decocms 4.577.0 → 4.577.1
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-BdE1rZoJ.js → AlertCircle-Bj2NuHQY.js} +1 -1
- package/dist/client/assets/{AreaChart-D0m3b7qG.js → AreaChart-wF798x8i.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DIrnwv8l.js → ArrowLeft-DCMq103h.js} +1 -1
- package/dist/client/assets/{ArrowUp-km-Xmh__.js → ArrowUp-AwRcCsuH.js} +1 -1
- package/dist/client/assets/{BookOpen01-BneB1q9z.js → BookOpen01-D2g_6Ti1.js} +1 -1
- package/dist/client/assets/{CartesianChart-BwsWHEdb.js → CartesianChart-B6p3i5Ce.js} +1 -1
- package/dist/client/assets/{CategoricalChart-Dxo_7xLg.js → CategoricalChart-Bjq2Qe33.js} +1 -1
- package/dist/client/assets/{CheckCircle-CiBUynzC.js → CheckCircle-BfCYdSA_.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-CRWdnYCm.js → ChevronSelectorVertical-Bwduw2Hp.js} +1 -1
- package/dist/client/assets/{ChevronUp-B7dgqvYM.js → ChevronUp-JSFuaLqF.js} +1 -1
- package/dist/client/assets/{CreditCard01-CcIddg9s.js → CreditCard01-DsaJOWgX.js} +1 -1
- package/dist/client/assets/{Globe04-DIBckqos.js → Globe04-BBKBtEaK.js} +1 -1
- package/dist/client/assets/{Key01-BV5ckBOE.js → Key01-BTIXWKkS.js} +1 -1
- package/dist/client/assets/{LinkBroken01-Mv2kbzSM.js → LinkBroken01-DjOOxf0e.js} +1 -1
- package/dist/client/assets/{Minus-Bygm9L7w.js → Minus-BAq-AD33.js} +1 -1
- package/dist/client/assets/{Monitor01-HDGt-WwC.js → Monitor01-CqtNhdJN.js} +1 -1
- package/dist/client/assets/{Play-DROL2O51.js → Play-kmXfE4Am.js} +1 -1
- package/dist/client/assets/{Plus-C-Or0hIv.js → Plus-Bq5KiXqn.js} +1 -1
- package/dist/client/assets/{ReferenceLine-BPmIH9b3.js → ReferenceLine-CcfMMo9r.js} +1 -1
- package/dist/client/assets/{SearchMd-D88tiwag.js → SearchMd-D1P7yVqT.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-Cdbqpanm.js → ShoppingBag01-CAQ4NRTU.js} +1 -1
- package/dist/client/assets/{Sun-CgOyXDTW.js → Sun-C5iV1Zpq.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Dkkqg27i.js → SwitchHorizontal01-CP6L8rlm.js} +1 -1
- package/dist/client/assets/{Tool01-D4tVVqAj.js → Tool01-DAYJL0v-.js} +1 -1
- package/dist/client/assets/{Tooltip-cgLuNyXo.js → Tooltip-DiDmzDgy.js} +1 -1
- package/dist/client/assets/{Trash01-Cqkcp6ky.js → Trash01-Dt7pyOwE.js} +1 -1
- package/dist/client/assets/{Upload01-CsOcxm5q.js → Upload01-CZ2h76oj.js} +1 -1
- package/dist/client/assets/{UserSquare-CK-bjijW.js → UserSquare-CBWDFbi3.js} +1 -1
- package/dist/client/assets/{Users01-BpEuprvx.js → Users01-BZzvQda-.js} +1 -1
- package/dist/client/assets/{XClose-D9taHFI1.js → XClose-D2u966Hj.js} +1 -1
- package/dist/client/assets/{Zap-BhxT34oC.js → Zap-CDj8jJFt.js} +1 -1
- package/dist/client/assets/{access-gate-Bbt03qvc.js → access-gate-DL6Fx00C.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-EzR6kkmo.js → add-connection-dialog-DXVmpebU.js} +1 -1
- package/dist/client/assets/agent-app-DClrb2ok.js +1 -0
- package/dist/client/assets/{agent-assets-DUoWUOFt.js → agent-assets-C4JxM7ek.js} +1 -1
- package/dist/client/assets/{agent-automation-Cyb5qsWY.js → agent-automation-BRLWOY9Z.js} +1 -1
- package/dist/client/assets/{agent-automations-HcbM2XMD.js → agent-automations-Bi4PZQpt.js} +1 -1
- package/dist/client/assets/{agent-blog-BLi3oKLw.js → agent-blog-CZFhSkNf.js} +2 -2
- package/dist/client/assets/{agent-blog-post-DXyE25Wg.js → agent-blog-post-DWjaJsuP.js} +2 -2
- package/dist/client/assets/{agent-calendar-D7ih9de1.js → agent-calendar-DVRrZoQI.js} +1 -1
- package/dist/client/assets/{agent-capabilities-CrqOfLmC.js → agent-capabilities-DHVCvnvi.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-DtVo8JXM.js → agent-connect-sources-zocgSqV4.js} +1 -1
- package/dist/client/assets/agent-deck-BQ_G3Xvk.js +1 -0
- package/dist/client/assets/{agent-e2e-CBM_w3qk.js → agent-e2e-C7P50BKx.js} +1 -1
- package/dist/client/assets/agent-experiments-B7tgn9fP.js +1 -0
- package/dist/client/assets/{agent-file-DjiNMKB3.js → agent-file-CVIHN4Pv.js} +1 -1
- package/dist/client/assets/{agent-hosting-C70MC-PA.js → agent-hosting-DmUbTOe2.js} +1 -1
- package/dist/client/assets/{agent-icon-bK3wLPrb.js → agent-icon-BwEytdmh.js} +1 -1
- package/dist/client/assets/agent-library-BhTWSN-a.js +1 -0
- package/dist/client/assets/agent-library-file-C9nXPWjk.js +1 -0
- package/dist/client/assets/agent-overview-gQqe-_Zq.js +1 -0
- package/dist/client/assets/{agent-releases-BlbJtMk9.js → agent-releases-Bxmxt--5.js} +1 -1
- package/dist/client/assets/agent-settings-BZlQcdRN.js +1 -0
- package/dist/client/assets/{agent-site-editor-BeTpu1p8.js → agent-site-editor-Bxgpwy-D.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-D3XwSBBo.js +2 -0
- package/dist/client/assets/agent-site-editor-content-5EK8c-yC.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-DtbJe_5m.js +1 -0
- package/dist/client/assets/agent-view-DJh235b7.js +1 -0
- package/dist/client/assets/{agent-view-guard-CruOWgYs.js → agent-view-guard-B4P_nOY3.js} +1 -1
- package/dist/client/assets/{ai-providers-C2yFfgyi.js → ai-providers-CvpoHUFb.js} +1 -1
- package/dist/client/assets/{alert-jF8tTR34.js → alert-0-4Lk02S.js} +1 -1
- package/dist/client/assets/{analytics-sections-Qo8FMsPn.js → analytics-sections-DEuK9yNO.js} +1 -1
- package/dist/client/assets/{api-keys-15uqAkvj.js → api-keys-BWb-_Fqf.js} +1 -1
- package/dist/client/assets/api-keys-PaXWWj2O.js +1 -0
- package/dist/client/assets/{app-editor-B4pmL5qY.js → app-editor-DVjFa_ip.js} +1 -1
- package/dist/client/assets/{asset-utils-CwQVXoYw.js → asset-utils-DSh1-4fR.js} +1 -1
- package/dist/client/assets/{auth-YGSVzhUG.js → auth-DFCgioOs.js} +1 -1
- package/dist/client/assets/{auth-catchall-hWKWJU80.js → auth-catchall-_w9pWMK8.js} +1 -1
- package/dist/client/assets/{auth-entry-DpL4vu4t.js → auth-entry-HAlWF4UX.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BFmr3RnK.js → auth-split-layout-BSaVPfK6.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DHgqzdUM.js → authenticate-and-persist-oauth-BGX0Y23v.js} +1 -1
- package/dist/client/assets/{automation-list-row-BAeLE453.js → automation-list-row-Xayp8iFs.js} +1 -1
- package/dist/client/assets/{automation-runs-C7o6atC8.js → automation-runs-CUwzltO7.js} +1 -1
- package/dist/client/assets/{automations-BvOuQD58.js → automations-C0bs2qin.js} +1 -1
- package/dist/client/assets/{badge-D9oJO89f.js → badge-DbKUf3vA.js} +1 -1
- package/dist/client/assets/{block-document-Phc0b_hv.js → block-document-zkAHP8m2.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-XztheX0p.js → blocks-preview-workspace-context-DQL_zlqC.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-CPXZUbSV.js → blocks-tab-states-BUfMyINR.js} +1 -1
- package/dist/client/assets/{blog-preview-url-BlQDNdnl.js → blog-preview-url-CT-VZElJ.js} +1 -1
- package/dist/client/assets/{blog-schema-BY4m7Viq.js → blog-schema-Dys-tzF0.js} +1 -1
- package/dist/client/assets/{blog-source-gate-CiOBhTPt.js → blog-source-gate-CYaEgV9t.js} +1 -1
- package/dist/client/assets/{blog-view-gate-CCZFjbaz.js → blog-view-gate-zXMdlu7Q.js} +1 -1
- package/dist/client/assets/{buckets-BkOGaNvk.js → buckets-DOgpbimo.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-BvBG7PT7.js → build-improve-prompt-doc-BMf33123.js} +1 -1
- package/dist/client/assets/{calendar-CNAmcpRM.js → calendar-5Nt9EKO9.js} +1 -1
- package/dist/client/assets/{capability-load-error-BfsuWu82.js → capability-load-error-BSxnBi9L.js} +1 -1
- package/dist/client/assets/{category-editor-DfKRUZ0M.js → category-editor-DziWemO6.js} +1 -1
- package/dist/client/assets/{category-tree-C0ZkCPxc.js → category-tree-Cm0a3nBT.js} +1 -1
- package/dist/client/assets/{chart-CjhZfLhJ.js → chart-DPgJVmAl.js} +1 -1
- package/dist/client/assets/{chat-context-BXBBnsXM.js → chat-context-D8Eje7xK.js} +1 -1
- package/dist/client/assets/{chat-draft-BiNhHFHP.js → chat-draft-ArmxHiV6.js} +1 -1
- package/dist/client/assets/{checkbox-BqeIWnOr.js → checkbox-CCw3an34.js} +1 -1
- package/dist/client/assets/{choose-editor-C3lPTBrc.js → choose-editor-CXiL24Bl.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DXTy0zTr.js → cli-auth-success-c7wBWUO5.js} +1 -1
- package/dist/client/assets/{client-icons-bVQyh7Ui.js → client-icons-CuJeSv2A.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-BGhvXRA5.js → cms-settings-editor-gxtK9SOp.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-C_2pJAHv.js → cms-store-drafts-chLFxeWf.js} +1 -1
- package/dist/client/assets/{collapsible-M6EMuds1.js → collapsible-CVtLl5wO.js} +1 -1
- package/dist/client/assets/{collection-detail-DtpW8ulK.js → collection-detail-D_Bcp_j6.js} +1 -1
- package/dist/client/assets/{collection-display-button-CLT_iQ9K.js → collection-display-button-CnhRvkGN.js} +1 -1
- package/dist/client/assets/{collection-search-d8_we7KS.js → collection-search-CC2QUXh2.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-jjhzHxOC.js → collection-table-wrapper-DSy_nx4_.js} +1 -1
- package/dist/client/assets/{collection-tabs-CDEZauaw.js → collection-tabs-DHZJ_O9U.js} +1 -1
- package/dist/client/assets/{combobox-eXr44O4N.js → combobox-CB15NqGc.js} +1 -1
- package/dist/client/assets/{command-CL5fBjco.js → command-BOSLOC8n.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-ZhumvGkq.js → companion-mcps-section-CeNpBYo7.js} +1 -1
- package/dist/client/assets/{config-DTkH3DlA.js → config-DqdBgCnO.js} +1 -1
- package/dist/client/assets/{connect-DTRBNGAJ.js → connect-WyHpmSHS.js} +1 -1
- package/dist/client/assets/{connect-layout-C9YZDE5a.js → connect-layout-D_zQARSX.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-CtNzRZNm.js → connect-source-dialog-DHtZw9ff.js} +1 -1
- package/dist/client/assets/{connection-DQRUSri4.js → connection-D0YCkaZO.js} +1 -1
- package/dist/client/assets/{connection-card-DiXDtKCD.js → connection-card-B1Rl2nXN.js} +1 -1
- package/dist/client/assets/{connection-detail-A1N-eCPy.js → connection-detail-LxUhih2_.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DbQ-1SYg.js → connection-form-helpers-CAOx4zgX.js} +1 -1
- package/dist/client/assets/{connection-slug-eNvNu5ns.js → connection-slug-BH_NX0Ks.js} +1 -1
- package/dist/client/assets/{connections-F6Cb4hev.js → connections-BhxOwljy.js} +1 -1
- package/dist/client/assets/{content-tab-zWTaVHTI.js → content-tab-BdaE3oCc.js} +3 -3
- package/dist/client/assets/{context-jjXucCze.js → context-BmOpD-Hr.js} +1 -1
- package/dist/client/assets/{context-menu-C8EhSOHZ.js → context-menu-Df7WW_d5.js} +1 -1
- package/dist/client/assets/{context-shell-DAsZEr3G.js → context-shell-cJbikpSJ.js} +3 -3
- package/dist/client/assets/{core.esm-q-GZRseF.js → core.esm-CAA73EV4.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-B0fwudcl.js → create-organization-dialog-BLvG9G-Z.js} +1 -1
- package/dist/client/assets/{delete-copy-DewsXC-x.js → delete-copy-CAFEtw8Z.js} +1 -1
- package/dist/client/assets/{device-hint-DOHdIy74.js → device-hint-DgkMhcRQ.js} +1 -1
- package/dist/client/assets/{discover-Sgb2XR4X.js → discover-Cceep_sX.js} +1 -1
- package/dist/client/assets/{domain-settings-CzQKvon-.js → domain-settings-52h_8fKM.js} +1 -1
- package/dist/client/assets/{drawer-CT21cqiT.js → drawer-B9PFQFcy.js} +1 -1
- package/dist/client/assets/{editor-DSTLBMSV.js → editor-DZ4pzlHx.js} +1 -1
- package/dist/client/assets/{editor-classes-DNgU6VQ_.js → editor-classes-Cb5f4sl2.js} +1 -1
- package/dist/client/assets/{empty-message-0iKzEZgc.js → empty-message-CXYzekmD.js} +1 -1
- package/dist/client/assets/{empty-state-De0GyKdS.js → empty-state-BkAAjXrp.js} +1 -1
- package/dist/client/assets/{empty-state-C7mAM8aV.js → empty-state-DMtSEEQ1.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-DwnKczQ0.js → experiments-tab-choice-CDm4A9Wq.js} +1 -1
- package/dist/client/assets/{extract-connection-data-C9uUQyrf.js → extract-connection-data-u6K4j2aJ.js} +1 -1
- package/dist/client/assets/{feature-gate-BekWNhM3.js → feature-gate-DFWAlRCv.js} +1 -1
- package/dist/client/assets/{feature-paywall-CzMsGR-v.js → feature-paywall-BiIzjBeB.js} +1 -1
- package/dist/client/assets/{file-explorer-BA6AotC6.js → file-explorer-M__gA7Xu.js} +1 -1
- package/dist/client/assets/{file-preview-CK5Pkylz.js → file-preview-D7WeSAA4.js} +1 -1
- package/dist/client/assets/{file-share-button-qjRy5kh1.js → file-share-button-BtW_yxzc.js} +1 -1
- package/dist/client/assets/{file-type-icon-DI74_rhH.js → file-type-icon-mKSSLPP8.js} +1 -1
- package/dist/client/assets/{folder-icon-RhxrL37z.js → folder-icon-DCyvwLH6.js} +1 -1
- package/dist/client/assets/{form-czY_WZeB.js → form-8HJUl2GV.js} +1 -1
- package/dist/client/assets/{frame-navigation-D3lcT6PQ.js → frame-navigation-Bp6fuuV5.js} +1 -1
- package/dist/client/assets/{general-DyfkLFv0.js → general-C9cj7tJH.js} +1 -1
- package/dist/client/assets/{github-icon-DbvGzNXg.js → github-icon-DEvD-SlA.js} +1 -1
- package/dist/client/assets/{held-block-view-616AHRnA.js → held-block-view-DRxUlNuB.js} +1 -1
- package/dist/client/assets/{home-CvjGQ8iY.js → home-DR1hV3al.js} +1 -1
- package/dist/client/assets/{home-overview-BspPD0Qy.js → home-overview-CgBJdfHr.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-gX34y3hJ.js → hosted-reconcile-DH_YtUfF.js} +1 -1
- package/dist/client/assets/{icon-button-Bek6uWU8.js → icon-button-CadQrI05.js} +1 -1
- package/dist/client/assets/{index-e47kvUTQ.js → index-8kUWDN7v.js} +1 -1
- package/dist/client/assets/{index-D6lWWdm-.js → index-BLdRRqFU.js} +1 -1
- package/dist/client/assets/{index-B_hHGrWo.js → index-Bkf6As2Q.js} +1 -1
- package/dist/client/assets/{index-BASUN16S.js → index-ButqNodW.js} +1 -1
- package/dist/client/assets/{index-CLog75-o.js → index-BvGbwvSS.js} +1 -1
- package/dist/client/assets/{index-CJqO_lXj.js → index-C1fc6W9Q.js} +1 -1
- package/dist/client/assets/{index-Cb-PI-oM.js → index-C5aoCNXr.js} +1 -1
- package/dist/client/assets/{index-Cn4blTB2.js → index-C9E0iqgh.js} +1 -1
- package/dist/client/assets/{index-5IFWC0PS.js → index-CWKxkTwy.js} +5 -5
- package/dist/client/assets/{index-CYAg_mZ5.js → index-CcTmEE1N.js} +1 -1
- package/dist/client/assets/{index-BVaQtZpO.js → index-CzrYE4jE.js} +1 -1
- package/dist/client/assets/{index-ZpYsIOky.js → index-DVdV24aR.js} +1 -1
- package/dist/client/assets/{index-DI1WEe1Y.js → index-Tvs593C1.js} +1 -1
- package/dist/client/assets/{index-Cq3k2rBV.js → index-_sPF1edR.js} +1 -1
- package/dist/client/assets/{index-Co1pEKoz.js → index-gX7QfQio.js} +1 -1
- package/dist/client/assets/{index-redirect-B5LCK4UZ.js → index-redirect-DOlNtcAX.js} +1 -1
- package/dist/client/assets/{index-BFLUunGm.js → index-t9nYrZiR.js} +1 -1
- package/dist/client/assets/{index-BgGa_gEX.js → index-yzkfeOP2.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CgeE9MzI.js → infiniteQueryObserver-DCK-YXw1.js} +1 -1
- package/dist/client/assets/{infra-billing-D_NOfbaI.js → infra-billing-B-pN25L9.js} +1 -1
- package/dist/client/assets/{input-1bbcsHzM.js → input-1NX4JUHA.js} +3 -3
- package/dist/client/assets/{input-Cof38_0i.js → input-DA-TtdGL.js} +1 -1
- package/dist/client/assets/{integration-icon-ClorKiq5.js → integration-icon-C1bpkd7s.js} +1 -1
- package/dist/client/assets/{item-actions-pz3LKYdP.js → item-actions-kNG-BlG3.js} +1 -1
- package/dist/client/assets/{jira-icon-CSE5FXRa.js → jira-icon-CnBOGlR6.js} +1 -1
- package/dist/client/assets/{label-C1myK8cj.js → label-BXSXPHWU.js} +1 -1
- package/dist/client/assets/{layout-B4vND3NH.js → layout-C0J9eFzL.js} +1 -1
- package/dist/client/assets/{legacy-admin-welcome-dialog-DtBTs-JZ.js → legacy-admin-welcome-dialog-DbVWjlJ6.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-wdUtLgZd.js → legacy-agents-deep-DVKmxbFS.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-D0dw61Zg.js → legacy-main-redirect-D0wT4Yry.js} +1 -1
- package/dist/client/assets/library-sYbbN7ux.js +1 -0
- package/dist/client/assets/{library-tab-3lHWVZnM.js → library-tab-gK_7g-te.js} +1 -1
- package/dist/client/assets/{login-OeBuTK5R.js → login-DnxvVl1t.js} +1 -1
- package/dist/client/assets/{markdown-BhnPL5Bs.js → markdown-DiEygcQw.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DeImvVKz.js → mcp-app-renderer-BbTTGmQC.js} +1 -1
- package/dist/client/assets/{mcp-oauth-D2St0yzi.js → mcp-oauth-CQGGouuy.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DAPLorIu.js → mcp-oauth-TUUsAJpA.js} +1 -1
- package/dist/client/assets/{members-CRV8r-1W.js → members-nUmVbnC9.js} +1 -1
- package/dist/client/assets/{memory-C08OAgnC.js → memory-Blrtbn8a.js} +1 -1
- package/dist/client/assets/{mock-board-UupkdDTJ.js → mock-board-CC-isAOX.js} +3 -3
- package/dist/client/assets/{monaco-editor-DgmLjwMj.js → monaco-editor-C9ZwdTpU.js} +1 -1
- package/dist/client/assets/{monitoring-C2AkJ1E2.js → monitoring-B36SUiOP.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BkupHr4w.js → monitoring-stats-row-H3pnSbDz.js} +1 -1
- package/dist/client/assets/{multi-select-D_-o3Z5k.js → multi-select-obeT7dRo.js} +1 -1
- package/dist/client/assets/{mustache-D-pZ4GVh.js → mustache-gM754ehf.js} +1 -1
- package/dist/client/assets/{named-rule-step-BqRLfozU.js → named-rule-step-W9P9uG-f.js} +1 -1
- package/dist/client/assets/{named-rule-view-Cjao8aHC.js → named-rule-view-BJLbVNsp.js} +1 -1
- package/dist/client/assets/{new-project-dialog-ly3jlxrO.js → new-project-dialog-Cfdy4DZo.js} +1 -1
- package/dist/client/assets/{oauth-callback-DGsbFvpE.js → oauth-callback-Cxz67hG6.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DH_kBA_S.js → oauth-callback-ai-provider-Diui0sS6.js} +1 -1
- package/dist/client/assets/{oauth-consent-DiV1G_a8.js → oauth-consent-BWS32jU1.js} +1 -1
- package/dist/client/assets/{onboarding-wSysb6DG.js → onboarding-Cg2Txb26.js} +1 -1
- package/dist/client/assets/{openai-conversation-BnmAjQv3.js → openai-conversation-CGGu6BWJ.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-BddiZzQV.js → optimistic-project-sidebar-views-cd4O2LnM.js} +1 -1
- package/dist/client/assets/{order-monitor-day-vJd_rbss.js → order-monitor-day-DrziIuIu.js} +1 -1
- package/dist/client/assets/{organization-choice-B_C6gRzc.js → organization-choice-CPef1x_g.js} +1 -1
- package/dist/client/assets/{orgs-Hd1POC7b.js → orgs--h6JaB89.js} +1 -1
- package/dist/client/assets/{own-accounts-section-DRAcUJQm.js → own-accounts-section-D0sCVz2F.js} +1 -1
- package/dist/client/assets/{pair-DsQEIDjk.js → pair-DbwVEDlq.js} +1 -1
- package/dist/client/assets/{parse-sections-DAMeYP46.js → parse-sections-CMxFIp3d.js} +2 -2
- package/dist/client/assets/{plan-9F8q1LmB.js → plan-1pM1JHac.js} +1 -1
- package/dist/client/assets/{plan-ladder-BVTNP5Xz.js → plan-ladder-XiZUV3-n.js} +1 -1
- package/dist/client/assets/{plan-usage-card-Du0lOF_J.js → plan-usage-card-BsCyr1kn.js} +1 -1
- package/dist/client/assets/{popover-DP7XfF8t.js → popover-CTEYICXO.js} +1 -1
- package/dist/client/assets/{post-calendar-DDpUGeeB.js → post-calendar-DbsJgYWp.js} +1 -1
- package/dist/client/assets/{post-editor-DtDeATFH.js → post-editor-GP7cTHEm.js} +1 -1
- package/dist/client/assets/{preview-content-C5OVyGLr.js → preview-content-BYvAegAr.js} +1 -1
- package/dist/client/assets/{preview-dialog-DuuWqEir.js → preview-dialog-tONoLcHy.js} +1 -1
- package/dist/client/assets/{preview-panel-BZ5HJll2.js → preview-panel-CxdwWGtV.js} +1 -1
- package/dist/client/assets/{preview-tab-P_107JPX.js → preview-tab-BJQS3_gN.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-Dt7DCQ6n.js → product-picker-dialog-DVmdugXw.js} +1 -1
- package/dist/client/assets/{profile-GhJox0Lx.js → profile-CFEIL030.js} +1 -1
- package/dist/client/assets/{project-app-view-qeUPQ38h.js → project-app-view-DpcLMitT.js} +1 -1
- package/dist/client/assets/{project-apps-DfPcY68g.js → project-apps-T4OBSnxG.js} +1 -1
- package/dist/client/assets/{project-icon-B90806PF.js → project-icon-CsM5Xu_3.js} +1 -1
- package/dist/client/assets/{project-index-Do6iewlo.js → project-index-CnwYmkRd.js} +1 -1
- package/dist/client/assets/project-reports-Bsj_xvMI.js +1 -0
- package/dist/client/assets/project-tasks-BGrqP4mL.js +1 -0
- package/dist/client/assets/{projects-CymMldT7.js → projects-D9OLRq0V.js} +1 -1
- package/dist/client/assets/{projects-empty-state-BTGd2cv1.js → projects-empty-state-DAdhJyFi.js} +1 -1
- package/dist/client/assets/{prompts-Cd0qPZsx.js → prompts-hNC_o6uG.js} +1 -1
- package/dist/client/assets/{record-editor-BH3fKYC8.js → record-editor-BUh6IBbj.js} +1 -1
- package/dist/client/assets/{redirect-editor-xZO49sls.js → redirect-editor-CRbYvUNE.js} +1 -1
- package/dist/client/assets/{reports-B9pEcRxn.js → reports-CoqdbgJH.js} +1 -1
- package/dist/client/assets/reports-D5qXQXTJ.js +1 -0
- package/dist/client/assets/{reports-onboarding-DxeuhIZr.js → reports-onboarding-B8pLePIS.js} +1 -1
- package/dist/client/assets/{reports-tab-YeP0tPeK.js → reports-tab-BTcGlLJG.js} +2 -2
- package/dist/client/assets/repositories-Cb1lXF50.js +1 -0
- package/dist/client/assets/{repositories-B0Temlg5.js → repositories-cxta7jGt.js} +1 -1
- package/dist/client/assets/{repository-binding-L4ChVpPs.js → repository-binding-DScgU6HN.js} +1 -1
- package/dist/client/assets/{repository-picker-CCYsOJZQ.js → repository-picker-BUWqEoln.js} +1 -1
- package/dist/client/assets/{require-capability-Cm5TFoc0.js → require-capability-Cqs162cO.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BUx3f5eg.js → required-auth-layout-BiIyXd3D.js} +1 -1
- package/dist/client/assets/{reset-password-DWi7rqRm.js → reset-password-da4PvhID.js} +1 -1
- package/dist/client/assets/{resizable-Biivyzu2.js → resizable-Bf-xwR0k.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-C_X-fR95.js → resolve-tab-icon-CGJDnTEl.js} +1 -1
- package/dist/client/assets/{review-settings-DhlyLgn0.js → review-settings-Ulx4CyPZ.js} +1 -1
- package/dist/client/assets/{role-color-_0YSG8Dj.js → role-color-C7dBdDUi.js} +1 -1
- package/dist/client/assets/{roles-akRjx2S4.js → roles-z96sRIvs.js} +1 -1
- package/dist/client/assets/route-CNldsqd_.js +1 -0
- package/dist/client/assets/{route-CKHdrn7R.js → route-D7eWiLEQ.js} +1 -1
- package/dist/client/assets/{route-D1Gpwe4D.js → route-UFlyMaLZ.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-BJx1JU2-.js → sandbox-lifecycle-context-DY2xu0Uo.js} +1 -1
- package/dist/client/assets/{save-status-T9dswXr1.js → save-status-DshwUBI8.js} +1 -1
- package/dist/client/assets/{schema-DjfjCUhq.js → schema-DUByfd2Y.js} +1 -1
- package/dist/client/assets/{schema-Dc_MkHkp.js → schema-DWYnTC39.js} +1 -1
- package/dist/client/assets/{scroll-area-cgfYHO2J.js → scroll-area-EO9hsjie.js} +1 -1
- package/dist/client/assets/{search-input-CgAhBcAm.js → search-input-Dc1w2xyv.js} +1 -1
- package/dist/client/assets/{search-toggle-BvL2EnQl.js → search-toggle-BZIowSkC.js} +1 -1
- package/dist/client/assets/{secret-picker-pXy37N0W.js → secret-picker-t9uXEG8-.js} +1 -1
- package/dist/client/assets/{secrets-DY2kpTfw.js → secrets-CPHCsh_T.js} +1 -1
- package/dist/client/assets/{section-array-field-Dqv2uZIX.js → section-array-field-BFg67nYp.js} +1 -1
- package/dist/client/assets/{sections-BYpfTFZT.js → sections-CrmI_GQr.js} +1 -1
- package/dist/client/assets/{sections-editor-D7uS2U4v.js → sections-editor-CrXI2Bvd.js} +1 -1
- package/dist/client/assets/{select-Dj8hBfnd.js → select-CWL8C0Pw.js} +1 -1
- package/dist/client/assets/{select-model-BCp0KUZW.js → select-model-_wNlq-Z9.js} +1 -1
- package/dist/client/assets/{seo-editor-C6gHCSwh.js → seo-editor-B3mQn1CH.js} +1 -1
- package/dist/client/assets/{separator-CD_4C4Y0.js → separator-Cyq4ZO_K.js} +1 -1
- package/dist/client/assets/settings-tab-CDHhpvzE.js +1 -0
- package/dist/client/assets/{sheet-w42F36Fm.js → sheet-Bqz29cSo.js} +1 -1
- package/dist/client/assets/{shell-layout-SnEo2Z8s.js → shell-layout-DVIwCYxA.js} +1 -1
- package/dist/client/assets/{site-draft-actions-X8qdJpR6.js → site-draft-actions-DQ2Ndjsf.js} +1 -1
- package/dist/client/assets/{site-draft-view-DieOLT9Q.js → site-draft-view-CIEvFlZ7.js} +1 -1
- package/dist/client/assets/site-editor-C927WhHx.js +1 -0
- package/dist/client/assets/{site-editor-toast-CAmfWZOg.js → site-editor-toast-BLqoqKy_.js} +1 -1
- package/dist/client/assets/{skills-BPDMMsh1.js → skills-0h7pumIQ.js} +1 -1
- package/dist/client/assets/{slider-BUH8Dwgf.js → slider-GCMZAdst.js} +1 -1
- package/dist/client/assets/{sortable.esm-BwyBVE7G.js → sortable.esm-CYzspn3s.js} +1 -1
- package/dist/client/assets/{sso-Cf_QJD0l.js → sso-Ca2H_kJv.js} +1 -1
- package/dist/client/assets/{suggestion-EZp_1C2Z.js → suggestion-CppSMZxc.js} +1 -1
- package/dist/client/assets/{super-agent-icon-Cuh3vhpx.js → super-agent-icon-Dq0ZAaMf.js} +1 -1
- package/dist/client/assets/{switch-CcIiziq_.js → switch-DBO_GrNe.js} +1 -1
- package/dist/client/assets/{synced-repos-Cnb_uqs2.js → synced-repos-BTn3MABM.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-DvOK9lLO.js → tab-icon-glyph-BaeBTavE.js} +1 -1
- package/dist/client/assets/{table-CX_Xjv5_.js → table-xCmpwB0s.js} +1 -1
- package/dist/client/assets/{tabs-BVFow_A3.js → tabs-rkhPwLiJ.js} +1 -1
- package/dist/client/assets/{task-board-DVtARw_U.js → task-board-D7RCmGkN.js} +1 -1
- package/dist/client/assets/{task-route-Ck3RXNt1.js → task-route-BJeZEOaQ.js} +1 -1
- package/dist/client/assets/{task-status-DFMg9mu2.js → task-status-ISwbNtXh.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-BUGnnj7V.js → taskboard-analytics-B3vmd83_.js} +1 -1
- package/dist/client/assets/{tasks-B3OOn3U2.js → tasks-BLz1W4rF.js} +1 -1
- package/dist/client/assets/tasks-hZ3cVL1W.js +1 -0
- package/dist/client/assets/{textarea-BxqysnAf.js → textarea-CvY2QE-l.js} +1 -1
- package/dist/client/assets/{thread-analytics-dnNDwV70.js → thread-analytics-DmP3G179.js} +1 -1
- package/dist/client/assets/{thread-intent-BujELieJ.js → thread-intent-0TjSPqLd.js} +1 -1
- package/dist/client/assets/{thread-route-BAkMWoFr.js → thread-route-4ZjlovaL.js} +1 -1
- package/dist/client/assets/{thread-route-CG4NoBnV.js → thread-route-BbSych2c.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-iPIMT5tX.js → thread-sheet-body-JQX8n1oy.js} +1 -1
- package/dist/client/assets/{time-range-picker-DXMtxhmu.js → time-range-picker-Bcp8sqUk.js} +1 -1
- package/dist/client/assets/{toggle-group-CFCrTuTF.js → toggle-group-BPubP3Pi.js} +1 -1
- package/dist/client/assets/{tool-namespace-C9gQSjv3.js → tool-namespace-c-MaHIy3.js} +1 -1
- package/dist/client/assets/{tool-set-selector-Dpj_1lJt.js → tool-set-selector-qnchAzSg.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Bk7F5Fex.js → toolbar-icon-button-DqW_CkJO.js} +1 -1
- package/dist/client/assets/{tooltip-Bj0ggRLV.js → tooltip-mM1fQXaq.js} +1 -1
- package/dist/client/assets/{tooltipContext-BSiIa8-6.js → tooltipContext-B2y0_sWP.js} +1 -1
- package/dist/client/assets/{track-uewKzN4A.js → track-XkKLQQJT.js} +1 -1
- package/dist/client/assets/{types-BuSDoCm5.js → types-E9_eqrxO.js} +1 -1
- package/dist/client/assets/{url-slug-BFZflu8h.js → url-slug-BVpN8K6B.js} +1 -1
- package/dist/client/assets/{usage-stats-FTjlrZsR.js → usage-stats-DT9jvl-J.js} +1 -1
- package/dist/client/assets/{use-ai-providers-hOyNnU7s.js → use-ai-providers-Bku85sJ3.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-JRuS8Fqz.js → use-apply-named-rule-Bwm7LB-d.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-C5w0G3Ru.js +1 -0
- package/dist/client/assets/{use-automations-BW9n1XZu.js → use-automations-D9iFnWhp.js} +1 -1
- package/dist/client/assets/{use-autosave-CFQpxLa7.js → use-autosave-CLbBIg-P.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-BTQz7erp.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-Bib3kRoh.js → use-chat-layout-state-Cbkyo6cP.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-BanOYWkB.js → use-cms-publish-actions-XYKTfqt2.js} +1 -1
- package/dist/client/assets/{use-connect-companion-hxxGTIoI.js → use-connect-companion-DCIdJC0W.js} +1 -1
- package/dist/client/assets/{use-connection-CKudd0UO.js → use-connection-CLoaxXGr.js} +1 -1
- package/dist/client/assets/{use-content-sync-DVFphaEf.js → use-content-sync-14ry1gRC.js} +1 -1
- package/dist/client/assets/{use-copy-s7vshP5o.js → use-copy-D3ELC0tX.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BcLGuFCX.js → use-date-fns-locale-DU1bARSL.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DF7xOcC9.js → use-debounced-autosave-Dxp05968.js} +1 -1
- package/dist/client/assets/{use-debounced-value-B0C48w17.js → use-debounced-value-CgYJanEq.js} +1 -1
- package/dist/client/assets/{use-deco-credits-Cc7w_fUS.js → use-deco-credits-DlgC2mIc.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Ctfpdj_z.js → use-decopilot-events-DhxeqkWl.js} +1 -1
- package/dist/client/assets/{use-delete-block-CMQm89VB.js → use-delete-block-BJD7162e.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BM0YKMsI.js → use-delete-connection-DtzGQTsr.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CJOxofw6.js → use-deployment-admin-8guQU4GC.js} +1 -1
- package/dist/client/assets/{use-entitlements-BPjzEs4p.js → use-entitlements-J4XPZF2l.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-BwHAw0OT.js → use-fast-preview-draft-url-BX0PGrG_.js} +1 -1
- package/dist/client/assets/{use-file-configs-DA74H1hE.js → use-file-configs-DngvlIXa.js} +1 -1
- package/dist/client/assets/{use-id-selection-CMNzhPoi.js → use-id-selection-Dkbf-QZH.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-C-HQ6EgP.js → use-inbox-feed-b7aNeh2-.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-M12K1Dpn.js → use-infinite-scroll-BWIp-OKY.js} +1 -1
- package/dist/client/assets/{use-join-requests-ntiStw2Q.js → use-join-requests-CdvnKUpu.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-DLlaHA4v.js → use-main-panel-tabs-i0OC0oRI.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-B2OMY_Tu.js → use-mcp-auth-status-CxxAbIdU.js} +1 -1
- package/dist/client/assets/{use-mcp-client-D_jTz-1i.js → use-mcp-client-CmWEhN6T.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CFPSpaeI.js → use-mcp-prompts-RB8yW0_L.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BMGCtRJK.js → use-mcp-tools-Bfew76Ae.js} +1 -1
- package/dist/client/assets/{use-mobile-M7B5YJR_.js → use-mobile-BZ5I1Gts.js} +1 -1
- package/dist/client/assets/{use-move-blocks-B5DoaBOm.js → use-move-blocks-a-Gpcz1Q.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BoWId4qC.js → use-navigate-to-agent-CMbT8SLE.js} +1 -1
- package/dist/client/assets/{use-never-published-8p9ySrBa.js → use-never-published-Cq663vOp.js} +1 -1
- package/dist/client/assets/{use-org-fs-Dpr5-hHp.js → use-org-fs-D8fqy59B.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DOKrzBXU.js → use-org-repo-syncs-D0tdQJ2P.js} +1 -1
- package/dist/client/assets/{use-org-sso-zsNytoCe.js → use-org-sso-D-kGbeq_.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CIEI8bNF.js → use-organization-settings-BZz5ibUN.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-tu_PxC_K.js → use-project-native-view-presence-BbI14MhH.js} +1 -1
- package/dist/client/assets/{use-project-scope-D1EeIJG0.js → use-project-scope-3ijTexFj.js} +1 -1
- package/dist/client/assets/{use-recent-apps-DSYeKmJU.js → use-recent-apps-CWPH7SDm.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-ChnnkK6V.js → use-reports-diagnostic-V-qftvBJ.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-bxyyBbR-.js → use-sandbox-events-CBP-Uwww.js} +1 -1
- package/dist/client/assets/{use-secrets-NY7H3OwI.js → use-secrets-CfMZEME2.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-Beu0iQz9.js → use-section-preview-base-DxIpbqPr.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-D0GS7hdN.js → use-sidebar-collapsed-Cbxz0vjB.js} +1 -1
- package/dist/client/assets/{use-tags-NAzrZ60o.js → use-tags-DTSxZWpz.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-DdzuizDS.js → use-task-board-analytics-BKNhIlpV.js} +1 -1
- package/dist/client/assets/{use-task-board-events-iA0mSg2Q.js → use-task-board-events-MfMFlaj-.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-Dw8_2urj.js → use-task-board-item-prs-i0iDRtks.js} +1 -1
- package/dist/client/assets/{use-task-board-items-DQYVvsFC.js → use-task-board-items-6-h_Haer.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-DaZyR7M-.js → use-task-board-prompts-BzepMvGT.js} +1 -1
- package/dist/client/assets/{use-task-metadata-c0FPnJ80.js → use-task-metadata-CkJg1Id-.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-nmtU5Zq-.js → use-thread-outputs-DegzudvH.js} +1 -1
- package/dist/client/assets/{use-view-draft-kind-Cu0aFeKZ.js → use-view-draft-kind-BQ4N5uEB.js} +1 -1
- package/dist/client/assets/{use-voice-input-DPQbRCzt.js → use-voice-input-vD0BpiqU.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-njPYFTao.js +1 -0
- package/dist/client/assets/{useQueries-BncTnCJs.js → useQueries-D6BmTkII.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CSPS7F0z.js +1 -0
- package/dist/client/assets/{users-DnLbGcVd.js → users-RduqDlHV.js} +1 -1
- package/dist/client/assets/{utils-yu1cqe5g.js → utils-CkU_P8Ie.js} +1 -1
- package/dist/client/assets/{variant-calendar-B9yPwKNQ.js → variant-calendar-1rTVvyAx.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-DUz7pA6N.js → variant-matcher-override-B3zGkPXZ.js} +1 -1
- package/dist/client/assets/{view-header-DYVjdF9_.js → view-header-B-Vek7fH.js} +1 -1
- package/dist/client/assets/{virtual-mcp-B46xFMzN.js → virtual-mcp-DPJ0M-HO.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-Cgkbp7EA.js → watch-sse-pool-DqTWfbxM.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-xUigIkK8.js +0 -1
- package/dist/client/assets/agent-deck-Cs__MOn_.js +0 -1
- package/dist/client/assets/agent-experiments-CR3rcuNZ.js +0 -1
- package/dist/client/assets/agent-library-CeznhRs4.js +0 -1
- package/dist/client/assets/agent-library-file-B-Sx2y3P.js +0 -1
- package/dist/client/assets/agent-overview-CFue46Ll.js +0 -1
- package/dist/client/assets/agent-settings-BljPRjiA.js +0 -1
- package/dist/client/assets/agent-site-editor-code-BAiYvGFH.js +0 -2
- package/dist/client/assets/agent-site-editor-content-Bl3XwQ5q.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-Cys48HaE.js +0 -1
- package/dist/client/assets/agent-view-DlR04ups.js +0 -1
- package/dist/client/assets/api-keys-BYU6jhvq.js +0 -1
- package/dist/client/assets/library-DmRa8bBp.js +0 -1
- package/dist/client/assets/project-reports-CidF3Xyg.js +0 -1
- package/dist/client/assets/project-tasks-BYy46ISP.js +0 -1
- package/dist/client/assets/reports-DtEFVn9D.js +0 -1
- package/dist/client/assets/repositories-YEhOcvb2.js +0 -1
- package/dist/client/assets/route-tQ0sT4aI.js +0 -1
- package/dist/client/assets/settings-tab-DPVLqmJT.js +0 -1
- package/dist/client/assets/site-editor-D71enwO7.js +0 -1
- package/dist/client/assets/tasks-DHWz5CTo.js +0 -1
- package/dist/client/assets/use-ask-in-chat-BkWoc5AG.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-B4vRqcEf.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CfdlXnOy.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-QQvh5ycV.js +0 -1
package/dist/client/assets/{site-draft-actions-X8qdJpR6.js → site-draft-actions-DQ2Ndjsf.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c as B,b as be,r as U,j as a,B as xe,m as q,K as hs,al as za,t as et,eJ as Ua,as as jr,dK as wr,Y as os,dL as Ka,aH as _s,aI as Es,aJ as zs,aK as Us,b5 as Ks,aL as qs,aM as Hs,aN as Vs,X as Ys,Z as Zs,_ as en,a as tn,a4 as Ps,bX as qa,h as cs,eK as Pr,eL as wn,bw as Ha,bk as Va,bp as Xn,eM as Ga,eN as Wa,am as Qa,I as Ja,a7 as Xa,eO as Ya,V as Sr,i as mt,er as Pn,q as kr,J as Nr,D as Cr,x as Ar,v as Rr,Q as Dr,R as Tr,eP as Za,b6 as Br,a5 as Sn,b3 as kn,e as Yn,E as el,T as tl}from"./index-5IFWC0PS.js";import{S as sl}from"./separator-CD_4C4Y0.js";import{f as nl,u as fs,r as Ir,l as $r,c as Fr,b as rl}from"./chat-context-BXBBnsXM.js";import{u as It,aa as al,ab as Lr,ac as Or,c as Nn,b as Cn,N as An,ad as ll,M as il,ae as ol,af as cl,ag as dl,v as Rn,U as Mr,ah as ul,a2 as _r,H as hl,ai as fl,aj as ml,g as Er}from"./site-editor-toast-CAmfWZOg.js";import{j as pl,L as bl,g as gl}from"./shell-layout-SnEo2Z8s.js";import{I as zr}from"./toolbar-icon-button-Bk7F5Fex.js";import{b as xl,P as vl,a as yl}from"./popover-DP7XfF8t.js";import{c as tt,T as st,a as nt,b as sn}from"./tooltip-Bj0ggRLV.js";import{f as jl,a as wl,c as Pl,C as Zn,e as er,b as tr}from"./command-CL5fBjco.js";import{T as Tt,a as Ur,b as Kr}from"./tabs-BVFow_A3.js";import{t as qr}from"./ChevronUp-B7dgqvYM.js";import{a0 as Hr,at as nn,F as Sl,a as Vr,S as kl,b as Nl,au as Gr,M as Cl}from"./agent-icon-bK3wLPrb.js";import{a as Wr}from"./SwitchHorizontal01-Dkkqg27i.js";import{c as Qr,s as Gs}from"./Tool01-D4tVVqAj.js";import{s as Jr}from"./Plus-C-Or0hIv.js";import{s as rn}from"./Trash01-Cqkcp6ky.js";import{d as Ls,e as Dn,j as Al,s as Ds,k as Xr,a as Yr,n as Rl,l as Dl}from"./use-view-draft-kind-Cu0aFeKZ.js";import{u as ms}from"./use-voice-input-DPQbRCzt.js";import{o as Tl,f as Bl,g as Il,d as Zr,h as Tn}from"./thread-intent-BujELieJ.js";import{h as ea,r as ta,u as Ss,g as $l,e as Me,f as sa}from"./repository-binding-L4ChVpPs.js";import{u as Fl}from"./use-debounced-value-B0C48w17.js";import{u as Ll}from"./useInfiniteQuery-CfdlXnOy.js";import{d as Ol,b as Ml,p as _l,e as na,g as ra,h as aa}from"./use-navigate-to-agent-BoWId4qC.js";import{u as an,n as js,b as la,a as El,c as zl,d as Ul,r as ys,g as Kl,s as ql,e as Ts,f as Hl}from"./cms-store-drafts-C_2pJAHv.js";import{a as Ws}from"./virtual-mcp-B46xFMzN.js";import{u as Bn}from"./use-blocks-v8-project-B4vRqcEf.js";import{G as ia}from"./github-icon-DbvGzNXg.js";import{a as Vl,b as Gl}from"./use-fast-preview-draft-url-BwHAw0OT.js";import{a3 as ls,a4 as oa,z as Qs,o as In,a5 as Wl,a6 as Ql,E as Jl,a7 as Xl,a8 as Yl,p as Zl,W as jt,f as $n,a9 as ei}from"./blocks-tab-states-CPXZUbSV.js";import"./index-BVaQtZpO.js";import{T as ti}from"./textarea-BxqysnAf.js";import{i as Fn}from"./CheckCircle-CiBUynzC.js";import{n as si,s as ni,C as ri,a as ai,b as li,M as ii,c as oi,d as ci,m as di,u as ui}from"./use-cms-publish-actions-BanOYWkB.js";import{a as hi,g as fi}from"./UserSquare-CK-bjijW.js";import{i as Ln,b as On,m as mi,h as pi,c as ca,f as da,d as bi,r as Mn,e as gi,n as xi,g as vi,j as yi,k as ji,l as _n,o as wi,p as ua,q as Pi,s as En,t as un}from"./sandbox-git-api-DcqI6XE4.js";import{a as Si,g as ki}from"./utils-yu1cqe5g.js";import{i as Ni}from"./Monitor01-HDGt-WwC.js";import{w as zn,R as ha}from"./device-hint-DOHdIy74.js";import{w as sr}from"./editor-DSTLBMSV.js";import{i as Ci,C as Ai}from"./section-array-field-Dqv2uZIX.js";import{s as fa}from"./save-changes-debug-nBi-n9eV.js";import{u as Ri}from"./use-mcp-client-D_jTz-1i.js";import{u as Di}from"./use-sandbox-events-bxyyBbR-.js";import{b as Ti,a as Bi}from"./sandbox-lifecycle-context-BJx1JU2-.js";import{b as Ii}from"./agent-capabilities-CrqOfLmC.js";import{b as $i}from"./thread-route-CG4NoBnV.js";function Fi(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),h=!d&&!l&&!i&&!!e;return i?{isBase:d,current:l,storeDraft:i,unlisted:h}:{isBase:d,current:l,unlisted:h}}const Li={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "},nr=1114111;function rr(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>nr?e:String.fromCodePoint(r)}if(s.startsWith("#")){const r=Number.parseInt(s.slice(1),10);return!Number.isFinite(r)||r>nr?e:String.fromCodePoint(r)}return Li[s]??e}):""}function Oi(t){const e=B.c(39),{url:s,onSave:r}=t,n=be(),[o,d]=U.useState(s??"");let l;e[0]!==o?(l=o.trim(),e[0]=o,e[1]=l):l=e[1];const i=l;let h;e[2]!==r||e[3]!==i?(h=()=>r(i?Tl(i):null),e[2]=r,e[3]=i,e[4]=h):h=e[4];const c=h;let u;e[5]!==n?(u=n("thread.branchPicker.localHint"),e[5]=n,e[6]=u):u=e[6];let p;e[7]!==u?(p=a.jsx("p",{className:"text-xs text-muted-foreground",children:u}),e[7]=u,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=C=>d(C.target.value),e[13]=m):m=e[13];let g;e[14]!==c||e[15]!==i?(g=C=>{C.key==="Enter"&&i&&c()},e[14]=c,e[15]=i,e[16]=g):g=e[16];let v;e[17]!==b||e[18]!==f||e[19]!==g||e[20]!==o?(v=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]=v):v=e[21];let j;e[22]!==r||e[23]!==n||e[24]!==s?(j=s?a.jsx(xe,{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]=j):j=e[25];const w=!i;let x;e[26]!==n?(x=n("thread.branchPicker.save"),e[26]=n,e[27]=x):x=e[27];let P;e[28]!==c||e[29]!==w||e[30]!==x?(P=a.jsx(xe,{size:"sm",disabled:w,onClick:c,children:x}),e[28]=c,e[29]=w,e[30]=x,e[31]=P):P=e[31];let y;e[32]!==j||e[33]!==P?(y=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[j,P]}),e[32]=j,e[33]=P,e[34]=y):y=e[34];let N;return e[35]!==y||e[36]!==p||e[37]!==v?(N=a.jsxs("div",{className:"flex flex-col gap-2 p-2",children:[p,v,y]}),e[35]=y,e[36]=p,e[37]=v,e[38]=N):N=e[38],N}function Mi(t){const e=B.c(8),{virtualMcpId:s,branch:r,serve:n,rowRef:o,onPicked:d}=t,l=It(s,r),i=!!n.connection,h=i&&l.kind==="protocol"&&l.source==="local";let c;e[0]!==d||e[1]!==n?(c=()=>_i(n,d),e[0]=d,e[1]=n,e[2]=c):c=e[2];let u;return e[3]!==o||e[4]!==i||e[5]!==h||e[6]!==c?(u=a.jsx(Ei,{rowRef:o,selected:i,connected:h,onSelect:c}),e[3]=o,e[4]=i,e[5]=h,e[6]=c,e[7]=u):u=e[7],u}function _i(t,e){e?.(),!t.connection&&t.set({endpoint:t.lastEndpoint??al})}function Ei(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=q("flex rounded-lg",l),e[0]=l,e[1]=i):i=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=a.jsx("span",{"data-testid":"localhost-dot",className:"h-2 w-2 shrink-0 rounded-full bg-foreground"}),e[2]=h):h=e[2];let c;e[3]!==d?(c=d("thread.branchPicker.localhost.label"),e[3]=d,e[4]=c):c=e[4];let u;e[5]!==c?(u=a.jsx("span",{className:"min-w-0 flex-1 truncate",children:c}),e[5]=c,e[6]=u):u=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]!==u||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:[h,u,p]}),e[10]=o,e[11]=r,e[12]=u,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 zi=10080*60*1e3;function Ui({sandboxMap:t,userId:e,rawBranches:s,now:r}){const n=new Map;for(const[u,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(u);for(const g of Object.values(f??{})){const v=g?.createdAt??0;v>m.lastActiveAt&&(m.lastActiveAt=v)}}const o=r-zi,d=[...n.entries()].filter(([,u])=>u.lastActiveAt>=o).sort((u,p)=>p[1].lastActiveAt-u[1].lastActiveAt).map(([u,p])=>({name:u,source:"recent",contributors:[...p.userIds],lastActiveAt:p.lastActiveAt})),l=new Set(d.map(u=>u.name)),i=new Set(Object.keys(t?.[e]??{})),h=[...i].filter(u=>!l.has(u)).sort().map(u=>({name:u,source:"yours"})),c=s.filter(u=>!i.has(u.name)&&!l.has(u.name)).map(u=>({name:u.name,source:"other",author:u.author??null}));return{recent:d,yours:h,others:c}}const Ki=100,qi=50,Hi=300;function gn(t,e){const s=e.trim().toLowerCase();return s?t.toLowerCase().includes(s):!0}function Vi(t){const e=B.c(39),{orgId:s,orgSlug:r,userId:n,target:o,sandboxMap:d,owner:l,repo:i,search:h,enabled:c}=t,u=h===void 0?"":h,p=c===void 0?!0:c;let b;e[0]!==u?(b=u.trim(),e[0]=u,e[1]=b):b=e[1];const f=b,m=Fl(f,Hi);let g;e[2]!==o?(g=ea(o),e[2]=o,e[3]=g):g=e[3];const v=g,j=f.length>0;let w;e[4]!==m||e[5]!==s||e[6]!==r||e[7]!==l||e[8]!==i||e[9]!==o?(w=hs.githubBranchSearch(s,r,ta(o),l,i,m),e[4]=m,e[5]=s,e[6]=r,e[7]=l,e[8]=i,e[9]=o,e[10]=w):w=e[10];const x=p&&v;let P;e[11]!==m||e[12]!==r||e[13]!==o?(P=T=>{const{pageParam:ee}=T;return za(r,"REPOSITORY_SEARCH_BRANCHES",{...o,query:m,limit:m?qi:Ki,cursor:ee})},e[11]=m,e[12]=r,e[13]=o,e[14]=P):P=e[14];let y;e[15]!==m?(y=T=>m?void 0:T.nextCursor??void 0,e[15]=m,e[16]=y):y=e[16];let N;e[17]!==w||e[18]!==x||e[19]!==P||e[20]!==y?(N={queryKey:w,enabled:x,staleTime:3e4,retry:!1,initialPageParam:null,queryFn:P,getNextPageParam:y},e[17]=w,e[18]=x,e[19]=P,e[20]=y,e[21]=N):N=e[21];const{data:C,isLoading:A,isError:S,isFetching:D,hasNextPage:k,isFetchingNextPage:L,fetchNextPage:I}=Ll(N),O=j&&(m!==f||D),M=(C?.pages??[]).flatMap(Gi),$=pl(6e4),X=Ui({sandboxMap:d,userId:n,rawBranches:M,now:$});let H;e[22]!==f?(H=T=>gn(T.name,f),e[22]=f,e[23]=H):H=e[23];const Y=X.recent.filter(H);let F;e[24]!==f?(F=T=>gn(T.name,f),e[24]=f,e[25]=F):F=e[25];const K=X.yours.filter(F),J=X.others,ne=C?.pages[0],V=j&&ne&&!O?Math.max(0,ne.totalCount-ne.branches.length):0,de=!j&&k;let Z;e[26]!==I?(Z=()=>{I()},e[26]=I,e[27]=Z):Z=e[27];let re;return e[28]!==V||e[29]!==S||e[30]!==L||e[31]!==A||e[32]!==O||e[33]!==J||e[34]!==Y||e[35]!==de||e[36]!==Z||e[37]!==K?(re={recent:Y,yours:K,others:J,isLoading:A,isError:S,isSearching:O,hiddenMatchCount:V,hasMore:de,isFetchingMore:L,fetchMore:Z},e[28]=V,e[29]=S,e[30]=L,e[31]=A,e[32]=O,e[33]=J,e[34]=Y,e[35]=de,e[36]=Z,e[37]=K,e[38]=re):re=e[38],re}function Gi(t){return t.branches}function Wi(t){const e=B.c(8),s=be(),{releases:r,createRelease:n}=an(t.virtualMcpId),o=Ss(t.virtualMcpId);let d;return e[0]!==n||e[1]!==t.kind||e[2]!==t.userId||e[3]!==t.userLabel||e[4]!==o||e[5]!==r||e[6]!==s?(d=()=>{if(r.length>=Ws)return et.error(s("thread.branchPicker.capReached",{max:Ws})),null;const l=t.kind==="blog"?Bl(t.userLabel):Il(t.userLabel);return n({branch:l,name:la(r,s(Ls(l))),color:js(r.length),createdBy:t.userId,createdAt:new Date().toISOString(),...o?{runtime:Zr(o.metadata)}:{}}).catch(i=>{et.error(s("thread.branchPicker.saveError"),{description:Lr(s,Or(i))})}),l},e[0]=n,e[1]=t.kind,e[2]=t.userId,e[3]=t.userLabel,e[4]=o,e[5]=r,e[6]=s,e[7]=d):d=e[7],d}const Js="-mx-[3px] h-3.5 w-3.5 shrink-0";function Qi(t){const e=B.c(120),{virtualMcpId:s,isV8:r,userLabel:n,value:o,baseBranch:d,baseIsDraft:l,orgId:i,orgSlug:h,userId:c,target:u,owner:p,repo:b,sandboxMap:f,onChange:m,onCreateBranch:g,onAdoptBranch:v,disabled:j,spawnsNewChat:w,placement:x,draftKind:P}=t,y=r===void 0?!1:r,N=l===void 0?!1:l,C=j===void 0?!1:j,A=w===void 0?!1:w,S=x===void 0?"chat":x,D=P===void 0?"site":P,k=be(),I=Dn()?D:null,O=S==="header",[M,$]=U.useState(!1),[X,H]=U.useState(!1),[Y,F]=U.useState("branches"),[K,J]=U.useState(null),[ne,V]=U.useState(""),[de,Z]=U.useState(null),[re,T]=U.useState(null),ee=U.useRef(null),{releases:z,createRelease:te,renameRelease:se,deleteRelease:je}=an(s),ae=I??void 0;let le;e[0]!==ae||e[1]!==c||e[2]!==n||e[3]!==s?(le={virtualMcpId:s,userLabel:n,userId:c,kind:ae},e[0]=ae,e[1]=c,e[2]=n,e[3]=s,e[4]=le):le=e[4];const oe=Wi(le),{projectDefault:ie}=ms(s);let E;e[5]!==ie?(E=R=>Hl(R,ie)==="sandbox",e[5]=ie,e[6]=E):E=e[6];const ue=E,ke=El(s,y),me=y?zl(z,ke.data):[],Q=ke.refetch,_=Ul(s),{url:ce,setUrl:Ve,clear:Pt}=Nn(s),_e=Cn(s),we=y&&!!_e.connection,Ie=y?_e.connection?.endpoint??null:ce,ge=!!Ie;let De;e[7]!==Pt||e[8]!==y||e[9]!==_e?(De=()=>{Pt(),y&&_e.clear()},e[7]=Pt,e[8]=y,e[9]=_e,e[10]=De):De=e[10];const Ae=De;let $e;e[11]!==M?($e={enabled:M},e[11]=M,e[12]=$e):$e=e[12];const{data:Le}=Ua($e);let Fe;e[13]!==Le?.data?.members?(Fe=R=>R?Le?.data?.members?.find(ve=>ve.userId===R)?.user?.name??void 0:void 0,e[13]=Le?.data?.members,e[14]=Fe):Fe=e[14];const St=Fe,pt=z.length>=Ws;let Re;e[15]!==I||e[16]!==ie||e[17]!==z?(Re=R=>!!Ds(z,R.branch,I,ie),e[15]=I,e[16]=ie,e[17]=z,e[18]=Re):Re=e[18];const he=Re,G=k("thread.branchPicker.capReached",{max:Ws}),{isBase:Pe,current:Se,storeDraft:Ne,unlisted:Be}=Fi({value:o,baseBranch:d,releases:z,baseIsDraft:N,storeDrafts:me}),Ge=Al(z,I,o);let rt;e[19]!==I||e[20]!==o?(rt=R=>I===null||Xr(R.name)===I||R.name===o,e[19]=I,e[20]=o,e[21]=rt):rt=e[21];const kt=me.filter(rt),ps=Pe?k("thread.branchPicker.live"):Se?.name??Ne?.name??k(Ls(o)),at=we?k("thread.branchPicker.localhost.label"):ge?k("thread.branchPicker.localLabel"):o?ps:k("thread.branchPicker.selectVersion"),Ft=we?"bg-foreground":ge?"bg-special":Pe?"bg-success":Ne?ys(void 0):ys(Se?.color??"orange"),Te=!we&&!ge&&!Pe&&!!Se&&ue(Se),We=R=>{Ae();const ve=me.some(yt=>yt.name===R)?{runtime:"cms"}:z.find(yt=>yt.branch===R);m(R,ve&&{runtime:ve.runtime}),$(!1)};let lt;e[22]!==k?(lt=R=>{et.error(k("thread.branchPicker.saveError"),{description:Lr(k,Or(R))})},e[22]=k,e[23]=lt):lt=e[23];const Qe=lt;let Lt;e[24]!==Ve?(Lt=R=>{Ve(R),H(!1),$(!1)},e[24]=Ve,e[25]=Lt):Lt=e[25];const bs=Lt,Nt=(R,ve)=>{if(Ae(),v){v(R),H(!1),$(!1);return}if(!z.some(yt=>yt.branch===R)){if(pt){et.error(G);return}te({branch:R,name:ve.trim()||R,color:js(z.length),createdBy:c,createdAt:new Date().toISOString()}).catch(Qe)}m(R),H(!1),$(!1)};let Je;e[26]!==Ae||e[27]!==m||e[28]!==g||e[29]!==oe?(Je=()=>{const R=oe();R&&(Ae(),(g??m)(R),$(!1))},e[26]=Ae,e[27]=m,e[28]=g,e[29]=oe,e[30]=Je):Je=e[30];const gs=Je;let it;e[31]===Symbol.for("react.memo_cache_sentinel")?(it=()=>{J(null),V(""),H(!1),F("branches")},e[31]=it):it=e[31];const xs=it;let ot;e[32]===Symbol.for("react.memo_cache_sentinel")?(ot=R=>{F(R),H(!0)},e[32]=ot):ot=e[32];const Ct=ot;let ct;e[33]===Symbol.for("react.memo_cache_sentinel")?(ct=R=>{J(R.branch),V(R.name)},e[33]=ct):ct=e[33];const vs=ct;let bt;e[34]!==ne||e[35]!==se||e[36]!==Qe?(bt=R=>{const ve=ne.trim();ve&&se(R,ve).catch(Qe),J(null),V("")},e[34]=ne,e[35]=se,e[36]=Qe,e[37]=bt):bt=e[37];const At=bt,Ot=R=>{const ve=R===void 0?o:R,yt=ne.trim();if(yt&&ve){if(pt){et.error(G),J(null),V("");return}te({branch:ve,name:yt,color:js(z.length),createdBy:c,createdAt:new Date().toISOString()}).catch(Qe)}J(null),V("")};let dt;e[38]===Symbol.for("react.memo_cache_sentinel")?(dt=()=>{J(null),V("")},e[38]=dt):dt=e[38];const Rt=dt,Dt=()=>{const R=de;if(Z(null),!(!R||!he(R))){if(R.branch===o){const ve=Ds(z,R.branch,I,ie);ve?We(ve.branch):$(!1)}else $(!1);je(R.branch).catch(Qe)}},gt=Kl(Ge,ie),xt=(gt.content.length>0||kt.length>0)&>.code.length>0,Xe=R=>K===R.branch?a.jsx(hn,{value:ne,onChange:V,onSave:()=>At(R.branch),onCancel:Rt},R.branch):a.jsx(fn,{rowRef:!ge&&R.branch===o?ee:void 0,dot:ys(R.color),codeIcon:ue(R)?Ts(R.color):void 0,label:R.name,creator:St(R.createdBy),originTooltip:y?k("thread.branchPicker.viaStudioUi"):void 0,branch:!y||ue(R)?R.branch:void 0,selected:!ge&&R.branch===o,onSelect:()=>We(R.branch),onRename:()=>vs(R),onDelete:()=>Z(R),deleteBlocked:!he(R)},R.branch),Ye=()=>{const R=re;if(T(null),!!R){if(R.name===o){const ve=Ds(z,R.name,I,ie);if(!ve)return;We(ve.branch)}_.mutateAsync(R.name).catch(ve=>{et.error(k("thread.branchPicker.discardStoreDraftError"),{description:ve instanceof Error?ve.message:void 0})})}},ut=kt.map(R=>K===R.name?a.jsx(hn,{value:ne,onChange:V,onSave:()=>Ot(R.name),onCancel:Rt},`store:${R.name}`):a.jsx(fn,{rowRef:!ge&&R.name===o?ee:void 0,dot:ys(void 0),label:R.name,creator:St(R.createdBy),agentIcon:Ts(js(me.indexOf(R))),originTooltip:k("thread.branchPicker.storeDraftVia",{via:ql(R.via)}),selected:!ge&&R.name===o,onSelect:()=>We(R.name),onRename:()=>{J(R.name),V(R.name)},onDelete:()=>T(R),deleteBlocked:R.name===o&&!Ds(z,R.name,I,ie)},`store:${R.name}`));let Ee;e[39]!==C||e[40]!==y||e[41]!==Q?(Ee=C?void 0:R=>{R?y&&Q():xs(),$(R)},e[39]=C,e[40]=y,e[41]=Q,e[42]=Ee):Ee=e[42];const Ze=O?"text-xs":"text-xs text-muted-foreground hover:text-foreground";let ze;e[43]!==Ze?(ze=q("shrink min-w-0 max-w-[220px] gap-2",Ze,zr),e[43]=Ze,e[44]=ze):ze=e[44];let Ue;e[45]!==C?(Ue=!C&&a.jsx(qr,{size:12,className:"opacity-60 shrink-0"}),e[45]=C,e[46]=Ue):Ue=e[46];let Ke;e[47]!==at?(Ke=a.jsx(nt,{children:at}),e[47]=at,e[48]=Ke):Ke=e[48];const vt=xl,W="w-[min(300px,calc(100vw-2rem))] p-1.5",pe="start";let fe;e[49]===Symbol.for("react.memo_cache_sentinel")?(fe=R=>{R.preventDefault(),ee.current?.scrollIntoView({block:"nearest"})},e[49]=fe):fe=e[49];let ye;e[50]!==A||e[51]!==k?(ye=A&&a.jsx("p",{className:"px-2 pb-1.5 pt-1 text-xs text-muted-foreground",children:k("thread.branchPicker.newChatHint")}),e[50]=A,e[51]=k,e[52]=ye):ye=e[52];const Oe=X?a.jsx(Xi,{orgId:i,orgSlug:h,userId:c,target:u,owner:p,repo:b,sandboxMap:f,enabled:M,tab:Y,onTabChange:F,isV8:y,localUrl:ce,onSaveLocal:bs,onBack:()=>H(!1),onAdopt:Nt,draftKind:I}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:q("always-scrollbar flex max-h-[min(50vh,20rem)] flex-col overflow-y-auto",y&&"gap-1"),children:[!y&&ge&&Ie&&a.jsx(Ji,{rowRef:ee,url:Ie,onSelect:()=>Ct("local"),onEdit:()=>Ct("local"),onTurnOff:()=>Ae()}),Be&&o&&(K===o?a.jsx(hn,{value:ne,onChange:V,onSave:()=>Ot(),onCancel:Rt}):a.jsx(fn,{rowRef:ge?void 0:ee,dot:ys("orange"),label:k(Ls(o)),branch:y?void 0:o,originTooltip:y?k("thread.branchPicker.viaStudioUi"):void 0,selected:!ge,onSelect:()=>We(o),onRename:()=>{J(o),V(la(z,k(Ls(o))))}})),xt?a.jsxs(a.Fragment,{children:[a.jsx(ar,{children:k("thread.branchPicker.groupContent")}),gt.content.map(Xe),ut,a.jsx(ar,{divided:!0,children:k("thread.branchPicker.groupCode")}),gt.code.map(Xe)]}):a.jsxs(a.Fragment,{children:[Ge.map(Xe),ut]}),y&&a.jsx(Mi,{virtualMcpId:s,branch:o,serve:_e,rowRef:we?ee:void 0,onPicked:()=>$(!1)})]}),(Be||Ge.length>0||kt.length>0||y)&&a.jsx("div",{className:"my-1 border-t"}),a.jsxs("button",{type:"button",onClick:()=>{gs()},disabled:pt,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(Jr,{className:"h-4 w-4 shrink-0"}),k("thread.branchPicker.newVersion")]}),pt&&a.jsx("p",{className:"px-2 pb-1 pt-0.5 text-xs text-warning",children:G}),a.jsxs("button",{type:"button",onClick:()=>Ct("branches"),className:q("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",y&&"mt-1"),children:[k("thread.branchPicker.advanced"),a.jsx(jr,{className:"h-4 w-4 shrink-0"})]})]});let ht;e[53]!==vt||e[54]!==fe||e[55]!==ye||e[56]!==Oe?(ht=a.jsxs(vt,{className:W,align:pe,onOpenAutoFocus:fe,children:[ye,Oe]}),e[53]=vt,e[54]=fe,e[55]=ye,e[56]=Oe,e[57]=ht):ht=e[57];const Ea=a.jsxs(vl,{open:M,onOpenChange:Ee,children:[a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx("span",{className:"inline-flex min-w-0 shrink",children:a.jsx(yl,{asChild:!0,children:a.jsxs(xe,{"data-tour":bl.branchPicker,variant:O?"outline":"ghost",size:O?"sm":"default","aria-label":at,disabled:C,className:ze,children:[Te?a.jsx(Hr,{className:q(Js,Ts(Se?.color))}):Ne&&!ge?a.jsx(wr,{className:q(Js,Ts(js(me.indexOf(Ne))))}):a.jsx("span",{className:q("h-2 w-2 shrink-0 rounded-full",o||ge?Ft:"bg-muted-foreground")}),a.jsx("span",{className:"min-w-0 truncate @max-3xl/panel-header:hidden",children:at}),Ue]})})})}),Ke]}),ht]}),cn=de!==null;let Ns;e[58]===Symbol.for("react.memo_cache_sentinel")?(Ns=R=>{R||Z(null)},e[58]=Ns):Ns=e[58];let Mt;e[59]!==k?(Mt=k("thread.branchPicker.deleteTitle"),e[59]=k,e[60]=Mt):Mt=e[60];let _t;e[61]!==Mt?(_t=a.jsx(_s,{children:Mt}),e[61]=Mt,e[62]=_t):_t=e[62];let Et;e[63]!==de||e[64]!==k?(Et=de&&k("thread.branchPicker.deleteConfirm",{name:de.name}),e[63]=de,e[64]=k,e[65]=Et):Et=e[65];let zt;e[66]!==Et?(zt=a.jsx(Es,{children:Et}),e[66]=Et,e[67]=zt):zt=e[67];let Ut;e[68]!==_t||e[69]!==zt?(Ut=a.jsxs(zs,{children:[_t,zt]}),e[68]=_t,e[69]=zt,e[70]=Ut):Ut=e[70];let Kt;e[71]!==k?(Kt=k("thread.branchPicker.cancel"),e[71]=k,e[72]=Kt):Kt=e[72];let qt;e[73]!==Kt?(qt=a.jsx(Us,{children:Kt}),e[73]=Kt,e[74]=qt):qt=e[74];let Ht;e[75]!==k?(Ht=k("thread.branchPicker.delete"),e[75]=k,e[76]=Ht):Ht=e[76];let Vt;e[77]!==Dt||e[78]!==Ht?(Vt=a.jsx(Ks,{onClick:Dt,variant:"destructive",children:Ht}),e[77]=Dt,e[78]=Ht,e[79]=Vt):Vt=e[79];let Gt;e[80]!==qt||e[81]!==Vt?(Gt=a.jsxs(qs,{children:[qt,Vt]}),e[80]=qt,e[81]=Vt,e[82]=Gt):Gt=e[82];let Wt;e[83]!==Ut||e[84]!==Gt?(Wt=a.jsxs(Hs,{children:[Ut,Gt]}),e[83]=Ut,e[84]=Gt,e[85]=Wt):Wt=e[85];let Cs;e[86]!==cn||e[87]!==Wt?(Cs=a.jsx(Vs,{open:cn,onOpenChange:Ns,children:Wt}),e[86]=cn,e[87]=Wt,e[88]=Cs):Cs=e[88];const dn=re!==null;let As;e[89]===Symbol.for("react.memo_cache_sentinel")?(As=R=>{R||T(null)},e[89]=As):As=e[89];let Qt;e[90]!==k?(Qt=k("thread.branchPicker.deleteTitle"),e[90]=k,e[91]=Qt):Qt=e[91];let Jt;e[92]!==Qt?(Jt=a.jsx(_s,{children:Qt}),e[92]=Qt,e[93]=Jt):Jt=e[93];let Xt;e[94]!==re||e[95]!==k?(Xt=re&&k("thread.branchPicker.discardStoreDraftConfirm",{name:re.name}),e[94]=re,e[95]=k,e[96]=Xt):Xt=e[96];let Yt;e[97]!==Xt?(Yt=a.jsx(Es,{children:Xt}),e[97]=Xt,e[98]=Yt):Yt=e[98];let Zt;e[99]!==Jt||e[100]!==Yt?(Zt=a.jsxs(zs,{children:[Jt,Yt]}),e[99]=Jt,e[100]=Yt,e[101]=Zt):Zt=e[101];let es;e[102]!==k?(es=k("thread.branchPicker.cancel"),e[102]=k,e[103]=es):es=e[103];let ts;e[104]!==es?(ts=a.jsx(Us,{children:es}),e[104]=es,e[105]=ts):ts=e[105];let ss;e[106]!==k?(ss=k("thread.branchPicker.delete"),e[106]=k,e[107]=ss):ss=e[107];let ns;e[108]!==Ye||e[109]!==ss?(ns=a.jsx(Ks,{onClick:Ye,variant:"destructive",children:ss}),e[108]=Ye,e[109]=ss,e[110]=ns):ns=e[110];let rs;e[111]!==ts||e[112]!==ns?(rs=a.jsxs(qs,{children:[ts,ns]}),e[111]=ts,e[112]=ns,e[113]=rs):rs=e[113];let as;e[114]!==Zt||e[115]!==rs?(as=a.jsxs(Hs,{children:[Zt,rs]}),e[114]=Zt,e[115]=rs,e[116]=as):as=e[116];let Rs;return e[117]!==dn||e[118]!==as?(Rs=a.jsx(Vs,{open:dn,onOpenChange:As,children:as}),e[117]=dn,e[118]=as,e[119]=Rs):Rs=e[119],a.jsxs(a.Fragment,{children:[Ea,Cs,Rs]})}function hn(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 h;e[4]!==o||e[5]!==n?(h=f=>{f.key==="Enter"&&n(),f.key==="Escape"&&(f.preventDefault(),f.stopPropagation(),o())},e[4]=o,e[5]=n,e[6]=h):h=e[6];let c;e[7]!==l||e[8]!==i||e[9]!==h||e[10]!==s?(c=a.jsx("input",{autoFocus:!0,"aria-label":l,value:s,onChange:i,onKeyDown:h,className:"h-8 flex-1 rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[7]=l,e[8]=i,e[9]=h,e[10]=s,e[11]=c):c=e[11];let u;e[12]!==d?(u=d("thread.branchPicker.save"),e[12]=d,e[13]=u):u=e[13];let p;e[14]!==n||e[15]!==u?(p=a.jsx(xe,{size:"sm",onClick:n,children:u}),e[14]=n,e[15]=u,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 ar(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=q("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 fn(t){const e=B.c(53),{rowRef:s,dot:r,codeIcon:n,agentIcon:o,originTooltip:d,label:l,creator:i,branch:h,selected:c,onSelect:u,onRename:p,onDelete:b,deleteBlocked:f}=t,m=f===void 0?!1:f,g=be();let v;e[0]!==o||e[1]!==n||e[2]!==r?(v=n?a.jsx(Hr,{className:q(Js,n)}):o?a.jsx(wr,{className:q(Js,o)}):a.jsx("span",{className:q("h-2 w-2 shrink-0 rounded-full",r)}),e[0]=o,e[1]=n,e[2]=r,e[3]=v):v=e[3];let j;e[4]!==i?(j=i&&a.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:i}),e[4]=i,e[5]=j):j=e[5];let w;e[6]!==l||e[7]!==j?(w=a.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[l,j]}),e[6]=l,e[7]=j,e[8]=w):w=e[8];let x;e[9]!==u||e[10]!==c||e[11]!==v||e[12]!==w?(x=a.jsxs("button",{type:"button","aria-pressed":c,onClick:u,className:"flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[v,w]}),e[9]=u,e[10]=c,e[11]=v,e[12]=w,e[13]=x):x=e[13];const P=x,y=c?"bg-accent":"hover:bg-accent";let N;e[14]!==y?(N=q("group flex items-center rounded-lg",y),e[14]=y,e[15]=N):N=e[15];let C;e[16]!==h||e[17]!==n||e[18]!==d||e[19]!==P||e[20]!==g?(C=h||d?a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:P}),a.jsxs(nt,{side:"bottom",className:"text-xs",children:[n&&a.jsx("p",{className:"font-medium",children:g("thread.branchPicker.codeDraftTooltip")}),d&&a.jsx("p",{children:d}),h&&a.jsx("p",{className:"font-mono",children:g("thread.branchPicker.branchTooltip",{branch:h})})]})]}):P,e[16]=h,e[17]=n,e[18]=d,e[19]=P,e[20]=g,e[21]=C):C=e[21];let A;e[22]!==g?(A=g("thread.branchPicker.moreActions"),e[22]=g,e[23]=A):A=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=a.jsx(Wr,{className:"h-4 w-4"}),e[24]=S):S=e[24];let D;e[25]!==A?(D=a.jsx(Ys,{asChild:!0,children:a.jsx(xe,{variant:"ghost",size:"icon","aria-label":A,className:"mr-1 h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",children:S})}),e[25]=A,e[26]=D):D=e[26];let k;e[27]===Symbol.for("react.memo_cache_sentinel")?(k=a.jsx(Qr,{className:"h-4 w-4"}),e[27]=k):k=e[27];let L;e[28]!==g?(L=g("thread.branchPicker.rename"),e[28]=g,e[29]=L):L=e[29];let I;e[30]!==p||e[31]!==L?(I=a.jsxs(os,{onSelect:p,children:[k,L]}),e[30]=p,e[31]=L,e[32]=I):I=e[32];let O;e[33]!==m||e[34]!==b||e[35]!==g?(O=b&&a.jsxs(os,{onSelect:b,disabled:m,className:"text-destructive focus:text-destructive",children:[a.jsx(rn,{className:"h-4 w-4"}),g("thread.branchPicker.delete")]}),e[33]=m,e[34]=b,e[35]=g,e[36]=O):O=e[36];let M;e[37]!==m||e[38]!==b||e[39]!==g?(M=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]=M):M=e[40];let $;e[41]!==I||e[42]!==O||e[43]!==M?($=a.jsxs(Zs,{align:"end",children:[I,O,M]}),e[41]=I,e[42]=O,e[43]=M,e[44]=$):$=e[44];let X;e[45]!==D||e[46]!==$?(X=a.jsxs(en,{children:[D,$]}),e[45]=D,e[46]=$,e[47]=X):X=e[47];let H;return e[48]!==s||e[49]!==X||e[50]!==N||e[51]!==C?(H=a.jsxs("div",{ref:s,className:N,children:[C,X]}),e[48]=s,e[49]=X,e[50]=N,e[51]=C,e[52]=H):H=e[52],H}function Ji(t){const e=B.c(40),{rowRef:s,url:r,onSelect:n,onEdit:o,onTurnOff:d}=t,l=be();let i;try{let D;e[0]!==r?(D=new URL(r),e[0]=r,e[1]=D):D=e[1],i=D.host}catch{i=r}const h=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 u;e[3]!==l?(u=l("thread.branchPicker.localLabel"),e[3]=l,e[4]=u):u=e[4];let p;e[5]!==h?(p=a.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:h}),e[5]=h,e[6]=p):p=e[6];let b;e[7]!==u||e[8]!==p?(b=a.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[u,p]}),e[7]=u,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(Wr,{className:"h-4 w-4"}),e[15]=g):g=e[15];let v;e[16]!==m?(v=a.jsx(Ys,{asChild:!0,children:a.jsx(xe,{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]=v):v=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx(Qr,{className:"h-4 w-4"}),e[18]=j):j=e[18];let w;e[19]!==l?(w=l("thread.branchPicker.rename"),e[19]=l,e[20]=w):w=e[20];let x;e[21]!==o||e[22]!==w?(x=a.jsxs(os,{onSelect:o,children:[j,w]}),e[21]=o,e[22]=w,e[23]=x):x=e[23];let P;e[24]===Symbol.for("react.memo_cache_sentinel")?(P=a.jsx(rn,{className:"h-4 w-4"}),e[24]=P):P=e[24];let y;e[25]!==l?(y=l("thread.branchPicker.localTurnOff"),e[25]=l,e[26]=y):y=e[26];let N;e[27]!==d||e[28]!==y?(N=a.jsxs(os,{onSelect:d,className:"text-destructive focus:text-destructive",children:[P,y]}),e[27]=d,e[28]=y,e[29]=N):N=e[29];let C;e[30]!==x||e[31]!==N?(C=a.jsxs(Zs,{align:"end",children:[x,N]}),e[30]=x,e[31]=N,e[32]=C):C=e[32];let A;e[33]!==C||e[34]!==v?(A=a.jsxs(en,{children:[v,C]}),e[33]=C,e[34]=v,e[35]=A):A=e[35];let S;return e[36]!==s||e[37]!==A||e[38]!==f?(S=a.jsxs("div",{ref:s,className:"group flex items-center rounded-lg bg-accent",children:[f,A]}),e[36]=s,e[37]=A,e[38]=f,e[39]=S):S=e[39],S}function Xi(t){const e=B.c(75),{orgId:s,orgSlug:r,userId:n,target:o,owner:d,repo:l,sandboxMap:i,enabled:h,tab:c,onTabChange:u,isV8:p,localUrl:b,onSaveLocal:f,onBack:m,onAdopt:g,draftKind:v}=t,j=be(),[w,x]=U.useState(""),P=c==="branches"?w:"",y=h&&c==="branches";let N;e[0]!==s||e[1]!==r||e[2]!==d||e[3]!==l||e[4]!==i||e[5]!==P||e[6]!==y||e[7]!==o||e[8]!==n?(N={orgId:s,orgSlug:r,userId:n,target:o,sandboxMap:i,owner:d,repo:l,search:P,enabled:y},e[0]=s,e[1]=r,e[2]=d,e[3]=l,e[4]=i,e[5]=P,e[6]=y,e[7]=o,e[8]=n,e[9]=N):N=e[9];const{recent:C,yours:A,others:S,isLoading:D,hasMore:k,isFetchingMore:L,fetchMore:I}=Vi(N),O=h&&c==="prs";let M;e[10]!==s||e[11]!==r||e[12]!==d||e[13]!==l||e[14]!==O||e[15]!==o?(M={orgId:s,orgSlug:r,target:o,owner:d,repo:l,enabled:O},e[10]=s,e[11]=r,e[12]=d,e[13]=l,e[14]=O,e[15]=o,e[16]=M):M=e[16];const{data:$,isLoading:X}=Ol(M);let H;if(e[17]!==v||e[18]!==I||e[19]!==k||e[20]!==L||e[21]!==D||e[22]!==p||e[23]!==b||e[24]!==g||e[25]!==m||e[26]!==f||e[27]!==u||e[28]!==S||e[29]!==d||e[30]!==X||e[31]!==C||e[32]!==l||e[33]!==w||e[34]!==j||e[35]!==$||e[36]!==c||e[37]!==A){const Y=$===void 0?[]:$,F=`${d}/${l}`;let K;e[39]!==F?(K=F.toLowerCase(),e[39]=F,e[40]=K):K=e[40];const J=K;let ne;e[41]!==J?(ne=E=>E.headRepoFullName?.toLowerCase()===J,e[41]=J,e[42]=ne):ne=e[42];const V=Y.filter(ne);let de;if(e[43]!==v||e[44]!==S||e[45]!==C||e[46]!==A){const E=new Set;de=[...C,...A,...S].filter(ue=>E.has(ue.name)?!1:(E.add(ue.name),v!=="site"||Xr(ue.name)==="site")),e[43]=v,e[44]=S,e[45]=C,e[46]=A,e[47]=de}else de=e[47];const Z=de;let re;e[48]===Symbol.for("react.memo_cache_sentinel")?(re=a.jsx(Sl,{className:"h-4 w-4 shrink-0"}),e[48]=re):re=e[48];let T;e[49]!==j?(T=j("thread.branchPicker.advancedBack"),e[49]=j,e[50]=T):T=e[50];let ee;e[51]!==m||e[52]!==T?(ee=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:[re,T]}),e[51]=m,e[52]=T,e[53]=ee):ee=e[53];let z;e[54]!==u?(z=E=>{u(E),x("")},e[54]=u,e[55]=z):z=e[55];let te;e[56]!==j?(te=j("thread.branchPicker.branchesTab"),e[56]=j,e[57]=te):te=e[57];let se;e[58]!==te?(se=a.jsx(Tt,{value:"branches",className:"h-6 px-2.5 text-xs",children:te}),e[58]=te,e[59]=se):se=e[59];let je;e[60]!==j?(je=j("thread.branchPicker.prsTab"),e[60]=j,e[61]=je):je=e[61];let ae;e[62]!==je?(ae=a.jsx(Tt,{value:"prs",className:"h-6 px-2.5 text-xs",children:je}),e[62]=je,e[63]=ae):ae=e[63];let le;e[64]!==p||e[65]!==j?(le=!p&&a.jsx(Tt,{value:"local",className:"h-6 px-2.5 text-xs",children:j("thread.branchPicker.localTab")}),e[64]=p,e[65]=j,e[66]=le):le=e[66];let oe;e[67]!==se||e[68]!==ae||e[69]!==le?(oe=a.jsxs(Ur,{className:"h-auto w-fit justify-start gap-1 bg-accent p-1",variant:"pill",children:[se,ae,le]}),e[67]=se,e[68]=ae,e[69]=le,e[70]=oe):oe=e[70];let ie;e[71]!==z||e[72]!==oe||e[73]!==c?(ie=a.jsx(Kr,{className:"px-2 pt-2 pb-1",value:c,onValueChange:z,children:oe}),e[71]=z,e[72]=oe,e[73]=c,e[74]=ie):ie=e[74],H=a.jsxs("div",{className:"flex flex-col",children:[ee,ie,c==="local"&&!p?a.jsx(Oi,{url:b,onSave:f}):a.jsxs(jl,{filter:c==="branches"?Yi:void 0,children:[a.jsx(wl,{placeholder:j(c==="branches"?"thread.branchPicker.searchBranches":"thread.branchPicker.searchPullRequests"),value:w,onValueChange:x}),a.jsx(Pl,{onScroll:E=>{const ue=E.currentTarget;c==="branches"&&ue.scrollHeight-ue.scrollTop-ue.clientHeight<48&&I()},children:c==="branches"?a.jsxs(a.Fragment,{children:[D&&a.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:j("thread.branchPicker.loadingMore")}),!D&&Z.length===0&&a.jsx(Zn,{children:j("thread.branchPicker.noBranchesFound")}),Z.length>0&&a.jsx(er,{children:Z.map(E=>a.jsxs(tr,{value:E.name,className:"cursor-pointer",onSelect:()=>g(E.name,E.name),children:[a.jsx(Ka,{className:"mr-2 h-4 w-4 shrink-0"}),a.jsx("span",{className:"flex-1 truncate",children:E.name})]},E.name))}),k&&a.jsx("div",{className:"p-2",children:a.jsx(xe,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs",disabled:L,onClick:I,children:j(L?"thread.branchPicker.loadingMore":"thread.branchPicker.loadMoreBranches")})})]}):a.jsxs(a.Fragment,{children:[X&&a.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:j("thread.branchPicker.loadingPullRequests")}),!X&&V.length===0&&a.jsx(Zn,{children:j("thread.branchPicker.noOpenPullRequests")}),V.length>0&&a.jsx(er,{children:V.map(E=>a.jsxs(tr,{value:`#${E.number} ${E.title} ${E.head}`,className:"cursor-pointer",onSelect:()=>g(E.head,rr(E.title)),children:[a.jsx(nn,{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:rr(E.title)}),a.jsxs("span",{className:"truncate text-xs text-muted-foreground",children:["#",E.number," · ",E.head]})]})]},E.number))})]})})]})]}),e[17]=v,e[18]=I,e[19]=k,e[20]=L,e[21]=D,e[22]=p,e[23]=b,e[24]=g,e[25]=m,e[26]=f,e[27]=u,e[28]=S,e[29]=d,e[30]=X,e[31]=C,e[32]=l,e[33]=w,e[34]=j,e[35]=$,e[36]=c,e[37]=A,e[38]=H}else H=e[38];return H}function Yi(t,e){return gn(t,e)?1:0}function Zi(t){const e=B.c(20),{locked:s,placement:r,value:n,virtualMcpId:o,isV8:d,userLabel:l,baseBranch:i,baseIsDraft:h,onChange:c,onCreateBranch:u,onAdoptBranch:p,orgId:b,orgSlug:f,userId:m,target:g,owner:v,repo:j,sandboxMap:w,draftKind:x}=t;let P;return e[0]!==i||e[1]!==h||e[2]!==x||e[3]!==d||e[4]!==s||e[5]!==p||e[6]!==c||e[7]!==u||e[8]!==b||e[9]!==f||e[10]!==v||e[11]!==r||e[12]!==j||e[13]!==w||e[14]!==g||e[15]!==m||e[16]!==l||e[17]!==n||e[18]!==o?(P=a.jsx(Qi,{virtualMcpId:o,isV8:d,userLabel:l,value:n,baseBranch:i,baseIsDraft:h,orgId:b,orgSlug:f,userId:m,target:g,owner:v,repo:j,sandboxMap:w,onChange:c,onCreateBranch:u,onAdoptBranch:p,spawnsNewChat:s,placement:r,draftKind:x}),e[0]=i,e[1]=h,e[2]=x,e[3]=d,e[4]=s,e[5]=p,e[6]=c,e[7]=u,e[8]=b,e[9]=f,e[10]=v,e[11]=r,e[12]=j,e[13]=w,e[14]=g,e[15]=m,e[16]=l,e[17]=n,e[18]=o,e[19]=P):P=e[19],P}function eo(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 to(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 so(t){const e=B.c(25),{virtualMcp:s,currentBranch:r}=t,n=nl(),o=fs();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,h=o?.createTask,c=Yr()==="blog"?"blog":"site",u=ms(s?.id),p=u.runtime,b=s?.metadata;let f;e[3]!==b?(f=Zr(b),e[3]=b,e[4]=f):f=e[4];const m=f,g=m==="cms"&&p==="sandbox",v=$l(s),j=Me(v),{data:w}=tn.useSession(),x=w?.user;let P;e[5]!==x?(P=Tn(x),e[5]=x,e[6]=P):P=e[6];const y=P,N=w?.user?.id??"",{org:C}=Ps(),A=Ml(s,r),S=Bn(s?.id),D=S&&p==="cms";let k;e[7]!==h||e[8]!==r||e[9]!==l||e[10]!==m||e[11]!==p||e[12]!==u.resolved||e[13]!==i||e[14]!==S?(k=(Y,F)=>{const K=to({locked:l,sessionRuntime:u.resolved?p:null,projectRuntime:m,draftRuntime:F&&(F.runtime??m),current:Y===r,contentOnly:S});K.kind==="new-chat"&&h?h({branch:Y,...K.runtime?{runtime:K.runtime}:{}}):i&&i(Y)},e[7]=h,e[8]=r,e[9]=l,e[10]=m,e[11]=p,e[12]=u.resolved,e[13]=i,e[14]=S,e[15]=k):k=e[15];const L=k;let I;e[16]!==g||e[17]!==h||e[18]!==l||e[19]!==i?(I=Y=>{(l||g)&&h?h({branch:Y}):i&&i(Y)},e[16]=g,e[17]=h,e[18]=l,e[19]=i,e[20]=I):I=e[20];const O=I;let M;e[21]!==h?(M=h?Y=>h({runtime:"sandbox",branch:Y}):void 0,e[21]=h,e[22]=M):M=e[22];const $=M,X=v&&ea(j)?a.jsx(Zi,{userLabel:y,virtualMcpId:s?.id??"",isV8:S,value:r,baseBranch:A,baseIsDraft:D,orgId:C.id,orgSlug:C.slug,userId:N,target:j,owner:v.owner,repo:v.name,sandboxMap:s?.metadata?.sandboxMap,onChange:L,onCreateBranch:O,onAdoptBranch:$,locked:l,placement:"chat",draftKind:c},`${ta(j)}:${v.owner}/${v.name}`):null;let H;return e[23]!==X?(H=a.jsx(eo,{branchPill:X}),e[23]=X,e[24]=H):H=e[24],H}const no=qa("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 ro(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=q(no({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 ao(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(os,{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 ma(t){const e=B.c(20),{label:s,onClick:r,variant:n,size:o,disabled:d,loading:l,pulse:i,tooltip:h,icon:c,items:u,menuAriaLabel:p,className:b}=t,f=n===void 0?"default":n,m=o===void 0?"default":o,g=d===void 0?!1:d,v=l===void 0?!1:l,j=i===void 0?!1:i,w=(u?.length??0)>0;let x;if(e[0]!==b||e[1]!==g||e[2]!==w||e[3]!==c||e[4]!==u||e[5]!==s||e[6]!==v||e[7]!==p||e[8]!==r||e[9]!==j||e[10]!==m||e[11]!==h||e[12]!==f){const P=q(zr,f==="default"&&"focus-visible:inset-ring-current");let y;e[14]!==c||e[15]!==v?(y=v?a.jsx(cs,{size:"xs"}):c,e[14]=c,e[15]=v,e[16]=y):y=e[16];const N=a.jsxs(xe,{type:"button",variant:f,size:m,disabled:g,"aria-busy":v||void 0,onClick:v?void 0:r,className:q(P,w&&"rounded-r-none border-r border-current/20"),children:[y,s]}),C=j&&"animate-pulse-brightness motion-reduce:animate-none motion-reduce:opacity-80";let A;e[17]!==b||e[18]!==C?(A=q(C,b),e[17]=b,e[18]=C,e[19]=A):A=e[19],x=a.jsxs(ro,{className:A,children:[h?a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx("span",{className:q("inline-flex rounded-lg outline-none",P,g&&"cursor-not-allowed"),tabIndex:g?0:void 0,role:g?"button":void 0,"aria-disabled":g||void 0,children:N})}),a.jsx(nt,{children:h})]}):N,w?a.jsxs(en,{children:[a.jsx(Ys,{asChild:!0,children:a.jsx(xe,{type:"button",variant:f,size:m,"aria-label":p,className:q("has-[>svg]:px-2",P),children:a.jsx(qr,{className:"size-3.5"})})}),a.jsx(Zs,{align:"end",children:u?.map(lo)})]}):null]}),e[0]=b,e[1]=g,e[2]=w,e[3]=c,e[4]=u,e[5]=s,e[6]=v,e[7]=p,e[8]=r,e[9]=j,e[10]=m,e[11]=h,e[12]=f,e[13]=x}else x=e[13];return x}function lo(t){return a.jsx(ao,{item:t},t.key)}async function io(t){if(t.hosted)return;const e=t.branch;await t.setCurrentTaskBranch(t.nextBranch()),e&&e!==t.baseBranch&&await t.deleteRelease(e)}function oo(t,e,{hosted:s}){return s&&t!==null?t:e}function co(t,e){const s=B.c(11),[r,n]=U.useState(null);let o;s[0]!==r||s[1]!==t||s[2]!==e?(o=oo(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 uo({open:t,hosted:e}){return t||e}function pa(t){return si({userName:t?.name,userEmail:t?.email})??void 0}function ln(t){const e=B.c(18),{state:s,header:r,body:n,note:o,gate:d,footer:l}=t,i=s!=="ready";let h;e[0]!==r?(h=a.jsx("div",{className:"space-y-0.5 px-4 py-3",children:r}),e[0]=r,e[1]=h):h=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 u;e[3]!==o?(u=o?a.jsx("div",{className:"space-y-1.5 border-t px-4 py-3",children:o}):null,e[3]=o,e[4]=u):u=e[4];let p;e[5]!==n||e[6]!==u?(p=a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n,u]}),e[5]=n,e[6]=u,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]!==h||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:[h,c,p,d,b,f]}),e[11]=d,e[12]=s,e[13]=i,e[14]=h,e[15]=p,e[16]=f,e[17]=m):m=e[17],m}function ws(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 ba(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=q("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 He(t){const e=B.c(4),{className:s}=t;let r;e[0]!==s?(r=q("animate-pulse rounded bg-muted motion-reduce:animate-none",s),e[0]=s,e[1]=r):r=e[1];let n;return e[2]!==r?(n=a.jsx("div",{className:r}),e[2]=r,e[3]=n):n=e[3],n}function Bt(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(ba,{children:a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx(He,{className:"size-4 rounded-md"}),a.jsx(He,{className:"h-3 w-24"}),a.jsx(He,{className:"h-2.5 w-16"}),a.jsx(He,{className:"ml-auto size-6 rounded"})]})}),t[0]=e):e=t[0],e}const ho="secret";function ga(t){return t.kind!=="block"?null:t.namedRule??null}function fo(t,e){const s=e.find(r=>r&&typeof r=="object");return s?Jl(s.__resolveType):Xl(t)}const mo=/(?:^|\/)\.deco\/blocks\/([^/]+)\.json$/;function Un(t){const e=mo.exec(t)?.[1];return e?Si(e):null}function Xs(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 po(t,e){return t===null?"new":e===null?"removed":"edited"}function xa(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 is(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 Ha(r);const o=(r.split("/").pop()??r).replace(/\.[jt]sx?$/,"");return xa(o)||o}}return`Section ${e+1}`}function Kn(t){if(Pr(t))return t.value??null;const e=t.__resolveType;return typeof e=="string"&&Va(e)?t.section??null:null}const va=6;function Os(t,e=0){if(e>va||!t||typeof t!="object")return[];if(Array.isArray(t))return t.flatMap(n=>Os(n,e+1));const s=t;if(wn(s.__resolveType))return xn(s).flatMap(n=>Os(n?.value,e+1));const r=Kn(s);return r!==null?Os(r,e+1):[s]}function xn(t){const e=t?.variants;return Array.isArray(e)?e.map(s=>s&&typeof s=="object"&&!Array.isArray(s)?s:null):[]}function lr(t){let e=t;for(let s=0;s<va;s++){if(!e||typeof e!="object"||Array.isArray(e))return null;const r=e;if(wn(r.__resolveType))return r;const n=Kn(r);if(n===null)return null;e=n}return null}function bo(t,e,s){const r=xn(lr(t)),n=e?xn(lr(e)):[],o=e?Array.from({length:Math.max(r.length,n.length)},(i,h)=>h).filter(i=>!on(r[i],n[i])):[],l=[...o.map(i=>r[i]??n[i]),...r.filter((i,h)=>!o.includes(h))].flatMap(i=>Os(i?.value)).map(i=>is(i,s,!0));return[...new Set(l)]}function mn(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 h=o;if(wn(h.__resolveType)){d=!0;break}const c=Kn(h);if(c===null)break;o=c}const l=d?bo(t,n,e):[];return{name:is(d?t:o,e,!0),kind:"section",status:s,fields:r,...d?{wrapper:!0}:{},...l.length>0?{held:l}:{}}}function vn(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&&Pr(d),i=l?d.value:d;if(!Array.isArray(i))return[];const h=l?["sections","variants",o,"value","value"]:["sections","variants",o,"value"];return i.flatMap((c,u)=>c&&typeof c=="object"&&!Array.isArray(c)?[{section:c,basePath:[...h,u]}]:[])})}return[]}function ir(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 on(t,e){return t===void 0&&e===void 0?!0:ir(t)===ir(e)}function wt(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;on(l,i)||o.push({label:xa(d),path:[...s,d],from:l,to:i})}return o}function go(t,e){const s=e.find(r=>r&&typeof r=="object");return s?s.__resolveType===ri:t===ai}function xo(t,e){const s=n=>n===void 0||!!n&&typeof n=="object"&&!Array.isArray(n)&&!("__resolveType"in n),r=[];for(const n of wt(t,e,[])){const o=String(n.path[0]);s(n.from)&&s(n.to)?r.push(...wt(n.from??{},n.to??{},[o])):r.push(n)}return r}const vo=new Set(["sections"]);function qn(t,e,s=!1){const r=t?vn(t,s):[],n=e?vn(e,s):[],o=[],d=Math.max(r.length,n.length);for(let i=0;i<d;i++){const h=r[i],c=n[i];if(!s){const u=yo(h,c,i);u&&o.push(u);continue}if(h&&c){if(on(h.section,c.section))continue;o.push(mn(c.section,i,"edited",wt(h.section,c.section,c.basePath),h.section))}else c?o.push(mn(c.section,i,"new",[])):h&&o.push(mn(h.section,i,"removed",[]))}const l=wt(t,e,[],vo);return l.length>0&&o.push({name:"Page settings",kind:"settings",status:"edited",fields:l}),o}function yo(t,e,s){return t&&e?on(t.section,e.section)?null:{name:is(e.section,s),kind:"section",status:"edited",fields:wt(t.section,e.section,e.basePath)}:e?{name:is(e.section,s),kind:"section",status:"new",fields:[]}:t?{name:is(t.section,s),kind:"section",status:"removed",fields:[]}:null}function yn(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 jo(t){const e=[],s=[],r=[],n=[];for(const[o,d]of Object.entries(t?.diffs??{})){if(Ln(o)){n.push(o);continue}const l=po(d.from,d.to),i=Un(o);if(!i){r.push(yn(o,l));continue}const h=Xs(d.from),c=Xs(d.to),u=c??h;if(!u){r.push(yn(o,l));continue}const p=ls(i,u);if(p){e.push({kind:"page",blockKey:i,name:p.name,pagePath:p.path,isSiteApp:!1,status:l,filepaths:[o],sections:l==="edited"?qn(h,c):[],fromJson:h,toJson:c});continue}const b=In(i,u);s.push({kind:"block",blockKey:i,name:Qs(i,u),pagePath:null,isSiteApp:b,status:l,filepaths:[o],sections:l==="edited"?[{name:Qs(i,u),kind:"section",status:"edited",fields:wt(h,c,[])}].filter(f=>f.fields.length>0):[],fromJson:h,toJson:c})}return ya({pages:e,blocks:s,other:r,generated:n})}function pn(t,e){return(t.filepaths[0]??"").localeCompare(e.filepaths[0]??"")}function ya(t){const{pages:e,blocks:s,other:r,generated:n}=t;return e.sort(pn),s.sort(pn),r.sort(pn),{pages:e,blocks:s,other:r,generated:n,count:e.length+s.length+r.length}}function wo(t){return t==="added"?"new":t==="removed"?"removed":"edited"}function ja(t){return t.startsWith("pages-")}function wa(t){const{files:e,lookup:s,diff:r}=t,n=[],o=[],d=[],l=[];for(const i of e){const h=i.path;if(Ln(h)){l.push(h);continue}const c=wo(i.status),u=Un(h);if(!u){d.push(yn(h,c));continue}const p=r?.diffs[h],b=Xs(p?.from??null),f=Xs(p?.to??null),m=Pa(s,u),g=m??f??b;if((m?ls(u,m):null)??(!m&&ja(u))){const w=g?ls(u,g):null;n.push({kind:"page",blockKey:u,name:w?.name??oa(u),pagePath:w?.path??null,isSiteApp:!1,status:c,filepaths:[h],sections:c==="edited"?qn(b,f):[],fromJson:b,toJson:f??(c==="new"?m:null)});continue}const j=Qs(u,g??{});o.push({kind:"block",blockKey:u,name:j,pagePath:null,isSiteApp:In(u,m??{}),status:c,filepaths:[h],sections:c==="edited"?[{name:j,kind:"section",status:"edited",fields:wt(b,f,[])}].filter(w=>w.fields.length>0):[],fromJson:b,toJson:f})}return ya({pages:n,blocks:o,other:d,generated:l})}function Pa(t,e){const s=t?.[e];return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function Po(t,e){return t??e}function Sa(t){return t.length<=1?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}const bn=3;function Bs(t){if(t.length<=bn)return Sa(t);const e=t.length-bn;return`${t.slice(0,bn).join(", ")} and ${e} more`}function So(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 ko(t){const e=ga(t);return e==="experiments"?"A/B tests":e==="campaigns"?"Campaign dates":t.name}function No(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 ${Bs(s.map(l=>So(l,!!t.v8)))}`),r.length>0){const l=r.length===1?"page":"pages";e.push(`added the ${Bs(r.map(i=>i.name))} ${l}`)}if(n.length>0){const l=n.length===1?"page":"pages";e.push(`removed the ${Bs(n.map(i=>i.name))} ${l}`)}const o=t.blocks.map(ko);if(o.length>0&&e.push(`changed ${Bs(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=Sa(e);return ni(d.charAt(0).toUpperCase()+d.slice(1))}function Co(t,e){return t?vn(t,e).length:0}function Ao(t,e=!1){const s={newPageSections:t.kind==="page"&&t.status==="new"?Co(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 or="••••••";function ds(t){if(Array.isArray(t))return t.map(ds);if(!t||typeof t!="object")return t;const e=t,s={};for(const[r,n]of Object.entries(e))s[r]=ds(n);return e.__resolveType===ho&&"ciphertext"in e&&(s.ciphertext=or),Wa(e)&&"encrypted"in e&&(s.encrypted=or),s}function cr(t){return t.map(e=>({...e,from:ds(e.from),to:ds(e.to)}))}function Ro(t){const{changes:e,sides:s,lookup:r,meta:n,hosted:o}=t,d=[],l=[],i=c=>[...new Set((s?.diagnostics??[]).filter(u=>Xn(Ga(u.file))===Xn(c)).map(u=>u.side))],h=Object.keys(e).sort((c,u)=>c<u?-1:c>u?1:0);for(const c of h){const u=e[c],p=u.kind==="delete"?"removed":u.baseVersion===null?"new":"edited",b=s?.entries[c],f=b?.before??null,m=b?.after??null,g=Pa(r,c),v=g??m??f,j=i(c),w={blockKey:c,status:p,filepaths:[],entry:{name:c,version:u.version},...j.length>0?{unreadable:j}:{},fromJson:ds(f),toJson:ds(m??(p==="new"?g:null))},x=g?ls(c,g,n):null,P=!g&&v?ls(c,v,n):null;if(x??P??(!v&&ja(c))){const S=v?ls(c,v,n):null;d.push({...w,kind:"page",name:S?.name??oa(c),pagePath:S?.path??null,isSiteApp:!1,sections:p==="edited"?qn(f,m,!0).map(D=>({...D,fields:cr(D.fields)})):[]});continue}const y=o?Wl(c,v,g,m,f):null,N=y?Ql(y,[v,g,m,f]):Qs(c,v??{}),C=fo(c,[g,m,f]),A=go(c,[g,m,f]);l.push({...w,kind:"block",name:A?"Settings":N,...A?{cmsSettings:!0}:{},...y?{blogKind:y}:{},...C?{namedRule:C}:{},pagePath:null,isSiteApp:In(c,g??v??{}),sections:p==="edited"?[{name:A?"Settings":N,kind:"section",status:"edited",fields:cr(A?xo(f,m):wt(f,m,[]))}].filter(S=>S.fields.length>0):[]})}return{pages:d,blocks:l,other:[],generated:[],count:d.length+l.length,v8:!0}}function Ce(t){return t.filepaths[0]??t.blockKey??t.name}function Do(t,e){return e(t==="new"?"thread.publishPopover.chipNew":t==="removed"?"thread.publishPopover.chipRemoved":"thread.publishPopover.chipEdited")}function To(t,e){const s=t.kind==="block"?hi:Vr;return a.jsx("span",{title:Do(t.status,e),className:"flex shrink-0",children:a.jsx(s,{className:q("size-4",t.status==="new"&&"text-brand",t.status==="edited"&&"text-warning",t.status==="removed"&&"text-destructive")})})}function Bo(t,e){if(t.kind==="page")return t.pagePath;if(t.kind!=="block")return null;if(t.blogKind)return Yl(t.blogKind,e);if(t.cmsSettings)return e("thread.publishPopover.settingsDetail");const s=ga(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 Io(t,e,s){const r=Ao(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 ka(t){const e=B.c(46),{change:s,bodyPending:r,selected:n,onSelect:o,confirming:d,onConfirmingChange:l,onDiscard:i,isPublishing:h,isDiscarding:c,v8:u}=t,p=r===void 0?!1:r,b=u===void 0?!1:u,f=be();let m;e[0]!==s||e[1]!==f?(m=Bo(s,f),e[0]=s,e[1]=f,e[2]=m):m=e[2];const g=m;let v;if(e[3]!==p||e[4]!==s||e[5]!==d||e[6]!==g||e[7]!==c||e[8]!==h||e[9]!==l||e[10]!==i||e[11]!==o||e[12]!==n||e[13]!==f||e[14]!==b){const j=Io(s,f,b),w=p&&j.length===0&&s.status==="edited",x=n&&"border-foreground/30 bg-accent hover:bg-secondary-hover";let P;e[16]!==x?(P=q("cursor-pointer transition-colors hover:bg-accent",x),e[16]=x,e[17]=P):P=e[17];let y;e[18]!==s?(y=Ce(s),e[18]=s,e[19]=y):y=e[19];let N;e[20]!==s||e[21]!==f?(N=To(s,f),e[20]=s,e[21]=f,e[22]=N):N=e[22];let C;e[23]!==s.cmsSettings||e[24]!==s.name||e[25]!==f?(C=s.cmsSettings?f("thread.publishPopover.settings"):s.name,e[23]=s.cmsSettings,e[24]=s.name,e[25]=f,e[26]=C):C=e[26];let A;e[27]!==C?(A=a.jsx("span",{className:"truncate text-sm font-medium",children:C}),e[27]=C,e[28]=A):A=e[28];let S;e[29]!==g?(S=g?a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:g}):null,e[29]=g,e[30]=S):S=e[30];let D;e[31]!==n||e[32]!==A||e[33]!==S?(D=a.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left","aria-pressed":n,children:[A,S]}),e[31]=n,e[32]=A,e[33]=S,e[34]=D):D=e[34];let k;e[35]!==d||e[36]!==c||e[37]!==h||e[38]!==l||e[39]!==i||e[40]!==f?(k=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:I=>{I.stopPropagation(),l(!1)},children:f("thread.publishDialog.cancel")}),a.jsx("button",{type:"button",className:"text-xs font-medium text-destructive disabled:opacity-50",onClick:I=>{I.stopPropagation(),l(!1),i?.()},disabled:c,children:f("thread.publishPopover.discard")})]}):i?a.jsx(sn,{children:a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx(xe,{type:"button",variant:"ghost-destructive",size:"icon-xs","aria-label":f("thread.publishPopover.discard"),className:"shrink-0 disabled:pointer-events-auto",onClick:I=>{I.stopPropagation(),l(!0)},disabled:h||c,children:a.jsx(rn,{className:"size-3.5"})})}),a.jsx(nt,{children:f("thread.publishPopover.discard")})]})}):null,e[35]=d,e[36]=c,e[37]=h,e[38]=l,e[39]=i,e[40]=f,e[41]=k):k=e[41];let L;e[42]!==D||e[43]!==k||e[44]!==N?(L=a.jsxs("div",{className:"flex items-center gap-2.5",children:[N,D,k]}),e[42]=D,e[43]=k,e[44]=N,e[45]=L):L=e[45],v=a.jsxs(ba,{className:P,"data-change-id":y,onClick:o,children:[L,j.length>0?a.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px] text-xs text-muted-foreground",children:j.map($o)}):w?a.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px]",children:a.jsx(He,{className:"h-4 w-2/3"})}):null]}),e[3]=p,e[4]=s,e[5]=d,e[6]=g,e[7]=c,e[8]=h,e[9]=l,e[10]=i,e[11]=o,e[12]=n,e[13]=f,e[14]=b,e[15]=v}else v=e[15];return v}function $o(t,e){return a.jsx("div",{className:"truncate",children:t},`${e}-${t}`)}function Na(){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]=U.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 h=new ResizeObserver(i);return h.observe(l),()=>h.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 Fo(){return document.documentElement.classList.contains("dark")?"vs-dark":"vs"}const Lo=[{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 dr(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=Lo.map(Oo),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 Oo(t,e){return a.jsxs("div",{className:q("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:q("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:q("h-2 animate-pulse rounded-sm bg-muted",t.width,t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")})]},e)}const Ca={readOnly:!0,renderSideBySide:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12},Mo={...Ca,lineNumbersMinChars:3,lineDecorationsWidth:4,folding:!1,glyphMargin:!1,renderOverviewRuler:!1};function _o(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,h=n===void 0?"px-6":n,c=d===void 0?!1:d,u=l===void 0?"380px":l,[p,b]=U.useState(null),[f,m]=U.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=Fo(),e[0]=g):g=e[0];const v=g;if(!s||Object.keys(s.diffs).length===0){let w;return e[1]!==i?(w=a.jsx("div",{className:"flex items-center justify-center py-10 text-sm text-muted-foreground",children:i}),e[1]=i,e[2]=w):w=e[2],w}let j;return e[3]!==s.diffs||e[4]!==f||e[5]!==u||e[6]!==p||e[7]!==c||e[8]!==o||e[9]!==h?(j=a.jsx("div",{className:"divide-y",children:Object.entries(s.diffs).map(w=>{const[x,P]=w,{from:y,to:N}=P,C=p===x,A=y===null,S=N===null,D=x.startsWith("/")?x.slice(1):x,k=D.lastIndexOf("/"),L=k>=0?D.slice(k+1):D,I=k>=0?D.slice(0,k):null,O=ki(x),M=A?"bg-success":S?"bg-destructive":"bg-warning";return c?a.jsx("div",{children:a.jsx(sr,{original:y??"",modified:N??"",language:O,theme:v,height:u,loading:a.jsx(dr,{height:u}),options:Mo})},x):a.jsxs("div",{children:[a.jsxs("div",{className:q("flex items-center gap-3 py-3 hover:bg-accent",h),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(C?null:x),children:a.jsx(jr,{className:q("h-3.5 w-3.5 transition-transform",C&&"rotate-90")})}),a.jsx("div",{className:q("h-2.5 w-2.5 shrink-0 rounded-full",M)}),a.jsx(Vr,{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:L}),I&&a.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:I}),o?a.jsxs(en,{children:[a.jsx(Ys,{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(Qa,{className:"h-3.5 w-3.5"})})}),a.jsx(Zs,{align:"end",children:a.jsx(os,{className:"text-destructive focus:text-destructive",onSelect:()=>m(x),children:"Discard changes"})})]}):null]}),f===x&&o?a.jsxs("div",{className:q("flex items-center justify-between gap-3 border-t bg-destructive/5 py-2.5",h),children:[a.jsxs("span",{className:"text-xs text-destructive",children:["Discard all changes to"," ",a.jsx("span",{className:"font-medium",children:L}),"? This cannot be undone."]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[a.jsx(xe,{type:"button",variant:"ghost",size:"sm",onClick:()=>m(null),children:"Cancel"}),a.jsx(xe,{type:"button",variant:"destructive",size:"sm",onClick:()=>{m(null),o(x)},children:"Discard"})]})]}):null,C&&a.jsx("div",{className:"border-t",children:a.jsx(sr,{original:y??"",modified:N??"",language:O,theme:v,height:u,loading:a.jsx(dr,{height:u}),options:Ca})})]},x)})}),e[3]=s.diffs,e[4]=f,e[5]=u,e[6]=p,e[7]=c,e[8]=o,e[9]=h,e[10]=j):j=e[10],j}function Eo(t){if(t.kind!=="block"||t.isSiteApp||!t.blockKey)return null;const e=(t.toJson??t.fromJson)?.__resolveType;return typeof e=="string"&&Ci(e)?t.blockKey:null}function zo(t){return t.kind!=="page"?!0:!t.pagePath||jt(t.pagePath).length>0}function Uo(t,e){try{return ll(t,ei,e)}catch{return null}}function Ko(t,e,s){if(!e)return;const r=Zl(e,t);if(!r)return null;if(jt(r.path).length===0||s?.path!==r.path)return r.path;const n=$n(r.path,s.params);return jt(n).length===0?n:r.path}function qo(t){return t.sectionKey&&!t.v8?Uo(t.previewServerUrl,t.sectionKey):Vo(t.previewServerUrl,t.path)}function Ho(t,e){if(t.kind!=="page")return"/";const s=t.pagePath;if(!s)return"";if(jt(s).length===0)return s;if(e?.path!==s)return"";const r=$n(s,e.params);return jt(r).length===0?r:""}function Vo(t,e){const s=e.trim();if(!s||jt(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 Go(t,e){return e?.kind==="pointer"&&e.link?An(t.toString(),e.link):Aa(t,e)}function Aa(t,e){if(!e)return null;if(e.kind==="pointer")return An(t.toString(),e.pointer);try{return new URL(`${t.pathname}${t.search}`,e.previewUrl).href}catch{return null}}function Wo(t,e,s){return e===null?!1:t!=="other"||s?.kind==="sandbox"}function Qo(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 Ra=U.createContext(!0),Jo=["split","before","after","code"];function Xo(t){return Jo.includes(t)}const Da={desktop:1280,mobile:412};function Yo(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 U,j as a,B as xe,m as q,K as hs,al as za,t as et,eJ as Ua,as as jr,dK as wr,Y as os,dL as Ka,aH as _s,aI as Es,aJ as zs,aK as Us,b5 as Ks,aL as qs,aM as Hs,aN as Vs,X as Ys,Z as Zs,_ as en,a as tn,a4 as Ps,bX as qa,h as cs,eK as Pr,eL as wn,bw as Ha,bk as Va,bp as Xn,eM as Ga,eN as Wa,am as Qa,I as Ja,a7 as Xa,eO as Ya,V as Sr,i as mt,er as Pn,q as kr,J as Nr,D as Cr,x as Ar,v as Rr,Q as Dr,R as Tr,eP as Za,b6 as Br,a5 as Sn,b3 as kn,e as Yn,E as el,T as tl}from"./index-CWKxkTwy.js";import{S as sl}from"./separator-Cyq4ZO_K.js";import{f as nl,u as fs,r as Ir,l as $r,c as Fr,b as rl}from"./chat-context-D8Eje7xK.js";import{u as It,aa as al,ab as Lr,ac as Or,c as Nn,b as Cn,N as An,ad as ll,M as il,ae as ol,af as cl,ag as dl,v as Rn,U as Mr,ah as ul,a2 as _r,H as hl,ai as fl,aj as ml,g as Er}from"./site-editor-toast-BLqoqKy_.js";import{j as pl,L as bl,g as gl}from"./shell-layout-DVIwCYxA.js";import{I as zr}from"./toolbar-icon-button-DqW_CkJO.js";import{b as xl,P as vl,a as yl}from"./popover-CTEYICXO.js";import{c as tt,T as st,a as nt,b as sn}from"./tooltip-mM1fQXaq.js";import{f as jl,a as wl,c as Pl,C as Zn,e as er,b as tr}from"./command-BOSLOC8n.js";import{T as Tt,a as Ur,b as Kr}from"./tabs-rkhPwLiJ.js";import{t as qr}from"./ChevronUp-JSFuaLqF.js";import{a0 as Hr,at as nn,F as Sl,a as Vr,S as kl,b as Nl,au as Gr,M as Cl}from"./agent-icon-BwEytdmh.js";import{a as Wr}from"./SwitchHorizontal01-CP6L8rlm.js";import{c as Qr,s as Gs}from"./Tool01-DAYJL0v-.js";import{s as Jr}from"./Plus-Bq5KiXqn.js";import{s as rn}from"./Trash01-Dt7pyOwE.js";import{d as Ls,e as Dn,j as Al,s as Ds,k as Xr,a as Yr,n as Rl,l as Dl}from"./use-view-draft-kind-BQ4N5uEB.js";import{u as ms}from"./use-voice-input-vD0BpiqU.js";import{o as Tl,f as Bl,g as Il,d as Zr,h as Tn}from"./thread-intent-0TjSPqLd.js";import{h as ea,r as ta,u as Ss,g as $l,e as Me,f as sa}from"./repository-binding-DScgU6HN.js";import{u as Fl}from"./use-debounced-value-CgYJanEq.js";import{u as Ll}from"./useInfiniteQuery-njPYFTao.js";import{d as Ol,b as Ml,p as _l,e as na,g as ra,h as aa}from"./use-navigate-to-agent-CMbT8SLE.js";import{u as an,n as js,b as la,a as El,c as zl,d as Ul,r as ys,g as Kl,s as ql,e as Ts,f as Hl}from"./cms-store-drafts-chLFxeWf.js";import{a as Ws}from"./virtual-mcp-DPJ0M-HO.js";import{u as Bn}from"./use-blocks-v8-project-BTQz7erp.js";import{G as ia}from"./github-icon-DEvD-SlA.js";import{a as Vl,b as Gl}from"./use-fast-preview-draft-url-BX0PGrG_.js";import{a3 as ls,a4 as oa,z as Qs,o as In,a5 as Wl,a6 as Ql,E as Jl,a7 as Xl,a8 as Yl,p as Zl,W as jt,f as $n,a9 as ei}from"./blocks-tab-states-BUfMyINR.js";import"./index-CzrYE4jE.js";import{T as ti}from"./textarea-CvY2QE-l.js";import{i as Fn}from"./CheckCircle-BfCYdSA_.js";import{n as si,s as ni,C as ri,a as ai,b as li,M as ii,c as oi,d as ci,m as di,u as ui}from"./use-cms-publish-actions-XYKTfqt2.js";import{a as hi,g as fi}from"./UserSquare-CBWDFbi3.js";import{i as Ln,b as On,m as mi,h as pi,c as ca,f as da,d as bi,r as Mn,e as gi,n as xi,g as vi,j as yi,k as ji,l as _n,o as wi,p as ua,q as Pi,s as En,t as un}from"./sandbox-git-api-DcqI6XE4.js";import{a as Si,g as ki}from"./utils-CkU_P8Ie.js";import{i as Ni}from"./Monitor01-CqtNhdJN.js";import{w as zn,R as ha}from"./device-hint-DgkMhcRQ.js";import{w as sr}from"./editor-DZ4pzlHx.js";import{i as Ci,C as Ai}from"./section-array-field-BFg67nYp.js";import{s as fa}from"./save-changes-debug-nBi-n9eV.js";import{u as Ri}from"./use-mcp-client-CmWEhN6T.js";import{u as Di}from"./use-sandbox-events-CBP-Uwww.js";import{b as Ti,a as Bi}from"./sandbox-lifecycle-context-DY2xu0Uo.js";import{b as Ii}from"./agent-capabilities-DHVCvnvi.js";import{b as $i}from"./thread-route-BbSych2c.js";function Fi(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),h=!d&&!l&&!i&&!!e;return i?{isBase:d,current:l,storeDraft:i,unlisted:h}:{isBase:d,current:l,unlisted:h}}const Li={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "},nr=1114111;function rr(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>nr?e:String.fromCodePoint(r)}if(s.startsWith("#")){const r=Number.parseInt(s.slice(1),10);return!Number.isFinite(r)||r>nr?e:String.fromCodePoint(r)}return Li[s]??e}):""}function Oi(t){const e=B.c(39),{url:s,onSave:r}=t,n=be(),[o,d]=U.useState(s??"");let l;e[0]!==o?(l=o.trim(),e[0]=o,e[1]=l):l=e[1];const i=l;let h;e[2]!==r||e[3]!==i?(h=()=>r(i?Tl(i):null),e[2]=r,e[3]=i,e[4]=h):h=e[4];const c=h;let u;e[5]!==n?(u=n("thread.branchPicker.localHint"),e[5]=n,e[6]=u):u=e[6];let p;e[7]!==u?(p=a.jsx("p",{className:"text-xs text-muted-foreground",children:u}),e[7]=u,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=C=>d(C.target.value),e[13]=m):m=e[13];let g;e[14]!==c||e[15]!==i?(g=C=>{C.key==="Enter"&&i&&c()},e[14]=c,e[15]=i,e[16]=g):g=e[16];let v;e[17]!==b||e[18]!==f||e[19]!==g||e[20]!==o?(v=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]=v):v=e[21];let j;e[22]!==r||e[23]!==n||e[24]!==s?(j=s?a.jsx(xe,{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]=j):j=e[25];const w=!i;let x;e[26]!==n?(x=n("thread.branchPicker.save"),e[26]=n,e[27]=x):x=e[27];let P;e[28]!==c||e[29]!==w||e[30]!==x?(P=a.jsx(xe,{size:"sm",disabled:w,onClick:c,children:x}),e[28]=c,e[29]=w,e[30]=x,e[31]=P):P=e[31];let y;e[32]!==j||e[33]!==P?(y=a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[j,P]}),e[32]=j,e[33]=P,e[34]=y):y=e[34];let N;return e[35]!==y||e[36]!==p||e[37]!==v?(N=a.jsxs("div",{className:"flex flex-col gap-2 p-2",children:[p,v,y]}),e[35]=y,e[36]=p,e[37]=v,e[38]=N):N=e[38],N}function Mi(t){const e=B.c(8),{virtualMcpId:s,branch:r,serve:n,rowRef:o,onPicked:d}=t,l=It(s,r),i=!!n.connection,h=i&&l.kind==="protocol"&&l.source==="local";let c;e[0]!==d||e[1]!==n?(c=()=>_i(n,d),e[0]=d,e[1]=n,e[2]=c):c=e[2];let u;return e[3]!==o||e[4]!==i||e[5]!==h||e[6]!==c?(u=a.jsx(Ei,{rowRef:o,selected:i,connected:h,onSelect:c}),e[3]=o,e[4]=i,e[5]=h,e[6]=c,e[7]=u):u=e[7],u}function _i(t,e){e?.(),!t.connection&&t.set({endpoint:t.lastEndpoint??al})}function Ei(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=q("flex rounded-lg",l),e[0]=l,e[1]=i):i=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=a.jsx("span",{"data-testid":"localhost-dot",className:"h-2 w-2 shrink-0 rounded-full bg-foreground"}),e[2]=h):h=e[2];let c;e[3]!==d?(c=d("thread.branchPicker.localhost.label"),e[3]=d,e[4]=c):c=e[4];let u;e[5]!==c?(u=a.jsx("span",{className:"min-w-0 flex-1 truncate",children:c}),e[5]=c,e[6]=u):u=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]!==u||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:[h,u,p]}),e[10]=o,e[11]=r,e[12]=u,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 zi=10080*60*1e3;function Ui({sandboxMap:t,userId:e,rawBranches:s,now:r}){const n=new Map;for(const[u,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(u);for(const g of Object.values(f??{})){const v=g?.createdAt??0;v>m.lastActiveAt&&(m.lastActiveAt=v)}}const o=r-zi,d=[...n.entries()].filter(([,u])=>u.lastActiveAt>=o).sort((u,p)=>p[1].lastActiveAt-u[1].lastActiveAt).map(([u,p])=>({name:u,source:"recent",contributors:[...p.userIds],lastActiveAt:p.lastActiveAt})),l=new Set(d.map(u=>u.name)),i=new Set(Object.keys(t?.[e]??{})),h=[...i].filter(u=>!l.has(u)).sort().map(u=>({name:u,source:"yours"})),c=s.filter(u=>!i.has(u.name)&&!l.has(u.name)).map(u=>({name:u.name,source:"other",author:u.author??null}));return{recent:d,yours:h,others:c}}const Ki=100,qi=50,Hi=300;function gn(t,e){const s=e.trim().toLowerCase();return s?t.toLowerCase().includes(s):!0}function Vi(t){const e=B.c(39),{orgId:s,orgSlug:r,userId:n,target:o,sandboxMap:d,owner:l,repo:i,search:h,enabled:c}=t,u=h===void 0?"":h,p=c===void 0?!0:c;let b;e[0]!==u?(b=u.trim(),e[0]=u,e[1]=b):b=e[1];const f=b,m=Fl(f,Hi);let g;e[2]!==o?(g=ea(o),e[2]=o,e[3]=g):g=e[3];const v=g,j=f.length>0;let w;e[4]!==m||e[5]!==s||e[6]!==r||e[7]!==l||e[8]!==i||e[9]!==o?(w=hs.githubBranchSearch(s,r,ta(o),l,i,m),e[4]=m,e[5]=s,e[6]=r,e[7]=l,e[8]=i,e[9]=o,e[10]=w):w=e[10];const x=p&&v;let P;e[11]!==m||e[12]!==r||e[13]!==o?(P=T=>{const{pageParam:ee}=T;return za(r,"REPOSITORY_SEARCH_BRANCHES",{...o,query:m,limit:m?qi:Ki,cursor:ee})},e[11]=m,e[12]=r,e[13]=o,e[14]=P):P=e[14];let y;e[15]!==m?(y=T=>m?void 0:T.nextCursor??void 0,e[15]=m,e[16]=y):y=e[16];let N;e[17]!==w||e[18]!==x||e[19]!==P||e[20]!==y?(N={queryKey:w,enabled:x,staleTime:3e4,retry:!1,initialPageParam:null,queryFn:P,getNextPageParam:y},e[17]=w,e[18]=x,e[19]=P,e[20]=y,e[21]=N):N=e[21];const{data:C,isLoading:A,isError:S,isFetching:D,hasNextPage:k,isFetchingNextPage:L,fetchNextPage:I}=Ll(N),O=j&&(m!==f||D),M=(C?.pages??[]).flatMap(Gi),$=pl(6e4),X=Ui({sandboxMap:d,userId:n,rawBranches:M,now:$});let H;e[22]!==f?(H=T=>gn(T.name,f),e[22]=f,e[23]=H):H=e[23];const Y=X.recent.filter(H);let F;e[24]!==f?(F=T=>gn(T.name,f),e[24]=f,e[25]=F):F=e[25];const K=X.yours.filter(F),J=X.others,ne=C?.pages[0],V=j&&ne&&!O?Math.max(0,ne.totalCount-ne.branches.length):0,de=!j&&k;let Z;e[26]!==I?(Z=()=>{I()},e[26]=I,e[27]=Z):Z=e[27];let re;return e[28]!==V||e[29]!==S||e[30]!==L||e[31]!==A||e[32]!==O||e[33]!==J||e[34]!==Y||e[35]!==de||e[36]!==Z||e[37]!==K?(re={recent:Y,yours:K,others:J,isLoading:A,isError:S,isSearching:O,hiddenMatchCount:V,hasMore:de,isFetchingMore:L,fetchMore:Z},e[28]=V,e[29]=S,e[30]=L,e[31]=A,e[32]=O,e[33]=J,e[34]=Y,e[35]=de,e[36]=Z,e[37]=K,e[38]=re):re=e[38],re}function Gi(t){return t.branches}function Wi(t){const e=B.c(8),s=be(),{releases:r,createRelease:n}=an(t.virtualMcpId),o=Ss(t.virtualMcpId);let d;return e[0]!==n||e[1]!==t.kind||e[2]!==t.userId||e[3]!==t.userLabel||e[4]!==o||e[5]!==r||e[6]!==s?(d=()=>{if(r.length>=Ws)return et.error(s("thread.branchPicker.capReached",{max:Ws})),null;const l=t.kind==="blog"?Bl(t.userLabel):Il(t.userLabel);return n({branch:l,name:la(r,s(Ls(l))),color:js(r.length),createdBy:t.userId,createdAt:new Date().toISOString(),...o?{runtime:Zr(o.metadata)}:{}}).catch(i=>{et.error(s("thread.branchPicker.saveError"),{description:Lr(s,Or(i))})}),l},e[0]=n,e[1]=t.kind,e[2]=t.userId,e[3]=t.userLabel,e[4]=o,e[5]=r,e[6]=s,e[7]=d):d=e[7],d}const Js="-mx-[3px] h-3.5 w-3.5 shrink-0";function Qi(t){const e=B.c(120),{virtualMcpId:s,isV8:r,userLabel:n,value:o,baseBranch:d,baseIsDraft:l,orgId:i,orgSlug:h,userId:c,target:u,owner:p,repo:b,sandboxMap:f,onChange:m,onCreateBranch:g,onAdoptBranch:v,disabled:j,spawnsNewChat:w,placement:x,draftKind:P}=t,y=r===void 0?!1:r,N=l===void 0?!1:l,C=j===void 0?!1:j,A=w===void 0?!1:w,S=x===void 0?"chat":x,D=P===void 0?"site":P,k=be(),I=Dn()?D:null,O=S==="header",[M,$]=U.useState(!1),[X,H]=U.useState(!1),[Y,F]=U.useState("branches"),[K,J]=U.useState(null),[ne,V]=U.useState(""),[de,Z]=U.useState(null),[re,T]=U.useState(null),ee=U.useRef(null),{releases:z,createRelease:te,renameRelease:se,deleteRelease:je}=an(s),ae=I??void 0;let le;e[0]!==ae||e[1]!==c||e[2]!==n||e[3]!==s?(le={virtualMcpId:s,userLabel:n,userId:c,kind:ae},e[0]=ae,e[1]=c,e[2]=n,e[3]=s,e[4]=le):le=e[4];const oe=Wi(le),{projectDefault:ie}=ms(s);let E;e[5]!==ie?(E=R=>Hl(R,ie)==="sandbox",e[5]=ie,e[6]=E):E=e[6];const ue=E,ke=El(s,y),me=y?zl(z,ke.data):[],Q=ke.refetch,_=Ul(s),{url:ce,setUrl:Ve,clear:Pt}=Nn(s),_e=Cn(s),we=y&&!!_e.connection,Ie=y?_e.connection?.endpoint??null:ce,ge=!!Ie;let De;e[7]!==Pt||e[8]!==y||e[9]!==_e?(De=()=>{Pt(),y&&_e.clear()},e[7]=Pt,e[8]=y,e[9]=_e,e[10]=De):De=e[10];const Ae=De;let $e;e[11]!==M?($e={enabled:M},e[11]=M,e[12]=$e):$e=e[12];const{data:Le}=Ua($e);let Fe;e[13]!==Le?.data?.members?(Fe=R=>R?Le?.data?.members?.find(ve=>ve.userId===R)?.user?.name??void 0:void 0,e[13]=Le?.data?.members,e[14]=Fe):Fe=e[14];const St=Fe,pt=z.length>=Ws;let Re;e[15]!==I||e[16]!==ie||e[17]!==z?(Re=R=>!!Ds(z,R.branch,I,ie),e[15]=I,e[16]=ie,e[17]=z,e[18]=Re):Re=e[18];const he=Re,G=k("thread.branchPicker.capReached",{max:Ws}),{isBase:Pe,current:Se,storeDraft:Ne,unlisted:Be}=Fi({value:o,baseBranch:d,releases:z,baseIsDraft:N,storeDrafts:me}),Ge=Al(z,I,o);let rt;e[19]!==I||e[20]!==o?(rt=R=>I===null||Xr(R.name)===I||R.name===o,e[19]=I,e[20]=o,e[21]=rt):rt=e[21];const kt=me.filter(rt),ps=Pe?k("thread.branchPicker.live"):Se?.name??Ne?.name??k(Ls(o)),at=we?k("thread.branchPicker.localhost.label"):ge?k("thread.branchPicker.localLabel"):o?ps:k("thread.branchPicker.selectVersion"),Ft=we?"bg-foreground":ge?"bg-special":Pe?"bg-success":Ne?ys(void 0):ys(Se?.color??"orange"),Te=!we&&!ge&&!Pe&&!!Se&&ue(Se),We=R=>{Ae();const ve=me.some(yt=>yt.name===R)?{runtime:"cms"}:z.find(yt=>yt.branch===R);m(R,ve&&{runtime:ve.runtime}),$(!1)};let lt;e[22]!==k?(lt=R=>{et.error(k("thread.branchPicker.saveError"),{description:Lr(k,Or(R))})},e[22]=k,e[23]=lt):lt=e[23];const Qe=lt;let Lt;e[24]!==Ve?(Lt=R=>{Ve(R),H(!1),$(!1)},e[24]=Ve,e[25]=Lt):Lt=e[25];const bs=Lt,Nt=(R,ve)=>{if(Ae(),v){v(R),H(!1),$(!1);return}if(!z.some(yt=>yt.branch===R)){if(pt){et.error(G);return}te({branch:R,name:ve.trim()||R,color:js(z.length),createdBy:c,createdAt:new Date().toISOString()}).catch(Qe)}m(R),H(!1),$(!1)};let Je;e[26]!==Ae||e[27]!==m||e[28]!==g||e[29]!==oe?(Je=()=>{const R=oe();R&&(Ae(),(g??m)(R),$(!1))},e[26]=Ae,e[27]=m,e[28]=g,e[29]=oe,e[30]=Je):Je=e[30];const gs=Je;let it;e[31]===Symbol.for("react.memo_cache_sentinel")?(it=()=>{J(null),V(""),H(!1),F("branches")},e[31]=it):it=e[31];const xs=it;let ot;e[32]===Symbol.for("react.memo_cache_sentinel")?(ot=R=>{F(R),H(!0)},e[32]=ot):ot=e[32];const Ct=ot;let ct;e[33]===Symbol.for("react.memo_cache_sentinel")?(ct=R=>{J(R.branch),V(R.name)},e[33]=ct):ct=e[33];const vs=ct;let bt;e[34]!==ne||e[35]!==se||e[36]!==Qe?(bt=R=>{const ve=ne.trim();ve&&se(R,ve).catch(Qe),J(null),V("")},e[34]=ne,e[35]=se,e[36]=Qe,e[37]=bt):bt=e[37];const At=bt,Ot=R=>{const ve=R===void 0?o:R,yt=ne.trim();if(yt&&ve){if(pt){et.error(G),J(null),V("");return}te({branch:ve,name:yt,color:js(z.length),createdBy:c,createdAt:new Date().toISOString()}).catch(Qe)}J(null),V("")};let dt;e[38]===Symbol.for("react.memo_cache_sentinel")?(dt=()=>{J(null),V("")},e[38]=dt):dt=e[38];const Rt=dt,Dt=()=>{const R=de;if(Z(null),!(!R||!he(R))){if(R.branch===o){const ve=Ds(z,R.branch,I,ie);ve?We(ve.branch):$(!1)}else $(!1);je(R.branch).catch(Qe)}},gt=Kl(Ge,ie),xt=(gt.content.length>0||kt.length>0)&>.code.length>0,Xe=R=>K===R.branch?a.jsx(hn,{value:ne,onChange:V,onSave:()=>At(R.branch),onCancel:Rt},R.branch):a.jsx(fn,{rowRef:!ge&&R.branch===o?ee:void 0,dot:ys(R.color),codeIcon:ue(R)?Ts(R.color):void 0,label:R.name,creator:St(R.createdBy),originTooltip:y?k("thread.branchPicker.viaStudioUi"):void 0,branch:!y||ue(R)?R.branch:void 0,selected:!ge&&R.branch===o,onSelect:()=>We(R.branch),onRename:()=>vs(R),onDelete:()=>Z(R),deleteBlocked:!he(R)},R.branch),Ye=()=>{const R=re;if(T(null),!!R){if(R.name===o){const ve=Ds(z,R.name,I,ie);if(!ve)return;We(ve.branch)}_.mutateAsync(R.name).catch(ve=>{et.error(k("thread.branchPicker.discardStoreDraftError"),{description:ve instanceof Error?ve.message:void 0})})}},ut=kt.map(R=>K===R.name?a.jsx(hn,{value:ne,onChange:V,onSave:()=>Ot(R.name),onCancel:Rt},`store:${R.name}`):a.jsx(fn,{rowRef:!ge&&R.name===o?ee:void 0,dot:ys(void 0),label:R.name,creator:St(R.createdBy),agentIcon:Ts(js(me.indexOf(R))),originTooltip:k("thread.branchPicker.storeDraftVia",{via:ql(R.via)}),selected:!ge&&R.name===o,onSelect:()=>We(R.name),onRename:()=>{J(R.name),V(R.name)},onDelete:()=>T(R),deleteBlocked:R.name===o&&!Ds(z,R.name,I,ie)},`store:${R.name}`));let Ee;e[39]!==C||e[40]!==y||e[41]!==Q?(Ee=C?void 0:R=>{R?y&&Q():xs(),$(R)},e[39]=C,e[40]=y,e[41]=Q,e[42]=Ee):Ee=e[42];const Ze=O?"text-xs":"text-xs text-muted-foreground hover:text-foreground";let ze;e[43]!==Ze?(ze=q("shrink min-w-0 max-w-[220px] gap-2",Ze,zr),e[43]=Ze,e[44]=ze):ze=e[44];let Ue;e[45]!==C?(Ue=!C&&a.jsx(qr,{size:12,className:"opacity-60 shrink-0"}),e[45]=C,e[46]=Ue):Ue=e[46];let Ke;e[47]!==at?(Ke=a.jsx(nt,{children:at}),e[47]=at,e[48]=Ke):Ke=e[48];const vt=xl,W="w-[min(300px,calc(100vw-2rem))] p-1.5",pe="start";let fe;e[49]===Symbol.for("react.memo_cache_sentinel")?(fe=R=>{R.preventDefault(),ee.current?.scrollIntoView({block:"nearest"})},e[49]=fe):fe=e[49];let ye;e[50]!==A||e[51]!==k?(ye=A&&a.jsx("p",{className:"px-2 pb-1.5 pt-1 text-xs text-muted-foreground",children:k("thread.branchPicker.newChatHint")}),e[50]=A,e[51]=k,e[52]=ye):ye=e[52];const Oe=X?a.jsx(Xi,{orgId:i,orgSlug:h,userId:c,target:u,owner:p,repo:b,sandboxMap:f,enabled:M,tab:Y,onTabChange:F,isV8:y,localUrl:ce,onSaveLocal:bs,onBack:()=>H(!1),onAdopt:Nt,draftKind:I}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:q("always-scrollbar flex max-h-[min(50vh,20rem)] flex-col overflow-y-auto",y&&"gap-1"),children:[!y&&ge&&Ie&&a.jsx(Ji,{rowRef:ee,url:Ie,onSelect:()=>Ct("local"),onEdit:()=>Ct("local"),onTurnOff:()=>Ae()}),Be&&o&&(K===o?a.jsx(hn,{value:ne,onChange:V,onSave:()=>Ot(),onCancel:Rt}):a.jsx(fn,{rowRef:ge?void 0:ee,dot:ys("orange"),label:k(Ls(o)),branch:y?void 0:o,originTooltip:y?k("thread.branchPicker.viaStudioUi"):void 0,selected:!ge,onSelect:()=>We(o),onRename:()=>{J(o),V(la(z,k(Ls(o))))}})),xt?a.jsxs(a.Fragment,{children:[a.jsx(ar,{children:k("thread.branchPicker.groupContent")}),gt.content.map(Xe),ut,a.jsx(ar,{divided:!0,children:k("thread.branchPicker.groupCode")}),gt.code.map(Xe)]}):a.jsxs(a.Fragment,{children:[Ge.map(Xe),ut]}),y&&a.jsx(Mi,{virtualMcpId:s,branch:o,serve:_e,rowRef:we?ee:void 0,onPicked:()=>$(!1)})]}),(Be||Ge.length>0||kt.length>0||y)&&a.jsx("div",{className:"my-1 border-t"}),a.jsxs("button",{type:"button",onClick:()=>{gs()},disabled:pt,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(Jr,{className:"h-4 w-4 shrink-0"}),k("thread.branchPicker.newVersion")]}),pt&&a.jsx("p",{className:"px-2 pb-1 pt-0.5 text-xs text-warning",children:G}),a.jsxs("button",{type:"button",onClick:()=>Ct("branches"),className:q("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",y&&"mt-1"),children:[k("thread.branchPicker.advanced"),a.jsx(jr,{className:"h-4 w-4 shrink-0"})]})]});let ht;e[53]!==vt||e[54]!==fe||e[55]!==ye||e[56]!==Oe?(ht=a.jsxs(vt,{className:W,align:pe,onOpenAutoFocus:fe,children:[ye,Oe]}),e[53]=vt,e[54]=fe,e[55]=ye,e[56]=Oe,e[57]=ht):ht=e[57];const Ea=a.jsxs(vl,{open:M,onOpenChange:Ee,children:[a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx("span",{className:"inline-flex min-w-0 shrink",children:a.jsx(yl,{asChild:!0,children:a.jsxs(xe,{"data-tour":bl.branchPicker,variant:O?"outline":"ghost",size:O?"sm":"default","aria-label":at,disabled:C,className:ze,children:[Te?a.jsx(Hr,{className:q(Js,Ts(Se?.color))}):Ne&&!ge?a.jsx(wr,{className:q(Js,Ts(js(me.indexOf(Ne))))}):a.jsx("span",{className:q("h-2 w-2 shrink-0 rounded-full",o||ge?Ft:"bg-muted-foreground")}),a.jsx("span",{className:"min-w-0 truncate @max-3xl/panel-header:hidden",children:at}),Ue]})})})}),Ke]}),ht]}),cn=de!==null;let Ns;e[58]===Symbol.for("react.memo_cache_sentinel")?(Ns=R=>{R||Z(null)},e[58]=Ns):Ns=e[58];let Mt;e[59]!==k?(Mt=k("thread.branchPicker.deleteTitle"),e[59]=k,e[60]=Mt):Mt=e[60];let _t;e[61]!==Mt?(_t=a.jsx(_s,{children:Mt}),e[61]=Mt,e[62]=_t):_t=e[62];let Et;e[63]!==de||e[64]!==k?(Et=de&&k("thread.branchPicker.deleteConfirm",{name:de.name}),e[63]=de,e[64]=k,e[65]=Et):Et=e[65];let zt;e[66]!==Et?(zt=a.jsx(Es,{children:Et}),e[66]=Et,e[67]=zt):zt=e[67];let Ut;e[68]!==_t||e[69]!==zt?(Ut=a.jsxs(zs,{children:[_t,zt]}),e[68]=_t,e[69]=zt,e[70]=Ut):Ut=e[70];let Kt;e[71]!==k?(Kt=k("thread.branchPicker.cancel"),e[71]=k,e[72]=Kt):Kt=e[72];let qt;e[73]!==Kt?(qt=a.jsx(Us,{children:Kt}),e[73]=Kt,e[74]=qt):qt=e[74];let Ht;e[75]!==k?(Ht=k("thread.branchPicker.delete"),e[75]=k,e[76]=Ht):Ht=e[76];let Vt;e[77]!==Dt||e[78]!==Ht?(Vt=a.jsx(Ks,{onClick:Dt,variant:"destructive",children:Ht}),e[77]=Dt,e[78]=Ht,e[79]=Vt):Vt=e[79];let Gt;e[80]!==qt||e[81]!==Vt?(Gt=a.jsxs(qs,{children:[qt,Vt]}),e[80]=qt,e[81]=Vt,e[82]=Gt):Gt=e[82];let Wt;e[83]!==Ut||e[84]!==Gt?(Wt=a.jsxs(Hs,{children:[Ut,Gt]}),e[83]=Ut,e[84]=Gt,e[85]=Wt):Wt=e[85];let Cs;e[86]!==cn||e[87]!==Wt?(Cs=a.jsx(Vs,{open:cn,onOpenChange:Ns,children:Wt}),e[86]=cn,e[87]=Wt,e[88]=Cs):Cs=e[88];const dn=re!==null;let As;e[89]===Symbol.for("react.memo_cache_sentinel")?(As=R=>{R||T(null)},e[89]=As):As=e[89];let Qt;e[90]!==k?(Qt=k("thread.branchPicker.deleteTitle"),e[90]=k,e[91]=Qt):Qt=e[91];let Jt;e[92]!==Qt?(Jt=a.jsx(_s,{children:Qt}),e[92]=Qt,e[93]=Jt):Jt=e[93];let Xt;e[94]!==re||e[95]!==k?(Xt=re&&k("thread.branchPicker.discardStoreDraftConfirm",{name:re.name}),e[94]=re,e[95]=k,e[96]=Xt):Xt=e[96];let Yt;e[97]!==Xt?(Yt=a.jsx(Es,{children:Xt}),e[97]=Xt,e[98]=Yt):Yt=e[98];let Zt;e[99]!==Jt||e[100]!==Yt?(Zt=a.jsxs(zs,{children:[Jt,Yt]}),e[99]=Jt,e[100]=Yt,e[101]=Zt):Zt=e[101];let es;e[102]!==k?(es=k("thread.branchPicker.cancel"),e[102]=k,e[103]=es):es=e[103];let ts;e[104]!==es?(ts=a.jsx(Us,{children:es}),e[104]=es,e[105]=ts):ts=e[105];let ss;e[106]!==k?(ss=k("thread.branchPicker.delete"),e[106]=k,e[107]=ss):ss=e[107];let ns;e[108]!==Ye||e[109]!==ss?(ns=a.jsx(Ks,{onClick:Ye,variant:"destructive",children:ss}),e[108]=Ye,e[109]=ss,e[110]=ns):ns=e[110];let rs;e[111]!==ts||e[112]!==ns?(rs=a.jsxs(qs,{children:[ts,ns]}),e[111]=ts,e[112]=ns,e[113]=rs):rs=e[113];let as;e[114]!==Zt||e[115]!==rs?(as=a.jsxs(Hs,{children:[Zt,rs]}),e[114]=Zt,e[115]=rs,e[116]=as):as=e[116];let Rs;return e[117]!==dn||e[118]!==as?(Rs=a.jsx(Vs,{open:dn,onOpenChange:As,children:as}),e[117]=dn,e[118]=as,e[119]=Rs):Rs=e[119],a.jsxs(a.Fragment,{children:[Ea,Cs,Rs]})}function hn(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 h;e[4]!==o||e[5]!==n?(h=f=>{f.key==="Enter"&&n(),f.key==="Escape"&&(f.preventDefault(),f.stopPropagation(),o())},e[4]=o,e[5]=n,e[6]=h):h=e[6];let c;e[7]!==l||e[8]!==i||e[9]!==h||e[10]!==s?(c=a.jsx("input",{autoFocus:!0,"aria-label":l,value:s,onChange:i,onKeyDown:h,className:"h-8 flex-1 rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[7]=l,e[8]=i,e[9]=h,e[10]=s,e[11]=c):c=e[11];let u;e[12]!==d?(u=d("thread.branchPicker.save"),e[12]=d,e[13]=u):u=e[13];let p;e[14]!==n||e[15]!==u?(p=a.jsx(xe,{size:"sm",onClick:n,children:u}),e[14]=n,e[15]=u,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 ar(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=q("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 fn(t){const e=B.c(53),{rowRef:s,dot:r,codeIcon:n,agentIcon:o,originTooltip:d,label:l,creator:i,branch:h,selected:c,onSelect:u,onRename:p,onDelete:b,deleteBlocked:f}=t,m=f===void 0?!1:f,g=be();let v;e[0]!==o||e[1]!==n||e[2]!==r?(v=n?a.jsx(Hr,{className:q(Js,n)}):o?a.jsx(wr,{className:q(Js,o)}):a.jsx("span",{className:q("h-2 w-2 shrink-0 rounded-full",r)}),e[0]=o,e[1]=n,e[2]=r,e[3]=v):v=e[3];let j;e[4]!==i?(j=i&&a.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:i}),e[4]=i,e[5]=j):j=e[5];let w;e[6]!==l||e[7]!==j?(w=a.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[l,j]}),e[6]=l,e[7]=j,e[8]=w):w=e[8];let x;e[9]!==u||e[10]!==c||e[11]!==v||e[12]!==w?(x=a.jsxs("button",{type:"button","aria-pressed":c,onClick:u,className:"flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[v,w]}),e[9]=u,e[10]=c,e[11]=v,e[12]=w,e[13]=x):x=e[13];const P=x,y=c?"bg-accent":"hover:bg-accent";let N;e[14]!==y?(N=q("group flex items-center rounded-lg",y),e[14]=y,e[15]=N):N=e[15];let C;e[16]!==h||e[17]!==n||e[18]!==d||e[19]!==P||e[20]!==g?(C=h||d?a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:P}),a.jsxs(nt,{side:"bottom",className:"text-xs",children:[n&&a.jsx("p",{className:"font-medium",children:g("thread.branchPicker.codeDraftTooltip")}),d&&a.jsx("p",{children:d}),h&&a.jsx("p",{className:"font-mono",children:g("thread.branchPicker.branchTooltip",{branch:h})})]})]}):P,e[16]=h,e[17]=n,e[18]=d,e[19]=P,e[20]=g,e[21]=C):C=e[21];let A;e[22]!==g?(A=g("thread.branchPicker.moreActions"),e[22]=g,e[23]=A):A=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=a.jsx(Wr,{className:"h-4 w-4"}),e[24]=S):S=e[24];let D;e[25]!==A?(D=a.jsx(Ys,{asChild:!0,children:a.jsx(xe,{variant:"ghost",size:"icon","aria-label":A,className:"mr-1 h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",children:S})}),e[25]=A,e[26]=D):D=e[26];let k;e[27]===Symbol.for("react.memo_cache_sentinel")?(k=a.jsx(Qr,{className:"h-4 w-4"}),e[27]=k):k=e[27];let L;e[28]!==g?(L=g("thread.branchPicker.rename"),e[28]=g,e[29]=L):L=e[29];let I;e[30]!==p||e[31]!==L?(I=a.jsxs(os,{onSelect:p,children:[k,L]}),e[30]=p,e[31]=L,e[32]=I):I=e[32];let O;e[33]!==m||e[34]!==b||e[35]!==g?(O=b&&a.jsxs(os,{onSelect:b,disabled:m,className:"text-destructive focus:text-destructive",children:[a.jsx(rn,{className:"h-4 w-4"}),g("thread.branchPicker.delete")]}),e[33]=m,e[34]=b,e[35]=g,e[36]=O):O=e[36];let M;e[37]!==m||e[38]!==b||e[39]!==g?(M=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]=M):M=e[40];let $;e[41]!==I||e[42]!==O||e[43]!==M?($=a.jsxs(Zs,{align:"end",children:[I,O,M]}),e[41]=I,e[42]=O,e[43]=M,e[44]=$):$=e[44];let X;e[45]!==D||e[46]!==$?(X=a.jsxs(en,{children:[D,$]}),e[45]=D,e[46]=$,e[47]=X):X=e[47];let H;return e[48]!==s||e[49]!==X||e[50]!==N||e[51]!==C?(H=a.jsxs("div",{ref:s,className:N,children:[C,X]}),e[48]=s,e[49]=X,e[50]=N,e[51]=C,e[52]=H):H=e[52],H}function Ji(t){const e=B.c(40),{rowRef:s,url:r,onSelect:n,onEdit:o,onTurnOff:d}=t,l=be();let i;try{let D;e[0]!==r?(D=new URL(r),e[0]=r,e[1]=D):D=e[1],i=D.host}catch{i=r}const h=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 u;e[3]!==l?(u=l("thread.branchPicker.localLabel"),e[3]=l,e[4]=u):u=e[4];let p;e[5]!==h?(p=a.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:h}),e[5]=h,e[6]=p):p=e[6];let b;e[7]!==u||e[8]!==p?(b=a.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[u,p]}),e[7]=u,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(Wr,{className:"h-4 w-4"}),e[15]=g):g=e[15];let v;e[16]!==m?(v=a.jsx(Ys,{asChild:!0,children:a.jsx(xe,{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]=v):v=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx(Qr,{className:"h-4 w-4"}),e[18]=j):j=e[18];let w;e[19]!==l?(w=l("thread.branchPicker.rename"),e[19]=l,e[20]=w):w=e[20];let x;e[21]!==o||e[22]!==w?(x=a.jsxs(os,{onSelect:o,children:[j,w]}),e[21]=o,e[22]=w,e[23]=x):x=e[23];let P;e[24]===Symbol.for("react.memo_cache_sentinel")?(P=a.jsx(rn,{className:"h-4 w-4"}),e[24]=P):P=e[24];let y;e[25]!==l?(y=l("thread.branchPicker.localTurnOff"),e[25]=l,e[26]=y):y=e[26];let N;e[27]!==d||e[28]!==y?(N=a.jsxs(os,{onSelect:d,className:"text-destructive focus:text-destructive",children:[P,y]}),e[27]=d,e[28]=y,e[29]=N):N=e[29];let C;e[30]!==x||e[31]!==N?(C=a.jsxs(Zs,{align:"end",children:[x,N]}),e[30]=x,e[31]=N,e[32]=C):C=e[32];let A;e[33]!==C||e[34]!==v?(A=a.jsxs(en,{children:[v,C]}),e[33]=C,e[34]=v,e[35]=A):A=e[35];let S;return e[36]!==s||e[37]!==A||e[38]!==f?(S=a.jsxs("div",{ref:s,className:"group flex items-center rounded-lg bg-accent",children:[f,A]}),e[36]=s,e[37]=A,e[38]=f,e[39]=S):S=e[39],S}function Xi(t){const e=B.c(75),{orgId:s,orgSlug:r,userId:n,target:o,owner:d,repo:l,sandboxMap:i,enabled:h,tab:c,onTabChange:u,isV8:p,localUrl:b,onSaveLocal:f,onBack:m,onAdopt:g,draftKind:v}=t,j=be(),[w,x]=U.useState(""),P=c==="branches"?w:"",y=h&&c==="branches";let N;e[0]!==s||e[1]!==r||e[2]!==d||e[3]!==l||e[4]!==i||e[5]!==P||e[6]!==y||e[7]!==o||e[8]!==n?(N={orgId:s,orgSlug:r,userId:n,target:o,sandboxMap:i,owner:d,repo:l,search:P,enabled:y},e[0]=s,e[1]=r,e[2]=d,e[3]=l,e[4]=i,e[5]=P,e[6]=y,e[7]=o,e[8]=n,e[9]=N):N=e[9];const{recent:C,yours:A,others:S,isLoading:D,hasMore:k,isFetchingMore:L,fetchMore:I}=Vi(N),O=h&&c==="prs";let M;e[10]!==s||e[11]!==r||e[12]!==d||e[13]!==l||e[14]!==O||e[15]!==o?(M={orgId:s,orgSlug:r,target:o,owner:d,repo:l,enabled:O},e[10]=s,e[11]=r,e[12]=d,e[13]=l,e[14]=O,e[15]=o,e[16]=M):M=e[16];const{data:$,isLoading:X}=Ol(M);let H;if(e[17]!==v||e[18]!==I||e[19]!==k||e[20]!==L||e[21]!==D||e[22]!==p||e[23]!==b||e[24]!==g||e[25]!==m||e[26]!==f||e[27]!==u||e[28]!==S||e[29]!==d||e[30]!==X||e[31]!==C||e[32]!==l||e[33]!==w||e[34]!==j||e[35]!==$||e[36]!==c||e[37]!==A){const Y=$===void 0?[]:$,F=`${d}/${l}`;let K;e[39]!==F?(K=F.toLowerCase(),e[39]=F,e[40]=K):K=e[40];const J=K;let ne;e[41]!==J?(ne=E=>E.headRepoFullName?.toLowerCase()===J,e[41]=J,e[42]=ne):ne=e[42];const V=Y.filter(ne);let de;if(e[43]!==v||e[44]!==S||e[45]!==C||e[46]!==A){const E=new Set;de=[...C,...A,...S].filter(ue=>E.has(ue.name)?!1:(E.add(ue.name),v!=="site"||Xr(ue.name)==="site")),e[43]=v,e[44]=S,e[45]=C,e[46]=A,e[47]=de}else de=e[47];const Z=de;let re;e[48]===Symbol.for("react.memo_cache_sentinel")?(re=a.jsx(Sl,{className:"h-4 w-4 shrink-0"}),e[48]=re):re=e[48];let T;e[49]!==j?(T=j("thread.branchPicker.advancedBack"),e[49]=j,e[50]=T):T=e[50];let ee;e[51]!==m||e[52]!==T?(ee=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:[re,T]}),e[51]=m,e[52]=T,e[53]=ee):ee=e[53];let z;e[54]!==u?(z=E=>{u(E),x("")},e[54]=u,e[55]=z):z=e[55];let te;e[56]!==j?(te=j("thread.branchPicker.branchesTab"),e[56]=j,e[57]=te):te=e[57];let se;e[58]!==te?(se=a.jsx(Tt,{value:"branches",className:"h-6 px-2.5 text-xs",children:te}),e[58]=te,e[59]=se):se=e[59];let je;e[60]!==j?(je=j("thread.branchPicker.prsTab"),e[60]=j,e[61]=je):je=e[61];let ae;e[62]!==je?(ae=a.jsx(Tt,{value:"prs",className:"h-6 px-2.5 text-xs",children:je}),e[62]=je,e[63]=ae):ae=e[63];let le;e[64]!==p||e[65]!==j?(le=!p&&a.jsx(Tt,{value:"local",className:"h-6 px-2.5 text-xs",children:j("thread.branchPicker.localTab")}),e[64]=p,e[65]=j,e[66]=le):le=e[66];let oe;e[67]!==se||e[68]!==ae||e[69]!==le?(oe=a.jsxs(Ur,{className:"h-auto w-fit justify-start gap-1 bg-accent p-1",variant:"pill",children:[se,ae,le]}),e[67]=se,e[68]=ae,e[69]=le,e[70]=oe):oe=e[70];let ie;e[71]!==z||e[72]!==oe||e[73]!==c?(ie=a.jsx(Kr,{className:"px-2 pt-2 pb-1",value:c,onValueChange:z,children:oe}),e[71]=z,e[72]=oe,e[73]=c,e[74]=ie):ie=e[74],H=a.jsxs("div",{className:"flex flex-col",children:[ee,ie,c==="local"&&!p?a.jsx(Oi,{url:b,onSave:f}):a.jsxs(jl,{filter:c==="branches"?Yi:void 0,children:[a.jsx(wl,{placeholder:j(c==="branches"?"thread.branchPicker.searchBranches":"thread.branchPicker.searchPullRequests"),value:w,onValueChange:x}),a.jsx(Pl,{onScroll:E=>{const ue=E.currentTarget;c==="branches"&&ue.scrollHeight-ue.scrollTop-ue.clientHeight<48&&I()},children:c==="branches"?a.jsxs(a.Fragment,{children:[D&&a.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:j("thread.branchPicker.loadingMore")}),!D&&Z.length===0&&a.jsx(Zn,{children:j("thread.branchPicker.noBranchesFound")}),Z.length>0&&a.jsx(er,{children:Z.map(E=>a.jsxs(tr,{value:E.name,className:"cursor-pointer",onSelect:()=>g(E.name,E.name),children:[a.jsx(Ka,{className:"mr-2 h-4 w-4 shrink-0"}),a.jsx("span",{className:"flex-1 truncate",children:E.name})]},E.name))}),k&&a.jsx("div",{className:"p-2",children:a.jsx(xe,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs",disabled:L,onClick:I,children:j(L?"thread.branchPicker.loadingMore":"thread.branchPicker.loadMoreBranches")})})]}):a.jsxs(a.Fragment,{children:[X&&a.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:j("thread.branchPicker.loadingPullRequests")}),!X&&V.length===0&&a.jsx(Zn,{children:j("thread.branchPicker.noOpenPullRequests")}),V.length>0&&a.jsx(er,{children:V.map(E=>a.jsxs(tr,{value:`#${E.number} ${E.title} ${E.head}`,className:"cursor-pointer",onSelect:()=>g(E.head,rr(E.title)),children:[a.jsx(nn,{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:rr(E.title)}),a.jsxs("span",{className:"truncate text-xs text-muted-foreground",children:["#",E.number," · ",E.head]})]})]},E.number))})]})})]})]}),e[17]=v,e[18]=I,e[19]=k,e[20]=L,e[21]=D,e[22]=p,e[23]=b,e[24]=g,e[25]=m,e[26]=f,e[27]=u,e[28]=S,e[29]=d,e[30]=X,e[31]=C,e[32]=l,e[33]=w,e[34]=j,e[35]=$,e[36]=c,e[37]=A,e[38]=H}else H=e[38];return H}function Yi(t,e){return gn(t,e)?1:0}function Zi(t){const e=B.c(20),{locked:s,placement:r,value:n,virtualMcpId:o,isV8:d,userLabel:l,baseBranch:i,baseIsDraft:h,onChange:c,onCreateBranch:u,onAdoptBranch:p,orgId:b,orgSlug:f,userId:m,target:g,owner:v,repo:j,sandboxMap:w,draftKind:x}=t;let P;return e[0]!==i||e[1]!==h||e[2]!==x||e[3]!==d||e[4]!==s||e[5]!==p||e[6]!==c||e[7]!==u||e[8]!==b||e[9]!==f||e[10]!==v||e[11]!==r||e[12]!==j||e[13]!==w||e[14]!==g||e[15]!==m||e[16]!==l||e[17]!==n||e[18]!==o?(P=a.jsx(Qi,{virtualMcpId:o,isV8:d,userLabel:l,value:n,baseBranch:i,baseIsDraft:h,orgId:b,orgSlug:f,userId:m,target:g,owner:v,repo:j,sandboxMap:w,onChange:c,onCreateBranch:u,onAdoptBranch:p,spawnsNewChat:s,placement:r,draftKind:x}),e[0]=i,e[1]=h,e[2]=x,e[3]=d,e[4]=s,e[5]=p,e[6]=c,e[7]=u,e[8]=b,e[9]=f,e[10]=v,e[11]=r,e[12]=j,e[13]=w,e[14]=g,e[15]=m,e[16]=l,e[17]=n,e[18]=o,e[19]=P):P=e[19],P}function eo(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 to(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 so(t){const e=B.c(25),{virtualMcp:s,currentBranch:r}=t,n=nl(),o=fs();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,h=o?.createTask,c=Yr()==="blog"?"blog":"site",u=ms(s?.id),p=u.runtime,b=s?.metadata;let f;e[3]!==b?(f=Zr(b),e[3]=b,e[4]=f):f=e[4];const m=f,g=m==="cms"&&p==="sandbox",v=$l(s),j=Me(v),{data:w}=tn.useSession(),x=w?.user;let P;e[5]!==x?(P=Tn(x),e[5]=x,e[6]=P):P=e[6];const y=P,N=w?.user?.id??"",{org:C}=Ps(),A=Ml(s,r),S=Bn(s?.id),D=S&&p==="cms";let k;e[7]!==h||e[8]!==r||e[9]!==l||e[10]!==m||e[11]!==p||e[12]!==u.resolved||e[13]!==i||e[14]!==S?(k=(Y,F)=>{const K=to({locked:l,sessionRuntime:u.resolved?p:null,projectRuntime:m,draftRuntime:F&&(F.runtime??m),current:Y===r,contentOnly:S});K.kind==="new-chat"&&h?h({branch:Y,...K.runtime?{runtime:K.runtime}:{}}):i&&i(Y)},e[7]=h,e[8]=r,e[9]=l,e[10]=m,e[11]=p,e[12]=u.resolved,e[13]=i,e[14]=S,e[15]=k):k=e[15];const L=k;let I;e[16]!==g||e[17]!==h||e[18]!==l||e[19]!==i?(I=Y=>{(l||g)&&h?h({branch:Y}):i&&i(Y)},e[16]=g,e[17]=h,e[18]=l,e[19]=i,e[20]=I):I=e[20];const O=I;let M;e[21]!==h?(M=h?Y=>h({runtime:"sandbox",branch:Y}):void 0,e[21]=h,e[22]=M):M=e[22];const $=M,X=v&&ea(j)?a.jsx(Zi,{userLabel:y,virtualMcpId:s?.id??"",isV8:S,value:r,baseBranch:A,baseIsDraft:D,orgId:C.id,orgSlug:C.slug,userId:N,target:j,owner:v.owner,repo:v.name,sandboxMap:s?.metadata?.sandboxMap,onChange:L,onCreateBranch:O,onAdoptBranch:$,locked:l,placement:"chat",draftKind:c},`${ta(j)}:${v.owner}/${v.name}`):null;let H;return e[23]!==X?(H=a.jsx(eo,{branchPill:X}),e[23]=X,e[24]=H):H=e[24],H}const no=qa("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 ro(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=q(no({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 ao(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(os,{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 ma(t){const e=B.c(20),{label:s,onClick:r,variant:n,size:o,disabled:d,loading:l,pulse:i,tooltip:h,icon:c,items:u,menuAriaLabel:p,className:b}=t,f=n===void 0?"default":n,m=o===void 0?"default":o,g=d===void 0?!1:d,v=l===void 0?!1:l,j=i===void 0?!1:i,w=(u?.length??0)>0;let x;if(e[0]!==b||e[1]!==g||e[2]!==w||e[3]!==c||e[4]!==u||e[5]!==s||e[6]!==v||e[7]!==p||e[8]!==r||e[9]!==j||e[10]!==m||e[11]!==h||e[12]!==f){const P=q(zr,f==="default"&&"focus-visible:inset-ring-current");let y;e[14]!==c||e[15]!==v?(y=v?a.jsx(cs,{size:"xs"}):c,e[14]=c,e[15]=v,e[16]=y):y=e[16];const N=a.jsxs(xe,{type:"button",variant:f,size:m,disabled:g,"aria-busy":v||void 0,onClick:v?void 0:r,className:q(P,w&&"rounded-r-none border-r border-current/20"),children:[y,s]}),C=j&&"animate-pulse-brightness motion-reduce:animate-none motion-reduce:opacity-80";let A;e[17]!==b||e[18]!==C?(A=q(C,b),e[17]=b,e[18]=C,e[19]=A):A=e[19],x=a.jsxs(ro,{className:A,children:[h?a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx("span",{className:q("inline-flex rounded-lg outline-none",P,g&&"cursor-not-allowed"),tabIndex:g?0:void 0,role:g?"button":void 0,"aria-disabled":g||void 0,children:N})}),a.jsx(nt,{children:h})]}):N,w?a.jsxs(en,{children:[a.jsx(Ys,{asChild:!0,children:a.jsx(xe,{type:"button",variant:f,size:m,"aria-label":p,className:q("has-[>svg]:px-2",P),children:a.jsx(qr,{className:"size-3.5"})})}),a.jsx(Zs,{align:"end",children:u?.map(lo)})]}):null]}),e[0]=b,e[1]=g,e[2]=w,e[3]=c,e[4]=u,e[5]=s,e[6]=v,e[7]=p,e[8]=r,e[9]=j,e[10]=m,e[11]=h,e[12]=f,e[13]=x}else x=e[13];return x}function lo(t){return a.jsx(ao,{item:t},t.key)}async function io(t){if(t.hosted)return;const e=t.branch;await t.setCurrentTaskBranch(t.nextBranch()),e&&e!==t.baseBranch&&await t.deleteRelease(e)}function oo(t,e,{hosted:s}){return s&&t!==null?t:e}function co(t,e){const s=B.c(11),[r,n]=U.useState(null);let o;s[0]!==r||s[1]!==t||s[2]!==e?(o=oo(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 uo({open:t,hosted:e}){return t||e}function pa(t){return si({userName:t?.name,userEmail:t?.email})??void 0}function ln(t){const e=B.c(18),{state:s,header:r,body:n,note:o,gate:d,footer:l}=t,i=s!=="ready";let h;e[0]!==r?(h=a.jsx("div",{className:"space-y-0.5 px-4 py-3",children:r}),e[0]=r,e[1]=h):h=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 u;e[3]!==o?(u=o?a.jsx("div",{className:"space-y-1.5 border-t px-4 py-3",children:o}):null,e[3]=o,e[4]=u):u=e[4];let p;e[5]!==n||e[6]!==u?(p=a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n,u]}),e[5]=n,e[6]=u,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]!==h||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:[h,c,p,d,b,f]}),e[11]=d,e[12]=s,e[13]=i,e[14]=h,e[15]=p,e[16]=f,e[17]=m):m=e[17],m}function ws(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 ba(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=q("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 He(t){const e=B.c(4),{className:s}=t;let r;e[0]!==s?(r=q("animate-pulse rounded bg-muted motion-reduce:animate-none",s),e[0]=s,e[1]=r):r=e[1];let n;return e[2]!==r?(n=a.jsx("div",{className:r}),e[2]=r,e[3]=n):n=e[3],n}function Bt(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(ba,{children:a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx(He,{className:"size-4 rounded-md"}),a.jsx(He,{className:"h-3 w-24"}),a.jsx(He,{className:"h-2.5 w-16"}),a.jsx(He,{className:"ml-auto size-6 rounded"})]})}),t[0]=e):e=t[0],e}const ho="secret";function ga(t){return t.kind!=="block"?null:t.namedRule??null}function fo(t,e){const s=e.find(r=>r&&typeof r=="object");return s?Jl(s.__resolveType):Xl(t)}const mo=/(?:^|\/)\.deco\/blocks\/([^/]+)\.json$/;function Un(t){const e=mo.exec(t)?.[1];return e?Si(e):null}function Xs(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 po(t,e){return t===null?"new":e===null?"removed":"edited"}function xa(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 is(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 Ha(r);const o=(r.split("/").pop()??r).replace(/\.[jt]sx?$/,"");return xa(o)||o}}return`Section ${e+1}`}function Kn(t){if(Pr(t))return t.value??null;const e=t.__resolveType;return typeof e=="string"&&Va(e)?t.section??null:null}const va=6;function Os(t,e=0){if(e>va||!t||typeof t!="object")return[];if(Array.isArray(t))return t.flatMap(n=>Os(n,e+1));const s=t;if(wn(s.__resolveType))return xn(s).flatMap(n=>Os(n?.value,e+1));const r=Kn(s);return r!==null?Os(r,e+1):[s]}function xn(t){const e=t?.variants;return Array.isArray(e)?e.map(s=>s&&typeof s=="object"&&!Array.isArray(s)?s:null):[]}function lr(t){let e=t;for(let s=0;s<va;s++){if(!e||typeof e!="object"||Array.isArray(e))return null;const r=e;if(wn(r.__resolveType))return r;const n=Kn(r);if(n===null)return null;e=n}return null}function bo(t,e,s){const r=xn(lr(t)),n=e?xn(lr(e)):[],o=e?Array.from({length:Math.max(r.length,n.length)},(i,h)=>h).filter(i=>!on(r[i],n[i])):[],l=[...o.map(i=>r[i]??n[i]),...r.filter((i,h)=>!o.includes(h))].flatMap(i=>Os(i?.value)).map(i=>is(i,s,!0));return[...new Set(l)]}function mn(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 h=o;if(wn(h.__resolveType)){d=!0;break}const c=Kn(h);if(c===null)break;o=c}const l=d?bo(t,n,e):[];return{name:is(d?t:o,e,!0),kind:"section",status:s,fields:r,...d?{wrapper:!0}:{},...l.length>0?{held:l}:{}}}function vn(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&&Pr(d),i=l?d.value:d;if(!Array.isArray(i))return[];const h=l?["sections","variants",o,"value","value"]:["sections","variants",o,"value"];return i.flatMap((c,u)=>c&&typeof c=="object"&&!Array.isArray(c)?[{section:c,basePath:[...h,u]}]:[])})}return[]}function ir(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 on(t,e){return t===void 0&&e===void 0?!0:ir(t)===ir(e)}function wt(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;on(l,i)||o.push({label:xa(d),path:[...s,d],from:l,to:i})}return o}function go(t,e){const s=e.find(r=>r&&typeof r=="object");return s?s.__resolveType===ri:t===ai}function xo(t,e){const s=n=>n===void 0||!!n&&typeof n=="object"&&!Array.isArray(n)&&!("__resolveType"in n),r=[];for(const n of wt(t,e,[])){const o=String(n.path[0]);s(n.from)&&s(n.to)?r.push(...wt(n.from??{},n.to??{},[o])):r.push(n)}return r}const vo=new Set(["sections"]);function qn(t,e,s=!1){const r=t?vn(t,s):[],n=e?vn(e,s):[],o=[],d=Math.max(r.length,n.length);for(let i=0;i<d;i++){const h=r[i],c=n[i];if(!s){const u=yo(h,c,i);u&&o.push(u);continue}if(h&&c){if(on(h.section,c.section))continue;o.push(mn(c.section,i,"edited",wt(h.section,c.section,c.basePath),h.section))}else c?o.push(mn(c.section,i,"new",[])):h&&o.push(mn(h.section,i,"removed",[]))}const l=wt(t,e,[],vo);return l.length>0&&o.push({name:"Page settings",kind:"settings",status:"edited",fields:l}),o}function yo(t,e,s){return t&&e?on(t.section,e.section)?null:{name:is(e.section,s),kind:"section",status:"edited",fields:wt(t.section,e.section,e.basePath)}:e?{name:is(e.section,s),kind:"section",status:"new",fields:[]}:t?{name:is(t.section,s),kind:"section",status:"removed",fields:[]}:null}function yn(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 jo(t){const e=[],s=[],r=[],n=[];for(const[o,d]of Object.entries(t?.diffs??{})){if(Ln(o)){n.push(o);continue}const l=po(d.from,d.to),i=Un(o);if(!i){r.push(yn(o,l));continue}const h=Xs(d.from),c=Xs(d.to),u=c??h;if(!u){r.push(yn(o,l));continue}const p=ls(i,u);if(p){e.push({kind:"page",blockKey:i,name:p.name,pagePath:p.path,isSiteApp:!1,status:l,filepaths:[o],sections:l==="edited"?qn(h,c):[],fromJson:h,toJson:c});continue}const b=In(i,u);s.push({kind:"block",blockKey:i,name:Qs(i,u),pagePath:null,isSiteApp:b,status:l,filepaths:[o],sections:l==="edited"?[{name:Qs(i,u),kind:"section",status:"edited",fields:wt(h,c,[])}].filter(f=>f.fields.length>0):[],fromJson:h,toJson:c})}return ya({pages:e,blocks:s,other:r,generated:n})}function pn(t,e){return(t.filepaths[0]??"").localeCompare(e.filepaths[0]??"")}function ya(t){const{pages:e,blocks:s,other:r,generated:n}=t;return e.sort(pn),s.sort(pn),r.sort(pn),{pages:e,blocks:s,other:r,generated:n,count:e.length+s.length+r.length}}function wo(t){return t==="added"?"new":t==="removed"?"removed":"edited"}function ja(t){return t.startsWith("pages-")}function wa(t){const{files:e,lookup:s,diff:r}=t,n=[],o=[],d=[],l=[];for(const i of e){const h=i.path;if(Ln(h)){l.push(h);continue}const c=wo(i.status),u=Un(h);if(!u){d.push(yn(h,c));continue}const p=r?.diffs[h],b=Xs(p?.from??null),f=Xs(p?.to??null),m=Pa(s,u),g=m??f??b;if((m?ls(u,m):null)??(!m&&ja(u))){const w=g?ls(u,g):null;n.push({kind:"page",blockKey:u,name:w?.name??oa(u),pagePath:w?.path??null,isSiteApp:!1,status:c,filepaths:[h],sections:c==="edited"?qn(b,f):[],fromJson:b,toJson:f??(c==="new"?m:null)});continue}const j=Qs(u,g??{});o.push({kind:"block",blockKey:u,name:j,pagePath:null,isSiteApp:In(u,m??{}),status:c,filepaths:[h],sections:c==="edited"?[{name:j,kind:"section",status:"edited",fields:wt(b,f,[])}].filter(w=>w.fields.length>0):[],fromJson:b,toJson:f})}return ya({pages:n,blocks:o,other:d,generated:l})}function Pa(t,e){const s=t?.[e];return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function Po(t,e){return t??e}function Sa(t){return t.length<=1?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}const bn=3;function Bs(t){if(t.length<=bn)return Sa(t);const e=t.length-bn;return`${t.slice(0,bn).join(", ")} and ${e} more`}function So(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 ko(t){const e=ga(t);return e==="experiments"?"A/B tests":e==="campaigns"?"Campaign dates":t.name}function No(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 ${Bs(s.map(l=>So(l,!!t.v8)))}`),r.length>0){const l=r.length===1?"page":"pages";e.push(`added the ${Bs(r.map(i=>i.name))} ${l}`)}if(n.length>0){const l=n.length===1?"page":"pages";e.push(`removed the ${Bs(n.map(i=>i.name))} ${l}`)}const o=t.blocks.map(ko);if(o.length>0&&e.push(`changed ${Bs(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=Sa(e);return ni(d.charAt(0).toUpperCase()+d.slice(1))}function Co(t,e){return t?vn(t,e).length:0}function Ao(t,e=!1){const s={newPageSections:t.kind==="page"&&t.status==="new"?Co(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 or="••••••";function ds(t){if(Array.isArray(t))return t.map(ds);if(!t||typeof t!="object")return t;const e=t,s={};for(const[r,n]of Object.entries(e))s[r]=ds(n);return e.__resolveType===ho&&"ciphertext"in e&&(s.ciphertext=or),Wa(e)&&"encrypted"in e&&(s.encrypted=or),s}function cr(t){return t.map(e=>({...e,from:ds(e.from),to:ds(e.to)}))}function Ro(t){const{changes:e,sides:s,lookup:r,meta:n,hosted:o}=t,d=[],l=[],i=c=>[...new Set((s?.diagnostics??[]).filter(u=>Xn(Ga(u.file))===Xn(c)).map(u=>u.side))],h=Object.keys(e).sort((c,u)=>c<u?-1:c>u?1:0);for(const c of h){const u=e[c],p=u.kind==="delete"?"removed":u.baseVersion===null?"new":"edited",b=s?.entries[c],f=b?.before??null,m=b?.after??null,g=Pa(r,c),v=g??m??f,j=i(c),w={blockKey:c,status:p,filepaths:[],entry:{name:c,version:u.version},...j.length>0?{unreadable:j}:{},fromJson:ds(f),toJson:ds(m??(p==="new"?g:null))},x=g?ls(c,g,n):null,P=!g&&v?ls(c,v,n):null;if(x??P??(!v&&ja(c))){const S=v?ls(c,v,n):null;d.push({...w,kind:"page",name:S?.name??oa(c),pagePath:S?.path??null,isSiteApp:!1,sections:p==="edited"?qn(f,m,!0).map(D=>({...D,fields:cr(D.fields)})):[]});continue}const y=o?Wl(c,v,g,m,f):null,N=y?Ql(y,[v,g,m,f]):Qs(c,v??{}),C=fo(c,[g,m,f]),A=go(c,[g,m,f]);l.push({...w,kind:"block",name:A?"Settings":N,...A?{cmsSettings:!0}:{},...y?{blogKind:y}:{},...C?{namedRule:C}:{},pagePath:null,isSiteApp:In(c,g??v??{}),sections:p==="edited"?[{name:A?"Settings":N,kind:"section",status:"edited",fields:cr(A?xo(f,m):wt(f,m,[]))}].filter(S=>S.fields.length>0):[]})}return{pages:d,blocks:l,other:[],generated:[],count:d.length+l.length,v8:!0}}function Ce(t){return t.filepaths[0]??t.blockKey??t.name}function Do(t,e){return e(t==="new"?"thread.publishPopover.chipNew":t==="removed"?"thread.publishPopover.chipRemoved":"thread.publishPopover.chipEdited")}function To(t,e){const s=t.kind==="block"?hi:Vr;return a.jsx("span",{title:Do(t.status,e),className:"flex shrink-0",children:a.jsx(s,{className:q("size-4",t.status==="new"&&"text-brand",t.status==="edited"&&"text-warning",t.status==="removed"&&"text-destructive")})})}function Bo(t,e){if(t.kind==="page")return t.pagePath;if(t.kind!=="block")return null;if(t.blogKind)return Yl(t.blogKind,e);if(t.cmsSettings)return e("thread.publishPopover.settingsDetail");const s=ga(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 Io(t,e,s){const r=Ao(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 ka(t){const e=B.c(46),{change:s,bodyPending:r,selected:n,onSelect:o,confirming:d,onConfirmingChange:l,onDiscard:i,isPublishing:h,isDiscarding:c,v8:u}=t,p=r===void 0?!1:r,b=u===void 0?!1:u,f=be();let m;e[0]!==s||e[1]!==f?(m=Bo(s,f),e[0]=s,e[1]=f,e[2]=m):m=e[2];const g=m;let v;if(e[3]!==p||e[4]!==s||e[5]!==d||e[6]!==g||e[7]!==c||e[8]!==h||e[9]!==l||e[10]!==i||e[11]!==o||e[12]!==n||e[13]!==f||e[14]!==b){const j=Io(s,f,b),w=p&&j.length===0&&s.status==="edited",x=n&&"border-foreground/30 bg-accent hover:bg-secondary-hover";let P;e[16]!==x?(P=q("cursor-pointer transition-colors hover:bg-accent",x),e[16]=x,e[17]=P):P=e[17];let y;e[18]!==s?(y=Ce(s),e[18]=s,e[19]=y):y=e[19];let N;e[20]!==s||e[21]!==f?(N=To(s,f),e[20]=s,e[21]=f,e[22]=N):N=e[22];let C;e[23]!==s.cmsSettings||e[24]!==s.name||e[25]!==f?(C=s.cmsSettings?f("thread.publishPopover.settings"):s.name,e[23]=s.cmsSettings,e[24]=s.name,e[25]=f,e[26]=C):C=e[26];let A;e[27]!==C?(A=a.jsx("span",{className:"truncate text-sm font-medium",children:C}),e[27]=C,e[28]=A):A=e[28];let S;e[29]!==g?(S=g?a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:g}):null,e[29]=g,e[30]=S):S=e[30];let D;e[31]!==n||e[32]!==A||e[33]!==S?(D=a.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left","aria-pressed":n,children:[A,S]}),e[31]=n,e[32]=A,e[33]=S,e[34]=D):D=e[34];let k;e[35]!==d||e[36]!==c||e[37]!==h||e[38]!==l||e[39]!==i||e[40]!==f?(k=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:I=>{I.stopPropagation(),l(!1)},children:f("thread.publishDialog.cancel")}),a.jsx("button",{type:"button",className:"text-xs font-medium text-destructive disabled:opacity-50",onClick:I=>{I.stopPropagation(),l(!1),i?.()},disabled:c,children:f("thread.publishPopover.discard")})]}):i?a.jsx(sn,{children:a.jsxs(tt,{children:[a.jsx(st,{asChild:!0,children:a.jsx(xe,{type:"button",variant:"ghost-destructive",size:"icon-xs","aria-label":f("thread.publishPopover.discard"),className:"shrink-0 disabled:pointer-events-auto",onClick:I=>{I.stopPropagation(),l(!0)},disabled:h||c,children:a.jsx(rn,{className:"size-3.5"})})}),a.jsx(nt,{children:f("thread.publishPopover.discard")})]})}):null,e[35]=d,e[36]=c,e[37]=h,e[38]=l,e[39]=i,e[40]=f,e[41]=k):k=e[41];let L;e[42]!==D||e[43]!==k||e[44]!==N?(L=a.jsxs("div",{className:"flex items-center gap-2.5",children:[N,D,k]}),e[42]=D,e[43]=k,e[44]=N,e[45]=L):L=e[45],v=a.jsxs(ba,{className:P,"data-change-id":y,onClick:o,children:[L,j.length>0?a.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px] text-xs text-muted-foreground",children:j.map($o)}):w?a.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px]",children:a.jsx(He,{className:"h-4 w-2/3"})}):null]}),e[3]=p,e[4]=s,e[5]=d,e[6]=g,e[7]=c,e[8]=h,e[9]=l,e[10]=i,e[11]=o,e[12]=n,e[13]=f,e[14]=b,e[15]=v}else v=e[15];return v}function $o(t,e){return a.jsx("div",{className:"truncate",children:t},`${e}-${t}`)}function Na(){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]=U.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 h=new ResizeObserver(i);return h.observe(l),()=>h.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 Fo(){return document.documentElement.classList.contains("dark")?"vs-dark":"vs"}const Lo=[{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 dr(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=Lo.map(Oo),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 Oo(t,e){return a.jsxs("div",{className:q("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:q("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:q("h-2 animate-pulse rounded-sm bg-muted",t.width,t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")})]},e)}const Ca={readOnly:!0,renderSideBySide:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12},Mo={...Ca,lineNumbersMinChars:3,lineDecorationsWidth:4,folding:!1,glyphMargin:!1,renderOverviewRuler:!1};function _o(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,h=n===void 0?"px-6":n,c=d===void 0?!1:d,u=l===void 0?"380px":l,[p,b]=U.useState(null),[f,m]=U.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=Fo(),e[0]=g):g=e[0];const v=g;if(!s||Object.keys(s.diffs).length===0){let w;return e[1]!==i?(w=a.jsx("div",{className:"flex items-center justify-center py-10 text-sm text-muted-foreground",children:i}),e[1]=i,e[2]=w):w=e[2],w}let j;return e[3]!==s.diffs||e[4]!==f||e[5]!==u||e[6]!==p||e[7]!==c||e[8]!==o||e[9]!==h?(j=a.jsx("div",{className:"divide-y",children:Object.entries(s.diffs).map(w=>{const[x,P]=w,{from:y,to:N}=P,C=p===x,A=y===null,S=N===null,D=x.startsWith("/")?x.slice(1):x,k=D.lastIndexOf("/"),L=k>=0?D.slice(k+1):D,I=k>=0?D.slice(0,k):null,O=ki(x),M=A?"bg-success":S?"bg-destructive":"bg-warning";return c?a.jsx("div",{children:a.jsx(sr,{original:y??"",modified:N??"",language:O,theme:v,height:u,loading:a.jsx(dr,{height:u}),options:Mo})},x):a.jsxs("div",{children:[a.jsxs("div",{className:q("flex items-center gap-3 py-3 hover:bg-accent",h),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(C?null:x),children:a.jsx(jr,{className:q("h-3.5 w-3.5 transition-transform",C&&"rotate-90")})}),a.jsx("div",{className:q("h-2.5 w-2.5 shrink-0 rounded-full",M)}),a.jsx(Vr,{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:L}),I&&a.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:I}),o?a.jsxs(en,{children:[a.jsx(Ys,{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(Qa,{className:"h-3.5 w-3.5"})})}),a.jsx(Zs,{align:"end",children:a.jsx(os,{className:"text-destructive focus:text-destructive",onSelect:()=>m(x),children:"Discard changes"})})]}):null]}),f===x&&o?a.jsxs("div",{className:q("flex items-center justify-between gap-3 border-t bg-destructive/5 py-2.5",h),children:[a.jsxs("span",{className:"text-xs text-destructive",children:["Discard all changes to"," ",a.jsx("span",{className:"font-medium",children:L}),"? This cannot be undone."]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[a.jsx(xe,{type:"button",variant:"ghost",size:"sm",onClick:()=>m(null),children:"Cancel"}),a.jsx(xe,{type:"button",variant:"destructive",size:"sm",onClick:()=>{m(null),o(x)},children:"Discard"})]})]}):null,C&&a.jsx("div",{className:"border-t",children:a.jsx(sr,{original:y??"",modified:N??"",language:O,theme:v,height:u,loading:a.jsx(dr,{height:u}),options:Ca})})]},x)})}),e[3]=s.diffs,e[4]=f,e[5]=u,e[6]=p,e[7]=c,e[8]=o,e[9]=h,e[10]=j):j=e[10],j}function Eo(t){if(t.kind!=="block"||t.isSiteApp||!t.blockKey)return null;const e=(t.toJson??t.fromJson)?.__resolveType;return typeof e=="string"&&Ci(e)?t.blockKey:null}function zo(t){return t.kind!=="page"?!0:!t.pagePath||jt(t.pagePath).length>0}function Uo(t,e){try{return ll(t,ei,e)}catch{return null}}function Ko(t,e,s){if(!e)return;const r=Zl(e,t);if(!r)return null;if(jt(r.path).length===0||s?.path!==r.path)return r.path;const n=$n(r.path,s.params);return jt(n).length===0?n:r.path}function qo(t){return t.sectionKey&&!t.v8?Uo(t.previewServerUrl,t.sectionKey):Vo(t.previewServerUrl,t.path)}function Ho(t,e){if(t.kind!=="page")return"/";const s=t.pagePath;if(!s)return"";if(jt(s).length===0)return s;if(e?.path!==s)return"";const r=$n(s,e.params);return jt(r).length===0?r:""}function Vo(t,e){const s=e.trim();if(!s||jt(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 Go(t,e){return e?.kind==="pointer"&&e.link?An(t.toString(),e.link):Aa(t,e)}function Aa(t,e){if(!e)return null;if(e.kind==="pointer")return An(t.toString(),e.pointer);try{return new URL(`${t.pathname}${t.search}`,e.previewUrl).href}catch{return null}}function Wo(t,e,s){return e===null?!1:t!=="other"||s?.kind==="sandbox"}function Qo(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 Ra=U.createContext(!0),Jo=["split","before","after","code"];function Xo(t){return Jo.includes(t)}const Da={desktop:1280,mobile:412};function Yo(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:{[Ya(t.entry.name)]:{from:r,to:n}}}}function Ta(t){const e=B.c(76),{change:s,diff:r,bodyPending:n,previewServerUrl:o,draft:d,lastPage:l,v8:i,onReady:h}=t,c=be(),u=U.use(Ra),p=Eo(s),b=i?null:p,f=i?p:null,m=f?Ko(f,i?.blocks,l):void 0,g=f!==null&&m===null,v=Wo(s.kind,o,d)&&(f===null||typeof m=="string"),[j,w]=U.useState(null),x=v?j??"split":"code",[P,y]=U.useState("desktop"),[N,C]=U.useState(null),A=N??(f?m??"":Ho(s,l));let S;e[0]!==s?(S=zo(s),e[0]=s,e[1]=S):S=e[1];const D=S,k=o?qo({previewServerUrl:o,sectionKey:p,path:A,v8:!!i}):null,L=k?An(k.toString(),il):null,I=k?Aa(k,d):null,O=k?Go(k,d):null;let M;e[2]!==s||e[3]!==r?.diffs||e[4]!==c?(M=s.entry?Yo(s,c("thread.publishCompare.sideUnreadable")):{diffs:Object.fromEntries(s.filepaths.flatMap(_=>{const ce=r?.diffs[_];return ce?[[_,ce]]:[]}))},e[2]=s,e[3]=r?.diffs,e[4]=c,e[5]=M):M=e[5];const $=M;let X;e[6]!==$.diffs?(X=Object.keys($.diffs),e[6]=$.diffs,e[7]=X):X=e[7];const H=X.length>0;let Y;e:{if(b!==null){Y=null;break e}if(f!==null){const ce=A.trim();if(!ce){Y=null;break e}Y=jt(ce).length>0?c("thread.publishCompare.dynamicHint",{template:ce}):c("thread.publishCompare.blockHint",{path:ce});break e}if(s.kind!=="page"){let ce;e[8]!==c?(ce=c("thread.publishCompare.globalHint"),e[8]=c,e[9]=ce):ce=e[9],Y=ce;break e}let _;e[10]!==s.pagePath||e[11]!==c?(_=s.pagePath&&jt(s.pagePath).length>0?c("thread.publishCompare.dynamicHint",{template:s.pagePath}):null,e[10]=s.pagePath,e[11]=c,e[12]=_):_=e[12],Y=_}const F=Y,K=Qo(s,!!i),[J,ne]=U.useState(Zo);let V;e[13]===Symbol.for("react.memo_cache_sentinel")?(V=_=>ne(ce=>ce.has(_)?ce:new Set(ce).add(_)),e[13]=V):V=e[13];const de=V;let Z;e[14]!==i?(Z=_=>i?a.jsx(sc,{..._,onLoaded:de}):a.jsx(tc,{..._}),e[14]=i,e[15]=Z):Z=e[15];const re=Z,ee=(v?[K.before==="new"?null:L,K.after==="removed"?null:I].flatMap(_=>_?[zn(_,P)]:[]):[]).every(_=>J.has(_));let z;e[16]!==h||e[17]!==ee?(z=ee&&h?_=>{_&&h()}:void 0,e[16]=h,e[17]=ee,e[18]=z):z=e[18];const te=z,se=K.before==="new"?a.jsx(Is,{icon:a.jsx(Jr,{className:"size-5 text-brand"}),title:c("thread.publishCompare.newTitle"),description:c("thread.publishCompare.newDescription")}):re({url:L,device:P,title:c("thread.publishCompare.before"),missing:c("thread.publishCompare.enterPath")}),je=K.after==="removed"?a.jsx(Is,{icon:a.jsx(rn,{className:"size-5 text-destructive"}),title:c("thread.publishCompare.removedTitle"),description:c("thread.publishCompare.removedDescription")}):re({url:I,device:P,title:c("thread.publishCompare.after"),missing:c(k?"thread.publishCompare.draftUnavailable":"thread.publishCompare.enterPath")});let ae;e[19]!==v||e[20]!==w||e[21]!==u||e[22]!==c||e[23]!==x?(ae=v||u?a.jsx(Kr,{value:x,onValueChange:_=>{Xo(_)&&w(_)},children:a.jsxs(Ur,{className:"h-8 w-auto",variant:"pill",children:[v?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,u?a.jsx(Tt,{value:"code",className:"px-3 text-xs",children:c("thread.publishCompare.code")}):null]})}):null,e[19]=v,e[20]=w,e[21]=u,e[22]=c,e[23]=x,e[24]=ae):ae=e[24];let le;e[25]!==O||e[26]!==v||e[27]!==s.pagePath||e[28]!==P||e[29]!==A||e[30]!==D||e[31]!==b||e[32]!==y||e[33]!==C||e[34]!==c||e[35]!==x?(le=v&&x!=="code"?a.jsxs(a.Fragment,{children:[b?null:D?a.jsx(Ja,{value:A,onChange:_=>C(_.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:A}),a.jsxs("div",{className:"flex items-center rounded-lg border p-0.5",children:[a.jsx(ur,{active:P==="desktop",label:c("thread.publishCompare.desktop"),onClick:()=>y("desktop"),children:a.jsx(Ni,{className:"size-3.5"})}),a.jsx(ur,{active:P==="mobile",label:c("thread.publishCompare.mobile"),onClick:()=>y("mobile"),children:a.jsx(kl,{className:"size-3.5"})})]}),O?a.jsxs("a",{href:O,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(Xa,{className:"size-3.5"}),c("thread.publishCompare.openDraft")]}):null]}):null,e[25]=O,e[26]=v,e[27]=s.pagePath,e[28]=P,e[29]=A,e[30]=D,e[31]=b,e[32]=y,e[33]=C,e[34]=c,e[35]=x,e[36]=le):le=e[36];let oe;e[37]!==ae||e[38]!==le?(oe=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:[ae,le]}),e[37]=ae,e[38]=le,e[39]=oe):oe=e[39];let ie;e[40]!==v||e[41]!==F||e[42]!==x?(ie=F&&v&&x!=="code"?a.jsx("p",{className:"border-b bg-background px-4 py-1.5 text-2xs text-muted-foreground",children:F}):null,e[40]=v,e[41]=F,e[42]=x,e[43]=ie):ie=e[43];let E;e[44]!==g||e[45]!==u||e[46]!==c?(E=g&&u?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]=u,e[46]=c,e[47]=E):E=e[47];let ue;e[48]!==o||e[49]!==u||e[50]!==c||e[51]!==f||e[52]!==m||e[53]!==x?(ue=x==="code"&&!u?f!==null&&m===void 0?a.jsx(He,{className:"m-4 h-64 rounded"}):o===null?a.jsx(Is,{icon:a.jsx(Gs,{className:"size-5 text-muted-foreground"}),title:c("thread.publishCompare.previewNotReadyTitle"),description:c("thread.publishCompare.draftUnavailable")}):a.jsx(Is,{icon:a.jsx(Gs,{className:"size-5 text-muted-foreground"}),title:c("thread.publishCompare.noPreviewTitle"),description:c("thread.publishCompare.noPreviewDescription")}):null,e[48]=o,e[49]=u,e[50]=c,e[51]=f,e[52]=m,e[53]=x,e[54]=ue):ue=e[54];let ke;e[55]!==n||e[56]!==H||e[57]!==$||e[58]!==u||e[59]!==c||e[60]!==x?(ke=x==="code"&&u?a.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto bg-background [scrollbar-width:thin]",children:H?a.jsx(_o,{diff:$,hideFileRows:!0,editorHeight:"70vh"}):n?a.jsx(He,{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]=H,e[57]=$,e[58]=u,e[59]=c,e[60]=x,e[61]=ke):ke=e[61];let me;e[62]!==je||e[63]!==se||e[64]!==v||e[65]!==c||e[66]!==x?(me=v?a.jsxs("div",{className:q("flex min-h-0 flex-1 gap-3 p-3",x==="code"&&"hidden"),children:[a.jsx(hr,{label:c("thread.publishCompare.before"),hidden:x==="after",children:se}),a.jsx(hr,{label:c("thread.publishCompare.after"),highlight:!0,hidden:x==="before",children:je})]}):null,e[62]=je,e[63]=se,e[64]=v,e[65]=c,e[66]=x,e[67]=me):me=e[67];let Q;return e[68]!==te||e[69]!==oe||e[70]!==ie||e[71]!==E||e[72]!==ue||e[73]!==ke||e[74]!==me?(Q=a.jsxs("div",{ref:te,className:"flex min-h-0 min-w-0 flex-1 flex-col bg-muted/40",children:[oe,ie,E,ue,ke,me]}),e[68]=te,e[69]=oe,e[70]=ie,e[71]=E,e[72]=ue,e[73]=ke,e[74]=me,e[75]=Q):Q=e[75],Q}function Zo(){return new Set}function ur(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=q("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 hr(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 h;e[0]!==i?(h=q("flex min-h-0 min-w-0 flex-1 flex-col gap-1.5",i),e[0]=i,e[1]=h):h=e[1];const c=d&&"bg-brand";let u;e[2]!==c?(u=q("size-1.5 rounded-full bg-muted-foreground/50",c),e[2]=c,e[3]=u):u=e[3];let p;e[4]!==u?(p=a.jsx("span",{className:u}),e[4]=u,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=q("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 v;return e[14]!==g||e[15]!==h||e[16]!==b?(v=a.jsxs("div",{className:h,children:[b,g]}),e[14]=g,e[15]=h,e[16]=b,e[17]=v):v=e[17],v}function Is(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 ec(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 tc(t){const e=B.c(24),{url:s,device:r,title:n,missing:o}=t,[d,l]=Na(),[i,h]=U.useState(null);if(!s){let y;return e[0]!==o?(y=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]=y):y=e[1],y}let c;e[2]!==r||e[3]!==s?(c=zn(s,r),e[2]=r,e[3]=s,e[4]=c):c=e[4];const u=c,p=Da[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]!==u?(m=()=>h(u),e[5]=u,e[6]=m):m=e[6];const g=d.height>0?d.height/b:"100%",v=`scale(${b})`;let j;e[7]!==p||e[8]!==f||e[9]!==g||e[10]!==v?(j={left:f,width:p,height:g,transform:v,transformOrigin:"top left"},e[7]=p,e[8]=f,e[9]=g,e[10]=v,e[11]=j):j=e[11];let w;e[12]!==u||e[13]!==m||e[14]!==j||e[15]!==n?(w=a.jsx("iframe",{src:u,title:n,sandbox:"allow-scripts allow-same-origin",onLoad:m,className:"absolute top-0 border-0 bg-white",style:j},u),e[12]=u,e[13]=m,e[14]=j,e[15]=n,e[16]=w):w=e[16];let x;e[17]!==i||e[18]!==u?(x=i!==u?a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/60",children:a.jsx(cs,{className:"size-5 motion-reduce:animate-none"})}):null,e[17]=i,e[18]=u,e[19]=x):x=e[19];let P;return e[20]!==l||e[21]!==w||e[22]!==x?(P=a.jsxs("div",{ref:l,className:"absolute inset-0",children:[w,x]}),e[20]=l,e[21]=w,e[22]=x,e[23]=P):P=e[23],P}function sc(t){const e=B.c(21),{url:s,device:r,title:n,missing:o,onLoaded:d}=t,[l,i]=Na(),[h,c]=U.useState(null),[u,p]=U.useState(null),b=l.width>0&&l.height>0;b&&(h?.width!==l.width||h?.height!==l.height)&&c(l);const f=b?l:h;if(!s){let P;return e[0]!==o?(P=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]=P):P=e[1],P}let m,g,v,j;if(e[2]!==f||e[3]!==r||e[4]!==d||e[5]!==i||e[6]!==u||e[7]!==n||e[8]!==s){const P=zn(s,r),y=Da[r];m=u?.src!==P;const N=[...u&&m?[u]:[],{src:P,logicalWidth:y}];g=i,v="absolute inset-0",j=N.map(C=>{const A=C.src===P&&m;return a.jsx("iframe",{src:C.src,title:n,"aria-hidden":A&&u?!0:void 0,sandbox:"allow-scripts allow-same-origin",onLoad:()=>{C.src===P&&(p(C),d?.(C.src))},className:q("absolute top-0 border-0 bg-white",A&&"pointer-events-none opacity-0"),style:ec(f,C.logicalWidth)},C.src)}),e[2]=f,e[3]=r,e[4]=d,e[5]=i,e[6]=u,e[7]=n,e[8]=s,e[9]=m,e[10]=g,e[11]=v,e[12]=j}else m=e[9],g=e[10],v=e[11],j=e[12];let w;e[13]!==m||e[14]!==u?(w=m?u?a.jsx(cs,{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(cs,{className:"size-5 motion-reduce:animate-none"})}):null,e[13]=m,e[14]=u,e[15]=w):w=e[15];let x;return e[16]!==g||e[17]!==v||e[18]!==j||e[19]!==w?(x=a.jsxs("div",{ref:g,className:v,children:[j,w]}),e[16]=g,e[17]=v,e[18]=j,e[19]=w,e[20]=x):x=e[20],x}const nc=/^Co-authored-by:\s*([^<\r\n]+?)(?:\s*<[^>\r\n]*>)?\s*$/im;function rc(t){if(!t)return null;const e=nc.exec(t)?.[1]?.trim();return e||null}function ac(t){return/\[bot\]$/i.test(t)||/-bot$/i.test(t)}function lc(t){const e=rc(t.body);if(e)return e;const s=t.author.trim();return!s||ac(s)?null:s}function ic(t,e,s,r,n,o){return["cms-publish-bodies",t,e,s,r,n,o]}const oc=6e4;function cc(t,e){return e?null:t.files.map(s=>`${s.index}${s.working_dir} ${s.path}`).sort().join(`
|
|
3
3
|
`)}function dc(t,e,s){const r=B.c(6);let n;r[0]!==s||r[1]!==t||r[2]!==e?(n=hs.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:Pn},r[4]=n,r[5]=o):o=r[5];const{data:d}=mt(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},h=d?{fastPreview:!0}:void 0,c=U.useRef(null),u=async P=>{try{return await P()}catch(y){if(!l||!ca(y))throw y;return c.current??=l(),await c.current,P()}},p=Sr({...On(i),queryFn:()=>u(()=>da(i))}),b=p.data,f=b.changedFiles??null,m=b.headSha??null,g=f?f.length>0:mi(b)||pi(b),v=mt({queryKey:ic(e,s,r,o,m,cc(b,d)),queryFn:()=>u(()=>bi(i,b,o,h)),enabled:g,staleTime:d?oc:0,gcTime:d?void 0:0,throwOnError:(P,y)=>!f&&y.state.data===void 0}),j=dc(e,s,r),w=v.data??null,x=f?wa({files:f,lookup:j,diff:w}):jo(w);return{status:b,summary:x,allPaths:f?f.map(P=>P.path):Object.keys(w?.diffs??{}),discardablePaths:d?null:new Set(b.files.map(P=>P.path)),changedFilesTotal:b.changedFilesTotal??x.count,changedFilesTruncated:b.changedFilesTruncated??!1,headSha:m,diff:w,bodiesPending:g&&v.isPending,bodiesFailed:v.isError,cardsPending:!f&&g&&v.isPending,refresh:()=>Promise.all([p.refetch(),d?null:v.refetch()])}}function uc(t){const e=B.c(4);let s;e[0]!==t?(s=hs.decofile(t),e[0]=t,e[1]=s):s=e[1];let r;e[2]!==s?(r={queryKey:s,queryFn:Pn},e[2]=s,e[3]=r):r=e[3];const{data:n}=mt(r);return n}function hc(t,e){const s=B.c(5);let r;s[0]!==t||s[1]!==e?(r=e?cl(e,t):hs.liveMeta("","no-scope"),s[0]=t,s[1]=e,s[2]=r):r=s[2];let n;s[3]!==r?(n={queryKey:r,queryFn:Pn},s[3]=r,s[4]=n):n=s[4];const{data:o}=mt(n);return o}function Hn(t){const e=B.c(27),{backend:s,cacheKey:r,scope:n}=t,o=kr();let d;e[0]!==r?(d=hs.contentChanges(r),e[0]=r,e[1]=d):d=e[1];let l;e[2]!==s.client||e[3]!==r||e[4]!==o?(l=()=>dl(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 h=Sr(i),c=h.data,u=ol(s,r,c),p=uc(r),b=hc(s,n),f=u.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=Ro({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 v=g;let j;e[15]!==c.changes?(j=Object.entries(c.changes).map(fc),e[15]=c.changes,e[16]=j):j=e[16];const w=v.count>0&&u.isPending,x=p??null;let P;e[17]!==h?(P=()=>h.refetch(),e[17]=h,e[18]=P):P=e[18];let y;return e[19]!==c||e[20]!==u.isError||e[21]!==v||e[22]!==j||e[23]!==w||e[24]!==x||e[25]!==P?(y={changes:c,summary:v,entries:j,sidesPending:w,sidesFailed:u.isError,blocks:x,refresh:P},e[19]=c,e[20]=u.isError,e[21]=v,e[22]=j,e[23]=w,e[24]=x,e[25]=P,e[26]=y):y=e[26],y}function fc(t){const[e,s]=t;return{name:e,version:s.version}}function mc(t){return["smart-review-verdict",t.orgSlug,t.virtualMcpId,t.branch,t.threadId,t.fastPreview?"fast-preview-upstream":"sandbox",t.signature,t.language]}function pc(t){const e=B.c(27),{orgSlug:s,virtualMcpId:r,branch:n,threadId:o,fastPreview:d,status:l,diff:i,enabled:h}=t,[c]=Nr(),{language:u}=c;let p,b,f;if(e[0]!==n||e[1]!==i||e[2]!==h||e[3]!==d||e[4]!==u||e[5]!==s||e[6]!==l||e[7]!==o||e[8]!==r){const P=i?Mn(i):"";p=h&&!!n&&!!l&&!!i&&P!=="",f=mt,b=mc({orgSlug:s,virtualMcpId:r,branch:n,threadId:o,fastPreview:d,signature:P,language:u}),e[0]=n,e[1]=i,e[2]=h,e[3]=d,e[4]=u,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]!==u||e[15]!==s||e[16]!==l||e[17]!==o||e[18]!==r?(m=()=>gi({orgSlug:s,virtualMcpId:r,branch:n,threadId:o},{status:l,diff:i,language:u}),e[12]=n,e[13]=i,e[14]=u,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:bc},e[20]=p,e[21]=b,e[22]=m,e[23]=g):g=e[23];const v=f(g),j=v.data??null,w=p&&v.isFetching&&!v.data;let x;return e[24]!==j||e[25]!==w?(x={verdict:j,loading:w},e[24]=j,e[25]=w,e[26]=x):x=e[26],x}function bc(t,e){return!ca(e)&&t<1}function Ia(t){const e=B.c(30),{orgSlug:s,virtualMcpId:r,branch:n,threadId:o,fastPreview:d,status:l,diff:i,policy:h,judgeEnabled:c,paths:u}=t,p=c===void 0?!0:c,b=u===void 0?null:u;let f;e[0]!==i||e[1]!==p||e[2]!==h?(f=p&&xi(i,h),e[0]=i,e[1]=p,e[2]=h,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:v,loading:j}=pc(g);if(!i&&b){let y;e[13]!==b||e[14]!==h?(y=vi(b,h),e[13]=b,e[14]=h,e[15]=y):y=e[15];let N;return e[16]!==y?(N={gate:y,ready:!1},e[16]=y,e[17]=N):N=e[17],N}if(!i){let y;return e[18]===Symbol.for("react.memo_cache_sentinel")?(y={gate:{allowed:!0,reason:null},ready:!1},e[18]=y):y=e[18],y}if(!m){let y;e[19]!==i||e[20]!==h?(y=yi(i,h),e[19]=i,e[20]=h,e[21]=y):y=e[21];let N;return e[22]!==y?(N={gate:y,ready:!0},e[22]=y,e[23]=N):N=e[23],N}let w;e[24]!==j||e[25]!==v?(w=ji(v,j),e[24]=j,e[25]=v,e[26]=w):w=e[26];const x=!j;let P;return e[27]!==w||e[28]!==x?(P={gate:w,ready:x},e[27]=w,e[28]=x,e[29]=P):P=e[29],P}function gc(t){return["main","master"].includes(t.trim().toLowerCase())}function xc(t,e,s,r){return t===0?r("thread.publishPopover.publish"):s||!gc(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 vc=2500;function yc(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 $a(t){const e=B.c(16),s=U.useRef(!1),r=be();let n;e[0]!==t?(n=u=>{!u&&s.current||t.onOpenChange(u)},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(Ar,{className:"sr-only",children:d}),e[5]=d,e[6]=l):l=e[6];let i;e[7]!==t?(i=a.jsx(jc,{...t,publishLockRef:s}),e[7]=t,e[8]=i):i=e[8];let h;e[9]!==l||e[10]!==i?(h=a.jsxs(Rr,{"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]=h):h=e[11];let c;return e[12]!==o||e[13]!==t.open||e[14]!==h?(c=a.jsx(Cr,{open:t.open,onOpenChange:o,children:h}),e[12]=o,e[13]=t.open,e[14]=h,e[15]=c):c=e[15],c}function jc(t){const e=B.c(3),s=It(t.virtualMcpId,t.branch),r=s.kind==="protocol"&&s.source==="github";let n;return e[0]!==r||e[1]!==t?(n=uo({open:t.open,hosted:r})?a.jsx(Sc,{...t}):null,e[0]=r,e[1]=t,e[2]=n):n=e[2],n}const wc=4,us="flex h-[45%] min-h-0 min-w-0 shrink-0 md:h-auto md:flex-1";function ks(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 Vn(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx("div",{className:q(us,"bg-muted/40 p-3"),children:a.jsx(He,{className:"h-full w-full rounded-lg"})}),t[0]=e):e=t[0],e}function Gn(t){const e=B.c(11),{mode:s,title:r,subLine:n,trailing:o}=t,d=s==="review"?nn:Nl;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 h;e[6]!==n?(h=n?a.jsx("div",{className:"pl-6 text-xs text-muted-foreground",children:n}):null,e[6]=n,e[7]=h):h=e[7];let c;return e[8]!==i||e[9]!==h?(c=a.jsxs(a.Fragment,{children:[i,h]}),e[8]=i,e[9]=h,e[10]=c):c=e[10],c}function Wn(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(Gs,{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(xe,{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 Fa(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(Vn,{}),e[0]=o):o=e[0];let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(He,{className:"h-3.5 w-48"}),e[1]=d):d=e[1];let l;e[2]!==s?(l=a.jsx(Gn,{mode:s,title:d}),e[2]=s,e[3]=l):l=e[3];let i,h;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(ws,{children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Bt,{}),a.jsx(Bt,{}),a.jsx(Bt,{})]})}),h=a.jsxs(a.Fragment,{children:[a.jsx(He,{className:"h-3 w-20"}),a.jsx(He,{className:"h-14 w-full rounded-lg"})]}),e[4]=i,e[5]=h):(i=e[4],h=e[5]);let c;e[6]!==r||e[7]!==n?(c=a.jsx(Wn,{draftPreviewUrl:r,t:n}),e[6]=r,e[7]=n,e[8]=c):c=e[8];const u=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]!==u||e[13]!==p?(b=a.jsx(xe,{type:"button",variant:u,className:"flex-1",disabled:!0,children:p}),e[12]=u,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(ks,{pane:o,list:a.jsx(ln,{state:"loading",header:l,body:i,note:h,footer:f})}),e[18]=f,e[19]=l,e[20]=m):m=e[20],m}function Pc(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:q(us,"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 h;e[3]!==i?(h=a.jsx("span",{className:"truncate",children:i}),e[3]=i,e[4]=h):h=e[4];let c;e[5]!==s||e[6]!==h?(c=a.jsx(Gn,{mode:s,title:h}),e[5]=s,e[6]=h,e[7]=c):c=e[7];let u;e[8]!==n?(u=a.jsx("p",{className:"px-4 py-6 text-xs text-destructive",children:n}),e[8]=n,e[9]=u):u=e[9];let p;e[10]!==r||e[11]!==d?(p=a.jsx(Wn,{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(kn,{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(xe,{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 v;return e[22]!==g||e[23]!==c||e[24]!==u?(v=a.jsx(ks,{pane:l,list:a.jsx(ln,{state:"ready",header:c,body:u,footer:g})}),e[22]=g,e[23]=c,e[24]=u,e[25]=v):v=e[25],v}function Sc(t){const e=B.c(3),s=t.mode??"publish";let r;return e[0]!==s||e[1]!==t?(r=a.jsx(Dr,{children:n=>{const{reset:o}=n;return a.jsx(Tr,{fallback:d=>{const{error:l,resetError:i}=d;return a.jsx(Pc,{mode:s,draftPreviewUrl:t.draftPreviewUrl,message:l?.message??"",onRetry:()=>{o(),i()}})},children:a.jsx(U.Suspense,{fallback:a.jsx(Fa,{mode:s,draftPreviewUrl:t.draftPreviewUrl}),children:a.jsx(kc,{...t})})})}}),e[0]=s,e[1]=t,e[2]=r):r=e[2],r}function kc(t){const e=B.c(13),s=It(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=Rn(r);if(s.kind==="protocol"&&n){let d;return e[4]!==s||e[5]!==n||e[6]!==t?(d=s.source==="sandbox"?a.jsx(Ac,{...t,backend:s,cacheKey:n}):a.jsx(Cc,{...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(Fa,{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(Nc,{...t}),e[11]=t,e[12]=o):o=e[12],o}function Nc(t){const e=B.c(52),s=fs()?.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}=Ia(d),i=n.discardablePaths;let h;e[19]!==i?(h=j=>i===null||j.every(w=>i.has(w)),e[19]=i,e[20]=h):h=e[20];const c=h;let u;e[21]!==c?(u=j=>c(j.filepaths),e[21]=c,e[22]=u):u=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=_n(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:Mn(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]!==u||e[44]!==p||e[45]!==b||e[46]!==f||e[47]!==m?(g={summary:n.summary,allPaths:n.allPaths,canDiscard:u,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]=u,e[44]=p,e[45]=b,e[46]=f,e[47]=m,e[48]=g):g=e[48];let v;return e[49]!==t||e[50]!==g?(v=a.jsx(Qn,{...t,source:g}),e[49]=t,e[50]=g,e[51]=v):v=e[51],v}function La(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 Cc(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=Hn(d),i=s.source==="github";let h;e[12]!==s||e[13]!==l?(h=La(l,s),e[12]=s,e[13]=l,e[14]=h):h=e[14];let c;e[15]===Symbol.for("react.memo_cache_sentinel")?(c={allowed:!0,reason:null},e[15]=c):c=e[15];let u;e[16]!==i||e[17]!==n.branch||e[18]!==h?(u={...h,gate:c,headBranch:n.branch,hosted:i,otherWork:!1},e[16]=i,e[17]=n.branch,e[18]=h,e[19]=u):u=e[19];let p;return e[20]!==n||e[21]!==u?(p=a.jsx(Qn,{...n,source:u}),e[20]=n,e[21]=u,e[22]=p):p=e[22],p}function Ac(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=fs()?.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=Hn(l);let h;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?(h={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]=h):h=e[19];const c=Ba(h),u=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]!==u||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:u},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]=u,e[29]=o,e[30]=p):p=e[30];const{gate:b}=Ia(p);let f;if(e[31]!==c.allPaths||e[32]!==i){let N;e[34]!==i?(N=C=>{const A=Un(C);return A===null?!Ln(C):!Object.hasOwn(i.changes.changes,A)},e[34]=i,e[35]=N):N=e[35],f=c.allPaths.some(N),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=La(i,s),e[36]=s,e[37]=i,e[38]=g):g=e[38];let v;e[39]!==c||e[40]!==i?(v=()=>Promise.all([i.refresh(),c.refresh()]),e[39]=c,e[40]=i,e[41]=v):v=e[41];let j;e[42]!==c.status||e[43]!==n.branch?(j=_n(c.status)??n.branch,e[42]=c.status,e[43]=n.branch,e[44]=j):j=e[44];const w=c.headSha??void 0;let x;e[45]!==c.diff?(x=c.diff?{expectedDiffSignature:Mn(c.diff)}:{},e[45]=c.diff,e[46]=x):x=e[46];let P;e[47]!==b||e[48]!==m||e[49]!==w||e[50]!==x||e[51]!==g||e[52]!==v||e[53]!==j?(P={...g,refresh:v,gate:b,headBranch:j,expectedHeadSha:w,...x,hosted:!1,otherWork:m},e[47]=b,e[48]=m,e[49]=w,e[50]=x,e[51]=g,e[52]=v,e[53]=j,e[54]=P):P=e[54];let y;return e[55]!==n||e[56]!==P?(y=a.jsx(Qn,{...n,source:P}),e[55]=n,e[56]=P,e[57]=y):y=e[57],y}function Qn(t){const e=B.c(130),{source:s,publishLockRef:r,onOpenChange:n,mode:o,fastPreview:d,orgSlug:l,virtualMcpId:i,branch:h,baseBranch:c,repoTarget:u,owner:p,repo:b,draftPreviewUrl:f,destinationHost:m,previewServerUrl:g,compareDraft:v,lastPublishedPr:j,onRequestApproval:w,openPullRequest:x,onPullRequestChanged:P,onPublished:y}=t,N=o===void 0?"publish":o,C=j===void 0?null:j,A=x===void 0?null:x,S=be(),[D]=Nr(),{language:k}=D,L=fs()?.taskId??null,{data:I}=tn.useSession(),O=Ir($r(l,i,h)),{allPaths:M,changedFilesTotal:$,changedFilesTruncated:X,diff:H,bodiesFailed:Y,refresh:F,gate:K,hosted:J,otherWork:ne}=s;let V;e[0]!==v||e[1]!==s.bodiesPending||e[2]!==s.cardsPending||e[3]!==s.summary?(V={summary:s.summary,cardsPending:s.cardsPending,bodiesPending:s.bodiesPending,compareDraft:v},e[0]=v,e[1]=s.bodiesPending,e[2]=s.cardsPending,e[3]=s.summary,e[4]=V):V=e[4];const de=V;let Z;e[5]!==J?(Z={hosted:J},e[5]=J,e[6]=Z):Z=e[6];const re=co(de,Z),{summary:T,cardsPending:ee,bodiesPending:z,compareDraft:te}=re.shown,[se,je]=U.useState(null),[ae,le]=U.useState(!1),[oe,ie]=U.useState(Rc);let E;e[7]===Symbol.for("react.memo_cache_sentinel")?(E=W=>ie(pe=>pe.has(W)?pe:new Set(pe).add(W)),e[7]=E):E=e[7];const ue=E,[ke,me]=U.useState(null);let Q;e[8]===Symbol.for("react.memo_cache_sentinel")?(Q=[],e[8]=Q):Q=e[8];const[_,ce]=U.useState(Q);let Ve;e[9]!==s.v8?(Ve=W=>{me(W),ce(pe=>[W,...pe.filter(fe=>fe!==W)]),s.v8&&setTimeout(()=>ue(W),vc)},e[9]=s.v8,e[10]=Ve):Ve=e[10];const Pt=Ve,[_e,we]=U.useState(null);let Ie;e[11]!==se||e[12]!==T?(Ie=Po(se,No(T)),e[11]=se,e[12]=T,e[13]=Ie):Ie=e[13];const ge=Ie,De=[...T.pages,...T.blocks,...T.other],Ae=De.find(W=>Ce(W)===ke)??De[0]??null,$e=Ae?Ce(Ae):null,Le=[...new Set([...$e?[$e]:[],..._,...De.map(Ce)])].filter(W=>De.some(pe=>Ce(pe)===W)).slice(0,wc),Fe=!!s.v8,[St,pt]=U.useState(null),Re=Fe?yc({selectedId:$e,readyIds:oe,lastShownId:St,liveIds:Le}):$e;Fe&&Re===$e&&Re!==St&&pt(Re);const he=N==="review"&&!J,G=ee?"loading":z?"manifest":"ready",Pe=A?.state==="open",Se=s.headBranch,Ne=I?.user;let Be;e[14]!==Ne?(Be=pa(Ne),e[14]=Ne,e[15]=Be):Be=e[15];let Ge;e[16]!==s.expectedDiffSignature?(Ge=s.expectedDiffSignature?{expectedDiffSignature:s.expectedDiffSignature}:{},e[16]=s.expectedDiffSignature,e[17]=Ge):Ge=e[17];let rt;e[18]!==c||e[19]!==h||e[20]!==d||e[21]!==l||e[22]!==p||e[23]!==b||e[24]!==u||e[25]!==s.expectedHeadSha||e[26]!==s.headBranch||e[27]!==Be||e[28]!==Ge||e[29]!==L||e[30]!==i?(rt={orgSlug:l,virtualMcpId:i,branch:h,threadId:L,fastPreview:d,baseBranch:c,target:u,owner:p,repo:b,headBranch:Se,coAuthor:Be,expectedHeadSha:s.expectedHeadSha,...Ge},e[18]=c,e[19]=h,e[20]=d,e[21]=l,e[22]=p,e[23]=b,e[24]=u,e[25]=s.expectedHeadSha,e[26]=s.headBranch,e[27]=Be,e[28]=Ge,e[29]=L,e[30]=i,e[31]=rt):rt=e[31];const kt=rt,ps=he?"review":"publish",at=I?.user?.name;let Ft;e[32]!==M||e[33]!==m||e[34]!==J||e[35]!==ge||e[36]!==n||e[37]!==y||e[38]!==P||e[39]!==r||e[40]!==F||e[41]!==s.protocol||e[42]!==ps||e[43]!==at||e[44]!==kt?(Ft={mode:ps,target:kt,note:ge,allPaths:M,destinationHost:m,publishLockRef:r,onOpenChange:n,refresh:F,onPullRequestChanged:P,onPublished:y,hosted:J,authorName:at,protocol:s.protocol},e[32]=M,e[33]=m,e[34]=J,e[35]=ge,e[36]=n,e[37]=y,e[38]=P,e[39]=r,e[40]=F,e[41]=s.protocol,e[42]=ps,e[43]=at,e[44]=kt,e[45]=Ft):Ft=e[45];const{isPublishing:Te,publishError:We,publishErrorDetail:lt,submit:Qe,discardChange:Lt,discardAll:bs}=li(Ft),Nt=Mr(l,i).phase==="saving",Je=T.count>0||ne,gs=!Te&&Je&&(he||K.allowed);let it;e[46]!==c||e[47]!==he||e[48]!==s.v8||e[49]!==T.count||e[50]!==S?(it=he?T.count===0?S("thread.publishPopover.submitForReview"):T.count===1?S("thread.publishPopover.submitOneForReview"):S("thread.publishPopover.submitCountForReview",{count:T.count}):xc(T.count,c,!!s.v8,S),e[46]=c,e[47]=he,e[48]=s.v8,e[49]=T.count,e[50]=S,e[51]=it):it=e[51];const xs=it;let ot;e:{if(he&&Pe){let fe;e[52]!==A.number||e[53]!==S?(fe=S("thread.publishPopover.updatesPullRequest",{number:A.number}),e[52]=A.number,e[53]=S,e[54]=fe):fe=e[54],ot=fe;break e}const W=C;if(!W?.mergedAt){ot=null;break e}let pe;if(e[55]!==k||e[56]!==W||e[57]!==S){const fe=Za(new Date(W.mergedAt),k),ye=lc(W);pe=ye?S("thread.publishPopover.lastPublishedBy",{when:fe,name:ye}):S("thread.publishPopover.lastPublished",{when:fe}),e[55]=k,e[56]=W,e[57]=S,e[58]=pe}else pe=e[58];ot=pe}const Ct=ot;let ct;e[59]!==he||e[60]!==T.count||e[61]!==S?(ct=he?S("thread.publishPopover.submitForReview"):T.count===1?S("thread.publishPopover.publishOne"):T.count>1?S("thread.publishPopover.publishCount",{count:T.count}):S("thread.publishPopover.publish"),e[59]=he,e[60]=T.count,e[61]=S,e[62]=ct):ct=e[62];const vs=ct,bt=(W,pe)=>pe.length===0?null:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("div",{className:"px-0.5 text-2xs font-medium text-muted-foreground",children:W}),pe.map(fe=>{const ye=Ce(fe);return a.jsx(ka,{change:fe,bodyPending:z,selected:Ae!==null&&Ce(Ae)===ye,onSelect:()=>Pt(ye),confirming:_e===ye,onConfirmingChange:Oe=>we(Oe?ye:null),onDiscard:s.canDiscard(fe)?()=>{Lt(fe)}:void 0,isPublishing:Te,isDiscarding:Nt,v8:!!s.v8},ye)})]});let At;e:{if(he||!Je){At=null;break e}if(K.pending){let ye;e[63]===Symbol.for("react.memo_cache_sentinel")?(ye=a.jsx(cs,{className:"size-3.5 motion-reduce:animate-none"}),e[63]=ye):ye=e[63];let Oe;e[64]!==S?(Oe=S("thread.publishPopover.reviewing"),e[64]=S,e[65]=Oe):Oe=e[65];let ht;e[66]!==Oe?(ht=a.jsxs("div",{className:"flex items-center gap-2 border-t px-4 py-2.5 text-xs text-muted-foreground",children:[ye,Oe]}),e[66]=Oe,e[67]=ht):ht=e[67],At=ht;break e}if(K.allowed){At=null;break e}let W;e[68]===Symbol.for("react.memo_cache_sentinel")?(W=a.jsx(Sn,{className:"mt-0.5 size-3.5 shrink-0"}),e[68]=W):W=e[68];let pe;e[69]!==K.reason||e[70]!==S?(pe=K.reason??S("thread.publishPopover.needsReviewGeneric"),e[69]=K.reason,e[70]=S,e[71]=pe):pe=e[71];let fe;e[72]!==pe?(fe=a.jsxs("div",{className:"flex items-start gap-2 border-t px-4 py-2.5 text-xs text-warning",children:[W,a.jsx("span",{children:pe})]}),e[72]=pe,e[73]=fe):fe=e[73],At=fe}const Ot=At;let dt;e[74]!==bs||e[75]!==ae||e[76]!==Nt||e[77]!==Te||e[78]!==s.canDiscardAll||e[79]!==T.count||e[80]!==S?(dt=T.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:()=>le(!0),disabled:Te||Nt,children:S("thread.publishPopover.discardAll")}),a.jsx(Vs,{open:ae,onOpenChange:le,children:a.jsxs(Hs,{children:[a.jsxs(zs,{children:[a.jsx(_s,{children:S("thread.publishPopover.discardAllTitle")}),a.jsx(Es,{children:S("thread.publishPopover.discardAllConfirm")})]}),a.jsxs(qs,{children:[a.jsx(Us,{children:S("thread.publishDialog.cancel")}),a.jsx(Ks,{onClick:()=>{bs()},disabled:Nt,className:q(Br({variant:"destructive"})),children:S("thread.publishPopover.discardAll")})]})]})})]}),e[74]=bs,e[75]=ae,e[76]=Nt,e[77]=Te,e[78]=s.canDiscardAll,e[79]=T.count,e[80]=S,e[81]=dt):dt=e[81];const Rt=dt,Dt=ee?a.jsx(ws,{children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Bt,{}),a.jsx(Bt,{})]})}):T.count===0&&ne?a.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:S("thread.publishPopover.onlyOtherWork")}):T.count===0?a.jsxs("div",{className:"flex flex-col items-center gap-1 py-10 text-center",children:[a.jsx(Fn,{className:"mb-1 size-5 text-success"}),a.jsx("p",{className:"text-sm font-medium",children:S(he?"thread.publishPopover.nothingToSubmit":"thread.publishPopover.everythingLive")}),a.jsx("p",{className:"text-xs text-muted-foreground",children:S(he?"thread.publishPopover.submitEmptyHint":"thread.publishPopover.emptyHint")})]}):a.jsxs(ws,{children:[X?a.jsx("p",{className:"text-2xs text-muted-foreground",children:S("thread.publishPopover.showingFirst",{shown:T.count,total:$})}):null,bt(S("thread.publishPopover.pagesGroup"),T.pages),bt(S("thread.publishPopover.blocksGroup"),T.blocks),bt(S("thread.publishPopover.otherGroup"),T.other),Y?a.jsx("p",{className:"text-2xs text-muted-foreground",children:S("thread.publishPopover.detailsUnavailable")}):null,ne?a.jsx("p",{className:"text-2xs text-muted-foreground",children:S("thread.publishPopover.alsoOtherWork")}):null]}),gt=ee?a.jsx(Vn,{}):Ae?a.jsx("div",{className:q(us,"relative"),children:De.filter(W=>Le.includes(Ce(W))).map(W=>a.jsx("div",{className:q("absolute inset-0 flex",Fe?Ce(W)===Re?"z-10":"pointer-events-none opacity-0":Ce(W)!==$e&&"hidden"),inert:Fe&&Ce(W)!==Re,"aria-hidden":Fe&&Ce(W)!==Re?!0:void 0,children:a.jsx(Ta,{change:W,diff:H,bodyPending:z,previewServerUrl:g,draft:te,lastPage:O,v8:s.v8,onReady:Fe?()=>ue(Ce(W)):void 0})},Ce(W)))}):a.jsx("div",{className:q(us,"bg-muted/40")});let xt;e[82]!==xs?(xt=a.jsx("span",{className:"truncate",children:xs}),e[82]=xs,e[83]=xt):xt=e[83];let Xe;e[84]!==Rt||e[85]!==N||e[86]!==Ct||e[87]!==xt?(Xe=a.jsx(Gn,{mode:N,title:xt,subLine:Ct,trailing:Rt}),e[84]=Rt,e[85]=N,e[86]=Ct,e[87]=xt,e[88]=Xe):Xe=e[88];let Ye;e[89]!==Te||e[90]!==he||e[91]!==ge||e[92]!==T.count||e[93]!==S?(Ye=T.count===0?null:a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-sm font-medium",children:S(he?"thread.publishPopover.reviewNote":"thread.publishPopover.versionNote")}),a.jsx(ti,{value:ge,onChange:W=>je(W.target.value),placeholder:S(he?"thread.publishPopover.reviewNotePlaceholder":"thread.publishPopover.versionNotePlaceholder"),rows:2,maxLength:ii,className:"resize-none text-sm",disabled:Te})]}),e[89]=Te,e[90]=he,e[91]=ge,e[92]=T.count,e[93]=S,e[94]=Ye):Ye=e[94];let ut;e[95]!==f||e[96]!==S?(ut=a.jsx(Wn,{draftPreviewUrl:f,t:S}),e[95]=f,e[96]=S,e[97]=ut):ut=e[97];let Ee;e[98]!==gs||e[99]!==K||e[100]!==Je||e[101]!==J||e[102]!==Te||e[103]!==he||e[104]!==w||e[105]!==vs||e[106]!==re||e[107]!==Qe||e[108]!==S?(Ee=!he&&!J&&Je&&!K.allowed&&!K.pending?a.jsx(xe,{type:"button",className:"flex-1",onClick:w,disabled:Te,children:S("thread.publishPopover.requestApproval")}):a.jsxs(xe,{type:"button",variant:he?"default":"brand",className:"flex-1",onClick:()=>{re.hold(),Qe().then(W=>{W===!1&&re.release()})},disabled:!gs,children:[Te?a.jsx(cs,{className:"size-4 motion-reduce:animate-none"}):null,Te?S(he?"thread.publishPopover.submitting":"thread.publishPopover.publishing"):vs]}),e[98]=gs,e[99]=K,e[100]=Je,e[101]=J,e[102]=Te,e[103]=he,e[104]=w,e[105]=vs,e[106]=re,e[107]=Qe,e[108]=S,e[109]=Ee):Ee=e[109];let Ze;e[110]!==ut||e[111]!==Ee?(Ze=a.jsxs("div",{className:"flex gap-2",children:[ut,Ee]}),e[110]=ut,e[111]=Ee,e[112]=Ze):Ze=e[112];let ze;e[113]!==We||e[114]!==lt||e[115]!==S?(ze=We?a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-destructive",children:We}),lt?a.jsx(ul,{label:S("siteEditor.details"),detail:lt}):null]}):null,e[113]=We,e[114]=lt,e[115]=S,e[116]=ze):ze=e[116];let Ue;e[117]!==Ze||e[118]!==ze?(Ue=a.jsxs(a.Fragment,{children:[Ze,ze]}),e[117]=Ze,e[118]=ze,e[119]=Ue):Ue=e[119];let Ke;e[120]!==Dt||e[121]!==Ot||e[122]!==G||e[123]!==Xe||e[124]!==Ye||e[125]!==Ue?(Ke=a.jsx(ln,{state:G,header:Xe,body:Dt,note:Ye,gate:Ot,footer:Ue}),e[120]=Dt,e[121]=Ot,e[122]=G,e[123]=Xe,e[124]=Ye,e[125]=Ue,e[126]=Ke):Ke=e[126];let vt;return e[127]!==gt||e[128]!==Ke?(vt=a.jsx(ks,{pane:gt,list:Ke}),e[127]=gt,e[128]=Ke,e[129]=vt):vt=e[129],vt}function Rc(){return new Set}function Dc(t){if(!(t==="claiming"||t==="ready"||t==="failed"))return Ai[t].short}const Tc=new Set(["failure","timed_out","cancelled","action_required"]);function Oa(t){return t.status==="completed"&&Tc.has(t.conclusion)}function Jn(t){return t.status==="queued"||t.status==="in_progress"}function Ms(t){return t.isPending&&t.fetchStatus!=="idle"}function Bc(t){return{key:"view-change-request",label:t("thread.cmsActions.viewOnProvider"),action:"open-pr-page"}}function ft(t,e,s){return e?[...t,Bc(s)]:t}function qe(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 fr(t){return{key:"submit-for-review",label:t("thread.headerActions.submitForReview"),action:"create-pr"}}function $s(t,e,s){if(e.filter(Jn).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 Ic(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,h=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:qe([],i,l)};if(i.workingTreeDirty||h)return{label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:qe(ft([fr(l)],r,l),i,l)};if(fa("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:qe(ft([],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:qe(ft([],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:qe(ft([],r,l),i,l)};if(!r)return{label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:qe([fr(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 u=n.filter(Jn).length,p=n.filter(Oa).map(f=>f.name);if(u===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:qe(ft([{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 $s({label:l("thread.headerActions.markReady"),action:"mark-ready",variant:"default",tooltip:l("thread.headerActions.markDraftReadyTooltip"),menu:qe(ft([],r,l),i,l)},n,l);const b=o?.unresolvedConversations??0;return b>0?$s({label:l("thread.headerActions.addressFeedback"),action:"resolve-comments",variant:"default",tooltip:l("thread.headerActions.unresolvedConversationsTooltip",{count:String(b)}),menu:qe(ft([],r,l),i,l)},n,l):o?.missingRequiredApprovals?$s({label:l("thread.cmsActions.waitingForReview"),action:"open-pr-page",variant:"outline",tooltip:l("thread.headerActions.waitingForApprovalsTooltip"),menu:qe(ft([],r,l),i,l)},n,l):$s({label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",meta:{publishPolicyOverride:"open"},menu:qe(ft([{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 mr(t){return{key:"view-change-request",label:t("thread.cmsActions.viewOnProvider"),action:"open-pr"}}function Fs(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 pr(t,e,s,r){const n=e.length;if(n===0)return t;if(e.filter(Jn).length>0){const l=e.filter(h=>h.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(Oa).length;return d>0?{...t,variant:"warning",tooltip:r("thread.cmsActions.checksFailing",{failed:d,total:n})}:t}function $c(t,e){return!!(t?.merged&&t.headSha&&e.kind==="ready"&&!e.workingTreeDirty&&e.headSha===t.headSha)}function Fc(t){return Ms(t.prQuery)?!0:t.pr?.state!=="open"||t.pr.merged?!1:Ms(t.checksQuery)||Ms(t.reviewsQuery)}function Lc(t,e){return t.workingTreeDirty?!0:e!==null?e>0:t.aheadOfBase>0}function Oc(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 Mc(t){return{...t,menu:[]}}function _c(t){const{branch:e,pr:s,checks:r,reviews:n,publishing:o,saving:d,loading:l,publishableChangeCount:i,t:h}=t;if(e.kind!=="ready"&&t.statusError)return{label:h("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:h("thread.headerActions.loading"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(o)return{label:h("thread.cmsActions.publishing"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(t.syncing)return{label:h("thread.cmsActions.gettingLatest"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(d)return{label:h("thread.headerActions.saving"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(s&&s.state==="open"&&!s.merged?s:null){const u=n?.mergeableState??"unknown";return u==="dirty"?{label:h("thread.cmsActions.getLatest"),action:"get-latest",variant:"default",tooltip:h("thread.cmsActions.getLatestTooltip"),menu:[{key:"resolve-on-provider",label:h("thread.cmsActions.resolveOnProvider"),action:"open-pr"}]}:u==="blocked"||n?.draft?pr({label:h("thread.cmsActions.waitingForReview"),action:"open-pr",variant:"outline",menu:Fs([mr(h)],e,h)},r,"loading",h):pr({label:h("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:Fs([mr(h)],e,h)},r,"none",h)}return $c(s,e)?{label:h("thread.headerActions.upToDate"),variant:"outline",disabled:!0,menu:Fs([],e,h)}:Lc(e,i)?{label:h("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:Fs([{key:"request-approval",label:h("thread.headerActions.submitForReview"),action:"request-approval"}],e,h)}:e.behindBase>0?{label:h("thread.cmsActions.getLatest"),action:"get-latest",variant:"default",tooltip:h("thread.cmsActions.getLatestTooltip"),menu:[],autoRun:e.aheadOfBase===0}:{label:h("thread.headerActions.upToDate"),variant:"outline",disabled:!0,menu:[]}}function Ec(t){return t.conflicting===!0?"dirty":t.conflicting===null?"unknown":t.reviewBlocked||t.unresolvedConversations>0?"blocked":"clean"}function Ma(t){const e=B.c(4);let s;e[0]!==t?(s=_l(t),e[0]=t,e[1]=s):s=e[1];let r;return e[2]!==s?(r={...s,select:zc},e[2]=s,e[3]=r):r=e[3],mt(r)}function zc(t){const e=t.changeRequest;return e?{draft:e.draft,mergeableState:Ec(e),unresolvedConversations:e.unresolvedConversations,missingRequiredApprovals:e.reviewBlocked}:null}function br(t,e){return t==="open-pr"||e==="resolve-on-provider"?a.jsx(ia,{size:16}):t==="publish"?a.jsx(Gr,{className:"size-4"}):t==="get-latest"||t==="retry-status"?a.jsx(kn,{className:"size-4"}):a.jsx(nn,{className:"size-4"})}function Uc(t){const e=B.c(63),{virtualMcpId:s}=t,r=be(),{org:n}=Ps(),o=kr(),d=Ss(s),{data:l}=tn.useSession(),i=Dn(),{deleteRelease:h}=an(s),{currentBranch:c,setCurrentTaskBranch:u,taskId:p,createTask:b}=Fr();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={open:!1,mode:"publish"},e[0]=f):f=e[0];const[m,g]=U.useState(f);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=G=>g({open:!0,mode:G}),e[1]=v):v=e[1];const j=v,w=sa(d),x=w.status==="attached"||w.status==="public-clone"?w.repo:null,{previewServerUrl:P}=ms(s),y=c?Ir($r(n.slug,s,c)):null,N=y?$n(y.path,y.params):"/",C=Vl(c?{orgSlug:n.slug,virtualMcpId:s,branch:c,previewServerUrl:P,path:N}:null);let A;e[2]!==c||e[3]!==n.slug||e[4]!==s?(A=c?{orgSlug:n.slug,virtualMcpId:s,branch:c}:null,e[2]=c,e[3]=n.slug,e[4]=s,e[5]=A):A=e[5];const S=Gl(A),D=It(s,c),k=D.kind==="protocol"&&D.source==="github";let L;e[6]!==c||e[7]!==n.slug||e[8]!==s?(L=c?{orgSlug:n.slug,virtualMcpId:s,branch:c}:null,e[6]=c,e[7]=n.slug,e[8]=s,e[9]=L):L=e[9];const I=Rn(L),O=_r(k?D:null,I);let M;e[10]!==n.slug||e[11]!==s?(M=hl(n.slug,s),e[10]=n.slug,e[11]=s,e[12]=M):M=e[12];const $=fl(M,k?S:null),X=k?ml(P,N,$):C.url,H=c??"",Y=p??null;let F;e[13]!==n.slug||e[14]!==H||e[15]!==Y||e[16]!==s?(F=On({orgSlug:n.slug,virtualMcpId:s,branch:H,threadId:Y}),e[13]=n.slug,e[14]=H,e[15]=Y,e[16]=s,e[17]=F):F=e[17];const K=!!c&&D.kind!=="pending"&&!k;let J;e[18]!==F||e[19]!==K?(J={...F,enabled:K},e[18]=F,e[19]=K,e[20]=J):J=e[20];const ne=mt(J),V=k?null:ne.data??null,de=k?Oc(O.data,c??""):null,Z=de?de.branchMeta:V?{kind:"ready",branch:_n(V)??c??"",base:V.base??"main",workingTreeDirty:wi(V),unpushed:V.unpushed??0,aheadOfBase:V.aheadOfBase??0,behindBase:V.behindBase??0,headSha:V.headSha??""}:{kind:"unknown"},re=de?de.publishableChangeCount:V?.changedFiles?wa({files:V.changedFiles}).count:null,T=k?O:ne,ee=(Z.kind==="ready"?Z.branch:null)??c??null,z=Z.kind==="ready"?Z.base:"main",te=na({orgId:n.id,orgSlug:n.slug,target:Me(x),owner:x?.owner??"",repo:x?.name??"",branch:ee}),se=te.data??null,je=ra({orgId:n.id,orgSlug:n.slug,target:Me(x),owner:x?.owner??"",repo:x?.name??"",base:z}),ae=aa({orgId:n.id,orgSlug:n.slug,target:Me(x),owner:x?.owner??"",repo:x?.name??"",branch:ee}),le=Ma({orgId:n.id,orgSlug:n.slug,target:Me(x),owner:x?.owner??"",repo:x?.name??"",branch:ee});let oe;e[21]!==ae||e[22]!==se||e[23]!==te||e[24]!==le?(oe=Fc({pr:se,prQuery:te,checksQuery:ae,reviewsQuery:le}),e[21]=ae,e[22]=se,e[23]=te,e[24]=le,e[25]=oe):oe=e[25];const ie=oe;let E;e[26]!==te?(E=async()=>{await te.refetch()},e[26]=te,e[27]=E):E=e[27];const ue=E,ke=Yn({mutationFn:()=>io({hosted:k,branch:c,baseBranch:z,nextBranch:()=>Rl(c,Tn(l?.user),i),setCurrentTaskBranch:u,deleteRelease:h}),onError:Hc});let me;e[28]!==n.slug||e[29]!==p||e[30]!==s?(me=async G=>(await Pi({orgSlug:n.slug,virtualMcpId:s,branch:G.branch,threadId:p??null},G.base),G),e[28]=n.slug,e[29]=p,e[30]=s,e[31]=me):me=e[31];let Q;e[32]!==c||e[33]!==n.slug||e[34]!==o||e[35]!==r||e[36]!==p||e[37]!==s?(Q=async G=>{et.success(r("thread.headerActions.syncedWithBase",{base:G.base})),await Promise.all([o.invalidateQueries({queryKey:En({orgSlug:n.slug,virtualMcpId:s,branch:c??G.branch,threadId:p??null})}),o.invalidateQueries({queryKey:hs.decofile(`${n.slug}/${s}/${G.branch}`)})])},e[32]=c,e[33]=n.slug,e[34]=o,e[35]=r,e[36]=p,e[37]=s,e[38]=Q):Q=e[38];let _;e[39]!==me||e[40]!==Q?(_={mutationFn:me,onSuccess:Q,onError:qc},e[39]=me,e[40]=Q,e[41]=_):_=e[41];const ce=Yn(_),Ve=Er(n.slug,s),Pt=ke.isPending,_e=_c({branch:Z,pr:se,checks:ae.data??[],reviews:le.data??null,publishing:Pt,saving:Ve,syncing:ce.isPending,statusRetrying:T.isFetching&&!!T.error,statusError:T.error instanceof Error?T.error.message:T.error?String(T.error):null,loading:!!ie,publishableChangeCount:re,t:r}),we=k?Mc(_e):_e,Ie=we.autoRun&&Z.kind==="ready"&&x&&P?`${ee}@${Z.headSha}`:null,ge=U.useRef(null);if(U.useEffect(()=>{!Ie||!ee||ge.current!==Ie&&(ge.current=Ie,ce.mutate({branch:ee,base:z}))},[Ie,ee,z,ce]),w.status==="detached"){let G;e[42]!==r?(G=r("thread.headerActions.reconnectGithub"),e[42]=r,e[43]=G):G=e[43];let Pe;e[44]!==G?(Pe=a.jsx(st,{asChild:!0,children:a.jsx("span",{children:a.jsx(xe,{size:"sm",variant:"outline",disabled:!0,children:G})})}),e[44]=G,e[45]=Pe):Pe=e[45];let Se;e[46]!==r?(Se=r("thread.headerActions.githubConnectionRemoved"),e[46]=r,e[47]=Se):Se=e[47];let Ne;e[48]!==Se?(Ne=a.jsx(nt,{children:Se}),e[48]=Se,e[49]=Ne):Ne=e[49];let Be;return e[50]!==Pe||e[51]!==Ne?(Be=a.jsx(sn,{children:a.jsxs(tt,{children:[Pe,Ne]})}),e[50]=Pe,e[51]=Ne,e[52]=Be):Be=e[52],Be}if(!d)return null;if(!x||!P){const G=x?"noPreviewServer":"noRepo";let Pe;e[53]!==c||e[54]!==b?(Pe=c?()=>{const Ne=b?.({runtime:"sandbox",branch:c});Ne&&el("coding_session_started",{thread_id:Ne})}:void 0,e[53]=c,e[54]=b,e[55]=Pe):Pe=e[55];let Se;return e[56]!==G||e[57]!==Pe?(Se=a.jsx(Vc,{reason:G,onStartCodingSession:Pe}),e[56]=G,e[57]=Pe,e[58]=Se):Se=e[58],Se}if(!c)return null;const De=G=>{switch(G){case"publish":{j("publish");return}case"request-approval":{j("review");return}case"get-latest":{if(!ee||ce.isPending)return;ce.mutate({branch:ee,base:z});return}case"retry-status":{T.refetch();return}case"open-pr":{se?.htmlUrl&&window.open(se.htmlUrl,"_blank","noopener,noreferrer");return}}};let Ae;e[59]!==De?(Ae=G=>({key:G.key,label:G.label,icon:br(G.action,G.key),...G.tooltip?{tooltip:G.tooltip}:{},onSelect:()=>De(G.action)}),e[59]=De,e[60]=Ae):Ae=e[60];const $e=we.menu.map(Ae),Le=we.action,Fe=we.label,St=we.variant,pt=!!we.loading;let Re;e[61]!==r?(Re=r("thread.cmsActions.moreActionsAriaLabel"),e[61]=r,e[62]=Re):Re=e[62];const he=a.jsx(ma,{size:"sm",label:Fe,variant:St,disabled:!!we.disabled||!Le,loading:pt,...Le&&!we.loading?{icon:br(Le)}:{},...we.tooltip?{tooltip:we.tooltip}:{},items:$e,menuAriaLabel:Re,onClick:Le?()=>De(Le):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,he,c?a.jsx($a,{open:m.open,mode:m.mode,fastPreview:!0,onOpenChange:G=>{G||g(Kc)},orgSlug:n.slug,virtualMcpId:s,branch:c,baseBranch:z,repoTarget:Me(x),owner:x.owner,repo:x.name,publishPolicy:ua(d?.metadata?.publishPolicy),draftPreviewUrl:X,destinationHost:C.host,previewServerUrl:P,compareDraft:S?{kind:"pointer",pointer:S,...$?{link:$}:{}}:null,lastPublishedPr:je.data??null,onRequestApproval:()=>j("review"),openPullRequest:se?.state==="open"?se:null,onPullRequestChanged:ue,onPublished:()=>ke.mutateAsync()}):null]})}function Kc(t){return{...t,open:!1}}function qc(t){et.error(t instanceof Error?t.message:String(t))}function Hc(t){console.error("site editor: settling after publish failed",t)}function Vc(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(xe,{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 h;e[9]!==i?(h=a.jsx(nt,{children:i}),e[9]=i,e[10]=h):h=e[10];let c;return e[11]!==l||e[12]!==h?(c=a.jsx(sn,{children:a.jsxs(tt,{children:[l,h]})}),e[11]=l,e[12]=h,e[13]=c):c=e[13],c}const $t="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 Gc(t){return`Reopen PR #${t.prNumber}. ${$t}`}function Wc(t){return`Rebase \`${t.branch}\` on the latest base and force-push with --force-with-lease. ${$t}`}function Qc(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). ${$t}`}function Jc(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. ${$t}`}function Xc(t){return`Mark PR #${t.prNumber} ready for review. ${$t}`}function Yc(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. ${$t}`}function Zc(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. ${$t}`}function gr(t){switch(t){case"publish":return a.jsx(Gr,{className:"size-4"});case"create-pr":case"reopen":return a.jsx(nn,{className:"size-4"});case"rebase":case"sync":return a.jsx(kn,{className:"size-4"});case"fix-checks":return a.jsx(Sn,{className:"size-4"});case"mark-ready":return a.jsx(Fn,{className:"size-4"});case"resolve-comments":return a.jsx(Cl,{className:"size-4"});case"merge":return a.jsx(fi,{className:"size-4"});case"review":return a.jsx(Gs,{className:"size-4"});case"open-pr-page":return a.jsx(ia,{size:16})}}const xr=new Set(["reopen","rebase","fix-checks","mark-ready","resolve-comments","review","sync"]),vr=new Set(["publish","create-pr"]);function ed(t){const e=B.c(44),{t:s,button:r,actionBusy:n,changeRequestPending:o,savePending:d,onAction:l}=t,i=r.action;let h;e[0]!==i||e[1]!==n?(h=n&&i!==void 0&&xr.has(i),e[0]=i,e[1]=n,e[2]=h):h=e[2];const c=h,u=o&&i==="merge";let p;e[3]!==i||e[4]!==d?(p=d&&i!==void 0&&vr.has(i),e[3]=i,e[4]=d,e[5]=p):p=e[5];const b=p,f=!!r.disabled||c||u||b||!i,m=!!r.loading||u;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 v=g;let j;if(e[11]!==n||e[12]!==r.menu||e[13]!==o||e[14]!==l||e[15]!==d||e[16]!==s){let D;e[18]!==n||e[19]!==o||e[20]!==l||e[21]!==d||e[22]!==s?(D=k=>{const L=n&&xr.has(k.action),I=d&&vr.has(k.action),O=k.action==="merge"&&o,M=I?s("thread.headerActions.saving"):L?s("thread.headerActions.chatIsRunning"):k.tooltip;return{key:k.key,label:k.label,icon:gr(k.action),disabled:!!(L||I||O),...M?{tooltip:M}:{},onSelect:()=>l(k.action)}},e[18]=n,e[19]=o,e[20]=l,e[21]=d,e[22]=s,e[23]=D):D=e[23],j=r.menu.map(D),e[11]=n,e[12]=r.menu,e[13]=o,e[14]=l,e[15]=d,e[16]=s,e[17]=j}else j=e[17];const w=j,x=r.label,P=r.variant;let y;e[24]!==i||e[25]!==m?(y=i&&!m?{icon:gr(i)}:{},e[24]=i,e[25]=m,e[26]=y):y=e[26];let N;e[27]!==v?(N=v?{tooltip:v}:{},e[27]=v,e[28]=N):N=e[28];let C;e[29]!==s?(C=s("thread.headerActions.moreActionsAriaLabel"),e[29]=s,e[30]=C):C=e[30];let A;e[31]!==i||e[32]!==l?(A=i?()=>l(i):void 0,e[31]=i,e[32]=l,e[33]=A):A=e[33];let S;return e[34]!==r.label||e[35]!==r.variant||e[36]!==f||e[37]!==w||e[38]!==m||e[39]!==y||e[40]!==N||e[41]!==C||e[42]!==A?(S=a.jsx(ma,{size:"sm",label:x,variant:P,disabled:f,loading:m,...y,...N,items:w,menuAriaLabel:C,onClick:A}),e[34]=r.label,e[35]=r.variant,e[36]=f,e[37]=w,e[38]=m,e[39]=y,e[40]=N,e[41]=C,e[42]=A,e[43]=S):S=e[43],S}function yr(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(sn,{children:a.jsxs(tt,{children:[n,o]})}),e[6]=n,e[7]=o,e[8]=d):d=e[8],d}function td(t){return{label:t("thread.headerActions.loadingBranch"),disabled:!0,loading:!0,variant:"outline",tooltip:t("thread.headerActions.waitingForSandboxBranchTooltip"),menu:[]}}function sd({virtualMcpId:t}){const e=be(),{org:s}=Ps(),{data:r}=tn.useSession(),n=Ss(t),{deleteRelease:o}=an(t),{currentBranch:d,setCurrentTaskBranch:l,createTask:i,taskId:h}=Fr(),c=rl(),{openSidePanel:u}=gl(),[p,b]=U.useState({open:!1,mode:"publish",policyOverride:null}),f=Ri({connectionId:tl,orgId:s.id,orgSlug:s.slug}),m=Ti(f),[g,v]=U.useState(!1),j=U.useRef(""),w=sa(n),x=w.status==="attached"||w.status==="public-clone"?w.repo:null,{lifecycle:P,branch:y,phase:N}=Di(),C={orgSlug:s.slug,virtualMcpId:t,branch:d??"",threadId:h??null},S=mt({queryKey:En(C),queryFn:()=>da(C),enabled:!!d,staleTime:15e3,refetchInterval:Q=>un(Q.state.data)?5e3:!1}).data??null,D=y,k=P,L=D.kind==="ready"?D.branch:null,I=d??L??void 0,O=(D.kind==="ready"?D.branch:null)??I??null,M=na({orgId:s.id,orgSlug:s.slug,target:Me(x),owner:x?.owner??"",repo:x?.name??"",branch:O}),$=M.data??null,X=aa({orgId:s.id,orgSlug:s.slug,target:Me(x),owner:x?.owner??"",repo:x?.name??"",branch:O}),H=Ma({orgId:s.id,orgSlug:s.slug,target:Me(x),owner:x?.owner??"",repo:x?.name??"",branch:O}),Y=ra({orgId:s.id,orgSlug:s.slug,target:Me(x),owner:x?.owner??"",repo:x?.name??"",base:D.kind==="ready"?D.base:null}),F=D,K=ua(n?.metadata?.publishPolicy),J=Er(s.slug,t),{previewUrl:ne}=Bi(),{previewServerUrl:V,projectDefault:de}=ms(t),Z=Yr(),re=Dn();if(w.status==="detached")return a.jsx(yr,{label:e("thread.headerActions.githubConnectionRemoved"),children:a.jsx(xe,{size:"sm",variant:"outline",disabled:!0,children:e("thread.headerActions.reconnectGithub")})});if(!x)return null;const T=O?Ic({lifecycle:k,branch:F,claimPhase:N,pr:$,checks:X.data??[],reviews:H.data??null,noReviewableDiff:un(S),loading:Ms(M),t:e}):td(e),ee=JSON.stringify({label:T.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:k.phase,headBranch:O,noReviewableDiff:un(S)});j.current!==ee&&(j.current=ee,fa("header button",{label:T.label,tooltip:T.tooltip,action:T.action,chatBranch:d,sandboxBranch:L,sandboxRouteBranch:I,headBranch:O,branchMeta:D,effectiveBranchMeta:F,lifecyclePhase:k.phase,prNumber:$?.number??null,prState:$?.state??null}));const z=Q=>(u(),c.sendMessage({parts:[{type:"text",text:Q}]})),te=c.isStreaming,se=F.kind==="ready"?F.base:"main",je=async()=>{await M.refetch()},ae=async()=>{const Q=d,_=Dl({viewKind:Z,branch:d,projectDefault:de,userLabel:Tn(r?.user),blogView:re});_.kind==="new-thread"?i({runtime:_.runtime,branch:_.branch}):await l(_.branch),Q&&Q!==se&&await o(Q)},le=async Q=>{if(!(!x||g)){v(!0);try{const _=pa(r?.user);await oi(s.slug,Me(x),{number:Q,coAuthor:_}),et.success(e("thread.headerActions.publishedPr",{prNumber:String(Q)})),await je(),await ae()}catch(_){et.error(_ instanceof ci?_.detail??di(_.reason,e):_ instanceof Error?_.message:e("thread.headerActions.failedToMergePullRequest"))}finally{v(!1)}}},oe=(Q,_)=>b({open:!0,mode:Q,policyOverride:_}),ie=Q=>{if(O)switch(Q){case"publish":oe("publish",T.meta?.publishPolicyOverride??null);return;case"create-pr":oe("review",null);return;case"merge":$&&le($.number);return;case"sync":if(te)return;z(Qc({branch:O,base:se}));return;case"open-pr-page":$?.htmlUrl&&window.open($.htmlUrl,"_blank","noopener,noreferrer");return;case"review":if(te)return;$&&z(Zc({prNumber:$.number}));return;case"reopen":if(te)return;$&&z(Gc({prNumber:$.number}));return;case"rebase":if(te)return;z(Wc({branch:O}));return;case"fix-checks":if(te)return;$&&z(Jc({prNumber:$.number,failingChecks:T.meta?.failingChecks??[]}));return;case"mark-ready":if(te)return;$&&z(Xc({prNumber:$.number}));return;case"resolve-comments":if(te)return;$&&z(Yc({prNumber:$.number}));return}},E=g||te,ue=a.jsx(ed,{t:e,button:T,actionBusy:E,changeRequestPending:g,savePending:J,onAction:ie}),ke=F.kind==="ready"&&F.pushError&&F.pushFailingSince?e("thread.headerActions.pushFailing",{since:new Date(F.pushFailingSince).toLocaleString(),error:F.pushError}):null,me=ke?a.jsx(yr,{label:ke,children:a.jsx(Sn,{role:"img","aria-label":ke,className:"size-4 text-warning"})}):null;return I?a.jsxs(a.Fragment,{children:[me,ue,a.jsx($a,{open:p.open,mode:p.mode,fastPreview:!1,recoverSandbox:()=>m.mutateAsync({virtualMcpId:t,branch:I,...h?{threadId:h}:{}}),onOpenChange:Q=>{Q||b(_=>({..._,open:!1}))},orgSlug:s.slug,virtualMcpId:t,branch:I,baseBranch:se,repoTarget:Me(x),owner:x.owner,repo:x.name,publishPolicy:p.policyOverride??K,draftPreviewUrl:ne,destinationHost:null,previewServerUrl:V,compareDraft:ne?{kind:"sandbox",previewUrl:ne}:null,lastPublishedPr:Y.data??null,onRequestApproval:()=>b(Q=>({...Q,open:!0,mode:"review"})),openPullRequest:$?.state==="open"?$:null,onPullRequestChanged:je,onPublished:ae})]}):a.jsxs(a.Fragment,{children:[me,ue]})}function nd(t){const e=B.c(33),{orgSlug:s,virtualMcpId:r,branch:n}=t,o=be(),[d,l]=U.useState(!1),i=It(r,n),h=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 u=Rn(c),{data:p}=_r(h,u);if(!h||!u||!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 v;e[10]!==g?(v=a.jsx(xe,{size:"sm",variant:"outline","data-testid":"local-changes-button",onClick:m,children:g}),e[10]=g,e[11]=v):v=e[11];let j;e[12]!==o?(j=o("decoServe.changes.title"),e[12]=o,e[13]=j):j=e[13];let w;e[14]!==j?(w=a.jsx(Ar,{className:"sr-only",children:j}),e[14]=j,e[15]=w):w=e[15];let x;e[16]!==n||e[17]!==u||e[18]!==h||e[19]!==d||e[20]!==s||e[21]!==o||e[22]!==r?(x=d?a.jsx(Dr,{children:C=>{const{reset:A}=C;return a.jsx(Tr,{fallback:S=>{const{resetError:D}=S;return a.jsx(jn,{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:()=>{A(),D(),l(!1)}})},children:a.jsx(U.Suspense,{fallback:a.jsx(ks,{pane:a.jsx(Vn,{}),list:a.jsx(jn,{title:o("decoServe.changes.title"),loading:!0,body:a.jsx(ws,{children:a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Bt,{}),a.jsx(Bt,{})]})}),onClose:()=>l(!1)})}),children:a.jsx(rd,{orgSlug:s,virtualMcpId:r,branch:n,backend:h,cacheKey:u,onClose:()=>l(!1)})})})}}):null,e[16]=n,e[17]=u,e[18]=h,e[19]=d,e[20]=s,e[21]=o,e[22]=r,e[23]=x):x=e[23];let P;e[24]!==w||e[25]!==x?(P=a.jsxs(Rr,{"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:[w,x]}),e[24]=w,e[25]=x,e[26]=P):P=e[26];let y;e[27]!==d||e[28]!==P?(y=a.jsx(Cr,{open:d,onOpenChange:l,children:P}),e[27]=d,e[28]=P,e[29]=y):y=e[29];let N;return e[30]!==y||e[31]!==v?(N=a.jsxs(a.Fragment,{children:[v,y]}),e[30]=y,e[31]=v,e[32]=N):N=e[32],N}function jn(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(),h=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 u;e[2]!==c||e[3]!==r?(u=a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[c,r]}),e[2]=c,e[3]=r,e[4]=u):u=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(ha,{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(xe,{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 v;return e[17]!==n||e[18]!==h||e[19]!==u||e[20]!==g?(v=a.jsx(ln,{state:h,header:u,body:n,footer:g}),e[17]=n,e[18]=h,e[19]=u,e[20]=g,e[21]=v):v=e[21],v}function rd(t){const e=B.c(54),{orgSlug:s,virtualMcpId:r,branch:n,backend:o,cacheKey:d,onClose:l}=t,i=be();let h;e[0]!==n||e[1]!==s||e[2]!==r?(h={orgSlug:s,virtualMcpId:r,branch:n},e[0]=n,e[1]=s,e[2]=r,e[3]=h):h=e[3];let c;e[4]!==o||e[5]!==d||e[6]!==h?(c={backend:o,cacheKey:d,scope:h},e[4]=o,e[5]=d,e[6]=h,e[7]=c):c=e[7];const u=Hn(c);let p;e[8]!==n||e[9]!==s||e[10]!==u.refresh||e[11]!==r?(p={orgSlug:s,virtualMcpId:r,branch:n,refresh:u.refresh},e[8]=n,e[9]=s,e[10]=u.refresh,e[11]=r,e[12]=p):p=e[12];const b=ui(p),f=Mr(s,r).phase==="saving",m=o.describe.readOnly,[g,v]=U.useState(null),[j,w]=U.useState(null),[x,P]=U.useState(!1),{summary:y}=u;let N,C,A,S,D;if(e[13]!==g||e[14]!==o||e[15]!==j||e[16]!==b||e[17]!==x||e[18]!==f||e[19]!==m||e[20]!==u.blocks||e[21]!==u.entries||e[22]!==u.sidesFailed||e[23]!==u.sidesPending||e[24]!==y.blocks||e[25]!==y.count||e[26]!==y.pages||e[27]!==i){const I=[...y.pages,...y.blocks],O=I.find(H=>Ce(H)===g)??I[0]??null;let M;e[33]!==y.count||e[34]!==i?(M=y.count===0?i("decoServe.changes.title"):y.count===1?i("decoServe.changes.titleOne"):i("decoServe.changes.titleCount",{count:y.count}),e[33]=y.count,e[34]=i,e[35]=M):M=e[35],D=M;const $=(H,Y)=>Y.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:H}),Y.map(F=>{const K=Ce(F);return a.jsx(ka,{change:F,bodyPending:u.sidesPending,v8:!0,selected:O!==null&&Ce(O)===K,onSelect:()=>v(K),confirming:j===K,onConfirmingChange:J=>w(J?K:null),onDiscard:m||!F.entry?void 0:()=>{b(o,[F.entry],i("thread.publishPopover.discarded",{name:F.name}))},isPublishing:!1,isDiscarding:f},K)})]});let X;e[36]!==o||e[37]!==b||e[38]!==x||e[39]!==f||e[40]!==m||e[41]!==u.entries||e[42]!==y.count||e[43]!==i?(X=m||y.count<=1?null:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"ml-auto shrink-0 text-2xs text-muted-foreground transition-colors hover:text-destructive disabled:opacity-50",onClick:()=>P(!0),disabled:f,children:i("thread.publishPopover.discardAll")}),a.jsx(Vs,{open:x,onOpenChange:P,children:a.jsxs(Hs,{children:[a.jsxs(zs,{children:[a.jsx(_s,{children:i("thread.publishPopover.discardAllTitle")}),a.jsx(Es,{children:i("thread.publishPopover.discardAllConfirm")})]}),a.jsxs(qs,{children:[a.jsx(Us,{children:i("thread.publishDialog.cancel")}),a.jsx(Ks,{onClick:()=>{b(o,u.entries,i("thread.publishDialog.allChangesDiscarded"))},disabled:f,className:q(Br({variant:"destructive"})),children:i("thread.publishPopover.discardAll")})]})]})})]}),e[36]=o,e[37]=b,e[38]=x,e[39]=f,e[40]=m,e[41]=u.entries,e[42]=y.count,e[43]=i,e[44]=X):X=e[44],A=X,C=y.count===0?a.jsxs("div",{className:"flex flex-col items-center gap-1 py-10 text-center",children:[a.jsx(Fn,{className:"mb-1 size-5 text-success"}),a.jsx("p",{className:"text-sm font-medium",children:i("decoServe.changes.empty")})]}):a.jsxs(ws,{children:[$(i("thread.publishPopover.pagesGroup"),y.pages),$(i("thread.publishPopover.blocksGroup"),y.blocks),u.sidesFailed?a.jsx("p",{className:"text-2xs text-muted-foreground",children:i("thread.publishPopover.detailsUnavailable")}):null]}),N=ks,S=O?a.jsx("div",{className:q(us,"relative flex"),children:a.jsx(Ta,{change:O,diff:null,bodyPending:u.sidesPending,previewServerUrl:null,draft:null,lastPage:null,v8:{blocks:u.blocks}},Ce(O))}):a.jsx("div",{className:q(us,"bg-muted/40")}),e[13]=g,e[14]=o,e[15]=j,e[16]=b,e[17]=x,e[18]=f,e[19]=m,e[20]=u.blocks,e[21]=u.entries,e[22]=u.sidesFailed,e[23]=u.sidesPending,e[24]=y.blocks,e[25]=y.count,e[26]=y.pages,e[27]=i,e[28]=N,e[29]=C,e[30]=A,e[31]=S,e[32]=D}else N=e[28],C=e[29],A=e[30],S=e[31],D=e[32];let k;e[45]!==C||e[46]!==A||e[47]!==l||e[48]!==D?(k=a.jsx(jn,{title:D,trailing:A,body:C,onClose:l}),e[45]=C,e[46]=A,e[47]=l,e[48]=D,e[49]=k):k=e[49];let L;return e[50]!==N||e[51]!==S||e[52]!==k?(L=a.jsx(N,{pane:S,list:k}),e[50]=N,e[51]=S,e[52]=k,e[53]=L):L=e[53],L}function ad(t){const e=B.c(5),{virtualMcpId:s,branch:r}=t,n=be(),o=It(s,r);if(!ld(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 ld(t){return t.kind==="protocol"?t.hasSchema!==!1:t.kind==="unavailable"&&t.source!=="local"}function id(t){const e=B.c(11),{virtualMcpId:s,branch:r}=t,n=be(),o=It(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 h;e[4]!==n?(h=n("decoServe.readOnly.tooltip"),e[4]=n,e[5]=h):h=e[5];let c;e[6]!==h?(c=a.jsx(nt,{side:"bottom",className:"max-w-xs",children:a.jsx(ha,{text:h})}),e[6]=h,e[7]=c):c=e[7];let u;return e[8]!==i||e[9]!==c?(u=a.jsxs(tt,{children:[i,c]}),e[8]=i,e[9]=c,e[10]=u):u=e[10],u}function od(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 cd(){const t=B.c(27),e=fs(),{org:s}=Ps(),r=Ss(e?.virtualMcpId),n=r?.id??e?.virtualMcpId??"",o=e?.currentBranch??null,{runtime:d,resolved:l}=ms(r?.id),i=Bn(r?.id),{url:h}=Nn(r?.id),{connection:c}=Cn(n||null),u=!!r&&!!o&&l&&d==="cms"&&!i&&!h,p=o??"",b=e?.taskId??null;let f,m,g,v;t[0]!==s.slug||t[1]!==p||t[2]!==b||t[3]!==n?(m={orgSlug:s.slug,virtualMcpId:n,branch:p,threadId:b},f=dd,v=mt,g=On(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]=v):(f=t[4],m=t[5],g=t[6],v=t[7]);let j;t[8]!==f||t[9]!==m?(j=(k,L)=>f(L?.queryKey)===f(En(m))?k:void 0,t[8]=f,t[9]=m,t[10]=j):j=t[10];let w;t[11]!==u||t[12]!==g||t[13]!==j?(w={...g,enabled:u,placeholderData:j},t[11]=u,t[12]=g,t[13]=j,t[14]=w):w=t[14];const x=v(w),P=!!h,y=!!c;let N;if(t[15]!==i||t[16]!==o||t[17]!==r?.metadata?.releases||t[18]!==l||t[19]!==d||t[20]!==x.data||t[21]!==x.isError||t[22]!==P||t[23]!==y){let k;t[25]!==o?(k=L=>L.branch===o,t[25]=o,t[26]=k):k=t[26],N=od({runtime:d,runtimeResolved:l,blocksV8:i,localPreview:P,servingLocally:y,branch:o,listedDraft:(r?.metadata?.releases??[]).some(k),defaultBranch:x.data?x.data.base??null:x.isError?null:void 0}),t[15]=i,t[16]=o,t[17]=r?.metadata?.releases,t[18]=l,t[19]=d,t[20]=x.data,t[21]=x.isError,t[22]=P,t[23]=y,t[24]=N}else N=t[24];const C=N,A=`${n}:${o??""}`,[S,D]=U.useState(null);return C!=="pending"&&(S?.key!==A||S.gate!==C)&&D({key:A,gate:C}),C==="pending"&&S?.key===A?S.gate:C}function dd(t){return t?.[2]}function ud(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 au(t){const e=B.c(2),{blocksOnly:s}=t;let r;return e[0]!==s?(r=s?a.jsx(hd,{}):a.jsx(_a,{}),e[0]=s,e[1]=r):r=e[1],r}function hd(){return Bn($i())?a.jsx(Ra,{value:!1,children:a.jsx(_a,{})}):null}function _a(){const t=B.c(32),e=fs(),{org:s}=Ps(),r=Ss(e?.virtualMcpId),n=e?.currentBranch??null,o=ms(r?.id).runtime,{url:d}=Nn(r?.id),{connection:l}=Cn(r?.id??e?.virtualMcpId),i=r?.id??e?.virtualMcpId,h=cd()!=="open",c=!!r,u=!!l,p=!!d;let b;t[0]!==r||t[1]!==h||t[2]!==o||t[3]!==c||t[4]!==u||t[5]!==p?(b=ud({hasEntity:c,servingLocally:u,localPreview:p,showsRepositoryActions:!!r&&Ii(r),runtime:o,onProduction:h}),t[0]=r,t[1]=h,t[2]=o,t[3]=c,t[4]=u,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(ad,{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(id,{virtualMcpId:i,branch:n}),t[10]=n,t[11]=f.localFiles,t[12]=i,t[13]=g):g=t[13];let v;t[14]!==n||t[15]!==s||t[16]!==f.localFiles||t[17]!==i?(v=f.localFiles&&a.jsx(nd,{orgSlug:s.slug,virtualMcpId:i,branch:n}),t[14]=n,t[15]=s,t[16]=f.localFiles,t[17]=i,t[18]=v):v=t[18];let j;t[19]!==n||t[20]!==r||t[21]!==f.draftSelect?(j=r&&f.draftSelect&&a.jsx("div",{className:"flex min-w-0 shrink items-center justify-end",children:a.jsx(so,{virtualMcp:r,currentBranch:n})}),t[19]=n,t[20]=r,t[21]=f.draftSelect,t[22]=j):j=t[22];let w;t[23]!==r||t[24]!==f.publish?(w=r&&f.publish&&a.jsxs(a.Fragment,{children:[a.jsx(sl,{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(Uc,{virtualMcpId:r.id}):a.jsx(sd,{virtualMcpId:r.id})})]}),t[23]=r,t[24]=f.publish,t[25]=w):w=t[25];let x;return t[26]!==m||t[27]!==g||t[28]!==v||t[29]!==j||t[30]!==w?(x=a.jsxs(a.Fragment,{children:[m,g,v,j,w]}),t[26]=m,t[27]=g,t[28]=v,t[29]=j,t[30]=w,t[31]=x):x=t[31],x}export{au as S,cd as a,Na as b,Wi as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as I,j as r,n as v,b as M,a4 as P,bd as R}from"./index-
|
|
1
|
+
import{c as I,j as r,n as v,b as M,a4 as P,bd as R}from"./index-CWKxkTwy.js";import{E as T}from"./empty-state-DMtSEEQ1.js";import{u as w}from"./chat-context-D8Eje7xK.js";import{u as B,j as L,k as _}from"./site-editor-toast-BLqoqKy_.js";import{i as $,u as A,j as Q,S as U}from"./blocks-tab-states-BUfMyINR.js";import{b as G}from"./use-view-draft-kind-BQ4N5uEB.js";function H(C){const e=I.c(7),{icon:l,title:i,description:t,action:n}=C;let a;e[0]!==n?(a=n?{children:n.label,onClick:n.onClick,disabled:n.disabled}:void 0,e[0]=n,e[1]=a):a=e[1];let o;return e[2]!==t||e[3]!==l||e[4]!==a||e[5]!==i?(o=r.jsx(v,{children:r.jsx(v.Content,{children:r.jsx(v.Container,{children:r.jsx(T,{icon:l,title:i,description:t,buttonProps:a})})})}),e[2]=t,e[3]=l,e[4]=a,e[5]=i,e[6]=o):o=e[6],o}function Y(C){const e=I.c(33),{virtualMcpId:l,icon:i,copy:t,skeleton:n,children:a}=C,o=M(),{org:p}=P(),k=w(),u=k?.currentBranch??null,g=B(l,u);R(g.kind==="protocol"&&g.source==="github");const{openPanel:b}=G();if(!u){const s=t.noDraftTitle,D=t.noDraftDesc;let d;e[0]!==o?(d=o("sectionsEditor.namedRules.openEditor"),e[0]=o,e[1]=d):d=e[1];let f;e[2]!==b?(f=()=>b("content"),e[2]=b,e[3]=f):f=e[3];let m;e[4]!==d||e[5]!==f?(m={label:d,onClick:f},e[4]=d,e[5]=f,e[6]=m):m=e[6];let x;return e[7]!==t.noDraftDesc||e[8]!==t.noDraftTitle||e[9]!==i||e[10]!==m?(x=r.jsx(H,{icon:i,title:s,description:D,action:m}),e[7]=t.noDraftDesc,e[8]=t.noDraftTitle,e[9]=i,e[10]=m,e[11]=x):x=e[11],x}if($(g)){let s;return e[12]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx(U,{}),e[12]=s):s=e[12],s}if(g.kind==="pending"){let s;return e[13]!==n?(s=r.jsx(r.Fragment,{children:n}),e[13]=n,e[14]=s):s=e[14],s}if(g.kind!=="protocol"){let s;return e[15]!==t.loadFailed||e[16]!==t.loadFailedHint||e[17]!==i?(s=r.jsx(H,{icon:i,title:t.loadFailed,description:t.loadFailedHint}),e[15]=t.loadFailed,e[16]=t.loadFailedHint,e[17]=i,e[18]=s):s=e[18],s}let c;e[19]!==u||e[20]!==p.slug||e[21]!==l?(c=JSON.stringify([p.slug,l,u]),e[19]=u,e[20]=p.slug,e[21]=l,e[22]=c):c=e[22];const h=k?.taskId??null;let j;return e[23]!==u||e[24]!==a||e[25]!==t||e[26]!==i||e[27]!==p.slug||e[28]!==n||e[29]!==c||e[30]!==h||e[31]!==l?(j=r.jsx(J,{orgSlug:p.slug,virtualMcpId:l,branch:u,threadId:h,icon:i,copy:t,skeleton:n,children:a},c),e[23]=u,e[24]=a,e[25]=t,e[26]=i,e[27]=p.slug,e[28]=n,e[29]=c,e[30]=h,e[31]=l,e[32]=j):j=e[32],j}function J(C){const e=I.c(35),{orgSlug:l,virtualMcpId:i,branch:t,threadId:n,icon:a,copy:o,skeleton:p,children:k}=C,u=M();let g;e[0]!==t||e[1]!==l||e[2]!==n||e[3]!==i?(g={orgSlug:l,virtualMcpId:i,branch:t,threadId:n,previewUrl:null},e[0]=t,e[1]=l,e[2]=n,e[3]=i,e[4]=g):g=e[4];const b=g,c=L(b),h=A(b),j=c.data,s=h.data;let D;e[5]!==t||e[6]!==l||e[7]!==i?(D={orgSlug:l,virtualMcpId:i,branch:t},e[5]=t,e[6]=l,e[7]=i,e[8]=D):D=e[8];const d=_(D,Q);if(!j||!s||!d.ready){if(c.isError||h.isError||d.failed){const N=o.loadFailed,O=o.loadFailedHint;let F;e[9]!==u?(F=u("sectionsEditor.namedRules.tryAgain"),e[9]=u,e[10]=F):F=e[10];let E;e[11]!==c||e[12]!==d||e[13]!==h?(E=()=>{c.isError&&c.refetch(),h.isError&&h.refetch(),d.failed&&d.retry()},e[11]=c,e[12]=d,e[13]=h,e[14]=E):E=e[14];let S;e[15]!==F||e[16]!==E?(S={label:F,onClick:E},e[15]=F,e[16]=E,e[17]=S):S=e[17];let y;return e[18]!==o.loadFailed||e[19]!==o.loadFailedHint||e[20]!==a||e[21]!==S?(y=r.jsx(H,{icon:a,title:N,description:O,action:S}),e[18]=o.loadFailed,e[19]=o.loadFailedHint,e[20]=a,e[21]=S,e[22]=y):y=e[22],y}let x;return e[23]!==p?(x=r.jsx(r.Fragment,{children:p}),e[23]=p,e[24]=x):x=e[24],x}let f;e[25]!==t||e[26]!==k||e[27]!==j||e[28]!==s||e[29]!==l||e[30]!==n||e[31]!==i?(f=k({orgSlug:l,virtualMcpId:i,branch:t,threadId:n,decofile:j,meta:s}),e[25]=t,e[26]=k,e[27]=j,e[28]=s,e[29]=l,e[30]=n,e[31]=i,e[32]=f):f=e[32];let m;return e[33]!==f?(m=r.jsx(r.Fragment,{children:f}),e[33]=f,e[34]=m):m=e[34],m}export{H as S,Y as a};
|