decocms 4.562.1 → 4.563.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Cwj2JDLb.js → AlertCircle-2LbzMVC9.js} +1 -1
- package/dist/client/assets/{AreaChart-M71cxP0N.js → AreaChart-qBz2MFzD.js} +1 -1
- package/dist/client/assets/{ArrowLeft-D6im8CSl.js → ArrowLeft-BeuQwyHa.js} +1 -1
- package/dist/client/assets/{ArrowUp-zoWFBt83.js → ArrowUp-DmxAfWhF.js} +1 -1
- package/dist/client/assets/{CartesianChart-CkRq1ukN.js → CartesianChart-BSwxZ1ZU.js} +1 -1
- package/dist/client/assets/{CategoricalChart-CJyVrm-b.js → CategoricalChart-DVdTZlRq.js} +1 -1
- package/dist/client/assets/{CheckCircle-Dycaqr3_.js → CheckCircle-BzNTGMCW.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-Cq__IjWt.js → ChevronSelectorVertical-XdbRnSsi.js} +1 -1
- package/dist/client/assets/{ChevronUp-B0uKxpVg.js → ChevronUp-aYmfXYet.js} +1 -1
- package/dist/client/assets/{CreditCard01-CMHPxKus.js → CreditCard01-yFcUZGe-.js} +1 -1
- package/dist/client/assets/{Globe04-BLpPYUUd.js → Globe04-RPMmcIuy.js} +1 -1
- package/dist/client/assets/{Key01-KS2Cdqso.js → Key01-jvDltRrN.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CFo-1erV.js → LinkBroken01-Jybptj_M.js} +1 -1
- package/dist/client/assets/{Minus-CR14C6Ew.js → Minus-BqtyYKKc.js} +1 -1
- package/dist/client/assets/{Monitor01-PjSuNm4O.js → Monitor01-As0zpJLy.js} +1 -1
- package/dist/client/assets/{Play-DAD0wkps.js → Play-CdlorRHF.js} +1 -1
- package/dist/client/assets/{Plus-Caq968Zm.js → Plus-CzoopYlU.js} +1 -1
- package/dist/client/assets/ReferenceLine-CJng4Q0_.js +1 -0
- package/dist/client/assets/{SearchMd-BionSqTl.js → SearchMd-By2dNUiw.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DUpALglE.js → ShoppingBag01-DhegylE0.js} +1 -1
- package/dist/client/assets/{Sun-x19ShBxe.js → Sun-Hd0LHTxB.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Dghq_Bvd.js → SwitchHorizontal01-Czrqzt6f.js} +1 -1
- package/dist/client/assets/{Tool01-GdBdG6P_.js → Tool01-D38zOT0h.js} +1 -1
- package/dist/client/assets/{Tooltip-CDDThlKy.js → Tooltip-Dxjn-_yM.js} +1 -1
- package/dist/client/assets/{Trash01-DhMVlpac.js → Trash01-BxSWir9J.js} +1 -1
- package/dist/client/assets/{Upload01-hsehoAUh.js → Upload01-C8sapTWh.js} +1 -1
- package/dist/client/assets/{UserSquare-T5uOviXx.js → UserSquare-CEg-eLCw.js} +1 -1
- package/dist/client/assets/{Users01-DDaeVlhF.js → Users01-CMreTMtq.js} +1 -1
- package/dist/client/assets/{XClose-NmocES7U.js → XClose-DGifUqyQ.js} +1 -1
- package/dist/client/assets/{Zap-aTbgq59l.js → Zap-BLaVFWQx.js} +1 -1
- package/dist/client/assets/{access-gate-CpAtBb_h.js → access-gate-BJSZ7nU5.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BFqv_pWT.js → add-connection-dialog-Dpu5ecJP.js} +1 -1
- package/dist/client/assets/agent-app-CHKycGm0.js +1 -0
- package/dist/client/assets/agent-assets-7nArEuts.js +1 -0
- package/dist/client/assets/{agent-automation-7-KjK-1c.js → agent-automation-Dq1UMpQM.js} +3 -3
- package/dist/client/assets/{agent-automations-DnNwxwTt.js → agent-automations-DF3vcb3-.js} +1 -1
- package/dist/client/assets/agent-calendar-CsvxRBRw.js +1 -0
- package/dist/client/assets/agent-capabilities-CaXbVMop.js +1 -0
- package/dist/client/assets/{agent-connect-sources-SuTyB8Qe.js → agent-connect-sources-84FLUgzX.js} +1 -1
- package/dist/client/assets/agent-deck-DEx4qeYv.js +1 -0
- package/dist/client/assets/agent-e2e-CfTkWgUa.js +1 -0
- package/dist/client/assets/agent-experiments-BMy2QOPP.js +1 -0
- package/dist/client/assets/agent-file-C7mhhKFK.js +1 -0
- package/dist/client/assets/agent-hosting-BmtgVBqV.js +1 -0
- package/dist/client/assets/{agent-icon-DD6O0sln.js → agent-icon-U2nlXoBG.js} +1 -1
- package/dist/client/assets/agent-library-DIxeSWXa.js +1 -0
- package/dist/client/assets/agent-library-file-DQB6i5_0.js +1 -0
- package/dist/client/assets/agent-overview-D8ZTdoEM.js +1 -0
- package/dist/client/assets/agent-releases-DOPovy0S.js +2 -0
- package/dist/client/assets/agent-settings-x3yUV6x9.js +1 -0
- package/dist/client/assets/{agent-site-editor-YGSo4JHf.js → agent-site-editor-Pg_WHlnv.js} +2 -2
- package/dist/client/assets/agent-site-editor-code-DDscaXHP.js +2 -0
- package/dist/client/assets/agent-site-editor-content-CBj6Azpl.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-Doqukvwz.js +1 -0
- package/dist/client/assets/agent-view-CvpQlU18.js +1 -0
- package/dist/client/assets/{agent-view-guard-Ud9RVhUT.js → agent-view-guard-BFnkZyhp.js} +1 -1
- package/dist/client/assets/{ai-providers-CdWvTe6E.js → ai-providers-tFJSU00y.js} +1 -1
- package/dist/client/assets/{alert-rSlkmSpl.js → alert-B52lXsYB.js} +1 -1
- package/dist/client/assets/{analytics-sections-CdJGMHGj.js → analytics-sections-DgZGw207.js} +1 -1
- package/dist/client/assets/api-keys-BEFmsf3L.js +1 -0
- package/dist/client/assets/{api-keys-CgV7T2W3.js → api-keys-Bc1E8umo.js} +1 -1
- package/dist/client/assets/app-editor-a13s_yZZ.js +1 -0
- package/dist/client/assets/{asset-utils-DJaTbmOK.js → asset-utils-DxOK6Cj3.js} +1 -1
- package/dist/client/assets/{auth-Dfx2bf9S.js → auth-D991fBKg.js} +1 -1
- package/dist/client/assets/{auth-catchall-BzI646tE.js → auth-catchall-CO4eQSBG.js} +1 -1
- package/dist/client/assets/{auth-entry-BA2dv7O1.js → auth-entry-IOobChfY.js} +1 -1
- package/dist/client/assets/{auth-split-layout-3t1_TKos.js → auth-split-layout-Dn_4EroD.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-EuyAX3Gy.js → authenticate-and-persist-oauth-CM3iiCDW.js} +1 -1
- package/dist/client/assets/{automation-list-row-BK5XD6ZY.js → automation-list-row-sEGCpgiC.js} +1 -1
- package/dist/client/assets/{automation-runs-BekfbsHI.js → automation-runs-DnhCJL7r.js} +1 -1
- package/dist/client/assets/{automations-ocOVuWpR.js → automations-BopJHgke.js} +1 -1
- package/dist/client/assets/{autosend-BLYIlkXq.js → autosend-D6GGYoeu.js} +1 -1
- package/dist/client/assets/{badge-9UZ-oy57.js → badge-C9w1KAGQ.js} +1 -1
- package/dist/client/assets/{block-document-B5Xpou_B.js → block-document-ExA3sDvi.js} +2 -2
- package/dist/client/assets/{blocks-preview-workspace-context-CGoI0EUn.js → blocks-preview-workspace-context-Gbv7_zq8.js} +1 -1
- package/dist/client/assets/blocks-tab-states-oXZbJa9b.js +1 -0
- package/dist/client/assets/{blog-schema-DMB79fe6.js → blog-schema-4OEvCOpU.js} +1 -1
- package/dist/client/assets/{buckets-C5e8GKB5.js → buckets-DsGf5D8D.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-aExDV9Mz.js → build-improve-prompt-doc-BpZBupFA.js} +1 -1
- package/dist/client/assets/{calendar-CKcdkgh5.js → calendar-ahGH-Iwe.js} +1 -1
- package/dist/client/assets/{capability-load-error-D8AT7eAw.js → capability-load-error-BG7LprlO.js} +1 -1
- package/dist/client/assets/category-editor-Ctbp0oQy.js +1 -0
- package/dist/client/assets/{chart-Ch4wXn1G.js → chart-DnblhNHq.js} +1 -1
- package/dist/client/assets/{chat-context-tsaqCp6v.js → chat-context-CCj5lauv.js} +2 -2
- package/dist/client/assets/{chat-draft-DeOYn8wH.js → chat-draft-BtMWyLm7.js} +1 -1
- package/dist/client/assets/{checkbox-bO8ZnM7n.js → checkbox-DB14k3TQ.js} +1 -1
- package/dist/client/assets/{choose-editor-B-1DX2pl.js → choose-editor-D4zx1UJt.js} +1 -1
- package/dist/client/assets/{cli-auth-success-WUcj8Laj.js → cli-auth-success-DeaH4VUx.js} +1 -1
- package/dist/client/assets/{client-icons-CJKwmsS5.js → client-icons-C4W9Kqhd.js} +1 -1
- package/dist/client/assets/cms-settings-editor-CcuLaEnU.js +1 -0
- package/dist/client/assets/cms-store-drafts-BumH78UY.js +1 -0
- package/dist/client/assets/{collapsible-CehJ-xlR.js → collapsible-BPEhSNLz.js} +1 -1
- package/dist/client/assets/{collection-detail-w7NYTWNb.js → collection-detail-ralZDDkv.js} +1 -1
- package/dist/client/assets/{collection-display-button-CVOVdzmi.js → collection-display-button-CigTGx80.js} +1 -1
- package/dist/client/assets/{collection-search-Lm88VC-w.js → collection-search-D_oD-yY0.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-LUTykEyP.js → collection-table-wrapper-C2dK4p_4.js} +1 -1
- package/dist/client/assets/{collection-tabs-BW9NTpao.js → collection-tabs-SAUXvS4g.js} +1 -1
- package/dist/client/assets/{combobox-C8IS_aP5.js → combobox-hVgdYGtQ.js} +1 -1
- package/dist/client/assets/{command-B42vqDSm.js → command-DiccrIM8.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-gN7svOR8.js → companion-mcps-section-BUEyDlWy.js} +1 -1
- package/dist/client/assets/{config--cZAprAj.js → config-DgUlbPLE.js} +1 -1
- package/dist/client/assets/{connect-BAZtz6qy.js → connect-DhpQ_i5Y.js} +3 -3
- package/dist/client/assets/{connect-layout-FGHNVpHc.js → connect-layout-Dgb_j_Nn.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-BlacChCY.js → connect-source-dialog-Dga8Dh15.js} +1 -1
- package/dist/client/assets/{connection-Brtus8mh.js → connection-DF20RpK_.js} +1 -1
- package/dist/client/assets/{connection-card-CSkWTxJN.js → connection-card-DeCnJCAi.js} +1 -1
- package/dist/client/assets/{connection-detail-Dz92Js40.js → connection-detail-Dn5XmXHk.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CQaJSXmJ.js → connection-form-helpers-B4MG2Fy2.js} +1 -1
- package/dist/client/assets/{connection-slug-DREkgXeA.js → connection-slug-tS8GnOSc.js} +1 -1
- package/dist/client/assets/{connections-BZUJ_roU.js → connections-DREB4U2P.js} +1 -1
- package/dist/client/assets/{content-tab-Bc_Tg1a4.js → content-tab-kF-GtTU9.js} +8 -8
- package/dist/client/assets/context-Gpy7m9cw.js +1 -0
- package/dist/client/assets/{context-menu-D-JkcRvL.js → context-menu-vUs3I8Wh.js} +1 -1
- package/dist/client/assets/{context-shell-Bwve3xDx.js → context-shell-vU2YMH1K.js} +3 -3
- package/dist/client/assets/{core.esm-ByTukYOF.js → core.esm-CWyzckxm.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BIe1f-Sz.js → create-organization-dialog-qsB5dfrW.js} +1 -1
- package/dist/client/assets/device-hint-DMMaEP-p.js +1 -0
- package/dist/client/assets/{discover-D050EtE3.js → discover-DN-I6i-O.js} +1 -1
- package/dist/client/assets/{domain-settings-DPbJEdjs.js → domain-settings-FZeIPnhT.js} +1 -1
- package/dist/client/assets/{drawer-Dijofbhl.js → drawer-CMTReHxa.js} +1 -1
- package/dist/client/assets/{editor-BODVgWYK.js → editor-C6CE2FNQ.js} +1 -1
- package/dist/client/assets/{editor-classes-BdpfcKyR.js → editor-classes-DbMPYB4Z.js} +1 -1
- package/dist/client/assets/{empty-state-Drt9QRbX.js → empty-state-DF9St1T6.js} +1 -1
- package/dist/client/assets/{empty-state-CwfRxt_B.js → empty-state-ovRL7NEK.js} +1 -1
- package/dist/client/assets/experiments-tab-choice-BXlwzycK.js +1 -0
- package/dist/client/assets/{extract-connection-data-Pe-Tip3g.js → extract-connection-data-Q1k0ncm3.js} +1 -1
- package/dist/client/assets/{feature-gate-2Z3FyCIy.js → feature-gate-DKF86Lcy.js} +1 -1
- package/dist/client/assets/{feature-paywall-CpM-erQe.js → feature-paywall-BoU9TII8.js} +1 -1
- package/dist/client/assets/{feedback-DcWPFhR_.js → feedback-f3MT17uD.js} +1 -1
- package/dist/client/assets/{file-explorer-xWdf34ip.js → file-explorer-DmvPCizi.js} +2 -2
- package/dist/client/assets/{file-preview-Ca_4k6rv.js → file-preview-aD0sVwV5.js} +1 -1
- package/dist/client/assets/{file-share-button-DgOCZ5mM.js → file-share-button-agT85qGG.js} +2 -2
- package/dist/client/assets/{file-type-icon-DiS0iV28.js → file-type-icon-CflTIvHJ.js} +1 -1
- package/dist/client/assets/{folder-icon-swAD3bQU.js → folder-icon-BKhbsJwX.js} +1 -1
- package/dist/client/assets/{form-CRja9i9j.js → form-B_3ZthF3.js} +1 -1
- package/dist/client/assets/{general-C7SfdAAF.js → general-BdjsCK2j.js} +1 -1
- package/dist/client/assets/{github-icon-tpEVyIwD.js → github-icon-M-2WiP3Y.js} +1 -1
- package/dist/client/assets/home-dTYjLEfm.js +1 -0
- package/dist/client/assets/{home-overview-CMI03yPH.js → home-overview-BAVfF6qS.js} +1 -1
- package/dist/client/assets/hosted-reconcile-B3o4dv7j.js +1 -0
- package/dist/client/assets/{icon-button-BZ9f2Pt9.js → icon-button-DQuPTgIB.js} +1 -1
- package/dist/client/assets/{index-Z8XjhDCo.js → index-0kopV6YP.js} +2 -2
- package/dist/client/assets/{index-68Cr2r1N.js → index-2bmOBUEF.js} +1 -1
- package/dist/client/assets/{index-LnWr599j.js → index-BM0DSfBG.js} +1 -1
- package/dist/client/assets/{index-Cvc22Qvh.js → index-BZX-7ipZ.js} +45 -45
- package/dist/client/assets/index-BlTJ0I-U.js +4 -0
- package/dist/client/assets/{index-C2wTYLQr.js → index-BvJNHE6H.js} +6 -6
- package/dist/client/assets/{index-CbuCRTrW.js → index-C2-s3ia2.js} +1 -1
- package/dist/client/assets/{index-CcZq_9Fb.js → index-C81DBcO6.js} +1 -1
- package/dist/client/assets/{index-BGom2FnM.js → index-Cjc_aSrk.js} +1 -1
- package/dist/client/assets/{index-Dw1u8oXT.js → index-D7Mi9FGh.js} +1 -1
- package/dist/client/assets/{index-Dt7ZIwRY.js → index-DHMhIfTt.js} +1 -1
- package/dist/client/assets/{index-D0G5dFqT.js → index-DT3lYd1R.js} +1 -1
- package/dist/client/assets/{index-CZXPJi4-.js → index-DzmcFP3y.js} +1 -1
- package/dist/client/assets/index-SmuiYnIl.css +1 -0
- package/dist/client/assets/{index-DQAtcq3Z.js → index-cmF_qGuq.js} +1 -1
- package/dist/client/assets/{index-BW7-bbk0.js → index-iezPx7cK.js} +1 -1
- package/dist/client/assets/index-mtR249ru.js +1 -0
- package/dist/client/assets/{index-redirect-PbFd_QHU.js → index-redirect-ay83YA5a.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CmujZk55.js → infiniteQueryObserver-CQGSlzKO.js} +1 -1
- package/dist/client/assets/{infra-billing-BlZrBUYP.js → infra-billing-DUjivW_p.js} +1 -1
- package/dist/client/assets/{input-D6ZRMHIB.js → input-3OyhKW_c.js} +1 -1
- package/dist/client/assets/input-CcFFY__7.js +17 -0
- package/dist/client/assets/{integration-icon-DMt85Vdd.js → integration-icon-Btk7lWbK.js} +1 -1
- package/dist/client/assets/{jira-icon-C0C7R9Uf.js → jira-icon-TeK8CaRV.js} +1 -1
- package/dist/client/assets/{label-RB5C5N6z.js → label-BGCn7A0y.js} +1 -1
- package/dist/client/assets/{layout-CBfnb3CZ.js → layout-XVKa9Y6f.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-zWqSTSjP.js → legacy-agents-deep-DksTbOzF.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BZlpoESe.js → legacy-main-redirect-8kA2UC85.js} +1 -1
- package/dist/client/assets/library-O1-Gs4qz.js +1 -0
- package/dist/client/assets/{library-tab-C7gKe5iN.js → library-tab-DJKD7rUC.js} +3 -3
- package/dist/client/assets/{login-D9zRzHBo.js → login-CH5yud2M.js} +1 -1
- package/dist/client/assets/{markdown-HhU9_nSI.js → markdown-B6eeRWQb.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DeLjk14w.js → mcp-app-renderer-DwuRGgZk.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DLwsgkOm.js → mcp-oauth-BvqIKSqR.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C-i6IZ7F.js → mcp-oauth-Bz1Lo9Pk.js} +1 -1
- package/dist/client/assets/{members-DocomT72.js → members-FYjquUkN.js} +1 -1
- package/dist/client/assets/{memory-BP3-K3oo.js → memory-CoUl94G3.js} +1 -1
- package/dist/client/assets/{mock-board-CoWf0eSd.js → mock-board-DvOE8ZQh.js} +4 -4
- package/dist/client/assets/{monaco-editor-oUmtqDLR.js → monaco-editor-vUgphdkE.js} +1 -1
- package/dist/client/assets/monitoring-UUQquQf7.js +2 -0
- package/dist/client/assets/{monitoring-stats-row-XSvwSWAi.js → monitoring-stats-row-BY92i-Bt.js} +1 -1
- package/dist/client/assets/{multi-select-CISJC82c.js → multi-select-9ieJQPsD.js} +1 -1
- package/dist/client/assets/mustache-CgF6ozKS.js +4 -0
- package/dist/client/assets/named-rule-view-CdhLqAy7.js +1 -0
- package/dist/client/assets/{new-project-dialog-BA0jmhgS.js → new-project-dialog-EK9WMEhp.js} +1 -1
- package/dist/client/assets/{oauth-callback-C1NevZMJ.js → oauth-callback-Cuv6PAYs.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BJwoy8qA.js → oauth-callback-ai-provider-BGc97raN.js} +1 -1
- package/dist/client/assets/{oauth-consent-BTT41r6l.js → oauth-consent-fGbsmdGY.js} +1 -1
- package/dist/client/assets/{onboarding-C2uIwwWY.js → onboarding-DF5AGUdi.js} +1 -1
- package/dist/client/assets/openai-conversation-CMIme_Ur.js +3 -0
- package/dist/client/assets/{optimistic-project-sidebar-views-BnUNFsLR.js → optimistic-project-sidebar-views-mQ0HUqGi.js} +1 -1
- package/dist/client/assets/{order-monitor-day-BzMajB7Y.js → order-monitor-day-BPx4Aihv.js} +1 -1
- package/dist/client/assets/{organization-choice-5ra3ZqkQ.js → organization-choice-KNGQur5O.js} +1 -1
- package/dist/client/assets/{orgs-ZeqGcjOU.js → orgs-C5Zlwg3I.js} +1 -1
- package/dist/client/assets/{own-accounts-section-Dd8ELrvu.js → own-accounts-section-C_F0-lzr.js} +1 -1
- package/dist/client/assets/{pair-Bx1LbJmC.js → pair-C5KKQk8r.js} +7 -7
- package/dist/client/assets/{parse-sections-BTDQNPKy.js → parse-sections-DE2O_vev.js} +7 -7
- package/dist/client/assets/{plan-bz8_rmrJ.js → plan-DdvgvWt2.js} +1 -1
- package/dist/client/assets/{plan-ladder-CZUMQESY.js → plan-ladder-BQ0gcfdF.js} +1 -1
- package/dist/client/assets/{plan-usage-card-SygAb3OS.js → plan-usage-card-8-3zMqsW.js} +2 -2
- package/dist/client/assets/{popover-D5YX99Kp.js → popover-CkuSZicN.js} +1 -1
- package/dist/client/assets/post-calendar-DVrcXuZq.js +1 -0
- package/dist/client/assets/{post-editor-BAf1z147.js → post-editor-CG6NXsGN.js} +2 -2
- package/dist/client/assets/{preview-content-TDEad-bh.js → preview-content-xRBU7B3O.js} +1 -1
- package/dist/client/assets/{preview-dialog-BkHpQdXG.js → preview-dialog-D36kXBk6.js} +1 -1
- package/dist/client/assets/{preview-panel-DduOnxXk.js → preview-panel-Cp7F1lqp.js} +1 -1
- package/dist/client/assets/preview-tab-Dn0RGnhj.js +551 -0
- package/dist/client/assets/{product-picker-dialog-DDkB9ByB.js → product-picker-dialog-C2KLekZA.js} +1 -1
- package/dist/client/assets/{profile-DHJVxDvo.js → profile-BfDfzRPA.js} +1 -1
- package/dist/client/assets/project-app-view-DVhAuH9N.js +1 -0
- package/dist/client/assets/project-apps-D47w7eJj.js +1 -0
- package/dist/client/assets/{project-icon-eZOGIGwj.js → project-icon-ofE-LDok.js} +1 -1
- package/dist/client/assets/{project-index-BSMjLbxc.js → project-index-PpuyCKHe.js} +1 -1
- package/dist/client/assets/project-reports-BuJS86vH.js +1 -0
- package/dist/client/assets/project-sidebar-views-Dew_3OKS.js +1 -0
- package/dist/client/assets/project-tasks-CZtVWSYo.js +1 -0
- package/dist/client/assets/{projects-D7HB1QKY.js → projects-Be7d593_.js} +1 -1
- package/dist/client/assets/{projects-empty-state-DBWek16Y.js → projects-empty-state-DpmH0sch.js} +1 -1
- package/dist/client/assets/{prompts-MMmII7eb.js → prompts-ClmMS_OK.js} +1 -1
- package/dist/client/assets/record-editor-OoLxSu9R.js +1 -0
- package/dist/client/assets/redirect-editor-W9B4A_h8.js +1 -0
- package/dist/client/assets/{reports-D0VzI1C_.js → reports-DCsJlho1.js} +1 -1
- package/dist/client/assets/{reports-onboarding-DonafHiF.js → reports-onboarding-CMTzWUTp.js} +1 -1
- package/dist/client/assets/reports-s2E9cwFc.js +1 -0
- package/dist/client/assets/{reports-tab-Wl9IyKm6.js → reports-tab-BKnG1JmX.js} +2 -2
- package/dist/client/assets/repositories-Dj2kaTIN.js +1 -0
- package/dist/client/assets/{repositories-9kTJbSW8.js → repositories-KlUH4dUR.js} +1 -1
- package/dist/client/assets/{repository-binding-B7A7NBUB.js → repository-binding-CqOunspI.js} +1 -1
- package/dist/client/assets/{repository-picker-CI7xSsin.js → repository-picker-DNdEQtlZ.js} +1 -1
- package/dist/client/assets/{require-capability-BTBUQsVM.js → require-capability-RYn3iksk.js} +1 -1
- package/dist/client/assets/{required-auth-layout-ClYF4eFR.js → required-auth-layout-Dfyc4Zas.js} +1 -1
- package/dist/client/assets/{reset-password-Ah3K7D-l.js → reset-password-CTGJ7V-t.js} +1 -1
- package/dist/client/assets/{resizable-DzzgKGKP.js → resizable-BCGqPRic.js} +1 -1
- package/dist/client/assets/resolve-tab-icon-BnqDq-fY.js +1 -0
- package/dist/client/assets/{review-settings-Fxdols3J.js → review-settings-DvoYyrmi.js} +1 -1
- package/dist/client/assets/{role-color-CEkb11P4.js → role-color-cUMHSMVi.js} +1 -1
- package/dist/client/assets/{roles-CqJ0hOtT.js → roles-x3B4vLKU.js} +1 -1
- package/dist/client/assets/route-PbputQp9.js +1 -0
- package/dist/client/assets/route-h-Fc_oVe.js +1 -0
- package/dist/client/assets/route-wINBwrny.js +1 -0
- package/dist/client/assets/sandbox-lifecycle-context-CXwLCWvJ.js +1 -0
- package/dist/client/assets/{schema-BH82js-o.js → schema-C1bLOk3P.js} +1 -1
- package/dist/client/assets/{schema-DHahXPsT.js → schema-DHLwjAWR.js} +1 -1
- package/dist/client/assets/{scroll-area-BN87AboJ.js → scroll-area-rELMi4e6.js} +1 -1
- package/dist/client/assets/{search-input-BBYghT-z.js → search-input-Crult1Qo.js} +1 -1
- package/dist/client/assets/{search-toggle-pLnMgrhP.js → search-toggle-DzMf9QP4.js} +1 -1
- package/dist/client/assets/{secret-picker-DWWFQJzg.js → secret-picker-CimF9dsx.js} +1 -1
- package/dist/client/assets/{secrets-CM4b3_qA.js → secrets-CZCnF6s4.js} +1 -1
- package/dist/client/assets/section-array-field-C3Tpx16b.js +1 -0
- package/dist/client/assets/{sections-CgO1w_IT.js → sections-346PcP2T.js} +1 -1
- package/dist/client/assets/sections-editor-DwV32_3f.js +1 -0
- package/dist/client/assets/{select-GzsOSPza.js → select-CwDmbwEv.js} +1 -1
- package/dist/client/assets/{select-model-BU2ssn1V.js → select-model-B1ocDBwF.js} +1 -1
- package/dist/client/assets/seo-editor-D1gGpMMF.js +1 -0
- package/dist/client/assets/{separator-CuwdHpjW.js → separator-C05SxAdn.js} +1 -1
- package/dist/client/assets/settings-tab-BImv5HgS.js +1 -0
- package/dist/client/assets/{sheet-BIQm-3An.js → sheet-BYgfxL9i.js} +1 -1
- package/dist/client/assets/{shell-layout-CH0j9rog.js → shell-layout-BvJfyzsq.js} +1 -1
- package/dist/client/assets/site-draft-actions-CgeV78uL.js +3 -0
- package/dist/client/assets/site-draft-view-Dkq2XweK.js +1 -0
- package/dist/client/assets/site-editor-B9ARkCiN.js +1 -0
- package/dist/client/assets/site-editor-toast-D83gMpdg.js +1 -0
- package/dist/client/assets/{skills-C71x-yhC.js → skills-OVV2oEwU.js} +1 -1
- package/dist/client/assets/{slider-BTgIuWj6.js → slider-Ipy9G5jv.js} +1 -1
- package/dist/client/assets/{sortable.esm-Dd1EVaQb.js → sortable.esm-DgwAq-fn.js} +1 -1
- package/dist/client/assets/{sso-BfwIPTh8.js → sso-C9cutlah.js} +1 -1
- package/dist/client/assets/{suggestion-CsEyXKDY.js → suggestion-Dwy6qysF.js} +1 -1
- package/dist/client/assets/{switch-BRZA_xq0.js → switch-BLkpF22m.js} +1 -1
- package/dist/client/assets/{synced-repos-Do7bESqI.js → synced-repos-orJHnVxs.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-BsVyyg_A.js → tab-icon-glyph-Co1M723I.js} +1 -1
- package/dist/client/assets/{table-DJd8n4EY.js → table-DPFxRA7S.js} +1 -1
- package/dist/client/assets/{tabs-D5AMuciq.js → tabs--wmPR0cZ.js} +1 -1
- package/dist/client/assets/{task-board-DN88kD7h.js → task-board-DJtwkz3O.js} +1 -1
- package/dist/client/assets/{task-route-4C0M-4XY.js → task-route-vCMrJPp9.js} +1 -1
- package/dist/client/assets/{task-status-B2JNuBbQ.js → task-status-msgu5x2s.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-D_AXxVNg.js → taskboard-analytics-5nxg7YXN.js} +1 -1
- package/dist/client/assets/{tasks-dMEgvkta.js → tasks-DpWVcTLT.js} +1 -1
- package/dist/client/assets/tasks-hbXv3hSd.js +1 -0
- package/dist/client/assets/{textarea-D7HQlMVo.js → textarea-D5OF_Tld.js} +1 -1
- package/dist/client/assets/{thread-analytics-BQjHh_yV.js → thread-analytics-CVsji2MZ.js} +1 -1
- package/dist/client/assets/{thread-intent-Bs-Q7fma.js → thread-intent-DIce2mks.js} +2 -2
- package/dist/client/assets/{thread-route-C-uX4C4C.js → thread-route-CGqDFJ1K.js} +1 -1
- package/dist/client/assets/{thread-route-B44higRI.js → thread-route-CP2TR6nw.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BNo76_XD.js → thread-sheet-body-Cba15kJF.js} +1 -1
- package/dist/client/assets/{time-range-picker-D4sglVBw.js → time-range-picker-OdWLHy9U.js} +1 -1
- package/dist/client/assets/{toggle-group-BBgjmF6C.js → toggle-group-DbLOGwe7.js} +1 -1
- package/dist/client/assets/{tool-namespace-l4eN7YZ5.js → tool-namespace-BQhkJpu9.js} +1 -1
- package/dist/client/assets/{tool-set-selector-Bi-Sw2KD.js → tool-set-selector-BmAnaEsw.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-nrUHQe-I.js → toolbar-icon-button-BzIcnxXk.js} +1 -1
- package/dist/client/assets/{tooltip-C0GWPsi8.js → tooltip--uPFG1gb.js} +1 -1
- package/dist/client/assets/{tooltipContext-DdEokZtY.js → tooltipContext-C8ArdkXW.js} +1 -1
- package/dist/client/assets/{track-29FVOdFL.js → track-Bb4064-s.js} +1 -1
- package/dist/client/assets/{types-DKuFfsqr.js → types-EjHtXl5u.js} +1 -1
- package/dist/client/assets/{url-slug-5t39ocbn.js → url-slug-rCJqhuIp.js} +1 -1
- package/dist/client/assets/{usage-stats-CHeI7dPd.js → usage-stats-DaOtdhEm.js} +2 -2
- package/dist/client/assets/{use-ai-providers-BbVlPdZd.js → use-ai-providers-C5rCFpU_.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-CnOcORn0.js → use-apply-named-rule-zZmpVvRd.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-BaG9i0zc.js +1 -0
- package/dist/client/assets/{use-automations-BoyfX_H0.js → use-automations-CI7vvUzE.js} +1 -1
- package/dist/client/assets/{use-autosave-CZD-Fkyk.js → use-autosave-DUBcsRSH.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-CXrKL60y.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-BC5WrKKn.js → use-chat-layout-state-CZaSk8YF.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-BbDVRUuf.js → use-cms-publish-actions-BV2nwL3g.js} +5 -5
- package/dist/client/assets/{use-connect-companion-DEAJWvqA.js → use-connect-companion-DC6UOpxV.js} +1 -1
- package/dist/client/assets/{use-connection-Dqyf1wn8.js → use-connection-BEb786wf.js} +1 -1
- package/dist/client/assets/{use-content-sync-vr73v2b2.js → use-content-sync-CtHfpBJp.js} +1 -1
- package/dist/client/assets/{use-copy-BGfQrJIh.js → use-copy-DccRTYvG.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-C4jbLuwI.js → use-date-fns-locale-DD1YxYKP.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BrjHHNNB.js → use-debounced-autosave-clO2CzWE.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BF84eZeF.js → use-debounced-value-CJpdUTvG.js} +1 -1
- package/dist/client/assets/{use-deco-credits-MCc3vHir.js → use-deco-credits-DtE2LNZs.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-uSeDcfUe.js → use-decopilot-events-DxBT3zOC.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CLe-XFxn.js → use-delete-connection-COvFjvtJ.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-ShnoFTNr.js → use-deployment-admin-BSEuekHe.js} +1 -1
- package/dist/client/assets/{use-entitlements-wE65MYfi.js → use-entitlements-CWXMyUT0.js} +1 -1
- package/dist/client/assets/use-fast-preview-draft-url-BCmBxVQg.js +1 -0
- package/dist/client/assets/{use-file-configs-D9BR1kJU.js → use-file-configs-DsyBYIJw.js} +1 -1
- package/dist/client/assets/{use-id-selection-BcfcmGZl.js → use-id-selection-6CmUdc1s.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-EYADn16y.js → use-inbox-feed-okLCp4Pp.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Ds1Wd1cw.js → use-infinite-scroll-4e7tB3Vz.js} +1 -1
- package/dist/client/assets/{use-join-requests-CkWiAH0i.js → use-join-requests-muPMmn0O.js} +1 -1
- package/dist/client/assets/use-main-panel-tabs-BcP_qZl8.js +1 -0
- package/dist/client/assets/use-mcp-auth-status-D_TqnxnH.js +1 -0
- package/dist/client/assets/{use-mcp-client-BfCmeMHR.js → use-mcp-client-CrdyqnFt.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DoojBZhS.js → use-mcp-prompts-C3SHzM_d.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DwTtnjNb.js → use-mcp-tools-DQIJMlw-.js} +1 -1
- package/dist/client/assets/{use-mobile-C1stVK0E.js → use-mobile-BDWitdax.js} +1 -1
- package/dist/client/assets/use-move-blocks-B48xFUbp.js +1 -0
- package/dist/client/assets/{use-navigate-to-agent-D2d0cpFU.js → use-navigate-to-agent-C3sX18jI.js} +1 -1
- package/dist/client/assets/{use-org-fs-DHnEDbF9.js → use-org-fs-BRERSVus.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CcoLGdUP.js → use-org-repo-syncs-BFFdo3jR.js} +1 -1
- package/dist/client/assets/{use-org-sso-d82WgyRM.js → use-org-sso-BHDTii7j.js} +1 -1
- package/dist/client/assets/{use-organization-settings-a6mUKPHv.js → use-organization-settings-DPCrcu8e.js} +1 -1
- package/dist/client/assets/{use-project-scope-C0EKXyqg.js → use-project-scope-k7OaKjIm.js} +1 -1
- package/dist/client/assets/{use-recent-apps-DEMyNf2W.js → use-recent-apps-Buo9cWvj.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-rjeHGSYu.js → use-reports-diagnostic-B1lbI319.js} +1 -1
- package/dist/client/assets/use-sandbox-events-BRJYKM54.js +2 -0
- package/dist/client/assets/{use-secrets-CifnNbah.js → use-secrets-DlNiP0j4.js} +1 -1
- package/dist/client/assets/use-section-preview-base-CL9U3MEc.js +1 -0
- package/dist/client/assets/use-sidebar-collapsed-ByMTBVZc.js +1 -0
- package/dist/client/assets/{use-tags-CgXVAtG9.js → use-tags-CcJayzHf.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BTZNDNnK.js → use-task-board-analytics-0-6_3j_2.js} +1 -1
- package/dist/client/assets/{use-task-board-events-DCguN7A5.js → use-task-board-events-CzDIUBok.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-CnqmEndd.js → use-task-board-item-prs-DbHC-4Ry.js} +1 -1
- package/dist/client/assets/{use-task-board-items-BmpaMZkF.js → use-task-board-items-COxHF7_K.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-DdSO4gLi.js → use-task-board-prompts-CKi9j8wF.js} +1 -1
- package/dist/client/assets/{use-task-metadata-D3xqf4sH.js → use-task-metadata-BxcNhivS.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-D6sQTVJo.js → use-thread-outputs-lMVF4bT2.js} +1 -1
- package/dist/client/assets/use-voice-input-DsJxHyTh.js +1 -0
- package/dist/client/assets/useInfiniteQuery-B313haH3.js +1 -0
- package/dist/client/assets/{useQueries-BuMODvFG.js → useQueries-BO8pZ9q-.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-07GrICuv.js +1 -0
- package/dist/client/assets/{users-Ct3PwBMT.js → users-DCPPe9Uo.js} +1 -1
- package/dist/client/assets/{utils-DA49HMaO.js → utils-D0xixM8q.js} +3 -3
- package/dist/client/assets/{variant-calendar-CPtUMCAS.js → variant-calendar-C5r0ak32.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-DnlLYEoa.js → variant-matcher-override-QQd3tA7f.js} +1 -1
- package/dist/client/assets/{view-header-CAO18iqy.js → view-header-BPAnt0vh.js} +1 -1
- package/dist/client/assets/{virtual-mcp-C4mAz3N8.js → virtual-mcp-Dzr3mFmO.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-BI4P-Lkx.js → watch-sse-pool-j0K-nQ0i.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server.js +464 -464
- package/package.json +1 -1
- package/dist/client/assets/ReferenceLine-DEAQfOjW.js +0 -1
- package/dist/client/assets/agent-app-ZW_Vm-c7.js +0 -1
- package/dist/client/assets/agent-assets-kQe7VufN.js +0 -1
- package/dist/client/assets/agent-calendar-CbAiDaBT.js +0 -1
- package/dist/client/assets/agent-capabilities-DKq2l6j_.js +0 -1
- package/dist/client/assets/agent-deck-8VVMhl7J.js +0 -1
- package/dist/client/assets/agent-e2e-C9FJgu1a.js +0 -1
- package/dist/client/assets/agent-file-D5ZobkO7.js +0 -1
- package/dist/client/assets/agent-hosting-Df5G-pNf.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-releases-6IDVzk1I.js +0 -2
- 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/app-editor-DQrUb2qq.js +0 -1
- package/dist/client/assets/blocks-tab-states-CNkB95lx.js +0 -1
- package/dist/client/assets/category-editor-DDFXYf_d.js +0 -1
- package/dist/client/assets/cms-settings-editor-CL1HXF3j.js +0 -1
- package/dist/client/assets/cms-store-drafts-C_ZG08jQ.js +0 -1
- package/dist/client/assets/context-2NK4t-Lg.js +0 -1
- package/dist/client/assets/device-hint-Djy4F7LR.js +0 -1
- package/dist/client/assets/home-DsrjQvGT.js +0 -1
- package/dist/client/assets/hosted-reconcile-BnVn2LVL.js +0 -1
- package/dist/client/assets/index-B8Pa92mK.js +0 -4
- package/dist/client/assets/index-D-DRzVEB.js +0 -2
- package/dist/client/assets/index-ug7KC70Z.css +0 -1
- package/dist/client/assets/input-C7_FCkgY.js +0 -17
- package/dist/client/assets/library-pMQg4GCR.js +0 -1
- package/dist/client/assets/monitoring-DKfNSCeR.js +0 -2
- package/dist/client/assets/mustache-D4zVU9iA.js +0 -4
- package/dist/client/assets/named-rule-view-BTwHmZ5L.js +0 -1
- package/dist/client/assets/openai-conversation-pUSF1vof.js +0 -3
- package/dist/client/assets/post-calendar-BIBU13NF.js +0 -1
- package/dist/client/assets/preview-tab-Cgfndmyh.js +0 -551
- package/dist/client/assets/project-app-view-BfcPf6du.js +0 -1
- package/dist/client/assets/project-apps-Bny6_T2A.js +0 -1
- package/dist/client/assets/project-reports-BzA8d8hO.js +0 -1
- package/dist/client/assets/project-sidebar-views-CrRbPbLq.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/redirect-editor-cm3-huyu.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/resolve-tab-icon-DMbVCUvi.js +0 -1
- package/dist/client/assets/route-BA7jjOjA.js +0 -1
- package/dist/client/assets/route-DGCMYgfH.js +0 -1
- package/dist/client/assets/route-DJbiUXJl.js +0 -1
- package/dist/client/assets/sandbox-lifecycle-context-WaQV2LhH.js +0 -1
- package/dist/client/assets/sections-editor-Uk83RbMN.js +0 -1
- package/dist/client/assets/seo-editor-dMXY0ofk.js +0 -1
- package/dist/client/assets/settings-tab-FvtSSyQC.js +0 -1
- package/dist/client/assets/site-draft-view-C74WkBDm.js +0 -3
- package/dist/client/assets/site-editor-CazX9Ijc.js +0 -1
- package/dist/client/assets/site-editor-toast-DrW9VMK5.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/use-fast-preview-draft-url-BmUgrEyk.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-DTMcBtUc.js +0 -1
- package/dist/client/assets/use-mcp-auth-status-DhFx8XVQ.js +0 -1
- package/dist/client/assets/use-move-blocks-Bclcq-Qe.js +0 -1
- package/dist/client/assets/use-section-preview-base-SkN8HQaB.js +0 -1
- package/dist/client/assets/use-sidebar-collapsed-DwcGl0-e.js +0 -1
- package/dist/client/assets/useInfiniteQuery-P9--kf7E.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-C2ZhOGvp.js +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{c as B,b as be,r as q,j as a,B as ve,m as K,K as ss,al as ka,t as et,fa as Na,as as or,ed as cr,Y as Xt,c6 as Ca,aH as ks,aI as Ns,aJ as Cs,aK as As,bj as Rs,aL as Ts,aM as Ds,aN as Bs,X as _s,Z as Ms,_ as Es,a as zs,a5 as hs,ct as Aa,h as Zt,fb as dr,fc as cn,bJ as Ra,b8 as Ta,bh as _n,fd as Da,c0 as Ba,am as Ia,I as $a,a8 as Fa,fe as La,V as ur,i as ft,eR as dn,q as hr,J as fr,D as mr,x as pr,v as br,Q as gr,R as xr,ff as Oa,bk as vr,a6 as un,b3 as hn,e as Mn,E as _a,T as Ma}from"./index-BZX-7ipZ.js";import{S as Ea}from"./separator-C05SxAdn.js";import{f as za,u as ns,r as yr,l as jr,c as wr,b as Ua}from"./chat-context-CCj5lauv.js";import{u as Bt,aq as qa,ar as Pr,as as Sr,c as fn,b as mn,L as pn,at as Ha,K as Ka,au as Va,ae as Ga,av as Wa,S as bn,R as kr,aw as Qa,a0 as Nr,F as Ja,ax as Ya,ay as Xa,B as Cr}from"./site-editor-toast-D83gMpdg.js";import{b as Za,L as el,a as tl}from"./shell-layout-BvJfyzsq.js";import{I as Ar}from"./toolbar-icon-button-BzIcnxXk.js";import{b as sl,P as nl,a as rl}from"./popover-CkuSZicN.js";import{c as tt,T as st,a as nt,b as Us}from"./tooltip--uPFG1gb.js";import{f as al,a as ll,c as il,C as En,e as zn,b as Un}from"./command-DiccrIM8.js";import{T as Tt,a as Rr,c as Tr}from"./tabs--wmPR0cZ.js";import{t as Dr}from"./ChevronUp-aYmfXYet.js";import{Y as Br,aG as qs,E as ol,a as Ir,aH as cl,b as dl,aI as $r,L as ul}from"./agent-icon-U2nlXoBG.js";import{a as Fr}from"./SwitchHorizontal01-Czrqzt6f.js";import{c as Lr,s as Is}from"./Tool01-D38zOT0h.js";import{s as Or}from"./Plus-CzoopYlU.js";import{s as Hs}from"./Trash01-BxSWir9J.js";import{l as hl,d as fl}from"./thread-intent-DIce2mks.js";import{h as _r,r as Mr,g as ml,e as _e,u as Ks,f as Er}from"./repository-binding-CqOunspI.js";import{u as pl}from"./use-debounced-value-CJpdUTvG.js";import{u as bl}from"./useInfiniteQuery-B313haH3.js";import{d as gl,b as xl,p as vl,e as zr,g as Ur,h as qr}from"./use-navigate-to-agent-C3sX18jI.js";import{u as Vs,g as gn,n as ds,b as Hr,a as yl,d as jl,e as wl,r as cs,f as Pl,s as Sl,h as xs,c as xn}from"./cms-store-drafts-BumH78UY.js";import{a as $s}from"./virtual-mcp-Dzr3mFmO.js";import{u as fs}from"./use-voice-input-DsJxHyTh.js";import{u as vn}from"./use-blocks-v8-project-CXrKL60y.js";import{G as Kr}from"./github-icon-M-2WiP3Y.js";import{u as kl,a as Nl}from"./use-fast-preview-draft-url-BCmBxVQg.js";import{a6 as Jt,a7 as Vr,D as Fs,o as yn,a8 as Cl,a9 as Al,G as Rl,aa as Tl,ab as Dl,p as Bl,y as Pt,f as jn,ac as Il}from"./blocks-tab-states-oXZbJa9b.js";import"./index-mtR249ru.js";import{T as $l}from"./textarea-D5OF_Tld.js";import{i as wn}from"./CheckCircle-BzNTGMCW.js";import{n as Fl,s as Ll,C as Ol,a as _l,b as Ml,M as El,c as zl,d as Ul,m as ql,u as Hl}from"./use-cms-publish-actions-BV2nwL3g.js";import{a as Kl,g as Vl}from"./UserSquare-CEg-eLCw.js";import{i as Pn,b as Sn,m as Gl,h as Wl,c as Gr,f as Wr,d as Ql,r as kn,e as Jl,n as Yl,g as Xl,j as Zl,k as ei,l as Nn,o as ti,p as Qr,q as si,s as Cn,t as Ys}from"./sandbox-git-api-DcqI6XE4.js";import{b as ni,g as ri}from"./utils-D0xixM8q.js";import{i as ai}from"./Monitor01-As0zpJLy.js";import{w as An,R as Jr}from"./device-hint-DMMaEP-p.js";import{w as qn}from"./editor-C6CE2FNQ.js";import{x as li,C as ii}from"./section-array-field-C3Tpx16b.js";import{s as Yr}from"./save-changes-debug-nBi-n9eV.js";import{u as oi}from"./use-mcp-client-CrdyqnFt.js";import{u as ci}from"./use-sandbox-events-BRJYKM54.js";import{b as di,a as ui}from"./sandbox-lifecycle-context-CXwLCWvJ.js";import{b as hi}from"./agent-capabilities-CaXbVMop.js";import{b as fi}from"./thread-route-CP2TR6nw.js";function mi(t){const{value:e,baseBranch:s,releases:r,baseIsDraft:n=!1,storeDrafts:o=[]}=t,d=!n&&!!e&&e===s,l=r.find(c=>c.branch===e),i=d||l?void 0:o.find(c=>c.name===e),u=!d&&!l&&!i&&!!e;return i?{isBase:d,current:l,storeDraft:i,unlisted:u}:{isBase:d,current:l,unlisted:u}}const pi={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "},Hn=1114111;function Kn(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>Hn?e:String.fromCodePoint(r)}if(s.startsWith("#")){const r=Number.parseInt(s.slice(1),10);return!Number.isFinite(r)||r>Hn?e:String.fromCodePoint(r)}return pi[s]??e}):""}function bi(t){const e=B.c(39),{url:s,onSave:r}=t,n=be(),[o,d]=q.useState(s??"");let l;e[0]!==o?(l=o.trim(),e[0]=o,e[1]=l):l=e[1];const i=l;let u;e[2]!==r||e[3]!==i?(u=()=>r(i?hl(i):null),e[2]=r,e[3]=i,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 p;e[7]!==h?(p=a.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[7]=h,e[8]=p):p=e[8];let b;e[9]!==n?(b=n("thread.branchPicker.localUrlLabel"),e[9]=n,e[10]=b):b=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 g;e[14]!==c||e[15]!==i?(g=N=>{N.key==="Enter"&&i&&c()},e[14]=c,e[15]=i,e[16]=g):g=e[16];let x;e[17]!==b||e[18]!==f||e[19]!==g||e[20]!==o?(x=a.jsx("input",{type:"url",inputMode:"url","aria-label":b,placeholder:f,value:o,onChange:m,onKeyDown:g,className:"h-8 w-full rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[17]=b,e[18]=f,e[19]=g,e[20]=o,e[21]=x):x=e[21];let P;e[22]!==r||e[23]!==n||e[24]!==s?(P=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]=P):P=e[25];const j=!i;let y;e[26]!==n?(y=n("thread.branchPicker.save"),e[26]=n,e[27]=y):y=e[27];let S;e[28]!==c||e[29]!==j||e[30]!==y?(S=a.jsx(ve,{size:"sm",disabled:j,onClick:c,children:y}),e[28]=c,e[29]=j,e[30]=y,e[31]=S):S=e[31];let w;e[32]!==P||e[33]!==S?(w=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[P,S]}),e[32]=P,e[33]=S,e[34]=w):w=e[34];let k;return e[35]!==w||e[36]!==p||e[37]!==x?(k=a.jsxs("div",{className:"flex flex-col gap-2 p-2",children:[p,x,w]}),e[35]=w,e[36]=p,e[37]=x,e[38]=k):k=e[38],k}function gi(t){const e=B.c(8),{virtualMcpId:s,branch:r,serve:n,rowRef:o,onPicked:d}=t,l=Bt(s,r),i=!!n.connection,u=i&&l.kind==="protocol"&&l.source==="local";let c;e[0]!==d||e[1]!==n?(c=()=>xi(n,d),e[0]=d,e[1]=n,e[2]=c):c=e[2];let h;return e[3]!==o||e[4]!==i||e[5]!==u||e[6]!==c?(h=a.jsx(vi,{rowRef:o,selected:i,connected:u,onSelect:c}),e[3]=o,e[4]=i,e[5]=u,e[6]=c,e[7]=h):h=e[7],h}function xi(t,e){e?.(),!t.connection&&t.set({endpoint:t.lastEndpoint??qa})}function vi(t){const e=B.c(19),{rowRef:s,selected:r,connected:n,onSelect:o}=t,d=be(),l=r?"bg-accent":"hover:bg-accent";let i;e[0]!==l?(i=K("flex rounded-lg",l),e[0]=l,e[1]=i):i=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 p;e[7]!==n||e[8]!==d?(p=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]=p):p=e[9];let b;e[10]!==o||e[11]!==r||e[12]!==h||e[13]!==p?(b=a.jsxs("button",{type:"button","aria-pressed":r,onClick:o,className:"flex w-full min-w-0 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[u,h,p]}),e[10]=o,e[11]=r,e[12]=h,e[13]=p,e[14]=b):b=e[14];let f;return e[15]!==s||e[16]!==i||e[17]!==b?(f=a.jsx("div",{ref:s,className:i,children:b}),e[15]=s,e[16]=i,e[17]=b,e[18]=f):f=e[18],f}const yi=10080*60*1e3;function ji({sandboxMap:t,userId:e,rawBranches:s,now:r}){const n=new Map;for(const[h,p]of Object.entries(t??{}))for(const[b,f]of Object.entries(p??{})){let m=n.get(b);m||(m={userIds:new Set,lastActiveAt:0},n.set(b,m)),m.userIds.add(h);for(const g of Object.values(f??{})){const x=g?.createdAt??0;x>m.lastActiveAt&&(m.lastActiveAt=x)}}const o=r-yi,d=[...n.entries()].filter(([,h])=>h.lastActiveAt>=o).sort((h,p)=>p[1].lastActiveAt-h[1].lastActiveAt).map(([h,p])=>({name:h,source:"recent",contributors:[...p.userIds],lastActiveAt:p.lastActiveAt})),l=new Set(d.map(h=>h.name)),i=new Set(Object.keys(t?.[e]??{})),u=[...i].filter(h=>!l.has(h)).sort().map(h=>({name:h,source:"yours"})),c=s.filter(h=>!i.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 wi=100,Pi=50,Si=300;function nn(t,e){const s=e.trim().toLowerCase();return s?t.toLowerCase().includes(s):!0}function ki(t){const e=B.c(39),{orgId:s,orgSlug:r,userId:n,target:o,sandboxMap:d,owner:l,repo:i,search:u,enabled:c}=t,h=u===void 0?"":u,p=c===void 0?!0:c;let b;e[0]!==h?(b=h.trim(),e[0]=h,e[1]=b):b=e[1];const f=b,m=pl(f,Si);let g;e[2]!==o?(g=_r(o),e[2]=o,e[3]=g):g=e[3];const x=g,P=f.length>0;let j;e[4]!==m||e[5]!==s||e[6]!==r||e[7]!==l||e[8]!==i||e[9]!==o?(j=ss.githubBranchSearch(s,r,Mr(o),l,i,m),e[4]=m,e[5]=s,e[6]=r,e[7]=l,e[8]=i,e[9]=o,e[10]=j):j=e[10];const y=p&&x;let S;e[11]!==m||e[12]!==r||e[13]!==o?(S=D=>{const{pageParam:Z}=D;return ka(r,"REPOSITORY_SEARCH_BRANCHES",{...o,query:m,limit:m?Pi:wi,cursor:Z})},e[11]=m,e[12]=r,e[13]=o,e[14]=S):S=e[14];let w;e[15]!==m?(w=D=>m?void 0:D.nextCursor??void 0,e[15]=m,e[16]=w):w=e[16];let k;e[17]!==j||e[18]!==y||e[19]!==S||e[20]!==w?(k={queryKey:j,enabled:y,staleTime:3e4,retry:!1,initialPageParam:null,queryFn:S,getNextPageParam:w},e[17]=j,e[18]=y,e[19]=S,e[20]=w,e[21]=k):k=e[21];const{data:N,isLoading:C,isError:v,isFetching:A,hasNextPage:T,isFetchingNextPage:I,fetchNextPage:_}=bl(k),$=P&&(m!==f||A),H=(N?.pages??[]).flatMap(Ni),O=Za(6e4),G=ji({sandboxMap:d,userId:n,rawBranches:H,now:O});let E;e[22]!==f?(E=D=>nn(D.name,f),e[22]=f,e[23]=E):E=e[23];const W=G.recent.filter(E);let F;e[24]!==f?(F=D=>nn(D.name,f),e[24]=f,e[25]=F):F=e[25];const V=G.yours.filter(F),te=G.others,Y=N?.pages[0],ne=P&&Y&&!$?Math.max(0,Y.totalCount-Y.branches.length):0,le=!P&&T;let M;e[26]!==_?(M=()=>{_()},e[26]=_,e[27]=M):M=e[27];let X;return e[28]!==ne||e[29]!==v||e[30]!==I||e[31]!==C||e[32]!==$||e[33]!==te||e[34]!==W||e[35]!==le||e[36]!==M||e[37]!==V?(X={recent:W,yours:V,others:te,isLoading:C,isError:v,isSearching:$,hiddenMatchCount:ne,hasMore:le,isFetchingMore:I,fetchMore:M},e[28]=ne,e[29]=v,e[30]=I,e[31]=C,e[32]=$,e[33]=te,e[34]=W,e[35]=le,e[36]=M,e[37]=V,e[38]=X):X=e[38],X}function Ni(t){return t.branches}function Ci(t){const e=B.c(6),s=be(),{releases:r,createRelease:n}=Vs(t.virtualMcpId);let o;return e[0]!==n||e[1]!==t.userId||e[2]!==t.userLabel||e[3]!==r||e[4]!==s?(o=()=>{if(r.length>=$s)return et.error(s("thread.branchPicker.capReached",{max:$s})),null;const d=gn(t.userLabel);return n({branch:d,name:Hr(r,s("thread.branchPicker.defaultVersionName")),color:ds(r.length),createdBy:t.userId,createdAt:new Date().toISOString()}).catch(l=>{et.error(s("thread.branchPicker.saveError"),{description:Pr(s,Sr(l))})}),d},e[0]=n,e[1]=t.userId,e[2]=t.userLabel,e[3]=r,e[4]=s,e[5]=o):o=e[5],o}const Ls="-mx-[3px] h-3.5 w-3.5 shrink-0";function Ai(t){const e=B.c(110),{virtualMcpId:s,isV8:r,userLabel:n,value:o,baseBranch:d,baseIsDraft:l,orgId:i,orgSlug:u,userId:c,target:h,owner:p,repo:b,sandboxMap:f,onChange:m,onCreateBranch:g,onAdoptBranch:x,disabled:P,spawnsNewChat:j,placement:y}=t,S=r===void 0?!1:r,w=l===void 0?!1:l,k=P===void 0?!1:P,N=j===void 0?!1:j,C=y===void 0?"chat":y,v=be(),A=C==="header",[T,I]=q.useState(!1),[_,$]=q.useState(!1),[H,O]=q.useState("branches"),[G,E]=q.useState(null),[W,F]=q.useState(""),[V,te]=q.useState(null),[Y,ne]=q.useState(null),le=q.useRef(null),{releases:M,createRelease:X,renameRelease:D,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=Ci(se),ge=yl(s,S),ue=S?jl(M,ge.data):[],re=ge.refetch,fe=wl(s),{url:ye,setUrl:z,clear:oe}=fn(s),xe=mn(s),Q=S&&!!xe.connection,ee=S?xe.connection?.endpoint??null:ye,ce=!!ee;let J;e[4]!==oe||e[5]!==S||e[6]!==xe?(J=()=>{oe(),S&&xe.clear()},e[4]=oe,e[5]=S,e[6]=xe,e[7]=J):J=e[7];const de=J;let Me;e[8]!==T?(Me={enabled:T},e[8]=T,e[9]=Me):Me=e[9];const{data:mt}=Na(Me);let we;e[10]!==mt?.data?.members?(we=R=>R?mt?.data?.members?.find(pe=>pe.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>=$s,Re=M.length>1,Te=v("thread.branchPicker.capReached",{max:$s}),{isBase:Ee,current:Ne,storeDraft:at,unlisted:ze}=mi({value:o,baseBranch:d,releases:M,baseIsDraft:w,storeDrafts:ue}),$t=Ee?v("thread.branchPicker.live"):Ne?.name??at?.name??v("thread.branchPicker.defaultVersionName"),Oe=Q?v("thread.branchPicker.localhost.label"):ce?v("thread.branchPicker.localLabel"):o?$t:v("thread.branchPicker.selectVersion"),Qe=Q?"bg-foreground":ce?"bg-special":Ee?"bg-success":at?cs(void 0):cs(Ne?.color??"orange"),L=!Q&&!ce&&!Ee&&Ne?.runtime==="sandbox",me=R=>{de();const pe=ue.some(Ve=>Ve.name===R)?{runtime:"cms"}:M.find(Ve=>Ve.branch===R);m(R,pe&&{runtime:pe.runtime}),I(!1)};let Pe;e[12]!==v?(Pe=R=>{et.error(v("thread.branchPicker.saveError"),{description:Pr(v,Sr(R))})},e[12]=v,e[13]=Pe):Pe=e[13];const Se=Pe;let De;e[14]!==z?(De=R=>{z(R),$(!1),I(!1)},e[14]=z,e[15]=De):De=e[15];const pt=De,bt=(R,pe)=>{if(de(),x){x(R),$(!1),I(!1);return}if(!M.some(Ve=>Ve.branch===R)){if(Le){et.error(Te);return}X({branch:R,name:pe.trim()||R,color:ds(M.length),createdBy:c,createdAt:new Date().toISOString()}).catch(Se)}m(R),$(!1),I(!1)};let lt;e[16]!==de||e[17]!==m||e[18]!==g||e[19]!==ie?(lt=()=>{const R=ie();R&&(de(),(g??m)(R),I(!1))},e[16]=de,e[17]=m,e[18]=g,e[19]=ie,e[20]=lt):lt=e[20];const rs=lt;let gt;e[21]===Symbol.for("react.memo_cache_sentinel")?(gt=()=>{E(null),F(""),$(!1),O("branches")},e[21]=gt):gt=e[21];const as=gt;let it;e[22]===Symbol.for("react.memo_cache_sentinel")?(it=R=>{O(R),$(!0)},e[22]=it):it=e[22];const Ce=it;let ot;e[23]===Symbol.for("react.memo_cache_sentinel")?(ot=R=>{E(R.branch),F(R.name)},e[23]=ot):ot=e[23];const Ft=ot;let xt;e[24]!==W||e[25]!==D||e[26]!==Se?(xt=R=>{const pe=W.trim();pe&&D(R,pe).catch(Se),E(null),F("")},e[24]=W,e[25]=D,e[26]=Se,e[27]=xt):xt=e[27];const Qs=xt,Lt=R=>{const pe=R===void 0?o:R,Ve=W.trim();if(Ve&&pe){if(Le){et.error(Te),E(null),F("");return}X({branch:pe,name:Ve,color:ds(M.length),createdBy:c,createdAt:new Date().toISOString()}).catch(Se)}E(null),F("")};let Je;e[28]===Symbol.for("react.memo_cache_sentinel")?(Je=()=>{E(null),F("")},e[28]=Je):Je=e[28];const ct=Je,kt=()=>{const R=V;if(te(null),!(!R||!Re)){if(R.branch===o){const pe=M.filter(Sa=>Sa.branch!==R.branch),Ve=pe.find(Ri)??pe[0];Ve?me(Ve.branch):I(!1)}else I(!1);Z(R.branch).catch(Se)}},dt=Pl(M),ls=(dt.content.length>0||ue.length>0)&&dt.code.length>0,vt=R=>G===R.branch?a.jsx(Xs,{value:W,onChange:F,onSave:()=>Qs(R.branch),onCancel:ct},R.branch):a.jsx(Zs,{rowRef:!ce&&R.branch===o?le:void 0,dot:cs(R.color),codeIcon:R.runtime==="sandbox"?xs(R.color):void 0,label:R.name,creator:rt(R.createdBy),originTooltip:S?v("thread.branchPicker.viaStudioUi"):void 0,branch:!S||R.runtime==="sandbox"?R.branch:void 0,selected:!ce&&R.branch===o,onSelect:()=>me(R.branch),onRename:()=>Ft(R),onDelete:()=>te(R),deleteBlocked:!Re},R.branch),Nt=()=>{const R=Y;if(ne(null),!(!R||R.name===o&&M.length===0)){if(R.name===o){const pe=M[0];pe?me(pe.branch):I(!1)}fe.mutateAsync(R.name).catch(pe=>{et.error(v("thread.branchPicker.discardStoreDraftError"),{description:pe instanceof Error?pe.message:void 0})})}},Ct=ue.map((R,pe)=>G===R.name?a.jsx(Xs,{value:W,onChange:F,onSave:()=>Lt(R.name),onCancel:ct},`store:${R.name}`):a.jsx(Zs,{rowRef:!ce&&R.name===o?le:void 0,dot:cs(void 0),label:R.name,creator:rt(R.createdBy),agentIcon:xs(ds(pe)),originTooltip:v("thread.branchPicker.storeDraftVia",{via:Sl(R.via)}),selected:!ce&&R.name===o,onSelect:()=>me(R.name),onRename:()=>{E(R.name),F(R.name)},onDelete:()=>ne(R),deleteBlocked:R.name===o&&M.length===0},`store:${R.name}`));let yt;e[29]!==k||e[30]!==S||e[31]!==re?(yt=k?void 0:R=>{R?S&&re():as(),I(R)},e[29]=k,e[30]=S,e[31]=re,e[32]=yt):yt=e[32];const At=A?"text-xs":"text-xs text-muted-foreground hover:text-foreground";let Ye;e[33]!==At?(Ye=K("shrink min-w-0 max-w-[220px] gap-2",At,Ar),e[33]=At,e[34]=Ye):Ye=e[34];let jt;e[35]!==k?(jt=!k&&a.jsx(Dr,{size:12,className:"opacity-60 shrink-0"}),e[35]=k,e[36]=jt):jt=e[36];let ut;e[37]!==Oe?(ut=a.jsx(nt,{children:Oe}),e[37]=Oe,e[38]=ut):ut=e[38];const Rt=sl,is="w-[min(300px,calc(100vw-2rem))] p-1.5",os="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]!==v?(Ie=N&&a.jsx("p",{className:"px-2 pb-1.5 pt-1 text-xs text-muted-foreground",children:v("thread.branchPicker.newChatHint")}),e[40]=N,e[41]=v,e[42]=Ie):Ie=e[42];const Xe=_?a.jsx(Di,{orgId:i,orgSlug:u,userId:c,target:h,owner:p,repo:b,sandboxMap:f,enabled:T,tab:H,onTabChange:O,isV8:S,localUrl:ye,onSaveLocal:pt,onBack:()=>$(!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",S&&"gap-1"),children:[!S&&ce&&ee&&a.jsx(Ti,{rowRef:le,url:ee,onSelect:()=>Ce("local"),onEdit:()=>Ce("local"),onTurnOff:()=>de()}),ze&&o&&(G===o?a.jsx(Xs,{value:W,onChange:F,onSave:()=>Lt(),onCancel:ct}):a.jsx(Zs,{rowRef:ce?void 0:le,dot:cs("orange"),label:v("thread.branchPicker.defaultVersionName"),branch:S?void 0:o,originTooltip:S?v("thread.branchPicker.viaStudioUi"):void 0,selected:!ce,onSelect:()=>me(o),onRename:()=>{E(o),F(Hr(M,v("thread.branchPicker.defaultVersionName")))}})),ls?a.jsxs(a.Fragment,{children:[a.jsx(Vn,{children:v("thread.branchPicker.groupContent")}),dt.content.map(vt),Ct,a.jsx(Vn,{divided:!0,children:v("thread.branchPicker.groupCode")}),dt.code.map(vt)]}):a.jsxs(a.Fragment,{children:[M.map(vt),Ct]}),S&&a.jsx(gi,{virtualMcpId:s,branch:o,serve:xe,rowRef:Q?le:void 0,onPicked:()=>I(!1)})]}),(ze||M.length>0||ue.length>0||S)&&a.jsx("div",{className:"my-1 border-t"}),a.jsxs("button",{type:"button",onClick:()=>{rs()},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(Or,{className:"h-4 w-4 shrink-0"}),v("thread.branchPicker.newVersion")]}),Le&&a.jsx("p",{className:"px-2 pb-1 pt-0.5 text-xs text-warning",children:Te}),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",S&&"mt-1"),children:[v("thread.branchPicker.advanced"),a.jsx(or,{className:"h-4 w-4 shrink-0"})]})]});let Ue;e[43]!==Rt||e[44]!==Be||e[45]!==Ie||e[46]!==Xe?(Ue=a.jsxs(Rt,{className:is,align:os,onOpenAutoFocus:Be,children:[Ie,Xe]}),e[43]=Rt,e[44]=Be,e[45]=Ie,e[46]=Xe,e[47]=Ue):Ue=e[47];const wt=a.jsxs(nl,{open:T,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(rl,{asChild:!0,children:a.jsxs(ve,{"data-tour":el.branchPicker,variant:A?"outline":"ghost",size:A?"sm":"default","aria-label":Oe,disabled:k,className:Ye,children:[L?a.jsx(Br,{className:K(Ls,xs(Ne?.color))}):at&&!ce?a.jsx(cr,{className:K(Ls,xs(ds(ue.indexOf(at))))}):a.jsx("span",{className:K("h-2 w-2 shrink-0 rounded-full",o||ce?Qe:"bg-muted-foreground")}),a.jsx("span",{className:"min-w-0 truncate @max-3xl/panel-header:hidden",children:Oe}),jt]})})})}),ut]}),Ue]}),Ze=V!==null;let qe;e[48]===Symbol.for("react.memo_cache_sentinel")?(qe=R=>{R||te(null)},e[48]=qe):qe=e[48];let $e;e[49]!==v?($e=v("thread.branchPicker.deleteTitle"),e[49]=v,e[50]=$e):$e=e[50];let Fe;e[51]!==$e?(Fe=a.jsx(ks,{children:$e}),e[51]=$e,e[52]=Fe):Fe=e[52];let He;e[53]!==V||e[54]!==v?(He=V&&v("thread.branchPicker.deleteConfirm",{name:V.name}),e[53]=V,e[54]=v,e[55]=He):He=e[55];let U;e[56]!==He?(U=a.jsx(Ns,{children:He}),e[56]=He,e[57]=U):U=e[57];let ae;e[58]!==Fe||e[59]!==U?(ae=a.jsxs(Cs,{children:[Fe,U]}),e[58]=Fe,e[59]=U,e[60]=ae):ae=e[60];let he;e[61]!==v?(he=v("thread.branchPicker.cancel"),e[61]=v,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]!==v?(Ae=v("thread.branchPicker.delete"),e[65]=v,e[66]=Ae):Ae=e[66];let Ke;e[67]!==kt||e[68]!==Ae?(Ke=a.jsx(Rs,{onClick:kt,variant:"destructive",children:Ae}),e[67]=kt,e[68]=Ae,e[69]=Ke):Ke=e[69];let Ot;e[70]!==je||e[71]!==Ke?(Ot=a.jsxs(Ts,{children:[je,Ke]}),e[70]=je,e[71]=Ke,e[72]=Ot):Ot=e[72];let _t;e[73]!==ae||e[74]!==Ot?(_t=a.jsxs(Ds,{children:[ae,Ot]}),e[73]=ae,e[74]=Ot,e[75]=_t):_t=e[75];let ps;e[76]!==Ze||e[77]!==_t?(ps=a.jsx(Bs,{open:Ze,onOpenChange:qe,children:_t}),e[76]=Ze,e[77]=_t,e[78]=ps):ps=e[78];const Js=Y!==null;let bs;e[79]===Symbol.for("react.memo_cache_sentinel")?(bs=R=>{R||ne(null)},e[79]=bs):bs=e[79];let Mt;e[80]!==v?(Mt=v("thread.branchPicker.deleteTitle"),e[80]=v,e[81]=Mt):Mt=e[81];let Et;e[82]!==Mt?(Et=a.jsx(ks,{children:Mt}),e[82]=Mt,e[83]=Et):Et=e[83];let zt;e[84]!==Y||e[85]!==v?(zt=Y&&v("thread.branchPicker.discardStoreDraftConfirm",{name:Y.name}),e[84]=Y,e[85]=v,e[86]=zt):zt=e[86];let Ut;e[87]!==zt?(Ut=a.jsx(Ns,{children:zt}),e[87]=zt,e[88]=Ut):Ut=e[88];let qt;e[89]!==Et||e[90]!==Ut?(qt=a.jsxs(Cs,{children:[Et,Ut]}),e[89]=Et,e[90]=Ut,e[91]=qt):qt=e[91];let Ht;e[92]!==v?(Ht=v("thread.branchPicker.cancel"),e[92]=v,e[93]=Ht):Ht=e[93];let Kt;e[94]!==Ht?(Kt=a.jsx(As,{children:Ht}),e[94]=Ht,e[95]=Kt):Kt=e[95];let Vt;e[96]!==v?(Vt=v("thread.branchPicker.delete"),e[96]=v,e[97]=Vt):Vt=e[97];let Gt;e[98]!==Nt||e[99]!==Vt?(Gt=a.jsx(Rs,{onClick:Nt,variant:"destructive",children:Vt}),e[98]=Nt,e[99]=Vt,e[100]=Gt):Gt=e[100];let Wt;e[101]!==Kt||e[102]!==Gt?(Wt=a.jsxs(Ts,{children:[Kt,Gt]}),e[101]=Kt,e[102]=Gt,e[103]=Wt):Wt=e[103];let Qt;e[104]!==qt||e[105]!==Wt?(Qt=a.jsxs(Ds,{children:[qt,Wt]}),e[104]=qt,e[105]=Wt,e[106]=Qt):Qt=e[106];let gs;return e[107]!==Js||e[108]!==Qt?(gs=a.jsx(Bs,{open:Js,onOpenChange:bs,children:Qt}),e[107]=Js,e[108]=Qt,e[109]=gs):gs=e[109],a.jsxs(a.Fragment,{children:[wt,ps,gs]})}function Ri(t){return t.runtime!=="sandbox"}function Xs(t){const e=B.c(20),{value:s,onChange:r,onSave:n,onCancel:o}=t,d=be();let l;e[0]!==d?(l=d("thread.branchPicker.rename"),e[0]=d,e[1]=l):l=e[1];let i;e[2]!==r?(i=f=>r(f.target.value),e[2]=r,e[3]=i):i=e[3];let u;e[4]!==o||e[5]!==n?(u=f=>{f.key==="Enter"&&n(),f.key==="Escape"&&(f.preventDefault(),f.stopPropagation(),o())},e[4]=o,e[5]=n,e[6]=u):u=e[6];let c;e[7]!==l||e[8]!==i||e[9]!==u||e[10]!==s?(c=a.jsx("input",{autoFocus:!0,"aria-label":l,value:s,onChange:i,onKeyDown:u,className:"h-8 flex-1 rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[7]=l,e[8]=i,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 p;e[14]!==n||e[15]!==h?(p=a.jsx(ve,{size:"sm",onClick:n,children:h}),e[14]=n,e[15]=h,e[16]=p):p=e[16];let b;return e[17]!==c||e[18]!==p?(b=a.jsxs("div",{className:"flex items-center gap-1.5 p-1",children:[c,p]}),e[17]=c,e[18]=p,e[19]=b):b=e[19],b}function Vn(t){const e=B.c(5),{divided:s,children:r}=t,o=(s===void 0?!1:s)&&"mt-1 border-t";let d;e[0]!==o?(d=K("px-2 pb-1 pt-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",o),e[0]=o,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 Zs(t){const e=B.c(53),{rowRef:s,dot:r,codeIcon:n,agentIcon:o,originTooltip:d,label:l,creator:i,branch:u,selected:c,onSelect:h,onRename:p,onDelete:b,deleteBlocked:f}=t,m=f===void 0?!1:f,g=be();let x;e[0]!==o||e[1]!==n||e[2]!==r?(x=n?a.jsx(Br,{className:K(Ls,n)}):o?a.jsx(cr,{className:K(Ls,o)}):a.jsx("span",{className:K("h-2 w-2 shrink-0 rounded-full",r)}),e[0]=o,e[1]=n,e[2]=r,e[3]=x):x=e[3];let P;e[4]!==i?(P=i&&a.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:i}),e[4]=i,e[5]=P):P=e[5];let j;e[6]!==l||e[7]!==P?(j=a.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[l,P]}),e[6]=l,e[7]=P,e[8]=j):j=e[8];let y;e[9]!==h||e[10]!==c||e[11]!==x||e[12]!==j?(y=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:[x,j]}),e[9]=h,e[10]=c,e[11]=x,e[12]=j,e[13]=y):y=e[13];const S=y,w=c?"bg-accent":"hover:bg-accent";let k;e[14]!==w?(k=K("group flex items-center rounded-lg",w),e[14]=w,e[15]=k):k=e[15];let N;e[16]!==u||e[17]!==n||e[18]!==d||e[19]!==S||e[20]!==g?(N=u||d?a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:S}),a.jsxs(nt,{side:"bottom",className:"text-xs",children:[n&&a.jsx("p",{className:"font-medium",children:g("thread.branchPicker.codeDraftTooltip")}),d&&a.jsx("p",{children:d}),u&&a.jsx("p",{className:"font-mono",children:g("thread.branchPicker.branchTooltip",{branch:u})})]})]}):S,e[16]=u,e[17]=n,e[18]=d,e[19]=S,e[20]=g,e[21]=N):N=e[21];let C;e[22]!==g?(C=g("thread.branchPicker.moreActions"),e[22]=g,e[23]=C):C=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx(Fr,{className:"h-4 w-4"}),e[24]=v):v=e[24];let A;e[25]!==C?(A=a.jsx(_s,{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:v})}),e[25]=C,e[26]=A):A=e[26];let T;e[27]===Symbol.for("react.memo_cache_sentinel")?(T=a.jsx(Lr,{className:"h-4 w-4"}),e[27]=T):T=e[27];let I;e[28]!==g?(I=g("thread.branchPicker.rename"),e[28]=g,e[29]=I):I=e[29];let _;e[30]!==p||e[31]!==I?(_=a.jsxs(Xt,{onSelect:p,children:[T,I]}),e[30]=p,e[31]=I,e[32]=_):_=e[32];let $;e[33]!==m||e[34]!==b||e[35]!==g?($=b&&a.jsxs(Xt,{onSelect:b,disabled:m,className:"text-destructive focus:text-destructive",children:[a.jsx(Hs,{className:"h-4 w-4"}),g("thread.branchPicker.delete")]}),e[33]=m,e[34]=b,e[35]=g,e[36]=$):$=e[36];let H;e[37]!==m||e[38]!==b||e[39]!==g?(H=b&&m&&a.jsx("p",{className:"max-w-48 px-2 pb-1.5 text-xs text-muted-foreground",children:g("thread.branchPicker.keepOneDraft")}),e[37]=m,e[38]=b,e[39]=g,e[40]=H):H=e[40];let O;e[41]!==_||e[42]!==$||e[43]!==H?(O=a.jsxs(Ms,{align:"end",children:[_,$,H]}),e[41]=_,e[42]=$,e[43]=H,e[44]=O):O=e[44];let G;e[45]!==A||e[46]!==O?(G=a.jsxs(Es,{children:[A,O]}),e[45]=A,e[46]=O,e[47]=G):G=e[47];let E;return e[48]!==s||e[49]!==G||e[50]!==k||e[51]!==N?(E=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):E=e[52],E}function Ti(t){const e=B.c(40),{rowRef:s,url:r,onSelect:n,onEdit:o,onTurnOff:d}=t,l=be();let i;try{let A;e[0]!==r?(A=new URL(r),e[0]=r,e[1]=A):A=e[1],i=A.host}catch{i=r}const u=i;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 p;e[5]!==u?(p=a.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:u}),e[5]=u,e[6]=p):p=e[6];let b;e[7]!==h||e[8]!==p?(b=a.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[h,p]}),e[7]=h,e[8]=p,e[9]=b):b=e[9];let f;e[10]!==n||e[11]!==b?(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,b]}),e[10]=n,e[11]=b,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 g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=a.jsx(Fr,{className:"h-4 w-4"}),e[15]=g):g=e[15];let x;e[16]!==m?(x=a.jsx(_s,{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:g})}),e[16]=m,e[17]=x):x=e[17];let P;e[18]===Symbol.for("react.memo_cache_sentinel")?(P=a.jsx(Lr,{className:"h-4 w-4"}),e[18]=P):P=e[18];let j;e[19]!==l?(j=l("thread.branchPicker.rename"),e[19]=l,e[20]=j):j=e[20];let y;e[21]!==o||e[22]!==j?(y=a.jsxs(Xt,{onSelect:o,children:[P,j]}),e[21]=o,e[22]=j,e[23]=y):y=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=a.jsx(Hs,{className:"h-4 w-4"}),e[24]=S):S=e[24];let w;e[25]!==l?(w=l("thread.branchPicker.localTurnOff"),e[25]=l,e[26]=w):w=e[26];let k;e[27]!==d||e[28]!==w?(k=a.jsxs(Xt,{onSelect:d,className:"text-destructive focus:text-destructive",children:[S,w]}),e[27]=d,e[28]=w,e[29]=k):k=e[29];let N;e[30]!==y||e[31]!==k?(N=a.jsxs(Ms,{align:"end",children:[y,k]}),e[30]=y,e[31]=k,e[32]=N):N=e[32];let C;e[33]!==N||e[34]!==x?(C=a.jsxs(Es,{children:[x,N]}),e[33]=N,e[34]=x,e[35]=C):C=e[35];let v;return e[36]!==s||e[37]!==C||e[38]!==f?(v=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]=v):v=e[39],v}function Di(t){const e=B.c(73),{orgId:s,orgSlug:r,userId:n,target:o,owner:d,repo:l,sandboxMap:i,enabled:u,tab:c,onTabChange:h,isV8:p,localUrl:b,onSaveLocal:f,onBack:m,onAdopt:g}=t,x=be(),[P,j]=q.useState(""),y=c==="branches"?P:"",S=u&&c==="branches";let w;e[0]!==s||e[1]!==r||e[2]!==d||e[3]!==l||e[4]!==i||e[5]!==y||e[6]!==S||e[7]!==o||e[8]!==n?(w={orgId:s,orgSlug:r,userId:n,target:o,sandboxMap:i,owner:d,repo:l,search:y,enabled:S},e[0]=s,e[1]=r,e[2]=d,e[3]=l,e[4]=i,e[5]=y,e[6]=S,e[7]=o,e[8]=n,e[9]=w):w=e[9];const{recent:k,yours:N,others:C,isLoading:v,hasMore:A,isFetchingMore:T,fetchMore:I}=ki(w),_=u&&c==="prs";let $;e[10]!==s||e[11]!==r||e[12]!==d||e[13]!==l||e[14]!==_||e[15]!==o?($={orgId:s,orgSlug:r,target:o,owner:d,repo:l,enabled:_},e[10]=s,e[11]=r,e[12]=d,e[13]=l,e[14]=_,e[15]=o,e[16]=$):$=e[16];const{data:H,isLoading:O}=gl($);let G;if(e[17]!==I||e[18]!==A||e[19]!==T||e[20]!==v||e[21]!==p||e[22]!==b||e[23]!==g||e[24]!==m||e[25]!==f||e[26]!==h||e[27]!==C||e[28]!==d||e[29]!==O||e[30]!==k||e[31]!==l||e[32]!==P||e[33]!==x||e[34]!==H||e[35]!==c||e[36]!==N){const E=H===void 0?[]:H,W=`${d}/${l}`;let F;e[38]!==W?(F=W.toLowerCase(),e[38]=W,e[39]=F):F=e[39];const V=F;let te;e[40]!==V?(te=z=>z.headRepoFullName?.toLowerCase()===V,e[40]=V,e[41]=te):te=e[41];const Y=E.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(ol,{className:"h-4 w-4 shrink-0"}),e[46]=M):M=e[46];let X;e[47]!==x?(X=x("thread.branchPicker.advancedBack"),e[47]=x,e[48]=X):X=e[48];let D;e[49]!==m||e[50]!==X?(D=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,X]}),e[49]=m,e[50]=X,e[51]=D):D=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]!==x?(se=x("thread.branchPicker.branchesTab"),e[54]=x,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]!==x?(ge=x("thread.branchPicker.prsTab"),e[58]=x,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]!==p||e[63]!==x?(re=!p&&a.jsx(Tt,{value:"local",className:"h-6 px-2.5 text-xs",children:x("thread.branchPicker.localTab")}),e[62]=p,e[63]=x,e[64]=re):re=e[64];let fe;e[65]!==ie||e[66]!==ue||e[67]!==re?(fe=a.jsxs(Rr,{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(Tr,{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:[D,ye,c==="local"&&!p?a.jsx(bi,{url:b,onSave:f}):a.jsxs(al,{filter:c==="branches"?Bi:void 0,children:[a.jsx(ll,{placeholder:x(c==="branches"?"thread.branchPicker.searchBranches":"thread.branchPicker.searchPullRequests"),value:P,onValueChange:j}),a.jsx(il,{onScroll:z=>{const oe=z.currentTarget;c==="branches"&&oe.scrollHeight-oe.scrollTop-oe.clientHeight<48&&I()},children:c==="branches"?a.jsxs(a.Fragment,{children:[v&&a.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:x("thread.branchPicker.loadingMore")}),!v&&le.length===0&&a.jsx(En,{children:x("thread.branchPicker.noBranchesFound")}),le.length>0&&a.jsx(zn,{children:le.map(z=>a.jsxs(Un,{value:z.name,className:"cursor-pointer",onSelect:()=>g(z.name,z.name),children:[a.jsx(Ca,{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:T,onClick:I,children:x(T?"thread.branchPicker.loadingMore":"thread.branchPicker.loadMoreBranches")})})]}):a.jsxs(a.Fragment,{children:[O&&a.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:x("thread.branchPicker.loadingPullRequests")}),!O&&Y.length===0&&a.jsx(En,{children:x("thread.branchPicker.noOpenPullRequests")}),Y.length>0&&a.jsx(zn,{children:Y.map(z=>a.jsxs(Un,{value:`#${z.number} ${z.title} ${z.head}`,className:"cursor-pointer",onSelect:()=>g(z.head,Kn(z.title)),children:[a.jsx(qs,{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:Kn(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]=T,e[20]=v,e[21]=p,e[22]=b,e[23]=g,e[24]=m,e[25]=f,e[26]=h,e[27]=C,e[28]=d,e[29]=O,e[30]=k,e[31]=l,e[32]=P,e[33]=x,e[34]=H,e[35]=c,e[36]=N,e[37]=G}else G=e[37];return G}function Bi(t,e){return nn(t,e)?1:0}function Ii(t){const e=B.c(19),{locked:s,placement:r,value:n,virtualMcpId:o,isV8:d,userLabel:l,baseBranch:i,baseIsDraft:u,onChange:c,onCreateBranch:h,onAdoptBranch:p,orgId:b,orgSlug:f,userId:m,target:g,owner:x,repo:P,sandboxMap:j}=t;let y;return e[0]!==i||e[1]!==u||e[2]!==d||e[3]!==s||e[4]!==p||e[5]!==c||e[6]!==h||e[7]!==b||e[8]!==f||e[9]!==x||e[10]!==r||e[11]!==P||e[12]!==j||e[13]!==g||e[14]!==m||e[15]!==l||e[16]!==n||e[17]!==o?(y=a.jsx(Ai,{virtualMcpId:o,isV8:d,userLabel:l,value:n,baseBranch:i,baseIsDraft:u,orgId:b,orgSlug:f,userId:m,target:g,owner:x,repo:P,sandboxMap:j,onChange:c,onCreateBranch:h,onAdoptBranch:p,spawnsNewChat:s,placement:r}),e[0]=i,e[1]=u,e[2]=d,e[3]=s,e[4]=p,e[5]=c,e[6]=h,e[7]=b,e[8]=f,e[9]=x,e[10]=r,e[11]=P,e[12]=j,e[13]=g,e[14]=m,e[15]=l,e[16]=n,e[17]=o,e[18]=y):y=e[18],y}function $i(t){const e=B.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 Fi(t){const{locked:e,sessionRuntime:s,projectRuntime:r,draftRuntime:n,current:o}=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"&&!o?{kind:"new-chat"}:e?s==="sandbox"?{kind:"new-chat",runtime:"sandbox"}:{kind:"new-chat"}:{kind:"switch"}}function Li(t){const e=B.c(25),{virtualMcp:s,currentBranch:r}=t,n=za(),o=ns();let d;e[0]!==n?.messages||e[1]!==o?.isThreadLocked?(d=(n?.messages??[]).length>0||(o?.isThreadLocked??!1),e[0]=n?.messages,e[1]=o?.isThreadLocked,e[2]=d):d=e[2];const l=d,i=o?.setCurrentTaskBranch,u=o?.createTask,c=fs(s?.id),h=c.runtime,p=s?.metadata;let b;e[3]!==p?(b=fl(p),e[3]=p,e[4]=b):b=e[4];const f=b,m=f==="cms"&&h==="sandbox",g=ml(s),x=_e(g),{data:P}=zs.useSession(),j=P?.user;let y;e[5]!==j?(y=xn(j),e[5]=j,e[6]=y):y=e[6];const S=y,w=P?.user?.id??"",{org:k}=hs(),N=xl(s,r),C=vn(s?.id),v=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]!==i||e[14]!==C?(A=(E,W)=>{const F=Fi({locked:l,sessionRuntime:c.resolved?h:null,projectRuntime:f,draftRuntime:W&&(W.runtime??f),current:E===r,contentOnly:C});F.kind==="new-chat"&&u?u({branch:E,...F.runtime?{runtime:F.runtime}:{}}):i&&i(E)},e[7]=u,e[8]=r,e[9]=l,e[10]=f,e[11]=h,e[12]=c.resolved,e[13]=i,e[14]=C,e[15]=A):A=e[15];const T=A;let I;e[16]!==m||e[17]!==u||e[18]!==l||e[19]!==i?(I=E=>{(l||m)&&u?u({branch:E}):i&&i(E)},e[16]=m,e[17]=u,e[18]=l,e[19]=i,e[20]=I):I=e[20];const _=I;let $;e[21]!==u?($=u?E=>u({runtime:"sandbox",branch:E}):void 0,e[21]=u,e[22]=$):$=e[22];const H=$,O=g&&_r(x)?a.jsx(Ii,{userLabel:S,virtualMcpId:s?.id??"",isV8:C,value:r,baseBranch:N,baseIsDraft:v,orgId:k.id,orgSlug:k.slug,userId:w,target:x,owner:g.owner,repo:g.name,sandboxMap:s?.metadata?.sandboxMap,onChange:T,onCreateBranch:_,onAdoptBranch:H,locked:l,placement:"chat"},`${Mr(x)}:${g.owner}/${g.name}`):null;let G;return e[23]!==O?(G=a.jsx($i,{branchPill:O}),e[23]=O,e[24]=G):G=e[24],G}const Oi=Aa("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 _i(t){const e=B.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 o;e[4]!==s||e[5]!==r?(o=K(Oi({orientation:r}),s),e[4]=s,e[5]=r,e[6]=o):o=e[6];let d;return e[7]!==r||e[8]!==n||e[9]!==o?(d=a.jsx("div",{role:"group","data-slot":"button-group","data-orientation":r,className:o,...n}),e[7]=r,e[8]=n,e[9]=o,e[10]=d):d=e[10],d}function Mi(t){const e=B.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(Xt,{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 o=n;if(!s.tooltip)return o;let d;e[7]!==o?(d=a.jsx(st,{asChild:!0,children:o}),e[7]=o,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 i;return e[11]!==d||e[12]!==l?(i=a.jsxs(tt,{children:[d,l]}),e[11]=d,e[12]=l,e[13]=i):i=e[13],i}function Xr(t){const e=B.c(20),{label:s,onClick:r,variant:n,size:o,disabled:d,loading:l,pulse:i,tooltip:u,icon:c,items:h,menuAriaLabel:p,className:b}=t,f=n===void 0?"default":n,m=o===void 0?"default":o,g=d===void 0?!1:d,x=l===void 0?!1:l,P=i===void 0?!1:i,j=(h?.length??0)>0;let y;if(e[0]!==b||e[1]!==g||e[2]!==j||e[3]!==c||e[4]!==h||e[5]!==s||e[6]!==x||e[7]!==p||e[8]!==r||e[9]!==P||e[10]!==m||e[11]!==u||e[12]!==f){const S=K(Ar,f==="default"&&"focus-visible:inset-ring-current");let w;e[14]!==c||e[15]!==x?(w=x?a.jsx(Zt,{size:"xs"}):c,e[14]=c,e[15]=x,e[16]=w):w=e[16];const k=a.jsxs(ve,{type:"button",variant:f,size:m,disabled:g,"aria-busy":x||void 0,onClick:x?void 0:r,className:K(S,j&&"rounded-r-none border-r border-current/20"),children:[w,s]}),N=P&&"animate-pulse-brightness motion-reduce:animate-none motion-reduce:opacity-80";let C;e[17]!==b||e[18]!==N?(C=K(N,b),e[17]=b,e[18]=N,e[19]=C):C=e[19],y=a.jsxs(_i,{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",S,g&&"cursor-not-allowed"),tabIndex:g?0:void 0,role:g?"button":void 0,"aria-disabled":g||void 0,children:k})}),a.jsx(nt,{children:u})]}):k,j?a.jsxs(Es,{children:[a.jsx(_s,{asChild:!0,children:a.jsx(ve,{type:"button",variant:f,size:m,"aria-label":p,className:K("has-[>svg]:px-2",S),children:a.jsx(Dr,{className:"size-3.5"})})}),a.jsx(Ms,{align:"end",children:h?.map(Ei)})]}):null]}),e[0]=b,e[1]=g,e[2]=j,e[3]=c,e[4]=h,e[5]=s,e[6]=x,e[7]=p,e[8]=r,e[9]=P,e[10]=m,e[11]=u,e[12]=f,e[13]=y}else y=e[13];return y}function Ei(t){return a.jsx(Mi,{item:t},t.key)}async function zi(t){if(t.hosted)return;const e=t.branch;await t.setCurrentTaskBranch(t.nextBranch()),e&&e!==t.baseBranch&&await t.deleteRelease(e)}function Ui(t,e,{hosted:s}){return s&&t!==null?t:e}function qi(t,e){const s=B.c(11),[r,n]=q.useState(null);let o;s[0]!==r||s[1]!==t||s[2]!==e?(o=Ui(r,t,e),s[0]=r,s[1]=t,s[2]=e,s[3]=o):o=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 i;return s[8]!==o||s[9]!==d?(i={shown:o,hold:d,release:l},s[8]=o,s[9]=d,s[10]=i):i=s[10],i}function Hi({open:t,hosted:e}){return t||e}function Zr(t){return Fl({userName:t?.name,userEmail:t?.email})??void 0}function Gs(t){const e=B.c(18),{state:s,header:r,body:n,note:o,gate:d,footer:l}=t,i=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]!==o?(h=o?a.jsx("div",{className:"space-y-1.5 border-t px-4 py-3",children:o}):null,e[3]=o,e[4]=h):h=e[4];let p;e[5]!==n||e[6]!==h?(p=a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n,h]}),e[5]=n,e[6]=h,e[7]=p):p=e[7];let b;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=a.jsx("div",{className:"border-t"}),e[8]=b):b=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]!==i||e[14]!==u||e[15]!==p||e[16]!==f?(m=a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col","data-publish-state":s,"aria-busy":i,children:[u,c,p,d,b,f]}),e[11]=d,e[12]=s,e[13]=i,e[14]=u,e[15]=p,e[16]=f,e[17]=m):m=e[17],m}function us(t){const e=B.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 ea(t){const e=B.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 o;e[4]!==r?(o=K("rounded-lg border bg-card px-3 py-2.5",r),e[4]=r,e[5]=o):o=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==o?(d=a.jsx("div",{className:o,...n,children:s}),e[6]=s,e[7]=n,e[8]=o,e[9]=d):d=e[9],d}function We(t){const e=B.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 Dt(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(ea,{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 Ki="secret";function ta(t){return t.kind!=="block"?null:t.namedRule??null}function Vi(t,e){const s=e.find(r=>r&&typeof r=="object");return s?Rl(s.__resolveType):Tl(t)}const Gi=/(?:^|\/)\.deco\/blocks\/([^/]+)\.json$/;function Rn(t){const e=Gi.exec(t)?.[1];return e?ni(e):null}function Os(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 Wi(t,e){return t===null?"new":e===null?"removed":"edited"}function sa(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 Ra(r);const o=(r.split("/").pop()??r).replace(/\.[jt]sx?$/,"");return sa(o)||o}}return`Section ${e+1}`}function Tn(t){if(dr(t))return t.value??null;const e=t.__resolveType;return typeof e=="string"&&Ta(e)?t.section??null:null}const na=6;function Ps(t,e=0){if(e>na||!t||typeof t!="object")return[];if(Array.isArray(t))return t.flatMap(n=>Ps(n,e+1));const s=t;if(cn(s.__resolveType))return rn(s).flatMap(n=>Ps(n?.value,e+1));const r=Tn(s);return r!==null?Ps(r,e+1):[s]}function rn(t){const e=t?.variants;return Array.isArray(e)?e.map(s=>s&&typeof s=="object"&&!Array.isArray(s)?s:null):[]}function Gn(t){let e=t;for(let s=0;s<na;s++){if(!e||typeof e!="object"||Array.isArray(e))return null;const r=e;if(cn(r.__resolveType))return r;const n=Tn(r);if(n===null)return null;e=n}return null}function Qi(t,e,s){const r=rn(Gn(t)),n=e?rn(Gn(e)):[],o=e?Array.from({length:Math.max(r.length,n.length)},(i,u)=>u).filter(i=>!Ws(r[i],n[i])):[],l=[...o.map(i=>r[i]??n[i]),...r.filter((i,u)=>!o.includes(u))].flatMap(i=>Ps(i?.value)).map(i=>Yt(i,s,!0));return[...new Set(l)]}function en(t,e,s,r,n){let o=t,d=!1;for(let i=0;i<4;i++){if(!o||typeof o!="object"||Array.isArray(o)){d=!0;break}const u=o;if(cn(u.__resolveType)){d=!0;break}const c=Tn(u);if(c===null)break;o=c}const l=d?Qi(t,n,e):[];return{name:Yt(d?t:o,e,!0),kind:"section",status:s,fields:r,...d?{wrapper:!0}:{},...l.length>0?{held:l}:{}}}function an(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,o)=>{const d=n&&typeof n=="object"&&!Array.isArray(n)?n.value:null,l=e&&dr(d),i=l?d.value:d;if(!Array.isArray(i))return[];const u=l?["sections","variants",o,"value","value"]:["sections","variants",o,"value"];return i.flatMap((c,h)=>c&&typeof c=="object"&&!Array.isArray(c)?[{section:c,basePath:[...u,h]}]:[])})}return[]}function Wn(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,o)=>(n[o]=r[o],n),{})}return s})}function Ws(t,e){return t===void 0&&e===void 0?!0:Wn(t)===Wn(e)}function St(t,e,s,r=new Set){const n=new Set([...Object.keys(t??{}),...Object.keys(e??{})]),o=[];for(const d of n){if(d.startsWith("__")||r.has(d))continue;const l=t?t[d]:void 0,i=e?e[d]:void 0;Ws(l,i)||o.push({label:sa(d),path:[...s,d],from:l,to:i})}return o}function Ji(t,e){const s=e.find(r=>r&&typeof r=="object");return s?s.__resolveType===Ol:t===_l}function Yi(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 o=String(n.path[0]);s(n.from)&&s(n.to)?r.push(...St(n.from??{},n.to??{},[o])):r.push(n)}return r}const Xi=new Set(["sections"]);function Dn(t,e,s=!1){const r=t?an(t,s):[],n=e?an(e,s):[],o=[],d=Math.max(r.length,n.length);for(let i=0;i<d;i++){const u=r[i],c=n[i];if(!s){const h=Zi(u,c,i);h&&o.push(h);continue}if(u&&c){if(Ws(u.section,c.section))continue;o.push(en(c.section,i,"edited",St(u.section,c.section,c.basePath),u.section))}else c?o.push(en(c.section,i,"new",[])):u&&o.push(en(u.section,i,"removed",[]))}const l=St(t,e,[],Xi);return l.length>0&&o.push({name:"Page settings",kind:"settings",status:"edited",fields:l}),o}function Zi(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 ln(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 eo(t){const e=[],s=[],r=[],n=[];for(const[o,d]of Object.entries(t?.diffs??{})){if(Pn(o)){n.push(o);continue}const l=Wi(d.from,d.to),i=Rn(o);if(!i){r.push(ln(o,l));continue}const u=Os(d.from),c=Os(d.to),h=c??u;if(!h){r.push(ln(o,l));continue}const p=Jt(i,h);if(p){e.push({kind:"page",blockKey:i,name:p.name,pagePath:p.path,isSiteApp:!1,status:l,filepaths:[o],sections:l==="edited"?Dn(u,c):[],fromJson:u,toJson:c});continue}const b=yn(i,h);s.push({kind:"block",blockKey:i,name:Fs(i,h),pagePath:null,isSiteApp:b,status:l,filepaths:[o],sections:l==="edited"?[{name:Fs(i,h),kind:"section",status:"edited",fields:St(u,c,[])}].filter(f=>f.fields.length>0):[],fromJson:u,toJson:c})}return ra({pages:e,blocks:s,other:r,generated:n})}function tn(t,e){return(t.filepaths[0]??"").localeCompare(e.filepaths[0]??"")}function ra(t){const{pages:e,blocks:s,other:r,generated:n}=t;return e.sort(tn),s.sort(tn),r.sort(tn),{pages:e,blocks:s,other:r,generated:n,count:e.length+s.length+r.length}}function to(t){return t==="added"?"new":t==="removed"?"removed":"edited"}function aa(t){return t.startsWith("pages-")}function la(t){const{files:e,lookup:s,diff:r}=t,n=[],o=[],d=[],l=[];for(const i of e){const u=i.path;if(Pn(u)){l.push(u);continue}const c=to(i.status),h=Rn(u);if(!h){d.push(ln(u,c));continue}const p=r?.diffs[u],b=Os(p?.from??null),f=Os(p?.to??null),m=ia(s,h),g=m??f??b;if((m?Jt(h,m):null)??(!m&&aa(h))){const j=g?Jt(h,g):null;n.push({kind:"page",blockKey:h,name:j?.name??Vr(h),pagePath:j?.path??null,isSiteApp:!1,status:c,filepaths:[u],sections:c==="edited"?Dn(b,f):[],fromJson:b,toJson:f??(c==="new"?m:null)});continue}const P=Fs(h,g??{});o.push({kind:"block",blockKey:h,name:P,pagePath:null,isSiteApp:yn(h,m??{}),status:c,filepaths:[u],sections:c==="edited"?[{name:P,kind:"section",status:"edited",fields:St(b,f,[])}].filter(j=>j.fields.length>0):[],fromJson:b,toJson:f})}return ra({pages:n,blocks:o,other:d,generated:l})}function ia(t,e){const s=t?.[e];return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function so(t,e){return t??e}function oa(t){return t.length<=1?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}const sn=3;function vs(t){if(t.length<=sn)return oa(t);const e=t.length-sn;return`${t.slice(0,sn).join(", ")} and ${e} more`}function no(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 ro(t){const e=ta(t);return e==="experiments"?"A/B tests":e==="campaigns"?"Campaign dates":t.name}function ao(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=>no(l,!!t.v8)))}`),r.length>0){const l=r.length===1?"page":"pages";e.push(`added the ${vs(r.map(i=>i.name))} ${l}`)}if(n.length>0){const l=n.length===1?"page":"pages";e.push(`removed the ${vs(n.map(i=>i.name))} ${l}`)}const o=t.blocks.map(ro);if(o.length>0&&e.push(`changed ${vs(o)}`),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=oa(e);return Ll(d.charAt(0).toUpperCase()+d.slice(1))}function lo(t,e){return t?an(t,e).length:0}function io(t,e=!1){const s={newPageSections:t.kind==="page"&&t.status==="new"?lo(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 Qn="••••••";function es(t){if(Array.isArray(t))return t.map(es);if(!t||typeof t!="object")return t;const e=t,s={};for(const[r,n]of Object.entries(e))s[r]=es(n);return e.__resolveType===Ki&&"ciphertext"in e&&(s.ciphertext=Qn),Ba(e)&&"encrypted"in e&&(s.encrypted=Qn),s}function Jn(t){return t.map(e=>({...e,from:es(e.from),to:es(e.to)}))}function oo(t){const{changes:e,sides:s,lookup:r,meta:n,hosted:o}=t,d=[],l=[],i=c=>[...new Set((s?.diagnostics??[]).filter(h=>_n(Da(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],p=h.kind==="delete"?"removed":h.baseVersion===null?"new":"edited",b=s?.entries[c],f=b?.before??null,m=b?.after??null,g=ia(r,c),x=g??m??f,P=i(c),j={blockKey:c,status:p,filepaths:[],entry:{name:c,version:h.version},...P.length>0?{unreadable:P}:{},fromJson:es(f),toJson:es(m??(p==="new"?g:null))},y=g?Jt(c,g,n):null,S=!g&&x?Jt(c,x,n):null;if(y??S??(!x&&aa(c))){const v=x?Jt(c,x,n):null;d.push({...j,kind:"page",name:v?.name??Vr(c),pagePath:v?.path??null,isSiteApp:!1,sections:p==="edited"?Dn(f,m,!0).map(A=>({...A,fields:Jn(A.fields)})):[]});continue}const w=o?Cl(c,x,g,m,f):null,k=w?Al(w,[x,g,m,f]):Fs(c,x??{}),N=Vi(c,[g,m,f]),C=Ji(c,[g,m,f]);l.push({...j,kind:"block",name:C?"Settings":k,...C?{cmsSettings:!0}:{},...w?{blogKind:w}:{},...N?{namedRule:N}:{},pagePath:null,isSiteApp:yn(c,g??x??{}),sections:p==="edited"?[{name:C?"Settings":k,kind:"section",status:"edited",fields:Jn(C?Yi(f,m):St(f,m,[]))}].filter(v=>v.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 co(t,e){return e(t==="new"?"thread.publishPopover.chipNew":t==="removed"?"thread.publishPopover.chipRemoved":"thread.publishPopover.chipEdited")}function uo(t,e){const s=t.kind==="block"?Kl:Ir;return a.jsx("span",{title:co(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 ho(t,e){if(t.kind==="page")return t.pagePath;if(t.kind!=="block")return null;if(t.blogKind)return Dl(t.blogKind,e);if(t.cmsSettings)return e("thread.publishPopover.settingsDetail");const s=ta(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 fo(t,e,s){const r=io(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 ca(t){const e=B.c(46),{change:s,bodyPending:r,selected:n,onSelect:o,confirming:d,onConfirmingChange:l,onDiscard:i,isPublishing:u,isDiscarding:c,v8:h}=t,p=r===void 0?!1:r,b=h===void 0?!1:h,f=be();let m;e[0]!==s||e[1]!==f?(m=ho(s,f),e[0]=s,e[1]=f,e[2]=m):m=e[2];const g=m;let x;if(e[3]!==p||e[4]!==s||e[5]!==d||e[6]!==g||e[7]!==c||e[8]!==u||e[9]!==l||e[10]!==i||e[11]!==o||e[12]!==n||e[13]!==f||e[14]!==b){const P=fo(s,f,b),j=p&&P.length===0&&s.status==="edited",y=n&&"border-foreground/30 bg-accent hover:bg-secondary-hover";let S;e[16]!==y?(S=K("cursor-pointer transition-colors hover:bg-accent",y),e[16]=y,e[17]=S):S=e[17];let w;e[18]!==s?(w=ke(s),e[18]=s,e[19]=w):w=e[19];let k;e[20]!==s||e[21]!==f?(k=uo(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 v;e[29]!==g?(v=g?a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:g}):null,e[29]=g,e[30]=v):v=e[30];let A;e[31]!==n||e[32]!==C||e[33]!==v?(A=a.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left","aria-pressed":n,children:[C,v]}),e[31]=n,e[32]=C,e[33]=v,e[34]=A):A=e[34];let T;e[35]!==d||e[36]!==c||e[37]!==u||e[38]!==l||e[39]!==i||e[40]!==f?(T=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:_=>{_.stopPropagation(),l(!1)},children:f("thread.publishDialog.cancel")}),a.jsx("button",{type:"button",className:"text-xs font-medium text-destructive disabled:opacity-50",onClick:_=>{_.stopPropagation(),l(!1),i?.()},disabled:c,children:f("thread.publishPopover.discard")})]}):i?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:_=>{_.stopPropagation(),l(!0)},disabled:u||c,children:a.jsx(Hs,{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]=i,e[40]=f,e[41]=T):T=e[41];let I;e[42]!==A||e[43]!==T||e[44]!==k?(I=a.jsxs("div",{className:"flex items-center gap-2.5",children:[k,A,T]}),e[42]=A,e[43]=T,e[44]=k,e[45]=I):I=e[45],x=a.jsxs(ea,{className:S,"data-change-id":w,onClick:o,children:[I,P.length>0?a.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px] text-xs text-muted-foreground",children:P.map(mo)}):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]=p,e[4]=s,e[5]=d,e[6]=g,e[7]=c,e[8]=u,e[9]=l,e[10]=i,e[11]=o,e[12]=n,e[13]=f,e[14]=b,e[15]=x}else x=e[15];return x}function mo(t,e){return a.jsx("div",{className:"truncate",children:t},`${e}-${t}`)}function da(){const t=B.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]=q.useState(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=l=>{if(!l)return;const i=()=>r(c=>c.width===l.clientWidth&&c.height===l.clientHeight?c:{width:l.clientWidth,height:l.clientHeight});i();const u=new ResizeObserver(i);return u.observe(l),()=>u.disconnect()},t[1]=n):n=t[1];const o=n;let d;return t[2]!==s?(d=[s,o],t[2]=s,t[3]=d):d=t[3],d}function po(){return document.documentElement.classList.contains("dark")?"vs-dark":"vs"}const bo=[{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 Yn(t){const e=B.c(10),{height:s}=t,r=be();let n;e[0]!==s?(n={height:s},e[0]=s,e[1]=n):n=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=bo.map(go),e[2]=o):o=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 i;return e[7]!==n||e[8]!==l?(i=a.jsxs("div",{style:n,className:"flex w-full flex-col gap-1.5 overflow-hidden px-3 py-2",children:[o,l]}),e[7]=n,e[8]=l,e[9]=i):i=e[9],i}function go(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 ua={readOnly:!0,renderSideBySide:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12},xo={...ua,lineNumbersMinChars:3,lineDecorationsWidth:4,folding:!1,glyphMargin:!1,renderOverviewRuler:!1};function vo(t){const e=B.c(11),{diff:s,emptyMessage:r,rowClassName:n,onDiscardFile:o,hideFileRows:d,editorHeight:l}=t,i=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,[p,b]=q.useState(null),[f,m]=q.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=po(),e[0]=g):g=e[0];const x=g;if(!s||Object.keys(s.diffs).length===0){let j;return e[1]!==i?(j=a.jsx("div",{className:"flex items-center justify-center py-10 text-sm text-muted-foreground",children:i}),e[1]=i,e[2]=j):j=e[2],j}let P;return e[3]!==s.diffs||e[4]!==f||e[5]!==h||e[6]!==p||e[7]!==c||e[8]!==o||e[9]!==u?(P=a.jsx("div",{className:"divide-y",children:Object.entries(s.diffs).map(j=>{const[y,S]=j,{from:w,to:k}=S,N=p===y,C=w===null,v=k===null,A=y.startsWith("/")?y.slice(1):y,T=A.lastIndexOf("/"),I=T>=0?A.slice(T+1):A,_=T>=0?A.slice(0,T):null,$=ri(y),H=C?"bg-success":v?"bg-destructive":"bg-warning";return c?a.jsx("div",{children:a.jsx(qn,{original:w??"",modified:k??"",language:$,theme:x,height:h,loading:a.jsx(Yn,{height:h}),options:xo})},y):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:()=>b(N?null:y),children:a.jsx(or,{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",H)}),a.jsx(Ir,{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}),_&&a.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:_}),o?a.jsxs(Es,{children:[a.jsx(_s,{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(Ia,{className:"h-3.5 w-3.5"})})}),a.jsx(Ms,{align:"end",children:a.jsx(Xt,{className:"text-destructive focus:text-destructive",onSelect:()=>m(y),children:"Discard changes"})})]}):null]}),f===y&&o?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),o(y)},children:"Discard"})]})]}):null,N&&a.jsx("div",{className:"border-t",children:a.jsx(qn,{original:w??"",modified:k??"",language:$,theme:x,height:h,loading:a.jsx(Yn,{height:h}),options:ua})})]},y)})}),e[3]=s.diffs,e[4]=f,e[5]=h,e[6]=p,e[7]=c,e[8]=o,e[9]=u,e[10]=P):P=e[10],P}function yo(t){if(t.kind!=="block"||t.isSiteApp||!t.blockKey)return null;const e=(t.toJson??t.fromJson)?.__resolveType;return typeof e=="string"&&li(e)?t.blockKey:null}function jo(t){return t.kind!=="page"?!0:!t.pagePath||Pt(t.pagePath).length>0}function wo(t,e){try{return Ha(t,Il,e)}catch{return null}}function Po(t,e,s){if(!e)return;const r=Bl(e,t);if(!r)return null;if(Pt(r.path).length===0||s?.path!==r.path)return r.path;const n=jn(r.path,s.params);return Pt(n).length===0?n:r.path}function So(t){return t.sectionKey&&!t.v8?wo(t.previewServerUrl,t.sectionKey):No(t.previewServerUrl,t.path)}function ko(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=jn(s,e.params);return Pt(r).length===0?r:""}function No(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 Co(t,e){return e?.kind==="pointer"&&e.link?pn(t.toString(),e.link):ha(t,e)}function ha(t,e){if(!e)return null;if(e.kind==="pointer")return pn(t.toString(),e.pointer);try{return new URL(`${t.pathname}${t.search}`,e.previewUrl).href}catch{return null}}function Ao(t,e,s){return e===null?!1:t!=="other"||s?.kind==="sandbox"}function Ro(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 fa=q.createContext(!0),To=["split","before","after","code"];function Do(t){return To.includes(t)}const ma={desktop:1280,mobile:412};function Bo(t,e){const s=(o,d)=>t.unreadable?.includes(d)?e:o?`${JSON.stringify(o,null,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:{[La(t.entry.name)]:{from:r,to:n}}}}function pa(t){const e=B.c(76),{change:s,diff:r,bodyPending:n,previewServerUrl:o,draft:d,lastPage:l,v8:i,onReady:u}=t,c=be(),h=q.use(fa),p=yo(s),b=i?null:p,f=i?p:null,m=f?Po(f,i?.blocks,l):void 0,g=f!==null&&m===null,x=Ao(s.kind,o,d)&&(f===null||typeof m=="string"),[P,j]=q.useState(null),y=x?P??"split":"code",[S,w]=q.useState("desktop"),[k,N]=q.useState(null),C=k??(f?m??"":ko(s,l));let v;e[0]!==s?(v=jo(s),e[0]=s,e[1]=v):v=e[1];const A=v,T=o?So({previewServerUrl:o,sectionKey:p,path:C,v8:!!i}):null,I=T?pn(T.toString(),Ka):null,_=T?ha(T,d):null,$=T?Co(T,d):null;let H;e[2]!==s||e[3]!==r?.diffs||e[4]!==c?(H=s.entry?Bo(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]=H):H=e[5];const O=H;let G;e[6]!==O.diffs?(G=Object.keys(O.diffs),e[6]=O.diffs,e[7]=G):G=e[7];const E=G.length>0;let W;e:{if(b!==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 F=W,V=Ro(s,!!i),[te,Y]=q.useState(Io);let ne;e[13]===Symbol.for("react.memo_cache_sentinel")?(ne=J=>Y(de=>de.has(J)?de:new Set(de).add(J)),e[13]=ne):ne=e[13];const le=ne;let M;e[14]!==i?(M=J=>i?a.jsx(Lo,{...J,onLoaded:le}):a.jsx(Fo,{...J}),e[14]=i,e[15]=M):M=e[15];const X=M,Z=(x?[V.before==="new"?null:I,V.after==="removed"?null:_].flatMap(J=>J?[An(J,S)]:[]):[]).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(Or,{className:"size-5 text-brand"}),title:c("thread.publishCompare.newTitle"),description:c("thread.publishCompare.newDescription")}):X({url:I,device:S,title:c("thread.publishCompare.before"),missing:c("thread.publishCompare.enterPath")}),ue=V.after==="removed"?a.jsx(ys,{icon:a.jsx(Hs,{className:"size-5 text-destructive"}),title:c("thread.publishCompare.removedTitle"),description:c("thread.publishCompare.removedDescription")}):X({url:_,device:S,title:c("thread.publishCompare.after"),missing:c(T?"thread.publishCompare.draftUnavailable":"thread.publishCompare.enterPath")});let re;e[19]!==x||e[20]!==j||e[21]!==h||e[22]!==c||e[23]!==y?(re=x||h?a.jsx(Tr,{value:y,onValueChange:J=>{Do(J)&&j(J)},children:a.jsxs(Rr,{className:"h-8 w-auto",variant:"pill",children:[x?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]=x,e[20]=j,e[21]=h,e[22]=c,e[23]=y,e[24]=re):re=e[24];let fe;e[25]!==$||e[26]!==x||e[27]!==s.pagePath||e[28]!==S||e[29]!==C||e[30]!==A||e[31]!==b||e[32]!==w||e[33]!==N||e[34]!==c||e[35]!==y?(fe=x&&y!=="code"?a.jsxs(a.Fragment,{children:[b?null:A?a.jsx($a,{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(Xn,{active:S==="desktop",label:c("thread.publishCompare.desktop"),onClick:()=>w("desktop"),children:a.jsx(ai,{className:"size-3.5"})}),a.jsx(Xn,{active:S==="mobile",label:c("thread.publishCompare.mobile"),onClick:()=>w("mobile"),children:a.jsx(cl,{className:"size-3.5"})})]}),$?a.jsxs("a",{href:$,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(Fa,{className:"size-3.5"}),c("thread.publishCompare.openDraft")]}):null]}):null,e[25]=$,e[26]=x,e[27]=s.pagePath,e[28]=S,e[29]=C,e[30]=A,e[31]=b,e[32]=w,e[33]=N,e[34]=c,e[35]=y,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]!==x||e[41]!==F||e[42]!==y?(z=F&&x&&y!=="code"?a.jsx("p",{className:"border-b bg-background px-4 py-1.5 text-2xs text-muted-foreground",children:F}):null,e[40]=x,e[41]=F,e[42]=y,e[43]=z):z=e[43];let oe;e[44]!==g||e[45]!==h||e[46]!==c?(oe=g&&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]=g,e[45]=h,e[46]=c,e[47]=oe):oe=e[47];let xe;e[48]!==o||e[49]!==h||e[50]!==c||e[51]!==f||e[52]!==m||e[53]!==y?(xe=y==="code"&&!h?f!==null&&m===void 0?a.jsx(We,{className:"m-4 h-64 rounded"}):o===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]=o,e[49]=h,e[50]=c,e[51]=f,e[52]=m,e[53]=y,e[54]=xe):xe=e[54];let Q;e[55]!==n||e[56]!==E||e[57]!==O||e[58]!==h||e[59]!==c||e[60]!==y?(Q=y==="code"&&h?a.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto bg-background [scrollbar-width:thin]",children:E?a.jsx(vo,{diff:O,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,e[57]=O,e[58]=h,e[59]=c,e[60]=y,e[61]=Q):Q=e[61];let ee;e[62]!==ue||e[63]!==ge||e[64]!==x||e[65]!==c||e[66]!==y?(ee=x?a.jsxs("div",{className:K("flex min-h-0 flex-1 gap-3 p-3",y==="code"&&"hidden"),children:[a.jsx(Zn,{label:c("thread.publishCompare.before"),hidden:y==="after",children:ge}),a.jsx(Zn,{label:c("thread.publishCompare.after"),highlight:!0,hidden:y==="before",children:ue})]}):null,e[62]=ue,e[63]=ge,e[64]=x,e[65]=c,e[66]=y,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 Io(){return new Set}function Xn(t){const e=B.c(8),{active:s,label:r,onClick:n,children:o}=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 i;return e[2]!==s||e[3]!==o||e[4]!==r||e[5]!==n||e[6]!==l?(i=a.jsx("button",{type:"button","aria-label":r,"aria-pressed":s,title:r,onClick:n,className:l,children:o}),e[2]=s,e[3]=o,e[4]=r,e[5]=n,e[6]=l,e[7]=i):i=e[7],i}function Zn(t){const e=B.c(18),{label:s,highlight:r,hidden:n,children:o}=t,d=r===void 0?!1:r,i=(n===void 0?!1:n)&&"hidden";let u;e[0]!==i?(u=K("flex min-h-0 min-w-0 flex-1 flex-col gap-1.5",i),e[0]=i,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 p;e[4]!==h?(p=a.jsx("span",{className:h}),e[4]=h,e[5]=p):p=e[5];let b;e[6]!==s||e[7]!==p?(b=a.jsxs("div",{className:"flex items-center gap-1.5 px-0.5 text-2xs font-medium text-muted-foreground",children:[p,s]}),e[6]=s,e[7]=p,e[8]=b):b=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 g;e[11]!==o||e[12]!==m?(g=a.jsx("div",{className:m,children:o}),e[11]=o,e[12]=m,e[13]=g):g=e[13];let x;return e[14]!==g||e[15]!==u||e[16]!==b?(x=a.jsxs("div",{className:u,children:[b,g]}),e[14]=g,e[15]=u,e[16]=b,e[17]=x):x=e[17],x}function ys(t){const e=B.c(10),{icon:s,title:r,description:n}=t;let o;e[0]!==s?(o=a.jsx("div",{className:"mb-1",children:s}),e[0]=s,e[1]=o):o=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 i;return e[6]!==o||e[7]!==d||e[8]!==l?(i=a.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-1 px-6 text-center",children:[o,d,l]}),e[6]=o,e[7]=d,e[8]=l,e[9]=i):i=e[9],i}function $o(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 Fo(t){const e=B.c(24),{url:s,device:r,title:n,missing:o}=t,[d,l]=da(),[i,u]=q.useState(null);if(!s){let w;return e[0]!==o?(w=a.jsx("p",{className:"flex h-full items-center justify-center px-6 text-center text-xs text-muted-foreground",children:o}),e[0]=o,e[1]=w):w=e[1],w}let c;e[2]!==r||e[3]!==s?(c=An(s,r),e[2]=r,e[3]=s,e[4]=c):c=e[4];const h=c,p=ma[r],b=d.width>0?Math.min(d.width/p,1):1,f=d.width>0?Math.max((d.width-p*b)/2,0):0;let m;e[5]!==h?(m=()=>u(h),e[5]=h,e[6]=m):m=e[6];const g=d.height>0?d.height/b:"100%",x=`scale(${b})`;let P;e[7]!==p||e[8]!==f||e[9]!==g||e[10]!==x?(P={left:f,width:p,height:g,transform:x,transformOrigin:"top left"},e[7]=p,e[8]=f,e[9]=g,e[10]=x,e[11]=P):P=e[11];let j;e[12]!==h||e[13]!==m||e[14]!==P||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:P},h),e[12]=h,e[13]=m,e[14]=P,e[15]=n,e[16]=j):j=e[16];let y;e[17]!==i||e[18]!==h?(y=i!==h?a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/60",children:a.jsx(Zt,{className:"size-5 motion-reduce:animate-none"})}):null,e[17]=i,e[18]=h,e[19]=y):y=e[19];let S;return e[20]!==l||e[21]!==j||e[22]!==y?(S=a.jsxs("div",{ref:l,className:"absolute inset-0",children:[j,y]}),e[20]=l,e[21]=j,e[22]=y,e[23]=S):S=e[23],S}function Lo(t){const e=B.c(21),{url:s,device:r,title:n,missing:o,onLoaded:d}=t,[l,i]=da(),[u,c]=q.useState(null),[h,p]=q.useState(null),b=l.width>0&&l.height>0;b&&(u?.width!==l.width||u?.height!==l.height)&&c(l);const f=b?l:u;if(!s){let S;return e[0]!==o?(S=a.jsx("p",{className:"flex h-full items-center justify-center px-6 text-center text-xs text-muted-foreground",children:o}),e[0]=o,e[1]=S):S=e[1],S}let m,g,x,P;if(e[2]!==f||e[3]!==r||e[4]!==d||e[5]!==i||e[6]!==h||e[7]!==n||e[8]!==s){const S=An(s,r),w=ma[r];m=h?.src!==S;const k=[...h&&m?[h]:[],{src:S,logicalWidth:w}];g=i,x="absolute inset-0",P=k.map(N=>{const C=N.src===S&&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===S&&(p(N),d?.(N.src))},className:K("absolute top-0 border-0 bg-white",C&&"pointer-events-none opacity-0"),style:$o(f,N.logicalWidth)},N.src)}),e[2]=f,e[3]=r,e[4]=d,e[5]=i,e[6]=h,e[7]=n,e[8]=s,e[9]=m,e[10]=g,e[11]=x,e[12]=P}else m=e[9],g=e[10],x=e[11],P=e[12];let j;e[13]!==m||e[14]!==h?(j=m?h?a.jsx(Zt,{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(Zt,{className:"size-5 motion-reduce:animate-none"})}):null,e[13]=m,e[14]=h,e[15]=j):j=e[15];let y;return e[16]!==g||e[17]!==x||e[18]!==P||e[19]!==j?(y=a.jsxs("div",{ref:g,className:x,children:[P,j]}),e[16]=g,e[17]=x,e[18]=P,e[19]=j,e[20]=y):y=e[20],y}const Oo=/^Co-authored-by:\s*([^<\r\n]+?)(?:\s*<[^>\r\n]*>)?\s*$/im;function _o(t){if(!t)return null;const e=Oo.exec(t)?.[1]?.trim();return e||null}function Mo(t){return/\[bot\]$/i.test(t)||/-bot$/i.test(t)}function Eo(t){const e=_o(t.body);if(e)return e;const s=t.author.trim();return!s||Mo(s)?null:s}function zo(t,e,s,r,n,o){return["cms-publish-bodies",t,e,s,r,n,o]}const Uo=6e4;function qo(t,e){return e?null:t.files.map(s=>`${s.index}${s.working_dir} ${s.path}`).sort().join(`
|
|
3
|
+
`)}function Ho(t,e,s){const r=B.c(6);let n;r[0]!==s||r[1]!==t||r[2]!==e?(n=ss.decofile(`${t}/${e}/${s}`),r[0]=s,r[1]=t,r[2]=e,r[3]=n):n=r[3];let o;r[4]!==n?(o={queryKey:n,queryFn:dn},r[4]=n,r[5]=o):o=r[5];const{data:d}=ft(o);return d}function ba(t){const{orgSlug:e,virtualMcpId:s,branch:r,threadId:n,baseBranch:o,fastPreview:d,recoverSandbox:l}=t,i={orgSlug:e,virtualMcpId:s,branch:r,threadId:n},u=d?{fastPreview:!0}:void 0,c=q.useRef(null),h=async S=>{try{return await S()}catch(w){if(!l||!Gr(w))throw w;return c.current??=l(),await c.current,S()}},p=ur({...Sn(i),queryFn:()=>h(()=>Wr(i))}),b=p.data,f=b.changedFiles??null,m=b.headSha??null,g=f?f.length>0:Gl(b)||Wl(b),x=ft({queryKey:zo(e,s,r,o,m,qo(b,d)),queryFn:()=>h(()=>Ql(i,b,o,u)),enabled:g,staleTime:d?Uo:0,gcTime:d?void 0:0,throwOnError:(S,w)=>!f&&w.state.data===void 0}),P=Ho(e,s,r),j=x.data??null,y=f?la({files:f,lookup:P,diff:j}):eo(j);return{status:b,summary:y,allPaths:f?f.map(S=>S.path):Object.keys(j?.diffs??{}),discardablePaths:d?null:new Set(b.files.map(S=>S.path)),changedFilesTotal:b.changedFilesTotal??y.count,changedFilesTruncated:b.changedFilesTruncated??!1,headSha:m,diff:j,bodiesPending:g&&x.isPending,bodiesFailed:x.isError,cardsPending:!f&&g&&x.isPending,refresh:()=>Promise.all([p.refetch(),d?null:x.refetch()])}}function Ko(t){const e=B.c(4);let s;e[0]!==t?(s=ss.decofile(t),e[0]=t,e[1]=s):s=e[1];let r;e[2]!==s?(r={queryKey:s,queryFn:dn},e[2]=s,e[3]=r):r=e[3];const{data:n}=ft(r);return n}function Vo(t,e){const s=B.c(5);let r;s[0]!==t||s[1]!==e?(r=e?Ga(e,t):ss.liveMeta("","no-scope"),s[0]=t,s[1]=e,s[2]=r):r=s[2];let n;s[3]!==r?(n={queryKey:r,queryFn:dn},s[3]=r,s[4]=n):n=s[4];const{data:o}=ft(n);return o}function Bn(t){const e=B.c(27),{backend:s,cacheKey:r,scope:n}=t,o=hr();let d;e[0]!==r?(d=ss.contentChanges(r),e[0]=r,e[1]=d):d=e[1];let l;e[2]!==s.client||e[3]!==r||e[4]!==o?(l=()=>Wa(o,s.client,r),e[2]=s.client,e[3]=r,e[4]=o,e[5]=l):l=e[5];let i;e[6]!==d||e[7]!==l?(i={queryKey:d,queryFn:l,staleTime:0},e[6]=d,e[7]=l,e[8]=i):i=e[8];const u=ur(i),c=u.data,h=Va(s,r,c),p=Ko(r),b=Vo(s,n),f=h.data??null,m=s.source==="github";let g;e[9]!==c.changes||e[10]!==p||e[11]!==b||e[12]!==f||e[13]!==m?(g=oo({changes:c.changes,sides:f,lookup:p,meta:b,hosted:m}),e[9]=c.changes,e[10]=p,e[11]=b,e[12]=f,e[13]=m,e[14]=g):g=e[14];const x=g;let P;e[15]!==c.changes?(P=Object.entries(c.changes).map(Go),e[15]=c.changes,e[16]=P):P=e[16];const j=x.count>0&&h.isPending,y=p??null;let S;e[17]!==u?(S=()=>u.refetch(),e[17]=u,e[18]=S):S=e[18];let w;return e[19]!==c||e[20]!==h.isError||e[21]!==x||e[22]!==P||e[23]!==j||e[24]!==y||e[25]!==S?(w={changes:c,summary:x,entries:P,sidesPending:j,sidesFailed:h.isError,blocks:y,refresh:S},e[19]=c,e[20]=h.isError,e[21]=x,e[22]=P,e[23]=j,e[24]=y,e[25]=S,e[26]=w):w=e[26],w}function Go(t){const[e,s]=t;return{name:e,version:s.version}}function Wo(t){return["smart-review-verdict",t.orgSlug,t.virtualMcpId,t.branch,t.threadId,t.fastPreview?"fast-preview-upstream":"sandbox",t.signature,t.language]}function Qo(t){const e=B.c(27),{orgSlug:s,virtualMcpId:r,branch:n,threadId:o,fastPreview:d,status:l,diff:i,enabled:u}=t,[c]=fr(),{language:h}=c;let p,b,f;if(e[0]!==n||e[1]!==i||e[2]!==u||e[3]!==d||e[4]!==h||e[5]!==s||e[6]!==l||e[7]!==o||e[8]!==r){const S=i?kn(i):"";p=u&&!!n&&!!l&&!!i&&S!=="",f=ft,b=Wo({orgSlug:s,virtualMcpId:r,branch:n,threadId:o,fastPreview:d,signature:S,language:h}),e[0]=n,e[1]=i,e[2]=u,e[3]=d,e[4]=h,e[5]=s,e[6]=l,e[7]=o,e[8]=r,e[9]=p,e[10]=b,e[11]=f}else p=e[9],b=e[10],f=e[11];let m;e[12]!==n||e[13]!==i||e[14]!==h||e[15]!==s||e[16]!==l||e[17]!==o||e[18]!==r?(m=()=>Jl({orgSlug:s,virtualMcpId:r,branch:n,threadId:o},{status:l,diff:i,language:h}),e[12]=n,e[13]=i,e[14]=h,e[15]=s,e[16]=l,e[17]=o,e[18]=r,e[19]=m):m=e[19];let g;e[20]!==p||e[21]!==b||e[22]!==m?(g={queryKey:b,queryFn:m,enabled:p,staleTime:1/0,gcTime:6e5,retry:Jo},e[20]=p,e[21]=b,e[22]=m,e[23]=g):g=e[23];const x=f(g),P=x.data??null,j=p&&x.isFetching&&!x.data;let y;return e[24]!==P||e[25]!==j?(y={verdict:P,loading:j},e[24]=P,e[25]=j,e[26]=y):y=e[26],y}function Jo(t,e){return!Gr(e)&&t<1}function ga(t){const e=B.c(30),{orgSlug:s,virtualMcpId:r,branch:n,threadId:o,fastPreview:d,status:l,diff:i,policy:u,judgeEnabled:c,paths:h}=t,p=c===void 0?!0:c,b=h===void 0?null:h;let f;e[0]!==i||e[1]!==p||e[2]!==u?(f=p&&Yl(i,u),e[0]=i,e[1]=p,e[2]=u,e[3]=f):f=e[3];const m=f;let g;e[4]!==n||e[5]!==i||e[6]!==d||e[7]!==m||e[8]!==s||e[9]!==l||e[10]!==o||e[11]!==r?(g={orgSlug:s,virtualMcpId:r,branch:n,threadId:o,fastPreview:d,status:l,diff:i,enabled:m},e[4]=n,e[5]=i,e[6]=d,e[7]=m,e[8]=s,e[9]=l,e[10]=o,e[11]=r,e[12]=g):g=e[12];const{verdict:x,loading:P}=Qo(g);if(!i&&b){let w;e[13]!==b||e[14]!==u?(w=Xl(b,u),e[13]=b,e[14]=u,e[15]=w):w=e[15];let k;return e[16]!==w?(k={gate:w,ready:!1},e[16]=w,e[17]=k):k=e[17],k}if(!i){let w;return e[18]===Symbol.for("react.memo_cache_sentinel")?(w={gate:{allowed:!0,reason:null},ready:!1},e[18]=w):w=e[18],w}if(!m){let w;e[19]!==i||e[20]!==u?(w=Zl(i,u),e[19]=i,e[20]=u,e[21]=w):w=e[21];let k;return e[22]!==w?(k={gate:w,ready:!0},e[22]=w,e[23]=k):k=e[23],k}let j;e[24]!==P||e[25]!==x?(j=ei(x,P),e[24]=P,e[25]=x,e[26]=j):j=e[26];const y=!P;let S;return e[27]!==j||e[28]!==y?(S={gate:j,ready:y},e[27]=j,e[28]=y,e[29]=S):S=e[29],S}function Yo(t){return["main","master"].includes(t.trim().toLowerCase())}function Xo(t,e,s,r){return t===0?r("thread.publishPopover.publish"):s||!Yo(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 Zo=2500;function ec(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 xa(t){const e=B.c(16),s=q.useRef(!1),r=be();let n;e[0]!==t?(n=h=>{!h&&s.current||t.onOpenChange(h)},e[0]=t,e[1]=n):n=e[1];const o=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(pr,{className:"sr-only",children:d}),e[5]=d,e[6]=l):l=e[6];let i;e[7]!==t?(i=a.jsx(tc,{...t,publishLockRef:s}),e[7]=t,e[8]=i):i=e[8];let u;e[9]!==l||e[10]!==i?(u=a.jsxs(br,{"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,i]}),e[9]=l,e[10]=i,e[11]=u):u=e[11];let c;return e[12]!==o||e[13]!==t.open||e[14]!==u?(c=a.jsx(mr,{open:t.open,onOpenChange:o,children:u}),e[12]=o,e[13]=t.open,e[14]=u,e[15]=c):c=e[15],c}function tc(t){const e=B.c(3),s=Bt(t.virtualMcpId,t.branch),r=s.kind==="protocol"&&s.source==="github";let n;return e[0]!==r||e[1]!==t?(n=Hi({open:t.open,hosted:r})?a.jsx(rc,{...t}):null,e[0]=r,e[1]=t,e[2]=n):n=e[2],n}const sc=4,ts="flex h-[45%] min-h-0 min-w-0 shrink-0 md:h-auto md:flex-1";function ms(t){const e=B.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 o;return e[2]!==r||e[3]!==n?(o=a.jsxs(a.Fragment,{children:[r,n]}),e[2]=r,e[3]=n,e[4]=o):o=e[4],o}function In(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx("div",{className:K(ts,"bg-muted/40 p-3"),children:a.jsx(We,{className:"h-full w-full rounded-lg"})}),t[0]=e):e=t[0],e}function $n(t){const e=B.c(11),{mode:s,title:r,subLine:n,trailing:o}=t,d=s==="review"?qs:dl;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 i;e[2]!==l||e[3]!==r||e[4]!==o?(i=a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[l,r,o]}),e[2]=l,e[3]=r,e[4]=o,e[5]=i):i=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]!==i||e[9]!==u?(c=a.jsxs(a.Fragment,{children:[i,u]}),e[8]=i,e[9]=u,e[10]=c):c=e[10],c}function Fn(t){const e=B.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 o=!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 i;return e[5]!==n||e[6]!==o||e[7]!==l?(i=a.jsxs(ve,{type:"button",variant:"outline",onClick:n,disabled:o,children:[d,l]}),e[5]=n,e[6]=o,e[7]=l,e[8]=i):i=e[8],i}function va(t){const e=B.c(21),{mode:s,draftPreviewUrl:r}=t,n=be();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(In,{}),e[0]=o):o=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($n,{mode:s,title:d}),e[2]=s,e[3]=l):l=e[3];let i,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(us,{children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Dt,{}),a.jsx(Dt,{}),a.jsx(Dt,{})]})}),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]=i,e[5]=u):(i=e[4],u=e[5]);let c;e[6]!==r||e[7]!==n?(c=a.jsx(Fn,{draftPreviewUrl:r,t:n}),e[6]=r,e[7]=n,e[8]=c):c=e[8];const h=s==="review"?"default":"brand";let p;e[9]!==s||e[10]!==n?(p=n(s==="review"?"thread.publishPopover.submitForReview":"thread.publishPopover.publish"),e[9]=s,e[10]=n,e[11]=p):p=e[11];let b;e[12]!==h||e[13]!==p?(b=a.jsx(ve,{type:"button",variant:h,className:"flex-1",disabled:!0,children:p}),e[12]=h,e[13]=p,e[14]=b):b=e[14];let f;e[15]!==c||e[16]!==b?(f=a.jsxs("div",{className:"flex gap-2",children:[c,b]}),e[15]=c,e[16]=b,e[17]=f):f=e[17];let m;return e[18]!==f||e[19]!==l?(m=a.jsx(ms,{pane:o,list:a.jsx(Gs,{state:"loading",header:l,body:i,note:u,footer:f})}),e[18]=f,e[19]=l,e[20]=m):m=e[20],m}function nc(t){const e=B.c(26),{mode:s,draftPreviewUrl:r,message:n,onRetry:o}=t,d=be();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx("div",{className:K(ts,"bg-muted/40")}),e[0]=l):l=e[0];let i;e[1]!==d?(i=d("thread.publishPopover.loadFailed"),e[1]=d,e[2]=i):i=e[2];let u;e[3]!==i?(u=a.jsx("span",{className:"truncate",children:i}),e[3]=i,e[4]=u):u=e[4];let c;e[5]!==s||e[6]!==u?(c=a.jsx($n,{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 p;e[10]!==r||e[11]!==d?(p=a.jsx(Fn,{draftPreviewUrl:r,t:d}),e[10]=r,e[11]=d,e[12]=p):p=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=a.jsx(hn,{className:"size-4"}),e[13]=b):b=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]!==o||e[17]!==f?(m=a.jsxs(ve,{type:"button",variant:"outline",className:"flex-1",onClick:o,children:[b,f]}),e[16]=o,e[17]=f,e[18]=m):m=e[18];let g;e[19]!==p||e[20]!==m?(g=a.jsxs("div",{className:"flex gap-2",children:[p,m]}),e[19]=p,e[20]=m,e[21]=g):g=e[21];let x;return e[22]!==g||e[23]!==c||e[24]!==h?(x=a.jsx(ms,{pane:l,list:a.jsx(Gs,{state:"ready",header:c,body:h,footer:g})}),e[22]=g,e[23]=c,e[24]=h,e[25]=x):x=e[25],x}function rc(t){const e=B.c(3),s=t.mode??"publish";let r;return e[0]!==s||e[1]!==t?(r=a.jsx(gr,{children:n=>{const{reset:o}=n;return a.jsx(xr,{fallback:d=>{const{error:l,resetError:i}=d;return a.jsx(nc,{mode:s,draftPreviewUrl:t.draftPreviewUrl,message:l?.message??"",onRetry:()=>{o(),i()}})},children:a.jsx(q.Suspense,{fallback:a.jsx(va,{mode:s,draftPreviewUrl:t.draftPreviewUrl}),children:a.jsx(ac,{...t})})})}}),e[0]=s,e[1]=t,e[2]=r):r=e[2],r}function ac(t){const e=B.c(13),s=Bt(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=bn(r);if(s.kind==="protocol"&&n){let d;return e[4]!==s||e[5]!==n||e[6]!==t?(d=s.source==="sandbox"?a.jsx(oc,{...t,backend:s,cacheKey:n}):a.jsx(ic,{...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(va,{mode:d,draftPreviewUrl:t.draftPreviewUrl}),e[8]=t.draftPreviewUrl,e[9]=d,e[10]=l):l=e[10],l}let o;return e[11]!==t?(o=a.jsx(lc,{...t}),e[11]=t,e[12]=o):o=e[12],o}function lc(t){const e=B.c(52),s=ns()?.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=ba(r),o=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]!==o||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:o},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]=o,e[17]=s,e[18]=d):d=e[18];const{gate:l}=ga(d),i=n.discardablePaths;let u;e[19]!==i?(u=P=>i===null||P.every(j=>i.has(j)),e[19]=i,e[20]=u):u=e[20];const c=u;let h;e[21]!==c?(h=P=>c(P.filepaths),e[21]=c,e[22]=h):h=e[22];let p;e[23]!==c||e[24]!==n.allPaths||e[25]!==n.changedFilesTruncated?(p=!n.changedFilesTruncated&&c(n.allPaths),e[23]=c,e[24]=n.allPaths,e[25]=n.changedFilesTruncated,e[26]=p):p=e[26];let b;e[27]!==t.branch||e[28]!==n.status?(b=Nn(n.status)??t.branch,e[27]=t.branch,e[28]=n.status,e[29]=b):b=e[29];const f=n.headSha??void 0;let m;e[30]!==t.fastPreview||e[31]!==n.diff?(m=!t.fastPreview&&n.diff?{expectedDiffSignature:kn(n.diff)}:{},e[30]=t.fastPreview,e[31]=n.diff,e[32]=m):m=e[32];let g;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]!==p||e[45]!==b||e[46]!==f||e[47]!==m?(g={summary:n.summary,allPaths:n.allPaths,canDiscard:h,canDiscardAll:p,changedFilesTotal:n.changedFilesTotal,changedFilesTruncated:n.changedFilesTruncated,diff:n.diff,bodiesPending:n.bodiesPending,bodiesFailed:n.bodiesFailed,cardsPending:n.cardsPending,refresh:n.refresh,gate:l,headBranch:b,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]=p,e[45]=b,e[46]=f,e[47]=m,e[48]=g):g=e[48];let x;return e[49]!==t||e[50]!==g?(x=a.jsx(Ln,{...t,source:g}),e[49]=t,e[50]=g,e[51]=x):x=e[51],x}function ya(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 ic(t){const e=B.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 o;e[4]!==n.branch||e[5]!==n.orgSlug||e[6]!==n.virtualMcpId?(o={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch},e[4]=n.branch,e[5]=n.orgSlug,e[6]=n.virtualMcpId,e[7]=o):o=e[7];let d;e[8]!==s||e[9]!==r||e[10]!==o?(d={backend:s,cacheKey:r,scope:o},e[8]=s,e[9]=r,e[10]=o,e[11]=d):d=e[11];const l=Bn(d),i=s.source==="github";let u;e[12]!==s||e[13]!==l?(u=ya(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]!==i||e[17]!==n.branch||e[18]!==u?(h={...u,gate:c,headBranch:n.branch,hosted:i,otherWork:!1},e[16]=i,e[17]=n.branch,e[18]=u,e[19]=h):h=e[19];let p;return e[20]!==n||e[21]!==h?(p=a.jsx(Ln,{...n,source:h}),e[20]=n,e[21]=h,e[22]=p):p=e[22],p}function oc(t){const e=B.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 o=ns()?.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 i=Bn(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]!==o?(u={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,threadId:o,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]=o,e[19]=u):u=e[19];const c=ba(u),h=n.mode!=="review";let p;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]!==o?(p={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,threadId:o,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]=o,e[30]=p):p=e[30];const{gate:b}=ga(p);let f;if(e[31]!==c.allPaths||e[32]!==i){let k;e[34]!==i?(k=N=>{const C=Rn(N);return C===null?!Pn(N):!Object.hasOwn(i.changes.changes,C)},e[34]=i,e[35]=k):k=e[35],f=c.allPaths.some(k),e[31]=c.allPaths,e[32]=i,e[33]=f}else f=e[33];const m=f;let g;e[36]!==s||e[37]!==i?(g=ya(i,s),e[36]=s,e[37]=i,e[38]=g):g=e[38];let x;e[39]!==c||e[40]!==i?(x=()=>Promise.all([i.refresh(),c.refresh()]),e[39]=c,e[40]=i,e[41]=x):x=e[41];let P;e[42]!==c.status||e[43]!==n.branch?(P=Nn(c.status)??n.branch,e[42]=c.status,e[43]=n.branch,e[44]=P):P=e[44];const j=c.headSha??void 0;let y;e[45]!==c.diff?(y=c.diff?{expectedDiffSignature:kn(c.diff)}:{},e[45]=c.diff,e[46]=y):y=e[46];let S;e[47]!==b||e[48]!==m||e[49]!==j||e[50]!==y||e[51]!==g||e[52]!==x||e[53]!==P?(S={...g,refresh:x,gate:b,headBranch:P,expectedHeadSha:j,...y,hosted:!1,otherWork:m},e[47]=b,e[48]=m,e[49]=j,e[50]=y,e[51]=g,e[52]=x,e[53]=P,e[54]=S):S=e[54];let w;return e[55]!==n||e[56]!==S?(w=a.jsx(Ln,{...n,source:S}),e[55]=n,e[56]=S,e[57]=w):w=e[57],w}function Ln(t){const e=B.c(130),{source:s,publishLockRef:r,onOpenChange:n,mode:o,fastPreview:d,orgSlug:l,virtualMcpId:i,branch:u,baseBranch:c,repoTarget:h,owner:p,repo:b,draftPreviewUrl:f,destinationHost:m,previewServerUrl:g,compareDraft:x,lastPublishedPr:P,onRequestApproval:j,openPullRequest:y,onPullRequestChanged:S,onPublished:w}=t,k=o===void 0?"publish":o,N=P===void 0?null:P,C=y===void 0?null:y,v=be(),[A]=fr(),{language:T}=A,I=ns()?.taskId??null,{data:_}=zs.useSession(),$=yr(jr(l,i,u)),{allPaths:H,changedFilesTotal:O,changedFilesTruncated:G,diff:E,bodiesFailed:W,refresh:F,gate:V,hosted:te,otherWork:Y}=s;let ne;e[0]!==x||e[1]!==s.bodiesPending||e[2]!==s.cardsPending||e[3]!==s.summary?(ne={summary:s.summary,cardsPending:s.cardsPending,bodiesPending:s.bodiesPending,compareDraft:x},e[0]=x,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 X=qi(le,M),{summary:D,cardsPending:Z,bodiesPending:se,compareDraft:ie}=X.shown,[ge,ue]=q.useState(null),[re,fe]=q.useState(!1),[ye,z]=q.useState(cc);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]=q.useState(null);let ce;e[8]===Symbol.for("react.memo_cache_sentinel")?(ce=[],e[8]=ce):ce=e[8];const[J,de]=q.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),Zo)},e[9]=s.v8,e[10]=Me):Me=e[10];const mt=Me,[we,rt]=q.useState(null);let Le;e[11]!==ge||e[12]!==D?(Le=so(ge,ao(D)),e[11]=ge,e[12]=D,e[13]=Le):Le=e[13];const Re=Le,Te=[...D.pages,...D.blocks,...D.other],Ee=Te.find(U=>ke(U)===Q)??Te[0]??null,Ne=Ee?ke(Ee):null,at=[...new Set([...Ne?[Ne]:[],...J,...Te.map(ke)])].filter(U=>Te.some(ae=>ke(ae)===U)).slice(0,sc),ze=!!s.v8,[$t,Oe]=q.useState(null),Qe=ze?ec({selectedId:Ne,readyIds:ye,lastShownId:$t,liveIds:at}):Ne;ze&&Qe===Ne&&Qe!==$t&&Oe(Qe);const L=k==="review"&&!te,me=Z?"loading":se?"manifest":"ready",Pe=C?.state==="open",Se=s.headBranch,De=_?.user;let pt;e[14]!==De?(pt=Zr(De),e[14]=De,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]!==p||e[23]!==b||e[24]!==h||e[25]!==s.expectedHeadSha||e[26]!==s.headBranch||e[27]!==pt||e[28]!==bt||e[29]!==I||e[30]!==i?(lt={orgSlug:l,virtualMcpId:i,branch:u,threadId:I,fastPreview:d,baseBranch:c,target:h,owner:p,repo:b,headBranch:Se,coAuthor:pt,expectedHeadSha:s.expectedHeadSha,...bt},e[18]=c,e[19]=u,e[20]=d,e[21]=l,e[22]=p,e[23]=b,e[24]=h,e[25]=s.expectedHeadSha,e[26]=s.headBranch,e[27]=pt,e[28]=bt,e[29]=I,e[30]=i,e[31]=lt):lt=e[31];const rs=lt,gt=L?"review":"publish",as=_?.user?.name;let it;e[32]!==H||e[33]!==m||e[34]!==te||e[35]!==Re||e[36]!==n||e[37]!==w||e[38]!==S||e[39]!==r||e[40]!==F||e[41]!==s.protocol||e[42]!==gt||e[43]!==as||e[44]!==rs?(it={mode:gt,target:rs,note:Re,allPaths:H,destinationHost:m,publishLockRef:r,onOpenChange:n,refresh:F,onPullRequestChanged:S,onPublished:w,hosted:te,authorName:as,protocol:s.protocol},e[32]=H,e[33]=m,e[34]=te,e[35]=Re,e[36]=n,e[37]=w,e[38]=S,e[39]=r,e[40]=F,e[41]=s.protocol,e[42]=gt,e[43]=as,e[44]=rs,e[45]=it):it=e[45];const{isPublishing:Ce,publishError:ot,publishErrorDetail:Ft,submit:xt,discardChange:Qs,discardAll:Lt}=Ml(it),Je=kr(l,i).phase==="saving",ct=D.count>0||Y,kt=!Ce&&ct&&(L||V.allowed);let dt;e[46]!==c||e[47]!==L||e[48]!==s.v8||e[49]!==D.count||e[50]!==v?(dt=L?D.count===0?v("thread.publishPopover.submitForReview"):D.count===1?v("thread.publishPopover.submitOneForReview"):v("thread.publishPopover.submitCountForReview",{count:D.count}):Xo(D.count,c,!!s.v8,v),e[46]=c,e[47]=L,e[48]=s.v8,e[49]=D.count,e[50]=v,e[51]=dt):dt=e[51];const ls=dt;let vt;e:{if(L&&Pe){let he;e[52]!==C.number||e[53]!==v?(he=v("thread.publishPopover.updatesPullRequest",{number:C.number}),e[52]=C.number,e[53]=v,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]!==T||e[56]!==U||e[57]!==v){const he=Oa(new Date(U.mergedAt),T),je=Eo(U);ae=je?v("thread.publishPopover.lastPublishedBy",{when:he,name:je}):v("thread.publishPopover.lastPublished",{when:he}),e[55]=T,e[56]=U,e[57]=v,e[58]=ae}else ae=e[58];vt=ae}const Nt=vt;let Ct;e[59]!==L||e[60]!==D.count||e[61]!==v?(Ct=L?v("thread.publishPopover.submitForReview"):D.count===1?v("thread.publishPopover.publishOne"):D.count>1?v("thread.publishPopover.publishCount",{count:D.count}):v("thread.publishPopover.publish"),e[59]=L,e[60]=D.count,e[61]=v,e[62]=Ct):Ct=e[62];const yt=Ct,At=(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(ca,{change:he,bodyPending:se,selected:Ee!==null&&ke(Ee)===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 Ye;e:{if(L||!ct){Ye=null;break e}if(V.pending){let je;e[63]===Symbol.for("react.memo_cache_sentinel")?(je=a.jsx(Zt,{className:"size-3.5 motion-reduce:animate-none"}),e[63]=je):je=e[63];let Ae;e[64]!==v?(Ae=v("thread.publishPopover.reviewing"),e[64]=v,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],Ye=Ke;break e}if(V.allowed){Ye=null;break e}let U;e[68]===Symbol.for("react.memo_cache_sentinel")?(U=a.jsx(un,{className:"mt-0.5 size-3.5 shrink-0"}),e[68]=U):U=e[68];let ae;e[69]!==V.reason||e[70]!==v?(ae=V.reason??v("thread.publishPopover.needsReviewGeneric"),e[69]=V.reason,e[70]=v,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],Ye=he}const jt=Ye;let ut;e[74]!==Lt||e[75]!==re||e[76]!==Je||e[77]!==Ce||e[78]!==s.canDiscardAll||e[79]!==D.count||e[80]!==v?(ut=D.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:v("thread.publishPopover.discardAll")}),a.jsx(Bs,{open:re,onOpenChange:fe,children:a.jsxs(Ds,{children:[a.jsxs(Cs,{children:[a.jsx(ks,{children:v("thread.publishPopover.discardAllTitle")}),a.jsx(Ns,{children:v("thread.publishPopover.discardAllConfirm")})]}),a.jsxs(Ts,{children:[a.jsx(As,{children:v("thread.publishDialog.cancel")}),a.jsx(Rs,{onClick:()=>{Lt()},disabled:Je,className:K(vr({variant:"destructive"})),children:v("thread.publishPopover.discardAll")})]})]})})]}),e[74]=Lt,e[75]=re,e[76]=Je,e[77]=Ce,e[78]=s.canDiscardAll,e[79]=D.count,e[80]=v,e[81]=ut):ut=e[81];const Rt=ut,is=Z?a.jsx(us,{children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Dt,{}),a.jsx(Dt,{})]})}):D.count===0&&Y?a.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:v("thread.publishPopover.onlyOtherWork")}):D.count===0?a.jsxs("div",{className:"flex flex-col items-center gap-1 py-10 text-center",children:[a.jsx(wn,{className:"mb-1 size-5 text-success"}),a.jsx("p",{className:"text-sm font-medium",children:v(L?"thread.publishPopover.nothingToSubmit":"thread.publishPopover.everythingLive")}),a.jsx("p",{className:"text-xs text-muted-foreground",children:v(L?"thread.publishPopover.submitEmptyHint":"thread.publishPopover.emptyHint")})]}):a.jsxs(us,{children:[G?a.jsx("p",{className:"text-2xs text-muted-foreground",children:v("thread.publishPopover.showingFirst",{shown:D.count,total:O})}):null,At(v("thread.publishPopover.pagesGroup"),D.pages),At(v("thread.publishPopover.blocksGroup"),D.blocks),At(v("thread.publishPopover.otherGroup"),D.other),W?a.jsx("p",{className:"text-2xs text-muted-foreground",children:v("thread.publishPopover.detailsUnavailable")}):null,Y?a.jsx("p",{className:"text-2xs text-muted-foreground",children:v("thread.publishPopover.alsoOtherWork")}):null]}),os=Z?a.jsx(In,{}):Ee?a.jsx("div",{className:K(ts,"relative"),children:Te.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(pa,{change:U,diff:E,bodyPending:se,previewServerUrl:g,draft:ie,lastPage:$,v8:s.v8,onReady:ze?()=>xe(ke(U)):void 0})},ke(U)))}):a.jsx("div",{className:K(ts,"bg-muted/40")});let Be;e[82]!==ls?(Be=a.jsx("span",{className:"truncate",children:ls}),e[82]=ls,e[83]=Be):Be=e[83];let Ie;e[84]!==Rt||e[85]!==k||e[86]!==Nt||e[87]!==Be?(Ie=a.jsx($n,{mode:k,title:Be,subLine:Nt,trailing:Rt}),e[84]=Rt,e[85]=k,e[86]=Nt,e[87]=Be,e[88]=Ie):Ie=e[88];let Xe;e[89]!==Ce||e[90]!==L||e[91]!==Re||e[92]!==D.count||e[93]!==v?(Xe=D.count===0?null:a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-sm font-medium",children:v(L?"thread.publishPopover.reviewNote":"thread.publishPopover.versionNote")}),a.jsx($l,{value:Re,onChange:U=>ue(U.target.value),placeholder:v(L?"thread.publishPopover.reviewNotePlaceholder":"thread.publishPopover.versionNotePlaceholder"),rows:2,maxLength:El,className:"resize-none text-sm",disabled:Ce})]}),e[89]=Ce,e[90]=L,e[91]=Re,e[92]=D.count,e[93]=v,e[94]=Xe):Xe=e[94];let Ue;e[95]!==f||e[96]!==v?(Ue=a.jsx(Fn,{draftPreviewUrl:f,t:v}),e[95]=f,e[96]=v,e[97]=Ue):Ue=e[97];let wt;e[98]!==kt||e[99]!==V||e[100]!==ct||e[101]!==te||e[102]!==Ce||e[103]!==L||e[104]!==j||e[105]!==yt||e[106]!==X||e[107]!==xt||e[108]!==v?(wt=!L&&!te&&ct&&!V.allowed&&!V.pending?a.jsx(ve,{type:"button",className:"flex-1",onClick:j,disabled:Ce,children:v("thread.publishPopover.requestApproval")}):a.jsxs(ve,{type:"button",variant:L?"default":"brand",className:"flex-1",onClick:()=>{X.hold(),xt().then(U=>{U===!1&&X.release()})},disabled:!kt,children:[Ce?a.jsx(Zt,{className:"size-4 motion-reduce:animate-none"}):null,Ce?v(L?"thread.publishPopover.submitting":"thread.publishPopover.publishing"):yt]}),e[98]=kt,e[99]=V,e[100]=ct,e[101]=te,e[102]=Ce,e[103]=L,e[104]=j,e[105]=yt,e[106]=X,e[107]=xt,e[108]=v,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 qe;e[113]!==ot||e[114]!==Ft||e[115]!==v?(qe=ot?a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-destructive",children:ot}),Ft?a.jsx(Qa,{label:v("siteEditor.details"),detail:Ft}):null]}):null,e[113]=ot,e[114]=Ft,e[115]=v,e[116]=qe):qe=e[116];let $e;e[117]!==Ze||e[118]!==qe?($e=a.jsxs(a.Fragment,{children:[Ze,qe]}),e[117]=Ze,e[118]=qe,e[119]=$e):$e=e[119];let Fe;e[120]!==is||e[121]!==jt||e[122]!==me||e[123]!==Ie||e[124]!==Xe||e[125]!==$e?(Fe=a.jsx(Gs,{state:me,header:Ie,body:is,note:Xe,gate:jt,footer:$e}),e[120]=is,e[121]=jt,e[122]=me,e[123]=Ie,e[124]=Xe,e[125]=$e,e[126]=Fe):Fe=e[126];let He;return e[127]!==os||e[128]!==Fe?(He=a.jsx(ms,{pane:os,list:Fe}),e[127]=os,e[128]=Fe,e[129]=He):He=e[129],He}function cc(){return new Set}function dc(t){if(!(t==="claiming"||t==="ready"||t==="failed"))return ii[t].short}const uc=new Set(["failure","timed_out","cancelled","action_required"]);function ja(t){return t.status==="completed"&&uc.has(t.conclusion)}function On(t){return t.status==="queued"||t.status==="in_progress"}function Ss(t){return t.isPending&&t.fetchStatus!=="idle"}function hc(t){return{key:"view-change-request",label:t("thread.cmsActions.viewOnProvider"),action:"open-pr-page"}}function ht(t,e,s){return e?[...t,hc(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 er(t){return{key:"submit-for-review",label:t("thread.headerActions.submitForReview"),action:"create-pr"}}function js(t,e,s){if(e.filter(On).length===0)return t;const n=e.filter(o=>o.status==="completed").length;return{...t,tooltip:s("thread.cmsActions.checksRunning",{done:n,total:e.length})}}function fc(t){const{lifecycle:e,branch:s,pr:r,checks:n,reviews:o,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&&dc(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 i=s,u=i.unpushed>0&&!(r&&i.headSha&&r.headSha&&i.headSha===r.headSha);if(t.noReviewableDiff&&!r)return{label:l("thread.headerActions.upToDate"),disabled:!0,variant:"outline",tooltip:l("thread.headerActions.branchInSyncTooltip",{base:i.base}),menu:Ge([],i,l)};if(i.workingTreeDirty||u)return{label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:Ge(ht([er(l)],r,l),i,l)};if(Yr("no local work — checking PR/sync state",{workingTreeDirty:i.workingTreeDirty,unpushed:i.unpushed,aheadOfBase:i.aheadOfBase,behindBase:i.behindBase,branch:i.branch,base:i.base,prMerged:r?.merged??null,prState:r?.state??null}),r?.merged)return!!i.headSha&&!!r.headSha&&i.headSha!==r.headSha?{label:l("thread.headerActions.continue"),action:"create-pr",variant:"special",tooltip:l("thread.headerActions.openNewPrTooltip"),menu:Ge(ht([],r,l),i,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),i,l)};if(i.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),i,l)};if(!r)return{label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:Ge([er(l)],i,l)};if((o?.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(On).length,p=n.filter(ja).map(f=>f.name);if(h===0&&p.length>0)return{label:l("thread.headerActions.fixChecks"),action:"fix-checks",variant:"default",tooltip:l("thread.headerActions.failingChecksTooltip",{checks:p.join(", ")}),meta:{failingChecks:p},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),i,l)};if(o?.draft)return js({label:l("thread.headerActions.markReady"),action:"mark-ready",variant:"default",tooltip:l("thread.headerActions.markDraftReadyTooltip"),menu:Ge(ht([],r,l),i,l)},n,l);const b=o?.unresolvedConversations??0;return b>0?js({label:l("thread.headerActions.addressFeedback"),action:"resolve-comments",variant:"default",tooltip:l("thread.headerActions.unresolvedConversationsTooltip",{count:String(b)}),menu:Ge(ht([],r,l),i,l)},n,l):o?.missingRequiredApprovals?js({label:l("thread.cmsActions.waitingForReview"),action:"open-pr-page",variant:"outline",tooltip:l("thread.headerActions.waitingForApprovalsTooltip"),menu:Ge(ht([],r,l),i,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),i,l)},n,l)}return i.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:i.base}),menu:[]}}function tr(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 sr(t,e,s,r){const n=e.length;if(n===0)return t;if(e.filter(On).length>0){const l=e.filter(u=>u.status==="completed").length,i=r("thread.cmsActions.checksRunning",{done:l,total:n});return s==="loading"?{...t,loading:!0,tooltip:i}:{...t,tooltip:i}}const d=e.filter(ja).length;return d>0?{...t,variant:"warning",tooltip:r("thread.cmsActions.checksFailing",{failed:d,total:n})}:t}function mc(t,e){return!!(t?.merged&&t.headSha&&e.kind==="ready"&&!e.workingTreeDirty&&e.headSha===t.headSha)}function pc(t){return Ss(t.prQuery)?!0:t.pr?.state!=="open"||t.pr.merged?!1:Ss(t.checksQuery)||Ss(t.reviewsQuery)}function bc(t,e){return t.workingTreeDirty?!0:e!==null?e>0:t.aheadOfBase>0}function gc(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 xc(t){return{...t,menu:[]}}function vc(t){const{branch:e,pr:s,checks:r,reviews:n,publishing:o,saving:d,loading:l,publishableChangeCount:i,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(o)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?sr({label:u("thread.cmsActions.waitingForReview"),action:"open-pr",variant:"outline",menu:ws([tr(u)],e,u)},r,"loading",u):sr({label:u("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:ws([tr(u)],e,u)},r,"none",u)}return mc(s,e)?{label:u("thread.headerActions.upToDate"),variant:"outline",disabled:!0,menu:ws([],e,u)}:bc(e,i)?{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 yc(t){return t.conflicting===!0?"dirty":t.conflicting===null?"unknown":t.reviewBlocked||t.unresolvedConversations>0?"blocked":"clean"}function wa(t){const e=B.c(4);let s;e[0]!==t?(s=vl(t),e[0]=t,e[1]=s):s=e[1];let r;return e[2]!==s?(r={...s,select:jc},e[2]=s,e[3]=r):r=e[3],ft(r)}function jc(t){const e=t.changeRequest;return e?{draft:e.draft,mergeableState:yc(e),unresolvedConversations:e.unresolvedConversations,missingRequiredApprovals:e.reviewBlocked}:null}function nr(t,e){return t==="open-pr"||e==="resolve-on-provider"?a.jsx(Kr,{size:16}):t==="publish"?a.jsx($r,{className:"size-4"}):t==="get-latest"||t==="retry-status"?a.jsx(hn,{className:"size-4"}):a.jsx(qs,{className:"size-4"})}function wc(t){const e=B.c(63),{virtualMcpId:s}=t,r=be(),{org:n}=hs(),o=hr(),d=Ks(s),{data:l}=zs.useSession(),{deleteRelease:i}=Vs(s),{currentBranch:u,setCurrentTaskBranch:c,taskId:h,createTask:p}=wr();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={open:!1,mode:"publish"},e[0]=b):b=e[0];const[f,m]=q.useState(b);let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=L=>m({open:!0,mode:L}),e[1]=g):g=e[1];const x=g,P=Er(d),j=P.status==="attached"||P.status==="public-clone"?P.repo:null,{previewServerUrl:y}=fs(s),S=u?yr(jr(n.slug,s,u)):null,w=S?jn(S.path,S.params):"/",k=kl(u?{orgSlug:n.slug,virtualMcpId:s,branch:u,previewServerUrl:y,path:w}: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=Nl(N),v=Bt(s,u),A=v.kind==="protocol"&&v.source==="github";let T;e[6]!==u||e[7]!==n.slug||e[8]!==s?(T=u?{orgSlug:n.slug,virtualMcpId:s,branch:u}:null,e[6]=u,e[7]=n.slug,e[8]=s,e[9]=T):T=e[9];const I=bn(T),_=Nr(A?v:null,I);let $;e[10]!==n.slug||e[11]!==s?($=Ja(n.slug,s),e[10]=n.slug,e[11]=s,e[12]=$):$=e[12];const H=Ya($,A?C:null),O=A?Xa(y,w,H):k.url,G=u??"",E=h??null;let W;e[13]!==n.slug||e[14]!==G||e[15]!==E||e[16]!==s?(W=Sn({orgSlug:n.slug,virtualMcpId:s,branch:G,threadId:E}),e[13]=n.slug,e[14]=G,e[15]=E,e[16]=s,e[17]=W):W=e[17];const F=!!u&&v.kind!=="pending"&&!A;let V;e[18]!==W||e[19]!==F?(V={...W,enabled:F},e[18]=W,e[19]=F,e[20]=V):V=e[20];const te=ft(V),Y=A?null:te.data??null,ne=A?gc(_.data,u??""):null,le=ne?ne.branchMeta:Y?{kind:"ready",branch:Nn(Y)??u??"",base:Y.base??"main",workingTreeDirty:ti(Y),unpushed:Y.unpushed??0,aheadOfBase:Y.aheadOfBase??0,behindBase:Y.behindBase??0,headSha:Y.headSha??""}:{kind:"unknown"},M=ne?ne.publishableChangeCount:Y?.changedFiles?la({files:Y.changedFiles}).count:null,X=A?_:te,D=(le.kind==="ready"?le.branch:null)??u??null,Z=le.kind==="ready"?le.base:"main",se=zr({orgId:n.id,orgSlug:n.slug,target:_e(j),owner:j?.owner??"",repo:j?.name??"",branch:D}),ie=se.data??null,ge=Ur({orgId:n.id,orgSlug:n.slug,target:_e(j),owner:j?.owner??"",repo:j?.name??"",base:Z}),ue=qr({orgId:n.id,orgSlug:n.slug,target:_e(j),owner:j?.owner??"",repo:j?.name??"",branch:D}),re=wa({orgId:n.id,orgSlug:n.slug,target:_e(j),owner:j?.owner??"",repo:j?.name??"",branch:D});let fe;e[21]!==ue||e[22]!==ie||e[23]!==se||e[24]!==re?(fe=pc({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=Mn({mutationFn:()=>zi({hosted:A,branch:u,baseBranch:Z,nextBranch:()=>gn(xn(l?.user)),setCurrentTaskBranch:c,deleteRelease:i}),onError:kc});let Q;e[28]!==n.slug||e[29]!==h||e[30]!==s?(Q=async L=>(await si({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]!==o||e[35]!==r||e[36]!==h||e[37]!==s?(ee=async L=>{et.success(r("thread.headerActions.syncedWithBase",{base:L.base})),await Promise.all([o.invalidateQueries({queryKey:Cn({orgSlug:n.slug,virtualMcpId:s,branch:u??L.branch,threadId:h??null})}),o.invalidateQueries({queryKey:ss.decofile(`${n.slug}/${s}/${L.branch}`)})])},e[32]=u,e[33]=n.slug,e[34]=o,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:Sc},e[39]=Q,e[40]=ee,e[41]=ce):ce=e[41];const J=Mn(ce),de=Cr(n.slug,s),Me=xe.isPending,mt=vc({branch:le,pr:ie,checks:ue.data??[],reviews:re.data??null,publishing:Me,saving:de,syncing:J.isPending,statusRetrying:X.isFetching&&!!X.error,statusError:X.error instanceof Error?X.error.message:X.error?String(X.error):null,loading:!!ye,publishableChangeCount:M,t:r}),we=A?xc(mt):mt,rt=we.autoRun&&le.kind==="ready"&&j&&y?`${D}@${le.headSha}`:null,Le=q.useRef(null);if(q.useEffect(()=>{!rt||!D||Le.current!==rt&&(Le.current=rt,J.mutate({branch:D,base:Z}))},[rt,D,Z,J]),P.status==="detached"){let L;e[42]!==r?(L=r("thread.headerActions.reconnectGithub"),e[42]=r,e[43]=L):L=e[43];let me;e[44]!==L?(me=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]=me):me=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 De;return e[50]!==me||e[51]!==Se?(De=a.jsx(Us,{children:a.jsxs(tt,{children:[me,Se]})}),e[50]=me,e[51]=Se,e[52]=De):De=e[52],De}if(!d)return null;if(!j||!y){const L=j?"noPreviewServer":"noRepo";let me;e[53]!==u||e[54]!==p?(me=u?()=>{const Se=p?.({runtime:"sandbox",branch:u});Se&&_a("coding_session_started",{thread_id:Se})}:void 0,e[53]=u,e[54]=p,e[55]=me):me=e[55];let Pe;return e[56]!==L||e[57]!==me?(Pe=a.jsx(Nc,{reason:L,onStartCodingSession:me}),e[56]=L,e[57]=me,e[58]=Pe):Pe=e[58],Pe}if(!u)return null;const Re=L=>{switch(L){case"publish":{x("publish");return}case"request-approval":{x("review");return}case"get-latest":{if(!D||J.isPending)return;J.mutate({branch:D,base:Z});return}case"retry-status":{X.refetch();return}case"open-pr":{ie?.htmlUrl&&window.open(ie.htmlUrl,"_blank","noopener,noreferrer");return}}};let Te;e[59]!==Re?(Te=L=>({key:L.key,label:L.label,icon:nr(L.action,L.key),...L.tooltip?{tooltip:L.tooltip}:{},onSelect:()=>Re(L.action)}),e[59]=Re,e[60]=Te):Te=e[60];const Ee=we.menu.map(Te),Ne=we.action,at=we.label,ze=we.variant,$t=!!we.loading;let Oe;e[61]!==r?(Oe=r("thread.cmsActions.moreActionsAriaLabel"),e[61]=r,e[62]=Oe):Oe=e[62];const Qe=a.jsx(Xr,{size:"sm",label:at,variant:ze,disabled:!!we.disabled||!Ne,loading:$t,...Ne&&!we.loading?{icon:nr(Ne)}:{},...we.tooltip?{tooltip:we.tooltip}:{},items:Ee,menuAriaLabel:Oe,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(xa,{open:f.open,mode:f.mode,fastPreview:!0,onOpenChange:L=>{L||m(Pc)},orgSlug:n.slug,virtualMcpId:s,branch:u,baseBranch:Z,repoTarget:_e(j),owner:j.owner,repo:j.name,publishPolicy:Qr(d?.metadata?.publishPolicy),draftPreviewUrl:O,destinationHost:k.host,previewServerUrl:y,compareDraft:C?{kind:"pointer",pointer:C,...H?{link:H}:{}}:null,lastPublishedPr:ge.data??null,onRequestApproval:()=>x("review"),openPullRequest:ie?.state==="open"?ie:null,onPullRequestChanged:oe,onPublished:()=>xe.mutateAsync()}):null]})}function Pc(t){return{...t,open:!1}}function Sc(t){et.error(t instanceof Error?t.message:String(t))}function kc(t){console.error("site editor: settling after publish failed",t)}function Nc(t){const e=B.c(14),{reason:s,onStartCodingSession:r}=t,n=be(),o=!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]!==o||e[4]!==d?(l=a.jsx(st,{asChild:!0,children:a.jsx("span",{children:a.jsx(ve,{size:"sm",variant:"outline",disabled:o,onClick:r,children:d})})}),e[2]=r,e[3]=o,e[4]=d,e[5]=l):l=e[5];let i;e[6]!==s||e[7]!==n?(i=n(s==="noPreviewServer"?"sandbox.cmsUnavailable.noPreviewServer":"sandbox.cmsUnavailable.noRepo"),e[6]=s,e[7]=n,e[8]=i):i=e[8];let u;e[9]!==i?(u=a.jsx(nt,{children:i}),e[9]=i,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 It="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 Cc(t){return`Reopen PR #${t.prNumber}. ${It}`}function Ac(t){return`Rebase \`${t.branch}\` on the latest base and force-push with --force-with-lease. ${It}`}function Rc(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). ${It}`}function Tc(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. ${It}`}function Dc(t){return`Mark PR #${t.prNumber} ready for review. ${It}`}function Bc(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. ${It}`}function Ic(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. ${It}`}function rr(t){switch(t){case"publish":return a.jsx($r,{className:"size-4"});case"create-pr":case"reopen":return a.jsx(qs,{className:"size-4"});case"rebase":case"sync":return a.jsx(hn,{className:"size-4"});case"fix-checks":return a.jsx(un,{className:"size-4"});case"mark-ready":return a.jsx(wn,{className:"size-4"});case"resolve-comments":return a.jsx(ul,{className:"size-4"});case"merge":return a.jsx(Vl,{className:"size-4"});case"review":return a.jsx(Is,{className:"size-4"});case"open-pr-page":return a.jsx(Kr,{size:16})}}const ar=new Set(["reopen","rebase","fix-checks","mark-ready","resolve-comments","review","sync"]),lr=new Set(["publish","create-pr"]);function $c(t){const e=B.c(44),{t:s,button:r,actionBusy:n,changeRequestPending:o,savePending:d,onAction:l}=t,i=r.action;let u;e[0]!==i||e[1]!==n?(u=n&&i!==void 0&&ar.has(i),e[0]=i,e[1]=n,e[2]=u):u=e[2];const c=u,h=o&&i==="merge";let p;e[3]!==i||e[4]!==d?(p=d&&i!==void 0&&lr.has(i),e[3]=i,e[4]=d,e[5]=p):p=e[5];const b=p,f=!!r.disabled||c||h||b||!i,m=!!r.loading||h;let g;e[6]!==r.tooltip||e[7]!==c||e[8]!==b||e[9]!==s?(g=c?s("thread.headerActions.chatIsRunning"):b?s("thread.headerActions.saving"):r.tooltip,e[6]=r.tooltip,e[7]=c,e[8]=b,e[9]=s,e[10]=g):g=e[10];const x=g;let P;if(e[11]!==n||e[12]!==r.menu||e[13]!==o||e[14]!==l||e[15]!==d||e[16]!==s){let A;e[18]!==n||e[19]!==o||e[20]!==l||e[21]!==d||e[22]!==s?(A=T=>{const I=n&&ar.has(T.action),_=d&&lr.has(T.action),$=T.action==="merge"&&o,H=_?s("thread.headerActions.saving"):I?s("thread.headerActions.chatIsRunning"):T.tooltip;return{key:T.key,label:T.label,icon:rr(T.action),disabled:!!(I||_||$),...H?{tooltip:H}:{},onSelect:()=>l(T.action)}},e[18]=n,e[19]=o,e[20]=l,e[21]=d,e[22]=s,e[23]=A):A=e[23],P=r.menu.map(A),e[11]=n,e[12]=r.menu,e[13]=o,e[14]=l,e[15]=d,e[16]=s,e[17]=P}else P=e[17];const j=P,y=r.label,S=r.variant;let w;e[24]!==i||e[25]!==m?(w=i&&!m?{icon:rr(i)}:{},e[24]=i,e[25]=m,e[26]=w):w=e[26];let k;e[27]!==x?(k=x?{tooltip:x}:{},e[27]=x,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]!==i||e[32]!==l?(C=i?()=>l(i):void 0,e[31]=i,e[32]=l,e[33]=C):C=e[33];let v;return e[34]!==r.label||e[35]!==r.variant||e[36]!==f||e[37]!==j||e[38]!==m||e[39]!==w||e[40]!==k||e[41]!==N||e[42]!==C?(v=a.jsx(Xr,{size:"sm",label:y,variant:S,disabled:f,loading:m,...w,...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]=w,e[40]=k,e[41]=N,e[42]=C,e[43]=v):v=e[43],v}function ir(t){const e=B.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 o;e[4]!==s?(o=a.jsx(nt,{children:s}),e[4]=s,e[5]=o):o=e[5];let d;return e[6]!==n||e[7]!==o?(d=a.jsx(Us,{children:a.jsxs(tt,{children:[n,o]})}),e[6]=n,e[7]=o,e[8]=d):d=e[8],d}function Fc(t){return{label:t("thread.headerActions.loadingBranch"),disabled:!0,loading:!0,variant:"outline",tooltip:t("thread.headerActions.waitingForSandboxBranchTooltip"),menu:[]}}function Lc({virtualMcpId:t}){const e=be(),{org:s}=hs(),{data:r}=zs.useSession(),n=Ks(t),{deleteRelease:o}=Vs(t),{currentBranch:d,setCurrentTaskBranch:l,createTask:i,taskId:u}=wr(),c=Ua(),{openSidePanel:h}=tl(),[p,b]=q.useState({open:!1,mode:"publish",policyOverride:null}),f=oi({connectionId:Ma,orgId:s.id,orgSlug:s.slug}),m=di(f),[g,x]=q.useState(!1),P=q.useRef(""),j=Er(n),y=j.status==="attached"||j.status==="public-clone"?j.repo:null,{lifecycle:S,branch:w,phase:k}=ci(),N={orgSlug:s.slug,virtualMcpId:t,branch:d??"",threadId:u??null},v=ft({queryKey:Cn(N),queryFn:()=>Wr(N),enabled:!!d,staleTime:15e3,refetchInterval:Q=>Ys(Q.state.data)?5e3:!1}).data??null,A=w,T=S,I=A.kind==="ready"?A.branch:null,_=d??I??void 0,$=(A.kind==="ready"?A.branch:null)??_??null,H=zr({orgId:s.id,orgSlug:s.slug,target:_e(y),owner:y?.owner??"",repo:y?.name??"",branch:$}),O=H.data??null,G=qr({orgId:s.id,orgSlug:s.slug,target:_e(y),owner:y?.owner??"",repo:y?.name??"",branch:$}),E=wa({orgId:s.id,orgSlug:s.slug,target:_e(y),owner:y?.owner??"",repo:y?.name??"",branch:$}),W=Ur({orgId:s.id,orgSlug:s.slug,target:_e(y),owner:y?.owner??"",repo:y?.name??"",base:A.kind==="ready"?A.base:null}),F=A,V=Qr(n?.metadata?.publishPolicy),te=Cr(s.slug,t),{previewUrl:Y}=ui(),{previewServerUrl:ne,projectDefault:le}=fs(t);if(j.status==="detached")return a.jsx(ir,{label:e("thread.headerActions.githubConnectionRemoved"),children:a.jsx(ve,{size:"sm",variant:"outline",disabled:!0,children:e("thread.headerActions.reconnectGithub")})});if(!y)return null;const M=$?fc({lifecycle:T,branch:F,claimPhase:k,pr:O,checks:G.data??[],reviews:E.data??null,noReviewableDiff:Ys(v),loading:Ss(H),t:e}):Fc(e),X=JSON.stringify({label:M.label,branchKind:F.kind,workingTreeDirty:F.kind==="ready"?F.workingTreeDirty:null,unpushed:F.kind==="ready"?F.unpushed:null,aheadOfBase:F.kind==="ready"?F.aheadOfBase:null,lifecycle:T.phase,headBranch:$,noReviewableDiff:Ys(v)});P.current!==X&&(P.current=X,Yr("header button",{label:M.label,tooltip:M.tooltip,action:M.action,chatBranch:d,sandboxBranch:I,sandboxRouteBranch:_,headBranch:$,branchMeta:A,effectiveBranchMeta:F,lifecyclePhase:T.phase,prNumber:O?.number??null,prState:O?.state??null}));const D=Q=>(h(),c.sendMessage({parts:[{type:"text",text:Q}]})),Z=c.isStreaming,se=F.kind==="ready"?F.base:"main",ie=async()=>{await H.refetch()},ge=async()=>{const Q=d,ee=gn(xn(r?.user));le==="cms"?i({runtime:"cms",branch:ee}):await l(ee),Q&&Q!==se&&await o(Q)},ue=async Q=>{if(!(!y||g)){x(!0);try{const ee=Zr(r?.user);await zl(s.slug,_e(y),{number:Q,coAuthor:ee}),et.success(e("thread.headerActions.publishedPr",{prNumber:String(Q)})),await ie(),await ge()}catch(ee){et.error(ee instanceof Ul?ee.detail??ql(ee.reason,e):ee instanceof Error?ee.message:e("thread.headerActions.failedToMergePullRequest"))}finally{x(!1)}}},re=(Q,ee)=>b({open:!0,mode:Q,policyOverride:ee}),fe=Q=>{if($)switch(Q){case"publish":re("publish",M.meta?.publishPolicyOverride??null);return;case"create-pr":re("review",null);return;case"merge":O&&ue(O.number);return;case"sync":if(Z)return;D(Rc({branch:$,base:se}));return;case"open-pr-page":O?.htmlUrl&&window.open(O.htmlUrl,"_blank","noopener,noreferrer");return;case"review":if(Z)return;O&&D(Ic({prNumber:O.number}));return;case"reopen":if(Z)return;O&&D(Cc({prNumber:O.number}));return;case"rebase":if(Z)return;D(Ac({branch:$}));return;case"fix-checks":if(Z)return;O&&D(Tc({prNumber:O.number,failingChecks:M.meta?.failingChecks??[]}));return;case"mark-ready":if(Z)return;O&&D(Dc({prNumber:O.number}));return;case"resolve-comments":if(Z)return;O&&D(Bc({prNumber:O.number}));return}},ye=g||Z,z=a.jsx($c,{t:e,button:M,actionBusy:ye,changeRequestPending:g,savePending:te,onAction:fe}),oe=F.kind==="ready"&&F.pushError&&F.pushFailingSince?e("thread.headerActions.pushFailing",{since:new Date(F.pushFailingSince).toLocaleString(),error:F.pushError}):null,xe=oe?a.jsx(ir,{label:oe,children:a.jsx(un,{role:"img","aria-label":oe,className:"size-4 text-warning"})}):null;return _?a.jsxs(a.Fragment,{children:[xe,z,a.jsx(xa,{open:p.open,mode:p.mode,fastPreview:!1,recoverSandbox:()=>m.mutateAsync({virtualMcpId:t,branch:_,...u?{threadId:u}:{}}),onOpenChange:Q=>{Q||b(ee=>({...ee,open:!1}))},orgSlug:s.slug,virtualMcpId:t,branch:_,baseBranch:se,repoTarget:_e(y),owner:y.owner,repo:y.name,publishPolicy:p.policyOverride??V,draftPreviewUrl:Y,destinationHost:null,previewServerUrl:ne,compareDraft:Y?{kind:"sandbox",previewUrl:Y}:null,lastPublishedPr:W.data??null,onRequestApproval:()=>b(Q=>({...Q,open:!0,mode:"review"})),openPullRequest:O?.state==="open"?O:null,onPullRequestChanged:ie,onPublished:ge})]}):a.jsxs(a.Fragment,{children:[xe,z]})}function Oc(t){const e=B.c(33),{orgSlug:s,virtualMcpId:r,branch:n}=t,o=be(),[d,l]=q.useState(!1),i=Bt(r,n),u=i.kind==="protocol"&&i.source==="local"?i: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=bn(c),{data:p}=Nr(u,h);if(!u||!h||!n)return null;let b;e[4]!==p?(b=p?Object.keys(p.changes).length:0,e[4]=p,e[5]=b):b=e[5];const f=b;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=()=>l(!0),e[6]=m):m=e[6];let g;e[7]!==f||e[8]!==o?(g=f>0?o("decoServe.changes.buttonCount",{count:f}):o("decoServe.changes.button"),e[7]=f,e[8]=o,e[9]=g):g=e[9];let x;e[10]!==g?(x=a.jsx(ve,{size:"sm",variant:"outline","data-testid":"local-changes-button",onClick:m,children:g}),e[10]=g,e[11]=x):x=e[11];let P;e[12]!==o?(P=o("decoServe.changes.title"),e[12]=o,e[13]=P):P=e[13];let j;e[14]!==P?(j=a.jsx(pr,{className:"sr-only",children:P}),e[14]=P,e[15]=j):j=e[15];let y;e[16]!==n||e[17]!==h||e[18]!==u||e[19]!==d||e[20]!==s||e[21]!==o||e[22]!==r?(y=d?a.jsx(gr,{children:N=>{const{reset:C}=N;return a.jsx(xr,{fallback:v=>{const{resetError:A}=v;return a.jsx(on,{title:o("decoServe.changes.title"),body:a.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:o("decoServe.changes.loadFailed")}),onClose:()=>{C(),A(),l(!1)}})},children:a.jsx(q.Suspense,{fallback:a.jsx(ms,{pane:a.jsx(In,{}),list:a.jsx(on,{title:o("decoServe.changes.title"),loading:!0,body:a.jsx(us,{children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Dt,{}),a.jsx(Dt,{})]})}),onClose:()=>l(!1)})}),children:a.jsx(_c,{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]=o,e[22]=r,e[23]=y):y=e[23];let S;e[24]!==j||e[25]!==y?(S=a.jsxs(br,{"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,y]}),e[24]=j,e[25]=y,e[26]=S):S=e[26];let w;e[27]!==d||e[28]!==S?(w=a.jsx(mr,{open:d,onOpenChange:l,children:S}),e[27]=d,e[28]=S,e[29]=w):w=e[29];let k;return e[30]!==w||e[31]!==x?(k=a.jsxs(a.Fragment,{children:[x,w]}),e[30]=w,e[31]=x,e[32]=k):k=e[32],k}function on(t){const e=B.c(22),{title:s,trailing:r,body:n,loading:o,onClose:d}=t,l=o===void 0?!1:o,i=be(),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 p;e[5]!==i?(p=i("decoServe.changes.hint"),e[5]=i,e[6]=p):p=e[6];let b;e[7]!==p?(b=a.jsx("p",{className:"text-2xs text-muted-foreground",children:a.jsx(Jr,{text:p})}),e[7]=p,e[8]=b):b=e[8];let f;e[9]!==i?(f=i("decoServe.changes.close"),e[9]=i,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 g;e[14]!==b||e[15]!==m?(g=a.jsxs(a.Fragment,{children:[b,m]}),e[14]=b,e[15]=m,e[16]=g):g=e[16];let x;return e[17]!==n||e[18]!==u||e[19]!==h||e[20]!==g?(x=a.jsx(Gs,{state:u,header:h,body:n,footer:g}),e[17]=n,e[18]=u,e[19]=h,e[20]=g,e[21]=x):x=e[21],x}function _c(t){const e=B.c(54),{orgSlug:s,virtualMcpId:r,branch:n,backend:o,cacheKey:d,onClose:l}=t,i=be();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]!==o||e[5]!==d||e[6]!==u?(c={backend:o,cacheKey:d,scope:u},e[4]=o,e[5]=d,e[6]=u,e[7]=c):c=e[7];const h=Bn(c);let p;e[8]!==n||e[9]!==s||e[10]!==h.refresh||e[11]!==r?(p={orgSlug:s,virtualMcpId:r,branch:n,refresh:h.refresh},e[8]=n,e[9]=s,e[10]=h.refresh,e[11]=r,e[12]=p):p=e[12];const b=Hl(p),f=kr(s,r).phase==="saving",m=o.describe.readOnly,[g,x]=q.useState(null),[P,j]=q.useState(null),[y,S]=q.useState(!1),{summary:w}=h;let k,N,C,v,A;if(e[13]!==g||e[14]!==o||e[15]!==P||e[16]!==b||e[17]!==y||e[18]!==f||e[19]!==m||e[20]!==h.blocks||e[21]!==h.entries||e[22]!==h.sidesFailed||e[23]!==h.sidesPending||e[24]!==w.blocks||e[25]!==w.count||e[26]!==w.pages||e[27]!==i){const _=[...w.pages,...w.blocks],$=_.find(E=>ke(E)===g)??_[0]??null;let H;e[33]!==w.count||e[34]!==i?(H=w.count===0?i("decoServe.changes.title"):w.count===1?i("decoServe.changes.titleOne"):i("decoServe.changes.titleCount",{count:w.count}),e[33]=w.count,e[34]=i,e[35]=H):H=e[35],A=H;const O=(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:E}),W.map(F=>{const V=ke(F);return a.jsx(ca,{change:F,bodyPending:h.sidesPending,v8:!0,selected:$!==null&&ke($)===V,onSelect:()=>x(V),confirming:P===V,onConfirmingChange:te=>j(te?V:null),onDiscard:m||!F.entry?void 0:()=>{b(o,[F.entry],i("thread.publishPopover.discarded",{name:F.name}))},isPublishing:!1,isDiscarding:f},V)})]});let G;e[36]!==o||e[37]!==b||e[38]!==y||e[39]!==f||e[40]!==m||e[41]!==h.entries||e[42]!==w.count||e[43]!==i?(G=m||w.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:()=>S(!0),disabled:f,children:i("thread.publishPopover.discardAll")}),a.jsx(Bs,{open:y,onOpenChange:S,children:a.jsxs(Ds,{children:[a.jsxs(Cs,{children:[a.jsx(ks,{children:i("thread.publishPopover.discardAllTitle")}),a.jsx(Ns,{children:i("thread.publishPopover.discardAllConfirm")})]}),a.jsxs(Ts,{children:[a.jsx(As,{children:i("thread.publishDialog.cancel")}),a.jsx(Rs,{onClick:()=>{b(o,h.entries,i("thread.publishDialog.allChangesDiscarded"))},disabled:f,className:K(vr({variant:"destructive"})),children:i("thread.publishPopover.discardAll")})]})]})})]}),e[36]=o,e[37]=b,e[38]=y,e[39]=f,e[40]=m,e[41]=h.entries,e[42]=w.count,e[43]=i,e[44]=G):G=e[44],C=G,N=w.count===0?a.jsxs("div",{className:"flex flex-col items-center gap-1 py-10 text-center",children:[a.jsx(wn,{className:"mb-1 size-5 text-success"}),a.jsx("p",{className:"text-sm font-medium",children:i("decoServe.changes.empty")})]}):a.jsxs(us,{children:[O(i("thread.publishPopover.pagesGroup"),w.pages),O(i("thread.publishPopover.blocksGroup"),w.blocks),h.sidesFailed?a.jsx("p",{className:"text-2xs text-muted-foreground",children:i("thread.publishPopover.detailsUnavailable")}):null]}),k=ms,v=$?a.jsx("div",{className:K(ts,"relative flex"),children:a.jsx(pa,{change:$,diff:null,bodyPending:h.sidesPending,previewServerUrl:null,draft:null,lastPage:null,v8:{blocks:h.blocks}},ke($))}):a.jsx("div",{className:K(ts,"bg-muted/40")}),e[13]=g,e[14]=o,e[15]=P,e[16]=b,e[17]=y,e[18]=f,e[19]=m,e[20]=h.blocks,e[21]=h.entries,e[22]=h.sidesFailed,e[23]=h.sidesPending,e[24]=w.blocks,e[25]=w.count,e[26]=w.pages,e[27]=i,e[28]=k,e[29]=N,e[30]=C,e[31]=v,e[32]=A}else k=e[28],N=e[29],C=e[30],v=e[31],A=e[32];let T;e[45]!==N||e[46]!==C||e[47]!==l||e[48]!==A?(T=a.jsx(on,{title:A,trailing:C,body:N,onClose:l}),e[45]=N,e[46]=C,e[47]=l,e[48]=A,e[49]=T):T=e[49];let I;return e[50]!==k||e[51]!==v||e[52]!==T?(I=a.jsx(k,{pane:v,list:T}),e[50]=k,e[51]=v,e[52]=T,e[53]=I):I=e[53],I}function Mc(t){const e=B.c(5),{virtualMcpId:s,branch:r}=t,n=be(),o=Bt(s,r);if(!Ec(o))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 i;return e[3]!==l?(i=a.jsxs(tt,{children:[d,a.jsx(nt,{side:"bottom",className:"max-w-xs",children:l})]}),e[3]=l,e[4]=i):i=e[4],i}function Ec(t){return t.kind==="protocol"?t.hasSchema!==!1:t.kind==="unavailable"&&t.source!=="local"}function zc(t){const e=B.c(11),{virtualMcpId:s,branch:r}=t,n=be(),o=Bt(s,r);if(!(o.kind==="protocol"&&o.source==="local"&&o.describe.readOnly))return null;let l;e[0]!==n?(l=n("decoServe.readOnly.label"),e[0]=n,e[1]=l):l=e[1];let i;e[2]!==l?(i=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]=i):i=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(Jr,{text:u})}),e[6]=u,e[7]=c):c=e[7];let h;return e[8]!==i||e[9]!==c?(h=a.jsxs(tt,{children:[i,c]}),e[8]=i,e[9]=c,e[10]=h):h=e[10],h}function Uc(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 qc(){const t=B.c(27),e=ns(),{org:s}=hs(),r=Ks(e?.virtualMcpId),n=r?.id??e?.virtualMcpId??"",o=e?.currentBranch??null,{runtime:d,resolved:l}=fs(r?.id),i=vn(r?.id),{url:u}=fn(r?.id),{connection:c}=mn(n||null),h=!!r&&!!o&&l&&d==="cms"&&!i&&!u,p=o??"",b=e?.taskId??null;let f,m,g,x;t[0]!==s.slug||t[1]!==p||t[2]!==b||t[3]!==n?(m={orgSlug:s.slug,virtualMcpId:n,branch:p,threadId:b},f=Hc,x=ft,g=Sn(m),t[0]=s.slug,t[1]=p,t[2]=b,t[3]=n,t[4]=f,t[5]=m,t[6]=g,t[7]=x):(f=t[4],m=t[5],g=t[6],x=t[7]);let P;t[8]!==f||t[9]!==m?(P=(T,I)=>f(I?.queryKey)===f(Cn(m))?T:void 0,t[8]=f,t[9]=m,t[10]=P):P=t[10];let j;t[11]!==h||t[12]!==g||t[13]!==P?(j={...g,enabled:h,placeholderData:P},t[11]=h,t[12]=g,t[13]=P,t[14]=j):j=t[14];const y=x(j),S=!!u,w=!!c;let k;if(t[15]!==i||t[16]!==o||t[17]!==r?.metadata?.releases||t[18]!==l||t[19]!==d||t[20]!==y.data||t[21]!==y.isError||t[22]!==S||t[23]!==w){let T;t[25]!==o?(T=I=>I.branch===o,t[25]=o,t[26]=T):T=t[26],k=Uc({runtime:d,runtimeResolved:l,blocksV8:i,localPreview:S,servingLocally:w,branch:o,listedDraft:(r?.metadata?.releases??[]).some(T),defaultBranch:y.data?y.data.base??null:y.isError?null:void 0}),t[15]=i,t[16]=o,t[17]=r?.metadata?.releases,t[18]=l,t[19]=d,t[20]=y.data,t[21]=y.isError,t[22]=S,t[23]=w,t[24]=k}else k=t[24];const N=k,C=`${n}:${o??""}`,[v,A]=q.useState(null);return N!=="pending"&&(v?.key!==C||v.gate!==N)&&A({key:C,gate:N}),N==="pending"&&v?.key===C?v.gate:N}function Hc(t){return t?.[2]}function Kc(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 _d(t){const e=B.c(2),{blocksOnly:s}=t;let r;return e[0]!==s?(r=s?a.jsx(Vc,{}):a.jsx(Pa,{}),e[0]=s,e[1]=r):r=e[1],r}function Vc(){return vn(fi())?a.jsx(fa,{value:!1,children:a.jsx(Pa,{})}):null}function Pa(){const t=B.c(32),e=ns(),{org:s}=hs(),r=Ks(e?.virtualMcpId),n=e?.currentBranch??null,o=fs(r?.id).runtime,{url:d}=fn(r?.id),{connection:l}=mn(r?.id??e?.virtualMcpId),i=r?.id??e?.virtualMcpId,u=qc()!=="open",c=!!r,h=!!l,p=!!d;let b;t[0]!==r||t[1]!==u||t[2]!==o||t[3]!==c||t[4]!==h||t[5]!==p?(b=Kc({hasEntity:c,servingLocally:h,localPreview:p,showsRepositoryActions:!!r&&hi(r),runtime:o,onProduction:u}),t[0]=r,t[1]=u,t[2]=o,t[3]=c,t[4]=h,t[5]=p,t[6]=b):b=t[6];const f=b;if(!i||f.hidden)return null;let m;t[7]!==n||t[8]!==i?(m=a.jsx(Mc,{virtualMcpId:i,branch:n}),t[7]=n,t[8]=i,t[9]=m):m=t[9];let g;t[10]!==n||t[11]!==f.localFiles||t[12]!==i?(g=f.localFiles&&a.jsx(zc,{virtualMcpId:i,branch:n}),t[10]=n,t[11]=f.localFiles,t[12]=i,t[13]=g):g=t[13];let x;t[14]!==n||t[15]!==s||t[16]!==f.localFiles||t[17]!==i?(x=f.localFiles&&a.jsx(Oc,{orgSlug:s.slug,virtualMcpId:i,branch:n}),t[14]=n,t[15]=s,t[16]=f.localFiles,t[17]=i,t[18]=x):x=t[18];let P;t[19]!==n||t[20]!==r||t[21]!==f.draftSelect?(P=r&&f.draftSelect&&a.jsx("div",{className:"flex min-w-0 shrink items-center justify-end",children:a.jsx(Li,{virtualMcp:r,currentBranch:n})}),t[19]=n,t[20]=r,t[21]=f.draftSelect,t[22]=P):P=t[22];let j;t[23]!==r||t[24]!==f.publish?(j=r&&f.publish&&a.jsxs(a.Fragment,{children:[a.jsx(Ea,{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(wc,{virtualMcpId:r.id}):a.jsx(Lc,{virtualMcpId:r.id})})]}),t[23]=r,t[24]=f.publish,t[25]=j):j=t[25];let y;return t[26]!==m||t[27]!==g||t[28]!==x||t[29]!==P||t[30]!==j?(y=a.jsxs(a.Fragment,{children:[m,g,x,P,j]}),t[26]=m,t[27]=g,t[28]=x,t[29]=P,t[30]=j,t[31]=y):y=t[31],y}export{_d as S,qc as a,Ci as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as I,j as r,n as v,b as M,a5 as T,bi as w}from"./index-BZX-7ipZ.js";import{E as B}from"./empty-state-ovRL7NEK.js";import{u as L}from"./chat-context-CCj5lauv.js";import{u as N,l as O,E as _}from"./site-editor-toast-D83gMpdg.js";import{i as $,u as A,j as Q,S as U}from"./blocks-tab-states-oXZbJa9b.js";import{a as G}from"./autosend-D6GGYoeu.js";function H(S){const e=I.c(7),{icon:n,title:i,description:t,action:o}=S;let a;e[0]!==o?(a=o?{children:o.label,onClick:o.onClick,disabled:o.disabled}:void 0,e[0]=o,e[1]=a):a=e[1];let s;return e[2]!==t||e[3]!==n||e[4]!==a||e[5]!==i?(s=r.jsx(v,{children:r.jsx(v.Content,{children:r.jsx(v.Container,{children:r.jsx(B,{icon:n,title:i,description:t,buttonProps:a})})})}),e[2]=t,e[3]=n,e[4]=a,e[5]=i,e[6]=s):s=e[6],s}function Y(S){const e=I.c(28),{virtualMcpId:n,icon:i,copy:t,skeleton:o,children:a}=S,s=M(),{org:g}=T(),j=L(),m=j?.currentBranch??null,p=N(n,m);w(p.kind==="protocol"&&p.source==="github");const{openPanel:k}=G();if(!m){const l=t.noDraftTitle,D=t.noDraftDesc;let u;e[0]!==s?(u=s("sectionsEditor.namedRules.openEditor"),e[0]=s,e[1]=u):u=e[1];let c;e[2]!==k?(c=()=>k("content"),e[2]=k,e[3]=c):c=e[3];let d;e[4]!==u||e[5]!==c?(d={label:u,onClick:c},e[4]=u,e[5]=c,e[6]=d):d=e[6];let x;return e[7]!==t.noDraftDesc||e[8]!==t.noDraftTitle||e[9]!==i||e[10]!==d?(x=r.jsx(H,{icon:i,title:l,description:D,action:d}),e[7]=t.noDraftDesc,e[8]=t.noDraftTitle,e[9]=i,e[10]=d,e[11]=x):x=e[11],x}if($(p)){let l;return e[12]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsx(U,{}),e[12]=l):l=e[12],l}if(p.kind==="pending"){let l;return e[13]!==o?(l=r.jsx(r.Fragment,{children:o}),e[13]=o,e[14]=l):l=e[14],l}if(p.kind!=="protocol"){let l;return e[15]!==t.loadFailed||e[16]!==t.loadFailedHint||e[17]!==i?(l=r.jsx(H,{icon:i,title:t.loadFailed,description:t.loadFailedHint}),e[15]=t.loadFailed,e[16]=t.loadFailedHint,e[17]=i,e[18]=l):l=e[18],l}const h=j?.taskId??null;let f;return e[19]!==m||e[20]!==a||e[21]!==t||e[22]!==i||e[23]!==g.slug||e[24]!==o||e[25]!==h||e[26]!==n?(f=r.jsx(K,{orgSlug:g.slug,virtualMcpId:n,branch:m,threadId:h,icon:i,copy:t,skeleton:o,children:a},m),e[19]=m,e[20]=a,e[21]=t,e[22]=i,e[23]=g.slug,e[24]=o,e[25]=h,e[26]=n,e[27]=f):f=e[27],f}function K(S){const e=I.c(35),{orgSlug:n,virtualMcpId:i,branch:t,threadId:o,icon:a,copy:s,skeleton:g,children:j}=S,m=M();let p;e[0]!==t||e[1]!==n||e[2]!==o||e[3]!==i?(p={orgSlug:n,virtualMcpId:i,branch:t,threadId:o,previewUrl:null},e[0]=t,e[1]=n,e[2]=o,e[3]=i,e[4]=p):p=e[4];const k=p,h=O(k),f=A(k),l=h.data,D=f.data;let u;e[5]!==t||e[6]!==n||e[7]!==i?(u={orgSlug:n,virtualMcpId:i,branch:t},e[5]=t,e[6]=n,e[7]=i,e[8]=u):u=e[8];const c=_(u,Q);if(!l||!D||!c.ready){if(h.isError||f.isError||c.failed){const P=s.loadFailed,R=s.loadFailedHint;let E;e[9]!==m?(E=m("sectionsEditor.namedRules.tryAgain"),e[9]=m,e[10]=E):E=e[10];let F;e[11]!==h||e[12]!==c||e[13]!==f?(F=()=>{h.isError&&h.refetch(),f.isError&&f.refetch(),c.failed&&c.retry()},e[11]=h,e[12]=c,e[13]=f,e[14]=F):F=e[14];let b;e[15]!==E||e[16]!==F?(b={label:E,onClick:F},e[15]=E,e[16]=F,e[17]=b):b=e[17];let y;return e[18]!==s.loadFailed||e[19]!==s.loadFailedHint||e[20]!==a||e[21]!==b?(y=r.jsx(H,{icon:a,title:P,description:R,action:b}),e[18]=s.loadFailed,e[19]=s.loadFailedHint,e[20]=a,e[21]=b,e[22]=y):y=e[22],y}let C;return e[23]!==g?(C=r.jsx(r.Fragment,{children:g}),e[23]=g,e[24]=C):C=e[24],C}let d;e[25]!==t||e[26]!==j||e[27]!==l||e[28]!==D||e[29]!==n||e[30]!==o||e[31]!==i?(d=j({orgSlug:n,virtualMcpId:i,branch:t,threadId:o,decofile:l,meta:D}),e[25]=t,e[26]=j,e[27]=l,e[28]=D,e[29]=n,e[30]=o,e[31]=i,e[32]=d):d=e[32];let x;return e[33]!==d?(x=r.jsx(r.Fragment,{children:d}),e[33]=d,e[34]=x):x=e[34],x}export{H as S,Y as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as u,r as g,j as n,J as G,a0 as F,a as E,l as O,b as P,n as y,L as H}from"./index-BZX-7ipZ.js";import{C as M}from"./chat-context-CCj5lauv.js";import{C as x}from"./index-Cjc_aSrk.js";import{L}from"./index-2bmOBUEF.js";import{B as V}from"./blocks-preview-workspace-context-Gbv7_zq8.js";import{e as T,p as J,s as K,a as W,r as U,T as $,u as R,b as z}from"./site-editor-toast-D83gMpdg.js";import{u as q,L as B,P as Q,S as X}from"./preview-tab-Dn0RGnhj.js";import{C as Y}from"./content-tab-kF-GtTU9.js";import{T as Z}from"./tab-icon-glyph-Co1M723I.js";import{r as tt}from"./resolve-tab-icon-BnqDq-fY.js";import et from"./agent-site-editor-Pg_WHlnv.js";import"./autosend-D6GGYoeu.js";import"./thread-route-CP2TR6nw.js";import"./use-project-scope-k7OaKjIm.js";import"./repository-binding-CqOunspI.js";import"./use-mcp-client-CrdyqnFt.js";import"./auth-D991fBKg.js";import"./thread-intent-DIce2mks.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-j0K-nQ0i.js";import"./task-board-DJtwkz3O.js";import"./schema-C1bLOk3P.js";import"./use-entitlements-CWXMyUT0.js";import"./use-ai-providers-C5rCFpU_.js";import"./use-decopilot-events-DxBT3zOC.js";import"./use-organization-settings-DPCrcu8e.js";import"./use-mobile-BDWitdax.js";import"./use-sidebar-collapsed-ByMTBVZc.js";import"./use-chat-layout-state-CZaSk8YF.js";import"./agent-icon-U2nlXoBG.js";import"./AlertCircle-2LbzMVC9.js";import"./Tool01-D38zOT0h.js";import"./ArrowUp-DmxAfWhF.js";import"./ArrowLeft-BeuQwyHa.js";import"./LinkBroken01-Jybptj_M.js";import"./ShoppingBag01-DhegylE0.js";import"./Globe04-RPMmcIuy.js";import"./CheckCircle-BzNTGMCW.js";import"./ChevronUp-aYmfXYet.js";import"./ChevronSelectorVertical-XdbRnSsi.js";import"./UserSquare-CEg-eLCw.js";import"./CreditCard01-yFcUZGe-.js";import"./SwitchHorizontal01-Czrqzt6f.js";import"./Key01-jvDltRrN.js";import"./Minus-BqtyYKKc.js";import"./Monitor01-As0zpJLy.js";import"./Sun-Hd0LHTxB.js";import"./Play-CdlorRHF.js";import"./Plus-CzoopYlU.js";import"./SearchMd-By2dNUiw.js";import"./Trash01-BxSWir9J.js";import"./Upload01-C8sapTWh.js";import"./Users01-CMreTMtq.js";import"./XClose-DGifUqyQ.js";import"./Zap-BLaVFWQx.js";import"./tooltip--uPFG1gb.js";import"./index-BM0DSfBG.js";import"./toolbar-icon-button-BzIcnxXk.js";import"./shell-layout-BvJfyzsq.js";import"./use-deployment-admin-BSEuekHe.js";import"./admin-fetch-BhTJlAsX.js";import"./command-DiccrIM8.js";import"./index-cmF_qGuq.js";import"./integration-icon-Btk7lWbK.js";import"./project-icon-ofE-LDok.js";import"./use-navigate-to-agent-C3sX18jI.js";import"./new-project-dialog-EK9WMEhp.js";import"./label-BGCn7A0y.js";import"./repository-picker-DNdEQtlZ.js";import"./github-icon-M-2WiP3Y.js";import"./useInfiniteQuery-B313haH3.js";import"./infiniteQueryObserver-CQGSlzKO.js";import"./collection-search-D_oD-yY0.js";import"./use-debounced-value-CJpdUTvG.js";import"./required-auth-layout-Dfyc4Zas.js";import"./use-org-sso-BHDTii7j.js";import"./sheet-BYgfxL9i.js";import"./resizable-BCGqPRic.js";import"./core.esm-CWyzckxm.js";import"./sortable.esm-DgwAq-fn.js";import"./context-menu-vUs3I8Wh.js";import"./create-organization-dialog-qsB5dfrW.js";import"./form-B_3ZthF3.js";import"./project-apps-D47w7eJj.js";import"./use-recent-apps-Buo9cWvj.js";import"./use-voice-input-DsJxHyTh.js";import"./popover-CkuSZicN.js";import"./drawer-CMTReHxa.js";import"./index-DT3lYd1R.js";import"./checkbox-DB14k3TQ.js";import"./select-CwDmbwEv.js";import"./index-BdQq_4o_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./use-blocks-v8-project-CXrKL60y.js";import"./sandbox-url-D3mC8qhT.js";import"./utils-D0xixM8q.js";import"./use-sandbox-events-BRJYKM54.js";import"./sandbox-git-api-DcqI6XE4.js";import"./parse-sections-DE2O_vev.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-C5KKQk8r.js";import"./collapsible-BPEhSNLz.js";import"./use-copy-DccRTYvG.js";import"./usage-stats-DaOtdhEm.js";import"./tool-namespace-BQhkJpu9.js";import"./utils-CVEq3hMx.js";import"./markdown-B6eeRWQb.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-DwuRGgZk.js";import"./types-EjHtXl5u.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./use-connection-BEb786wf.js";import"./use-mcp-prompts-C3SHzM_d.js";import"./use-thread-outputs-lMVF4bT2.js";import"./file-type-icon-CflTIvHJ.js";import"./section-array-field-C3Tpx16b.js";import"./blocks-tab-states-oXZbJa9b.js";import"./empty-state-DF9St1T6.js";import"./hosted-reconcile-B3o4dv7j.js";import"./slider-Ipy9G5jv.js";import"./index-iezPx7cK.js";import"./tooltipContext-C8ArdkXW.js";import"./CategoricalChart-DVdTZlRq.js";import"./index-D7Mi9FGh.js";import"./switch-BLkpF22m.js";import"./textarea-D5OF_Tld.js";import"./scroll-area-rELMi4e6.js";import"./monaco-editor-vUgphdkE.js";import"./editor-C6CE2FNQ.js";import"./calendar-ahGH-Iwe.js";import"./editor-classes-DbMPYB4Z.js";import"./toggle-group-DbLOGwe7.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-hVgdYGtQ.js";import"./search-input-Crult1Qo.js";import"./tabs--wmPR0cZ.js";import"./use-file-configs-DsyBYIJw.js";import"./asset-utils-DxOK6Cj3.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./sandbox-lifecycle-context-CXwLCWvJ.js";import"./variant-matcher-override-QQd3tA7f.js";import"./use-fast-preview-draft-url-BCmBxVQg.js";import"./useQueries-BO8pZ9q-.js";import"./device-hint-DMMaEP-p.js";import"./alert-B52lXsYB.js";import"./virtual-mcp-Dzr3mFmO.js";import"./url-slug-rCJqhuIp.js";import"./app-preview-url-9Od4s8Sz.js";import"./agent-capabilities-CaXbVMop.js";import"./preview-source-BsRLGWUP.js";import"./use-task-metadata-BxcNhivS.js";import"./view-header-BPAnt0vh.js";import"./use-cms-publish-actions-BV2nwL3g.js";import"./use-content-sync-CtHfpBJp.js";import"./mustache-CgF6ozKS.js";import"./date-utils-CrvIKg-s.js";import"./use-move-blocks-B48xFUbp.js";import"./badge-C9w1KAGQ.js";import"./empty-state-ovRL7NEK.js";import"./collection-table-wrapper-C2dK4p_4.js";import"./table-DPFxRA7S.js";import"./site-draft-actions-CgeV78uL.js";import"./separator-C05SxAdn.js";import"./cms-store-drafts-BumH78UY.js";import"./serial-task-queue-CGOeQgpr.js";import"./index-mtR249ru.js";import"./input-CcFFY__7.js";import"./icon-button-DQuPTgIB.js";import"./chat-draft-BtMWyLm7.js";import"./use-deco-credits-DtE2LNZs.js";import"./input-3OyhKW_c.js";import"./suggestion-Dwy6qysF.js";import"./use-org-fs-BRERSVus.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-BoU9TII8.js";import"./plan-ladder-BQ0gcfdF.js";import"./add-connection-dialog-Dpu5ecJP.js";import"./extract-connection-data-Q1k0ncm3.js";import"./metadata-D72DunRR.js";import"./connection-DF20RpK_.js";import"./connection-card-DeCnJCAi.js";import"./connection-slug-tS8GnOSc.js";import"./schema-DHLwjAWR.js";import"./connection-form-helpers-B4MG2Fy2.js";import"./authenticate-and-persist-oauth-CM3iiCDW.js";import"./mcp-oauth-BvqIKSqR.js";import"./mcp-oauth-Bz1Lo9Pk.js";import"./collection-tabs-SAUXvS4g.js";import"./use-infinite-scroll-4e7tB3Vz.js";import"./useSuspenseInfiniteQuery-07GrICuv.js";import"./use-task-board-events-CzDIUBok.js";import"./save-changes-debug-nBi-n9eV.js";import"./site-draft-view-Dkq2XweK.js";function I(e){return e.kind==="unavailable"&&e.source==="local"&&(e.problem?.reason??"not-answering")==="not-answering"}const ot=e=>e;function it(e){const t=u.c(10),{candidates:o,invalidLink:c,shell:m,editor:i}=e,r=c===void 0?!1:c,s=m===void 0?ot:m,[p,l]=g.useState(null);if(p){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),t[0]=f):f=t[0];let h;return t[1]!==p||t[2]!==i?(h=i(p,f),t[1]=p,t[2]=i,t[3]=h):h=t[3],h}let a;t[4]!==o||t[5]!==r?(a=n.jsx(rt,{candidates:o,invalidLink:r,onConnect:l}),t[4]=o,t[5]=r,t[6]=a):a=t[6];let d;return t[7]!==s||t[8]!==a?(d=s(a),t[7]=s,t[8]=a,t[9]=d):d=t[9],d}function rt(e){const t=u.c(17),{candidates:o,invalidLink:c,onConnect:m}=e,i=c===void 0?!1:c,[r]=G(),{language:s}=r;let p;t[0]!==m?(p=N=>m({endpoint:N}),t[0]=m,t[1]=p):p=t[1];let l;t[2]!==o||t[3]!==p?(l={candidates:o,onFound:p},t[2]=o,t[3]=p,t[4]=l):l=t[4];const a=q(l),{state:d,access:f,needsGesture:h}=a;let k;t[5]!==o||t[6]!==s?(k=new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(o.map(T)),t[5]=o,t[6]=s,t[7]=k):k=t[7];const C=k;let S;t[8]!==f||t[9]!==a.start||t[10]!==h||t[11]!==d?(S=f==="denied"?{kind:"denied"}:h?{kind:"needs-gesture",onStart:a.start}:d.problem?{kind:"problem",problem:d.problem,host:T(d.problem.endpoint)}:{kind:"looking",paused:d.status==="paused"},t[8]=f,t[9]=a.start,t[10]=h,t[11]=d,t[12]=S):S=t[12];const _=S;let j;return t[13]!==C||t[14]!==i||t[15]!==_?(j=n.jsx(B,{wait:_,hosts:C,invalidLink:i}),t[13]=C,t[14]=i,t[15]=_,t[16]=j):j=t[16],j}const v="deco-serve",w="working-tree",nt={id:"",slug:"",name:"",logo:null},st={id:v,slug:v},mt={virtualMcpId:v,taskId:null,openTask:()=>{},createTask:()=>"",createTaskWithMessage:()=>{},activeTask:null,isThreadLocked:!1,lockedHarness:null,lockedBranch:null,currentBranch:w,setCurrentTaskBranch:()=>{}};function pt(){const e=window.location.hash,t=new URLSearchParams(e.replace(/^#/,"")).has("endpoint"),o=t?J(e):null;return t&&window.history.replaceState(null,"",window.location.pathname+window.location.search),o&&K(o),{candidates:W(o,U()),invalidLink:t&&!o}}const at=[{id:"site-editor",to:"/site-editor",label:"preview"},{id:"content",to:"/site-editor/content",label:"content"}];function ct(){const e=u.c(6),t=P();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:lt},e[0]=o):o=e[0];const c=O(o);let m;e[1]!==t||e[2]!==c?(m=at.map(r=>n.jsx(y.Tab,{asChild:!0,active:c==="content"==(r.id==="content"),children:n.jsxs(H,{to:r.to,activeOptions:{exact:!0},children:[n.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(Z,{icon:tt({tabId:r.id,kind:"system",connections:[]})})}),t(`common.mainPanelTabs.${r.label}`)]})},r.id)),e[1]=t,e[2]=c,e[3]=m):m=e[3];let i;return e[4]!==m?(i=n.jsx(y.Tabs,{children:m}),e[4]=m,e[5]=i):i=e[5],i}function lt(e){return e.matches.at(-1)?.staticData.siteEditorView}function A(e){const t=u.c(14),{children:o}=e,c=P(),{connection:m}=z(v),i=R(v,w);let r,s;if(t[0]!==i||t[1]!==o||t[2]!==m||t[3]!==c){s=Symbol.for("react.early_return_sentinel");t:{if(r=m?T(m.endpoint):"",i.kind==="protocol"){s=o;break t}if(i.kind!=="unavailable"||I(i)){s=n.jsx(X,{headingLevel:2,waiting:!0,title:c("decoServe.connect.reaching",{host:r})});break t}}t[0]=i,t[1]=o,t[2]=m,t[3]=c,t[4]=r,t[5]=s}else r=t[4],s=t[5];if(s!==Symbol.for("react.early_return_sentinel"))return s;let p;t[6]!==i.problem?(p=i.problem??{reason:"not-answering"},t[6]=i.problem,t[7]=p):p=t[7];let l;t[8]!==r||t[9]!==p?(l={kind:"problem",problem:p,host:r},t[8]=r,t[9]=p,t[10]=l):l=t[10];let a;return t[11]!==r||t[12]!==l?(a=n.jsx(B,{wait:l,hosts:r}),t[11]=r,t[12]=l,t[13]=a):a=t[13],a}function dt(e){const t=u.c(6),{onLost:o}=e,c=R(v,w);let m;t[0]!==c?(m=I(c),t[0]=c,t[1]=m):m=t[1];const i=m;let r,s;return t[2]!==i||t[3]!==o?(r=()=>{i&&o()},s=[i,o],t[2]=i,t[3]=o,t[4]=r,t[5]=s):(r=t[4],s=t[5]),g.useEffect(r,s),null}const D={threadOpen:!1,contentOpen:!0,threadVisibilityExplicit:!1,toggleThread:()=>{},toggleContent:()=>{}};function ut(){const e=u.c(11),{data:t}=E.useSession();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:ft},e[0]=o):o=e[0];const c=O(o),m=!!t?.user;let i;e[1]!==m?(i={rail:m},e[1]=m,e[2]=i):i=e[2];const r=c??"preview";let s,p,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(ct,{}),p=n.jsx(x.Thread,{children:null}),l=n.jsx(et,{}),e[3]=s,e[4]=p,e[5]=l):(s=e[3],p=e[4],l=e[5]);let a;e[6]!==r?(a=n.jsx(L.Content,{children:n.jsxs(x,{...D,threadless:!0,contentKey:r,contentNavigation:s,children:[p,l]})}),e[6]=r,e[7]=a):a=e[7];let d;return e[8]!==i||e[9]!==a?(d=n.jsx(L,{outsideOrg:i,children:a}),e[8]=i,e[9]=a,e[10]=d):d=e[10],d}function ft(e){return e.matches.at(-1)?.staticData.siteEditorView}function ht(e){const t=u.c(8),{children:o}=e,{data:c}=E.useSession(),m=!!c?.user;let i;t[0]!==m?(i={rail:m},t[0]=m,t[1]=i):i=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(x.Thread,{children:null}),t[2]=r):r=t[2];let s;t[3]!==o?(s=n.jsx(L.Content,{children:n.jsxs(x,{...D,threadless:!0,contentKey:"guide",children:[r,n.jsx(x.Content,{children:o})]})}),t[3]=o,t[4]=s):s=t[4];let p;return t[5]!==i||t[6]!==s?(p=n.jsx(L,{outsideOrg:i,children:s}),t[5]=i,t[6]=s,t[7]=p):p=t[7],p}const b=()=>{},vt={connection:null,set:b,clear:b};function Yi(){const e=u.c(3),[t]=g.useState(pt);let o;return e[0]!==t.candidates||e[1]!==t.invalidLink?(o=n.jsx(F,{org:nt,project:st,children:n.jsx(it,{candidates:t.candidates,invalidLink:t.invalidLink,shell:kt,editor:xt})}),e[0]=t.candidates,e[1]=t.invalidLink,e[2]=o):o=e[2],o}function xt(e,t){return n.jsxs($.Provider,{value:{connection:e,set:b,clear:b},children:[n.jsx(dt,{onLost:t}),n.jsx(M,{value:mt,children:n.jsx(V,{children:n.jsx(ut,{})})})]})}function kt(e){return n.jsx($.Provider,{value:vt,children:n.jsx(ht,{children:e})})}function Zi(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(A,{children:n.jsx(Q,{virtualMcpId:v})}),e[0]=t):t=e[0],t}function tr(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(A,{children:n.jsx(Y,{virtualMcpId:v})}),e[0]=t):t=e[0],t}export{tr as SiteEditorContent,Zi as SiteEditorPreview,Yi as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{eP as P,eQ as S,c as $,q as ne,i as F,K as g,eR as Ne,aB as wn,aF as Sn,aG as yn,r as L,a as En,at as De,a5 as On,by as yt,eS as Dn,eT as kn,eU as Et,ar as _n,bo as Ot,bh as B,eV as In,eW as Tn,eX as Z,eY as Pn,eZ as Rn,e_ as ue,e$ as xn,f0 as Dt,f1 as kt,f2 as $n,f3 as Nn,a3 as jn,t as K,j as Y}from"./index-BZX-7ipZ.js";import{u as _t}from"./use-voice-input-DsJxHyTh.js";import{s as et}from"./thread-intent-DIce2mks.js";import{u as je}from"./use-blocks-v8-project-CXrKL60y.js";import{b as be}from"./sandbox-url-D3mC8qhT.js";import{s as Cn}from"./utils-D0xixM8q.js";import{u as Ce}from"./repository-binding-CqOunspI.js";import{u as An}from"./chat-context-CCj5lauv.js";import{i as Un,u as Mn}from"./use-sandbox-events-BRJYKM54.js";import{a as Ln}from"./sandbox-git-api-DcqI6XE4.js";const q="deco-content",ke={major:1},It=1;async function Fn(e){let t=new Uint8Array(await e.arrayBuffer());if(t[0]===31&&t[1]===139){const n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));t=new Uint8Array(await new Response(n).arrayBuffer())}return JSON.parse(new TextDecoder().decode(t))}const _e={major:ke.major,minor:It},Tt=`the endpoint speaks an older ${q} than this client needs (${_e.major}.${_e.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function re(e,t,n){const o={reason:t,required:{..._e}};if(n){o.actual={protocol:n.protocol,major:n.version?.major,minor:n.version?.minor};const r=n.server;typeof r?.name=="string"&&typeof r.version=="string"&&(o.server={name:r.name,version:r.version})}return new P(S.Unsupported,e,o)}function Pt(e){const t=e??{},{protocol:n,version:o}=t;if(n!==q)throw re(`the endpoint speaks ${JSON.stringify(n)}, not ${q}`,"protocol",t);if(o?.major!==ke.major)throw re(`the endpoint speaks ${q} ${String(o?.major)}.x; this client speaks ${ke.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<It)throw re(Tt,"outdated",t);return e}function tt(e,t){return t.code===S.MethodNotFound&&e.startsWith("changes.")?re(Tt,"outdated"):P.from(t)}function Ae(e){const t=e.fetch??(s=>fetch(s));let n=1;async function o(s){const i={"content-type":"application/json",accept:"application/json",...e.headers},a=await t(new Request(e.endpoint,{method:"POST",headers:i,body:JSON.stringify(s)}));let l;try{l=await Fn(a)}catch{throw new P(S.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(l)&&l?.id===null){const c=l?.error;throw c?P.from(c):new P(S.Unavailable,`the endpoint answered HTTP ${a.status}`)}return l}const r=async(s,i)=>{const a=n++,l=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(l.error)throw tt(s,l.error);return l.result};return{call:r,describe:async()=>Pt(await r("describe")),schemaGet:s=>r("schema.get",s),blocksList:s=>r("blocks.list",s),blocksApply:s=>r("blocks.apply",s),changesList:s=>r("changes.list",s),changesGet:s=>r("changes.get",s),changesDiscard:s=>r("changes.discard",s),async batch(s){const i=s.map(()=>n++),a=await o(s.map((c,f)=>({jsonrpc:"2.0",id:i[f],method:c.method,params:c.params??{}}))),l=new Map(a.map(c=>[c.id,c]));return i.map((c,f)=>{const u=l.get(c);return u?u.error?{ok:!1,error:tt(s[f].method,u.error)}:{ok:!0,result:u.result}:{ok:!1,error:new P(S.InternalError,"no response for this call")}})}}}function Ue(e){return e&&!e.edited?{ifNoneMatch:e.revision}:{}}const nt=20,ot=5,rt=500;function Me(e){return e instanceof P?e.code===S.MethodNotFound?!0:e.code===S.Unsupported&&e.data?.reason==="outdated":!1}function fe(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function Qn(e,t,n){const o=g.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(Ue(r)),i=fe(r,s);if(i)return i;const a=await t.changesList({});return fe(void 0,a)}async function Rt(e,t){const n=[];for(let s=0;s<t.length;s+=nt)n.push(t.slice(s,s+nt));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=ot){const i=await e.batch(n.slice(s,s+ot).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const l=a.result;Object.assign(o,l.entries),r.push(...l.diagnostics)}}return{entries:o,diagnostics:r}}async function Qr(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=rt){const r=t.slice(o,o+rt),s=await e.changesDiscard({names:r.map(i=>i.name),ifMatch:Object.fromEntries(r.map(i=>[i.name,i.version]))});n={revision:s.revision,versions:{...n.versions,...s.versions}}}return n}function Vr(e){return e instanceof P&&e.code===S.Conflict}function Le(e){return e?.kind==="protocol"?e:null}function Br(e,t,n){const o=$.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=ne();let a;o[2]!==e?(a=Le(e),o[2]=e,o[3]=a):a=o[3];const l=a,c=!!l&&!!t&&s.enabled!==!1;let f;o[4]!==t?(f=g.contentChanges(t??""),o[4]=t,o[5]=f):f=o[5];let u;o[6]!==t||o[7]!==c||o[8]!==l||o[9]!==i?(u=c?()=>Qn(i,l.client,t):Ne,o[6]=t,o[7]=c,o[8]=l,o[9]=i,o[10]=u):u=o[10];let d;return o[11]!==f||o[12]!==u?(d={queryKey:f,queryFn:u,staleTime:0},o[11]=f,o[12]=u,o[13]=d):d=o[13],F(d)}function Hr(e,t,n){const o=$.c(14);let r;o[0]!==e?(r=Le(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i;o[2]!==n?(i=n?Object.keys(n.changes):[],o[2]=n,o[3]=i):i=o[3];const a=i,l=!!s&&!!t&&!!n&&a.length>0;let c;o[4]!==t||o[5]!==n?.revision?(c=g.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=c):c=o[6];let f;o[7]!==l||o[8]!==a||o[9]!==s?(f=l?()=>Rt(s.client,a):Ne,o[7]=l,o[8]=a,o[9]=s,o[10]=f):f=o[10];let u;return o[11]!==c||o[12]!==f?(u={queryKey:c,queryFn:f,staleTime:Number.POSITIVE_INFINITY},o[11]=c,o[12]=f,o[13]=u):u=o[13],F(u)}function Jr(e,t,n){const o=$.c(16);let r;o[0]!==e?(r=Le(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i,a,l,c;if(o[2]!==t||o[3]!==n?.changes||o[4]!==s){const d=Object.entries(n?.changes??{}).filter(Wn).map(Jn).sort(Hn);a=d.map(Bn);const h=JSON.stringify(d.map(Vn));i=!!s&&!!t&&a.length>0,c=F,l=g.contentDeletedCopies(t??"",h),o[2]=t,o[3]=n?.changes,o[4]=s,o[5]=i,o[6]=a,o[7]=l,o[8]=c}else i=o[5],a=o[6],l=o[7],c=o[8];let f;o[9]!==i||o[10]!==a||o[11]!==s?(f=i?async()=>{const d=await Rt(s.client,a),h=Object.create(null);for(const[p,v]of Object.entries(d.entries))h[p]=v.before&&typeof v.before=="object"?v.before:null;return h}:Ne,o[9]=i,o[10]=a,o[11]=s,o[12]=f):f=o[12];let u;return o[13]!==l||o[14]!==f?(u={queryKey:l,queryFn:f,staleTime:Number.POSITIVE_INFINITY,placeholderData:wn},o[13]=l,o[14]=f,o[15]=u):u=o[15],c(u)}function Vn(e){return[e.name,e.base]}function Bn(e){return e.name}function Hn(e,t){return e.name<t.name?-1:e.name>t.name?1:0}function Jn(e){const[t,n]=e;return{name:t,base:n.baseVersion??""}}function Wn(e){const[,t]=e;return t.kind==="delete"}function xt(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")return!1;const n=t.hostname.toLowerCase();return n==="127.0.0.1"||n==="[::1]"||n==="localhost"}catch{return!1}}function de(e){try{const t=new URL(e);return(t.hostname==="127.0.0.1"||t.hostname==="[::1]")&&(t.hostname="localhost"),t.href}catch{return e}}const $t=Sn({endpoint:yn().max(2048).refine(e=>xt(e)&&new URL(e).pathname==="/rpc").transform(de)});function Wr(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=$t.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function Nt(e){const t=$t.safeParse(e);return t.success?t.data:null}const jt="studio:deco-serve-last";function Gr(e){try{localStorage.setItem(jt,JSON.stringify(e))}catch{}}function Yr(){try{const e=localStorage.getItem(jt);return e?Nt(JSON.parse(e)):null}catch{return null}}function zr(e){try{return new URL(de(e)).host}catch{return e}}function Gn(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const Yn="http://localhost:4545/rpc";class Fe extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function zn(e){if(e instanceof Fe)return{reason:"not-deco-serve"};if(!(e instanceof P))return{reason:"not-answering"};switch(e.code){case S.Unauthorized:case S.MethodNotFound:return{reason:"outdated"};case S.Unsupported:return Me(e)?{reason:"outdated"}:{reason:"version-mismatch"};case S.Unavailable:return/^the endpoint answered HTTP/.test(e.message)?{reason:"not-deco-serve"}:{reason:"error",detail:e.message};default:return{reason:"error",detail:e.message}}}function Xr(e,t){if(e)return[de(e.endpoint)];const n=[t?.endpoint,Yn].filter(o=>!!o).map(de);return[...new Set(n)]}const Ct=L.createContext(null);function Xn(e){const t=$.c(24),n=L.useContext(Ct),o=je(n?null:e),{data:r}=En.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?De.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[l,c]=it(a);let f;t[4]!==i||t[5]!==s||t[6]!==e?(f=i?De.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=f):f=t[7];const[u,d]=it(f);if(n)return n;let h;t[8]!==l||t[9]!==i||t[10]!==o?(h=i&&o?Nt(l):null,t[8]=l,t[9]=i,t[10]=o,t[11]=h):h=t[11];const p=h,v=i&&o&&typeof u=="string"?u:null;let w;t[12]!==d||t[13]!==c||t[14]!==i?(w=R=>{i&&(c(R),d(R.endpoint))},t[12]=d,t[13]=c,t[14]=i,t[15]=w):w=t[15];let _;t[16]!==c||t[17]!==i?(_=()=>{i&&c(null)},t[16]=c,t[17]=i,t[18]=_):_=t[18];let E;return t[19]!==p||t[20]!==v||t[21]!==w||t[22]!==_?(E={connection:p,lastEndpoint:v,set:w,clear:_},t[19]=p,t[20]=v,t[21]=w,t[22]=_,t[23]=E):E=t[23],E}function st(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function it(e){const t=$.c(17),n=ne(),o=e??"";let r;t[0]!==o?(r=["localStorage",o],t[0]=o,t[1]=r):r=t[1];const s=r;let i,a;t[2]!==e?(i=()=>e?st(e):null,a=()=>e?st(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const l=!!e;let c;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==l?(c={queryKey:s,queryFn:i,initialData:a,enabled:l,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=l,t[9]=c):c=t[9];const{data:f}=F(c);let u;t[10]!==e||t[11]!==n||t[12]!==s?(u=v=>{if(e){try{v===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(v))}catch{}n.setQueryData(s,v)}},t[10]=e,t[11]=n,t[12]=s,t[13]=u):u=t[13];const d=u,h=e?f??null:null;let p;return t[14]!==d||t[15]!==h?(p=[h,d],t[14]=d,t[15]=h,t[16]=p):p=t[16],p}function Zr(e){return e.kind==="protocol"||e.kind==="unavailable"}function qr(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n===null||n==="legacy"?t:!0}function Kr(e,t,n){return t!=="github"||!n?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function es(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&xt(t)?t:null}function ts(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function At(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function Zn(e){if(!e.hasProject)return"legacy";const t=At(e);if(t==="local")return"protocol-local";if(!e.v8)return"legacy";if(t==="sandbox"){const o=e.sandboxSite;return o==="ready"?"protocol-sandbox":o==="error"?"retrying-sandbox":"pending"}const n=e.githubSite;return n==="ready"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":"pending"}function qn(e){return{github:e.v8&&e.mode==="github",sandbox:e.v8&&e.mode==="sandbox"&&e.workingTreeReady}}function at(e){return e.isError||e.errorUpdateCount>0}function Kn(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const r of n)Object.hasOwn(t,r)?o[r]=t[r]:delete o[r];return o}function eo(e){if(!e||typeof e!="object")return[];const t=e,n=[];return typeof t.blockKey=="string"&&n.push(t.blockKey),t.writes&&typeof t.writes=="object"&&n.push(...Object.keys(t.writes)),Array.isArray(t.deletes)&&n.push(...t.deletes.filter(o=>typeof o=="string")),n}const Ut="__noSchema";function Mt(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[Ut]:!0}}function ns(e){return!!e&&e[Ut]===!0}function Qe(e){if(!e.ok)return e.error.code===S.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function to(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const no=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function os(e){const t=new Map;for(const[n,o]of Object.entries(e)){const r=o&&typeof o=="object"&&!Array.isArray(o)?o:{},s=typeof r.__resolveType=="string"?r.__resolveType:null,i=t.get(s)??[];i.push({key:n,label:to(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(no)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:ct(n.resolveType).localeCompare(ct(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function ct(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function lt(e,t,n){if(t.length===0)return n;const[o,...r]=t;if(Array.isArray(e)&&typeof o=="number"){const s=e.slice();return s[o]=lt(e[o],r,n),s}if(e&&typeof e=="object"&&typeof o=="string"){const s=e,i={};for(const a of Object.keys(s))i[a]=a===o?lt(s[a],r,n):s[a];return i}return e}function rs(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class ut extends Error{}const Ve="site-not-owned";async function oo(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function ro(e,t=n=>fetch(n)){const n=Ae({endpoint:e,fetch:async o=>{const r=await t(o);if(await oo(r))throw new ut;return r}});try{return await He(n)}catch(o){if(o instanceof ut)return Ve;throw o}}async function so(e,t,n){await t();const o=await ro(e,n);return o===Ve?o:{...o,hosted:Dn(e,n)}}const Be=5e3;function io(e){if(!e.site)throw new Error("this project names no site");return kn(e.site,e.branch)}function ao(e){return new URL(be(e,"rpc"),window.location.origin).href}async function He(e){const[t,n]=await e.batch([{method:"describe"},{method:"schema.get"}]);if(!t?.ok)throw t?.error??new Error("no describe");if(t.result?.protocol!==q)throw new Fe;const r=Pt(t.result);if(!n)throw new Error("no schema.get");if(Qe(n))return{client:e,describe:r,hasSchema:!1};if(n.ok)return{client:e,describe:r,hasSchema:!0};throw n.error}function co(e,t=n=>fetch(n)){return He(Ae({endpoint:e,fetch:t}))}function me(e,t){const n=$.c(50),{org:o}=On(),{connection:r}=Xn(e),{runtime:s}=_t(e),i=L.useContext(Ct),a=je(e),l=yt(Ce(e)?.metadata),c=At({hasServeConnection:!!r,runtime:s}),f=An()?.taskId??null,u=Un(Mn().lifecycle.phase),d=ne(),h=qn({mode:c,v8:a,workingTreeReady:u}),p=h.github&&!!o.slug&&!!e&&!!t,v=F({queryKey:g.contentBackend(o.slug,e??"",t??"","github"),queryFn:()=>so(io({orgSlug:o.slug,site:l,branch:t}),()=>Et(l,t)),enabled:p,staleTime:Number.POSITIVE_INFINITY,...ft}),w=h.sandbox&&!!o.slug&&!!e&&!!t;let _;n[0]!==t||n[1]!==o.slug||n[2]!==f||n[3]!==e?(_=()=>co(ao({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:f})),n[0]=t,n[1]=o.slug,n[2]=f,n[3]=e,n[4]=_):_=n[4];const E=F({queryKey:g.contentBackend(o.slug,e??"",t??"","sandbox",f??""),queryFn:_,enabled:w,staleTime:Number.POSITIVE_INFINITY,...ft}),R=!!r;let I;n[5]!==r?.endpoint||n[6]!==o.slug||n[7]!==e?(I=g.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[5]=r?.endpoint,n[6]=o.slug,n[7]=e,n[8]=I):I=n[8];let N;n[9]!==r?(N=()=>He(Ae({endpoint:r.endpoint})),n[9]=r,n[10]=N):N=n[10];let x;n[11]!==R||n[12]!==I||n[13]!==N?(x={queryKey:I,queryFn:N,enabled:R,staleTime:Number.POSITIVE_INFINITY,retry:fo,retryDelay:uo,refetchInterval:lo},n[11]=R,n[12]=I,n[13]=N,n[14]=x):x=n[14];const b=F(x);let U;n[15]!==r?.endpoint||n[16]!==o.slug||n[17]!==e?(U=g.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[15]=r?.endpoint,n[16]=o.slug,n[17]=e,n[18]=U):U=n[18];const D=U;let T;n[19]!==r?.endpoint||n[20]!==o.slug||n[21]!==e?(T=g.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[19]=r?.endpoint,n[20]=o.slug,n[21]=e,n[22]=T):T=n[22];let j;n[23]!==b.data||n[24]!==D||n[25]!==d?(j=async()=>{try{return await b.data.client.describe()}catch(m){const J=m;throw d.invalidateQueries({queryKey:D,exact:!0},{cancelRefetch:!1}),J}},n[23]=b.data,n[24]=D,n[25]=d,n[26]=j):j=n[26];const C=!!b.data&&!i;let O;n[27]!==T||n[28]!==j||n[29]!==C?(O={queryKey:T,queryFn:j,enabled:C,refetchInterval:Be,retry:!1},n[27]=T,n[28]=j,n[29]=C,n[30]=O):O=n[30];const A=F(O).data??b.data?.describe,k=Zn({hasProject:!!e,hasServeConnection:!!r,runtime:s,v8:a,githubSite:v.data===Ve?"not-owned":v.data?"ready":at(v)?"error":"loading",sandboxSite:ho({data:E.data,isError:at(E),workingTreeReady:u})});if(k==="pending"){let m;return n[31]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending"},n[31]=m):m=n[31],m}if(k==="retrying-sandbox"){let m;return n[32]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending",retrying:"sandbox"},n[32]=m):m=n[32],m}if(k==="legacy"){let m;return n[33]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"legacy"},n[33]=m):m=n[33],m}if(k==="protocol-github"){const m=v.data;let J;n[34]!==m?(J=Ie("github",m,""),n[34]=m,n[35]=J):J=n[35];let oe;return n[36]!==l||n[37]!==J?(oe={...J,site:l},n[36]=l,n[37]=J,n[38]=oe):oe=n[38],oe}if(k==="site-not-owned-github"){let m;return n[39]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github",siteNotOwned:!0},n[39]=m):m=n[39],m}if(k==="protocol-sandbox"){let m;return n[40]!==E.data?(m=Ie("sandbox",E.data,":sandbox"),n[40]=E.data,n[41]=m):m=n[41],m}if(k==="unavailable-github"){let m;return n[42]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github"},n[42]=m):m=n[42],m}const Q=b.error??b.failureReason,y=r?.endpoint??"";let V;return n[43]!==A||n[44]!==b.data||n[45]!==b.failureCount||n[46]!==b.isError||n[47]!==y||n[48]!==Q?(V=vo({probed:b.data,isError:b.isError,failureCount:b.failureCount,failure:Q,describe:A,endpoint:y}),n[43]=A,n[44]=b.data,n[45]=b.failureCount,n[46]=b.isError,n[47]=y,n[48]=Q,n[49]=V):V=n[49],V}function lo(e){return e.state.status==="error"||e.state.data?.hasSchema===!1?Be:!1}function uo(e){return Gn(e+1)}function fo(e,t){return!(t instanceof P)&&!(t instanceof Fe)}function ho(e){return e.data!==void 0?"ready":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const go=3;function vo(e){const t=e.probed?Ie("local",{...e.probed,describe:e.describe??e.probed.describe},`:serve:${e.endpoint}`):null;return e.isError||e.failureCount>0?t?.kind==="protocol"&&!e.isError&&e.failureCount<go?t:{kind:"unavailable",source:"local",problem:zn(e.failure)}:t??{kind:"pending"}}const ft={retry:2,refetchInterval:e=>e.state.status==="error"?Be:!1};function Ie(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema,...t.hosted?{hosted:t.hosted}:{}}}function Lt(e){const t=$.c(12);let n;t[0]!==e?(n=De.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=_n(o,null),i=je(e);let a;t[2]!==r||t[3]!==e?(a=e?et(r):null,t[2]=r,t[3]=e,t[4]=a):a=t[4];const c=i?null:a;let f,u;t[5]!==s?(f=h=>s(et(h)),u=()=>s(null),t[5]=s,t[6]=f,t[7]=u):(f=t[6],u=t[7]);let d;return t[8]!==c||t[9]!==f||t[10]!==u?(d={url:c,setUrl:f,clear:u},t[8]=c,t[9]=f,t[10]=u,t[11]=d):d=t[11],d}function po(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function dt(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}function we(e,t,n){return["decofile-write",e,t,n]}function bo(e,t,n){return{id:we(e,t,n).join(":")}}class Je extends Error{constructor(t,n,o=[],r=!1){super(n),this.blocks=t,this.fields=o,this.carriedStored=r,this.name="BlockConflictError"}blocks;fields;carriedStored}function We(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function Ge(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function mo(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function wo(e,t,n){e.setQueryData(g.decofileDraft(We(t)),n)}function So(e,t){return e.getQueryData(g.decofileDraft(We(t)))??null}async function yo(e,t){return(await fetch(Ge(e),{cache:"no-store",headers:{"if-none-match":`"${t}"`}}).catch(()=>null))?.status===200}function ss(e){const t=$.c(4);let n;t[0]!==e?(n=g.decofileDraft(e?We(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Eo,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r??null}async function Eo(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function Oo(e,t){const n=await fetch(Ge(t),{cache:"no-store"});if(!n.ok){const r=new Error(`Failed to fetch decofile: ${n.status}`);throw r.status=n.status,r}const o=await n.json();return o.token&&wo(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function is(e,t){const n=await fetch(Ge(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const r=await n.json().catch(()=>({}));throw r.code==="block-conflict"?new Je(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return mo(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const Ft=3e3,Do=15e3,ko=2*6e4,Qt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function _o(e){return e<ko?Ft:Do}function Io(e,t=Qt){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,_o(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:l,skip:c}=e();if(r||t.hidden()||c?.()){i();return}r=!0;let f;try{f=l()}catch{f=void 0}Promise.resolve(f).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const ht=()=>0;function To(e,t,n=Qt){const o=L.useRef(t);o.current=t;const[r]=L.useState(()=>({polling:()=>Io(()=>o.current,n),idle:()=>()=>{}}));L.useSyncExternalStore(e?r.polling:r.idle,ht,ht)}function Vt(e,t){return be(e,t)}function Po(e,t){return be(e,"preview-fetch",{path:t})}function as(e){return Vt(e,"preview-invoke")}function cs(e){return Vt(e,"catalog-invoke")}function Bt(e){try{const{hostname:t}=new URL(e);return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}function Ro(){if(typeof document>"u")return null;const e=Array.from(document.querySelectorAll("iframe"));for(const t of e){const n=t.getAttribute("src");if(n&&Bt(n))return n}return null}function xo(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??Ro();return n&&Bt(n)?new URL(t,n).toString():Po(e,t)}function $o(e){return xo(e,"/.decofile")}function No(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function gt(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function jo(e,t){const n=be(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=No(o.status);if(r==="absent")return{kind:"absent"};if(r==="unavailable")return{kind:"unavailable"};if(r==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const s=await o.json();return typeof s.content!="string"?{kind:"unavailable"}:{kind:"data",data:Cn(s.content)}}async function Co(e,t){const n=await jo(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function ls(e){const t=`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/meta`,n=await fetch(t,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const o=new Error(`Failed to read committed meta: ${n.status}`);throw o.status=n.status,o}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function Ao(e){return Ce(e)?.metadata?.runtime?.path??null}class Ht extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function us(e){return e instanceof P&&e.code===S.Conflict}function Jt(e){const t=e.data?.violations;return!Array.isArray(t)||t.length===0?e.message:t.slice(0,3).map(n=>n.message).join("; ")}class Ye extends Error{constructor(){super("The draft's changes couldn't be read"),this.name="HostedDraftUnreadError"}}class ze extends Error{constructor(){super("The blocks kept changing while the change was saved"),this.name="HostedKeptChangingError"}}function fs(e,t){return(t instanceof Ye||t instanceof ze)&&(t.message=Wt(e,t,"github")),t}function Wt(e,t,n){if(t instanceof Ye)return e("siteEditor.save.draftUnread");if(t instanceof ze)return e("siteEditor.save.keptChanging");if(t instanceof Je)return t.message;if(n==="local")return Mo(e,t);if(t instanceof P)switch(t.code){case S.Conflict:return e("siteEditor.save.conflict");case S.ReadOnly:return e("siteEditor.save.readOnly");case S.InvalidBlock:case S.InvalidParams:return e("siteEditor.save.invalid");case S.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function Uo(e,t){if(t==="local"||e instanceof Je||e instanceof Ye||e instanceof ze)return null;if(e instanceof P){const n=e.code===S.InvalidBlock||e.code===S.InvalidParams?Jt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function Mo(e,t){if(t instanceof Ht)return e("decoServe.save.serverGone");if(t instanceof P)switch(t.code){case S.Conflict:return e("decoServe.save.conflict");case S.ReadOnly:return e("decoServe.save.readOnly");case S.InvalidBlock:case S.InvalidParams:return e("decoServe.save.invalid",{detail:Jt(t)});case S.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function Lo(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function Fo(e,t){const[n,o]=L.useState(e),r=L.useRef(null);return e&&!n&&o(!0),L.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=Lo(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const Qo="decocms:content-writes",Te=new Set;let G;function Gt(){if(G!==void 0)return G;G=null;try{typeof BroadcastChannel=="function"&&(G=new BroadcastChannel(Qo),G.addEventListener("message",e=>{const t=e.data?.cacheKey;if(typeof t=="string")for(const n of[...Te])n(t)}))}catch{G=null}return G}function Vo(e){try{Gt()?.postMessage({cacheKey:e})}catch{}}function Bo(e){return Gt(),Te.add(e),()=>{Te.delete(e)}}const Yt="__at=",zt="__test=",Ho=/^[0-9a-f]{12}-[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;function Jo(e){return e.at!==void 0||Object.keys(e.tests??{}).length>0}function X(e){return typeof e=="string"&&Ho.test(e)}function vt(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function Wo(e){const t=e.tests??{};return[...e.at!==void 0?[Yt+vt(e.at)]:[],...Object.keys(t).map(n=>zt+vt(`${n}=${t[n]?"on":"off"}`))]}function pt(e,t){const o=[...e.split("&").filter(r=>r&&!r.startsWith(Yt)&&!r.startsWith(zt)),...t];return o.length>0?`?${o.join("&")}`:""}function he(e,t){const n=Wo(t),o=e.indexOf("?"),r=o===-1?e:e.slice(0,o);if(X(r))return r+pt(o===-1?"":e.slice(o+1),n);const s=e.lastIndexOf("@");if(s<=0)return e;const i=e.slice(0,s),a=i.indexOf("?"),l=a===-1?i:i.slice(0,a),c=a===-1?"":i.slice(a+1);return`${l}${pt(c,n)}${e.slice(s)}`}function ds(e,t,n){if(!Jo(t))return e;try{const o=new URL(e),r=o.searchParams.get("__draft");return r&&r!=="off"?(o.searchParams.set("__draft",he(r,t)),o.toString()):X(n)?(o.searchParams.set("__draft",he(n,t)),o.toString()):e}catch{return e}}function hs(e,t,n="/"){if(!e||!X(t))return null;try{const o=new URL(n,e);return o.searchParams.set("__draft",t),o.toString()}catch{return null}}function Xt(e){return btoa(encodeURIComponent(e))}function gs(e,t,n){const o=Go(e,t,n);return o.searchParams.set("__cb",crypto.randomUUID()),o.toString()}function Go(e,t,n){const o=new URL(e).origin,r=new URL(`/live/previews/${encodeURIComponent(t)}`,o);return r.searchParams.set("path","/"),r.searchParams.set("pathTemplate","/"),r.searchParams.set("props",Xt(JSON.stringify({path:"/",sections:[{__resolveType:n}]}))),r}const Yo="__draft";function vs(e){return`${`${e.apiHost}/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}?token=${e.token}`}@${e.version}`}const zo="off";function Xo(e,t){if(!t)return e;const n=new URL(e);return n.searchParams.set(Yo,t),n.toString()}function ps(e){const t=e.pageBlock.__resolveType;if(typeof t!="string"||!t)return null;const n=new URL(e.previewBaseUrl).origin,o=new URL(`/live/previews/${encodeURIComponent(t)}`,n);o.searchParams.set("__decoFBT","0"),o.searchParams.set("__d",""),o.searchParams.set("path",e.path),o.searchParams.set("pathTemplate",e.pathTemplate);const{__resolveType:r,...s}=e.pageBlock,i=JSON.stringify({__props:s,__decofile:e.decofile});return{src:o.toString(),body:i}}function bs(e,t,n,o){const r=new URL(e).origin,s=new URL(`/live/previews/${encodeURIComponent(t)}`,r);s.searchParams.set("__d","");const i=[{__resolveType:"preview",block:n}];return o&&i.push(o),s.searchParams.set("props",Xt(JSON.stringify({sections:i}))),s.toString()}function ms(e){return e.fastPreviewActive&&e.previewServerUrl?e.previewServerUrl:e.sandboxUrl??null}const bt="__variant=";function Zt(e,t,n){return`${e}@${t}=${n}`}function ws(e,t){return!e||!t.multivariate||t.variants.length<=1?[]:t.index<0||t.index>=t.variants.length?[]:[Zt(e,"sections",t.index)]}function Ss(e){const t=Array.isArray(e.mvObj.variants)?e.mvObj.variants:[];if(!e.pageKey||e.sectionIndex<0)return[];if(e.selectedVariantIndex<0||e.selectedVariantIndex>=t.length)return[];const o=`${e.page.multivariate?`sections.variants.${e.page.index}.value${e.page.lazyValues?".value":""}`:"sections"}.${e.sectionIndex}${e.sectionLazy?".section":""}`;return[Zt(e.pageKey,o,e.selectedVariantIndex)]}function ys(e,t){return[...t,...e]}function Zo(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function Xe(e,t){const n=e.lastIndexOf("@");if(n<=0)return e;const o=e.slice(0,n),r=o.indexOf("?"),s=r===-1?o:o.slice(0,r),a=[...r===-1?[]:o.slice(r+1).split("&").filter(c=>c&&!c.startsWith(bt)),...t.map(c=>bt+Zo(c))],l=a.length>0?`?${a.join("&")}`:"";return`${s}${l}${e.slice(n)}`}function Es(e,t,n=!1){if(t.length===0&&!n)return null;try{const o=new URL(e),r=o.hostname==="[::1]"?`localhost${o.port?`:${o.port}`:""}`:o.host;return Xe(`${r}${o.pathname}@local`,t)}catch{return null}}function Os(e,t){if(t.length===0)return e;try{const n=new URL(e),o=n.searchParams.get("__draft");return!o||o==="off"?e:(n.searchParams.set("__draft",Xe(o,t)),n.toString())}catch{return e}}function qo(e){const{pointer:t}=e;if(!t||t===zo)return null;const n=t.indexOf("?");return X(n===-1?t:t.slice(0,n))||t.lastIndexOf("@")<=0?null:X(e.heldRevision)&&e.forcedVariants.length===0?he(e.heldRevision,e.previewOptions):he(Xe(t,e.forcedVariants),e.previewOptions)}function Ko(e,t){if(!e||!t)return null;try{return Xo(e,t)}catch{return null}}function Ds(e,t,n){if(!e||!n)return null;try{return Ko(new URL(t,e).toString(),n)}catch{return null}}const ge={forcedVariants:[],previewOptions:{}},se=new Map,ie=new Map,Pe=new Map;function qt(e){for(const t of Pe.get(e)??[])t()}function Kt(e,t){const n=X(t)?t:null;(ie.get(e)??null)!==n&&(n?ie.set(e,n):ie.delete(e),qt(e))}function er(e){return ie.get(e)??null}function tr(e,t){return JSON.stringify(e)===JSON.stringify(t)}function ks(e,t){const n=se.get(e)??ge,o=t??ge;tr(n,o)||(t?se.set(e,o):se.delete(e),qt(e))}function nr(e){return se.get(e)??ge}function en(e,t){let n=Pe.get(e);return n||(n=new Set,Pe.set(e,n)),n.add(t),()=>{n.delete(t)}}function or(e){const t=$.c(3);let n,o;return t[0]!==e?(n=r=>en(e,r),o=()=>nr(e),t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,rr)}function rr(){return ge}function sr(e){const t=$.c(3);let n,o;return t[0]!==e?(n=r=>e?en(e,r):ar,o=()=>e?er(e):null,t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,ir)}function ir(){return null}function ar(){}function _s(e,t){const n=$.c(4),o=or(e),r=sr(e);let s;return n[0]!==o||n[1]!==r||n[2]!==t?(s=qo({pointer:t,heldRevision:r,...o}),n[0]=o,n[1]=r,n[2]=t,n[3]=s):s=n[3],s}const tn={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},cr=15e3,ve=new Map;function z(e,t){return`${e}/${t}`}function H(e){let t=ve.get(e);return t||(t={state:tn,listeners:new Set,previews:0,timer:null,discardListeners:new Set},ve.set(e,t)),t}function W(e,t){const n=H(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function Se(e){e.timer&&clearTimeout(e.timer),e.timer=null}function Ze(e){return ve.get(e)?.state??tn}function lr(e,t){const n=H(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function Is(e){const t=H(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(Se(t),W(e,{phase:"idle"}))}}function Ts(e){const t=ve.get(e);!t||t.state.phase!=="reloading"||(Se(t),W(e,{phase:"idle"}))}function nn(e){const t=H(e);Se(t),W(e,{phase:"saving",inFlight:t.state.inFlight+1})}function ae(e,t){const n=H(e),o=Math.max(0,n.state.inFlight-1);if(o>0){W(e,{inFlight:o});return}if(!t.ok||n.previews===0){W(e,{phase:"idle",inFlight:o});return}on(e,t.navigates,o)}function on(e,t,n=0){const o=H(e);Se(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&W(e,{phase:"idle"})},cr),W(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function ur(e){return e?.kind==="protocol"&&e.source==="github"}async function ce(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,l=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:g.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await l,{navigates:!1};const c=s?g.protocolDraftRead(o,r,s):null,f=c?JSON.stringify(n.getQueryData(c)??null):null,u=l?[l]:[];if(a&&t.reread&&u.push(n.invalidateQueries({queryKey:g.decofile(a)})),a&&!t.adopted&&u.push(n.invalidateQueries({queryKey:g.contentChanges(a)})),s&&i.source==="sandbox"&&u.push(n.invalidateQueries({queryKey:Ln(o,r,s)})),ur(i)&&c&&!t.adopted&&u.push(n.invalidateQueries({queryKey:c})),await Promise.all(u),t.kind!=="edit"){const p=z(o,r);W(p,{epoch:Ze(p).epoch+1})}const d=c?JSON.stringify(n.getQueryData(c)??null):null,h=f!==d;return h&&await new Promise(p=>Ot.schedule(p)),{navigates:h}}async function fr(e,t){return nn(z(e.orgSlug,e.virtualMcpId)),rn(e,t)}function mt(e){return e.branch?JSON.stringify(e.queryClient.getQueryData(g.protocolDraftRead(e.orgSlug,e.virtualMcpId,e.branch))??null):null}async function rn(e,t){const n=z(e.orgSlug,e.virtualMcpId),o=t.adopted?mt(e):null;let r;try{r=await t.write()}catch(i){throw ae(n,{ok:!1,navigates:!1}),t.refreshOnError&&ce(e,{kind:t.kind,reread:!0}).catch(()=>{}),i}if(e.backend?.kind==="protocol"&&e.cacheKey&&Vo(e.cacheKey),Kt(n,t.shownRevision?.(r)??null),t.adopted){const i=mt(e)!==o;return i&&await new Promise(a=>Ot.schedule(a)),ae(n,{ok:!0,navigates:i}),t.reread&&ce(e,t).catch(()=>{}),r}let s=!1;try{({navigates:s}=await ce(e,t))}catch{}finally{ae(n,{ok:!0,navigates:s})}return r}function Ps(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=z(o,r),a=new Set(t.blockKeys);for(const f of[...H(i).discardListeners])f(a);nn(i);let l=!1;const c=()=>(l=!0,rn(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:we(o,r,s),scope:bo(o,r,s),mutationFn:c}).execute(void 0).catch(f=>{throw l||ae(i,{ok:!1,navigates:!1}),f}):c()}function Rs(e,t,n){const o=$.c(8);let r;o[0]!==e||o[1]!==t?(r=z(e,t),o[0]=e,o[1]=t,o[2]=r):r=o[2];const s=r;let i;o[3]!==n||o[4]!==s?(i=()=>{const l=H(s).discardListeners;return l.add(n),()=>{l.delete(n)}},o[3]=n,o[4]=s,o[5]=i):i=o[5];let a;o[6]!==s?(a=[s],o[6]=s,o[7]=a):a=o[7],L.useEffect(i,a)}function sn(e){const t=z(e.orgSlug,e.virtualMcpId);Ze(t).inFlight>0||(Kt(t,null),ce(e,{kind:"external"}).then(({navigates:n})=>{const o=H(t);o.previews>0&&o.state.inFlight===0&&on(t,n)}).catch(()=>{}))}function dr(e,t){const n=$.c(7);let o;n[0]!==e||n[1]!==t?(o=z(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=c=>lr(r,c),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>Ze(r),n[5]=r,n[6]=a):a=n[6];const l=a;return L.useSyncExternalStore(i,l,l)}const hr=500;function xs(e,t){const{phase:n}=dr(e,t);return Fo(n!=="idle",hr)}function gr(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function an(e,t){return g.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function $s(e,t,n,o){if(o?.source==="github"){const i=e.getQueryData(g.contentIndex(t));return i?Tn(i,n):vr(e,t,n)}const r=e.getQueryData(g.contentVersions(t));if(!r)return;if(Object.hasOwn(r,n))return r[n];const s=e.getQueryData(g.decofile(t));return s&&Object.hasOwn(s,n)?void 0:null}function ee(e,t){if(Object.hasOwn(e.changes,t))return e.changes[t];const n=B(t),o=Object.keys(e.changes).find(r=>B(r)===n);return o===void 0?void 0:e.changes[o]}function vr(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(o)return cn(o,ye(e,t),n)}function cn(e,t,n){const o=ee(e,n);return o?.kind==="delete"?o.version??ue:o?o.version:t.has(B(n))?ue:null}function Ns(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(!o)return!1;const r=ee(o,n);return r?r.kind==="set"&&r.baseVersion===null:ye(e,t).has(B(n))}function js(e,t){const n=e.getQueryData(g.decofile(t)),o=e.getQueryData(g.contentChanges(t));if(!n||!o)return null;const r=ye(e,t);return{blocks:n,versionOf:s=>cn(o,r,s)}}function ye(e,t){return new Set(e.getQueryData(g.contentDraftTombstones(t)))}function pe(e,t,n,o){const r=B(n),s=ye(e,t);s.has(r)!==o&&(o?s.add(r):s.delete(r),Z(e),e.setQueryData(g.contentDraftTombstones(t),[...s]))}function ln(e,t,n,o){const r=o.revision,s=e.getQueryData(g.contentVersions(n)),i=Object.entries(o.versions??{}).map(([u,d])=>[u,d===ue?null:d]),a=e.getQueryData(g.contentChanges(n)),l=new Set(i.flatMap(([u])=>{const d=a?ee(a,u):void 0;return(d?d.baseVersion:s?.[u]??null)===null?[u]:[]})),c=new Set(i.flatMap(([u,d])=>d===null?[]:[B(u)]));e.setQueryData(g.contentChanges(n),u=>{if(!u)return u;const d={...u.changes};for(const[h,p]of i){const v=ee(u,h),w=v?v.baseVersion:s?.[h]??null;p!==null?d[h]={kind:"set",version:p,baseVersion:w}:w!==null?d[h]={kind:"delete",version:null,baseVersion:w}:delete d[h]}return{...u,changes:d,edited:!0}});for(const[u,d]of i)d!==null?pe(e,n,u,!1):!c.has(B(u))&&l.has(u)&&pe(e,n,u,!0);const f=o.revision;return f&&f!=="none"&&e.setQueryData(g.protocolDraftRead(t.orgSlug,t.virtualMcpId,t.branch),u=>u&&{...u,version:f}),r}function Ee(e,t,n){Z(e),e.setQueryData(g.contentVersions(t),o=>{const r={...o};for(const[s,i]of Object.entries(n))i===null?delete r[s]:r[s]=i;return r})}function un(e,t){const n=e.getMutationCache().findAll({mutationKey:we(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>eo(o.state.variables)))}function Re(e,t){e.resetQueries({queryKey:g.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function te(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof P);throw t.source==="local"&&s?(Re(e,n),new Ht(r)):(t.source==="local"&&Me(r)&&Re(e,n),r)}}const le=new Map;function fn(e,t,n,o){const r=le.get(o);if(r)return r;const s=qe(e,t,n,o,!0);return le.set(o,s),s.finally(()=>le.delete(o))}const Oe=new Set;function pr(e,t,n){const o=$.c(8),r=ne(),s=t?.orgSlug,i=t?.virtualMcpId,a=t?.branch;let l,c;o[0]!==e||o[1]!==a||o[2]!==n||o[3]!==s||o[4]!==r||o[5]!==i?(l=()=>{if(!e||!s||!i||!a)return;const f={orgSlug:s,virtualMcpId:i,branch:a};return Bo(u=>{u===n&&(Oe.has(n)||(Oe.add(n),mr(r,e,f,n).catch(br).finally(()=>Oe.delete(n))))})},c=[r,e,s,i,a,n],o[0]=e,o[1]=a,o[2]=n,o[3]=s,o[4]=r,o[5]=i,o[6]=l,o[7]=c):(l=o[6],c=o[7]),L.useEffect(l,c)}function br(){}async function mr(e,t,n,o){const r=le.get(o);return r&&await r.catch(()=>{}),fn(e,t,n,o)}async function qe(e,t,n,o,r){Z(e);const s=g.decofile(o),i=an(n,t),a=g.contentRevision(o),l=g.contentVersions(o),c=e.getQueryData(s),f=e.getQueryData(l),d=e.getQueryData(i),h=e.getQueryData(a)??void 0,p=r&&c&&f?h?.revision:void 0,v=r&&d?h?.schemaVersion:void 0,w=g.contentChanges(o),_=e.getQueryData(w);if(t.source==="github"&&t.hosted)return wr(e,t,t.hosted,n,o,{conditional:r,seen:h,currentMeta:d,schemaIfNoneMatch:v,seenChanges:_});const[E,R,I]=await te(e,t,n,()=>t.client.batch([{method:"blocks.list",params:p?{ifNoneMatch:p}:{}},{method:"schema.get",params:v?{ifNoneMatch:v}:{}},{method:"changes.list",params:Ue(_)}])),N=e.getQueryData(a)?.revision,x=N!==void 0&&N!==h?.revision;if(I?.ok){const O=x?null:fe(_,I.result);O&&e.setQueryData(w,O)}else I&&t.source==="local"&&Me(I.error)&&Re(e,n);if(!E?.ok)throw E?.error??new Error("no blocks.list");if(!R)throw new Error("no schema.get");const b=E.result,U=Qe(R),D=R.ok&&!U?R.result:null;if(b.notModified&&(!c||!f)||D?.notModified&&!d)return qe(e,t,n,o,!1);const T=b.notModified?new Set:un(e,n),j=b.notModified?c:Kn(b.blocks,c,T),C=U?Mt():D?D.notModified?d:D.schema:R.error;if(e.setQueryData(a,{revision:x?N:b.notModified?h?.revision:b.revision,schemaVersion:D?D.notModified?h?.schemaVersion:D.version??void 0:void 0}),e.setQueryData(s,j),!b.notModified){const O=e.getQueryData(l),M={...b.versions};for(const A of T){const k=O?.[A];k!==void 0?M[A]=k:delete M[A]}e.setQueryData(l,M)}return C instanceof P||e.setQueryData(i,C),!x&&!b.notModified&&c&&h?.revision&&b.revision!==h.revision&&sn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:j,meta:C}}async function wr(e,t,n,o,r,s){const i=g.decofile(r),a=g.contentIndex(r),l=g.contentRevision(r),c=g.contentVersions(r),f=an(o,t),u=g.contentChanges(r),d=e.getQueryData(a),h=s.conditional&&d?s.seen?.revision:void 0,[p,v,w]=await te(e,t,o,()=>n.batch([{method:"cms.index",params:h?{ifNoneMatch:h}:{}},{method:"schema.get",params:s.schemaIfNoneMatch?{ifNoneMatch:s.schemaIfNoneMatch}:{}},{method:"changes.list",params:Ue(s.seenChanges)}])),_=e.getQueryData(a)??d,E=e.getQueryData(l)?.revision,R=E!==void 0&&E!==s.seen?.revision;if(w?.ok&&!R){const y=fe(s.seenChanges,w.result);y&&e.setQueryData(u,y)}if(!p?.ok)throw p?.error??new Error("no cms.index");if(!v)throw new Error("no schema.get");const I=p.result,N=Qe(v),x=v.ok&&!N?v.result:null;if(I.notModified&&!d||x?.notModified&&!s.currentMeta)return qe(e,t,o,r,!1);const b=N?Mt():x?x.notModified?s.currentMeta:x.schema:v.error;b instanceof P||e.setQueryData(f,b);const U=x?x.notModified?s.seen?.schemaVersion:x.version??void 0:void 0,D=e.getQueryData(i)??{};if(I.notModified||R)return e.setQueryData(l,{revision:R?E:s.seen?.revision,schemaVersion:U}),e.setQueryData(i,D),{blocks:D,meta:b};const T={revision:I.revision,resolvedRef:I.resolvedRef,sequence:I.sequence,entries:I.entries,draft:I.draft};e.setQueryData(a,T);const j=!!s.seen?.revision&&T.revision!==s.seen.revision&&(!s.seen.revision.startsWith("s-")||!!d&&dn(d.draft,T.draft));j&&e.setQueryData(g.protocolDraftRead(o.orgSlug,o.virtualMcpId,o.branch),y=>y&&{...y,version:T.revision}),e.setQueryData(l,{revision:T.revision,schemaVersion:U});const C=un(e,o),O=e.getQueryData(c)??{},M={},A={},k=[];for(const[y,V]of Object.entries(D)){const m=T.entries[y];!m&&!C.has(y)||(M[y]=V,O[y]!==void 0&&(A[y]=O[y]),m&&!C.has(y)&&O[y]!==m.version&&k.push(y))}return e.setQueryData(i,M),e.setQueryData(c,A),k.length>0&&await xn(e,n,r,k,C),_&&j&&Sr(_,T)&&sn({queryClient:e,orgSlug:o.orgSlug,virtualMcpId:o.virtualMcpId,branch:o.branch,backend:t,cacheKey:r}),{blocks:e.getQueryData(i)??M,meta:b}}function Sr(e,t){if(dn(e.draft,t.draft))return!0;const n=Object.keys(t.entries);return n.length!==Object.keys(e.entries).length?!0:n.some(o=>!Object.hasOwn(e.entries,o)||e.entries[o]?.version!==t.entries[o]?.version)}function dn(e,t){const n=Object.keys(t);return n.length!==Object.keys(e).length?!0:n.some(o=>!Object.hasOwn(e,o)||e[o]?.version!==t[o]?.version)}function yr(e,t){const n=[...Object.keys(t.set??{}),...t.delete??[]];return Object.fromEntries(n.filter(o=>Object.hasOwn(e,o)).map(o=>[o,e[o]]))}function wt(e){if(!(e instanceof P)||e.code!==S.Unavailable)return;const t=e.data?.landed;if(!(!t||typeof t!="object"||Array.isArray(t)))return Object.fromEntries(Object.entries(t).filter(n=>typeof n[1]=="string"))}function Er(e,t){const n=Object.fromEntries(Object.entries(e.set??{}).filter(([r])=>!Object.hasOwn(t,r))),o=(e.delete??[]).filter(r=>!Object.hasOwn(t,r));return{...Object.keys(n).length>0?{set:n}:{},...o.length>0?{delete:o}:{}}}function St(e,t,n,o,r){Z(e),ln(e,t,n,{revision:e.getQueryData(g.contentRevision(n))?.revision??"",versions:r}),Ee(e,n,Object.fromEntries(Object.entries(r).map(([s,i])=>[s,i===ue?null:i]))),Dt(e,n,r,o.set??{})}async function Cs(e,t,n,o,r,s){if(t.source==="github"){const a=[...Object.keys(r.set??{}),...r.delete??[]].filter(c=>!s||!Object.hasOwn(s,c));if(a.length>0)throw new Error(`A hosted save needs a precondition for every block it touches (missing: ${a.join(", ")})`);const l=In(r.set);if(l.length>0)throw new Error(`A hosted save can't write a block that isn't loaded (${l.join(", ")})`)}return fr({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o},{kind:"edit",adopted:t.source==="github",write:async()=>{const i=f=>te(e,t,n,()=>t.client.blocksApply({set:f.set,delete:f.delete,...s?{ifMatch:yr(s,f)}:{}}));let a;try{a=await i(r)}catch(f){const u=t.source==="github"?wt(f):void 0;if(!u)throw f;const d=Er(r,u);Object.keys(u).length>0&&St(e,n,o,r,u);let h;try{h=await i(d)}catch(p){const v=wt(p);throw v&&Object.keys(v).length>0&&St(e,n,o,d,v),p}a={...h,versions:{...u,...h.versions}}}Z(e);const l=t.source==="github"?ln(e,n,o,a):a.revision;t.source==="github"&&Dt(e,o,a.versions??{},r.set??{}),e.setQueryData(g.contentRevision(o),f=>({...f,revision:l}));const c=a.versions??{};return Ee(e,o,c),{revision:l,versions:c}}})}function hn(e,t){if(!(e instanceof P))return;const n=e.data?.draft;if(!n||typeof n!="object"||!Object.hasOwn(n,t))return;const o=n[t];return o&&typeof o.version=="string"?o:void 0}function gn(e,t,n){if(!(n instanceof P))return;const o=n.data?.draft;if(!(!o||typeof o!="object"))for(const[r,s]of Object.entries(o))s===null&&pe(e,t,r,!1)}function vn(e,t,n,o){Z(e),Pn(e,n,o);const r=o.block===null,s=e.getQueryData(g.contentVersions(t)),i=e.getQueryData(g.contentChanges(t)),a=i?ee(i,n):void 0,l=a?a.baseVersion:s?.[n]??null;if(i){const c=B(n),f=Object.fromEntries(Object.entries(i.changes).filter(([u])=>B(u)!==c));r?l!==null&&(f[n]={kind:"delete",version:null,baseVersion:l}):f[n]={kind:"set",version:o.version,baseVersion:l},e.setQueryData(g.contentChanges(t),{...i,changes:f,edited:!0})}pe(e,t,n,r&&l===null),e.setQueryData(g.decofile(t),c=>{const f={...c};return r?delete f[n]:f[n]=o.block,f}),Ee(e,t,{[n]:r?null:o.version}),Rn(e,t,n,o)}function As(e,t,n,o){if(t.source!=="github"||!(o instanceof P))return!1;gn(e,n,o);const r=o.data?.draft;if(!r||typeof r!="object")return!1;const s=Object.keys(r),i=s.map(a=>hn(o,a));return s.length===0||i.some(a=>a===void 0)?!1:(e.cancelQueries({queryKey:g.decofile(n)}),s.forEach((a,l)=>{vn(e,n,a,i[l])}),!0)}async function Us(e,t,n,o,r,s){t.source==="github"&&gn(e,o,s);const i=t.source==="github"?hn(s,r):void 0;if(i)return e.cancelQueries({queryKey:g.decofile(o)}),vn(e,o,r,i),!0;await e.invalidateQueries({queryKey:g.decofile(o)});let a;try{const c=(await te(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(c&&c.after===null&&c.version!==null)return!1;a={value:c?.after??null,version:c?.version??null},t.source==="github"&&e.setQueryData(g.contentChanges(o),f=>{if(!f)return f;const u={...f.changes};return c?.kind?u[r]={kind:c.kind,version:c.version,baseVersion:c.baseVersion}:delete u[r],{...f,changes:u,edited:!0}})}catch{const l=await te(e,t,n,()=>t.client.blocksList({}));if(l.notModified)return!1;a={value:l.blocks[r]??null,version:l.versions[r]??null}}return e.setQueryData(g.decofile(o),l=>{const c={...l};return a.value===null?delete c[r]:c[r]=a.value,c}),Ee(e,o,{[r]:a.version}),!1}function Or(e){const t=$.c(17),n=Ce(e?.virtualMcpId)?.metadata;let o;t[0]!==n?(o=yt(n),t[0]=n,t[1]=o):o=t[1];const r=o;let s;t[2]!==e?.branch||t[3]!==e?.orgSlug||t[4]!==e?.virtualMcpId?(s=g.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[2]=e?.branch,t[3]=e?.orgSlug,t[4]=e?.virtualMcpId,t[5]=s):s=t[5];let i;t[6]!==e||t[7]!==r?(i=async()=>{const v=await Et(r,e.branch),w=v.pointer?.lastIndexOf("@")??-1;return{draft:v.pointer&&w>0?v.pointer.slice(0,w):null,version:v.pointer&&w>0?v.pointer.slice(w+1):v.etag}},t[6]=e,t[7]=r,t[8]=i):i=t[8];const a=!!e&&!!r;let l;t[9]!==s||t[10]!==i||t[11]!==a?(l={queryKey:s,queryFn:i,enabled:a,staleTime:Number.POSITIVE_INFINITY},t[9]=s,t[10]=i,t[11]=a,t[12]=l):l=t[12];const{data:c,isPending:f,isError:u}=F(l),d=!!e&&!!r&&f&&!u;if(!e||!c?.draft||!c.version){let v;return t[13]!==d?(v={pointer:null,pending:d},t[13]=d,t[14]=v):v=t[14],v}const h=`${c.draft}@${c.version}`;let p;return t[15]!==h?(p={pointer:h,pending:!1},t[15]=h,t[16]=p):p=t[16],p}function Ms(e){return Or(e).pointer}function Ls(e){const t=$.c(4);let n;t[0]!==e?(n=g.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Dr,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r?.revision}async function Dr(){throw new Error("content revisions are set by reads and writes")}function xe(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function Fs(e,t){return xe({...e,protocolSuffix:t.cacheKeySuffix})}function Ke(e,t){const n=$.c(6),{url:o}=Lt(e?.virtualMcpId),r=me(e?.virtualMcpId,e?.branch);if(!e)return"";let s;return n[0]!==r.cacheKeySuffix||n[1]!==r.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(s=r.kind==="protocol"?xe({...e,protocolSuffix:r.cacheKeySuffix}):xe({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=r.cacheKeySuffix,n[1]=r.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=s):s=n[5],s}function Qs(e,t){const n=$.c(46),{url:o}=Lt(e?.virtualMcpId),r=!!o,s=me(e?.virtualMcpId,e?.branch),i=s.kind==="protocol"?s:null,a=Ke(e),l=t?.fetchEnabled??!0,c=Ao(e?.virtualMcpId),f=_t(e?.virtualMcpId).runtime==="cms",u=ne();let d;n[0]!==a?(d=g.decofile(a),n[0]=a,n[1]=d):d=n[1];const h=d;pr(i,i&&e?e:null,a);let p;n[2]!==e||n[3]!==u||n[4]!==h?(p=()=>{if(!e||u.isMutating({mutationKey:we(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const O=u.getQueryState(h);return O?.fetchStatus==="fetching"||Date.now()-(O?.dataUpdatedAt??0)<Ft/2},n[2]=e,n[3]=u,n[4]=h,n[5]=p):p=n[5];let v;n[6]!==f||n[7]!==r||n[8]!==e||n[9]!==i||n[10]!==u||n[11]!==h?(v=async()=>{if(e){if(!i&&f&&!r){const O=So(u,e)?.version;if(O&&!await yo(e,O))return}await u.refetchQueries({queryKey:h,exact:!0},{cancelRefetch:!1})}},n[6]=f,n[7]=r,n[8]=e,n[9]=i,n[10]=u,n[11]=h,n[12]=v):v=n[12];let w;n[13]!==p||n[14]!==v?(w={skip:p,read:v},n[13]=p,n[14]=v,n[15]=w):w=n[15],To(!!t?.pollWhile&&!!e,w);const _=kt(i?.hosted?a:"");let E;n[16]!==s.kind||n[17]!==f||n[18]!==l||n[19]!==a||n[20]!==r||n[21]!==o||n[22]!==c||n[23]!==e||n[24]!==i||n[25]!==u?(E=async()=>{if(i)return(await fn(u,i,e,a)).blocks;if(s.kind==="unavailable")throw gr("decofile");if(r){const k=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(Ir),Q=k?.ok?dt(await k.text()):null;if(Q)return Q;const y=new Error("decofile unavailable (local tunnel unreachable)");throw y.status=502,y}if(f)return Oo(u,e);const O=()=>Co(e,po(c,".deco/blocks.gen.json"));if(l){const k=await fetch($o(e),{cache:"no-store"}).catch(_r);if(k?.ok){const V=dt(await k.text());if(V)return V}const Q=await O();if(Q.kind==="data")return Q.data;const y=new Error(`Failed to fetch decofile: ${k?.status??"network error"}`);throw y.status=gt({liveOk:!!k?.ok,liveStatus:k?.status,committedAbsent:Q.kind==="absent"}),y}const M=await O();if(M.kind==="data")return M.data;const A=new Error("decofile unavailable (preview down, no committed snapshot)");throw A.status=gt({liveOk:!1,committedAbsent:M.kind==="absent"}),A},n[16]=s.kind,n[17]=f,n[18]=l,n[19]=a,n[20]=r,n[21]=o,n[22]=c,n[23]=e,n[24]=i,n[25]=u,n[26]=E):E=n[26];const R=!!e&&s.kind!=="pending",I=i?0:3e4,N=i?.describe.pollIntervalMs,x=i?"always":void 0;let b;n[27]!==f||n[28]!==r||n[29]!==i?(b=(O,M)=>{if(i||f||r)return O<3;const A=M.status;return A!==502&&A!==404&&O<2},n[27]=f,n[28]=r,n[29]=i,n[30]=b):b=n[30];let U;n[31]!==h||n[32]!==E||n[33]!==R||n[34]!==I||n[35]!==N||n[36]!==x||n[37]!==b?(U={queryKey:h,queryFn:E,enabled:R,staleTime:I,refetchInterval:N,refetchIntervalInBackground:!1,refetchOnWindowFocus:x,retry:b,retryDelay:kr},n[31]=h,n[32]=E,n[33]=R,n[34]=I,n[35]=N,n[36]=x,n[37]=b,n[38]=U):U=n[38];const D=F(U);let T;n[39]!==_||n[40]!==D?(T=_&&D.data?$n(_,D.data):void 0,n[39]=_,n[40]=D,n[41]=T):T=n[41];const j=T;let C;return n[42]!==j||n[43]!==i?.hosted||n[44]!==D?(C=i?.hosted&&j?{...D,data:j}:D,n[42]=j,n[43]=i?.hosted,n[44]=D,n[45]=C):C=n[45],C}function kr(e){return jn(5e3,1e3,e,2,0)}function _r(){return null}function Ir(){return null}function Vs(e,t,n){const o=me(e?.virtualMcpId,e?.branch),r=Ke(e),s=o.kind==="protocol"?o.hosted:void 0;return Nn(s,r,t,n)}function Bs(e,t){const n=$.c(3),o=me(e?.virtualMcpId,e?.branch),r=Ke(e),s=kt(o.kind==="protocol"&&o.hosted?r:"");let i;return n[0]!==s?.entries||n[1]!==t?(i=Object.entries(s?.entries??{}).filter(a=>{const[,l]=a;return t(l.meta?.type??"")}).map(Tr),n[0]=s?.entries,n[1]=t,n[2]=i):i=n[2],i}function Tr(e){const[t]=e;return t}const Pr="site-editor-save",pn={id:Pr,description:void 0,action:void 0,cancel:void 0},Hs="site-editor-undo",$e="site-editor-publish";function Rr(e){const t=$.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=Y.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1];let s;t[2]!==o?(s=Y.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=Y.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function bn(e,t){return t?Y.jsx(Rr,{label:e("siteEditor.details"),detail:t}):void 0}function Js(e,t,n){K.error(Wt(e,t,n),{...pn,description:bn(e,Uo(t,n))})}function Ws(e,t,n=!1){K.info(e(t?"sectionsEditor.reconcile.leftDeleted":"sectionsEditor.reconcile.keptTheirs"),{...pn,description:e(t?n?"sectionsEditor.reconcile.leftDeletedNeverPublishedHint":"sectionsEditor.reconcile.leftDeletedHint":"sectionsEditor.reconcile.keptTheirsHint")})}const mn={action:void 0,duration:void 0};function Gs(e,t){K.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...mn,id:$e,description:void 0})}function Ys(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=bn(e,o??null);K[i](t,{id:$e,description:n&&a?Y.jsxs(Y.Fragment,{children:[Y.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:l=>{l.preventDefault(),K.loading(s??e("thread.publishPopover.publishing"),{...mn,id:$e,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function zs(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Fs as $,ms as A,xs as B,Kr as C,Or as D,Vs as E,z as F,sr as G,ks as H,Es as I,he as J,zo as K,Xo as L,ds as M,Os as N,gs as O,Ts as P,Is as Q,dr as R,Ke as S,Ct as T,Ls as U,ps as V,bo as W,we as X,fr as Y,jo as Z,mo as _,Xr as a,Br as a0,Jr as a1,Bs as a2,Ws as a3,Ns as a4,fs as a5,Je as a6,us as a7,mr as a8,Ye as a9,As as aA,fn as aB,gr as aC,ls as aD,$e as aE,mn as aF,Gs as aG,Ps as aH,Qr as aI,Vr as aJ,Me as aK,ss as aL,Ms as aM,vs as aN,X as aO,hs as aP,Ys as aQ,Hs as aR,pn as aS,un as aT,bs as aU,cs as aV,ws as aW,Ss as aX,ys as aY,Cs as aa,Us as ab,Js as ac,$s as ad,an as ae,wo as af,is as ag,Rs as ah,js as ai,qr as aj,os as ak,ct as al,lt as am,rs as an,xo as ao,ts as ap,Yn as aq,bn as ar,zs as as,Go as at,Hr as au,Qn as av,Rr as aw,_s as ax,Ds as ay,ze as az,Xn as b,Lt as c,Gn as d,zr as e,zn as f,He as g,Ae as h,xt as i,as as j,Po as k,Qs as l,Zr as m,ns as n,Ao as o,Wr as p,po as q,Yr as r,Gr as s,qo as t,me as u,Ko as v,Jo as w,Co as x,At as y,es as z};
|