decocms 4.573.0 → 4.574.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Cn7aLqGD.js → AlertCircle-Co3RPbIZ.js} +1 -1
- package/dist/client/assets/{AreaChart-CMeTgrZu.js → AreaChart-BvS2pAoE.js} +1 -1
- package/dist/client/assets/{ArrowLeft-Clex4DU3.js → ArrowLeft-XBSBGQal.js} +1 -1
- package/dist/client/assets/{ArrowUp-DPT2wlR7.js → ArrowUp-DLnkUu9S.js} +1 -1
- package/dist/client/assets/{CartesianChart-B2gOTKNo.js → CartesianChart-DOb1QHVF.js} +1 -1
- package/dist/client/assets/{CategoricalChart-Djc5Q1Zp.js → CategoricalChart-BkeCXQf9.js} +1 -1
- package/dist/client/assets/{CheckCircle-l0BgBdex.js → CheckCircle-kNwBDDVU.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BbXlLdNT.js → ChevronSelectorVertical-Gg7YcxlH.js} +1 -1
- package/dist/client/assets/{ChevronUp-D0xD4CWi.js → ChevronUp-D1T3kSyr.js} +1 -1
- package/dist/client/assets/{CreditCard01-CAgfpVLC.js → CreditCard01-D65BAIaV.js} +1 -1
- package/dist/client/assets/{Globe04-DFwi3CoQ.js → Globe04-D17A2x5l.js} +1 -1
- package/dist/client/assets/{Key01-q3498IuC.js → Key01-awxHKnoL.js} +1 -1
- package/dist/client/assets/{LinkBroken01-BkclpWPr.js → LinkBroken01-loTkm0G5.js} +1 -1
- package/dist/client/assets/{Minus-D2H1757g.js → Minus-CYrsmoRb.js} +1 -1
- package/dist/client/assets/{Monitor01-pdAw5Hpb.js → Monitor01-DalIAdj7.js} +1 -1
- package/dist/client/assets/{Play-mj0Zbxy1.js → Play-C6Weq-wk.js} +1 -1
- package/dist/client/assets/{Plus-DD-WVS1P.js → Plus-D7X8Q2-q.js} +1 -1
- package/dist/client/assets/{ReferenceLine-obrmbgU1.js → ReferenceLine-HGyXAqMo.js} +1 -1
- package/dist/client/assets/{SearchMd-D2GFNI7a.js → SearchMd-e6xPeRPD.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-BQMf6OTu.js → ShoppingBag01-zloi0TDl.js} +1 -1
- package/dist/client/assets/{Sun-BWeGTNdA.js → Sun-C1lyqton.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-amrllZXH.js → SwitchHorizontal01-elXb4-4d.js} +1 -1
- package/dist/client/assets/{Tool01-CMaWHp8E.js → Tool01-Bo2g-Ylw.js} +1 -1
- package/dist/client/assets/{Tooltip-DFEqzaZu.js → Tooltip-C2g-R1Ae.js} +1 -1
- package/dist/client/assets/{Trash01-CrG-kC_D.js → Trash01-C-PU5Hm-.js} +1 -1
- package/dist/client/assets/{Upload01-CyQARd6T.js → Upload01-NPnXKs-J.js} +1 -1
- package/dist/client/assets/{UserSquare-CPjVW48L.js → UserSquare-Qd-FKVqK.js} +1 -1
- package/dist/client/assets/{Users01-BPY3vewQ.js → Users01-CTNixqdX.js} +1 -1
- package/dist/client/assets/{XClose-BBI2UlVL.js → XClose-BuJ6u6eL.js} +1 -1
- package/dist/client/assets/{Zap-B1DyovfK.js → Zap-pmN7zSOE.js} +1 -1
- package/dist/client/assets/{access-gate-ZWgi9qYj.js → access-gate-Bj4L1Bay.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BQNXbA5n.js → add-connection-dialog-BL3Uj9Py.js} +1 -1
- package/dist/client/assets/agent-app-C3J9IT10.js +1 -0
- package/dist/client/assets/agent-assets-CvnH7aBA.js +1 -0
- package/dist/client/assets/{agent-automation-CU9zTpQA.js → agent-automation-Bea1eB6T.js} +2 -2
- package/dist/client/assets/agent-automations-R-Eaz2To.js +1 -0
- package/dist/client/assets/agent-calendar-Cd8km6Ln.js +1 -0
- package/dist/client/assets/{agent-capabilities-C8QrjnQn.js → agent-capabilities-BGShibnD.js} +1 -1
- package/dist/client/assets/agent-connect-sources-BrM4y83H.js +1 -0
- package/dist/client/assets/agent-deck-DRKoTD-S.js +1 -0
- package/dist/client/assets/agent-e2e-BuKHozb1.js +1 -0
- package/dist/client/assets/agent-experiments-CgtwbbvZ.js +1 -0
- package/dist/client/assets/agent-file-wlYMcv_9.js +1 -0
- package/dist/client/assets/agent-hosting-BaITgwKU.js +1 -0
- package/dist/client/assets/{agent-icon-2MzErGc_.js → agent-icon-CTbTFMnU.js} +1 -1
- package/dist/client/assets/agent-library-CC7Sh_px.js +1 -0
- package/dist/client/assets/agent-library-file-DB9_i_YI.js +1 -0
- package/dist/client/assets/agent-overview-BkJ7Az2Q.js +1 -0
- package/dist/client/assets/agent-releases-Dh0xH2nd.js +2 -0
- package/dist/client/assets/agent-settings-B8F88lFa.js +1 -0
- package/dist/client/assets/{agent-site-editor-BpKx1qkb.js → agent-site-editor-D_QBdAc9.js} +2 -2
- package/dist/client/assets/agent-site-editor-code-TQZ-nnUV.js +2 -0
- package/dist/client/assets/agent-site-editor-content-CAE4z8AF.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-gLgYeQTA.js +1 -0
- package/dist/client/assets/{agent-view-guard-4G3ZLLJ6.js → agent-view-guard-CL3qLzE2.js} +1 -1
- package/dist/client/assets/agent-view-mJs78en_.js +1 -0
- package/dist/client/assets/{ai-providers-uRKTNSKv.js → ai-providers-CKuZmBiu.js} +1 -1
- package/dist/client/assets/{alert-DEZDXwhI.js → alert-wYcDlQSf.js} +1 -1
- package/dist/client/assets/{analytics-sections-CyCVHqsU.js → analytics-sections-BjzpdbBT.js} +1 -1
- package/dist/client/assets/api-keys-BtDMAyj2.js +1 -0
- package/dist/client/assets/{api-keys-DpXs9tft.js → api-keys-am7hNPgd.js} +1 -1
- package/dist/client/assets/app-editor-D88RxUP1.js +1 -0
- package/dist/client/assets/{asset-utils-CksrawxC.js → asset-utils-C5mv1eiH.js} +1 -1
- package/dist/client/assets/{auth-Zsy5lyIS.js → auth-CQxDIkM-.js} +1 -1
- package/dist/client/assets/{auth-catchall-BA7Y2mUQ.js → auth-catchall-DX0dhfK_.js} +1 -1
- package/dist/client/assets/{auth-entry-DTgpDRCa.js → auth-entry-Bkznmv5L.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DnneloZ-.js → auth-split-layout-BRZioxOZ.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DNTXHLOn.js → authenticate-and-persist-oauth-o7XKLq_6.js} +1 -1
- package/dist/client/assets/{automation-list-row-DBYEb7yh.js → automation-list-row-knBDKeRb.js} +1 -1
- package/dist/client/assets/{automation-runs-WkjLeJLn.js → automation-runs-CvC4BqLv.js} +1 -1
- package/dist/client/assets/{automations-DQbfRFSm.js → automations-Ajx2woko.js} +1 -1
- package/dist/client/assets/{autosend-C5Y0g7p2.js → autosend-B0POegpm.js} +1 -1
- package/dist/client/assets/{badge-CR0zmQ24.js → badge-BpzeYR5Z.js} +1 -1
- package/dist/client/assets/{block-document-C3eGsk46.js → block-document-DIhkVhEf.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-BSZxdExq.js → blocks-preview-workspace-context-BnkXYZX_.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-WlRP2osS.js → blocks-tab-states-BRjgrPty.js} +1 -1
- package/dist/client/assets/{blog-schema-KDZONLbr.js → blog-schema-BdMdKJFM.js} +1 -1
- package/dist/client/assets/{buckets-BleX9NUY.js → buckets-C62arTZK.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-BoBB4xB3.js → build-improve-prompt-doc-DNVGwsoG.js} +1 -1
- package/dist/client/assets/{calendar-BK-qPKHr.js → calendar-SB5YBzj8.js} +1 -1
- package/dist/client/assets/{capability-load-error-C9JRNP4k.js → capability-load-error-BkOUGX51.js} +1 -1
- package/dist/client/assets/category-editor-CozNeVRI.js +1 -0
- package/dist/client/assets/{chart-C9hiF3-H.js → chart-D-gatwT8.js} +1 -1
- package/dist/client/assets/{chat-context-DyGpAf46.js → chat-context-PvP_Q1CV.js} +6 -6
- package/dist/client/assets/{chat-draft-CD_ST5_c.js → chat-draft-C714j1Wd.js} +1 -1
- package/dist/client/assets/{checkbox-HvlgUNAP.js → checkbox-Bk98t4UK.js} +1 -1
- package/dist/client/assets/{choose-editor-CnjAnqj_.js → choose-editor-DmqmkbHo.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Bwy0nso2.js → cli-auth-success-D4NODEkN.js} +1 -1
- package/dist/client/assets/{client-icons-Be9kjZ93.js → client-icons-WHlOXnmn.js} +1 -1
- package/dist/client/assets/cms-settings-editor-kiB9O6al.js +1 -0
- package/dist/client/assets/{cms-store-drafts-BISchbEr.js → cms-store-drafts-DEGbfccc.js} +1 -1
- package/dist/client/assets/collapsible-C7N88_dp.js +1 -0
- package/dist/client/assets/collection-detail-a6oC0bB8.js +1 -0
- package/dist/client/assets/{collection-display-button-ES-6OdCv.js → collection-display-button-Dl9vfdLR.js} +1 -1
- package/dist/client/assets/{collection-search-EpeR-DRK.js → collection-search-Din8SB5Y.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-KbLz2yHx.js → collection-table-wrapper-BYDcFi4z.js} +1 -1
- package/dist/client/assets/{collection-tabs-B_be-L9Y.js → collection-tabs-BJDa_4_F.js} +1 -1
- package/dist/client/assets/{combobox-B18VgXI1.js → combobox-CVchGkTE.js} +1 -1
- package/dist/client/assets/{command-BNUAVYAm.js → command-DA2t4jTW.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-CxXAX0y8.js → companion-mcps-section-BKP3xr1j.js} +1 -1
- package/dist/client/assets/{config-TryZ4RX0.js → config-B1mE6oOL.js} +1 -1
- package/dist/client/assets/{connect-CoilE_s4.js → connect-CAAYdS8d.js} +2 -2
- package/dist/client/assets/{connect-layout-BhfEVfq1.js → connect-layout-DUesEwTl.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-DPKdRpQi.js → connect-source-dialog-DQtWLoYH.js} +1 -1
- package/dist/client/assets/{connection-card-CNcOtDo-.js → connection-card-CPhS4jEh.js} +1 -1
- package/dist/client/assets/{connection-detail-DxRuUlKe.js → connection-detail-D0-sYPQS.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-UVT13B_U.js → connection-form-helpers-CRMRmqMW.js} +1 -1
- package/dist/client/assets/{connection-8A6_dw75.js → connection-giFDA0-u.js} +1 -1
- package/dist/client/assets/{connection-slug-C2s7RBeT.js → connection-slug-DTdYIX0A.js} +1 -1
- package/dist/client/assets/{connections-tE6aWKQG.js → connections-D-1tH9cf.js} +1 -1
- package/dist/client/assets/{content-tab-qUSnNt0b.js → content-tab-DH5bq_bz.js} +3 -3
- package/dist/client/assets/context-DK_qXRQL.js +1 -0
- package/dist/client/assets/{context-menu-DtOAkxnl.js → context-menu-CsBFFEsr.js} +1 -1
- package/dist/client/assets/{context-shell-ClsbZC3c.js → context-shell-l0daBgQ1.js} +3 -3
- package/dist/client/assets/{core.esm-rLLWAwJX.js → core.esm-tIHbtjKb.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BX56eATK.js → create-organization-dialog-Dy6I2vcX.js} +1 -1
- package/dist/client/assets/{device-hint-CUm6BAQf.js → device-hint-DslC2w9a.js} +1 -1
- package/dist/client/assets/discover-DzzEIO43.js +1 -0
- package/dist/client/assets/{domain-settings-CKu_dJSz.js → domain-settings-Dq_m7HYl.js} +1 -1
- package/dist/client/assets/{drawer-Cn25WPda.js → drawer-BYGTIOoj.js} +1 -1
- package/dist/client/assets/{editor-classes-fUC3onT7.js → editor-classes-LFKjNX_0.js} +1 -1
- package/dist/client/assets/{editor-D2cdCxzq.js → editor-x1lgFdfy.js} +1 -1
- package/dist/client/assets/{empty-state-Ced795Fu.js → empty-state-CH3GYanB.js} +1 -1
- package/dist/client/assets/{empty-state-BBHWcru0.js → empty-state-CtwVPMDf.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-BTxa6G1X.js → experiments-tab-choice-DMVM7f3S.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DPARA3fa.js → extract-connection-data-hvaA6rrK.js} +1 -1
- package/dist/client/assets/{feature-gate-DmEXSzsv.js → feature-gate-ru6FBLZU.js} +1 -1
- package/dist/client/assets/{feature-paywall-CnmlocfU.js → feature-paywall-eifo7eqe.js} +1 -1
- package/dist/client/assets/file-explorer-Bgho9rLt.js +2 -0
- package/dist/client/assets/{file-preview-DDtKFulA.js → file-preview-BzUEEwEK.js} +1 -1
- package/dist/client/assets/{file-share-button-z-0u2RSG.js → file-share-button-CFBrVPAQ.js} +1 -1
- package/dist/client/assets/{file-type-icon-DKzfESDS.js → file-type-icon-DM9o0Fkb.js} +1 -1
- package/dist/client/assets/{folder-icon-D5X4rDtM.js → folder-icon-DSGoR_x6.js} +1 -1
- package/dist/client/assets/{form-DlOI0nvB.js → form-gd_hA5VT.js} +1 -1
- package/dist/client/assets/{general-BaTc6G8G.js → general-Cn8XvemK.js} +1 -1
- package/dist/client/assets/{github-icon-Fl1CK57w.js → github-icon-BVy-v7gH.js} +1 -1
- package/dist/client/assets/home-C9onXt5U.js +1 -0
- package/dist/client/assets/{home-overview-BFMTQOYy.js → home-overview-DZBjDQoG.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-DlXpLWPa.js → hosted-reconcile-DNkBVm-1.js} +1 -1
- package/dist/client/assets/{icon-button-igm3gACH.js → icon-button-Ze0c1pwp.js} +1 -1
- package/dist/client/assets/{index-B9BVHbVj.js → index-B-T__H4R.js} +1 -1
- package/dist/client/assets/{index-BvVW5l1B.js → index-Bbmo8mh-.js} +1 -1
- package/dist/client/assets/{index-CZHAvvQX.js → index-Bgxp_wDH.js} +1 -1
- package/dist/client/assets/index-BkJtJQz4.css +1 -0
- package/dist/client/assets/{index-DWwfYL9X.js → index-C3XZ4Hr3.js} +2 -2
- package/dist/client/assets/{index-BiDkG-fY.js → index-CQQpem-0.js} +1 -1
- package/dist/client/assets/{index-BqYmVY5c.js → index-CnOVjrIG.js} +1 -1
- package/dist/client/assets/{index-D13d0Rz8.js → index-D5i1_B2b.js} +1 -1
- package/dist/client/assets/{index-BvIbbFRO.js → index-D8y5KFA4.js} +1 -1
- package/dist/client/assets/index-DB454549.js +1 -0
- package/dist/client/assets/{index-B0M6fld0.js → index-DEZ1imMJ.js} +41 -41
- package/dist/client/assets/{index-woHs2Bei.js → index-DYgzDE_k.js} +1 -1
- package/dist/client/assets/{index-qF2eIicz.js → index-DkhsKOTp.js} +1 -1
- package/dist/client/assets/{index-BjDHxKQ1.js → index-DsbWutG1.js} +1 -1
- package/dist/client/assets/{index-RvC7A_Zr.js → index-Kbjjvu85.js} +1 -1
- package/dist/client/assets/{index-BK7RpYPl.js → index-_l1iac4T.js} +1 -1
- package/dist/client/assets/{index-bp35vkxQ.js → index-i75UpmlW.js} +1 -1
- package/dist/client/assets/{index-redirect-Y2-2LqtJ.js → index-redirect-BbZ_bzp6.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CQdhIsL1.js → infiniteQueryObserver-C0Gb02df.js} +1 -1
- package/dist/client/assets/{infra-billing-D0aBn-2W.js → infra-billing-BCVZN9OG.js} +1 -1
- package/dist/client/assets/{input-WEG44w8N.js → input-CxHdmxHa.js} +1 -1
- package/dist/client/assets/{input-DPyEB9OP.js → input-Dla4T1vA.js} +4 -4
- package/dist/client/assets/{integration-icon-CbGo7Hoi.js → integration-icon-CFHOt7sY.js} +1 -1
- package/dist/client/assets/{jira-icon-C8Fhxneh.js → jira-icon-_AEc9Yhw.js} +1 -1
- package/dist/client/assets/{label-C2-_lSSQ.js → label-BEWDSeNl.js} +1 -1
- package/dist/client/assets/{layout-B7jJw3TW.js → layout--y8zVnrP.js} +1 -1
- package/dist/client/assets/legacy-admin-welcome-dialog-B223MrIf.js +1 -0
- package/dist/client/assets/{legacy-agents-deep-ZncRE9wV.js → legacy-agents-deep-PO1FuZ04.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BU-BNhBf.js → legacy-main-redirect-CLP7AoCb.js} +1 -1
- package/dist/client/assets/library-Cx1S-GVi.js +1 -0
- package/dist/client/assets/{library-tab-KFeYjSPq.js → library-tab-CqMcp5u0.js} +1 -1
- package/dist/client/assets/login-BuRZE0OR.js +1 -0
- package/dist/client/assets/{markdown-CBPGMAeL.js → markdown-Db8a3LUX.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-Ct_65kSq.js → mcp-app-renderer-C8G6NLBz.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BRzA5Pv_.js → mcp-oauth-BBT3ip6Z.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BzDrrJmr.js → mcp-oauth-CHmbtYyN.js} +1 -1
- package/dist/client/assets/{members-DmQ1d6J9.js → members-CF1S2ayK.js} +1 -1
- package/dist/client/assets/{memory-veer-4dg.js → memory-Bk61fr1m.js} +2 -2
- package/dist/client/assets/{mock-board-CKa4hpGl.js → mock-board-CYJBKLD5.js} +3 -3
- package/dist/client/assets/{monaco-editor-CpFV1RfN.js → monaco-editor-DTwBEUg_.js} +1 -1
- package/dist/client/assets/{monitoring-CBecEU71.js → monitoring-Cqe9DCsk.js} +2 -2
- package/dist/client/assets/{monitoring-stats-row-Dn8Q55tj.js → monitoring-stats-row-GkTmJnnE.js} +1 -1
- package/dist/client/assets/{multi-select-CrGD5Ooc.js → multi-select-GRYee_BH.js} +1 -1
- package/dist/client/assets/{mustache-CfZeeK0-.js → mustache-DtDLolVD.js} +1 -1
- package/dist/client/assets/{named-rule-view-DCoLjOb_.js → named-rule-view-BNwXQD8T.js} +1 -1
- package/dist/client/assets/{new-project-dialog-xaa497EH.js → new-project-dialog-Dfe2Pik9.js} +1 -1
- package/dist/client/assets/{oauth-callback-BZYuOZDS.js → oauth-callback-C9LKZChW.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-ht2kAjnJ.js → oauth-callback-ai-provider-C7LWQiJX.js} +1 -1
- package/dist/client/assets/{oauth-consent-Cycay5jx.js → oauth-consent-Dm4zOEtc.js} +1 -1
- package/dist/client/assets/{onboarding-CW6ecLdB.js → onboarding-xP-6CuuS.js} +1 -1
- package/dist/client/assets/{openai-conversation-BIBsPprq.js → openai-conversation-BH1GqT3q.js} +2 -2
- package/dist/client/assets/{optimistic-project-sidebar-views-ClxmmxQQ.js → optimistic-project-sidebar-views-BcV4r24I.js} +1 -1
- package/dist/client/assets/{order-monitor-day-ujguBEEi.js → order-monitor-day-BrCrwZlv.js} +1 -1
- package/dist/client/assets/{organization-choice-Dmg8UAst.js → organization-choice-Bb3OozNa.js} +1 -1
- package/dist/client/assets/{orgs-DwXxjD5w.js → orgs-BwWx4Gpo.js} +1 -1
- package/dist/client/assets/{own-accounts-section-B1_zf8oO.js → own-accounts-section-CL57nUX5.js} +1 -1
- package/dist/client/assets/{pair-CYQ33Koe.js → pair-D5JEvK2M.js} +7 -7
- package/dist/client/assets/{parse-sections-D19DrjFN.js → parse-sections-Ca4qHQSq.js} +3 -3
- package/dist/client/assets/{plan-ladder-DMGBEO8S.js → plan-ladder-DdqVPKf9.js} +1 -1
- package/dist/client/assets/plan-q4Vm_z4g.js +1 -0
- package/dist/client/assets/{plan-usage-card-Dh5aZ9Wu.js → plan-usage-card-397aTXRB.js} +2 -2
- package/dist/client/assets/{popover-CQC-Pea_.js → popover-DsvzKyw_.js} +1 -1
- package/dist/client/assets/post-calendar-CvHtHQHg.js +1 -0
- package/dist/client/assets/{post-editor-Bi0Lvuv1.js → post-editor-0bthmrQK.js} +2 -2
- package/dist/client/assets/{preview-content-DmNC5FDZ.js → preview-content-Bs_qZ8yA.js} +1 -1
- package/dist/client/assets/{preview-dialog-BXuQsxvP.js → preview-dialog-Bn3JJkpc.js} +1 -1
- package/dist/client/assets/{preview-panel-BvPhN_GC.js → preview-panel-CX3l3cru.js} +1 -1
- package/dist/client/assets/{preview-tab-kdq5fsPz.js → preview-tab-C506bsNP.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-BMl-NFfE.js → product-picker-dialog-DRJETx9Q.js} +1 -1
- package/dist/client/assets/{profile-CHLa-N2x.js → profile-BlRaDfot.js} +1 -1
- package/dist/client/assets/project-app-view-CKUZlcwf.js +1 -0
- package/dist/client/assets/{project-apps-DLoX3eK_.js → project-apps-B_xWF85u.js} +1 -1
- package/dist/client/assets/{project-icon-BFEgPANo.js → project-icon-rrJh6PJx.js} +1 -1
- package/dist/client/assets/{project-index-Bt04pJyj.js → project-index-CoA3rtsT.js} +1 -1
- package/dist/client/assets/project-reports-bT7h-_SM.js +1 -0
- package/dist/client/assets/project-tasks-CqL0-1p3.js +1 -0
- package/dist/client/assets/{projects-DBgcy_ko.js → projects-CM1tg94T.js} +1 -1
- package/dist/client/assets/{projects-empty-state-DSl1yjrE.js → projects-empty-state-llpcLXG9.js} +1 -1
- package/dist/client/assets/{prompts-DLHllT_u.js → prompts-B0OAMamK.js} +1 -1
- package/dist/client/assets/record-editor-fYL_geiT.js +1 -0
- package/dist/client/assets/redirect-editor-CqeB0Mu0.js +1 -0
- package/dist/client/assets/reports-CtLMPNBD.js +1 -0
- package/dist/client/assets/{reports-BLJvZSDk.js → reports-Rgui-AzR.js} +1 -1
- package/dist/client/assets/{reports-onboarding-B_ps3py4.js → reports-onboarding-Bb3vI6W8.js} +1 -1
- package/dist/client/assets/reports-tab-BaN84XaS.js +2 -0
- package/dist/client/assets/repositories-DR2_ORl-.js +1 -0
- package/dist/client/assets/{repositories-Bvm6e85d.js → repositories-OwZ7bC1j.js} +1 -1
- package/dist/client/assets/{repository-binding-D5Bfxppj.js → repository-binding-C0msapZZ.js} +1 -1
- package/dist/client/assets/{repository-picker-BG4RNPTd.js → repository-picker-BYFeDBpn.js} +1 -1
- package/dist/client/assets/{require-capability-DRWZ_9vY.js → require-capability-cQiPB2TO.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BDLyo6_T.js → required-auth-layout-DfUx9vzb.js} +1 -1
- package/dist/client/assets/{reset-password-DaveZxAM.js → reset-password-CwNbLDfo.js} +1 -1
- package/dist/client/assets/{resizable-ZTEIsDw7.js → resizable-CHI5UJHW.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-bd7hcPCn.js → resolve-tab-icon-BWeUUKzK.js} +1 -1
- package/dist/client/assets/review-settings-DUhDHWEg.js +1 -0
- package/dist/client/assets/{role-color-BoSKmMc3.js → role-color-DlPdNUQM.js} +1 -1
- package/dist/client/assets/{roles-ll9CMZdV.js → roles-ChXNdo9W.js} +1 -1
- package/dist/client/assets/route-8zXp8Zmg.js +1 -0
- package/dist/client/assets/route-DW6RzQLd.js +1 -0
- package/dist/client/assets/route-oGUs3Dt9.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context--ksv8XqS.js → sandbox-lifecycle-context-WXIR2CMZ.js} +1 -1
- package/dist/client/assets/{schema-DDAhL9Cr.js → schema-9jBUPMLq.js} +1 -1
- package/dist/client/assets/{schema-BObR_fJ_.js → schema-BFmIytlm.js} +1 -1
- package/dist/client/assets/{scroll-area-CYr4aRZr.js → scroll-area-CQ_g6hBm.js} +1 -1
- package/dist/client/assets/search-input-Co3g-t6C.js +1 -0
- package/dist/client/assets/{search-toggle-OJssd2AY.js → search-toggle-CO5TN956.js} +1 -1
- package/dist/client/assets/{secret-picker-wjLxUG7e.js → secret-picker-VlsiGxPi.js} +1 -1
- package/dist/client/assets/{secrets-BYPmdyMN.js → secrets-DJboETC0.js} +1 -1
- package/dist/client/assets/{section-array-field-DZEuNEZT.js → section-array-field-CvmfLv3q.js} +1 -1
- package/dist/client/assets/{sections-BDGuApqp.js → sections-C_Jmzzpn.js} +1 -1
- package/dist/client/assets/sections-editor-D1U5_lZq.js +1 -0
- package/dist/client/assets/{select-taudESnf.js → select-BJaUvbIR.js} +1 -1
- package/dist/client/assets/{select-model-JxuGnGfN.js → select-model-CftP-ks_.js} +1 -1
- package/dist/client/assets/{seo-editor-D7qUpqtC.js → seo-editor-B6UrHPko.js} +1 -1
- package/dist/client/assets/{separator-rYurNu9w.js → separator-BXKmXRi8.js} +1 -1
- package/dist/client/assets/settings-tab-CHBeACws.js +1 -0
- package/dist/client/assets/{sheet-C5Vpqn4B.js → sheet-D2hfPw7P.js} +1 -1
- package/dist/client/assets/shell-layout-BLRNx2fV.js +1 -0
- package/dist/client/assets/{site-draft-actions-I-a6sWGq.js → site-draft-actions-5nXph2SS.js} +1 -1
- package/dist/client/assets/{site-draft-view-B9eorarP.js → site-draft-view-3CfqUHrV.js} +1 -1
- package/dist/client/assets/site-editor-BqlLTFw0.js +1 -0
- package/dist/client/assets/{site-editor-toast-BkfBkyel.js → site-editor-toast-Cgezu0A5.js} +1 -1
- package/dist/client/assets/skills-B_05tfLr.js +1 -0
- package/dist/client/assets/{slider-Va2dwWaV.js → slider-C6h9g0cI.js} +1 -1
- package/dist/client/assets/{sortable.esm-BmFrP3rv.js → sortable.esm-D2_ALuVf.js} +1 -1
- package/dist/client/assets/{sso-BZP02FnS.js → sso-CtTl7KnN.js} +1 -1
- package/dist/client/assets/{suggestion-CJnvcEOz.js → suggestion-C8VoNVDk.js} +2 -2
- package/dist/client/assets/{super-agent-icon-BpFks7bc.js → super-agent-icon-B-73GF60.js} +1 -1
- package/dist/client/assets/{switch-NBzUnGw4.js → switch-C53DVv3y.js} +1 -1
- package/dist/client/assets/{synced-repos-x20dApIj.js → synced-repos-Cqz-evGv.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-De_GoXbo.js → tab-icon-glyph-I3aa1qRZ.js} +1 -1
- package/dist/client/assets/{table-B6HdX-5W.js → table-DjgVXWdP.js} +1 -1
- package/dist/client/assets/{tabs-B9Fkm8UP.js → tabs-DtOFAaIp.js} +1 -1
- package/dist/client/assets/{task-board-r7mBQBfA.js → task-board-D3wT6_aG.js} +1 -1
- package/dist/client/assets/{task-route-DzXY9dAT.js → task-route-DngvTiyh.js} +1 -1
- package/dist/client/assets/{task-status-nf4sWabv.js → task-status-BfFZ6nf8.js} +1 -1
- package/dist/client/assets/taskboard-analytics-D-vAg9Px.js +1 -0
- package/dist/client/assets/{tasks-DiiwePJH.js → tasks-BHa2qCWg.js} +3 -3
- package/dist/client/assets/tasks-adXvugV8.js +1 -0
- package/dist/client/assets/{textarea-8xMov02r.js → textarea-_jcGqOvl.js} +1 -1
- package/dist/client/assets/thread-analytics-DPDga_ap.js +1 -0
- package/dist/client/assets/{thread-intent-B-lUepd6.js → thread-intent-DuI80508.js} +1 -1
- package/dist/client/assets/{thread-route-CidpLna8.js → thread-route-B-uAlF3E.js} +1 -1
- package/dist/client/assets/{thread-route-BHZi-1Lx.js → thread-route-Ci8rIker.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-CJ90Ecr4.js → thread-sheet-body-BiNfUUQ_.js} +1 -1
- package/dist/client/assets/{time-range-picker-Bf3LTcPm.js → time-range-picker-F9SEOG2b.js} +1 -1
- package/dist/client/assets/{toggle-group-GmYScomU.js → toggle-group-C6oiEKlf.js} +1 -1
- package/dist/client/assets/{tool-namespace-BMJphfly.js → tool-namespace-DdU5nhii.js} +1 -1
- package/dist/client/assets/{tool-set-selector-ORY0JK_a.js → tool-set-selector-2nfgy8us.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DLb2L87M.js → toolbar-icon-button-BmJKmAUK.js} +1 -1
- package/dist/client/assets/{tooltip-DUgZeaAs.js → tooltip-Dam-ym8O.js} +1 -1
- package/dist/client/assets/{tooltipContext-DhhamGUz.js → tooltipContext-PzKiic-J.js} +1 -1
- package/dist/client/assets/{track-CDDSJk6a.js → track-Dj7QHX2C.js} +1 -1
- package/dist/client/assets/{types-D5f5_4KC.js → types-gyofjZHf.js} +6 -6
- package/dist/client/assets/{url-slug-BgFXpKTa.js → url-slug-BMHzx0XY.js} +1 -1
- package/dist/client/assets/{usage-stats-Db2409wH.js → usage-stats-C3KvQP9T.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CegsSqNf.js → use-ai-providers-DwpUgHpj.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-CoAQZSng.js → use-apply-named-rule-BnEs0jP7.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-BIANNd7Z.js +1 -0
- package/dist/client/assets/{use-automations-IINULJEn.js → use-automations-CyrAu8XA.js} +1 -1
- package/dist/client/assets/{use-autosave-B28tAi82.js → use-autosave-TV-hF63e.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-4PZwWSEO.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-SKM2dTYC.js → use-chat-layout-state-BG2-xqQp.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-D7FBZjX-.js → use-cms-publish-actions-CmQuU9AY.js} +5 -5
- package/dist/client/assets/{use-connect-companion-aYlKXW1g.js → use-connect-companion-CowVgnp9.js} +1 -1
- package/dist/client/assets/use-connection-BozgIoMu.js +1 -0
- package/dist/client/assets/{use-content-sync-Wt7A-cqi.js → use-content-sync-BBbOIir0.js} +1 -1
- package/dist/client/assets/{use-copy-jRaPRTwC.js → use-copy-o0P-kroy.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-C5zF4lje.js → use-date-fns-locale-bKU2Q73X.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DI_mWee1.js → use-debounced-autosave-BmvZzlB_.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Df5Y0bKp.js → use-debounced-value-yZdJ1f2K.js} +1 -1
- package/dist/client/assets/{use-deco-credits-IyUHS95H.js → use-deco-credits-Bjfx0bAt.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CVaB2Rhy.js → use-decopilot-events-C_C16-Ln.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DrZnUntQ.js → use-delete-connection-B4rX1qgg.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CoSxtFqU.js → use-deployment-admin-CS9K9Ea9.js} +1 -1
- package/dist/client/assets/{use-entitlements-n2MsZM9p.js → use-entitlements-DidlVdLU.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-otug38hg.js → use-fast-preview-draft-url-KJzyk03O.js} +1 -1
- package/dist/client/assets/{use-file-configs-BvpMQAvp.js → use-file-configs-DhXDYO83.js} +1 -1
- package/dist/client/assets/{use-id-selection-DlXip3K9.js → use-id-selection-BHXFVfAt.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-CVBam4xO.js → use-inbox-feed-CKkWXum7.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-qE2UPD2B.js → use-infinite-scroll-CED9GMTE.js} +1 -1
- package/dist/client/assets/{use-join-requests-Dmu4TFw2.js → use-join-requests-DAuosANz.js} +1 -1
- package/dist/client/assets/use-main-panel-tabs-DfOwinBC.js +1 -0
- package/dist/client/assets/{use-mcp-auth-status-CdzqA_1C.js → use-mcp-auth-status-Dls0bLQE.js} +1 -1
- package/dist/client/assets/{use-mcp-client-C8sFqQYs.js → use-mcp-client-DJjkIlNp.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-KGxEzqRw.js → use-mcp-prompts-it9pO2QZ.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DMaf2rKI.js → use-mcp-tools-wfurU0oX.js} +1 -1
- package/dist/client/assets/{use-mobile-JxzmRS3O.js → use-mobile-CJITN8uI.js} +1 -1
- package/dist/client/assets/{use-move-blocks-B66Z69SN.js → use-move-blocks-CC1C41-K.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BPUG-DwT.js → use-navigate-to-agent-MlXDIBYX.js} +1 -1
- package/dist/client/assets/{use-org-fs-BTZCBdxy.js → use-org-fs-BH012Up0.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CBRIaGB1.js → use-org-repo-syncs-jV2kVf-q.js} +1 -1
- package/dist/client/assets/{use-org-sso-CxdxMmbI.js → use-org-sso-Bo72RJ5p.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DgPYo7py.js → use-organization-settings-bWX185lw.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-DltS_Jdi.js → use-project-native-view-presence-DhhbOsoh.js} +1 -1
- package/dist/client/assets/use-project-scope-pwqcjGo8.js +1 -0
- package/dist/client/assets/{use-recent-apps-DCrhrE1r.js → use-recent-apps-Rr1jTj-T.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-BMotCZC_.js → use-reports-diagnostic-0n4ScjpC.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-CPma0JnN.js → use-sandbox-events-D1_GHzsF.js} +1 -1
- package/dist/client/assets/{use-secrets-U7VdTPCn.js → use-secrets-Dim43C3b.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CVV-8YE0.js → use-section-preview-base-B6FS0lTt.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-D8frxAVL.js → use-sidebar-collapsed-DcAIYhdp.js} +1 -1
- package/dist/client/assets/{use-tags-zNsAvyT2.js → use-tags-6ljf50Kl.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-CE11Vums.js → use-task-board-analytics-5XuzJjLw.js} +1 -1
- package/dist/client/assets/{use-task-board-events-WJfNx3Vw.js → use-task-board-events-DnEp5edD.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-BkBj5QMy.js → use-task-board-item-prs-CycVEDhs.js} +1 -1
- package/dist/client/assets/{use-task-board-items-CmUbMz1G.js → use-task-board-items-pvi4Vcv1.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-Dsyp8Uoc.js → use-task-board-prompts-CE5ytMaB.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DRP-RY0l.js → use-task-metadata-D4kXdUwO.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-BOXdgR_A.js → use-thread-outputs-BPYn8k3d.js} +1 -1
- package/dist/client/assets/{use-voice-input-CQSYzFMw.js → use-voice-input-BKZpbbiI.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CtNfxLxq.js +1 -0
- package/dist/client/assets/{useQueries-BpjN820-.js → useQueries-B3iHMIbL.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-OzDVxqdl.js +1 -0
- package/dist/client/assets/{users-DgPmfgcj.js → users-7Hqe-w13.js} +1 -1
- package/dist/client/assets/{utils-DwY9C3Mj.js → utils-BbEfYi1l.js} +1 -1
- package/dist/client/assets/{variant-calendar-ByGN-Vpc.js → variant-calendar-vayISj1w.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-CzeUMJ70.js → variant-matcher-override-ulDJ4YBu.js} +1 -1
- package/dist/client/assets/{view-header-JSqDfdkj.js → view-header-y27ISHbd.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CVLIL1Oq.js → virtual-mcp-vRvxAZ15.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-CwQVaju9.js → watch-sse-pool-DhoYakYc.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/client/legacy-admin-welcome.webp +0 -0
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-Bj3EYwlx.js +0 -1
- package/dist/client/assets/agent-assets-DI6qPyKd.js +0 -1
- package/dist/client/assets/agent-automations---UAtRbI.js +0 -1
- package/dist/client/assets/agent-calendar-cf-gDNxH.js +0 -1
- package/dist/client/assets/agent-connect-sources-DWV9WSKP.js +0 -1
- package/dist/client/assets/agent-deck-D0lCoowF.js +0 -1
- package/dist/client/assets/agent-e2e-BOiuADaK.js +0 -1
- package/dist/client/assets/agent-experiments-BMv9LCIg.js +0 -1
- package/dist/client/assets/agent-file-CNp-H5vm.js +0 -1
- package/dist/client/assets/agent-hosting-C-EBAKmR.js +0 -1
- package/dist/client/assets/agent-library-file-Agr0p3aP.js +0 -1
- package/dist/client/assets/agent-library-slTipnE2.js +0 -1
- package/dist/client/assets/agent-overview-BS9_YnvP.js +0 -1
- package/dist/client/assets/agent-releases-KTwDvjK6.js +0 -2
- package/dist/client/assets/agent-settings-DrVJjCl1.js +0 -1
- package/dist/client/assets/agent-site-editor-code-1vmtmGbS.js +0 -2
- package/dist/client/assets/agent-site-editor-content-DLlGzEUS.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-Qe8DbwSs.js +0 -1
- package/dist/client/assets/agent-view-B8yeRN99.js +0 -1
- package/dist/client/assets/api-keys-CqXC8hcJ.js +0 -1
- package/dist/client/assets/app-editor-BaI-amod.js +0 -1
- package/dist/client/assets/category-editor-CcG8-9VQ.js +0 -1
- package/dist/client/assets/cms-settings-editor-BrJarYyE.js +0 -1
- package/dist/client/assets/collapsible-f_iRDMCl.js +0 -1
- package/dist/client/assets/collection-detail-C3I3Gpfg.js +0 -1
- package/dist/client/assets/context-5V6pbdZV.js +0 -1
- package/dist/client/assets/discover-C3KntGhQ.js +0 -1
- package/dist/client/assets/file-explorer-BQ3nHrzo.js +0 -2
- package/dist/client/assets/home-_5AX_rte.js +0 -1
- package/dist/client/assets/index-K-NS4tm_.css +0 -1
- package/dist/client/assets/index-cB2W9GP1.js +0 -1
- package/dist/client/assets/library-2jjA6huk.js +0 -1
- package/dist/client/assets/login-CYw53vfL.js +0 -1
- package/dist/client/assets/plan-C3-HdCti.js +0 -1
- package/dist/client/assets/post-calendar-DyAhp07d.js +0 -1
- package/dist/client/assets/project-app-view--F2yE3h6.js +0 -1
- package/dist/client/assets/project-reports-CQX2n1pZ.js +0 -1
- package/dist/client/assets/project-tasks-BxS2RWnj.js +0 -1
- package/dist/client/assets/record-editor-DSuyBQvO.js +0 -1
- package/dist/client/assets/redirect-editor-Dg4EE9RJ.js +0 -1
- package/dist/client/assets/reports-DfhDFmgz.js +0 -1
- package/dist/client/assets/reports-tab-NBJtBy1O.js +0 -2
- package/dist/client/assets/repositories-Cdm1E3kt.js +0 -1
- package/dist/client/assets/review-settings-DWBDMXEy.js +0 -1
- package/dist/client/assets/route-CARtHArs.js +0 -1
- package/dist/client/assets/route-CE2T-4lr.js +0 -1
- package/dist/client/assets/route-apqFkN8H.js +0 -1
- package/dist/client/assets/search-input-CEHMJvIu.js +0 -1
- package/dist/client/assets/sections-editor-w8bIFtKt.js +0 -1
- package/dist/client/assets/settings-tab-BjoW2SLa.js +0 -1
- package/dist/client/assets/shell-layout-B_Je98M9.js +0 -1
- package/dist/client/assets/site-editor-A0UTz4FO.js +0 -1
- package/dist/client/assets/skills-DFP73eqq.js +0 -1
- package/dist/client/assets/taskboard-analytics-sh1MutiR.js +0 -1
- package/dist/client/assets/tasks-CDaME30v.js +0 -1
- package/dist/client/assets/thread-analytics-CI4Ww-tz.js +0 -1
- package/dist/client/assets/use-ask-in-chat-D8s6kqgy.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-390kM-ss.js +0 -1
- package/dist/client/assets/use-connection-BLq1Zghk.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-CmG1gXaL.js +0 -1
- package/dist/client/assets/use-project-scope-BLJIcw6l.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CrPhADUx.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B5oEM_Vd.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{gQ as Ae,gR as Ze,hm as xn,hn as ks,c as U,b as Z,r as H,j as t,B as ee,h as nt,m as ve,_ as Ms,X as _s,Z as Vs,Y as Je,ap as Gt,an as qt,ao as Ht,t as le,R as Xe,a5 as Ee,a6 as Ts,ho as gn,v as it,D as at,y as $t,L as At,I as Ne,F as vn,ai as bn,ah as jn,g4 as $e,as as Ds,g3 as Me,gO as Oe,ak as ft,d as pt,i as Ps,K as Et,hp as yn,hq as wn,hr as Sn,$ as Ct,c7 as be,hs as we,n as Ke,P as Nn,u as Cn,bx as lt,q as Ft,e as Os,fN as kn,ac as Mn,x as ht,aT as Is,w as xt,av as _n,da as Vn,E as _e,bB as Tn,a as Dn,ht as zt,hu as Pn,b3 as On,ag as In,aE as $n,aD as An,by as En,a8 as Fn,hl as zn,aN as Rn,aM as Ln,aJ as Un,aH as Bn,aI as Yn,aL as Wn,aK as Kn,bj as Gn,aS as qn}from"./index-B0M6fld0.js";import{g as Hn}from"./extract-connection-data-DPARA3fa.js";import{b as Qn}from"./chat-context-DyGpAf46.js";import{U as Xn,b as Jn}from"./build-improve-prompt-doc-BoBB4xB3.js";import{E as Zn}from"./empty-state-BBHWcru0.js";import{g as ei}from"./shell-layout-B_Je98M9.js";import{g as gt,n as ti,a as Qt,e as si,u as ni,f as ii}from"./use-date-fns-locale-C5zF4lje.js";import{a as ai}from"./mcp-oauth-BzDrrJmr.js";import{T as ut}from"./textarea-8xMov02r.js";import{c as Ve,T as Te,a as De}from"./tooltip-DUgZeaAs.js";import{a as Rt,b as $s,u as li}from"./use-connection-BLq1Zghk.js";import{u as As,g as Es,c as ri,i as oi}from"./repository-binding-D5Bfxppj.js";import{i as Xt}from"./mcp-oauth-BRzA5Pv_.js";import{bs as ci,m as Fs,bt as di,bu as ui,aW as mi,aB as fi,aF as pi,bv as hi,bw as zs,bx as Rs,by as xi,an as gi,bz as vi,bA as kt,bB as Jt,A as Zt,L as bi,bC as ji,bD as yi,h as Ls,D as es,k as wi,j as Si,az as Ni,n as Ci,v as ki,u as Mi,r as _i,q as Vi,g as Us,e as vt,aR as Ti,ab as Di,O as Pi}from"./agent-icon-2MzErGc_.js";import{s as ze}from"./Plus-DD-WVS1P.js";import{t as dt,a as Oi,b as Ii}from"./Tool01-CMaWHp8E.js";import{s as bt}from"./Trash01-CrG-kC_D.js";import{u as ts}from"./use-debounced-autosave-DI_mWee1.js";import{A as $i}from"./add-connection-dialog-BQNXbA5n.js";import{i as Dt}from"./SearchMd-D2GFNI7a.js";import{F as ss}from"./file-type-icon-DKzfESDS.js";import{k as Ai,l as Ei,p as Fi,q as zi}from"./use-org-fs-BTZCBdxy.js";import{C as Ri}from"./collection-tabs-B_be-L9Y.js";import{T as Bs,u as Ys}from"./use-mcp-auth-status-CdzqA_1C.js";import{I as jt}from"./integration-icon-CbGo7Hoi.js";import{C as Li}from"./checkbox-HvlgUNAP.js";import{u as yt}from"./use-mcp-client-C8sFqQYs.js";import{a as Ws}from"./use-mcp-tools-DMaf2rKI.js";import{u as Ui}from"./use-mcp-prompts-KGxEzqRw.js";import{g as Bi}from"./connection-slug-C2s7RBeT.js";import{c as Pe,b as Re,a as Le,d as Ue,S as Be}from"./select-taudESnf.js";import{s as Ks}from"./XClose-BBI2UlVL.js";import{t as Pt}from"./utils-CVEq3hMx.js";import{S as rt}from"./switch-NBzUnGw4.js";import{a as Gs,b as qs,P as Hs}from"./popover-CQC-Pea_.js";import{S as Yi}from"./scroll-area-CYr4aRZr.js";import{i as Wi}from"./Upload01-CyQARd6T.js";import{a as Ki}from"./SwitchHorizontal01-amrllZXH.js";import{i as Gi}from"./Monitor01-pdAw5Hpb.js";import{g as qi}from"./types-D5f5_4KC.js";import{a as Qs,c as Hi}from"./agent-capabilities-C8QrjnQn.js";import{a as Qi}from"./autosend-C5Y0g7p2.js";import{u as Xi,g as Ot,o as ns,r as It,p as Ji,h as Zi,a as ea,i as is,t as ta,j as sa,k as na,b as ia}from"./use-project-native-view-presence-DltS_Jdi.js";import{a as Xs,u as aa,i as la,o as ra,r as as,p as oa,w as ca,b as ls}from"./optimistic-project-sidebar-views-ClxmmxQQ.js";import{a as da,P as ua,i as ma}from"./sections-BDGuApqp.js";import{i as Lt}from"./Key01-q3498IuC.js";import{u as fa}from"./use-copy-jRaPRTwC.js";import{L as Se}from"./label-C2-_lSSQ.js";import{h as pa}from"./roles-DW32thi2.js";import{b as ha,u as xa}from"./use-blocks-v8-project-390kM-ss.js";import{s as Js,l as ga,v as Zs,r as va}from"./thread-intent-B-lUepd6.js";import{V as ba,E as wt,R as rs,r as en,C as ja,w as ya}from"./virtual-mcp-CVLIL1Oq.js";import{b as wa,a as Sa,D as Na}from"./drawer-Cn25WPda.js";import{u as Ca}from"./use-mobile-JxzmRS3O.js";import{d as St}from"./delay-CnY5UFtP.js";import{b as ka}from"./sandbox-url-D3mC8qhT.js";import{S as Ma,a as _a,b as Va}from"./secret-picker-wjLxUG7e.js";import{u as Ta,a as Da}from"./use-secrets-U7VdTPCn.js";import{o as os}from"./omit-server-managed-metadata-L5IhjRZB.js";import{G as Pa}from"./github-icon-Fl1CK57w.js";import{R as Oa}from"./repository-picker-BG4RNPTd.js";import{n as cs}from"./app-preview-url-9Od4s8Sz.js";import{a as Ia}from"./use-organization-settings-DgPYo7py.js";import{r as $a}from"./serial-task-queue-CGOeQgpr.js";function st(a,e){const s=gt(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,i=Ae(a,e?.in),l=i.getDay(),d=(l<n?7:0)+l-n;return i.setDate(i.getDate()-d),i.setHours(0,0,0,0),i}function mt(a,e){return st(a,{...e,weekStartsOn:1})}function tn(a,e){const s=Ae(a,e?.in),n=s.getFullYear(),i=Ze(s,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const l=mt(i),d=Ze(s,0);d.setFullYear(n,0,4),d.setHours(0,0,0,0);const r=mt(d);return s.getTime()>=l.getTime()?n+1:s.getTime()>=r.getTime()?n:n-1}function ds(a,e){const s=Ae(a,e?.in);return s.setHours(0,0,0,0),s}function Aa(a,e,s){const[n,i]=ti(s?.in,a,e),l=ds(n),d=ds(i),r=+l-Qt(l),f=+d-Qt(d);return Math.round((r-f)/xn)}function Ea(a,e){const s=tn(a,e),n=Ze(a,0);return n.setFullYear(s,0,4),n.setHours(0,0,0,0),mt(n)}function Fa(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function za(a){return!(!Fa(a)&&typeof a!="number"||isNaN(+Ae(a)))}function Ra(a,e){const s=Ae(a,e?.in);return s.setFullYear(s.getFullYear(),0,1),s.setHours(0,0,0,0),s}function La(a,e){const s=Ae(a,e?.in);return Aa(s,Ra(s))+1}function Ua(a,e){const s=Ae(a,e?.in),n=+mt(s)-+Ea(s);return Math.round(n/ks)+1}function sn(a,e){const s=Ae(a,e?.in),n=s.getFullYear(),i=gt(),l=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,d=Ze(e?.in||a,0);d.setFullYear(n+1,0,l),d.setHours(0,0,0,0);const r=st(d,e),f=Ze(e?.in||a,0);f.setFullYear(n,0,l),f.setHours(0,0,0,0);const o=st(f,e);return+s>=+r?n+1:+s>=+o?n:n-1}function Ba(a,e){const s=gt(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,i=sn(a,e),l=Ze(e?.in||a,0);return l.setFullYear(i,0,n),l.setHours(0,0,0,0),st(l,e)}function Ya(a,e){const s=Ae(a,e?.in),n=+st(s,e)-+Ba(s,e);return Math.round(n/ks)+1}function re(a,e){const s=a<0?"-":"",n=Math.abs(a).toString().padStart(e,"0");return s+n}const Fe={y(a,e){const s=a.getFullYear(),n=s>0?s:1-s;return re(e==="yy"?n%100:n,e.length)},M(a,e){const s=a.getMonth();return e==="M"?String(s+1):re(s+1,2)},d(a,e){return re(a.getDate(),e.length)},a(a,e){const s=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];default:return s==="am"?"a.m.":"p.m."}},h(a,e){return re(a.getHours()%12||12,e.length)},H(a,e){return re(a.getHours(),e.length)},m(a,e){return re(a.getMinutes(),e.length)},s(a,e){return re(a.getSeconds(),e.length)},S(a,e){const s=e.length,n=a.getMilliseconds(),i=Math.trunc(n*Math.pow(10,s-3));return re(i,e.length)}},Qe={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},us={G:function(a,e,s){const n=a.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return s.era(n,{width:"abbreviated"});case"GGGGG":return s.era(n,{width:"narrow"});default:return s.era(n,{width:"wide"})}},y:function(a,e,s){if(e==="yo"){const n=a.getFullYear(),i=n>0?n:1-n;return s.ordinalNumber(i,{unit:"year"})}return Fe.y(a,e)},Y:function(a,e,s,n){const i=sn(a,n),l=i>0?i:1-i;if(e==="YY"){const d=l%100;return re(d,2)}return e==="Yo"?s.ordinalNumber(l,{unit:"year"}):re(l,e.length)},R:function(a,e){const s=tn(a);return re(s,e.length)},u:function(a,e){const s=a.getFullYear();return re(s,e.length)},Q:function(a,e,s){const n=Math.ceil((a.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return re(n,2);case"Qo":return s.ordinalNumber(n,{unit:"quarter"});case"QQQ":return s.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(n,{width:"narrow",context:"formatting"});default:return s.quarter(n,{width:"wide",context:"formatting"})}},q:function(a,e,s){const n=Math.ceil((a.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return re(n,2);case"qo":return s.ordinalNumber(n,{unit:"quarter"});case"qqq":return s.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(n,{width:"narrow",context:"standalone"});default:return s.quarter(n,{width:"wide",context:"standalone"})}},M:function(a,e,s){const n=a.getMonth();switch(e){case"M":case"MM":return Fe.M(a,e);case"Mo":return s.ordinalNumber(n+1,{unit:"month"});case"MMM":return s.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(n,{width:"narrow",context:"formatting"});default:return s.month(n,{width:"wide",context:"formatting"})}},L:function(a,e,s){const n=a.getMonth();switch(e){case"L":return String(n+1);case"LL":return re(n+1,2);case"Lo":return s.ordinalNumber(n+1,{unit:"month"});case"LLL":return s.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(n,{width:"narrow",context:"standalone"});default:return s.month(n,{width:"wide",context:"standalone"})}},w:function(a,e,s,n){const i=Ya(a,n);return e==="wo"?s.ordinalNumber(i,{unit:"week"}):re(i,e.length)},I:function(a,e,s){const n=Ua(a);return e==="Io"?s.ordinalNumber(n,{unit:"week"}):re(n,e.length)},d:function(a,e,s){return e==="do"?s.ordinalNumber(a.getDate(),{unit:"date"}):Fe.d(a,e)},D:function(a,e,s){const n=La(a);return e==="Do"?s.ordinalNumber(n,{unit:"dayOfYear"}):re(n,e.length)},E:function(a,e,s){const n=a.getDay();switch(e){case"E":case"EE":case"EEE":return s.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},e:function(a,e,s,n){const i=a.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(l);case"ee":return re(l,2);case"eo":return s.ordinalNumber(l,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(a,e,s,n){const i=a.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(l);case"cc":return re(l,e.length);case"co":return s.ordinalNumber(l,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(a,e,s){const n=a.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return re(i,e.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},a:function(a,e,s){const i=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(a,e,s){const n=a.getHours();let i;switch(n===12?i=Qe.noon:n===0?i=Qe.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(a,e,s){const n=a.getHours();let i;switch(n>=17?i=Qe.evening:n>=12?i=Qe.afternoon:n>=4?i=Qe.morning:i=Qe.night,e){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(a,e,s){if(e==="ho"){let n=a.getHours()%12;return n===0&&(n=12),s.ordinalNumber(n,{unit:"hour"})}return Fe.h(a,e)},H:function(a,e,s){return e==="Ho"?s.ordinalNumber(a.getHours(),{unit:"hour"}):Fe.H(a,e)},K:function(a,e,s){const n=a.getHours()%12;return e==="Ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},k:function(a,e,s){let n=a.getHours();return n===0&&(n=24),e==="ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},m:function(a,e,s){return e==="mo"?s.ordinalNumber(a.getMinutes(),{unit:"minute"}):Fe.m(a,e)},s:function(a,e,s){return e==="so"?s.ordinalNumber(a.getSeconds(),{unit:"second"}):Fe.s(a,e)},S:function(a,e){return Fe.S(a,e)},X:function(a,e,s){const n=a.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return fs(n);case"XXXX":case"XX":return We(n);default:return We(n,":")}},x:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"x":return fs(n);case"xxxx":case"xx":return We(n);default:return We(n,":")}},O:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ms(n,":");default:return"GMT"+We(n,":")}},z:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ms(n,":");default:return"GMT"+We(n,":")}},t:function(a,e,s){const n=Math.trunc(+a/1e3);return re(n,e.length)},T:function(a,e,s){return re(+a,e.length)}};function ms(a,e=""){const s=a>0?"-":"+",n=Math.abs(a),i=Math.trunc(n/60),l=n%60;return l===0?s+String(i):s+String(i)+e+re(l,2)}function fs(a,e){return a%60===0?(a>0?"-":"+")+re(Math.abs(a)/60,2):We(a,e)}function We(a,e=""){const s=a>0?"-":"+",n=Math.abs(a),i=re(Math.trunc(n/60),2),l=re(n%60,2);return s+i+e+l}const ps=(a,e)=>{switch(a){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},nn=(a,e)=>{switch(a){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Wa=(a,e)=>{const s=a.match(/(P+)(p+)?/)||[],n=s[1],i=s[2];if(!i)return ps(a,e);let l;switch(n){case"P":l=e.dateTime({width:"short"});break;case"PP":l=e.dateTime({width:"medium"});break;case"PPP":l=e.dateTime({width:"long"});break;default:l=e.dateTime({width:"full"});break}return l.replace("{{date}}",ps(n,e)).replace("{{time}}",nn(i,e))},Ka={p:nn,P:Wa},Ga=/^D+$/,qa=/^Y+$/,Ha=["D","DD","YY","YYYY"];function Qa(a){return Ga.test(a)}function Xa(a){return qa.test(a)}function Ja(a,e,s){const n=Za(a,e,s);if(console.warn(n),Ha.includes(a))throw new RangeError(n)}function Za(a,e,s){const n=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${e}\`) for formatting ${n} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const el=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,tl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sl=/^'([^]*?)'?$/,nl=/''/g,il=/[a-zA-Z]/;function al(a,e,s){const n=gt(),i=s?.locale??n.locale??si,l=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,d=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Ae(a,s?.in);if(!za(r))throw new RangeError("Invalid time value");let f=e.match(tl).map(p=>{const u=p[0];if(u==="p"||u==="P"){const m=Ka[u];return m(p,i.formatLong)}return p}).join("").match(el).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const u=p[0];if(u==="'")return{isToken:!1,value:ll(p)};if(us[u])return{isToken:!0,value:p};if(u.match(il))throw new RangeError("Format string contains an unescaped latin alphabet character `"+u+"`");return{isToken:!1,value:p}});i.localize.preprocessor&&(f=i.localize.preprocessor(r,f));const o={firstWeekContainsDate:l,weekStartsOn:d,locale:i};return f.map(p=>{if(!p.isToken)return p.value;const u=p.value;(!s?.useAdditionalWeekYearTokens&&Xa(u)||!s?.useAdditionalDayOfYearTokens&&Qa(u))&&Ja(u,e,String(a));const m=us[u[0]];return m(r,u,i.localize,o)}).join("")}function ll(a){const e=a.match(sl);return e?e[1].replace(nl,"'"):a}const an=25*1024*1024,Mt="home",_t="knowledge";function hs(a){return a==null?"":a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(0)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`}function Ye(a){return a.split("/").pop()??a}function rl(a){const e=U.c(64),{form:s}=a,n=Z(),{upload:i}=Ai(Mt),l=Ei(),d=H.useRef(null),[r,f]=H.useState(!1),[o,p]=H.useState(""),[u,m]=H.useState(!1);let h;e[0]!==r?(h={enabled:r},e[0]=r,e[1]=h):h=e[1];const{data:c}=Fi(60,h),x=c===void 0?[]:c;let g;e[2]!==r?(g={enabled:r},e[2]=r,e[3]=g):g=e[3];const{data:v}=zi(g),j=v===void 0?[]:v;let y;e[4]!==s?(y=()=>s.getValues("metadata.knowledge")??[],e[4]=s,e[5]=y):y=e[5];const[b,w]=H.useState(y);let S;e[6]!==s?(S=O=>{w(O),s.setValue("metadata.knowledge",O,{shouldDirty:!0})},e[6]=s,e[7]=S):S=e[7];const N=S;let C;e[8]!==l||e[9]!==b||e[10]!==N||e[11]!==n||e[12]!==i?(C=async O=>{if(!O||O.length===0)return;const J=Array.from(O),ye=J.filter(pl),pe=J.filter(fl);if(pe.length>0&&le.warning(n("virtualMcp.filesSection.fileTooLargeTitle"),{description:n("virtualMcp.filesSection.fileTooLargeDescription",{names:pe.map(ml).join(", ")})}),ye.length!==0){try{await i.mutateAsync({dir:_t,files:ye})}catch(D){const oe=D;le.error(oe instanceof Error?oe.message:n("virtualMcp.filesSection.failedUploadFile"));return}N([...b,...ye.map(D=>({id:crypto.randomUUID(),name:D.name,volume:Mt,path:`${_t}/${D.name}`,url:l(Mt,`${_t}/${D.name}`),contentType:D.type||null,size:D.size,addedAt:new Date().toISOString()}))])}},e[8]=l,e[9]=b,e[10]=N,e[11]=n,e[12]=i,e[13]=C):C=e[13];const M=C;let T;e[14]!==l||e[15]!==b||e[16]!==N?(T=O=>{b.some(J=>J.volume===O.volume&&J.path===O.path)||(N([...b,{id:crypto.randomUUID(),name:Ye(O.path),volume:O.volume,path:O.path,url:l(O.volume,O.path),contentType:null,size:O.size??null,addedAt:new Date().toISOString()}]),f(!1))},e[14]=l,e[15]=b,e[16]=N,e[17]=T):T=e[17];const V=T;let _;e[18]!==l||e[19]!==b||e[20]!==N?(_=O=>{b.some(J=>J.volume===O.volume&&J.path===O.path)||(N([...b,{id:crypto.randomUUID(),name:Ye(O.path),kind:"skill",volume:O.volume,path:O.path,url:l(O.volume,O.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),f(!1))},e[18]=l,e[19]=b,e[20]=N,e[21]=_):_=e[21];const E=_;let P;e[22]!==b||e[23]!==N?(P=O=>{N(b.filter(J=>J.id!==O))},e[22]=b,e[23]=N,e[24]=P):P=e[24];const A=P;let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=O=>{f(O),O&&p("")},e[25]=I):I=e[25];const K=I;let Q;e[26]!==b?(Q=new Set(b.map(ul)),e[26]=b,e[27]=Q):Q=e[27];const R=Q,F=o.toLowerCase();let Y;e[28]!==R?(Y=O=>!R.has(`${O.volume}/${O.path}`),e[28]=R,e[29]=Y):Y=e[29];const z=x.filter(dl).filter(Y).filter(O=>Ye(O.path).toLowerCase().includes(F)).slice(0,5);let L;e[30]!==R?(L=O=>!R.has(`${O.volume}/${O.path}`),e[30]=R,e[31]=L):L=e[31];const W=j.filter(L).filter(O=>Ye(O.path).toLowerCase().includes(F)).slice(0,5),G=O=>t.jsxs(Ms,{open:r,onOpenChange:K,children:[t.jsx(_s,{asChild:!0,children:O}),t.jsxs(Vs,{align:"end",className:"w-56",children:[t.jsxs(Je,{onSelect:()=>{d.current?.click()},children:[t.jsx(ci,{size:16}),n("virtualMcp.filesSection.uploadFile")]}),t.jsxs(Gt,{children:[t.jsxs(qt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(Fs,{size:16}),n("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(Ht,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Dt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:J=>p(J.target.value),onKeyDown:cl,placeholder:n("virtualMcp.filesSection.searchFilesPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:z.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noFilesFound")}):z.map(J=>t.jsxs(Je,{onSelect:()=>V(J),children:[t.jsx(ss,{filename:Ye(J.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ye(J.path)}),J.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:hs(J.size)})]},`${J.volume}/${J.path}`))})]})]}),t.jsxs(Gt,{children:[t.jsxs(qt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(dt,{size:16}),n("virtualMcp.filesSection.selectSkill")]}),t.jsxs(Ht,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Dt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:J=>p(J.target.value),onKeyDown:ol,placeholder:n("virtualMcp.filesSection.searchSkillsPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:W.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noSkillsFound")}):W.map(J=>t.jsxs(Je,{onSelect:()=>E(J),children:[t.jsx(dt,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ye(J.path)})]},`${J.volume}/${J.path}`))})]})]})]})]}),se="flex flex-col gap-3";let te;e[32]!==n?(te=n("virtualMcp.filesSection.filesAndSkills"),e[32]=n,e[33]=te):te=e[33];let k;e[34]!==te?(k=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:te}),e[34]=te,e[35]=k):k=e[35];let $;e[36]!==n?($=n("virtualMcp.filesSection.description"),e[36]=n,e[37]=$):$=e[37];let q;e[38]!==$?(q=t.jsx("p",{className:"text-sm text-muted-foreground",children:$}),e[38]=$,e[39]=q):q=e[39];let B;e[40]!==k||e[41]!==q?(B=t.jsxs("div",{className:"flex flex-col gap-1",children:[k,q]}),e[40]=k,e[41]=q,e[42]=B):B=e[42];const X=b.length>0&&G(t.jsxs(ee,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(nt,{size:"xs"}):t.jsx(ze,{size:14}),n("virtualMcp.filesSection.add")]}));let ae;e[43]!==B||e[44]!==X?(ae=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[B,X]}),e[43]=B,e[44]=X,e[45]=ae):ae=e[45];let je;e[46]!==M?(je=t.jsx("input",{ref:d,type:"file",multiple:!0,className:"hidden",onChange:O=>{M(O.target.files),O.target.value=""}}),e[46]=M,e[47]=je):je=e[47];let ie,ce;e[48]===Symbol.for("react.memo_cache_sentinel")?(ie=O=>{O.preventDefault(),m(!0)},ce=()=>m(!1),e[48]=ie,e[49]=ce):(ie=e[48],ce=e[49]);let ue;e[50]!==M?(ue=O=>{O.preventDefault(),O.stopPropagation(),m(!1),M(O.dataTransfer.files)},e[50]=M,e[51]=ue):ue=e[51];const ge=u&&"outline outline-2 outline-dashed outline-primary";let de;e[52]!==ge?(de=ve("flex flex-col gap-2 rounded-lg",ge),e[52]=ge,e[53]=de):de=e[53];const he=b.length===0?G(t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(ze,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:n("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):b.map(O=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 surface",children:[O.kind==="skill"?t.jsx("div",{className:"flex items-center justify-center h-8 w-6.5 shrink-0 rounded-md bg-muted text-muted-foreground",children:t.jsx(dt,{size:16})}):t.jsx(ss,{filename:O.name,className:"h-8 w-6.5 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:O.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:O.kind==="skill"?n("virtualMcp.filesSection.kindSkill"):O.size!=null?hs(O.size):n("virtualMcp.filesSection.kindFile")})]}),t.jsx(ee,{variant:"ghost",size:"icon",onClick:()=>A(O.id),"aria-label":n("virtualMcp.filesSection.removeAriaLabel",{name:O.name}),children:t.jsx(bt,{size:16})})]},O.id));let me;e[54]!==ie||e[55]!==ce||e[56]!==ue||e[57]!==de||e[58]!==he?(me=t.jsx("div",{onDragOver:ie,onDragLeave:ce,onDrop:ue,className:de,children:he}),e[54]=ie,e[55]=ce,e[56]=ue,e[57]=de,e[58]=he,e[59]=me):me=e[59];let fe;return e[60]!==ae||e[61]!==je||e[62]!==me?(fe=t.jsxs("section",{className:se,children:[ae,je,me]}),e[60]=ae,e[61]=je,e[62]=me,e[63]=fe):fe=e[63],fe}function ol(a){return a.stopPropagation()}function cl(a){return a.stopPropagation()}function dl(a){return a.kind!=="dir"}function ul(a){return`${a.volume}/${a.path}`}function ml(a){return a.name}function fl(a){return a.size>an}function pl(a){return a.size<=an}function tt(){const a=U.c(1);let e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(nt,{className:"size-6 text-muted-foreground"})}),a[0]=e):e=a[0],e}function ct(a,e){return({error:s})=>s?.message?.includes("Method not found")||s?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:a})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(Ts,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:e("virtualMcp.dependencySelectionDialog.somethingWentWrong")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:s?.message?s.message.length>200?`${s.message.slice(0,200)}...`:s.message:e("virtualMcp.dependencySelectionDialog.unexpectedError")})]})]})}function ln(a){const e=U.c(23),{item:s,isSelected:n,onToggle:i,disabled:l}=a,d=l?"cursor-not-allowed opacity-50":"cursor-pointer",r=n?"bg-accent/25":"hover:bg-accent";let f;e[0]!==d||e[1]!==r?(f=ve("flex items-start gap-3 p-4 rounded-lg transition-colors",d,r),e[0]=d,e[1]=r,e[2]=f):f=e[2];let o;e[3]!==s.name?(o=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:s.name}),e[3]=s.name,e[4]=o):o=e[4];let p;e[5]!==s.tags?(p=s.tags&&t.jsx("span",{className:"shrink-0",children:s.tags}),e[5]=s.tags,e[6]=p):p=e[6];let u;e[7]!==o||e[8]!==p?(u=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o,p]}),e[7]=o,e[8]=p,e[9]=u):u=e[9];let m;e[10]!==s.description?(m=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[10]=s.description,e[11]=m):m=e[11];let h;e[12]!==u||e[13]!==m?(h=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[u,m]}),e[12]=u,e[13]=m,e[14]=h):h=e[14];let c;e[15]!==l||e[16]!==n||e[17]!==i?(c=t.jsx(Li,{checked:n,onCheckedChange:i,disabled:l,className:"mt-0.5"}),e[15]=l,e[16]=n,e[17]=i,e[18]=c):c=e[18];let x;return e[19]!==f||e[20]!==h||e[21]!==c?(x=t.jsxs("label",{className:f,children:[h,c]}),e[19]=f,e[20]=h,e[21]=c,e[22]=x):x=e[22],x}function hl(a){const e=U.c(35),{activeTab:s,onTabChange:n,showSelectAll:i,isAllSelected:l,handleSelectAll:d}=a,r=Z();let f;e[0]!==r?(f=r("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=r,e[1]=f):f=e[1];let o;e[2]!==f?(o={id:"tools",label:f},e[2]=f,e[3]=o):o=e[3];let p;e[4]!==r?(p=r("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=r,e[5]=p):p=e[5];let u;e[6]!==p?(u={id:"active",label:p},e[6]=p,e[7]=u):u=e[7];let m;e[8]!==r?(m=r("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=r,e[9]=m):m=e[9];let h;e[10]!==m?(h={id:"resources",label:m},e[10]=m,e[11]=h):h=e[11];let c;e[12]!==r?(c=r("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=r,e[13]=c):c=e[13];let x;e[14]!==c?(x={id:"prompts",label:c},e[14]=c,e[15]=x):x=e[15];let g;e[16]!==o||e[17]!==u||e[18]!==h||e[19]!==x?(g=[o,u,h,x],e[16]=o,e[17]=u,e[18]=h,e[19]=x,e[20]=g):g=e[20];let v;e[21]!==n?(v=w=>n(w),e[21]=n,e[22]=v):v=e[22];let j;e[23]!==s||e[24]!==v||e[25]!==g?(j=t.jsx(Ri,{tabs:g,activeTab:s,onTabChange:v}),e[23]=s,e[24]=v,e[25]=g,e[26]=j):j=e[26];let y;e[27]!==d||e[28]!==l||e[29]!==i||e[30]!==r?(y=i&&t.jsx("button",{type:"button",onClick:d,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r(l?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=d,e[28]=l,e[29]=i,e[30]=r,e[31]=y):y=e[31];let b;return e[32]!==j||e[33]!==y?(b=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border shrink-0",children:[j,y]}),e[32]=j,e[33]=y,e[34]=b):b=e[34],b}function Ut(a){const e=U.c(13),{items:s,selections:n,onToggle:i,emptyMessage:l,disabled:d}=a;let r,f,o;if(e[0]!==d||e[1]!==l||e[2]!==s||e[3]!==i||e[4]!==n){o=Symbol.for("react.early_return_sentinel");e:{const u=s.map(xl);if(s.length===0){let m;e[8]!==l?(m=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:l})}),e[8]=l,e[9]=m):m=e[9],o=m;break e}r="flex-1 overflow-auto px-4 py-3 space-y-1",f=s.map(m=>t.jsx(ln,{item:m,isSelected:n===null||n?.includes(m.id),onToggle:()=>i(m.id,u),disabled:d},m.id))}e[0]=d,e[1]=l,e[2]=s,e[3]=i,e[4]=n,e[5]=r,e[6]=f,e[7]=o}else r=e[5],f=e[6],o=e[7];if(o!==Symbol.for("react.early_return_sentinel"))return o;let p;return e[10]!==r||e[11]!==f?(p=t.jsx("div",{className:r,children:f}),e[10]=r,e[11]=f,e[12]=p):p=e[12],p}function xl(a){return a.id}function gl(a){const e=U.c(22),{connectionId:s,toolSelections:n,onToggleTool:i}=a,l=Z(),{org:d}=Ee();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const f=yt(r);let o;e[4]!==f?(o={client:f},e[4]=f,e[5]=o):o=e[5];const{data:p}=Ws(o),u=p.tools;let m,h,c;if(e[6]!==p.tools||e[7]!==i||e[8]!==l||e[9]!==n){c=Symbol.for("react.early_return_sentinel");e:{const g=u.map(bl);let v;e[13]!==n?(v=b=>n===null||n.includes(b.name),e[13]=n,e[14]=v):v=e[14];const y=p.tools.filter(v).map(vl);if(y.length===0){let b;e[15]!==l?(b=l("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=l,e[16]=b):b=e[16];let w;e[17]!==b?(w=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:b})}),e[17]=b,e[18]=w):w=e[18],c=w;break e}m="flex-1 overflow-auto px-4 py-3 space-y-1",h=y.map(b=>t.jsx(ln,{item:b,isSelected:!0,onToggle:()=>i(b.id,g)},b.id))}e[6]=p.tools,e[7]=i,e[8]=l,e[9]=n,e[10]=m,e[11]=h,e[12]=c}else m=e[10],h=e[11],c=e[12];if(c!==Symbol.for("react.early_return_sentinel"))return c;let x;return e[19]!==m||e[20]!==h?(x=t.jsx("div",{className:m,children:h}),e[19]=m,e[20]=h,e[21]=x):x=e[21],x}function vl(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Bs,{annotations:a.annotations,_meta:a._meta})}}function bl(a){return a.name}function jl(a){const e=U.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:d}=Ee();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const f=yt(r);let o;e[4]!==f?(o={client:f},e[4]=f,e[5]=o):o=e[5];const{data:p}=Ws(o);let u;e[6]!==p.tools?(u=p.tools.map(yl),e[6]=p.tools,e[7]=u):u=e[7];const m=u,h=Z();let c;e[8]!==h?(c=h("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=h,e[9]=c):c=e[9];let x;return e[10]!==l||e[11]!==m||e[12]!==i||e[13]!==n||e[14]!==c?(x=t.jsx(Ut,{items:m,selections:n,onToggle:i,emptyMessage:c,disabled:l}),e[10]=l,e[11]=m,e[12]=i,e[13]=n,e[14]=c,e[15]=x):x=e[15],x}function yl(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Bs,{annotations:a.annotations,_meta:a._meta})}}function wl(a){const e=U.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:d}=Ee();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const f=yt(r);let o;e[4]!==f?(o={client:f},e[4]=f,e[5]=o):o=e[5];const{data:p}=gn(o);let u;e[6]!==p.resources?(u=p.resources.map(Sl),e[6]=p.resources,e[7]=u):u=e[7];const m=u,h=Z();let c;e[8]!==h?(c=h("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=h,e[9]=c):c=e[9];let x;return e[10]!==l||e[11]!==m||e[12]!==i||e[13]!==n||e[14]!==c?(x=t.jsx(Ut,{items:m,selections:n,onToggle:i,emptyMessage:c,disabled:l}),e[10]=l,e[11]=m,e[12]=i,e[13]=n,e[14]=c,e[15]=x):x=e[15],x}function Sl(a){return{id:a.name||a.uri,name:a.name||a.uri,description:a.description}}function Nl(a){const e=U.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:d}=Ee();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const f=yt(r);let o;e[4]!==f?(o={client:f},e[4]=f,e[5]=o):o=e[5];const{data:p}=Ui(o);let u;e[6]!==p.prompts?(u=p.prompts.map(Cl),e[6]=p.prompts,e[7]=u):u=e[7];const m=u,h=Z();let c;e[8]!==h?(c=h("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=h,e[9]=c):c=e[9];let x;return e[10]!==l||e[11]!==m||e[12]!==i||e[13]!==n||e[14]!==c?(x=t.jsx(Ut,{items:m,selections:n,onToggle:i,emptyMessage:c,disabled:l}),e[10]=l,e[11]=m,e[12]=i,e[13]=n,e[14]=c,e[15]=x):x=e[15],x}function Cl(a){return{id:a.name,name:a.name,description:a.description}}function kl(a){const e=U.c(58),{currentConnection:s,activeTab:n,selectedId:i,formData:l,toggleTool:d,toggleResource:r,togglePrompt:f,toggleAllTools:o,toggleAllResources:p,toggleAllPrompts:u,onTabChange:m}=a,h=Z(),c=l[i],x=n==="tools"?c?.tools===null:n==="resources"?c?.resources===null:n==="prompts"?c?.prompts===null:!1,g=n!=="active";let v;e[0]!==n||e[1]!==i||e[2]!==u||e[3]!==p||e[4]!==o?(v=()=>{n==="tools"?o(i):n==="resources"?p(i):n==="prompts"&&u(i)},e[0]=n,e[1]=i,e[2]=u,e[3]=p,e[4]=o,e[5]=v):v=e[5];const j=v;let y;e[6]!==s.icon||e[7]!==s.title?(y=t.jsx(jt,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0"}),e[6]=s.icon,e[7]=s.title,e[8]=y):y=e[8];let b;e[9]!==s.title?(b=t.jsx("h2",{className:"text-base font-semibold truncate",children:s.title}),e[9]=s.title,e[10]=b):b=e[10];let w;e[11]!==s.description?(w=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[11]=s.description,e[12]=w):w=e[12];let S;e[13]!==b||e[14]!==w?(S=t.jsxs("div",{className:"flex-1 min-w-0",children:[b,w]}),e[13]=b,e[14]=w,e[15]=S):S=e[15];let N;e[16]!==y||e[17]!==S?(N=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[y,S]})}),e[16]=y,e[17]=S,e[18]=N):N=e[18];let C;e[19]!==n||e[20]!==j||e[21]!==x||e[22]!==m||e[23]!==g?(C=t.jsx(hl,{activeTab:n,onTabChange:m,showSelectAll:g,isAllSelected:x,handleSelectAll:j}),e[19]=n,e[20]=j,e[21]=x,e[22]=m,e[23]=g,e[24]=C):C=e[24];let M;e[25]!==n||e[26]!==l||e[27]!==i||e[28]!==h||e[29]!==d?(M=n==="active"&&t.jsx(Xe,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(tt,{}),children:t.jsx(gl,{connectionId:i,toolSelections:l[i]?l[i].tools:[],onToggleTool:(A,I)=>d(i,A,I)})})}),e[25]=n,e[26]=l,e[27]=i,e[28]=h,e[29]=d,e[30]=M):M=e[30];let T;e[31]!==n||e[32]!==l||e[33]!==i||e[34]!==h||e[35]!==d?(T=n==="tools"&&t.jsx(Xe,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(tt,{}),children:t.jsx(jl,{connectionId:i,selections:l[i]?l[i].tools:[],onToggle:(A,I)=>d(i,A,I)})})}),e[31]=n,e[32]=l,e[33]=i,e[34]=h,e[35]=d,e[36]=T):T=e[36];let V;e[37]!==n||e[38]!==l||e[39]!==i||e[40]!==h||e[41]!==r?(V=n==="resources"&&t.jsx(Xe,{fallback:ct(h("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(tt,{}),children:t.jsx(wl,{connectionId:i,selections:l[i]?l[i].resources:[],onToggle:(A,I)=>r(i,A,I)})})}),e[37]=n,e[38]=l,e[39]=i,e[40]=h,e[41]=r,e[42]=V):V=e[42];let _;e[43]!==n||e[44]!==l||e[45]!==i||e[46]!==h||e[47]!==f?(_=n==="prompts"&&t.jsx(Xe,{fallback:ct(h("virtualMcp.dependencySelectionDialog.promptsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(tt,{}),children:t.jsx(Nl,{connectionId:i,selections:l[i]?l[i].prompts:[],onToggle:(A,I)=>f(i,A,I)})})}),e[43]=n,e[44]=l,e[45]=i,e[46]=h,e[47]=f,e[48]=_):_=e[48];let E;e[49]!==V||e[50]!==_||e[51]!==M||e[52]!==T?(E=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[M,T,V,_]}),e[49]=V,e[50]=_,e[51]=M,e[52]=T,e[53]=E):E=e[53];let P;return e[54]!==E||e[55]!==N||e[56]!==C?(P=t.jsxs(t.Fragment,{children:[N,C,E]}),e[54]=E,e[55]=N,e[56]=C,e[57]=P):P=e[57],P}function Ml(a){const e=U.c(7),{onClose:s}=a,n=Z();let i;e[0]!==s?(i=()=>s(!1),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==n?(l=n("virtualMcp.dependencySelectionDialog.done"),e[2]=n,e[3]=l):l=e[3];let d;return e[4]!==i||e[5]!==l?(d=t.jsx($t,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(ee,{variant:"outline",onClick:i,children:l})}),e[4]=i,e[5]=l,e[6]=d):d=e[6],d}function _l(a){const e=U.c(23),{connectionId:s,onAuthenticate:n,children:i}=a,l=Z();let d;e[0]!==s?(d={connectionId:s},e[0]=s,e[1]=d):d=e[1];const r=Ys(d);if(r.supportsOAuth&&!r.isAuthenticated){let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-muted",children:t.jsx(di,{size:22,className:"text-muted-foreground"})}),e[2]=p):p=e[2];let u;e[3]!==l?(u=l("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=l,e[4]=u):u=e[4];let m;e[5]!==u?(m=t.jsx("p",{className:"text-sm font-medium",children:u}),e[5]=u,e[6]=m):m=e[6];let h;e[7]!==l?(h=l("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=l,e[8]=h):h=e[8];let c;e[9]!==h?(c=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:h}),e[9]=h,e[10]=c):c=e[10];let x;e[11]!==m||e[12]!==c?(x=t.jsxs("div",{className:"space-y-1",children:[m,c]}),e[11]=m,e[12]=c,e[13]=x):x=e[13];let g;e[14]!==s||e[15]!==n||e[16]!==l?(g=n&&t.jsx(ee,{variant:"outline",size:"sm",onClick:()=>n(s),children:l("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=s,e[15]=n,e[16]=l,e[17]=g):g=e[17];let v;return e[18]!==x||e[19]!==g?(v=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-8 text-center",children:[p,x,g]}),e[18]=x,e[19]=g,e[20]=v):v=e[20],v}let o;return e[21]!==i?(o=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=o):o=e[22],o}function Vl(a){const e={};for(const s of a)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function xs(a){return Object.entries(a).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function gs(a,e,s,n){const i=a[e]??{tools:null,resources:null,prompts:null};return{...a,[e]:{...i,[s]:n}}}function Tl(a,e){return e.type==="SET_ACTIVE_TAB"?{...a,activeTab:e.payload}:a}function Dl(a){const e=U.c(49),{open:s,onOpenChange:n,selectedId:i,form:l,connections:d,onAuthenticate:r}=a;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={activeTab:"tools"},e[0]=f):f=e[0];const[o,p]=H.useReducer(Tl,f),u=Rt(i??"");let m;e[1]!==d?(m=d??[],e[1]=d,e[2]=m):m=e[2];let h;e[3]!==m?(h=Vl(m),e[3]=m,e[4]=h):h=e[4];const c=h;let x;e[5]!==l||e[6]!==c?(x=(z,L,W,G)=>{const se=c[z]?.[L];let te;se===null?te=G.filter(k=>k!==W):se?.includes(W)?te=se.filter(k=>k!==W):(te=[...se??[],W],te.length===G.length&&(te=null)),l.setValue("connections",xs(gs(c,z,L,te)),{shouldDirty:!0,shouldTouch:!0})},e[5]=l,e[6]=c,e[7]=x):x=e[7];const g=x;let v;e[8]!==l||e[9]!==c?(v=(z,L)=>{const G=c[z]?.[L]===null?[]:null;l.setValue("connections",xs(gs(c,z,L,G)),{shouldDirty:!0,shouldTouch:!0})},e[8]=l,e[9]=c,e[10]=v):v=e[10];const j=v;let y;e[11]!==g?(y=(z,L,W)=>g(z,"tools",L,W),e[11]=g,e[12]=y):y=e[12];const b=y;let w;e[13]!==g?(w=(z,L,W)=>g(z,"resources",L,W),e[13]=g,e[14]=w):w=e[14];const S=w;let N;e[15]!==g?(N=(z,L,W)=>g(z,"prompts",L,W),e[15]=g,e[16]=N):N=e[16];const C=N;let M;e[17]!==j?(M=z=>j(z,"tools"),e[17]=j,e[18]=M):M=e[18];const T=M;let V;e[19]!==j?(V=z=>j(z,"resources"),e[19]=j,e[20]=V):V=e[20];const _=V;let E;e[21]!==j?(E=z=>j(z,"prompts"),e[21]=j,e[22]=E):E=e[22];const P=E;if(!i||!u)return null;let A;e[23]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(tt,{}),e[23]=A):A=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=z=>p({type:"SET_ACTIVE_TAB",payload:z}),e[24]=I):I=e[24];let K;e[25]!==u||e[26]!==o.activeTab||e[27]!==c||e[28]!==i||e[29]!==P||e[30]!==_||e[31]!==T||e[32]!==C||e[33]!==S||e[34]!==b?(K=t.jsx(kl,{currentConnection:u,activeTab:o.activeTab,selectedId:i,formData:c,toggleTool:b,toggleResource:S,togglePrompt:C,toggleAllTools:T,toggleAllResources:_,toggleAllPrompts:P,onTabChange:I},i),e[25]=u,e[26]=o.activeTab,e[27]=c,e[28]=i,e[29]=P,e[30]=_,e[31]=T,e[32]=C,e[33]=S,e[34]=b,e[35]=K):K=e[35];let Q;e[36]!==r||e[37]!==i||e[38]!==K?(Q=t.jsx(H.Suspense,{fallback:A,children:t.jsx(_l,{connectionId:i,onAuthenticate:r,children:K})}),e[36]=r,e[37]=i,e[38]=K,e[39]=Q):Q=e[39];let R;e[40]!==n?(R=t.jsx(Ml,{onClose:n}),e[40]=n,e[41]=R):R=e[41];let F;e[42]!==Q||e[43]!==R?(F=t.jsxs(it,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[Q,R]}),e[42]=Q,e[43]=R,e[44]=F):F=e[44];let Y;return e[45]!==n||e[46]!==s||e[47]!==F?(Y=t.jsx(at,{open:s,onOpenChange:n,children:F}),e[45]=n,e[46]=s,e[47]=F,e[48]=Y):Y=e[48],Y}const vs="__new_instance__";function Pl(a){const e=U.c(25),{connection_id:s,usedConnectionIds:n,onOpenSettings:i,onRemove:l,onAuthenticate:d,onSwitchInstance:r,onNewInstance:f}=a,o=Rt(s),{org:p}=Ee();if(!o){let g;return e[0]!==l?(g=t.jsx(Al,{onRemove:l}),e[0]=l,e[1]=g):g=e[1],g}let u;e[2]!==o?(u=Bi(o),e[2]=o,e[3]=u):u=e[3];const m=u;let h;e[4]!==s?(h=t.jsx($l,{connection_id:s}),e[4]=s,e[5]=h):h=e[5];let c;e[6]!==o.app_name||e[7]!==o.connection_type||e[8]!==o.description||e[9]!==o.icon||e[10]!==o.status||e[11]!==o.title||e[12]!==s||e[13]!==d||e[14]!==f||e[15]!==i||e[16]!==l||e[17]!==r||e[18]!==p.slug||e[19]!==m||e[20]!==n?(c=t.jsx(Il,{connection_id:s,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,connectionType:o.connection_type,connectionStatus:o.status,slug:m,orgSlug:p.slug,appName:o.app_name,usedConnectionIds:n,onOpenSettings:i,onRemove:l,onAuthenticate:d,onSwitchInstance:r,onNewInstance:f}),e[6]=o.app_name,e[7]=o.connection_type,e[8]=o.description,e[9]=o.icon,e[10]=o.status,e[11]=o.title,e[12]=s,e[13]=d,e[14]=f,e[15]=i,e[16]=l,e[17]=r,e[18]=p.slug,e[19]=m,e[20]=n,e[21]=c):c=e[21];let x;return e[22]!==h||e[23]!==c?(x=t.jsx(H.Suspense,{fallback:h,children:c}),e[22]=h,e[23]=c,e[24]=x):x=e[24],x}function Ol(a){const e=U.c(24),{appName:s,connectionId:n,usedConnectionIds:i,onSwitchInstance:l,onNewInstance:d}=a,r=Z();let f;e[0]!==s?(f={filters:[{column:"app_name",value:s}]},e[0]=s,e[1]=f):f=e[1];const o=li(f);if(o.length<=1&&!d)return null;let p;e[2]!==n||e[3]!==d||e[4]!==l?(p=g=>{g===vs?d?.():l(n,g)},e[2]=n,e[3]=d,e[4]=l,e[5]=p):p=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Re,{size:"xs",className:"w-auto gap-1 shadow-none",children:t.jsx(Le,{})}),e[6]=u):u=e[6];let m;if(e[7]!==n||e[8]!==o||e[9]!==i){let g;e[11]!==n||e[12]!==i?(g=v=>t.jsx(Pe,{value:v.id,className:"text-xs",disabled:v.id!==n&&i.has(v.id),children:v.title},v.id),e[11]=n,e[12]=i,e[13]=g):g=e[13],m=o.map(g),e[7]=n,e[8]=o,e[9]=i,e[10]=m}else m=e[10];let h;e[14]!==d||e[15]!==r?(h=d&&t.jsxs(Pe,{value:vs,className:"text-xs text-muted-foreground",children:["+ ",r("virtualMcp.connectionItem.newInstance")]}),e[14]=d,e[15]=r,e[16]=h):h=e[16];let c;e[17]!==m||e[18]!==h?(c=t.jsxs(Ue,{children:[m,h]}),e[17]=m,e[18]=h,e[19]=c):c=e[19];let x;return e[20]!==n||e[21]!==p||e[22]!==c?(x=t.jsxs(Be,{value:n,onValueChange:p,children:[u,c]}),e[20]=n,e[21]=p,e[22]=c,e[23]=x):x=e[23],x}function Il({connection_id:a,connectionTitle:e,connectionDescription:s,connectionIcon:n,connectionType:i,connectionStatus:l,slug:d,orgSlug:r,appName:f,usedConnectionIds:o,onOpenSettings:p,onRemove:u,onAuthenticate:m,onSwitchInstance:h,onNewInstance:c}){const x=Ys({connectionId:a}),g=$s(),j=!(i==="VIRTUAL")&&x.supportsOAuth&&!x.isAuthenticated,y=l!=="active",b=Z(),w=async S=>{try{await g.update.mutateAsync({id:a,data:{status:S}}),le.success(b(S==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{le.error(b("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:ve("surface overflow-hidden transition-colors",(j||y)&&"shadow-edge-destructive bg-destructive/5"),children:[t.jsxs(At,{to:"/$org/settings/connections/$appSlug",params:{org:r,appSlug:d},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-accent transition-colors",children:[t.jsx(jt,{icon:n,name:e,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:e}),j?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b("virtualMcp.connectionItem.needsAuthorization")}):y?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b(l==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):s&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s})]}),j?t.jsx(ee,{variant:"outline",size:"sm",className:"shrink-0",onClick:S=>{S.preventDefault(),S.stopPropagation(),m(a)},children:b("virtualMcp.connectionItem.authorize")}):y?t.jsxs(ee,{variant:"outline",size:"sm",className:"gap-1.5 shrink-0",onClick:S=>{S.preventDefault(),S.stopPropagation(),w("active")},children:[t.jsx(ui,{size:13}),b("virtualMcp.connectionItem.enable")]}):t.jsxs(Ve,{delayDuration:0,children:[t.jsx(Te,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center rounded-md h-7 w-7 hover:bg-accent text-muted-foreground shrink-0 transition-colors",children:t.jsx(Oi,{size:16})})}),t.jsx(De,{side:"bottom",children:b("virtualMcp.connectionItem.connectionSettings")})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-t border-border bg-muted/25",children:[f&&t.jsx(Ol,{appName:f,connectionId:a,usedConnectionIds:o,onSwitchInstance:h,onNewInstance:c}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(Ve,{delayDuration:0,children:[t.jsx(Te,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon-sm",onClick:p,"aria-label":b("virtualMcp.connectionItem.configureResources"),children:t.jsx(mi,{size:13})})}),t.jsx(De,{side:"bottom",children:b("virtualMcp.connectionItem.configureResources")})]}),!y&&t.jsxs(Ve,{delayDuration:0,children:[t.jsx(Te,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground",onClick:()=>w("inactive"),"aria-label":b("virtualMcp.connectionItem.disableConnection"),children:t.jsx(fi,{size:13})})}),t.jsx(De,{side:"bottom",children:b("virtualMcp.connectionItem.disable")})]}),t.jsxs(Ve,{delayDuration:0,children:[t.jsx(Te,{asChild:!0,children:t.jsx(ee,{variant:"ghost-destructive",size:"icon-sm",onClick:u,"aria-label":b("virtualMcp.connectionItem.removeConnection"),children:t.jsx(Ks,{size:13})})}),t.jsx(De,{side:"bottom",children:b("virtualMcp.connectionItem.remove")})]})]})]})]})}function $l(a){const e=U.c(17),{connection_id:s}=a,n=Rt(s);if(!n){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(rn,{}),e[0]=u):u=e[0],u}let i;e[1]!==n.icon||e[2]!==n.title?(i=t.jsx(jt,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0"}),e[1]=n.icon,e[2]=n.title,e[3]=i):i=e[3];let l;e[4]!==n.title?(l=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[4]=n.title,e[5]=l):l=e[5];let d;e[6]!==n.description?(d=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[6]=n.description,e[7]=d):d=e[7];let r;e[8]!==l||e[9]!==d?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,d]}),e[8]=l,e[9]=d,e[10]=r):r=e[10];let f;e[11]!==i||e[12]!==r?(f=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,r]}),e[11]=i,e[12]=r,e[13]=f):f=e[13];let o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})}),e[14]=o):o=e[14];let p;return e[15]!==f?(p=t.jsxs("div",{className:"surface overflow-hidden",children:[f,o]}),e[15]=f,e[16]=p):p=e[16],p}function Al(a){const e=U.c(20),{onRemove:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.connectionItem.connectionNotFound"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==i?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm text-destructive font-medium truncate",children:i})}),e[2]=i,e[3]=l):l=e[3];let d;e[4]!==n?(d=n("virtualMcp.connectionItem.removeConnection"),e[4]=n,e[5]=d):d=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ks,{size:13}),e[6]=r):r=e[6];let f;e[7]!==s||e[8]!==d?(f=t.jsx(Te,{asChild:!0,children:t.jsx(ee,{variant:"ghost-destructive",size:"icon-sm",className:"shrink-0",onClick:s,"aria-label":d,children:r})}),e[7]=s,e[8]=d,e[9]=f):f=e[9];let o;e[10]!==n?(o=n("virtualMcp.connectionItem.remove"),e[10]=n,e[11]=o):o=e[11];let p;e[12]!==o?(p=t.jsx(De,{side:"bottom",children:o}),e[12]=o,e[13]=p):p=e[13];let u;e[14]!==f||e[15]!==p?(u=t.jsxs(Ve,{delayDuration:0,children:[f,p]}),e[14]=f,e[15]=p,e[16]=u):u=e[16];let m;return e[17]!==l||e[18]!==u?(m=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-destructive/50 bg-destructive/5",children:[l,u]}),e[17]=l,e[18]=u,e[19]=m):m=e[19],m}function rn(){const a=U.c(3);let e;a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),a[0]=e):e=a[0];let s;a[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e,t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-48 rounded bg-muted animate-pulse"})]})]}),a[1]=s):s=a[1];let n;return a[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"surface overflow-hidden",children:[s,t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})})]}),a[2]=n):n=a[2],n}function on(a){const e=U.c(85),{value:s,onChange:n,onColorChange:i,name:l,size:d,className:r,avatarClassName:f,showHoverOverlay:o,disabled:p}=a,u=d===void 0?"lg":d,m=o===void 0?!0:o,h=p===void 0?!1:p,c=Z(),[x,g]=H.useState(!1),[v,j]=H.useState("icons"),[y,b]=H.useState(""),[w,S]=H.useState("blue");let N;e[0]!==s?(N=pi(s),e[0]=s,e[1]=N):N=e[1];const C=N,M=C.type==="icon"||C.type==="url"&&C.color?C.color:w;let T;e[2]!==n||e[3]!==M?(T=pe=>{n(kt(pe,M))},e[2]=n,e[3]=M,e[4]=T):T=e[4];const V=T;let _;e[5]!==n||e[6]!==i||e[7]!==C.name||e[8]!==C.type||e[9]!==C.url?(_=pe=>{S(pe),i?.(pe),C.type==="icon"?n(kt(C.name,pe)):C.type==="url"&&n(Jt(C.url,pe))},e[5]=n,e[6]=i,e[7]=C.name,e[8]=C.type,e[9]=C.url,e[10]=_):_=e[10];const E=_;let P;e[11]!==n||e[12]!==M?(P=pe=>{n(Jt(pe,M)),g(!1)},e[11]=n,e[12]=M,e[13]=P):P=e[13];const A=P;let I;e[14]!==n||e[15]!==M?(I=()=>{const pe=zs(),D=pe[Math.floor(Math.random()*pe.length)];n(kt(D,M))},e[14]=n,e[15]=M,e[16]=I):I=e[16];const K=I,Q=h?!1:x;let R;e[17]!==c?(R=c("common.iconPicker.changeIcon"),e[17]=c,e[18]=R):R=e[18];const F=h?"cursor-default opacity-50":"cursor-pointer";let Y;e[19]!==r||e[20]!==u||e[21]!==F?(Y=ve("relative group overflow-hidden",F,hi(u),r),e[19]=r,e[20]=u,e[21]=F,e[22]=Y):Y=e[22];let z;e[23]!==f||e[24]!==l||e[25]!==u||e[26]!==s?(z=t.jsx(Zt,{icon:s,name:l,size:u,className:f}),e[23]=f,e[24]=l,e[25]=u,e[26]=s,e[27]=z):z=e[27];let L;e[28]!==h||e[29]!==m?(L=m&&!h&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(bi,{size:16,className:"text-white"})}),e[28]=h,e[29]=m,e[30]=L):L=e[30];let W;e[31]!==h||e[32]!==R||e[33]!==Y||e[34]!==z||e[35]!==L?(W=t.jsx(Gs,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":R,disabled:h,className:Y,children:[z,L]})}),e[31]=h,e[32]=R,e[33]=Y,e[34]=z,e[35]=L,e[36]=W):W=e[36];let G;e[37]!==l||e[38]!==s?(G=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(Zt,{icon:s,name:l,size:"xl"})}),e[37]=l,e[38]=s,e[39]=G):G=e[39];let se;e[40]!==v?(se=pe=>{if(pe.key!=="ArrowLeft"&&pe.key!=="ArrowRight")return;pe.preventDefault();const D=v==="icons"?"upload":"icons";j(D),document.getElementById(`icon-picker-tab-${D}`)?.focus()},e[40]=v,e[41]=se):se=e[41];const te=v==="icons",k=v==="icons"?0:-1;let $;e[42]===Symbol.for("react.memo_cache_sentinel")?($=()=>j("icons"),e[42]=$):$=e[42];const q=v==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let B;e[43]!==q?(B=ve("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",q),e[43]=q,e[44]=B):B=e[44];let X;e[45]!==c?(X=c("common.iconPicker.iconsTab"),e[45]=c,e[46]=X):X=e[46];let ae;e[47]!==te||e[48]!==k||e[49]!==B||e[50]!==X?(ae=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":te,"aria-controls":"icon-picker-panel-icons",tabIndex:k,onClick:$,className:B,children:X}),e[47]=te,e[48]=k,e[49]=B,e[50]=X,e[51]=ae):ae=e[51];const je=v==="upload",ie=v==="upload"?0:-1;let ce;e[52]===Symbol.for("react.memo_cache_sentinel")?(ce=()=>j("upload"),e[52]=ce):ce=e[52];const ue=v==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let ge;e[53]!==ue?(ge=ve("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",ue),e[53]=ue,e[54]=ge):ge=e[54];let de;e[55]!==c?(de=c("common.iconPicker.uploadTab"),e[55]=c,e[56]=de):de=e[56];let he;e[57]!==je||e[58]!==ie||e[59]!==ge||e[60]!==de?(he=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":je,"aria-controls":"icon-picker-panel-upload",tabIndex:ie,onClick:ce,className:ge,children:de}),e[57]=je,e[58]=ie,e[59]=ge,e[60]=de,e[61]=he):he=e[61];let me;e[62]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx("div",{className:"flex-1"}),e[62]=me):me=e[62];let fe;e[63]!==se||e[64]!==ae||e[65]!==he?(fe=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:se,children:[ae,he,me]}),e[63]=se,e[64]=ae,e[65]=he,e[66]=fe):fe=e[66];let O;e[67]!==E||e[68]!==K||e[69]!==V||e[70]!==A||e[71]!==C.name||e[72]!==C.type||e[73]!==y||e[74]!==M||e[75]!==v?(O=v==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(Rl,{search:y,onSearchChange:b,selectedColor:M,onColorChange:E,onSelectIcon:V,onRandom:K,currentIconName:C.type==="icon"?C.name:null})}):t.jsx("div",{id:"icon-picker-panel-upload",role:"tabpanel","aria-labelledby":"icon-picker-tab-upload",children:t.jsx(Ll,{onUpload:A})}),e[67]=E,e[68]=K,e[69]=V,e[70]=A,e[71]=C.name,e[72]=C.type,e[73]=y,e[74]=M,e[75]=v,e[76]=O):O=e[76];let J;e[77]!==G||e[78]!==fe||e[79]!==O?(J=t.jsx(qs,{align:"start",className:"w-80 p-0",onOpenAutoFocus:El,children:t.jsxs("div",{className:"flex flex-col",children:[G,fe,O]})}),e[77]=G,e[78]=fe,e[79]=O,e[80]=J):J=e[80];let ye;return e[81]!==W||e[82]!==J||e[83]!==Q?(ye=t.jsxs(Hs,{open:Q,onOpenChange:g,children:[W,J]}),e[81]=W,e[82]=J,e[83]=Q,e[84]=ye):ye=e[84],ye}function El(a){return a.preventDefault()}function Fl(a){const e=U.c(33),{selectedColor:s,onColorChange:n}=a,i=Z(),[l,d]=H.useState(!1);let r,f,o,p,u,m,h;if(e[0]!==l||e[1]!==s){const w=Rs(s);f=Hs,m=l,h=d,r=Gs,u=!0,o="button",p=ve("h-6 w-6 rounded-full shrink-0 ring-2 ring-offset-2 ring-offset-background transition-all cursor-pointer hover:scale-110",w.dot,"ring-foreground/20"),e[0]=l,e[1]=s,e[2]=r,e[3]=f,e[4]=o,e[5]=p,e[6]=u,e[7]=m,e[8]=h}else r=e[2],f=e[3],o=e[4],p=e[5],u=e[6],m=e[7],h=e[8];let c;e[9]!==i?(c=i("common.iconPicker.changeColor"),e[9]=i,e[10]=c):c=e[10];let x;e[11]!==i?(x=i("common.iconPicker.changeColor"),e[11]=i,e[12]=x):x=e[12];let g;e[13]!==o||e[14]!==p||e[15]!==c||e[16]!==x?(g=t.jsx("button",{type:o,className:p,title:c,"aria-label":x}),e[13]=o,e[14]=p,e[15]=c,e[16]=x,e[17]=g):g=e[17];let v;e[18]!==r||e[19]!==u||e[20]!==g?(v=t.jsx(r,{asChild:u,children:g}),e[18]=r,e[19]=u,e[20]=g,e[21]=v):v=e[21];let j;e[22]!==n||e[23]!==s?(j=yi.map(w=>t.jsx("button",{type:"button",onClick:()=>{n(w.name),d(!1)},className:ve("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",w.dot,s===w.name?"ring-2 ring-offset-1 ring-offset-background ring-foreground/30 scale-110":"hover:scale-110"),title:w.name,"aria-label":w.name},w.name)),e[22]=n,e[23]=s,e[24]=j):j=e[24];let y;e[25]!==j?(y=t.jsx(qs,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:zl,children:t.jsx("div",{className:"grid grid-cols-4 gap-1",children:j})}),e[25]=j,e[26]=y):y=e[26];let b;return e[27]!==f||e[28]!==y||e[29]!==m||e[30]!==h||e[31]!==v?(b=t.jsxs(f,{open:m,onOpenChange:h,children:[v,y]}),e[27]=f,e[28]=y,e[29]=m,e[30]=h,e[31]=v,e[32]=b):b=e[32],b}function zl(a){return a.preventDefault()}function Rl(a){const e=U.c(55),{search:s,onSearchChange:n,selectedColor:i,onColorChange:l,onSelectIcon:d,onRandom:r,currentIconName:f}=a,o=Z();let p,u,m,h,c,x,g;if(e[0]!==f||e[1]!==l||e[2]!==r||e[3]!==n||e[4]!==d||e[5]!==s||e[6]!==i||e[7]!==o){const w=zs(),S=Rs(i);u=xi(w,s),x="flex flex-col";let N;e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Dt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=N):N=e[15];let C;e[16]!==n?(C=I=>n(I.target.value),e[16]=n,e[17]=C):C=e[17];let M;e[18]!==o?(M=o("common.iconPicker.filterPlaceholder"),e[18]=o,e[19]=M):M=e[19];let T;e[20]!==s||e[21]!==C||e[22]!==M?(T=t.jsxs("div",{className:"relative flex-1",children:[N,t.jsx(Ne,{value:s,onChange:C,placeholder:M,size:"sm",className:"text-xs pl-7"})]}),e[20]=s,e[21]=C,e[22]=M,e[23]=T):T=e[23];let V;e[24]!==o?(V=o("common.iconPicker.randomIcon"),e[24]=o,e[25]=V):V=e[25];let _;e[26]!==o?(_=o("common.iconPicker.randomIcon"),e[26]=o,e[27]=_):_=e[27];let E;e[28]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ji,{className:"size-3.5 text-muted-foreground"}),e[28]=E):E=e[28];let P;e[29]!==r||e[30]!==V||e[31]!==_?(P=t.jsx(ee,{type:"button",variant:"outline",size:"icon",onClick:r,className:"shrink-0",title:V,"aria-label":_,children:E}),e[29]=r,e[30]=V,e[31]=_,e[32]=P):P=e[32];let A;e[33]!==l||e[34]!==i?(A=t.jsx(Fl,{selectedColor:i,onColorChange:l}),e[33]=l,e[34]=i,e[35]=A):A=e[35],e[36]!==P||e[37]!==A||e[38]!==T?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[T,P,A]}),e[36]=P,e[37]=A,e[38]=T,e[39]=g):g=e[39],p=Yi,c="h-56",m="grid grid-cols-9 gap-0.5 px-2 pb-2",h=u.map(I=>{const K=gi(I);return K?t.jsx("button",{type:"button",onClick:()=>d(I),className:ve("h-8 w-8 flex items-center justify-center rounded-lg transition-colors cursor-pointer",f===I?ve(S.bg,S.text):ve(S.text,"hover:bg-accent")),title:I,"aria-label":vi(I),children:t.jsx(K,{size:18})},I):null}),e[0]=f,e[1]=l,e[2]=r,e[3]=n,e[4]=d,e[5]=s,e[6]=i,e[7]=o,e[8]=p,e[9]=u,e[10]=m,e[11]=h,e[12]=c,e[13]=x,e[14]=g}else p=e[8],u=e[9],m=e[10],h=e[11],c=e[12],x=e[13],g=e[14];let v;e[40]!==m||e[41]!==h?(v=t.jsx("div",{className:m,children:h}),e[40]=m,e[41]=h,e[42]=v):v=e[42];let j;e[43]!==u.length||e[44]!==o?(j=u.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:o("common.iconPicker.noIconsFound")}),e[43]=u.length,e[44]=o,e[45]=j):j=e[45];let y;e[46]!==p||e[47]!==c||e[48]!==v||e[49]!==j?(y=t.jsxs(p,{className:c,children:[v,j]}),e[46]=p,e[47]=c,e[48]=v,e[49]=j,e[50]=y):y=e[50];let b;return e[51]!==x||e[52]!==g||e[53]!==y?(b=t.jsxs("div",{className:x,children:[g,y]}),e[51]=x,e[52]=g,e[53]=y,e[54]=b):b=e[54],b}function Ll(a){const e=U.c(46),{onUpload:s}=a,n=Z(),i=H.useRef(null);let l;e[0]!==s||e[1]!==n?(l=P=>{const A=P.target.files?.[0];if(!A)return;if(A.size>2097152){le.error(n("common.iconPicker.imageTooLarge")),P.target.value="";return}const I=new FileReader;I.onerror=()=>{le.error(n("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},I.onloadend=()=>{I.readyState===FileReader.DONE&&I.result&&s(I.result),i.current&&(i.current.value="")},I.readAsDataURL(A)},e[0]=s,e[1]=n,e[2]=l):l=e[2];const d=l,[r,f]=H.useState("");let o;e[3]!==s||e[4]!==r?(o=()=>{const P=r.trim();P&&(s(P),f(""))},e[3]=s,e[4]=r,e[5]=o):o=e[5];const p=o;let u;e[6]!==d?(u=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:d}),e[6]=d,e[7]=u):u=e[7];let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=()=>i.current?.click(),e[8]=m):m=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Wi,{size:20}),e[9]=h):h=e[9];let c;e[10]!==n?(c=n("common.iconPicker.uploadHint"),e[10]=n,e[11]=c):c=e[11];let x;e[12]!==c?(x=t.jsxs("button",{type:"button",onClick:m,className:"h-24 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent transition-colors flex flex-col items-center justify-center gap-2 text-muted-foreground hover:text-foreground",children:[h,t.jsx("span",{className:"text-xs",children:c})]}),e[12]=c,e[13]=x):x=e[13];let g;e[14]!==n?(g=n("common.iconPicker.or"),e[14]=n,e[15]=g):g=e[15];let v;e[16]!==g?(v=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[16]=g,e[17]=v):v=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 h-px bg-border"}),e[18]=j):j=e[18];let y;e[19]!==v?(y=t.jsxs("div",{className:"flex items-center gap-2",children:[v,j]}),e[19]=v,e[20]=y):y=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=P=>f(P.target.value),e[21]=b):b=e[21];let w;e[22]!==n?(w=n("common.iconPicker.pasteUrlPlaceholder"),e[22]=n,e[23]=w):w=e[23];let S;e[24]!==p?(S=P=>{P.key==="Enter"&&(P.preventDefault(),p())},e[24]=p,e[25]=S):S=e[25];let N;e[26]!==r||e[27]!==w||e[28]!==S?(N=t.jsx(Ne,{value:r,onChange:b,placeholder:w,className:"h-8 text-xs flex-1",onKeyDown:S}),e[26]=r,e[27]=w,e[28]=S,e[29]=N):N=e[29];let C;e[30]!==r?(C=r.trim(),e[30]=r,e[31]=C):C=e[31];const M=!C;let T;e[32]!==n?(T=n("common.iconPicker.apply"),e[32]=n,e[33]=T):T=e[33];let V;e[34]!==p||e[35]!==M||e[36]!==T?(V=t.jsx(ee,{variant:"outline",className:"shrink-0",onClick:p,disabled:M,children:T}),e[34]=p,e[35]=M,e[36]=T,e[37]=V):V=e[37];let _;e[38]!==N||e[39]!==V?(_=t.jsxs("div",{className:"flex items-center gap-1.5",children:[N,V]}),e[38]=N,e[39]=V,e[40]=_):_=e[40];let E;return e[41]!==y||e[42]!==_||e[43]!==u||e[44]!==x?(E=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[u,x,y,_]}),e[41]=y,e[42]=_,e[43]=u,e[44]=x,e[45]=E):E=e[45],E}function Ul(a){const e=U.c(14),{viewId:s}=a;if(s==="overview"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ls,{size:16}),e[0]=i):i=e[0],i}if(s==="context"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Fs,{size:16}),e[1]=i):i=e[1],i}if(s==="monitor"){let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(wi,{size:16}),e[2]=i):i=e[2],i}if(s==="plan"){let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Si,{size:16}),e[3]=i):i=e[3],i}if(s==="reports"){let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ni,{size:16}),e[4]=i):i=e[4],i}if(s==="board"){let i;return e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ci,{size:16}),e[5]=i):i=e[5],i}if(s==="site-editor"){let i;return e[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Gi,{size:16}),e[6]=i):i=e[6],i}if(s==="assets"){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ii,{size:16}),e[7]=i):i=e[7],i}if(s==="releases"){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ki,{size:16}),e[8]=i):i=e[8],i}if(s==="hosting"){let i;return e[9]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(bn,{size:16}),e[9]=i):i=e[9],i}if(s==="e2e"){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Mi,{size:16}),e[10]=i):i=e[10],i}if(s==="calendar"){let i;return e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(_i,{size:16}),e[11]=i):i=e[11],i}if(s==="experiments"){let i;return e[12]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Vi,{size:16}),e[12]=i):i=e[12],i}let n;return e[13]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Us,{size:16}),e[13]=n):n=e[13],n}function cn(a){const e=U.c(51),{pinned:s,canSetMainView:n,onOpen:i,onTogglePin:l,onSetMainView:d}=a,r=Z(),f=s?"text-foreground":"text-muted-foreground/40";let o;e[0]!==f?(o=ve("size-7",f),e[0]=f,e[1]=o):o=e[1];let p;e[2]!==s||e[3]!==r?(p=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=s,e[3]=r,e[4]=p):p=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(es,{size:16}),e[5]=u):u=e[5];let m;e[6]!==l||e[7]!==s||e[8]!==o||e[9]!==p?(m=t.jsx(Te,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon",className:o,"aria-label":p,"aria-pressed":s,onClick:l,children:u})}),e[6]=l,e[7]=s,e[8]=o,e[9]=p,e[10]=m):m=e[10];let h;e[11]!==s||e[12]!==r?(h=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=s,e[12]=r,e[13]=h):h=e[13];let c;e[14]!==h?(c=t.jsx(De,{side:"top",children:h}),e[14]=h,e[15]=c):c=e[15];let x;e[16]!==m||e[17]!==c?(x=t.jsxs(Ve,{delayDuration:0,children:[m,c]}),e[16]=m,e[17]=c,e[18]=x):x=e[18];let g;e[19]!==r?(g=r("virtualMcp.settings.views.rowActions"),e[19]=r,e[20]=g):g=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Ki,{size:16}),e[21]=v):v=e[21];let j;e[22]!==g?(j=t.jsx(_s,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":g,children:v})}),e[22]=g,e[23]=j):j=e[23];let y;e[24]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(vn,{size:14}),e[24]=y):y=e[24];let b;e[25]!==r?(b=r("virtualMcp.settings.views.open"),e[25]=r,e[26]=b):b=e[26];let w;e[27]!==i||e[28]!==b?(w=t.jsxs(Je,{onClick:i,children:[y,b]}),e[27]=i,e[28]=b,e[29]=w):w=e[29];let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(es,{size:14}),e[30]=S):S=e[30];let N;e[31]!==s||e[32]!==r?(N=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=s,e[32]=r,e[33]=N):N=e[33];let C;e[34]!==l||e[35]!==N?(C=t.jsxs(Je,{onClick:l,children:[S,N]}),e[34]=l,e[35]=N,e[36]=C):C=e[36];let M;e[37]!==n||e[38]!==d||e[39]!==r?(M=n&&t.jsxs(Je,{onClick:d,children:[t.jsx(Ls,{size:14}),r("virtualMcp.settings.views.setMainView")]}),e[37]=n,e[38]=d,e[39]=r,e[40]=M):M=e[40];let T;e[41]!==w||e[42]!==C||e[43]!==M?(T=t.jsxs(Vs,{align:"end",children:[w,C,M]}),e[41]=w,e[42]=C,e[43]=M,e[44]=T):T=e[44];let V;e[45]!==j||e[46]!==T?(V=t.jsxs(Ms,{children:[j,T]}),e[45]=j,e[46]=T,e[47]=V):V=e[47];let _;return e[48]!==V||e[49]!==x?(_=t.jsxs("div",{className:"flex items-center gap-1",children:[x,V]}),e[48]=V,e[49]=x,e[50]=_):_=e[50],_}const bs=a=>a.stopPropagation();function Bl(a){const e=U.c(8),{icon:s,title:n}=a;let i;e[0]!==s||e[1]!==n?(i=t.jsx(jt,{icon:s,name:n,size:"xs",className:"shrink-0"}),e[0]=s,e[1]=n,e[2]=i):i=e[2];let l;e[3]!==n?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[3]=n,e[4]=l):l=e[4];let d;return e[5]!==i||e[6]!==l?(d=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,l]}),e[5]=i,e[6]=l,e[7]=d):d=e[7],d}function Yl(a){const e=U.c(42),{views:s,viewId:n}=a;let i;e[0]!==n||e[1]!==s?(i=s.pinned(n),e[0]=n,e[1]=s,e[2]=i):i=e[2];const l=i;let d;e[3]!==n?(d=t.jsx(Ul,{viewId:n}),e[3]=n,e[4]=d):d=e[4];const r=s.labels[n];let f;e[5]!==n||e[6]!==s?(f=()=>s.openView(n),e[5]=n,e[6]=s,e[7]=f):f=e[7];let o;e[8]!==l||e[9]!==n||e[10]!==s?(o=l&&s.canBeMainView(n)&&!s.isMainView(n),e[8]=l,e[9]=n,e[10]=s,e[11]=o):o=e[11];let p;e[12]!==n||e[13]!==s?(p=()=>s.openView(n),e[12]=n,e[13]=s,e[14]=p):p=e[14];let u;e[15]!==l||e[16]!==n||e[17]!==s?(u=()=>s.togglePin(n,!l),e[15]=l,e[16]=n,e[17]=s,e[18]=u):u=e[18];let m;e[19]!==n||e[20]!==s?(m=()=>s.setMainView(n),e[19]=n,e[20]=s,e[21]=m):m=e[21];let h;e[22]!==l||e[23]!==o||e[24]!==p||e[25]!==u||e[26]!==m?(h=t.jsx(cn,{pinned:l,canSetMainView:o,onOpen:p,onTogglePin:u,onSetMainView:m}),e[22]=l,e[23]=o,e[24]=p,e[25]=u,e[26]=m,e[27]=h):h=e[27];let c;e[28]!==n||e[29]!==s?(c=()=>s.openView(n),e[28]=n,e[29]=s,e[30]=c):c=e[30];let x;e[31]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ds,{size:16}),e[31]=x):x=e[31];let g;e[32]!==c?(g=t.jsx("span",{onClick:c,className:"flex cursor-pointer items-center text-muted-foreground",children:x}),e[32]=c,e[33]=g):g=e[33];let v;e[34]!==g||e[35]!==h?(v=t.jsxs("div",{className:"flex items-center gap-1",children:[h,g]}),e[34]=g,e[35]=h,e[36]=v):v=e[36];let j;return e[37]!==v||e[38]!==d||e[39]!==r||e[40]!==f?(j=t.jsx($e,{icon:d,title:r,onClick:f,action:v}),e[37]=v,e[38]=d,e[39]=r,e[40]=f,e[41]=j):j=e[41],j}function Wl(a){const e=U.c(75),{views:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.views.defaults"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==n?(l=n("virtualMcp.layoutTabContent.mainView"),e[2]=n,e[3]=l):l=e[3];let d;e[4]!==n?(d=n("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=n,e[5]=d):d=e[5];const r=s.noMainView?"none":"set",f=s.noMainView?void 0:s.defaultMainView,o=s.setMainView;let p;e[6]!==n?(p=n("virtualMcp.layoutTabContent.mainView"),e[6]=n,e[7]=p):p=e[7];let u;e[8]!==n?(u=n("virtualMcp.layoutTabContent.noMainView"),e[8]=n,e[9]=u):u=e[9];let m;e[10]!==u?(m=t.jsx(Le,{placeholder:u}),e[10]=u,e[11]=m):m=e[11];let h;e[12]!==p||e[13]!==m?(h=t.jsx(Re,{"aria-label":p,size:"sm",className:"w-36 shrink-0 @min-xl/project-settings:w-44",children:m}),e[12]=p,e[13]=m,e[14]=h):h=e[14];let c;e[15]!==s.defaultMainOptions?(c=s.defaultMainOptions.map(Kl),e[15]=s.defaultMainOptions,e[16]=c):c=e[16];let x;e[17]!==c?(x=t.jsx(Ue,{children:c}),e[17]=c,e[18]=x):x=e[18];let g;e[19]!==h||e[20]!==x||e[21]!==r||e[22]!==f||e[23]!==s.setMainView?(g=t.jsxs(Be,{value:f,onValueChange:o,children:[h,x]},r),e[19]=h,e[20]=x,e[21]=r,e[22]=f,e[23]=s.setMainView,e[24]=g):g=e[24];let v;e[25]!==g||e[26]!==l||e[27]!==d?(v=t.jsx($e,{title:l,description:d,action:g}),e[25]=g,e[26]=l,e[27]=d,e[28]=v):v=e[28];let j;e[29]!==n?(j=n("virtualMcp.layoutTabContent.showChat"),e[29]=n,e[30]=j):j=e[30];let y;e[31]!==n?(y=n("virtualMcp.layoutTabContent.showChatDescription"),e[31]=n,e[32]=y):y=e[32];let b;e[33]!==n?(b=n("virtualMcp.layoutTabContent.showChat"),e[33]=n,e[34]=b):b=e[34];const w=s.noMainView?!0:s.chatDefaultOpen;let S;e[35]!==b||e[36]!==w||e[37]!==s.noMainView||e[38]!==s.setChatDefaultOpen?(S=t.jsx(Te,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(rt,{"aria-label":b,checked:w,disabled:s.noMainView,onCheckedChange:s.setChatDefaultOpen})})}),e[35]=b,e[36]=w,e[37]=s.noMainView,e[38]=s.setChatDefaultOpen,e[39]=S):S=e[39];let N;e[40]!==n||e[41]!==s.noMainView?(N=s.noMainView&&t.jsx(De,{side:"top",children:n("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[40]=n,e[41]=s.noMainView,e[42]=N):N=e[42];let C;e[43]!==S||e[44]!==N?(C=t.jsxs(Ve,{delayDuration:0,children:[S,N]}),e[43]=S,e[44]=N,e[45]=C):C=e[45];let M;e[46]!==j||e[47]!==y||e[48]!==C?(M=t.jsx($e,{title:j,description:y,action:C}),e[46]=j,e[47]=y,e[48]=C,e[49]=M):M=e[49];let T;e[50]!==v||e[51]!==M?(T=t.jsxs(Me,{children:[v,M]}),e[50]=v,e[51]=M,e[52]=T):T=e[52];let V;e[53]!==i||e[54]!==T?(V=t.jsx(Oe,{title:i,children:T}),e[53]=i,e[54]=T,e[55]=V):V=e[55];let _;e[56]!==n?(_=n("virtualMcp.settings.views.sidebar"),e[56]=n,e[57]=_):_=e[57];let E;e[58]!==s.navViews||e[59]!==s.projectViews?(E=[...s.navViews,...s.projectViews],e[58]=s.navViews,e[59]=s.projectViews,e[60]=E):E=e[60];let P;e[61]!==E||e[62]!==s?(P=E.map(R=>t.jsx(Yl,{views:s,viewId:R},R)),e[61]=E,e[62]=s,e[63]=P):P=e[63];let A;e[64]!==s?(A=s.connectionsData.flatMap(R=>[t.jsx(Bl,{icon:R.icon,title:R.title},`${R.id}:header`),...R.uiTools.map(F=>{const Y=s.pinnedAppViews.find(G=>G.connectionId===R.id&&G.toolName===F.name),z=!!Y,L=jn(R.id,F.name),W=`ext-apps:${R.id}:${F.name}`;return t.jsx($e,{onClick:()=>s.openView(L),icon:z?t.jsx("span",{onClick:bs,children:t.jsx(on,{value:Y.icon??null,name:Y.label||F.name,size:"xs",showHoverOverlay:!1,onChange:G=>s.setAppViewIcon(R.id,F.name,G)})}):t.jsx(Us,{size:16}),title:z?t.jsx("span",{onClick:bs,children:t.jsx(Ne,{value:Y.label,onChange:G=>s.setAppViewLabel(R.id,F.name,G.target.value),onBlur:s.commitAppViewLabel,"aria-label":F.title??Pt(F.name),className:"h-7 w-full max-w-52 text-sm"})}):F.title??Pt(F.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(cn,{pinned:z,canSetMainView:z&&!s.isMainView(W),onOpen:()=>s.openView(L),onTogglePin:()=>s.toggleAppViewPin(R.id,F.name),onSetMainView:()=>s.setMainView(W)}),t.jsx("span",{onClick:()=>s.openView(L),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Ds,{size:16})})]})},`${R.id}:${F.name}`)})]),e[64]=s,e[65]=A):A=e[65];let I;e[66]!==P||e[67]!==A?(I=t.jsxs(Me,{children:[P,A]}),e[66]=P,e[67]=A,e[68]=I):I=e[68];let K;e[69]!==_||e[70]!==I?(K=t.jsx(Oe,{title:_,children:I}),e[69]=_,e[70]=I,e[71]=K):K=e[71];let Q;return e[72]!==V||e[73]!==K?(Q=t.jsxs(t.Fragment,{children:[V,K]}),e[72]=V,e[73]=K,e[74]=Q):Q=e[74],Q}function Kl(a){return t.jsx(Pe,{value:a.value,children:a.label},a.value)}const dn="site-editor",un={context:Ct.library,monitor:Ct.monitoring,plan:Ct.plan};function js(a){return Object.hasOwn(un,a)}const Gl=new Set([dn,"content"]);function ql({virtualMcpId:a,form:e,flushAndSave:s}){const n=Z(),i=ft(),{openPanel:l}=Qi(),d=pt(),{org:r}=Ee(),f=As(a),o=Xi(f),p=Xs(a),u=aa(a),m=(f?.connections??[]).map(k=>k.connection_id).sort(),{data:h}=Ps({queryKey:Et.projectConnectionDetails(a,m),enabled:m.length>0,queryFn:async()=>await Promise.all(m.map(async $=>{try{const{item:q}=await i.call("COLLECTION_CONNECTIONS_GET",{id:$}),B=(q?.tools??[]).flatMap(X=>{const ae=qi(X._meta);return ae?[{name:X.name,title:X.title,description:X.description,resourceUri:ae}]:[]});return{fetchOk:!0,id:$,title:q?.title??$,icon:q?.icon??null,uiTools:B}}catch{return{fetchOk:!1,id:$,title:$,icon:null,uiTools:[]}}}))}),c=(h??[]).filter(k=>k.uiTools.length>0),x=new Set([...yn,...wn]),g=e.watch("metadata.ui.pinnedViews")??[],v=e.watch("metadata.ui.layout")??null,j=v?.defaultMainView??null,y=v?.chatDefaultOpen??!1,b=o.presence.calendar,w=e.watch("metadata.sidebarViewsSeen"),S=Ot(It({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:v}}),e.watch("metadata.sidebarViewsVersion"),ns(w,b)),N=u??(f?Ot(It(f.metadata),f.metadata.sidebarViewsVersion,ns(f.metadata.sidebarViewsSeen,b)):S),C=(()=>{if(!j||j.type==="chat")return"";const k=Sn(j.type);return k==="instructions"||k==="connections"||k==="layout"?"settings":Gl.has(k)?dn:x.has(k)?k:`${k}:${j.id??""}:${j.toolName??""}`})(),M=C==="",T=k=>{const[$,q,B]=k.split(":");return $?x.has($)?{type:$}:$==="ext-apps"&&q?{type:"ext-apps",id:q,toolName:B||void 0}:null:null},V=k=>{e.setValue("metadata.ui.pinnedViews",k,{shouldDirty:!0})},_=k=>{e.setValue("metadata.ui.layout",{...v,...k},{shouldDirty:!0})},E=H.useRef(!1);if(h&&h.length>0&&!E.current){E.current=!0;const k=new Set((h??[]).filter(X=>X.fetchOk).map(X=>X.id)),$=new Set(c.flatMap(X=>X.uiTools.map(ae=>`${X.id}:${ae.name}`))),q=new Set(m),B=g.filter(X=>q.has(X.connectionId)&&(!k.has(X.connectionId)||$.has(`${X.connectionId}:${X.toolName}`)));B.length!==g.length&&(V(B),j?.type==="ext-apps"&&!B.some(X=>X.connectionId===j.id&&X.toolName===j.toolName)&&_({defaultMainView:{type:"settings"}}))}const P=(k,$)=>{if(g.some(B=>B.connectionId===k&&B.toolName===$)){const B=g.filter(ae=>!(ae.connectionId===k&&ae.toolName===$));V(B);const X=`ext-apps:${k}:${$}`;C===X&&_({defaultMainView:{type:"settings"}})}else{const B=c.find(X=>X.id===k)?.uiTools.find(X=>X.name===$)?.title;V([...g,{connectionId:k,toolName:$,label:B??Pt($),icon:null}])}s()},A=(k,$,q)=>{V(g.map(B=>B.connectionId===k&&B.toolName===$?{...B,label:q}:B))},I=()=>{s()},K=(k,$,q)=>{V(g.map(B=>B.connectionId===k&&B.toolName===$?{...B,icon:q}:B)),s()},Q=k=>{_({defaultMainView:T(k)}),s()},R=(k,$)=>{const q=ta(N,k,$,1);e.setValue("metadata.sidebarViews",q,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsSeen",sa(f?.metadata.sidebarViewsSeen??w,b),{shouldDirty:!0}),p.stage(q,N);const B=na(j,k,$);B!==j&&_({defaultMainView:B})},F=Qs(f?.metadata),Y=Ji(F,o.presence),z=Zi(Y),L=ea(N,Y,1),W={overview:n("sidebar.navDestinations.overview"),context:n("sidebar.navDestinations.context"),monitor:n("sidebar.navDestinations.monitor"),plan:n("sidebar.navDestinations.plan"),reports:n("sidebar.navDestinations.reports"),board:n("sidebar.navDestinations.spineTasks"),"site-editor":n("virtualMcp.layoutTabContent.siteEditor"),assets:n("common.mainPanelTabs.assets"),releases:n("common.mainPanelTabs.releases"),hosting:n("common.mainPanelTabs.hosting"),e2e:n("common.mainPanelTabs.e2e"),automations:n("virtualMcp.layoutTabContent.automations"),calendar:n("common.mainPanelTabs.calendar"),experiments:n("common.mainPanelTabs.experiments")},G=[{value:"overview",label:n("sidebar.navDestinations.overview")}];for(const k of L)k!=="automations"&&k!=="overview"&&(js(k)||G.push({value:k,label:W[k]}));for(const k of g)G.push({value:`ext-apps:${k.connectionId}:${k.toolName}`,label:k.label||k.toolName});L.includes("automations")&&G.push({value:"automations",label:W.automations}),G.push({value:"settings",label:n("virtualMcp.layoutTabContent.settings")});const se=k=>{if(js(k)){d({to:un[k],params:{org:r.slug,agentId:a}});return}l(k,{virtualmcpid:a})},te=new Set(is);return{navViews:is,projectViews:z.filter(k=>!te.has(k)),labels:W,pinned:k=>N.includes(k),isMainView:k=>C===k,canBeMainView:k=>G.some($=>$.value===k),defaultMainView:C,defaultMainOptions:G,noMainView:M,chatDefaultOpen:y,connectionsData:c,pinnedAppViews:g,openView:se,togglePin:(k,$)=>R(k,$),setMainView:Q,setChatDefaultOpen:k=>{_({chatDefaultOpen:k}),s()},toggleAppViewPin:P,setAppViewIcon:K,setAppViewLabel:A,commitAppViewLabel:I}}function Hl(a){const e=U.c(55),{form:s,onCommit:n}=a,i=Z(),l=H.useId();let d;e[0]!==i?(d=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=d):d=e[1];let r;e[2]!==d?(r=t.jsx("p",{className:"text-sm font-medium",children:d}),e[2]=d,e[3]=r):r=e[3];let f;e[4]!==i?(f=i("virtualMcp.settings.identity.iconDescription"),e[4]=i,e[5]=f):f=e[5];let o;e[6]!==f?(o=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:f}),e[6]=f,e[7]=o):o=e[7];let p;e[8]!==r||e[9]!==o?(p=t.jsxs("div",{children:[r,o]}),e[8]=r,e[9]=o,e[10]=p):p=e[10];let u;e[11]!==s||e[12]!==n||e[13]!==i?(u=V=>{const{field:_}=V;return t.jsx("div",{className:"justify-self-start",children:t.jsx(on,{value:_.value??null,onChange:E=>{_.onChange(E),n()},onColorChange:E=>{s.setValue("metadata.ui.themeColor",E,{shouldDirty:!0}),n()},name:s.watch("title")||i("virtualMcp.virtualMcp.agentNameFallback"),size:"md",avatarClassName:"[&_svg]:w-1/2 [&_svg]:h-1/2"})})},e[11]=s,e[12]=n,e[13]=i,e[14]=u):u=e[14];let m;e[15]!==s.control||e[16]!==u?(m=t.jsx(be,{name:"icon",control:s.control,render:u}),e[15]=s.control,e[16]=u,e[17]=m):m=e[17];let h;e[18]!==p||e[19]!==m?(h=t.jsxs(we,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[p,m]}),e[18]=p,e[19]=m,e[20]=h):h=e[20];const c=`${l}-name`;let x;e[21]!==i?(x=i("virtualMcp.settings.identity.name"),e[21]=i,e[22]=x):x=e[22];let g;e[23]!==x||e[24]!==c?(g=t.jsx("label",{htmlFor:c,className:"text-sm font-medium",children:x}),e[23]=x,e[24]=c,e[25]=g):g=e[25];let v;e[26]!==l||e[27]!==n||e[28]!==i?(v=V=>{const{field:_}=V;return t.jsx(Ne,{..._,id:`${l}-name`,value:_.value??"",onBlur:()=>{_.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=l,e[27]=n,e[28]=i,e[29]=v):v=e[29];let j;e[30]!==s.control||e[31]!==v?(j=t.jsx(be,{name:"title",control:s.control,render:v}),e[30]=s.control,e[31]=v,e[32]=j):j=e[32];let y;e[33]!==g||e[34]!==j?(y=t.jsxs(we,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[g,j]}),e[33]=g,e[34]=j,e[35]=y):y=e[35];const b=`${l}-description`;let w;e[36]!==i?(w=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=w):w=e[37];let S;e[38]!==b||e[39]!==w?(S=t.jsx("label",{htmlFor:b,className:"text-sm font-medium",children:w}),e[38]=b,e[39]=w,e[40]=S):S=e[40];let N;e[41]!==l||e[42]!==n||e[43]!==i?(N=V=>{const{field:_}=V;return t.jsx(ut,{..._,id:`${l}-description`,value:_.value??"",onBlur:()=>{_.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=l,e[42]=n,e[43]=i,e[44]=N):N=e[44];let C;e[45]!==s.control||e[46]!==N?(C=t.jsx(be,{name:"description",control:s.control,render:N}),e[45]=s.control,e[46]=N,e[47]=C):C=e[47];let M;e[48]!==S||e[49]!==C?(M=t.jsxs(we,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[S,C]}),e[48]=S,e[49]=C,e[50]=M):M=e[50];let T;return e[51]!==y||e[52]!==M||e[53]!==h?(T=t.jsxs(Me,{children:[h,y,M]}),e[51]=y,e[52]=M,e[53]=h,e[54]=T):T=e[54],T}function Ql(a){const e=U.c(8),{section:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.navigation"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==s||e[3]!==n?(l=da.map(r=>{const{titleKey:f}=ua[r];return t.jsx(Ke.Tab,{active:s===r,asChild:!0,children:t.jsx(At,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:o=>({...o,section:r==="general"?void 0:r}),children:n(f)})},r)}),e[2]=s,e[3]=n,e[4]=l):l=e[4];let d;if(e[5]!==i||e[6]!==l){const r=t.jsx(Ke.Tabs,{"aria-label":i,children:l});d=t.jsx(Nn.Toolbar.Left.Portal,{fallback:r,children:r}),e[5]=i,e[6]=l,e[7]=d}else d=e[7];return d}function Xl(){const a=U.c(8),e=pt();let s;a[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},a[0]=s):s=a[0];const{section:n}=Cn(s);let i;a[1]!==n?(i=ma(n)?n:"general",a[1]=n,a[2]=i):i=a[2];let l;a[3]!==e?(l=r=>e({to:".",search:f=>({...f,section:r??void 0})}),a[3]=e,a[4]=l):l=a[4];let d;return a[5]!==i||a[6]!==l?(d={section:i,openSection:l},a[5]=i,a[6]=l,a[7]=d):d=a[7],d}function mn(a){const e=U.c(20),{value:s,label:n,copiedLabel:i,variant:l,size:d,className:r,copiedClassName:f}=a,o=l===void 0?"ghost":l,p=d===void 0?"icon-sm":d,{handleCopy:u,copied:m}=fa();let h;e[0]!==u||e[1]!==s?(h=()=>{u(s).catch(Jl)},e[0]=u,e[1]=s,e[2]=h):h=e[2];const c=m&&f;let x;e[3]!==r||e[4]!==c?(x=ve(r,c),e[3]=r,e[4]=c,e[5]=x):x=e[5];let g;e[6]!==m?(g=m?t.jsx(lt,{className:"text-success"}):t.jsx(vt,{}),e[6]=m,e[7]=g):g=e[7];let v;e[8]!==n||e[9]!==p||e[10]!==h||e[11]!==x||e[12]!==g||e[13]!==o?(v=t.jsx(ee,{type:"button",variant:o,size:p,"aria-label":n,onClick:h,className:x,children:g}),e[8]=n,e[9]=p,e[10]=h,e[11]=x,e[12]=g,e[13]=o,e[14]=v):v=e[14];const j=m?i:"";let y;e[15]!==j?(y=t.jsx("span",{className:"sr-only","aria-live":"polite",children:j}),e[15]=j,e[16]=y):y=e[16];let b;return e[17]!==v||e[18]!==y?(b=t.jsxs(t.Fragment,{children:[v,y]}),e[17]=v,e[18]=y,e[19]=b):b=e[19],b}function Jl(){}function Zl(a){const e=U.c(14),{id:s,value:n,copyLabel:i,copiedLabel:l,className:d}=a;let r;e[0]!==d?(r=ve("relative h-fit",d),e[0]=d,e[1]=r):r=e[1];let f;e[2]!==s||e[3]!==n?(f=t.jsx(Ne,{id:s,value:n,readOnly:!0,disabled:!0,className:"pr-10 font-mono"}),e[2]=s,e[3]=n,e[4]=f):f=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=ve("absolute top-1/2 right-1 -translate-y-1/2 transition-opacity","opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100 pointer-coarse:opacity-100"),e[5]=o):o=e[5];let p;e[6]!==l||e[7]!==i||e[8]!==n?(p=t.jsx(mn,{value:n,label:i,copiedLabel:l,className:o,copiedClassName:"opacity-100"}),e[6]=l,e[7]=i,e[8]=n,e[9]=p):p=e[9];let u;return e[10]!==r||e[11]!==f||e[12]!==p?(u=t.jsxs("div",{className:r,children:[f,p]}),e[10]=r,e[11]=f,e[12]=p,e[13]=u):u=e[13],u}async function ys(a){const e=await a.json().catch(()=>({}));if(!a.ok)throw new Error(e.error??`HTTP ${a.status}`);return e}function er(a){const e=U.c(108),{orgSlug:s,virtualMcpId:n,site:i}=a,l=Z(),d=Ft();let r;e[0]!==i?(r=kn(i,"site-tokens"),e[0]=i,e[1]=r):r=e[1];const f=r;let o;e[2]!==s||e[3]!==n?(o=Et.hostedSiteTokens(s,n),e[2]=s,e[3]=n,e[4]=o):o=e[4];const p=o,[u,m]=H.useState(null),h=H.useId();let c;e[5]!==f?(c=async()=>ys(await fetch(f)),e[5]=f,e[6]=c):c=e[6];let x;e[7]!==p||e[8]!==c?(x={queryKey:p,queryFn:c},e[7]=p,e[8]=c,e[9]=x):x=e[9];const g=Ps(x);let v;e[10]!==f?(v=async()=>ys(await fetch(f,{method:"POST"})),e[10]=f,e[11]=v):v=e[11];let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=J=>{const{token:ye}=J;return m(ye)},e[12]=j):j=e[12];let y;e[13]!==p||e[14]!==d?(y=()=>d.invalidateQueries({queryKey:p}),e[13]=p,e[14]=d,e[15]=y):y=e[15];let b;e[16]!==v||e[17]!==y?(b={mutationFn:v,onSuccess:j,onError:tr,onSettled:y},e[16]=v,e[17]=y,e[18]=b):b=e[18];const w=Os(b);let S;e[19]!==g.data?.tokens?(S=g.data?.tokens??[],e[19]=g.data?.tokens,e[20]=S):S=e[20];const N=S,C=g.data?.site;let M;e[21]!==l?(M=l("siteTokens.title"),e[21]=l,e[22]=M):M=e[22];let T;e[23]!==l?(T=l("siteTokens.description"),e[23]=l,e[24]=T):T=e[24];let V;e[25]!==l?(V=l("siteTokens.siteId"),e[25]=l,e[26]=V):V=e[26];let _;e[27]!==h||e[28]!==V?(_=t.jsx("label",{htmlFor:h,className:"text-sm font-medium",children:V}),e[27]=h,e[28]=V,e[29]=_):_=e[29];let E;e[30]!==l?(E=l("siteTokens.siteIdDescription"),e[30]=l,e[31]=E):E=e[31];let P;e[32]!==E?(P=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:E}),e[32]=E,e[33]=P):P=e[33];let A;e[34]!==C||e[35]!==h||e[36]!==l?(A=C?t.jsx(Zl,{id:h,value:C,copyLabel:l("siteTokens.copySiteId"),copiedLabel:l("siteTokens.siteIdCopied"),className:"min-w-0 flex-1"}):t.jsx("p",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:"—"}),e[34]=C,e[35]=h,e[36]=l,e[37]=A):A=e[37];const I=!g.data||w.isPending;let K;e[38]!==w?(K=()=>w.mutate(),e[38]=w,e[39]=K):K=e[39];let Q;e[40]!==w.isPending?(Q=w.isPending?t.jsx(nt,{className:"size-3.5"}):t.jsx(ze,{size:14}),e[40]=w.isPending,e[41]=Q):Q=e[41];let R;e[42]!==l?(R=l("siteTokens.issue"),e[42]=l,e[43]=R):R=e[43];let F;e[44]!==I||e[45]!==K||e[46]!==Q||e[47]!==R?(F=t.jsxs(ee,{type:"button",size:"sm",className:"shrink-0",disabled:I,onClick:K,children:[Q,R]}),e[44]=I,e[45]=K,e[46]=Q,e[47]=R,e[48]=F):F=e[48];let Y;e[49]!==A||e[50]!==F?(Y=t.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[A,F]}),e[49]=A,e[50]=F,e[51]=Y):Y=e[51];let z;e[52]!==_||e[53]!==P||e[54]!==Y?(z=t.jsxs(we,{className:"group",children:[_,P,Y]}),e[52]=_,e[53]=P,e[54]=Y,e[55]=z):z=e[55];let L;e[56]!==g.error||e[57]!==g.isError?(L=g.isError?t.jsx(we,{children:t.jsx("p",{className:"text-xs text-destructive",children:g.error.message})}):null,e[56]=g.error,e[57]=g.isError,e[58]=L):L=e[58];let W;if(e[59]!==l||e[60]!==N){let J;e[62]!==l?(J=ye=>t.jsx(we,{children:t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsx(Lt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate font-mono text-xs",children:ye.kid}),t.jsx("p",{className:"text-xs text-muted-foreground",children:l("siteTokens.issuedAgo",{when:Mn(new Date(ye.iat*1e3))})})]})]})},ye.kid),e[62]=l,e[63]=J):J=e[63],W=N.map(J),e[59]=l,e[60]=N,e[61]=W}else W=e[61];let G;e[64]!==z||e[65]!==L||e[66]!==W?(G=t.jsxs(Me,{children:[z,L,W]}),e[64]=z,e[65]=L,e[66]=W,e[67]=G):G=e[67];const se=u!==null;let te;e[68]===Symbol.for("react.memo_cache_sentinel")?(te=J=>!J&&m(null),e[68]=te):te=e[68];let k;e[69]!==l?(k=l("siteTokens.createdTitle"),e[69]=l,e[70]=k):k=e[70];let $;e[71]!==k?($=t.jsx(ht,{children:k}),e[71]=k,e[72]=$):$=e[72];let q;e[73]!==l?(q=l("siteTokens.createdDescription"),e[73]=l,e[74]=q):q=e[74];let B;e[75]!==q?(B=t.jsx(Is,{children:q}),e[75]=q,e[76]=B):B=e[76];let X;e[77]!==$||e[78]!==B?(X=t.jsxs(xt,{children:[$,B]}),e[77]=$,e[78]=B,e[79]=X):X=e[79];let ae;e[80]!==l?(ae=l("siteTokens.createdTitle"),e[80]=l,e[81]=ae):ae=e[81];const je=u??"";let ie;e[82]!==ae||e[83]!==je?(ie=t.jsx(Ne,{readOnly:!0,"aria-label":ae,value:je,className:"font-mono text-xs"}),e[82]=ae,e[83]=je,e[84]=ie):ie=e[84];let ce;e[85]!==u||e[86]!==l?(ce=u?t.jsx(mn,{value:u,label:l("siteTokens.copy"),copiedLabel:l("siteTokens.copied"),variant:"outline",size:"icon",className:"shrink-0"}):null,e[85]=u,e[86]=l,e[87]=ce):ce=e[87];let ue;e[88]!==ie||e[89]!==ce?(ue=t.jsxs("div",{className:"flex items-center gap-2",children:[ie,ce]}),e[88]=ie,e[89]=ce,e[90]=ue):ue=e[90];let ge;e[91]===Symbol.for("react.memo_cache_sentinel")?(ge=()=>m(null),e[91]=ge):ge=e[91];let de;e[92]!==l?(de=l("siteTokens.done"),e[92]=l,e[93]=de):de=e[93];let he;e[94]!==de?(he=t.jsx($t,{children:t.jsx(ee,{onClick:ge,children:de})}),e[94]=de,e[95]=he):he=e[95];let me;e[96]!==X||e[97]!==ue||e[98]!==he?(me=t.jsxs(it,{className:"sm:max-w-lg",children:[X,ue,he]}),e[96]=X,e[97]=ue,e[98]=he,e[99]=me):me=e[99];let fe;e[100]!==se||e[101]!==me?(fe=t.jsx(at,{open:se,onOpenChange:te,children:me}),e[100]=se,e[101]=me,e[102]=fe):fe=e[102];let O;return e[103]!==M||e[104]!==T||e[105]!==G||e[106]!==fe?(O=t.jsxs(Oe,{title:M,description:T,children:[G,fe]}),e[103]=M,e[104]=T,e[105]=G,e[106]=fe,e[107]=O):O=e[107],O}function tr(a){return le.error(a.message)}function sr(a){const e=U.c(31),{virtualMcp:s}=a,n=Z(),{org:i}=Ee(),{roleSlug:l}=_n();let d;e[0]!==s?(d=ha(s),e[0]=s,e[1]=d):d=e[1];const r=d,f=ft(),o=Ft();let p;e[2]!==f||e[3]!==s?(p=N=>f.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:s.id,data:{blocksV8:N}}),e[2]=f,e[3]=s,e[4]=p):p=e[4];let u;e[5]!==i||e[6]!==o?(u=()=>Vn(o,i.id),e[5]=i,e[6]=o,e[7]=u):u=e[7];let m;e[8]!==p||e[9]!==u?(m={mutationFn:p,onError:nr,onSettled:u},e[8]=p,e[9]=u,e[10]=m):m=e[10];const h=Os(m);if(!pa(l))return null;const c=h.isPending?h.variables:r;let x;e[11]!==n?(x=n("virtualMcp.settings.blocksV8Site.label"),e[11]=n,e[12]=x):x=e[12];let g;e[13]!==x?(g=t.jsx(Se,{htmlFor:"blocks-v8-site",className:"font-normal text-foreground",children:x}),e[13]=x,e[14]=g):g=e[14];let v;e[15]!==n?(v=n("virtualMcp.settings.blocksV8Site.description"),e[15]=n,e[16]=v):v=e[16];let j;e[17]!==v?(j=t.jsx("p",{className:"text-xs text-muted-foreground",children:v}),e[17]=v,e[18]=j):j=e[18];let y;e[19]!==g||e[20]!==j?(y=t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[g,j]}),e[19]=g,e[20]=j,e[21]=y):y=e[21];let b;e[22]!==h?(b=N=>h.mutate(N),e[22]=h,e[23]=b):b=e[23];let w;e[24]!==c||e[25]!==b||e[26]!==h.isPending?(w=t.jsx(rt,{id:"blocks-v8-site",className:"shrink-0",checked:c,disabled:h.isPending,onCheckedChange:b}),e[24]=c,e[25]=b,e[26]=h.isPending,e[27]=w):w=e[27];let S;return e[28]!==w||e[29]!==y?(S=t.jsx(Oe,{children:t.jsx(Me,{children:t.jsx(we,{children:t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[y,w]})})})}),e[28]=w,e[29]=y,e[30]=S):S=e[30],S}function nr(a){return le.error(a.message)}function ir(a){const e=U.c(8),{control:s,previewServerUrl:n}=a,i=Z();let l;e[0]!==n?(l=Js(n),e[0]=n,e[1]=l):l=e[1];const d=!!l;let r;e[2]!==d||e[3]!==i?(r=o=>{const{field:p}=o;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(Se,{htmlFor:"fast-preview",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreview.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i(d?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(rt,{id:"fast-preview",className:"shrink-0",checked:!!p.value&&d,disabled:!d,onCheckedChange:u=>p.onChange(u)})]})},e[2]=d,e[3]=i,e[4]=r):r=e[4];let f;return e[5]!==s||e[6]!==r?(f=t.jsx(be,{control:s,name:"metadata.fastPreview",render:r}),e[5]=s,e[6]=r,e[7]=f):f=e[7],f}function ar(a){const e=U.c(5),{control:s,fastPreview:n}=a,i=Z();if(!n)return null;let l;e[0]!==i?(l=r=>{const{field:f}=r;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(Se,{htmlFor:"fast-preview-in-place",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.description")})]}),t.jsx(rt,{id:"fast-preview-in-place",className:"shrink-0",checked:!!f.value,onCheckedChange:o=>f.onChange(o)})]})},e[0]=i,e[1]=l):l=e[1];let d;return e[2]!==s||e[3]!==l?(d=t.jsx(be,{control:s,name:"metadata.fastPreviewInPlace",render:l}),e[2]=s,e[3]=l,e[4]=d):d=e[4],d}function lr(a){const e=U.c(18),{control:s,isBlocksV8:n}=a,i=n===void 0?!1:n,l=Z();let d;e[0]!==l?(d=l("sandbox.previewServerUrlField.label"),e[0]=l,e[1]=d):d=e[1];let r;e[2]!==d?(r=t.jsx(Se,{htmlFor:"preview-server-url",children:d}),e[2]=d,e[3]=r):r=e[3];let f;e[4]!==l?(f=c=>{const{field:x}=c,g=x.value??"";return t.jsx(Ne,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:l("sandbox.previewServerUrlField.placeholder"),value:g,onChange:v=>x.onChange(v.target.value===""?null:v.target.value),onBlur:()=>{x.onChange(ga(g)),x.onBlur()}})},e[4]=l,e[5]=f):f=e[5];let o;e[6]!==s||e[7]!==f?(o=t.jsx(be,{control:s,name:"metadata.previewServerUrl",render:f}),e[6]=s,e[7]=f,e[8]=o):o=e[8];const p=i?"sandbox.previewServerUrlField.descriptionBlocksV8":"sandbox.previewServerUrlField.description";let u;e[9]!==l||e[10]!==p?(u=l(p),e[9]=l,e[10]=p,e[11]=u):u=e[11];let m;e[12]!==u?(m=t.jsx("p",{className:"text-xs text-muted-foreground",children:u}),e[12]=u,e[13]=m):m=e[13];let h;return e[14]!==r||e[15]!==o||e[16]!==m?(h=t.jsxs("div",{className:"space-y-2",children:[r,o,m]}),e[14]=r,e[15]=o,e[16]=m,e[17]=h):h=e[17],h}function rr(a){const e=U.c(15),{control:s,isBlocksV8:n,previewServerUrl:i,fastPreview:l}=a,d=Z(),r=n||!!l;let f;e[0]!==s||e[1]!==n?(f=t.jsx(we,{children:t.jsx(lr,{control:s,isBlocksV8:n})}),e[0]=s,e[1]=n,e[2]=f):f=e[2];let o;e[3]!==s||e[4]!==n||e[5]!==i||e[6]!==d?(o=n?!Js(i)&&t.jsx(we,{children:t.jsx("p",{className:"text-xs text-muted-foreground",children:d("sandbox.cmsSettings.blocksV8.needsPreviewServerUrl")})}):t.jsx(we,{children:t.jsx(ir,{control:s,previewServerUrl:i})}),e[3]=s,e[4]=n,e[5]=i,e[6]=d,e[7]=o):o=e[7];let p;e[8]!==s||e[9]!==r?(p=r&&t.jsx(we,{children:t.jsx(ar,{control:s,fastPreview:r})}),e[8]=s,e[9]=r,e[10]=p):p=e[10];let u;return e[11]!==f||e[12]!==o||e[13]!==p?(u=t.jsxs(t.Fragment,{children:[f,o,p]}),e[11]=f,e[12]=o,e[13]=p,e[14]=u):u=e[14],u}const Vt={tools:null,resources:null,prompts:null},or=ba.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function cr(a){const s=new TextEncoder().encode(a),n=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(n)}function fn(a){return{"x-studio-client":a,"x-mesh-client":a}}function dr(a){const e=U.c(15),{url:s,agentId:n}=a,i=Z(),[l,d]=H.useState(!1);let r;e[0]!==n||e[1]!==i||e[2]!==s?(r=async()=>{_e("agent_connect_action",{agent_id:n,action:"copy_url"}),await navigator.clipboard.writeText(s),d(!0),le.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await St(2e3),d(!1)},e[0]=n,e[1]=i,e[2]=s,e[3]=r):r=e[3];const f=r;let o;e[4]!==l?(o=l?t.jsx(lt,{size:20,className:"text-success"}):t.jsx(vt,{size:20}),e[4]=l,e[5]=o):o=e[5];let p;e[6]!==l||e[7]!==i?(p=i(l?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=l,e[7]=i,e[8]=p):p=e[8];let u;e[9]!==p?(u=t.jsx("span",{className:"text-xs font-medium",children:p}),e[9]=p,e[10]=u):u=e[10];let m;return e[11]!==f||e[12]!==o||e[13]!==u?(m=t.jsxs(ee,{type:"button",variant:"outline",onClick:f,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[o,u]}),e[11]=f,e[12]=o,e[13]=u,e[14]=m):m=e[14],m}function ur(a){const e=U.c(13),{url:s,serverName:n,agentId:i}=a,l=Z();let d;e[0]!==i||e[1]!==n||e[2]!==l||e[3]!==s?(d=()=>{_e("agent_connect_action",{agent_id:i,action:"install_cursor"});const m=Zs(n),h={type:"http",url:s,headers:fn("Cursor")},c=cr(JSON.stringify(h,null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(m)}&config=${encodeURIComponent(c)}`;window.open(x,"_blank"),le.success(l("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=n,e[2]=l,e[3]=s,e[4]=d):d=e[4];const r=d;let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),e[5]=f):f=e[5];let o;e[6]!==l?(o=l("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=l,e[7]=o):o=e[7];let p;e[8]!==o?(p=t.jsx("span",{className:"text-xs font-medium",children:o}),e[8]=o,e[9]=p):p=e[9];let u;return e[10]!==r||e[11]!==p?(u=t.jsxs(ee,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[f,p]}),e[10]=r,e[11]=p,e[12]=u):u=e[12],u}function mr(a){const e=U.c(16),{url:s,serverName:n,agentId:i}=a,l=Z(),[d,r]=H.useState(!1);let f;e[0]!==i||e[1]!==n||e[2]!==l||e[3]!==s?(f=async()=>{_e("agent_connect_action",{agent_id:i,action:"install_claude_code"});const c=Zs(n),x={type:"http",url:s,headers:fn("Claude Code")},g=JSON.stringify(x,null,2),v=`claude mcp add-json "${c}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(v),r(!0),le.success(l("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await St(2e3),r(!1)},e[0]=i,e[1]=n,e[2]=l,e[3]=s,e[4]=f):f=e[4];const o=f;let p;e[5]!==d?(p=d?t.jsx(lt,{size:20,className:"text-success"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[5]=d,e[6]=p):p=e[6];let u;e[7]!==d||e[8]!==l?(u=l(d?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=d,e[8]=l,e[9]=u):u=e[9];let m;e[10]!==u?(m=t.jsx("span",{className:"text-xs font-medium",children:u}),e[10]=u,e[11]=m):m=e[11];let h;return e[12]!==o||e[13]!==p||e[14]!==m?(h=t.jsxs(ee,{type:"button",variant:"outline",onClick:o,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[p,m]}),e[12]=o,e[13]=p,e[14]=m,e[15]=h):h=e[15],h}const fr=720*60*60;function pr({virtualMcp:a}){const e=Z(),s=ft(),[n,i]=H.useState(null),[l,d]=H.useState(!1),[r,f]=H.useState(!1),o=a.id,p=a.title||`agent-${o.slice(0,8)}`,u=n?`bunx @decocms/typegen@latest --mcp ${o} --key ${n} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${o} --key <api-key> --output client.ts`,m=async()=>{d(!0);try{const{key:c}=await s.call("API_KEY_CREATE",{name:`typegen-${p}`,permissions:{[o]:["*"]},expiresIn:fr});if(!c)throw new Error("No key in response");i(c),_e("agent_typegen_key_generated",{agent_id:o})}catch{_e("agent_typegen_key_failed",{agent_id:o}),le.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{d(!1)}},h=async()=>{_e("agent_connect_action",{agent_id:o,action:"typegen_copy_command",has_api_key:!!n}),await navigator.clipboard.writeText(u),f(!0),le.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await St(2e3),f(!1)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClient")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClientDescription")})]}),!n&&t.jsxs(ee,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:m,disabled:l,children:[l?t.jsx(nt,{className:"size-3.5"}):t.jsx(Lt,{size:14}),t.jsx("span",{children:e(l?"virtualMcp.virtualMcpShareModal.generating":"virtualMcp.virtualMcpShareModal.generateApiKey")})]})]}),n&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateClientLabel")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:u}),t.jsx(ee,{type:"button",variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:h,children:r?t.jsx(lt,{size:12,className:"text-success"}):t.jsx(vt,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx(hr,{apiKey:n,agentId:o})]})}function hr(a){const e=U.c(21),{apiKey:s,agentId:n}=a,[i,l]=H.useState(!1),d=window.location.origin,r=s?`STUDIO_API_KEY=${s}`:"STUDIO_API_KEY=<api-key>",f=`STUDIO_BASE_URL=${d}`,o=`${r}
|
|
1
|
+
import{gS as Ae,gT as Ze,ho as xn,hp as ks,c as U,b as Z,r as H,j as t,B as ee,h as nt,m as ve,_ as Ms,X as _s,Z as Vs,Y as Je,ap as Gt,an as qt,ao as Ht,t as le,R as Xe,a5 as Ee,a6 as Ts,hq as gn,v as it,D as at,y as $t,L as At,I as Ne,F as vn,ai as bn,ah as jn,g7 as $e,as as Ds,g6 as Me,gQ as Oe,ak as ft,d as pt,i as Ps,K as Et,hr as yn,hs as wn,ht as Sn,$ as Ct,c7 as be,hu as we,n as Ke,P as Nn,u as Cn,bx as lt,q as Ft,e as Os,fQ as kn,ac as Mn,x as ht,aT as Is,w as xt,av as _n,dd as Vn,E as _e,bB as Tn,a as Dn,hv as zt,hw as Pn,b3 as On,ag as In,aE as $n,aD as An,by as En,a8 as Fn,hn as zn,aN as Rn,aM as Ln,aJ as Un,aH as Bn,aI as Yn,aL as Wn,aK as Kn,bj as Gn,aS as qn}from"./index-DEZ1imMJ.js";import{g as Hn}from"./extract-connection-data-hvaA6rrK.js";import{b as Qn}from"./chat-context-PvP_Q1CV.js";import{U as Xn,b as Jn}from"./build-improve-prompt-doc-DNVGwsoG.js";import{E as Zn}from"./empty-state-CtwVPMDf.js";import{g as ei}from"./shell-layout-BLRNx2fV.js";import{g as gt,n as ti,a as Qt,e as si,u as ni,f as ii}from"./use-date-fns-locale-bKU2Q73X.js";import{a as ai}from"./mcp-oauth-CHmbtYyN.js";import{T as ut}from"./textarea-_jcGqOvl.js";import{c as Ve,T as Te,a as De}from"./tooltip-Dam-ym8O.js";import{a as Rt,b as $s,u as li}from"./use-connection-BozgIoMu.js";import{u as As,g as Es,c as ri,i as oi}from"./repository-binding-C0msapZZ.js";import{i as Xt}from"./mcp-oauth-BBT3ip6Z.js";import{bs as ci,m as Fs,bt as di,bu as ui,aW as mi,aB as fi,aF as pi,bv as hi,bw as zs,bx as Rs,by as xi,an as gi,bz as vi,bA as kt,bB as Jt,A as Zt,L as bi,bC as ji,bD as yi,h as Ls,D as es,k as wi,j as Si,az as Ni,n as Ci,v as ki,u as Mi,r as _i,q as Vi,g as Us,e as vt,aR as Ti,ab as Di,O as Pi}from"./agent-icon-CTbTFMnU.js";import{s as ze}from"./Plus-D7X8Q2-q.js";import{t as dt,a as Oi,b as Ii}from"./Tool01-Bo2g-Ylw.js";import{s as bt}from"./Trash01-C-PU5Hm-.js";import{u as ts}from"./use-debounced-autosave-BmvZzlB_.js";import{A as $i}from"./add-connection-dialog-BL3Uj9Py.js";import{i as Dt}from"./SearchMd-e6xPeRPD.js";import{F as ss}from"./file-type-icon-DM9o0Fkb.js";import{k as Ai,l as Ei,p as Fi,q as zi}from"./use-org-fs-BH012Up0.js";import{C as Ri}from"./collection-tabs-BJDa_4_F.js";import{T as Bs,u as Ys}from"./use-mcp-auth-status-Dls0bLQE.js";import{I as jt}from"./integration-icon-CFHOt7sY.js";import{C as Li}from"./checkbox-Bk98t4UK.js";import{u as yt}from"./use-mcp-client-DJjkIlNp.js";import{a as Ws}from"./use-mcp-tools-wfurU0oX.js";import{u as Ui}from"./use-mcp-prompts-it9pO2QZ.js";import{g as Bi}from"./connection-slug-DTdYIX0A.js";import{c as Pe,b as Re,a as Le,d as Ue,S as Be}from"./select-BJaUvbIR.js";import{s as Ks}from"./XClose-BuJ6u6eL.js";import{t as Pt}from"./utils-CVEq3hMx.js";import{S as rt}from"./switch-C53DVv3y.js";import{a as Gs,b as qs,P as Hs}from"./popover-DsvzKyw_.js";import{S as Yi}from"./scroll-area-CQ_g6hBm.js";import{i as Wi}from"./Upload01-NPnXKs-J.js";import{a as Ki}from"./SwitchHorizontal01-elXb4-4d.js";import{i as Gi}from"./Monitor01-DalIAdj7.js";import{g as qi}from"./types-gyofjZHf.js";import{a as Qs,c as Hi}from"./agent-capabilities-BGShibnD.js";import{a as Qi}from"./autosend-B0POegpm.js";import{u as Xi,g as Ot,o as ns,r as It,p as Ji,h as Zi,a as ea,i as is,t as ta,j as sa,k as na,b as ia}from"./use-project-native-view-presence-DhhbOsoh.js";import{a as Xs,u as aa,i as la,o as ra,r as as,p as oa,w as ca,b as ls}from"./optimistic-project-sidebar-views-BcV4r24I.js";import{a as da,P as ua,i as ma}from"./sections-C_Jmzzpn.js";import{i as Lt}from"./Key01-awxHKnoL.js";import{u as fa}from"./use-copy-o0P-kroy.js";import{L as Se}from"./label-BEWDSeNl.js";import{h as pa}from"./roles-DW32thi2.js";import{b as ha,u as xa}from"./use-blocks-v8-project-4PZwWSEO.js";import{s as Js,l as ga,v as Zs,r as va}from"./thread-intent-DuI80508.js";import{V as ba,E as wt,R as rs,r as en,C as ja,w as ya}from"./virtual-mcp-vRvxAZ15.js";import{b as wa,a as Sa,D as Na}from"./drawer-BYGTIOoj.js";import{u as Ca}from"./use-mobile-CJITN8uI.js";import{d as St}from"./delay-CnY5UFtP.js";import{b as ka}from"./sandbox-url-D3mC8qhT.js";import{S as Ma,a as _a,b as Va}from"./secret-picker-VlsiGxPi.js";import{u as Ta,a as Da}from"./use-secrets-Dim43C3b.js";import{o as os}from"./omit-server-managed-metadata-L5IhjRZB.js";import{G as Pa}from"./github-icon-BVy-v7gH.js";import{R as Oa}from"./repository-picker-BYFeDBpn.js";import{n as cs}from"./app-preview-url-9Od4s8Sz.js";import{a as Ia}from"./use-organization-settings-bWX185lw.js";import{r as $a}from"./serial-task-queue-CGOeQgpr.js";function st(a,e){const s=gt(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,i=Ae(a,e?.in),l=i.getDay(),d=(l<n?7:0)+l-n;return i.setDate(i.getDate()-d),i.setHours(0,0,0,0),i}function mt(a,e){return st(a,{...e,weekStartsOn:1})}function tn(a,e){const s=Ae(a,e?.in),n=s.getFullYear(),i=Ze(s,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const l=mt(i),d=Ze(s,0);d.setFullYear(n,0,4),d.setHours(0,0,0,0);const r=mt(d);return s.getTime()>=l.getTime()?n+1:s.getTime()>=r.getTime()?n:n-1}function ds(a,e){const s=Ae(a,e?.in);return s.setHours(0,0,0,0),s}function Aa(a,e,s){const[n,i]=ti(s?.in,a,e),l=ds(n),d=ds(i),r=+l-Qt(l),f=+d-Qt(d);return Math.round((r-f)/xn)}function Ea(a,e){const s=tn(a,e),n=Ze(a,0);return n.setFullYear(s,0,4),n.setHours(0,0,0,0),mt(n)}function Fa(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function za(a){return!(!Fa(a)&&typeof a!="number"||isNaN(+Ae(a)))}function Ra(a,e){const s=Ae(a,e?.in);return s.setFullYear(s.getFullYear(),0,1),s.setHours(0,0,0,0),s}function La(a,e){const s=Ae(a,e?.in);return Aa(s,Ra(s))+1}function Ua(a,e){const s=Ae(a,e?.in),n=+mt(s)-+Ea(s);return Math.round(n/ks)+1}function sn(a,e){const s=Ae(a,e?.in),n=s.getFullYear(),i=gt(),l=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,d=Ze(e?.in||a,0);d.setFullYear(n+1,0,l),d.setHours(0,0,0,0);const r=st(d,e),f=Ze(e?.in||a,0);f.setFullYear(n,0,l),f.setHours(0,0,0,0);const o=st(f,e);return+s>=+r?n+1:+s>=+o?n:n-1}function Ba(a,e){const s=gt(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,i=sn(a,e),l=Ze(e?.in||a,0);return l.setFullYear(i,0,n),l.setHours(0,0,0,0),st(l,e)}function Ya(a,e){const s=Ae(a,e?.in),n=+st(s,e)-+Ba(s,e);return Math.round(n/ks)+1}function re(a,e){const s=a<0?"-":"",n=Math.abs(a).toString().padStart(e,"0");return s+n}const Fe={y(a,e){const s=a.getFullYear(),n=s>0?s:1-s;return re(e==="yy"?n%100:n,e.length)},M(a,e){const s=a.getMonth();return e==="M"?String(s+1):re(s+1,2)},d(a,e){return re(a.getDate(),e.length)},a(a,e){const s=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];default:return s==="am"?"a.m.":"p.m."}},h(a,e){return re(a.getHours()%12||12,e.length)},H(a,e){return re(a.getHours(),e.length)},m(a,e){return re(a.getMinutes(),e.length)},s(a,e){return re(a.getSeconds(),e.length)},S(a,e){const s=e.length,n=a.getMilliseconds(),i=Math.trunc(n*Math.pow(10,s-3));return re(i,e.length)}},Qe={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},us={G:function(a,e,s){const n=a.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return s.era(n,{width:"abbreviated"});case"GGGGG":return s.era(n,{width:"narrow"});default:return s.era(n,{width:"wide"})}},y:function(a,e,s){if(e==="yo"){const n=a.getFullYear(),i=n>0?n:1-n;return s.ordinalNumber(i,{unit:"year"})}return Fe.y(a,e)},Y:function(a,e,s,n){const i=sn(a,n),l=i>0?i:1-i;if(e==="YY"){const d=l%100;return re(d,2)}return e==="Yo"?s.ordinalNumber(l,{unit:"year"}):re(l,e.length)},R:function(a,e){const s=tn(a);return re(s,e.length)},u:function(a,e){const s=a.getFullYear();return re(s,e.length)},Q:function(a,e,s){const n=Math.ceil((a.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return re(n,2);case"Qo":return s.ordinalNumber(n,{unit:"quarter"});case"QQQ":return s.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(n,{width:"narrow",context:"formatting"});default:return s.quarter(n,{width:"wide",context:"formatting"})}},q:function(a,e,s){const n=Math.ceil((a.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return re(n,2);case"qo":return s.ordinalNumber(n,{unit:"quarter"});case"qqq":return s.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(n,{width:"narrow",context:"standalone"});default:return s.quarter(n,{width:"wide",context:"standalone"})}},M:function(a,e,s){const n=a.getMonth();switch(e){case"M":case"MM":return Fe.M(a,e);case"Mo":return s.ordinalNumber(n+1,{unit:"month"});case"MMM":return s.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(n,{width:"narrow",context:"formatting"});default:return s.month(n,{width:"wide",context:"formatting"})}},L:function(a,e,s){const n=a.getMonth();switch(e){case"L":return String(n+1);case"LL":return re(n+1,2);case"Lo":return s.ordinalNumber(n+1,{unit:"month"});case"LLL":return s.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(n,{width:"narrow",context:"standalone"});default:return s.month(n,{width:"wide",context:"standalone"})}},w:function(a,e,s,n){const i=Ya(a,n);return e==="wo"?s.ordinalNumber(i,{unit:"week"}):re(i,e.length)},I:function(a,e,s){const n=Ua(a);return e==="Io"?s.ordinalNumber(n,{unit:"week"}):re(n,e.length)},d:function(a,e,s){return e==="do"?s.ordinalNumber(a.getDate(),{unit:"date"}):Fe.d(a,e)},D:function(a,e,s){const n=La(a);return e==="Do"?s.ordinalNumber(n,{unit:"dayOfYear"}):re(n,e.length)},E:function(a,e,s){const n=a.getDay();switch(e){case"E":case"EE":case"EEE":return s.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},e:function(a,e,s,n){const i=a.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(l);case"ee":return re(l,2);case"eo":return s.ordinalNumber(l,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(a,e,s,n){const i=a.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(l);case"cc":return re(l,e.length);case"co":return s.ordinalNumber(l,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(a,e,s){const n=a.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return re(i,e.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},a:function(a,e,s){const i=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(a,e,s){const n=a.getHours();let i;switch(n===12?i=Qe.noon:n===0?i=Qe.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(a,e,s){const n=a.getHours();let i;switch(n>=17?i=Qe.evening:n>=12?i=Qe.afternoon:n>=4?i=Qe.morning:i=Qe.night,e){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(a,e,s){if(e==="ho"){let n=a.getHours()%12;return n===0&&(n=12),s.ordinalNumber(n,{unit:"hour"})}return Fe.h(a,e)},H:function(a,e,s){return e==="Ho"?s.ordinalNumber(a.getHours(),{unit:"hour"}):Fe.H(a,e)},K:function(a,e,s){const n=a.getHours()%12;return e==="Ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},k:function(a,e,s){let n=a.getHours();return n===0&&(n=24),e==="ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},m:function(a,e,s){return e==="mo"?s.ordinalNumber(a.getMinutes(),{unit:"minute"}):Fe.m(a,e)},s:function(a,e,s){return e==="so"?s.ordinalNumber(a.getSeconds(),{unit:"second"}):Fe.s(a,e)},S:function(a,e){return Fe.S(a,e)},X:function(a,e,s){const n=a.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return fs(n);case"XXXX":case"XX":return We(n);default:return We(n,":")}},x:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"x":return fs(n);case"xxxx":case"xx":return We(n);default:return We(n,":")}},O:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ms(n,":");default:return"GMT"+We(n,":")}},z:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ms(n,":");default:return"GMT"+We(n,":")}},t:function(a,e,s){const n=Math.trunc(+a/1e3);return re(n,e.length)},T:function(a,e,s){return re(+a,e.length)}};function ms(a,e=""){const s=a>0?"-":"+",n=Math.abs(a),i=Math.trunc(n/60),l=n%60;return l===0?s+String(i):s+String(i)+e+re(l,2)}function fs(a,e){return a%60===0?(a>0?"-":"+")+re(Math.abs(a)/60,2):We(a,e)}function We(a,e=""){const s=a>0?"-":"+",n=Math.abs(a),i=re(Math.trunc(n/60),2),l=re(n%60,2);return s+i+e+l}const ps=(a,e)=>{switch(a){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},nn=(a,e)=>{switch(a){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Wa=(a,e)=>{const s=a.match(/(P+)(p+)?/)||[],n=s[1],i=s[2];if(!i)return ps(a,e);let l;switch(n){case"P":l=e.dateTime({width:"short"});break;case"PP":l=e.dateTime({width:"medium"});break;case"PPP":l=e.dateTime({width:"long"});break;default:l=e.dateTime({width:"full"});break}return l.replace("{{date}}",ps(n,e)).replace("{{time}}",nn(i,e))},Ka={p:nn,P:Wa},Ga=/^D+$/,qa=/^Y+$/,Ha=["D","DD","YY","YYYY"];function Qa(a){return Ga.test(a)}function Xa(a){return qa.test(a)}function Ja(a,e,s){const n=Za(a,e,s);if(console.warn(n),Ha.includes(a))throw new RangeError(n)}function Za(a,e,s){const n=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${e}\`) for formatting ${n} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const el=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,tl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sl=/^'([^]*?)'?$/,nl=/''/g,il=/[a-zA-Z]/;function al(a,e,s){const n=gt(),i=s?.locale??n.locale??si,l=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,d=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Ae(a,s?.in);if(!za(r))throw new RangeError("Invalid time value");let f=e.match(tl).map(p=>{const u=p[0];if(u==="p"||u==="P"){const m=Ka[u];return m(p,i.formatLong)}return p}).join("").match(el).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const u=p[0];if(u==="'")return{isToken:!1,value:ll(p)};if(us[u])return{isToken:!0,value:p};if(u.match(il))throw new RangeError("Format string contains an unescaped latin alphabet character `"+u+"`");return{isToken:!1,value:p}});i.localize.preprocessor&&(f=i.localize.preprocessor(r,f));const o={firstWeekContainsDate:l,weekStartsOn:d,locale:i};return f.map(p=>{if(!p.isToken)return p.value;const u=p.value;(!s?.useAdditionalWeekYearTokens&&Xa(u)||!s?.useAdditionalDayOfYearTokens&&Qa(u))&&Ja(u,e,String(a));const m=us[u[0]];return m(r,u,i.localize,o)}).join("")}function ll(a){const e=a.match(sl);return e?e[1].replace(nl,"'"):a}const an=25*1024*1024,Mt="home",_t="knowledge";function hs(a){return a==null?"":a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(0)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`}function Ye(a){return a.split("/").pop()??a}function rl(a){const e=U.c(64),{form:s}=a,n=Z(),{upload:i}=Ai(Mt),l=Ei(),d=H.useRef(null),[r,f]=H.useState(!1),[o,p]=H.useState(""),[u,m]=H.useState(!1);let h;e[0]!==r?(h={enabled:r},e[0]=r,e[1]=h):h=e[1];const{data:c}=Fi(60,h),x=c===void 0?[]:c;let g;e[2]!==r?(g={enabled:r},e[2]=r,e[3]=g):g=e[3];const{data:v}=zi(g),j=v===void 0?[]:v;let y;e[4]!==s?(y=()=>s.getValues("metadata.knowledge")??[],e[4]=s,e[5]=y):y=e[5];const[b,w]=H.useState(y);let S;e[6]!==s?(S=O=>{w(O),s.setValue("metadata.knowledge",O,{shouldDirty:!0})},e[6]=s,e[7]=S):S=e[7];const N=S;let C;e[8]!==l||e[9]!==b||e[10]!==N||e[11]!==n||e[12]!==i?(C=async O=>{if(!O||O.length===0)return;const J=Array.from(O),ye=J.filter(pl),pe=J.filter(fl);if(pe.length>0&&le.warning(n("virtualMcp.filesSection.fileTooLargeTitle"),{description:n("virtualMcp.filesSection.fileTooLargeDescription",{names:pe.map(ml).join(", ")})}),ye.length!==0){try{await i.mutateAsync({dir:_t,files:ye})}catch(D){const oe=D;le.error(oe instanceof Error?oe.message:n("virtualMcp.filesSection.failedUploadFile"));return}N([...b,...ye.map(D=>({id:crypto.randomUUID(),name:D.name,volume:Mt,path:`${_t}/${D.name}`,url:l(Mt,`${_t}/${D.name}`),contentType:D.type||null,size:D.size,addedAt:new Date().toISOString()}))])}},e[8]=l,e[9]=b,e[10]=N,e[11]=n,e[12]=i,e[13]=C):C=e[13];const M=C;let T;e[14]!==l||e[15]!==b||e[16]!==N?(T=O=>{b.some(J=>J.volume===O.volume&&J.path===O.path)||(N([...b,{id:crypto.randomUUID(),name:Ye(O.path),volume:O.volume,path:O.path,url:l(O.volume,O.path),contentType:null,size:O.size??null,addedAt:new Date().toISOString()}]),f(!1))},e[14]=l,e[15]=b,e[16]=N,e[17]=T):T=e[17];const V=T;let _;e[18]!==l||e[19]!==b||e[20]!==N?(_=O=>{b.some(J=>J.volume===O.volume&&J.path===O.path)||(N([...b,{id:crypto.randomUUID(),name:Ye(O.path),kind:"skill",volume:O.volume,path:O.path,url:l(O.volume,O.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),f(!1))},e[18]=l,e[19]=b,e[20]=N,e[21]=_):_=e[21];const E=_;let P;e[22]!==b||e[23]!==N?(P=O=>{N(b.filter(J=>J.id!==O))},e[22]=b,e[23]=N,e[24]=P):P=e[24];const A=P;let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=O=>{f(O),O&&p("")},e[25]=I):I=e[25];const K=I;let Q;e[26]!==b?(Q=new Set(b.map(ul)),e[26]=b,e[27]=Q):Q=e[27];const R=Q,F=o.toLowerCase();let Y;e[28]!==R?(Y=O=>!R.has(`${O.volume}/${O.path}`),e[28]=R,e[29]=Y):Y=e[29];const z=x.filter(dl).filter(Y).filter(O=>Ye(O.path).toLowerCase().includes(F)).slice(0,5);let L;e[30]!==R?(L=O=>!R.has(`${O.volume}/${O.path}`),e[30]=R,e[31]=L):L=e[31];const W=j.filter(L).filter(O=>Ye(O.path).toLowerCase().includes(F)).slice(0,5),G=O=>t.jsxs(Ms,{open:r,onOpenChange:K,children:[t.jsx(_s,{asChild:!0,children:O}),t.jsxs(Vs,{align:"end",className:"w-56",children:[t.jsxs(Je,{onSelect:()=>{d.current?.click()},children:[t.jsx(ci,{size:16}),n("virtualMcp.filesSection.uploadFile")]}),t.jsxs(Gt,{children:[t.jsxs(qt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(Fs,{size:16}),n("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(Ht,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Dt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:J=>p(J.target.value),onKeyDown:cl,placeholder:n("virtualMcp.filesSection.searchFilesPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:z.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noFilesFound")}):z.map(J=>t.jsxs(Je,{onSelect:()=>V(J),children:[t.jsx(ss,{filename:Ye(J.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ye(J.path)}),J.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:hs(J.size)})]},`${J.volume}/${J.path}`))})]})]}),t.jsxs(Gt,{children:[t.jsxs(qt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(dt,{size:16}),n("virtualMcp.filesSection.selectSkill")]}),t.jsxs(Ht,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Dt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:J=>p(J.target.value),onKeyDown:ol,placeholder:n("virtualMcp.filesSection.searchSkillsPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:W.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noSkillsFound")}):W.map(J=>t.jsxs(Je,{onSelect:()=>E(J),children:[t.jsx(dt,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ye(J.path)})]},`${J.volume}/${J.path}`))})]})]})]})]}),se="flex flex-col gap-3";let te;e[32]!==n?(te=n("virtualMcp.filesSection.filesAndSkills"),e[32]=n,e[33]=te):te=e[33];let k;e[34]!==te?(k=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:te}),e[34]=te,e[35]=k):k=e[35];let $;e[36]!==n?($=n("virtualMcp.filesSection.description"),e[36]=n,e[37]=$):$=e[37];let q;e[38]!==$?(q=t.jsx("p",{className:"text-sm text-muted-foreground",children:$}),e[38]=$,e[39]=q):q=e[39];let B;e[40]!==k||e[41]!==q?(B=t.jsxs("div",{className:"flex flex-col gap-1",children:[k,q]}),e[40]=k,e[41]=q,e[42]=B):B=e[42];const X=b.length>0&&G(t.jsxs(ee,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(nt,{size:"xs"}):t.jsx(ze,{size:14}),n("virtualMcp.filesSection.add")]}));let ae;e[43]!==B||e[44]!==X?(ae=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[B,X]}),e[43]=B,e[44]=X,e[45]=ae):ae=e[45];let je;e[46]!==M?(je=t.jsx("input",{ref:d,type:"file",multiple:!0,className:"hidden",onChange:O=>{M(O.target.files),O.target.value=""}}),e[46]=M,e[47]=je):je=e[47];let ie,ce;e[48]===Symbol.for("react.memo_cache_sentinel")?(ie=O=>{O.preventDefault(),m(!0)},ce=()=>m(!1),e[48]=ie,e[49]=ce):(ie=e[48],ce=e[49]);let ue;e[50]!==M?(ue=O=>{O.preventDefault(),O.stopPropagation(),m(!1),M(O.dataTransfer.files)},e[50]=M,e[51]=ue):ue=e[51];const ge=u&&"outline outline-2 outline-dashed outline-primary";let de;e[52]!==ge?(de=ve("flex flex-col gap-2 rounded-lg",ge),e[52]=ge,e[53]=de):de=e[53];const he=b.length===0?G(t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(ze,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:n("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):b.map(O=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 surface",children:[O.kind==="skill"?t.jsx("div",{className:"flex items-center justify-center h-8 w-6.5 shrink-0 rounded-md bg-muted text-muted-foreground",children:t.jsx(dt,{size:16})}):t.jsx(ss,{filename:O.name,className:"h-8 w-6.5 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:O.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:O.kind==="skill"?n("virtualMcp.filesSection.kindSkill"):O.size!=null?hs(O.size):n("virtualMcp.filesSection.kindFile")})]}),t.jsx(ee,{variant:"ghost",size:"icon",onClick:()=>A(O.id),"aria-label":n("virtualMcp.filesSection.removeAriaLabel",{name:O.name}),children:t.jsx(bt,{size:16})})]},O.id));let me;e[54]!==ie||e[55]!==ce||e[56]!==ue||e[57]!==de||e[58]!==he?(me=t.jsx("div",{onDragOver:ie,onDragLeave:ce,onDrop:ue,className:de,children:he}),e[54]=ie,e[55]=ce,e[56]=ue,e[57]=de,e[58]=he,e[59]=me):me=e[59];let fe;return e[60]!==ae||e[61]!==je||e[62]!==me?(fe=t.jsxs("section",{className:se,children:[ae,je,me]}),e[60]=ae,e[61]=je,e[62]=me,e[63]=fe):fe=e[63],fe}function ol(a){return a.stopPropagation()}function cl(a){return a.stopPropagation()}function dl(a){return a.kind!=="dir"}function ul(a){return`${a.volume}/${a.path}`}function ml(a){return a.name}function fl(a){return a.size>an}function pl(a){return a.size<=an}function tt(){const a=U.c(1);let e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(nt,{className:"size-6 text-muted-foreground"})}),a[0]=e):e=a[0],e}function ct(a,e){return({error:s})=>s?.message?.includes("Method not found")||s?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:a})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(Ts,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:e("virtualMcp.dependencySelectionDialog.somethingWentWrong")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:s?.message?s.message.length>200?`${s.message.slice(0,200)}...`:s.message:e("virtualMcp.dependencySelectionDialog.unexpectedError")})]})]})}function ln(a){const e=U.c(23),{item:s,isSelected:n,onToggle:i,disabled:l}=a,d=l?"cursor-not-allowed opacity-50":"cursor-pointer",r=n?"bg-accent/25":"hover:bg-accent";let f;e[0]!==d||e[1]!==r?(f=ve("flex items-start gap-3 p-4 rounded-lg transition-colors",d,r),e[0]=d,e[1]=r,e[2]=f):f=e[2];let o;e[3]!==s.name?(o=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:s.name}),e[3]=s.name,e[4]=o):o=e[4];let p;e[5]!==s.tags?(p=s.tags&&t.jsx("span",{className:"shrink-0",children:s.tags}),e[5]=s.tags,e[6]=p):p=e[6];let u;e[7]!==o||e[8]!==p?(u=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o,p]}),e[7]=o,e[8]=p,e[9]=u):u=e[9];let m;e[10]!==s.description?(m=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[10]=s.description,e[11]=m):m=e[11];let h;e[12]!==u||e[13]!==m?(h=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[u,m]}),e[12]=u,e[13]=m,e[14]=h):h=e[14];let c;e[15]!==l||e[16]!==n||e[17]!==i?(c=t.jsx(Li,{checked:n,onCheckedChange:i,disabled:l,className:"mt-0.5"}),e[15]=l,e[16]=n,e[17]=i,e[18]=c):c=e[18];let x;return e[19]!==f||e[20]!==h||e[21]!==c?(x=t.jsxs("label",{className:f,children:[h,c]}),e[19]=f,e[20]=h,e[21]=c,e[22]=x):x=e[22],x}function hl(a){const e=U.c(35),{activeTab:s,onTabChange:n,showSelectAll:i,isAllSelected:l,handleSelectAll:d}=a,r=Z();let f;e[0]!==r?(f=r("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=r,e[1]=f):f=e[1];let o;e[2]!==f?(o={id:"tools",label:f},e[2]=f,e[3]=o):o=e[3];let p;e[4]!==r?(p=r("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=r,e[5]=p):p=e[5];let u;e[6]!==p?(u={id:"active",label:p},e[6]=p,e[7]=u):u=e[7];let m;e[8]!==r?(m=r("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=r,e[9]=m):m=e[9];let h;e[10]!==m?(h={id:"resources",label:m},e[10]=m,e[11]=h):h=e[11];let c;e[12]!==r?(c=r("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=r,e[13]=c):c=e[13];let x;e[14]!==c?(x={id:"prompts",label:c},e[14]=c,e[15]=x):x=e[15];let g;e[16]!==o||e[17]!==u||e[18]!==h||e[19]!==x?(g=[o,u,h,x],e[16]=o,e[17]=u,e[18]=h,e[19]=x,e[20]=g):g=e[20];let v;e[21]!==n?(v=w=>n(w),e[21]=n,e[22]=v):v=e[22];let j;e[23]!==s||e[24]!==v||e[25]!==g?(j=t.jsx(Ri,{tabs:g,activeTab:s,onTabChange:v}),e[23]=s,e[24]=v,e[25]=g,e[26]=j):j=e[26];let y;e[27]!==d||e[28]!==l||e[29]!==i||e[30]!==r?(y=i&&t.jsx("button",{type:"button",onClick:d,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r(l?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=d,e[28]=l,e[29]=i,e[30]=r,e[31]=y):y=e[31];let b;return e[32]!==j||e[33]!==y?(b=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border shrink-0",children:[j,y]}),e[32]=j,e[33]=y,e[34]=b):b=e[34],b}function Ut(a){const e=U.c(13),{items:s,selections:n,onToggle:i,emptyMessage:l,disabled:d}=a;let r,f,o;if(e[0]!==d||e[1]!==l||e[2]!==s||e[3]!==i||e[4]!==n){o=Symbol.for("react.early_return_sentinel");e:{const u=s.map(xl);if(s.length===0){let m;e[8]!==l?(m=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:l})}),e[8]=l,e[9]=m):m=e[9],o=m;break e}r="flex-1 overflow-auto px-4 py-3 space-y-1",f=s.map(m=>t.jsx(ln,{item:m,isSelected:n===null||n?.includes(m.id),onToggle:()=>i(m.id,u),disabled:d},m.id))}e[0]=d,e[1]=l,e[2]=s,e[3]=i,e[4]=n,e[5]=r,e[6]=f,e[7]=o}else r=e[5],f=e[6],o=e[7];if(o!==Symbol.for("react.early_return_sentinel"))return o;let p;return e[10]!==r||e[11]!==f?(p=t.jsx("div",{className:r,children:f}),e[10]=r,e[11]=f,e[12]=p):p=e[12],p}function xl(a){return a.id}function gl(a){const e=U.c(22),{connectionId:s,toolSelections:n,onToggleTool:i}=a,l=Z(),{org:d}=Ee();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const f=yt(r);let o;e[4]!==f?(o={client:f},e[4]=f,e[5]=o):o=e[5];const{data:p}=Ws(o),u=p.tools;let m,h,c;if(e[6]!==p.tools||e[7]!==i||e[8]!==l||e[9]!==n){c=Symbol.for("react.early_return_sentinel");e:{const g=u.map(bl);let v;e[13]!==n?(v=b=>n===null||n.includes(b.name),e[13]=n,e[14]=v):v=e[14];const y=p.tools.filter(v).map(vl);if(y.length===0){let b;e[15]!==l?(b=l("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=l,e[16]=b):b=e[16];let w;e[17]!==b?(w=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:b})}),e[17]=b,e[18]=w):w=e[18],c=w;break e}m="flex-1 overflow-auto px-4 py-3 space-y-1",h=y.map(b=>t.jsx(ln,{item:b,isSelected:!0,onToggle:()=>i(b.id,g)},b.id))}e[6]=p.tools,e[7]=i,e[8]=l,e[9]=n,e[10]=m,e[11]=h,e[12]=c}else m=e[10],h=e[11],c=e[12];if(c!==Symbol.for("react.early_return_sentinel"))return c;let x;return e[19]!==m||e[20]!==h?(x=t.jsx("div",{className:m,children:h}),e[19]=m,e[20]=h,e[21]=x):x=e[21],x}function vl(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Bs,{annotations:a.annotations,_meta:a._meta})}}function bl(a){return a.name}function jl(a){const e=U.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:d}=Ee();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const f=yt(r);let o;e[4]!==f?(o={client:f},e[4]=f,e[5]=o):o=e[5];const{data:p}=Ws(o);let u;e[6]!==p.tools?(u=p.tools.map(yl),e[6]=p.tools,e[7]=u):u=e[7];const m=u,h=Z();let c;e[8]!==h?(c=h("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=h,e[9]=c):c=e[9];let x;return e[10]!==l||e[11]!==m||e[12]!==i||e[13]!==n||e[14]!==c?(x=t.jsx(Ut,{items:m,selections:n,onToggle:i,emptyMessage:c,disabled:l}),e[10]=l,e[11]=m,e[12]=i,e[13]=n,e[14]=c,e[15]=x):x=e[15],x}function yl(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Bs,{annotations:a.annotations,_meta:a._meta})}}function wl(a){const e=U.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:d}=Ee();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const f=yt(r);let o;e[4]!==f?(o={client:f},e[4]=f,e[5]=o):o=e[5];const{data:p}=gn(o);let u;e[6]!==p.resources?(u=p.resources.map(Sl),e[6]=p.resources,e[7]=u):u=e[7];const m=u,h=Z();let c;e[8]!==h?(c=h("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=h,e[9]=c):c=e[9];let x;return e[10]!==l||e[11]!==m||e[12]!==i||e[13]!==n||e[14]!==c?(x=t.jsx(Ut,{items:m,selections:n,onToggle:i,emptyMessage:c,disabled:l}),e[10]=l,e[11]=m,e[12]=i,e[13]=n,e[14]=c,e[15]=x):x=e[15],x}function Sl(a){return{id:a.name||a.uri,name:a.name||a.uri,description:a.description}}function Nl(a){const e=U.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:d}=Ee();let r;e[0]!==s||e[1]!==d.id||e[2]!==d.slug?(r={connectionId:s,orgId:d.id,orgSlug:d.slug},e[0]=s,e[1]=d.id,e[2]=d.slug,e[3]=r):r=e[3];const f=yt(r);let o;e[4]!==f?(o={client:f},e[4]=f,e[5]=o):o=e[5];const{data:p}=Ui(o);let u;e[6]!==p.prompts?(u=p.prompts.map(Cl),e[6]=p.prompts,e[7]=u):u=e[7];const m=u,h=Z();let c;e[8]!==h?(c=h("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=h,e[9]=c):c=e[9];let x;return e[10]!==l||e[11]!==m||e[12]!==i||e[13]!==n||e[14]!==c?(x=t.jsx(Ut,{items:m,selections:n,onToggle:i,emptyMessage:c,disabled:l}),e[10]=l,e[11]=m,e[12]=i,e[13]=n,e[14]=c,e[15]=x):x=e[15],x}function Cl(a){return{id:a.name,name:a.name,description:a.description}}function kl(a){const e=U.c(58),{currentConnection:s,activeTab:n,selectedId:i,formData:l,toggleTool:d,toggleResource:r,togglePrompt:f,toggleAllTools:o,toggleAllResources:p,toggleAllPrompts:u,onTabChange:m}=a,h=Z(),c=l[i],x=n==="tools"?c?.tools===null:n==="resources"?c?.resources===null:n==="prompts"?c?.prompts===null:!1,g=n!=="active";let v;e[0]!==n||e[1]!==i||e[2]!==u||e[3]!==p||e[4]!==o?(v=()=>{n==="tools"?o(i):n==="resources"?p(i):n==="prompts"&&u(i)},e[0]=n,e[1]=i,e[2]=u,e[3]=p,e[4]=o,e[5]=v):v=e[5];const j=v;let y;e[6]!==s.icon||e[7]!==s.title?(y=t.jsx(jt,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0"}),e[6]=s.icon,e[7]=s.title,e[8]=y):y=e[8];let b;e[9]!==s.title?(b=t.jsx("h2",{className:"text-base font-semibold truncate",children:s.title}),e[9]=s.title,e[10]=b):b=e[10];let w;e[11]!==s.description?(w=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[11]=s.description,e[12]=w):w=e[12];let S;e[13]!==b||e[14]!==w?(S=t.jsxs("div",{className:"flex-1 min-w-0",children:[b,w]}),e[13]=b,e[14]=w,e[15]=S):S=e[15];let N;e[16]!==y||e[17]!==S?(N=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[y,S]})}),e[16]=y,e[17]=S,e[18]=N):N=e[18];let C;e[19]!==n||e[20]!==j||e[21]!==x||e[22]!==m||e[23]!==g?(C=t.jsx(hl,{activeTab:n,onTabChange:m,showSelectAll:g,isAllSelected:x,handleSelectAll:j}),e[19]=n,e[20]=j,e[21]=x,e[22]=m,e[23]=g,e[24]=C):C=e[24];let M;e[25]!==n||e[26]!==l||e[27]!==i||e[28]!==h||e[29]!==d?(M=n==="active"&&t.jsx(Xe,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(tt,{}),children:t.jsx(gl,{connectionId:i,toolSelections:l[i]?l[i].tools:[],onToggleTool:(A,I)=>d(i,A,I)})})}),e[25]=n,e[26]=l,e[27]=i,e[28]=h,e[29]=d,e[30]=M):M=e[30];let T;e[31]!==n||e[32]!==l||e[33]!==i||e[34]!==h||e[35]!==d?(T=n==="tools"&&t.jsx(Xe,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(tt,{}),children:t.jsx(jl,{connectionId:i,selections:l[i]?l[i].tools:[],onToggle:(A,I)=>d(i,A,I)})})}),e[31]=n,e[32]=l,e[33]=i,e[34]=h,e[35]=d,e[36]=T):T=e[36];let V;e[37]!==n||e[38]!==l||e[39]!==i||e[40]!==h||e[41]!==r?(V=n==="resources"&&t.jsx(Xe,{fallback:ct(h("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(tt,{}),children:t.jsx(wl,{connectionId:i,selections:l[i]?l[i].resources:[],onToggle:(A,I)=>r(i,A,I)})})}),e[37]=n,e[38]=l,e[39]=i,e[40]=h,e[41]=r,e[42]=V):V=e[42];let _;e[43]!==n||e[44]!==l||e[45]!==i||e[46]!==h||e[47]!==f?(_=n==="prompts"&&t.jsx(Xe,{fallback:ct(h("virtualMcp.dependencySelectionDialog.promptsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(tt,{}),children:t.jsx(Nl,{connectionId:i,selections:l[i]?l[i].prompts:[],onToggle:(A,I)=>f(i,A,I)})})}),e[43]=n,e[44]=l,e[45]=i,e[46]=h,e[47]=f,e[48]=_):_=e[48];let E;e[49]!==V||e[50]!==_||e[51]!==M||e[52]!==T?(E=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[M,T,V,_]}),e[49]=V,e[50]=_,e[51]=M,e[52]=T,e[53]=E):E=e[53];let P;return e[54]!==E||e[55]!==N||e[56]!==C?(P=t.jsxs(t.Fragment,{children:[N,C,E]}),e[54]=E,e[55]=N,e[56]=C,e[57]=P):P=e[57],P}function Ml(a){const e=U.c(7),{onClose:s}=a,n=Z();let i;e[0]!==s?(i=()=>s(!1),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==n?(l=n("virtualMcp.dependencySelectionDialog.done"),e[2]=n,e[3]=l):l=e[3];let d;return e[4]!==i||e[5]!==l?(d=t.jsx($t,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(ee,{variant:"outline",onClick:i,children:l})}),e[4]=i,e[5]=l,e[6]=d):d=e[6],d}function _l(a){const e=U.c(23),{connectionId:s,onAuthenticate:n,children:i}=a,l=Z();let d;e[0]!==s?(d={connectionId:s},e[0]=s,e[1]=d):d=e[1];const r=Ys(d);if(r.supportsOAuth&&!r.isAuthenticated){let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-muted",children:t.jsx(di,{size:22,className:"text-muted-foreground"})}),e[2]=p):p=e[2];let u;e[3]!==l?(u=l("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=l,e[4]=u):u=e[4];let m;e[5]!==u?(m=t.jsx("p",{className:"text-sm font-medium",children:u}),e[5]=u,e[6]=m):m=e[6];let h;e[7]!==l?(h=l("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=l,e[8]=h):h=e[8];let c;e[9]!==h?(c=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:h}),e[9]=h,e[10]=c):c=e[10];let x;e[11]!==m||e[12]!==c?(x=t.jsxs("div",{className:"space-y-1",children:[m,c]}),e[11]=m,e[12]=c,e[13]=x):x=e[13];let g;e[14]!==s||e[15]!==n||e[16]!==l?(g=n&&t.jsx(ee,{variant:"outline",size:"sm",onClick:()=>n(s),children:l("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=s,e[15]=n,e[16]=l,e[17]=g):g=e[17];let v;return e[18]!==x||e[19]!==g?(v=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-8 text-center",children:[p,x,g]}),e[18]=x,e[19]=g,e[20]=v):v=e[20],v}let o;return e[21]!==i?(o=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=o):o=e[22],o}function Vl(a){const e={};for(const s of a)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function xs(a){return Object.entries(a).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function gs(a,e,s,n){const i=a[e]??{tools:null,resources:null,prompts:null};return{...a,[e]:{...i,[s]:n}}}function Tl(a,e){return e.type==="SET_ACTIVE_TAB"?{...a,activeTab:e.payload}:a}function Dl(a){const e=U.c(49),{open:s,onOpenChange:n,selectedId:i,form:l,connections:d,onAuthenticate:r}=a;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={activeTab:"tools"},e[0]=f):f=e[0];const[o,p]=H.useReducer(Tl,f),u=Rt(i??"");let m;e[1]!==d?(m=d??[],e[1]=d,e[2]=m):m=e[2];let h;e[3]!==m?(h=Vl(m),e[3]=m,e[4]=h):h=e[4];const c=h;let x;e[5]!==l||e[6]!==c?(x=(z,L,W,G)=>{const se=c[z]?.[L];let te;se===null?te=G.filter(k=>k!==W):se?.includes(W)?te=se.filter(k=>k!==W):(te=[...se??[],W],te.length===G.length&&(te=null)),l.setValue("connections",xs(gs(c,z,L,te)),{shouldDirty:!0,shouldTouch:!0})},e[5]=l,e[6]=c,e[7]=x):x=e[7];const g=x;let v;e[8]!==l||e[9]!==c?(v=(z,L)=>{const G=c[z]?.[L]===null?[]:null;l.setValue("connections",xs(gs(c,z,L,G)),{shouldDirty:!0,shouldTouch:!0})},e[8]=l,e[9]=c,e[10]=v):v=e[10];const j=v;let y;e[11]!==g?(y=(z,L,W)=>g(z,"tools",L,W),e[11]=g,e[12]=y):y=e[12];const b=y;let w;e[13]!==g?(w=(z,L,W)=>g(z,"resources",L,W),e[13]=g,e[14]=w):w=e[14];const S=w;let N;e[15]!==g?(N=(z,L,W)=>g(z,"prompts",L,W),e[15]=g,e[16]=N):N=e[16];const C=N;let M;e[17]!==j?(M=z=>j(z,"tools"),e[17]=j,e[18]=M):M=e[18];const T=M;let V;e[19]!==j?(V=z=>j(z,"resources"),e[19]=j,e[20]=V):V=e[20];const _=V;let E;e[21]!==j?(E=z=>j(z,"prompts"),e[21]=j,e[22]=E):E=e[22];const P=E;if(!i||!u)return null;let A;e[23]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(tt,{}),e[23]=A):A=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=z=>p({type:"SET_ACTIVE_TAB",payload:z}),e[24]=I):I=e[24];let K;e[25]!==u||e[26]!==o.activeTab||e[27]!==c||e[28]!==i||e[29]!==P||e[30]!==_||e[31]!==T||e[32]!==C||e[33]!==S||e[34]!==b?(K=t.jsx(kl,{currentConnection:u,activeTab:o.activeTab,selectedId:i,formData:c,toggleTool:b,toggleResource:S,togglePrompt:C,toggleAllTools:T,toggleAllResources:_,toggleAllPrompts:P,onTabChange:I},i),e[25]=u,e[26]=o.activeTab,e[27]=c,e[28]=i,e[29]=P,e[30]=_,e[31]=T,e[32]=C,e[33]=S,e[34]=b,e[35]=K):K=e[35];let Q;e[36]!==r||e[37]!==i||e[38]!==K?(Q=t.jsx(H.Suspense,{fallback:A,children:t.jsx(_l,{connectionId:i,onAuthenticate:r,children:K})}),e[36]=r,e[37]=i,e[38]=K,e[39]=Q):Q=e[39];let R;e[40]!==n?(R=t.jsx(Ml,{onClose:n}),e[40]=n,e[41]=R):R=e[41];let F;e[42]!==Q||e[43]!==R?(F=t.jsxs(it,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[Q,R]}),e[42]=Q,e[43]=R,e[44]=F):F=e[44];let Y;return e[45]!==n||e[46]!==s||e[47]!==F?(Y=t.jsx(at,{open:s,onOpenChange:n,children:F}),e[45]=n,e[46]=s,e[47]=F,e[48]=Y):Y=e[48],Y}const vs="__new_instance__";function Pl(a){const e=U.c(25),{connection_id:s,usedConnectionIds:n,onOpenSettings:i,onRemove:l,onAuthenticate:d,onSwitchInstance:r,onNewInstance:f}=a,o=Rt(s),{org:p}=Ee();if(!o){let g;return e[0]!==l?(g=t.jsx(Al,{onRemove:l}),e[0]=l,e[1]=g):g=e[1],g}let u;e[2]!==o?(u=Bi(o),e[2]=o,e[3]=u):u=e[3];const m=u;let h;e[4]!==s?(h=t.jsx($l,{connection_id:s}),e[4]=s,e[5]=h):h=e[5];let c;e[6]!==o.app_name||e[7]!==o.connection_type||e[8]!==o.description||e[9]!==o.icon||e[10]!==o.status||e[11]!==o.title||e[12]!==s||e[13]!==d||e[14]!==f||e[15]!==i||e[16]!==l||e[17]!==r||e[18]!==p.slug||e[19]!==m||e[20]!==n?(c=t.jsx(Il,{connection_id:s,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,connectionType:o.connection_type,connectionStatus:o.status,slug:m,orgSlug:p.slug,appName:o.app_name,usedConnectionIds:n,onOpenSettings:i,onRemove:l,onAuthenticate:d,onSwitchInstance:r,onNewInstance:f}),e[6]=o.app_name,e[7]=o.connection_type,e[8]=o.description,e[9]=o.icon,e[10]=o.status,e[11]=o.title,e[12]=s,e[13]=d,e[14]=f,e[15]=i,e[16]=l,e[17]=r,e[18]=p.slug,e[19]=m,e[20]=n,e[21]=c):c=e[21];let x;return e[22]!==h||e[23]!==c?(x=t.jsx(H.Suspense,{fallback:h,children:c}),e[22]=h,e[23]=c,e[24]=x):x=e[24],x}function Ol(a){const e=U.c(24),{appName:s,connectionId:n,usedConnectionIds:i,onSwitchInstance:l,onNewInstance:d}=a,r=Z();let f;e[0]!==s?(f={filters:[{column:"app_name",value:s}]},e[0]=s,e[1]=f):f=e[1];const o=li(f);if(o.length<=1&&!d)return null;let p;e[2]!==n||e[3]!==d||e[4]!==l?(p=g=>{g===vs?d?.():l(n,g)},e[2]=n,e[3]=d,e[4]=l,e[5]=p):p=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Re,{size:"xs",className:"w-auto gap-1 shadow-none",children:t.jsx(Le,{})}),e[6]=u):u=e[6];let m;if(e[7]!==n||e[8]!==o||e[9]!==i){let g;e[11]!==n||e[12]!==i?(g=v=>t.jsx(Pe,{value:v.id,className:"text-xs",disabled:v.id!==n&&i.has(v.id),children:v.title},v.id),e[11]=n,e[12]=i,e[13]=g):g=e[13],m=o.map(g),e[7]=n,e[8]=o,e[9]=i,e[10]=m}else m=e[10];let h;e[14]!==d||e[15]!==r?(h=d&&t.jsxs(Pe,{value:vs,className:"text-xs text-muted-foreground",children:["+ ",r("virtualMcp.connectionItem.newInstance")]}),e[14]=d,e[15]=r,e[16]=h):h=e[16];let c;e[17]!==m||e[18]!==h?(c=t.jsxs(Ue,{children:[m,h]}),e[17]=m,e[18]=h,e[19]=c):c=e[19];let x;return e[20]!==n||e[21]!==p||e[22]!==c?(x=t.jsxs(Be,{value:n,onValueChange:p,children:[u,c]}),e[20]=n,e[21]=p,e[22]=c,e[23]=x):x=e[23],x}function Il({connection_id:a,connectionTitle:e,connectionDescription:s,connectionIcon:n,connectionType:i,connectionStatus:l,slug:d,orgSlug:r,appName:f,usedConnectionIds:o,onOpenSettings:p,onRemove:u,onAuthenticate:m,onSwitchInstance:h,onNewInstance:c}){const x=Ys({connectionId:a}),g=$s(),j=!(i==="VIRTUAL")&&x.supportsOAuth&&!x.isAuthenticated,y=l!=="active",b=Z(),w=async S=>{try{await g.update.mutateAsync({id:a,data:{status:S}}),le.success(b(S==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{le.error(b("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:ve("surface overflow-hidden transition-colors",(j||y)&&"shadow-edge-destructive bg-destructive/5"),children:[t.jsxs(At,{to:"/$org/settings/connections/$appSlug",params:{org:r,appSlug:d},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-accent transition-colors",children:[t.jsx(jt,{icon:n,name:e,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:e}),j?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b("virtualMcp.connectionItem.needsAuthorization")}):y?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b(l==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):s&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s})]}),j?t.jsx(ee,{variant:"outline",size:"sm",className:"shrink-0",onClick:S=>{S.preventDefault(),S.stopPropagation(),m(a)},children:b("virtualMcp.connectionItem.authorize")}):y?t.jsxs(ee,{variant:"outline",size:"sm",className:"gap-1.5 shrink-0",onClick:S=>{S.preventDefault(),S.stopPropagation(),w("active")},children:[t.jsx(ui,{size:13}),b("virtualMcp.connectionItem.enable")]}):t.jsxs(Ve,{delayDuration:0,children:[t.jsx(Te,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center rounded-md h-7 w-7 hover:bg-accent text-muted-foreground shrink-0 transition-colors",children:t.jsx(Oi,{size:16})})}),t.jsx(De,{side:"bottom",children:b("virtualMcp.connectionItem.connectionSettings")})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-t border-border bg-muted/25",children:[f&&t.jsx(Ol,{appName:f,connectionId:a,usedConnectionIds:o,onSwitchInstance:h,onNewInstance:c}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(Ve,{delayDuration:0,children:[t.jsx(Te,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon-sm",onClick:p,"aria-label":b("virtualMcp.connectionItem.configureResources"),children:t.jsx(mi,{size:13})})}),t.jsx(De,{side:"bottom",children:b("virtualMcp.connectionItem.configureResources")})]}),!y&&t.jsxs(Ve,{delayDuration:0,children:[t.jsx(Te,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground",onClick:()=>w("inactive"),"aria-label":b("virtualMcp.connectionItem.disableConnection"),children:t.jsx(fi,{size:13})})}),t.jsx(De,{side:"bottom",children:b("virtualMcp.connectionItem.disable")})]}),t.jsxs(Ve,{delayDuration:0,children:[t.jsx(Te,{asChild:!0,children:t.jsx(ee,{variant:"ghost-destructive",size:"icon-sm",onClick:u,"aria-label":b("virtualMcp.connectionItem.removeConnection"),children:t.jsx(Ks,{size:13})})}),t.jsx(De,{side:"bottom",children:b("virtualMcp.connectionItem.remove")})]})]})]})]})}function $l(a){const e=U.c(17),{connection_id:s}=a,n=Rt(s);if(!n){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(rn,{}),e[0]=u):u=e[0],u}let i;e[1]!==n.icon||e[2]!==n.title?(i=t.jsx(jt,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0"}),e[1]=n.icon,e[2]=n.title,e[3]=i):i=e[3];let l;e[4]!==n.title?(l=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[4]=n.title,e[5]=l):l=e[5];let d;e[6]!==n.description?(d=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[6]=n.description,e[7]=d):d=e[7];let r;e[8]!==l||e[9]!==d?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,d]}),e[8]=l,e[9]=d,e[10]=r):r=e[10];let f;e[11]!==i||e[12]!==r?(f=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,r]}),e[11]=i,e[12]=r,e[13]=f):f=e[13];let o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})}),e[14]=o):o=e[14];let p;return e[15]!==f?(p=t.jsxs("div",{className:"surface overflow-hidden",children:[f,o]}),e[15]=f,e[16]=p):p=e[16],p}function Al(a){const e=U.c(20),{onRemove:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.connectionItem.connectionNotFound"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==i?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm text-destructive font-medium truncate",children:i})}),e[2]=i,e[3]=l):l=e[3];let d;e[4]!==n?(d=n("virtualMcp.connectionItem.removeConnection"),e[4]=n,e[5]=d):d=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ks,{size:13}),e[6]=r):r=e[6];let f;e[7]!==s||e[8]!==d?(f=t.jsx(Te,{asChild:!0,children:t.jsx(ee,{variant:"ghost-destructive",size:"icon-sm",className:"shrink-0",onClick:s,"aria-label":d,children:r})}),e[7]=s,e[8]=d,e[9]=f):f=e[9];let o;e[10]!==n?(o=n("virtualMcp.connectionItem.remove"),e[10]=n,e[11]=o):o=e[11];let p;e[12]!==o?(p=t.jsx(De,{side:"bottom",children:o}),e[12]=o,e[13]=p):p=e[13];let u;e[14]!==f||e[15]!==p?(u=t.jsxs(Ve,{delayDuration:0,children:[f,p]}),e[14]=f,e[15]=p,e[16]=u):u=e[16];let m;return e[17]!==l||e[18]!==u?(m=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-destructive/50 bg-destructive/5",children:[l,u]}),e[17]=l,e[18]=u,e[19]=m):m=e[19],m}function rn(){const a=U.c(3);let e;a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),a[0]=e):e=a[0];let s;a[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e,t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-48 rounded bg-muted animate-pulse"})]})]}),a[1]=s):s=a[1];let n;return a[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"surface overflow-hidden",children:[s,t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})})]}),a[2]=n):n=a[2],n}function on(a){const e=U.c(85),{value:s,onChange:n,onColorChange:i,name:l,size:d,className:r,avatarClassName:f,showHoverOverlay:o,disabled:p}=a,u=d===void 0?"lg":d,m=o===void 0?!0:o,h=p===void 0?!1:p,c=Z(),[x,g]=H.useState(!1),[v,j]=H.useState("icons"),[y,b]=H.useState(""),[w,S]=H.useState("blue");let N;e[0]!==s?(N=pi(s),e[0]=s,e[1]=N):N=e[1];const C=N,M=C.type==="icon"||C.type==="url"&&C.color?C.color:w;let T;e[2]!==n||e[3]!==M?(T=pe=>{n(kt(pe,M))},e[2]=n,e[3]=M,e[4]=T):T=e[4];const V=T;let _;e[5]!==n||e[6]!==i||e[7]!==C.name||e[8]!==C.type||e[9]!==C.url?(_=pe=>{S(pe),i?.(pe),C.type==="icon"?n(kt(C.name,pe)):C.type==="url"&&n(Jt(C.url,pe))},e[5]=n,e[6]=i,e[7]=C.name,e[8]=C.type,e[9]=C.url,e[10]=_):_=e[10];const E=_;let P;e[11]!==n||e[12]!==M?(P=pe=>{n(Jt(pe,M)),g(!1)},e[11]=n,e[12]=M,e[13]=P):P=e[13];const A=P;let I;e[14]!==n||e[15]!==M?(I=()=>{const pe=zs(),D=pe[Math.floor(Math.random()*pe.length)];n(kt(D,M))},e[14]=n,e[15]=M,e[16]=I):I=e[16];const K=I,Q=h?!1:x;let R;e[17]!==c?(R=c("common.iconPicker.changeIcon"),e[17]=c,e[18]=R):R=e[18];const F=h?"cursor-default opacity-50":"cursor-pointer";let Y;e[19]!==r||e[20]!==u||e[21]!==F?(Y=ve("relative group overflow-hidden",F,hi(u),r),e[19]=r,e[20]=u,e[21]=F,e[22]=Y):Y=e[22];let z;e[23]!==f||e[24]!==l||e[25]!==u||e[26]!==s?(z=t.jsx(Zt,{icon:s,name:l,size:u,className:f}),e[23]=f,e[24]=l,e[25]=u,e[26]=s,e[27]=z):z=e[27];let L;e[28]!==h||e[29]!==m?(L=m&&!h&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(bi,{size:16,className:"text-white"})}),e[28]=h,e[29]=m,e[30]=L):L=e[30];let W;e[31]!==h||e[32]!==R||e[33]!==Y||e[34]!==z||e[35]!==L?(W=t.jsx(Gs,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":R,disabled:h,className:Y,children:[z,L]})}),e[31]=h,e[32]=R,e[33]=Y,e[34]=z,e[35]=L,e[36]=W):W=e[36];let G;e[37]!==l||e[38]!==s?(G=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(Zt,{icon:s,name:l,size:"xl"})}),e[37]=l,e[38]=s,e[39]=G):G=e[39];let se;e[40]!==v?(se=pe=>{if(pe.key!=="ArrowLeft"&&pe.key!=="ArrowRight")return;pe.preventDefault();const D=v==="icons"?"upload":"icons";j(D),document.getElementById(`icon-picker-tab-${D}`)?.focus()},e[40]=v,e[41]=se):se=e[41];const te=v==="icons",k=v==="icons"?0:-1;let $;e[42]===Symbol.for("react.memo_cache_sentinel")?($=()=>j("icons"),e[42]=$):$=e[42];const q=v==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let B;e[43]!==q?(B=ve("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",q),e[43]=q,e[44]=B):B=e[44];let X;e[45]!==c?(X=c("common.iconPicker.iconsTab"),e[45]=c,e[46]=X):X=e[46];let ae;e[47]!==te||e[48]!==k||e[49]!==B||e[50]!==X?(ae=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":te,"aria-controls":"icon-picker-panel-icons",tabIndex:k,onClick:$,className:B,children:X}),e[47]=te,e[48]=k,e[49]=B,e[50]=X,e[51]=ae):ae=e[51];const je=v==="upload",ie=v==="upload"?0:-1;let ce;e[52]===Symbol.for("react.memo_cache_sentinel")?(ce=()=>j("upload"),e[52]=ce):ce=e[52];const ue=v==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let ge;e[53]!==ue?(ge=ve("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",ue),e[53]=ue,e[54]=ge):ge=e[54];let de;e[55]!==c?(de=c("common.iconPicker.uploadTab"),e[55]=c,e[56]=de):de=e[56];let he;e[57]!==je||e[58]!==ie||e[59]!==ge||e[60]!==de?(he=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":je,"aria-controls":"icon-picker-panel-upload",tabIndex:ie,onClick:ce,className:ge,children:de}),e[57]=je,e[58]=ie,e[59]=ge,e[60]=de,e[61]=he):he=e[61];let me;e[62]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx("div",{className:"flex-1"}),e[62]=me):me=e[62];let fe;e[63]!==se||e[64]!==ae||e[65]!==he?(fe=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:se,children:[ae,he,me]}),e[63]=se,e[64]=ae,e[65]=he,e[66]=fe):fe=e[66];let O;e[67]!==E||e[68]!==K||e[69]!==V||e[70]!==A||e[71]!==C.name||e[72]!==C.type||e[73]!==y||e[74]!==M||e[75]!==v?(O=v==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(Rl,{search:y,onSearchChange:b,selectedColor:M,onColorChange:E,onSelectIcon:V,onRandom:K,currentIconName:C.type==="icon"?C.name:null})}):t.jsx("div",{id:"icon-picker-panel-upload",role:"tabpanel","aria-labelledby":"icon-picker-tab-upload",children:t.jsx(Ll,{onUpload:A})}),e[67]=E,e[68]=K,e[69]=V,e[70]=A,e[71]=C.name,e[72]=C.type,e[73]=y,e[74]=M,e[75]=v,e[76]=O):O=e[76];let J;e[77]!==G||e[78]!==fe||e[79]!==O?(J=t.jsx(qs,{align:"start",className:"w-80 p-0",onOpenAutoFocus:El,children:t.jsxs("div",{className:"flex flex-col",children:[G,fe,O]})}),e[77]=G,e[78]=fe,e[79]=O,e[80]=J):J=e[80];let ye;return e[81]!==W||e[82]!==J||e[83]!==Q?(ye=t.jsxs(Hs,{open:Q,onOpenChange:g,children:[W,J]}),e[81]=W,e[82]=J,e[83]=Q,e[84]=ye):ye=e[84],ye}function El(a){return a.preventDefault()}function Fl(a){const e=U.c(33),{selectedColor:s,onColorChange:n}=a,i=Z(),[l,d]=H.useState(!1);let r,f,o,p,u,m,h;if(e[0]!==l||e[1]!==s){const w=Rs(s);f=Hs,m=l,h=d,r=Gs,u=!0,o="button",p=ve("h-6 w-6 rounded-full shrink-0 ring-2 ring-offset-2 ring-offset-background transition-all cursor-pointer hover:scale-110",w.dot,"ring-foreground/20"),e[0]=l,e[1]=s,e[2]=r,e[3]=f,e[4]=o,e[5]=p,e[6]=u,e[7]=m,e[8]=h}else r=e[2],f=e[3],o=e[4],p=e[5],u=e[6],m=e[7],h=e[8];let c;e[9]!==i?(c=i("common.iconPicker.changeColor"),e[9]=i,e[10]=c):c=e[10];let x;e[11]!==i?(x=i("common.iconPicker.changeColor"),e[11]=i,e[12]=x):x=e[12];let g;e[13]!==o||e[14]!==p||e[15]!==c||e[16]!==x?(g=t.jsx("button",{type:o,className:p,title:c,"aria-label":x}),e[13]=o,e[14]=p,e[15]=c,e[16]=x,e[17]=g):g=e[17];let v;e[18]!==r||e[19]!==u||e[20]!==g?(v=t.jsx(r,{asChild:u,children:g}),e[18]=r,e[19]=u,e[20]=g,e[21]=v):v=e[21];let j;e[22]!==n||e[23]!==s?(j=yi.map(w=>t.jsx("button",{type:"button",onClick:()=>{n(w.name),d(!1)},className:ve("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",w.dot,s===w.name?"ring-2 ring-offset-1 ring-offset-background ring-foreground/30 scale-110":"hover:scale-110"),title:w.name,"aria-label":w.name},w.name)),e[22]=n,e[23]=s,e[24]=j):j=e[24];let y;e[25]!==j?(y=t.jsx(qs,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:zl,children:t.jsx("div",{className:"grid grid-cols-4 gap-1",children:j})}),e[25]=j,e[26]=y):y=e[26];let b;return e[27]!==f||e[28]!==y||e[29]!==m||e[30]!==h||e[31]!==v?(b=t.jsxs(f,{open:m,onOpenChange:h,children:[v,y]}),e[27]=f,e[28]=y,e[29]=m,e[30]=h,e[31]=v,e[32]=b):b=e[32],b}function zl(a){return a.preventDefault()}function Rl(a){const e=U.c(55),{search:s,onSearchChange:n,selectedColor:i,onColorChange:l,onSelectIcon:d,onRandom:r,currentIconName:f}=a,o=Z();let p,u,m,h,c,x,g;if(e[0]!==f||e[1]!==l||e[2]!==r||e[3]!==n||e[4]!==d||e[5]!==s||e[6]!==i||e[7]!==o){const w=zs(),S=Rs(i);u=xi(w,s),x="flex flex-col";let N;e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Dt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=N):N=e[15];let C;e[16]!==n?(C=I=>n(I.target.value),e[16]=n,e[17]=C):C=e[17];let M;e[18]!==o?(M=o("common.iconPicker.filterPlaceholder"),e[18]=o,e[19]=M):M=e[19];let T;e[20]!==s||e[21]!==C||e[22]!==M?(T=t.jsxs("div",{className:"relative flex-1",children:[N,t.jsx(Ne,{value:s,onChange:C,placeholder:M,size:"sm",className:"text-xs pl-7"})]}),e[20]=s,e[21]=C,e[22]=M,e[23]=T):T=e[23];let V;e[24]!==o?(V=o("common.iconPicker.randomIcon"),e[24]=o,e[25]=V):V=e[25];let _;e[26]!==o?(_=o("common.iconPicker.randomIcon"),e[26]=o,e[27]=_):_=e[27];let E;e[28]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ji,{className:"size-3.5 text-muted-foreground"}),e[28]=E):E=e[28];let P;e[29]!==r||e[30]!==V||e[31]!==_?(P=t.jsx(ee,{type:"button",variant:"outline",size:"icon",onClick:r,className:"shrink-0",title:V,"aria-label":_,children:E}),e[29]=r,e[30]=V,e[31]=_,e[32]=P):P=e[32];let A;e[33]!==l||e[34]!==i?(A=t.jsx(Fl,{selectedColor:i,onColorChange:l}),e[33]=l,e[34]=i,e[35]=A):A=e[35],e[36]!==P||e[37]!==A||e[38]!==T?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[T,P,A]}),e[36]=P,e[37]=A,e[38]=T,e[39]=g):g=e[39],p=Yi,c="h-56",m="grid grid-cols-9 gap-0.5 px-2 pb-2",h=u.map(I=>{const K=gi(I);return K?t.jsx("button",{type:"button",onClick:()=>d(I),className:ve("h-8 w-8 flex items-center justify-center rounded-lg transition-colors cursor-pointer",f===I?ve(S.bg,S.text):ve(S.text,"hover:bg-accent")),title:I,"aria-label":vi(I),children:t.jsx(K,{size:18})},I):null}),e[0]=f,e[1]=l,e[2]=r,e[3]=n,e[4]=d,e[5]=s,e[6]=i,e[7]=o,e[8]=p,e[9]=u,e[10]=m,e[11]=h,e[12]=c,e[13]=x,e[14]=g}else p=e[8],u=e[9],m=e[10],h=e[11],c=e[12],x=e[13],g=e[14];let v;e[40]!==m||e[41]!==h?(v=t.jsx("div",{className:m,children:h}),e[40]=m,e[41]=h,e[42]=v):v=e[42];let j;e[43]!==u.length||e[44]!==o?(j=u.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:o("common.iconPicker.noIconsFound")}),e[43]=u.length,e[44]=o,e[45]=j):j=e[45];let y;e[46]!==p||e[47]!==c||e[48]!==v||e[49]!==j?(y=t.jsxs(p,{className:c,children:[v,j]}),e[46]=p,e[47]=c,e[48]=v,e[49]=j,e[50]=y):y=e[50];let b;return e[51]!==x||e[52]!==g||e[53]!==y?(b=t.jsxs("div",{className:x,children:[g,y]}),e[51]=x,e[52]=g,e[53]=y,e[54]=b):b=e[54],b}function Ll(a){const e=U.c(46),{onUpload:s}=a,n=Z(),i=H.useRef(null);let l;e[0]!==s||e[1]!==n?(l=P=>{const A=P.target.files?.[0];if(!A)return;if(A.size>2097152){le.error(n("common.iconPicker.imageTooLarge")),P.target.value="";return}const I=new FileReader;I.onerror=()=>{le.error(n("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},I.onloadend=()=>{I.readyState===FileReader.DONE&&I.result&&s(I.result),i.current&&(i.current.value="")},I.readAsDataURL(A)},e[0]=s,e[1]=n,e[2]=l):l=e[2];const d=l,[r,f]=H.useState("");let o;e[3]!==s||e[4]!==r?(o=()=>{const P=r.trim();P&&(s(P),f(""))},e[3]=s,e[4]=r,e[5]=o):o=e[5];const p=o;let u;e[6]!==d?(u=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:d}),e[6]=d,e[7]=u):u=e[7];let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=()=>i.current?.click(),e[8]=m):m=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Wi,{size:20}),e[9]=h):h=e[9];let c;e[10]!==n?(c=n("common.iconPicker.uploadHint"),e[10]=n,e[11]=c):c=e[11];let x;e[12]!==c?(x=t.jsxs("button",{type:"button",onClick:m,className:"h-24 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent transition-colors flex flex-col items-center justify-center gap-2 text-muted-foreground hover:text-foreground",children:[h,t.jsx("span",{className:"text-xs",children:c})]}),e[12]=c,e[13]=x):x=e[13];let g;e[14]!==n?(g=n("common.iconPicker.or"),e[14]=n,e[15]=g):g=e[15];let v;e[16]!==g?(v=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[16]=g,e[17]=v):v=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 h-px bg-border"}),e[18]=j):j=e[18];let y;e[19]!==v?(y=t.jsxs("div",{className:"flex items-center gap-2",children:[v,j]}),e[19]=v,e[20]=y):y=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=P=>f(P.target.value),e[21]=b):b=e[21];let w;e[22]!==n?(w=n("common.iconPicker.pasteUrlPlaceholder"),e[22]=n,e[23]=w):w=e[23];let S;e[24]!==p?(S=P=>{P.key==="Enter"&&(P.preventDefault(),p())},e[24]=p,e[25]=S):S=e[25];let N;e[26]!==r||e[27]!==w||e[28]!==S?(N=t.jsx(Ne,{value:r,onChange:b,placeholder:w,className:"h-8 text-xs flex-1",onKeyDown:S}),e[26]=r,e[27]=w,e[28]=S,e[29]=N):N=e[29];let C;e[30]!==r?(C=r.trim(),e[30]=r,e[31]=C):C=e[31];const M=!C;let T;e[32]!==n?(T=n("common.iconPicker.apply"),e[32]=n,e[33]=T):T=e[33];let V;e[34]!==p||e[35]!==M||e[36]!==T?(V=t.jsx(ee,{variant:"outline",className:"shrink-0",onClick:p,disabled:M,children:T}),e[34]=p,e[35]=M,e[36]=T,e[37]=V):V=e[37];let _;e[38]!==N||e[39]!==V?(_=t.jsxs("div",{className:"flex items-center gap-1.5",children:[N,V]}),e[38]=N,e[39]=V,e[40]=_):_=e[40];let E;return e[41]!==y||e[42]!==_||e[43]!==u||e[44]!==x?(E=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[u,x,y,_]}),e[41]=y,e[42]=_,e[43]=u,e[44]=x,e[45]=E):E=e[45],E}function Ul(a){const e=U.c(14),{viewId:s}=a;if(s==="overview"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ls,{size:16}),e[0]=i):i=e[0],i}if(s==="context"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Fs,{size:16}),e[1]=i):i=e[1],i}if(s==="monitor"){let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(wi,{size:16}),e[2]=i):i=e[2],i}if(s==="plan"){let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Si,{size:16}),e[3]=i):i=e[3],i}if(s==="reports"){let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ni,{size:16}),e[4]=i):i=e[4],i}if(s==="board"){let i;return e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ci,{size:16}),e[5]=i):i=e[5],i}if(s==="site-editor"){let i;return e[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Gi,{size:16}),e[6]=i):i=e[6],i}if(s==="assets"){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ii,{size:16}),e[7]=i):i=e[7],i}if(s==="releases"){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ki,{size:16}),e[8]=i):i=e[8],i}if(s==="hosting"){let i;return e[9]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(bn,{size:16}),e[9]=i):i=e[9],i}if(s==="e2e"){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Mi,{size:16}),e[10]=i):i=e[10],i}if(s==="calendar"){let i;return e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(_i,{size:16}),e[11]=i):i=e[11],i}if(s==="experiments"){let i;return e[12]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Vi,{size:16}),e[12]=i):i=e[12],i}let n;return e[13]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Us,{size:16}),e[13]=n):n=e[13],n}function cn(a){const e=U.c(51),{pinned:s,canSetMainView:n,onOpen:i,onTogglePin:l,onSetMainView:d}=a,r=Z(),f=s?"text-foreground":"text-muted-foreground/40";let o;e[0]!==f?(o=ve("size-7",f),e[0]=f,e[1]=o):o=e[1];let p;e[2]!==s||e[3]!==r?(p=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=s,e[3]=r,e[4]=p):p=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(es,{size:16}),e[5]=u):u=e[5];let m;e[6]!==l||e[7]!==s||e[8]!==o||e[9]!==p?(m=t.jsx(Te,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon",className:o,"aria-label":p,"aria-pressed":s,onClick:l,children:u})}),e[6]=l,e[7]=s,e[8]=o,e[9]=p,e[10]=m):m=e[10];let h;e[11]!==s||e[12]!==r?(h=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=s,e[12]=r,e[13]=h):h=e[13];let c;e[14]!==h?(c=t.jsx(De,{side:"top",children:h}),e[14]=h,e[15]=c):c=e[15];let x;e[16]!==m||e[17]!==c?(x=t.jsxs(Ve,{delayDuration:0,children:[m,c]}),e[16]=m,e[17]=c,e[18]=x):x=e[18];let g;e[19]!==r?(g=r("virtualMcp.settings.views.rowActions"),e[19]=r,e[20]=g):g=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Ki,{size:16}),e[21]=v):v=e[21];let j;e[22]!==g?(j=t.jsx(_s,{asChild:!0,children:t.jsx(ee,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":g,children:v})}),e[22]=g,e[23]=j):j=e[23];let y;e[24]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(vn,{size:14}),e[24]=y):y=e[24];let b;e[25]!==r?(b=r("virtualMcp.settings.views.open"),e[25]=r,e[26]=b):b=e[26];let w;e[27]!==i||e[28]!==b?(w=t.jsxs(Je,{onClick:i,children:[y,b]}),e[27]=i,e[28]=b,e[29]=w):w=e[29];let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(es,{size:14}),e[30]=S):S=e[30];let N;e[31]!==s||e[32]!==r?(N=r(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=s,e[32]=r,e[33]=N):N=e[33];let C;e[34]!==l||e[35]!==N?(C=t.jsxs(Je,{onClick:l,children:[S,N]}),e[34]=l,e[35]=N,e[36]=C):C=e[36];let M;e[37]!==n||e[38]!==d||e[39]!==r?(M=n&&t.jsxs(Je,{onClick:d,children:[t.jsx(Ls,{size:14}),r("virtualMcp.settings.views.setMainView")]}),e[37]=n,e[38]=d,e[39]=r,e[40]=M):M=e[40];let T;e[41]!==w||e[42]!==C||e[43]!==M?(T=t.jsxs(Vs,{align:"end",children:[w,C,M]}),e[41]=w,e[42]=C,e[43]=M,e[44]=T):T=e[44];let V;e[45]!==j||e[46]!==T?(V=t.jsxs(Ms,{children:[j,T]}),e[45]=j,e[46]=T,e[47]=V):V=e[47];let _;return e[48]!==V||e[49]!==x?(_=t.jsxs("div",{className:"flex items-center gap-1",children:[x,V]}),e[48]=V,e[49]=x,e[50]=_):_=e[50],_}const bs=a=>a.stopPropagation();function Bl(a){const e=U.c(8),{icon:s,title:n}=a;let i;e[0]!==s||e[1]!==n?(i=t.jsx(jt,{icon:s,name:n,size:"xs",className:"shrink-0"}),e[0]=s,e[1]=n,e[2]=i):i=e[2];let l;e[3]!==n?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[3]=n,e[4]=l):l=e[4];let d;return e[5]!==i||e[6]!==l?(d=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,l]}),e[5]=i,e[6]=l,e[7]=d):d=e[7],d}function Yl(a){const e=U.c(42),{views:s,viewId:n}=a;let i;e[0]!==n||e[1]!==s?(i=s.pinned(n),e[0]=n,e[1]=s,e[2]=i):i=e[2];const l=i;let d;e[3]!==n?(d=t.jsx(Ul,{viewId:n}),e[3]=n,e[4]=d):d=e[4];const r=s.labels[n];let f;e[5]!==n||e[6]!==s?(f=()=>s.openView(n),e[5]=n,e[6]=s,e[7]=f):f=e[7];let o;e[8]!==l||e[9]!==n||e[10]!==s?(o=l&&s.canBeMainView(n)&&!s.isMainView(n),e[8]=l,e[9]=n,e[10]=s,e[11]=o):o=e[11];let p;e[12]!==n||e[13]!==s?(p=()=>s.openView(n),e[12]=n,e[13]=s,e[14]=p):p=e[14];let u;e[15]!==l||e[16]!==n||e[17]!==s?(u=()=>s.togglePin(n,!l),e[15]=l,e[16]=n,e[17]=s,e[18]=u):u=e[18];let m;e[19]!==n||e[20]!==s?(m=()=>s.setMainView(n),e[19]=n,e[20]=s,e[21]=m):m=e[21];let h;e[22]!==l||e[23]!==o||e[24]!==p||e[25]!==u||e[26]!==m?(h=t.jsx(cn,{pinned:l,canSetMainView:o,onOpen:p,onTogglePin:u,onSetMainView:m}),e[22]=l,e[23]=o,e[24]=p,e[25]=u,e[26]=m,e[27]=h):h=e[27];let c;e[28]!==n||e[29]!==s?(c=()=>s.openView(n),e[28]=n,e[29]=s,e[30]=c):c=e[30];let x;e[31]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ds,{size:16}),e[31]=x):x=e[31];let g;e[32]!==c?(g=t.jsx("span",{onClick:c,className:"flex cursor-pointer items-center text-muted-foreground",children:x}),e[32]=c,e[33]=g):g=e[33];let v;e[34]!==g||e[35]!==h?(v=t.jsxs("div",{className:"flex items-center gap-1",children:[h,g]}),e[34]=g,e[35]=h,e[36]=v):v=e[36];let j;return e[37]!==v||e[38]!==d||e[39]!==r||e[40]!==f?(j=t.jsx($e,{icon:d,title:r,onClick:f,action:v}),e[37]=v,e[38]=d,e[39]=r,e[40]=f,e[41]=j):j=e[41],j}function Wl(a){const e=U.c(75),{views:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.views.defaults"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==n?(l=n("virtualMcp.layoutTabContent.mainView"),e[2]=n,e[3]=l):l=e[3];let d;e[4]!==n?(d=n("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=n,e[5]=d):d=e[5];const r=s.noMainView?"none":"set",f=s.noMainView?void 0:s.defaultMainView,o=s.setMainView;let p;e[6]!==n?(p=n("virtualMcp.layoutTabContent.mainView"),e[6]=n,e[7]=p):p=e[7];let u;e[8]!==n?(u=n("virtualMcp.layoutTabContent.noMainView"),e[8]=n,e[9]=u):u=e[9];let m;e[10]!==u?(m=t.jsx(Le,{placeholder:u}),e[10]=u,e[11]=m):m=e[11];let h;e[12]!==p||e[13]!==m?(h=t.jsx(Re,{"aria-label":p,size:"sm",className:"w-36 shrink-0 @min-xl/project-settings:w-44",children:m}),e[12]=p,e[13]=m,e[14]=h):h=e[14];let c;e[15]!==s.defaultMainOptions?(c=s.defaultMainOptions.map(Kl),e[15]=s.defaultMainOptions,e[16]=c):c=e[16];let x;e[17]!==c?(x=t.jsx(Ue,{children:c}),e[17]=c,e[18]=x):x=e[18];let g;e[19]!==h||e[20]!==x||e[21]!==r||e[22]!==f||e[23]!==s.setMainView?(g=t.jsxs(Be,{value:f,onValueChange:o,children:[h,x]},r),e[19]=h,e[20]=x,e[21]=r,e[22]=f,e[23]=s.setMainView,e[24]=g):g=e[24];let v;e[25]!==g||e[26]!==l||e[27]!==d?(v=t.jsx($e,{title:l,description:d,action:g}),e[25]=g,e[26]=l,e[27]=d,e[28]=v):v=e[28];let j;e[29]!==n?(j=n("virtualMcp.layoutTabContent.showChat"),e[29]=n,e[30]=j):j=e[30];let y;e[31]!==n?(y=n("virtualMcp.layoutTabContent.showChatDescription"),e[31]=n,e[32]=y):y=e[32];let b;e[33]!==n?(b=n("virtualMcp.layoutTabContent.showChat"),e[33]=n,e[34]=b):b=e[34];const w=s.noMainView?!0:s.chatDefaultOpen;let S;e[35]!==b||e[36]!==w||e[37]!==s.noMainView||e[38]!==s.setChatDefaultOpen?(S=t.jsx(Te,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(rt,{"aria-label":b,checked:w,disabled:s.noMainView,onCheckedChange:s.setChatDefaultOpen})})}),e[35]=b,e[36]=w,e[37]=s.noMainView,e[38]=s.setChatDefaultOpen,e[39]=S):S=e[39];let N;e[40]!==n||e[41]!==s.noMainView?(N=s.noMainView&&t.jsx(De,{side:"top",children:n("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[40]=n,e[41]=s.noMainView,e[42]=N):N=e[42];let C;e[43]!==S||e[44]!==N?(C=t.jsxs(Ve,{delayDuration:0,children:[S,N]}),e[43]=S,e[44]=N,e[45]=C):C=e[45];let M;e[46]!==j||e[47]!==y||e[48]!==C?(M=t.jsx($e,{title:j,description:y,action:C}),e[46]=j,e[47]=y,e[48]=C,e[49]=M):M=e[49];let T;e[50]!==v||e[51]!==M?(T=t.jsxs(Me,{children:[v,M]}),e[50]=v,e[51]=M,e[52]=T):T=e[52];let V;e[53]!==i||e[54]!==T?(V=t.jsx(Oe,{title:i,children:T}),e[53]=i,e[54]=T,e[55]=V):V=e[55];let _;e[56]!==n?(_=n("virtualMcp.settings.views.sidebar"),e[56]=n,e[57]=_):_=e[57];let E;e[58]!==s.navViews||e[59]!==s.projectViews?(E=[...s.navViews,...s.projectViews],e[58]=s.navViews,e[59]=s.projectViews,e[60]=E):E=e[60];let P;e[61]!==E||e[62]!==s?(P=E.map(R=>t.jsx(Yl,{views:s,viewId:R},R)),e[61]=E,e[62]=s,e[63]=P):P=e[63];let A;e[64]!==s?(A=s.connectionsData.flatMap(R=>[t.jsx(Bl,{icon:R.icon,title:R.title},`${R.id}:header`),...R.uiTools.map(F=>{const Y=s.pinnedAppViews.find(G=>G.connectionId===R.id&&G.toolName===F.name),z=!!Y,L=jn(R.id,F.name),W=`ext-apps:${R.id}:${F.name}`;return t.jsx($e,{onClick:()=>s.openView(L),icon:z?t.jsx("span",{onClick:bs,children:t.jsx(on,{value:Y.icon??null,name:Y.label||F.name,size:"xs",showHoverOverlay:!1,onChange:G=>s.setAppViewIcon(R.id,F.name,G)})}):t.jsx(Us,{size:16}),title:z?t.jsx("span",{onClick:bs,children:t.jsx(Ne,{value:Y.label,onChange:G=>s.setAppViewLabel(R.id,F.name,G.target.value),onBlur:s.commitAppViewLabel,"aria-label":F.title??Pt(F.name),className:"h-7 w-full max-w-52 text-sm"})}):F.title??Pt(F.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(cn,{pinned:z,canSetMainView:z&&!s.isMainView(W),onOpen:()=>s.openView(L),onTogglePin:()=>s.toggleAppViewPin(R.id,F.name),onSetMainView:()=>s.setMainView(W)}),t.jsx("span",{onClick:()=>s.openView(L),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Ds,{size:16})})]})},`${R.id}:${F.name}`)})]),e[64]=s,e[65]=A):A=e[65];let I;e[66]!==P||e[67]!==A?(I=t.jsxs(Me,{children:[P,A]}),e[66]=P,e[67]=A,e[68]=I):I=e[68];let K;e[69]!==_||e[70]!==I?(K=t.jsx(Oe,{title:_,children:I}),e[69]=_,e[70]=I,e[71]=K):K=e[71];let Q;return e[72]!==V||e[73]!==K?(Q=t.jsxs(t.Fragment,{children:[V,K]}),e[72]=V,e[73]=K,e[74]=Q):Q=e[74],Q}function Kl(a){return t.jsx(Pe,{value:a.value,children:a.label},a.value)}const dn="site-editor",un={context:Ct.library,monitor:Ct.monitoring,plan:Ct.plan};function js(a){return Object.hasOwn(un,a)}const Gl=new Set([dn,"content"]);function ql({virtualMcpId:a,form:e,flushAndSave:s}){const n=Z(),i=ft(),{openPanel:l}=Qi(),d=pt(),{org:r}=Ee(),f=As(a),o=Xi(f),p=Xs(a),u=aa(a),m=(f?.connections??[]).map(k=>k.connection_id).sort(),{data:h}=Ps({queryKey:Et.projectConnectionDetails(a,m),enabled:m.length>0,queryFn:async()=>await Promise.all(m.map(async $=>{try{const{item:q}=await i.call("COLLECTION_CONNECTIONS_GET",{id:$}),B=(q?.tools??[]).flatMap(X=>{const ae=qi(X._meta);return ae?[{name:X.name,title:X.title,description:X.description,resourceUri:ae}]:[]});return{fetchOk:!0,id:$,title:q?.title??$,icon:q?.icon??null,uiTools:B}}catch{return{fetchOk:!1,id:$,title:$,icon:null,uiTools:[]}}}))}),c=(h??[]).filter(k=>k.uiTools.length>0),x=new Set([...yn,...wn]),g=e.watch("metadata.ui.pinnedViews")??[],v=e.watch("metadata.ui.layout")??null,j=v?.defaultMainView??null,y=v?.chatDefaultOpen??!1,b=o.presence.calendar,w=e.watch("metadata.sidebarViewsSeen"),S=Ot(It({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:v}}),e.watch("metadata.sidebarViewsVersion"),ns(w,b)),N=u??(f?Ot(It(f.metadata),f.metadata.sidebarViewsVersion,ns(f.metadata.sidebarViewsSeen,b)):S),C=(()=>{if(!j||j.type==="chat")return"";const k=Sn(j.type);return k==="instructions"||k==="connections"||k==="layout"?"settings":Gl.has(k)?dn:x.has(k)?k:`${k}:${j.id??""}:${j.toolName??""}`})(),M=C==="",T=k=>{const[$,q,B]=k.split(":");return $?x.has($)?{type:$}:$==="ext-apps"&&q?{type:"ext-apps",id:q,toolName:B||void 0}:null:null},V=k=>{e.setValue("metadata.ui.pinnedViews",k,{shouldDirty:!0})},_=k=>{e.setValue("metadata.ui.layout",{...v,...k},{shouldDirty:!0})},E=H.useRef(!1);if(h&&h.length>0&&!E.current){E.current=!0;const k=new Set((h??[]).filter(X=>X.fetchOk).map(X=>X.id)),$=new Set(c.flatMap(X=>X.uiTools.map(ae=>`${X.id}:${ae.name}`))),q=new Set(m),B=g.filter(X=>q.has(X.connectionId)&&(!k.has(X.connectionId)||$.has(`${X.connectionId}:${X.toolName}`)));B.length!==g.length&&(V(B),j?.type==="ext-apps"&&!B.some(X=>X.connectionId===j.id&&X.toolName===j.toolName)&&_({defaultMainView:{type:"settings"}}))}const P=(k,$)=>{if(g.some(B=>B.connectionId===k&&B.toolName===$)){const B=g.filter(ae=>!(ae.connectionId===k&&ae.toolName===$));V(B);const X=`ext-apps:${k}:${$}`;C===X&&_({defaultMainView:{type:"settings"}})}else{const B=c.find(X=>X.id===k)?.uiTools.find(X=>X.name===$)?.title;V([...g,{connectionId:k,toolName:$,label:B??Pt($),icon:null}])}s()},A=(k,$,q)=>{V(g.map(B=>B.connectionId===k&&B.toolName===$?{...B,label:q}:B))},I=()=>{s()},K=(k,$,q)=>{V(g.map(B=>B.connectionId===k&&B.toolName===$?{...B,icon:q}:B)),s()},Q=k=>{_({defaultMainView:T(k)}),s()},R=(k,$)=>{const q=ta(N,k,$,1);e.setValue("metadata.sidebarViews",q,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsSeen",sa(f?.metadata.sidebarViewsSeen??w,b),{shouldDirty:!0}),p.stage(q,N);const B=na(j,k,$);B!==j&&_({defaultMainView:B})},F=Qs(f?.metadata),Y=Ji(F,o.presence),z=Zi(Y),L=ea(N,Y,1),W={overview:n("sidebar.navDestinations.overview"),context:n("sidebar.navDestinations.context"),monitor:n("sidebar.navDestinations.monitor"),plan:n("sidebar.navDestinations.plan"),reports:n("sidebar.navDestinations.reports"),board:n("sidebar.navDestinations.spineTasks"),"site-editor":n("virtualMcp.layoutTabContent.siteEditor"),assets:n("common.mainPanelTabs.assets"),releases:n("common.mainPanelTabs.releases"),hosting:n("common.mainPanelTabs.hosting"),e2e:n("common.mainPanelTabs.e2e"),automations:n("virtualMcp.layoutTabContent.automations"),calendar:n("common.mainPanelTabs.calendar"),experiments:n("common.mainPanelTabs.experiments")},G=[{value:"overview",label:n("sidebar.navDestinations.overview")}];for(const k of L)k!=="automations"&&k!=="overview"&&(js(k)||G.push({value:k,label:W[k]}));for(const k of g)G.push({value:`ext-apps:${k.connectionId}:${k.toolName}`,label:k.label||k.toolName});L.includes("automations")&&G.push({value:"automations",label:W.automations}),G.push({value:"settings",label:n("virtualMcp.layoutTabContent.settings")});const se=k=>{if(js(k)){d({to:un[k],params:{org:r.slug,agentId:a}});return}l(k,{virtualmcpid:a})},te=new Set(is);return{navViews:is,projectViews:z.filter(k=>!te.has(k)),labels:W,pinned:k=>N.includes(k),isMainView:k=>C===k,canBeMainView:k=>G.some($=>$.value===k),defaultMainView:C,defaultMainOptions:G,noMainView:M,chatDefaultOpen:y,connectionsData:c,pinnedAppViews:g,openView:se,togglePin:(k,$)=>R(k,$),setMainView:Q,setChatDefaultOpen:k=>{_({chatDefaultOpen:k}),s()},toggleAppViewPin:P,setAppViewIcon:K,setAppViewLabel:A,commitAppViewLabel:I}}function Hl(a){const e=U.c(55),{form:s,onCommit:n}=a,i=Z(),l=H.useId();let d;e[0]!==i?(d=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=d):d=e[1];let r;e[2]!==d?(r=t.jsx("p",{className:"text-sm font-medium",children:d}),e[2]=d,e[3]=r):r=e[3];let f;e[4]!==i?(f=i("virtualMcp.settings.identity.iconDescription"),e[4]=i,e[5]=f):f=e[5];let o;e[6]!==f?(o=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:f}),e[6]=f,e[7]=o):o=e[7];let p;e[8]!==r||e[9]!==o?(p=t.jsxs("div",{children:[r,o]}),e[8]=r,e[9]=o,e[10]=p):p=e[10];let u;e[11]!==s||e[12]!==n||e[13]!==i?(u=V=>{const{field:_}=V;return t.jsx("div",{className:"justify-self-start",children:t.jsx(on,{value:_.value??null,onChange:E=>{_.onChange(E),n()},onColorChange:E=>{s.setValue("metadata.ui.themeColor",E,{shouldDirty:!0}),n()},name:s.watch("title")||i("virtualMcp.virtualMcp.agentNameFallback"),size:"md",avatarClassName:"[&_svg]:w-1/2 [&_svg]:h-1/2"})})},e[11]=s,e[12]=n,e[13]=i,e[14]=u):u=e[14];let m;e[15]!==s.control||e[16]!==u?(m=t.jsx(be,{name:"icon",control:s.control,render:u}),e[15]=s.control,e[16]=u,e[17]=m):m=e[17];let h;e[18]!==p||e[19]!==m?(h=t.jsxs(we,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[p,m]}),e[18]=p,e[19]=m,e[20]=h):h=e[20];const c=`${l}-name`;let x;e[21]!==i?(x=i("virtualMcp.settings.identity.name"),e[21]=i,e[22]=x):x=e[22];let g;e[23]!==x||e[24]!==c?(g=t.jsx("label",{htmlFor:c,className:"text-sm font-medium",children:x}),e[23]=x,e[24]=c,e[25]=g):g=e[25];let v;e[26]!==l||e[27]!==n||e[28]!==i?(v=V=>{const{field:_}=V;return t.jsx(Ne,{..._,id:`${l}-name`,value:_.value??"",onBlur:()=>{_.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=l,e[27]=n,e[28]=i,e[29]=v):v=e[29];let j;e[30]!==s.control||e[31]!==v?(j=t.jsx(be,{name:"title",control:s.control,render:v}),e[30]=s.control,e[31]=v,e[32]=j):j=e[32];let y;e[33]!==g||e[34]!==j?(y=t.jsxs(we,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[g,j]}),e[33]=g,e[34]=j,e[35]=y):y=e[35];const b=`${l}-description`;let w;e[36]!==i?(w=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=w):w=e[37];let S;e[38]!==b||e[39]!==w?(S=t.jsx("label",{htmlFor:b,className:"text-sm font-medium",children:w}),e[38]=b,e[39]=w,e[40]=S):S=e[40];let N;e[41]!==l||e[42]!==n||e[43]!==i?(N=V=>{const{field:_}=V;return t.jsx(ut,{..._,id:`${l}-description`,value:_.value??"",onBlur:()=>{_.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=l,e[42]=n,e[43]=i,e[44]=N):N=e[44];let C;e[45]!==s.control||e[46]!==N?(C=t.jsx(be,{name:"description",control:s.control,render:N}),e[45]=s.control,e[46]=N,e[47]=C):C=e[47];let M;e[48]!==S||e[49]!==C?(M=t.jsxs(we,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[S,C]}),e[48]=S,e[49]=C,e[50]=M):M=e[50];let T;return e[51]!==y||e[52]!==M||e[53]!==h?(T=t.jsxs(Me,{children:[h,y,M]}),e[51]=y,e[52]=M,e[53]=h,e[54]=T):T=e[54],T}function Ql(a){const e=U.c(8),{section:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.navigation"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==s||e[3]!==n?(l=da.map(r=>{const{titleKey:f}=ua[r];return t.jsx(Ke.Tab,{active:s===r,asChild:!0,children:t.jsx(At,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:o=>({...o,section:r==="general"?void 0:r}),children:n(f)})},r)}),e[2]=s,e[3]=n,e[4]=l):l=e[4];let d;if(e[5]!==i||e[6]!==l){const r=t.jsx(Ke.Tabs,{"aria-label":i,children:l});d=t.jsx(Nn.Toolbar.Left.Portal,{fallback:r,children:r}),e[5]=i,e[6]=l,e[7]=d}else d=e[7];return d}function Xl(){const a=U.c(8),e=pt();let s;a[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},a[0]=s):s=a[0];const{section:n}=Cn(s);let i;a[1]!==n?(i=ma(n)?n:"general",a[1]=n,a[2]=i):i=a[2];let l;a[3]!==e?(l=r=>e({to:".",search:f=>({...f,section:r??void 0})}),a[3]=e,a[4]=l):l=a[4];let d;return a[5]!==i||a[6]!==l?(d={section:i,openSection:l},a[5]=i,a[6]=l,a[7]=d):d=a[7],d}function mn(a){const e=U.c(20),{value:s,label:n,copiedLabel:i,variant:l,size:d,className:r,copiedClassName:f}=a,o=l===void 0?"ghost":l,p=d===void 0?"icon-sm":d,{handleCopy:u,copied:m}=fa();let h;e[0]!==u||e[1]!==s?(h=()=>{u(s).catch(Jl)},e[0]=u,e[1]=s,e[2]=h):h=e[2];const c=m&&f;let x;e[3]!==r||e[4]!==c?(x=ve(r,c),e[3]=r,e[4]=c,e[5]=x):x=e[5];let g;e[6]!==m?(g=m?t.jsx(lt,{className:"text-success"}):t.jsx(vt,{}),e[6]=m,e[7]=g):g=e[7];let v;e[8]!==n||e[9]!==p||e[10]!==h||e[11]!==x||e[12]!==g||e[13]!==o?(v=t.jsx(ee,{type:"button",variant:o,size:p,"aria-label":n,onClick:h,className:x,children:g}),e[8]=n,e[9]=p,e[10]=h,e[11]=x,e[12]=g,e[13]=o,e[14]=v):v=e[14];const j=m?i:"";let y;e[15]!==j?(y=t.jsx("span",{className:"sr-only","aria-live":"polite",children:j}),e[15]=j,e[16]=y):y=e[16];let b;return e[17]!==v||e[18]!==y?(b=t.jsxs(t.Fragment,{children:[v,y]}),e[17]=v,e[18]=y,e[19]=b):b=e[19],b}function Jl(){}function Zl(a){const e=U.c(14),{id:s,value:n,copyLabel:i,copiedLabel:l,className:d}=a;let r;e[0]!==d?(r=ve("relative h-fit",d),e[0]=d,e[1]=r):r=e[1];let f;e[2]!==s||e[3]!==n?(f=t.jsx(Ne,{id:s,value:n,readOnly:!0,disabled:!0,className:"pr-10 font-mono"}),e[2]=s,e[3]=n,e[4]=f):f=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=ve("absolute top-1/2 right-1 -translate-y-1/2 transition-opacity","opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100 pointer-coarse:opacity-100"),e[5]=o):o=e[5];let p;e[6]!==l||e[7]!==i||e[8]!==n?(p=t.jsx(mn,{value:n,label:i,copiedLabel:l,className:o,copiedClassName:"opacity-100"}),e[6]=l,e[7]=i,e[8]=n,e[9]=p):p=e[9];let u;return e[10]!==r||e[11]!==f||e[12]!==p?(u=t.jsxs("div",{className:r,children:[f,p]}),e[10]=r,e[11]=f,e[12]=p,e[13]=u):u=e[13],u}async function ys(a){const e=await a.json().catch(()=>({}));if(!a.ok)throw new Error(e.error??`HTTP ${a.status}`);return e}function er(a){const e=U.c(108),{orgSlug:s,virtualMcpId:n,site:i}=a,l=Z(),d=Ft();let r;e[0]!==i?(r=kn(i,"site-tokens"),e[0]=i,e[1]=r):r=e[1];const f=r;let o;e[2]!==s||e[3]!==n?(o=Et.hostedSiteTokens(s,n),e[2]=s,e[3]=n,e[4]=o):o=e[4];const p=o,[u,m]=H.useState(null),h=H.useId();let c;e[5]!==f?(c=async()=>ys(await fetch(f)),e[5]=f,e[6]=c):c=e[6];let x;e[7]!==p||e[8]!==c?(x={queryKey:p,queryFn:c},e[7]=p,e[8]=c,e[9]=x):x=e[9];const g=Ps(x);let v;e[10]!==f?(v=async()=>ys(await fetch(f,{method:"POST"})),e[10]=f,e[11]=v):v=e[11];let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=J=>{const{token:ye}=J;return m(ye)},e[12]=j):j=e[12];let y;e[13]!==p||e[14]!==d?(y=()=>d.invalidateQueries({queryKey:p}),e[13]=p,e[14]=d,e[15]=y):y=e[15];let b;e[16]!==v||e[17]!==y?(b={mutationFn:v,onSuccess:j,onError:tr,onSettled:y},e[16]=v,e[17]=y,e[18]=b):b=e[18];const w=Os(b);let S;e[19]!==g.data?.tokens?(S=g.data?.tokens??[],e[19]=g.data?.tokens,e[20]=S):S=e[20];const N=S,C=g.data?.site;let M;e[21]!==l?(M=l("siteTokens.title"),e[21]=l,e[22]=M):M=e[22];let T;e[23]!==l?(T=l("siteTokens.description"),e[23]=l,e[24]=T):T=e[24];let V;e[25]!==l?(V=l("siteTokens.siteId"),e[25]=l,e[26]=V):V=e[26];let _;e[27]!==h||e[28]!==V?(_=t.jsx("label",{htmlFor:h,className:"text-sm font-medium",children:V}),e[27]=h,e[28]=V,e[29]=_):_=e[29];let E;e[30]!==l?(E=l("siteTokens.siteIdDescription"),e[30]=l,e[31]=E):E=e[31];let P;e[32]!==E?(P=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:E}),e[32]=E,e[33]=P):P=e[33];let A;e[34]!==C||e[35]!==h||e[36]!==l?(A=C?t.jsx(Zl,{id:h,value:C,copyLabel:l("siteTokens.copySiteId"),copiedLabel:l("siteTokens.siteIdCopied"),className:"min-w-0 flex-1"}):t.jsx("p",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:"—"}),e[34]=C,e[35]=h,e[36]=l,e[37]=A):A=e[37];const I=!g.data||w.isPending;let K;e[38]!==w?(K=()=>w.mutate(),e[38]=w,e[39]=K):K=e[39];let Q;e[40]!==w.isPending?(Q=w.isPending?t.jsx(nt,{className:"size-3.5"}):t.jsx(ze,{size:14}),e[40]=w.isPending,e[41]=Q):Q=e[41];let R;e[42]!==l?(R=l("siteTokens.issue"),e[42]=l,e[43]=R):R=e[43];let F;e[44]!==I||e[45]!==K||e[46]!==Q||e[47]!==R?(F=t.jsxs(ee,{type:"button",size:"sm",className:"shrink-0",disabled:I,onClick:K,children:[Q,R]}),e[44]=I,e[45]=K,e[46]=Q,e[47]=R,e[48]=F):F=e[48];let Y;e[49]!==A||e[50]!==F?(Y=t.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[A,F]}),e[49]=A,e[50]=F,e[51]=Y):Y=e[51];let z;e[52]!==_||e[53]!==P||e[54]!==Y?(z=t.jsxs(we,{className:"group",children:[_,P,Y]}),e[52]=_,e[53]=P,e[54]=Y,e[55]=z):z=e[55];let L;e[56]!==g.error||e[57]!==g.isError?(L=g.isError?t.jsx(we,{children:t.jsx("p",{className:"text-xs text-destructive",children:g.error.message})}):null,e[56]=g.error,e[57]=g.isError,e[58]=L):L=e[58];let W;if(e[59]!==l||e[60]!==N){let J;e[62]!==l?(J=ye=>t.jsx(we,{children:t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsx(Lt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate font-mono text-xs",children:ye.kid}),t.jsx("p",{className:"text-xs text-muted-foreground",children:l("siteTokens.issuedAgo",{when:Mn(new Date(ye.iat*1e3))})})]})]})},ye.kid),e[62]=l,e[63]=J):J=e[63],W=N.map(J),e[59]=l,e[60]=N,e[61]=W}else W=e[61];let G;e[64]!==z||e[65]!==L||e[66]!==W?(G=t.jsxs(Me,{children:[z,L,W]}),e[64]=z,e[65]=L,e[66]=W,e[67]=G):G=e[67];const se=u!==null;let te;e[68]===Symbol.for("react.memo_cache_sentinel")?(te=J=>!J&&m(null),e[68]=te):te=e[68];let k;e[69]!==l?(k=l("siteTokens.createdTitle"),e[69]=l,e[70]=k):k=e[70];let $;e[71]!==k?($=t.jsx(ht,{children:k}),e[71]=k,e[72]=$):$=e[72];let q;e[73]!==l?(q=l("siteTokens.createdDescription"),e[73]=l,e[74]=q):q=e[74];let B;e[75]!==q?(B=t.jsx(Is,{children:q}),e[75]=q,e[76]=B):B=e[76];let X;e[77]!==$||e[78]!==B?(X=t.jsxs(xt,{children:[$,B]}),e[77]=$,e[78]=B,e[79]=X):X=e[79];let ae;e[80]!==l?(ae=l("siteTokens.createdTitle"),e[80]=l,e[81]=ae):ae=e[81];const je=u??"";let ie;e[82]!==ae||e[83]!==je?(ie=t.jsx(Ne,{readOnly:!0,"aria-label":ae,value:je,className:"font-mono text-xs"}),e[82]=ae,e[83]=je,e[84]=ie):ie=e[84];let ce;e[85]!==u||e[86]!==l?(ce=u?t.jsx(mn,{value:u,label:l("siteTokens.copy"),copiedLabel:l("siteTokens.copied"),variant:"outline",size:"icon",className:"shrink-0"}):null,e[85]=u,e[86]=l,e[87]=ce):ce=e[87];let ue;e[88]!==ie||e[89]!==ce?(ue=t.jsxs("div",{className:"flex items-center gap-2",children:[ie,ce]}),e[88]=ie,e[89]=ce,e[90]=ue):ue=e[90];let ge;e[91]===Symbol.for("react.memo_cache_sentinel")?(ge=()=>m(null),e[91]=ge):ge=e[91];let de;e[92]!==l?(de=l("siteTokens.done"),e[92]=l,e[93]=de):de=e[93];let he;e[94]!==de?(he=t.jsx($t,{children:t.jsx(ee,{onClick:ge,children:de})}),e[94]=de,e[95]=he):he=e[95];let me;e[96]!==X||e[97]!==ue||e[98]!==he?(me=t.jsxs(it,{className:"sm:max-w-lg",children:[X,ue,he]}),e[96]=X,e[97]=ue,e[98]=he,e[99]=me):me=e[99];let fe;e[100]!==se||e[101]!==me?(fe=t.jsx(at,{open:se,onOpenChange:te,children:me}),e[100]=se,e[101]=me,e[102]=fe):fe=e[102];let O;return e[103]!==M||e[104]!==T||e[105]!==G||e[106]!==fe?(O=t.jsxs(Oe,{title:M,description:T,children:[G,fe]}),e[103]=M,e[104]=T,e[105]=G,e[106]=fe,e[107]=O):O=e[107],O}function tr(a){return le.error(a.message)}function sr(a){const e=U.c(31),{virtualMcp:s}=a,n=Z(),{org:i}=Ee(),{roleSlug:l}=_n();let d;e[0]!==s?(d=ha(s),e[0]=s,e[1]=d):d=e[1];const r=d,f=ft(),o=Ft();let p;e[2]!==f||e[3]!==s?(p=N=>f.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:s.id,data:{blocksV8:N}}),e[2]=f,e[3]=s,e[4]=p):p=e[4];let u;e[5]!==i||e[6]!==o?(u=()=>Vn(o,i.id),e[5]=i,e[6]=o,e[7]=u):u=e[7];let m;e[8]!==p||e[9]!==u?(m={mutationFn:p,onError:nr,onSettled:u},e[8]=p,e[9]=u,e[10]=m):m=e[10];const h=Os(m);if(!pa(l))return null;const c=h.isPending?h.variables:r;let x;e[11]!==n?(x=n("virtualMcp.settings.blocksV8Site.label"),e[11]=n,e[12]=x):x=e[12];let g;e[13]!==x?(g=t.jsx(Se,{htmlFor:"blocks-v8-site",className:"font-normal text-foreground",children:x}),e[13]=x,e[14]=g):g=e[14];let v;e[15]!==n?(v=n("virtualMcp.settings.blocksV8Site.description"),e[15]=n,e[16]=v):v=e[16];let j;e[17]!==v?(j=t.jsx("p",{className:"text-xs text-muted-foreground",children:v}),e[17]=v,e[18]=j):j=e[18];let y;e[19]!==g||e[20]!==j?(y=t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[g,j]}),e[19]=g,e[20]=j,e[21]=y):y=e[21];let b;e[22]!==h?(b=N=>h.mutate(N),e[22]=h,e[23]=b):b=e[23];let w;e[24]!==c||e[25]!==b||e[26]!==h.isPending?(w=t.jsx(rt,{id:"blocks-v8-site",className:"shrink-0",checked:c,disabled:h.isPending,onCheckedChange:b}),e[24]=c,e[25]=b,e[26]=h.isPending,e[27]=w):w=e[27];let S;return e[28]!==w||e[29]!==y?(S=t.jsx(Oe,{children:t.jsx(Me,{children:t.jsx(we,{children:t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[y,w]})})})}),e[28]=w,e[29]=y,e[30]=S):S=e[30],S}function nr(a){return le.error(a.message)}function ir(a){const e=U.c(8),{control:s,previewServerUrl:n}=a,i=Z();let l;e[0]!==n?(l=Js(n),e[0]=n,e[1]=l):l=e[1];const d=!!l;let r;e[2]!==d||e[3]!==i?(r=o=>{const{field:p}=o;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(Se,{htmlFor:"fast-preview",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreview.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i(d?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(rt,{id:"fast-preview",className:"shrink-0",checked:!!p.value&&d,disabled:!d,onCheckedChange:u=>p.onChange(u)})]})},e[2]=d,e[3]=i,e[4]=r):r=e[4];let f;return e[5]!==s||e[6]!==r?(f=t.jsx(be,{control:s,name:"metadata.fastPreview",render:r}),e[5]=s,e[6]=r,e[7]=f):f=e[7],f}function ar(a){const e=U.c(5),{control:s,fastPreview:n}=a,i=Z();if(!n)return null;let l;e[0]!==i?(l=r=>{const{field:f}=r;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(Se,{htmlFor:"fast-preview-in-place",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.description")})]}),t.jsx(rt,{id:"fast-preview-in-place",className:"shrink-0",checked:!!f.value,onCheckedChange:o=>f.onChange(o)})]})},e[0]=i,e[1]=l):l=e[1];let d;return e[2]!==s||e[3]!==l?(d=t.jsx(be,{control:s,name:"metadata.fastPreviewInPlace",render:l}),e[2]=s,e[3]=l,e[4]=d):d=e[4],d}function lr(a){const e=U.c(18),{control:s,isBlocksV8:n}=a,i=n===void 0?!1:n,l=Z();let d;e[0]!==l?(d=l("sandbox.previewServerUrlField.label"),e[0]=l,e[1]=d):d=e[1];let r;e[2]!==d?(r=t.jsx(Se,{htmlFor:"preview-server-url",children:d}),e[2]=d,e[3]=r):r=e[3];let f;e[4]!==l?(f=c=>{const{field:x}=c,g=x.value??"";return t.jsx(Ne,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:l("sandbox.previewServerUrlField.placeholder"),value:g,onChange:v=>x.onChange(v.target.value===""?null:v.target.value),onBlur:()=>{x.onChange(ga(g)),x.onBlur()}})},e[4]=l,e[5]=f):f=e[5];let o;e[6]!==s||e[7]!==f?(o=t.jsx(be,{control:s,name:"metadata.previewServerUrl",render:f}),e[6]=s,e[7]=f,e[8]=o):o=e[8];const p=i?"sandbox.previewServerUrlField.descriptionBlocksV8":"sandbox.previewServerUrlField.description";let u;e[9]!==l||e[10]!==p?(u=l(p),e[9]=l,e[10]=p,e[11]=u):u=e[11];let m;e[12]!==u?(m=t.jsx("p",{className:"text-xs text-muted-foreground",children:u}),e[12]=u,e[13]=m):m=e[13];let h;return e[14]!==r||e[15]!==o||e[16]!==m?(h=t.jsxs("div",{className:"space-y-2",children:[r,o,m]}),e[14]=r,e[15]=o,e[16]=m,e[17]=h):h=e[17],h}function rr(a){const e=U.c(15),{control:s,isBlocksV8:n,previewServerUrl:i,fastPreview:l}=a,d=Z(),r=n||!!l;let f;e[0]!==s||e[1]!==n?(f=t.jsx(we,{children:t.jsx(lr,{control:s,isBlocksV8:n})}),e[0]=s,e[1]=n,e[2]=f):f=e[2];let o;e[3]!==s||e[4]!==n||e[5]!==i||e[6]!==d?(o=n?!Js(i)&&t.jsx(we,{children:t.jsx("p",{className:"text-xs text-muted-foreground",children:d("sandbox.cmsSettings.blocksV8.needsPreviewServerUrl")})}):t.jsx(we,{children:t.jsx(ir,{control:s,previewServerUrl:i})}),e[3]=s,e[4]=n,e[5]=i,e[6]=d,e[7]=o):o=e[7];let p;e[8]!==s||e[9]!==r?(p=r&&t.jsx(we,{children:t.jsx(ar,{control:s,fastPreview:r})}),e[8]=s,e[9]=r,e[10]=p):p=e[10];let u;return e[11]!==f||e[12]!==o||e[13]!==p?(u=t.jsxs(t.Fragment,{children:[f,o,p]}),e[11]=f,e[12]=o,e[13]=p,e[14]=u):u=e[14],u}const Vt={tools:null,resources:null,prompts:null},or=ba.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function cr(a){const s=new TextEncoder().encode(a),n=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(n)}function fn(a){return{"x-studio-client":a,"x-mesh-client":a}}function dr(a){const e=U.c(15),{url:s,agentId:n}=a,i=Z(),[l,d]=H.useState(!1);let r;e[0]!==n||e[1]!==i||e[2]!==s?(r=async()=>{_e("agent_connect_action",{agent_id:n,action:"copy_url"}),await navigator.clipboard.writeText(s),d(!0),le.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await St(2e3),d(!1)},e[0]=n,e[1]=i,e[2]=s,e[3]=r):r=e[3];const f=r;let o;e[4]!==l?(o=l?t.jsx(lt,{size:20,className:"text-success"}):t.jsx(vt,{size:20}),e[4]=l,e[5]=o):o=e[5];let p;e[6]!==l||e[7]!==i?(p=i(l?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=l,e[7]=i,e[8]=p):p=e[8];let u;e[9]!==p?(u=t.jsx("span",{className:"text-xs font-medium",children:p}),e[9]=p,e[10]=u):u=e[10];let m;return e[11]!==f||e[12]!==o||e[13]!==u?(m=t.jsxs(ee,{type:"button",variant:"outline",onClick:f,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[o,u]}),e[11]=f,e[12]=o,e[13]=u,e[14]=m):m=e[14],m}function ur(a){const e=U.c(13),{url:s,serverName:n,agentId:i}=a,l=Z();let d;e[0]!==i||e[1]!==n||e[2]!==l||e[3]!==s?(d=()=>{_e("agent_connect_action",{agent_id:i,action:"install_cursor"});const m=Zs(n),h={type:"http",url:s,headers:fn("Cursor")},c=cr(JSON.stringify(h,null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(m)}&config=${encodeURIComponent(c)}`;window.open(x,"_blank"),le.success(l("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=n,e[2]=l,e[3]=s,e[4]=d):d=e[4];const r=d;let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),e[5]=f):f=e[5];let o;e[6]!==l?(o=l("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=l,e[7]=o):o=e[7];let p;e[8]!==o?(p=t.jsx("span",{className:"text-xs font-medium",children:o}),e[8]=o,e[9]=p):p=e[9];let u;return e[10]!==r||e[11]!==p?(u=t.jsxs(ee,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[f,p]}),e[10]=r,e[11]=p,e[12]=u):u=e[12],u}function mr(a){const e=U.c(16),{url:s,serverName:n,agentId:i}=a,l=Z(),[d,r]=H.useState(!1);let f;e[0]!==i||e[1]!==n||e[2]!==l||e[3]!==s?(f=async()=>{_e("agent_connect_action",{agent_id:i,action:"install_claude_code"});const c=Zs(n),x={type:"http",url:s,headers:fn("Claude Code")},g=JSON.stringify(x,null,2),v=`claude mcp add-json "${c}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(v),r(!0),le.success(l("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await St(2e3),r(!1)},e[0]=i,e[1]=n,e[2]=l,e[3]=s,e[4]=f):f=e[4];const o=f;let p;e[5]!==d?(p=d?t.jsx(lt,{size:20,className:"text-success"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[5]=d,e[6]=p):p=e[6];let u;e[7]!==d||e[8]!==l?(u=l(d?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=d,e[8]=l,e[9]=u):u=e[9];let m;e[10]!==u?(m=t.jsx("span",{className:"text-xs font-medium",children:u}),e[10]=u,e[11]=m):m=e[11];let h;return e[12]!==o||e[13]!==p||e[14]!==m?(h=t.jsxs(ee,{type:"button",variant:"outline",onClick:o,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[p,m]}),e[12]=o,e[13]=p,e[14]=m,e[15]=h):h=e[15],h}const fr=720*60*60;function pr({virtualMcp:a}){const e=Z(),s=ft(),[n,i]=H.useState(null),[l,d]=H.useState(!1),[r,f]=H.useState(!1),o=a.id,p=a.title||`agent-${o.slice(0,8)}`,u=n?`bunx @decocms/typegen@latest --mcp ${o} --key ${n} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${o} --key <api-key> --output client.ts`,m=async()=>{d(!0);try{const{key:c}=await s.call("API_KEY_CREATE",{name:`typegen-${p}`,permissions:{[o]:["*"]},expiresIn:fr});if(!c)throw new Error("No key in response");i(c),_e("agent_typegen_key_generated",{agent_id:o})}catch{_e("agent_typegen_key_failed",{agent_id:o}),le.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{d(!1)}},h=async()=>{_e("agent_connect_action",{agent_id:o,action:"typegen_copy_command",has_api_key:!!n}),await navigator.clipboard.writeText(u),f(!0),le.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await St(2e3),f(!1)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClient")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClientDescription")})]}),!n&&t.jsxs(ee,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:m,disabled:l,children:[l?t.jsx(nt,{className:"size-3.5"}):t.jsx(Lt,{size:14}),t.jsx("span",{children:e(l?"virtualMcp.virtualMcpShareModal.generating":"virtualMcp.virtualMcpShareModal.generateApiKey")})]})]}),n&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateClientLabel")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:u}),t.jsx(ee,{type:"button",variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:h,children:r?t.jsx(lt,{size:12,className:"text-success"}):t.jsx(vt,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx(hr,{apiKey:n,agentId:o})]})}function hr(a){const e=U.c(21),{apiKey:s,agentId:n}=a,[i,l]=H.useState(!1),d=window.location.origin,r=s?`STUDIO_API_KEY=${s}`:"STUDIO_API_KEY=<api-key>",f=`STUDIO_BASE_URL=${d}`,o=`${r}
|
|
2
2
|
${f}`;let p;e[0]!==n||e[1]!==s||e[2]!==o?(p=async()=>{_e("agent_connect_action",{agent_id:n,action:"typegen_copy_env",has_api_key:!!s}),await navigator.clipboard.writeText(o),l(!0),await St(2e3),l(!1)},e[0]=n,e[1]=s,e[2]=o,e[3]=p):p=e[3];const u=p,m=!s;let h;e[4]!==m?(h=ve({"opacity-50":m}),e[4]=m,e[5]=h):h=e[5];let c;e[6]!==r||e[7]!==h?(c=t.jsx("span",{className:h,children:r}),e[6]=r,e[7]=h,e[8]=c):c=e[8];let x,g;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("br",{}),g=t.jsx("span",{children:f}),e[9]=x,e[10]=g):(x=e[9],g=e[10]);let v;e[11]!==c?(v=t.jsxs("code",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:[c,x,g]}),e[11]=c,e[12]=v):v=e[12];let j;e[13]!==i?(j=i?t.jsx(lt,{size:12,className:"text-success"}):t.jsx(vt,{size:12}),e[13]=i,e[14]=j):j=e[14];let y;e[15]!==u||e[16]!==j?(y=t.jsx(ee,{type:"button",variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:u,children:j}),e[15]=u,e[16]=j,e[17]=y):y=e[17];let b;return e[18]!==v||e[19]!==y?(b=t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[v,y]})}),e[18]=v,e[19]=y,e[20]=b):b=e[20],b}function xr(a){const e=U.c(3),{virtualMcp:s}=a;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=n):n=e[0];let i;return e[1]!==s?(i=t.jsx(H.Suspense,{fallback:n,children:t.jsx(pr,{virtualMcp:s})}),e[1]=s,e[2]=i):i=e[2],i}function gr(a){const e=U.c(45),{open:s,onOpenChange:n,virtualMcp:i}=a,l=Z(),{org:d}=Ee(),r=`/api/${d.slug}/mcp/virtual-mcp/${i.id}`;let f;e[0]!==r?(f=new URL(r,window.location.origin),e[0]=r,e[1]=f):f=e[1];const o=f;let p;e[2]!==i.id||e[3]!==i.title?(p=i.title||`agent-${i.id?.slice(0,8)??"default"}`,e[2]=i.id,e[3]=i.title,e[4]=p):p=e[4];const u=p,m=Ca();let h;e[5]!==i.id||e[6]!==o.href?(h=t.jsx(dr,{url:o.href,agentId:i.id}),e[5]=i.id,e[6]=o.href,e[7]=h):h=e[7];let c,x;e[8]!==u||e[9]!==i.id||e[10]!==o.href?(c=t.jsx(ur,{url:o.href,serverName:u,agentId:i.id}),x=t.jsx(mr,{url:o.href,serverName:u,agentId:i.id}),e[8]=u,e[9]=i.id,e[10]=o.href,e[11]=c,e[12]=x):(c=e[11],x=e[12]);let g;e[13]!==h||e[14]!==c||e[15]!==x?(g=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[h,c,x]})}),e[13]=h,e[14]=c,e[15]=x,e[16]=g):g=e[16];let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"border-t border-border"}),e[17]=v):v=e[17];let j;e[18]!==i?(j=t.jsx(xr,{virtualMcp:i}),e[18]=i,e[19]=j):j=e[19];let y;e[20]!==g||e[21]!==j?(y=t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v,j]}),e[20]=g,e[21]=j,e[22]=y):y=e[22];const b=y;if(m){let M;e[23]!==l?(M=l("virtualMcp.virtualMcpShareModal.connect"),e[23]=l,e[24]=M):M=e[24];let T;e[25]!==M?(T=t.jsx(wa,{className:"mt-4 mb-4 text-base font-semibold",children:M}),e[25]=M,e[26]=T):T=e[26];let V;e[27]!==b||e[28]!==T?(V=t.jsx(Sa,{children:t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-6 [touch-action:pan-y]",children:[T,b]})}),e[27]=b,e[28]=T,e[29]=V):V=e[29];let _;return e[30]!==n||e[31]!==s||e[32]!==V?(_=t.jsx(Na,{open:s,onOpenChange:n,children:V}),e[30]=n,e[31]=s,e[32]=V,e[33]=_):_=e[33],_}let w;e[34]!==l?(w=l("virtualMcp.virtualMcpShareModal.connect"),e[34]=l,e[35]=w):w=e[35];let S;e[36]!==w?(S=t.jsx(xt,{children:t.jsx(ht,{children:w})}),e[36]=w,e[37]=S):S=e[37];let N;e[38]!==b||e[39]!==S?(N=t.jsxs(it,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[S,b]}),e[38]=b,e[39]=S,e[40]=N):N=e[40];let C;return e[41]!==n||e[42]!==s||e[43]!==N?(C=t.jsx(at,{open:s,onOpenChange:n,children:N}),e[41]=n,e[42]=s,e[43]=N,e[44]=C):C=e[44],C}const vr=/^[A-Za-z_][A-Za-z0-9_]*$/;function br(a){const e={},s=a.split(/\r?\n/);for(let n=0;n<s.length;n++){let i=(s[n]??"").trim();if(!i||i.startsWith("#"))continue;i.startsWith("export ")&&(i=i.slice(7).trim());const l=i.indexOf("=");if(l<0)throw new Error(`Line ${n+1}: missing '='`);const d=i.slice(0,l).trim();if(!vr.test(d))throw new Error(`Line ${n+1}: invalid key "${d}"`);let r=i.slice(l+1).trim();r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),e[d]=r}return e}function jr(a){const e=U.c(28),{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:d}=a,r=Z();let f;e[0]!==r?(f=r("sandbox.envVarsField.title"),e[0]=r,e[1]=f):f=e[1];let o;e[2]!==f?(o=t.jsx("div",{className:"flex items-baseline justify-between gap-2",children:t.jsx(Se,{className:"font-normal text-foreground",children:f})}),e[2]=f,e[3]=o):o=e[3];let p;e[4]!==r?(p=r("sandbox.envVarsField.description"),e[4]=r,e[5]=p):p=e[5];let u;e[6]!==p?(u=t.jsx("p",{className:"text-xs text-muted-foreground",children:p}),e[6]=p,e[7]=u):u=e[7];let m;e[8]!==s||e[9]!==n||e[10]!==l||e[11]!==d||e[12]!==i?(m=t.jsx(yr,{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:d}),e[8]=s,e[9]=n,e[10]=l,e[11]=d,e[12]=i,e[13]=m):m=e[13];let h;e[14]!==r?(h=j=>{const{error:y}=j;return t.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:y?.message??r("sandbox.envVarsField.failedToLoadSecrets")})},e[14]=r,e[15]=h):h=e[15];let c;e[16]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Tn,{className:"h-9 w-full"}),e[16]=c):c=e[16];let x;e[17]!==s||e[18]!==n?(x=t.jsx(H.Suspense,{fallback:c,children:t.jsx(Sr,{control:s,form:n})}),e[17]=s,e[18]=n,e[19]=x):x=e[19];let g;e[20]!==h||e[21]!==x?(g=t.jsx(Xe,{fallback:h,children:x}),e[20]=h,e[21]=x,e[22]=g):g=e[22];let v;return e[23]!==o||e[24]!==u||e[25]!==m||e[26]!==g?(v=t.jsxs("div",{className:"space-y-2",children:[o,u,m,g]}),e[23]=o,e[24]=u,e[25]=m,e[26]=g,e[27]=v):v=e[27],v}function yr(a){const e=U.c(33),{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:d}=a,r=Z(),o=Dn.useSession().data?.user?.id,p="metadata.runtime.env";let u;e[0]!==n?(u=()=>JSON.stringify(ws(n.getValues(p))),e[0]=n,e[1]=u):u=e[1];const[m,h]=H.useState(u);let c;e[2]!==s?(c={control:s,name:p},e[2]=s,e[3]=c):c=e[3];const x=zt(c);let g;e[4]!==x?(g=JSON.stringify(ws(x)),e[4]=x,e[5]=g):g=e[5];const v=g,j=v!==m;let y;e[6]!==d||e[7]!==o?(y=o?Object.keys(d?.[o]??{}):[],e[6]=d,e[7]=o,e[8]=y):y=e[8];const b=y,w=b.length>0,[S,N]=H.useState(!1);if(!j||!w)return null;let C;e[9]!==v||e[10]!==l||e[11]!==r||e[12]!==b||e[13]!==i?(C=async()=>{N(!0);const K=await Promise.allSettled(b.map(async R=>{const F=ka({orgSlug:l,virtualMcpId:i,branch:R,threadId:null},"setup/start",{force:"1"}),Y=await fetch(F,{method:"POST"});if(!Y.ok){const z=await Y.text().catch(()=>Y.statusText);throw new Error(z||Y.statusText)}}));N(!1);const Q=K.filter(wr).length;Q===0?(h(v),le.success(b.length===1?r("sandbox.envVarsField.restartedSingle"):r("sandbox.envVarsField.restartedMultiple",{count:b.length}))):le.error(r("sandbox.envVarsField.restartFailed",{failed:Q,total:b.length}))},e[9]=v,e[10]=l,e[11]=r,e[12]=b,e[13]=i,e[14]=C):C=e[14];const M=C;let T;e[15]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Ts,{className:"size-3.5 shrink-0"}),e[15]=T):T=e[15];let V;e[16]!==r?(V=r("sandbox.envVarsField.sandboxRunningNotice"),e[16]=r,e[17]=V):V=e[17];let _;e[18]!==V?(_=t.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-warning",children:[T,t.jsx("span",{className:"truncate",children:V})]}),e[18]=V,e[19]=_):_=e[19];let E;e[20]!==S?(E=S?t.jsx(nt,{className:"size-3.5"}):t.jsx(On,{className:"size-3.5"}),e[20]=S,e[21]=E):E=e[21];let P;e[22]!==S||e[23]!==r?(P=r(S?"sandbox.envVarsField.restarting":"sandbox.envVarsField.restartDev"),e[22]=S,e[23]=r,e[24]=P):P=e[24];let A;e[25]!==M||e[26]!==S||e[27]!==P||e[28]!==E?(A=t.jsxs(ee,{type:"button",variant:"outline",size:"sm",onClick:M,disabled:S,className:"shrink-0",children:[E,P]}),e[25]=M,e[26]=S,e[27]=P,e[28]=E,e[29]=A):A=e[29];let I;return e[30]!==A||e[31]!==_?(I=t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs",children:[_,A]}),e[30]=A,e[31]=_,e[32]=I):I=e[32],I}function wr(a){return a.status==="rejected"}function Sr(a){const e=U.c(62),{control:s,form:n}=a,i=Z(),l="metadata.runtime.env";let d;e[0]!==s?(d={control:s,name:l},e[0]=s,e[1]=d):d=e[1];const r=Pn(d),{fields:f,append:o,remove:p}=r;let u;e[2]!==n?(u=(F,Y)=>{n.setValue(`${l}.${F}`,Y,{shouldDirty:!0,shouldTouch:!0})},e[2]=n,e[3]=u):u=e[3];const m=u,h=Ta();let c;if(e[4]!==h){c=new Map;for(const F of h)c.set(F.id,F);e[4]=h,e[5]=c}else c=e[5];const[x,g]=H.useState(null);let v;e[6]!==o?(v=()=>{o({key:"",kind:"literal",value:""})},e[6]=o,e[7]=v):v=e[7];const j=v;let y;e[8]!==o||e[9]!==n||e[10]!==i?(y=async()=>{let F;try{F=await navigator.clipboard.readText()}catch{le.error(i("sandbox.envVarsField.clipboardReadFailed"));return}if(!F.trim()){le.error(i("sandbox.envVarsField.clipboardEmpty"));return}let Y;try{Y=br(F)}catch(te){const k=te;le.error(k.message);return}const z=Object.entries(Y);if(z.length===0){le.error(i("sandbox.envVarsField.nothingToAdd"));return}const L=n.getValues(l)??[],W=new Set;for(const te of L){const k=(te.key??"").trim();k&&W.add(k)}let G=0,se=0;for(const[te,k]of z){if(W.has(te)){se++;continue}o({key:te,kind:"literal",value:k}),W.add(te),G++}G===0&&se>0?le.message(i("sandbox.envVarsField.allKeysExist",{count:se})):le.success(se>0?i("sandbox.envVarsField.addedWithSkipped",{added:G,skipped:se}):i("sandbox.envVarsField.added",{added:G}))},e[8]=o,e[9]=n,e[10]=i,e[11]=y):y=e[11];const b=y;let w;if(e[12]!==s||e[13]!==f||e[14]!==n||e[15]!==p||e[16]!==c||e[17]!==h||e[18]!==m){let F;e[20]!==s||e[21]!==n||e[22]!==p||e[23]!==c||e[24]!==h||e[25]!==m?(F=(Y,z)=>t.jsx("li",{className:"rounded-md border border-border bg-background",children:t.jsx(Nr,{index:z,control:s,form:n,onUpdateEntry:m,fieldPath:l,secrets:h,secretById:c,onSaveAsSecret:(L,W)=>g({kind:"save-literal",index:z,presetKey:L,presetValue:W}),onCreateNewSecret:L=>g({kind:"create-new",index:z,presetKey:L}),onRemove:()=>p(z)})},Y.id),e[20]=s,e[21]=n,e[22]=p,e[23]=c,e[24]=h,e[25]=m,e[26]=F):F=e[26],w=f.map(F),e[12]=s,e[13]=f,e[14]=n,e[15]=p,e[16]=c,e[17]=h,e[18]=m,e[19]=w}else w=e[19];let S;e[27]!==w?(S=t.jsx("ul",{className:"space-y-2",children:w}),e[27]=w,e[28]=S):S=e[28];let N;e[29]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(ze,{className:"size-3.5"}),e[29]=N):N=e[29];let C;e[30]!==i?(C=i("sandbox.envVarsField.addEnvVar"),e[30]=i,e[31]=C):C=e[31];let M;e[32]!==j||e[33]!==C?(M=t.jsxs(ee,{type:"button",variant:"outline",size:"sm",onClick:j,className:"flex-1",children:[N,C]}),e[32]=j,e[33]=C,e[34]=M):M=e[34];let T;e[35]!==i?(T=i("sandbox.envVarsField.pasteDotenvAriaLabel"),e[35]=i,e[36]=T):T=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Ti,{className:"size-3.5"}),e[37]=V):V=e[37];let _;e[38]!==i?(_=i("sandbox.envVarsField.pasteDotenv"),e[38]=i,e[39]=_):_=e[39];let E;e[40]!==b||e[41]!==T||e[42]!==_?(E=t.jsx(Te,{asChild:!0,children:t.jsxs(ee,{type:"button",variant:"outline",size:"sm",onClick:b,"aria-label":T,children:[V,_]})}),e[40]=b,e[41]=T,e[42]=_,e[43]=E):E=e[43];let P;e[44]!==i?(P=i("sandbox.envVarsField.pasteDotenvTooltip"),e[44]=i,e[45]=P):P=e[45];let A;e[46]!==P?(A=t.jsx(De,{children:P}),e[46]=P,e[47]=A):A=e[47];let I;e[48]!==E||e[49]!==A?(I=t.jsxs(Ve,{children:[E,A]}),e[48]=E,e[49]=A,e[50]=I):I=e[50];let K;e[51]!==I||e[52]!==M?(K=t.jsxs("div",{className:"flex items-center gap-2",children:[M,I]}),e[51]=I,e[52]=M,e[53]=K):K=e[53];let Q;e[54]!==x||e[55]!==n||e[56]!==m?(Q=x!==null?t.jsx(kr,{mode:x,onClose:()=>g(null),onSaved:F=>{const Y=n.getValues(`${l}.${x.index}.key`)?.trim()??"";m(x.index,{key:Y,kind:"secret",secretId:F}),g(null)}}):null,e[54]=x,e[55]=n,e[56]=m,e[57]=Q):Q=e[57];let R;return e[58]!==K||e[59]!==Q||e[60]!==S?(R=t.jsxs("div",{className:"space-y-2",children:[S,K,Q]}),e[58]=K,e[59]=Q,e[60]=S,e[61]=R):R=e[61],R}function Nr(a){const e=U.c(77),{index:s,control:n,form:i,onUpdateEntry:l,fieldPath:d,secrets:r,secretById:f,onSaveAsSecret:o,onCreateNewSecret:p,onRemove:u}=a,m=Z(),h=`${d}.${s}.key`,c=`${d}.${s}.value`,x=`${d}.${s}.secretId`,g=`${d}.${s}.kind`;let v;e[0]!==n||e[1]!==g?(v={control:n,name:g},e[0]=n,e[1]=g,e[2]=v):v=e[2];const y=zt(v)==="secret"?"secret":"literal";let b;e[3]!==i||e[4]!==s||e[5]!==h||e[6]!==o||e[7]!==l||e[8]!==c?(b=k=>{const $=i.getValues(h)?.trim()??"";if(k==="literal"){l(s,{key:$,kind:"literal",value:""});return}const q=i.getValues(c)??"";if(q.length>0){o($,q);return}l(s,{key:$,kind:"secret",secretId:""})},e[3]=i,e[4]=s,e[5]=h,e[6]=o,e[7]=l,e[8]=c,e[9]=b):b=e[9];const w=b;let S;e[10]!==s||e[11]!==m?(S=k=>{const{field:$}=k,q=($.value??"").trim(),B=q.length>0&&!wt.test(q);return t.jsxs("div",{className:"space-y-1",children:[t.jsx(Ne,{...$,value:$.value??"",placeholder:m("sandbox.envVarsField.keyPlaceholder"),spellCheck:!1,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",className:ve("font-mono",B&&"border-destructive focus-visible:ring-destructive"),"aria-invalid":B,"aria-label":m("sandbox.envVarsField.envVarKeyLabel",{index:s+1}),onBlur:X=>{const ae=X.target.value.trim();$.onChange(ae),$.onBlur()}}),B?t.jsx("p",{className:"text-2xs text-destructive",children:m("sandbox.envVarsField.invalidKeyMessage")}):null]})},e[10]=s,e[11]=m,e[12]=S):S=e[12];let N;e[13]!==n||e[14]!==h||e[15]!==S?(N=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(be,{control:n,name:h,render:S})}),e[13]=n,e[14]=h,e[15]=S,e[16]=N):N=e[16];let C;e[17]!==w?(C=k=>w(k),e[17]=w,e[18]=C):C=e[18];let M;e[19]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Re,{className:"h-9 w-[110px]",children:t.jsx(Le,{})}),e[19]=M):M=e[19];let T;e[20]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Lt,{className:"size-3.5"}),e[20]=T):T=e[20];let V;e[21]!==m?(V=m("sandbox.envVarsField.literal"),e[21]=m,e[22]=V):V=e[22];let _;e[23]!==V?(_=t.jsx(Pe,{value:"literal",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[T,V]})}),e[23]=V,e[24]=_):_=e[24];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(In,{className:"size-3.5"}),e[25]=E):E=e[25];let P;e[26]!==m?(P=m("sandbox.envVarsField.secret"),e[26]=m,e[27]=P):P=e[27];let A;e[28]!==P?(A=t.jsx(Pe,{value:"secret",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[E,P]})}),e[28]=P,e[29]=A):A=e[29];let I;e[30]!==A||e[31]!==_?(I=t.jsxs(Ue,{children:[_,A]}),e[30]=A,e[31]=_,e[32]=I):I=e[32];let K;e[33]!==y||e[34]!==I||e[35]!==C?(K=t.jsx("div",{className:"shrink-0",children:t.jsxs(Be,{value:y,onValueChange:C,children:[M,I]})}),e[33]=y,e[34]=I,e[35]=C,e[36]=K):K=e[36];let Q;e[37]!==n||e[38]!==i||e[39]!==s||e[40]!==h||e[41]!==y||e[42]!==p||e[43]!==f||e[44]!==x||e[45]!==r||e[46]!==m||e[47]!==c?(Q=t.jsx("div",{className:"flex flex-[2] min-w-0 items-center gap-1",children:y==="literal"?t.jsx(be,{control:n,name:c,render:k=>{const{field:$}=k;return t.jsx(Ne,{...$,value:$.value??"",type:"password",placeholder:m("sandbox.envVarsField.valuePlaceholder"),spellCheck:!1,autoComplete:"off",className:"font-mono","aria-label":m("sandbox.envVarsField.envVarValueLabel",{index:s+1}),onBlur:q=>{$.onChange(q.target.value),$.onBlur()}})}}):t.jsxs(t.Fragment,{children:[t.jsx(be,{control:n,name:x,render:k=>{const{field:$}=k;return t.jsxs(Be,{value:$.value||"",onValueChange:q=>$.onChange(q),children:[t.jsx(Re,{className:ve("h-9 w-full",!$.value&&"text-muted-foreground"),"aria-label":m("sandbox.envVarsField.secretAriaLabel",{index:s+1}),children:t.jsx(Le,{placeholder:m("sandbox.envVarsField.pickSecretPlaceholder"),children:t.jsx(Ma,{field:$,secretById:f})})}),t.jsx(Ue,{children:r.length===0?t.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:m("sandbox.envVarsField.noSecretsYet")}):r.map(Cr)})]})}}),t.jsxs(Ve,{children:[t.jsx(Te,{asChild:!0,children:t.jsx(ee,{type:"button",variant:"ghost",size:"icon","aria-label":m("sandbox.envVarsField.createNewSecretAriaLabel"),onClick:()=>{const k=i.getValues(h)?.trim()??"";p(k)},children:t.jsx(ze,{className:"size-3.5"})})}),t.jsx(De,{children:m("sandbox.envVarsField.createNewSecret")})]})]})}),e[37]=n,e[38]=i,e[39]=s,e[40]=h,e[41]=y,e[42]=p,e[43]=f,e[44]=x,e[45]=r,e[46]=m,e[47]=c,e[48]=Q):Q=e[48];let R;e[49]!==i||e[50]!==h||e[51]!==y||e[52]!==o||e[53]!==m||e[54]!==c?(R=y==="literal"?t.jsxs(Ve,{children:[t.jsx(Te,{asChild:!0,children:t.jsx(ee,{type:"button",variant:"ghost",size:"icon","aria-label":m("sandbox.envVarsField.saveAsSecretAriaLabel"),onClick:()=>{const k=i.getValues(h)?.trim()??"",$=i.getValues(c)??"";o(k,$)},children:t.jsx(Di,{className:"size-3.5"})})}),t.jsx(De,{children:m("sandbox.envVarsField.saveAsSecret")})]}):null,e[49]=i,e[50]=h,e[51]=y,e[52]=o,e[53]=m,e[54]=c,e[55]=R):R=e[55];let F;e[56]!==m?(F=m("sandbox.envVarsField.removeEnvVarAriaLabel"),e[56]=m,e[57]=F):F=e[57];let Y;e[58]===Symbol.for("react.memo_cache_sentinel")?(Y=t.jsx(bt,{className:"size-3.5"}),e[58]=Y):Y=e[58];let z;e[59]!==u||e[60]!==F?(z=t.jsx(Te,{asChild:!0,children:t.jsx(ee,{type:"button",variant:"ghost",size:"icon","aria-label":F,onClick:u,children:Y})}),e[59]=u,e[60]=F,e[61]=z):z=e[61];let L;e[62]!==m?(L=m("sandbox.envVarsField.remove"),e[62]=m,e[63]=L):L=e[63];let W;e[64]!==L?(W=t.jsx(De,{children:L}),e[64]=L,e[65]=W):W=e[65];let G;e[66]!==z||e[67]!==W?(G=t.jsxs(Ve,{children:[z,W]}),e[66]=z,e[67]=W,e[68]=G):G=e[68];let se;e[69]!==R||e[70]!==G?(se=t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[R,G]}),e[69]=R,e[70]=G,e[71]=se):se=e[71];let te;return e[72]!==K||e[73]!==Q||e[74]!==se||e[75]!==N?(te=t.jsxs("div",{className:"flex flex-col gap-2 p-2 sm:flex-row sm:items-center",children:[N,K,Q,se]}),e[72]=K,e[73]=Q,e[74]=se,e[75]=N,e[76]=te):te=e[76],te}function Cr(a){return t.jsx(Pe,{value:a.id,children:t.jsxs("span",{className:"inline-flex items-center gap-2",children:[t.jsx(Va,{scope:a.scope}),t.jsx("span",{className:"font-mono",children:a.name})]})},a.id)}function kr({mode:a,onClose:e,onSaved:s}){const n=Z(),i=a.kind==="save-literal"?a.presetValue:"",l=a.presetKey,[d,r]=H.useState(()=>Mr(l)),[f,o]=H.useState("organization"),[p,u]=H.useState(i),[m,h]=H.useState(""),c=Da(),x=d.trim(),g=p.length>0&&x.length>0&&_a.test(x),v=async b=>{if(b.preventDefault(),!!g)try{const w=await c.mutateAsync({scope:f,name:x,value:p,description:m.trim()||void 0});le.success(n("sandbox.envVarsField.secretSaved",{name:w.name})),s(w.id)}catch(w){le.error(w instanceof Error?w.message:n("sandbox.envVarsField.failedToSaveSecret"))}},j=a.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretTitle"):n("sandbox.envVarsField.createNewSecretTitle"),y=a.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretDescription"):n("sandbox.envVarsField.createNewSecretDescription");return t.jsx(at,{open:!0,onOpenChange:b=>{b||e()},children:t.jsxs(it,{className:"sm:max-w-md",children:[t.jsxs(xt,{children:[t.jsx(ht,{children:j}),t.jsx(Is,{children:y})]}),t.jsxs("form",{onSubmit:v,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Se,{htmlFor:"save-secret-scope",children:n("sandbox.envVarsField.scopeLabel")}),t.jsxs(Be,{value:f,onValueChange:b=>o(b),children:[t.jsx(Re,{id:"save-secret-scope",children:t.jsx(Le,{})}),t.jsxs(Ue,{children:[t.jsx(Pe,{value:"organization",children:n("sandbox.envVarsField.scopeOrganization")}),t.jsx(Pe,{value:"user",children:n("sandbox.envVarsField.scopePrivate")})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Se,{htmlFor:"save-secret-name",children:n("sandbox.envVarsField.nameLabel")}),t.jsx(Ne,{id:"save-secret-name",value:d,onChange:b=>r(b.target.value),placeholder:n("sandbox.envVarsField.namePlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.envVarsField.nameHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Se,{htmlFor:"save-secret-value",children:n("sandbox.envVarsField.valueLabel")}),t.jsx(Ne,{id:"save-secret-value",type:"password",value:p,onChange:b=>u(b.target.value),placeholder:n("sandbox.envVarsField.secretValuePlaceholder"),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Se,{htmlFor:"save-secret-description",children:n("sandbox.envVarsField.descriptionLabel")}),t.jsx(ut,{id:"save-secret-description",value:m,onChange:b=>h(b.target.value),rows:2,placeholder:n("sandbox.envVarsField.descriptionPlaceholder")})]}),t.jsxs($t,{children:[t.jsx(ee,{type:"button",variant:"outline",onClick:e,disabled:c.isPending,children:n("sandbox.envVarsField.cancel")}),t.jsx(ee,{type:"submit",disabled:!g||c.isPending,children:c.isPending?n("sandbox.envVarsField.saving"):n("sandbox.envVarsField.saveSecret")})]})]})]})})}function ws(a){if(!Array.isArray(a))return[];const e=[];for(const s of a){if(!s||typeof s!="object")continue;const n=s,i=(n.key??"").trim();if(!(!i||!wt.test(i))){if(n.kind==="literal"){e.push({key:i,kind:"literal",value:n.value??""});continue}n.kind==="secret"&&n.secretId&&e.push({key:i,kind:"secret",secretId:n.secretId})}}return e}function Mr(a){const e=a.trim();return e&&wt.test(e)?e:""}function _r({repository:a}){const e=a.path.split("/");return{owner:e.slice(0,-1).join("/"),name:e.at(-1)??a.path,url:a.webUrl,repositoryId:a.id}}function Vr(a){const e=U.c(30),{repo:s,onConnect:n}=a,i=Z(),[l,d]=H.useState(!1);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Pa,{size:20,className:"text-foreground/70"}),e[0]=r):r=e[0];let f;e[1]!==s||e[2]!==i?(f=s?`${s.owner}/${s.name}`:i("virtualMcp.settings.repository.none"),e[1]=s,e[2]=i,e[3]=f):f=e[3];let o;e[4]!==s||e[5]!==i?(o=s?s.url:i("virtualMcp.settings.repository.noneDescription"),e[4]=s,e[5]=i,e[6]=o):o=e[6];const p=s?"outline":"default";let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=()=>d(!0),e[7]=u):u=e[7];let m;e[8]!==s||e[9]!==i?(m=i(s?"virtualMcp.settings.repository.change":"virtualMcp.settings.repository.connect"),e[8]=s,e[9]=i,e[10]=m):m=e[10];let h;e[11]!==p||e[12]!==m?(h=t.jsx(ee,{size:"sm",variant:p,onClick:u,children:m}),e[11]=p,e[12]=m,e[13]=h):h=e[13];let c;e[14]!==f||e[15]!==o||e[16]!==h?(c=t.jsx(Me,{children:t.jsx($e,{icon:r,title:f,description:o,action:h})}),e[14]=f,e[15]=o,e[16]=h,e[17]=c):c=e[17];let x;e[18]!==i?(x=i("virtualMcp.settings.repository.connect"),e[18]=i,e[19]=x):x=e[19];let g;e[20]!==n||e[21]!==i?(g=async y=>{await n(_r(y)),d(!1),le.success(i("virtualMcp.settings.repository.connected",{name:y.repository.path}))},e[20]=n,e[21]=i,e[22]=g):g=e[22];let v;e[23]!==l||e[24]!==g||e[25]!==x?(v=t.jsx(Oa,{open:l,onOpenChange:d,title:x,onPicked:g,onError:Tr}),e[23]=l,e[24]=g,e[25]=x,e[26]=v):v=e[26];let j;return e[27]!==v||e[28]!==c?(j=t.jsxs(Oe,{children:[c,v]}),e[27]=v,e[28]=c,e[29]=j):j=e[29],j}function Tr(a){return le.error(a)}const Dr={npm:{install:"npm install",run:a=>`npm run ${a}`,runtime:"node"},pnpm:{install:"pnpm install",run:a=>`pnpm run ${a}`,runtime:"node"},yarn:{install:"yarn install",run:a=>`yarn run ${a}`,runtime:"node"},bun:{install:"bun install",run:a=>`bun run ${a}`,runtime:"bun"},deno:{install:"deno install",run:a=>`deno task ${a}`,runtime:"deno"}};function Pr(a){const e=a.trim();if(e==="")return{ok:!0,value:null};if(!/^\d+$/.test(e))return{ok:!1};const s=Number(e);return s<1||s>65535?{ok:!1}:{ok:!0,value:String(s)}}const Or=Object.keys(Dr),Tt="__none__";function Ir(a){const e=U.c(47),{control:s}=a,n=Z(),i=H.useRef(null);let l;e[0]!==n?(l=n("sandbox.runtimeFields.packageManager"),e[0]=n,e[1]=l):l=e[1];let d;e[2]!==l?(d=t.jsx(Se,{htmlFor:"runtime-pm",children:l}),e[2]=l,e[3]=d):d=e[3];let r;e[4]!==n?(r=C=>{const{field:M}=C;return t.jsxs(Be,{value:M.value??Tt,onValueChange:T=>M.onChange(T===Tt?null:T),children:[t.jsx(Re,{id:"runtime-pm",children:t.jsx(Le,{placeholder:n("sandbox.runtimeFields.autoDetect")})}),t.jsxs(Ue,{children:[t.jsx(Pe,{value:Tt,children:n("sandbox.runtimeFields.autoDetect")}),Or.map(Ar)]})]})},e[4]=n,e[5]=r):r=e[5];let f;e[6]!==s||e[7]!==r?(f=t.jsx(be,{control:s,name:"metadata.runtime.selected",render:r}),e[6]=s,e[7]=r,e[8]=f):f=e[8];let o;e[9]!==d||e[10]!==f?(o=t.jsxs("div",{className:"space-y-2",children:[d,f]}),e[9]=d,e[10]=f,e[11]=o):o=e[11];let p;e[12]!==n?(p=n("sandbox.runtimeFields.packagePath"),e[12]=n,e[13]=p):p=e[13];let u;e[14]!==p?(u=t.jsx(Se,{htmlFor:"runtime-path",children:p}),e[14]=p,e[15]=u):u=e[15];let m;e[16]!==s?(m=t.jsx(be,{control:s,name:"metadata.runtime.path",render:$r}),e[16]=s,e[17]=m):m=e[17];let h;e[18]!==n?(h=n("sandbox.runtimeFields.packagePathDescription"),e[18]=n,e[19]=h):h=e[19];let c;e[20]!==h?(c=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[20]=h,e[21]=c):c=e[21];let x;e[22]!==c||e[23]!==u||e[24]!==m?(x=t.jsxs("div",{className:"space-y-2",children:[u,m,c]}),e[22]=c,e[23]=u,e[24]=m,e[25]=x):x=e[25];let g;e[26]!==n?(g=n("sandbox.runtimeFields.devServerPort"),e[26]=n,e[27]=g):g=e[27];let v;e[28]!==g?(v=t.jsx(Se,{htmlFor:"runtime-port",children:g}),e[28]=g,e[29]=v):v=e[29];let j;e[30]!==n?(j=C=>{const{field:M}=C;return t.jsx(Ne,{ref:i,id:"runtime-port",inputMode:"numeric",placeholder:n("sandbox.runtimeFields.auto"),defaultValue:M.value??"",onBlur:T=>{const V=Pr(T.target.value);V.ok?M.onChange(V.value):i.current&&(i.current.value=M.value??"")}})},e[30]=n,e[31]=j):j=e[31];let y;e[32]!==s||e[33]!==j?(y=t.jsx(be,{control:s,name:"metadata.runtime.port",render:j}),e[32]=s,e[33]=j,e[34]=y):y=e[34];let b;e[35]!==n?(b=n("sandbox.runtimeFields.devServerPortDescription"),e[35]=n,e[36]=b):b=e[36];let w;e[37]!==b?(w=t.jsx("p",{className:"text-xs text-muted-foreground",children:b}),e[37]=b,e[38]=w):w=e[38];let S;e[39]!==v||e[40]!==y||e[41]!==w?(S=t.jsxs("div",{className:"space-y-2",children:[v,y,w]}),e[39]=v,e[40]=y,e[41]=w,e[42]=S):S=e[42];let N;return e[43]!==x||e[44]!==S||e[45]!==o?(N=t.jsxs("div",{className:"space-y-5",children:[o,x,S]}),e[43]=x,e[44]=S,e[45]=o,e[46]=N):N=e[46],N}function $r(a){const{field:e}=a;return t.jsx(Ne,{id:"runtime-path",placeholder:".",defaultValue:e.value??"",onBlur:s=>{const n=s.target.value.trim();e.onChange(n===""?null:n)}})}function Ar(a){return t.jsx(Pe,{value:a,children:a},a)}function Er(a){const e=U.c(10),{control:s}=a,n=Z(),[i,l]=H.useState(null),[d,r]=H.useState(null),f=zt({control:s,name:"metadata.runtime.path"})??"";let o;e[0]!==f?(o=cs(f),e[0]=f,e[1]=o):o=e[1];const p=o;let u;e[2]!==i||e[3]!==d||e[4]!==p||e[5]!==n?(u=h=>{const{field:c}=h,x=c.value??[],g=j=>c.onChange(j.length?j:null),v=()=>{if(i===null)return;const j=cs(i);if(!j){l(null),r(null);return}if(j===p||x.some(y=>y.path===j)){r(n("sandbox.runtimeApps.duplicate"));return}g([...x,{path:j}]),l(null),r(null)};return t.jsxs("div",{className:"space-y-2",children:[t.jsx(Se,{htmlFor:"runtime-apps-draft",children:n("sandbox.runtimeApps.title")}),x.length>0&&t.jsx("ul",{className:"space-y-1.5",children:x.map(j=>t.jsxs("li",{className:"flex h-9 items-center gap-2 rounded-md border border-border px-3",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:j.path}),t.jsx(ee,{type:"button",variant:"ghost",size:"icon-sm","aria-label":n("sandbox.runtimeApps.remove",{path:j.path}),onClick:()=>g(x.filter(y=>y.path!==j.path)),children:t.jsx(bt,{})})]},j.path))}),i!==null?t.jsx(Ne,{id:"runtime-apps-draft",autoFocus:!0,placeholder:"apps/checkout",value:i,"aria-invalid":!!d,onChange:j=>{l(j.target.value),r(null)},onBlur:v,onKeyDown:j=>{j.key==="Enter"?(j.preventDefault(),v()):j.key==="Escape"&&(l(null),r(null))}}):x.length<rs&&t.jsxs(ee,{id:"runtime-apps-draft",type:"button",variant:"outline",size:"sm",onClick:()=>l(""),children:[t.jsx(ze,{}),n("sandbox.runtimeApps.add")]}),d?t.jsx("p",{className:"text-xs text-destructive",children:d}):t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.runtimeApps.description",{max:String(rs)})})]})},e[2]=i,e[3]=d,e[4]=p,e[5]=n,e[6]=u):u=e[6];let m;return e[7]!==s||e[8]!==u?(m=t.jsx(be,{control:s,name:"metadata.runtime.apps",render:u}),e[7]=s,e[8]=u,e[9]=m):m=e[9],m}function Fr(a){const e=U.c(5),{control:s}=a,n=Z();let i;e[0]!==n?(i=d=>{const{field:r}=d;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(Se,{htmlFor:"field-description-tooltips",className:"font-normal text-foreground",children:n("sandbox.fieldDescriptionTooltipsField.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.fieldDescriptionTooltipsField.description")})]}),t.jsx(rt,{id:"field-description-tooltips",className:"shrink-0",checked:r.value??!1,onCheckedChange:f=>r.onChange(f)})]})},e[0]=n,e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==i?(l=t.jsx(be,{control:s,name:"metadata.fieldDescriptionTooltips",render:i}),e[2]=s,e[3]=i,e[4]=l):l=e[4],l}function zr(a){const e=U.c(32),{control:s,onCommit:n}=a,i=Z();let l;e[0]!==i?(l=i("virtualMcp.virtualMcp.publishPolicySmart"),e[0]=i,e[1]=l):l=e[1];let d;e[2]!==i?(d=i("virtualMcp.virtualMcp.publishPolicySmartDescription"),e[2]=i,e[3]=d):d=e[3];let r;e[4]!==l||e[5]!==d?(r={value:"smart",label:l,description:d},e[4]=l,e[5]=d,e[6]=r):r=e[6];let f;e[7]!==i?(f=i("virtualMcp.virtualMcp.publishPolicyCodeReview"),e[7]=i,e[8]=f):f=e[8];let o;e[9]!==i?(o=i("virtualMcp.virtualMcp.publishPolicyCodeReviewDescription"),e[9]=i,e[10]=o):o=e[10];let p;e[11]!==f||e[12]!==o?(p={value:"code-review",label:f,description:o},e[11]=f,e[12]=o,e[13]=p):p=e[13];let u;e[14]!==i?(u=i("virtualMcp.virtualMcp.publishPolicyOpen"),e[14]=i,e[15]=u):u=e[15];let m;e[16]!==i?(m=i("virtualMcp.virtualMcp.publishPolicyOpenDescription"),e[16]=i,e[17]=m):m=e[17];let h;e[18]!==u||e[19]!==m?(h={value:"open",label:u,description:m},e[18]=u,e[19]=m,e[20]=h):h=e[20];let c;e[21]!==r||e[22]!==p||e[23]!==h?(c=[r,p,h],e[21]=r,e[22]=p,e[23]=h,e[24]=c):c=e[24];const x=c;let g;e[25]!==n||e[26]!==x||e[27]!==i?(g=j=>{const{field:y}=j,b=y.value??"smart";return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(Se,{htmlFor:"publish-policy",className:"font-normal text-foreground",children:i("virtualMcp.virtualMcp.publishing")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("virtualMcp.virtualMcp.publishingDescription")})]}),t.jsxs(Be,{value:b,onValueChange:w=>{y.onChange(w),n()},children:[t.jsx(Re,{id:"publish-policy",className:"w-44 shrink-0",children:t.jsx(Le,{})}),t.jsx(Ue,{className:"max-w-80",children:x.map(Rr)})]})]})},e[25]=n,e[26]=x,e[27]=i,e[28]=g):g=e[28];let v;return e[29]!==s||e[30]!==g?(v=t.jsx(be,{name:"metadata.publishPolicy",control:s,render:g}),e[29]=s,e[30]=g,e[31]=v):v=e[31],v}function Rr(a){return t.jsx(Pe,{value:a.value,description:a.description,children:a.label},a.value)}function Lr(a){const e=U.c(24),{control:s,onCommit:n}=a,i=Z();let l;e[0]!==i?(l=i("sandbox.cmsSettings.contentEditing.off"),e[0]=i,e[1]=l):l=e[1];let d;e[2]!==i?(d=i("sandbox.cmsSettings.contentEditing.offDescription"),e[2]=i,e[3]=d):d=e[3];let r;e[4]!==l||e[5]!==d?(r={value:"off",label:l,description:d},e[4]=l,e[5]=d,e[6]=r):r=e[6];let f;e[7]!==i?(f=i("sandbox.cmsSettings.contentEditing.on"),e[7]=i,e[8]=f):f=e[8];let o;e[9]!==i?(o=i("sandbox.cmsSettings.contentEditing.onDescription"),e[9]=i,e[10]=o):o=e[10];let p;e[11]!==f||e[12]!==o?(p={value:"on",label:f,description:o},e[11]=f,e[12]=o,e[13]=p):p=e[13];let u;e[14]!==r||e[15]!==p?(u=[r,p],e[14]=r,e[15]=p,e[16]=u):u=e[16];const m=u;let h;e[17]!==n||e[18]!==m||e[19]!==i?(h=x=>{const{field:g}=x,v=g.value??null,j=en(v);return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(Se,{htmlFor:"content-editing-mode",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.contentEditing.title")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.contentEditing.description")})]}),t.jsxs(Be,{value:j,onValueChange:y=>{const b=ja.safeParse(y);b.success&&(g.onChange(ya(v,b.data)),n())},children:[t.jsx(Re,{id:"content-editing-mode",className:"w-44 shrink-0",children:t.jsx(Le,{})}),t.jsx(Ue,{className:"max-w-80",children:m.map(Ur)})]})]})},e[17]=n,e[18]=m,e[19]=i,e[20]=h):h=e[20];let c;return e[21]!==s||e[22]!==h?(c=t.jsx(be,{name:"metadata.ui.layout",control:s,render:h}),e[21]=s,e[22]=h,e[23]=c):c=e[23],c}function Ur(a){return t.jsx(Pe,{value:a.value,description:a.description,children:a.label},a.value)}function Ss(a){const e=a.metadata?.sidebarViews,s=a.metadata?.sidebarViewsVersion;return{effectiveViews:[...Ot(It(a.metadata),s)],rawViews:e===null?null:e?[...e]:void 0,version:s,seen:a.metadata?.sidebarViewsSeen??void 0}}function Ns(a,e){return a===e?!0:!a||!e||a.length!==e.length?!1:a.every((s,n)=>s===e[n])}function Br(a,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...a,shareDialogOpen:e.payload};case"SET_ADD_DIALOG_OPEN":return{...a,addDialogOpen:e.payload};case"OPEN_SETTINGS":return{...a,settingsDialogOpen:!0,settingsConnectionId:e.payload};case"CLOSE_SETTINGS":return{...a,settingsDialogOpen:!1,settingsConnectionId:null};default:return a}}function Yr(a,e){switch(e.type){case"accumulate":{const s=a??{start:e.now,fields:new Set,saveCount:0,instructionsLength:null},n=new Set(s.fields);for(const i of e.fields)n.add(i);return{...s,fields:n,saveCount:s.saveCount+1,instructionsLength:e.instructionsLength??s.instructionsLength}}case"reset":return null}}function Wr(a){const e=a.metadata?.runtime?.env;if(!e||e.length===0)return a;const s=e.filter(n=>{if(!n||typeof n!="object")return!1;const i=(n.key??"").trim();return!i||!wt.test(i)?!1:n.kind==="literal"?!0:n.kind==="secret"?!!n.secretId:!1});return s.length===e.length?a:{...a,metadata:{...a.metadata,runtime:{...a.metadata?.runtime??{},env:s}}}}async function Kr(a,e){const s=a?.idToken??null;if(s){const i=Cs(s);if(i)return i}const n=a?.userinfoEndpoint??null;if(n)try{const i=await fetch(n,{headers:{Authorization:`Bearer ${e}`}});if(i.ok){const l=await i.json(),d=typeof l.email=="string"?l.email:typeof l.upn=="string"?l.upn:typeof l.preferred_username=="string"?l.preferred_username:null;if(d)return d}}catch{}return Cs(e)}function Cs(a){try{const e=a.split(".");if(e.length===3&&e[1]){const s=JSON.parse(atob(e[1].replace(/-/g,"+").replace(/_/g,"/")));if(typeof s.email=="string")return s.email;if(typeof s.upn=="string")return s.upn;if(typeof s.preferred_username=="string")return s.preferred_username}}catch{}return null}function Gr({virtualMcp:a,contextSection:e}){const s=Z(),n=ni(),{org:i}=Ee(),l=ri(),{data:d}=oi([a.id]),r=d?.get(a.id)?.last_used_at,f=$s(),o=Ft(),p=ft(),u=Xs(a.id),m=JSON.stringify([i.id,a.id]),h=la(a.metadata,u.snapshot()),c=$n({resolver:An(or),defaultValues:{...a,metadata:{...os(a.metadata),previewServerUrl:va(a.metadata),...h}}}),x=c.watch("connections"),g=Ia("multi_app_preview"),v=Hi(a),j=Qs(a?.metadata),y=j&&en(c.watch("metadata.ui.layout"))==="off",b=Es(a),w=b?{owner:b.owner,name:b.name,url:b.url}:null,[S,N]=H.useReducer(Br,{shareDialogOpen:!1,addDialogOpen:!1,settingsDialogOpen:!1,settingsConnectionId:null}),[C,M]=H.useState(!1),[T,V]=H.useState(!1),{openSidePanel:_}=ei(),{sendMessage:E}=Qn(),P=async()=>{if(T)return;const D=c.getValues("metadata.instructions");if(D?.trim()){V(!0);try{R(),_e("agent_instructions_improve_clicked",{agent_id:a.id,instructions_length:D.length}),_();const oe=qn(i.id);await E({tiptapDoc:Jn({managerAgentId:oe.id,managerName:oe.title,kind:"agent",id:a.id,instructions:D})})}finally{V(!1)}}},[A,I]=H.useReducer(Yr,null),K=()=>{A!==null&&(_e("agent_updated",{agent_id:a.id,fields:Array.from(A.fields),instructions_length:A.instructionsLength,save_count:A.saveCount,edit_duration_ms:Date.now()-A.start}),I({type:"reset"}))},{schedule:Q,flush:R}=ts({delayMs:3e4,save:async()=>K()}),F=async()=>{const D=u.snapshot(),oe={predicate:Ce=>ls(Ce.queryKey,i.id)},ne=async()=>(await o.invalidateQueries({predicate:Ce=>ls(Ce.queryKey,i.id),refetchType:"all"}),as(o,i.id,a.id)),xe=(Ce,He)=>{if(Ce){Ns(c.getValues("metadata.sidebarViews"),Ce.rawViews)||c.setValue("metadata.sidebarViews",Ce.rawViews,{shouldDirty:!1}),c.getValues("metadata.sidebarViewsVersion")!==Ce.version&&c.setValue("metadata.sidebarViewsVersion",Ce.version,{shouldDirty:!1}),Ns(c.getValues("metadata.sidebarViewsSeen"),Ce.seen)||c.setValue("metadata.sidebarViewsSeen",Ce.seen,{shouldDirty:!1});return}He!==null&&(c.setValue("metadata.sidebarViews",[...He],{shouldDirty:!1}),c.setValue("metadata.sidebarViewsVersion",ia,{shouldDirty:!1}))},ke=ra(D),Ie=Object.keys(c.control._formState.dirtyFields);if(Ie.length===0&&!ke){await u.settle({snapshot:D,saved:!0,authoritativeViews:D?.persistedViews});return}const Ge=Ie.length>0?Ie:["metadata"],ot=Ge.includes("metadata"),qe=c.getValues();c.reset(qe,{keepValues:!0});const et=Wr(qe),pn=as(o,i.id,a.id),hn=oa({sidebarViews:et.metadata?.sidebarViews,sidebarViewsVersion:et.metadata?.sidebarViewsVersion},D,pn?.metadata);et.metadata={...os(et.metadata),...hn};let Nt;try{Nt=await l.update.mutateAsync({id:a.id,data:et})}catch(Ce){let He=null;try{He=await ne()}catch{}const Wt=He?Ss(He):null,Kt=await u.settle({snapshot:D,saved:!1,authoritativeViews:Wt?.effectiveViews});throw Kt.settledLatest&&xe(Wt,Kt.reconciledViews),Ce}await o.cancelQueries(oe),ca(o,i.id,Nt);const Bt=Ss(Nt),Yt=await u.settle({snapshot:D,saved:!0,authoritativeViews:Bt.effectiveViews});Yt.settledLatest&&xe(Bt,Yt.reconciledViews),I({type:"accumulate",now:Date.now(),fields:Ge,instructionsLength:ot?qe.metadata?.instructions?.length??0:null}),Q()},Y=()=>$a(m,F),{schedule:z,flush:L}=ts({save:Y});H.useEffect(()=>{const D=c.watch(()=>z());return()=>D.unsubscribe()},[]);const W=()=>{_e("connections_dialog_opened",{source:"agent_settings",mode:"add"}),N({type:"SET_ADD_DIALOG_OPEN",payload:!0})},G=async D=>{const oe=c.getValues("connections");if(oe.some(ke=>ke.connection_id===D))return;c.setValue("connections",[...oe,{connection_id:D,selected_tools:Vt.tools,selected_resources:Vt.resources,selected_prompts:Vt.prompts}],{shouldDirty:!0}),N({type:"SET_ADD_DIALOG_OPEN",payload:!1});const ne=new URL(`/api/${i.slug}/mcp/${D}`,window.location.origin),xe=await Xt({url:ne.href,token:null,orgId:i.id});xe.supportsOAuth&&!xe.isAuthenticated&&await q(D)},se=D=>{const ne=c.getValues("connections").filter(xe=>xe.connection_id!==D);c.setValue("connections",ne,{shouldDirty:!0})},te=(D,oe)=>{const ne=c.getValues("connections");if(ne.some(xe=>xe.connection_id===oe)){le.error(s("virtualMcp.virtualMcp.instanceAlreadyAdded"));return}c.setValue("connections",ne.map(xe=>xe.connection_id===D?{...xe,connection_id:oe}:xe),{shouldDirty:!0})},k=async D=>{if(c.getValues("connections").find(ne=>ne.connection_id===D))try{const{item:ne}=await p.call("COLLECTION_CONNECTIONS_GET",{id:D});if(!ne)return;const xe=ne.title.replace(/\s*\(.*?\)\s*$/,""),ke=Hn("conn"),Ie=`${xe} (${Date.now().toString(36).slice(-4)})`;await f.create.mutateAsync({id:ke,title:Ie,description:ne.description??null,connection_type:ne.connection_type,connection_url:ne.connection_url??null,connection_token:null,icon:ne.icon??null,app_name:ne.app_name??null,app_id:ne.app_id??null,connection_headers:ne.connection_headers??null});const Ge=new URL(`/api/${i.slug}/mcp/${ke}`,window.location.origin),ot=await Xt({url:Ge.href,token:null,orgId:i.id});if(ot.supportsOAuth&&!ot.isAuthenticated){const qe=await q(ke);if(!qe){await f.delete.mutateAsync(ke);return}await f.update.mutateAsync({id:ke,data:{title:`${xe} (${qe})`}})}te(D,ke),le.success(s("virtualMcp.virtualMcp.newInstanceCreated"))}catch(ne){console.error("Failed to create instance:",ne),le.error(s("virtualMcp.virtualMcp.failedToCreateInstance"))}},$=D=>{N({type:"OPEN_SETTINGS",payload:D})},q=async D=>{const{token:oe,tokenInfo:ne,error:xe}=await ai({connectionId:D,orgSlug:i.slug,scope:"offline_access"});if(xe||!oe)return le.error(s("virtualMcp.virtualMcp.authenticationFailed",{error:xe??""})),null;if(ne)try{const Ie=await fetch(`/api/${i.slug}/connections/${D}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:ne.accessToken,refreshToken:ne.refreshToken,expiresIn:ne.expiresIn,scope:ne.scope,clientId:ne.clientId,clientSecret:ne.clientSecret,tokenEndpoint:ne.tokenEndpoint})});if(!Ie.ok)console.error("Failed to save OAuth token:",await Ie.text()),await f.update.mutateAsync({id:D,data:{connection_token:oe}});else try{await f.update.mutateAsync({id:D,data:{}})}catch(Ge){console.warn("Failed to refresh connection tools after OAuth:",Ge)}}catch(Ie){console.error("Error saving OAuth token:",Ie),await f.update.mutateAsync({id:D,data:{connection_token:oe}})}else await f.update.mutateAsync({id:D,data:{connection_token:oe}});const ke=new URL(`/api/${i.slug}/mcp/${D}`,window.location.origin);return await o.invalidateQueries({queryKey:Et.isMCPAuthenticated(ke.href,null)}),le.success(s("virtualMcp.virtualMcp.authenticationSuccessful")),Kr(ne,oe)},B=()=>{const D=c.getValues("metadata.instructions")??"",oe=s("virtualMcp.virtualMcp.promptTemplateContent"),ne=D.trim()?`${D}
|
|
3
3
|
|
|
4
4
|
${oe}`:oe;c.setValue("metadata.instructions",ne,{shouldDirty:!0})},X=new Set(x.map(D=>D.connection_id)),{section:ae}=Xl(),je=e!==null,ie=e==="instructions"?null:e??ae,ce=ie==="general",ue=je?e==="instructions":ce,ge=xa(a.id),de=En(a.metadata),he=ql({virtualMcpId:a.id,form:c,flushAndSave:L}),me=pt(),[fe,O]=H.useState(!1),J=async()=>{R();try{await l.delete.mutateAsync(a.id),_e("agent_deleted",{agent_id:a.id,source:"agent_detail"}),le.success(s("virtualMcp.virtualMcp.agentDeleted",{title:a.title})),me({to:"/$org",params:{org:i.slug}})}catch{}},ye=t.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>{_e("agent_connect_modal_opened",{agent_id:a.id}),N({type:"SET_SHARE_DIALOG_OPEN",payload:!0})},children:[t.jsx(Fn,{size:14}),s("virtualMcp.virtualMcp.connect")]}),pe=t.jsxs("div",{className:"flex items-center gap-2",children:[!c.watch("metadata.instructions")?.trim()&&t.jsx(ee,{variant:"outline",size:"sm",onClick:B,children:s("virtualMcp.virtualMcp.promptTemplate")}),t.jsxs(ee,{variant:"outline",size:"sm",disabled:T||!c.watch("metadata.instructions")?.trim(),onClick:P,children:[t.jsx(dt,{size:13}),s("virtualMcp.virtualMcp.improve")]})]});return t.jsxs(Ke,{children:[t.jsxs(t.Fragment,{children:[!je&&t.jsxs(t.Fragment,{children:[t.jsx(Ke.Title,{children:s("virtualMcp.settings.title")}),t.jsx(Ql,{section:ie??"general"})]}),t.jsx(Ke.Actions,{secondary:ie==="connections"?ye:void 0,children:ie==="connections"?t.jsxs(ee,{size:"sm",onClick:W,children:[t.jsx(ze,{size:14}),s("virtualMcp.virtualMcp.addConnection")]}):ie==="general"?ye:null}),t.jsx(Ke.Content,{children:t.jsx(Ke.Container,{width:"standard",className:"@container/project-settings",children:t.jsxs(zn,{children:[ie==="views"&&t.jsx(Wl,{views:he}),ce&&t.jsx(Hl,{form:c,onCommit:L}),ie==="connections"&&t.jsx("section",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:x.length===0?t.jsxs("button",{type:"button",onClick:W,className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(ze,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:s("virtualMcp.virtualMcp.noConnectionsYet")})]}):x.map(D=>t.jsx(Xe,{fallback:()=>null,children:t.jsx(H.Suspense,{fallback:t.jsx(rn,{}),children:t.jsx(Pl,{connection_id:D.connection_id,usedConnectionIds:X,onOpenSettings:()=>$(D.connection_id),onRemove:()=>se(D.connection_id),onAuthenticate:q,onSwitchInstance:te,onNewInstance:()=>k(D.connection_id)})})},D.connection_id))})}),ue&&t.jsxs("section",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground",children:s("virtualMcp.virtualMcp.instructions")}),pe]}),t.jsx(be,{name:"metadata.instructions",control:c.control,render:({field:D})=>t.jsxs("div",{className:"relative rounded-xl shadow-edge bg-card focus-within-ring",children:[t.jsx(ut,{...D,value:D.value??"",onChange:oe=>{D.onChange(oe)},onBlur:()=>{D.onBlur(),L()},placeholder:s("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"min-h-[200px] max-h-[360px] overflow-auto resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed border-0 shadow-none px-4 py-3 pr-11 focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent",style:{boxShadow:"none"}}),t.jsxs(Ve,{delayDuration:0,children:[t.jsx(Te,{asChild:!0,children:t.jsx(ee,{type:"button",variant:"ghost",size:"icon-sm",className:"absolute top-2 right-2 text-muted-foreground",onClick:()=>M(!0),"aria-label":s("virtualMcp.virtualMcp.openFullscreenEditor"),children:t.jsx(Pi,{size:14})})}),t.jsx(De,{side:"left",children:s("virtualMcp.virtualMcp.fullscreen")})]})]})})]}),ue&&t.jsx(rl,{form:c}),ie==="site"&&!j&&t.jsx(Oe,{children:t.jsx(Me,{children:t.jsx($e,{title:s("virtualMcp.settings.cmsEmptyTitle"),description:s("virtualMcp.settings.cmsEmpty"),action:t.jsx(ee,{size:"sm",variant:"outline",asChild:!0,children:t.jsx(At,{to:".",search:{section:"repository"},children:s("virtualMcp.settings.repository.open")})})})})}),ie==="site"&&j&&t.jsx(Oe,{title:s("sandbox.cmsSettings.title"),children:t.jsxs(Me,{children:[t.jsx(we,{children:t.jsx(Lr,{control:c.control,onCommit:L})}),!y&&t.jsx(we,{children:t.jsx(Fr,{control:c.control})}),!y&&v&&t.jsx(we,{children:t.jsx(zr,{control:c.control,onCommit:L})})]})}),ie==="site"&&!y&&t.jsx(Oe,{title:s("sandbox.cmsSettings.preview.title"),description:s("sandbox.cmsSettings.preview.description"),children:t.jsx(Me,{children:t.jsx(rr,{control:c.control,isBlocksV8:ge,previewServerUrl:c.watch("metadata.previewServerUrl"),fastPreview:c.watch("metadata.fastPreview")})})}),ie==="site"&&t.jsx(sr,{virtualMcp:a}),ie==="site"&&ge&&de&&t.jsx(er,{orgSlug:i.slug,virtualMcpId:a.id,site:de}),ie==="repository"&&t.jsx(Vr,{repo:w,onConnect:D=>(c.setValue("metadata.repository",D,{shouldDirty:!0}),L())}),ie==="repository"&&t.jsx(Oe,{title:s("virtualMcp.settings.repository.runtimeTitle"),description:s("virtualMcp.settings.repository.runtimeDescription"),children:t.jsxs(Me,{children:[t.jsx(we,{children:t.jsx(Ir,{control:c.control})}),g&&t.jsx(we,{children:t.jsx(Er,{control:c.control})}),t.jsx(we,{children:t.jsx(jr,{control:c.control,form:c,virtualMcpId:a.id,orgSlug:i.slug,sandboxMap:a.metadata.sandboxMap})})]})}),ce&&t.jsx(Oe,{title:s("virtualMcp.settings.groups.details"),children:t.jsxs(Me,{children:[t.jsx($e,{title:s("virtualMcp.virtualMcp.createdBy"),action:t.jsx(Xn,{id:a.created_by,size:"2xs",className:"text-sm text-muted-foreground"})}),t.jsx($e,{title:s("virtualMcp.virtualMcp.created"),action:t.jsx("span",{className:"text-sm text-muted-foreground",children:al(new Date(a.created_at),"PP",{locale:n})})}),t.jsx($e,{title:s("virtualMcp.virtualMcp.lastUsedLabel"),action:t.jsx("span",{className:"text-sm text-muted-foreground",children:r?ii(new Date(r),{addSuffix:!0,locale:n}):s("virtualMcp.virtualMcp.neverUsed")})})]})}),ce&&t.jsx(Oe,{title:s("virtualMcp.settings.groups.advanced"),children:t.jsx(Me,{children:t.jsx($e,{title:s("virtualMcp.virtualMcp.deleteAgent"),description:s("virtualMcp.virtualMcp.deleteAgentDescription"),action:t.jsxs(ee,{variant:"outline",size:"sm",className:"text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:()=>O(!0),children:[t.jsx(bt,{size:14}),s("virtualMcp.virtualMcp.deleteAgent")]})})})})]})})},e??ie)]}),t.jsx(Rn,{open:fe,onOpenChange:O,children:t.jsxs(Ln,{children:[t.jsxs(Un,{children:[t.jsx(Bn,{children:s("virtualMcp.virtualMcp.deleteAgentConfirm")}),t.jsx(Yn,{children:s("virtualMcp.virtualMcp.deleteAgentConfirmDescription",{title:a.title})})]}),t.jsxs(Wn,{children:[t.jsx(Kn,{children:s("virtualMcp.virtualMcp.cancel")}),t.jsx(Gn,{onClick:J,variant:"destructive",children:s("virtualMcp.virtualMcp.delete")})]})]})}),t.jsx($i,{open:S.addDialogOpen,onOpenChange:D=>N({type:"SET_ADD_DIALOG_OPEN",payload:D}),agentId:a.id,addedConnectionIds:X,onAdd:G}),t.jsx(Dl,{open:S.settingsDialogOpen,onOpenChange:D=>{D||N({type:"CLOSE_SETTINGS"})},selectedId:S.settingsConnectionId,form:c,connections:x,onAuthenticate:q}),t.jsx(gr,{open:S.shareDialogOpen,onOpenChange:D=>N({type:"SET_SHARE_DIALOG_OPEN",payload:D}),virtualMcp:a}),t.jsx(at,{open:C,onOpenChange:M,children:t.jsxs(it,{className:"w-[90vw] sm:max-w-6xl h-[85vh] flex flex-col p-0 gap-0",children:[t.jsx(xt,{className:"px-6 pt-6 pb-3 border-b border-border shrink-0",children:t.jsx(ht,{children:s("virtualMcp.virtualMcp.instructions")})}),t.jsx("div",{className:"flex-1 min-h-0 p-6",children:t.jsx(be,{name:"metadata.instructions",control:c.control,render:({field:D})=>t.jsx(ut,{...D,value:D.value??"",onChange:oe=>{D.onChange(oe)},onBlur:()=>{D.onBlur(),L()},placeholder:s("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"w-full h-full resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed rounded-xl shadow-edge px-4 py-3 focus-ring bg-card border-0",style:{boxShadow:"none"}})})})]})})]})}function ac(a){const e=U.c(22),{virtualMcpId:s,contextSection:n}=a,i=n===void 0?null:n,l=Z(),d=pt(),{org:r}=Ee(),f=As(s);if(!f){let m;e[0]!==l?(m=l("virtualMcp.virtualMcp.spaceNotFound"),e[0]=l,e[1]=m):m=e[1];let h;e[2]!==l?(h=l("virtualMcp.virtualMcp.spaceNotFoundDescription"),e[2]=l,e[3]=h):h=e[3];let c;e[4]!==d||e[5]!==r.slug?(c=()=>d({to:"/$org",params:{org:r.slug}}),e[4]=d,e[5]=r.slug,e[6]=c):c=e[6];let x;e[7]!==l?(x=l("virtualMcp.virtualMcp.backToSpaces"),e[7]=l,e[8]=x):x=e[8];let g;e[9]!==c||e[10]!==x?(g=t.jsx(ee,{variant:"outline",onClick:c,children:x}),e[9]=c,e[10]=x,e[11]=g):g=e[11];let v;return e[12]!==m||e[13]!==h||e[14]!==g?(v=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Zn,{title:m,description:h,actions:g})}),e[12]=m,e[13]=h,e[14]=g,e[15]=v):v=e[15],v}let o;e[16]!==f?(o=Es(f)?.connectionId??"",e[16]=f,e[17]=o):o=e[17];const p=`${f.id}:${o}`;let u;return e[18]!==i||e[19]!==p||e[20]!==f?(u=t.jsx(Gr,{virtualMcp:f,contextSection:i},p),e[18]=i,e[19]=p,e[20]=f,e[21]=u):u=e[21],u}export{ac as V};
|