decocms 4.568.2 → 4.569.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-C8Ovs13g.js → AlertCircle-C8lUSNa8.js} +1 -1
- package/dist/client/assets/{AreaChart-BPZ71FQT.js → AreaChart-Co4_GDFk.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BevitLPy.js → ArrowLeft-BW0QTKlw.js} +1 -1
- package/dist/client/assets/{ArrowUp-LKVB7Ud3.js → ArrowUp-DjenQeZQ.js} +1 -1
- package/dist/client/assets/{CartesianChart-BKvZsEJJ.js → CartesianChart-KHpxFlDw.js} +1 -1
- package/dist/client/assets/{CategoricalChart-BAz9vqhr.js → CategoricalChart-DCWzRRkG.js} +1 -1
- package/dist/client/assets/{CheckCircle-6PthhUL2.js → CheckCircle-CBLXbFFB.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-DPCJGeHn.js → ChevronSelectorVertical-ofVA6B_w.js} +1 -1
- package/dist/client/assets/{ChevronUp-CpgR3_nb.js → ChevronUp-Dg02PCVC.js} +1 -1
- package/dist/client/assets/{CreditCard01-C2oB4pfr.js → CreditCard01-F1q7cqMP.js} +1 -1
- package/dist/client/assets/{Globe04-BhKEHcph.js → Globe04-B7JSn39b.js} +1 -1
- package/dist/client/assets/{Key01-BSJHIVa1.js → Key01-DPrG8yA6.js} +1 -1
- package/dist/client/assets/{LinkBroken01-BBFDlqgt.js → LinkBroken01-DfOqWtEB.js} +1 -1
- package/dist/client/assets/{Minus-CVdaI4Fm.js → Minus-CtT-IgpU.js} +1 -1
- package/dist/client/assets/{Monitor01-Cuob4vSq.js → Monitor01-CY6I-T_v.js} +1 -1
- package/dist/client/assets/{Play-Da9nWpcs.js → Play-Cb465MQD.js} +1 -1
- package/dist/client/assets/{Plus-_9GNTGSE.js → Plus-EDJqelyG.js} +1 -1
- package/dist/client/assets/{ReferenceLine-DsOcULXV.js → ReferenceLine-M7tH9_wm.js} +1 -1
- package/dist/client/assets/{SearchMd-CW3ppy8-.js → SearchMd-BM1-RWQF.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-B5QyiZLr.js → ShoppingBag01-BsFRFwoQ.js} +1 -1
- package/dist/client/assets/{Sun-BDkIkIw6.js → Sun-BPyrKfqp.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Mkrao4SC.js → SwitchHorizontal01-CMdcXPwO.js} +1 -1
- package/dist/client/assets/{Tool01-B3AGNBtQ.js → Tool01-CuDHSO34.js} +1 -1
- package/dist/client/assets/{Tooltip-VyzG-XyD.js → Tooltip-BY8JGJJH.js} +1 -1
- package/dist/client/assets/{Trash01-BMv3ZifH.js → Trash01-Bif7g_Tq.js} +1 -1
- package/dist/client/assets/{Upload01-C0aUrRmk.js → Upload01-Drv81LKH.js} +1 -1
- package/dist/client/assets/{UserSquare-Vj3086v1.js → UserSquare-DqOeWgs_.js} +1 -1
- package/dist/client/assets/{Users01-B9jA9cs-.js → Users01-DSPCiWrI.js} +1 -1
- package/dist/client/assets/{XClose-BIHWtUjo.js → XClose-CFLo0iwC.js} +1 -1
- package/dist/client/assets/{Zap-TomaYxmL.js → Zap-TzUnnTO5.js} +1 -1
- package/dist/client/assets/{access-gate-Kza0R1uM.js → access-gate-BZysXSEP.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-P67nq7X-.js → add-connection-dialog-Bj8rQn7t.js} +1 -1
- package/dist/client/assets/agent-app-B0ADSPIl.js +1 -0
- package/dist/client/assets/{agent-assets-DtbqMuB9.js → agent-assets-de3dSSE0.js} +1 -1
- package/dist/client/assets/{agent-automation-DAvuTlAb.js → agent-automation-Eoz9llO0.js} +1 -1
- package/dist/client/assets/{agent-automations-NySBiOWw.js → agent-automations-YrodALnn.js} +1 -1
- package/dist/client/assets/{agent-calendar-CH42INb4.js → agent-calendar-BaQX5CRD.js} +1 -1
- package/dist/client/assets/{agent-capabilities-W9vBXHXR.js → agent-capabilities-Z6OO2Jnk.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-DhfPL4pD.js → agent-connect-sources-C9AyKvNN.js} +1 -1
- package/dist/client/assets/agent-deck-FWdv6Cpu.js +1 -0
- package/dist/client/assets/{agent-e2e-BU2QcQtT.js → agent-e2e-7RobNFIi.js} +1 -1
- package/dist/client/assets/agent-experiments-zhmtYFsP.js +1 -0
- package/dist/client/assets/{agent-file-3PXh2x7T.js → agent-file-Dbl-JFZv.js} +1 -1
- package/dist/client/assets/{agent-hosting-DP-fQO-C.js → agent-hosting-CqO-A-Yx.js} +1 -1
- package/dist/client/assets/{agent-icon-CqeITJaa.js → agent-icon-CRaK_2eb.js} +1 -1
- package/dist/client/assets/agent-library-C9bPwpZT.js +1 -0
- package/dist/client/assets/agent-library-file-CJqPNg_v.js +1 -0
- package/dist/client/assets/agent-overview-DIZADCxs.js +1 -0
- package/dist/client/assets/{agent-releases-BUU1ZC1p.js → agent-releases-DELNaOnx.js} +1 -1
- package/dist/client/assets/agent-settings-BXotmRnL.js +1 -0
- package/dist/client/assets/{agent-site-editor-mLmsToBw.js → agent-site-editor-CZ_aX5w6.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-Bd4DxsVE.js +2 -0
- package/dist/client/assets/agent-site-editor-content-BOAu460T.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-DIPhJI1V.js +1 -0
- package/dist/client/assets/agent-view-CQ1k8Ncp.js +1 -0
- package/dist/client/assets/{agent-view-guard-CEF0TLXe.js → agent-view-guard-DQbhiGaj.js} +1 -1
- package/dist/client/assets/{ai-providers-Bk0b8lBS.js → ai-providers-ByQv34ay.js} +1 -1
- package/dist/client/assets/{alert-DVyXeSP0.js → alert-D9FiKroy.js} +1 -1
- package/dist/client/assets/{analytics-sections-HglAPM52.js → analytics-sections-BmDNYduw.js} +1 -1
- package/dist/client/assets/api-keys-4E58id83.js +1 -0
- package/dist/client/assets/{api-keys-CPcOhmA3.js → api-keys-BfsLg2vA.js} +1 -1
- package/dist/client/assets/{app-editor-BuVYUcC0.js → app-editor-B45vF8Mg.js} +1 -1
- package/dist/client/assets/{asset-utils-B_PFTFoC.js → asset-utils-BxC41cma.js} +1 -1
- package/dist/client/assets/{auth-DmpUBIs7.js → auth-Ds2S-lbe.js} +1 -1
- package/dist/client/assets/{auth-catchall-CFzPqvha.js → auth-catchall-C-6FZGi0.js} +1 -1
- package/dist/client/assets/{auth-entry-wXfEcyl9.js → auth-entry-CyO_cwvd.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BjY-DDgX.js → auth-split-layout-m3Tiw0uy.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DaaDxUin.js → authenticate-and-persist-oauth-D8AvdBCW.js} +1 -1
- package/dist/client/assets/{automation-list-row-DXb5up2E.js → automation-list-row-C9ktMtT0.js} +1 -1
- package/dist/client/assets/{automation-runs-BAUKeHIB.js → automation-runs-BOw5cx8_.js} +1 -1
- package/dist/client/assets/{automations-BvaZrGnV.js → automations-B7fWZ0Vh.js} +1 -1
- package/dist/client/assets/{autosend-BVZJx1Ct.js → autosend-DDd9ei6A.js} +1 -1
- package/dist/client/assets/{badge-DzMp3mdM.js → badge-BpuDiibz.js} +1 -1
- package/dist/client/assets/{block-document-bjE6-3hu.js → block-document-0xSm2fiy.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-BL9PsmSD.js → blocks-preview-workspace-context-BKKCrT_T.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-ifXBK4F2.js → blocks-tab-states-D0oTw6gu.js} +1 -1
- package/dist/client/assets/{blog-schema-rddaOm3X.js → blog-schema-BppY95gR.js} +1 -1
- package/dist/client/assets/{buckets-BzOMugSD.js → buckets-CqGWJLKP.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-BYoR7ku5.js → build-improve-prompt-doc-BGIBlPP6.js} +1 -1
- package/dist/client/assets/{calendar-BJC2oYOH.js → calendar-DuGzMi3S.js} +1 -1
- package/dist/client/assets/{capability-load-error-N3peg2W6.js → capability-load-error-DIv2eZlz.js} +1 -1
- package/dist/client/assets/{category-editor-11ETFMeQ.js → category-editor-DHDmibyv.js} +1 -1
- package/dist/client/assets/{chart-BaW3HlzU.js → chart-BcizaXxw.js} +1 -1
- package/dist/client/assets/{chat-context-Bc7GhR8U.js → chat-context-O7Uim5zw.js} +1 -1
- package/dist/client/assets/{chat-draft-CnT-R9KP.js → chat-draft-CP7W66gO.js} +1 -1
- package/dist/client/assets/{checkbox-Djgrt1vS.js → checkbox-Dj1_p-oY.js} +1 -1
- package/dist/client/assets/{choose-editor-BY15-a1C.js → choose-editor-FgTuu-ql.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Wkek8Nxt.js → cli-auth-success-CNmrqva7.js} +1 -1
- package/dist/client/assets/{client-icons-DUqNvNJS.js → client-icons-BF-arSHb.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-CMQtdcSG.js → cms-settings-editor-BOyoDLZX.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-BakCAk7K.js → cms-store-drafts-DiBAZwre.js} +1 -1
- package/dist/client/assets/{collapsible-Cu2ykx45.js → collapsible-Bp1-V-Fv.js} +1 -1
- package/dist/client/assets/{collection-detail-CnJWnmsp.js → collection-detail-DBSAOtJN.js} +1 -1
- package/dist/client/assets/{collection-display-button-NSxOZ5TH.js → collection-display-button-C5ml6MSP.js} +1 -1
- package/dist/client/assets/{collection-search-ClV5mqoe.js → collection-search-AauU22W8.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Dh8uL3pb.js → collection-table-wrapper-qRDLH-yA.js} +1 -1
- package/dist/client/assets/{collection-tabs-T0QGfCDZ.js → collection-tabs-DO7nBfoY.js} +1 -1
- package/dist/client/assets/{combobox-Cx-C-l4z.js → combobox-dI6mnh2K.js} +1 -1
- package/dist/client/assets/{command-DgSBNjBh.js → command-BO5QH15f.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-zXENoXl8.js → companion-mcps-section-CbUF3EiL.js} +1 -1
- package/dist/client/assets/{config-1zqgWIk2.js → config-w5HL15RE.js} +1 -1
- package/dist/client/assets/{connect-DrCZmYlD.js → connect-Dv7_pdgv.js} +1 -1
- package/dist/client/assets/{connect-layout-DQ4O9ewt.js → connect-layout-DIUYH7zZ.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-BFfL8MZO.js → connect-source-dialog-5pyz_gqC.js} +1 -1
- package/dist/client/assets/{connection-DHqLhyYm.js → connection-BmfrUVUF.js} +1 -1
- package/dist/client/assets/{connection-card-yh4MTPg_.js → connection-card-Dyl9jamP.js} +1 -1
- package/dist/client/assets/{connection-detail-CLMyx8eY.js → connection-detail-trf1a8ud.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Bp0P0TC9.js → connection-form-helpers-DkXWTd-5.js} +1 -1
- package/dist/client/assets/{connection-slug-nir9u1BL.js → connection-slug-D9QF6JTj.js} +1 -1
- package/dist/client/assets/{connections-DvAElJBj.js → connections-DBn4X-FO.js} +1 -1
- package/dist/client/assets/{content-tab-ClOEdPwZ.js → content-tab-eUiPWbq7.js} +3 -3
- package/dist/client/assets/{context-Duc_mQnE.js → context-Dm1vgWac.js} +1 -1
- package/dist/client/assets/{context-menu-Cxk9gBC0.js → context-menu-BG18ePnL.js} +1 -1
- package/dist/client/assets/{context-shell-DUWqXQZN.js → context-shell-CJdcogAj.js} +3 -3
- package/dist/client/assets/{core.esm-DAx4DJuz.js → core.esm-CiyyLnsG.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BjqA3lpc.js → create-organization-dialog-DeokYGJM.js} +1 -1
- package/dist/client/assets/{device-hint-DPZT-Xea.js → device-hint-Z9_uJm09.js} +1 -1
- package/dist/client/assets/{discover-BY4Mr8uM.js → discover-BJzOKOeT.js} +1 -1
- package/dist/client/assets/{domain-settings-CbT821rp.js → domain-settings-k6_UVS3e.js} +1 -1
- package/dist/client/assets/{drawer-BFx-bd_L.js → drawer-DMRnFsxc.js} +1 -1
- package/dist/client/assets/{editor-C09OhWY7.js → editor-BTYObZ3D.js} +1 -1
- package/dist/client/assets/{editor-classes-CBvy4Zr6.js → editor-classes-DIdZ5SUW.js} +1 -1
- package/dist/client/assets/{empty-state-DUTglEtg.js → empty-state-B44K4GDI.js} +1 -1
- package/dist/client/assets/{empty-state-UqiTRa_b.js → empty-state-BTVsC7xK.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-DVTcfAT7.js → experiments-tab-choice-CzcNWwIa.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Dc6vmoBL.js → extract-connection-data-BAO6488m.js} +1 -1
- package/dist/client/assets/{feature-gate-DIvD2qXm.js → feature-gate-D17dqUhL.js} +1 -1
- package/dist/client/assets/{feature-paywall-Ds90JgjK.js → feature-paywall-BAqosyy1.js} +1 -1
- package/dist/client/assets/{feedback-JjHaNOsE.js → feedback-BCnQQwEu.js} +1 -1
- package/dist/client/assets/{file-explorer-CluRXZ37.js → file-explorer-DpZFO-Yb.js} +1 -1
- package/dist/client/assets/{file-preview-D8Si3yqg.js → file-preview-C7xeW7Ns.js} +1 -1
- package/dist/client/assets/{file-share-button-BMnJAgQ5.js → file-share-button-Cj2TiEru.js} +1 -1
- package/dist/client/assets/{file-type-icon-CNSXAyFe.js → file-type-icon-BgvZ7mJ5.js} +1 -1
- package/dist/client/assets/{folder-icon-C89oXJaH.js → folder-icon-CC-uKBN4.js} +1 -1
- package/dist/client/assets/{form-DpIMBI8y.js → form-CQzCiA7m.js} +1 -1
- package/dist/client/assets/{general-DHFARAaC.js → general-WB7AI2JV.js} +1 -1
- package/dist/client/assets/{github-icon-DewiI3zK.js → github-icon-Dq39pEMT.js} +1 -1
- package/dist/client/assets/{home-DUBEI8qS.js → home-DNtWj6y4.js} +1 -1
- package/dist/client/assets/{home-overview-BoEkJpNz.js → home-overview-KMaj_IXE.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-97iAdZVR.js → hosted-reconcile-C-OJGDnV.js} +1 -1
- package/dist/client/assets/{icon-button-BfxFpZIz.js → icon-button-BxjZlrnJ.js} +1 -1
- package/dist/client/assets/{index-Bv7_FvT_.js → index-0imbfLx3.js} +1 -1
- package/dist/client/assets/{index-CYEUdIaI.js → index-B541Z8pm.js} +1 -1
- package/dist/client/assets/{index-_xfuQegh.js → index-BK7nI4x8.js} +1 -1
- package/dist/client/assets/{index-DYz5vKDK.js → index-BZnluLX8.js} +1 -1
- package/dist/client/assets/{index-sUdqwSqQ.js → index-CGYr3Izo.js} +1 -1
- package/dist/client/assets/{index-B64fyQ1o.js → index-CJj8VLTq.js} +1 -1
- package/dist/client/assets/{index-cBEKd_zd.js → index-CMI5yx1h.js} +1 -1
- package/dist/client/assets/{index-BIHeqmlu.js → index-CZmp59DI.js} +1 -1
- package/dist/client/assets/{index-YAbWBpI2.js → index-Cm-moWa5.js} +3 -3
- package/dist/client/assets/{index-D3yQzMmD.js → index-D8rwwuoa.js} +1 -1
- package/dist/client/assets/{index-7uos3LCQ.js → index-DBE1cmuY.js} +1 -1
- package/dist/client/assets/{index-ooZoGt7g.js → index-DDHS6uH4.js} +1 -1
- package/dist/client/assets/{index-BA4wFQV0.js → index-DfAh0E81.js} +1 -1
- package/dist/client/assets/{index-DnPa3j4q.js → index-DhSgpwmt.js} +1 -1
- package/dist/client/assets/{index-BLlatKRp.js → index-O8I8IW_m.js} +1 -1
- package/dist/client/assets/{index-BqI8ssrO.js → index-pMcMdeCf.js} +1 -1
- package/dist/client/assets/{index-redirect-o6Cxf_-C.js → index-redirect-DzUS6M4j.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BetHfx9E.js → infiniteQueryObserver-D6uRpwx5.js} +1 -1
- package/dist/client/assets/{infra-billing-C4-Upy26.js → infra-billing-DuXLPrYd.js} +1 -1
- package/dist/client/assets/{input-DD9yaa2N.js → input-Blfx4aW7.js} +1 -1
- package/dist/client/assets/{input-BwL2yzTb.js → input-DhrW1toc.js} +3 -3
- package/dist/client/assets/{integration-icon-BJPq2ynB.js → integration-icon-CDajRnkl.js} +1 -1
- package/dist/client/assets/{jira-icon-BJ1Yqfz3.js → jira-icon-BjvaFHGW.js} +1 -1
- package/dist/client/assets/{label-ERMWTDM1.js → label-BwDzqaMo.js} +1 -1
- package/dist/client/assets/{layout-Clyb314Q.js → layout-BFtQxqvc.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DXqg162W.js → legacy-agents-deep-ClovinDV.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-DnsMd1-f.js → legacy-main-redirect-CXwADpls.js} +1 -1
- package/dist/client/assets/library-BWyOfhBW.js +1 -0
- package/dist/client/assets/{library-tab-B4AZKZNW.js → library-tab-D9aFdK2S.js} +1 -1
- package/dist/client/assets/{login-DoyIZZDV.js → login-BKJiNyyp.js} +1 -1
- package/dist/client/assets/{markdown-XW6Y_EoI.js → markdown-BukU_dP8.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DL7gNCl6.js → mcp-app-renderer-C-v6StvL.js} +1 -1
- package/dist/client/assets/{mcp-oauth-rHESfw1u.js → mcp-oauth-CY66kpRN.js} +1 -1
- package/dist/client/assets/{mcp-oauth-PRMkVXh1.js → mcp-oauth-CxEXOBcT.js} +1 -1
- package/dist/client/assets/{members-DBffdKOk.js → members-CF-gnn8J.js} +1 -1
- package/dist/client/assets/{memory-DTe7ai10.js → memory-CdLLa3Kl.js} +1 -1
- package/dist/client/assets/{mock-board-Dcrv6S29.js → mock-board-DElhppkh.js} +3 -3
- package/dist/client/assets/{monaco-editor-Bomp4HmR.js → monaco-editor-BNkAcsUY.js} +1 -1
- package/dist/client/assets/{monitoring-CKTJkohg.js → monitoring-C-ycc-h_.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BVMN-DLg.js → monitoring-stats-row-B0tic5F9.js} +1 -1
- package/dist/client/assets/{multi-select-D9N-nXLY.js → multi-select-FgNDnuDo.js} +1 -1
- package/dist/client/assets/{mustache-eb_Bg87y.js → mustache-CIeVDhQo.js} +1 -1
- package/dist/client/assets/{named-rule-view-zp9L0ztj.js → named-rule-view-9PjPoj8p.js} +1 -1
- package/dist/client/assets/{new-project-dialog-CxL0mjQ3.js → new-project-dialog-DHaEULY3.js} +1 -1
- package/dist/client/assets/{oauth-callback-BXFUoube.js → oauth-callback-B3eu4Ach.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-C-SfsQUr.js → oauth-callback-ai-provider-CqUI9sqZ.js} +1 -1
- package/dist/client/assets/{oauth-consent-hR2Ry0UE.js → oauth-consent-r8Ehs0lB.js} +1 -1
- package/dist/client/assets/{onboarding-IOMBN2u3.js → onboarding-BTBq2ggs.js} +1 -1
- package/dist/client/assets/{openai-conversation-U4xBjBfE.js → openai-conversation-p1k1gWxX.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-DlG0FgvT.js → optimistic-project-sidebar-views-DWWGhnPv.js} +1 -1
- package/dist/client/assets/{order-monitor-day-DHO_k1R7.js → order-monitor-day-CChR5TYK.js} +1 -1
- package/dist/client/assets/{organization-choice-SsLKJxTz.js → organization-choice-Cw7nqarH.js} +1 -1
- package/dist/client/assets/{orgs-CN24uHaU.js → orgs-Do-VFG6Q.js} +1 -1
- package/dist/client/assets/{own-accounts-section-DiMchtro.js → own-accounts-section-CfrXQu2D.js} +1 -1
- package/dist/client/assets/{pair-BzX9EpMl.js → pair-CQCTPbi0.js} +1 -1
- package/dist/client/assets/{parse-sections-UGlsQq9_.js → parse-sections-DfTZ3uiV.js} +3 -3
- package/dist/client/assets/{plan-CwrMkHhz.js → plan-DD5HWH6n.js} +1 -1
- package/dist/client/assets/{plan-ladder-BmHzS4XX.js → plan-ladder-DPpGlKZx.js} +1 -1
- package/dist/client/assets/{plan-usage-card-BPrhaw5t.js → plan-usage-card-DWpMRf7u.js} +1 -1
- package/dist/client/assets/{popover-eKoh4-Z1.js → popover-DLErjFx_.js} +1 -1
- package/dist/client/assets/{post-calendar-5-RTMM86.js → post-calendar-CK1SMoTM.js} +1 -1
- package/dist/client/assets/{post-editor-bG2s_3vv.js → post-editor-DisluBT5.js} +1 -1
- package/dist/client/assets/{preview-content-B0_lha9p.js → preview-content-DnVFo2zs.js} +1 -1
- package/dist/client/assets/{preview-dialog-Ci3FAVDm.js → preview-dialog-DUS21naY.js} +1 -1
- package/dist/client/assets/{preview-panel-BuqHC95v.js → preview-panel-D7uUNbcL.js} +1 -1
- package/dist/client/assets/{preview-tab-ChwoL7Do.js → preview-tab-Ahs-yhYv.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-DkygTQUe.js → product-picker-dialog-C2vgULGa.js} +1 -1
- package/dist/client/assets/{profile-GstFURmM.js → profile-DDNj47eG.js} +1 -1
- package/dist/client/assets/{project-app-view-BML0V8pu.js → project-app-view-CuA06XiE.js} +1 -1
- package/dist/client/assets/{project-apps-BFVy6oqU.js → project-apps-DWbss0KI.js} +1 -1
- package/dist/client/assets/{project-icon-DRALSoCE.js → project-icon-BUFanmLS.js} +1 -1
- package/dist/client/assets/{project-index-0ZlMTyxM.js → project-index-7p2eseSo.js} +1 -1
- package/dist/client/assets/project-reports-DvoGEV_S.js +1 -0
- package/dist/client/assets/{project-sidebar-views-IsAuRqFR.js → project-sidebar-views-pH1XKMU9.js} +1 -1
- package/dist/client/assets/project-tasks-3w3MRdO3.js +1 -0
- package/dist/client/assets/{projects-Cwfayn5A.js → projects-DLcZ2EUB.js} +1 -1
- package/dist/client/assets/{projects-empty-state-BLo1oUuy.js → projects-empty-state-5N5mL8dT.js} +1 -1
- package/dist/client/assets/{prompts-geIlmCw0.js → prompts-D_luUyMG.js} +1 -1
- package/dist/client/assets/record-editor-CuEUlJ7c.js +1 -0
- package/dist/client/assets/{redirect-editor-CZ8Jt6Rk.js → redirect-editor-CFnitpju.js} +1 -1
- package/dist/client/assets/{reports-SAO6FB-Y.js → reports-BORTq3kl.js} +1 -1
- package/dist/client/assets/reports-BllquOlr.js +1 -0
- package/dist/client/assets/{reports-onboarding-8dWVmpHn.js → reports-onboarding-BWbcZ2GX.js} +1 -1
- package/dist/client/assets/{reports-tab-ICX3CL8K.js → reports-tab-B-Hn1LIV.js} +2 -2
- package/dist/client/assets/repositories-B1CtO4Nn.js +1 -0
- package/dist/client/assets/{repositories-CEe5dTCI.js → repositories-BVZQH-sB.js} +1 -1
- package/dist/client/assets/{repository-binding-BEFtyvwg.js → repository-binding-B7kVJGqt.js} +1 -1
- package/dist/client/assets/{repository-picker-dYbX0JPX.js → repository-picker-CjOhm0Ey.js} +1 -1
- package/dist/client/assets/{require-capability-C_BedkF8.js → require-capability-CJKpnzPC.js} +1 -1
- package/dist/client/assets/{required-auth-layout-B2yDP8xU.js → required-auth-layout-Cv1Or1o2.js} +1 -1
- package/dist/client/assets/{reset-password-HMJAQkaR.js → reset-password-DW52Np0r.js} +1 -1
- package/dist/client/assets/{resizable-CXcYWQyr.js → resizable-DyfDlaKB.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-CSavMQhX.js → resolve-tab-icon-BA6C6Jfy.js} +1 -1
- package/dist/client/assets/{review-settings-HR5AJuT5.js → review-settings-DV90EMNs.js} +1 -1
- package/dist/client/assets/{role-color-XqQUBPY2.js → role-color-BCYUEsYA.js} +1 -1
- package/dist/client/assets/{roles-WFtvt_td.js → roles-BuwDNuGG.js} +1 -1
- package/dist/client/assets/route-6u2HC7D0.js +1 -0
- package/dist/client/assets/{route-BeJKDC7d.js → route-CVmwmVAO.js} +1 -1
- package/dist/client/assets/{route-CUPbBKJB.js → route-kdlreTx0.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-CFqytSKR.js → sandbox-lifecycle-context-CNzI4oJx.js} +1 -1
- package/dist/client/assets/{schema-CU--MvCG.js → schema-BJHp07rJ.js} +1 -1
- package/dist/client/assets/{schema-s_8X_Pq7.js → schema-iQl5fqzx.js} +1 -1
- package/dist/client/assets/{scroll-area-V--N6BXn.js → scroll-area-ASqVshf_.js} +1 -1
- package/dist/client/assets/{search-input-BQcAdCac.js → search-input-CpR7MF4a.js} +1 -1
- package/dist/client/assets/{search-toggle-BQnVnCJm.js → search-toggle-Y8EXpMEc.js} +1 -1
- package/dist/client/assets/{secret-picker-kAED7ZfH.js → secret-picker-Br5fCyJR.js} +1 -1
- package/dist/client/assets/{secrets-CI8FkMIy.js → secrets-B5CgD_04.js} +1 -1
- package/dist/client/assets/{section-array-field-D45EV3Ua.js → section-array-field-DVc_SUaS.js} +1 -1
- package/dist/client/assets/{sections-editor-DGs8wpRP.js → sections-editor-lkKcQFno.js} +1 -1
- package/dist/client/assets/{sections-ChpddIHY.js → sections-zGZh6wSh.js} +1 -1
- package/dist/client/assets/{select-BkMg57qf.js → select-Bc6SUkDB.js} +1 -1
- package/dist/client/assets/{select-model-Dxh581PI.js → select-model-DoenYnGG.js} +1 -1
- package/dist/client/assets/{seo-editor-46VthC2w.js → seo-editor-_aB2qgvo.js} +1 -1
- package/dist/client/assets/{separator-XP0nOrIu.js → separator-sTUHAoAe.js} +1 -1
- package/dist/client/assets/settings-tab-DhF3HWFp.js +1 -0
- package/dist/client/assets/{sheet-B4T7-RMg.js → sheet-DplVXaxG.js} +1 -1
- package/dist/client/assets/{shell-layout-BejViDQa.js → shell-layout-n8ud5acT.js} +1 -1
- package/dist/client/assets/{site-draft-actions-QFmuYxUg.js → site-draft-actions-D6MDFwbu.js} +1 -1
- package/dist/client/assets/{site-draft-view-ffleha4j.js → site-draft-view-KDIF-X3e.js} +1 -1
- package/dist/client/assets/site-editor-By4hUbCH.js +1 -0
- package/dist/client/assets/{site-editor-toast-B1S7n1Id.js → site-editor-toast-C6zgUX0e.js} +1 -1
- package/dist/client/assets/{skills-BIRzMqs8.js → skills-C0c78VRl.js} +1 -1
- package/dist/client/assets/{slider-B7-Cm7k7.js → slider-GSuedGm_.js} +1 -1
- package/dist/client/assets/{sortable.esm-CW_p4INX.js → sortable.esm-BIp1gAsr.js} +1 -1
- package/dist/client/assets/{sso-BsU2HJVe.js → sso-CYU8G0dx.js} +1 -1
- package/dist/client/assets/{suggestion-DbrJ_AD8.js → suggestion-CyNVbkov.js} +1 -1
- package/dist/client/assets/{switch-B_lDpEA0.js → switch-Ddk_-Adw.js} +1 -1
- package/dist/client/assets/{synced-repos-DCv_vlRR.js → synced-repos-BoVbsdN8.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-6tkQpk4Q.js → tab-icon-glyph-Bib8sDT3.js} +1 -1
- package/dist/client/assets/{table-C6s_VKOi.js → table-CDpozwVb.js} +1 -1
- package/dist/client/assets/{tabs-DlRJfLwT.js → tabs-BBBKV7Oj.js} +1 -1
- package/dist/client/assets/{task-board-DUco_y7A.js → task-board-CIxtWADL.js} +1 -1
- package/dist/client/assets/{task-route-CRs-eXmU.js → task-route-nL6YBqpT.js} +1 -1
- package/dist/client/assets/{task-status-BOHpGrk3.js → task-status-BdHIH5wb.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-fFVrXogo.js → taskboard-analytics-WYvo8iIi.js} +1 -1
- package/dist/client/assets/tasks-Cdzrrdaz.js +1 -0
- package/dist/client/assets/{tasks-SWTgaFVa.js → tasks-gq6y7TQx.js} +1 -1
- package/dist/client/assets/{textarea-OklqAHMd.js → textarea-kPu_uJPE.js} +1 -1
- package/dist/client/assets/{thread-analytics-DTuM9ZEl.js → thread-analytics-D6Pq3tuN.js} +1 -1
- package/dist/client/assets/{thread-intent-C1wXk8R2.js → thread-intent-H43pIrGm.js} +1 -1
- package/dist/client/assets/{thread-route-DicZMCve.js → thread-route-D5BZJ8B8.js} +1 -1
- package/dist/client/assets/{thread-route-LSwEDNk3.js → thread-route-DAi-GZ9V.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-CEMon8kR.js → thread-sheet-body-G_9F28Tw.js} +1 -1
- package/dist/client/assets/{time-range-picker-C6ZqhnIM.js → time-range-picker-DE66qw6Q.js} +1 -1
- package/dist/client/assets/{toggle-group-5MHxVWOz.js → toggle-group-C6-doG0i.js} +1 -1
- package/dist/client/assets/{tool-namespace-Ceqr3QyQ.js → tool-namespace-B7QKcZjk.js} +1 -1
- package/dist/client/assets/{tool-set-selector-DLUu043H.js → tool-set-selector-BQ0Oxag8.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DEBmHG_e.js → toolbar-icon-button-CcKPaKCW.js} +1 -1
- package/dist/client/assets/{tooltip-DAuc-B32.js → tooltip-DkKVKER8.js} +1 -1
- package/dist/client/assets/{tooltipContext-1vhchD6-.js → tooltipContext-B3txDLR-.js} +1 -1
- package/dist/client/assets/{track-YH0kfWd_.js → track-BIP36_Uh.js} +1 -1
- package/dist/client/assets/{types-DyZTbbkk.js → types-DADZ5j7m.js} +1 -1
- package/dist/client/assets/{url-slug-DIlgbobQ.js → url-slug-ChYq0W60.js} +1 -1
- package/dist/client/assets/{usage-stats-BebN-2hd.js → usage-stats-32tsZUXd.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DcAVgXsj.js → use-ai-providers-CoMFtqYl.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-B_Z446Ry.js → use-apply-named-rule-BQlrOJWU.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-hvqpSKkf.js +1 -0
- package/dist/client/assets/{use-automations-nJoSSUFU.js → use-automations-D6Y5V5w7.js} +1 -1
- package/dist/client/assets/{use-autosave-D5M1H1ld.js → use-autosave-Bhnkuzh5.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-DhlWbUca.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-DlqdI6ik.js → use-chat-layout-state-D7aW6a0C.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-sdbq0KPV.js → use-cms-publish-actions-DXLjbxwu.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DXp8DxZm.js → use-connect-companion-C7vylwX0.js} +1 -1
- package/dist/client/assets/{use-connection-Dht5w7Xq.js → use-connection-lpdRo-uP.js} +1 -1
- package/dist/client/assets/{use-content-sync-TbLiRz5C.js → use-content-sync-CoMrJcv7.js} +1 -1
- package/dist/client/assets/{use-copy-D33RiL7q.js → use-copy-DNHp83li.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BRlda5oW.js → use-date-fns-locale-CjJNXfvB.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DE6eSc27.js → use-debounced-autosave-CocwDpD-.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CzIv9NaE.js → use-debounced-value-DklROaCE.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BaQvGBEw.js → use-deco-credits-ev_UnwK6.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DjIuYjOP.js → use-decopilot-events-DsbeE0fY.js} +1 -1
- package/dist/client/assets/{use-delete-connection-aPrSXyAj.js → use-delete-connection-D9EOjdNd.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CUut_j3Q.js → use-deployment-admin-BD_xFjSG.js} +1 -1
- package/dist/client/assets/{use-entitlements-D3oGZGk4.js → use-entitlements-CEKmKdX0.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-axvbwLaV.js → use-fast-preview-draft-url-BfmpOxim.js} +1 -1
- package/dist/client/assets/{use-file-configs-5QRblAyS.js → use-file-configs-CGC2NdjT.js} +1 -1
- package/dist/client/assets/{use-id-selection-BvQC2CH0.js → use-id-selection-DL9yj-Hm.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-B_E5DqhG.js → use-inbox-feed-BIp7PHrk.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DUyqnU8Z.js → use-infinite-scroll-Cd1N4jMv.js} +1 -1
- package/dist/client/assets/{use-join-requests-Dz7yS88x.js → use-join-requests-dwGw3ubc.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-ChV3O5om.js → use-main-panel-tabs-DBPTQANw.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BwIqp-AR.js → use-mcp-auth-status-D0tSzrht.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Ce3gHVGN.js → use-mcp-client-BkZUf1G1.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Dq9WwEe3.js → use-mcp-prompts-ogj31Wyv.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DuEgTWI8.js → use-mcp-tools-CRGCgSi0.js} +1 -1
- package/dist/client/assets/{use-mobile-CW1BshYp.js → use-mobile-Brbs-D5v.js} +1 -1
- package/dist/client/assets/{use-move-blocks-B6bkFBMu.js → use-move-blocks-X2wSIdhe.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DEmRYJP2.js → use-navigate-to-agent-De0vzDZt.js} +1 -1
- package/dist/client/assets/{use-org-fs-Dj3nhg6p.js → use-org-fs-DSsFMzTw.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-BssG7LDG.js → use-org-repo-syncs-DEF2HBAf.js} +1 -1
- package/dist/client/assets/{use-org-sso-CPPSm2_k.js → use-org-sso-DatsrvZR.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Bxmr_gqX.js → use-organization-settings-CyexoMCC.js} +1 -1
- package/dist/client/assets/{use-project-scope-Cp4z8A1-.js → use-project-scope-BIVViTXo.js} +1 -1
- package/dist/client/assets/{use-recent-apps-BZ6rxv5O.js → use-recent-apps-CYuwpxqr.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-C7WA1MXv.js → use-reports-diagnostic-CAzZagV3.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-D_ekj7qC.js → use-sandbox-events-DxPsGHpR.js} +1 -1
- package/dist/client/assets/{use-secrets-CaIOigN4.js → use-secrets-CpdnK-89.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-C1Vehe6q.js → use-section-preview-base-9hC7oJo0.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-BzixWcm4.js → use-sidebar-collapsed-BbD-3i3N.js} +1 -1
- package/dist/client/assets/{use-tags-CKT9rJaQ.js → use-tags-Bt88S1Fh.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-GfBHZgc-.js → use-task-board-analytics-BTkEPZTH.js} +1 -1
- package/dist/client/assets/{use-task-board-events-B65L1qbJ.js → use-task-board-events-C_Du1Z0W.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-BVht1yZk.js → use-task-board-item-prs-vSYpxSpr.js} +1 -1
- package/dist/client/assets/{use-task-board-items-D_dsOzO4.js → use-task-board-items-D8dDcoyT.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-CNi_885P.js → use-task-board-prompts-BSaKlopF.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CVbCX8pH.js → use-task-metadata-BF4el6FI.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-BgwiVnbA.js → use-thread-outputs-CzwE74V7.js} +1 -1
- package/dist/client/assets/{use-voice-input-qp904jOd.js → use-voice-input-Ct26_ckB.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BNB4wMo9.js +1 -0
- package/dist/client/assets/{useQueries-_uQRl1Uh.js → useQueries-D0Ic2OLL.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DUZAeMjh.js +1 -0
- package/dist/client/assets/{users-D-5oJ2Ks.js → users-CcZNVW1C.js} +1 -1
- package/dist/client/assets/{utils-CWqleJYQ.js → utils-CVwSOtNq.js} +1 -1
- package/dist/client/assets/{variant-calendar-WDduM77l.js → variant-calendar-bvYuncUl.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-Bb9J_WJV.js → variant-matcher-override-JfQvd5m1.js} +1 -1
- package/dist/client/assets/{view-header-BdEbmY1e.js → view-header-3XIW6_JX.js} +1 -1
- package/dist/client/assets/{virtual-mcp-B5SyuXEj.js → virtual-mcp-Ba39VAch.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-BQPiLe0y.js → watch-sse-pool-CcLpshxd.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +765 -714
- package/package.json +1 -1
- package/dist/client/assets/agent-app-Da9CCDUf.js +0 -1
- package/dist/client/assets/agent-deck-BAqsiSU8.js +0 -1
- package/dist/client/assets/agent-experiments-D_FXRK8m.js +0 -1
- package/dist/client/assets/agent-library-file-CClO1HJb.js +0 -1
- package/dist/client/assets/agent-library-jdBUMrX4.js +0 -1
- package/dist/client/assets/agent-overview-CozHgqWw.js +0 -1
- package/dist/client/assets/agent-settings-DFWwpeNN.js +0 -1
- package/dist/client/assets/agent-site-editor-code-Y9S3Tflm.js +0 -2
- package/dist/client/assets/agent-site-editor-content-DQIMpOhN.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-Cmd7Qr1A.js +0 -1
- package/dist/client/assets/agent-view-CECuI8u1.js +0 -1
- package/dist/client/assets/api-keys-CeUptd-H.js +0 -1
- package/dist/client/assets/library-D5ziXpSY.js +0 -1
- package/dist/client/assets/project-reports-Db25ahlS.js +0 -1
- package/dist/client/assets/project-tasks-8KIU2G_G.js +0 -1
- package/dist/client/assets/record-editor-B_4KV28Z.js +0 -1
- package/dist/client/assets/reports-BCF6hR_E.js +0 -1
- package/dist/client/assets/repositories-CaGUOsCY.js +0 -1
- package/dist/client/assets/route-Dvj1xiWd.js +0 -1
- package/dist/client/assets/settings-tab-D_5Bm5aU.js +0 -1
- package/dist/client/assets/site-editor-By5ShAZu.js +0 -1
- package/dist/client/assets/tasks-B4qczLXa.js +0 -1
- package/dist/client/assets/use-ask-in-chat-Ta68GLzt.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-DcWNpXou.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CCCREFcj.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CIdX85h2.js +0 -1
package/dist/client/assets/{site-draft-actions-QFmuYxUg.js → site-draft-actions-D6MDFwbu.js}
RENAMED
|
@@ -1,3 +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,fc 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,fd as dr,fe as cn,bJ as Ra,b8 as Ta,bh as _n,ff as Da,c0 as Ba,am as Ia,I as $a,a8 as Fa,fg 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,fh as Oa,bk as vr,a6 as un,b3 as hn,e as Mn,E as _a,T as Ma}from"./index-YAbWBpI2.js";import{S as Ea}from"./separator-XP0nOrIu.js";import{f as za,u as ns,r as yr,l as jr,c as wr,b as Ua}from"./chat-context-Bc7GhR8U.js";import{u as Bt,ar as qa,as as Pr,at as Sr,c as fn,b as mn,M as pn,au as Ha,L as Ka,av as Va,af as Ga,aw as Wa,U as bn,S as kr,ax as Qa,a1 as Nr,G as Ja,ay as Ya,az as Xa,C as Cr}from"./site-editor-toast-B1S7n1Id.js";import{b as Za,L as el,a as tl}from"./shell-layout-BejViDQa.js";import{I as Ar}from"./toolbar-icon-button-DEBmHG_e.js";import{b as sl,P as nl,a as rl}from"./popover-eKoh4-Z1.js";import{c as tt,T as st,a as nt,b as Us}from"./tooltip-DAuc-B32.js";import{f as al,a as ll,c as il,C as En,e as zn,b as Un}from"./command-DgSBNjBh.js";import{T as Tt,a as Rr,c as Tr}from"./tabs-DlRJfLwT.js";import{t as Dr}from"./ChevronUp-CpgR3_nb.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-CqeITJaa.js";import{a as Fr}from"./SwitchHorizontal01-Mkrao4SC.js";import{c as Lr,s as Is}from"./Tool01-B3AGNBtQ.js";import{s as Or}from"./Plus-_9GNTGSE.js";import{s as Hs}from"./Trash01-BMv3ZifH.js";import{l as hl,d as fl}from"./thread-intent-C1wXk8R2.js";import{h as _r,r as Mr,g as ml,e as _e,u as Ks,f as Er}from"./repository-binding-BEFtyvwg.js";import{u as pl}from"./use-debounced-value-CzIv9NaE.js";import{u as bl}from"./useInfiniteQuery-CCCREFcj.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-DEmRYJP2.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-BakCAk7K.js";import{a as $s}from"./virtual-mcp-B5SyuXEj.js";import{u as fs}from"./use-voice-input-qp904jOd.js";import{u as vn}from"./use-blocks-v8-project-DcWNpXou.js";import{G as Kr}from"./github-icon-DewiI3zK.js";import{u as kl,a as Nl}from"./use-fast-preview-draft-url-axvbwLaV.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-ifXBK4F2.js";import"./index-D3yQzMmD.js";import{T as $l}from"./textarea-OklqAHMd.js";import{i as wn}from"./CheckCircle-6PthhUL2.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-sdbq0KPV.js";import{a as Kl,g as Vl}from"./UserSquare-Vj3086v1.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-CWqleJYQ.js";import{i as ai}from"./Monitor01-Cuob4vSq.js";import{w as An,R as Jr}from"./device-hint-DPZT-Xea.js";import{w as qn}from"./editor-C09OhWY7.js";import{x as li,C as ii}from"./section-array-field-D45EV3Ua.js";import{s as Yr}from"./save-changes-debug-nBi-n9eV.js";import{u as oi}from"./use-mcp-client-Ce3gHVGN.js";import{u as ci}from"./use-sandbox-events-D_ekj7qC.js";import{b as di,a as ui}from"./sandbox-lifecycle-context-CFqytSKR.js";import{b as hi}from"./agent-capabilities-W9vBXHXR.js";import{b as fi}from"./thread-route-DicZMCve.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)}
|
|
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,fc 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,fd as dr,fe as cn,bJ as Ra,b8 as Ta,bh as _n,ff as Da,c0 as Ba,am as Ia,I as $a,a8 as Fa,fg 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,fh as Oa,bk as vr,a6 as un,b3 as hn,e as Mn,E as _a,T as Ma}from"./index-Cm-moWa5.js";import{S as Ea}from"./separator-sTUHAoAe.js";import{f as za,u as ns,r as yr,l as jr,c as wr,b as Ua}from"./chat-context-O7Uim5zw.js";import{u as Bt,ar as qa,as as Pr,at as Sr,c as fn,b as mn,M as pn,au as Ha,L as Ka,av as Va,af as Ga,aw as Wa,U as bn,S as kr,ax as Qa,a1 as Nr,G as Ja,ay as Ya,az as Xa,C as Cr}from"./site-editor-toast-C6zgUX0e.js";import{b as Za,L as el,a as tl}from"./shell-layout-n8ud5acT.js";import{I as Ar}from"./toolbar-icon-button-CcKPaKCW.js";import{b as sl,P as nl,a as rl}from"./popover-DLErjFx_.js";import{c as tt,T as st,a as nt,b as Us}from"./tooltip-DkKVKER8.js";import{f as al,a as ll,c as il,C as En,e as zn,b as Un}from"./command-BO5QH15f.js";import{T as Tt,a as Rr,c as Tr}from"./tabs-BBBKV7Oj.js";import{t as Dr}from"./ChevronUp-Dg02PCVC.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-CRaK_2eb.js";import{a as Fr}from"./SwitchHorizontal01-CMdcXPwO.js";import{c as Lr,s as Is}from"./Tool01-CuDHSO34.js";import{s as Or}from"./Plus-EDJqelyG.js";import{s as Hs}from"./Trash01-Bif7g_Tq.js";import{l as hl,d as fl}from"./thread-intent-H43pIrGm.js";import{h as _r,r as Mr,g as ml,e as _e,u as Ks,f as Er}from"./repository-binding-B7kVJGqt.js";import{u as pl}from"./use-debounced-value-DklROaCE.js";import{u as bl}from"./useInfiniteQuery-BNB4wMo9.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-De0vzDZt.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-DiBAZwre.js";import{a as $s}from"./virtual-mcp-Ba39VAch.js";import{u as fs}from"./use-voice-input-Ct26_ckB.js";import{u as vn}from"./use-blocks-v8-project-DhlWbUca.js";import{G as Kr}from"./github-icon-Dq39pEMT.js";import{u as kl,a as Nl}from"./use-fast-preview-draft-url-BfmpOxim.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-D0oTw6gu.js";import"./index-D8rwwuoa.js";import{T as $l}from"./textarea-kPu_uJPE.js";import{i as wn}from"./CheckCircle-CBLXbFFB.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-DXLjbxwu.js";import{a as Kl,g as Vl}from"./UserSquare-DqOeWgs_.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-CVwSOtNq.js";import{i as ai}from"./Monitor01-CY6I-T_v.js";import{w as An,R as Jr}from"./device-hint-Z9_uJm09.js";import{w as qn}from"./editor-BTYObZ3D.js";import{x as li,C as ii}from"./section-array-field-DVc_SUaS.js";import{s as Yr}from"./save-changes-debug-nBi-n9eV.js";import{u as oi}from"./use-mcp-client-BkZUf1G1.js";import{u as ci}from"./use-sandbox-events-DxPsGHpR.js";import{b as di,a as ui}from"./sandbox-lifecycle-context-CNzI4oJx.js";import{b as hi}from"./agent-capabilities-Z6OO2Jnk.js";import{b as fi}from"./thread-route-D5BZJ8B8.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
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
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as I,j as r,n as v,b as M,a5 as T,bi as w}from"./index-
|
|
1
|
+
import{c as I,j as r,n as v,b as M,a5 as T,bi as w}from"./index-Cm-moWa5.js";import{E as B}from"./empty-state-BTVsC7xK.js";import{u as L}from"./chat-context-O7Uim5zw.js";import{u as N,l as O,F as _}from"./site-editor-toast-C6zgUX0e.js";import{i as $,u as A,j as Q,S as U}from"./blocks-tab-states-D0oTw6gu.js";import{a as G}from"./autosend-DDd9ei6A.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:F}=G();if(!m){const l=t.noDraftTitle,k=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]!==F?(c=()=>F("content"),e[2]=F,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:k,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 F=p,h=O(F),f=A(F),l=h.data,k=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||!k||!c.ready){if(h.isError||f.isError||c.failed){const P=s.loadFailed,R=s.loadFailedHint;let D;e[9]!==m?(D=m("sectionsEditor.namedRules.tryAgain"),e[9]=m,e[10]=D):D=e[10];let b;e[11]!==h||e[12]!==c||e[13]!==f?(b=()=>{h.isError&&h.refetch(),f.isError&&f.refetch(),c.failed&&c.retry()},e[11]=h,e[12]=c,e[13]=f,e[14]=b):b=e[14];let E;e[15]!==D||e[16]!==b?(E={label:D,onClick:b},e[15]=D,e[16]=b,e[17]=E):E=e[17];let y;return e[18]!==s.loadFailed||e[19]!==s.loadFailedHint||e[20]!==a||e[21]!==E?(y=r.jsx(H,{icon:a,title:P,description:R,action:E}),e[18]=s.loadFailed,e[19]=s.loadFailedHint,e[20]=a,e[21]=E,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]!==k||e[29]!==n||e[30]!==o||e[31]!==i?(d=j({orgSlug:n,virtualMcpId:i,branch:t,threadId:o,decofile:l,meta:k}),e[25]=t,e[26]=j,e[27]=l,e[28]=k,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};
|