decocms 4.562.1 → 4.562.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Cwj2JDLb.js → AlertCircle-BPGyk76P.js} +1 -1
- package/dist/client/assets/{AreaChart-M71cxP0N.js → AreaChart-Dwi8bZZ1.js} +1 -1
- package/dist/client/assets/{ArrowLeft-D6im8CSl.js → ArrowLeft-DRdw9Nza.js} +1 -1
- package/dist/client/assets/{ArrowUp-zoWFBt83.js → ArrowUp-BJTv4ddc.js} +1 -1
- package/dist/client/assets/{CartesianChart-CkRq1ukN.js → CartesianChart-DHyrpR7F.js} +1 -1
- package/dist/client/assets/{CategoricalChart-CJyVrm-b.js → CategoricalChart-CVu6TY4_.js} +1 -1
- package/dist/client/assets/{CheckCircle-Dycaqr3_.js → CheckCircle-y3P873c6.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-Cq__IjWt.js → ChevronSelectorVertical-TIONA5Zl.js} +1 -1
- package/dist/client/assets/{ChevronUp-B0uKxpVg.js → ChevronUp-CDe5Gfov.js} +1 -1
- package/dist/client/assets/{CreditCard01-CMHPxKus.js → CreditCard01-abk_vBBR.js} +1 -1
- package/dist/client/assets/{Globe04-BLpPYUUd.js → Globe04-Dr1jk8eS.js} +1 -1
- package/dist/client/assets/{Key01-KS2Cdqso.js → Key01-DzZgIVqE.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CFo-1erV.js → LinkBroken01-4j6Z2AOF.js} +1 -1
- package/dist/client/assets/{Minus-CR14C6Ew.js → Minus-B2u_zm0f.js} +1 -1
- package/dist/client/assets/{Monitor01-PjSuNm4O.js → Monitor01-DWylBoOJ.js} +1 -1
- package/dist/client/assets/{Play-DAD0wkps.js → Play-CV8_Sy8a.js} +1 -1
- package/dist/client/assets/{Plus-Caq968Zm.js → Plus-BtfY7EHX.js} +1 -1
- package/dist/client/assets/{ReferenceLine-DEAQfOjW.js → ReferenceLine-DN9gAkkU.js} +1 -1
- package/dist/client/assets/{SearchMd-BionSqTl.js → SearchMd-DD6kw-fs.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DUpALglE.js → ShoppingBag01-CY137tVP.js} +1 -1
- package/dist/client/assets/{Sun-x19ShBxe.js → Sun-CyYLfv8E.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Dghq_Bvd.js → SwitchHorizontal01-C3qdjyVX.js} +1 -1
- package/dist/client/assets/{Tool01-GdBdG6P_.js → Tool01-CyX9Nllj.js} +1 -1
- package/dist/client/assets/{Tooltip-CDDThlKy.js → Tooltip-DVBICxdG.js} +1 -1
- package/dist/client/assets/{Trash01-DhMVlpac.js → Trash01-DSJ1LUhI.js} +1 -1
- package/dist/client/assets/{Upload01-hsehoAUh.js → Upload01-DC0joCKG.js} +1 -1
- package/dist/client/assets/{UserSquare-T5uOviXx.js → UserSquare-DmeGszKa.js} +1 -1
- package/dist/client/assets/{Users01-DDaeVlhF.js → Users01-B-OacssU.js} +1 -1
- package/dist/client/assets/{XClose-NmocES7U.js → XClose-avSrIpAi.js} +1 -1
- package/dist/client/assets/{Zap-aTbgq59l.js → Zap--C2rij07.js} +1 -1
- package/dist/client/assets/{access-gate-CpAtBb_h.js → access-gate-Bd3vMxaX.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BFqv_pWT.js → add-connection-dialog-uIVnUFji.js} +1 -1
- package/dist/client/assets/agent-app-BkJxaBM5.js +1 -0
- package/dist/client/assets/{agent-assets-kQe7VufN.js → agent-assets-CWN2kTtA.js} +1 -1
- package/dist/client/assets/{agent-automation-7-KjK-1c.js → agent-automation-BgD0bRSV.js} +1 -1
- package/dist/client/assets/{agent-automations-DnNwxwTt.js → agent-automations-DfordlM0.js} +1 -1
- package/dist/client/assets/{agent-calendar-CbAiDaBT.js → agent-calendar-z2j3yA6d.js} +1 -1
- package/dist/client/assets/{agent-capabilities-DKq2l6j_.js → agent-capabilities-4Kae1N0E.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-SuTyB8Qe.js → agent-connect-sources-C33PwxBc.js} +1 -1
- package/dist/client/assets/agent-deck-Lf3f7IO8.js +1 -0
- package/dist/client/assets/{agent-e2e-C9FJgu1a.js → agent-e2e-C44IfVz9.js} +1 -1
- package/dist/client/assets/{agent-file-D5ZobkO7.js → agent-file-D8S6ohDB.js} +1 -1
- package/dist/client/assets/{agent-hosting-Df5G-pNf.js → agent-hosting-D6CnE5uR.js} +1 -1
- package/dist/client/assets/{agent-icon-DD6O0sln.js → agent-icon-Nkid6y9z.js} +1 -1
- package/dist/client/assets/agent-library-Co5WQMIF.js +1 -0
- package/dist/client/assets/agent-library-file-BPJi6RfX.js +1 -0
- package/dist/client/assets/agent-overview-D73rnnSU.js +1 -0
- package/dist/client/assets/{agent-releases-6IDVzk1I.js → agent-releases-WO1DzowK.js} +1 -1
- package/dist/client/assets/agent-settings-DK2xDr1_.js +1 -0
- package/dist/client/assets/{agent-site-editor-YGSo4JHf.js → agent-site-editor-CVSVIfgT.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-21UDx-VP.js +2 -0
- package/dist/client/assets/agent-site-editor-content-ycS9Pz-a.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-CM8uT3ZM.js +1 -0
- package/dist/client/assets/agent-view-CnIONLQC.js +1 -0
- package/dist/client/assets/{agent-view-guard-Ud9RVhUT.js → agent-view-guard-BkTiwrL7.js} +1 -1
- package/dist/client/assets/{ai-providers-CdWvTe6E.js → ai-providers-C77po6hX.js} +1 -1
- package/dist/client/assets/{alert-rSlkmSpl.js → alert-8ZKgnOi9.js} +1 -1
- package/dist/client/assets/{analytics-sections-CdJGMHGj.js → analytics-sections-D2pjEazH.js} +1 -1
- package/dist/client/assets/api-keys-CJdXbN4c.js +1 -0
- package/dist/client/assets/{api-keys-CgV7T2W3.js → api-keys-CalFVYGL.js} +1 -1
- package/dist/client/assets/{app-editor-DQrUb2qq.js → app-editor--cZ0paPb.js} +1 -1
- package/dist/client/assets/{asset-utils-DJaTbmOK.js → asset-utils-CwwYcMA6.js} +1 -1
- package/dist/client/assets/{auth-catchall-BzI646tE.js → auth-catchall--6gbNuLd.js} +1 -1
- package/dist/client/assets/{auth-entry-BA2dv7O1.js → auth-entry-CsdiTapN.js} +1 -1
- package/dist/client/assets/{auth-split-layout-3t1_TKos.js → auth-split-layout-BqtGBv-Q.js} +1 -1
- package/dist/client/assets/{auth-Dfx2bf9S.js → auth-xvjttF9D.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-EuyAX3Gy.js → authenticate-and-persist-oauth-DdntocF2.js} +1 -1
- package/dist/client/assets/{automation-list-row-BK5XD6ZY.js → automation-list-row-DtkMgEsK.js} +1 -1
- package/dist/client/assets/{automation-runs-BekfbsHI.js → automation-runs-DxsRwY7z.js} +1 -1
- package/dist/client/assets/{automations-ocOVuWpR.js → automations-DXGl5rDB.js} +1 -1
- package/dist/client/assets/{autosend-BLYIlkXq.js → autosend-DbfDzqlB.js} +1 -1
- package/dist/client/assets/{badge-9UZ-oy57.js → badge-BLk85LCv.js} +1 -1
- package/dist/client/assets/{block-document-B5Xpou_B.js → block-document-CSsqtozZ.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-CGoI0EUn.js → blocks-preview-workspace-context-C59bKt9w.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-CNkB95lx.js → blocks-tab-states-DP3rjaHt.js} +1 -1
- package/dist/client/assets/{blog-schema-DMB79fe6.js → blog-schema-B65cUy5G.js} +1 -1
- package/dist/client/assets/{buckets-C5e8GKB5.js → buckets-CNCQh0A_.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-aExDV9Mz.js → build-improve-prompt-doc-DUmEW7kR.js} +1 -1
- package/dist/client/assets/{calendar-CKcdkgh5.js → calendar-CDcnOKeY.js} +1 -1
- package/dist/client/assets/{capability-load-error-D8AT7eAw.js → capability-load-error-BZMPli2s.js} +1 -1
- package/dist/client/assets/{category-editor-DDFXYf_d.js → category-editor-BFW4v6Zt.js} +1 -1
- package/dist/client/assets/{chart-Ch4wXn1G.js → chart-W6WUctG8.js} +1 -1
- package/dist/client/assets/{chat-context-tsaqCp6v.js → chat-context-yHOaM07v.js} +1 -1
- package/dist/client/assets/{chat-draft-DeOYn8wH.js → chat-draft-BKLG-IxC.js} +1 -1
- package/dist/client/assets/{checkbox-bO8ZnM7n.js → checkbox-Dv6iFznu.js} +1 -1
- package/dist/client/assets/{choose-editor-B-1DX2pl.js → choose-editor-BbaXuEWm.js} +1 -1
- package/dist/client/assets/{cli-auth-success-WUcj8Laj.js → cli-auth-success-CINmtrn-.js} +1 -1
- package/dist/client/assets/{client-icons-CJKwmsS5.js → client-icons-CRCSqe4B.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-CL1HXF3j.js → cms-settings-editor-BKSzHFaJ.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-C_ZG08jQ.js → cms-store-drafts-BRph2qKQ.js} +1 -1
- package/dist/client/assets/{collapsible-CehJ-xlR.js → collapsible-WPiOb2df.js} +1 -1
- package/dist/client/assets/{collection-detail-w7NYTWNb.js → collection-detail-DeLh0iGu.js} +1 -1
- package/dist/client/assets/{collection-display-button-CVOVdzmi.js → collection-display-button-X03nm1ka.js} +1 -1
- package/dist/client/assets/{collection-search-Lm88VC-w.js → collection-search-CPadQqKp.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-LUTykEyP.js → collection-table-wrapper-DbE8PRZm.js} +1 -1
- package/dist/client/assets/{collection-tabs-BW9NTpao.js → collection-tabs-B05-I-04.js} +1 -1
- package/dist/client/assets/{combobox-C8IS_aP5.js → combobox-AFeNX90_.js} +1 -1
- package/dist/client/assets/{command-B42vqDSm.js → command-CSFENWMV.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-gN7svOR8.js → companion-mcps-section-DByl9EP4.js} +1 -1
- package/dist/client/assets/{config--cZAprAj.js → config-BuNaSsQb.js} +1 -1
- package/dist/client/assets/{connect-BAZtz6qy.js → connect-B5ODvCMk.js} +1 -1
- package/dist/client/assets/{connect-layout-FGHNVpHc.js → connect-layout-CrQKfs54.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-BlacChCY.js → connect-source-dialog-dT9CEaaL.js} +1 -1
- package/dist/client/assets/{connection-Brtus8mh.js → connection-9Wtillpb.js} +1 -1
- package/dist/client/assets/{connection-card-CSkWTxJN.js → connection-card-B7mEOoWU.js} +1 -1
- package/dist/client/assets/{connection-detail-Dz92Js40.js → connection-detail-CVkLDsqd.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CQaJSXmJ.js → connection-form-helpers-ZOfZ5xVa.js} +1 -1
- package/dist/client/assets/{connection-slug-DREkgXeA.js → connection-slug-BCjSI_lE.js} +1 -1
- package/dist/client/assets/{connections-BZUJ_roU.js → connections-B2Pjgwb4.js} +1 -1
- package/dist/client/assets/{content-tab-Bc_Tg1a4.js → content-tab-D6POg5eV.js} +3 -3
- package/dist/client/assets/{context-2NK4t-Lg.js → context-D9Jnu7vN.js} +1 -1
- package/dist/client/assets/{context-menu-D-JkcRvL.js → context-menu-Cgl4PGwR.js} +1 -1
- package/dist/client/assets/{context-shell-Bwve3xDx.js → context-shell-xJwj29nG.js} +3 -3
- package/dist/client/assets/{core.esm-ByTukYOF.js → core.esm-C3kzKmQL.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BIe1f-Sz.js → create-organization-dialog-C6jgiT68.js} +1 -1
- package/dist/client/assets/{device-hint-Djy4F7LR.js → device-hint-B0gKGTHi.js} +1 -1
- package/dist/client/assets/{discover-D050EtE3.js → discover-hzv5-quf.js} +1 -1
- package/dist/client/assets/{domain-settings-DPbJEdjs.js → domain-settings-CUR5XLBa.js} +1 -1
- package/dist/client/assets/{drawer-Dijofbhl.js → drawer-1kqkgpFK.js} +1 -1
- package/dist/client/assets/{editor-BODVgWYK.js → editor-CrG4V3zO.js} +1 -1
- package/dist/client/assets/{editor-classes-BdpfcKyR.js → editor-classes-LBX4QjrW.js} +1 -1
- package/dist/client/assets/{empty-state-CwfRxt_B.js → empty-state-CVOGmYU9.js} +1 -1
- package/dist/client/assets/{empty-state-Drt9QRbX.js → empty-state-CbRq3C3n.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Pe-Tip3g.js → extract-connection-data-C6MDLhDM.js} +1 -1
- package/dist/client/assets/{feature-gate-2Z3FyCIy.js → feature-gate-Uh4gtHbP.js} +1 -1
- package/dist/client/assets/{feature-paywall-CpM-erQe.js → feature-paywall-BVXAF3Vl.js} +1 -1
- package/dist/client/assets/{feedback-DcWPFhR_.js → feedback-Bx6uae5t.js} +1 -1
- package/dist/client/assets/{file-explorer-xWdf34ip.js → file-explorer-B33pnQXI.js} +1 -1
- package/dist/client/assets/{file-preview-Ca_4k6rv.js → file-preview-DifPTXD4.js} +1 -1
- package/dist/client/assets/{file-share-button-DgOCZ5mM.js → file-share-button-OD6j_Xmo.js} +1 -1
- package/dist/client/assets/{file-type-icon-DiS0iV28.js → file-type-icon-jLU7FJUL.js} +1 -1
- package/dist/client/assets/{folder-icon-swAD3bQU.js → folder-icon-Bk-fEOJa.js} +1 -1
- package/dist/client/assets/{form-CRja9i9j.js → form-DE5X7SPR.js} +1 -1
- package/dist/client/assets/{general-C7SfdAAF.js → general-DxPCrqDE.js} +1 -1
- package/dist/client/assets/{github-icon-tpEVyIwD.js → github-icon-Bvc_Uep-.js} +1 -1
- package/dist/client/assets/{home-overview-CMI03yPH.js → home-overview-3LLMJPVW.js} +1 -1
- package/dist/client/assets/{home-DsrjQvGT.js → home-z2EXALAZ.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-BnVn2LVL.js → hosted-reconcile-gHkwH1BF.js} +1 -1
- package/dist/client/assets/{icon-button-BZ9f2Pt9.js → icon-button-1xC_JQLB.js} +1 -1
- package/dist/client/assets/{index-Dt7ZIwRY.js → index-BHtZ5LOo.js} +1 -1
- package/dist/client/assets/{index-BW7-bbk0.js → index-BJKjGJrF.js} +1 -1
- package/dist/client/assets/{index-D-DRzVEB.js → index-BtlZo3IV.js} +1 -1
- package/dist/client/assets/{index-C2wTYLQr.js → index-C1iaIX-s.js} +1 -1
- package/dist/client/assets/{index-B8Pa92mK.js → index-Chg--78J.js} +1 -1
- package/dist/client/assets/{index-DQAtcq3Z.js → index-Czm9RrRY.js} +1 -1
- package/dist/client/assets/{index-68Cr2r1N.js → index-DOaDUx72.js} +1 -1
- package/dist/client/assets/{index-Cvc22Qvh.js → index-DWvRfTwV.js} +3 -3
- package/dist/client/assets/{index-BGom2FnM.js → index-DyoVCnKR.js} +1 -1
- package/dist/client/assets/{index-LnWr599j.js → index-J6dVRDZu.js} +1 -1
- package/dist/client/assets/{index-D0G5dFqT.js → index-KGPpyCdi.js} +1 -1
- package/dist/client/assets/{index-Dw1u8oXT.js → index-L3rSytXD.js} +1 -1
- package/dist/client/assets/{index-CbuCRTrW.js → index-Wodin-tK.js} +1 -1
- package/dist/client/assets/{index-Z8XjhDCo.js → index-eKAZ8rFQ.js} +1 -1
- package/dist/client/assets/{index-CcZq_9Fb.js → index-pqEXXiDC.js} +1 -1
- package/dist/client/assets/{index-redirect-PbFd_QHU.js → index-redirect-D52J_8O4.js} +1 -1
- package/dist/client/assets/{index-CZXPJi4-.js → index-xAQMjVHe.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CmujZk55.js → infiniteQueryObserver-O1nZgTsK.js} +1 -1
- package/dist/client/assets/{infra-billing-BlZrBUYP.js → infra-billing-CsrcHH3z.js} +1 -1
- package/dist/client/assets/{input-C7_FCkgY.js → input-Lv9puCyJ.js} +3 -3
- package/dist/client/assets/{input-D6ZRMHIB.js → input-Z4x7UYYS.js} +1 -1
- package/dist/client/assets/{integration-icon-DMt85Vdd.js → integration-icon-BCp7DD7C.js} +1 -1
- package/dist/client/assets/{jira-icon-C0C7R9Uf.js → jira-icon-Cgp_nHIG.js} +1 -1
- package/dist/client/assets/{label-RB5C5N6z.js → label-BkzEUDUr.js} +1 -1
- package/dist/client/assets/{layout-CBfnb3CZ.js → layout-pqxzJsxG.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-zWqSTSjP.js → legacy-agents-deep-C88GLYmw.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BZlpoESe.js → legacy-main-redirect-DcmC8SjE.js} +1 -1
- package/dist/client/assets/library-D4o0AtWq.js +1 -0
- package/dist/client/assets/{library-tab-C7gKe5iN.js → library-tab-DI44ELWs.js} +1 -1
- package/dist/client/assets/{login-D9zRzHBo.js → login-DQICOGIE.js} +1 -1
- package/dist/client/assets/{markdown-HhU9_nSI.js → markdown-DkmjrNqn.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DeLjk14w.js → mcp-app-renderer-CIky1nBi.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C-i6IZ7F.js → mcp-oauth-CNMWqwMp.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DLwsgkOm.js → mcp-oauth-SAUpfbwO.js} +1 -1
- package/dist/client/assets/{members-DocomT72.js → members-BT1BIG15.js} +1 -1
- package/dist/client/assets/{memory-BP3-K3oo.js → memory-BDRH6Og0.js} +1 -1
- package/dist/client/assets/{mock-board-CoWf0eSd.js → mock-board-BF-mAr4y.js} +3 -3
- package/dist/client/assets/{monaco-editor-oUmtqDLR.js → monaco-editor-Dff4ZjU3.js} +1 -1
- package/dist/client/assets/{monitoring-DKfNSCeR.js → monitoring-BPV_CuUX.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-XSvwSWAi.js → monitoring-stats-row-ZCTbL6bH.js} +1 -1
- package/dist/client/assets/{multi-select-CISJC82c.js → multi-select-B4WkKxx8.js} +1 -1
- package/dist/client/assets/{mustache-D4zVU9iA.js → mustache-DCgM4RQC.js} +1 -1
- package/dist/client/assets/{named-rule-view-BTwHmZ5L.js → named-rule-view-D8WSLrw8.js} +1 -1
- package/dist/client/assets/{new-project-dialog-BA0jmhgS.js → new-project-dialog-Kvs8XyHN.js} +1 -1
- package/dist/client/assets/{oauth-callback-C1NevZMJ.js → oauth-callback-CIFexUJN.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BJwoy8qA.js → oauth-callback-ai-provider-3-_RChJi.js} +1 -1
- package/dist/client/assets/{oauth-consent-BTT41r6l.js → oauth-consent-vlJReqsl.js} +1 -1
- package/dist/client/assets/{onboarding-C2uIwwWY.js → onboarding-CC0xFJ-5.js} +1 -1
- package/dist/client/assets/{openai-conversation-pUSF1vof.js → openai-conversation-D9tyQTXT.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-BnUNFsLR.js → optimistic-project-sidebar-views-BmsZ-Me-.js} +1 -1
- package/dist/client/assets/{order-monitor-day-BzMajB7Y.js → order-monitor-day-Cxsz6w2q.js} +1 -1
- package/dist/client/assets/{organization-choice-5ra3ZqkQ.js → organization-choice-4fOAxXZj.js} +1 -1
- package/dist/client/assets/{orgs-ZeqGcjOU.js → orgs-nKU8niHO.js} +1 -1
- package/dist/client/assets/{own-accounts-section-Dd8ELrvu.js → own-accounts-section-B2chKMQ0.js} +1 -1
- package/dist/client/assets/{pair-Bx1LbJmC.js → pair-BwCxrq_f.js} +1 -1
- package/dist/client/assets/{parse-sections-BTDQNPKy.js → parse-sections-CK6AHU3E.js} +3 -3
- package/dist/client/assets/{plan-bz8_rmrJ.js → plan-C4kJq3a0.js} +1 -1
- package/dist/client/assets/{plan-ladder-CZUMQESY.js → plan-ladder-wSfhs4No.js} +1 -1
- package/dist/client/assets/{plan-usage-card-SygAb3OS.js → plan-usage-card-CBlBUX6I.js} +1 -1
- package/dist/client/assets/{popover-D5YX99Kp.js → popover-CpDRMXBS.js} +1 -1
- package/dist/client/assets/{post-calendar-BIBU13NF.js → post-calendar-C4WCdLXl.js} +1 -1
- package/dist/client/assets/{post-editor-BAf1z147.js → post-editor-BHEvn_Zz.js} +1 -1
- package/dist/client/assets/{preview-content-TDEad-bh.js → preview-content-C4WlFzcj.js} +1 -1
- package/dist/client/assets/{preview-dialog-BkHpQdXG.js → preview-dialog-CSGQDL5A.js} +1 -1
- package/dist/client/assets/{preview-panel-DduOnxXk.js → preview-panel-BMN_Ysm9.js} +1 -1
- package/dist/client/assets/{preview-tab-Cgfndmyh.js → preview-tab-sRIuk4Ej.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-DDkB9ByB.js → product-picker-dialog-DzFQlf9n.js} +1 -1
- package/dist/client/assets/{profile-DHJVxDvo.js → profile-DGzRd8vX.js} +1 -1
- package/dist/client/assets/{project-app-view-BfcPf6du.js → project-app-view-ByacUDvM.js} +1 -1
- package/dist/client/assets/{project-apps-Bny6_T2A.js → project-apps-DzbYoXyd.js} +1 -1
- package/dist/client/assets/{project-icon-eZOGIGwj.js → project-icon-DTA6ZXhl.js} +1 -1
- package/dist/client/assets/{project-index-BSMjLbxc.js → project-index-BmalKoU9.js} +1 -1
- package/dist/client/assets/project-reports-DPgVezio.js +1 -0
- package/dist/client/assets/{project-sidebar-views-CrRbPbLq.js → project-sidebar-views-BxNR4pgO.js} +1 -1
- package/dist/client/assets/project-tasks-C8oeh0BH.js +1 -0
- package/dist/client/assets/{projects-D7HB1QKY.js → projects-BIj_kuAC.js} +1 -1
- package/dist/client/assets/{projects-empty-state-DBWek16Y.js → projects-empty-state-DVir8yX9.js} +1 -1
- package/dist/client/assets/{prompts-MMmII7eb.js → prompts-BmgauEg8.js} +1 -1
- package/dist/client/assets/record-editor-BZSwvkut.js +1 -0
- package/dist/client/assets/{redirect-editor-cm3-huyu.js → redirect-editor-BxlqORGw.js} +1 -1
- package/dist/client/assets/{reports-D0VzI1C_.js → reports-7rmI992n.js} +1 -1
- package/dist/client/assets/reports-Be7TvXFw.js +1 -0
- package/dist/client/assets/{reports-onboarding-DonafHiF.js → reports-onboarding-DPzdd7qa.js} +1 -1
- package/dist/client/assets/{reports-tab-Wl9IyKm6.js → reports-tab-C_NZHfzv.js} +2 -2
- package/dist/client/assets/{repositories-9kTJbSW8.js → repositories-D3yxw4y-.js} +1 -1
- package/dist/client/assets/repositories-DFHveJlo.js +1 -0
- package/dist/client/assets/{repository-binding-B7A7NBUB.js → repository-binding-CeErFm4l.js} +1 -1
- package/dist/client/assets/{repository-picker-CI7xSsin.js → repository-picker-C3C3_E5g.js} +1 -1
- package/dist/client/assets/{require-capability-BTBUQsVM.js → require-capability-BOrIzed0.js} +1 -1
- package/dist/client/assets/{required-auth-layout-ClYF4eFR.js → required-auth-layout-nGThcCwM.js} +1 -1
- package/dist/client/assets/{reset-password-Ah3K7D-l.js → reset-password-xu4Q0lXY.js} +1 -1
- package/dist/client/assets/{resizable-DzzgKGKP.js → resizable-gNSqe3KZ.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-DMbVCUvi.js → resolve-tab-icon-D4I4sh6v.js} +1 -1
- package/dist/client/assets/{review-settings-Fxdols3J.js → review-settings-CjrtYBLa.js} +1 -1
- package/dist/client/assets/{role-color-CEkb11P4.js → role-color-DQHx1mqZ.js} +1 -1
- package/dist/client/assets/{roles-CqJ0hOtT.js → roles-C_hPZ63M.js} +1 -1
- package/dist/client/assets/route-04y-cUhL.js +1 -0
- package/dist/client/assets/{route-BA7jjOjA.js → route-CijJVC7q.js} +1 -1
- package/dist/client/assets/{route-DGCMYgfH.js → route-D7Ke7Nww.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-WaQV2LhH.js → sandbox-lifecycle-context-CuiD9fGV.js} +1 -1
- package/dist/client/assets/{schema-DHahXPsT.js → schema-DiUKA_SL.js} +1 -1
- package/dist/client/assets/{schema-BH82js-o.js → schema-DvxWNZKz.js} +1 -1
- package/dist/client/assets/{scroll-area-BN87AboJ.js → scroll-area-CUevVS4T.js} +1 -1
- package/dist/client/assets/{search-input-BBYghT-z.js → search-input-DWWqDlal.js} +1 -1
- package/dist/client/assets/{search-toggle-pLnMgrhP.js → search-toggle-Z6tLdJtz.js} +1 -1
- package/dist/client/assets/{secret-picker-DWWFQJzg.js → secret-picker-BK4dq3ip.js} +1 -1
- package/dist/client/assets/{secrets-CM4b3_qA.js → secrets-DrGLagdz.js} +1 -1
- package/dist/client/assets/{sections-CgO1w_IT.js → sections-CC9QneUq.js} +1 -1
- package/dist/client/assets/{sections-editor-Uk83RbMN.js → sections-editor-CEHFL2VN.js} +1 -1
- package/dist/client/assets/{select-GzsOSPza.js → select-gJgQvQZg.js} +1 -1
- package/dist/client/assets/{select-model-BU2ssn1V.js → select-model-ivosxEc9.js} +1 -1
- package/dist/client/assets/{seo-editor-dMXY0ofk.js → seo-editor-CaLY6KkG.js} +1 -1
- package/dist/client/assets/{separator-CuwdHpjW.js → separator-PY5RFBB-.js} +1 -1
- package/dist/client/assets/settings-tab-DeCOk8kh.js +1 -0
- package/dist/client/assets/{sheet-BIQm-3An.js → sheet-BKUVqko3.js} +1 -1
- package/dist/client/assets/{shell-layout-CH0j9rog.js → shell-layout-Bx4AZ_YV.js} +1 -1
- package/dist/client/assets/{site-draft-view-C74WkBDm.js → site-draft-view-B8TmuovZ.js} +1 -1
- package/dist/client/assets/site-editor-BeO4XfO2.js +1 -0
- package/dist/client/assets/{site-editor-toast-DrW9VMK5.js → site-editor-toast-B-FxlfJP.js} +1 -1
- package/dist/client/assets/{skills-C71x-yhC.js → skills-CZlPyCDI.js} +1 -1
- package/dist/client/assets/{slider-BTgIuWj6.js → slider-CnnTZZH8.js} +1 -1
- package/dist/client/assets/{sortable.esm-Dd1EVaQb.js → sortable.esm-YReNzob1.js} +1 -1
- package/dist/client/assets/{sso-BfwIPTh8.js → sso-B0Izx2rk.js} +1 -1
- package/dist/client/assets/{suggestion-CsEyXKDY.js → suggestion-D-YZpsQl.js} +1 -1
- package/dist/client/assets/{switch-BRZA_xq0.js → switch-UpbwlQtZ.js} +1 -1
- package/dist/client/assets/{synced-repos-Do7bESqI.js → synced-repos-DJZhlM-5.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-BsVyyg_A.js → tab-icon-glyph-BA8eumIA.js} +1 -1
- package/dist/client/assets/{table-DJd8n4EY.js → table-D9nZzqmf.js} +1 -1
- package/dist/client/assets/{tabs-D5AMuciq.js → tabs-BFXzZPNk.js} +1 -1
- package/dist/client/assets/{task-board-DN88kD7h.js → task-board-CzrPT-OZ.js} +1 -1
- package/dist/client/assets/{task-route-4C0M-4XY.js → task-route-DrqrKj8M.js} +1 -1
- package/dist/client/assets/{task-status-B2JNuBbQ.js → task-status-B5fYlW4s.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-D_AXxVNg.js → taskboard-analytics-Bo8Bxm9q.js} +1 -1
- package/dist/client/assets/{tasks-dMEgvkta.js → tasks-BFPPo49C.js} +1 -1
- package/dist/client/assets/tasks-CI7wGKXW.js +1 -0
- package/dist/client/assets/{textarea-D7HQlMVo.js → textarea-BVq0fBVJ.js} +1 -1
- package/dist/client/assets/{thread-analytics-BQjHh_yV.js → thread-analytics-j4C-4XbM.js} +1 -1
- package/dist/client/assets/{thread-intent-Bs-Q7fma.js → thread-intent-BONVdhUb.js} +1 -1
- package/dist/client/assets/{thread-route-C-uX4C4C.js → thread-route-CDlnAMQ3.js} +1 -1
- package/dist/client/assets/{thread-route-B44higRI.js → thread-route-DMWye38f.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BNo76_XD.js → thread-sheet-body-C1Yi4Tsp.js} +1 -1
- package/dist/client/assets/{time-range-picker-D4sglVBw.js → time-range-picker-DuQ-XfqJ.js} +1 -1
- package/dist/client/assets/{toggle-group-BBgjmF6C.js → toggle-group-Bw4R79dp.js} +1 -1
- package/dist/client/assets/{tool-namespace-l4eN7YZ5.js → tool-namespace-CmEhPnkj.js} +1 -1
- package/dist/client/assets/{tool-set-selector-Bi-Sw2KD.js → tool-set-selector-DAvZ69Ky.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-nrUHQe-I.js → toolbar-icon-button-CRZySHtx.js} +1 -1
- package/dist/client/assets/{tooltip-C0GWPsi8.js → tooltip-BVv5wAeF.js} +1 -1
- package/dist/client/assets/{tooltipContext-DdEokZtY.js → tooltipContext-DwFHeBjZ.js} +1 -1
- package/dist/client/assets/{track-29FVOdFL.js → track-CHjUqURA.js} +1 -1
- package/dist/client/assets/{types-DKuFfsqr.js → types-7R44AYrk.js} +1 -1
- package/dist/client/assets/{url-slug-5t39ocbn.js → url-slug-CoT8zovb.js} +1 -1
- package/dist/client/assets/{usage-stats-CHeI7dPd.js → usage-stats-qZh3WQDj.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BbVlPdZd.js → use-ai-providers-CCcuLCZt.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-CnOcORn0.js → use-apply-named-rule-BRjLBznN.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-DQs0YHUB.js +1 -0
- package/dist/client/assets/{use-automations-BoyfX_H0.js → use-automations-jhigzQzP.js} +1 -1
- package/dist/client/assets/{use-autosave-CZD-Fkyk.js → use-autosave--xoi8yhU.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-BC5WrKKn.js → use-chat-layout-state-Dnl_7DMo.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-BbDVRUuf.js → use-cms-publish-actions-CgLBJwXN.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DEAJWvqA.js → use-connect-companion-BVtzi_36.js} +1 -1
- package/dist/client/assets/{use-connection-Dqyf1wn8.js → use-connection-BQpfU6u4.js} +1 -1
- package/dist/client/assets/{use-content-sync-vr73v2b2.js → use-content-sync-DjDHeqFk.js} +1 -1
- package/dist/client/assets/{use-copy-BGfQrJIh.js → use-copy-CMfnyhoo.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-C4jbLuwI.js → use-date-fns-locale-CRoKnCN9.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BrjHHNNB.js → use-debounced-autosave-D1fE_-TK.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BF84eZeF.js → use-debounced-value-DiJ2aJN8.js} +1 -1
- package/dist/client/assets/{use-deco-credits-MCc3vHir.js → use-deco-credits-D1bpdE32.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-uSeDcfUe.js → use-decopilot-events-CZSx1Itd.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CLe-XFxn.js → use-delete-connection-BFOvb9ed.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-ShnoFTNr.js → use-deployment-admin-DQ5wNSYp.js} +1 -1
- package/dist/client/assets/{use-entitlements-wE65MYfi.js → use-entitlements-BChYmsyZ.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-BmUgrEyk.js → use-fast-preview-draft-url-CO3Nwa6o.js} +1 -1
- package/dist/client/assets/{use-file-configs-D9BR1kJU.js → use-file-configs-DRzFKzj4.js} +1 -1
- package/dist/client/assets/{use-id-selection-BcfcmGZl.js → use-id-selection-DexUoI58.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-EYADn16y.js → use-inbox-feed-BvqULLI3.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Ds1Wd1cw.js → use-infinite-scroll-C7IQ9e5j.js} +1 -1
- package/dist/client/assets/{use-join-requests-CkWiAH0i.js → use-join-requests-Dr_qAJ4N.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-DTMcBtUc.js → use-main-panel-tabs-DZKpYMQg.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DhFx8XVQ.js → use-mcp-auth-status-D0-JLgq9.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BfCmeMHR.js → use-mcp-client-Z8a6jg-w.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DoojBZhS.js → use-mcp-prompts-KWx0e75o.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DwTtnjNb.js → use-mcp-tools-C4Fqpw4S.js} +1 -1
- package/dist/client/assets/{use-mobile-C1stVK0E.js → use-mobile-B7UqukPG.js} +1 -1
- package/dist/client/assets/{use-move-blocks-Bclcq-Qe.js → use-move-blocks-DqXCo5PB.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-D2d0cpFU.js → use-navigate-to-agent-9BOtBFjV.js} +1 -1
- package/dist/client/assets/{use-org-fs-DHnEDbF9.js → use-org-fs-DU8c86TB.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CcoLGdUP.js → use-org-repo-syncs-DGuZeud_.js} +1 -1
- package/dist/client/assets/{use-org-sso-d82WgyRM.js → use-org-sso-nKgxHjqa.js} +1 -1
- package/dist/client/assets/{use-organization-settings-a6mUKPHv.js → use-organization-settings-DqaBVcmT.js} +1 -1
- package/dist/client/assets/{use-project-scope-C0EKXyqg.js → use-project-scope-B4B7p1mj.js} +1 -1
- package/dist/client/assets/{use-recent-apps-DEMyNf2W.js → use-recent-apps-CQ2MLxK5.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-rjeHGSYu.js → use-reports-diagnostic-MABLwKiU.js} +1 -1
- package/dist/client/assets/{use-secrets-CifnNbah.js → use-secrets-DP80TxaK.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-SkN8HQaB.js → use-section-preview-base-C7kw5vsr.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-DwcGl0-e.js → use-sidebar-collapsed-Dz5RfxtZ.js} +1 -1
- package/dist/client/assets/{use-tags-CgXVAtG9.js → use-tags-BMj-zonr.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BTZNDNnK.js → use-task-board-analytics-Bxag-9wC.js} +1 -1
- package/dist/client/assets/{use-task-board-events-DCguN7A5.js → use-task-board-events-B8bEY6A0.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-CnqmEndd.js → use-task-board-item-prs-JXA8OC5C.js} +1 -1
- package/dist/client/assets/{use-task-board-items-BmpaMZkF.js → use-task-board-items-DFDnaPnO.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-DdSO4gLi.js → use-task-board-prompts-CeCaGQl-.js} +1 -1
- package/dist/client/assets/{use-task-metadata-D3xqf4sH.js → use-task-metadata-D6_-qyJw.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-D6sQTVJo.js → use-thread-outputs-DIlmUcwz.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DAm-dYuC.js +1 -0
- package/dist/client/assets/{useQueries-BuMODvFG.js → useQueries-DlmzJSx8.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BTqieOpO.js +1 -0
- package/dist/client/assets/{users-Ct3PwBMT.js → users-BIMbDMRH.js} +1 -1
- package/dist/client/assets/{utils-DA49HMaO.js → utils-B-ZZ1C4f.js} +1 -1
- package/dist/client/assets/{variant-calendar-CPtUMCAS.js → variant-calendar-CPbvwCiJ.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-DnlLYEoa.js → variant-matcher-override-BDeSqmx4.js} +1 -1
- package/dist/client/assets/{view-header-CAO18iqy.js → view-header-BTUnAkrc.js} +1 -1
- package/dist/client/assets/{virtual-mcp-C4mAz3N8.js → virtual-mcp-D-xL-K_P.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-BI4P-Lkx.js → watch-sse-pool-B6ObjuCT.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +464 -464
- package/package.json +1 -1
- package/dist/client/assets/agent-app-ZW_Vm-c7.js +0 -1
- package/dist/client/assets/agent-deck-8VVMhl7J.js +0 -1
- package/dist/client/assets/agent-library-C_HTRhOS.js +0 -1
- package/dist/client/assets/agent-library-file-8gKy0Im-.js +0 -1
- package/dist/client/assets/agent-overview-CSsPaJjm.js +0 -1
- package/dist/client/assets/agent-settings-uWS3yWiw.js +0 -1
- package/dist/client/assets/agent-site-editor-code-wtgSW_Bw.js +0 -2
- package/dist/client/assets/agent-site-editor-content-BC5jgNMj.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-Dd0H-yKP.js +0 -1
- package/dist/client/assets/agent-view-C4jCWfsN.js +0 -1
- package/dist/client/assets/api-keys-CmWPTVBS.js +0 -1
- package/dist/client/assets/library-pMQg4GCR.js +0 -1
- package/dist/client/assets/project-reports-BzA8d8hO.js +0 -1
- package/dist/client/assets/project-tasks-BCE2SgoF.js +0 -1
- package/dist/client/assets/record-editor-DVouiUmR.js +0 -1
- package/dist/client/assets/reports-BHAVwnBG.js +0 -1
- package/dist/client/assets/repositories-bPxFm30V.js +0 -1
- package/dist/client/assets/route-DJbiUXJl.js +0 -1
- package/dist/client/assets/settings-tab-FvtSSyQC.js +0 -1
- package/dist/client/assets/site-editor-CazX9Ijc.js +0 -1
- package/dist/client/assets/tasks-BlrmxtrG.js +0 -1
- package/dist/client/assets/use-ask-in-chat-Cp_wqFIx.js +0 -1
- package/dist/client/assets/useInfiniteQuery-P9--kf7E.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-C2ZhOGvp.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c as T,b as me,r as H,j as a,B as ve,m as K,K as ns,al as Ca,t as et,fd as Aa,as as dr,ed as ur,Y as Zt,c6 as Ra,aH as ks,aI as Ns,aJ as Cs,aK as As,bj as Rs,aL as Ds,aM as Ts,aN as Bs,X as Os,Z as Ms,_ as _s,a as zs,a5 as rs,ct as Da,h as es,ff as hr,fg as un,bJ as Ta,b8 as Ba,bh as _n,fh as Ia,c0 as Fa,am as $a,I as La,a8 as Ea,fi as Oa,V as fr,i as ft,eR as hn,q as mr,J as pr,D as br,x as gr,v as xr,Q as vr,R as yr,fj as Ma,bk as jr,a6 as fn,b3 as mn,e as zn,E as _a,T as za,n as Xs,bi as Ua}from"./index-Cvc22Qvh.js";import{S as Ha}from"./separator-CuwdHpjW.js";import{f as qa,u as It,r as wr,l as Pr,c as Sr,b as Ka}from"./chat-context-tsaqCp6v.js";import{u as kt,aq as Va,ar as kr,as as Nr,c as pn,b as bn,L as gn,at as Ga,K as Wa,au as Qa,ae as Ja,av as Xa,S as xn,R as Cr,aw as Ya,a0 as Ar,F as Za,ax as el,ay as tl,B as Rr,l as sl,E as nl}from"./site-editor-toast-DrW9VMK5.js";import{b as rl,L as al,a as ll}from"./shell-layout-CH0j9rog.js";import{I as Dr}from"./toolbar-icon-button-nrUHQe-I.js";import{b as il,P as ol,a as cl}from"./popover-D5YX99Kp.js";import{c as tt,T as st,a as nt,b as Us}from"./tooltip-C0GWPsi8.js";import{f as dl,a as ul,c as hl,C as Un,e as Hn,b as qn}from"./command-B42vqDSm.js";import{T as Tt,a as Tr,c as Br}from"./tabs-D5AMuciq.js";import{t as Ir}from"./ChevronUp-B0uKxpVg.js";import{X as Fr,aL as Hs,D as fl,a as $r,aM as ml,b as pl,aN as Lr,K as bl}from"./agent-icon-DD6O0sln.js";import{a as Er}from"./SwitchHorizontal01-Dghq_Bvd.js";import{c as Or,s as Is}from"./Tool01-GdBdG6P_.js";import{s as Mr}from"./Plus-Caq968Zm.js";import{s as qs}from"./Trash01-DhMVlpac.js";import{m as gl,d as xl}from"./thread-intent-Bs-Q7fma.js";import{h as _r,r as zr,g as vl,e as Oe,u as Ks,f as Ur}from"./repository-binding-B7A7NBUB.js";import{u as yl}from"./use-debounced-value-BF84eZeF.js";import{u as jl}from"./useInfiniteQuery-P9--kf7E.js";import{d as wl,b as Pl,p as Sl,e as Hr,g as qr,h as Kr}from"./use-navigate-to-agent-D2d0cpFU.js";import{u as Vs,g as vn,n as us,b as Vr,a as kl,d as Nl,e as Cl,r as ds,f as Al,s as Rl,h as xs,c as yn}from"./cms-store-drafts-C_ZG08jQ.js";import{a as Fs}from"./virtual-mcp-C4mAz3N8.js";import{a as fs}from"./input-C7_FCkgY.js";import{u as jn,c as Dl}from"./agent-capabilities-DKq2l6j_.js";import{G as Gr}from"./github-icon-tpEVyIwD.js";import{u as Tl,a as Bl}from"./use-fast-preview-draft-url-BmUgrEyk.js";import{av as Xt,aw as Wr,E as $s,q as wn,ax as Il,ay as Fl,H as $l,az as Ll,aA as El,aB as Ol,p as Ml,z as Pt,f as Pn,aC as _l,$ as zl,i as Ul,u as Hl,k as ql,S as Kl}from"./blocks-tab-states-CNkB95lx.js";import{u as Vl}from"./index-D-DRzVEB.js";import{T as Gl}from"./textarea-D7HQlMVo.js";import{i as Sn}from"./CheckCircle-Dycaqr3_.js";import{n as Wl,s as Ql,C as Jl,a as Xl,b as Yl,M as Zl,c as ei,d as ti,m as si,u as ni}from"./use-cms-publish-actions-BbDVRUuf.js";import{a as ri,g as ai}from"./UserSquare-T5uOviXx.js";import{i as kn,b as Nn,m as li,h as ii,c as Qr,f as Jr,d as oi,r as Cn,e as ci,n as di,g as ui,j as hi,k as fi,l as An,o as mi,p as Xr,q as pi,s as Rn,t as Ys}from"./sandbox-git-api-DcqI6XE4.js";import{b as bi,g as gi}from"./utils-DA49HMaO.js";import{i as xi}from"./Monitor01-PjSuNm4O.js";import{w as Dn,R as Yr}from"./device-hint-Djy4F7LR.js";import{w as Kn}from"./editor-BODVgWYK.js";import{s as Zr}from"./save-changes-debug-nBi-n9eV.js";import{u as vi}from"./use-mcp-client-BfCmeMHR.js";import{b as yi,a as ji}from"./sandbox-lifecycle-context-WaQV2LhH.js";import{b as wi}from"./thread-route-B44higRI.js";import{E as Pi}from"./empty-state-CwfRxt_B.js";import{a as Si}from"./autosend-BLYIlkXq.js";function ki(t){const{value:e,baseBranch:s,releases:r,baseIsDraft:n=!1,storeDrafts:i=[]}=t,d=!n&&!!e&&e===s,l=r.find(c=>c.branch===e),o=d||l?void 0:i.find(c=>c.name===e),u=!d&&!l&&!o&&!!e;return o?{isBase:d,current:l,storeDraft:o,unlisted:u}:{isBase:d,current:l,unlisted:u}}const Ni={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "},Vn=1114111;function Gn(t){return t?t.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(e,s)=>{if(s.startsWith("#x")||s.startsWith("#X")){const r=Number.parseInt(s.slice(2),16);return!Number.isFinite(r)||r>Vn?e:String.fromCodePoint(r)}if(s.startsWith("#")){const r=Number.parseInt(s.slice(1),10);return!Number.isFinite(r)||r>Vn?e:String.fromCodePoint(r)}return Ni[s]??e}):""}function Ci(t){const e=T.c(39),{url:s,onSave:r}=t,n=me(),[i,d]=H.useState(s??"");let l;e[0]!==i?(l=i.trim(),e[0]=i,e[1]=l):l=e[1];const o=l;let u;e[2]!==r||e[3]!==o?(u=()=>r(o?gl(o):null),e[2]=r,e[3]=o,e[4]=u):u=e[4];const c=u;let h;e[5]!==n?(h=n("thread.branchPicker.localHint"),e[5]=n,e[6]=h):h=e[6];let b;e[7]!==h?(b=a.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[7]=h,e[8]=b):b=e[8];let p;e[9]!==n?(p=n("thread.branchPicker.localUrlLabel"),e[9]=n,e[10]=p):p=e[10];let f;e[11]!==n?(f=n("thread.branchPicker.localUrlPlaceholder"),e[11]=n,e[12]=f):f=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=N=>d(N.target.value),e[13]=m):m=e[13];let x;e[14]!==c||e[15]!==o?(x=N=>{N.key==="Enter"&&o&&c()},e[14]=c,e[15]=o,e[16]=x):x=e[16];let g;e[17]!==p||e[18]!==f||e[19]!==x||e[20]!==i?(g=a.jsx("input",{type:"url",inputMode:"url","aria-label":p,placeholder:f,value:i,onChange:m,onKeyDown:x,className:"h-8 w-full rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[17]=p,e[18]=f,e[19]=x,e[20]=i,e[21]=g):g=e[21];let w;e[22]!==r||e[23]!==n||e[24]!==s?(w=s?a.jsx(ve,{variant:"ghost",size:"sm",className:"text-xs text-destructive hover:text-destructive",onClick:()=>r(null),children:n("thread.branchPicker.localTurnOff")}):a.jsx("span",{}),e[22]=r,e[23]=n,e[24]=s,e[25]=w):w=e[25];const j=!o;let v;e[26]!==n?(v=n("thread.branchPicker.save"),e[26]=n,e[27]=v):v=e[27];let P;e[28]!==c||e[29]!==j||e[30]!==v?(P=a.jsx(ve,{size:"sm",disabled:j,onClick:c,children:v}),e[28]=c,e[29]=j,e[30]=v,e[31]=P):P=e[31];let S;e[32]!==w||e[33]!==P?(S=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[w,P]}),e[32]=w,e[33]=P,e[34]=S):S=e[34];let k;return e[35]!==S||e[36]!==b||e[37]!==g?(k=a.jsxs("div",{className:"flex flex-col gap-2 p-2",children:[b,g,S]}),e[35]=S,e[36]=b,e[37]=g,e[38]=k):k=e[38],k}function Ai(t){const e=T.c(8),{virtualMcpId:s,branch:r,serve:n,rowRef:i,onPicked:d}=t,l=kt(s,r),o=!!n.connection,u=o&&l.kind==="protocol"&&l.source==="local";let c;e[0]!==d||e[1]!==n?(c=()=>Ri(n,d),e[0]=d,e[1]=n,e[2]=c):c=e[2];let h;return e[3]!==i||e[4]!==o||e[5]!==u||e[6]!==c?(h=a.jsx(Di,{rowRef:i,selected:o,connected:u,onSelect:c}),e[3]=i,e[4]=o,e[5]=u,e[6]=c,e[7]=h):h=e[7],h}function Ri(t,e){e?.(),!t.connection&&t.set({endpoint:t.lastEndpoint??Va})}function Di(t){const e=T.c(19),{rowRef:s,selected:r,connected:n,onSelect:i}=t,d=me(),l=r?"bg-accent":"hover:bg-accent";let o;e[0]!==l?(o=K("flex rounded-lg",l),e[0]=l,e[1]=o):o=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx("span",{"data-testid":"localhost-dot",className:"h-2 w-2 shrink-0 rounded-full bg-foreground"}),e[2]=u):u=e[2];let c;e[3]!==d?(c=d("thread.branchPicker.localhost.label"),e[3]=d,e[4]=c):c=e[4];let h;e[5]!==c?(h=a.jsx("span",{className:"min-w-0 flex-1 truncate",children:c}),e[5]=c,e[6]=h):h=e[6];let b;e[7]!==n||e[8]!==d?(b=n&&a.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:d("thread.branchPicker.localhost.connected")}),e[7]=n,e[8]=d,e[9]=b):b=e[9];let p;e[10]!==i||e[11]!==r||e[12]!==h||e[13]!==b?(p=a.jsxs("button",{type:"button","aria-pressed":r,onClick:i,className:"flex w-full min-w-0 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[u,h,b]}),e[10]=i,e[11]=r,e[12]=h,e[13]=b,e[14]=p):p=e[14];let f;return e[15]!==s||e[16]!==o||e[17]!==p?(f=a.jsx("div",{ref:s,className:o,children:p}),e[15]=s,e[16]=o,e[17]=p,e[18]=f):f=e[18],f}const Ti=10080*60*1e3;function Bi({sandboxMap:t,userId:e,rawBranches:s,now:r}){const n=new Map;for(const[h,b]of Object.entries(t??{}))for(const[p,f]of Object.entries(b??{})){let m=n.get(p);m||(m={userIds:new Set,lastActiveAt:0},n.set(p,m)),m.userIds.add(h);for(const x of Object.values(f??{})){const g=x?.createdAt??0;g>m.lastActiveAt&&(m.lastActiveAt=g)}}const i=r-Ti,d=[...n.entries()].filter(([,h])=>h.lastActiveAt>=i).sort((h,b)=>b[1].lastActiveAt-h[1].lastActiveAt).map(([h,b])=>({name:h,source:"recent",contributors:[...b.userIds],lastActiveAt:b.lastActiveAt})),l=new Set(d.map(h=>h.name)),o=new Set(Object.keys(t?.[e]??{})),u=[...o].filter(h=>!l.has(h)).sort().map(h=>({name:h,source:"yours"})),c=s.filter(h=>!o.has(h.name)&&!l.has(h.name)).map(h=>({name:h.name,source:"other",author:h.author??null}));return{recent:d,yours:u,others:c}}const Ii=100,Fi=50,$i=300;function rn(t,e){const s=e.trim().toLowerCase();return s?t.toLowerCase().includes(s):!0}function Li(t){const e=T.c(39),{orgId:s,orgSlug:r,userId:n,target:i,sandboxMap:d,owner:l,repo:o,search:u,enabled:c}=t,h=u===void 0?"":u,b=c===void 0?!0:c;let p;e[0]!==h?(p=h.trim(),e[0]=h,e[1]=p):p=e[1];const f=p,m=yl(f,$i);let x;e[2]!==i?(x=_r(i),e[2]=i,e[3]=x):x=e[3];const g=x,w=f.length>0;let j;e[4]!==m||e[5]!==s||e[6]!==r||e[7]!==l||e[8]!==o||e[9]!==i?(j=ns.githubBranchSearch(s,r,zr(i),l,o,m),e[4]=m,e[5]=s,e[6]=r,e[7]=l,e[8]=o,e[9]=i,e[10]=j):j=e[10];const v=b&&g;let P;e[11]!==m||e[12]!==r||e[13]!==i?(P=B=>{const{pageParam:Z}=B;return Ca(r,"REPOSITORY_SEARCH_BRANCHES",{...i,query:m,limit:m?Fi:Ii,cursor:Z})},e[11]=m,e[12]=r,e[13]=i,e[14]=P):P=e[14];let S;e[15]!==m?(S=B=>m?void 0:B.nextCursor??void 0,e[15]=m,e[16]=S):S=e[16];let k;e[17]!==j||e[18]!==v||e[19]!==P||e[20]!==S?(k={queryKey:j,enabled:v,staleTime:3e4,retry:!1,initialPageParam:null,queryFn:P,getNextPageParam:S},e[17]=j,e[18]=v,e[19]=P,e[20]=S,e[21]=k):k=e[21];const{data:N,isLoading:C,isError:y,isFetching:A,hasNextPage:D,isFetchingNextPage:I,fetchNextPage:O}=jl(k),F=w&&(m!==f||A),q=(N?.pages??[]).flatMap(Ei),E=rl(6e4),G=Bi({sandboxMap:d,userId:n,rawBranches:q,now:E});let _;e[22]!==f?(_=B=>rn(B.name,f),e[22]=f,e[23]=_):_=e[23];const W=G.recent.filter(_);let $;e[24]!==f?($=B=>rn(B.name,f),e[24]=f,e[25]=$):$=e[25];const V=G.yours.filter($),te=G.others,X=N?.pages[0],ne=w&&X&&!F?Math.max(0,X.totalCount-X.branches.length):0,le=!w&&D;let M;e[26]!==O?(M=()=>{O()},e[26]=O,e[27]=M):M=e[27];let Y;return e[28]!==ne||e[29]!==y||e[30]!==I||e[31]!==C||e[32]!==F||e[33]!==te||e[34]!==W||e[35]!==le||e[36]!==M||e[37]!==V?(Y={recent:W,yours:V,others:te,isLoading:C,isError:y,isSearching:F,hiddenMatchCount:ne,hasMore:le,isFetchingMore:I,fetchMore:M},e[28]=ne,e[29]=y,e[30]=I,e[31]=C,e[32]=F,e[33]=te,e[34]=W,e[35]=le,e[36]=M,e[37]=V,e[38]=Y):Y=e[38],Y}function Ei(t){return t.branches}function Oi(t){const e=T.c(6),s=me(),{releases:r,createRelease:n}=Vs(t.virtualMcpId);let i;return e[0]!==n||e[1]!==t.userId||e[2]!==t.userLabel||e[3]!==r||e[4]!==s?(i=()=>{if(r.length>=Fs)return et.error(s("thread.branchPicker.capReached",{max:Fs})),null;const d=vn(t.userLabel);return n({branch:d,name:Vr(r,s("thread.branchPicker.defaultVersionName")),color:us(r.length),createdBy:t.userId,createdAt:new Date().toISOString()}).catch(l=>{et.error(s("thread.branchPicker.saveError"),{description:kr(s,Nr(l))})}),d},e[0]=n,e[1]=t.userId,e[2]=t.userLabel,e[3]=r,e[4]=s,e[5]=i):i=e[5],i}const Ls="-mx-[3px] h-3.5 w-3.5 shrink-0";function Mi(t){const e=T.c(110),{virtualMcpId:s,isV8:r,userLabel:n,value:i,baseBranch:d,baseIsDraft:l,orgId:o,orgSlug:u,userId:c,target:h,owner:b,repo:p,sandboxMap:f,onChange:m,onCreateBranch:x,onAdoptBranch:g,disabled:w,spawnsNewChat:j,placement:v}=t,P=r===void 0?!1:r,S=l===void 0?!1:l,k=w===void 0?!1:w,N=j===void 0?!1:j,C=v===void 0?"chat":v,y=me(),A=C==="header",[D,I]=H.useState(!1),[O,F]=H.useState(!1),[q,E]=H.useState("branches"),[G,_]=H.useState(null),[W,$]=H.useState(""),[V,te]=H.useState(null),[X,ne]=H.useState(null),le=H.useRef(null),{releases:M,createRelease:Y,renameRelease:B,deleteRelease:Z}=Vs(s);let se;e[0]!==c||e[1]!==n||e[2]!==s?(se={virtualMcpId:s,userLabel:n,userId:c},e[0]=c,e[1]=n,e[2]=s,e[3]=se):se=e[3];const ie=Oi(se),ge=kl(s,P),ue=P?Nl(M,ge.data):[],re=ge.refetch,fe=Cl(s),{url:ye,setUrl:z,clear:oe}=pn(s),xe=bn(s),Q=P&&!!xe.connection,ee=P?xe.connection?.endpoint??null:ye,ce=!!ee;let J;e[4]!==oe||e[5]!==P||e[6]!==xe?(J=()=>{oe(),P&&xe.clear()},e[4]=oe,e[5]=P,e[6]=xe,e[7]=J):J=e[7];const de=J;let Me;e[8]!==D?(Me={enabled:D},e[8]=D,e[9]=Me):Me=e[9];const{data:mt}=Aa(Me);let we;e[10]!==mt?.data?.members?(we=R=>R?mt?.data?.members?.find(be=>be.userId===R)?.user?.name??void 0:void 0,e[10]=mt?.data?.members,e[11]=we):we=e[11];const rt=we,Le=M.length>=Fs,Re=M.length>1,De=y("thread.branchPicker.capReached",{max:Fs}),{isBase:_e,current:Ne,storeDraft:at,unlisted:ze}=ki({value:i,baseBranch:d,releases:M,baseIsDraft:S,storeDrafts:ue}),$t=_e?y("thread.branchPicker.live"):Ne?.name??at?.name??y("thread.branchPicker.defaultVersionName"),Ee=Q?y("thread.branchPicker.localhost.label"):ce?y("thread.branchPicker.localLabel"):i?$t:y("thread.branchPicker.selectVersion"),Qe=Q?"bg-foreground":ce?"bg-special":_e?"bg-success":at?ds(void 0):ds(Ne?.color??"orange"),L=!Q&&!ce&&!_e&&Ne?.runtime==="sandbox",pe=R=>{de();const be=ue.some(Ve=>Ve.name===R)?{runtime:"cms"}:M.find(Ve=>Ve.branch===R);m(R,be&&{runtime:be.runtime}),I(!1)};let Pe;e[12]!==y?(Pe=R=>{et.error(y("thread.branchPicker.saveError"),{description:kr(y,Nr(R))})},e[12]=y,e[13]=Pe):Pe=e[13];const Se=Pe;let Te;e[14]!==z?(Te=R=>{z(R),F(!1),I(!1)},e[14]=z,e[15]=Te):Te=e[15];const pt=Te,bt=(R,be)=>{if(de(),g){g(R),F(!1),I(!1);return}if(!M.some(Ve=>Ve.branch===R)){if(Le){et.error(De);return}Y({branch:R,name:be.trim()||R,color:us(M.length),createdBy:c,createdAt:new Date().toISOString()}).catch(Se)}m(R),F(!1),I(!1)};let lt;e[16]!==de||e[17]!==m||e[18]!==x||e[19]!==ie?(lt=()=>{const R=ie();R&&(de(),(x??m)(R),I(!1))},e[16]=de,e[17]=m,e[18]=x,e[19]=ie,e[20]=lt):lt=e[20];const as=lt;let gt;e[21]===Symbol.for("react.memo_cache_sentinel")?(gt=()=>{_(null),$(""),F(!1),E("branches")},e[21]=gt):gt=e[21];const ls=gt;let it;e[22]===Symbol.for("react.memo_cache_sentinel")?(it=R=>{E(R),F(!0)},e[22]=it):it=e[22];const Ce=it;let ot;e[23]===Symbol.for("react.memo_cache_sentinel")?(ot=R=>{_(R.branch),$(R.name)},e[23]=ot):ot=e[23];const Lt=ot;let xt;e[24]!==W||e[25]!==B||e[26]!==Se?(xt=R=>{const be=W.trim();be&&B(R,be).catch(Se),_(null),$("")},e[24]=W,e[25]=B,e[26]=Se,e[27]=xt):xt=e[27];const Qs=xt,Et=R=>{const be=R===void 0?i:R,Ve=W.trim();if(Ve&&be){if(Le){et.error(De),_(null),$("");return}Y({branch:be,name:Ve,color:us(M.length),createdBy:c,createdAt:new Date().toISOString()}).catch(Se)}_(null),$("")};let Je;e[28]===Symbol.for("react.memo_cache_sentinel")?(Je=()=>{_(null),$("")},e[28]=Je):Je=e[28];const ct=Je,Nt=()=>{const R=V;if(te(null),!(!R||!Re)){if(R.branch===i){const be=M.filter(Na=>Na.branch!==R.branch),Ve=be.find(_i)??be[0];Ve?pe(Ve.branch):I(!1)}else I(!1);Z(R.branch).catch(Se)}},dt=Al(M),is=(dt.content.length>0||ue.length>0)&&dt.code.length>0,vt=R=>G===R.branch?a.jsx(Zs,{value:W,onChange:$,onSave:()=>Qs(R.branch),onCancel:ct},R.branch):a.jsx(en,{rowRef:!ce&&R.branch===i?le:void 0,dot:ds(R.color),codeIcon:R.runtime==="sandbox"?xs(R.color):void 0,label:R.name,creator:rt(R.createdBy),originTooltip:P?y("thread.branchPicker.viaStudioUi"):void 0,branch:!P||R.runtime==="sandbox"?R.branch:void 0,selected:!ce&&R.branch===i,onSelect:()=>pe(R.branch),onRename:()=>Lt(R),onDelete:()=>te(R),deleteBlocked:!Re},R.branch),Ct=()=>{const R=X;if(ne(null),!(!R||R.name===i&&M.length===0)){if(R.name===i){const be=M[0];be?pe(be.branch):I(!1)}fe.mutateAsync(R.name).catch(be=>{et.error(y("thread.branchPicker.discardStoreDraftError"),{description:be instanceof Error?be.message:void 0})})}},At=ue.map((R,be)=>G===R.name?a.jsx(Zs,{value:W,onChange:$,onSave:()=>Et(R.name),onCancel:ct},`store:${R.name}`):a.jsx(en,{rowRef:!ce&&R.name===i?le:void 0,dot:ds(void 0),label:R.name,creator:rt(R.createdBy),agentIcon:xs(us(be)),originTooltip:y("thread.branchPicker.storeDraftVia",{via:Rl(R.via)}),selected:!ce&&R.name===i,onSelect:()=>pe(R.name),onRename:()=>{_(R.name),$(R.name)},onDelete:()=>ne(R),deleteBlocked:R.name===i&&M.length===0},`store:${R.name}`));let yt;e[29]!==k||e[30]!==P||e[31]!==re?(yt=k?void 0:R=>{R?P&&re():ls(),I(R)},e[29]=k,e[30]=P,e[31]=re,e[32]=yt):yt=e[32];const Rt=A?"text-xs":"text-xs text-muted-foreground hover:text-foreground";let Xe;e[33]!==Rt?(Xe=K("shrink min-w-0 max-w-[220px] gap-2",Rt,Dr),e[33]=Rt,e[34]=Xe):Xe=e[34];let jt;e[35]!==k?(jt=!k&&a.jsx(Ir,{size:12,className:"opacity-60 shrink-0"}),e[35]=k,e[36]=jt):jt=e[36];let ut;e[37]!==Ee?(ut=a.jsx(nt,{children:Ee}),e[37]=Ee,e[38]=ut):ut=e[38];const Dt=il,os="w-[min(300px,calc(100vw-2rem))] p-1.5",cs="start";let Be;e[39]===Symbol.for("react.memo_cache_sentinel")?(Be=R=>{R.preventDefault(),le.current?.scrollIntoView({block:"nearest"})},e[39]=Be):Be=e[39];let Ie;e[40]!==N||e[41]!==y?(Ie=N&&a.jsx("p",{className:"px-2 pb-1.5 pt-1 text-xs text-muted-foreground",children:y("thread.branchPicker.newChatHint")}),e[40]=N,e[41]=y,e[42]=Ie):Ie=e[42];const Ye=O?a.jsx(Ui,{orgId:o,orgSlug:u,userId:c,target:h,owner:b,repo:p,sandboxMap:f,enabled:D,tab:q,onTabChange:E,isV8:P,localUrl:ye,onSaveLocal:pt,onBack:()=>F(!1),onAdopt:bt}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:K("always-scrollbar flex max-h-[min(50vh,20rem)] flex-col overflow-y-auto",P&&"gap-1"),children:[!P&&ce&&ee&&a.jsx(zi,{rowRef:le,url:ee,onSelect:()=>Ce("local"),onEdit:()=>Ce("local"),onTurnOff:()=>de()}),ze&&i&&(G===i?a.jsx(Zs,{value:W,onChange:$,onSave:()=>Et(),onCancel:ct}):a.jsx(en,{rowRef:ce?void 0:le,dot:ds("orange"),label:y("thread.branchPicker.defaultVersionName"),branch:P?void 0:i,originTooltip:P?y("thread.branchPicker.viaStudioUi"):void 0,selected:!ce,onSelect:()=>pe(i),onRename:()=>{_(i),$(Vr(M,y("thread.branchPicker.defaultVersionName")))}})),is?a.jsxs(a.Fragment,{children:[a.jsx(Wn,{children:y("thread.branchPicker.groupContent")}),dt.content.map(vt),At,a.jsx(Wn,{divided:!0,children:y("thread.branchPicker.groupCode")}),dt.code.map(vt)]}):a.jsxs(a.Fragment,{children:[M.map(vt),At]}),P&&a.jsx(Ai,{virtualMcpId:s,branch:i,serve:xe,rowRef:Q?le:void 0,onPicked:()=>I(!1)})]}),(ze||M.length>0||ue.length>0||P)&&a.jsx("div",{className:"my-1 border-t"}),a.jsxs("button",{type:"button",onClick:()=>{as()},disabled:Le,className:"flex w-full items-center gap-2 rounded-lg px-2 py-2 text-left text-sm text-muted-foreground hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:opacity-50",children:[a.jsx(Mr,{className:"h-4 w-4 shrink-0"}),y("thread.branchPicker.newVersion")]}),Le&&a.jsx("p",{className:"px-2 pb-1 pt-0.5 text-xs text-warning",children:De}),a.jsxs("button",{type:"button",onClick:()=>Ce("branches"),className:K("flex w-full items-center justify-between gap-2 rounded-lg px-2 py-2 text-left text-xs text-muted-foreground hover:bg-accent hover:text-foreground",P&&"mt-1"),children:[y("thread.branchPicker.advanced"),a.jsx(dr,{className:"h-4 w-4 shrink-0"})]})]});let Ue;e[43]!==Dt||e[44]!==Be||e[45]!==Ie||e[46]!==Ye?(Ue=a.jsxs(Dt,{className:os,align:cs,onOpenAutoFocus:Be,children:[Ie,Ye]}),e[43]=Dt,e[44]=Be,e[45]=Ie,e[46]=Ye,e[47]=Ue):Ue=e[47];const wt=a.jsxs(ol,{open:D,onOpenChange:yt,children:[a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx("span",{className:"inline-flex min-w-0 shrink",children:a.jsx(cl,{asChild:!0,children:a.jsxs(ve,{"data-tour":al.branchPicker,variant:A?"outline":"ghost",size:A?"sm":"default","aria-label":Ee,disabled:k,className:Xe,children:[L?a.jsx(Fr,{className:K(Ls,xs(Ne?.color))}):at&&!ce?a.jsx(ur,{className:K(Ls,xs(us(ue.indexOf(at))))}):a.jsx("span",{className:K("h-2 w-2 shrink-0 rounded-full",i||ce?Qe:"bg-muted-foreground")}),a.jsx("span",{className:"min-w-0 truncate @max-3xl/panel-header:hidden",children:Ee}),jt]})})})}),ut]}),Ue]}),Ze=V!==null;let He;e[48]===Symbol.for("react.memo_cache_sentinel")?(He=R=>{R||te(null)},e[48]=He):He=e[48];let Fe;e[49]!==y?(Fe=y("thread.branchPicker.deleteTitle"),e[49]=y,e[50]=Fe):Fe=e[50];let $e;e[51]!==Fe?($e=a.jsx(ks,{children:Fe}),e[51]=Fe,e[52]=$e):$e=e[52];let qe;e[53]!==V||e[54]!==y?(qe=V&&y("thread.branchPicker.deleteConfirm",{name:V.name}),e[53]=V,e[54]=y,e[55]=qe):qe=e[55];let U;e[56]!==qe?(U=a.jsx(Ns,{children:qe}),e[56]=qe,e[57]=U):U=e[57];let ae;e[58]!==$e||e[59]!==U?(ae=a.jsxs(Cs,{children:[$e,U]}),e[58]=$e,e[59]=U,e[60]=ae):ae=e[60];let he;e[61]!==y?(he=y("thread.branchPicker.cancel"),e[61]=y,e[62]=he):he=e[62];let je;e[63]!==he?(je=a.jsx(As,{children:he}),e[63]=he,e[64]=je):je=e[64];let Ae;e[65]!==y?(Ae=y("thread.branchPicker.delete"),e[65]=y,e[66]=Ae):Ae=e[66];let Ke;e[67]!==Nt||e[68]!==Ae?(Ke=a.jsx(Rs,{onClick:Nt,variant:"destructive",children:Ae}),e[67]=Nt,e[68]=Ae,e[69]=Ke):Ke=e[69];let Ot;e[70]!==je||e[71]!==Ke?(Ot=a.jsxs(Ds,{children:[je,Ke]}),e[70]=je,e[71]=Ke,e[72]=Ot):Ot=e[72];let Mt;e[73]!==ae||e[74]!==Ot?(Mt=a.jsxs(Ts,{children:[ae,Ot]}),e[73]=ae,e[74]=Ot,e[75]=Mt):Mt=e[75];let ps;e[76]!==Ze||e[77]!==Mt?(ps=a.jsx(Bs,{open:Ze,onOpenChange:He,children:Mt}),e[76]=Ze,e[77]=Mt,e[78]=ps):ps=e[78];const Js=X!==null;let bs;e[79]===Symbol.for("react.memo_cache_sentinel")?(bs=R=>{R||ne(null)},e[79]=bs):bs=e[79];let _t;e[80]!==y?(_t=y("thread.branchPicker.deleteTitle"),e[80]=y,e[81]=_t):_t=e[81];let zt;e[82]!==_t?(zt=a.jsx(ks,{children:_t}),e[82]=_t,e[83]=zt):zt=e[83];let Ut;e[84]!==X||e[85]!==y?(Ut=X&&y("thread.branchPicker.discardStoreDraftConfirm",{name:X.name}),e[84]=X,e[85]=y,e[86]=Ut):Ut=e[86];let Ht;e[87]!==Ut?(Ht=a.jsx(Ns,{children:Ut}),e[87]=Ut,e[88]=Ht):Ht=e[88];let qt;e[89]!==zt||e[90]!==Ht?(qt=a.jsxs(Cs,{children:[zt,Ht]}),e[89]=zt,e[90]=Ht,e[91]=qt):qt=e[91];let Kt;e[92]!==y?(Kt=y("thread.branchPicker.cancel"),e[92]=y,e[93]=Kt):Kt=e[93];let Vt;e[94]!==Kt?(Vt=a.jsx(As,{children:Kt}),e[94]=Kt,e[95]=Vt):Vt=e[95];let Gt;e[96]!==y?(Gt=y("thread.branchPicker.delete"),e[96]=y,e[97]=Gt):Gt=e[97];let Wt;e[98]!==Ct||e[99]!==Gt?(Wt=a.jsx(Rs,{onClick:Ct,variant:"destructive",children:Gt}),e[98]=Ct,e[99]=Gt,e[100]=Wt):Wt=e[100];let Qt;e[101]!==Vt||e[102]!==Wt?(Qt=a.jsxs(Ds,{children:[Vt,Wt]}),e[101]=Vt,e[102]=Wt,e[103]=Qt):Qt=e[103];let Jt;e[104]!==qt||e[105]!==Qt?(Jt=a.jsxs(Ts,{children:[qt,Qt]}),e[104]=qt,e[105]=Qt,e[106]=Jt):Jt=e[106];let gs;return e[107]!==Js||e[108]!==Jt?(gs=a.jsx(Bs,{open:Js,onOpenChange:bs,children:Jt}),e[107]=Js,e[108]=Jt,e[109]=gs):gs=e[109],a.jsxs(a.Fragment,{children:[wt,ps,gs]})}function _i(t){return t.runtime!=="sandbox"}function Zs(t){const e=T.c(20),{value:s,onChange:r,onSave:n,onCancel:i}=t,d=me();let l;e[0]!==d?(l=d("thread.branchPicker.rename"),e[0]=d,e[1]=l):l=e[1];let o;e[2]!==r?(o=f=>r(f.target.value),e[2]=r,e[3]=o):o=e[3];let u;e[4]!==i||e[5]!==n?(u=f=>{f.key==="Enter"&&n(),f.key==="Escape"&&(f.preventDefault(),f.stopPropagation(),i())},e[4]=i,e[5]=n,e[6]=u):u=e[6];let c;e[7]!==l||e[8]!==o||e[9]!==u||e[10]!==s?(c=a.jsx("input",{autoFocus:!0,"aria-label":l,value:s,onChange:o,onKeyDown:u,className:"h-8 flex-1 rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[7]=l,e[8]=o,e[9]=u,e[10]=s,e[11]=c):c=e[11];let h;e[12]!==d?(h=d("thread.branchPicker.save"),e[12]=d,e[13]=h):h=e[13];let b;e[14]!==n||e[15]!==h?(b=a.jsx(ve,{size:"sm",onClick:n,children:h}),e[14]=n,e[15]=h,e[16]=b):b=e[16];let p;return e[17]!==c||e[18]!==b?(p=a.jsxs("div",{className:"flex items-center gap-1.5 p-1",children:[c,b]}),e[17]=c,e[18]=b,e[19]=p):p=e[19],p}function Wn(t){const e=T.c(5),{divided:s,children:r}=t,i=(s===void 0?!1:s)&&"mt-1 border-t";let d;e[0]!==i?(d=K("px-2 pb-1 pt-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",i),e[0]=i,e[1]=d):d=e[1];let l;return e[2]!==r||e[3]!==d?(l=a.jsx("p",{className:d,children:r}),e[2]=r,e[3]=d,e[4]=l):l=e[4],l}function en(t){const e=T.c(53),{rowRef:s,dot:r,codeIcon:n,agentIcon:i,originTooltip:d,label:l,creator:o,branch:u,selected:c,onSelect:h,onRename:b,onDelete:p,deleteBlocked:f}=t,m=f===void 0?!1:f,x=me();let g;e[0]!==i||e[1]!==n||e[2]!==r?(g=n?a.jsx(Fr,{className:K(Ls,n)}):i?a.jsx(ur,{className:K(Ls,i)}):a.jsx("span",{className:K("h-2 w-2 shrink-0 rounded-full",r)}),e[0]=i,e[1]=n,e[2]=r,e[3]=g):g=e[3];let w;e[4]!==o?(w=o&&a.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:o}),e[4]=o,e[5]=w):w=e[5];let j;e[6]!==l||e[7]!==w?(j=a.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[l,w]}),e[6]=l,e[7]=w,e[8]=j):j=e[8];let v;e[9]!==h||e[10]!==c||e[11]!==g||e[12]!==j?(v=a.jsxs("button",{type:"button","aria-pressed":c,onClick:h,className:"flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[g,j]}),e[9]=h,e[10]=c,e[11]=g,e[12]=j,e[13]=v):v=e[13];const P=v,S=c?"bg-accent":"hover:bg-accent";let k;e[14]!==S?(k=K("group flex items-center rounded-lg",S),e[14]=S,e[15]=k):k=e[15];let N;e[16]!==u||e[17]!==n||e[18]!==d||e[19]!==P||e[20]!==x?(N=u||d?a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:P}),a.jsxs(nt,{side:"bottom",className:"text-xs",children:[n&&a.jsx("p",{className:"font-medium",children:x("thread.branchPicker.codeDraftTooltip")}),d&&a.jsx("p",{children:d}),u&&a.jsx("p",{className:"font-mono",children:x("thread.branchPicker.branchTooltip",{branch:u})})]})]}):P,e[16]=u,e[17]=n,e[18]=d,e[19]=P,e[20]=x,e[21]=N):N=e[21];let C;e[22]!==x?(C=x("thread.branchPicker.moreActions"),e[22]=x,e[23]=C):C=e[23];let y;e[24]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(Er,{className:"h-4 w-4"}),e[24]=y):y=e[24];let A;e[25]!==C?(A=a.jsx(Os,{asChild:!0,children:a.jsx(ve,{variant:"ghost",size:"icon","aria-label":C,className:"mr-1 h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",children:y})}),e[25]=C,e[26]=A):A=e[26];let D;e[27]===Symbol.for("react.memo_cache_sentinel")?(D=a.jsx(Or,{className:"h-4 w-4"}),e[27]=D):D=e[27];let I;e[28]!==x?(I=x("thread.branchPicker.rename"),e[28]=x,e[29]=I):I=e[29];let O;e[30]!==b||e[31]!==I?(O=a.jsxs(Zt,{onSelect:b,children:[D,I]}),e[30]=b,e[31]=I,e[32]=O):O=e[32];let F;e[33]!==m||e[34]!==p||e[35]!==x?(F=p&&a.jsxs(Zt,{onSelect:p,disabled:m,className:"text-destructive focus:text-destructive",children:[a.jsx(qs,{className:"h-4 w-4"}),x("thread.branchPicker.delete")]}),e[33]=m,e[34]=p,e[35]=x,e[36]=F):F=e[36];let q;e[37]!==m||e[38]!==p||e[39]!==x?(q=p&&m&&a.jsx("p",{className:"max-w-48 px-2 pb-1.5 text-xs text-muted-foreground",children:x("thread.branchPicker.keepOneDraft")}),e[37]=m,e[38]=p,e[39]=x,e[40]=q):q=e[40];let E;e[41]!==O||e[42]!==F||e[43]!==q?(E=a.jsxs(Ms,{align:"end",children:[O,F,q]}),e[41]=O,e[42]=F,e[43]=q,e[44]=E):E=e[44];let G;e[45]!==A||e[46]!==E?(G=a.jsxs(_s,{children:[A,E]}),e[45]=A,e[46]=E,e[47]=G):G=e[47];let _;return e[48]!==s||e[49]!==G||e[50]!==k||e[51]!==N?(_=a.jsxs("div",{ref:s,className:k,children:[N,G]}),e[48]=s,e[49]=G,e[50]=k,e[51]=N,e[52]=_):_=e[52],_}function zi(t){const e=T.c(40),{rowRef:s,url:r,onSelect:n,onEdit:i,onTurnOff:d}=t,l=me();let o;try{let A;e[0]!==r?(A=new URL(r),e[0]=r,e[1]=A):A=e[1],o=A.host}catch{o=r}const u=o;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-special"}),e[2]=c):c=e[2];let h;e[3]!==l?(h=l("thread.branchPicker.localLabel"),e[3]=l,e[4]=h):h=e[4];let b;e[5]!==u?(b=a.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:u}),e[5]=u,e[6]=b):b=e[6];let p;e[7]!==h||e[8]!==b?(p=a.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[h,b]}),e[7]=h,e[8]=b,e[9]=p):p=e[9];let f;e[10]!==n||e[11]!==p?(f=a.jsxs("button",{type:"button","aria-pressed":!0,onClick:n,className:"flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[c,p]}),e[10]=n,e[11]=p,e[12]=f):f=e[12];let m;e[13]!==l?(m=l("thread.branchPicker.moreActions"),e[13]=l,e[14]=m):m=e[14];let x;e[15]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(Er,{className:"h-4 w-4"}),e[15]=x):x=e[15];let g;e[16]!==m?(g=a.jsx(Os,{asChild:!0,children:a.jsx(ve,{variant:"ghost",size:"icon","aria-label":m,className:"mr-1 h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",children:x})}),e[16]=m,e[17]=g):g=e[17];let w;e[18]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(Or,{className:"h-4 w-4"}),e[18]=w):w=e[18];let j;e[19]!==l?(j=l("thread.branchPicker.rename"),e[19]=l,e[20]=j):j=e[20];let v;e[21]!==i||e[22]!==j?(v=a.jsxs(Zt,{onSelect:i,children:[w,j]}),e[21]=i,e[22]=j,e[23]=v):v=e[23];let P;e[24]===Symbol.for("react.memo_cache_sentinel")?(P=a.jsx(qs,{className:"h-4 w-4"}),e[24]=P):P=e[24];let S;e[25]!==l?(S=l("thread.branchPicker.localTurnOff"),e[25]=l,e[26]=S):S=e[26];let k;e[27]!==d||e[28]!==S?(k=a.jsxs(Zt,{onSelect:d,className:"text-destructive focus:text-destructive",children:[P,S]}),e[27]=d,e[28]=S,e[29]=k):k=e[29];let N;e[30]!==v||e[31]!==k?(N=a.jsxs(Ms,{align:"end",children:[v,k]}),e[30]=v,e[31]=k,e[32]=N):N=e[32];let C;e[33]!==N||e[34]!==g?(C=a.jsxs(_s,{children:[g,N]}),e[33]=N,e[34]=g,e[35]=C):C=e[35];let y;return e[36]!==s||e[37]!==C||e[38]!==f?(y=a.jsxs("div",{ref:s,className:"group flex items-center rounded-lg bg-accent",children:[f,C]}),e[36]=s,e[37]=C,e[38]=f,e[39]=y):y=e[39],y}function Ui(t){const e=T.c(73),{orgId:s,orgSlug:r,userId:n,target:i,owner:d,repo:l,sandboxMap:o,enabled:u,tab:c,onTabChange:h,isV8:b,localUrl:p,onSaveLocal:f,onBack:m,onAdopt:x}=t,g=me(),[w,j]=H.useState(""),v=c==="branches"?w:"",P=u&&c==="branches";let S;e[0]!==s||e[1]!==r||e[2]!==d||e[3]!==l||e[4]!==o||e[5]!==v||e[6]!==P||e[7]!==i||e[8]!==n?(S={orgId:s,orgSlug:r,userId:n,target:i,sandboxMap:o,owner:d,repo:l,search:v,enabled:P},e[0]=s,e[1]=r,e[2]=d,e[3]=l,e[4]=o,e[5]=v,e[6]=P,e[7]=i,e[8]=n,e[9]=S):S=e[9];const{recent:k,yours:N,others:C,isLoading:y,hasMore:A,isFetchingMore:D,fetchMore:I}=Li(S),O=u&&c==="prs";let F;e[10]!==s||e[11]!==r||e[12]!==d||e[13]!==l||e[14]!==O||e[15]!==i?(F={orgId:s,orgSlug:r,target:i,owner:d,repo:l,enabled:O},e[10]=s,e[11]=r,e[12]=d,e[13]=l,e[14]=O,e[15]=i,e[16]=F):F=e[16];const{data:q,isLoading:E}=wl(F);let G;if(e[17]!==I||e[18]!==A||e[19]!==D||e[20]!==y||e[21]!==b||e[22]!==p||e[23]!==x||e[24]!==m||e[25]!==f||e[26]!==h||e[27]!==C||e[28]!==d||e[29]!==E||e[30]!==k||e[31]!==l||e[32]!==w||e[33]!==g||e[34]!==q||e[35]!==c||e[36]!==N){const _=q===void 0?[]:q,W=`${d}/${l}`;let $;e[38]!==W?($=W.toLowerCase(),e[38]=W,e[39]=$):$=e[39];const V=$;let te;e[40]!==V?(te=z=>z.headRepoFullName?.toLowerCase()===V,e[40]=V,e[41]=te):te=e[41];const X=_.filter(te);let ne;if(e[42]!==C||e[43]!==k||e[44]!==N){const z=new Set;ne=[...k,...N,...C].filter(oe=>z.has(oe.name)?!1:(z.add(oe.name),!0)),e[42]=C,e[43]=k,e[44]=N,e[45]=ne}else ne=e[45];const le=ne;let M;e[46]===Symbol.for("react.memo_cache_sentinel")?(M=a.jsx(fl,{className:"h-4 w-4 shrink-0"}),e[46]=M):M=e[46];let Y;e[47]!==g?(Y=g("thread.branchPicker.advancedBack"),e[47]=g,e[48]=Y):Y=e[48];let B;e[49]!==m||e[50]!==Y?(B=a.jsxs("button",{type:"button",onClick:m,className:"flex items-center gap-1.5 px-2 py-1.5 text-xs text-muted-foreground hover:text-foreground",children:[M,Y]}),e[49]=m,e[50]=Y,e[51]=B):B=e[51];let Z;e[52]!==h?(Z=z=>{h(z),j("")},e[52]=h,e[53]=Z):Z=e[53];let se;e[54]!==g?(se=g("thread.branchPicker.branchesTab"),e[54]=g,e[55]=se):se=e[55];let ie;e[56]!==se?(ie=a.jsx(Tt,{value:"branches",className:"h-6 px-2.5 text-xs",children:se}),e[56]=se,e[57]=ie):ie=e[57];let ge;e[58]!==g?(ge=g("thread.branchPicker.prsTab"),e[58]=g,e[59]=ge):ge=e[59];let ue;e[60]!==ge?(ue=a.jsx(Tt,{value:"prs",className:"h-6 px-2.5 text-xs",children:ge}),e[60]=ge,e[61]=ue):ue=e[61];let re;e[62]!==b||e[63]!==g?(re=!b&&a.jsx(Tt,{value:"local",className:"h-6 px-2.5 text-xs",children:g("thread.branchPicker.localTab")}),e[62]=b,e[63]=g,e[64]=re):re=e[64];let fe;e[65]!==ie||e[66]!==ue||e[67]!==re?(fe=a.jsxs(Tr,{className:"h-auto w-fit justify-start gap-1 bg-accent p-1",variant:"pill",children:[ie,ue,re]}),e[65]=ie,e[66]=ue,e[67]=re,e[68]=fe):fe=e[68];let ye;e[69]!==Z||e[70]!==fe||e[71]!==c?(ye=a.jsx(Br,{className:"px-2 pt-2 pb-1",value:c,onValueChange:Z,children:fe}),e[69]=Z,e[70]=fe,e[71]=c,e[72]=ye):ye=e[72],G=a.jsxs("div",{className:"flex flex-col",children:[B,ye,c==="local"&&!b?a.jsx(Ci,{url:p,onSave:f}):a.jsxs(dl,{filter:c==="branches"?Hi:void 0,children:[a.jsx(ul,{placeholder:g(c==="branches"?"thread.branchPicker.searchBranches":"thread.branchPicker.searchPullRequests"),value:w,onValueChange:j}),a.jsx(hl,{onScroll:z=>{const oe=z.currentTarget;c==="branches"&&oe.scrollHeight-oe.scrollTop-oe.clientHeight<48&&I()},children:c==="branches"?a.jsxs(a.Fragment,{children:[y&&a.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:g("thread.branchPicker.loadingMore")}),!y&&le.length===0&&a.jsx(Un,{children:g("thread.branchPicker.noBranchesFound")}),le.length>0&&a.jsx(Hn,{children:le.map(z=>a.jsxs(qn,{value:z.name,className:"cursor-pointer",onSelect:()=>x(z.name,z.name),children:[a.jsx(Ra,{className:"mr-2 h-4 w-4 shrink-0"}),a.jsx("span",{className:"flex-1 truncate",children:z.name})]},z.name))}),A&&a.jsx("div",{className:"p-2",children:a.jsx(ve,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs",disabled:D,onClick:I,children:g(D?"thread.branchPicker.loadingMore":"thread.branchPicker.loadMoreBranches")})})]}):a.jsxs(a.Fragment,{children:[E&&a.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:g("thread.branchPicker.loadingPullRequests")}),!E&&X.length===0&&a.jsx(Un,{children:g("thread.branchPicker.noOpenPullRequests")}),X.length>0&&a.jsx(Hn,{children:X.map(z=>a.jsxs(qn,{value:`#${z.number} ${z.title} ${z.head}`,className:"cursor-pointer",onSelect:()=>x(z.head,Gn(z.title)),children:[a.jsx(Hs,{className:"mr-2 h-4 w-4 shrink-0 text-muted-foreground"}),a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsx("span",{className:"truncate",children:Gn(z.title)}),a.jsxs("span",{className:"truncate text-xs text-muted-foreground",children:["#",z.number," · ",z.head]})]})]},z.number))})]})})]})]}),e[17]=I,e[18]=A,e[19]=D,e[20]=y,e[21]=b,e[22]=p,e[23]=x,e[24]=m,e[25]=f,e[26]=h,e[27]=C,e[28]=d,e[29]=E,e[30]=k,e[31]=l,e[32]=w,e[33]=g,e[34]=q,e[35]=c,e[36]=N,e[37]=G}else G=e[37];return G}function Hi(t,e){return rn(t,e)?1:0}function qi(t){const e=T.c(19),{locked:s,placement:r,value:n,virtualMcpId:i,isV8:d,userLabel:l,baseBranch:o,baseIsDraft:u,onChange:c,onCreateBranch:h,onAdoptBranch:b,orgId:p,orgSlug:f,userId:m,target:x,owner:g,repo:w,sandboxMap:j}=t;let v;return e[0]!==o||e[1]!==u||e[2]!==d||e[3]!==s||e[4]!==b||e[5]!==c||e[6]!==h||e[7]!==p||e[8]!==f||e[9]!==g||e[10]!==r||e[11]!==w||e[12]!==j||e[13]!==x||e[14]!==m||e[15]!==l||e[16]!==n||e[17]!==i?(v=a.jsx(Mi,{virtualMcpId:i,isV8:d,userLabel:l,value:n,baseBranch:o,baseIsDraft:u,orgId:p,orgSlug:f,userId:m,target:x,owner:g,repo:w,sandboxMap:j,onChange:c,onCreateBranch:h,onAdoptBranch:b,spawnsNewChat:s,placement:r}),e[0]=o,e[1]=u,e[2]=d,e[3]=s,e[4]=b,e[5]=c,e[6]=h,e[7]=p,e[8]=f,e[9]=g,e[10]=r,e[11]=w,e[12]=j,e[13]=x,e[14]=m,e[15]=l,e[16]=n,e[17]=i,e[18]=v):v=e[18],v}function Ki(t){const e=T.c(2),{branchPill:s}=t;if(!s)return null;let r;return e[0]!==s?(r=a.jsx(a.Fragment,{children:s}),e[0]=s,e[1]=r):r=e[1],r}function Vi(t){const{locked:e,sessionRuntime:s,projectRuntime:r,draftRuntime:n,current:i}=t;return t.contentOnly&&n==="cms"?s==="cms"&&!e?{kind:"switch"}:{kind:"new-chat",runtime:"cms"}:n==="sandbox"&&s!=="sandbox"?{kind:"new-chat",runtime:"sandbox"}:n==="cms"&&s==="sandbox"&&r==="cms"&&!i?{kind:"new-chat"}:e?s==="sandbox"?{kind:"new-chat",runtime:"sandbox"}:{kind:"new-chat"}:{kind:"switch"}}function Gi(t){const e=T.c(25),{virtualMcp:s,currentBranch:r}=t,n=qa(),i=It();let d;e[0]!==n?.messages||e[1]!==i?.isThreadLocked?(d=(n?.messages??[]).length>0||(i?.isThreadLocked??!1),e[0]=n?.messages,e[1]=i?.isThreadLocked,e[2]=d):d=e[2];const l=d,o=i?.setCurrentTaskBranch,u=i?.createTask,c=fs(s?.id),h=c.runtime,b=s?.metadata;let p;e[3]!==b?(p=xl(b),e[3]=b,e[4]=p):p=e[4];const f=p,m=f==="cms"&&h==="sandbox",x=vl(s),g=Oe(x),{data:w}=zs.useSession(),j=w?.user;let v;e[5]!==j?(v=yn(j),e[5]=j,e[6]=v):v=e[6];const P=v,S=w?.user?.id??"",{org:k}=rs(),N=Pl(s,r),C=jn(s?.id),y=C&&h==="cms";let A;e[7]!==u||e[8]!==r||e[9]!==l||e[10]!==f||e[11]!==h||e[12]!==c.resolved||e[13]!==o||e[14]!==C?(A=(_,W)=>{const $=Vi({locked:l,sessionRuntime:c.resolved?h:null,projectRuntime:f,draftRuntime:W&&(W.runtime??f),current:_===r,contentOnly:C});$.kind==="new-chat"&&u?u({branch:_,...$.runtime?{runtime:$.runtime}:{}}):o&&o(_)},e[7]=u,e[8]=r,e[9]=l,e[10]=f,e[11]=h,e[12]=c.resolved,e[13]=o,e[14]=C,e[15]=A):A=e[15];const D=A;let I;e[16]!==m||e[17]!==u||e[18]!==l||e[19]!==o?(I=_=>{(l||m)&&u?u({branch:_}):o&&o(_)},e[16]=m,e[17]=u,e[18]=l,e[19]=o,e[20]=I):I=e[20];const O=I;let F;e[21]!==u?(F=u?_=>u({runtime:"sandbox",branch:_}):void 0,e[21]=u,e[22]=F):F=e[22];const q=F,E=x&&_r(g)?a.jsx(qi,{userLabel:P,virtualMcpId:s?.id??"",isV8:C,value:r,baseBranch:N,baseIsDraft:y,orgId:k.id,orgSlug:k.slug,userId:S,target:g,owner:x.owner,repo:x.name,sandboxMap:s?.metadata?.sandboxMap,onChange:D,onCreateBranch:O,onAdoptBranch:q,locked:l,placement:"chat"},`${zr(g)}:${x.owner}/${x.name}`):null;let G;return e[23]!==E?(G=a.jsx(Ki,{branchPill:E}),e[23]=E,e[24]=G):G=e[24],G}const Wi=Da("flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg",{variants:{orientation:{horizontal:"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}});function Qi(t){const e=T.c(11);let s,r,n;e[0]!==t?({className:s,orientation:r,...n}=t,e[0]=t,e[1]=s,e[2]=r,e[3]=n):(s=e[1],r=e[2],n=e[3]);let i;e[4]!==s||e[5]!==r?(i=K(Wi({orientation:r}),s),e[4]=s,e[5]=r,e[6]=i):i=e[6];let d;return e[7]!==r||e[8]!==n||e[9]!==i?(d=a.jsx("div",{role:"group","data-slot":"button-group","data-orientation":r,className:i,...n}),e[7]=r,e[8]=n,e[9]=i,e[10]=d):d=e[10],d}function Ji(t){const e=T.c(14),{item:s}=t;let r;e[0]!==s?(r=()=>{s.onSelect()},e[0]=s,e[1]=r):r=e[1];let n;e[2]!==s.disabled||e[3]!==s.icon||e[4]!==s.label||e[5]!==r?(n=a.jsxs(Zt,{disabled:s.disabled,onSelect:r,children:[s.icon,s.label]}),e[2]=s.disabled,e[3]=s.icon,e[4]=s.label,e[5]=r,e[6]=n):n=e[6];const i=n;if(!s.tooltip)return i;let d;e[7]!==i?(d=a.jsx(st,{asChild:!0,children:i}),e[7]=i,e[8]=d):d=e[8];let l;e[9]!==s.tooltip?(l=a.jsx(nt,{side:"right",children:s.tooltip}),e[9]=s.tooltip,e[10]=l):l=e[10];let o;return e[11]!==d||e[12]!==l?(o=a.jsxs(tt,{children:[d,l]}),e[11]=d,e[12]=l,e[13]=o):o=e[13],o}function ea(t){const e=T.c(20),{label:s,onClick:r,variant:n,size:i,disabled:d,loading:l,pulse:o,tooltip:u,icon:c,items:h,menuAriaLabel:b,className:p}=t,f=n===void 0?"default":n,m=i===void 0?"default":i,x=d===void 0?!1:d,g=l===void 0?!1:l,w=o===void 0?!1:o,j=(h?.length??0)>0;let v;if(e[0]!==p||e[1]!==x||e[2]!==j||e[3]!==c||e[4]!==h||e[5]!==s||e[6]!==g||e[7]!==b||e[8]!==r||e[9]!==w||e[10]!==m||e[11]!==u||e[12]!==f){const P=K(Dr,f==="default"&&"focus-visible:inset-ring-current");let S;e[14]!==c||e[15]!==g?(S=g?a.jsx(es,{size:"xs"}):c,e[14]=c,e[15]=g,e[16]=S):S=e[16];const k=a.jsxs(ve,{type:"button",variant:f,size:m,disabled:x,"aria-busy":g||void 0,onClick:g?void 0:r,className:K(P,j&&"rounded-r-none border-r border-current/20"),children:[S,s]}),N=w&&"animate-pulse-brightness motion-reduce:animate-none motion-reduce:opacity-80";let C;e[17]!==p||e[18]!==N?(C=K(N,p),e[17]=p,e[18]=N,e[19]=C):C=e[19],v=a.jsxs(Qi,{className:C,children:[u?a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx("span",{className:K("inline-flex rounded-lg outline-none",P,x&&"cursor-not-allowed"),tabIndex:x?0:void 0,role:x?"button":void 0,"aria-disabled":x||void 0,children:k})}),a.jsx(nt,{children:u})]}):k,j?a.jsxs(_s,{children:[a.jsx(Os,{asChild:!0,children:a.jsx(ve,{type:"button",variant:f,size:m,"aria-label":b,className:K("has-[>svg]:px-2",P),children:a.jsx(Ir,{className:"size-3.5"})})}),a.jsx(Ms,{align:"end",children:h?.map(Xi)})]}):null]}),e[0]=p,e[1]=x,e[2]=j,e[3]=c,e[4]=h,e[5]=s,e[6]=g,e[7]=b,e[8]=r,e[9]=w,e[10]=m,e[11]=u,e[12]=f,e[13]=v}else v=e[13];return v}function Xi(t){return a.jsx(Ji,{item:t},t.key)}async function Yi(t){if(t.hosted)return;const e=t.branch;await t.setCurrentTaskBranch(t.nextBranch()),e&&e!==t.baseBranch&&await t.deleteRelease(e)}function Zi(t,e,{hosted:s}){return s&&t!==null?t:e}function eo(t,e){const s=T.c(11),[r,n]=H.useState(null);let i;s[0]!==r||s[1]!==t||s[2]!==e?(i=Zi(r,t,e),s[0]=r,s[1]=t,s[2]=e,s[3]=i):i=s[3];let d;s[4]!==t||s[5]!==e?(d=()=>n(e.hosted?t:null),s[4]=t,s[5]=e,s[6]=d):d=s[6];let l;s[7]===Symbol.for("react.memo_cache_sentinel")?(l=()=>n(null),s[7]=l):l=s[7];let o;return s[8]!==i||s[9]!==d?(o={shown:i,hold:d,release:l},s[8]=i,s[9]=d,s[10]=o):o=s[10],o}function to({open:t,hosted:e}){return t||e}function ta(t){return Wl({userName:t?.name,userEmail:t?.email})??void 0}function Gs(t){const e=T.c(18),{state:s,header:r,body:n,note:i,gate:d,footer:l}=t,o=s!=="ready";let u;e[0]!==r?(u=a.jsx("div",{className:"space-y-0.5 px-4 py-3",children:r}),e[0]=r,e[1]=u):u=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx("div",{className:"border-t"}),e[2]=c):c=e[2];let h;e[3]!==i?(h=i?a.jsx("div",{className:"space-y-1.5 border-t px-4 py-3",children:i}):null,e[3]=i,e[4]=h):h=e[4];let b;e[5]!==n||e[6]!==h?(b=a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n,h]}),e[5]=n,e[6]=h,e[7]=b):b=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsx("div",{className:"border-t"}),e[8]=p):p=e[8];let f;e[9]!==l?(f=a.jsx("div",{className:"space-y-2 px-4 py-3",children:l}),e[9]=l,e[10]=f):f=e[10];let m;return e[11]!==d||e[12]!==s||e[13]!==o||e[14]!==u||e[15]!==b||e[16]!==f?(m=a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col","data-publish-state":s,"aria-busy":o,children:[u,c,b,d,p,f]}),e[11]=d,e[12]=s,e[13]=o,e[14]=u,e[15]=b,e[16]=f,e[17]=m):m=e[17],m}function hs(t){const e=T.c(2),{children:s}=t;let r;return e[0]!==s?(r=a.jsx("div",{className:"scroll-fade min-h-0 flex-1 space-y-3 overflow-y-auto overscroll-contain px-4 pt-3 pb-2 [scrollbar-width:thin]",children:s}),e[0]=s,e[1]=r):r=e[1],r}function sa(t){const e=T.c(10);let s,r,n;e[0]!==t?({className:r,children:s,...n}=t,e[0]=t,e[1]=s,e[2]=r,e[3]=n):(s=e[1],r=e[2],n=e[3]);let i;e[4]!==r?(i=K("rounded-lg border bg-card px-3 py-2.5",r),e[4]=r,e[5]=i):i=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==i?(d=a.jsx("div",{className:i,...n,children:s}),e[6]=s,e[7]=n,e[8]=i,e[9]=d):d=e[9],d}function We(t){const e=T.c(4),{className:s}=t;let r;e[0]!==s?(r=K("animate-pulse rounded bg-muted motion-reduce:animate-none",s),e[0]=s,e[1]=r):r=e[1];let n;return e[2]!==r?(n=a.jsx("div",{className:r}),e[2]=r,e[3]=n):n=e[3],n}function Bt(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(sa,{children:a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx(We,{className:"size-4 rounded-md"}),a.jsx(We,{className:"h-3 w-24"}),a.jsx(We,{className:"h-2.5 w-16"}),a.jsx(We,{className:"ml-auto size-6 rounded"})]})}),t[0]=e):e=t[0],e}const so="secret";function na(t){return t.kind!=="block"?null:t.namedRule??null}function no(t,e){const s=e.find(r=>r&&typeof r=="object");return s?$l(s.__resolveType):Ll(t)}const ro=/(?:^|\/)\.deco\/blocks\/([^/]+)\.json$/;function Tn(t){const e=ro.exec(t)?.[1];return e?bi(e):null}function Es(t){if(!t)return null;try{const e=JSON.parse(t);if(e&&typeof e=="object"&&!Array.isArray(e))return e}catch{}return null}function ao(t,e){return t===null?"new":e===null?"removed":"edited"}function ra(t){const e=t.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim();return e?(e.charAt(0).toUpperCase()+e.slice(1)).replace(/\s+[A-Z](?=[a-z])/g,s=>s.toLowerCase()):t}function Yt(t,e,s=!1){if(t&&typeof t=="object"&&!Array.isArray(t)){const r=t.__resolveType;if(typeof r=="string"&&r.trim()){if(s)return Ta(r);const i=(r.split("/").pop()??r).replace(/\.[jt]sx?$/,"");return ra(i)||i}}return`Section ${e+1}`}function Bn(t){if(hr(t))return t.value??null;const e=t.__resolveType;return typeof e=="string"&&Ba(e)?t.section??null:null}const aa=6;function Ps(t,e=0){if(e>aa||!t||typeof t!="object")return[];if(Array.isArray(t))return t.flatMap(n=>Ps(n,e+1));const s=t;if(un(s.__resolveType))return an(s).flatMap(n=>Ps(n?.value,e+1));const r=Bn(s);return r!==null?Ps(r,e+1):[s]}function an(t){const e=t?.variants;return Array.isArray(e)?e.map(s=>s&&typeof s=="object"&&!Array.isArray(s)?s:null):[]}function Qn(t){let e=t;for(let s=0;s<aa;s++){if(!e||typeof e!="object"||Array.isArray(e))return null;const r=e;if(un(r.__resolveType))return r;const n=Bn(r);if(n===null)return null;e=n}return null}function lo(t,e,s){const r=an(Qn(t)),n=e?an(Qn(e)):[],i=e?Array.from({length:Math.max(r.length,n.length)},(o,u)=>u).filter(o=>!Ws(r[o],n[o])):[],l=[...i.map(o=>r[o]??n[o]),...r.filter((o,u)=>!i.includes(u))].flatMap(o=>Ps(o?.value)).map(o=>Yt(o,s,!0));return[...new Set(l)]}function tn(t,e,s,r,n){let i=t,d=!1;for(let o=0;o<4;o++){if(!i||typeof i!="object"||Array.isArray(i)){d=!0;break}const u=i;if(un(u.__resolveType)){d=!0;break}const c=Bn(u);if(c===null)break;i=c}const l=d?lo(t,n,e):[];return{name:Yt(d?t:i,e,!0),kind:"section",status:s,fields:r,...d?{wrapper:!0}:{},...l.length>0?{held:l}:{}}}function ln(t,e){const s=t.sections;if(Array.isArray(s))return s.flatMap((r,n)=>r&&typeof r=="object"&&!Array.isArray(r)?[{section:r,basePath:["sections",n]}]:[]);if(s&&typeof s=="object"){const r=s.variants;if(Array.isArray(r))return r.flatMap((n,i)=>{const d=n&&typeof n=="object"&&!Array.isArray(n)?n.value:null,l=e&&hr(d),o=l?d.value:d;if(!Array.isArray(o))return[];const u=l?["sections","variants",i,"value","value"]:["sections","variants",i,"value"];return o.flatMap((c,h)=>c&&typeof c=="object"&&!Array.isArray(c)?[{section:c,basePath:[...u,h]}]:[])})}return[]}function Jn(t){return JSON.stringify(t,(e,s)=>{if(s&&typeof s=="object"&&!Array.isArray(s)){const r=s;return Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{})}return s})}function Ws(t,e){return t===void 0&&e===void 0?!0:Jn(t)===Jn(e)}function St(t,e,s,r=new Set){const n=new Set([...Object.keys(t??{}),...Object.keys(e??{})]),i=[];for(const d of n){if(d.startsWith("__")||r.has(d))continue;const l=t?t[d]:void 0,o=e?e[d]:void 0;Ws(l,o)||i.push({label:ra(d),path:[...s,d],from:l,to:o})}return i}function io(t,e){const s=e.find(r=>r&&typeof r=="object");return s?s.__resolveType===Jl:t===Xl}function oo(t,e){const s=n=>n===void 0||!!n&&typeof n=="object"&&!Array.isArray(n)&&!("__resolveType"in n),r=[];for(const n of St(t,e,[])){const i=String(n.path[0]);s(n.from)&&s(n.to)?r.push(...St(n.from??{},n.to??{},[i])):r.push(n)}return r}const co=new Set(["sections"]);function In(t,e,s=!1){const r=t?ln(t,s):[],n=e?ln(e,s):[],i=[],d=Math.max(r.length,n.length);for(let o=0;o<d;o++){const u=r[o],c=n[o];if(!s){const h=uo(u,c,o);h&&i.push(h);continue}if(u&&c){if(Ws(u.section,c.section))continue;i.push(tn(c.section,o,"edited",St(u.section,c.section,c.basePath),u.section))}else c?i.push(tn(c.section,o,"new",[])):u&&i.push(tn(u.section,o,"removed",[]))}const l=St(t,e,[],co);return l.length>0&&i.push({name:"Page settings",kind:"settings",status:"edited",fields:l}),i}function uo(t,e,s){return t&&e?Ws(t.section,e.section)?null:{name:Yt(e.section,s),kind:"section",status:"edited",fields:St(t.section,e.section,e.basePath)}:e?{name:Yt(e.section,s),kind:"section",status:"new",fields:[]}:t?{name:Yt(t.section,s),kind:"section",status:"removed",fields:[]}:null}function on(t,e){return{kind:"other",blockKey:null,name:t.split("/").pop()??t,pagePath:null,isSiteApp:!1,status:e,filepaths:[t],sections:[],fromJson:null,toJson:null}}function ho(t){const e=[],s=[],r=[],n=[];for(const[i,d]of Object.entries(t?.diffs??{})){if(kn(i)){n.push(i);continue}const l=ao(d.from,d.to),o=Tn(i);if(!o){r.push(on(i,l));continue}const u=Es(d.from),c=Es(d.to),h=c??u;if(!h){r.push(on(i,l));continue}const b=Xt(o,h);if(b){e.push({kind:"page",blockKey:o,name:b.name,pagePath:b.path,isSiteApp:!1,status:l,filepaths:[i],sections:l==="edited"?In(u,c):[],fromJson:u,toJson:c});continue}const p=wn(o,h);s.push({kind:"block",blockKey:o,name:$s(o,h),pagePath:null,isSiteApp:p,status:l,filepaths:[i],sections:l==="edited"?[{name:$s(o,h),kind:"section",status:"edited",fields:St(u,c,[])}].filter(f=>f.fields.length>0):[],fromJson:u,toJson:c})}return la({pages:e,blocks:s,other:r,generated:n})}function sn(t,e){return(t.filepaths[0]??"").localeCompare(e.filepaths[0]??"")}function la(t){const{pages:e,blocks:s,other:r,generated:n}=t;return e.sort(sn),s.sort(sn),r.sort(sn),{pages:e,blocks:s,other:r,generated:n,count:e.length+s.length+r.length}}function fo(t){return t==="added"?"new":t==="removed"?"removed":"edited"}function ia(t){return t.startsWith("pages-")}function oa(t){const{files:e,lookup:s,diff:r}=t,n=[],i=[],d=[],l=[];for(const o of e){const u=o.path;if(kn(u)){l.push(u);continue}const c=fo(o.status),h=Tn(u);if(!h){d.push(on(u,c));continue}const b=r?.diffs[u],p=Es(b?.from??null),f=Es(b?.to??null),m=ca(s,h),x=m??f??p;if((m?Xt(h,m):null)??(!m&&ia(h))){const j=x?Xt(h,x):null;n.push({kind:"page",blockKey:h,name:j?.name??Wr(h),pagePath:j?.path??null,isSiteApp:!1,status:c,filepaths:[u],sections:c==="edited"?In(p,f):[],fromJson:p,toJson:f??(c==="new"?m:null)});continue}const w=$s(h,x??{});i.push({kind:"block",blockKey:h,name:w,pagePath:null,isSiteApp:wn(h,m??{}),status:c,filepaths:[u],sections:c==="edited"?[{name:w,kind:"section",status:"edited",fields:St(p,f,[])}].filter(j=>j.fields.length>0):[],fromJson:p,toJson:f})}return la({pages:n,blocks:i,other:d,generated:l})}function ca(t,e){const s=t?.[e];return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function mo(t,e){return t??e}function da(t){return t.length<=1?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}const nn=3;function vs(t){if(t.length<=nn)return da(t);const e=t.length-nn;return`${t.slice(0,nn).join(", ")} and ${e} more`}function po(t,e){if(!e){const r=t.sections.filter(n=>n.kind==="section").map(n=>n.name).slice(0,3);return r.length>0?`${t.name} (${r.join(", ")})`:t.name}const s=[...new Set(t.sections.filter(r=>r.kind==="section").flatMap(r=>r.wrapper?r.held??[]:[r.name]))].slice(0,3);return s.length>0?`${t.name} (${s.join(", ")})`:t.name}function bo(t){const e=na(t);return e==="experiments"?"A/B tests":e==="campaigns"?"Campaign dates":t.name}function go(t){const e=[],s=t.pages.filter(l=>l.status==="edited"),r=t.pages.filter(l=>l.status==="new"),n=t.pages.filter(l=>l.status==="removed");if(s.length>0&&e.push(`updated ${vs(s.map(l=>po(l,!!t.v8)))}`),r.length>0){const l=r.length===1?"page":"pages";e.push(`added the ${vs(r.map(o=>o.name))} ${l}`)}if(n.length>0){const l=n.length===1?"page":"pages";e.push(`removed the ${vs(n.map(o=>o.name))} ${l}`)}const i=t.blocks.map(bo);if(i.length>0&&e.push(`changed ${vs(i)}`),t.other.length>0){const l=t.other.length===1?"file":"files";e.push(`changed ${t.other.length} ${l}`)}if(e.length===0)return"";const d=da(e);return Ql(d.charAt(0).toUpperCase()+d.slice(1))}function xo(t,e){return t?ln(t,e).length:0}function vo(t,e=!1){const s={newPageSections:t.kind==="page"&&t.status==="new"?xo(t.toJson,e):null,sections:0,settings:!1,fields:0};if(s.newPageSections!==null)return s;for(const r of t.sections){if(r.kind==="settings"){s.settings=!0;continue}t.kind==="page"?s.sections+=1:s.fields+=r.fields.length}return s}const Xn="••••••";function ts(t){if(Array.isArray(t))return t.map(ts);if(!t||typeof t!="object")return t;const e=t,s={};for(const[r,n]of Object.entries(e))s[r]=ts(n);return e.__resolveType===so&&"ciphertext"in e&&(s.ciphertext=Xn),Fa(e)&&"encrypted"in e&&(s.encrypted=Xn),s}function Yn(t){return t.map(e=>({...e,from:ts(e.from),to:ts(e.to)}))}function yo(t){const{changes:e,sides:s,lookup:r,meta:n,hosted:i}=t,d=[],l=[],o=c=>[...new Set((s?.diagnostics??[]).filter(h=>_n(Ia(h.file))===_n(c)).map(h=>h.side))],u=Object.keys(e).sort((c,h)=>c<h?-1:c>h?1:0);for(const c of u){const h=e[c],b=h.kind==="delete"?"removed":h.baseVersion===null?"new":"edited",p=s?.entries[c],f=p?.before??null,m=p?.after??null,x=ca(r,c),g=x??m??f,w=o(c),j={blockKey:c,status:b,filepaths:[],entry:{name:c,version:h.version},...w.length>0?{unreadable:w}:{},fromJson:ts(f),toJson:ts(m??(b==="new"?x:null))},v=x?Xt(c,x,n):null,P=!x&&g?Xt(c,g,n):null;if(v??P??(!g&&ia(c))){const y=g?Xt(c,g,n):null;d.push({...j,kind:"page",name:y?.name??Wr(c),pagePath:y?.path??null,isSiteApp:!1,sections:b==="edited"?In(f,m,!0).map(A=>({...A,fields:Yn(A.fields)})):[]});continue}const S=i?Il(c,g,x,m,f):null,k=S?Fl(S,[g,x,m,f]):$s(c,g??{}),N=no(c,[x,m,f]),C=io(c,[x,m,f]);l.push({...j,kind:"block",name:C?"Settings":k,...C?{cmsSettings:!0}:{},...S?{blogKind:S}:{},...N?{namedRule:N}:{},pagePath:null,isSiteApp:wn(c,x??g??{}),sections:b==="edited"?[{name:C?"Settings":k,kind:"section",status:"edited",fields:Yn(C?oo(f,m):St(f,m,[]))}].filter(y=>y.fields.length>0):[]})}return{pages:d,blocks:l,other:[],generated:[],count:d.length+l.length,v8:!0}}function ke(t){return t.filepaths[0]??t.blockKey??t.name}function jo(t,e){return e(t==="new"?"thread.publishPopover.chipNew":t==="removed"?"thread.publishPopover.chipRemoved":"thread.publishPopover.chipEdited")}function wo(t,e){const s=t.kind==="block"?ri:$r;return a.jsx("span",{title:jo(t.status,e),className:"flex shrink-0",children:a.jsx(s,{className:K("size-4",t.status==="new"&&"text-brand",t.status==="edited"&&"text-warning",t.status==="removed"&&"text-destructive")})})}function Po(t,e){if(t.kind==="page")return t.pagePath;if(t.kind!=="block")return null;if(t.blogKind)return El(t.blogKind,e);if(t.cmsSettings)return e("thread.publishPopover.settingsDetail");const s=na(t);return s==="experiments"?e("thread.publishPopover.abTests"):s==="campaigns"?e("thread.publishPopover.campaignDates"):t.isSiteApp?e("thread.publishPopover.siteConfiguration"):e("thread.publishPopover.globalSection")}function So(t,e,s){const r=vo(t,s);if(r.newPageSections!==null)return[r.newPageSections===1?e("thread.publishPopover.newPageSectionOne"):e("thread.publishPopover.newPageSections",{count:r.newPageSections})];const n=[];return r.sections===1?n.push(e("thread.publishPopover.sectionChangedOne")):r.sections>1&&n.push(e("thread.publishPopover.sectionsChanged",{count:r.sections})),r.fields===1?n.push(e("thread.publishPopover.fieldChangedOne")):r.fields>1&&n.push(e("thread.publishPopover.fieldsChanged",{count:r.fields})),r.settings&&n.push(e("thread.publishPopover.pageSettingsChanged")),n}function ua(t){const e=T.c(46),{change:s,bodyPending:r,selected:n,onSelect:i,confirming:d,onConfirmingChange:l,onDiscard:o,isPublishing:u,isDiscarding:c,v8:h}=t,b=r===void 0?!1:r,p=h===void 0?!1:h,f=me();let m;e[0]!==s||e[1]!==f?(m=Po(s,f),e[0]=s,e[1]=f,e[2]=m):m=e[2];const x=m;let g;if(e[3]!==b||e[4]!==s||e[5]!==d||e[6]!==x||e[7]!==c||e[8]!==u||e[9]!==l||e[10]!==o||e[11]!==i||e[12]!==n||e[13]!==f||e[14]!==p){const w=So(s,f,p),j=b&&w.length===0&&s.status==="edited",v=n&&"border-foreground/30 bg-accent hover:bg-secondary-hover";let P;e[16]!==v?(P=K("cursor-pointer transition-colors hover:bg-accent",v),e[16]=v,e[17]=P):P=e[17];let S;e[18]!==s?(S=ke(s),e[18]=s,e[19]=S):S=e[19];let k;e[20]!==s||e[21]!==f?(k=wo(s,f),e[20]=s,e[21]=f,e[22]=k):k=e[22];let N;e[23]!==s.cmsSettings||e[24]!==s.name||e[25]!==f?(N=s.cmsSettings?f("thread.publishPopover.settings"):s.name,e[23]=s.cmsSettings,e[24]=s.name,e[25]=f,e[26]=N):N=e[26];let C;e[27]!==N?(C=a.jsx("span",{className:"truncate text-sm font-medium",children:N}),e[27]=N,e[28]=C):C=e[28];let y;e[29]!==x?(y=x?a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:x}):null,e[29]=x,e[30]=y):y=e[30];let A;e[31]!==n||e[32]!==C||e[33]!==y?(A=a.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left","aria-pressed":n,children:[C,y]}),e[31]=n,e[32]=C,e[33]=y,e[34]=A):A=e[34];let D;e[35]!==d||e[36]!==c||e[37]!==u||e[38]!==l||e[39]!==o||e[40]!==f?(D=d?a.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[a.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground",onClick:O=>{O.stopPropagation(),l(!1)},children:f("thread.publishDialog.cancel")}),a.jsx("button",{type:"button",className:"text-xs font-medium text-destructive disabled:opacity-50",onClick:O=>{O.stopPropagation(),l(!1),o?.()},disabled:c,children:f("thread.publishPopover.discard")})]}):o?a.jsx(Us,{children:a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx(ve,{type:"button",variant:"ghost-destructive",size:"icon-xs","aria-label":f("thread.publishPopover.discard"),className:"shrink-0 disabled:pointer-events-auto",onClick:O=>{O.stopPropagation(),l(!0)},disabled:u||c,children:a.jsx(qs,{className:"size-3.5"})})}),a.jsx(nt,{children:f("thread.publishPopover.discard")})]})}):null,e[35]=d,e[36]=c,e[37]=u,e[38]=l,e[39]=o,e[40]=f,e[41]=D):D=e[41];let I;e[42]!==A||e[43]!==D||e[44]!==k?(I=a.jsxs("div",{className:"flex items-center gap-2.5",children:[k,A,D]}),e[42]=A,e[43]=D,e[44]=k,e[45]=I):I=e[45],g=a.jsxs(sa,{className:P,"data-change-id":S,onClick:i,children:[I,w.length>0?a.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px] text-xs text-muted-foreground",children:w.map(ko)}):j?a.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px]",children:a.jsx(We,{className:"h-4 w-2/3"})}):null]}),e[3]=b,e[4]=s,e[5]=d,e[6]=x,e[7]=c,e[8]=u,e[9]=l,e[10]=o,e[11]=i,e[12]=n,e[13]=f,e[14]=p,e[15]=g}else g=e[15];return g}function ko(t,e){return a.jsx("div",{className:"truncate",children:t},`${e}-${t}`)}function ha(){const t=T.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={width:-1,height:-1},t[0]=e):e=t[0];const[s,r]=H.useState(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=l=>{if(!l)return;const o=()=>r(c=>c.width===l.clientWidth&&c.height===l.clientHeight?c:{width:l.clientWidth,height:l.clientHeight});o();const u=new ResizeObserver(o);return u.observe(l),()=>u.disconnect()},t[1]=n):n=t[1];const i=n;let d;return t[2]!==s?(d=[s,i],t[2]=s,t[3]=d):d=t[3],d}function No(){return document.documentElement.classList.contains("dark")?"vs-dark":"vs"}const Co=[{width:"w-3/4",tone:"ctx"},{width:"w-1/2",tone:"del"},{width:"w-3/5",tone:"add"},{width:"w-2/5",tone:"ctx"},{width:"w-4/5",tone:"add"},{width:"w-1/2",tone:"ctx"}];function Zn(t){const e=T.c(10),{height:s}=t,r=me();let n;e[0]!==s?(n={height:s},e[0]=s,e[1]=n):n=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=Co.map(Ao),e[2]=i):i=e[2];let d;e[3]!==r?(d=r("thread.publishDialog.openingComparison"),e[3]=r,e[4]=d):d=e[4];let l;e[5]!==d?(l=a.jsx("div",{className:"flex items-center justify-center pt-1 text-2xs text-muted-foreground",children:d}),e[5]=d,e[6]=l):l=e[6];let o;return e[7]!==n||e[8]!==l?(o=a.jsxs("div",{style:n,className:"flex w-full flex-col gap-1.5 overflow-hidden px-3 py-2",children:[i,l]}),e[7]=n,e[8]=l,e[9]=o):o=e[9],o}function Ao(t,e){return a.jsxs("div",{className:K("flex items-center gap-2 rounded px-1 py-0.5",t.tone==="del"&&"bg-destructive/5",t.tone==="add"&&"bg-success/5"),children:[a.jsx("div",{className:K("h-2 w-4 shrink-0 animate-pulse rounded-sm bg-muted",t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")}),a.jsx("div",{className:K("h-2 animate-pulse rounded-sm bg-muted",t.width,t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")})]},e)}const fa={readOnly:!0,renderSideBySide:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12},Ro={...fa,lineNumbersMinChars:3,lineDecorationsWidth:4,folding:!1,glyphMargin:!1,renderOverviewRuler:!1};function Do(t){const e=T.c(11),{diff:s,emptyMessage:r,rowClassName:n,onDiscardFile:i,hideFileRows:d,editorHeight:l}=t,o=r===void 0?"No file changes in the working tree":r,u=n===void 0?"px-6":n,c=d===void 0?!1:d,h=l===void 0?"380px":l,[b,p]=H.useState(null),[f,m]=H.useState(null);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=No(),e[0]=x):x=e[0];const g=x;if(!s||Object.keys(s.diffs).length===0){let j;return e[1]!==o?(j=a.jsx("div",{className:"flex items-center justify-center py-10 text-sm text-muted-foreground",children:o}),e[1]=o,e[2]=j):j=e[2],j}let w;return e[3]!==s.diffs||e[4]!==f||e[5]!==h||e[6]!==b||e[7]!==c||e[8]!==i||e[9]!==u?(w=a.jsx("div",{className:"divide-y",children:Object.entries(s.diffs).map(j=>{const[v,P]=j,{from:S,to:k}=P,N=b===v,C=S===null,y=k===null,A=v.startsWith("/")?v.slice(1):v,D=A.lastIndexOf("/"),I=D>=0?A.slice(D+1):A,O=D>=0?A.slice(0,D):null,F=gi(v),q=C?"bg-success":y?"bg-destructive":"bg-warning";return c?a.jsx("div",{children:a.jsx(Kn,{original:S??"",modified:k??"",language:F,theme:g,height:h,loading:a.jsx(Zn,{height:h}),options:Ro})},v):a.jsxs("div",{children:[a.jsxs("div",{className:K("flex items-center gap-3 py-3 hover:bg-accent",u),children:[a.jsx("button",{type:"button",className:"flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground transition-transform hover:text-foreground",onClick:()=>p(N?null:v),children:a.jsx(dr,{className:K("h-3.5 w-3.5 transition-transform",N&&"rotate-90")})}),a.jsx("div",{className:K("h-2.5 w-2.5 shrink-0 rounded-full",q)}),a.jsx($r,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:I}),O&&a.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:O}),i?a.jsxs(_s,{children:[a.jsx(Os,{asChild:!0,children:a.jsx("button",{type:"button",className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground hover:bg-accent hover:text-foreground rounded-lg",children:a.jsx($a,{className:"h-3.5 w-3.5"})})}),a.jsx(Ms,{align:"end",children:a.jsx(Zt,{className:"text-destructive focus:text-destructive",onSelect:()=>m(v),children:"Discard changes"})})]}):null]}),f===v&&i?a.jsxs("div",{className:K("flex items-center justify-between gap-3 border-t bg-destructive/5 py-2.5",u),children:[a.jsxs("span",{className:"text-xs text-destructive",children:["Discard all changes to"," ",a.jsx("span",{className:"font-medium",children:I}),"? This cannot be undone."]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[a.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>m(null),children:"Cancel"}),a.jsx(ve,{type:"button",variant:"destructive",size:"sm",onClick:()=>{m(null),i(v)},children:"Discard"})]})]}):null,N&&a.jsx("div",{className:"border-t",children:a.jsx(Kn,{original:S??"",modified:k??"",language:F,theme:g,height:h,loading:a.jsx(Zn,{height:h}),options:fa})})]},v)})}),e[3]=s.diffs,e[4]=f,e[5]=h,e[6]=b,e[7]=c,e[8]=i,e[9]=u,e[10]=w):w=e[10],w}function To(t){if(t.kind!=="block"||t.isSiteApp||!t.blockKey)return null;const e=(t.toJson??t.fromJson)?.__resolveType;return typeof e=="string"&&Ol(e)?t.blockKey:null}function Bo(t){return t.kind!=="page"?!0:!t.pagePath||Pt(t.pagePath).length>0}function Io(t,e){try{return Ga(t,_l,e)}catch{return null}}function Fo(t,e,s){if(!e)return;const r=Ml(e,t);if(!r)return null;if(Pt(r.path).length===0||s?.path!==r.path)return r.path;const n=Pn(r.path,s.params);return Pt(n).length===0?n:r.path}function $o(t){return t.sectionKey&&!t.v8?Io(t.previewServerUrl,t.sectionKey):Eo(t.previewServerUrl,t.path)}function Lo(t,e){if(t.kind!=="page")return"/";const s=t.pagePath;if(!s)return"";if(Pt(s).length===0)return s;if(e?.path!==s)return"";const r=Pn(s,e.params);return Pt(r).length===0?r:""}function Eo(t,e){const s=e.trim();if(!s||Pt(s).length>0)return null;try{const r=new URL(t),n=new URL(s.startsWith("/")?s:`/${s}`,r);return n.origin===r.origin?n:null}catch{return null}}function Oo(t,e){return e?.kind==="pointer"&&e.link?gn(t.toString(),e.link):ma(t,e)}function ma(t,e){if(!e)return null;if(e.kind==="pointer")return gn(t.toString(),e.pointer);try{return new URL(`${t.pathname}${t.search}`,e.previewUrl).href}catch{return null}}function Mo(t,e,s){return e===null?!1:t!=="other"||s?.kind==="sandbox"}function _o(t,e){const s=e?t.kind==="page":t.kind!=="other";return{before:s&&t.status==="new"?"new":null,after:s&&t.status==="removed"?"removed":null}}const pa=H.createContext(!0),zo=["split","before","after","code"];function Uo(t){return zo.includes(t)}const ba={desktop:1280,mobile:412};function Ho(t,e){const s=(i,d)=>t.unreadable?.includes(d)?e:i?`${JSON.stringify(i,null,2)}
|
|
1
|
+
import{c as T,b as me,r as H,j as a,B as ve,m as K,K as ns,al as Ca,t as et,fd as Aa,as as dr,ed as ur,Y as Zt,c6 as Ra,aH as ks,aI as Ns,aJ as Cs,aK as As,bj as Rs,aL as Ds,aM as Ts,aN as Bs,X as Os,Z as Ms,_ as _s,a as zs,a5 as rs,ct as Da,h as es,ff as hr,fg as un,bJ as Ta,b8 as Ba,bh as _n,fh as Ia,c0 as Fa,am as $a,I as La,a8 as Ea,fi as Oa,V as fr,i as ft,eR as hn,q as mr,J as pr,D as br,x as gr,v as xr,Q as vr,R as yr,fj as Ma,bk as jr,a6 as fn,b3 as mn,e as zn,E as _a,T as za,n as Xs,bi as Ua}from"./index-DWvRfTwV.js";import{S as Ha}from"./separator-PY5RFBB-.js";import{f as qa,u as It,r as wr,l as Pr,c as Sr,b as Ka}from"./chat-context-yHOaM07v.js";import{u as kt,aq as Va,ar as kr,as as Nr,c as pn,b as bn,L as gn,at as Ga,K as Wa,au as Qa,ae as Ja,av as Xa,S as xn,R as Cr,aw as Ya,a0 as Ar,F as Za,ax as el,ay as tl,B as Rr,l as sl,E as nl}from"./site-editor-toast-B-FxlfJP.js";import{b as rl,L as al,a as ll}from"./shell-layout-Bx4AZ_YV.js";import{I as Dr}from"./toolbar-icon-button-CRZySHtx.js";import{b as il,P as ol,a as cl}from"./popover-CpDRMXBS.js";import{c as tt,T as st,a as nt,b as Us}from"./tooltip-BVv5wAeF.js";import{f as dl,a as ul,c as hl,C as Un,e as Hn,b as qn}from"./command-CSFENWMV.js";import{T as Tt,a as Tr,c as Br}from"./tabs-BFXzZPNk.js";import{t as Ir}from"./ChevronUp-CDe5Gfov.js";import{X as Fr,aL as Hs,D as fl,a as $r,aM as ml,b as pl,aN as Lr,K as bl}from"./agent-icon-Nkid6y9z.js";import{a as Er}from"./SwitchHorizontal01-C3qdjyVX.js";import{c as Or,s as Is}from"./Tool01-CyX9Nllj.js";import{s as Mr}from"./Plus-BtfY7EHX.js";import{s as qs}from"./Trash01-DSJ1LUhI.js";import{m as gl,d as xl}from"./thread-intent-BONVdhUb.js";import{h as _r,r as zr,g as vl,e as Oe,u as Ks,f as Ur}from"./repository-binding-CeErFm4l.js";import{u as yl}from"./use-debounced-value-DiJ2aJN8.js";import{u as jl}from"./useInfiniteQuery-DAm-dYuC.js";import{d as wl,b as Pl,p as Sl,e as Hr,g as qr,h as Kr}from"./use-navigate-to-agent-9BOtBFjV.js";import{u as Vs,g as vn,n as us,b as Vr,a as kl,d as Nl,e as Cl,r as ds,f as Al,s as Rl,h as xs,c as yn}from"./cms-store-drafts-BRph2qKQ.js";import{a as Fs}from"./virtual-mcp-D-xL-K_P.js";import{a as fs}from"./input-Lv9puCyJ.js";import{u as jn,c as Dl}from"./agent-capabilities-4Kae1N0E.js";import{G as Gr}from"./github-icon-Bvc_Uep-.js";import{u as Tl,a as Bl}from"./use-fast-preview-draft-url-CO3Nwa6o.js";import{av as Xt,aw as Wr,E as $s,q as wn,ax as Il,ay as Fl,H as $l,az as Ll,aA as El,aB as Ol,p as Ml,z as Pt,f as Pn,aC as _l,$ as zl,i as Ul,u as Hl,k as ql,S as Kl}from"./blocks-tab-states-DP3rjaHt.js";import{u as Vl}from"./index-BtlZo3IV.js";import{T as Gl}from"./textarea-BVq0fBVJ.js";import{i as Sn}from"./CheckCircle-y3P873c6.js";import{n as Wl,s as Ql,C as Jl,a as Xl,b as Yl,M as Zl,c as ei,d as ti,m as si,u as ni}from"./use-cms-publish-actions-CgLBJwXN.js";import{a as ri,g as ai}from"./UserSquare-DmeGszKa.js";import{i as kn,b as Nn,m as li,h as ii,c as Qr,f as Jr,d as oi,r as Cn,e as ci,n as di,g as ui,j as hi,k as fi,l as An,o as mi,p as Xr,q as pi,s as Rn,t as Ys}from"./sandbox-git-api-DcqI6XE4.js";import{b as bi,g as gi}from"./utils-B-ZZ1C4f.js";import{i as xi}from"./Monitor01-DWylBoOJ.js";import{w as Dn,R as Yr}from"./device-hint-B0gKGTHi.js";import{w as Kn}from"./editor-CrG4V3zO.js";import{s as Zr}from"./save-changes-debug-nBi-n9eV.js";import{u as vi}from"./use-mcp-client-Z8a6jg-w.js";import{b as yi,a as ji}from"./sandbox-lifecycle-context-CuiD9fGV.js";import{b as wi}from"./thread-route-DMWye38f.js";import{E as Pi}from"./empty-state-CVOGmYU9.js";import{a as Si}from"./autosend-DbfDzqlB.js";function ki(t){const{value:e,baseBranch:s,releases:r,baseIsDraft:n=!1,storeDrafts:i=[]}=t,d=!n&&!!e&&e===s,l=r.find(c=>c.branch===e),o=d||l?void 0:i.find(c=>c.name===e),u=!d&&!l&&!o&&!!e;return o?{isBase:d,current:l,storeDraft:o,unlisted:u}:{isBase:d,current:l,unlisted:u}}const Ni={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "},Vn=1114111;function Gn(t){return t?t.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(e,s)=>{if(s.startsWith("#x")||s.startsWith("#X")){const r=Number.parseInt(s.slice(2),16);return!Number.isFinite(r)||r>Vn?e:String.fromCodePoint(r)}if(s.startsWith("#")){const r=Number.parseInt(s.slice(1),10);return!Number.isFinite(r)||r>Vn?e:String.fromCodePoint(r)}return Ni[s]??e}):""}function Ci(t){const e=T.c(39),{url:s,onSave:r}=t,n=me(),[i,d]=H.useState(s??"");let l;e[0]!==i?(l=i.trim(),e[0]=i,e[1]=l):l=e[1];const o=l;let u;e[2]!==r||e[3]!==o?(u=()=>r(o?gl(o):null),e[2]=r,e[3]=o,e[4]=u):u=e[4];const c=u;let h;e[5]!==n?(h=n("thread.branchPicker.localHint"),e[5]=n,e[6]=h):h=e[6];let b;e[7]!==h?(b=a.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[7]=h,e[8]=b):b=e[8];let p;e[9]!==n?(p=n("thread.branchPicker.localUrlLabel"),e[9]=n,e[10]=p):p=e[10];let f;e[11]!==n?(f=n("thread.branchPicker.localUrlPlaceholder"),e[11]=n,e[12]=f):f=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=N=>d(N.target.value),e[13]=m):m=e[13];let x;e[14]!==c||e[15]!==o?(x=N=>{N.key==="Enter"&&o&&c()},e[14]=c,e[15]=o,e[16]=x):x=e[16];let g;e[17]!==p||e[18]!==f||e[19]!==x||e[20]!==i?(g=a.jsx("input",{type:"url",inputMode:"url","aria-label":p,placeholder:f,value:i,onChange:m,onKeyDown:x,className:"h-8 w-full rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[17]=p,e[18]=f,e[19]=x,e[20]=i,e[21]=g):g=e[21];let w;e[22]!==r||e[23]!==n||e[24]!==s?(w=s?a.jsx(ve,{variant:"ghost",size:"sm",className:"text-xs text-destructive hover:text-destructive",onClick:()=>r(null),children:n("thread.branchPicker.localTurnOff")}):a.jsx("span",{}),e[22]=r,e[23]=n,e[24]=s,e[25]=w):w=e[25];const j=!o;let v;e[26]!==n?(v=n("thread.branchPicker.save"),e[26]=n,e[27]=v):v=e[27];let P;e[28]!==c||e[29]!==j||e[30]!==v?(P=a.jsx(ve,{size:"sm",disabled:j,onClick:c,children:v}),e[28]=c,e[29]=j,e[30]=v,e[31]=P):P=e[31];let S;e[32]!==w||e[33]!==P?(S=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[w,P]}),e[32]=w,e[33]=P,e[34]=S):S=e[34];let k;return e[35]!==S||e[36]!==b||e[37]!==g?(k=a.jsxs("div",{className:"flex flex-col gap-2 p-2",children:[b,g,S]}),e[35]=S,e[36]=b,e[37]=g,e[38]=k):k=e[38],k}function Ai(t){const e=T.c(8),{virtualMcpId:s,branch:r,serve:n,rowRef:i,onPicked:d}=t,l=kt(s,r),o=!!n.connection,u=o&&l.kind==="protocol"&&l.source==="local";let c;e[0]!==d||e[1]!==n?(c=()=>Ri(n,d),e[0]=d,e[1]=n,e[2]=c):c=e[2];let h;return e[3]!==i||e[4]!==o||e[5]!==u||e[6]!==c?(h=a.jsx(Di,{rowRef:i,selected:o,connected:u,onSelect:c}),e[3]=i,e[4]=o,e[5]=u,e[6]=c,e[7]=h):h=e[7],h}function Ri(t,e){e?.(),!t.connection&&t.set({endpoint:t.lastEndpoint??Va})}function Di(t){const e=T.c(19),{rowRef:s,selected:r,connected:n,onSelect:i}=t,d=me(),l=r?"bg-accent":"hover:bg-accent";let o;e[0]!==l?(o=K("flex rounded-lg",l),e[0]=l,e[1]=o):o=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx("span",{"data-testid":"localhost-dot",className:"h-2 w-2 shrink-0 rounded-full bg-foreground"}),e[2]=u):u=e[2];let c;e[3]!==d?(c=d("thread.branchPicker.localhost.label"),e[3]=d,e[4]=c):c=e[4];let h;e[5]!==c?(h=a.jsx("span",{className:"min-w-0 flex-1 truncate",children:c}),e[5]=c,e[6]=h):h=e[6];let b;e[7]!==n||e[8]!==d?(b=n&&a.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:d("thread.branchPicker.localhost.connected")}),e[7]=n,e[8]=d,e[9]=b):b=e[9];let p;e[10]!==i||e[11]!==r||e[12]!==h||e[13]!==b?(p=a.jsxs("button",{type:"button","aria-pressed":r,onClick:i,className:"flex w-full min-w-0 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[u,h,b]}),e[10]=i,e[11]=r,e[12]=h,e[13]=b,e[14]=p):p=e[14];let f;return e[15]!==s||e[16]!==o||e[17]!==p?(f=a.jsx("div",{ref:s,className:o,children:p}),e[15]=s,e[16]=o,e[17]=p,e[18]=f):f=e[18],f}const Ti=10080*60*1e3;function Bi({sandboxMap:t,userId:e,rawBranches:s,now:r}){const n=new Map;for(const[h,b]of Object.entries(t??{}))for(const[p,f]of Object.entries(b??{})){let m=n.get(p);m||(m={userIds:new Set,lastActiveAt:0},n.set(p,m)),m.userIds.add(h);for(const x of Object.values(f??{})){const g=x?.createdAt??0;g>m.lastActiveAt&&(m.lastActiveAt=g)}}const i=r-Ti,d=[...n.entries()].filter(([,h])=>h.lastActiveAt>=i).sort((h,b)=>b[1].lastActiveAt-h[1].lastActiveAt).map(([h,b])=>({name:h,source:"recent",contributors:[...b.userIds],lastActiveAt:b.lastActiveAt})),l=new Set(d.map(h=>h.name)),o=new Set(Object.keys(t?.[e]??{})),u=[...o].filter(h=>!l.has(h)).sort().map(h=>({name:h,source:"yours"})),c=s.filter(h=>!o.has(h.name)&&!l.has(h.name)).map(h=>({name:h.name,source:"other",author:h.author??null}));return{recent:d,yours:u,others:c}}const Ii=100,Fi=50,$i=300;function rn(t,e){const s=e.trim().toLowerCase();return s?t.toLowerCase().includes(s):!0}function Li(t){const e=T.c(39),{orgId:s,orgSlug:r,userId:n,target:i,sandboxMap:d,owner:l,repo:o,search:u,enabled:c}=t,h=u===void 0?"":u,b=c===void 0?!0:c;let p;e[0]!==h?(p=h.trim(),e[0]=h,e[1]=p):p=e[1];const f=p,m=yl(f,$i);let x;e[2]!==i?(x=_r(i),e[2]=i,e[3]=x):x=e[3];const g=x,w=f.length>0;let j;e[4]!==m||e[5]!==s||e[6]!==r||e[7]!==l||e[8]!==o||e[9]!==i?(j=ns.githubBranchSearch(s,r,zr(i),l,o,m),e[4]=m,e[5]=s,e[6]=r,e[7]=l,e[8]=o,e[9]=i,e[10]=j):j=e[10];const v=b&&g;let P;e[11]!==m||e[12]!==r||e[13]!==i?(P=B=>{const{pageParam:Z}=B;return Ca(r,"REPOSITORY_SEARCH_BRANCHES",{...i,query:m,limit:m?Fi:Ii,cursor:Z})},e[11]=m,e[12]=r,e[13]=i,e[14]=P):P=e[14];let S;e[15]!==m?(S=B=>m?void 0:B.nextCursor??void 0,e[15]=m,e[16]=S):S=e[16];let k;e[17]!==j||e[18]!==v||e[19]!==P||e[20]!==S?(k={queryKey:j,enabled:v,staleTime:3e4,retry:!1,initialPageParam:null,queryFn:P,getNextPageParam:S},e[17]=j,e[18]=v,e[19]=P,e[20]=S,e[21]=k):k=e[21];const{data:N,isLoading:C,isError:y,isFetching:A,hasNextPage:D,isFetchingNextPage:I,fetchNextPage:O}=jl(k),F=w&&(m!==f||A),q=(N?.pages??[]).flatMap(Ei),E=rl(6e4),G=Bi({sandboxMap:d,userId:n,rawBranches:q,now:E});let _;e[22]!==f?(_=B=>rn(B.name,f),e[22]=f,e[23]=_):_=e[23];const W=G.recent.filter(_);let $;e[24]!==f?($=B=>rn(B.name,f),e[24]=f,e[25]=$):$=e[25];const V=G.yours.filter($),te=G.others,X=N?.pages[0],ne=w&&X&&!F?Math.max(0,X.totalCount-X.branches.length):0,le=!w&&D;let M;e[26]!==O?(M=()=>{O()},e[26]=O,e[27]=M):M=e[27];let Y;return e[28]!==ne||e[29]!==y||e[30]!==I||e[31]!==C||e[32]!==F||e[33]!==te||e[34]!==W||e[35]!==le||e[36]!==M||e[37]!==V?(Y={recent:W,yours:V,others:te,isLoading:C,isError:y,isSearching:F,hiddenMatchCount:ne,hasMore:le,isFetchingMore:I,fetchMore:M},e[28]=ne,e[29]=y,e[30]=I,e[31]=C,e[32]=F,e[33]=te,e[34]=W,e[35]=le,e[36]=M,e[37]=V,e[38]=Y):Y=e[38],Y}function Ei(t){return t.branches}function Oi(t){const e=T.c(6),s=me(),{releases:r,createRelease:n}=Vs(t.virtualMcpId);let i;return e[0]!==n||e[1]!==t.userId||e[2]!==t.userLabel||e[3]!==r||e[4]!==s?(i=()=>{if(r.length>=Fs)return et.error(s("thread.branchPicker.capReached",{max:Fs})),null;const d=vn(t.userLabel);return n({branch:d,name:Vr(r,s("thread.branchPicker.defaultVersionName")),color:us(r.length),createdBy:t.userId,createdAt:new Date().toISOString()}).catch(l=>{et.error(s("thread.branchPicker.saveError"),{description:kr(s,Nr(l))})}),d},e[0]=n,e[1]=t.userId,e[2]=t.userLabel,e[3]=r,e[4]=s,e[5]=i):i=e[5],i}const Ls="-mx-[3px] h-3.5 w-3.5 shrink-0";function Mi(t){const e=T.c(110),{virtualMcpId:s,isV8:r,userLabel:n,value:i,baseBranch:d,baseIsDraft:l,orgId:o,orgSlug:u,userId:c,target:h,owner:b,repo:p,sandboxMap:f,onChange:m,onCreateBranch:x,onAdoptBranch:g,disabled:w,spawnsNewChat:j,placement:v}=t,P=r===void 0?!1:r,S=l===void 0?!1:l,k=w===void 0?!1:w,N=j===void 0?!1:j,C=v===void 0?"chat":v,y=me(),A=C==="header",[D,I]=H.useState(!1),[O,F]=H.useState(!1),[q,E]=H.useState("branches"),[G,_]=H.useState(null),[W,$]=H.useState(""),[V,te]=H.useState(null),[X,ne]=H.useState(null),le=H.useRef(null),{releases:M,createRelease:Y,renameRelease:B,deleteRelease:Z}=Vs(s);let se;e[0]!==c||e[1]!==n||e[2]!==s?(se={virtualMcpId:s,userLabel:n,userId:c},e[0]=c,e[1]=n,e[2]=s,e[3]=se):se=e[3];const ie=Oi(se),ge=kl(s,P),ue=P?Nl(M,ge.data):[],re=ge.refetch,fe=Cl(s),{url:ye,setUrl:z,clear:oe}=pn(s),xe=bn(s),Q=P&&!!xe.connection,ee=P?xe.connection?.endpoint??null:ye,ce=!!ee;let J;e[4]!==oe||e[5]!==P||e[6]!==xe?(J=()=>{oe(),P&&xe.clear()},e[4]=oe,e[5]=P,e[6]=xe,e[7]=J):J=e[7];const de=J;let Me;e[8]!==D?(Me={enabled:D},e[8]=D,e[9]=Me):Me=e[9];const{data:mt}=Aa(Me);let we;e[10]!==mt?.data?.members?(we=R=>R?mt?.data?.members?.find(be=>be.userId===R)?.user?.name??void 0:void 0,e[10]=mt?.data?.members,e[11]=we):we=e[11];const rt=we,Le=M.length>=Fs,Re=M.length>1,De=y("thread.branchPicker.capReached",{max:Fs}),{isBase:_e,current:Ne,storeDraft:at,unlisted:ze}=ki({value:i,baseBranch:d,releases:M,baseIsDraft:S,storeDrafts:ue}),$t=_e?y("thread.branchPicker.live"):Ne?.name??at?.name??y("thread.branchPicker.defaultVersionName"),Ee=Q?y("thread.branchPicker.localhost.label"):ce?y("thread.branchPicker.localLabel"):i?$t:y("thread.branchPicker.selectVersion"),Qe=Q?"bg-foreground":ce?"bg-special":_e?"bg-success":at?ds(void 0):ds(Ne?.color??"orange"),L=!Q&&!ce&&!_e&&Ne?.runtime==="sandbox",pe=R=>{de();const be=ue.some(Ve=>Ve.name===R)?{runtime:"cms"}:M.find(Ve=>Ve.branch===R);m(R,be&&{runtime:be.runtime}),I(!1)};let Pe;e[12]!==y?(Pe=R=>{et.error(y("thread.branchPicker.saveError"),{description:kr(y,Nr(R))})},e[12]=y,e[13]=Pe):Pe=e[13];const Se=Pe;let Te;e[14]!==z?(Te=R=>{z(R),F(!1),I(!1)},e[14]=z,e[15]=Te):Te=e[15];const pt=Te,bt=(R,be)=>{if(de(),g){g(R),F(!1),I(!1);return}if(!M.some(Ve=>Ve.branch===R)){if(Le){et.error(De);return}Y({branch:R,name:be.trim()||R,color:us(M.length),createdBy:c,createdAt:new Date().toISOString()}).catch(Se)}m(R),F(!1),I(!1)};let lt;e[16]!==de||e[17]!==m||e[18]!==x||e[19]!==ie?(lt=()=>{const R=ie();R&&(de(),(x??m)(R),I(!1))},e[16]=de,e[17]=m,e[18]=x,e[19]=ie,e[20]=lt):lt=e[20];const as=lt;let gt;e[21]===Symbol.for("react.memo_cache_sentinel")?(gt=()=>{_(null),$(""),F(!1),E("branches")},e[21]=gt):gt=e[21];const ls=gt;let it;e[22]===Symbol.for("react.memo_cache_sentinel")?(it=R=>{E(R),F(!0)},e[22]=it):it=e[22];const Ce=it;let ot;e[23]===Symbol.for("react.memo_cache_sentinel")?(ot=R=>{_(R.branch),$(R.name)},e[23]=ot):ot=e[23];const Lt=ot;let xt;e[24]!==W||e[25]!==B||e[26]!==Se?(xt=R=>{const be=W.trim();be&&B(R,be).catch(Se),_(null),$("")},e[24]=W,e[25]=B,e[26]=Se,e[27]=xt):xt=e[27];const Qs=xt,Et=R=>{const be=R===void 0?i:R,Ve=W.trim();if(Ve&&be){if(Le){et.error(De),_(null),$("");return}Y({branch:be,name:Ve,color:us(M.length),createdBy:c,createdAt:new Date().toISOString()}).catch(Se)}_(null),$("")};let Je;e[28]===Symbol.for("react.memo_cache_sentinel")?(Je=()=>{_(null),$("")},e[28]=Je):Je=e[28];const ct=Je,Nt=()=>{const R=V;if(te(null),!(!R||!Re)){if(R.branch===i){const be=M.filter(Na=>Na.branch!==R.branch),Ve=be.find(_i)??be[0];Ve?pe(Ve.branch):I(!1)}else I(!1);Z(R.branch).catch(Se)}},dt=Al(M),is=(dt.content.length>0||ue.length>0)&&dt.code.length>0,vt=R=>G===R.branch?a.jsx(Zs,{value:W,onChange:$,onSave:()=>Qs(R.branch),onCancel:ct},R.branch):a.jsx(en,{rowRef:!ce&&R.branch===i?le:void 0,dot:ds(R.color),codeIcon:R.runtime==="sandbox"?xs(R.color):void 0,label:R.name,creator:rt(R.createdBy),originTooltip:P?y("thread.branchPicker.viaStudioUi"):void 0,branch:!P||R.runtime==="sandbox"?R.branch:void 0,selected:!ce&&R.branch===i,onSelect:()=>pe(R.branch),onRename:()=>Lt(R),onDelete:()=>te(R),deleteBlocked:!Re},R.branch),Ct=()=>{const R=X;if(ne(null),!(!R||R.name===i&&M.length===0)){if(R.name===i){const be=M[0];be?pe(be.branch):I(!1)}fe.mutateAsync(R.name).catch(be=>{et.error(y("thread.branchPicker.discardStoreDraftError"),{description:be instanceof Error?be.message:void 0})})}},At=ue.map((R,be)=>G===R.name?a.jsx(Zs,{value:W,onChange:$,onSave:()=>Et(R.name),onCancel:ct},`store:${R.name}`):a.jsx(en,{rowRef:!ce&&R.name===i?le:void 0,dot:ds(void 0),label:R.name,creator:rt(R.createdBy),agentIcon:xs(us(be)),originTooltip:y("thread.branchPicker.storeDraftVia",{via:Rl(R.via)}),selected:!ce&&R.name===i,onSelect:()=>pe(R.name),onRename:()=>{_(R.name),$(R.name)},onDelete:()=>ne(R),deleteBlocked:R.name===i&&M.length===0},`store:${R.name}`));let yt;e[29]!==k||e[30]!==P||e[31]!==re?(yt=k?void 0:R=>{R?P&&re():ls(),I(R)},e[29]=k,e[30]=P,e[31]=re,e[32]=yt):yt=e[32];const Rt=A?"text-xs":"text-xs text-muted-foreground hover:text-foreground";let Xe;e[33]!==Rt?(Xe=K("shrink min-w-0 max-w-[220px] gap-2",Rt,Dr),e[33]=Rt,e[34]=Xe):Xe=e[34];let jt;e[35]!==k?(jt=!k&&a.jsx(Ir,{size:12,className:"opacity-60 shrink-0"}),e[35]=k,e[36]=jt):jt=e[36];let ut;e[37]!==Ee?(ut=a.jsx(nt,{children:Ee}),e[37]=Ee,e[38]=ut):ut=e[38];const Dt=il,os="w-[min(300px,calc(100vw-2rem))] p-1.5",cs="start";let Be;e[39]===Symbol.for("react.memo_cache_sentinel")?(Be=R=>{R.preventDefault(),le.current?.scrollIntoView({block:"nearest"})},e[39]=Be):Be=e[39];let Ie;e[40]!==N||e[41]!==y?(Ie=N&&a.jsx("p",{className:"px-2 pb-1.5 pt-1 text-xs text-muted-foreground",children:y("thread.branchPicker.newChatHint")}),e[40]=N,e[41]=y,e[42]=Ie):Ie=e[42];const Ye=O?a.jsx(Ui,{orgId:o,orgSlug:u,userId:c,target:h,owner:b,repo:p,sandboxMap:f,enabled:D,tab:q,onTabChange:E,isV8:P,localUrl:ye,onSaveLocal:pt,onBack:()=>F(!1),onAdopt:bt}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:K("always-scrollbar flex max-h-[min(50vh,20rem)] flex-col overflow-y-auto",P&&"gap-1"),children:[!P&&ce&&ee&&a.jsx(zi,{rowRef:le,url:ee,onSelect:()=>Ce("local"),onEdit:()=>Ce("local"),onTurnOff:()=>de()}),ze&&i&&(G===i?a.jsx(Zs,{value:W,onChange:$,onSave:()=>Et(),onCancel:ct}):a.jsx(en,{rowRef:ce?void 0:le,dot:ds("orange"),label:y("thread.branchPicker.defaultVersionName"),branch:P?void 0:i,originTooltip:P?y("thread.branchPicker.viaStudioUi"):void 0,selected:!ce,onSelect:()=>pe(i),onRename:()=>{_(i),$(Vr(M,y("thread.branchPicker.defaultVersionName")))}})),is?a.jsxs(a.Fragment,{children:[a.jsx(Wn,{children:y("thread.branchPicker.groupContent")}),dt.content.map(vt),At,a.jsx(Wn,{divided:!0,children:y("thread.branchPicker.groupCode")}),dt.code.map(vt)]}):a.jsxs(a.Fragment,{children:[M.map(vt),At]}),P&&a.jsx(Ai,{virtualMcpId:s,branch:i,serve:xe,rowRef:Q?le:void 0,onPicked:()=>I(!1)})]}),(ze||M.length>0||ue.length>0||P)&&a.jsx("div",{className:"my-1 border-t"}),a.jsxs("button",{type:"button",onClick:()=>{as()},disabled:Le,className:"flex w-full items-center gap-2 rounded-lg px-2 py-2 text-left text-sm text-muted-foreground hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:opacity-50",children:[a.jsx(Mr,{className:"h-4 w-4 shrink-0"}),y("thread.branchPicker.newVersion")]}),Le&&a.jsx("p",{className:"px-2 pb-1 pt-0.5 text-xs text-warning",children:De}),a.jsxs("button",{type:"button",onClick:()=>Ce("branches"),className:K("flex w-full items-center justify-between gap-2 rounded-lg px-2 py-2 text-left text-xs text-muted-foreground hover:bg-accent hover:text-foreground",P&&"mt-1"),children:[y("thread.branchPicker.advanced"),a.jsx(dr,{className:"h-4 w-4 shrink-0"})]})]});let Ue;e[43]!==Dt||e[44]!==Be||e[45]!==Ie||e[46]!==Ye?(Ue=a.jsxs(Dt,{className:os,align:cs,onOpenAutoFocus:Be,children:[Ie,Ye]}),e[43]=Dt,e[44]=Be,e[45]=Ie,e[46]=Ye,e[47]=Ue):Ue=e[47];const wt=a.jsxs(ol,{open:D,onOpenChange:yt,children:[a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx("span",{className:"inline-flex min-w-0 shrink",children:a.jsx(cl,{asChild:!0,children:a.jsxs(ve,{"data-tour":al.branchPicker,variant:A?"outline":"ghost",size:A?"sm":"default","aria-label":Ee,disabled:k,className:Xe,children:[L?a.jsx(Fr,{className:K(Ls,xs(Ne?.color))}):at&&!ce?a.jsx(ur,{className:K(Ls,xs(us(ue.indexOf(at))))}):a.jsx("span",{className:K("h-2 w-2 shrink-0 rounded-full",i||ce?Qe:"bg-muted-foreground")}),a.jsx("span",{className:"min-w-0 truncate @max-3xl/panel-header:hidden",children:Ee}),jt]})})})}),ut]}),Ue]}),Ze=V!==null;let He;e[48]===Symbol.for("react.memo_cache_sentinel")?(He=R=>{R||te(null)},e[48]=He):He=e[48];let Fe;e[49]!==y?(Fe=y("thread.branchPicker.deleteTitle"),e[49]=y,e[50]=Fe):Fe=e[50];let $e;e[51]!==Fe?($e=a.jsx(ks,{children:Fe}),e[51]=Fe,e[52]=$e):$e=e[52];let qe;e[53]!==V||e[54]!==y?(qe=V&&y("thread.branchPicker.deleteConfirm",{name:V.name}),e[53]=V,e[54]=y,e[55]=qe):qe=e[55];let U;e[56]!==qe?(U=a.jsx(Ns,{children:qe}),e[56]=qe,e[57]=U):U=e[57];let ae;e[58]!==$e||e[59]!==U?(ae=a.jsxs(Cs,{children:[$e,U]}),e[58]=$e,e[59]=U,e[60]=ae):ae=e[60];let he;e[61]!==y?(he=y("thread.branchPicker.cancel"),e[61]=y,e[62]=he):he=e[62];let je;e[63]!==he?(je=a.jsx(As,{children:he}),e[63]=he,e[64]=je):je=e[64];let Ae;e[65]!==y?(Ae=y("thread.branchPicker.delete"),e[65]=y,e[66]=Ae):Ae=e[66];let Ke;e[67]!==Nt||e[68]!==Ae?(Ke=a.jsx(Rs,{onClick:Nt,variant:"destructive",children:Ae}),e[67]=Nt,e[68]=Ae,e[69]=Ke):Ke=e[69];let Ot;e[70]!==je||e[71]!==Ke?(Ot=a.jsxs(Ds,{children:[je,Ke]}),e[70]=je,e[71]=Ke,e[72]=Ot):Ot=e[72];let Mt;e[73]!==ae||e[74]!==Ot?(Mt=a.jsxs(Ts,{children:[ae,Ot]}),e[73]=ae,e[74]=Ot,e[75]=Mt):Mt=e[75];let ps;e[76]!==Ze||e[77]!==Mt?(ps=a.jsx(Bs,{open:Ze,onOpenChange:He,children:Mt}),e[76]=Ze,e[77]=Mt,e[78]=ps):ps=e[78];const Js=X!==null;let bs;e[79]===Symbol.for("react.memo_cache_sentinel")?(bs=R=>{R||ne(null)},e[79]=bs):bs=e[79];let _t;e[80]!==y?(_t=y("thread.branchPicker.deleteTitle"),e[80]=y,e[81]=_t):_t=e[81];let zt;e[82]!==_t?(zt=a.jsx(ks,{children:_t}),e[82]=_t,e[83]=zt):zt=e[83];let Ut;e[84]!==X||e[85]!==y?(Ut=X&&y("thread.branchPicker.discardStoreDraftConfirm",{name:X.name}),e[84]=X,e[85]=y,e[86]=Ut):Ut=e[86];let Ht;e[87]!==Ut?(Ht=a.jsx(Ns,{children:Ut}),e[87]=Ut,e[88]=Ht):Ht=e[88];let qt;e[89]!==zt||e[90]!==Ht?(qt=a.jsxs(Cs,{children:[zt,Ht]}),e[89]=zt,e[90]=Ht,e[91]=qt):qt=e[91];let Kt;e[92]!==y?(Kt=y("thread.branchPicker.cancel"),e[92]=y,e[93]=Kt):Kt=e[93];let Vt;e[94]!==Kt?(Vt=a.jsx(As,{children:Kt}),e[94]=Kt,e[95]=Vt):Vt=e[95];let Gt;e[96]!==y?(Gt=y("thread.branchPicker.delete"),e[96]=y,e[97]=Gt):Gt=e[97];let Wt;e[98]!==Ct||e[99]!==Gt?(Wt=a.jsx(Rs,{onClick:Ct,variant:"destructive",children:Gt}),e[98]=Ct,e[99]=Gt,e[100]=Wt):Wt=e[100];let Qt;e[101]!==Vt||e[102]!==Wt?(Qt=a.jsxs(Ds,{children:[Vt,Wt]}),e[101]=Vt,e[102]=Wt,e[103]=Qt):Qt=e[103];let Jt;e[104]!==qt||e[105]!==Qt?(Jt=a.jsxs(Ts,{children:[qt,Qt]}),e[104]=qt,e[105]=Qt,e[106]=Jt):Jt=e[106];let gs;return e[107]!==Js||e[108]!==Jt?(gs=a.jsx(Bs,{open:Js,onOpenChange:bs,children:Jt}),e[107]=Js,e[108]=Jt,e[109]=gs):gs=e[109],a.jsxs(a.Fragment,{children:[wt,ps,gs]})}function _i(t){return t.runtime!=="sandbox"}function Zs(t){const e=T.c(20),{value:s,onChange:r,onSave:n,onCancel:i}=t,d=me();let l;e[0]!==d?(l=d("thread.branchPicker.rename"),e[0]=d,e[1]=l):l=e[1];let o;e[2]!==r?(o=f=>r(f.target.value),e[2]=r,e[3]=o):o=e[3];let u;e[4]!==i||e[5]!==n?(u=f=>{f.key==="Enter"&&n(),f.key==="Escape"&&(f.preventDefault(),f.stopPropagation(),i())},e[4]=i,e[5]=n,e[6]=u):u=e[6];let c;e[7]!==l||e[8]!==o||e[9]!==u||e[10]!==s?(c=a.jsx("input",{autoFocus:!0,"aria-label":l,value:s,onChange:o,onKeyDown:u,className:"h-8 flex-1 rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[7]=l,e[8]=o,e[9]=u,e[10]=s,e[11]=c):c=e[11];let h;e[12]!==d?(h=d("thread.branchPicker.save"),e[12]=d,e[13]=h):h=e[13];let b;e[14]!==n||e[15]!==h?(b=a.jsx(ve,{size:"sm",onClick:n,children:h}),e[14]=n,e[15]=h,e[16]=b):b=e[16];let p;return e[17]!==c||e[18]!==b?(p=a.jsxs("div",{className:"flex items-center gap-1.5 p-1",children:[c,b]}),e[17]=c,e[18]=b,e[19]=p):p=e[19],p}function Wn(t){const e=T.c(5),{divided:s,children:r}=t,i=(s===void 0?!1:s)&&"mt-1 border-t";let d;e[0]!==i?(d=K("px-2 pb-1 pt-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",i),e[0]=i,e[1]=d):d=e[1];let l;return e[2]!==r||e[3]!==d?(l=a.jsx("p",{className:d,children:r}),e[2]=r,e[3]=d,e[4]=l):l=e[4],l}function en(t){const e=T.c(53),{rowRef:s,dot:r,codeIcon:n,agentIcon:i,originTooltip:d,label:l,creator:o,branch:u,selected:c,onSelect:h,onRename:b,onDelete:p,deleteBlocked:f}=t,m=f===void 0?!1:f,x=me();let g;e[0]!==i||e[1]!==n||e[2]!==r?(g=n?a.jsx(Fr,{className:K(Ls,n)}):i?a.jsx(ur,{className:K(Ls,i)}):a.jsx("span",{className:K("h-2 w-2 shrink-0 rounded-full",r)}),e[0]=i,e[1]=n,e[2]=r,e[3]=g):g=e[3];let w;e[4]!==o?(w=o&&a.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:o}),e[4]=o,e[5]=w):w=e[5];let j;e[6]!==l||e[7]!==w?(j=a.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[l,w]}),e[6]=l,e[7]=w,e[8]=j):j=e[8];let v;e[9]!==h||e[10]!==c||e[11]!==g||e[12]!==j?(v=a.jsxs("button",{type:"button","aria-pressed":c,onClick:h,className:"flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[g,j]}),e[9]=h,e[10]=c,e[11]=g,e[12]=j,e[13]=v):v=e[13];const P=v,S=c?"bg-accent":"hover:bg-accent";let k;e[14]!==S?(k=K("group flex items-center rounded-lg",S),e[14]=S,e[15]=k):k=e[15];let N;e[16]!==u||e[17]!==n||e[18]!==d||e[19]!==P||e[20]!==x?(N=u||d?a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:P}),a.jsxs(nt,{side:"bottom",className:"text-xs",children:[n&&a.jsx("p",{className:"font-medium",children:x("thread.branchPicker.codeDraftTooltip")}),d&&a.jsx("p",{children:d}),u&&a.jsx("p",{className:"font-mono",children:x("thread.branchPicker.branchTooltip",{branch:u})})]})]}):P,e[16]=u,e[17]=n,e[18]=d,e[19]=P,e[20]=x,e[21]=N):N=e[21];let C;e[22]!==x?(C=x("thread.branchPicker.moreActions"),e[22]=x,e[23]=C):C=e[23];let y;e[24]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(Er,{className:"h-4 w-4"}),e[24]=y):y=e[24];let A;e[25]!==C?(A=a.jsx(Os,{asChild:!0,children:a.jsx(ve,{variant:"ghost",size:"icon","aria-label":C,className:"mr-1 h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",children:y})}),e[25]=C,e[26]=A):A=e[26];let D;e[27]===Symbol.for("react.memo_cache_sentinel")?(D=a.jsx(Or,{className:"h-4 w-4"}),e[27]=D):D=e[27];let I;e[28]!==x?(I=x("thread.branchPicker.rename"),e[28]=x,e[29]=I):I=e[29];let O;e[30]!==b||e[31]!==I?(O=a.jsxs(Zt,{onSelect:b,children:[D,I]}),e[30]=b,e[31]=I,e[32]=O):O=e[32];let F;e[33]!==m||e[34]!==p||e[35]!==x?(F=p&&a.jsxs(Zt,{onSelect:p,disabled:m,className:"text-destructive focus:text-destructive",children:[a.jsx(qs,{className:"h-4 w-4"}),x("thread.branchPicker.delete")]}),e[33]=m,e[34]=p,e[35]=x,e[36]=F):F=e[36];let q;e[37]!==m||e[38]!==p||e[39]!==x?(q=p&&m&&a.jsx("p",{className:"max-w-48 px-2 pb-1.5 text-xs text-muted-foreground",children:x("thread.branchPicker.keepOneDraft")}),e[37]=m,e[38]=p,e[39]=x,e[40]=q):q=e[40];let E;e[41]!==O||e[42]!==F||e[43]!==q?(E=a.jsxs(Ms,{align:"end",children:[O,F,q]}),e[41]=O,e[42]=F,e[43]=q,e[44]=E):E=e[44];let G;e[45]!==A||e[46]!==E?(G=a.jsxs(_s,{children:[A,E]}),e[45]=A,e[46]=E,e[47]=G):G=e[47];let _;return e[48]!==s||e[49]!==G||e[50]!==k||e[51]!==N?(_=a.jsxs("div",{ref:s,className:k,children:[N,G]}),e[48]=s,e[49]=G,e[50]=k,e[51]=N,e[52]=_):_=e[52],_}function zi(t){const e=T.c(40),{rowRef:s,url:r,onSelect:n,onEdit:i,onTurnOff:d}=t,l=me();let o;try{let A;e[0]!==r?(A=new URL(r),e[0]=r,e[1]=A):A=e[1],o=A.host}catch{o=r}const u=o;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-special"}),e[2]=c):c=e[2];let h;e[3]!==l?(h=l("thread.branchPicker.localLabel"),e[3]=l,e[4]=h):h=e[4];let b;e[5]!==u?(b=a.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:u}),e[5]=u,e[6]=b):b=e[6];let p;e[7]!==h||e[8]!==b?(p=a.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[h,b]}),e[7]=h,e[8]=b,e[9]=p):p=e[9];let f;e[10]!==n||e[11]!==p?(f=a.jsxs("button",{type:"button","aria-pressed":!0,onClick:n,className:"flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[c,p]}),e[10]=n,e[11]=p,e[12]=f):f=e[12];let m;e[13]!==l?(m=l("thread.branchPicker.moreActions"),e[13]=l,e[14]=m):m=e[14];let x;e[15]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(Er,{className:"h-4 w-4"}),e[15]=x):x=e[15];let g;e[16]!==m?(g=a.jsx(Os,{asChild:!0,children:a.jsx(ve,{variant:"ghost",size:"icon","aria-label":m,className:"mr-1 h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",children:x})}),e[16]=m,e[17]=g):g=e[17];let w;e[18]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(Or,{className:"h-4 w-4"}),e[18]=w):w=e[18];let j;e[19]!==l?(j=l("thread.branchPicker.rename"),e[19]=l,e[20]=j):j=e[20];let v;e[21]!==i||e[22]!==j?(v=a.jsxs(Zt,{onSelect:i,children:[w,j]}),e[21]=i,e[22]=j,e[23]=v):v=e[23];let P;e[24]===Symbol.for("react.memo_cache_sentinel")?(P=a.jsx(qs,{className:"h-4 w-4"}),e[24]=P):P=e[24];let S;e[25]!==l?(S=l("thread.branchPicker.localTurnOff"),e[25]=l,e[26]=S):S=e[26];let k;e[27]!==d||e[28]!==S?(k=a.jsxs(Zt,{onSelect:d,className:"text-destructive focus:text-destructive",children:[P,S]}),e[27]=d,e[28]=S,e[29]=k):k=e[29];let N;e[30]!==v||e[31]!==k?(N=a.jsxs(Ms,{align:"end",children:[v,k]}),e[30]=v,e[31]=k,e[32]=N):N=e[32];let C;e[33]!==N||e[34]!==g?(C=a.jsxs(_s,{children:[g,N]}),e[33]=N,e[34]=g,e[35]=C):C=e[35];let y;return e[36]!==s||e[37]!==C||e[38]!==f?(y=a.jsxs("div",{ref:s,className:"group flex items-center rounded-lg bg-accent",children:[f,C]}),e[36]=s,e[37]=C,e[38]=f,e[39]=y):y=e[39],y}function Ui(t){const e=T.c(73),{orgId:s,orgSlug:r,userId:n,target:i,owner:d,repo:l,sandboxMap:o,enabled:u,tab:c,onTabChange:h,isV8:b,localUrl:p,onSaveLocal:f,onBack:m,onAdopt:x}=t,g=me(),[w,j]=H.useState(""),v=c==="branches"?w:"",P=u&&c==="branches";let S;e[0]!==s||e[1]!==r||e[2]!==d||e[3]!==l||e[4]!==o||e[5]!==v||e[6]!==P||e[7]!==i||e[8]!==n?(S={orgId:s,orgSlug:r,userId:n,target:i,sandboxMap:o,owner:d,repo:l,search:v,enabled:P},e[0]=s,e[1]=r,e[2]=d,e[3]=l,e[4]=o,e[5]=v,e[6]=P,e[7]=i,e[8]=n,e[9]=S):S=e[9];const{recent:k,yours:N,others:C,isLoading:y,hasMore:A,isFetchingMore:D,fetchMore:I}=Li(S),O=u&&c==="prs";let F;e[10]!==s||e[11]!==r||e[12]!==d||e[13]!==l||e[14]!==O||e[15]!==i?(F={orgId:s,orgSlug:r,target:i,owner:d,repo:l,enabled:O},e[10]=s,e[11]=r,e[12]=d,e[13]=l,e[14]=O,e[15]=i,e[16]=F):F=e[16];const{data:q,isLoading:E}=wl(F);let G;if(e[17]!==I||e[18]!==A||e[19]!==D||e[20]!==y||e[21]!==b||e[22]!==p||e[23]!==x||e[24]!==m||e[25]!==f||e[26]!==h||e[27]!==C||e[28]!==d||e[29]!==E||e[30]!==k||e[31]!==l||e[32]!==w||e[33]!==g||e[34]!==q||e[35]!==c||e[36]!==N){const _=q===void 0?[]:q,W=`${d}/${l}`;let $;e[38]!==W?($=W.toLowerCase(),e[38]=W,e[39]=$):$=e[39];const V=$;let te;e[40]!==V?(te=z=>z.headRepoFullName?.toLowerCase()===V,e[40]=V,e[41]=te):te=e[41];const X=_.filter(te);let ne;if(e[42]!==C||e[43]!==k||e[44]!==N){const z=new Set;ne=[...k,...N,...C].filter(oe=>z.has(oe.name)?!1:(z.add(oe.name),!0)),e[42]=C,e[43]=k,e[44]=N,e[45]=ne}else ne=e[45];const le=ne;let M;e[46]===Symbol.for("react.memo_cache_sentinel")?(M=a.jsx(fl,{className:"h-4 w-4 shrink-0"}),e[46]=M):M=e[46];let Y;e[47]!==g?(Y=g("thread.branchPicker.advancedBack"),e[47]=g,e[48]=Y):Y=e[48];let B;e[49]!==m||e[50]!==Y?(B=a.jsxs("button",{type:"button",onClick:m,className:"flex items-center gap-1.5 px-2 py-1.5 text-xs text-muted-foreground hover:text-foreground",children:[M,Y]}),e[49]=m,e[50]=Y,e[51]=B):B=e[51];let Z;e[52]!==h?(Z=z=>{h(z),j("")},e[52]=h,e[53]=Z):Z=e[53];let se;e[54]!==g?(se=g("thread.branchPicker.branchesTab"),e[54]=g,e[55]=se):se=e[55];let ie;e[56]!==se?(ie=a.jsx(Tt,{value:"branches",className:"h-6 px-2.5 text-xs",children:se}),e[56]=se,e[57]=ie):ie=e[57];let ge;e[58]!==g?(ge=g("thread.branchPicker.prsTab"),e[58]=g,e[59]=ge):ge=e[59];let ue;e[60]!==ge?(ue=a.jsx(Tt,{value:"prs",className:"h-6 px-2.5 text-xs",children:ge}),e[60]=ge,e[61]=ue):ue=e[61];let re;e[62]!==b||e[63]!==g?(re=!b&&a.jsx(Tt,{value:"local",className:"h-6 px-2.5 text-xs",children:g("thread.branchPicker.localTab")}),e[62]=b,e[63]=g,e[64]=re):re=e[64];let fe;e[65]!==ie||e[66]!==ue||e[67]!==re?(fe=a.jsxs(Tr,{className:"h-auto w-fit justify-start gap-1 bg-accent p-1",variant:"pill",children:[ie,ue,re]}),e[65]=ie,e[66]=ue,e[67]=re,e[68]=fe):fe=e[68];let ye;e[69]!==Z||e[70]!==fe||e[71]!==c?(ye=a.jsx(Br,{className:"px-2 pt-2 pb-1",value:c,onValueChange:Z,children:fe}),e[69]=Z,e[70]=fe,e[71]=c,e[72]=ye):ye=e[72],G=a.jsxs("div",{className:"flex flex-col",children:[B,ye,c==="local"&&!b?a.jsx(Ci,{url:p,onSave:f}):a.jsxs(dl,{filter:c==="branches"?Hi:void 0,children:[a.jsx(ul,{placeholder:g(c==="branches"?"thread.branchPicker.searchBranches":"thread.branchPicker.searchPullRequests"),value:w,onValueChange:j}),a.jsx(hl,{onScroll:z=>{const oe=z.currentTarget;c==="branches"&&oe.scrollHeight-oe.scrollTop-oe.clientHeight<48&&I()},children:c==="branches"?a.jsxs(a.Fragment,{children:[y&&a.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:g("thread.branchPicker.loadingMore")}),!y&&le.length===0&&a.jsx(Un,{children:g("thread.branchPicker.noBranchesFound")}),le.length>0&&a.jsx(Hn,{children:le.map(z=>a.jsxs(qn,{value:z.name,className:"cursor-pointer",onSelect:()=>x(z.name,z.name),children:[a.jsx(Ra,{className:"mr-2 h-4 w-4 shrink-0"}),a.jsx("span",{className:"flex-1 truncate",children:z.name})]},z.name))}),A&&a.jsx("div",{className:"p-2",children:a.jsx(ve,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs",disabled:D,onClick:I,children:g(D?"thread.branchPicker.loadingMore":"thread.branchPicker.loadMoreBranches")})})]}):a.jsxs(a.Fragment,{children:[E&&a.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:g("thread.branchPicker.loadingPullRequests")}),!E&&X.length===0&&a.jsx(Un,{children:g("thread.branchPicker.noOpenPullRequests")}),X.length>0&&a.jsx(Hn,{children:X.map(z=>a.jsxs(qn,{value:`#${z.number} ${z.title} ${z.head}`,className:"cursor-pointer",onSelect:()=>x(z.head,Gn(z.title)),children:[a.jsx(Hs,{className:"mr-2 h-4 w-4 shrink-0 text-muted-foreground"}),a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsx("span",{className:"truncate",children:Gn(z.title)}),a.jsxs("span",{className:"truncate text-xs text-muted-foreground",children:["#",z.number," · ",z.head]})]})]},z.number))})]})})]})]}),e[17]=I,e[18]=A,e[19]=D,e[20]=y,e[21]=b,e[22]=p,e[23]=x,e[24]=m,e[25]=f,e[26]=h,e[27]=C,e[28]=d,e[29]=E,e[30]=k,e[31]=l,e[32]=w,e[33]=g,e[34]=q,e[35]=c,e[36]=N,e[37]=G}else G=e[37];return G}function Hi(t,e){return rn(t,e)?1:0}function qi(t){const e=T.c(19),{locked:s,placement:r,value:n,virtualMcpId:i,isV8:d,userLabel:l,baseBranch:o,baseIsDraft:u,onChange:c,onCreateBranch:h,onAdoptBranch:b,orgId:p,orgSlug:f,userId:m,target:x,owner:g,repo:w,sandboxMap:j}=t;let v;return e[0]!==o||e[1]!==u||e[2]!==d||e[3]!==s||e[4]!==b||e[5]!==c||e[6]!==h||e[7]!==p||e[8]!==f||e[9]!==g||e[10]!==r||e[11]!==w||e[12]!==j||e[13]!==x||e[14]!==m||e[15]!==l||e[16]!==n||e[17]!==i?(v=a.jsx(Mi,{virtualMcpId:i,isV8:d,userLabel:l,value:n,baseBranch:o,baseIsDraft:u,orgId:p,orgSlug:f,userId:m,target:x,owner:g,repo:w,sandboxMap:j,onChange:c,onCreateBranch:h,onAdoptBranch:b,spawnsNewChat:s,placement:r}),e[0]=o,e[1]=u,e[2]=d,e[3]=s,e[4]=b,e[5]=c,e[6]=h,e[7]=p,e[8]=f,e[9]=g,e[10]=r,e[11]=w,e[12]=j,e[13]=x,e[14]=m,e[15]=l,e[16]=n,e[17]=i,e[18]=v):v=e[18],v}function Ki(t){const e=T.c(2),{branchPill:s}=t;if(!s)return null;let r;return e[0]!==s?(r=a.jsx(a.Fragment,{children:s}),e[0]=s,e[1]=r):r=e[1],r}function Vi(t){const{locked:e,sessionRuntime:s,projectRuntime:r,draftRuntime:n,current:i}=t;return t.contentOnly&&n==="cms"?s==="cms"&&!e?{kind:"switch"}:{kind:"new-chat",runtime:"cms"}:n==="sandbox"&&s!=="sandbox"?{kind:"new-chat",runtime:"sandbox"}:n==="cms"&&s==="sandbox"&&r==="cms"&&!i?{kind:"new-chat"}:e?s==="sandbox"?{kind:"new-chat",runtime:"sandbox"}:{kind:"new-chat"}:{kind:"switch"}}function Gi(t){const e=T.c(25),{virtualMcp:s,currentBranch:r}=t,n=qa(),i=It();let d;e[0]!==n?.messages||e[1]!==i?.isThreadLocked?(d=(n?.messages??[]).length>0||(i?.isThreadLocked??!1),e[0]=n?.messages,e[1]=i?.isThreadLocked,e[2]=d):d=e[2];const l=d,o=i?.setCurrentTaskBranch,u=i?.createTask,c=fs(s?.id),h=c.runtime,b=s?.metadata;let p;e[3]!==b?(p=xl(b),e[3]=b,e[4]=p):p=e[4];const f=p,m=f==="cms"&&h==="sandbox",x=vl(s),g=Oe(x),{data:w}=zs.useSession(),j=w?.user;let v;e[5]!==j?(v=yn(j),e[5]=j,e[6]=v):v=e[6];const P=v,S=w?.user?.id??"",{org:k}=rs(),N=Pl(s,r),C=jn(s?.id),y=C&&h==="cms";let A;e[7]!==u||e[8]!==r||e[9]!==l||e[10]!==f||e[11]!==h||e[12]!==c.resolved||e[13]!==o||e[14]!==C?(A=(_,W)=>{const $=Vi({locked:l,sessionRuntime:c.resolved?h:null,projectRuntime:f,draftRuntime:W&&(W.runtime??f),current:_===r,contentOnly:C});$.kind==="new-chat"&&u?u({branch:_,...$.runtime?{runtime:$.runtime}:{}}):o&&o(_)},e[7]=u,e[8]=r,e[9]=l,e[10]=f,e[11]=h,e[12]=c.resolved,e[13]=o,e[14]=C,e[15]=A):A=e[15];const D=A;let I;e[16]!==m||e[17]!==u||e[18]!==l||e[19]!==o?(I=_=>{(l||m)&&u?u({branch:_}):o&&o(_)},e[16]=m,e[17]=u,e[18]=l,e[19]=o,e[20]=I):I=e[20];const O=I;let F;e[21]!==u?(F=u?_=>u({runtime:"sandbox",branch:_}):void 0,e[21]=u,e[22]=F):F=e[22];const q=F,E=x&&_r(g)?a.jsx(qi,{userLabel:P,virtualMcpId:s?.id??"",isV8:C,value:r,baseBranch:N,baseIsDraft:y,orgId:k.id,orgSlug:k.slug,userId:S,target:g,owner:x.owner,repo:x.name,sandboxMap:s?.metadata?.sandboxMap,onChange:D,onCreateBranch:O,onAdoptBranch:q,locked:l,placement:"chat"},`${zr(g)}:${x.owner}/${x.name}`):null;let G;return e[23]!==E?(G=a.jsx(Ki,{branchPill:E}),e[23]=E,e[24]=G):G=e[24],G}const Wi=Da("flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg",{variants:{orientation:{horizontal:"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}});function Qi(t){const e=T.c(11);let s,r,n;e[0]!==t?({className:s,orientation:r,...n}=t,e[0]=t,e[1]=s,e[2]=r,e[3]=n):(s=e[1],r=e[2],n=e[3]);let i;e[4]!==s||e[5]!==r?(i=K(Wi({orientation:r}),s),e[4]=s,e[5]=r,e[6]=i):i=e[6];let d;return e[7]!==r||e[8]!==n||e[9]!==i?(d=a.jsx("div",{role:"group","data-slot":"button-group","data-orientation":r,className:i,...n}),e[7]=r,e[8]=n,e[9]=i,e[10]=d):d=e[10],d}function Ji(t){const e=T.c(14),{item:s}=t;let r;e[0]!==s?(r=()=>{s.onSelect()},e[0]=s,e[1]=r):r=e[1];let n;e[2]!==s.disabled||e[3]!==s.icon||e[4]!==s.label||e[5]!==r?(n=a.jsxs(Zt,{disabled:s.disabled,onSelect:r,children:[s.icon,s.label]}),e[2]=s.disabled,e[3]=s.icon,e[4]=s.label,e[5]=r,e[6]=n):n=e[6];const i=n;if(!s.tooltip)return i;let d;e[7]!==i?(d=a.jsx(st,{asChild:!0,children:i}),e[7]=i,e[8]=d):d=e[8];let l;e[9]!==s.tooltip?(l=a.jsx(nt,{side:"right",children:s.tooltip}),e[9]=s.tooltip,e[10]=l):l=e[10];let o;return e[11]!==d||e[12]!==l?(o=a.jsxs(tt,{children:[d,l]}),e[11]=d,e[12]=l,e[13]=o):o=e[13],o}function ea(t){const e=T.c(20),{label:s,onClick:r,variant:n,size:i,disabled:d,loading:l,pulse:o,tooltip:u,icon:c,items:h,menuAriaLabel:b,className:p}=t,f=n===void 0?"default":n,m=i===void 0?"default":i,x=d===void 0?!1:d,g=l===void 0?!1:l,w=o===void 0?!1:o,j=(h?.length??0)>0;let v;if(e[0]!==p||e[1]!==x||e[2]!==j||e[3]!==c||e[4]!==h||e[5]!==s||e[6]!==g||e[7]!==b||e[8]!==r||e[9]!==w||e[10]!==m||e[11]!==u||e[12]!==f){const P=K(Dr,f==="default"&&"focus-visible:inset-ring-current");let S;e[14]!==c||e[15]!==g?(S=g?a.jsx(es,{size:"xs"}):c,e[14]=c,e[15]=g,e[16]=S):S=e[16];const k=a.jsxs(ve,{type:"button",variant:f,size:m,disabled:x,"aria-busy":g||void 0,onClick:g?void 0:r,className:K(P,j&&"rounded-r-none border-r border-current/20"),children:[S,s]}),N=w&&"animate-pulse-brightness motion-reduce:animate-none motion-reduce:opacity-80";let C;e[17]!==p||e[18]!==N?(C=K(N,p),e[17]=p,e[18]=N,e[19]=C):C=e[19],v=a.jsxs(Qi,{className:C,children:[u?a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx("span",{className:K("inline-flex rounded-lg outline-none",P,x&&"cursor-not-allowed"),tabIndex:x?0:void 0,role:x?"button":void 0,"aria-disabled":x||void 0,children:k})}),a.jsx(nt,{children:u})]}):k,j?a.jsxs(_s,{children:[a.jsx(Os,{asChild:!0,children:a.jsx(ve,{type:"button",variant:f,size:m,"aria-label":b,className:K("has-[>svg]:px-2",P),children:a.jsx(Ir,{className:"size-3.5"})})}),a.jsx(Ms,{align:"end",children:h?.map(Xi)})]}):null]}),e[0]=p,e[1]=x,e[2]=j,e[3]=c,e[4]=h,e[5]=s,e[6]=g,e[7]=b,e[8]=r,e[9]=w,e[10]=m,e[11]=u,e[12]=f,e[13]=v}else v=e[13];return v}function Xi(t){return a.jsx(Ji,{item:t},t.key)}async function Yi(t){if(t.hosted)return;const e=t.branch;await t.setCurrentTaskBranch(t.nextBranch()),e&&e!==t.baseBranch&&await t.deleteRelease(e)}function Zi(t,e,{hosted:s}){return s&&t!==null?t:e}function eo(t,e){const s=T.c(11),[r,n]=H.useState(null);let i;s[0]!==r||s[1]!==t||s[2]!==e?(i=Zi(r,t,e),s[0]=r,s[1]=t,s[2]=e,s[3]=i):i=s[3];let d;s[4]!==t||s[5]!==e?(d=()=>n(e.hosted?t:null),s[4]=t,s[5]=e,s[6]=d):d=s[6];let l;s[7]===Symbol.for("react.memo_cache_sentinel")?(l=()=>n(null),s[7]=l):l=s[7];let o;return s[8]!==i||s[9]!==d?(o={shown:i,hold:d,release:l},s[8]=i,s[9]=d,s[10]=o):o=s[10],o}function to({open:t,hosted:e}){return t||e}function ta(t){return Wl({userName:t?.name,userEmail:t?.email})??void 0}function Gs(t){const e=T.c(18),{state:s,header:r,body:n,note:i,gate:d,footer:l}=t,o=s!=="ready";let u;e[0]!==r?(u=a.jsx("div",{className:"space-y-0.5 px-4 py-3",children:r}),e[0]=r,e[1]=u):u=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx("div",{className:"border-t"}),e[2]=c):c=e[2];let h;e[3]!==i?(h=i?a.jsx("div",{className:"space-y-1.5 border-t px-4 py-3",children:i}):null,e[3]=i,e[4]=h):h=e[4];let b;e[5]!==n||e[6]!==h?(b=a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n,h]}),e[5]=n,e[6]=h,e[7]=b):b=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsx("div",{className:"border-t"}),e[8]=p):p=e[8];let f;e[9]!==l?(f=a.jsx("div",{className:"space-y-2 px-4 py-3",children:l}),e[9]=l,e[10]=f):f=e[10];let m;return e[11]!==d||e[12]!==s||e[13]!==o||e[14]!==u||e[15]!==b||e[16]!==f?(m=a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col","data-publish-state":s,"aria-busy":o,children:[u,c,b,d,p,f]}),e[11]=d,e[12]=s,e[13]=o,e[14]=u,e[15]=b,e[16]=f,e[17]=m):m=e[17],m}function hs(t){const e=T.c(2),{children:s}=t;let r;return e[0]!==s?(r=a.jsx("div",{className:"scroll-fade min-h-0 flex-1 space-y-3 overflow-y-auto overscroll-contain px-4 pt-3 pb-2 [scrollbar-width:thin]",children:s}),e[0]=s,e[1]=r):r=e[1],r}function sa(t){const e=T.c(10);let s,r,n;e[0]!==t?({className:r,children:s,...n}=t,e[0]=t,e[1]=s,e[2]=r,e[3]=n):(s=e[1],r=e[2],n=e[3]);let i;e[4]!==r?(i=K("rounded-lg border bg-card px-3 py-2.5",r),e[4]=r,e[5]=i):i=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==i?(d=a.jsx("div",{className:i,...n,children:s}),e[6]=s,e[7]=n,e[8]=i,e[9]=d):d=e[9],d}function We(t){const e=T.c(4),{className:s}=t;let r;e[0]!==s?(r=K("animate-pulse rounded bg-muted motion-reduce:animate-none",s),e[0]=s,e[1]=r):r=e[1];let n;return e[2]!==r?(n=a.jsx("div",{className:r}),e[2]=r,e[3]=n):n=e[3],n}function Bt(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(sa,{children:a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx(We,{className:"size-4 rounded-md"}),a.jsx(We,{className:"h-3 w-24"}),a.jsx(We,{className:"h-2.5 w-16"}),a.jsx(We,{className:"ml-auto size-6 rounded"})]})}),t[0]=e):e=t[0],e}const so="secret";function na(t){return t.kind!=="block"?null:t.namedRule??null}function no(t,e){const s=e.find(r=>r&&typeof r=="object");return s?$l(s.__resolveType):Ll(t)}const ro=/(?:^|\/)\.deco\/blocks\/([^/]+)\.json$/;function Tn(t){const e=ro.exec(t)?.[1];return e?bi(e):null}function Es(t){if(!t)return null;try{const e=JSON.parse(t);if(e&&typeof e=="object"&&!Array.isArray(e))return e}catch{}return null}function ao(t,e){return t===null?"new":e===null?"removed":"edited"}function ra(t){const e=t.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim();return e?(e.charAt(0).toUpperCase()+e.slice(1)).replace(/\s+[A-Z](?=[a-z])/g,s=>s.toLowerCase()):t}function Yt(t,e,s=!1){if(t&&typeof t=="object"&&!Array.isArray(t)){const r=t.__resolveType;if(typeof r=="string"&&r.trim()){if(s)return Ta(r);const i=(r.split("/").pop()??r).replace(/\.[jt]sx?$/,"");return ra(i)||i}}return`Section ${e+1}`}function Bn(t){if(hr(t))return t.value??null;const e=t.__resolveType;return typeof e=="string"&&Ba(e)?t.section??null:null}const aa=6;function Ps(t,e=0){if(e>aa||!t||typeof t!="object")return[];if(Array.isArray(t))return t.flatMap(n=>Ps(n,e+1));const s=t;if(un(s.__resolveType))return an(s).flatMap(n=>Ps(n?.value,e+1));const r=Bn(s);return r!==null?Ps(r,e+1):[s]}function an(t){const e=t?.variants;return Array.isArray(e)?e.map(s=>s&&typeof s=="object"&&!Array.isArray(s)?s:null):[]}function Qn(t){let e=t;for(let s=0;s<aa;s++){if(!e||typeof e!="object"||Array.isArray(e))return null;const r=e;if(un(r.__resolveType))return r;const n=Bn(r);if(n===null)return null;e=n}return null}function lo(t,e,s){const r=an(Qn(t)),n=e?an(Qn(e)):[],i=e?Array.from({length:Math.max(r.length,n.length)},(o,u)=>u).filter(o=>!Ws(r[o],n[o])):[],l=[...i.map(o=>r[o]??n[o]),...r.filter((o,u)=>!i.includes(u))].flatMap(o=>Ps(o?.value)).map(o=>Yt(o,s,!0));return[...new Set(l)]}function tn(t,e,s,r,n){let i=t,d=!1;for(let o=0;o<4;o++){if(!i||typeof i!="object"||Array.isArray(i)){d=!0;break}const u=i;if(un(u.__resolveType)){d=!0;break}const c=Bn(u);if(c===null)break;i=c}const l=d?lo(t,n,e):[];return{name:Yt(d?t:i,e,!0),kind:"section",status:s,fields:r,...d?{wrapper:!0}:{},...l.length>0?{held:l}:{}}}function ln(t,e){const s=t.sections;if(Array.isArray(s))return s.flatMap((r,n)=>r&&typeof r=="object"&&!Array.isArray(r)?[{section:r,basePath:["sections",n]}]:[]);if(s&&typeof s=="object"){const r=s.variants;if(Array.isArray(r))return r.flatMap((n,i)=>{const d=n&&typeof n=="object"&&!Array.isArray(n)?n.value:null,l=e&&hr(d),o=l?d.value:d;if(!Array.isArray(o))return[];const u=l?["sections","variants",i,"value","value"]:["sections","variants",i,"value"];return o.flatMap((c,h)=>c&&typeof c=="object"&&!Array.isArray(c)?[{section:c,basePath:[...u,h]}]:[])})}return[]}function Jn(t){return JSON.stringify(t,(e,s)=>{if(s&&typeof s=="object"&&!Array.isArray(s)){const r=s;return Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{})}return s})}function Ws(t,e){return t===void 0&&e===void 0?!0:Jn(t)===Jn(e)}function St(t,e,s,r=new Set){const n=new Set([...Object.keys(t??{}),...Object.keys(e??{})]),i=[];for(const d of n){if(d.startsWith("__")||r.has(d))continue;const l=t?t[d]:void 0,o=e?e[d]:void 0;Ws(l,o)||i.push({label:ra(d),path:[...s,d],from:l,to:o})}return i}function io(t,e){const s=e.find(r=>r&&typeof r=="object");return s?s.__resolveType===Jl:t===Xl}function oo(t,e){const s=n=>n===void 0||!!n&&typeof n=="object"&&!Array.isArray(n)&&!("__resolveType"in n),r=[];for(const n of St(t,e,[])){const i=String(n.path[0]);s(n.from)&&s(n.to)?r.push(...St(n.from??{},n.to??{},[i])):r.push(n)}return r}const co=new Set(["sections"]);function In(t,e,s=!1){const r=t?ln(t,s):[],n=e?ln(e,s):[],i=[],d=Math.max(r.length,n.length);for(let o=0;o<d;o++){const u=r[o],c=n[o];if(!s){const h=uo(u,c,o);h&&i.push(h);continue}if(u&&c){if(Ws(u.section,c.section))continue;i.push(tn(c.section,o,"edited",St(u.section,c.section,c.basePath),u.section))}else c?i.push(tn(c.section,o,"new",[])):u&&i.push(tn(u.section,o,"removed",[]))}const l=St(t,e,[],co);return l.length>0&&i.push({name:"Page settings",kind:"settings",status:"edited",fields:l}),i}function uo(t,e,s){return t&&e?Ws(t.section,e.section)?null:{name:Yt(e.section,s),kind:"section",status:"edited",fields:St(t.section,e.section,e.basePath)}:e?{name:Yt(e.section,s),kind:"section",status:"new",fields:[]}:t?{name:Yt(t.section,s),kind:"section",status:"removed",fields:[]}:null}function on(t,e){return{kind:"other",blockKey:null,name:t.split("/").pop()??t,pagePath:null,isSiteApp:!1,status:e,filepaths:[t],sections:[],fromJson:null,toJson:null}}function ho(t){const e=[],s=[],r=[],n=[];for(const[i,d]of Object.entries(t?.diffs??{})){if(kn(i)){n.push(i);continue}const l=ao(d.from,d.to),o=Tn(i);if(!o){r.push(on(i,l));continue}const u=Es(d.from),c=Es(d.to),h=c??u;if(!h){r.push(on(i,l));continue}const b=Xt(o,h);if(b){e.push({kind:"page",blockKey:o,name:b.name,pagePath:b.path,isSiteApp:!1,status:l,filepaths:[i],sections:l==="edited"?In(u,c):[],fromJson:u,toJson:c});continue}const p=wn(o,h);s.push({kind:"block",blockKey:o,name:$s(o,h),pagePath:null,isSiteApp:p,status:l,filepaths:[i],sections:l==="edited"?[{name:$s(o,h),kind:"section",status:"edited",fields:St(u,c,[])}].filter(f=>f.fields.length>0):[],fromJson:u,toJson:c})}return la({pages:e,blocks:s,other:r,generated:n})}function sn(t,e){return(t.filepaths[0]??"").localeCompare(e.filepaths[0]??"")}function la(t){const{pages:e,blocks:s,other:r,generated:n}=t;return e.sort(sn),s.sort(sn),r.sort(sn),{pages:e,blocks:s,other:r,generated:n,count:e.length+s.length+r.length}}function fo(t){return t==="added"?"new":t==="removed"?"removed":"edited"}function ia(t){return t.startsWith("pages-")}function oa(t){const{files:e,lookup:s,diff:r}=t,n=[],i=[],d=[],l=[];for(const o of e){const u=o.path;if(kn(u)){l.push(u);continue}const c=fo(o.status),h=Tn(u);if(!h){d.push(on(u,c));continue}const b=r?.diffs[u],p=Es(b?.from??null),f=Es(b?.to??null),m=ca(s,h),x=m??f??p;if((m?Xt(h,m):null)??(!m&&ia(h))){const j=x?Xt(h,x):null;n.push({kind:"page",blockKey:h,name:j?.name??Wr(h),pagePath:j?.path??null,isSiteApp:!1,status:c,filepaths:[u],sections:c==="edited"?In(p,f):[],fromJson:p,toJson:f??(c==="new"?m:null)});continue}const w=$s(h,x??{});i.push({kind:"block",blockKey:h,name:w,pagePath:null,isSiteApp:wn(h,m??{}),status:c,filepaths:[u],sections:c==="edited"?[{name:w,kind:"section",status:"edited",fields:St(p,f,[])}].filter(j=>j.fields.length>0):[],fromJson:p,toJson:f})}return la({pages:n,blocks:i,other:d,generated:l})}function ca(t,e){const s=t?.[e];return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function mo(t,e){return t??e}function da(t){return t.length<=1?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}const nn=3;function vs(t){if(t.length<=nn)return da(t);const e=t.length-nn;return`${t.slice(0,nn).join(", ")} and ${e} more`}function po(t,e){if(!e){const r=t.sections.filter(n=>n.kind==="section").map(n=>n.name).slice(0,3);return r.length>0?`${t.name} (${r.join(", ")})`:t.name}const s=[...new Set(t.sections.filter(r=>r.kind==="section").flatMap(r=>r.wrapper?r.held??[]:[r.name]))].slice(0,3);return s.length>0?`${t.name} (${s.join(", ")})`:t.name}function bo(t){const e=na(t);return e==="experiments"?"A/B tests":e==="campaigns"?"Campaign dates":t.name}function go(t){const e=[],s=t.pages.filter(l=>l.status==="edited"),r=t.pages.filter(l=>l.status==="new"),n=t.pages.filter(l=>l.status==="removed");if(s.length>0&&e.push(`updated ${vs(s.map(l=>po(l,!!t.v8)))}`),r.length>0){const l=r.length===1?"page":"pages";e.push(`added the ${vs(r.map(o=>o.name))} ${l}`)}if(n.length>0){const l=n.length===1?"page":"pages";e.push(`removed the ${vs(n.map(o=>o.name))} ${l}`)}const i=t.blocks.map(bo);if(i.length>0&&e.push(`changed ${vs(i)}`),t.other.length>0){const l=t.other.length===1?"file":"files";e.push(`changed ${t.other.length} ${l}`)}if(e.length===0)return"";const d=da(e);return Ql(d.charAt(0).toUpperCase()+d.slice(1))}function xo(t,e){return t?ln(t,e).length:0}function vo(t,e=!1){const s={newPageSections:t.kind==="page"&&t.status==="new"?xo(t.toJson,e):null,sections:0,settings:!1,fields:0};if(s.newPageSections!==null)return s;for(const r of t.sections){if(r.kind==="settings"){s.settings=!0;continue}t.kind==="page"?s.sections+=1:s.fields+=r.fields.length}return s}const Xn="••••••";function ts(t){if(Array.isArray(t))return t.map(ts);if(!t||typeof t!="object")return t;const e=t,s={};for(const[r,n]of Object.entries(e))s[r]=ts(n);return e.__resolveType===so&&"ciphertext"in e&&(s.ciphertext=Xn),Fa(e)&&"encrypted"in e&&(s.encrypted=Xn),s}function Yn(t){return t.map(e=>({...e,from:ts(e.from),to:ts(e.to)}))}function yo(t){const{changes:e,sides:s,lookup:r,meta:n,hosted:i}=t,d=[],l=[],o=c=>[...new Set((s?.diagnostics??[]).filter(h=>_n(Ia(h.file))===_n(c)).map(h=>h.side))],u=Object.keys(e).sort((c,h)=>c<h?-1:c>h?1:0);for(const c of u){const h=e[c],b=h.kind==="delete"?"removed":h.baseVersion===null?"new":"edited",p=s?.entries[c],f=p?.before??null,m=p?.after??null,x=ca(r,c),g=x??m??f,w=o(c),j={blockKey:c,status:b,filepaths:[],entry:{name:c,version:h.version},...w.length>0?{unreadable:w}:{},fromJson:ts(f),toJson:ts(m??(b==="new"?x:null))},v=x?Xt(c,x,n):null,P=!x&&g?Xt(c,g,n):null;if(v??P??(!g&&ia(c))){const y=g?Xt(c,g,n):null;d.push({...j,kind:"page",name:y?.name??Wr(c),pagePath:y?.path??null,isSiteApp:!1,sections:b==="edited"?In(f,m,!0).map(A=>({...A,fields:Yn(A.fields)})):[]});continue}const S=i?Il(c,g,x,m,f):null,k=S?Fl(S,[g,x,m,f]):$s(c,g??{}),N=no(c,[x,m,f]),C=io(c,[x,m,f]);l.push({...j,kind:"block",name:C?"Settings":k,...C?{cmsSettings:!0}:{},...S?{blogKind:S}:{},...N?{namedRule:N}:{},pagePath:null,isSiteApp:wn(c,x??g??{}),sections:b==="edited"?[{name:C?"Settings":k,kind:"section",status:"edited",fields:Yn(C?oo(f,m):St(f,m,[]))}].filter(y=>y.fields.length>0):[]})}return{pages:d,blocks:l,other:[],generated:[],count:d.length+l.length,v8:!0}}function ke(t){return t.filepaths[0]??t.blockKey??t.name}function jo(t,e){return e(t==="new"?"thread.publishPopover.chipNew":t==="removed"?"thread.publishPopover.chipRemoved":"thread.publishPopover.chipEdited")}function wo(t,e){const s=t.kind==="block"?ri:$r;return a.jsx("span",{title:jo(t.status,e),className:"flex shrink-0",children:a.jsx(s,{className:K("size-4",t.status==="new"&&"text-brand",t.status==="edited"&&"text-warning",t.status==="removed"&&"text-destructive")})})}function Po(t,e){if(t.kind==="page")return t.pagePath;if(t.kind!=="block")return null;if(t.blogKind)return El(t.blogKind,e);if(t.cmsSettings)return e("thread.publishPopover.settingsDetail");const s=na(t);return s==="experiments"?e("thread.publishPopover.abTests"):s==="campaigns"?e("thread.publishPopover.campaignDates"):t.isSiteApp?e("thread.publishPopover.siteConfiguration"):e("thread.publishPopover.globalSection")}function So(t,e,s){const r=vo(t,s);if(r.newPageSections!==null)return[r.newPageSections===1?e("thread.publishPopover.newPageSectionOne"):e("thread.publishPopover.newPageSections",{count:r.newPageSections})];const n=[];return r.sections===1?n.push(e("thread.publishPopover.sectionChangedOne")):r.sections>1&&n.push(e("thread.publishPopover.sectionsChanged",{count:r.sections})),r.fields===1?n.push(e("thread.publishPopover.fieldChangedOne")):r.fields>1&&n.push(e("thread.publishPopover.fieldsChanged",{count:r.fields})),r.settings&&n.push(e("thread.publishPopover.pageSettingsChanged")),n}function ua(t){const e=T.c(46),{change:s,bodyPending:r,selected:n,onSelect:i,confirming:d,onConfirmingChange:l,onDiscard:o,isPublishing:u,isDiscarding:c,v8:h}=t,b=r===void 0?!1:r,p=h===void 0?!1:h,f=me();let m;e[0]!==s||e[1]!==f?(m=Po(s,f),e[0]=s,e[1]=f,e[2]=m):m=e[2];const x=m;let g;if(e[3]!==b||e[4]!==s||e[5]!==d||e[6]!==x||e[7]!==c||e[8]!==u||e[9]!==l||e[10]!==o||e[11]!==i||e[12]!==n||e[13]!==f||e[14]!==p){const w=So(s,f,p),j=b&&w.length===0&&s.status==="edited",v=n&&"border-foreground/30 bg-accent hover:bg-secondary-hover";let P;e[16]!==v?(P=K("cursor-pointer transition-colors hover:bg-accent",v),e[16]=v,e[17]=P):P=e[17];let S;e[18]!==s?(S=ke(s),e[18]=s,e[19]=S):S=e[19];let k;e[20]!==s||e[21]!==f?(k=wo(s,f),e[20]=s,e[21]=f,e[22]=k):k=e[22];let N;e[23]!==s.cmsSettings||e[24]!==s.name||e[25]!==f?(N=s.cmsSettings?f("thread.publishPopover.settings"):s.name,e[23]=s.cmsSettings,e[24]=s.name,e[25]=f,e[26]=N):N=e[26];let C;e[27]!==N?(C=a.jsx("span",{className:"truncate text-sm font-medium",children:N}),e[27]=N,e[28]=C):C=e[28];let y;e[29]!==x?(y=x?a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:x}):null,e[29]=x,e[30]=y):y=e[30];let A;e[31]!==n||e[32]!==C||e[33]!==y?(A=a.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left","aria-pressed":n,children:[C,y]}),e[31]=n,e[32]=C,e[33]=y,e[34]=A):A=e[34];let D;e[35]!==d||e[36]!==c||e[37]!==u||e[38]!==l||e[39]!==o||e[40]!==f?(D=d?a.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[a.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground",onClick:O=>{O.stopPropagation(),l(!1)},children:f("thread.publishDialog.cancel")}),a.jsx("button",{type:"button",className:"text-xs font-medium text-destructive disabled:opacity-50",onClick:O=>{O.stopPropagation(),l(!1),o?.()},disabled:c,children:f("thread.publishPopover.discard")})]}):o?a.jsx(Us,{children:a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx(ve,{type:"button",variant:"ghost-destructive",size:"icon-xs","aria-label":f("thread.publishPopover.discard"),className:"shrink-0 disabled:pointer-events-auto",onClick:O=>{O.stopPropagation(),l(!0)},disabled:u||c,children:a.jsx(qs,{className:"size-3.5"})})}),a.jsx(nt,{children:f("thread.publishPopover.discard")})]})}):null,e[35]=d,e[36]=c,e[37]=u,e[38]=l,e[39]=o,e[40]=f,e[41]=D):D=e[41];let I;e[42]!==A||e[43]!==D||e[44]!==k?(I=a.jsxs("div",{className:"flex items-center gap-2.5",children:[k,A,D]}),e[42]=A,e[43]=D,e[44]=k,e[45]=I):I=e[45],g=a.jsxs(sa,{className:P,"data-change-id":S,onClick:i,children:[I,w.length>0?a.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px] text-xs text-muted-foreground",children:w.map(ko)}):j?a.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px]",children:a.jsx(We,{className:"h-4 w-2/3"})}):null]}),e[3]=b,e[4]=s,e[5]=d,e[6]=x,e[7]=c,e[8]=u,e[9]=l,e[10]=o,e[11]=i,e[12]=n,e[13]=f,e[14]=p,e[15]=g}else g=e[15];return g}function ko(t,e){return a.jsx("div",{className:"truncate",children:t},`${e}-${t}`)}function ha(){const t=T.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={width:-1,height:-1},t[0]=e):e=t[0];const[s,r]=H.useState(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=l=>{if(!l)return;const o=()=>r(c=>c.width===l.clientWidth&&c.height===l.clientHeight?c:{width:l.clientWidth,height:l.clientHeight});o();const u=new ResizeObserver(o);return u.observe(l),()=>u.disconnect()},t[1]=n):n=t[1];const i=n;let d;return t[2]!==s?(d=[s,i],t[2]=s,t[3]=d):d=t[3],d}function No(){return document.documentElement.classList.contains("dark")?"vs-dark":"vs"}const Co=[{width:"w-3/4",tone:"ctx"},{width:"w-1/2",tone:"del"},{width:"w-3/5",tone:"add"},{width:"w-2/5",tone:"ctx"},{width:"w-4/5",tone:"add"},{width:"w-1/2",tone:"ctx"}];function Zn(t){const e=T.c(10),{height:s}=t,r=me();let n;e[0]!==s?(n={height:s},e[0]=s,e[1]=n):n=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=Co.map(Ao),e[2]=i):i=e[2];let d;e[3]!==r?(d=r("thread.publishDialog.openingComparison"),e[3]=r,e[4]=d):d=e[4];let l;e[5]!==d?(l=a.jsx("div",{className:"flex items-center justify-center pt-1 text-2xs text-muted-foreground",children:d}),e[5]=d,e[6]=l):l=e[6];let o;return e[7]!==n||e[8]!==l?(o=a.jsxs("div",{style:n,className:"flex w-full flex-col gap-1.5 overflow-hidden px-3 py-2",children:[i,l]}),e[7]=n,e[8]=l,e[9]=o):o=e[9],o}function Ao(t,e){return a.jsxs("div",{className:K("flex items-center gap-2 rounded px-1 py-0.5",t.tone==="del"&&"bg-destructive/5",t.tone==="add"&&"bg-success/5"),children:[a.jsx("div",{className:K("h-2 w-4 shrink-0 animate-pulse rounded-sm bg-muted",t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")}),a.jsx("div",{className:K("h-2 animate-pulse rounded-sm bg-muted",t.width,t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")})]},e)}const fa={readOnly:!0,renderSideBySide:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12},Ro={...fa,lineNumbersMinChars:3,lineDecorationsWidth:4,folding:!1,glyphMargin:!1,renderOverviewRuler:!1};function Do(t){const e=T.c(11),{diff:s,emptyMessage:r,rowClassName:n,onDiscardFile:i,hideFileRows:d,editorHeight:l}=t,o=r===void 0?"No file changes in the working tree":r,u=n===void 0?"px-6":n,c=d===void 0?!1:d,h=l===void 0?"380px":l,[b,p]=H.useState(null),[f,m]=H.useState(null);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=No(),e[0]=x):x=e[0];const g=x;if(!s||Object.keys(s.diffs).length===0){let j;return e[1]!==o?(j=a.jsx("div",{className:"flex items-center justify-center py-10 text-sm text-muted-foreground",children:o}),e[1]=o,e[2]=j):j=e[2],j}let w;return e[3]!==s.diffs||e[4]!==f||e[5]!==h||e[6]!==b||e[7]!==c||e[8]!==i||e[9]!==u?(w=a.jsx("div",{className:"divide-y",children:Object.entries(s.diffs).map(j=>{const[v,P]=j,{from:S,to:k}=P,N=b===v,C=S===null,y=k===null,A=v.startsWith("/")?v.slice(1):v,D=A.lastIndexOf("/"),I=D>=0?A.slice(D+1):A,O=D>=0?A.slice(0,D):null,F=gi(v),q=C?"bg-success":y?"bg-destructive":"bg-warning";return c?a.jsx("div",{children:a.jsx(Kn,{original:S??"",modified:k??"",language:F,theme:g,height:h,loading:a.jsx(Zn,{height:h}),options:Ro})},v):a.jsxs("div",{children:[a.jsxs("div",{className:K("flex items-center gap-3 py-3 hover:bg-accent",u),children:[a.jsx("button",{type:"button",className:"flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground transition-transform hover:text-foreground",onClick:()=>p(N?null:v),children:a.jsx(dr,{className:K("h-3.5 w-3.5 transition-transform",N&&"rotate-90")})}),a.jsx("div",{className:K("h-2.5 w-2.5 shrink-0 rounded-full",q)}),a.jsx($r,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:I}),O&&a.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:O}),i?a.jsxs(_s,{children:[a.jsx(Os,{asChild:!0,children:a.jsx("button",{type:"button",className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground hover:bg-accent hover:text-foreground rounded-lg",children:a.jsx($a,{className:"h-3.5 w-3.5"})})}),a.jsx(Ms,{align:"end",children:a.jsx(Zt,{className:"text-destructive focus:text-destructive",onSelect:()=>m(v),children:"Discard changes"})})]}):null]}),f===v&&i?a.jsxs("div",{className:K("flex items-center justify-between gap-3 border-t bg-destructive/5 py-2.5",u),children:[a.jsxs("span",{className:"text-xs text-destructive",children:["Discard all changes to"," ",a.jsx("span",{className:"font-medium",children:I}),"? This cannot be undone."]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[a.jsx(ve,{type:"button",variant:"ghost",size:"sm",onClick:()=>m(null),children:"Cancel"}),a.jsx(ve,{type:"button",variant:"destructive",size:"sm",onClick:()=>{m(null),i(v)},children:"Discard"})]})]}):null,N&&a.jsx("div",{className:"border-t",children:a.jsx(Kn,{original:S??"",modified:k??"",language:F,theme:g,height:h,loading:a.jsx(Zn,{height:h}),options:fa})})]},v)})}),e[3]=s.diffs,e[4]=f,e[5]=h,e[6]=b,e[7]=c,e[8]=i,e[9]=u,e[10]=w):w=e[10],w}function To(t){if(t.kind!=="block"||t.isSiteApp||!t.blockKey)return null;const e=(t.toJson??t.fromJson)?.__resolveType;return typeof e=="string"&&Ol(e)?t.blockKey:null}function Bo(t){return t.kind!=="page"?!0:!t.pagePath||Pt(t.pagePath).length>0}function Io(t,e){try{return Ga(t,_l,e)}catch{return null}}function Fo(t,e,s){if(!e)return;const r=Ml(e,t);if(!r)return null;if(Pt(r.path).length===0||s?.path!==r.path)return r.path;const n=Pn(r.path,s.params);return Pt(n).length===0?n:r.path}function $o(t){return t.sectionKey&&!t.v8?Io(t.previewServerUrl,t.sectionKey):Eo(t.previewServerUrl,t.path)}function Lo(t,e){if(t.kind!=="page")return"/";const s=t.pagePath;if(!s)return"";if(Pt(s).length===0)return s;if(e?.path!==s)return"";const r=Pn(s,e.params);return Pt(r).length===0?r:""}function Eo(t,e){const s=e.trim();if(!s||Pt(s).length>0)return null;try{const r=new URL(t),n=new URL(s.startsWith("/")?s:`/${s}`,r);return n.origin===r.origin?n:null}catch{return null}}function Oo(t,e){return e?.kind==="pointer"&&e.link?gn(t.toString(),e.link):ma(t,e)}function ma(t,e){if(!e)return null;if(e.kind==="pointer")return gn(t.toString(),e.pointer);try{return new URL(`${t.pathname}${t.search}`,e.previewUrl).href}catch{return null}}function Mo(t,e,s){return e===null?!1:t!=="other"||s?.kind==="sandbox"}function _o(t,e){const s=e?t.kind==="page":t.kind!=="other";return{before:s&&t.status==="new"?"new":null,after:s&&t.status==="removed"?"removed":null}}const pa=H.createContext(!0),zo=["split","before","after","code"];function Uo(t){return zo.includes(t)}const ba={desktop:1280,mobile:412};function Ho(t,e){const s=(i,d)=>t.unreadable?.includes(d)?e:i?`${JSON.stringify(i,null,2)}
|
|
2
2
|
`:null,r=t.status==="new"?null:s(t.fromJson,"before"),n=t.status==="removed"?null:s(t.toJson,"after");return r===null&&n===null?{diffs:{}}:t.status==="edited"&&(r===null||n===null)?{diffs:{}}:{diffs:{[Oa(t.entry.name)]:{from:r,to:n}}}}function ga(t){const e=T.c(76),{change:s,diff:r,bodyPending:n,previewServerUrl:i,draft:d,lastPage:l,v8:o,onReady:u}=t,c=me(),h=H.use(pa),b=To(s),p=o?null:b,f=o?b:null,m=f?Fo(f,o?.blocks,l):void 0,x=f!==null&&m===null,g=Mo(s.kind,i,d)&&(f===null||typeof m=="string"),[w,j]=H.useState(null),v=g?w??"split":"code",[P,S]=H.useState("desktop"),[k,N]=H.useState(null),C=k??(f?m??"":Lo(s,l));let y;e[0]!==s?(y=Bo(s),e[0]=s,e[1]=y):y=e[1];const A=y,D=i?$o({previewServerUrl:i,sectionKey:b,path:C,v8:!!o}):null,I=D?gn(D.toString(),Wa):null,O=D?ma(D,d):null,F=D?Oo(D,d):null;let q;e[2]!==s||e[3]!==r?.diffs||e[4]!==c?(q=s.entry?Ho(s,c("thread.publishCompare.sideUnreadable")):{diffs:Object.fromEntries(s.filepaths.flatMap(J=>{const de=r?.diffs[J];return de?[[J,de]]:[]}))},e[2]=s,e[3]=r?.diffs,e[4]=c,e[5]=q):q=e[5];const E=q;let G;e[6]!==E.diffs?(G=Object.keys(E.diffs),e[6]=E.diffs,e[7]=G):G=e[7];const _=G.length>0;let W;e:{if(p!==null){W=null;break e}if(f!==null){const de=C.trim();if(!de){W=null;break e}W=Pt(de).length>0?c("thread.publishCompare.dynamicHint",{template:de}):c("thread.publishCompare.blockHint",{path:de});break e}if(s.kind!=="page"){let de;e[8]!==c?(de=c("thread.publishCompare.globalHint"),e[8]=c,e[9]=de):de=e[9],W=de;break e}let J;e[10]!==s.pagePath||e[11]!==c?(J=s.pagePath&&Pt(s.pagePath).length>0?c("thread.publishCompare.dynamicHint",{template:s.pagePath}):null,e[10]=s.pagePath,e[11]=c,e[12]=J):J=e[12],W=J}const $=W,V=_o(s,!!o),[te,X]=H.useState(qo);let ne;e[13]===Symbol.for("react.memo_cache_sentinel")?(ne=J=>X(de=>de.has(J)?de:new Set(de).add(J)),e[13]=ne):ne=e[13];const le=ne;let M;e[14]!==o?(M=J=>o?a.jsx(Go,{...J,onLoaded:le}):a.jsx(Vo,{...J}),e[14]=o,e[15]=M):M=e[15];const Y=M,Z=(g?[V.before==="new"?null:I,V.after==="removed"?null:O].flatMap(J=>J?[Dn(J,P)]:[]):[]).every(J=>te.has(J));let se;e[16]!==u||e[17]!==Z?(se=Z&&u?J=>{J&&u()}:void 0,e[16]=u,e[17]=Z,e[18]=se):se=e[18];const ie=se,ge=V.before==="new"?a.jsx(ys,{icon:a.jsx(Mr,{className:"size-5 text-brand"}),title:c("thread.publishCompare.newTitle"),description:c("thread.publishCompare.newDescription")}):Y({url:I,device:P,title:c("thread.publishCompare.before"),missing:c("thread.publishCompare.enterPath")}),ue=V.after==="removed"?a.jsx(ys,{icon:a.jsx(qs,{className:"size-5 text-destructive"}),title:c("thread.publishCompare.removedTitle"),description:c("thread.publishCompare.removedDescription")}):Y({url:O,device:P,title:c("thread.publishCompare.after"),missing:c(D?"thread.publishCompare.draftUnavailable":"thread.publishCompare.enterPath")});let re;e[19]!==g||e[20]!==j||e[21]!==h||e[22]!==c||e[23]!==v?(re=g||h?a.jsx(Br,{value:v,onValueChange:J=>{Uo(J)&&j(J)},children:a.jsxs(Tr,{className:"h-8 w-auto",variant:"pill",children:[g?a.jsxs(a.Fragment,{children:[a.jsx(Tt,{value:"split",className:"px-3 text-xs",children:c("thread.publishCompare.sideBySide")}),a.jsx(Tt,{value:"before",className:"px-3 text-xs",children:c("thread.publishCompare.before")}),a.jsx(Tt,{value:"after",className:"px-3 text-xs",children:c("thread.publishCompare.after")})]}):null,h?a.jsx(Tt,{value:"code",className:"px-3 text-xs",children:c("thread.publishCompare.code")}):null]})}):null,e[19]=g,e[20]=j,e[21]=h,e[22]=c,e[23]=v,e[24]=re):re=e[24];let fe;e[25]!==F||e[26]!==g||e[27]!==s.pagePath||e[28]!==P||e[29]!==C||e[30]!==A||e[31]!==p||e[32]!==S||e[33]!==N||e[34]!==c||e[35]!==v?(fe=g&&v!=="code"?a.jsxs(a.Fragment,{children:[p?null:A?a.jsx(La,{value:C,onChange:J=>N(J.target.value),placeholder:s.pagePath??"/","aria-label":c("thread.publishCompare.pathLabel"),className:"h-8 w-56 font-mono text-xs"}):a.jsx("span",{className:"max-w-56 truncate px-1 font-mono text-xs text-muted-foreground",children:C}),a.jsxs("div",{className:"flex items-center rounded-lg border p-0.5",children:[a.jsx(er,{active:P==="desktop",label:c("thread.publishCompare.desktop"),onClick:()=>S("desktop"),children:a.jsx(xi,{className:"size-3.5"})}),a.jsx(er,{active:P==="mobile",label:c("thread.publishCompare.mobile"),onClick:()=>S("mobile"),children:a.jsx(ml,{className:"size-3.5"})})]}),F?a.jsxs("a",{href:F,target:"_blank",rel:"noopener noreferrer",className:"ml-auto flex items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[a.jsx(Ea,{className:"size-3.5"}),c("thread.publishCompare.openDraft")]}):null]}):null,e[25]=F,e[26]=g,e[27]=s.pagePath,e[28]=P,e[29]=C,e[30]=A,e[31]=p,e[32]=S,e[33]=N,e[34]=c,e[35]=v,e[36]=fe):fe=e[36];let ye;e[37]!==re||e[38]!==fe?(ye=a.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b bg-background px-4 py-2.5 max-md:pr-12",children:[re,fe]}),e[37]=re,e[38]=fe,e[39]=ye):ye=e[39];let z;e[40]!==g||e[41]!==$||e[42]!==v?(z=$&&g&&v!=="code"?a.jsx("p",{className:"border-b bg-background px-4 py-1.5 text-2xs text-muted-foreground",children:$}):null,e[40]=g,e[41]=$,e[42]=v,e[43]=z):z=e[43];let oe;e[44]!==x||e[45]!==h||e[46]!==c?(oe=x&&h?a.jsx("p",{className:"border-b bg-background px-4 py-1.5 text-2xs text-muted-foreground",children:c("thread.publishCompare.notOnAnyPage")}):null,e[44]=x,e[45]=h,e[46]=c,e[47]=oe):oe=e[47];let xe;e[48]!==i||e[49]!==h||e[50]!==c||e[51]!==f||e[52]!==m||e[53]!==v?(xe=v==="code"&&!h?f!==null&&m===void 0?a.jsx(We,{className:"m-4 h-64 rounded"}):i===null?a.jsx(ys,{icon:a.jsx(Is,{className:"size-5 text-muted-foreground"}),title:c("thread.publishCompare.previewNotReadyTitle"),description:c("thread.publishCompare.draftUnavailable")}):a.jsx(ys,{icon:a.jsx(Is,{className:"size-5 text-muted-foreground"}),title:c("thread.publishCompare.noPreviewTitle"),description:c("thread.publishCompare.noPreviewDescription")}):null,e[48]=i,e[49]=h,e[50]=c,e[51]=f,e[52]=m,e[53]=v,e[54]=xe):xe=e[54];let Q;e[55]!==n||e[56]!==_||e[57]!==E||e[58]!==h||e[59]!==c||e[60]!==v?(Q=v==="code"&&h?a.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto bg-background [scrollbar-width:thin]",children:_?a.jsx(Do,{diff:E,hideFileRows:!0,editorHeight:"70vh"}):n?a.jsx(We,{className:"m-4 h-64 rounded"}):a.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:c("thread.publishPopover.detailsUnavailable")})}):null,e[55]=n,e[56]=_,e[57]=E,e[58]=h,e[59]=c,e[60]=v,e[61]=Q):Q=e[61];let ee;e[62]!==ue||e[63]!==ge||e[64]!==g||e[65]!==c||e[66]!==v?(ee=g?a.jsxs("div",{className:K("flex min-h-0 flex-1 gap-3 p-3",v==="code"&&"hidden"),children:[a.jsx(tr,{label:c("thread.publishCompare.before"),hidden:v==="after",children:ge}),a.jsx(tr,{label:c("thread.publishCompare.after"),highlight:!0,hidden:v==="before",children:ue})]}):null,e[62]=ue,e[63]=ge,e[64]=g,e[65]=c,e[66]=v,e[67]=ee):ee=e[67];let ce;return e[68]!==ie||e[69]!==ye||e[70]!==z||e[71]!==oe||e[72]!==xe||e[73]!==Q||e[74]!==ee?(ce=a.jsxs("div",{ref:ie,className:"flex min-h-0 min-w-0 flex-1 flex-col bg-muted/40",children:[ye,z,oe,xe,Q,ee]}),e[68]=ie,e[69]=ye,e[70]=z,e[71]=oe,e[72]=xe,e[73]=Q,e[74]=ee,e[75]=ce):ce=e[75],ce}function qo(){return new Set}function er(t){const e=T.c(8),{active:s,label:r,onClick:n,children:i}=t,d=s&&"bg-accent text-foreground";let l;e[0]!==d?(l=K("flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-foreground",d),e[0]=d,e[1]=l):l=e[1];let o;return e[2]!==s||e[3]!==i||e[4]!==r||e[5]!==n||e[6]!==l?(o=a.jsx("button",{type:"button","aria-label":r,"aria-pressed":s,title:r,onClick:n,className:l,children:i}),e[2]=s,e[3]=i,e[4]=r,e[5]=n,e[6]=l,e[7]=o):o=e[7],o}function tr(t){const e=T.c(18),{label:s,highlight:r,hidden:n,children:i}=t,d=r===void 0?!1:r,o=(n===void 0?!1:n)&&"hidden";let u;e[0]!==o?(u=K("flex min-h-0 min-w-0 flex-1 flex-col gap-1.5",o),e[0]=o,e[1]=u):u=e[1];const c=d&&"bg-brand";let h;e[2]!==c?(h=K("size-1.5 rounded-full bg-muted-foreground/50",c),e[2]=c,e[3]=h):h=e[3];let b;e[4]!==h?(b=a.jsx("span",{className:h}),e[4]=h,e[5]=b):b=e[5];let p;e[6]!==s||e[7]!==b?(p=a.jsxs("div",{className:"flex items-center gap-1.5 px-0.5 text-2xs font-medium text-muted-foreground",children:[b,s]}),e[6]=s,e[7]=b,e[8]=p):p=e[8];const f=d&&"border-brand/60";let m;e[9]!==f?(m=K("relative min-h-0 flex-1 overflow-hidden rounded-lg border bg-background",f),e[9]=f,e[10]=m):m=e[10];let x;e[11]!==i||e[12]!==m?(x=a.jsx("div",{className:m,children:i}),e[11]=i,e[12]=m,e[13]=x):x=e[13];let g;return e[14]!==x||e[15]!==u||e[16]!==p?(g=a.jsxs("div",{className:u,children:[p,x]}),e[14]=x,e[15]=u,e[16]=p,e[17]=g):g=e[17],g}function ys(t){const e=T.c(10),{icon:s,title:r,description:n}=t;let i;e[0]!==s?(i=a.jsx("div",{className:"mb-1",children:s}),e[0]=s,e[1]=i):i=e[1];let d;e[2]!==r?(d=a.jsx("p",{className:"text-sm font-medium",children:r}),e[2]=r,e[3]=d):d=e[3];let l;e[4]!==n?(l=a.jsx("p",{className:"text-xs text-muted-foreground",children:n}),e[4]=n,e[5]=l):l=e[5];let o;return e[6]!==i||e[7]!==d||e[8]!==l?(o=a.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-1 px-6 text-center",children:[i,d,l]}),e[6]=i,e[7]=d,e[8]=l,e[9]=o):o=e[9],o}function Ko(t,e){if(!t)return{visibility:"hidden",width:e};const s=Math.min(t.width/e,1);return{left:Math.max((t.width-e*s)/2,0),width:e,height:t.height/s,transform:`scale(${s})`,transformOrigin:"top left"}}function Vo(t){const e=T.c(24),{url:s,device:r,title:n,missing:i}=t,[d,l]=ha(),[o,u]=H.useState(null);if(!s){let S;return e[0]!==i?(S=a.jsx("p",{className:"flex h-full items-center justify-center px-6 text-center text-xs text-muted-foreground",children:i}),e[0]=i,e[1]=S):S=e[1],S}let c;e[2]!==r||e[3]!==s?(c=Dn(s,r),e[2]=r,e[3]=s,e[4]=c):c=e[4];const h=c,b=ba[r],p=d.width>0?Math.min(d.width/b,1):1,f=d.width>0?Math.max((d.width-b*p)/2,0):0;let m;e[5]!==h?(m=()=>u(h),e[5]=h,e[6]=m):m=e[6];const x=d.height>0?d.height/p:"100%",g=`scale(${p})`;let w;e[7]!==b||e[8]!==f||e[9]!==x||e[10]!==g?(w={left:f,width:b,height:x,transform:g,transformOrigin:"top left"},e[7]=b,e[8]=f,e[9]=x,e[10]=g,e[11]=w):w=e[11];let j;e[12]!==h||e[13]!==m||e[14]!==w||e[15]!==n?(j=a.jsx("iframe",{src:h,title:n,sandbox:"allow-scripts allow-same-origin",onLoad:m,className:"absolute top-0 border-0 bg-white",style:w},h),e[12]=h,e[13]=m,e[14]=w,e[15]=n,e[16]=j):j=e[16];let v;e[17]!==o||e[18]!==h?(v=o!==h?a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/60",children:a.jsx(es,{className:"size-5 motion-reduce:animate-none"})}):null,e[17]=o,e[18]=h,e[19]=v):v=e[19];let P;return e[20]!==l||e[21]!==j||e[22]!==v?(P=a.jsxs("div",{ref:l,className:"absolute inset-0",children:[j,v]}),e[20]=l,e[21]=j,e[22]=v,e[23]=P):P=e[23],P}function Go(t){const e=T.c(21),{url:s,device:r,title:n,missing:i,onLoaded:d}=t,[l,o]=ha(),[u,c]=H.useState(null),[h,b]=H.useState(null),p=l.width>0&&l.height>0;p&&(u?.width!==l.width||u?.height!==l.height)&&c(l);const f=p?l:u;if(!s){let P;return e[0]!==i?(P=a.jsx("p",{className:"flex h-full items-center justify-center px-6 text-center text-xs text-muted-foreground",children:i}),e[0]=i,e[1]=P):P=e[1],P}let m,x,g,w;if(e[2]!==f||e[3]!==r||e[4]!==d||e[5]!==o||e[6]!==h||e[7]!==n||e[8]!==s){const P=Dn(s,r),S=ba[r];m=h?.src!==P;const k=[...h&&m?[h]:[],{src:P,logicalWidth:S}];x=o,g="absolute inset-0",w=k.map(N=>{const C=N.src===P&&m;return a.jsx("iframe",{src:N.src,title:n,"aria-hidden":C&&h?!0:void 0,sandbox:"allow-scripts allow-same-origin",onLoad:()=>{N.src===P&&(b(N),d?.(N.src))},className:K("absolute top-0 border-0 bg-white",C&&"pointer-events-none opacity-0"),style:Ko(f,N.logicalWidth)},N.src)}),e[2]=f,e[3]=r,e[4]=d,e[5]=o,e[6]=h,e[7]=n,e[8]=s,e[9]=m,e[10]=x,e[11]=g,e[12]=w}else m=e[9],x=e[10],g=e[11],w=e[12];let j;e[13]!==m||e[14]!==h?(j=m?h?a.jsx(es,{className:"absolute right-2 top-2 size-4 text-muted-foreground motion-reduce:animate-none"}):a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/60",children:a.jsx(es,{className:"size-5 motion-reduce:animate-none"})}):null,e[13]=m,e[14]=h,e[15]=j):j=e[15];let v;return e[16]!==x||e[17]!==g||e[18]!==w||e[19]!==j?(v=a.jsxs("div",{ref:x,className:g,children:[w,j]}),e[16]=x,e[17]=g,e[18]=w,e[19]=j,e[20]=v):v=e[20],v}const Wo=/^Co-authored-by:\s*([^<\r\n]+?)(?:\s*<[^>\r\n]*>)?\s*$/im;function Qo(t){if(!t)return null;const e=Wo.exec(t)?.[1]?.trim();return e||null}function Jo(t){return/\[bot\]$/i.test(t)||/-bot$/i.test(t)}function Xo(t){const e=Qo(t.body);if(e)return e;const s=t.author.trim();return!s||Jo(s)?null:s}function Yo(t,e,s,r,n,i){return["cms-publish-bodies",t,e,s,r,n,i]}const Zo=6e4;function ec(t,e){return e?null:t.files.map(s=>`${s.index}${s.working_dir} ${s.path}`).sort().join(`
|
|
3
3
|
`)}function tc(t,e,s){const r=T.c(6);let n;r[0]!==s||r[1]!==t||r[2]!==e?(n=ns.decofile(`${t}/${e}/${s}`),r[0]=s,r[1]=t,r[2]=e,r[3]=n):n=r[3];let i;r[4]!==n?(i={queryKey:n,queryFn:hn},r[4]=n,r[5]=i):i=r[5];const{data:d}=ft(i);return d}function xa(t){const{orgSlug:e,virtualMcpId:s,branch:r,threadId:n,baseBranch:i,fastPreview:d,recoverSandbox:l}=t,o={orgSlug:e,virtualMcpId:s,branch:r,threadId:n},u=d?{fastPreview:!0}:void 0,c=H.useRef(null),h=async P=>{try{return await P()}catch(S){if(!l||!Qr(S))throw S;return c.current??=l(),await c.current,P()}},b=fr({...Nn(o),queryFn:()=>h(()=>Jr(o))}),p=b.data,f=p.changedFiles??null,m=p.headSha??null,x=f?f.length>0:li(p)||ii(p),g=ft({queryKey:Yo(e,s,r,i,m,ec(p,d)),queryFn:()=>h(()=>oi(o,p,i,u)),enabled:x,staleTime:d?Zo:0,gcTime:d?void 0:0,throwOnError:(P,S)=>!f&&S.state.data===void 0}),w=tc(e,s,r),j=g.data??null,v=f?oa({files:f,lookup:w,diff:j}):ho(j);return{status:p,summary:v,allPaths:f?f.map(P=>P.path):Object.keys(j?.diffs??{}),discardablePaths:d?null:new Set(p.files.map(P=>P.path)),changedFilesTotal:p.changedFilesTotal??v.count,changedFilesTruncated:p.changedFilesTruncated??!1,headSha:m,diff:j,bodiesPending:x&&g.isPending,bodiesFailed:g.isError,cardsPending:!f&&x&&g.isPending,refresh:()=>Promise.all([b.refetch(),d?null:g.refetch()])}}function sc(t){const e=T.c(4);let s;e[0]!==t?(s=ns.decofile(t),e[0]=t,e[1]=s):s=e[1];let r;e[2]!==s?(r={queryKey:s,queryFn:hn},e[2]=s,e[3]=r):r=e[3];const{data:n}=ft(r);return n}function nc(t,e){const s=T.c(5);let r;s[0]!==t||s[1]!==e?(r=e?Ja(e,t):ns.liveMeta("","no-scope"),s[0]=t,s[1]=e,s[2]=r):r=s[2];let n;s[3]!==r?(n={queryKey:r,queryFn:hn},s[3]=r,s[4]=n):n=s[4];const{data:i}=ft(n);return i}function Fn(t){const e=T.c(27),{backend:s,cacheKey:r,scope:n}=t,i=mr();let d;e[0]!==r?(d=ns.contentChanges(r),e[0]=r,e[1]=d):d=e[1];let l;e[2]!==s.client||e[3]!==r||e[4]!==i?(l=()=>Xa(i,s.client,r),e[2]=s.client,e[3]=r,e[4]=i,e[5]=l):l=e[5];let o;e[6]!==d||e[7]!==l?(o={queryKey:d,queryFn:l,staleTime:0},e[6]=d,e[7]=l,e[8]=o):o=e[8];const u=fr(o),c=u.data,h=Qa(s,r,c),b=sc(r),p=nc(s,n),f=h.data??null,m=s.source==="github";let x;e[9]!==c.changes||e[10]!==b||e[11]!==p||e[12]!==f||e[13]!==m?(x=yo({changes:c.changes,sides:f,lookup:b,meta:p,hosted:m}),e[9]=c.changes,e[10]=b,e[11]=p,e[12]=f,e[13]=m,e[14]=x):x=e[14];const g=x;let w;e[15]!==c.changes?(w=Object.entries(c.changes).map(rc),e[15]=c.changes,e[16]=w):w=e[16];const j=g.count>0&&h.isPending,v=b??null;let P;e[17]!==u?(P=()=>u.refetch(),e[17]=u,e[18]=P):P=e[18];let S;return e[19]!==c||e[20]!==h.isError||e[21]!==g||e[22]!==w||e[23]!==j||e[24]!==v||e[25]!==P?(S={changes:c,summary:g,entries:w,sidesPending:j,sidesFailed:h.isError,blocks:v,refresh:P},e[19]=c,e[20]=h.isError,e[21]=g,e[22]=w,e[23]=j,e[24]=v,e[25]=P,e[26]=S):S=e[26],S}function rc(t){const[e,s]=t;return{name:e,version:s.version}}function ac(t){return["smart-review-verdict",t.orgSlug,t.virtualMcpId,t.branch,t.threadId,t.fastPreview?"fast-preview-upstream":"sandbox",t.signature,t.language]}function lc(t){const e=T.c(27),{orgSlug:s,virtualMcpId:r,branch:n,threadId:i,fastPreview:d,status:l,diff:o,enabled:u}=t,[c]=pr(),{language:h}=c;let b,p,f;if(e[0]!==n||e[1]!==o||e[2]!==u||e[3]!==d||e[4]!==h||e[5]!==s||e[6]!==l||e[7]!==i||e[8]!==r){const P=o?Cn(o):"";b=u&&!!n&&!!l&&!!o&&P!=="",f=ft,p=ac({orgSlug:s,virtualMcpId:r,branch:n,threadId:i,fastPreview:d,signature:P,language:h}),e[0]=n,e[1]=o,e[2]=u,e[3]=d,e[4]=h,e[5]=s,e[6]=l,e[7]=i,e[8]=r,e[9]=b,e[10]=p,e[11]=f}else b=e[9],p=e[10],f=e[11];let m;e[12]!==n||e[13]!==o||e[14]!==h||e[15]!==s||e[16]!==l||e[17]!==i||e[18]!==r?(m=()=>ci({orgSlug:s,virtualMcpId:r,branch:n,threadId:i},{status:l,diff:o,language:h}),e[12]=n,e[13]=o,e[14]=h,e[15]=s,e[16]=l,e[17]=i,e[18]=r,e[19]=m):m=e[19];let x;e[20]!==b||e[21]!==p||e[22]!==m?(x={queryKey:p,queryFn:m,enabled:b,staleTime:1/0,gcTime:6e5,retry:ic},e[20]=b,e[21]=p,e[22]=m,e[23]=x):x=e[23];const g=f(x),w=g.data??null,j=b&&g.isFetching&&!g.data;let v;return e[24]!==w||e[25]!==j?(v={verdict:w,loading:j},e[24]=w,e[25]=j,e[26]=v):v=e[26],v}function ic(t,e){return!Qr(e)&&t<1}function va(t){const e=T.c(30),{orgSlug:s,virtualMcpId:r,branch:n,threadId:i,fastPreview:d,status:l,diff:o,policy:u,judgeEnabled:c,paths:h}=t,b=c===void 0?!0:c,p=h===void 0?null:h;let f;e[0]!==o||e[1]!==b||e[2]!==u?(f=b&&di(o,u),e[0]=o,e[1]=b,e[2]=u,e[3]=f):f=e[3];const m=f;let x;e[4]!==n||e[5]!==o||e[6]!==d||e[7]!==m||e[8]!==s||e[9]!==l||e[10]!==i||e[11]!==r?(x={orgSlug:s,virtualMcpId:r,branch:n,threadId:i,fastPreview:d,status:l,diff:o,enabled:m},e[4]=n,e[5]=o,e[6]=d,e[7]=m,e[8]=s,e[9]=l,e[10]=i,e[11]=r,e[12]=x):x=e[12];const{verdict:g,loading:w}=lc(x);if(!o&&p){let S;e[13]!==p||e[14]!==u?(S=ui(p,u),e[13]=p,e[14]=u,e[15]=S):S=e[15];let k;return e[16]!==S?(k={gate:S,ready:!1},e[16]=S,e[17]=k):k=e[17],k}if(!o){let S;return e[18]===Symbol.for("react.memo_cache_sentinel")?(S={gate:{allowed:!0,reason:null},ready:!1},e[18]=S):S=e[18],S}if(!m){let S;e[19]!==o||e[20]!==u?(S=hi(o,u),e[19]=o,e[20]=u,e[21]=S):S=e[21];let k;return e[22]!==S?(k={gate:S,ready:!0},e[22]=S,e[23]=k):k=e[23],k}let j;e[24]!==w||e[25]!==g?(j=fi(g,w),e[24]=w,e[25]=g,e[26]=j):j=e[26];const v=!w;let P;return e[27]!==j||e[28]!==v?(P={gate:j,ready:v},e[27]=j,e[28]=v,e[29]=P):P=e[29],P}function oc(t){return["main","master"].includes(t.trim().toLowerCase())}function cc(t,e,s,r){return t===0?r("thread.publishPopover.publish"):s||!oc(e)?t===1?r("thread.publishPopover.publishOne"):r("thread.publishPopover.publishCount",{count:t}):t===1?r("thread.publishPopover.publishOneInProduction"):r("thread.publishPopover.publishCountInProduction",{count:t})}const dc=2500;function uc(t){const{selectedId:e,readyIds:s,lastShownId:r,liveIds:n}=t;return e===null||s.has(e)?e:r!==null&&r!==e&&n.includes(r)?r:e}function ya(t){const e=T.c(16),s=H.useRef(!1),r=me();let n;e[0]!==t?(n=h=>{!h&&s.current||t.onOpenChange(h)},e[0]=t,e[1]=n):n=e[1];const i=n;let d;e[2]!==t.mode||e[3]!==r?(d=t.mode==="review"?r("thread.publishPopover.submitForReview"):r("thread.publishPopover.publish"),e[2]=t.mode,e[3]=r,e[4]=d):d=e[4];let l;e[5]!==d?(l=a.jsx(gr,{className:"sr-only",children:d}),e[5]=d,e[6]=l):l=e[6];let o;e[7]!==t?(o=a.jsx(hc,{...t,publishLockRef:s}),e[7]=t,e[8]=o):o=e[8];let u;e[9]!==l||e[10]!==o?(u=a.jsxs(xr,{"aria-describedby":void 0,className:"flex h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] max-w-none flex-col md:flex-row md:h-[calc(100dvh-6rem)] md:w-[calc(100vw-6rem)] gap-0 overflow-hidden p-0 sm:max-w-none",closeButtonClassName:"top-3.5 right-3.5",children:[l,o]}),e[9]=l,e[10]=o,e[11]=u):u=e[11];let c;return e[12]!==i||e[13]!==t.open||e[14]!==u?(c=a.jsx(br,{open:t.open,onOpenChange:i,children:u}),e[12]=i,e[13]=t.open,e[14]=u,e[15]=c):c=e[15],c}function hc(t){const e=T.c(3),s=kt(t.virtualMcpId,t.branch),r=s.kind==="protocol"&&s.source==="github";let n;return e[0]!==r||e[1]!==t?(n=to({open:t.open,hosted:r})?a.jsx(pc,{...t}):null,e[0]=r,e[1]=t,e[2]=n):n=e[2],n}const fc=4,ss="flex h-[45%] min-h-0 min-w-0 shrink-0 md:h-auto md:flex-1";function ms(t){const e=T.c(5),{list:s,pane:r}=t;let n;e[0]!==s?(n=a.jsx("div",{className:"flex min-h-0 w-full flex-1 flex-col max-md:border-t md:w-[380px] md:flex-none md:shrink-0 md:border-l md:[&>[data-publish-state]>:first-child]:pr-12",children:s}),e[0]=s,e[1]=n):n=e[1];let i;return e[2]!==r||e[3]!==n?(i=a.jsxs(a.Fragment,{children:[r,n]}),e[2]=r,e[3]=n,e[4]=i):i=e[4],i}function $n(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx("div",{className:K(ss,"bg-muted/40 p-3"),children:a.jsx(We,{className:"h-full w-full rounded-lg"})}),t[0]=e):e=t[0],e}function Ln(t){const e=T.c(11),{mode:s,title:r,subLine:n,trailing:i}=t,d=s==="review"?Hs:pl;let l;e[0]!==d?(l=a.jsx(d,{className:"size-4 shrink-0 text-muted-foreground"}),e[0]=d,e[1]=l):l=e[1];let o;e[2]!==l||e[3]!==r||e[4]!==i?(o=a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[l,r,i]}),e[2]=l,e[3]=r,e[4]=i,e[5]=o):o=e[5];let u;e[6]!==n?(u=n?a.jsx("div",{className:"pl-6 text-xs text-muted-foreground",children:n}):null,e[6]=n,e[7]=u):u=e[7];let c;return e[8]!==o||e[9]!==u?(c=a.jsxs(a.Fragment,{children:[o,u]}),e[8]=o,e[9]=u,e[10]=c):c=e[10],c}function En(t){const e=T.c(9),{draftPreviewUrl:s,t:r}=t;let n;e[0]!==s?(n=()=>{s&&window.open(s,"_blank","noopener,noreferrer")},e[0]=s,e[1]=n):n=e[1];const i=!s;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(Is,{className:"size-4"}),e[2]=d):d=e[2];let l;e[3]!==r?(l=r("thread.publishPopover.preview"),e[3]=r,e[4]=l):l=e[4];let o;return e[5]!==n||e[6]!==i||e[7]!==l?(o=a.jsxs(ve,{type:"button",variant:"outline",onClick:n,disabled:i,children:[d,l]}),e[5]=n,e[6]=i,e[7]=l,e[8]=o):o=e[8],o}function ja(t){const e=T.c(21),{mode:s,draftPreviewUrl:r}=t,n=me();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx($n,{}),e[0]=i):i=e[0];let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(We,{className:"h-3.5 w-48"}),e[1]=d):d=e[1];let l;e[2]!==s?(l=a.jsx(Ln,{mode:s,title:d}),e[2]=s,e[3]=l):l=e[3];let o,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(hs,{children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Bt,{}),a.jsx(Bt,{}),a.jsx(Bt,{})]})}),u=a.jsxs(a.Fragment,{children:[a.jsx(We,{className:"h-3 w-20"}),a.jsx(We,{className:"h-14 w-full rounded-lg"})]}),e[4]=o,e[5]=u):(o=e[4],u=e[5]);let c;e[6]!==r||e[7]!==n?(c=a.jsx(En,{draftPreviewUrl:r,t:n}),e[6]=r,e[7]=n,e[8]=c):c=e[8];const h=s==="review"?"default":"brand";let b;e[9]!==s||e[10]!==n?(b=n(s==="review"?"thread.publishPopover.submitForReview":"thread.publishPopover.publish"),e[9]=s,e[10]=n,e[11]=b):b=e[11];let p;e[12]!==h||e[13]!==b?(p=a.jsx(ve,{type:"button",variant:h,className:"flex-1",disabled:!0,children:b}),e[12]=h,e[13]=b,e[14]=p):p=e[14];let f;e[15]!==c||e[16]!==p?(f=a.jsxs("div",{className:"flex gap-2",children:[c,p]}),e[15]=c,e[16]=p,e[17]=f):f=e[17];let m;return e[18]!==f||e[19]!==l?(m=a.jsx(ms,{pane:i,list:a.jsx(Gs,{state:"loading",header:l,body:o,note:u,footer:f})}),e[18]=f,e[19]=l,e[20]=m):m=e[20],m}function mc(t){const e=T.c(26),{mode:s,draftPreviewUrl:r,message:n,onRetry:i}=t,d=me();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx("div",{className:K(ss,"bg-muted/40")}),e[0]=l):l=e[0];let o;e[1]!==d?(o=d("thread.publishPopover.loadFailed"),e[1]=d,e[2]=o):o=e[2];let u;e[3]!==o?(u=a.jsx("span",{className:"truncate",children:o}),e[3]=o,e[4]=u):u=e[4];let c;e[5]!==s||e[6]!==u?(c=a.jsx(Ln,{mode:s,title:u}),e[5]=s,e[6]=u,e[7]=c):c=e[7];let h;e[8]!==n?(h=a.jsx("p",{className:"px-4 py-6 text-xs text-destructive",children:n}),e[8]=n,e[9]=h):h=e[9];let b;e[10]!==r||e[11]!==d?(b=a.jsx(En,{draftPreviewUrl:r,t:d}),e[10]=r,e[11]=d,e[12]=b):b=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsx(mn,{className:"size-4"}),e[13]=p):p=e[13];let f;e[14]!==d?(f=d("thread.publishPopover.retry"),e[14]=d,e[15]=f):f=e[15];let m;e[16]!==i||e[17]!==f?(m=a.jsxs(ve,{type:"button",variant:"outline",className:"flex-1",onClick:i,children:[p,f]}),e[16]=i,e[17]=f,e[18]=m):m=e[18];let x;e[19]!==b||e[20]!==m?(x=a.jsxs("div",{className:"flex gap-2",children:[b,m]}),e[19]=b,e[20]=m,e[21]=x):x=e[21];let g;return e[22]!==x||e[23]!==c||e[24]!==h?(g=a.jsx(ms,{pane:l,list:a.jsx(Gs,{state:"ready",header:c,body:h,footer:x})}),e[22]=x,e[23]=c,e[24]=h,e[25]=g):g=e[25],g}function pc(t){const e=T.c(3),s=t.mode??"publish";let r;return e[0]!==s||e[1]!==t?(r=a.jsx(vr,{children:n=>{const{reset:i}=n;return a.jsx(yr,{fallback:d=>{const{error:l,resetError:o}=d;return a.jsx(mc,{mode:s,draftPreviewUrl:t.draftPreviewUrl,message:l?.message??"",onRetry:()=>{i(),o()}})},children:a.jsx(H.Suspense,{fallback:a.jsx(ja,{mode:s,draftPreviewUrl:t.draftPreviewUrl}),children:a.jsx(bc,{...t})})})}}),e[0]=s,e[1]=t,e[2]=r):r=e[2],r}function bc(t){const e=T.c(13),s=kt(t.virtualMcpId,t.branch);let r;e[0]!==t.branch||e[1]!==t.orgSlug||e[2]!==t.virtualMcpId?(r={orgSlug:t.orgSlug,virtualMcpId:t.virtualMcpId,branch:t.branch},e[0]=t.branch,e[1]=t.orgSlug,e[2]=t.virtualMcpId,e[3]=r):r=e[3];const n=xn(r);if(s.kind==="protocol"&&n){let d;return e[4]!==s||e[5]!==n||e[6]!==t?(d=s.source==="sandbox"?a.jsx(vc,{...t,backend:s,cacheKey:n}):a.jsx(xc,{...t,backend:s,cacheKey:n}),e[4]=s,e[5]=n,e[6]=t,e[7]=d):d=e[7],d}if(s.kind!=="legacy"){const d=t.mode??"publish";let l;return e[8]!==t.draftPreviewUrl||e[9]!==d?(l=a.jsx(ja,{mode:d,draftPreviewUrl:t.draftPreviewUrl}),e[8]=t.draftPreviewUrl,e[9]=d,e[10]=l):l=e[10],l}let i;return e[11]!==t?(i=a.jsx(gc,{...t}),e[11]=t,e[12]=i):i=e[12],i}function gc(t){const e=T.c(52),s=It()?.taskId??null;let r;e[0]!==t.baseBranch||e[1]!==t.branch||e[2]!==t.fastPreview||e[3]!==t.orgSlug||e[4]!==t.recoverSandbox||e[5]!==t.virtualMcpId||e[6]!==s?(r={orgSlug:t.orgSlug,virtualMcpId:t.virtualMcpId,branch:t.branch,threadId:s,baseBranch:t.baseBranch,fastPreview:t.fastPreview,recoverSandbox:t.recoverSandbox},e[0]=t.baseBranch,e[1]=t.branch,e[2]=t.fastPreview,e[3]=t.orgSlug,e[4]=t.recoverSandbox,e[5]=t.virtualMcpId,e[6]=s,e[7]=r):r=e[7];const n=xa(r),i=t.mode!=="review";let d;e[8]!==t.branch||e[9]!==t.fastPreview||e[10]!==t.orgSlug||e[11]!==t.publishPolicy||e[12]!==t.virtualMcpId||e[13]!==n.allPaths||e[14]!==n.diff||e[15]!==n.status||e[16]!==i||e[17]!==s?(d={orgSlug:t.orgSlug,virtualMcpId:t.virtualMcpId,branch:t.branch,threadId:s,fastPreview:t.fastPreview,status:n.status,diff:n.diff,paths:n.allPaths,policy:t.publishPolicy,judgeEnabled:i},e[8]=t.branch,e[9]=t.fastPreview,e[10]=t.orgSlug,e[11]=t.publishPolicy,e[12]=t.virtualMcpId,e[13]=n.allPaths,e[14]=n.diff,e[15]=n.status,e[16]=i,e[17]=s,e[18]=d):d=e[18];const{gate:l}=va(d),o=n.discardablePaths;let u;e[19]!==o?(u=w=>o===null||w.every(j=>o.has(j)),e[19]=o,e[20]=u):u=e[20];const c=u;let h;e[21]!==c?(h=w=>c(w.filepaths),e[21]=c,e[22]=h):h=e[22];let b;e[23]!==c||e[24]!==n.allPaths||e[25]!==n.changedFilesTruncated?(b=!n.changedFilesTruncated&&c(n.allPaths),e[23]=c,e[24]=n.allPaths,e[25]=n.changedFilesTruncated,e[26]=b):b=e[26];let p;e[27]!==t.branch||e[28]!==n.status?(p=An(n.status)??t.branch,e[27]=t.branch,e[28]=n.status,e[29]=p):p=e[29];const f=n.headSha??void 0;let m;e[30]!==t.fastPreview||e[31]!==n.diff?(m=!t.fastPreview&&n.diff?{expectedDiffSignature:Cn(n.diff)}:{},e[30]=t.fastPreview,e[31]=n.diff,e[32]=m):m=e[32];let x;e[33]!==l||e[34]!==n.allPaths||e[35]!==n.bodiesFailed||e[36]!==n.bodiesPending||e[37]!==n.cardsPending||e[38]!==n.changedFilesTotal||e[39]!==n.changedFilesTruncated||e[40]!==n.diff||e[41]!==n.refresh||e[42]!==n.summary||e[43]!==h||e[44]!==b||e[45]!==p||e[46]!==f||e[47]!==m?(x={summary:n.summary,allPaths:n.allPaths,canDiscard:h,canDiscardAll:b,changedFilesTotal:n.changedFilesTotal,changedFilesTruncated:n.changedFilesTruncated,diff:n.diff,bodiesPending:n.bodiesPending,bodiesFailed:n.bodiesFailed,cardsPending:n.cardsPending,refresh:n.refresh,gate:l,headBranch:p,expectedHeadSha:f,...m,hosted:!1,otherWork:!1},e[33]=l,e[34]=n.allPaths,e[35]=n.bodiesFailed,e[36]=n.bodiesPending,e[37]=n.cardsPending,e[38]=n.changedFilesTotal,e[39]=n.changedFilesTruncated,e[40]=n.diff,e[41]=n.refresh,e[42]=n.summary,e[43]=h,e[44]=b,e[45]=p,e[46]=f,e[47]=m,e[48]=x):x=e[48];let g;return e[49]!==t||e[50]!==x?(g=a.jsx(On,{...t,source:x}),e[49]=t,e[50]=x,e[51]=g):g=e[51],g}function wa(t,e){return{summary:t.summary,allPaths:[],canDiscard:()=>!0,canDiscardAll:!0,changedFilesTotal:t.summary.count,changedFilesTruncated:!1,diff:null,bodiesPending:t.sidesPending,bodiesFailed:t.sidesFailed,cardsPending:!1,refresh:t.refresh,protocol:{backend:e,entries:t.entries},v8:{blocks:t.blocks}}}function xc(t){const e=T.c(23);let s,r,n;e[0]!==t?({backend:s,cacheKey:r,...n}=t,e[0]=t,e[1]=s,e[2]=r,e[3]=n):(s=e[1],r=e[2],n=e[3]);let i;e[4]!==n.branch||e[5]!==n.orgSlug||e[6]!==n.virtualMcpId?(i={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch},e[4]=n.branch,e[5]=n.orgSlug,e[6]=n.virtualMcpId,e[7]=i):i=e[7];let d;e[8]!==s||e[9]!==r||e[10]!==i?(d={backend:s,cacheKey:r,scope:i},e[8]=s,e[9]=r,e[10]=i,e[11]=d):d=e[11];const l=Fn(d),o=s.source==="github";let u;e[12]!==s||e[13]!==l?(u=wa(l,s),e[12]=s,e[13]=l,e[14]=u):u=e[14];let c;e[15]===Symbol.for("react.memo_cache_sentinel")?(c={allowed:!0,reason:null},e[15]=c):c=e[15];let h;e[16]!==o||e[17]!==n.branch||e[18]!==u?(h={...u,gate:c,headBranch:n.branch,hosted:o,otherWork:!1},e[16]=o,e[17]=n.branch,e[18]=u,e[19]=h):h=e[19];let b;return e[20]!==n||e[21]!==h?(b=a.jsx(On,{...n,source:h}),e[20]=n,e[21]=h,e[22]=b):b=e[22],b}function vc(t){const e=T.c(58);let s,r,n;e[0]!==t?({backend:s,cacheKey:r,...n}=t,e[0]=t,e[1]=s,e[2]=r,e[3]=n):(s=e[1],r=e[2],n=e[3]);const i=It()?.taskId??null;let d;e[4]!==n.branch||e[5]!==n.orgSlug||e[6]!==n.virtualMcpId?(d={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch},e[4]=n.branch,e[5]=n.orgSlug,e[6]=n.virtualMcpId,e[7]=d):d=e[7];let l;e[8]!==s||e[9]!==r||e[10]!==d?(l={backend:s,cacheKey:r,scope:d},e[8]=s,e[9]=r,e[10]=d,e[11]=l):l=e[11];const o=Fn(l);let u;e[12]!==n.baseBranch||e[13]!==n.branch||e[14]!==n.fastPreview||e[15]!==n.orgSlug||e[16]!==n.recoverSandbox||e[17]!==n.virtualMcpId||e[18]!==i?(u={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,threadId:i,baseBranch:n.baseBranch,fastPreview:n.fastPreview,recoverSandbox:n.recoverSandbox},e[12]=n.baseBranch,e[13]=n.branch,e[14]=n.fastPreview,e[15]=n.orgSlug,e[16]=n.recoverSandbox,e[17]=n.virtualMcpId,e[18]=i,e[19]=u):u=e[19];const c=xa(u),h=n.mode!=="review";let b;e[20]!==c.allPaths||e[21]!==c.diff||e[22]!==c.status||e[23]!==n.branch||e[24]!==n.fastPreview||e[25]!==n.orgSlug||e[26]!==n.publishPolicy||e[27]!==n.virtualMcpId||e[28]!==h||e[29]!==i?(b={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,threadId:i,fastPreview:n.fastPreview,status:c.status,diff:c.diff,paths:c.allPaths,policy:n.publishPolicy,judgeEnabled:h},e[20]=c.allPaths,e[21]=c.diff,e[22]=c.status,e[23]=n.branch,e[24]=n.fastPreview,e[25]=n.orgSlug,e[26]=n.publishPolicy,e[27]=n.virtualMcpId,e[28]=h,e[29]=i,e[30]=b):b=e[30];const{gate:p}=va(b);let f;if(e[31]!==c.allPaths||e[32]!==o){let k;e[34]!==o?(k=N=>{const C=Tn(N);return C===null?!kn(N):!Object.hasOwn(o.changes.changes,C)},e[34]=o,e[35]=k):k=e[35],f=c.allPaths.some(k),e[31]=c.allPaths,e[32]=o,e[33]=f}else f=e[33];const m=f;let x;e[36]!==s||e[37]!==o?(x=wa(o,s),e[36]=s,e[37]=o,e[38]=x):x=e[38];let g;e[39]!==c||e[40]!==o?(g=()=>Promise.all([o.refresh(),c.refresh()]),e[39]=c,e[40]=o,e[41]=g):g=e[41];let w;e[42]!==c.status||e[43]!==n.branch?(w=An(c.status)??n.branch,e[42]=c.status,e[43]=n.branch,e[44]=w):w=e[44];const j=c.headSha??void 0;let v;e[45]!==c.diff?(v=c.diff?{expectedDiffSignature:Cn(c.diff)}:{},e[45]=c.diff,e[46]=v):v=e[46];let P;e[47]!==p||e[48]!==m||e[49]!==j||e[50]!==v||e[51]!==x||e[52]!==g||e[53]!==w?(P={...x,refresh:g,gate:p,headBranch:w,expectedHeadSha:j,...v,hosted:!1,otherWork:m},e[47]=p,e[48]=m,e[49]=j,e[50]=v,e[51]=x,e[52]=g,e[53]=w,e[54]=P):P=e[54];let S;return e[55]!==n||e[56]!==P?(S=a.jsx(On,{...n,source:P}),e[55]=n,e[56]=P,e[57]=S):S=e[57],S}function On(t){const e=T.c(130),{source:s,publishLockRef:r,onOpenChange:n,mode:i,fastPreview:d,orgSlug:l,virtualMcpId:o,branch:u,baseBranch:c,repoTarget:h,owner:b,repo:p,draftPreviewUrl:f,destinationHost:m,previewServerUrl:x,compareDraft:g,lastPublishedPr:w,onRequestApproval:j,openPullRequest:v,onPullRequestChanged:P,onPublished:S}=t,k=i===void 0?"publish":i,N=w===void 0?null:w,C=v===void 0?null:v,y=me(),[A]=pr(),{language:D}=A,I=It()?.taskId??null,{data:O}=zs.useSession(),F=wr(Pr(l,o,u)),{allPaths:q,changedFilesTotal:E,changedFilesTruncated:G,diff:_,bodiesFailed:W,refresh:$,gate:V,hosted:te,otherWork:X}=s;let ne;e[0]!==g||e[1]!==s.bodiesPending||e[2]!==s.cardsPending||e[3]!==s.summary?(ne={summary:s.summary,cardsPending:s.cardsPending,bodiesPending:s.bodiesPending,compareDraft:g},e[0]=g,e[1]=s.bodiesPending,e[2]=s.cardsPending,e[3]=s.summary,e[4]=ne):ne=e[4];const le=ne;let M;e[5]!==te?(M={hosted:te},e[5]=te,e[6]=M):M=e[6];const Y=eo(le,M),{summary:B,cardsPending:Z,bodiesPending:se,compareDraft:ie}=Y.shown,[ge,ue]=H.useState(null),[re,fe]=H.useState(!1),[ye,z]=H.useState(yc);let oe;e[7]===Symbol.for("react.memo_cache_sentinel")?(oe=U=>z(ae=>ae.has(U)?ae:new Set(ae).add(U)),e[7]=oe):oe=e[7];const xe=oe,[Q,ee]=H.useState(null);let ce;e[8]===Symbol.for("react.memo_cache_sentinel")?(ce=[],e[8]=ce):ce=e[8];const[J,de]=H.useState(ce);let Me;e[9]!==s.v8?(Me=U=>{ee(U),de(ae=>[U,...ae.filter(he=>he!==U)]),s.v8&&setTimeout(()=>xe(U),dc)},e[9]=s.v8,e[10]=Me):Me=e[10];const mt=Me,[we,rt]=H.useState(null);let Le;e[11]!==ge||e[12]!==B?(Le=mo(ge,go(B)),e[11]=ge,e[12]=B,e[13]=Le):Le=e[13];const Re=Le,De=[...B.pages,...B.blocks,...B.other],_e=De.find(U=>ke(U)===Q)??De[0]??null,Ne=_e?ke(_e):null,at=[...new Set([...Ne?[Ne]:[],...J,...De.map(ke)])].filter(U=>De.some(ae=>ke(ae)===U)).slice(0,fc),ze=!!s.v8,[$t,Ee]=H.useState(null),Qe=ze?uc({selectedId:Ne,readyIds:ye,lastShownId:$t,liveIds:at}):Ne;ze&&Qe===Ne&&Qe!==$t&&Ee(Qe);const L=k==="review"&&!te,pe=Z?"loading":se?"manifest":"ready",Pe=C?.state==="open",Se=s.headBranch,Te=O?.user;let pt;e[14]!==Te?(pt=ta(Te),e[14]=Te,e[15]=pt):pt=e[15];let bt;e[16]!==s.expectedDiffSignature?(bt=s.expectedDiffSignature?{expectedDiffSignature:s.expectedDiffSignature}:{},e[16]=s.expectedDiffSignature,e[17]=bt):bt=e[17];let lt;e[18]!==c||e[19]!==u||e[20]!==d||e[21]!==l||e[22]!==b||e[23]!==p||e[24]!==h||e[25]!==s.expectedHeadSha||e[26]!==s.headBranch||e[27]!==pt||e[28]!==bt||e[29]!==I||e[30]!==o?(lt={orgSlug:l,virtualMcpId:o,branch:u,threadId:I,fastPreview:d,baseBranch:c,target:h,owner:b,repo:p,headBranch:Se,coAuthor:pt,expectedHeadSha:s.expectedHeadSha,...bt},e[18]=c,e[19]=u,e[20]=d,e[21]=l,e[22]=b,e[23]=p,e[24]=h,e[25]=s.expectedHeadSha,e[26]=s.headBranch,e[27]=pt,e[28]=bt,e[29]=I,e[30]=o,e[31]=lt):lt=e[31];const as=lt,gt=L?"review":"publish",ls=O?.user?.name;let it;e[32]!==q||e[33]!==m||e[34]!==te||e[35]!==Re||e[36]!==n||e[37]!==S||e[38]!==P||e[39]!==r||e[40]!==$||e[41]!==s.protocol||e[42]!==gt||e[43]!==ls||e[44]!==as?(it={mode:gt,target:as,note:Re,allPaths:q,destinationHost:m,publishLockRef:r,onOpenChange:n,refresh:$,onPullRequestChanged:P,onPublished:S,hosted:te,authorName:ls,protocol:s.protocol},e[32]=q,e[33]=m,e[34]=te,e[35]=Re,e[36]=n,e[37]=S,e[38]=P,e[39]=r,e[40]=$,e[41]=s.protocol,e[42]=gt,e[43]=ls,e[44]=as,e[45]=it):it=e[45];const{isPublishing:Ce,publishError:ot,publishErrorDetail:Lt,submit:xt,discardChange:Qs,discardAll:Et}=Yl(it),Je=Cr(l,o).phase==="saving",ct=B.count>0||X,Nt=!Ce&&ct&&(L||V.allowed);let dt;e[46]!==c||e[47]!==L||e[48]!==s.v8||e[49]!==B.count||e[50]!==y?(dt=L?B.count===0?y("thread.publishPopover.submitForReview"):B.count===1?y("thread.publishPopover.submitOneForReview"):y("thread.publishPopover.submitCountForReview",{count:B.count}):cc(B.count,c,!!s.v8,y),e[46]=c,e[47]=L,e[48]=s.v8,e[49]=B.count,e[50]=y,e[51]=dt):dt=e[51];const is=dt;let vt;e:{if(L&&Pe){let he;e[52]!==C.number||e[53]!==y?(he=y("thread.publishPopover.updatesPullRequest",{number:C.number}),e[52]=C.number,e[53]=y,e[54]=he):he=e[54],vt=he;break e}const U=N;if(!U?.mergedAt){vt=null;break e}let ae;if(e[55]!==D||e[56]!==U||e[57]!==y){const he=Ma(new Date(U.mergedAt),D),je=Xo(U);ae=je?y("thread.publishPopover.lastPublishedBy",{when:he,name:je}):y("thread.publishPopover.lastPublished",{when:he}),e[55]=D,e[56]=U,e[57]=y,e[58]=ae}else ae=e[58];vt=ae}const Ct=vt;let At;e[59]!==L||e[60]!==B.count||e[61]!==y?(At=L?y("thread.publishPopover.submitForReview"):B.count===1?y("thread.publishPopover.publishOne"):B.count>1?y("thread.publishPopover.publishCount",{count:B.count}):y("thread.publishPopover.publish"),e[59]=L,e[60]=B.count,e[61]=y,e[62]=At):At=e[62];const yt=At,Rt=(U,ae)=>ae.length===0?null:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("div",{className:"px-0.5 text-2xs font-medium text-muted-foreground",children:U}),ae.map(he=>{const je=ke(he);return a.jsx(ua,{change:he,bodyPending:se,selected:_e!==null&&ke(_e)===je,onSelect:()=>mt(je),confirming:we===je,onConfirmingChange:Ae=>rt(Ae?je:null),onDiscard:s.canDiscard(he)?()=>{Qs(he)}:void 0,isPublishing:Ce,isDiscarding:Je,v8:!!s.v8},je)})]});let Xe;e:{if(L||!ct){Xe=null;break e}if(V.pending){let je;e[63]===Symbol.for("react.memo_cache_sentinel")?(je=a.jsx(es,{className:"size-3.5 motion-reduce:animate-none"}),e[63]=je):je=e[63];let Ae;e[64]!==y?(Ae=y("thread.publishPopover.reviewing"),e[64]=y,e[65]=Ae):Ae=e[65];let Ke;e[66]!==Ae?(Ke=a.jsxs("div",{className:"flex items-center gap-2 border-t px-4 py-2.5 text-xs text-muted-foreground",children:[je,Ae]}),e[66]=Ae,e[67]=Ke):Ke=e[67],Xe=Ke;break e}if(V.allowed){Xe=null;break e}let U;e[68]===Symbol.for("react.memo_cache_sentinel")?(U=a.jsx(fn,{className:"mt-0.5 size-3.5 shrink-0"}),e[68]=U):U=e[68];let ae;e[69]!==V.reason||e[70]!==y?(ae=V.reason??y("thread.publishPopover.needsReviewGeneric"),e[69]=V.reason,e[70]=y,e[71]=ae):ae=e[71];let he;e[72]!==ae?(he=a.jsxs("div",{className:"flex items-start gap-2 border-t px-4 py-2.5 text-xs text-warning",children:[U,a.jsx("span",{children:ae})]}),e[72]=ae,e[73]=he):he=e[73],Xe=he}const jt=Xe;let ut;e[74]!==Et||e[75]!==re||e[76]!==Je||e[77]!==Ce||e[78]!==s.canDiscardAll||e[79]!==B.count||e[80]!==y?(ut=B.count<=1||!s.canDiscardAll?null:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"ml-auto shrink-0 text-2xs text-muted-foreground transition-colors hover:text-destructive disabled:opacity-50",onClick:()=>fe(!0),disabled:Ce||Je,children:y("thread.publishPopover.discardAll")}),a.jsx(Bs,{open:re,onOpenChange:fe,children:a.jsxs(Ts,{children:[a.jsxs(Cs,{children:[a.jsx(ks,{children:y("thread.publishPopover.discardAllTitle")}),a.jsx(Ns,{children:y("thread.publishPopover.discardAllConfirm")})]}),a.jsxs(Ds,{children:[a.jsx(As,{children:y("thread.publishDialog.cancel")}),a.jsx(Rs,{onClick:()=>{Et()},disabled:Je,className:K(jr({variant:"destructive"})),children:y("thread.publishPopover.discardAll")})]})]})})]}),e[74]=Et,e[75]=re,e[76]=Je,e[77]=Ce,e[78]=s.canDiscardAll,e[79]=B.count,e[80]=y,e[81]=ut):ut=e[81];const Dt=ut,os=Z?a.jsx(hs,{children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Bt,{}),a.jsx(Bt,{})]})}):B.count===0&&X?a.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:y("thread.publishPopover.onlyOtherWork")}):B.count===0?a.jsxs("div",{className:"flex flex-col items-center gap-1 py-10 text-center",children:[a.jsx(Sn,{className:"mb-1 size-5 text-success"}),a.jsx("p",{className:"text-sm font-medium",children:y(L?"thread.publishPopover.nothingToSubmit":"thread.publishPopover.everythingLive")}),a.jsx("p",{className:"text-xs text-muted-foreground",children:y(L?"thread.publishPopover.submitEmptyHint":"thread.publishPopover.emptyHint")})]}):a.jsxs(hs,{children:[G?a.jsx("p",{className:"text-2xs text-muted-foreground",children:y("thread.publishPopover.showingFirst",{shown:B.count,total:E})}):null,Rt(y("thread.publishPopover.pagesGroup"),B.pages),Rt(y("thread.publishPopover.blocksGroup"),B.blocks),Rt(y("thread.publishPopover.otherGroup"),B.other),W?a.jsx("p",{className:"text-2xs text-muted-foreground",children:y("thread.publishPopover.detailsUnavailable")}):null,X?a.jsx("p",{className:"text-2xs text-muted-foreground",children:y("thread.publishPopover.alsoOtherWork")}):null]}),cs=Z?a.jsx($n,{}):_e?a.jsx("div",{className:K(ss,"relative"),children:De.filter(U=>at.includes(ke(U))).map(U=>a.jsx("div",{className:K("absolute inset-0 flex",ze?ke(U)===Qe?"z-10":"pointer-events-none opacity-0":ke(U)!==Ne&&"hidden"),inert:ze&&ke(U)!==Qe,"aria-hidden":ze&&ke(U)!==Qe?!0:void 0,children:a.jsx(ga,{change:U,diff:_,bodyPending:se,previewServerUrl:x,draft:ie,lastPage:F,v8:s.v8,onReady:ze?()=>xe(ke(U)):void 0})},ke(U)))}):a.jsx("div",{className:K(ss,"bg-muted/40")});let Be;e[82]!==is?(Be=a.jsx("span",{className:"truncate",children:is}),e[82]=is,e[83]=Be):Be=e[83];let Ie;e[84]!==Dt||e[85]!==k||e[86]!==Ct||e[87]!==Be?(Ie=a.jsx(Ln,{mode:k,title:Be,subLine:Ct,trailing:Dt}),e[84]=Dt,e[85]=k,e[86]=Ct,e[87]=Be,e[88]=Ie):Ie=e[88];let Ye;e[89]!==Ce||e[90]!==L||e[91]!==Re||e[92]!==B.count||e[93]!==y?(Ye=B.count===0?null:a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-sm font-medium",children:y(L?"thread.publishPopover.reviewNote":"thread.publishPopover.versionNote")}),a.jsx(Gl,{value:Re,onChange:U=>ue(U.target.value),placeholder:y(L?"thread.publishPopover.reviewNotePlaceholder":"thread.publishPopover.versionNotePlaceholder"),rows:2,maxLength:Zl,className:"resize-none text-sm",disabled:Ce})]}),e[89]=Ce,e[90]=L,e[91]=Re,e[92]=B.count,e[93]=y,e[94]=Ye):Ye=e[94];let Ue;e[95]!==f||e[96]!==y?(Ue=a.jsx(En,{draftPreviewUrl:f,t:y}),e[95]=f,e[96]=y,e[97]=Ue):Ue=e[97];let wt;e[98]!==Nt||e[99]!==V||e[100]!==ct||e[101]!==te||e[102]!==Ce||e[103]!==L||e[104]!==j||e[105]!==yt||e[106]!==Y||e[107]!==xt||e[108]!==y?(wt=!L&&!te&&ct&&!V.allowed&&!V.pending?a.jsx(ve,{type:"button",className:"flex-1",onClick:j,disabled:Ce,children:y("thread.publishPopover.requestApproval")}):a.jsxs(ve,{type:"button",variant:L?"default":"brand",className:"flex-1",onClick:()=>{Y.hold(),xt().then(U=>{U===!1&&Y.release()})},disabled:!Nt,children:[Ce?a.jsx(es,{className:"size-4 motion-reduce:animate-none"}):null,Ce?y(L?"thread.publishPopover.submitting":"thread.publishPopover.publishing"):yt]}),e[98]=Nt,e[99]=V,e[100]=ct,e[101]=te,e[102]=Ce,e[103]=L,e[104]=j,e[105]=yt,e[106]=Y,e[107]=xt,e[108]=y,e[109]=wt):wt=e[109];let Ze;e[110]!==Ue||e[111]!==wt?(Ze=a.jsxs("div",{className:"flex gap-2",children:[Ue,wt]}),e[110]=Ue,e[111]=wt,e[112]=Ze):Ze=e[112];let He;e[113]!==ot||e[114]!==Lt||e[115]!==y?(He=ot?a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-destructive",children:ot}),Lt?a.jsx(Ya,{label:y("siteEditor.details"),detail:Lt}):null]}):null,e[113]=ot,e[114]=Lt,e[115]=y,e[116]=He):He=e[116];let Fe;e[117]!==Ze||e[118]!==He?(Fe=a.jsxs(a.Fragment,{children:[Ze,He]}),e[117]=Ze,e[118]=He,e[119]=Fe):Fe=e[119];let $e;e[120]!==os||e[121]!==jt||e[122]!==pe||e[123]!==Ie||e[124]!==Ye||e[125]!==Fe?($e=a.jsx(Gs,{state:pe,header:Ie,body:os,note:Ye,gate:jt,footer:Fe}),e[120]=os,e[121]=jt,e[122]=pe,e[123]=Ie,e[124]=Ye,e[125]=Fe,e[126]=$e):$e=e[126];let qe;return e[127]!==cs||e[128]!==$e?(qe=a.jsx(ms,{pane:cs,list:$e}),e[127]=cs,e[128]=$e,e[129]=qe):qe=e[129],qe}function yc(){return new Set}function jc(t){if(!(t==="claiming"||t==="ready"||t==="failed"))return zl[t].short}const wc=new Set(["failure","timed_out","cancelled","action_required"]);function Pa(t){return t.status==="completed"&&wc.has(t.conclusion)}function Mn(t){return t.status==="queued"||t.status==="in_progress"}function Ss(t){return t.isPending&&t.fetchStatus!=="idle"}function Pc(t){return{key:"view-change-request",label:t("thread.cmsActions.viewOnProvider"),action:"open-pr-page"}}function ht(t,e,s){return e?[...t,Pc(s)]:t}function Ge(t,e,s){return e.kind!=="ready"||e.behindBase<=0?t:[...t,{key:"get-latest",label:s("thread.cmsActions.getLatest"),action:"sync",tooltip:s("thread.cmsActions.getLatestTooltip")}]}function sr(t){return{key:"submit-for-review",label:t("thread.headerActions.submitForReview"),action:"create-pr"}}function js(t,e,s){if(e.filter(Mn).length===0)return t;const n=e.filter(i=>i.status==="completed").length;return{...t,tooltip:s("thread.cmsActions.checksRunning",{done:n,total:e.length})}}function Sc(t){const{lifecycle:e,branch:s,pr:r,checks:n,reviews:i,loading:d,t:l}=t;if(d)return{label:l("thread.headerActions.loading"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.loadingBranchTooltip"),menu:[]};switch(e.phase){case"idle":return{label:t.claimPhase&&jc(t.claimPhase.kind)||l("thread.headerActions.startingSandbox"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.waitingForDaemonTooltip"),menu:[]};case"cloning":return{label:l("thread.headerActions.cloningRepo"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.cloningRepoTooltip"),menu:[]};case"clone-failed":return{label:l("thread.headerActions.cloneFailed"),disabled:!0,variant:"outline",tooltip:e.error||l("thread.headerActions.cloneFailedDefaultTooltip"),menu:[]};case"checking-out":return{label:l("thread.headerActions.switchingTo",{branch:e.to}),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.checkingOutTooltip",{branch:e.to}),menu:[]};case"installing":return{label:l("thread.headerActions.installingPackages"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.installingPackagesTooltip"),menu:[]};case"starting":{if(!(s.kind==="ready"&&(s.workingTreeDirty||s.aheadOfBase>0||s.unpushed>0))&&!t.noReviewableDiff)return{label:l("thread.headerActions.startingApp"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.startingAppTooltip"),menu:[]};break}}if(s.kind!=="ready")return{label:l("thread.headerActions.loadingBranch"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.waitingForBranchTooltip"),menu:[]};const o=s,u=o.unpushed>0&&!(r&&o.headSha&&r.headSha&&o.headSha===r.headSha);if(t.noReviewableDiff&&!r)return{label:l("thread.headerActions.upToDate"),disabled:!0,variant:"outline",tooltip:l("thread.headerActions.branchInSyncTooltip",{base:o.base}),menu:Ge([],o,l)};if(o.workingTreeDirty||u)return{label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:Ge(ht([sr(l)],r,l),o,l)};if(Zr("no local work — checking PR/sync state",{workingTreeDirty:o.workingTreeDirty,unpushed:o.unpushed,aheadOfBase:o.aheadOfBase,behindBase:o.behindBase,branch:o.branch,base:o.base,prMerged:r?.merged??null,prState:r?.state??null}),r?.merged)return!!o.headSha&&!!r.headSha&&o.headSha!==r.headSha?{label:l("thread.headerActions.continue"),action:"create-pr",variant:"special",tooltip:l("thread.headerActions.openNewPrTooltip"),menu:Ge(ht([],r,l),o,l)}:{label:l("thread.headerActions.upToDate"),disabled:!0,variant:"outline",tooltip:l("thread.headerActions.prMergedTooltip",{prNumber:String(r.number),base:r.base}),menu:Ge(ht([],r,l),o,l)};if(o.aheadOfBase>0){if(r&&r.state==="closed"&&!r.merged)return{label:l("thread.headerActions.reopenPr"),action:"reopen",variant:"default",tooltip:l("thread.headerActions.reopenPrTooltip",{prNumber:String(r.number)}),menu:Ge(ht([],r,l),o,l)};if(!r)return{label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:Ge([sr(l)],o,l)};if((i?.mergeableState??"unknown")==="dirty")return{label:l("thread.cmsActions.getLatest"),action:"rebase",variant:"default",tooltip:l("thread.cmsActions.getLatestTooltip"),menu:[{key:"resolve-on-provider",label:l("thread.cmsActions.resolveOnProvider"),action:"open-pr-page"}]};const h=n.filter(Mn).length,b=n.filter(Pa).map(f=>f.name);if(h===0&&b.length>0)return{label:l("thread.headerActions.fixChecks"),action:"fix-checks",variant:"default",tooltip:l("thread.headerActions.failingChecksTooltip",{checks:b.join(", ")}),meta:{failingChecks:b},menu:Ge(ht([{key:"publish-anyway",label:l("thread.headerActions.publishAnyway"),action:"merge",tooltip:l("thread.headerActions.squashMergeTooltip",{prNumber:String(r.number),base:r.base})}],r,l),o,l)};if(i?.draft)return js({label:l("thread.headerActions.markReady"),action:"mark-ready",variant:"default",tooltip:l("thread.headerActions.markDraftReadyTooltip"),menu:Ge(ht([],r,l),o,l)},n,l);const p=i?.unresolvedConversations??0;return p>0?js({label:l("thread.headerActions.addressFeedback"),action:"resolve-comments",variant:"default",tooltip:l("thread.headerActions.unresolvedConversationsTooltip",{count:String(p)}),menu:Ge(ht([],r,l),o,l)},n,l):i?.missingRequiredApprovals?js({label:l("thread.cmsActions.waitingForReview"),action:"open-pr-page",variant:"outline",tooltip:l("thread.headerActions.waitingForApprovalsTooltip"),menu:Ge(ht([],r,l),o,l)},n,l):js({label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",meta:{publishPolicyOverride:"open"},menu:Ge(ht([{key:"review",label:l("thread.headerActions.review"),action:"review"}],r,l),o,l)},n,l)}return o.behindBase>0?{label:l("thread.cmsActions.getLatest"),action:"sync",variant:"default",tooltip:l("thread.cmsActions.getLatestTooltip"),menu:[]}:{label:l("thread.headerActions.upToDate"),disabled:!0,variant:"outline",tooltip:l("thread.headerActions.branchInSyncTooltip",{base:o.base}),menu:[]}}function nr(t){return{key:"view-change-request",label:t("thread.cmsActions.viewOnProvider"),action:"open-pr"}}function ws(t,e,s){return e.kind!=="ready"||e.behindBase<=0?t:[...t,{key:"get-latest",label:s("thread.cmsActions.getLatest"),action:"get-latest",tooltip:s("thread.cmsActions.getLatestTooltip")}]}function rr(t,e,s,r){const n=e.length;if(n===0)return t;if(e.filter(Mn).length>0){const l=e.filter(u=>u.status==="completed").length,o=r("thread.cmsActions.checksRunning",{done:l,total:n});return s==="loading"?{...t,loading:!0,tooltip:o}:{...t,tooltip:o}}const d=e.filter(Pa).length;return d>0?{...t,variant:"warning",tooltip:r("thread.cmsActions.checksFailing",{failed:d,total:n})}:t}function kc(t,e){return!!(t?.merged&&t.headSha&&e.kind==="ready"&&!e.workingTreeDirty&&e.headSha===t.headSha)}function Nc(t){return Ss(t.prQuery)?!0:t.pr?.state!=="open"||t.pr.merged?!1:Ss(t.checksQuery)||Ss(t.reviewsQuery)}function Cc(t,e){return t.workingTreeDirty?!0:e!==null?e>0:t.aheadOfBase>0}function Ac(t,e){if(!t)return{branchMeta:{kind:"unknown"},publishableChangeCount:null};const s=Object.keys(t.changes).length;return{branchMeta:{kind:"ready",branch:e,base:t.base.resolvedRef??"main",workingTreeDirty:!1,unpushed:0,aheadOfBase:s,behindBase:0,headSha:t.revision},publishableChangeCount:s}}function Rc(t){return{...t,menu:[]}}function Dc(t){const{branch:e,pr:s,checks:r,reviews:n,publishing:i,saving:d,loading:l,publishableChangeCount:o,t:u}=t;if(e.kind!=="ready"&&t.statusError)return{label:u("thread.cmsActions.retry"),action:"retry-status",variant:"outline",disabled:t.statusRetrying,loading:t.statusRetrying,tooltip:t.statusError,menu:[]};if(l||e.kind!=="ready")return{label:u("thread.headerActions.loading"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(i)return{label:u("thread.cmsActions.publishing"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(t.syncing)return{label:u("thread.cmsActions.gettingLatest"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(d)return{label:u("thread.headerActions.saving"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(s&&s.state==="open"&&!s.merged?s:null){const h=n?.mergeableState??"unknown";return h==="dirty"?{label:u("thread.cmsActions.getLatest"),action:"get-latest",variant:"default",tooltip:u("thread.cmsActions.getLatestTooltip"),menu:[{key:"resolve-on-provider",label:u("thread.cmsActions.resolveOnProvider"),action:"open-pr"}]}:h==="blocked"||n?.draft?rr({label:u("thread.cmsActions.waitingForReview"),action:"open-pr",variant:"outline",menu:ws([nr(u)],e,u)},r,"loading",u):rr({label:u("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:ws([nr(u)],e,u)},r,"none",u)}return kc(s,e)?{label:u("thread.headerActions.upToDate"),variant:"outline",disabled:!0,menu:ws([],e,u)}:Cc(e,o)?{label:u("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:ws([{key:"request-approval",label:u("thread.headerActions.submitForReview"),action:"request-approval"}],e,u)}:e.behindBase>0?{label:u("thread.cmsActions.getLatest"),action:"get-latest",variant:"default",tooltip:u("thread.cmsActions.getLatestTooltip"),menu:[],autoRun:e.aheadOfBase===0}:{label:u("thread.headerActions.upToDate"),variant:"outline",disabled:!0,menu:[]}}function Tc(t){return t.conflicting===!0?"dirty":t.conflicting===null?"unknown":t.reviewBlocked||t.unresolvedConversations>0?"blocked":"clean"}function Sa(t){const e=T.c(4);let s;e[0]!==t?(s=Sl(t),e[0]=t,e[1]=s):s=e[1];let r;return e[2]!==s?(r={...s,select:Bc},e[2]=s,e[3]=r):r=e[3],ft(r)}function Bc(t){const e=t.changeRequest;return e?{draft:e.draft,mergeableState:Tc(e),unresolvedConversations:e.unresolvedConversations,missingRequiredApprovals:e.reviewBlocked}:null}function ar(t,e){return t==="open-pr"||e==="resolve-on-provider"?a.jsx(Gr,{size:16}):t==="publish"?a.jsx(Lr,{className:"size-4"}):t==="get-latest"||t==="retry-status"?a.jsx(mn,{className:"size-4"}):a.jsx(Hs,{className:"size-4"})}function Ic(t){const e=T.c(63),{virtualMcpId:s}=t,r=me(),{org:n}=rs(),i=mr(),d=Ks(s),{data:l}=zs.useSession(),{deleteRelease:o}=Vs(s),{currentBranch:u,setCurrentTaskBranch:c,taskId:h,createTask:b}=Sr();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={open:!1,mode:"publish"},e[0]=p):p=e[0];const[f,m]=H.useState(p);let x;e[1]===Symbol.for("react.memo_cache_sentinel")?(x=L=>m({open:!0,mode:L}),e[1]=x):x=e[1];const g=x,w=Ur(d),j=w.status==="attached"||w.status==="public-clone"?w.repo:null,{previewServerUrl:v}=fs(s),P=u?wr(Pr(n.slug,s,u)):null,S=P?Pn(P.path,P.params):"/",k=Tl(u?{orgSlug:n.slug,virtualMcpId:s,branch:u,previewServerUrl:v,path:S}:null);let N;e[2]!==u||e[3]!==n.slug||e[4]!==s?(N=u?{orgSlug:n.slug,virtualMcpId:s,branch:u}:null,e[2]=u,e[3]=n.slug,e[4]=s,e[5]=N):N=e[5];const C=Bl(N),y=kt(s,u),A=y.kind==="protocol"&&y.source==="github";let D;e[6]!==u||e[7]!==n.slug||e[8]!==s?(D=u?{orgSlug:n.slug,virtualMcpId:s,branch:u}:null,e[6]=u,e[7]=n.slug,e[8]=s,e[9]=D):D=e[9];const I=xn(D),O=Ar(A?y:null,I);let F;e[10]!==n.slug||e[11]!==s?(F=Za(n.slug,s),e[10]=n.slug,e[11]=s,e[12]=F):F=e[12];const q=el(F,A?C:null),E=A?tl(v,S,q):k.url,G=u??"",_=h??null;let W;e[13]!==n.slug||e[14]!==G||e[15]!==_||e[16]!==s?(W=Nn({orgSlug:n.slug,virtualMcpId:s,branch:G,threadId:_}),e[13]=n.slug,e[14]=G,e[15]=_,e[16]=s,e[17]=W):W=e[17];const $=!!u&&y.kind!=="pending"&&!A;let V;e[18]!==W||e[19]!==$?(V={...W,enabled:$},e[18]=W,e[19]=$,e[20]=V):V=e[20];const te=ft(V),X=A?null:te.data??null,ne=A?Ac(O.data,u??""):null,le=ne?ne.branchMeta:X?{kind:"ready",branch:An(X)??u??"",base:X.base??"main",workingTreeDirty:mi(X),unpushed:X.unpushed??0,aheadOfBase:X.aheadOfBase??0,behindBase:X.behindBase??0,headSha:X.headSha??""}:{kind:"unknown"},M=ne?ne.publishableChangeCount:X?.changedFiles?oa({files:X.changedFiles}).count:null,Y=A?O:te,B=(le.kind==="ready"?le.branch:null)??u??null,Z=le.kind==="ready"?le.base:"main",se=Hr({orgId:n.id,orgSlug:n.slug,target:Oe(j),owner:j?.owner??"",repo:j?.name??"",branch:B}),ie=se.data??null,ge=qr({orgId:n.id,orgSlug:n.slug,target:Oe(j),owner:j?.owner??"",repo:j?.name??"",base:Z}),ue=Kr({orgId:n.id,orgSlug:n.slug,target:Oe(j),owner:j?.owner??"",repo:j?.name??"",branch:B}),re=Sa({orgId:n.id,orgSlug:n.slug,target:Oe(j),owner:j?.owner??"",repo:j?.name??"",branch:B});let fe;e[21]!==ue||e[22]!==ie||e[23]!==se||e[24]!==re?(fe=Nc({pr:ie,prQuery:se,checksQuery:ue,reviewsQuery:re}),e[21]=ue,e[22]=ie,e[23]=se,e[24]=re,e[25]=fe):fe=e[25];const ye=fe;let z;e[26]!==se?(z=async()=>{await se.refetch()},e[26]=se,e[27]=z):z=e[27];const oe=z,xe=zn({mutationFn:()=>Yi({hosted:A,branch:u,baseBranch:Z,nextBranch:()=>vn(yn(l?.user)),setCurrentTaskBranch:c,deleteRelease:o}),onError:Lc});let Q;e[28]!==n.slug||e[29]!==h||e[30]!==s?(Q=async L=>(await pi({orgSlug:n.slug,virtualMcpId:s,branch:L.branch,threadId:h??null},L.base),L),e[28]=n.slug,e[29]=h,e[30]=s,e[31]=Q):Q=e[31];let ee;e[32]!==u||e[33]!==n.slug||e[34]!==i||e[35]!==r||e[36]!==h||e[37]!==s?(ee=async L=>{et.success(r("thread.headerActions.syncedWithBase",{base:L.base})),await Promise.all([i.invalidateQueries({queryKey:Rn({orgSlug:n.slug,virtualMcpId:s,branch:u??L.branch,threadId:h??null})}),i.invalidateQueries({queryKey:ns.decofile(`${n.slug}/${s}/${L.branch}`)})])},e[32]=u,e[33]=n.slug,e[34]=i,e[35]=r,e[36]=h,e[37]=s,e[38]=ee):ee=e[38];let ce;e[39]!==Q||e[40]!==ee?(ce={mutationFn:Q,onSuccess:ee,onError:$c},e[39]=Q,e[40]=ee,e[41]=ce):ce=e[41];const J=zn(ce),de=Rr(n.slug,s),Me=xe.isPending,mt=Dc({branch:le,pr:ie,checks:ue.data??[],reviews:re.data??null,publishing:Me,saving:de,syncing:J.isPending,statusRetrying:Y.isFetching&&!!Y.error,statusError:Y.error instanceof Error?Y.error.message:Y.error?String(Y.error):null,loading:!!ye,publishableChangeCount:M,t:r}),we=A?Rc(mt):mt,rt=we.autoRun&&le.kind==="ready"&&j&&v?`${B}@${le.headSha}`:null,Le=H.useRef(null);if(H.useEffect(()=>{!rt||!B||Le.current!==rt&&(Le.current=rt,J.mutate({branch:B,base:Z}))},[rt,B,Z,J]),w.status==="detached"){let L;e[42]!==r?(L=r("thread.headerActions.reconnectGithub"),e[42]=r,e[43]=L):L=e[43];let pe;e[44]!==L?(pe=a.jsx(st,{asChild:!0,children:a.jsx("span",{children:a.jsx(ve,{size:"sm",variant:"outline",disabled:!0,children:L})})}),e[44]=L,e[45]=pe):pe=e[45];let Pe;e[46]!==r?(Pe=r("thread.headerActions.githubConnectionRemoved"),e[46]=r,e[47]=Pe):Pe=e[47];let Se;e[48]!==Pe?(Se=a.jsx(nt,{children:Pe}),e[48]=Pe,e[49]=Se):Se=e[49];let Te;return e[50]!==pe||e[51]!==Se?(Te=a.jsx(Us,{children:a.jsxs(tt,{children:[pe,Se]})}),e[50]=pe,e[51]=Se,e[52]=Te):Te=e[52],Te}if(!d)return null;if(!j||!v){const L=j?"noPreviewServer":"noRepo";let pe;e[53]!==u||e[54]!==b?(pe=u?()=>{const Se=b?.({runtime:"sandbox",branch:u});Se&&_a("coding_session_started",{thread_id:Se})}:void 0,e[53]=u,e[54]=b,e[55]=pe):pe=e[55];let Pe;return e[56]!==L||e[57]!==pe?(Pe=a.jsx(Ec,{reason:L,onStartCodingSession:pe}),e[56]=L,e[57]=pe,e[58]=Pe):Pe=e[58],Pe}if(!u)return null;const Re=L=>{switch(L){case"publish":{g("publish");return}case"request-approval":{g("review");return}case"get-latest":{if(!B||J.isPending)return;J.mutate({branch:B,base:Z});return}case"retry-status":{Y.refetch();return}case"open-pr":{ie?.htmlUrl&&window.open(ie.htmlUrl,"_blank","noopener,noreferrer");return}}};let De;e[59]!==Re?(De=L=>({key:L.key,label:L.label,icon:ar(L.action,L.key),...L.tooltip?{tooltip:L.tooltip}:{},onSelect:()=>Re(L.action)}),e[59]=Re,e[60]=De):De=e[60];const _e=we.menu.map(De),Ne=we.action,at=we.label,ze=we.variant,$t=!!we.loading;let Ee;e[61]!==r?(Ee=r("thread.cmsActions.moreActionsAriaLabel"),e[61]=r,e[62]=Ee):Ee=e[62];const Qe=a.jsx(ea,{size:"sm",label:at,variant:ze,disabled:!!we.disabled||!Ne,loading:$t,...Ne&&!we.loading?{icon:ar(Ne)}:{},...we.tooltip?{tooltip:we.tooltip}:{},items:_e,menuAriaLabel:Ee,onClick:Ne?()=>Re(Ne):void 0});return a.jsxs(a.Fragment,{children:[we.status?a.jsx("span",{className:"mr-1 hidden shrink-0 text-xs text-muted-foreground sm:inline",children:we.status}):null,Qe,u?a.jsx(ya,{open:f.open,mode:f.mode,fastPreview:!0,onOpenChange:L=>{L||m(Fc)},orgSlug:n.slug,virtualMcpId:s,branch:u,baseBranch:Z,repoTarget:Oe(j),owner:j.owner,repo:j.name,publishPolicy:Xr(d?.metadata?.publishPolicy),draftPreviewUrl:E,destinationHost:k.host,previewServerUrl:v,compareDraft:C?{kind:"pointer",pointer:C,...q?{link:q}:{}}:null,lastPublishedPr:ge.data??null,onRequestApproval:()=>g("review"),openPullRequest:ie?.state==="open"?ie:null,onPullRequestChanged:oe,onPublished:()=>xe.mutateAsync()}):null]})}function Fc(t){return{...t,open:!1}}function $c(t){et.error(t instanceof Error?t.message:String(t))}function Lc(t){console.error("site editor: settling after publish failed",t)}function Ec(t){const e=T.c(14),{reason:s,onStartCodingSession:r}=t,n=me(),i=!r;let d;e[0]!==n?(d=n("sandbox.cmsUnavailable.startCodingSession"),e[0]=n,e[1]=d):d=e[1];let l;e[2]!==r||e[3]!==i||e[4]!==d?(l=a.jsx(st,{asChild:!0,children:a.jsx("span",{children:a.jsx(ve,{size:"sm",variant:"outline",disabled:i,onClick:r,children:d})})}),e[2]=r,e[3]=i,e[4]=d,e[5]=l):l=e[5];let o;e[6]!==s||e[7]!==n?(o=n(s==="noPreviewServer"?"sandbox.cmsUnavailable.noPreviewServer":"sandbox.cmsUnavailable.noRepo"),e[6]=s,e[7]=n,e[8]=o):o=e[8];let u;e[9]!==o?(u=a.jsx(nt,{children:o}),e[9]=o,e[10]=u):u=e[10];let c;return e[11]!==l||e[12]!==u?(c=a.jsx(Us,{children:a.jsxs(tt,{children:[l,u]})}),e[11]=l,e[12]=u,e[13]=c):c=e[13],c}const Ft="The user clicked this action deliberately — execute directly. Do not call user_ask unless you hit an actual problem outside the scope of this intent (missing auth, unresolvable conflict, a check with multiple plausible fixes).";function Oc(t){return`Reopen PR #${t.prNumber}. ${Ft}`}function Mc(t){return`Rebase \`${t.branch}\` on the latest base and force-push with --force-with-lease. ${Ft}`}function _c(t){return`Sync \`${t.branch}\` with everyone else's work: \`git add -A\`, commit any pending local changes with a concise conventional-commit message (skip if the working tree is clean), \`git pull --rebase\` to bring in anything pushed directly to \`origin/${t.branch}\`, then \`git rebase origin/${t.base}\` to catch up with the base branch. Resolve any conflicts that come up, then push the result (force-with-lease only if the rebase rewrote commits already on the remote). ${Ft}`}function zc(t){const e=(t.failingChecks??[]).map(s=>`\`${s}\``).join(", ");return`PR #${t.prNumber} has failing checks: ${e}. For each: read the logs, diagnose the root cause, apply the smallest fix that makes it pass, commit, and push. ${Ft}`}function Uc(t){return`Mark PR #${t.prNumber} ready for review. ${Ft}`}function Hc(t){return`Read the unresolved review threads on PR #${t.prNumber}. For each thread: understand the reviewer's ask, apply the needed changes, commit, push, reply explaining what changed, and resolve the thread. If a comment is a question that doesn't need a code change, reply with the answer and resolve. ${Ft}`}function qc(t){return`Review PR #${t.prNumber}. Read the full diff, analyze every changed file for correctness, security, code quality, and alignment with the repo's patterns. Post specific line-level review comments on concerns, then submit an overall review (approve / request changes / comment) with a concise summary. Do not modify the code — this is a read-and-comment pass. ${Ft}`}function lr(t){switch(t){case"publish":return a.jsx(Lr,{className:"size-4"});case"create-pr":case"reopen":return a.jsx(Hs,{className:"size-4"});case"rebase":case"sync":return a.jsx(mn,{className:"size-4"});case"fix-checks":return a.jsx(fn,{className:"size-4"});case"mark-ready":return a.jsx(Sn,{className:"size-4"});case"resolve-comments":return a.jsx(bl,{className:"size-4"});case"merge":return a.jsx(ai,{className:"size-4"});case"review":return a.jsx(Is,{className:"size-4"});case"open-pr-page":return a.jsx(Gr,{size:16})}}const ir=new Set(["reopen","rebase","fix-checks","mark-ready","resolve-comments","review","sync"]),or=new Set(["publish","create-pr"]);function Kc(t){const e=T.c(44),{t:s,button:r,actionBusy:n,changeRequestPending:i,savePending:d,onAction:l}=t,o=r.action;let u;e[0]!==o||e[1]!==n?(u=n&&o!==void 0&&ir.has(o),e[0]=o,e[1]=n,e[2]=u):u=e[2];const c=u,h=i&&o==="merge";let b;e[3]!==o||e[4]!==d?(b=d&&o!==void 0&&or.has(o),e[3]=o,e[4]=d,e[5]=b):b=e[5];const p=b,f=!!r.disabled||c||h||p||!o,m=!!r.loading||h;let x;e[6]!==r.tooltip||e[7]!==c||e[8]!==p||e[9]!==s?(x=c?s("thread.headerActions.chatIsRunning"):p?s("thread.headerActions.saving"):r.tooltip,e[6]=r.tooltip,e[7]=c,e[8]=p,e[9]=s,e[10]=x):x=e[10];const g=x;let w;if(e[11]!==n||e[12]!==r.menu||e[13]!==i||e[14]!==l||e[15]!==d||e[16]!==s){let A;e[18]!==n||e[19]!==i||e[20]!==l||e[21]!==d||e[22]!==s?(A=D=>{const I=n&&ir.has(D.action),O=d&&or.has(D.action),F=D.action==="merge"&&i,q=O?s("thread.headerActions.saving"):I?s("thread.headerActions.chatIsRunning"):D.tooltip;return{key:D.key,label:D.label,icon:lr(D.action),disabled:!!(I||O||F),...q?{tooltip:q}:{},onSelect:()=>l(D.action)}},e[18]=n,e[19]=i,e[20]=l,e[21]=d,e[22]=s,e[23]=A):A=e[23],w=r.menu.map(A),e[11]=n,e[12]=r.menu,e[13]=i,e[14]=l,e[15]=d,e[16]=s,e[17]=w}else w=e[17];const j=w,v=r.label,P=r.variant;let S;e[24]!==o||e[25]!==m?(S=o&&!m?{icon:lr(o)}:{},e[24]=o,e[25]=m,e[26]=S):S=e[26];let k;e[27]!==g?(k=g?{tooltip:g}:{},e[27]=g,e[28]=k):k=e[28];let N;e[29]!==s?(N=s("thread.headerActions.moreActionsAriaLabel"),e[29]=s,e[30]=N):N=e[30];let C;e[31]!==o||e[32]!==l?(C=o?()=>l(o):void 0,e[31]=o,e[32]=l,e[33]=C):C=e[33];let y;return e[34]!==r.label||e[35]!==r.variant||e[36]!==f||e[37]!==j||e[38]!==m||e[39]!==S||e[40]!==k||e[41]!==N||e[42]!==C?(y=a.jsx(ea,{size:"sm",label:v,variant:P,disabled:f,loading:m,...S,...k,items:j,menuAriaLabel:N,onClick:C}),e[34]=r.label,e[35]=r.variant,e[36]=f,e[37]=j,e[38]=m,e[39]=S,e[40]=k,e[41]=N,e[42]=C,e[43]=y):y=e[43],y}function cr(t){const e=T.c(9),{label:s,children:r}=t;if(!s){let l;return e[0]!==r?(l=a.jsx(a.Fragment,{children:r}),e[0]=r,e[1]=l):l=e[1],l}let n;e[2]!==r?(n=a.jsx(st,{asChild:!0,children:a.jsx("span",{children:r})}),e[2]=r,e[3]=n):n=e[3];let i;e[4]!==s?(i=a.jsx(nt,{children:s}),e[4]=s,e[5]=i):i=e[5];let d;return e[6]!==n||e[7]!==i?(d=a.jsx(Us,{children:a.jsxs(tt,{children:[n,i]})}),e[6]=n,e[7]=i,e[8]=d):d=e[8],d}function Vc(t){return{label:t("thread.headerActions.loadingBranch"),disabled:!0,loading:!0,variant:"outline",tooltip:t("thread.headerActions.waitingForSandboxBranchTooltip"),menu:[]}}function Gc({virtualMcpId:t}){const e=me(),{org:s}=rs(),{data:r}=zs.useSession(),n=Ks(t),{deleteRelease:i}=Vs(t),{currentBranch:d,setCurrentTaskBranch:l,createTask:o,taskId:u}=Sr(),c=Ka(),{openSidePanel:h}=ll(),[b,p]=H.useState({open:!1,mode:"publish",policyOverride:null}),f=vi({connectionId:za,orgId:s.id,orgSlug:s.slug}),m=yi(f),[x,g]=H.useState(!1),w=H.useRef(""),j=Ur(n),v=j.status==="attached"||j.status==="public-clone"?j.repo:null,{lifecycle:P,branch:S,phase:k}=Vl(),N={orgSlug:s.slug,virtualMcpId:t,branch:d??"",threadId:u??null},y=ft({queryKey:Rn(N),queryFn:()=>Jr(N),enabled:!!d,staleTime:15e3,refetchInterval:Q=>Ys(Q.state.data)?5e3:!1}).data??null,A=S,D=P,I=A.kind==="ready"?A.branch:null,O=d??I??void 0,F=(A.kind==="ready"?A.branch:null)??O??null,q=Hr({orgId:s.id,orgSlug:s.slug,target:Oe(v),owner:v?.owner??"",repo:v?.name??"",branch:F}),E=q.data??null,G=Kr({orgId:s.id,orgSlug:s.slug,target:Oe(v),owner:v?.owner??"",repo:v?.name??"",branch:F}),_=Sa({orgId:s.id,orgSlug:s.slug,target:Oe(v),owner:v?.owner??"",repo:v?.name??"",branch:F}),W=qr({orgId:s.id,orgSlug:s.slug,target:Oe(v),owner:v?.owner??"",repo:v?.name??"",base:A.kind==="ready"?A.base:null}),$=A,V=Xr(n?.metadata?.publishPolicy),te=Rr(s.slug,t),{previewUrl:X}=ji(),{previewServerUrl:ne,projectDefault:le}=fs(t);if(j.status==="detached")return a.jsx(cr,{label:e("thread.headerActions.githubConnectionRemoved"),children:a.jsx(ve,{size:"sm",variant:"outline",disabled:!0,children:e("thread.headerActions.reconnectGithub")})});if(!v)return null;const M=F?Sc({lifecycle:D,branch:$,claimPhase:k,pr:E,checks:G.data??[],reviews:_.data??null,noReviewableDiff:Ys(y),loading:Ss(q),t:e}):Vc(e),Y=JSON.stringify({label:M.label,branchKind:$.kind,workingTreeDirty:$.kind==="ready"?$.workingTreeDirty:null,unpushed:$.kind==="ready"?$.unpushed:null,aheadOfBase:$.kind==="ready"?$.aheadOfBase:null,lifecycle:D.phase,headBranch:F,noReviewableDiff:Ys(y)});w.current!==Y&&(w.current=Y,Zr("header button",{label:M.label,tooltip:M.tooltip,action:M.action,chatBranch:d,sandboxBranch:I,sandboxRouteBranch:O,headBranch:F,branchMeta:A,effectiveBranchMeta:$,lifecyclePhase:D.phase,prNumber:E?.number??null,prState:E?.state??null}));const B=Q=>(h(),c.sendMessage({parts:[{type:"text",text:Q}]})),Z=c.isStreaming,se=$.kind==="ready"?$.base:"main",ie=async()=>{await q.refetch()},ge=async()=>{const Q=d,ee=vn(yn(r?.user));le==="cms"?o({runtime:"cms",branch:ee}):await l(ee),Q&&Q!==se&&await i(Q)},ue=async Q=>{if(!(!v||x)){g(!0);try{const ee=ta(r?.user);await ei(s.slug,Oe(v),{number:Q,coAuthor:ee}),et.success(e("thread.headerActions.publishedPr",{prNumber:String(Q)})),await ie(),await ge()}catch(ee){et.error(ee instanceof ti?ee.detail??si(ee.reason,e):ee instanceof Error?ee.message:e("thread.headerActions.failedToMergePullRequest"))}finally{g(!1)}}},re=(Q,ee)=>p({open:!0,mode:Q,policyOverride:ee}),fe=Q=>{if(F)switch(Q){case"publish":re("publish",M.meta?.publishPolicyOverride??null);return;case"create-pr":re("review",null);return;case"merge":E&&ue(E.number);return;case"sync":if(Z)return;B(_c({branch:F,base:se}));return;case"open-pr-page":E?.htmlUrl&&window.open(E.htmlUrl,"_blank","noopener,noreferrer");return;case"review":if(Z)return;E&&B(qc({prNumber:E.number}));return;case"reopen":if(Z)return;E&&B(Oc({prNumber:E.number}));return;case"rebase":if(Z)return;B(Mc({branch:F}));return;case"fix-checks":if(Z)return;E&&B(zc({prNumber:E.number,failingChecks:M.meta?.failingChecks??[]}));return;case"mark-ready":if(Z)return;E&&B(Uc({prNumber:E.number}));return;case"resolve-comments":if(Z)return;E&&B(Hc({prNumber:E.number}));return}},ye=x||Z,z=a.jsx(Kc,{t:e,button:M,actionBusy:ye,changeRequestPending:x,savePending:te,onAction:fe}),oe=$.kind==="ready"&&$.pushError&&$.pushFailingSince?e("thread.headerActions.pushFailing",{since:new Date($.pushFailingSince).toLocaleString(),error:$.pushError}):null,xe=oe?a.jsx(cr,{label:oe,children:a.jsx(fn,{role:"img","aria-label":oe,className:"size-4 text-warning"})}):null;return O?a.jsxs(a.Fragment,{children:[xe,z,a.jsx(ya,{open:b.open,mode:b.mode,fastPreview:!1,recoverSandbox:()=>m.mutateAsync({virtualMcpId:t,branch:O,...u?{threadId:u}:{}}),onOpenChange:Q=>{Q||p(ee=>({...ee,open:!1}))},orgSlug:s.slug,virtualMcpId:t,branch:O,baseBranch:se,repoTarget:Oe(v),owner:v.owner,repo:v.name,publishPolicy:b.policyOverride??V,draftPreviewUrl:X,destinationHost:null,previewServerUrl:ne,compareDraft:X?{kind:"sandbox",previewUrl:X}:null,lastPublishedPr:W.data??null,onRequestApproval:()=>p(Q=>({...Q,open:!0,mode:"review"})),openPullRequest:E?.state==="open"?E:null,onPullRequestChanged:ie,onPublished:ge})]}):a.jsxs(a.Fragment,{children:[xe,z]})}function Wc(t){const e=T.c(33),{orgSlug:s,virtualMcpId:r,branch:n}=t,i=me(),[d,l]=H.useState(!1),o=kt(r,n),u=o.kind==="protocol"&&o.source==="local"?o:null;let c;e[0]!==n||e[1]!==s||e[2]!==r?(c=n?{orgSlug:s,virtualMcpId:r,branch:n}:null,e[0]=n,e[1]=s,e[2]=r,e[3]=c):c=e[3];const h=xn(c),{data:b}=Ar(u,h);if(!u||!h||!n)return null;let p;e[4]!==b?(p=b?Object.keys(b.changes).length:0,e[4]=b,e[5]=p):p=e[5];const f=p;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=()=>l(!0),e[6]=m):m=e[6];let x;e[7]!==f||e[8]!==i?(x=f>0?i("decoServe.changes.buttonCount",{count:f}):i("decoServe.changes.button"),e[7]=f,e[8]=i,e[9]=x):x=e[9];let g;e[10]!==x?(g=a.jsx(ve,{size:"sm",variant:"outline","data-testid":"local-changes-button",onClick:m,children:x}),e[10]=x,e[11]=g):g=e[11];let w;e[12]!==i?(w=i("decoServe.changes.title"),e[12]=i,e[13]=w):w=e[13];let j;e[14]!==w?(j=a.jsx(gr,{className:"sr-only",children:w}),e[14]=w,e[15]=j):j=e[15];let v;e[16]!==n||e[17]!==h||e[18]!==u||e[19]!==d||e[20]!==s||e[21]!==i||e[22]!==r?(v=d?a.jsx(vr,{children:N=>{const{reset:C}=N;return a.jsx(yr,{fallback:y=>{const{resetError:A}=y;return a.jsx(cn,{title:i("decoServe.changes.title"),body:a.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:i("decoServe.changes.loadFailed")}),onClose:()=>{C(),A(),l(!1)}})},children:a.jsx(H.Suspense,{fallback:a.jsx(ms,{pane:a.jsx($n,{}),list:a.jsx(cn,{title:i("decoServe.changes.title"),loading:!0,body:a.jsx(hs,{children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Bt,{}),a.jsx(Bt,{})]})}),onClose:()=>l(!1)})}),children:a.jsx(Qc,{orgSlug:s,virtualMcpId:r,branch:n,backend:u,cacheKey:h,onClose:()=>l(!1)})})})}}):null,e[16]=n,e[17]=h,e[18]=u,e[19]=d,e[20]=s,e[21]=i,e[22]=r,e[23]=v):v=e[23];let P;e[24]!==j||e[25]!==v?(P=a.jsxs(xr,{"aria-describedby":void 0,className:"flex h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] max-w-none flex-col md:flex-row md:h-[calc(100dvh-6rem)] md:w-[calc(100vw-6rem)] gap-0 overflow-hidden p-0 sm:max-w-none",closeButtonClassName:"top-3.5 right-3.5",children:[j,v]}),e[24]=j,e[25]=v,e[26]=P):P=e[26];let S;e[27]!==d||e[28]!==P?(S=a.jsx(br,{open:d,onOpenChange:l,children:P}),e[27]=d,e[28]=P,e[29]=S):S=e[29];let k;return e[30]!==S||e[31]!==g?(k=a.jsxs(a.Fragment,{children:[g,S]}),e[30]=S,e[31]=g,e[32]=k):k=e[32],k}function cn(t){const e=T.c(22),{title:s,trailing:r,body:n,loading:i,onClose:d}=t,l=i===void 0?!1:i,o=me(),u=l?"loading":"ready";let c;e[0]!==s?(c=a.jsx("span",{className:"truncate",children:s}),e[0]=s,e[1]=c):c=e[1];let h;e[2]!==c||e[3]!==r?(h=a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[c,r]}),e[2]=c,e[3]=r,e[4]=h):h=e[4];let b;e[5]!==o?(b=o("decoServe.changes.hint"),e[5]=o,e[6]=b):b=e[6];let p;e[7]!==b?(p=a.jsx("p",{className:"text-2xs text-muted-foreground",children:a.jsx(Yr,{text:b})}),e[7]=b,e[8]=p):p=e[8];let f;e[9]!==o?(f=o("decoServe.changes.close"),e[9]=o,e[10]=f):f=e[10];let m;e[11]!==d||e[12]!==f?(m=a.jsx(ve,{type:"button",variant:"outline",className:"w-full",onClick:d,children:f}),e[11]=d,e[12]=f,e[13]=m):m=e[13];let x;e[14]!==p||e[15]!==m?(x=a.jsxs(a.Fragment,{children:[p,m]}),e[14]=p,e[15]=m,e[16]=x):x=e[16];let g;return e[17]!==n||e[18]!==u||e[19]!==h||e[20]!==x?(g=a.jsx(Gs,{state:u,header:h,body:n,footer:x}),e[17]=n,e[18]=u,e[19]=h,e[20]=x,e[21]=g):g=e[21],g}function Qc(t){const e=T.c(54),{orgSlug:s,virtualMcpId:r,branch:n,backend:i,cacheKey:d,onClose:l}=t,o=me();let u;e[0]!==n||e[1]!==s||e[2]!==r?(u={orgSlug:s,virtualMcpId:r,branch:n},e[0]=n,e[1]=s,e[2]=r,e[3]=u):u=e[3];let c;e[4]!==i||e[5]!==d||e[6]!==u?(c={backend:i,cacheKey:d,scope:u},e[4]=i,e[5]=d,e[6]=u,e[7]=c):c=e[7];const h=Fn(c);let b;e[8]!==n||e[9]!==s||e[10]!==h.refresh||e[11]!==r?(b={orgSlug:s,virtualMcpId:r,branch:n,refresh:h.refresh},e[8]=n,e[9]=s,e[10]=h.refresh,e[11]=r,e[12]=b):b=e[12];const p=ni(b),f=Cr(s,r).phase==="saving",m=i.describe.readOnly,[x,g]=H.useState(null),[w,j]=H.useState(null),[v,P]=H.useState(!1),{summary:S}=h;let k,N,C,y,A;if(e[13]!==x||e[14]!==i||e[15]!==w||e[16]!==p||e[17]!==v||e[18]!==f||e[19]!==m||e[20]!==h.blocks||e[21]!==h.entries||e[22]!==h.sidesFailed||e[23]!==h.sidesPending||e[24]!==S.blocks||e[25]!==S.count||e[26]!==S.pages||e[27]!==o){const O=[...S.pages,...S.blocks],F=O.find(_=>ke(_)===x)??O[0]??null;let q;e[33]!==S.count||e[34]!==o?(q=S.count===0?o("decoServe.changes.title"):S.count===1?o("decoServe.changes.titleOne"):o("decoServe.changes.titleCount",{count:S.count}),e[33]=S.count,e[34]=o,e[35]=q):q=e[35],A=q;const E=(_,W)=>W.length===0?null:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("div",{className:"px-0.5 text-2xs font-medium text-muted-foreground",children:_}),W.map($=>{const V=ke($);return a.jsx(ua,{change:$,bodyPending:h.sidesPending,v8:!0,selected:F!==null&&ke(F)===V,onSelect:()=>g(V),confirming:w===V,onConfirmingChange:te=>j(te?V:null),onDiscard:m||!$.entry?void 0:()=>{p(i,[$.entry],o("thread.publishPopover.discarded",{name:$.name}))},isPublishing:!1,isDiscarding:f},V)})]});let G;e[36]!==i||e[37]!==p||e[38]!==v||e[39]!==f||e[40]!==m||e[41]!==h.entries||e[42]!==S.count||e[43]!==o?(G=m||S.count<=1?null:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"ml-auto shrink-0 text-2xs text-muted-foreground transition-colors hover:text-destructive disabled:opacity-50",onClick:()=>P(!0),disabled:f,children:o("thread.publishPopover.discardAll")}),a.jsx(Bs,{open:v,onOpenChange:P,children:a.jsxs(Ts,{children:[a.jsxs(Cs,{children:[a.jsx(ks,{children:o("thread.publishPopover.discardAllTitle")}),a.jsx(Ns,{children:o("thread.publishPopover.discardAllConfirm")})]}),a.jsxs(Ds,{children:[a.jsx(As,{children:o("thread.publishDialog.cancel")}),a.jsx(Rs,{onClick:()=>{p(i,h.entries,o("thread.publishDialog.allChangesDiscarded"))},disabled:f,className:K(jr({variant:"destructive"})),children:o("thread.publishPopover.discardAll")})]})]})})]}),e[36]=i,e[37]=p,e[38]=v,e[39]=f,e[40]=m,e[41]=h.entries,e[42]=S.count,e[43]=o,e[44]=G):G=e[44],C=G,N=S.count===0?a.jsxs("div",{className:"flex flex-col items-center gap-1 py-10 text-center",children:[a.jsx(Sn,{className:"mb-1 size-5 text-success"}),a.jsx("p",{className:"text-sm font-medium",children:o("decoServe.changes.empty")})]}):a.jsxs(hs,{children:[E(o("thread.publishPopover.pagesGroup"),S.pages),E(o("thread.publishPopover.blocksGroup"),S.blocks),h.sidesFailed?a.jsx("p",{className:"text-2xs text-muted-foreground",children:o("thread.publishPopover.detailsUnavailable")}):null]}),k=ms,y=F?a.jsx("div",{className:K(ss,"relative flex"),children:a.jsx(ga,{change:F,diff:null,bodyPending:h.sidesPending,previewServerUrl:null,draft:null,lastPage:null,v8:{blocks:h.blocks}},ke(F))}):a.jsx("div",{className:K(ss,"bg-muted/40")}),e[13]=x,e[14]=i,e[15]=w,e[16]=p,e[17]=v,e[18]=f,e[19]=m,e[20]=h.blocks,e[21]=h.entries,e[22]=h.sidesFailed,e[23]=h.sidesPending,e[24]=S.blocks,e[25]=S.count,e[26]=S.pages,e[27]=o,e[28]=k,e[29]=N,e[30]=C,e[31]=y,e[32]=A}else k=e[28],N=e[29],C=e[30],y=e[31],A=e[32];let D;e[45]!==N||e[46]!==C||e[47]!==l||e[48]!==A?(D=a.jsx(cn,{title:A,trailing:C,body:N,onClose:l}),e[45]=N,e[46]=C,e[47]=l,e[48]=A,e[49]=D):D=e[49];let I;return e[50]!==k||e[51]!==y||e[52]!==D?(I=a.jsx(k,{pane:y,list:D}),e[50]=k,e[51]=y,e[52]=D,e[53]=I):I=e[53],I}function Jc(t){const e=T.c(5),{virtualMcpId:s,branch:r}=t,n=me(),i=kt(s,r);if(!Xc(i))return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(st,{asChild:!0,children:a.jsx("span",{"data-testid":"content-version-badge",className:"shrink-0 rounded border border-border px-1.5 py-px font-mono text-2xs leading-4 text-muted-foreground",children:"v8"})}),e[0]=d):d=e[0];let l;e[1]!==n?(l=n("decoServe.version.v8"),e[1]=n,e[2]=l):l=e[2];let o;return e[3]!==l?(o=a.jsxs(tt,{children:[d,a.jsx(nt,{side:"bottom",className:"max-w-xs",children:l})]}),e[3]=l,e[4]=o):o=e[4],o}function Xc(t){return t.kind==="protocol"?t.hasSchema!==!1:t.kind==="unavailable"&&t.source!=="local"}function Yc(t){const e=T.c(11),{virtualMcpId:s,branch:r}=t,n=me(),i=kt(s,r);if(!(i.kind==="protocol"&&i.source==="local"&&i.describe.readOnly))return null;let l;e[0]!==n?(l=n("decoServe.readOnly.label"),e[0]=n,e[1]=l):l=e[1];let o;e[2]!==l?(o=a.jsx(st,{asChild:!0,children:a.jsx("span",{tabIndex:0,"data-testid":"deco-serve-read-only",className:"shrink-0 rounded-full bg-warning/10 px-2 py-0.5 text-xs font-medium text-foreground",children:l})}),e[2]=l,e[3]=o):o=e[3];let u;e[4]!==n?(u=n("decoServe.readOnly.tooltip"),e[4]=n,e[5]=u):u=e[5];let c;e[6]!==u?(c=a.jsx(nt,{side:"bottom",className:"max-w-xs",children:a.jsx(Yr,{text:u})}),e[6]=u,e[7]=c):c=e[7];let h;return e[8]!==o||e[9]!==c?(h=a.jsxs(tt,{children:[o,c]}),e[8]=o,e[9]=c,e[10]=h):h=e[10],h}function Zc(t){return t.servingLocally||t.localPreview?"open":t.runtimeResolved?t.runtime!=="cms"?"open":t.branch?t.blocksV8?"open":t.defaultBranch?t.defaultBranch===t.branch?"blocked":"open":t.listedDraft||t.defaultBranch===null?"open":"pending":"pending":"pending"}function ed(){const t=T.c(27),e=It(),{org:s}=rs(),r=Ks(e?.virtualMcpId),n=r?.id??e?.virtualMcpId??"",i=e?.currentBranch??null,{runtime:d,resolved:l}=fs(r?.id),o=jn(r?.id),{url:u}=pn(r?.id),{connection:c}=bn(n||null),h=!!r&&!!i&&l&&d==="cms"&&!o&&!u,b=i??"",p=e?.taskId??null;let f,m,x,g;t[0]!==s.slug||t[1]!==b||t[2]!==p||t[3]!==n?(m={orgSlug:s.slug,virtualMcpId:n,branch:b,threadId:p},f=td,g=ft,x=Nn(m),t[0]=s.slug,t[1]=b,t[2]=p,t[3]=n,t[4]=f,t[5]=m,t[6]=x,t[7]=g):(f=t[4],m=t[5],x=t[6],g=t[7]);let w;t[8]!==f||t[9]!==m?(w=(D,I)=>f(I?.queryKey)===f(Rn(m))?D:void 0,t[8]=f,t[9]=m,t[10]=w):w=t[10];let j;t[11]!==h||t[12]!==x||t[13]!==w?(j={...x,enabled:h,placeholderData:w},t[11]=h,t[12]=x,t[13]=w,t[14]=j):j=t[14];const v=g(j),P=!!u,S=!!c;let k;if(t[15]!==o||t[16]!==i||t[17]!==r?.metadata?.releases||t[18]!==l||t[19]!==d||t[20]!==v.data||t[21]!==v.isError||t[22]!==P||t[23]!==S){let D;t[25]!==i?(D=I=>I.branch===i,t[25]=i,t[26]=D):D=t[26],k=Zc({runtime:d,runtimeResolved:l,blocksV8:o,localPreview:P,servingLocally:S,branch:i,listedDraft:(r?.metadata?.releases??[]).some(D),defaultBranch:v.data?v.data.base??null:v.isError?null:void 0}),t[15]=o,t[16]=i,t[17]=r?.metadata?.releases,t[18]=l,t[19]=d,t[20]=v.data,t[21]=v.isError,t[22]=P,t[23]=S,t[24]=k}else k=t[24];const N=k,C=`${n}:${i??""}`,[y,A]=H.useState(null);return N!=="pending"&&(y?.key!==C||y.gate!==N)&&A({key:C,gate:N}),N==="pending"&&y?.key===C?y.gate:N}function td(t){return t?.[2]}function sd(t){const e=!t.hasEntity&&!t.servingLocally,s=t.hasEntity&&!t.localPreview&&!t.servingLocally&&!t.onProduction&&t.showsRepositoryActions;return{hidden:e,localFiles:!e&&t.servingLocally,draftSelect:!e&&t.hasEntity,publish:e||!s?null:t.runtime==="cms"?"cms":"code"}}function Qd(t){const e=T.c(2),{blocksOnly:s}=t;let r;return e[0]!==s?(r=s?a.jsx(nd,{}):a.jsx(ka,{}),e[0]=s,e[1]=r):r=e[1],r}function nd(){return jn(wi())?a.jsx(pa,{value:!1,children:a.jsx(ka,{})}):null}function ka(){const t=T.c(32),e=It(),{org:s}=rs(),r=Ks(e?.virtualMcpId),n=e?.currentBranch??null,i=fs(r?.id).runtime,{url:d}=pn(r?.id),{connection:l}=bn(r?.id??e?.virtualMcpId),o=r?.id??e?.virtualMcpId,u=ed()!=="open",c=!!r,h=!!l,b=!!d;let p;t[0]!==r||t[1]!==u||t[2]!==i||t[3]!==c||t[4]!==h||t[5]!==b?(p=sd({hasEntity:c,servingLocally:h,localPreview:b,showsRepositoryActions:!!r&&Dl(r),runtime:i,onProduction:u}),t[0]=r,t[1]=u,t[2]=i,t[3]=c,t[4]=h,t[5]=b,t[6]=p):p=t[6];const f=p;if(!o||f.hidden)return null;let m;t[7]!==n||t[8]!==o?(m=a.jsx(Jc,{virtualMcpId:o,branch:n}),t[7]=n,t[8]=o,t[9]=m):m=t[9];let x;t[10]!==n||t[11]!==f.localFiles||t[12]!==o?(x=f.localFiles&&a.jsx(Yc,{virtualMcpId:o,branch:n}),t[10]=n,t[11]=f.localFiles,t[12]=o,t[13]=x):x=t[13];let g;t[14]!==n||t[15]!==s||t[16]!==f.localFiles||t[17]!==o?(g=f.localFiles&&a.jsx(Wc,{orgSlug:s.slug,virtualMcpId:o,branch:n}),t[14]=n,t[15]=s,t[16]=f.localFiles,t[17]=o,t[18]=g):g=t[18];let w;t[19]!==n||t[20]!==r||t[21]!==f.draftSelect?(w=r&&f.draftSelect&&a.jsx("div",{className:"flex min-w-0 shrink items-center justify-end",children:a.jsx(Gi,{virtualMcp:r,currentBranch:n})}),t[19]=n,t[20]=r,t[21]=f.draftSelect,t[22]=w):w=t[22];let j;t[23]!==r||t[24]!==f.publish?(j=r&&f.publish&&a.jsxs(a.Fragment,{children:[a.jsx(Ha,{orientation:"vertical",className:"mx-1 data-[orientation=vertical]:h-4"}),a.jsx("div",{className:"flex shrink-0 items-center justify-end gap-1",children:f.publish==="cms"?a.jsx(Ic,{virtualMcpId:r.id}):a.jsx(Gc,{virtualMcpId:r.id})})]}),t[23]=r,t[24]=f.publish,t[25]=j):j=t[25];let v;return t[26]!==m||t[27]!==x||t[28]!==g||t[29]!==w||t[30]!==j?(v=a.jsxs(a.Fragment,{children:[m,x,g,w,j]}),t[26]=m,t[27]=x,t[28]=g,t[29]=w,t[30]=j,t[31]=v):v=t[31],v}function dn(t){const e=T.c(7),{icon:s,title:r,description:n,action:i}=t;let d;e[0]!==i?(d=i?{children:i.label,onClick:i.onClick,disabled:i.disabled}:void 0,e[0]=i,e[1]=d):d=e[1];let l;return e[2]!==n||e[3]!==s||e[4]!==d||e[5]!==r?(l=a.jsx(Xs,{children:a.jsx(Xs.Content,{children:a.jsx(Xs.Container,{children:a.jsx(Pi,{icon:s,title:r,description:n,buttonProps:d})})})}),e[2]=n,e[3]=s,e[4]=d,e[5]=r,e[6]=l):l=e[6],l}function Jd(t){const e=T.c(28),{virtualMcpId:s,icon:r,copy:n,skeleton:i,children:d}=t,l=me(),{org:o}=rs(),u=It(),c=u?.currentBranch??null,h=kt(s,c);Ua(h.kind==="protocol"&&h.source==="github");const{openPanel:b}=Si();if(!c){const m=n.noDraftTitle,x=n.noDraftDesc;let g;e[0]!==l?(g=l("sectionsEditor.namedRules.openEditor"),e[0]=l,e[1]=g):g=e[1];let w;e[2]!==b?(w=()=>b("content"),e[2]=b,e[3]=w):w=e[3];let j;e[4]!==g||e[5]!==w?(j={label:g,onClick:w},e[4]=g,e[5]=w,e[6]=j):j=e[6];let v;return e[7]!==n.noDraftDesc||e[8]!==n.noDraftTitle||e[9]!==r||e[10]!==j?(v=a.jsx(dn,{icon:r,title:m,description:x,action:j}),e[7]=n.noDraftDesc,e[8]=n.noDraftTitle,e[9]=r,e[10]=j,e[11]=v):v=e[11],v}if(Ul(h)){let m;return e[12]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(Kl,{}),e[12]=m):m=e[12],m}if(h.kind==="pending"){let m;return e[13]!==i?(m=a.jsx(a.Fragment,{children:i}),e[13]=i,e[14]=m):m=e[14],m}if(h.kind!=="protocol"){let m;return e[15]!==n.loadFailed||e[16]!==n.loadFailedHint||e[17]!==r?(m=a.jsx(dn,{icon:r,title:n.loadFailed,description:n.loadFailedHint}),e[15]=n.loadFailed,e[16]=n.loadFailedHint,e[17]=r,e[18]=m):m=e[18],m}const p=u?.taskId??null;let f;return e[19]!==c||e[20]!==d||e[21]!==n||e[22]!==r||e[23]!==o.slug||e[24]!==i||e[25]!==p||e[26]!==s?(f=a.jsx(rd,{orgSlug:o.slug,virtualMcpId:s,branch:c,threadId:p,icon:r,copy:n,skeleton:i,children:d},c),e[19]=c,e[20]=d,e[21]=n,e[22]=r,e[23]=o.slug,e[24]=i,e[25]=p,e[26]=s,e[27]=f):f=e[27],f}function rd(t){const e=T.c(35),{orgSlug:s,virtualMcpId:r,branch:n,threadId:i,icon:d,copy:l,skeleton:o,children:u}=t,c=me();let h;e[0]!==n||e[1]!==s||e[2]!==i||e[3]!==r?(h={orgSlug:s,virtualMcpId:r,branch:n,threadId:i,previewUrl:null},e[0]=n,e[1]=s,e[2]=i,e[3]=r,e[4]=h):h=e[4];const b=h,p=sl(b),f=Hl(b),m=p.data,x=f.data;let g;e[5]!==n||e[6]!==s||e[7]!==r?(g={orgSlug:s,virtualMcpId:r,branch:n},e[5]=n,e[6]=s,e[7]=r,e[8]=g):g=e[8];const w=nl(g,ql);if(!m||!x||!w.ready){if(p.isError||f.isError||w.failed){const S=l.loadFailed,k=l.loadFailedHint;let N;e[9]!==c?(N=c("sectionsEditor.namedRules.tryAgain"),e[9]=c,e[10]=N):N=e[10];let C;e[11]!==p||e[12]!==w||e[13]!==f?(C=()=>{p.isError&&p.refetch(),f.isError&&f.refetch(),w.failed&&w.retry()},e[11]=p,e[12]=w,e[13]=f,e[14]=C):C=e[14];let y;e[15]!==N||e[16]!==C?(y={label:N,onClick:C},e[15]=N,e[16]=C,e[17]=y):y=e[17];let A;return e[18]!==l.loadFailed||e[19]!==l.loadFailedHint||e[20]!==d||e[21]!==y?(A=a.jsx(dn,{icon:d,title:S,description:k,action:y}),e[18]=l.loadFailed,e[19]=l.loadFailedHint,e[20]=d,e[21]=y,e[22]=A):A=e[22],A}let P;return e[23]!==o?(P=a.jsx(a.Fragment,{children:o}),e[23]=o,e[24]=P):P=e[24],P}let j;e[25]!==n||e[26]!==u||e[27]!==m||e[28]!==x||e[29]!==s||e[30]!==i||e[31]!==r?(j=u({orgSlug:s,virtualMcpId:r,branch:n,threadId:i,decofile:m,meta:x}),e[25]=n,e[26]=u,e[27]=m,e[28]=x,e[29]=s,e[30]=i,e[31]=r,e[32]=j):j=e[32];let v;return e[33]!==j?(v=a.jsx(a.Fragment,{children:j}),e[33]=j,e[34]=v):v=e[34],v}export{dn as S,Qd as a,ed as b,Jd as c,Oi as u};
|