decocms 4.583.0 → 4.584.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BfuEGc37.js → AlertCircle-BZ0BGwnM.js} +1 -1
- package/dist/client/assets/{AreaChart-DR454FhG.js → AreaChart-Bx-g_z7W.js} +1 -1
- package/dist/client/assets/{ArrowLeft-Ccyza8AK.js → ArrowLeft-BTOFmFlT.js} +1 -1
- package/dist/client/assets/{ArrowRight-BfJPk4p9.js → ArrowRight-BpkoTWQH.js} +1 -1
- package/dist/client/assets/{ArrowUp-Cfwuhrfj.js → ArrowUp-CwKaPNjB.js} +1 -1
- package/dist/client/assets/{BookOpen01-vaPiqXWZ.js → BookOpen01-DhDZ7eNO.js} +1 -1
- package/dist/client/assets/{CartesianChart-Vg3-F_Bi.js → CartesianChart-BHS62I-v.js} +1 -1
- package/dist/client/assets/{CategoricalChart-gtbFaKuM.js → CategoricalChart-BnSCjdlG.js} +1 -1
- package/dist/client/assets/{CheckCircle-WpYwhp7A.js → CheckCircle-CY8bNwGH.js} +1 -1
- package/dist/client/assets/{ChevronDown-Kpzb5_P-.js → ChevronDown-BKlrlXc3.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-DNPn4Jhl.js → ChevronSelectorVertical-BePvvjKF.js} +1 -1
- package/dist/client/assets/{ChevronUp-CwLphDxo.js → ChevronUp-CHCELrzp.js} +1 -1
- package/dist/client/assets/{CreditCard01-CDUEuZ6_.js → CreditCard01-uK4ZToQn.js} +1 -1
- package/dist/client/assets/{Eye-BeTcpGN-.js → Eye-kjpbNZjZ.js} +1 -1
- package/dist/client/assets/{File02-D8jC2XAm.js → File02-CKfJdGFc.js} +1 -1
- package/dist/client/assets/{Globe04-CM5K7y4B.js → Globe04-jkYXmi_b.js} +1 -1
- package/dist/client/assets/{Image01-0Jwady1a.js → Image01-Bo1SdsGt.js} +1 -1
- package/dist/client/assets/{Key01-Dqvoolzt.js → Key01-7H0qkrA1.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Nn_BPz0l.js → LayoutLeft-BgxQ02aQ.js} +1 -1
- package/dist/client/assets/{LinkBroken01-6J7zZ1XX.js → LinkBroken01-Cxiv48HY.js} +1 -1
- package/dist/client/assets/{Minimize01-Dylk6LHz.js → Minimize01-BSWAuJc_.js} +1 -1
- package/dist/client/assets/{Minus-BFZz-RWg.js → Minus-DcVQxn2x.js} +1 -1
- package/dist/client/assets/{Monitor01-ZIydqkip.js → Monitor01-DihbBP9d.js} +1 -1
- package/dist/client/assets/{Play-CkrBckKV.js → Play-C20jb3jc.js} +1 -1
- package/dist/client/assets/{Plus-C8Idvwpa.js → Plus-i14Zi4mM.js} +1 -1
- package/dist/client/assets/{ReferenceLine-2ZGA3m5C.js → ReferenceLine-C4ifFxvc.js} +1 -1
- package/dist/client/assets/{SearchMd-G9SUUXxg.js → SearchMd-fVOqR5XB.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-sbzM0fY9.js → ShoppingBag01-CGXAeyMk.js} +1 -1
- package/dist/client/assets/{Sun-Bvg5JrAI.js → Sun-CfU4AOYR.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BbD-SqO6.js → SwitchHorizontal01-BSYwKL4Y.js} +1 -1
- package/dist/client/assets/{Tool01-DOjdBvJ6.js → Tool01-BVIO9Qty.js} +1 -1
- package/dist/client/assets/{Tooltip-buu7_uLC.js → Tooltip-Cfj1COLE.js} +1 -1
- package/dist/client/assets/{Trash01-BRIjyxCC.js → Trash01-P2MZx3ms.js} +1 -1
- package/dist/client/assets/{TrendUp01-DLgSqdSd.js → TrendUp01-CLufuADE.js} +1 -1
- package/dist/client/assets/{Upload01-Dd-OapHB.js → Upload01-Dprp9ZwK.js} +1 -1
- package/dist/client/assets/{UserCheck01-DVOI9Qq6.js → UserCheck01-C2z5zhQe.js} +1 -1
- package/dist/client/assets/{UserSquare-CRBGeews.js → UserSquare-B9MlTUcx.js} +1 -1
- package/dist/client/assets/{Users01-bZ_S-kH7.js → Users01-BcGcy0wY.js} +1 -1
- package/dist/client/assets/{XClose-CWGS9q3D.js → XClose-CbqnWE9C.js} +1 -1
- package/dist/client/assets/{Zap-BxaAY56U.js → Zap-DPxvV-Nt.js} +1 -1
- package/dist/client/assets/{access-gate-BpukTmFQ.js → access-gate-C8T1_NGY.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BfsrivZp.js → add-connection-dialog-C22z0dJk.js} +1 -1
- package/dist/client/assets/agent-app--F4BNoyB.js +1 -0
- package/dist/client/assets/{agent-assets-CxDlSc-F.js → agent-assets-DLiEqX7t.js} +1 -1
- package/dist/client/assets/{agent-automation-Cvq2MsBo.js → agent-automation-D707BChu.js} +1 -1
- package/dist/client/assets/{agent-automations-DqPMEPTu.js → agent-automations-xu_RP6J4.js} +1 -1
- package/dist/client/assets/{agent-blog-CBUzxo-R.js → agent-blog-DGVUKsy8.js} +2 -2
- package/dist/client/assets/{agent-blog-post-Bi0pzlIG.js → agent-blog-post-BxafFxUn.js} +2 -2
- package/dist/client/assets/{agent-calendar-D817wzif.js → agent-calendar-DWr9pjl2.js} +1 -1
- package/dist/client/assets/{agent-capabilities-COfZW6Pr.js → agent-capabilities-DepzNhfJ.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-DEAtqQDn.js → agent-connect-sources-Kv2PdtBo.js} +1 -1
- package/dist/client/assets/agent-deck-1yGtqqX7.js +1 -0
- package/dist/client/assets/{agent-e2e-B_mxpyua.js → agent-e2e-k5mMFS8d.js} +1 -1
- package/dist/client/assets/agent-experiments-BjwAV1ze.js +1 -0
- package/dist/client/assets/agent-file-BAQYezOJ.js +1 -0
- package/dist/client/assets/{agent-hosting-CNynwqai.js → agent-hosting-CWKW5hjL.js} +1 -1
- package/dist/client/assets/{agent-icon-DE4TWlDl.js → agent-icon-DkJRVLqK.js} +1 -1
- package/dist/client/assets/agent-library-DfrFeGkX.js +1 -0
- package/dist/client/assets/agent-library-file-IPcJ3k4D.js +1 -0
- package/dist/client/assets/agent-overview-CjuprpaL.js +1 -0
- package/dist/client/assets/{agent-releases-De-C-EMX.js → agent-releases-DSIYOvyj.js} +1 -1
- package/dist/client/assets/agent-settings-C2k2pYaj.js +1 -0
- package/dist/client/assets/{agent-site-editor-B5E5lU9u.js → agent-site-editor-C1fA8VpJ.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-De_VzwTE.js +2 -0
- package/dist/client/assets/agent-site-editor-content-BvuCeOgl.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-ALhHKuHE.js +1 -0
- package/dist/client/assets/agent-view-BJGWAiHE.js +1 -0
- package/dist/client/assets/{agent-view-guard-25E2XJRr.js → agent-view-guard-2_KCfto_.js} +1 -1
- package/dist/client/assets/{ai-providers-E4UhWu6J.js → ai-providers-DX-ltrPo.js} +1 -1
- package/dist/client/assets/{alert-GV95Dsn9.js → alert-Bv02tf7n.js} +1 -1
- package/dist/client/assets/{analytics-sections-C9-8NbQC.js → analytics-sections-pY8ydIOR.js} +1 -1
- package/dist/client/assets/{api-keys-BU9wHAPs.js → api-keys-CtapHyd2.js} +1 -1
- package/dist/client/assets/api-keys-DFTiZEXV.js +1 -0
- package/dist/client/assets/{app-editor-kEra9PRa.js → app-editor-b_F0QWd_.js} +1 -1
- package/dist/client/assets/{asset-utils-DWvcPbEZ.js → asset-utils-sFjfnFiW.js} +1 -1
- package/dist/client/assets/{auth-gL3R1YGn.js → auth-JsuyXQmx.js} +1 -1
- package/dist/client/assets/{auth-catchall-Dy37bIqg.js → auth-catchall-BF2sAyru.js} +1 -1
- package/dist/client/assets/{auth-entry-BHlmJEBv.js → auth-entry-DpOoMaDl.js} +1 -1
- package/dist/client/assets/{auth-split-layout-ckQyQHcL.js → auth-split-layout-uHl5qLom.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-C7oT67KU.js → authenticate-and-persist-oauth-bpkds3b0.js} +1 -1
- package/dist/client/assets/{automation-list-row-DriFJJzl.js → automation-list-row-C0N85u6M.js} +1 -1
- package/dist/client/assets/{automation-runs-C37do2Pw.js → automation-runs-D7wABNtH.js} +1 -1
- package/dist/client/assets/{automations-tDs_UhVP.js → automations-DoJiUx4k.js} +1 -1
- package/dist/client/assets/{badge-BG-k6t3T.js → badge-BcL569rK.js} +1 -1
- package/dist/client/assets/{block-document-pPtike34.js → block-document-BjznMIp2.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-BBjk2tme.js → blocks-preview-workspace-context-GWtlleeP.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-GP0NCNYs.js → blocks-tab-states-BSrtLgq9.js} +1 -1
- package/dist/client/assets/{blog-preview-url-CwSXxQWr.js → blog-preview-url-Czu_9H4e.js} +1 -1
- package/dist/client/assets/{blog-schema-DOB707mb.js → blog-schema-Cf62uKwQ.js} +1 -1
- package/dist/client/assets/{blog-source-gate-3rG_0gJI.js → blog-source-gate-DiR6cjBJ.js} +1 -1
- package/dist/client/assets/{blog-view-gate-Be4DtolQ.js → blog-view-gate-BhcycJ8-.js} +1 -1
- package/dist/client/assets/{buckets-BZrhNTRn.js → buckets-AU2_f8G6.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DVbQXrhG.js → build-improve-prompt-doc-em6vVUiq.js} +1 -1
- package/dist/client/assets/{calendar-CcuaFZRF.js → calendar-lMJXe0Vk.js} +1 -1
- package/dist/client/assets/{capability-load-error-Bcs21XUc.js → capability-load-error-D2PPUj2i.js} +1 -1
- package/dist/client/assets/{category-editor-CnJqxifY.js → category-editor-C6GjoH9R.js} +1 -1
- package/dist/client/assets/{category-tree-D2ejZxYL.js → category-tree-XVjkohBB.js} +1 -1
- package/dist/client/assets/{chart-B2B-jcI-.js → chart-CzCK-tF-.js} +1 -1
- package/dist/client/assets/{chat-context-CiT7AzBS.js → chat-context-BLnGXGPp.js} +1 -1
- package/dist/client/assets/{chat-draft-BNZV2YjB.js → chat-draft-jC339CDY.js} +1 -1
- package/dist/client/assets/{checkbox-DSC8VbDf.js → checkbox-jFW417rg.js} +1 -1
- package/dist/client/assets/{choose-editor-uAW7DjQg.js → choose-editor-GJQxUyy8.js} +1 -1
- package/dist/client/assets/{cli-auth-success-B897Xynp.js → cli-auth-success-Bb87LPip.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-B4pAxgqZ.js → cms-settings-editor-C1h0m5Lx.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-CtClpzKs.js → cms-store-drafts-Bi9z0Tv5.js} +1 -1
- package/dist/client/assets/{collapsible-DrV9qsGN.js → collapsible-IkM9Ewzf.js} +1 -1
- package/dist/client/assets/{collection-detail-DucMHrT0.js → collection-detail-C0lp4GBi.js} +1 -1
- package/dist/client/assets/{collection-display-button-BHyM7wC2.js → collection-display-button-Cl_5d_nT.js} +1 -1
- package/dist/client/assets/{collection-search-BbCHAL7t.js → collection-search-bFfkZUb6.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BlLHObjj.js → collection-table-wrapper-B2jzfzUl.js} +1 -1
- package/dist/client/assets/{collection-tabs-BXeEDC1Y.js → collection-tabs-DEboaJXk.js} +1 -1
- package/dist/client/assets/{combobox-DugO3-8Q.js → combobox-CiGXUnCv.js} +1 -1
- package/dist/client/assets/{command-Bo6EGcaE.js → command-D_N7zpwy.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-CsXLIG2Z.js → companion-mcps-section-DNWssZd2.js} +1 -1
- package/dist/client/assets/{config-CdVwRL_a.js → config-giA1KgEi.js} +1 -1
- package/dist/client/assets/{connect-lufub1FU.js → connect-Dr03SpeZ.js} +1 -1
- package/dist/client/assets/{connect-key--cfk-fLm.js → connect-key-XfiSxoIE.js} +1 -1
- package/dist/client/assets/{connect-layout-BPppRISp.js → connect-layout-Bbat9hlH.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-CfsFTEbG.js → connect-source-dialog-B_9vLQS4.js} +1 -1
- package/dist/client/assets/{connection-BLQs5hMz.js → connection-C8CUAy7P.js} +1 -1
- package/dist/client/assets/{connection-card-vLs08dR6.js → connection-card-D_Uc1OoH.js} +1 -1
- package/dist/client/assets/{connection-detail-CLkPYY1x.js → connection-detail-BIDElD0e.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BSIh8Ep0.js → connection-form-helpers-DASQdNW4.js} +1 -1
- package/dist/client/assets/{connection-slug-CmPPcsjf.js → connection-slug-BywwM0Xb.js} +1 -1
- package/dist/client/assets/{connections-C4ZbA0RY.js → connections-CsGzxnL4.js} +1 -1
- package/dist/client/assets/{content-tab-C-pzFX10.js → content-tab-vWa8SHR9.js} +3 -3
- package/dist/client/assets/{context-3bSluoDN.js → context-DQAvq4o7.js} +1 -1
- package/dist/client/assets/{context-menu-CzIORBDb.js → context-menu-725S94S-.js} +1 -1
- package/dist/client/assets/{context-shell-3lL8N_R5.js → context-shell-DZVf-jmL.js} +3 -3
- package/dist/client/assets/{create-organization-dialog-k086v-9Q.js → create-organization-dialog-CQU8vsHz.js} +1 -1
- package/dist/client/assets/{daily-pulse-P6H0d8QI.js → daily-pulse-CzMff-et.js} +1 -1
- package/dist/client/assets/{delete-copy-BQaedVkX.js → delete-copy-tVwI6KKh.js} +1 -1
- package/dist/client/assets/{device-hint-CvnqGHIy.js → device-hint-BeggFfp6.js} +1 -1
- package/dist/client/assets/{discover-qzwfuJLu.js → discover-JRFPAUk3.js} +1 -1
- package/dist/client/assets/{domain-settings-y3u2iu2W.js → domain-settings-DqDImPS-.js} +1 -1
- package/dist/client/assets/{drawer-CarQd6Jb.js → drawer-BHd0Jra6.js} +1 -1
- package/dist/client/assets/{editor-DYk_2MJQ.js → editor-BYfzbACz.js} +1 -1
- package/dist/client/assets/{editor-classes-DVIoQu74.js → editor-classes-B97Owa1G.js} +1 -1
- package/dist/client/assets/{empty-message-C90DlePv.js → empty-message-CH3ICmuH.js} +1 -1
- package/dist/client/assets/{empty-state-XAK3RjVy.js → empty-state-BGUxoSrw.js} +1 -1
- package/dist/client/assets/{empty-state-B67nwURy.js → empty-state-BtNfctJt.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-D8ZqCESL.js → experiments-tab-choice-Cqk56o_2.js} +1 -1
- package/dist/client/assets/{extract-connection-data-D6CjTXbp.js → extract-connection-data-X90aKvel.js} +1 -1
- package/dist/client/assets/{feature-gate-CCvZeJRu.js → feature-gate-DZa9r59Q.js} +1 -1
- package/dist/client/assets/{feature-paywall-DzmzZ5s3.js → feature-paywall-B5dVUVm-.js} +1 -1
- package/dist/client/assets/{file-explorer-BqxAkXtr.js → file-explorer-CuqUmCvx.js} +1 -1
- package/dist/client/assets/{file-preview-C0yEEExh.js → file-preview-DxP6YCuS.js} +1 -1
- package/dist/client/assets/{file-share-button-CowSSkLB.js → file-share-button-DUiUmzDk.js} +1 -1
- package/dist/client/assets/{file-type-icon-CEP8k4gh.js → file-type-icon-CPmLjdw0.js} +1 -1
- package/dist/client/assets/{folder-icon-CmtFeppJ.js → folder-icon-UhsVAhlz.js} +1 -1
- package/dist/client/assets/{form-8GAe5FIZ.js → form-YdpHvMEe.js} +1 -1
- package/dist/client/assets/{frame-navigation-BpI5RQJq.js → frame-navigation-DjoSOUXB.js} +1 -1
- package/dist/client/assets/{gateway-client-BqPME1T5.js → gateway-client-BmjZ0joI.js} +1 -1
- package/dist/client/assets/{general-DbhKzHt5.js → general-Bt4D7jSJ.js} +1 -1
- package/dist/client/assets/{github-icon-BH4kK9If.js → github-icon-DBNhbuOq.js} +1 -1
- package/dist/client/assets/{held-block-view-MI6LUwjK.js → held-block-view-BPyv_Bj9.js} +1 -1
- package/dist/client/assets/{home-_NmLJi-9.js → home-BdEm6uTS.js} +1 -1
- package/dist/client/assets/{home-overview-CTEEkh3w.js → home-overview-CilZm22n.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-BbIfIwl1.js → hosted-reconcile-CACimEU-.js} +1 -1
- package/dist/client/assets/{icon-button-Dd8gTd4-.js → icon-button-BVEHdZYj.js} +1 -1
- package/dist/client/assets/{index-Do3hK3is.js → index-4hVIbVvu.js} +1 -1
- package/dist/client/assets/{index-C17JTAPe.js → index-BW7F0oP5.js} +1 -1
- package/dist/client/assets/{index-BRHz7VD8.js → index-Bg2cA5dN.js} +1 -1
- package/dist/client/assets/{index-km18CQ4q.js → index-Big5zxJQ.js} +1 -1
- package/dist/client/assets/{index-DClpdtOI.js → index-BwUztF-N.js} +1 -1
- package/dist/client/assets/{index-Dkr4Q9bE.js → index-C302vCyS.js} +1 -1
- package/dist/client/assets/{index-BY10zRfl.js → index-CN3SCz7U.js} +1 -1
- package/dist/client/assets/{index-CZQ-Wgjf.js → index-CaInDSB5.js} +1 -1
- package/dist/client/assets/{index-Dez-6rcd.js → index-CksQ7RxK.js} +1 -1
- package/dist/client/assets/{index-DIHnNoyA.js → index-CxRVhGQ4.js} +1 -1
- package/dist/client/assets/{index-CwntHk8S.js → index-D9poEv_S.js} +3 -3
- package/dist/client/assets/{index-CADsC-mK.js → index-DMMrJmQ3.js} +1 -1
- package/dist/client/assets/{index-DEOQXzn-.js → index-DMf-vAS9.js} +1 -1
- package/dist/client/assets/{index-B-OtHlgY.js → index-DdcawAy-.js} +1 -1
- package/dist/client/assets/{index-B_-z8Lrt.js → index-DfQA1GAT.js} +1 -1
- package/dist/client/assets/{index-DPCC7KEx.js → index-Qo4M3qMa.js} +1 -1
- package/dist/client/assets/{index-CYjM_f4V.js → index-hwrw3rkU.js} +1 -1
- package/dist/client/assets/{index-redirect-CTR6WNPG.js → index-redirect-DiL6wV_c.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DdeQTeaz.js → infiniteQueryObserver-CaEK8ONs.js} +1 -1
- package/dist/client/assets/{infra-billing-tXzfTwHJ.js → infra-billing-BCFp1gNE.js} +1 -1
- package/dist/client/assets/{input-DXyNd1dE.js → input-B9td9Urd.js} +1 -1
- package/dist/client/assets/{input-CxFJosPu.js → input-DP0rL1U_.js} +3 -3
- package/dist/client/assets/{integration-icon-BCAGJ22m.js → integration-icon-NqhVgI3n.js} +1 -1
- package/dist/client/assets/{item-actions-B4f3ZYnI.js → item-actions-BZytzuQ9.js} +1 -1
- package/dist/client/assets/{jira-icon-B0PrtQPW.js → jira-icon-CwYh2GFn.js} +1 -1
- package/dist/client/assets/{label-BFX3DXnu.js → label-BCYFBbIw.js} +1 -1
- package/dist/client/assets/{layout-GEd6141D.js → layout-CL42o1Yr.js} +1 -1
- package/dist/client/assets/{legacy-admin-welcome-dialog-CjbAHNU0.js → legacy-admin-welcome-dialog-CmqRv0HT.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-BRMRDtxS.js → legacy-agents-deep-BUyPXwwA.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-Cpcnm12P.js → legacy-main-redirect-D7vM0GiU.js} +1 -1
- package/dist/client/assets/library-otkiWlmc.js +1 -0
- package/dist/client/assets/{library-tab-DiZQg1qQ.js → library-tab-BEc6Pbwf.js} +1 -1
- package/dist/client/assets/{login-DUNIcOhP.js → login-CLuevGyf.js} +1 -1
- package/dist/client/assets/{markdown-sWsq0zMA.js → markdown-DYPhmlaF.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DSMzeo3v.js → mcp-app-renderer-Cs2iJUy6.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DFWIYz5V.js → mcp-oauth-C6Tisjqi.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Cal4irlG.js → mcp-oauth-CdZI7dfM.js} +1 -1
- package/dist/client/assets/{members-D9DcuyAK.js → members-BaALa9xH.js} +1 -1
- package/dist/client/assets/{memory-DYN3365K.js → memory-B2E3y0Yc.js} +1 -1
- package/dist/client/assets/{mock-board-llSJ1DSL.js → mock-board-Cu5T7-1Z.js} +3 -3
- package/dist/client/assets/{monaco-editor-4_N5zBDQ.js → monaco-editor-ISdNcoi4.js} +1 -1
- package/dist/client/assets/{monitoring-5YgUKCBd.js → monitoring-BV9cqhbn.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BCaHkQz9.js → monitoring-stats-row-ad45HV04.js} +1 -1
- package/dist/client/assets/{multi-select-B4K-daTY.js → multi-select-B4a4O5qC.js} +1 -1
- package/dist/client/assets/{mustache-B8t03rZ4.js → mustache-BocCKXOv.js} +1 -1
- package/dist/client/assets/{named-rule-step-P0BFUtVs.js → named-rule-step-CKkqw0jp.js} +1 -1
- package/dist/client/assets/{named-rule-view-CvRYAekO.js → named-rule-view-C3wI3Xnv.js} +1 -1
- package/dist/client/assets/{new-project-dialog-DI67z-Vr.js → new-project-dialog-tmPiPwbR.js} +1 -1
- package/dist/client/assets/{new-project-store-DoliA5Iq.js → new-project-store-RJXM205V.js} +1 -1
- package/dist/client/assets/{oauth-callback-DtdbhW3N.js → oauth-callback-ItNO54kB.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-iNwVQAC1.js → oauth-callback-ai-provider-Be18PCqq.js} +1 -1
- package/dist/client/assets/{oauth-consent-Co0jE424.js → oauth-consent--O6O8U3z.js} +1 -1
- package/dist/client/assets/{onboarding-Dn4ndntc.js → onboarding-Bt8NRajr.js} +1 -1
- package/dist/client/assets/{openai-conversation-D43N7JcR.js → openai-conversation-De66y8sD.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-PUKP14F8.js → optimistic-project-sidebar-views-CfFOXS7u.js} +1 -1
- package/dist/client/assets/{order-monitor-day-fHekYy64.js → order-monitor-day-CePGGrQl.js} +1 -1
- package/dist/client/assets/{organization-choice-Ctd80SL2.js → organization-choice-BREc4-rY.js} +1 -1
- package/dist/client/assets/{orgs-BQeWnD4l.js → orgs-BuZAVuUT.js} +1 -1
- package/dist/client/assets/{own-accounts-section-CwzdBIu0.js → own-accounts-section-yyVEvkX6.js} +1 -1
- package/dist/client/assets/{pair-Du2wOAPA.js → pair-CiXtBbbF.js} +1 -1
- package/dist/client/assets/{parse-sections-DUEfhNb0.js → parse-sections-WY1RJ27g.js} +2 -2
- package/dist/client/assets/{plan-BDh0er6r.js → plan-CTTUCOCf.js} +1 -1
- package/dist/client/assets/{plan-ladder-cJHOFEt_.js → plan-ladder-Dn5ZPJM9.js} +1 -1
- package/dist/client/assets/{plan-usage-card-DnCWaNBs.js → plan-usage-card-C5_KdZ2_.js} +1 -1
- package/dist/client/assets/{popover-XZWwzjJe.js → popover-CP-hSbhT.js} +1 -1
- package/dist/client/assets/{post-calendar-Cq2VElZ4.js → post-calendar-Be8qbnFE.js} +1 -1
- package/dist/client/assets/{post-editor-ChZHYnmE.js → post-editor-GBnt5Obn.js} +1 -1
- package/dist/client/assets/{preview-content-Ct9U0F_F.js → preview-content-CqyBoW0D.js} +1 -1
- package/dist/client/assets/{preview-dialog-BlN_MeAY.js → preview-dialog-CKevN11A.js} +1 -1
- package/dist/client/assets/{preview-panel-CMaIBxrS.js → preview-panel-BuQ4yGSo.js} +1 -1
- package/dist/client/assets/{preview-tab-rp6yyGU1.js → preview-tab-C-V2oAhZ.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-Cp5iroCv.js → product-picker-dialog-C-Bh-agz.js} +1 -1
- package/dist/client/assets/{profile-BvhSJiAV.js → profile-CI-BPtuo.js} +1 -1
- package/dist/client/assets/{project-app-view-BPtWGCfo.js → project-app-view-B_29oE4R.js} +1 -1
- package/dist/client/assets/{project-apps-CDSLxQ6C.js → project-apps-hjYt3L4J.js} +1 -1
- package/dist/client/assets/{project-icon-C_Qws_Ah.js → project-icon-CtK060oN.js} +1 -1
- package/dist/client/assets/{project-index-dmu51Z_5.js → project-index-rV1NSwrP.js} +1 -1
- package/dist/client/assets/project-reports-DkhAaibb.js +1 -0
- package/dist/client/assets/project-tasks-DxN-rhsH.js +1 -0
- package/dist/client/assets/{projects-9cB_xTYP.js → projects-BaH2HGg3.js} +1 -1
- package/dist/client/assets/{projects-empty-state-ZoaV8gjs.js → projects-empty-state-COghPAu-.js} +1 -1
- package/dist/client/assets/{prompts-DfPwtsSz.js → prompts-DpolCk2C.js} +1 -1
- package/dist/client/assets/record-editor-CgyNKdK4.js +1 -0
- package/dist/client/assets/{redirect-editor-DmgDoBZW.js → redirect-editor-rDQg8ffs.js} +1 -1
- package/dist/client/assets/{reports-B7Mq5ojT.js → reports-BaxCffzc.js} +1 -1
- package/dist/client/assets/reports-Bl1YOFp5.js +1 -0
- package/dist/client/assets/{reports-onboarding-DnVjGniS.js → reports-onboarding-BejwYIRj.js} +1 -1
- package/dist/client/assets/{reports-tab-D7WrLBuD.js → reports-tab-D7-ZHRK_.js} +2 -2
- package/dist/client/assets/repositories-BD9AiItp.js +1 -0
- package/dist/client/assets/{repositories-B6qJORdw.js → repositories-DjySXVoQ.js} +1 -1
- package/dist/client/assets/{repository-binding-Cqb4hBI0.js → repository-binding-DnDGprHj.js} +1 -1
- package/dist/client/assets/{repository-picker-B967M4cj.js → repository-picker-CoyA5imt.js} +1 -1
- package/dist/client/assets/{require-capability-CnRgBqvn.js → require-capability-BcPRJVcD.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DwZV69de.js → required-auth-layout-DDlu3UJb.js} +1 -1
- package/dist/client/assets/{reset-password-DBlLRH7P.js → reset-password-BJJQZMwh.js} +1 -1
- package/dist/client/assets/{resizable-Ddu9Pik_.js → resizable-p6SPDaRS.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-C5v6XuFJ.js → resolve-tab-icon-BdVF5ixR.js} +1 -1
- package/dist/client/assets/{review-settings-_NtVHX9D.js → review-settings-BmsFMrpA.js} +1 -1
- package/dist/client/assets/{role-color-CYCY1ZHM.js → role-color-Csw3CmY5.js} +1 -1
- package/dist/client/assets/{roles-BOIysbZW.js → roles-BUQWm2PB.js} +1 -1
- package/dist/client/assets/{route-B2eUAr3E.js → route-Bb6Jc2uw.js} +1 -1
- package/dist/client/assets/route-D373Xcd2.js +1 -0
- package/dist/client/assets/{route-page-header-x4fiBRQK.js → route-page-header-BHWZyk8y.js} +1 -1
- package/dist/client/assets/{route-DjNFlT9m.js → route-xEKNDBRl.js} +1 -1
- package/dist/client/assets/{sandbox-git-api-CX3IYPAX.js → sandbox-git-api-Bi9RvPsJ.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-CsmYXarj.js → sandbox-lifecycle-context-C4V1kqms.js} +1 -1
- package/dist/client/assets/{save-status-DM-afM9Q.js → save-status-CbKB2tgB.js} +1 -1
- package/dist/client/assets/{schema-Bh0CFZUA.js → schema-DH1Yp9e9.js} +1 -1
- package/dist/client/assets/{schema-CsGAsuNy.js → schema-ur1hUUl7.js} +1 -1
- package/dist/client/assets/{scroll-area-DkuLv9J_.js → scroll-area-Od2oOAKa.js} +1 -1
- package/dist/client/assets/{search-input-Yj0UUhbr.js → search-input-CAfR6Gbn.js} +1 -1
- package/dist/client/assets/{search-toggle-CTqn74j5.js → search-toggle-CUVCbHGs.js} +1 -1
- package/dist/client/assets/{secret-picker-FNSDTzDT.js → secret-picker-DM8sNXWg.js} +1 -1
- package/dist/client/assets/{secrets-DnkJAwly.js → secrets-C6Drbexb.js} +1 -1
- package/dist/client/assets/{section-array-field-DbmoEjb3.js → section-array-field-BreHGIvy.js} +1 -1
- package/dist/client/assets/{sections-Bk5O8laV.js → sections-BVtQLv-b.js} +1 -1
- package/dist/client/assets/{sections-editor-BYa3JqlT.js → sections-editor-IaZ-F2EE.js} +1 -1
- package/dist/client/assets/{select-DqZVtjvu.js → select-DbziOf0e.js} +1 -1
- package/dist/client/assets/{select-model-D_3F7ch9.js → select-model-D7lvbmbp.js} +1 -1
- package/dist/client/assets/{seo-editor-alLFkZ3V.js → seo-editor-DGJ2myhV.js} +1 -1
- package/dist/client/assets/{separator-DOH2DVT3.js → separator-DCZYVGqN.js} +1 -1
- package/dist/client/assets/{session-runtime-DaEm9VzJ.js → session-runtime-D87un1xV.js} +1 -1
- package/dist/client/assets/settings-tab-ukKpNwn1.js +1 -0
- package/dist/client/assets/{sheet-B3BCtfXu.js → sheet-DCU86hqn.js} +1 -1
- package/dist/client/assets/{shell-layout-BMy93BCc.js → shell-layout-DhXO3kdV.js} +1 -1
- package/dist/client/assets/{site-draft-actions-C2zLtAMz.js → site-draft-actions-BoCCfw5y.js} +1 -1
- package/dist/client/assets/{site-draft-view-ikG8CMuB.js → site-draft-view-B7wPj61X.js} +1 -1
- package/dist/client/assets/site-editor-BAKS5237.js +1 -0
- package/dist/client/assets/{site-editor-toast-GAJZE2A0.js → site-editor-toast-BEmWExuz.js} +1 -1
- package/dist/client/assets/{skills-dIhMA0Ze.js → skills-B3F1746i.js} +1 -1
- package/dist/client/assets/{slider-DirLi5JL.js → slider-DX6aptUe.js} +1 -1
- package/dist/client/assets/{sortable.esm-B3zbNG6q.js → sortable.esm-YJOEuS_v.js} +1 -1
- package/dist/client/assets/{sso-tZNmyRgp.js → sso-D0XXTIV_.js} +1 -1
- package/dist/client/assets/{suggestion-bCd1m59t.js → suggestion-DrTYv82A.js} +1 -1
- package/dist/client/assets/{super-agent-icon-AJ6ZRe5V.js → super-agent-icon-Cnp5uAFQ.js} +1 -1
- package/dist/client/assets/{switch-BviC1co2.js → switch-DwFzcsns.js} +1 -1
- package/dist/client/assets/{synced-repos-DsEdkMaA.js → synced-repos-caTE6jNz.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-DkjrfS6l.js → tab-icon-glyph-DU1L4T-q.js} +1 -1
- package/dist/client/assets/{table-DX15DDx1.js → table-DSVromj4.js} +1 -1
- package/dist/client/assets/{tabs-BiFBpWbA.js → tabs-DNtYd_FL.js} +1 -1
- package/dist/client/assets/{task-board-DD2iUGL4.js → task-board-S28SxUs0.js} +1 -1
- package/dist/client/assets/{task-key-DP7js_2-.js → task-key-CXYVACcD.js} +1 -1
- package/dist/client/assets/{task-route-Bfb6XWlb.js → task-route-CSEPljWs.js} +1 -1
- package/dist/client/assets/{task-status-CBWakThc.js → task-status-BaHeMzhD.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-B5XiM0gZ.js → taskboard-analytics-BbIrzNe4.js} +1 -1
- package/dist/client/assets/{tasks-BPwrQv5-.js → tasks-Dfzb6Qu5.js} +1 -1
- package/dist/client/assets/tasks-DyhjZTVk.js +1 -0
- package/dist/client/assets/{textarea-BoSVR1xB.js → textarea-CUxYZmtB.js} +1 -1
- package/dist/client/assets/{thread-analytics-B3wSdPFK.js → thread-analytics-BW-e5YjI.js} +1 -1
- package/dist/client/assets/{thread-button-CIHD7120.js → thread-button-B-htK7Vf.js} +1 -1
- package/dist/client/assets/{thread-intent-DpzwhK2y.js → thread-intent-DHr3JStM.js} +1 -1
- package/dist/client/assets/{thread-route-Bdw4g7Hg.js → thread-route-DXN_3XgT.js} +1 -1
- package/dist/client/assets/{thread-route-D4mea9ep.js → thread-route-O2mpxOLc.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-C1_HCALD.js → thread-sheet-body-FVjAMKlq.js} +1 -1
- package/dist/client/assets/{time-range-picker-B9_5lQqT.js → time-range-picker-jFkw6TGI.js} +1 -1
- package/dist/client/assets/{toggle-group-l7lV2Oqp.js → toggle-group-7Kk4-ob3.js} +1 -1
- package/dist/client/assets/{tool-set-selector-BQISxiF9.js → tool-set-selector-DZKptQot.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CflJ2Qid.js → toolbar-icon-button-DeWs4WCs.js} +1 -1
- package/dist/client/assets/{tooltip-BTd3W-2Z.js → tooltip-BEauahba.js} +1 -1
- package/dist/client/assets/{tooltipContext-De8eALzu.js → tooltipContext-BSzAb1Kl.js} +1 -1
- package/dist/client/assets/{track-BBHYiJkY.js → track-098xAr1a.js} +1 -1
- package/dist/client/assets/{types-C8b3acwX.js → types-Dw1-yAGJ.js} +1 -1
- package/dist/client/assets/{url-slug-gNlq1cKV.js → url-slug-CauSsJ0r.js} +1 -1
- package/dist/client/assets/{usage-stats-Bk_1jh1-.js → usage-stats-C3riqRUR.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Cya2RotC.js → use-ai-providers-CV6RttZq.js} +1 -1
- package/dist/client/assets/{use-api-keys-BdlPKuv4.js → use-api-keys-C_NdcoOi.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-CcoLpt-_.js → use-apply-named-rule-CqD-eMBs.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-CnUh1VzW.js +1 -0
- package/dist/client/assets/{use-automations-CerQ9Qaj.js → use-automations-Bj-0uEbO.js} +1 -1
- package/dist/client/assets/{use-autosave-CQa7WbXM.js → use-autosave-CPGuRk2l.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-CIRMr5RK.js +1 -0
- package/dist/client/assets/use-blog-view-BD--oPX4.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-CWt5k1nY.js → use-chat-layout-state-CAyGUasr.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-7QluCfa8.js → use-cms-publish-actions-S499FS9c.js} +1 -1
- package/dist/client/assets/{use-connect-companion-B8Oqj7MQ.js → use-connect-companion-CY2Jhm-O.js} +1 -1
- package/dist/client/assets/{use-connection-2s3z_IKD.js → use-connection-Bbf6g-lU.js} +1 -1
- package/dist/client/assets/{use-content-sync-DxzP8nN9.js → use-content-sync-36WIXZeF.js} +1 -1
- package/dist/client/assets/{use-copy-sOY8Yuot.js → use-copy-CLhCSJsi.js} +1 -1
- package/dist/client/assets/{use-current-view-EjRzX02x.js → use-current-view-DPlgL3Qy.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-DjDbgiCF.js → use-date-fns-locale-CaaCuDu_.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave--lHIRoNY.js → use-debounced-autosave-DSyr3ji1.js} +1 -1
- package/dist/client/assets/{use-debounced-value-RJW46-1q.js → use-debounced-value-DcMmpwkI.js} +1 -1
- package/dist/client/assets/{use-deco-credits-d4Nbb0l0.js → use-deco-credits-C3HRZZ9R.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BGpwG8Pb.js → use-decopilot-events-CjaQwgdu.js} +1 -1
- package/dist/client/assets/{use-delete-block-BR5smTsV.js → use-delete-block-SgRzkXSC.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DHkW3H9t.js → use-delete-connection-BRCngTFL.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-j92yIioi.js → use-deployment-admin-BLj_HET-.js} +1 -1
- package/dist/client/assets/{use-entitlements-DtyegfyM.js → use-entitlements-DFIFwphq.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-B4HFa9pK.js → use-fast-preview-draft-url-DkfO7kpa.js} +1 -1
- package/dist/client/assets/{use-file-configs-CzyibAGV.js → use-file-configs-BQgzQxDR.js} +1 -1
- package/dist/client/assets/{use-id-selection-DSQKok9P.js → use-id-selection-DVqj6GHl.js} +1 -1
- package/dist/client/assets/{use-in-settings-DLJEfljS.js → use-in-settings-CeajORvg.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-BNnBKFlA.js → use-inbox-feed-BlDTr6Lw.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-D1tYrKq7.js → use-infinite-scroll-BtlabLXL.js} +1 -1
- package/dist/client/assets/{use-join-requests-CSjMfH5p.js → use-join-requests-BS3z5J_a.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-CllMGKzI.js → use-main-panel-tabs-BAhbR3ff.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DS0pbV57.js → use-mcp-auth-status-DQPqhHIm.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Cvc3WWPF.js → use-mcp-client-DUKo5caa.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Ck1uv43A.js → use-mcp-prompts-92SLArS_.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BIzewITl.js → use-mcp-tools-qCHBmr6_.js} +1 -1
- package/dist/client/assets/{use-mobile-CG2XwDbe.js → use-mobile-CwwSZrIf.js} +1 -1
- package/dist/client/assets/{use-move-blocks-Dv6zyDyx.js → use-move-blocks-DKQg1wdr.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BFBISUMc.js → use-navigate-to-agent-BcceyDj5.js} +1 -1
- package/dist/client/assets/{use-never-published-D3zJmakm.js → use-never-published-rNVNFzx6.js} +1 -1
- package/dist/client/assets/{use-org-fs-BfE7L8cf.js → use-org-fs-ChCg0GqS.js} +1 -1
- package/dist/client/assets/{use-org-notice-DghJzmC_.js → use-org-notice-Fc3F28TT.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CU3MGWk9.js → use-org-repo-syncs-DzvaTNMY.js} +1 -1
- package/dist/client/assets/{use-org-sso-C8BMUr72.js → use-org-sso-CLb0Ca9G.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Ddjh427l.js → use-organization-settings-eZ0X29xl.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-V2MXWXLu.js → use-panel-navigate-CWTvXMgS.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-EdJBeOw9.js → use-project-native-view-presence-BGo9wHxi.js} +1 -1
- package/dist/client/assets/{use-project-scope-COzEo5Zz.js → use-project-scope-DFLIrTST.js} +1 -1
- package/dist/client/assets/{use-recent-apps-BpR_nbgz.js → use-recent-apps-ikKC1oeZ.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-DYf7sFCj.js → use-reports-diagnostic-BUw8-WPG.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-cbWqZuIm.js → use-sandbox-events-lKDZ1Wyg.js} +1 -1
- package/dist/client/assets/{use-secrets-BamKWPUs.js → use-secrets-BhtMJX_Y.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-Cy_X_Jjl.js → use-section-preview-base-DtVYSJMh.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-CGkkkrTj.js → use-sidebar-collapsed-mYa34tIq.js} +1 -1
- package/dist/client/assets/{use-tags-staoqXQp.js → use-tags-ixaLqIix.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-C5Dsg-uV.js → use-task-board-analytics-BxetW7cJ.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-DsFjq28v.js → use-task-board-item-prs-BwV_XfKn.js} +1 -1
- package/dist/client/assets/{use-task-board-items-OgSDu-ag.js → use-task-board-items-DDIJt2ov.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-Bn4-yS6Z.js → use-task-board-prompts-zNd0qYQN.js} +1 -1
- package/dist/client/assets/{use-task-metadata-Bc8o5Sts.js → use-task-metadata-CNDyuNbK.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-Co5bznxQ.js → use-thread-outputs-DAKjQ5Pu.js} +1 -1
- package/dist/client/assets/{use-view-draft-kind-BdwsMdex.js → use-view-draft-kind-TCEqZWio.js} +1 -1
- package/dist/client/assets/{use-voice-input-CwLNuWlo.js → use-voice-input-fhkEdy7b.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CA_opHOs.js +1 -0
- package/dist/client/assets/{useQueries-BjVZ4kPO.js → useQueries-CTvQGMKH.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BN1c7Ych.js +1 -0
- package/dist/client/assets/{users-CPRHIyd2.js → users-CBKWRxCU.js} +1 -1
- package/dist/client/assets/{utils-DPEBLDgi.js → utils-DHHEaoAA.js} +1 -1
- package/dist/client/assets/{variant-calendar-Dlw46bNO.js → variant-calendar-BLXNK5ej.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-ChW3ijK5.js → variant-matcher-override-DzGrqs7q.js} +1 -1
- package/dist/client/assets/{view-header-D4oknAV1.js → view-header-1myD_Wkk.js} +1 -1
- package/dist/client/assets/{virtual-mcp-nhrh3mtw.js → virtual-mcp-Cmf0LAEo.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-CTgVk3NA.js → watch-sse-pool-ClMPSfwQ.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +30 -30
- package/dist/server/migrate-dbos.js +2 -2
- package/dist/server/migrate.js +125 -125
- package/dist/server/server.js +528 -528
- package/package.json +1 -1
- package/dist/client/assets/agent-app-ZmiqpLI8.js +0 -1
- package/dist/client/assets/agent-deck-DLJ_JEHY.js +0 -1
- package/dist/client/assets/agent-experiments-CC4vS2Ak.js +0 -1
- package/dist/client/assets/agent-file-DaY3pEIy.js +0 -1
- package/dist/client/assets/agent-library-53yJ_N0C.js +0 -1
- package/dist/client/assets/agent-library-file-CmdRdcgJ.js +0 -1
- package/dist/client/assets/agent-overview-Bjahi54k.js +0 -1
- package/dist/client/assets/agent-settings-Bmfo6yEF.js +0 -1
- package/dist/client/assets/agent-site-editor-code-BzQzaZAE.js +0 -2
- package/dist/client/assets/agent-site-editor-content-D03NaTwn.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-wStmeJD1.js +0 -1
- package/dist/client/assets/agent-view-Dh2W4gDj.js +0 -1
- package/dist/client/assets/api-keys-C8ArQ5p_.js +0 -1
- package/dist/client/assets/library-GlSV21no.js +0 -1
- package/dist/client/assets/project-reports-BVUPVqwF.js +0 -1
- package/dist/client/assets/project-tasks-i5QwXcB1.js +0 -1
- package/dist/client/assets/record-editor-BQX3fl3B.js +0 -1
- package/dist/client/assets/reports-Dmcxcdt8.js +0 -1
- package/dist/client/assets/repositories-CKo-J8oc.js +0 -1
- package/dist/client/assets/route-l3dfZAcw.js +0 -1
- package/dist/client/assets/settings-tab-Dnn9Ngte.js +0 -1
- package/dist/client/assets/site-editor-B8VlT5Kv.js +0 -1
- package/dist/client/assets/tasks-ip1BqsyR.js +0 -1
- package/dist/client/assets/use-ask-in-chat-B_ARVX9A.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-BedqZgtc.js +0 -1
- package/dist/client/assets/use-blog-view-9s3Vkx1q.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BagPKS5m.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BUmkwIx5.js +0 -1
package/dist/client/assets/{site-draft-actions-C2zLtAMz.js → site-draft-actions-BoCCfw5y.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as I,b as ge,r as U,j as r,B as be,m as G,K as gs,al as Ka,t as rt,eL as qa,as as Pr,dL as kr,Y as fs,dM as Ha,aH as Ss,aI as Ns,aJ as Cs,aK as Gs,b7 as Ws,aL as As,aM as Rs,aN as Ds,X as en,Z as tn,_ as sn,a as nn,a4 as Bs,bY as Va,h as ms,eM as Sr,eN as Pn,bx as Ga,bm as Wa,br as Xn,eO as Qa,eP as Ja,am as Ya,I as Xa,a7 as Za,eQ as el,V as Nr,i as bt,eI as kn,q as Cr,J as Ar,D as Rr,x as Dr,v as Tr,Q as Br,R as Ir,aV as tl,b8 as $r,a5 as Sn,b4 as Nn,e as Zn,E as sl,T as nl}from"./index-CwntHk8S.js";import{S as rl}from"./separator-DOH2DVT3.js";import{f as al,u as xs,r as Fr,l as Lr,c as Or,b as ll}from"./chat-context-CiT7AzBS.js";import{u as Ot,a8 as il,a9 as Mr,aa as Er,c as Cn,b as An,N as Rn,ab as ol,M as cl,ac as dl,v as Dn,U as _r,ad as ul,H as hl,ae as fl,af as ml,g as zr}from"./site-editor-toast-GAJZE2A0.js";import{L as pl}from"./use-org-notice-DghJzmC_.js";import{I as Ur}from"./toolbar-icon-button-CflJ2Qid.js";import{b as bl,P as gl,a as xl}from"./popover-XZWwzjJe.js";import{c as at,T as lt,a as it,b as rn}from"./tooltip-BTd3W-2Z.js";import{f as vl,a as yl,c as jl,C as er,e as tr,b as sr}from"./command-Bo6EGcaE.js";import{T as Ft,a as Kr,b as qr}from"./tabs-BiFBpWbA.js";import{t as Hr}from"./ChevronDown-Kpzb5_P-.js";import{b as wl}from"./UserCheck01-DVOI9Qq6.js";import{K as Vr,ab as an,a as Gr,F as Pl,b as kl,ac as Wr}from"./agent-icon-DE4TWlDl.js";import{a as Qr}from"./SwitchHorizontal01-BbD-SqO6.js";import{b as Jr}from"./Tool01-DOjdBvJ6.js";import{s as Yr}from"./Plus-C8Idvwpa.js";import{s as ln}from"./Trash01-BRIjyxCC.js";import{d as qs,e as Sl,s as Ms,f as Xr,u as Zr,n as Nl,g as Cl}from"./use-view-draft-kind-BdwsMdex.js";import{u as Tn}from"./use-blog-view-9s3Vkx1q.js";import{u as vs}from"./use-voice-input-CwLNuWlo.js";import{b as Al,d as ea}from"./session-runtime-DaEm9VzJ.js";import{h as ta,r as sa,b as Is,g as Rl,e as Ee,f as na}from"./repository-binding-Cqb4hBI0.js";import{u as Dl}from"./use-debounced-value-RJW46-1q.js";import{a as Tl,u as Bl}from"./shell-layout-BMy93BCc.js";import{u as Il}from"./useInfiniteQuery-BagPKS5m.js";import{d as $l,b as Fl,p as Ll,e as ra,g as aa,h as la}from"./use-navigate-to-agent-BFBISUMc.js";import{u as on,n as ks,b as ia,a as Ol,c as Ml,d as El,r as Ps,g as _l,s as zl,e as Es,f as Ul}from"./cms-store-drafts-CtClpzKs.js";import{e as Kl,g as ql,f as Bn}from"./thread-intent-DpzwhK2y.js";import{a as Qs}from"./virtual-mcp-nhrh3mtw.js";import{u as In}from"./use-blocks-v8-project-BedqZgtc.js";import{G as oa}from"./github-icon-BH4kK9If.js";import{k as Hl,r as Vl,c as ca,u as Gl}from"./use-sandbox-events-cbWqZuIm.js";import{a as Wl,b as Ql}from"./use-fast-preview-draft-url-B4HFa9pK.js";import{a3 as us,a4 as da,z as Js,o as $n,a5 as Jl,a6 as Yl,E as Xl,a7 as Zl,a8 as ei,p as ti,W as Ct,f as Fn,a9 as si}from"./blocks-tab-states-GP0NCNYs.js";import"./index-DClpdtOI.js";import{T as ni}from"./textarea-BoSVR1xB.js";import{i as Ln}from"./CheckCircle-WpYwhp7A.js";import{s as Ys}from"./Eye-BeTcpGN-.js";import{n as ri,s as ai,C as li,a as ii,b as oi,M as ci,c as di,d as ui,m as hi,u as fi}from"./use-cms-publish-actions-7QluCfa8.js";import{a as mi,h as pi}from"./UserSquare-CRBGeews.js";import{i as On,b as Mn,m as bi,h as gi,c as ua,f as ha,d as xi,r as En,e as vi,n as yi,g as ji,j as wi,k as Pi,l as _n,o as ki,p as fa,q as Si,s as zn,B as Ni,t as hn}from"./sandbox-git-api-CX3IYPAX.js";import{a as Ci,g as Ai}from"./utils-DPEBLDgi.js";import{i as Ri}from"./Monitor01-ZIydqkip.js";import{w as Un,R as ma}from"./device-hint-CvnqGHIy.js";import{w as nr}from"./editor-DYk_2MJQ.js";import{i as Di,C as Ti}from"./section-array-field-DbmoEjb3.js";import{T as Bi,a as rr}from"./toggle-group-l7lV2Oqp.js";import{s as pa}from"./save-changes-debug-nBi-n9eV.js";import{u as Ii}from"./use-mcp-client-Cvc3WWPF.js";import{t as $i}from"./Minimize01-Dylk6LHz.js";import{b as Fi,a as Li}from"./sandbox-lifecycle-context-CsmYXarj.js";import{b as Oi}from"./agent-capabilities-COfZW6Pr.js";import{c as Mi}from"./thread-route-Bdw4g7Hg.js";function Ei(t){const{value:e,baseBranch:s,releases:a,baseIsDraft:n=!1,storeDrafts:o=[]}=t,d=!n&&!!e&&e===s,l=a.find(c=>c.branch===e),i=d||l?void 0:o.find(c=>c.name===e),u=!d&&!l&&!i&&!!e;return i?{isBase:d,current:l,storeDraft:i,unlisted:u}:{isBase:d,current:l,unlisted:u}}const _i={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "},ar=1114111;function lr(t){return t?t.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(e,s)=>{if(s.startsWith("#x")||s.startsWith("#X")){const a=Number.parseInt(s.slice(2),16);return!Number.isFinite(a)||a>ar?e:String.fromCodePoint(a)}if(s.startsWith("#")){const a=Number.parseInt(s.slice(1),10);return!Number.isFinite(a)||a>ar?e:String.fromCodePoint(a)}return _i[s]??e}):""}function zi(t){const e=I.c(39),{url:s,onSave:a}=t,n=ge(),[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 u;e[2]!==a||e[3]!==i?(u=()=>a(i?Al(i):null),e[2]=a,e[3]=i,e[4]=u):u=e[4];const c=u;let h;e[5]!==n?(h=n("thread.branchPicker.localHint"),e[5]=n,e[6]=h):h=e[6];let p;e[7]!==h?(p=r.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[7]=h,e[8]=p):p=e[8];let b;e[9]!==n?(b=n("thread.branchPicker.localUrlLabel"),e[9]=n,e[10]=b):b=e[10];let f;e[11]!==n?(f=n("thread.branchPicker.localUrlPlaceholder"),e[11]=n,e[12]=f):f=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=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=r.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]!==a||e[23]!==n||e[24]!==s?(j=s?r.jsx(be,{variant:"ghost",size:"sm",className:"text-xs text-destructive hover:text-destructive",onClick:()=>a(null),children:n("thread.branchPicker.localTurnOff")}):r.jsx("span",{}),e[22]=a,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=r.jsx(be,{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=r.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=r.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 Ui(t){const e=I.c(8),{virtualMcpId:s,branch:a,serve:n,rowRef:o,onPicked:d}=t,l=Ot(s,a),i=!!n.connection,u=i&&l.kind==="protocol"&&l.source==="local";let c;e[0]!==d||e[1]!==n?(c=()=>Ki(n,d),e[0]=d,e[1]=n,e[2]=c):c=e[2];let h;return e[3]!==o||e[4]!==i||e[5]!==u||e[6]!==c?(h=r.jsx(qi,{rowRef:o,selected:i,connected:u,onSelect:c}),e[3]=o,e[4]=i,e[5]=u,e[6]=c,e[7]=h):h=e[7],h}function Ki(t,e){e?.(),!t.connection&&t.set({endpoint:t.lastEndpoint??il})}function qi(t){const e=I.c(19),{rowRef:s,selected:a,connected:n,onSelect:o}=t,d=ge(),l=a?"bg-accent":"hover:bg-accent";let i;e[0]!==l?(i=G("flex rounded-lg",l),e[0]=l,e[1]=i):i=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=r.jsx("span",{"data-testid":"localhost-dot",className:"h-2 w-2 shrink-0 rounded-full bg-foreground"}),e[2]=u):u=e[2];let c;e[3]!==d?(c=d("thread.branchPicker.localhost.label"),e[3]=d,e[4]=c):c=e[4];let h;e[5]!==c?(h=r.jsx("span",{className:"min-w-0 flex-1 truncate",children:c}),e[5]=c,e[6]=h):h=e[6];let p;e[7]!==n||e[8]!==d?(p=n&&r.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]!==a||e[12]!==h||e[13]!==p?(b=r.jsxs("button",{type:"button","aria-pressed":a,onClick:o,className:"flex w-full min-w-0 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[u,h,p]}),e[10]=o,e[11]=a,e[12]=h,e[13]=p,e[14]=b):b=e[14];let f;return e[15]!==s||e[16]!==i||e[17]!==b?(f=r.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 Hi=10080*60*1e3;function Vi({sandboxMap:t,userId:e,rawBranches:s,now:a}){const n=new Map;for(const[h,p]of Object.entries(t??{}))for(const[b,f]of Object.entries(p??{})){let m=n.get(b);m||(m={userIds:new Set,lastActiveAt:0},n.set(b,m)),m.userIds.add(h);for(const g of Object.values(f??{})){const v=g?.createdAt??0;v>m.lastActiveAt&&(m.lastActiveAt=v)}}const o=a-Hi,d=[...n.entries()].filter(([,h])=>h.lastActiveAt>=o).sort((h,p)=>p[1].lastActiveAt-h[1].lastActiveAt).map(([h,p])=>({name:h,source:"recent",contributors:[...p.userIds],lastActiveAt:p.lastActiveAt})),l=new Set(d.map(h=>h.name)),i=new Set(Object.keys(t?.[e]??{})),u=[...i].filter(h=>!l.has(h)).sort().map(h=>({name:h,source:"yours"})),c=s.filter(h=>!i.has(h.name)&&!l.has(h.name)).map(h=>({name:h.name,source:"other",author:h.author??null}));return{recent:d,yours:u,others:c}}const Gi=100,Wi=50,Qi=300;function xn(t,e){const s=e.trim().toLowerCase();return s?t.toLowerCase().includes(s):!0}function Ji(t){const e=I.c(39),{orgId:s,orgSlug:a,userId:n,target:o,sandboxMap:d,owner:l,repo:i,search:u,enabled:c}=t,h=u===void 0?"":u,p=c===void 0?!0:c;let b;e[0]!==h?(b=h.trim(),e[0]=h,e[1]=b):b=e[1];const f=b,m=Dl(f,Qi);let g;e[2]!==o?(g=ta(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]!==a||e[7]!==l||e[8]!==i||e[9]!==o?(w=gs.githubBranchSearch(s,a,sa(o),l,i,m),e[4]=m,e[5]=s,e[6]=a,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]!==a||e[13]!==o?(P=$=>{const{pageParam:ee}=$;return Ka(a,"REPOSITORY_SEARCH_BRANCHES",{...o,query:m,limit:m?Wi:Gi,cursor:ee})},e[11]=m,e[12]=a,e[13]=o,e[14]=P):P=e[14];let y;e[15]!==m?(y=$=>m?void 0:$.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:k,isFetching:D,hasNextPage:S,isFetchingNextPage:O,fetchNextPage:B}=Il(N),T=j&&(m!==f||D),F=(C?.pages??[]).flatMap(Yi),L=Tl(6e4),W=Vi({sandboxMap:d,userId:n,rawBranches:F,now:L});let q;e[22]!==f?(q=$=>xn($.name,f),e[22]=f,e[23]=q):q=e[23];const X=W.recent.filter(q);let M;e[24]!==f?(M=$=>xn($.name,f),e[24]=f,e[25]=M):M=e[25];const H=W.yours.filter(M),J=W.others,ne=C?.pages[0],Q=j&&ne&&!T?Math.max(0,ne.totalCount-ne.branches.length):0,he=!j&&S;let Z;e[26]!==B?(Z=()=>{B()},e[26]=B,e[27]=Z):Z=e[27];let re;return e[28]!==Q||e[29]!==k||e[30]!==O||e[31]!==A||e[32]!==T||e[33]!==J||e[34]!==X||e[35]!==he||e[36]!==Z||e[37]!==H?(re={recent:X,yours:H,others:J,isLoading:A,isError:k,isSearching:T,hiddenMatchCount:Q,hasMore:he,isFetchingMore:O,fetchMore:Z},e[28]=Q,e[29]=k,e[30]=O,e[31]=A,e[32]=T,e[33]=J,e[34]=X,e[35]=he,e[36]=Z,e[37]=H,e[38]=re):re=e[38],re}function Yi(t){return t.branches}function Xi(t){const e=I.c(8),s=ge(),{releases:a,createRelease:n}=on(t.virtualMcpId),o=Is(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]!==a||e[6]!==s?(d=()=>{if(a.length>=Qs)return rt.error(s("thread.branchPicker.capReached",{max:Qs})),null;const l=t.kind==="blog"?Kl(t.userLabel):ql(t.userLabel);return n({branch:l,name:ia(a,s(qs(l))),color:ks(a.length),createdBy:t.userId,createdAt:new Date().toISOString(),...o?{runtime:ea(o.metadata)}:{}}).catch(i=>{rt.error(s("thread.branchPicker.saveError"),{description:Mr(s,Er(i))})}),l},e[0]=n,e[1]=t.kind,e[2]=t.userId,e[3]=t.userLabel,e[4]=o,e[5]=a,e[6]=s,e[7]=d):d=e[7],d}const Xs="-mx-[3px] h-3.5 w-3.5 shrink-0";function Zi(t){const e=I.c(120),{virtualMcpId:s,isV8:a,userLabel:n,value:o,baseBranch:d,baseIsDraft:l,orgId:i,orgSlug:u,userId:c,target:h,owner:p,repo:b,sandboxMap:f,onChange:m,onCreateBranch:g,onAdoptBranch:v,disabled:j,spawnsNewChat:w,placement:x,draftKind:P}=t,y=a===void 0?!1:a,N=l===void 0?!1:l,C=j===void 0?!1:j,A=w===void 0?!1:w,k=x===void 0?"chat":x,D=P===void 0?"site":P,S=ge(),B=Tn()?D:null,T=k==="header",[F,L]=U.useState(!1),[W,q]=U.useState(!1),[X,M]=U.useState("branches"),[H,J]=U.useState(null),[ne,Q]=U.useState(""),[he,Z]=U.useState(null),[re,$]=U.useState(null),ee=U.useRef(null),{releases:K,createRelease:te,renameRelease:se,deleteRelease:Pe}=on(s),ae=B??void 0;let ie;e[0]!==ae||e[1]!==c||e[2]!==n||e[3]!==s?(ie={virtualMcpId:s,userLabel:n,userId:c,kind:ae},e[0]=ae,e[1]=c,e[2]=n,e[3]=s,e[4]=ie):ie=e[4];const de=Xi(ie),{projectDefault:oe}=vs(s);let z;e[5]!==oe?(z=R=>Ul(R,oe)==="sandbox",e[5]=oe,e[6]=z):z=e[6];const fe=z,ke=Ol(s,y),me=y?Ml(K,ke.data):[],Y=ke.refetch,E=El(s),{url:ce,setUrl:Ie,clear:Qe}=Cn(s),Se=An(s),gt=y&&!!Se.connection,Je=y?Se.connection?.endpoint??null:ce,ve=!!Je;let xe;e[7]!==Qe||e[8]!==y||e[9]!==Se?(xe=()=>{Qe(),y&&Se.clear()},e[7]=Qe,e[8]=y,e[9]=Se,e[10]=xe):xe=e[10];const Ae=xe;let Be;e[11]!==F?(Be={enabled:F},e[11]=F,e[12]=Be):Be=e[12];const{data:_e}=qa(Be);let Te;e[13]!==_e?.data?.members?(Te=R=>R?_e?.data?.members?.find(we=>we.userId===R)?.user?.name??void 0:void 0,e[13]=_e?.data?.members,e[14]=Te):Te=e[14];const Rt=Te,Me=K.length>=Qs;let $e;e[15]!==B||e[16]!==oe||e[17]!==K?($e=R=>!!Ms(K,R.branch,B,oe),e[15]=B,e[16]=oe,e[17]=K,e[18]=$e):$e=e[18];const pe=$e,ot=S("thread.branchPicker.capReached",{max:Qs}),{isBase:Ye,current:ct,storeDraft:Fe,unlisted:_}=Ei({value:o,baseBranch:d,releases:K,baseIsDraft:N,storeDrafts:me}),le=Sl(K,B,o);let ye;e[19]!==B||e[20]!==o?(ye=R=>B===null||Xr(R.name)===B||R.name===o,e[19]=B,e[20]=o,e[21]=ye):ye=e[21];const Re=me.filter(ye),Xe=Ye?S("thread.branchPicker.live"):ct?.name??Fe?.name??S(qs(o)),dt=gt?S("thread.branchPicker.localhost.label"):ve?S("thread.branchPicker.localLabel"):o?Xe:S("thread.branchPicker.selectVersion"),Et=gt?"bg-foreground":ve?"bg-special":Ye?"bg-success":Fe?Ps(void 0):Ps(ct?.color??"orange"),Ne=!gt&&!ve&&!Ye&&!!ct&&fe(ct),Ze=R=>{Ae();const we=me.some(Nt=>Nt.name===R)?{runtime:"cms"}:K.find(Nt=>Nt.branch===R);m(R,we&&{runtime:we.runtime}),L(!1)};let ut;e[22]!==S?(ut=R=>{rt.error(S("thread.branchPicker.saveError"),{description:Mr(S,Er(R))})},e[22]=S,e[23]=ut):ut=e[23];const et=ut;let _t;e[24]!==Ie?(_t=R=>{Ie(R),q(!1),L(!1)},e[24]=Ie,e[25]=_t):_t=e[25];const ys=_t,Dt=(R,we)=>{if(Ae(),v){v(R),q(!1),L(!1);return}if(!K.some(Nt=>Nt.branch===R)){if(Me){rt.error(ot);return}te({branch:R,name:we.trim()||R,color:ks(K.length),createdBy:c,createdAt:new Date().toISOString()}).catch(et)}m(R),q(!1),L(!1)};let xt;e[26]!==Ae||e[27]!==m||e[28]!==g||e[29]!==de?(xt=()=>{const R=de();R&&(Ae(),(g??m)(R),L(!1))},e[26]=Ae,e[27]=m,e[28]=g,e[29]=de,e[30]=xt):xt=e[30];const js=xt;let tt;e[31]===Symbol.for("react.memo_cache_sentinel")?(tt=()=>{J(null),Q(""),q(!1),M("branches")},e[31]=tt):tt=e[31];const Tt=tt;let vt;e[32]===Symbol.for("react.memo_cache_sentinel")?(vt=R=>{M(R),q(!0)},e[32]=vt):vt=e[32];const yt=vt;let jt;e[33]===Symbol.for("react.memo_cache_sentinel")?(jt=R=>{J(R.branch),Q(R.name)},e[33]=jt):jt=e[33];const zt=jt;let wt;e[34]!==ne||e[35]!==se||e[36]!==et?(wt=R=>{const we=ne.trim();we&&se(R,we).catch(et),J(null),Q("")},e[34]=ne,e[35]=se,e[36]=et,e[37]=wt):wt=e[37];const Ut=wt,Kt=R=>{const we=R===void 0?o:R,Nt=ne.trim();if(Nt&&we){if(Me){rt.error(ot),J(null),Q("");return}te({branch:we,name:Nt,color:ks(K.length),createdBy:c,createdAt:new Date().toISOString()}).catch(et)}J(null),Q("")};let Pt;e[38]===Symbol.for("react.memo_cache_sentinel")?(Pt=()=>{J(null),Q("")},e[38]=Pt):Pt=e[38];const ht=Pt,Bt=()=>{const R=he;if(Z(null),!(!R||!pe(R))){if(R.branch===o){const we=Ms(K,R.branch,B,oe);we?Ze(we.branch):L(!1)}else L(!1);Pe(R.branch).catch(et)}},ft=_l(le,oe),ws=(ft.content.length>0||Re.length>0)&&ft.code.length>0,It=R=>H===R.branch?r.jsx(fn,{value:ne,onChange:Q,onSave:()=>Ut(R.branch),onCancel:ht},R.branch):r.jsx(mn,{rowRef:!ve&&R.branch===o?ee:void 0,dot:Ps(R.color),codeIcon:fe(R)?Es(R.color):void 0,label:R.name,creator:Rt(R.createdBy),originTooltip:y?S("thread.branchPicker.viaStudioUi"):void 0,branch:!y||fe(R)?R.branch:void 0,selected:!ve&&R.branch===o,onSelect:()=>Ze(R.branch),onRename:()=>zt(R),onDelete:()=>Z(R),deleteBlocked:!pe(R)},R.branch),$t=()=>{const R=re;if($(null),!!R){if(R.name===o){const we=Ms(K,R.name,B,oe);if(!we)return;Ze(we.branch)}E.mutateAsync(R.name).catch(we=>{rt.error(S("thread.branchPicker.discardStoreDraftError"),{description:we instanceof Error?we.message:void 0})})}},mt=Re.map(R=>H===R.name?r.jsx(fn,{value:ne,onChange:Q,onSave:()=>Kt(R.name),onCancel:ht},`store:${R.name}`):r.jsx(mn,{rowRef:!ve&&R.name===o?ee:void 0,dot:Ps(void 0),label:R.name,creator:Rt(R.createdBy),agentIcon:Es(ks(me.indexOf(R))),originTooltip:S("thread.branchPicker.storeDraftVia",{via:zl(R.via)}),selected:!ve&&R.name===o,onSelect:()=>Ze(R.name),onRename:()=>{J(R.name),Q(R.name)},onDelete:()=>$(R),deleteBlocked:R.name===o&&!Ms(K,R.name,B,oe)},`store:${R.name}`));let ze;e[39]!==C||e[40]!==y||e[41]!==Y?(ze=C?void 0:R=>{R?y&&Y():Tt(),L(R)},e[39]=C,e[40]=y,e[41]=Y,e[42]=ze):ze=e[42];const st=T?"text-xs":"text-xs text-muted-foreground hover:text-foreground";let Ue;e[43]!==st?(Ue=G("shrink min-w-0 max-w-[220px] gap-2",st,Ur),e[43]=st,e[44]=Ue):Ue=e[44];let Ke;e[45]!==C?(Ke=!C&&r.jsx(Hr,{size:12,className:"opacity-60 shrink-0"}),e[45]=C,e[46]=Ke):Ke=e[46];let qe;e[47]!==dt?(qe=r.jsx(it,{children:dt}),e[47]=dt,e[48]=qe):qe=e[48];const nt=bl,kt="w-[min(300px,calc(100vw-2rem))] p-1.5",St="start";let Le;e[49]===Symbol.for("react.memo_cache_sentinel")?(Le=R=>{R.preventDefault(),ee.current?.scrollIntoView({block:"nearest"})},e[49]=Le):Le=e[49];let He;e[50]!==A||e[51]!==S?(He=A&&r.jsx("p",{className:"px-2 pb-1.5 pt-1 text-xs text-muted-foreground",children:S("thread.branchPicker.newChatHint")}),e[50]=A,e[51]=S,e[52]=He):He=e[52];const V=W?r.jsx(to,{orgId:i,orgSlug:u,userId:c,target:h,owner:p,repo:b,sandboxMap:f,enabled:F,tab:X,onTabChange:M,isV8:y,localUrl:ce,onSaveLocal:ys,onBack:()=>q(!1),onAdopt:Dt,draftKind:B}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:G("always-scrollbar flex max-h-[min(50vh,20rem)] flex-col overflow-y-auto",y&&"gap-1"),children:[!y&&ve&&Je&&r.jsx(eo,{rowRef:ee,url:Je,onSelect:()=>yt("local"),onEdit:()=>yt("local"),onTurnOff:()=>Ae()}),_&&o&&(H===o?r.jsx(fn,{value:ne,onChange:Q,onSave:()=>Kt(),onCancel:ht}):r.jsx(mn,{rowRef:ve?void 0:ee,dot:Ps("orange"),label:S(qs(o)),branch:y?void 0:o,originTooltip:y?S("thread.branchPicker.viaStudioUi"):void 0,selected:!ve,onSelect:()=>Ze(o),onRename:()=>{J(o),Q(ia(K,S(qs(o))))}})),ws?r.jsxs(r.Fragment,{children:[r.jsx(ir,{children:S("thread.branchPicker.groupContent")}),ft.content.map(It),mt,r.jsx(ir,{divided:!0,children:S("thread.branchPicker.groupCode")}),ft.code.map(It)]}):r.jsxs(r.Fragment,{children:[le.map(It),mt]}),y&&r.jsx(Ui,{virtualMcpId:s,branch:o,serve:Se,rowRef:gt?ee:void 0,onPicked:()=>L(!1)})]}),(_||le.length>0||Re.length>0||y)&&r.jsx("div",{className:"my-1 border-t"}),r.jsxs("button",{type:"button",onClick:()=>{js()},disabled:Me,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:[r.jsx(Yr,{className:"h-4 w-4 shrink-0"}),S("thread.branchPicker.newVersion")]}),Me&&r.jsx("p",{className:"px-2 pb-1 pt-0.5 text-xs text-warning",children:ot}),r.jsxs("button",{type:"button",onClick:()=>yt("branches"),className:G("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:[S("thread.branchPicker.advanced"),r.jsx(Pr,{className:"h-4 w-4 shrink-0"})]})]});let ue;e[53]!==nt||e[54]!==Le||e[55]!==He||e[56]!==V?(ue=r.jsxs(nt,{className:kt,align:St,onOpenAutoFocus:Le,children:[He,V]}),e[53]=nt,e[54]=Le,e[55]=He,e[56]=V,e[57]=ue):ue=e[57];const je=r.jsxs(gl,{open:F,onOpenChange:ze,children:[r.jsxs(at,{children:[r.jsx(lt,{asChild:!0,children:r.jsx("span",{className:"inline-flex min-w-0 shrink",children:r.jsx(xl,{asChild:!0,children:r.jsxs(be,{"data-tour":pl.branchPicker,variant:T?"outline":"ghost",size:T?"sm":"default","aria-label":dt,disabled:C,className:Ue,children:[Ne?r.jsx(Vr,{className:G(Xs,Es(ct?.color))}):Fe&&!ve?r.jsx(kr,{className:G(Xs,Es(ks(me.indexOf(Fe))))}):r.jsx("span",{className:G("h-2 w-2 shrink-0 rounded-full",o||ve?Et:"bg-muted-foreground")}),r.jsx("span",{className:"min-w-0 truncate @max-3xl/panel-header:hidden",children:dt}),Ke]})})})}),qe]}),ue]}),De=he!==null;let Oe;e[58]===Symbol.for("react.memo_cache_sentinel")?(Oe=R=>{R||Z(null)},e[58]=Oe):Oe=e[58];let Ve;e[59]!==S?(Ve=S("thread.branchPicker.deleteTitle"),e[59]=S,e[60]=Ve):Ve=e[60];let qt;e[61]!==Ve?(qt=r.jsx(Ss,{children:Ve}),e[61]=Ve,e[62]=qt):qt=e[62];let Ht;e[63]!==he||e[64]!==S?(Ht=he&&S("thread.branchPicker.deleteConfirm",{name:he.name}),e[63]=he,e[64]=S,e[65]=Ht):Ht=e[65];let Vt;e[66]!==Ht?(Vt=r.jsx(Ns,{children:Ht}),e[66]=Ht,e[67]=Vt):Vt=e[67];let Gt;e[68]!==qt||e[69]!==Vt?(Gt=r.jsxs(Cs,{children:[qt,Vt]}),e[68]=qt,e[69]=Vt,e[70]=Gt):Gt=e[70];let Wt;e[71]!==S?(Wt=S("thread.branchPicker.cancel"),e[71]=S,e[72]=Wt):Wt=e[72];let Qt;e[73]!==Wt?(Qt=r.jsx(Gs,{children:Wt}),e[73]=Wt,e[74]=Qt):Qt=e[74];let Jt;e[75]!==S?(Jt=S("thread.branchPicker.delete"),e[75]=S,e[76]=Jt):Jt=e[76];let Yt;e[77]!==Bt||e[78]!==Jt?(Yt=r.jsx(Ws,{onClick:Bt,variant:"destructive",children:Jt}),e[77]=Bt,e[78]=Jt,e[79]=Yt):Yt=e[79];let Xt;e[80]!==Qt||e[81]!==Yt?(Xt=r.jsxs(As,{children:[Qt,Yt]}),e[80]=Qt,e[81]=Yt,e[82]=Xt):Xt=e[82];let Zt;e[83]!==Gt||e[84]!==Xt?(Zt=r.jsxs(Rs,{children:[Gt,Xt]}),e[83]=Gt,e[84]=Xt,e[85]=Zt):Zt=e[85];let Fs;e[86]!==De||e[87]!==Zt?(Fs=r.jsx(Ds,{open:De,onOpenChange:Oe,children:Zt}),e[86]=De,e[87]=Zt,e[88]=Fs):Fs=e[88];const un=re!==null;let Ls;e[89]===Symbol.for("react.memo_cache_sentinel")?(Ls=R=>{R||$(null)},e[89]=Ls):Ls=e[89];let es;e[90]!==S?(es=S("thread.branchPicker.deleteTitle"),e[90]=S,e[91]=es):es=e[91];let ts;e[92]!==es?(ts=r.jsx(Ss,{children:es}),e[92]=es,e[93]=ts):ts=e[93];let ss;e[94]!==re||e[95]!==S?(ss=re&&S("thread.branchPicker.discardStoreDraftConfirm",{name:re.name}),e[94]=re,e[95]=S,e[96]=ss):ss=e[96];let ns;e[97]!==ss?(ns=r.jsx(Ns,{children:ss}),e[97]=ss,e[98]=ns):ns=e[98];let rs;e[99]!==ts||e[100]!==ns?(rs=r.jsxs(Cs,{children:[ts,ns]}),e[99]=ts,e[100]=ns,e[101]=rs):rs=e[101];let as;e[102]!==S?(as=S("thread.branchPicker.cancel"),e[102]=S,e[103]=as):as=e[103];let ls;e[104]!==as?(ls=r.jsx(Gs,{children:as}),e[104]=as,e[105]=ls):ls=e[105];let is;e[106]!==S?(is=S("thread.branchPicker.delete"),e[106]=S,e[107]=is):is=e[107];let os;e[108]!==$t||e[109]!==is?(os=r.jsx(Ws,{onClick:$t,variant:"destructive",children:is}),e[108]=$t,e[109]=is,e[110]=os):os=e[110];let cs;e[111]!==ls||e[112]!==os?(cs=r.jsxs(As,{children:[ls,os]}),e[111]=ls,e[112]=os,e[113]=cs):cs=e[113];let ds;e[114]!==rs||e[115]!==cs?(ds=r.jsxs(Rs,{children:[rs,cs]}),e[114]=rs,e[115]=cs,e[116]=ds):ds=e[116];let Os;return e[117]!==un||e[118]!==ds?(Os=r.jsx(Ds,{open:un,onOpenChange:Ls,children:ds}),e[117]=un,e[118]=ds,e[119]=Os):Os=e[119],r.jsxs(r.Fragment,{children:[je,Fs,Os]})}function fn(t){const e=I.c(20),{value:s,onChange:a,onSave:n,onCancel:o}=t,d=ge();let l;e[0]!==d?(l=d("thread.branchPicker.rename"),e[0]=d,e[1]=l):l=e[1];let i;e[2]!==a?(i=f=>a(f.target.value),e[2]=a,e[3]=i):i=e[3];let u;e[4]!==o||e[5]!==n?(u=f=>{f.key==="Enter"&&n(),f.key==="Escape"&&(f.preventDefault(),f.stopPropagation(),o())},e[4]=o,e[5]=n,e[6]=u):u=e[6];let c;e[7]!==l||e[8]!==i||e[9]!==u||e[10]!==s?(c=r.jsx("input",{autoFocus:!0,"aria-label":l,value:s,onChange:i,onKeyDown:u,className:"h-8 flex-1 rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[7]=l,e[8]=i,e[9]=u,e[10]=s,e[11]=c):c=e[11];let h;e[12]!==d?(h=d("thread.branchPicker.save"),e[12]=d,e[13]=h):h=e[13];let p;e[14]!==n||e[15]!==h?(p=r.jsx(be,{size:"sm",onClick:n,children:h}),e[14]=n,e[15]=h,e[16]=p):p=e[16];let b;return e[17]!==c||e[18]!==p?(b=r.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 ir(t){const e=I.c(5),{divided:s,children:a}=t,o=(s===void 0?!1:s)&&"mt-1 border-t";let d;e[0]!==o?(d=G("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]!==a||e[3]!==d?(l=r.jsx("p",{className:d,children:a}),e[2]=a,e[3]=d,e[4]=l):l=e[4],l}function mn(t){const e=I.c(53),{rowRef:s,dot:a,codeIcon:n,agentIcon:o,originTooltip:d,label:l,creator:i,branch:u,selected:c,onSelect:h,onRename:p,onDelete:b,deleteBlocked:f}=t,m=f===void 0?!1:f,g=ge();let v;e[0]!==o||e[1]!==n||e[2]!==a?(v=n?r.jsx(Vr,{className:G(Xs,n)}):o?r.jsx(kr,{className:G(Xs,o)}):r.jsx("span",{className:G("h-2 w-2 shrink-0 rounded-full",a)}),e[0]=o,e[1]=n,e[2]=a,e[3]=v):v=e[3];let j;e[4]!==i?(j=i&&r.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=r.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]!==h||e[10]!==c||e[11]!==v||e[12]!==w?(x=r.jsxs("button",{type:"button","aria-pressed":c,onClick:h,className:"flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[v,w]}),e[9]=h,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=G("group flex items-center rounded-lg",y),e[14]=y,e[15]=N):N=e[15];let C;e[16]!==u||e[17]!==n||e[18]!==d||e[19]!==P||e[20]!==g?(C=u||d?r.jsxs(at,{children:[r.jsx(lt,{asChild:!0,children:P}),r.jsxs(it,{side:"bottom",className:"text-xs",children:[n&&r.jsx("p",{className:"font-medium",children:g("thread.branchPicker.codeDraftTooltip")}),d&&r.jsx("p",{children:d}),u&&r.jsx("p",{className:"font-mono",children:g("thread.branchPicker.branchTooltip",{branch:u})})]})]}):P,e[16]=u,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 k;e[24]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Qr,{className:"h-4 w-4"}),e[24]=k):k=e[24];let D;e[25]!==A?(D=r.jsx(en,{asChild:!0,children:r.jsx(be,{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:k})}),e[25]=A,e[26]=D):D=e[26];let S;e[27]===Symbol.for("react.memo_cache_sentinel")?(S=r.jsx(Jr,{className:"h-4 w-4"}),e[27]=S):S=e[27];let O;e[28]!==g?(O=g("thread.branchPicker.rename"),e[28]=g,e[29]=O):O=e[29];let B;e[30]!==p||e[31]!==O?(B=r.jsxs(fs,{onSelect:p,children:[S,O]}),e[30]=p,e[31]=O,e[32]=B):B=e[32];let T;e[33]!==m||e[34]!==b||e[35]!==g?(T=b&&r.jsxs(fs,{onSelect:b,disabled:m,className:"text-destructive focus:text-destructive",children:[r.jsx(ln,{className:"h-4 w-4"}),g("thread.branchPicker.delete")]}),e[33]=m,e[34]=b,e[35]=g,e[36]=T):T=e[36];let F;e[37]!==m||e[38]!==b||e[39]!==g?(F=b&&m&&r.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]=F):F=e[40];let L;e[41]!==B||e[42]!==T||e[43]!==F?(L=r.jsxs(tn,{align:"end",children:[B,T,F]}),e[41]=B,e[42]=T,e[43]=F,e[44]=L):L=e[44];let W;e[45]!==D||e[46]!==L?(W=r.jsxs(sn,{children:[D,L]}),e[45]=D,e[46]=L,e[47]=W):W=e[47];let q;return e[48]!==s||e[49]!==W||e[50]!==N||e[51]!==C?(q=r.jsxs("div",{ref:s,className:N,children:[C,W]}),e[48]=s,e[49]=W,e[50]=N,e[51]=C,e[52]=q):q=e[52],q}function eo(t){const e=I.c(40),{rowRef:s,url:a,onSelect:n,onEdit:o,onTurnOff:d}=t,l=ge();let i;try{let D;e[0]!==a?(D=new URL(a),e[0]=a,e[1]=D):D=e[1],i=D.host}catch{i=a}const u=i;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-special"}),e[2]=c):c=e[2];let h;e[3]!==l?(h=l("thread.branchPicker.localLabel"),e[3]=l,e[4]=h):h=e[4];let p;e[5]!==u?(p=r.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:u}),e[5]=u,e[6]=p):p=e[6];let b;e[7]!==h||e[8]!==p?(b=r.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[h,p]}),e[7]=h,e[8]=p,e[9]=b):b=e[9];let f;e[10]!==n||e[11]!==b?(f=r.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=r.jsx(Qr,{className:"h-4 w-4"}),e[15]=g):g=e[15];let v;e[16]!==m?(v=r.jsx(en,{asChild:!0,children:r.jsx(be,{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=r.jsx(Jr,{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=r.jsxs(fs,{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=r.jsx(ln,{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=r.jsxs(fs,{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=r.jsxs(tn,{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=r.jsxs(sn,{children:[v,C]}),e[33]=C,e[34]=v,e[35]=A):A=e[35];let k;return e[36]!==s||e[37]!==A||e[38]!==f?(k=r.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]=k):k=e[39],k}function to(t){const e=I.c(75),{orgId:s,orgSlug:a,userId:n,target:o,owner:d,repo:l,sandboxMap:i,enabled:u,tab:c,onTabChange:h,isV8:p,localUrl:b,onSaveLocal:f,onBack:m,onAdopt:g,draftKind:v}=t,j=ge(),[w,x]=U.useState(""),P=c==="branches"?w:"",y=u&&c==="branches";let N;e[0]!==s||e[1]!==a||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:a,userId:n,target:o,sandboxMap:i,owner:d,repo:l,search:P,enabled:y},e[0]=s,e[1]=a,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:k,isLoading:D,hasMore:S,isFetchingMore:O,fetchMore:B}=Ji(N),T=u&&c==="prs";let F;e[10]!==s||e[11]!==a||e[12]!==d||e[13]!==l||e[14]!==T||e[15]!==o?(F={orgId:s,orgSlug:a,target:o,owner:d,repo:l,enabled:T},e[10]=s,e[11]=a,e[12]=d,e[13]=l,e[14]=T,e[15]=o,e[16]=F):F=e[16];const{data:L,isLoading:W}=$l(F);let q;if(e[17]!==v||e[18]!==B||e[19]!==S||e[20]!==O||e[21]!==D||e[22]!==p||e[23]!==b||e[24]!==g||e[25]!==m||e[26]!==f||e[27]!==h||e[28]!==k||e[29]!==d||e[30]!==W||e[31]!==C||e[32]!==l||e[33]!==w||e[34]!==j||e[35]!==L||e[36]!==c||e[37]!==A){const X=L===void 0?[]:L,M=`${d}/${l}`;let H;e[39]!==M?(H=M.toLowerCase(),e[39]=M,e[40]=H):H=e[40];const J=H;let ne;e[41]!==J?(ne=z=>z.headRepoFullName?.toLowerCase()===J,e[41]=J,e[42]=ne):ne=e[42];const Q=X.filter(ne);let he;if(e[43]!==v||e[44]!==k||e[45]!==C||e[46]!==A){const z=new Set;he=[...C,...A,...k].filter(fe=>z.has(fe.name)?!1:(z.add(fe.name),v!=="site"||Xr(fe.name)==="site")),e[43]=v,e[44]=k,e[45]=C,e[46]=A,e[47]=he}else he=e[47];const Z=he;let re;e[48]===Symbol.for("react.memo_cache_sentinel")?(re=r.jsx(wl,{className:"h-4 w-4 shrink-0"}),e[48]=re):re=e[48];let $;e[49]!==j?($=j("thread.branchPicker.advancedBack"),e[49]=j,e[50]=$):$=e[50];let ee;e[51]!==m||e[52]!==$?(ee=r.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,$]}),e[51]=m,e[52]=$,e[53]=ee):ee=e[53];let K;e[54]!==h?(K=z=>{h(z),x("")},e[54]=h,e[55]=K):K=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=r.jsx(Ft,{value:"branches",className:"h-6 px-2.5 text-xs",children:te}),e[58]=te,e[59]=se):se=e[59];let Pe;e[60]!==j?(Pe=j("thread.branchPicker.prsTab"),e[60]=j,e[61]=Pe):Pe=e[61];let ae;e[62]!==Pe?(ae=r.jsx(Ft,{value:"prs",className:"h-6 px-2.5 text-xs",children:Pe}),e[62]=Pe,e[63]=ae):ae=e[63];let ie;e[64]!==p||e[65]!==j?(ie=!p&&r.jsx(Ft,{value:"local",className:"h-6 px-2.5 text-xs",children:j("thread.branchPicker.localTab")}),e[64]=p,e[65]=j,e[66]=ie):ie=e[66];let de;e[67]!==se||e[68]!==ae||e[69]!==ie?(de=r.jsxs(Kr,{className:"h-auto w-fit justify-start gap-1 bg-accent p-1",variant:"pill",children:[se,ae,ie]}),e[67]=se,e[68]=ae,e[69]=ie,e[70]=de):de=e[70];let oe;e[71]!==K||e[72]!==de||e[73]!==c?(oe=r.jsx(qr,{className:"px-2 pt-2 pb-1",value:c,onValueChange:K,children:de}),e[71]=K,e[72]=de,e[73]=c,e[74]=oe):oe=e[74],q=r.jsxs("div",{className:"flex flex-col",children:[ee,oe,c==="local"&&!p?r.jsx(zi,{url:b,onSave:f}):r.jsxs(vl,{filter:c==="branches"?so:void 0,children:[r.jsx(yl,{placeholder:j(c==="branches"?"thread.branchPicker.searchBranches":"thread.branchPicker.searchPullRequests"),value:w,onValueChange:x}),r.jsx(jl,{onScroll:z=>{const fe=z.currentTarget;c==="branches"&&fe.scrollHeight-fe.scrollTop-fe.clientHeight<48&&B()},children:c==="branches"?r.jsxs(r.Fragment,{children:[D&&r.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:j("thread.branchPicker.loadingMore")}),!D&&Z.length===0&&r.jsx(er,{children:j("thread.branchPicker.noBranchesFound")}),Z.length>0&&r.jsx(tr,{children:Z.map(z=>r.jsxs(sr,{value:z.name,className:"cursor-pointer",onSelect:()=>g(z.name,z.name),children:[r.jsx(Ha,{className:"mr-2 h-4 w-4 shrink-0"}),r.jsx("span",{className:"flex-1 truncate",children:z.name})]},z.name))}),S&&r.jsx("div",{className:"p-2",children:r.jsx(be,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs",disabled:O,onClick:B,children:j(O?"thread.branchPicker.loadingMore":"thread.branchPicker.loadMoreBranches")})})]}):r.jsxs(r.Fragment,{children:[W&&r.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:j("thread.branchPicker.loadingPullRequests")}),!W&&Q.length===0&&r.jsx(er,{children:j("thread.branchPicker.noOpenPullRequests")}),Q.length>0&&r.jsx(tr,{children:Q.map(z=>r.jsxs(sr,{value:`#${z.number} ${z.title} ${z.head}`,className:"cursor-pointer",onSelect:()=>g(z.head,lr(z.title)),children:[r.jsx(an,{className:"mr-2 h-4 w-4 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[r.jsx("span",{className:"truncate",children:lr(z.title)}),r.jsxs("span",{className:"truncate text-xs text-muted-foreground",children:["#",z.number," · ",z.head]})]})]},z.number))})]})})]})]}),e[17]=v,e[18]=B,e[19]=S,e[20]=O,e[21]=D,e[22]=p,e[23]=b,e[24]=g,e[25]=m,e[26]=f,e[27]=h,e[28]=k,e[29]=d,e[30]=W,e[31]=C,e[32]=l,e[33]=w,e[34]=j,e[35]=L,e[36]=c,e[37]=A,e[38]=q}else q=e[38];return q}function so(t,e){return xn(t,e)?1:0}function no(t){const e=I.c(20),{locked:s,placement:a,value:n,virtualMcpId:o,isV8:d,userLabel:l,baseBranch:i,baseIsDraft:u,onChange:c,onCreateBranch:h,onAdoptBranch:p,orgId:b,orgSlug:f,userId:m,target:g,owner:v,repo:j,sandboxMap:w,draftKind:x}=t;let P;return e[0]!==i||e[1]!==u||e[2]!==x||e[3]!==d||e[4]!==s||e[5]!==p||e[6]!==c||e[7]!==h||e[8]!==b||e[9]!==f||e[10]!==v||e[11]!==a||e[12]!==j||e[13]!==w||e[14]!==g||e[15]!==m||e[16]!==l||e[17]!==n||e[18]!==o?(P=r.jsx(Zi,{virtualMcpId:o,isV8:d,userLabel:l,value:n,baseBranch:i,baseIsDraft:u,orgId:b,orgSlug:f,userId:m,target:g,owner:v,repo:j,sandboxMap:w,onChange:c,onCreateBranch:h,onAdoptBranch:p,spawnsNewChat:s,placement:a,draftKind:x}),e[0]=i,e[1]=u,e[2]=x,e[3]=d,e[4]=s,e[5]=p,e[6]=c,e[7]=h,e[8]=b,e[9]=f,e[10]=v,e[11]=a,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 ro(t){const e=I.c(2),{branchPill:s}=t;if(!s)return null;let a;return e[0]!==s?(a=r.jsx(r.Fragment,{children:s}),e[0]=s,e[1]=a):a=e[1],a}function ao(t){const{locked:e,sessionRuntime:s,projectRuntime:a,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"&&a==="cms"&&!o?{kind:"new-chat"}:e?s==="sandbox"?{kind:"new-chat",runtime:"sandbox"}:{kind:"new-chat"}:{kind:"switch"}}function lo(t){const e=I.c(25),{virtualMcp:s,currentBranch:a}=t,n=al(),o=xs();let d;e[0]!==n?.messages||e[1]!==o?.isThreadLocked?(d=(n?.messages??[]).length>0||(o?.isThreadLocked??!1),e[0]=n?.messages,e[1]=o?.isThreadLocked,e[2]=d):d=e[2];const l=d,i=o?.setCurrentTaskBranch,u=o?.createTask,c=Zr()==="blog"?"blog":"site",h=vs(s?.id),p=h.runtime,b=s?.metadata;let f;e[3]!==b?(f=ea(b),e[3]=b,e[4]=f):f=e[4];const m=f,g=m==="cms"&&p==="sandbox",v=Rl(s),j=Ee(v),{data:w}=nn.useSession(),x=w?.user;let P;e[5]!==x?(P=Bn(x),e[5]=x,e[6]=P):P=e[6];const y=P,N=w?.user?.id??"",{org:C}=Bs(),A=Fl(s,a),k=In(s?.id),D=k&&p==="cms";let S;e[7]!==u||e[8]!==a||e[9]!==l||e[10]!==m||e[11]!==p||e[12]!==h.resolved||e[13]!==i||e[14]!==k?(S=(X,M)=>{const H=ao({locked:l,sessionRuntime:h.resolved?p:null,projectRuntime:m,draftRuntime:M&&(M.runtime??m),current:X===a,contentOnly:k});H.kind==="new-chat"&&u?u({branch:X,...H.runtime?{runtime:H.runtime}:{}}):i&&i(X)},e[7]=u,e[8]=a,e[9]=l,e[10]=m,e[11]=p,e[12]=h.resolved,e[13]=i,e[14]=k,e[15]=S):S=e[15];const O=S;let B;e[16]!==g||e[17]!==u||e[18]!==l||e[19]!==i?(B=X=>{(l||g)&&u?u({branch:X}):i&&i(X)},e[16]=g,e[17]=u,e[18]=l,e[19]=i,e[20]=B):B=e[20];const T=B;let F;e[21]!==u?(F=u?X=>u({runtime:"sandbox",branch:X}):void 0,e[21]=u,e[22]=F):F=e[22];const L=F,W=v&&ta(j)?r.jsx(no,{userLabel:y,virtualMcpId:s?.id??"",isV8:k,value:a,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:O,onCreateBranch:T,onAdoptBranch:L,locked:l,placement:"chat",draftKind:c},`${sa(j)}:${v.owner}/${v.name}`):null;let q;return e[23]!==W?(q=r.jsx(ro,{branchPill:W}),e[23]=W,e[24]=q):q=e[24],q}const io=Va("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 oo(t){const e=I.c(11);let s,a,n;e[0]!==t?({className:s,orientation:a,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n):(s=e[1],a=e[2],n=e[3]);let o;e[4]!==s||e[5]!==a?(o=G(io({orientation:a}),s),e[4]=s,e[5]=a,e[6]=o):o=e[6];let d;return e[7]!==a||e[8]!==n||e[9]!==o?(d=r.jsx("div",{role:"group","data-slot":"button-group","data-orientation":a,className:o,...n}),e[7]=a,e[8]=n,e[9]=o,e[10]=d):d=e[10],d}function co(t){const e=I.c(14),{item:s}=t;let a;e[0]!==s?(a=()=>{s.onSelect()},e[0]=s,e[1]=a):a=e[1];let n;e[2]!==s.disabled||e[3]!==s.icon||e[4]!==s.label||e[5]!==a?(n=r.jsxs(fs,{disabled:s.disabled,onSelect:a,children:[s.icon,s.label]}),e[2]=s.disabled,e[3]=s.icon,e[4]=s.label,e[5]=a,e[6]=n):n=e[6];const o=n;if(!s.tooltip)return o;let d;e[7]!==o?(d=r.jsx(lt,{asChild:!0,children:o}),e[7]=o,e[8]=d):d=e[8];let l;e[9]!==s.tooltip?(l=r.jsx(it,{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=r.jsxs(at,{children:[d,l]}),e[11]=d,e[12]=l,e[13]=i):i=e[13],i}function ba(t){const e=I.c(20),{label:s,onClick:a,variant:n,size:o,disabled:d,loading:l,pulse:i,tooltip:u,icon:c,items:h,menuAriaLabel:p,className:b}=t,f=n===void 0?"default":n,m=o===void 0?"default":o,g=d===void 0?!1:d,v=l===void 0?!1:l,j=i===void 0?!1:i,w=(h?.length??0)>0;let x;if(e[0]!==b||e[1]!==g||e[2]!==w||e[3]!==c||e[4]!==h||e[5]!==s||e[6]!==v||e[7]!==p||e[8]!==a||e[9]!==j||e[10]!==m||e[11]!==u||e[12]!==f){const P=G(Ur,f==="default"&&"focus-visible:inset-ring-current");let y;e[14]!==c||e[15]!==v?(y=v?r.jsx(ms,{size:"xs"}):c,e[14]=c,e[15]=v,e[16]=y):y=e[16];const N=r.jsxs(be,{type:"button",variant:f,size:m,disabled:g,"aria-busy":v||void 0,onClick:v?void 0:a,className:G(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=G(C,b),e[17]=b,e[18]=C,e[19]=A):A=e[19],x=r.jsxs(oo,{className:A,children:[u?r.jsxs(at,{children:[r.jsx(lt,{asChild:!0,children:r.jsx("span",{className:G("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})}),r.jsx(it,{children:u})]}):N,w?r.jsxs(sn,{children:[r.jsx(en,{asChild:!0,children:r.jsx(be,{type:"button",variant:f,size:m,"aria-label":p,className:G("has-[>svg]:px-2",P),children:r.jsx(Hr,{className:"size-3.5"})})}),r.jsx(tn,{align:"end",children:h?.map(uo)})]}):null]}),e[0]=b,e[1]=g,e[2]=w,e[3]=c,e[4]=h,e[5]=s,e[6]=v,e[7]=p,e[8]=a,e[9]=j,e[10]=m,e[11]=u,e[12]=f,e[13]=x}else x=e[13];return x}function uo(t){return r.jsx(co,{item:t},t.key)}async function ho(t){if(t.hosted)return;const e=t.branch;await t.setCurrentTaskBranch(t.nextBranch()),e&&e!==t.baseBranch&&await t.deleteRelease(e)}function fo(t,e,{hosted:s}){return s&&t!==null?t:e}function mo(t,e){const s=I.c(11),[a,n]=U.useState(null);let o;s[0]!==a||s[1]!==t||s[2]!==e?(o=fo(a,t,e),s[0]=a,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 po({open:t,hosted:e}){return t||e}function ga(t){return ri({userName:t?.name,userEmail:t?.email})??void 0}function cn(t){const e=I.c(18),{state:s,header:a,body:n,note:o,gate:d,footer:l}=t,i=s!=="ready";let u;e[0]!==a?(u=r.jsx("div",{className:"space-y-0.5 px-4 py-3",children:a}),e[0]=a,e[1]=u):u=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx("div",{className:"border-t"}),e[2]=c):c=e[2];let h;e[3]!==o?(h=o?r.jsx("div",{className:"space-y-1.5 border-t px-4 py-3",children:o}):null,e[3]=o,e[4]=h):h=e[4];let p;e[5]!==n||e[6]!==h?(p=r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n,h]}),e[5]=n,e[6]=h,e[7]=p):p=e[7];let b;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx("div",{className:"border-t"}),e[8]=b):b=e[8];let f;e[9]!==l?(f=r.jsx("div",{className:"space-y-2 px-4 py-3",children:l}),e[9]=l,e[10]=f):f=e[10];let m;return e[11]!==d||e[12]!==s||e[13]!==i||e[14]!==u||e[15]!==p||e[16]!==f?(m=r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col","data-publish-state":s,"aria-busy":i,children:[u,c,p,d,b,f]}),e[11]=d,e[12]=s,e[13]=i,e[14]=u,e[15]=p,e[16]=f,e[17]=m):m=e[17],m}function Ts(t){const e=I.c(2),{children:s}=t;let a;return e[0]!==s?(a=r.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]=a):a=e[1],a}function xa(t){const e=I.c(10);let s,a,n;e[0]!==t?({className:a,children:s,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n):(s=e[1],a=e[2],n=e[3]);let o;e[4]!==a?(o=G("rounded-lg border bg-card px-3 py-2.5",a),e[4]=a,e[5]=o):o=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==o?(d=r.jsx("div",{className:o,...n,children:s}),e[6]=s,e[7]=n,e[8]=o,e[9]=d):d=e[9],d}function We(t){const e=I.c(4),{className:s}=t;let a;e[0]!==s?(a=G("animate-pulse rounded bg-muted motion-reduce:animate-none",s),e[0]=s,e[1]=a):a=e[1];let n;return e[2]!==a?(n=r.jsx("div",{className:a}),e[2]=a,e[3]=n):n=e[3],n}function Lt(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(xa,{children:r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx(We,{className:"size-4 rounded-md"}),r.jsx(We,{className:"h-3 w-24"}),r.jsx(We,{className:"h-2.5 w-16"}),r.jsx(We,{className:"ml-auto size-6 rounded"})]})}),t[0]=e):e=t[0],e}const bo="secret";function va(t){return t.kind!=="block"?null:t.namedRule??null}function go(t,e){const s=e.find(a=>a&&typeof a=="object");return s?Xl(s.__resolveType):Zl(t)}const xo=/(?:^|\/)\.deco\/blocks\/([^/]+)\.json$/;function Kn(t){const e=xo.exec(t)?.[1];return e?Ci(e):null}function Zs(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 vo(t,e){return t===null?"new":e===null?"removed":"edited"}function ya(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 hs(t,e,s=!1){if(t&&typeof t=="object"&&!Array.isArray(t)){const a=t.__resolveType;if(typeof a=="string"&&a.trim()){if(s)return Ga(a);const o=(a.split("/").pop()??a).replace(/\.[jt]sx?$/,"");return ya(o)||o}}return`Section ${e+1}`}function qn(t){if(Sr(t))return t.value??null;const e=t.__resolveType;return typeof e=="string"&&Wa(e)?t.section??null:null}const ja=6;function Hs(t,e=0){if(e>ja||!t||typeof t!="object")return[];if(Array.isArray(t))return t.flatMap(n=>Hs(n,e+1));const s=t;if(Pn(s.__resolveType))return vn(s).flatMap(n=>Hs(n?.value,e+1));const a=qn(s);return a!==null?Hs(a,e+1):[s]}function vn(t){const e=t?.variants;return Array.isArray(e)?e.map(s=>s&&typeof s=="object"&&!Array.isArray(s)?s:null):[]}function or(t){let e=t;for(let s=0;s<ja;s++){if(!e||typeof e!="object"||Array.isArray(e))return null;const a=e;if(Pn(a.__resolveType))return a;const n=qn(a);if(n===null)return null;e=n}return null}function yo(t,e,s){const a=vn(or(t)),n=e?vn(or(e)):[],o=e?Array.from({length:Math.max(a.length,n.length)},(i,u)=>u).filter(i=>!dn(a[i],n[i])):[],l=[...o.map(i=>a[i]??n[i]),...a.filter((i,u)=>!o.includes(u))].flatMap(i=>Hs(i?.value)).map(i=>hs(i,s,!0));return[...new Set(l)]}function pn(t,e,s,a,n){let o=t,d=!1;for(let i=0;i<4;i++){if(!o||typeof o!="object"||Array.isArray(o)){d=!0;break}const u=o;if(Pn(u.__resolveType)){d=!0;break}const c=qn(u);if(c===null)break;o=c}const l=d?yo(t,n,e):[];return{name:hs(d?t:o,e,!0),kind:"section",status:s,fields:a,...d?{wrapper:!0}:{},...l.length>0?{held:l}:{}}}function yn(t,e){const s=t.sections;if(Array.isArray(s))return s.flatMap((a,n)=>a&&typeof a=="object"&&!Array.isArray(a)?[{section:a,basePath:["sections",n]}]:[]);if(s&&typeof s=="object"){const a=s.variants;if(Array.isArray(a))return a.flatMap((n,o)=>{const d=n&&typeof n=="object"&&!Array.isArray(n)?n.value:null,l=e&&Sr(d),i=l?d.value:d;if(!Array.isArray(i))return[];const u=l?["sections","variants",o,"value","value"]:["sections","variants",o,"value"];return i.flatMap((c,h)=>c&&typeof c=="object"&&!Array.isArray(c)?[{section:c,basePath:[...u,h]}]:[])})}return[]}function cr(t){return JSON.stringify(t,(e,s)=>{if(s&&typeof s=="object"&&!Array.isArray(s)){const a=s;return Object.keys(a).sort().reduce((n,o)=>(n[o]=a[o],n),{})}return s})}function dn(t,e){return t===void 0&&e===void 0?!0:cr(t)===cr(e)}function At(t,e,s,a=new Set){const n=new Set([...Object.keys(t??{}),...Object.keys(e??{})]),o=[];for(const d of n){if(d.startsWith("__")||a.has(d))continue;const l=t?t[d]:void 0,i=e?e[d]:void 0;dn(l,i)||o.push({label:ya(d),path:[...s,d],from:l,to:i})}return o}function jo(t,e){const s=e.find(a=>a&&typeof a=="object");return s?s.__resolveType===li:t===ii}function wo(t,e){const s=n=>n===void 0||!!n&&typeof n=="object"&&!Array.isArray(n)&&!("__resolveType"in n),a=[];for(const n of At(t,e,[])){const o=String(n.path[0]);s(n.from)&&s(n.to)?a.push(...At(n.from??{},n.to??{},[o])):a.push(n)}return a}const Po=new Set(["sections"]);function Hn(t,e,s=!1){const a=t?yn(t,s):[],n=e?yn(e,s):[],o=[],d=Math.max(a.length,n.length);for(let i=0;i<d;i++){const u=a[i],c=n[i];if(!s){const h=ko(u,c,i);h&&o.push(h);continue}if(u&&c){if(dn(u.section,c.section))continue;o.push(pn(c.section,i,"edited",At(u.section,c.section,c.basePath),u.section))}else c?o.push(pn(c.section,i,"new",[])):u&&o.push(pn(u.section,i,"removed",[]))}const l=At(t,e,[],Po);return l.length>0&&o.push({name:"Page settings",kind:"settings",status:"edited",fields:l}),o}function ko(t,e,s){return t&&e?dn(t.section,e.section)?null:{name:hs(e.section,s),kind:"section",status:"edited",fields:At(t.section,e.section,e.basePath)}:e?{name:hs(e.section,s),kind:"section",status:"new",fields:[]}:t?{name:hs(t.section,s),kind:"section",status:"removed",fields:[]}:null}function jn(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 So(t){const e=[],s=[],a=[],n=[];for(const[o,d]of Object.entries(t?.diffs??{})){if(On(o)){n.push(o);continue}const l=vo(d.from,d.to),i=Kn(o);if(!i){a.push(jn(o,l));continue}const u=Zs(d.from),c=Zs(d.to),h=c??u;if(!h){a.push(jn(o,l));continue}const p=us(i,h);if(p){e.push({kind:"page",blockKey:i,name:p.name,pagePath:p.path,isSiteApp:!1,status:l,filepaths:[o],sections:l==="edited"?Hn(u,c):[],fromJson:u,toJson:c});continue}const b=$n(i,h);s.push({kind:"block",blockKey:i,name:Js(i,h),pagePath:null,isSiteApp:b,status:l,filepaths:[o],sections:l==="edited"?[{name:Js(i,h),kind:"section",status:"edited",fields:At(u,c,[])}].filter(f=>f.fields.length>0):[],fromJson:u,toJson:c})}return wa({pages:e,blocks:s,other:a,generated:n})}function bn(t,e){return(t.filepaths[0]??"").localeCompare(e.filepaths[0]??"")}function wa(t){const{pages:e,blocks:s,other:a,generated:n}=t;return e.sort(bn),s.sort(bn),a.sort(bn),{pages:e,blocks:s,other:a,generated:n,count:e.length+s.length+a.length}}function No(t){return t==="added"?"new":t==="removed"?"removed":"edited"}function Pa(t){return t.startsWith("pages-")}function ka(t){const{files:e,lookup:s,diff:a}=t,n=[],o=[],d=[],l=[];for(const i of e){const u=i.path;if(On(u)){l.push(u);continue}const c=No(i.status),h=Kn(u);if(!h){d.push(jn(u,c));continue}const p=a?.diffs[u],b=Zs(p?.from??null),f=Zs(p?.to??null),m=Sa(s,h),g=m??f??b;if((m?us(h,m):null)??(!m&&Pa(h))){const w=g?us(h,g):null;n.push({kind:"page",blockKey:h,name:w?.name??da(h),pagePath:w?.path??null,isSiteApp:!1,status:c,filepaths:[u],sections:c==="edited"?Hn(b,f):[],fromJson:b,toJson:f??(c==="new"?m:null)});continue}const j=Js(h,g??{});o.push({kind:"block",blockKey:h,name:j,pagePath:null,isSiteApp:$n(h,m??{}),status:c,filepaths:[u],sections:c==="edited"?[{name:j,kind:"section",status:"edited",fields:At(b,f,[])}].filter(w=>w.fields.length>0):[],fromJson:b,toJson:f})}return wa({pages:n,blocks:o,other:d,generated:l})}function Sa(t,e){const s=t?.[e];return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function Co(t,e){return t??e}function Na(t){return t.length<=1?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}const gn=3;function _s(t){if(t.length<=gn)return Na(t);const e=t.length-gn;return`${t.slice(0,gn).join(", ")} and ${e} more`}function Ao(t,e){if(!e){const a=t.sections.filter(n=>n.kind==="section").map(n=>n.name).slice(0,3);return a.length>0?`${t.name} (${a.join(", ")})`:t.name}const s=[...new Set(t.sections.filter(a=>a.kind==="section").flatMap(a=>a.wrapper?a.held??[]:[a.name]))].slice(0,3);return s.length>0?`${t.name} (${s.join(", ")})`:t.name}function Ro(t){const e=va(t);return e==="experiments"?"A/B tests":e==="campaigns"?"Campaign dates":t.name}function Do(t){const e=[],s=t.pages.filter(l=>l.status==="edited"),a=t.pages.filter(l=>l.status==="new"),n=t.pages.filter(l=>l.status==="removed");if(s.length>0&&e.push(`updated ${_s(s.map(l=>Ao(l,!!t.v8)))}`),a.length>0){const l=a.length===1?"page":"pages";e.push(`added the ${_s(a.map(i=>i.name))} ${l}`)}if(n.length>0){const l=n.length===1?"page":"pages";e.push(`removed the ${_s(n.map(i=>i.name))} ${l}`)}const o=t.blocks.map(Ro);if(o.length>0&&e.push(`changed ${_s(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=Na(e);return ai(d.charAt(0).toUpperCase()+d.slice(1))}function To(t,e){return t?yn(t,e).length:0}function Bo(t,e=!1){const s={newPageSections:t.kind==="page"&&t.status==="new"?To(t.toJson,e):null,sections:0,settings:!1,fields:0};if(s.newPageSections!==null)return s;for(const a of t.sections){if(a.kind==="settings"){s.settings=!0;continue}t.kind==="page"?s.sections+=1:s.fields+=a.fields.length}return s}const dr="••••••";function ps(t){if(Array.isArray(t))return t.map(ps);if(!t||typeof t!="object")return t;const e=t,s={};for(const[a,n]of Object.entries(e))s[a]=ps(n);return e.__resolveType===bo&&"ciphertext"in e&&(s.ciphertext=dr),Ja(e)&&"encrypted"in e&&(s.encrypted=dr),s}function ur(t){return t.map(e=>({...e,from:ps(e.from),to:ps(e.to)}))}function Io(t){const{changes:e,sides:s,lookup:a,meta:n,hosted:o}=t,d=[],l=[],i=c=>[...new Set((s?.diagnostics??[]).filter(h=>Xn(Qa(h.file))===Xn(c)).map(h=>h.side))],u=Object.keys(e).sort((c,h)=>c<h?-1:c>h?1:0);for(const c of u){const h=e[c],p=h.kind==="delete"?"removed":h.baseVersion===null?"new":"edited",b=s?.entries[c],f=b?.before??null,m=b?.after??null,g=Sa(a,c),v=g??m??f,j=i(c),w={blockKey:c,status:p,filepaths:[],entry:{name:c,version:h.version},...j.length>0?{unreadable:j}:{},fromJson:ps(f),toJson:ps(m??(p==="new"?g:null))},x=g?us(c,g,n):null,P=!g&&v?us(c,v,n):null;if(x??P??(!v&&Pa(c))){const k=v?us(c,v,n):null;d.push({...w,kind:"page",name:k?.name??da(c),pagePath:k?.path??null,isSiteApp:!1,sections:p==="edited"?Hn(f,m,!0).map(D=>({...D,fields:ur(D.fields)})):[]});continue}const y=o?Jl(c,v,g,m,f):null,N=y?Yl(y,[v,g,m,f]):Js(c,v??{}),C=go(c,[g,m,f]),A=jo(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:$n(c,g??v??{}),sections:p==="edited"?[{name:A?"Settings":N,kind:"section",status:"edited",fields:ur(A?wo(f,m):At(f,m,[]))}].filter(k=>k.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 $o(t,e){return e(t==="new"?"thread.publishPopover.chipNew":t==="removed"?"thread.publishPopover.chipRemoved":"thread.publishPopover.chipEdited")}function Fo(t,e){const s=t.kind==="block"?mi:Gr;return r.jsx("span",{title:$o(t.status,e),className:"flex shrink-0",children:r.jsx(s,{className:G("size-4",t.status==="new"&&"text-brand",t.status==="edited"&&"text-warning",t.status==="removed"&&"text-destructive")})})}function Lo(t,e){if(t.kind==="page")return t.pagePath;if(t.kind!=="block")return null;if(t.blogKind)return ei(t.blogKind,e);if(t.cmsSettings)return e("thread.publishPopover.settingsDetail");const s=va(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 Oo(t,e,s){const a=Bo(t,s);if(a.newPageSections!==null)return[a.newPageSections===1?e("thread.publishPopover.newPageSectionOne"):e("thread.publishPopover.newPageSections",{count:a.newPageSections})];const n=[];return a.sections===1?n.push(e("thread.publishPopover.sectionChangedOne")):a.sections>1&&n.push(e("thread.publishPopover.sectionsChanged",{count:a.sections})),a.fields===1?n.push(e("thread.publishPopover.fieldChangedOne")):a.fields>1&&n.push(e("thread.publishPopover.fieldsChanged",{count:a.fields})),a.settings&&n.push(e("thread.publishPopover.pageSettingsChanged")),n}function Ca(t){const e=I.c(46),{change:s,bodyPending:a,selected:n,onSelect:o,confirming:d,onConfirmingChange:l,onDiscard:i,isPublishing:u,isDiscarding:c,v8:h}=t,p=a===void 0?!1:a,b=h===void 0?!1:h,f=ge();let m;e[0]!==s||e[1]!==f?(m=Lo(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]!==u||e[9]!==l||e[10]!==i||e[11]!==o||e[12]!==n||e[13]!==f||e[14]!==b){const j=Oo(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=G("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=Fo(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=r.jsx("span",{className:"truncate text-sm font-medium",children:C}),e[27]=C,e[28]=A):A=e[28];let k;e[29]!==g?(k=g?r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:g}):null,e[29]=g,e[30]=k):k=e[30];let D;e[31]!==n||e[32]!==A||e[33]!==k?(D=r.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left","aria-pressed":n,children:[A,k]}),e[31]=n,e[32]=A,e[33]=k,e[34]=D):D=e[34];let S;e[35]!==d||e[36]!==c||e[37]!==u||e[38]!==l||e[39]!==i||e[40]!==f?(S=d?r.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[r.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground",onClick:B=>{B.stopPropagation(),l(!1)},children:f("thread.publishDialog.cancel")}),r.jsx("button",{type:"button",className:"text-xs font-medium text-destructive disabled:opacity-50",onClick:B=>{B.stopPropagation(),l(!1),i?.()},disabled:c,children:f("thread.publishPopover.discard")})]}):i?r.jsx(rn,{children:r.jsxs(at,{children:[r.jsx(lt,{asChild:!0,children:r.jsx(be,{type:"button",variant:"ghost-destructive",size:"icon-xs","aria-label":f("thread.publishPopover.discard"),className:"shrink-0 disabled:pointer-events-auto",onClick:B=>{B.stopPropagation(),l(!0)},disabled:u||c,children:r.jsx(ln,{className:"size-3.5"})})}),r.jsx(it,{children:f("thread.publishPopover.discard")})]})}):null,e[35]=d,e[36]=c,e[37]=u,e[38]=l,e[39]=i,e[40]=f,e[41]=S):S=e[41];let O;e[42]!==D||e[43]!==S||e[44]!==N?(O=r.jsxs("div",{className:"flex items-center gap-2.5",children:[N,D,S]}),e[42]=D,e[43]=S,e[44]=N,e[45]=O):O=e[45],v=r.jsxs(xa,{className:P,"data-change-id":y,onClick:o,children:[O,j.length>0?r.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px] text-xs text-muted-foreground",children:j.map(Mo)}):w?r.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px]",children:r.jsx(We,{className:"h-4 w-2/3"})}):null]}),e[3]=p,e[4]=s,e[5]=d,e[6]=g,e[7]=c,e[8]=u,e[9]=l,e[10]=i,e[11]=o,e[12]=n,e[13]=f,e[14]=b,e[15]=v}else v=e[15];return v}function Mo(t,e){return r.jsx("div",{className:"truncate",children:t},`${e}-${t}`)}function Aa(){const t=I.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,a]=U.useState(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=l=>{if(!l)return;const i=()=>a(c=>c.width===l.clientWidth&&c.height===l.clientHeight?c:{width:l.clientWidth,height:l.clientHeight});i();const u=new ResizeObserver(i);return u.observe(l),()=>u.disconnect()},t[1]=n):n=t[1];const o=n;let d;return t[2]!==s?(d=[s,o],t[2]=s,t[3]=d):d=t[3],d}function Eo(){return document.documentElement.classList.contains("dark")?"vs-dark":"vs"}const _o=[{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 hr(t){const e=I.c(10),{height:s}=t,a=ge();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=_o.map(zo),e[2]=o):o=e[2];let d;e[3]!==a?(d=a("thread.publishDialog.openingComparison"),e[3]=a,e[4]=d):d=e[4];let l;e[5]!==d?(l=r.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=r.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 zo(t,e){return r.jsxs("div",{className:G("flex items-center gap-2 rounded px-1 py-0.5",t.tone==="del"&&"bg-destructive/5",t.tone==="add"&&"bg-success/5"),children:[r.jsx("div",{className:G("h-2 w-4 shrink-0 animate-pulse rounded-sm bg-muted",t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")}),r.jsx("div",{className:G("h-2 animate-pulse rounded-sm bg-muted",t.width,t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")})]},e)}const Ra={readOnly:!0,renderSideBySide:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12},Uo={...Ra,lineNumbersMinChars:3,lineDecorationsWidth:4,folding:!1,glyphMargin:!1,renderOverviewRuler:!1};function Ko(t){const e=I.c(11),{diff:s,emptyMessage:a,rowClassName:n,onDiscardFile:o,hideFileRows:d,editorHeight:l}=t,i=a===void 0?"No file changes in the working tree":a,u=n===void 0?"px-6":n,c=d===void 0?!1:d,h=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=Eo(),e[0]=g):g=e[0];const v=g;if(!s||Object.keys(s.diffs).length===0){let w;return e[1]!==i?(w=r.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]!==h||e[6]!==p||e[7]!==c||e[8]!==o||e[9]!==u?(j=r.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,k=N===null,D=x.startsWith("/")?x.slice(1):x,S=D.lastIndexOf("/"),O=S>=0?D.slice(S+1):D,B=S>=0?D.slice(0,S):null,T=Ai(x),F=A?"bg-success":k?"bg-destructive":"bg-warning";return c?r.jsx("div",{children:r.jsx(nr,{original:y??"",modified:N??"",language:T,theme:v,height:h,loading:r.jsx(hr,{height:h}),options:Uo})},x):r.jsxs("div",{children:[r.jsxs("div",{className:G("flex items-center gap-3 py-3 hover:bg-accent",u),children:[r.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:r.jsx(Pr,{className:G("h-3.5 w-3.5 transition-transform",C&&"rotate-90")})}),r.jsx("div",{className:G("h-2.5 w-2.5 shrink-0 rounded-full",F)}),r.jsx(Gr,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:O}),B&&r.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:B}),o?r.jsxs(sn,{children:[r.jsx(en,{asChild:!0,children:r.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:r.jsx(Ya,{className:"h-3.5 w-3.5"})})}),r.jsx(tn,{align:"end",children:r.jsx(fs,{className:"text-destructive focus:text-destructive",onSelect:()=>m(x),children:"Discard changes"})})]}):null]}),f===x&&o?r.jsxs("div",{className:G("flex items-center justify-between gap-3 border-t bg-destructive/5 py-2.5",u),children:[r.jsxs("span",{className:"text-xs text-destructive",children:["Discard all changes to"," ",r.jsx("span",{className:"font-medium",children:O}),"? This cannot be undone."]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsx(be,{type:"button",variant:"ghost",size:"sm",onClick:()=>m(null),children:"Cancel"}),r.jsx(be,{type:"button",variant:"destructive",size:"sm",onClick:()=>{m(null),o(x)},children:"Discard"})]})]}):null,C&&r.jsx("div",{className:"border-t",children:r.jsx(nr,{original:y??"",modified:N??"",language:T,theme:v,height:h,loading:r.jsx(hr,{height:h}),options:Ra})})]},x)})}),e[3]=s.diffs,e[4]=f,e[5]=h,e[6]=p,e[7]=c,e[8]=o,e[9]=u,e[10]=j):j=e[10],j}function qo(t){if(t.kind!=="block"||t.isSiteApp||!t.blockKey)return null;const e=(t.toJson??t.fromJson)?.__resolveType;return typeof e=="string"&&Di(e)?t.blockKey:null}function Ho(t){return t.kind!=="page"?!0:!t.pagePath||Ct(t.pagePath).length>0}function Vo(t,e){try{return ol(t,si,e)}catch{return null}}function Go(t,e,s){if(!e)return;const a=ti(e,t);if(!a)return null;if(Ct(a.path).length===0||s?.path!==a.path)return a.path;const n=Fn(a.path,s.params);return Ct(n).length===0?n:a.path}function Wo(t){return t.sectionKey&&!t.v8?Vo(t.previewServerUrl,t.sectionKey):Jo(t.previewServerUrl,t.path)}function Qo(t,e){if(t.kind!=="page")return"/";const s=t.pagePath;if(!s)return"";if(Ct(s).length===0)return s;if(e?.path!==s)return"";const a=Fn(s,e.params);return Ct(a).length===0?a:""}function Jo(t,e){const s=e.trim();if(!s||Ct(s).length>0)return null;try{const a=new URL(t),n=new URL(s.startsWith("/")?s:`/${s}`,a);return n.origin===a.origin?n:null}catch{return null}}function Yo(t,e){return e?.kind==="pointer"&&e.link?Rn(t.toString(),e.link):Da(t,e)}function Da(t,e){if(!e)return null;if(e.kind==="pointer")return Rn(t.toString(),e.pointer);try{return new URL(`${t.pathname}${t.search}`,e.previewUrl).href}catch{return null}}function Xo(t,e,s){return e===null?!1:t!=="other"||s?.kind==="sandbox"}function Zo(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 Ta=U.createContext(!0),ec=["split","before","after","code"];function tc(t){return ec.includes(t)}const Ba={desktop:1280,mobile:412};function sc(t,e){const s=(o,d)=>t.unreadable?.includes(d)?e:o?`${JSON.stringify(o,null,2)}
|
|
1
|
+
import{c as I,b as ge,r as U,j as r,B as be,m as G,K as gs,al as Ka,t as rt,eL as qa,as as Pr,dL as kr,Y as fs,dM as Ha,aH as Ss,aI as Ns,aJ as Cs,aK as Gs,b7 as Ws,aL as As,aM as Rs,aN as Ds,X as en,Z as tn,_ as sn,a as nn,a4 as Bs,bY as Va,h as ms,eM as Sr,eN as Pn,bx as Ga,bm as Wa,br as Xn,eO as Qa,eP as Ja,am as Ya,I as Xa,a7 as Za,eQ as el,V as Nr,i as bt,eI as kn,q as Cr,J as Ar,D as Rr,x as Dr,v as Tr,Q as Br,R as Ir,aV as tl,b8 as $r,a5 as Sn,b4 as Nn,e as Zn,E as sl,T as nl}from"./index-D9poEv_S.js";import{S as rl}from"./separator-DCZYVGqN.js";import{f as al,u as xs,r as Fr,l as Lr,c as Or,b as ll}from"./chat-context-BLnGXGPp.js";import{u as Ot,a8 as il,a9 as Mr,aa as Er,c as Cn,b as An,N as Rn,ab as ol,M as cl,ac as dl,v as Dn,U as _r,ad as ul,H as hl,ae as fl,af as ml,g as zr}from"./site-editor-toast-BEmWExuz.js";import{L as pl}from"./use-org-notice-Fc3F28TT.js";import{I as Ur}from"./toolbar-icon-button-DeWs4WCs.js";import{b as bl,P as gl,a as xl}from"./popover-CP-hSbhT.js";import{c as at,T as lt,a as it,b as rn}from"./tooltip-BEauahba.js";import{f as vl,a as yl,c as jl,C as er,e as tr,b as sr}from"./command-D_N7zpwy.js";import{T as Ft,a as Kr,b as qr}from"./tabs-DNtYd_FL.js";import{t as Hr}from"./ChevronDown-BKlrlXc3.js";import{b as wl}from"./UserCheck01-C2z5zhQe.js";import{K as Vr,ab as an,a as Gr,F as Pl,b as kl,ac as Wr}from"./agent-icon-DkJRVLqK.js";import{a as Qr}from"./SwitchHorizontal01-BSYwKL4Y.js";import{b as Jr}from"./Tool01-BVIO9Qty.js";import{s as Yr}from"./Plus-i14Zi4mM.js";import{s as ln}from"./Trash01-P2MZx3ms.js";import{d as qs,e as Sl,s as Ms,f as Xr,u as Zr,n as Nl,g as Cl}from"./use-view-draft-kind-TCEqZWio.js";import{u as Tn}from"./use-blog-view-BD--oPX4.js";import{u as vs}from"./use-voice-input-fhkEdy7b.js";import{b as Al,d as ea}from"./session-runtime-D87un1xV.js";import{h as ta,r as sa,b as Is,g as Rl,e as Ee,f as na}from"./repository-binding-DnDGprHj.js";import{u as Dl}from"./use-debounced-value-DcMmpwkI.js";import{a as Tl,u as Bl}from"./shell-layout-DhXO3kdV.js";import{u as Il}from"./useInfiniteQuery-CA_opHOs.js";import{d as $l,b as Fl,p as Ll,e as ra,g as aa,h as la}from"./use-navigate-to-agent-BcceyDj5.js";import{u as on,n as ks,b as ia,a as Ol,c as Ml,d as El,r as Ps,g as _l,s as zl,e as Es,f as Ul}from"./cms-store-drafts-Bi9z0Tv5.js";import{e as Kl,g as ql,f as Bn}from"./thread-intent-DHr3JStM.js";import{a as Qs}from"./virtual-mcp-Cmf0LAEo.js";import{u as In}from"./use-blocks-v8-project-CIRMr5RK.js";import{G as oa}from"./github-icon-DBNhbuOq.js";import{k as Hl,r as Vl,c as ca,u as Gl}from"./use-sandbox-events-lKDZ1Wyg.js";import{a as Wl,b as Ql}from"./use-fast-preview-draft-url-DkfO7kpa.js";import{a3 as us,a4 as da,z as Js,o as $n,a5 as Jl,a6 as Yl,E as Xl,a7 as Zl,a8 as ei,p as ti,W as Ct,f as Fn,a9 as si}from"./blocks-tab-states-BSrtLgq9.js";import"./index-BwUztF-N.js";import{T as ni}from"./textarea-CUxYZmtB.js";import{i as Ln}from"./CheckCircle-CY8bNwGH.js";import{s as Ys}from"./Eye-kjpbNZjZ.js";import{n as ri,s as ai,C as li,a as ii,b as oi,M as ci,c as di,d as ui,m as hi,u as fi}from"./use-cms-publish-actions-S499FS9c.js";import{a as mi,h as pi}from"./UserSquare-B9MlTUcx.js";import{i as On,b as Mn,m as bi,h as gi,c as ua,f as ha,d as xi,r as En,e as vi,n as yi,g as ji,j as wi,k as Pi,l as _n,o as ki,p as fa,q as Si,s as zn,B as Ni,t as hn}from"./sandbox-git-api-Bi9RvPsJ.js";import{a as Ci,g as Ai}from"./utils-DHHEaoAA.js";import{i as Ri}from"./Monitor01-DihbBP9d.js";import{w as Un,R as ma}from"./device-hint-BeggFfp6.js";import{w as nr}from"./editor-BYfzbACz.js";import{i as Di,C as Ti}from"./section-array-field-BreHGIvy.js";import{T as Bi,a as rr}from"./toggle-group-7Kk4-ob3.js";import{s as pa}from"./save-changes-debug-nBi-n9eV.js";import{u as Ii}from"./use-mcp-client-DUKo5caa.js";import{t as $i}from"./Minimize01-BSWAuJc_.js";import{b as Fi,a as Li}from"./sandbox-lifecycle-context-C4V1kqms.js";import{b as Oi}from"./agent-capabilities-DepzNhfJ.js";import{c as Mi}from"./thread-route-DXN_3XgT.js";function Ei(t){const{value:e,baseBranch:s,releases:a,baseIsDraft:n=!1,storeDrafts:o=[]}=t,d=!n&&!!e&&e===s,l=a.find(c=>c.branch===e),i=d||l?void 0:o.find(c=>c.name===e),u=!d&&!l&&!i&&!!e;return i?{isBase:d,current:l,storeDraft:i,unlisted:u}:{isBase:d,current:l,unlisted:u}}const _i={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "},ar=1114111;function lr(t){return t?t.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(e,s)=>{if(s.startsWith("#x")||s.startsWith("#X")){const a=Number.parseInt(s.slice(2),16);return!Number.isFinite(a)||a>ar?e:String.fromCodePoint(a)}if(s.startsWith("#")){const a=Number.parseInt(s.slice(1),10);return!Number.isFinite(a)||a>ar?e:String.fromCodePoint(a)}return _i[s]??e}):""}function zi(t){const e=I.c(39),{url:s,onSave:a}=t,n=ge(),[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 u;e[2]!==a||e[3]!==i?(u=()=>a(i?Al(i):null),e[2]=a,e[3]=i,e[4]=u):u=e[4];const c=u;let h;e[5]!==n?(h=n("thread.branchPicker.localHint"),e[5]=n,e[6]=h):h=e[6];let p;e[7]!==h?(p=r.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[7]=h,e[8]=p):p=e[8];let b;e[9]!==n?(b=n("thread.branchPicker.localUrlLabel"),e[9]=n,e[10]=b):b=e[10];let f;e[11]!==n?(f=n("thread.branchPicker.localUrlPlaceholder"),e[11]=n,e[12]=f):f=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=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=r.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]!==a||e[23]!==n||e[24]!==s?(j=s?r.jsx(be,{variant:"ghost",size:"sm",className:"text-xs text-destructive hover:text-destructive",onClick:()=>a(null),children:n("thread.branchPicker.localTurnOff")}):r.jsx("span",{}),e[22]=a,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=r.jsx(be,{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=r.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=r.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 Ui(t){const e=I.c(8),{virtualMcpId:s,branch:a,serve:n,rowRef:o,onPicked:d}=t,l=Ot(s,a),i=!!n.connection,u=i&&l.kind==="protocol"&&l.source==="local";let c;e[0]!==d||e[1]!==n?(c=()=>Ki(n,d),e[0]=d,e[1]=n,e[2]=c):c=e[2];let h;return e[3]!==o||e[4]!==i||e[5]!==u||e[6]!==c?(h=r.jsx(qi,{rowRef:o,selected:i,connected:u,onSelect:c}),e[3]=o,e[4]=i,e[5]=u,e[6]=c,e[7]=h):h=e[7],h}function Ki(t,e){e?.(),!t.connection&&t.set({endpoint:t.lastEndpoint??il})}function qi(t){const e=I.c(19),{rowRef:s,selected:a,connected:n,onSelect:o}=t,d=ge(),l=a?"bg-accent":"hover:bg-accent";let i;e[0]!==l?(i=G("flex rounded-lg",l),e[0]=l,e[1]=i):i=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=r.jsx("span",{"data-testid":"localhost-dot",className:"h-2 w-2 shrink-0 rounded-full bg-foreground"}),e[2]=u):u=e[2];let c;e[3]!==d?(c=d("thread.branchPicker.localhost.label"),e[3]=d,e[4]=c):c=e[4];let h;e[5]!==c?(h=r.jsx("span",{className:"min-w-0 flex-1 truncate",children:c}),e[5]=c,e[6]=h):h=e[6];let p;e[7]!==n||e[8]!==d?(p=n&&r.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]!==a||e[12]!==h||e[13]!==p?(b=r.jsxs("button",{type:"button","aria-pressed":a,onClick:o,className:"flex w-full min-w-0 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[u,h,p]}),e[10]=o,e[11]=a,e[12]=h,e[13]=p,e[14]=b):b=e[14];let f;return e[15]!==s||e[16]!==i||e[17]!==b?(f=r.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 Hi=10080*60*1e3;function Vi({sandboxMap:t,userId:e,rawBranches:s,now:a}){const n=new Map;for(const[h,p]of Object.entries(t??{}))for(const[b,f]of Object.entries(p??{})){let m=n.get(b);m||(m={userIds:new Set,lastActiveAt:0},n.set(b,m)),m.userIds.add(h);for(const g of Object.values(f??{})){const v=g?.createdAt??0;v>m.lastActiveAt&&(m.lastActiveAt=v)}}const o=a-Hi,d=[...n.entries()].filter(([,h])=>h.lastActiveAt>=o).sort((h,p)=>p[1].lastActiveAt-h[1].lastActiveAt).map(([h,p])=>({name:h,source:"recent",contributors:[...p.userIds],lastActiveAt:p.lastActiveAt})),l=new Set(d.map(h=>h.name)),i=new Set(Object.keys(t?.[e]??{})),u=[...i].filter(h=>!l.has(h)).sort().map(h=>({name:h,source:"yours"})),c=s.filter(h=>!i.has(h.name)&&!l.has(h.name)).map(h=>({name:h.name,source:"other",author:h.author??null}));return{recent:d,yours:u,others:c}}const Gi=100,Wi=50,Qi=300;function xn(t,e){const s=e.trim().toLowerCase();return s?t.toLowerCase().includes(s):!0}function Ji(t){const e=I.c(39),{orgId:s,orgSlug:a,userId:n,target:o,sandboxMap:d,owner:l,repo:i,search:u,enabled:c}=t,h=u===void 0?"":u,p=c===void 0?!0:c;let b;e[0]!==h?(b=h.trim(),e[0]=h,e[1]=b):b=e[1];const f=b,m=Dl(f,Qi);let g;e[2]!==o?(g=ta(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]!==a||e[7]!==l||e[8]!==i||e[9]!==o?(w=gs.githubBranchSearch(s,a,sa(o),l,i,m),e[4]=m,e[5]=s,e[6]=a,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]!==a||e[13]!==o?(P=$=>{const{pageParam:ee}=$;return Ka(a,"REPOSITORY_SEARCH_BRANCHES",{...o,query:m,limit:m?Wi:Gi,cursor:ee})},e[11]=m,e[12]=a,e[13]=o,e[14]=P):P=e[14];let y;e[15]!==m?(y=$=>m?void 0:$.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:k,isFetching:D,hasNextPage:S,isFetchingNextPage:O,fetchNextPage:B}=Il(N),T=j&&(m!==f||D),F=(C?.pages??[]).flatMap(Yi),L=Tl(6e4),W=Vi({sandboxMap:d,userId:n,rawBranches:F,now:L});let q;e[22]!==f?(q=$=>xn($.name,f),e[22]=f,e[23]=q):q=e[23];const X=W.recent.filter(q);let M;e[24]!==f?(M=$=>xn($.name,f),e[24]=f,e[25]=M):M=e[25];const H=W.yours.filter(M),J=W.others,ne=C?.pages[0],Q=j&&ne&&!T?Math.max(0,ne.totalCount-ne.branches.length):0,he=!j&&S;let Z;e[26]!==B?(Z=()=>{B()},e[26]=B,e[27]=Z):Z=e[27];let re;return e[28]!==Q||e[29]!==k||e[30]!==O||e[31]!==A||e[32]!==T||e[33]!==J||e[34]!==X||e[35]!==he||e[36]!==Z||e[37]!==H?(re={recent:X,yours:H,others:J,isLoading:A,isError:k,isSearching:T,hiddenMatchCount:Q,hasMore:he,isFetchingMore:O,fetchMore:Z},e[28]=Q,e[29]=k,e[30]=O,e[31]=A,e[32]=T,e[33]=J,e[34]=X,e[35]=he,e[36]=Z,e[37]=H,e[38]=re):re=e[38],re}function Yi(t){return t.branches}function Xi(t){const e=I.c(8),s=ge(),{releases:a,createRelease:n}=on(t.virtualMcpId),o=Is(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]!==a||e[6]!==s?(d=()=>{if(a.length>=Qs)return rt.error(s("thread.branchPicker.capReached",{max:Qs})),null;const l=t.kind==="blog"?Kl(t.userLabel):ql(t.userLabel);return n({branch:l,name:ia(a,s(qs(l))),color:ks(a.length),createdBy:t.userId,createdAt:new Date().toISOString(),...o?{runtime:ea(o.metadata)}:{}}).catch(i=>{rt.error(s("thread.branchPicker.saveError"),{description:Mr(s,Er(i))})}),l},e[0]=n,e[1]=t.kind,e[2]=t.userId,e[3]=t.userLabel,e[4]=o,e[5]=a,e[6]=s,e[7]=d):d=e[7],d}const Xs="-mx-[3px] h-3.5 w-3.5 shrink-0";function Zi(t){const e=I.c(120),{virtualMcpId:s,isV8:a,userLabel:n,value:o,baseBranch:d,baseIsDraft:l,orgId:i,orgSlug:u,userId:c,target:h,owner:p,repo:b,sandboxMap:f,onChange:m,onCreateBranch:g,onAdoptBranch:v,disabled:j,spawnsNewChat:w,placement:x,draftKind:P}=t,y=a===void 0?!1:a,N=l===void 0?!1:l,C=j===void 0?!1:j,A=w===void 0?!1:w,k=x===void 0?"chat":x,D=P===void 0?"site":P,S=ge(),B=Tn()?D:null,T=k==="header",[F,L]=U.useState(!1),[W,q]=U.useState(!1),[X,M]=U.useState("branches"),[H,J]=U.useState(null),[ne,Q]=U.useState(""),[he,Z]=U.useState(null),[re,$]=U.useState(null),ee=U.useRef(null),{releases:K,createRelease:te,renameRelease:se,deleteRelease:Pe}=on(s),ae=B??void 0;let ie;e[0]!==ae||e[1]!==c||e[2]!==n||e[3]!==s?(ie={virtualMcpId:s,userLabel:n,userId:c,kind:ae},e[0]=ae,e[1]=c,e[2]=n,e[3]=s,e[4]=ie):ie=e[4];const de=Xi(ie),{projectDefault:oe}=vs(s);let z;e[5]!==oe?(z=R=>Ul(R,oe)==="sandbox",e[5]=oe,e[6]=z):z=e[6];const fe=z,ke=Ol(s,y),me=y?Ml(K,ke.data):[],Y=ke.refetch,E=El(s),{url:ce,setUrl:Ie,clear:Qe}=Cn(s),Se=An(s),gt=y&&!!Se.connection,Je=y?Se.connection?.endpoint??null:ce,ve=!!Je;let xe;e[7]!==Qe||e[8]!==y||e[9]!==Se?(xe=()=>{Qe(),y&&Se.clear()},e[7]=Qe,e[8]=y,e[9]=Se,e[10]=xe):xe=e[10];const Ae=xe;let Be;e[11]!==F?(Be={enabled:F},e[11]=F,e[12]=Be):Be=e[12];const{data:_e}=qa(Be);let Te;e[13]!==_e?.data?.members?(Te=R=>R?_e?.data?.members?.find(we=>we.userId===R)?.user?.name??void 0:void 0,e[13]=_e?.data?.members,e[14]=Te):Te=e[14];const Rt=Te,Me=K.length>=Qs;let $e;e[15]!==B||e[16]!==oe||e[17]!==K?($e=R=>!!Ms(K,R.branch,B,oe),e[15]=B,e[16]=oe,e[17]=K,e[18]=$e):$e=e[18];const pe=$e,ot=S("thread.branchPicker.capReached",{max:Qs}),{isBase:Ye,current:ct,storeDraft:Fe,unlisted:_}=Ei({value:o,baseBranch:d,releases:K,baseIsDraft:N,storeDrafts:me}),le=Sl(K,B,o);let ye;e[19]!==B||e[20]!==o?(ye=R=>B===null||Xr(R.name)===B||R.name===o,e[19]=B,e[20]=o,e[21]=ye):ye=e[21];const Re=me.filter(ye),Xe=Ye?S("thread.branchPicker.live"):ct?.name??Fe?.name??S(qs(o)),dt=gt?S("thread.branchPicker.localhost.label"):ve?S("thread.branchPicker.localLabel"):o?Xe:S("thread.branchPicker.selectVersion"),Et=gt?"bg-foreground":ve?"bg-special":Ye?"bg-success":Fe?Ps(void 0):Ps(ct?.color??"orange"),Ne=!gt&&!ve&&!Ye&&!!ct&&fe(ct),Ze=R=>{Ae();const we=me.some(Nt=>Nt.name===R)?{runtime:"cms"}:K.find(Nt=>Nt.branch===R);m(R,we&&{runtime:we.runtime}),L(!1)};let ut;e[22]!==S?(ut=R=>{rt.error(S("thread.branchPicker.saveError"),{description:Mr(S,Er(R))})},e[22]=S,e[23]=ut):ut=e[23];const et=ut;let _t;e[24]!==Ie?(_t=R=>{Ie(R),q(!1),L(!1)},e[24]=Ie,e[25]=_t):_t=e[25];const ys=_t,Dt=(R,we)=>{if(Ae(),v){v(R),q(!1),L(!1);return}if(!K.some(Nt=>Nt.branch===R)){if(Me){rt.error(ot);return}te({branch:R,name:we.trim()||R,color:ks(K.length),createdBy:c,createdAt:new Date().toISOString()}).catch(et)}m(R),q(!1),L(!1)};let xt;e[26]!==Ae||e[27]!==m||e[28]!==g||e[29]!==de?(xt=()=>{const R=de();R&&(Ae(),(g??m)(R),L(!1))},e[26]=Ae,e[27]=m,e[28]=g,e[29]=de,e[30]=xt):xt=e[30];const js=xt;let tt;e[31]===Symbol.for("react.memo_cache_sentinel")?(tt=()=>{J(null),Q(""),q(!1),M("branches")},e[31]=tt):tt=e[31];const Tt=tt;let vt;e[32]===Symbol.for("react.memo_cache_sentinel")?(vt=R=>{M(R),q(!0)},e[32]=vt):vt=e[32];const yt=vt;let jt;e[33]===Symbol.for("react.memo_cache_sentinel")?(jt=R=>{J(R.branch),Q(R.name)},e[33]=jt):jt=e[33];const zt=jt;let wt;e[34]!==ne||e[35]!==se||e[36]!==et?(wt=R=>{const we=ne.trim();we&&se(R,we).catch(et),J(null),Q("")},e[34]=ne,e[35]=se,e[36]=et,e[37]=wt):wt=e[37];const Ut=wt,Kt=R=>{const we=R===void 0?o:R,Nt=ne.trim();if(Nt&&we){if(Me){rt.error(ot),J(null),Q("");return}te({branch:we,name:Nt,color:ks(K.length),createdBy:c,createdAt:new Date().toISOString()}).catch(et)}J(null),Q("")};let Pt;e[38]===Symbol.for("react.memo_cache_sentinel")?(Pt=()=>{J(null),Q("")},e[38]=Pt):Pt=e[38];const ht=Pt,Bt=()=>{const R=he;if(Z(null),!(!R||!pe(R))){if(R.branch===o){const we=Ms(K,R.branch,B,oe);we?Ze(we.branch):L(!1)}else L(!1);Pe(R.branch).catch(et)}},ft=_l(le,oe),ws=(ft.content.length>0||Re.length>0)&&ft.code.length>0,It=R=>H===R.branch?r.jsx(fn,{value:ne,onChange:Q,onSave:()=>Ut(R.branch),onCancel:ht},R.branch):r.jsx(mn,{rowRef:!ve&&R.branch===o?ee:void 0,dot:Ps(R.color),codeIcon:fe(R)?Es(R.color):void 0,label:R.name,creator:Rt(R.createdBy),originTooltip:y?S("thread.branchPicker.viaStudioUi"):void 0,branch:!y||fe(R)?R.branch:void 0,selected:!ve&&R.branch===o,onSelect:()=>Ze(R.branch),onRename:()=>zt(R),onDelete:()=>Z(R),deleteBlocked:!pe(R)},R.branch),$t=()=>{const R=re;if($(null),!!R){if(R.name===o){const we=Ms(K,R.name,B,oe);if(!we)return;Ze(we.branch)}E.mutateAsync(R.name).catch(we=>{rt.error(S("thread.branchPicker.discardStoreDraftError"),{description:we instanceof Error?we.message:void 0})})}},mt=Re.map(R=>H===R.name?r.jsx(fn,{value:ne,onChange:Q,onSave:()=>Kt(R.name),onCancel:ht},`store:${R.name}`):r.jsx(mn,{rowRef:!ve&&R.name===o?ee:void 0,dot:Ps(void 0),label:R.name,creator:Rt(R.createdBy),agentIcon:Es(ks(me.indexOf(R))),originTooltip:S("thread.branchPicker.storeDraftVia",{via:zl(R.via)}),selected:!ve&&R.name===o,onSelect:()=>Ze(R.name),onRename:()=>{J(R.name),Q(R.name)},onDelete:()=>$(R),deleteBlocked:R.name===o&&!Ms(K,R.name,B,oe)},`store:${R.name}`));let ze;e[39]!==C||e[40]!==y||e[41]!==Y?(ze=C?void 0:R=>{R?y&&Y():Tt(),L(R)},e[39]=C,e[40]=y,e[41]=Y,e[42]=ze):ze=e[42];const st=T?"text-xs":"text-xs text-muted-foreground hover:text-foreground";let Ue;e[43]!==st?(Ue=G("shrink min-w-0 max-w-[220px] gap-2",st,Ur),e[43]=st,e[44]=Ue):Ue=e[44];let Ke;e[45]!==C?(Ke=!C&&r.jsx(Hr,{size:12,className:"opacity-60 shrink-0"}),e[45]=C,e[46]=Ke):Ke=e[46];let qe;e[47]!==dt?(qe=r.jsx(it,{children:dt}),e[47]=dt,e[48]=qe):qe=e[48];const nt=bl,kt="w-[min(300px,calc(100vw-2rem))] p-1.5",St="start";let Le;e[49]===Symbol.for("react.memo_cache_sentinel")?(Le=R=>{R.preventDefault(),ee.current?.scrollIntoView({block:"nearest"})},e[49]=Le):Le=e[49];let He;e[50]!==A||e[51]!==S?(He=A&&r.jsx("p",{className:"px-2 pb-1.5 pt-1 text-xs text-muted-foreground",children:S("thread.branchPicker.newChatHint")}),e[50]=A,e[51]=S,e[52]=He):He=e[52];const V=W?r.jsx(to,{orgId:i,orgSlug:u,userId:c,target:h,owner:p,repo:b,sandboxMap:f,enabled:F,tab:X,onTabChange:M,isV8:y,localUrl:ce,onSaveLocal:ys,onBack:()=>q(!1),onAdopt:Dt,draftKind:B}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:G("always-scrollbar flex max-h-[min(50vh,20rem)] flex-col overflow-y-auto",y&&"gap-1"),children:[!y&&ve&&Je&&r.jsx(eo,{rowRef:ee,url:Je,onSelect:()=>yt("local"),onEdit:()=>yt("local"),onTurnOff:()=>Ae()}),_&&o&&(H===o?r.jsx(fn,{value:ne,onChange:Q,onSave:()=>Kt(),onCancel:ht}):r.jsx(mn,{rowRef:ve?void 0:ee,dot:Ps("orange"),label:S(qs(o)),branch:y?void 0:o,originTooltip:y?S("thread.branchPicker.viaStudioUi"):void 0,selected:!ve,onSelect:()=>Ze(o),onRename:()=>{J(o),Q(ia(K,S(qs(o))))}})),ws?r.jsxs(r.Fragment,{children:[r.jsx(ir,{children:S("thread.branchPicker.groupContent")}),ft.content.map(It),mt,r.jsx(ir,{divided:!0,children:S("thread.branchPicker.groupCode")}),ft.code.map(It)]}):r.jsxs(r.Fragment,{children:[le.map(It),mt]}),y&&r.jsx(Ui,{virtualMcpId:s,branch:o,serve:Se,rowRef:gt?ee:void 0,onPicked:()=>L(!1)})]}),(_||le.length>0||Re.length>0||y)&&r.jsx("div",{className:"my-1 border-t"}),r.jsxs("button",{type:"button",onClick:()=>{js()},disabled:Me,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:[r.jsx(Yr,{className:"h-4 w-4 shrink-0"}),S("thread.branchPicker.newVersion")]}),Me&&r.jsx("p",{className:"px-2 pb-1 pt-0.5 text-xs text-warning",children:ot}),r.jsxs("button",{type:"button",onClick:()=>yt("branches"),className:G("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:[S("thread.branchPicker.advanced"),r.jsx(Pr,{className:"h-4 w-4 shrink-0"})]})]});let ue;e[53]!==nt||e[54]!==Le||e[55]!==He||e[56]!==V?(ue=r.jsxs(nt,{className:kt,align:St,onOpenAutoFocus:Le,children:[He,V]}),e[53]=nt,e[54]=Le,e[55]=He,e[56]=V,e[57]=ue):ue=e[57];const je=r.jsxs(gl,{open:F,onOpenChange:ze,children:[r.jsxs(at,{children:[r.jsx(lt,{asChild:!0,children:r.jsx("span",{className:"inline-flex min-w-0 shrink",children:r.jsx(xl,{asChild:!0,children:r.jsxs(be,{"data-tour":pl.branchPicker,variant:T?"outline":"ghost",size:T?"sm":"default","aria-label":dt,disabled:C,className:Ue,children:[Ne?r.jsx(Vr,{className:G(Xs,Es(ct?.color))}):Fe&&!ve?r.jsx(kr,{className:G(Xs,Es(ks(me.indexOf(Fe))))}):r.jsx("span",{className:G("h-2 w-2 shrink-0 rounded-full",o||ve?Et:"bg-muted-foreground")}),r.jsx("span",{className:"min-w-0 truncate @max-3xl/panel-header:hidden",children:dt}),Ke]})})})}),qe]}),ue]}),De=he!==null;let Oe;e[58]===Symbol.for("react.memo_cache_sentinel")?(Oe=R=>{R||Z(null)},e[58]=Oe):Oe=e[58];let Ve;e[59]!==S?(Ve=S("thread.branchPicker.deleteTitle"),e[59]=S,e[60]=Ve):Ve=e[60];let qt;e[61]!==Ve?(qt=r.jsx(Ss,{children:Ve}),e[61]=Ve,e[62]=qt):qt=e[62];let Ht;e[63]!==he||e[64]!==S?(Ht=he&&S("thread.branchPicker.deleteConfirm",{name:he.name}),e[63]=he,e[64]=S,e[65]=Ht):Ht=e[65];let Vt;e[66]!==Ht?(Vt=r.jsx(Ns,{children:Ht}),e[66]=Ht,e[67]=Vt):Vt=e[67];let Gt;e[68]!==qt||e[69]!==Vt?(Gt=r.jsxs(Cs,{children:[qt,Vt]}),e[68]=qt,e[69]=Vt,e[70]=Gt):Gt=e[70];let Wt;e[71]!==S?(Wt=S("thread.branchPicker.cancel"),e[71]=S,e[72]=Wt):Wt=e[72];let Qt;e[73]!==Wt?(Qt=r.jsx(Gs,{children:Wt}),e[73]=Wt,e[74]=Qt):Qt=e[74];let Jt;e[75]!==S?(Jt=S("thread.branchPicker.delete"),e[75]=S,e[76]=Jt):Jt=e[76];let Yt;e[77]!==Bt||e[78]!==Jt?(Yt=r.jsx(Ws,{onClick:Bt,variant:"destructive",children:Jt}),e[77]=Bt,e[78]=Jt,e[79]=Yt):Yt=e[79];let Xt;e[80]!==Qt||e[81]!==Yt?(Xt=r.jsxs(As,{children:[Qt,Yt]}),e[80]=Qt,e[81]=Yt,e[82]=Xt):Xt=e[82];let Zt;e[83]!==Gt||e[84]!==Xt?(Zt=r.jsxs(Rs,{children:[Gt,Xt]}),e[83]=Gt,e[84]=Xt,e[85]=Zt):Zt=e[85];let Fs;e[86]!==De||e[87]!==Zt?(Fs=r.jsx(Ds,{open:De,onOpenChange:Oe,children:Zt}),e[86]=De,e[87]=Zt,e[88]=Fs):Fs=e[88];const un=re!==null;let Ls;e[89]===Symbol.for("react.memo_cache_sentinel")?(Ls=R=>{R||$(null)},e[89]=Ls):Ls=e[89];let es;e[90]!==S?(es=S("thread.branchPicker.deleteTitle"),e[90]=S,e[91]=es):es=e[91];let ts;e[92]!==es?(ts=r.jsx(Ss,{children:es}),e[92]=es,e[93]=ts):ts=e[93];let ss;e[94]!==re||e[95]!==S?(ss=re&&S("thread.branchPicker.discardStoreDraftConfirm",{name:re.name}),e[94]=re,e[95]=S,e[96]=ss):ss=e[96];let ns;e[97]!==ss?(ns=r.jsx(Ns,{children:ss}),e[97]=ss,e[98]=ns):ns=e[98];let rs;e[99]!==ts||e[100]!==ns?(rs=r.jsxs(Cs,{children:[ts,ns]}),e[99]=ts,e[100]=ns,e[101]=rs):rs=e[101];let as;e[102]!==S?(as=S("thread.branchPicker.cancel"),e[102]=S,e[103]=as):as=e[103];let ls;e[104]!==as?(ls=r.jsx(Gs,{children:as}),e[104]=as,e[105]=ls):ls=e[105];let is;e[106]!==S?(is=S("thread.branchPicker.delete"),e[106]=S,e[107]=is):is=e[107];let os;e[108]!==$t||e[109]!==is?(os=r.jsx(Ws,{onClick:$t,variant:"destructive",children:is}),e[108]=$t,e[109]=is,e[110]=os):os=e[110];let cs;e[111]!==ls||e[112]!==os?(cs=r.jsxs(As,{children:[ls,os]}),e[111]=ls,e[112]=os,e[113]=cs):cs=e[113];let ds;e[114]!==rs||e[115]!==cs?(ds=r.jsxs(Rs,{children:[rs,cs]}),e[114]=rs,e[115]=cs,e[116]=ds):ds=e[116];let Os;return e[117]!==un||e[118]!==ds?(Os=r.jsx(Ds,{open:un,onOpenChange:Ls,children:ds}),e[117]=un,e[118]=ds,e[119]=Os):Os=e[119],r.jsxs(r.Fragment,{children:[je,Fs,Os]})}function fn(t){const e=I.c(20),{value:s,onChange:a,onSave:n,onCancel:o}=t,d=ge();let l;e[0]!==d?(l=d("thread.branchPicker.rename"),e[0]=d,e[1]=l):l=e[1];let i;e[2]!==a?(i=f=>a(f.target.value),e[2]=a,e[3]=i):i=e[3];let u;e[4]!==o||e[5]!==n?(u=f=>{f.key==="Enter"&&n(),f.key==="Escape"&&(f.preventDefault(),f.stopPropagation(),o())},e[4]=o,e[5]=n,e[6]=u):u=e[6];let c;e[7]!==l||e[8]!==i||e[9]!==u||e[10]!==s?(c=r.jsx("input",{autoFocus:!0,"aria-label":l,value:s,onChange:i,onKeyDown:u,className:"h-8 flex-1 rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[7]=l,e[8]=i,e[9]=u,e[10]=s,e[11]=c):c=e[11];let h;e[12]!==d?(h=d("thread.branchPicker.save"),e[12]=d,e[13]=h):h=e[13];let p;e[14]!==n||e[15]!==h?(p=r.jsx(be,{size:"sm",onClick:n,children:h}),e[14]=n,e[15]=h,e[16]=p):p=e[16];let b;return e[17]!==c||e[18]!==p?(b=r.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 ir(t){const e=I.c(5),{divided:s,children:a}=t,o=(s===void 0?!1:s)&&"mt-1 border-t";let d;e[0]!==o?(d=G("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]!==a||e[3]!==d?(l=r.jsx("p",{className:d,children:a}),e[2]=a,e[3]=d,e[4]=l):l=e[4],l}function mn(t){const e=I.c(53),{rowRef:s,dot:a,codeIcon:n,agentIcon:o,originTooltip:d,label:l,creator:i,branch:u,selected:c,onSelect:h,onRename:p,onDelete:b,deleteBlocked:f}=t,m=f===void 0?!1:f,g=ge();let v;e[0]!==o||e[1]!==n||e[2]!==a?(v=n?r.jsx(Vr,{className:G(Xs,n)}):o?r.jsx(kr,{className:G(Xs,o)}):r.jsx("span",{className:G("h-2 w-2 shrink-0 rounded-full",a)}),e[0]=o,e[1]=n,e[2]=a,e[3]=v):v=e[3];let j;e[4]!==i?(j=i&&r.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=r.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]!==h||e[10]!==c||e[11]!==v||e[12]!==w?(x=r.jsxs("button",{type:"button","aria-pressed":c,onClick:h,className:"flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[v,w]}),e[9]=h,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=G("group flex items-center rounded-lg",y),e[14]=y,e[15]=N):N=e[15];let C;e[16]!==u||e[17]!==n||e[18]!==d||e[19]!==P||e[20]!==g?(C=u||d?r.jsxs(at,{children:[r.jsx(lt,{asChild:!0,children:P}),r.jsxs(it,{side:"bottom",className:"text-xs",children:[n&&r.jsx("p",{className:"font-medium",children:g("thread.branchPicker.codeDraftTooltip")}),d&&r.jsx("p",{children:d}),u&&r.jsx("p",{className:"font-mono",children:g("thread.branchPicker.branchTooltip",{branch:u})})]})]}):P,e[16]=u,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 k;e[24]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Qr,{className:"h-4 w-4"}),e[24]=k):k=e[24];let D;e[25]!==A?(D=r.jsx(en,{asChild:!0,children:r.jsx(be,{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:k})}),e[25]=A,e[26]=D):D=e[26];let S;e[27]===Symbol.for("react.memo_cache_sentinel")?(S=r.jsx(Jr,{className:"h-4 w-4"}),e[27]=S):S=e[27];let O;e[28]!==g?(O=g("thread.branchPicker.rename"),e[28]=g,e[29]=O):O=e[29];let B;e[30]!==p||e[31]!==O?(B=r.jsxs(fs,{onSelect:p,children:[S,O]}),e[30]=p,e[31]=O,e[32]=B):B=e[32];let T;e[33]!==m||e[34]!==b||e[35]!==g?(T=b&&r.jsxs(fs,{onSelect:b,disabled:m,className:"text-destructive focus:text-destructive",children:[r.jsx(ln,{className:"h-4 w-4"}),g("thread.branchPicker.delete")]}),e[33]=m,e[34]=b,e[35]=g,e[36]=T):T=e[36];let F;e[37]!==m||e[38]!==b||e[39]!==g?(F=b&&m&&r.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]=F):F=e[40];let L;e[41]!==B||e[42]!==T||e[43]!==F?(L=r.jsxs(tn,{align:"end",children:[B,T,F]}),e[41]=B,e[42]=T,e[43]=F,e[44]=L):L=e[44];let W;e[45]!==D||e[46]!==L?(W=r.jsxs(sn,{children:[D,L]}),e[45]=D,e[46]=L,e[47]=W):W=e[47];let q;return e[48]!==s||e[49]!==W||e[50]!==N||e[51]!==C?(q=r.jsxs("div",{ref:s,className:N,children:[C,W]}),e[48]=s,e[49]=W,e[50]=N,e[51]=C,e[52]=q):q=e[52],q}function eo(t){const e=I.c(40),{rowRef:s,url:a,onSelect:n,onEdit:o,onTurnOff:d}=t,l=ge();let i;try{let D;e[0]!==a?(D=new URL(a),e[0]=a,e[1]=D):D=e[1],i=D.host}catch{i=a}const u=i;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-special"}),e[2]=c):c=e[2];let h;e[3]!==l?(h=l("thread.branchPicker.localLabel"),e[3]=l,e[4]=h):h=e[4];let p;e[5]!==u?(p=r.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:u}),e[5]=u,e[6]=p):p=e[6];let b;e[7]!==h||e[8]!==p?(b=r.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[h,p]}),e[7]=h,e[8]=p,e[9]=b):b=e[9];let f;e[10]!==n||e[11]!==b?(f=r.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=r.jsx(Qr,{className:"h-4 w-4"}),e[15]=g):g=e[15];let v;e[16]!==m?(v=r.jsx(en,{asChild:!0,children:r.jsx(be,{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=r.jsx(Jr,{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=r.jsxs(fs,{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=r.jsx(ln,{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=r.jsxs(fs,{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=r.jsxs(tn,{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=r.jsxs(sn,{children:[v,C]}),e[33]=C,e[34]=v,e[35]=A):A=e[35];let k;return e[36]!==s||e[37]!==A||e[38]!==f?(k=r.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]=k):k=e[39],k}function to(t){const e=I.c(75),{orgId:s,orgSlug:a,userId:n,target:o,owner:d,repo:l,sandboxMap:i,enabled:u,tab:c,onTabChange:h,isV8:p,localUrl:b,onSaveLocal:f,onBack:m,onAdopt:g,draftKind:v}=t,j=ge(),[w,x]=U.useState(""),P=c==="branches"?w:"",y=u&&c==="branches";let N;e[0]!==s||e[1]!==a||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:a,userId:n,target:o,sandboxMap:i,owner:d,repo:l,search:P,enabled:y},e[0]=s,e[1]=a,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:k,isLoading:D,hasMore:S,isFetchingMore:O,fetchMore:B}=Ji(N),T=u&&c==="prs";let F;e[10]!==s||e[11]!==a||e[12]!==d||e[13]!==l||e[14]!==T||e[15]!==o?(F={orgId:s,orgSlug:a,target:o,owner:d,repo:l,enabled:T},e[10]=s,e[11]=a,e[12]=d,e[13]=l,e[14]=T,e[15]=o,e[16]=F):F=e[16];const{data:L,isLoading:W}=$l(F);let q;if(e[17]!==v||e[18]!==B||e[19]!==S||e[20]!==O||e[21]!==D||e[22]!==p||e[23]!==b||e[24]!==g||e[25]!==m||e[26]!==f||e[27]!==h||e[28]!==k||e[29]!==d||e[30]!==W||e[31]!==C||e[32]!==l||e[33]!==w||e[34]!==j||e[35]!==L||e[36]!==c||e[37]!==A){const X=L===void 0?[]:L,M=`${d}/${l}`;let H;e[39]!==M?(H=M.toLowerCase(),e[39]=M,e[40]=H):H=e[40];const J=H;let ne;e[41]!==J?(ne=z=>z.headRepoFullName?.toLowerCase()===J,e[41]=J,e[42]=ne):ne=e[42];const Q=X.filter(ne);let he;if(e[43]!==v||e[44]!==k||e[45]!==C||e[46]!==A){const z=new Set;he=[...C,...A,...k].filter(fe=>z.has(fe.name)?!1:(z.add(fe.name),v!=="site"||Xr(fe.name)==="site")),e[43]=v,e[44]=k,e[45]=C,e[46]=A,e[47]=he}else he=e[47];const Z=he;let re;e[48]===Symbol.for("react.memo_cache_sentinel")?(re=r.jsx(wl,{className:"h-4 w-4 shrink-0"}),e[48]=re):re=e[48];let $;e[49]!==j?($=j("thread.branchPicker.advancedBack"),e[49]=j,e[50]=$):$=e[50];let ee;e[51]!==m||e[52]!==$?(ee=r.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,$]}),e[51]=m,e[52]=$,e[53]=ee):ee=e[53];let K;e[54]!==h?(K=z=>{h(z),x("")},e[54]=h,e[55]=K):K=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=r.jsx(Ft,{value:"branches",className:"h-6 px-2.5 text-xs",children:te}),e[58]=te,e[59]=se):se=e[59];let Pe;e[60]!==j?(Pe=j("thread.branchPicker.prsTab"),e[60]=j,e[61]=Pe):Pe=e[61];let ae;e[62]!==Pe?(ae=r.jsx(Ft,{value:"prs",className:"h-6 px-2.5 text-xs",children:Pe}),e[62]=Pe,e[63]=ae):ae=e[63];let ie;e[64]!==p||e[65]!==j?(ie=!p&&r.jsx(Ft,{value:"local",className:"h-6 px-2.5 text-xs",children:j("thread.branchPicker.localTab")}),e[64]=p,e[65]=j,e[66]=ie):ie=e[66];let de;e[67]!==se||e[68]!==ae||e[69]!==ie?(de=r.jsxs(Kr,{className:"h-auto w-fit justify-start gap-1 bg-accent p-1",variant:"pill",children:[se,ae,ie]}),e[67]=se,e[68]=ae,e[69]=ie,e[70]=de):de=e[70];let oe;e[71]!==K||e[72]!==de||e[73]!==c?(oe=r.jsx(qr,{className:"px-2 pt-2 pb-1",value:c,onValueChange:K,children:de}),e[71]=K,e[72]=de,e[73]=c,e[74]=oe):oe=e[74],q=r.jsxs("div",{className:"flex flex-col",children:[ee,oe,c==="local"&&!p?r.jsx(zi,{url:b,onSave:f}):r.jsxs(vl,{filter:c==="branches"?so:void 0,children:[r.jsx(yl,{placeholder:j(c==="branches"?"thread.branchPicker.searchBranches":"thread.branchPicker.searchPullRequests"),value:w,onValueChange:x}),r.jsx(jl,{onScroll:z=>{const fe=z.currentTarget;c==="branches"&&fe.scrollHeight-fe.scrollTop-fe.clientHeight<48&&B()},children:c==="branches"?r.jsxs(r.Fragment,{children:[D&&r.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:j("thread.branchPicker.loadingMore")}),!D&&Z.length===0&&r.jsx(er,{children:j("thread.branchPicker.noBranchesFound")}),Z.length>0&&r.jsx(tr,{children:Z.map(z=>r.jsxs(sr,{value:z.name,className:"cursor-pointer",onSelect:()=>g(z.name,z.name),children:[r.jsx(Ha,{className:"mr-2 h-4 w-4 shrink-0"}),r.jsx("span",{className:"flex-1 truncate",children:z.name})]},z.name))}),S&&r.jsx("div",{className:"p-2",children:r.jsx(be,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs",disabled:O,onClick:B,children:j(O?"thread.branchPicker.loadingMore":"thread.branchPicker.loadMoreBranches")})})]}):r.jsxs(r.Fragment,{children:[W&&r.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:j("thread.branchPicker.loadingPullRequests")}),!W&&Q.length===0&&r.jsx(er,{children:j("thread.branchPicker.noOpenPullRequests")}),Q.length>0&&r.jsx(tr,{children:Q.map(z=>r.jsxs(sr,{value:`#${z.number} ${z.title} ${z.head}`,className:"cursor-pointer",onSelect:()=>g(z.head,lr(z.title)),children:[r.jsx(an,{className:"mr-2 h-4 w-4 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[r.jsx("span",{className:"truncate",children:lr(z.title)}),r.jsxs("span",{className:"truncate text-xs text-muted-foreground",children:["#",z.number," · ",z.head]})]})]},z.number))})]})})]})]}),e[17]=v,e[18]=B,e[19]=S,e[20]=O,e[21]=D,e[22]=p,e[23]=b,e[24]=g,e[25]=m,e[26]=f,e[27]=h,e[28]=k,e[29]=d,e[30]=W,e[31]=C,e[32]=l,e[33]=w,e[34]=j,e[35]=L,e[36]=c,e[37]=A,e[38]=q}else q=e[38];return q}function so(t,e){return xn(t,e)?1:0}function no(t){const e=I.c(20),{locked:s,placement:a,value:n,virtualMcpId:o,isV8:d,userLabel:l,baseBranch:i,baseIsDraft:u,onChange:c,onCreateBranch:h,onAdoptBranch:p,orgId:b,orgSlug:f,userId:m,target:g,owner:v,repo:j,sandboxMap:w,draftKind:x}=t;let P;return e[0]!==i||e[1]!==u||e[2]!==x||e[3]!==d||e[4]!==s||e[5]!==p||e[6]!==c||e[7]!==h||e[8]!==b||e[9]!==f||e[10]!==v||e[11]!==a||e[12]!==j||e[13]!==w||e[14]!==g||e[15]!==m||e[16]!==l||e[17]!==n||e[18]!==o?(P=r.jsx(Zi,{virtualMcpId:o,isV8:d,userLabel:l,value:n,baseBranch:i,baseIsDraft:u,orgId:b,orgSlug:f,userId:m,target:g,owner:v,repo:j,sandboxMap:w,onChange:c,onCreateBranch:h,onAdoptBranch:p,spawnsNewChat:s,placement:a,draftKind:x}),e[0]=i,e[1]=u,e[2]=x,e[3]=d,e[4]=s,e[5]=p,e[6]=c,e[7]=h,e[8]=b,e[9]=f,e[10]=v,e[11]=a,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 ro(t){const e=I.c(2),{branchPill:s}=t;if(!s)return null;let a;return e[0]!==s?(a=r.jsx(r.Fragment,{children:s}),e[0]=s,e[1]=a):a=e[1],a}function ao(t){const{locked:e,sessionRuntime:s,projectRuntime:a,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"&&a==="cms"&&!o?{kind:"new-chat"}:e?s==="sandbox"?{kind:"new-chat",runtime:"sandbox"}:{kind:"new-chat"}:{kind:"switch"}}function lo(t){const e=I.c(25),{virtualMcp:s,currentBranch:a}=t,n=al(),o=xs();let d;e[0]!==n?.messages||e[1]!==o?.isThreadLocked?(d=(n?.messages??[]).length>0||(o?.isThreadLocked??!1),e[0]=n?.messages,e[1]=o?.isThreadLocked,e[2]=d):d=e[2];const l=d,i=o?.setCurrentTaskBranch,u=o?.createTask,c=Zr()==="blog"?"blog":"site",h=vs(s?.id),p=h.runtime,b=s?.metadata;let f;e[3]!==b?(f=ea(b),e[3]=b,e[4]=f):f=e[4];const m=f,g=m==="cms"&&p==="sandbox",v=Rl(s),j=Ee(v),{data:w}=nn.useSession(),x=w?.user;let P;e[5]!==x?(P=Bn(x),e[5]=x,e[6]=P):P=e[6];const y=P,N=w?.user?.id??"",{org:C}=Bs(),A=Fl(s,a),k=In(s?.id),D=k&&p==="cms";let S;e[7]!==u||e[8]!==a||e[9]!==l||e[10]!==m||e[11]!==p||e[12]!==h.resolved||e[13]!==i||e[14]!==k?(S=(X,M)=>{const H=ao({locked:l,sessionRuntime:h.resolved?p:null,projectRuntime:m,draftRuntime:M&&(M.runtime??m),current:X===a,contentOnly:k});H.kind==="new-chat"&&u?u({branch:X,...H.runtime?{runtime:H.runtime}:{}}):i&&i(X)},e[7]=u,e[8]=a,e[9]=l,e[10]=m,e[11]=p,e[12]=h.resolved,e[13]=i,e[14]=k,e[15]=S):S=e[15];const O=S;let B;e[16]!==g||e[17]!==u||e[18]!==l||e[19]!==i?(B=X=>{(l||g)&&u?u({branch:X}):i&&i(X)},e[16]=g,e[17]=u,e[18]=l,e[19]=i,e[20]=B):B=e[20];const T=B;let F;e[21]!==u?(F=u?X=>u({runtime:"sandbox",branch:X}):void 0,e[21]=u,e[22]=F):F=e[22];const L=F,W=v&&ta(j)?r.jsx(no,{userLabel:y,virtualMcpId:s?.id??"",isV8:k,value:a,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:O,onCreateBranch:T,onAdoptBranch:L,locked:l,placement:"chat",draftKind:c},`${sa(j)}:${v.owner}/${v.name}`):null;let q;return e[23]!==W?(q=r.jsx(ro,{branchPill:W}),e[23]=W,e[24]=q):q=e[24],q}const io=Va("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 oo(t){const e=I.c(11);let s,a,n;e[0]!==t?({className:s,orientation:a,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n):(s=e[1],a=e[2],n=e[3]);let o;e[4]!==s||e[5]!==a?(o=G(io({orientation:a}),s),e[4]=s,e[5]=a,e[6]=o):o=e[6];let d;return e[7]!==a||e[8]!==n||e[9]!==o?(d=r.jsx("div",{role:"group","data-slot":"button-group","data-orientation":a,className:o,...n}),e[7]=a,e[8]=n,e[9]=o,e[10]=d):d=e[10],d}function co(t){const e=I.c(14),{item:s}=t;let a;e[0]!==s?(a=()=>{s.onSelect()},e[0]=s,e[1]=a):a=e[1];let n;e[2]!==s.disabled||e[3]!==s.icon||e[4]!==s.label||e[5]!==a?(n=r.jsxs(fs,{disabled:s.disabled,onSelect:a,children:[s.icon,s.label]}),e[2]=s.disabled,e[3]=s.icon,e[4]=s.label,e[5]=a,e[6]=n):n=e[6];const o=n;if(!s.tooltip)return o;let d;e[7]!==o?(d=r.jsx(lt,{asChild:!0,children:o}),e[7]=o,e[8]=d):d=e[8];let l;e[9]!==s.tooltip?(l=r.jsx(it,{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=r.jsxs(at,{children:[d,l]}),e[11]=d,e[12]=l,e[13]=i):i=e[13],i}function ba(t){const e=I.c(20),{label:s,onClick:a,variant:n,size:o,disabled:d,loading:l,pulse:i,tooltip:u,icon:c,items:h,menuAriaLabel:p,className:b}=t,f=n===void 0?"default":n,m=o===void 0?"default":o,g=d===void 0?!1:d,v=l===void 0?!1:l,j=i===void 0?!1:i,w=(h?.length??0)>0;let x;if(e[0]!==b||e[1]!==g||e[2]!==w||e[3]!==c||e[4]!==h||e[5]!==s||e[6]!==v||e[7]!==p||e[8]!==a||e[9]!==j||e[10]!==m||e[11]!==u||e[12]!==f){const P=G(Ur,f==="default"&&"focus-visible:inset-ring-current");let y;e[14]!==c||e[15]!==v?(y=v?r.jsx(ms,{size:"xs"}):c,e[14]=c,e[15]=v,e[16]=y):y=e[16];const N=r.jsxs(be,{type:"button",variant:f,size:m,disabled:g,"aria-busy":v||void 0,onClick:v?void 0:a,className:G(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=G(C,b),e[17]=b,e[18]=C,e[19]=A):A=e[19],x=r.jsxs(oo,{className:A,children:[u?r.jsxs(at,{children:[r.jsx(lt,{asChild:!0,children:r.jsx("span",{className:G("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})}),r.jsx(it,{children:u})]}):N,w?r.jsxs(sn,{children:[r.jsx(en,{asChild:!0,children:r.jsx(be,{type:"button",variant:f,size:m,"aria-label":p,className:G("has-[>svg]:px-2",P),children:r.jsx(Hr,{className:"size-3.5"})})}),r.jsx(tn,{align:"end",children:h?.map(uo)})]}):null]}),e[0]=b,e[1]=g,e[2]=w,e[3]=c,e[4]=h,e[5]=s,e[6]=v,e[7]=p,e[8]=a,e[9]=j,e[10]=m,e[11]=u,e[12]=f,e[13]=x}else x=e[13];return x}function uo(t){return r.jsx(co,{item:t},t.key)}async function ho(t){if(t.hosted)return;const e=t.branch;await t.setCurrentTaskBranch(t.nextBranch()),e&&e!==t.baseBranch&&await t.deleteRelease(e)}function fo(t,e,{hosted:s}){return s&&t!==null?t:e}function mo(t,e){const s=I.c(11),[a,n]=U.useState(null);let o;s[0]!==a||s[1]!==t||s[2]!==e?(o=fo(a,t,e),s[0]=a,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 po({open:t,hosted:e}){return t||e}function ga(t){return ri({userName:t?.name,userEmail:t?.email})??void 0}function cn(t){const e=I.c(18),{state:s,header:a,body:n,note:o,gate:d,footer:l}=t,i=s!=="ready";let u;e[0]!==a?(u=r.jsx("div",{className:"space-y-0.5 px-4 py-3",children:a}),e[0]=a,e[1]=u):u=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx("div",{className:"border-t"}),e[2]=c):c=e[2];let h;e[3]!==o?(h=o?r.jsx("div",{className:"space-y-1.5 border-t px-4 py-3",children:o}):null,e[3]=o,e[4]=h):h=e[4];let p;e[5]!==n||e[6]!==h?(p=r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n,h]}),e[5]=n,e[6]=h,e[7]=p):p=e[7];let b;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx("div",{className:"border-t"}),e[8]=b):b=e[8];let f;e[9]!==l?(f=r.jsx("div",{className:"space-y-2 px-4 py-3",children:l}),e[9]=l,e[10]=f):f=e[10];let m;return e[11]!==d||e[12]!==s||e[13]!==i||e[14]!==u||e[15]!==p||e[16]!==f?(m=r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col","data-publish-state":s,"aria-busy":i,children:[u,c,p,d,b,f]}),e[11]=d,e[12]=s,e[13]=i,e[14]=u,e[15]=p,e[16]=f,e[17]=m):m=e[17],m}function Ts(t){const e=I.c(2),{children:s}=t;let a;return e[0]!==s?(a=r.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]=a):a=e[1],a}function xa(t){const e=I.c(10);let s,a,n;e[0]!==t?({className:a,children:s,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n):(s=e[1],a=e[2],n=e[3]);let o;e[4]!==a?(o=G("rounded-lg border bg-card px-3 py-2.5",a),e[4]=a,e[5]=o):o=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==o?(d=r.jsx("div",{className:o,...n,children:s}),e[6]=s,e[7]=n,e[8]=o,e[9]=d):d=e[9],d}function We(t){const e=I.c(4),{className:s}=t;let a;e[0]!==s?(a=G("animate-pulse rounded bg-muted motion-reduce:animate-none",s),e[0]=s,e[1]=a):a=e[1];let n;return e[2]!==a?(n=r.jsx("div",{className:a}),e[2]=a,e[3]=n):n=e[3],n}function Lt(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(xa,{children:r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx(We,{className:"size-4 rounded-md"}),r.jsx(We,{className:"h-3 w-24"}),r.jsx(We,{className:"h-2.5 w-16"}),r.jsx(We,{className:"ml-auto size-6 rounded"})]})}),t[0]=e):e=t[0],e}const bo="secret";function va(t){return t.kind!=="block"?null:t.namedRule??null}function go(t,e){const s=e.find(a=>a&&typeof a=="object");return s?Xl(s.__resolveType):Zl(t)}const xo=/(?:^|\/)\.deco\/blocks\/([^/]+)\.json$/;function Kn(t){const e=xo.exec(t)?.[1];return e?Ci(e):null}function Zs(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 vo(t,e){return t===null?"new":e===null?"removed":"edited"}function ya(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 hs(t,e,s=!1){if(t&&typeof t=="object"&&!Array.isArray(t)){const a=t.__resolveType;if(typeof a=="string"&&a.trim()){if(s)return Ga(a);const o=(a.split("/").pop()??a).replace(/\.[jt]sx?$/,"");return ya(o)||o}}return`Section ${e+1}`}function qn(t){if(Sr(t))return t.value??null;const e=t.__resolveType;return typeof e=="string"&&Wa(e)?t.section??null:null}const ja=6;function Hs(t,e=0){if(e>ja||!t||typeof t!="object")return[];if(Array.isArray(t))return t.flatMap(n=>Hs(n,e+1));const s=t;if(Pn(s.__resolveType))return vn(s).flatMap(n=>Hs(n?.value,e+1));const a=qn(s);return a!==null?Hs(a,e+1):[s]}function vn(t){const e=t?.variants;return Array.isArray(e)?e.map(s=>s&&typeof s=="object"&&!Array.isArray(s)?s:null):[]}function or(t){let e=t;for(let s=0;s<ja;s++){if(!e||typeof e!="object"||Array.isArray(e))return null;const a=e;if(Pn(a.__resolveType))return a;const n=qn(a);if(n===null)return null;e=n}return null}function yo(t,e,s){const a=vn(or(t)),n=e?vn(or(e)):[],o=e?Array.from({length:Math.max(a.length,n.length)},(i,u)=>u).filter(i=>!dn(a[i],n[i])):[],l=[...o.map(i=>a[i]??n[i]),...a.filter((i,u)=>!o.includes(u))].flatMap(i=>Hs(i?.value)).map(i=>hs(i,s,!0));return[...new Set(l)]}function pn(t,e,s,a,n){let o=t,d=!1;for(let i=0;i<4;i++){if(!o||typeof o!="object"||Array.isArray(o)){d=!0;break}const u=o;if(Pn(u.__resolveType)){d=!0;break}const c=qn(u);if(c===null)break;o=c}const l=d?yo(t,n,e):[];return{name:hs(d?t:o,e,!0),kind:"section",status:s,fields:a,...d?{wrapper:!0}:{},...l.length>0?{held:l}:{}}}function yn(t,e){const s=t.sections;if(Array.isArray(s))return s.flatMap((a,n)=>a&&typeof a=="object"&&!Array.isArray(a)?[{section:a,basePath:["sections",n]}]:[]);if(s&&typeof s=="object"){const a=s.variants;if(Array.isArray(a))return a.flatMap((n,o)=>{const d=n&&typeof n=="object"&&!Array.isArray(n)?n.value:null,l=e&&Sr(d),i=l?d.value:d;if(!Array.isArray(i))return[];const u=l?["sections","variants",o,"value","value"]:["sections","variants",o,"value"];return i.flatMap((c,h)=>c&&typeof c=="object"&&!Array.isArray(c)?[{section:c,basePath:[...u,h]}]:[])})}return[]}function cr(t){return JSON.stringify(t,(e,s)=>{if(s&&typeof s=="object"&&!Array.isArray(s)){const a=s;return Object.keys(a).sort().reduce((n,o)=>(n[o]=a[o],n),{})}return s})}function dn(t,e){return t===void 0&&e===void 0?!0:cr(t)===cr(e)}function At(t,e,s,a=new Set){const n=new Set([...Object.keys(t??{}),...Object.keys(e??{})]),o=[];for(const d of n){if(d.startsWith("__")||a.has(d))continue;const l=t?t[d]:void 0,i=e?e[d]:void 0;dn(l,i)||o.push({label:ya(d),path:[...s,d],from:l,to:i})}return o}function jo(t,e){const s=e.find(a=>a&&typeof a=="object");return s?s.__resolveType===li:t===ii}function wo(t,e){const s=n=>n===void 0||!!n&&typeof n=="object"&&!Array.isArray(n)&&!("__resolveType"in n),a=[];for(const n of At(t,e,[])){const o=String(n.path[0]);s(n.from)&&s(n.to)?a.push(...At(n.from??{},n.to??{},[o])):a.push(n)}return a}const Po=new Set(["sections"]);function Hn(t,e,s=!1){const a=t?yn(t,s):[],n=e?yn(e,s):[],o=[],d=Math.max(a.length,n.length);for(let i=0;i<d;i++){const u=a[i],c=n[i];if(!s){const h=ko(u,c,i);h&&o.push(h);continue}if(u&&c){if(dn(u.section,c.section))continue;o.push(pn(c.section,i,"edited",At(u.section,c.section,c.basePath),u.section))}else c?o.push(pn(c.section,i,"new",[])):u&&o.push(pn(u.section,i,"removed",[]))}const l=At(t,e,[],Po);return l.length>0&&o.push({name:"Page settings",kind:"settings",status:"edited",fields:l}),o}function ko(t,e,s){return t&&e?dn(t.section,e.section)?null:{name:hs(e.section,s),kind:"section",status:"edited",fields:At(t.section,e.section,e.basePath)}:e?{name:hs(e.section,s),kind:"section",status:"new",fields:[]}:t?{name:hs(t.section,s),kind:"section",status:"removed",fields:[]}:null}function jn(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 So(t){const e=[],s=[],a=[],n=[];for(const[o,d]of Object.entries(t?.diffs??{})){if(On(o)){n.push(o);continue}const l=vo(d.from,d.to),i=Kn(o);if(!i){a.push(jn(o,l));continue}const u=Zs(d.from),c=Zs(d.to),h=c??u;if(!h){a.push(jn(o,l));continue}const p=us(i,h);if(p){e.push({kind:"page",blockKey:i,name:p.name,pagePath:p.path,isSiteApp:!1,status:l,filepaths:[o],sections:l==="edited"?Hn(u,c):[],fromJson:u,toJson:c});continue}const b=$n(i,h);s.push({kind:"block",blockKey:i,name:Js(i,h),pagePath:null,isSiteApp:b,status:l,filepaths:[o],sections:l==="edited"?[{name:Js(i,h),kind:"section",status:"edited",fields:At(u,c,[])}].filter(f=>f.fields.length>0):[],fromJson:u,toJson:c})}return wa({pages:e,blocks:s,other:a,generated:n})}function bn(t,e){return(t.filepaths[0]??"").localeCompare(e.filepaths[0]??"")}function wa(t){const{pages:e,blocks:s,other:a,generated:n}=t;return e.sort(bn),s.sort(bn),a.sort(bn),{pages:e,blocks:s,other:a,generated:n,count:e.length+s.length+a.length}}function No(t){return t==="added"?"new":t==="removed"?"removed":"edited"}function Pa(t){return t.startsWith("pages-")}function ka(t){const{files:e,lookup:s,diff:a}=t,n=[],o=[],d=[],l=[];for(const i of e){const u=i.path;if(On(u)){l.push(u);continue}const c=No(i.status),h=Kn(u);if(!h){d.push(jn(u,c));continue}const p=a?.diffs[u],b=Zs(p?.from??null),f=Zs(p?.to??null),m=Sa(s,h),g=m??f??b;if((m?us(h,m):null)??(!m&&Pa(h))){const w=g?us(h,g):null;n.push({kind:"page",blockKey:h,name:w?.name??da(h),pagePath:w?.path??null,isSiteApp:!1,status:c,filepaths:[u],sections:c==="edited"?Hn(b,f):[],fromJson:b,toJson:f??(c==="new"?m:null)});continue}const j=Js(h,g??{});o.push({kind:"block",blockKey:h,name:j,pagePath:null,isSiteApp:$n(h,m??{}),status:c,filepaths:[u],sections:c==="edited"?[{name:j,kind:"section",status:"edited",fields:At(b,f,[])}].filter(w=>w.fields.length>0):[],fromJson:b,toJson:f})}return wa({pages:n,blocks:o,other:d,generated:l})}function Sa(t,e){const s=t?.[e];return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function Co(t,e){return t??e}function Na(t){return t.length<=1?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}const gn=3;function _s(t){if(t.length<=gn)return Na(t);const e=t.length-gn;return`${t.slice(0,gn).join(", ")} and ${e} more`}function Ao(t,e){if(!e){const a=t.sections.filter(n=>n.kind==="section").map(n=>n.name).slice(0,3);return a.length>0?`${t.name} (${a.join(", ")})`:t.name}const s=[...new Set(t.sections.filter(a=>a.kind==="section").flatMap(a=>a.wrapper?a.held??[]:[a.name]))].slice(0,3);return s.length>0?`${t.name} (${s.join(", ")})`:t.name}function Ro(t){const e=va(t);return e==="experiments"?"A/B tests":e==="campaigns"?"Campaign dates":t.name}function Do(t){const e=[],s=t.pages.filter(l=>l.status==="edited"),a=t.pages.filter(l=>l.status==="new"),n=t.pages.filter(l=>l.status==="removed");if(s.length>0&&e.push(`updated ${_s(s.map(l=>Ao(l,!!t.v8)))}`),a.length>0){const l=a.length===1?"page":"pages";e.push(`added the ${_s(a.map(i=>i.name))} ${l}`)}if(n.length>0){const l=n.length===1?"page":"pages";e.push(`removed the ${_s(n.map(i=>i.name))} ${l}`)}const o=t.blocks.map(Ro);if(o.length>0&&e.push(`changed ${_s(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=Na(e);return ai(d.charAt(0).toUpperCase()+d.slice(1))}function To(t,e){return t?yn(t,e).length:0}function Bo(t,e=!1){const s={newPageSections:t.kind==="page"&&t.status==="new"?To(t.toJson,e):null,sections:0,settings:!1,fields:0};if(s.newPageSections!==null)return s;for(const a of t.sections){if(a.kind==="settings"){s.settings=!0;continue}t.kind==="page"?s.sections+=1:s.fields+=a.fields.length}return s}const dr="••••••";function ps(t){if(Array.isArray(t))return t.map(ps);if(!t||typeof t!="object")return t;const e=t,s={};for(const[a,n]of Object.entries(e))s[a]=ps(n);return e.__resolveType===bo&&"ciphertext"in e&&(s.ciphertext=dr),Ja(e)&&"encrypted"in e&&(s.encrypted=dr),s}function ur(t){return t.map(e=>({...e,from:ps(e.from),to:ps(e.to)}))}function Io(t){const{changes:e,sides:s,lookup:a,meta:n,hosted:o}=t,d=[],l=[],i=c=>[...new Set((s?.diagnostics??[]).filter(h=>Xn(Qa(h.file))===Xn(c)).map(h=>h.side))],u=Object.keys(e).sort((c,h)=>c<h?-1:c>h?1:0);for(const c of u){const h=e[c],p=h.kind==="delete"?"removed":h.baseVersion===null?"new":"edited",b=s?.entries[c],f=b?.before??null,m=b?.after??null,g=Sa(a,c),v=g??m??f,j=i(c),w={blockKey:c,status:p,filepaths:[],entry:{name:c,version:h.version},...j.length>0?{unreadable:j}:{},fromJson:ps(f),toJson:ps(m??(p==="new"?g:null))},x=g?us(c,g,n):null,P=!g&&v?us(c,v,n):null;if(x??P??(!v&&Pa(c))){const k=v?us(c,v,n):null;d.push({...w,kind:"page",name:k?.name??da(c),pagePath:k?.path??null,isSiteApp:!1,sections:p==="edited"?Hn(f,m,!0).map(D=>({...D,fields:ur(D.fields)})):[]});continue}const y=o?Jl(c,v,g,m,f):null,N=y?Yl(y,[v,g,m,f]):Js(c,v??{}),C=go(c,[g,m,f]),A=jo(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:$n(c,g??v??{}),sections:p==="edited"?[{name:A?"Settings":N,kind:"section",status:"edited",fields:ur(A?wo(f,m):At(f,m,[]))}].filter(k=>k.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 $o(t,e){return e(t==="new"?"thread.publishPopover.chipNew":t==="removed"?"thread.publishPopover.chipRemoved":"thread.publishPopover.chipEdited")}function Fo(t,e){const s=t.kind==="block"?mi:Gr;return r.jsx("span",{title:$o(t.status,e),className:"flex shrink-0",children:r.jsx(s,{className:G("size-4",t.status==="new"&&"text-brand",t.status==="edited"&&"text-warning",t.status==="removed"&&"text-destructive")})})}function Lo(t,e){if(t.kind==="page")return t.pagePath;if(t.kind!=="block")return null;if(t.blogKind)return ei(t.blogKind,e);if(t.cmsSettings)return e("thread.publishPopover.settingsDetail");const s=va(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 Oo(t,e,s){const a=Bo(t,s);if(a.newPageSections!==null)return[a.newPageSections===1?e("thread.publishPopover.newPageSectionOne"):e("thread.publishPopover.newPageSections",{count:a.newPageSections})];const n=[];return a.sections===1?n.push(e("thread.publishPopover.sectionChangedOne")):a.sections>1&&n.push(e("thread.publishPopover.sectionsChanged",{count:a.sections})),a.fields===1?n.push(e("thread.publishPopover.fieldChangedOne")):a.fields>1&&n.push(e("thread.publishPopover.fieldsChanged",{count:a.fields})),a.settings&&n.push(e("thread.publishPopover.pageSettingsChanged")),n}function Ca(t){const e=I.c(46),{change:s,bodyPending:a,selected:n,onSelect:o,confirming:d,onConfirmingChange:l,onDiscard:i,isPublishing:u,isDiscarding:c,v8:h}=t,p=a===void 0?!1:a,b=h===void 0?!1:h,f=ge();let m;e[0]!==s||e[1]!==f?(m=Lo(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]!==u||e[9]!==l||e[10]!==i||e[11]!==o||e[12]!==n||e[13]!==f||e[14]!==b){const j=Oo(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=G("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=Fo(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=r.jsx("span",{className:"truncate text-sm font-medium",children:C}),e[27]=C,e[28]=A):A=e[28];let k;e[29]!==g?(k=g?r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:g}):null,e[29]=g,e[30]=k):k=e[30];let D;e[31]!==n||e[32]!==A||e[33]!==k?(D=r.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left","aria-pressed":n,children:[A,k]}),e[31]=n,e[32]=A,e[33]=k,e[34]=D):D=e[34];let S;e[35]!==d||e[36]!==c||e[37]!==u||e[38]!==l||e[39]!==i||e[40]!==f?(S=d?r.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[r.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground",onClick:B=>{B.stopPropagation(),l(!1)},children:f("thread.publishDialog.cancel")}),r.jsx("button",{type:"button",className:"text-xs font-medium text-destructive disabled:opacity-50",onClick:B=>{B.stopPropagation(),l(!1),i?.()},disabled:c,children:f("thread.publishPopover.discard")})]}):i?r.jsx(rn,{children:r.jsxs(at,{children:[r.jsx(lt,{asChild:!0,children:r.jsx(be,{type:"button",variant:"ghost-destructive",size:"icon-xs","aria-label":f("thread.publishPopover.discard"),className:"shrink-0 disabled:pointer-events-auto",onClick:B=>{B.stopPropagation(),l(!0)},disabled:u||c,children:r.jsx(ln,{className:"size-3.5"})})}),r.jsx(it,{children:f("thread.publishPopover.discard")})]})}):null,e[35]=d,e[36]=c,e[37]=u,e[38]=l,e[39]=i,e[40]=f,e[41]=S):S=e[41];let O;e[42]!==D||e[43]!==S||e[44]!==N?(O=r.jsxs("div",{className:"flex items-center gap-2.5",children:[N,D,S]}),e[42]=D,e[43]=S,e[44]=N,e[45]=O):O=e[45],v=r.jsxs(xa,{className:P,"data-change-id":y,onClick:o,children:[O,j.length>0?r.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px] text-xs text-muted-foreground",children:j.map(Mo)}):w?r.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px]",children:r.jsx(We,{className:"h-4 w-2/3"})}):null]}),e[3]=p,e[4]=s,e[5]=d,e[6]=g,e[7]=c,e[8]=u,e[9]=l,e[10]=i,e[11]=o,e[12]=n,e[13]=f,e[14]=b,e[15]=v}else v=e[15];return v}function Mo(t,e){return r.jsx("div",{className:"truncate",children:t},`${e}-${t}`)}function Aa(){const t=I.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,a]=U.useState(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=l=>{if(!l)return;const i=()=>a(c=>c.width===l.clientWidth&&c.height===l.clientHeight?c:{width:l.clientWidth,height:l.clientHeight});i();const u=new ResizeObserver(i);return u.observe(l),()=>u.disconnect()},t[1]=n):n=t[1];const o=n;let d;return t[2]!==s?(d=[s,o],t[2]=s,t[3]=d):d=t[3],d}function Eo(){return document.documentElement.classList.contains("dark")?"vs-dark":"vs"}const _o=[{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 hr(t){const e=I.c(10),{height:s}=t,a=ge();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=_o.map(zo),e[2]=o):o=e[2];let d;e[3]!==a?(d=a("thread.publishDialog.openingComparison"),e[3]=a,e[4]=d):d=e[4];let l;e[5]!==d?(l=r.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=r.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 zo(t,e){return r.jsxs("div",{className:G("flex items-center gap-2 rounded px-1 py-0.5",t.tone==="del"&&"bg-destructive/5",t.tone==="add"&&"bg-success/5"),children:[r.jsx("div",{className:G("h-2 w-4 shrink-0 animate-pulse rounded-sm bg-muted",t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")}),r.jsx("div",{className:G("h-2 animate-pulse rounded-sm bg-muted",t.width,t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")})]},e)}const Ra={readOnly:!0,renderSideBySide:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12},Uo={...Ra,lineNumbersMinChars:3,lineDecorationsWidth:4,folding:!1,glyphMargin:!1,renderOverviewRuler:!1};function Ko(t){const e=I.c(11),{diff:s,emptyMessage:a,rowClassName:n,onDiscardFile:o,hideFileRows:d,editorHeight:l}=t,i=a===void 0?"No file changes in the working tree":a,u=n===void 0?"px-6":n,c=d===void 0?!1:d,h=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=Eo(),e[0]=g):g=e[0];const v=g;if(!s||Object.keys(s.diffs).length===0){let w;return e[1]!==i?(w=r.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]!==h||e[6]!==p||e[7]!==c||e[8]!==o||e[9]!==u?(j=r.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,k=N===null,D=x.startsWith("/")?x.slice(1):x,S=D.lastIndexOf("/"),O=S>=0?D.slice(S+1):D,B=S>=0?D.slice(0,S):null,T=Ai(x),F=A?"bg-success":k?"bg-destructive":"bg-warning";return c?r.jsx("div",{children:r.jsx(nr,{original:y??"",modified:N??"",language:T,theme:v,height:h,loading:r.jsx(hr,{height:h}),options:Uo})},x):r.jsxs("div",{children:[r.jsxs("div",{className:G("flex items-center gap-3 py-3 hover:bg-accent",u),children:[r.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:r.jsx(Pr,{className:G("h-3.5 w-3.5 transition-transform",C&&"rotate-90")})}),r.jsx("div",{className:G("h-2.5 w-2.5 shrink-0 rounded-full",F)}),r.jsx(Gr,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:O}),B&&r.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:B}),o?r.jsxs(sn,{children:[r.jsx(en,{asChild:!0,children:r.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:r.jsx(Ya,{className:"h-3.5 w-3.5"})})}),r.jsx(tn,{align:"end",children:r.jsx(fs,{className:"text-destructive focus:text-destructive",onSelect:()=>m(x),children:"Discard changes"})})]}):null]}),f===x&&o?r.jsxs("div",{className:G("flex items-center justify-between gap-3 border-t bg-destructive/5 py-2.5",u),children:[r.jsxs("span",{className:"text-xs text-destructive",children:["Discard all changes to"," ",r.jsx("span",{className:"font-medium",children:O}),"? This cannot be undone."]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsx(be,{type:"button",variant:"ghost",size:"sm",onClick:()=>m(null),children:"Cancel"}),r.jsx(be,{type:"button",variant:"destructive",size:"sm",onClick:()=>{m(null),o(x)},children:"Discard"})]})]}):null,C&&r.jsx("div",{className:"border-t",children:r.jsx(nr,{original:y??"",modified:N??"",language:T,theme:v,height:h,loading:r.jsx(hr,{height:h}),options:Ra})})]},x)})}),e[3]=s.diffs,e[4]=f,e[5]=h,e[6]=p,e[7]=c,e[8]=o,e[9]=u,e[10]=j):j=e[10],j}function qo(t){if(t.kind!=="block"||t.isSiteApp||!t.blockKey)return null;const e=(t.toJson??t.fromJson)?.__resolveType;return typeof e=="string"&&Di(e)?t.blockKey:null}function Ho(t){return t.kind!=="page"?!0:!t.pagePath||Ct(t.pagePath).length>0}function Vo(t,e){try{return ol(t,si,e)}catch{return null}}function Go(t,e,s){if(!e)return;const a=ti(e,t);if(!a)return null;if(Ct(a.path).length===0||s?.path!==a.path)return a.path;const n=Fn(a.path,s.params);return Ct(n).length===0?n:a.path}function Wo(t){return t.sectionKey&&!t.v8?Vo(t.previewServerUrl,t.sectionKey):Jo(t.previewServerUrl,t.path)}function Qo(t,e){if(t.kind!=="page")return"/";const s=t.pagePath;if(!s)return"";if(Ct(s).length===0)return s;if(e?.path!==s)return"";const a=Fn(s,e.params);return Ct(a).length===0?a:""}function Jo(t,e){const s=e.trim();if(!s||Ct(s).length>0)return null;try{const a=new URL(t),n=new URL(s.startsWith("/")?s:`/${s}`,a);return n.origin===a.origin?n:null}catch{return null}}function Yo(t,e){return e?.kind==="pointer"&&e.link?Rn(t.toString(),e.link):Da(t,e)}function Da(t,e){if(!e)return null;if(e.kind==="pointer")return Rn(t.toString(),e.pointer);try{return new URL(`${t.pathname}${t.search}`,e.previewUrl).href}catch{return null}}function Xo(t,e,s){return e===null?!1:t!=="other"||s?.kind==="sandbox"}function Zo(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 Ta=U.createContext(!0),ec=["split","before","after","code"];function tc(t){return ec.includes(t)}const Ba={desktop:1280,mobile:412};function sc(t,e){const s=(o,d)=>t.unreadable?.includes(d)?e:o?`${JSON.stringify(o,null,2)}
|
|
2
2
|
`:null,a=t.status==="new"?null:s(t.fromJson,"before"),n=t.status==="removed"?null:s(t.toJson,"after");return a===null&&n===null?{diffs:{}}:t.status==="edited"&&(a===null||n===null)?{diffs:{}}:{diffs:{[el(t.entry.name)]:{from:a,to:n}}}}function Ia(t){const e=I.c(76),{change:s,diff:a,bodyPending:n,previewServerUrl:o,draft:d,lastPage:l,v8:i,onReady:u}=t,c=ge(),h=U.use(Ta),p=qo(s),b=i?null:p,f=i?p:null,m=f?Go(f,i?.blocks,l):void 0,g=f!==null&&m===null,v=Xo(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??"":Qo(s,l));let k;e[0]!==s?(k=Ho(s),e[0]=s,e[1]=k):k=e[1];const D=k,S=o?Wo({previewServerUrl:o,sectionKey:p,path:A,v8:!!i}):null,O=S?Rn(S.toString(),cl):null,B=S?Da(S,d):null,T=S?Yo(S,d):null;let F;e[2]!==s||e[3]!==a?.diffs||e[4]!==c?(F=s.entry?sc(s,c("thread.publishCompare.sideUnreadable")):{diffs:Object.fromEntries(s.filepaths.flatMap(E=>{const ce=a?.diffs[E];return ce?[[E,ce]]:[]}))},e[2]=s,e[3]=a?.diffs,e[4]=c,e[5]=F):F=e[5];const L=F;let W;e[6]!==L.diffs?(W=Object.keys(L.diffs),e[6]=L.diffs,e[7]=W):W=e[7];const q=W.length>0;let X;e:{if(b!==null){X=null;break e}if(f!==null){const ce=A.trim();if(!ce){X=null;break e}X=Ct(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],X=ce;break e}let E;e[10]!==s.pagePath||e[11]!==c?(E=s.pagePath&&Ct(s.pagePath).length>0?c("thread.publishCompare.dynamicHint",{template:s.pagePath}):null,e[10]=s.pagePath,e[11]=c,e[12]=E):E=e[12],X=E}const M=X,H=Zo(s,!!i),[J,ne]=U.useState(nc);let Q;e[13]===Symbol.for("react.memo_cache_sentinel")?(Q=E=>ne(ce=>ce.has(E)?ce:new Set(ce).add(E)),e[13]=Q):Q=e[13];const he=Q;let Z;e[14]!==i?(Z=E=>i?r.jsx(lc,{...E,onLoaded:he}):r.jsx(ac,{...E}),e[14]=i,e[15]=Z):Z=e[15];const re=Z,ee=(v?[H.before==="new"?null:O,H.after==="removed"?null:B].flatMap(E=>E?[Un(E,P)]:[]):[]).every(E=>J.has(E));let K;e[16]!==u||e[17]!==ee?(K=ee&&u?E=>{E&&u()}:void 0,e[16]=u,e[17]=ee,e[18]=K):K=e[18];const te=K,se=H.before==="new"?r.jsx(zs,{icon:r.jsx(Yr,{className:"size-5 text-brand"}),title:c("thread.publishCompare.newTitle"),description:c("thread.publishCompare.newDescription")}):re({url:O,device:P,title:c("thread.publishCompare.before"),missing:c("thread.publishCompare.enterPath")}),Pe=H.after==="removed"?r.jsx(zs,{icon:r.jsx(ln,{className:"size-5 text-destructive"}),title:c("thread.publishCompare.removedTitle"),description:c("thread.publishCompare.removedDescription")}):re({url:B,device:P,title:c("thread.publishCompare.after"),missing:c(S?"thread.publishCompare.draftUnavailable":"thread.publishCompare.enterPath")});let ae;e[19]!==v||e[20]!==w||e[21]!==h||e[22]!==c||e[23]!==x?(ae=v||h?r.jsx(qr,{value:x,onValueChange:E=>{tc(E)&&w(E)},children:r.jsxs(Kr,{className:"h-8 w-auto",variant:"pill",children:[v?r.jsxs(r.Fragment,{children:[r.jsx(Ft,{value:"split",className:"px-3 text-xs",children:c("thread.publishCompare.sideBySide")}),r.jsx(Ft,{value:"before",className:"px-3 text-xs",children:c("thread.publishCompare.before")}),r.jsx(Ft,{value:"after",className:"px-3 text-xs",children:c("thread.publishCompare.after")})]}):null,h?r.jsx(Ft,{value:"code",className:"px-3 text-xs",children:c("thread.publishCompare.code")}):null]})}):null,e[19]=v,e[20]=w,e[21]=h,e[22]=c,e[23]=x,e[24]=ae):ae=e[24];let ie;e[25]!==T||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?(ie=v&&x!=="code"?r.jsxs(r.Fragment,{children:[b?null:D?r.jsx(Xa,{value:A,onChange:E=>C(E.target.value),placeholder:s.pagePath??"/","aria-label":c("thread.publishCompare.pathLabel"),className:"h-8 w-56 font-mono text-xs"}):r.jsx("span",{className:"max-w-56 truncate px-1 font-mono text-xs text-muted-foreground",children:A}),r.jsxs("div",{className:"flex items-center rounded-lg border p-0.5",children:[r.jsx(fr,{active:P==="desktop",label:c("thread.publishCompare.desktop"),onClick:()=>y("desktop"),children:r.jsx(Ri,{className:"size-3.5"})}),r.jsx(fr,{active:P==="mobile",label:c("thread.publishCompare.mobile"),onClick:()=>y("mobile"),children:r.jsx(Pl,{className:"size-3.5"})})]}),T?r.jsxs("a",{href:T,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:[r.jsx(Za,{className:"size-3.5"}),c("thread.publishCompare.openDraft")]}):null]}):null,e[25]=T,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]=ie):ie=e[36];let de;e[37]!==ae||e[38]!==ie?(de=r.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,ie]}),e[37]=ae,e[38]=ie,e[39]=de):de=e[39];let oe;e[40]!==v||e[41]!==M||e[42]!==x?(oe=M&&v&&x!=="code"?r.jsx("p",{className:"border-b bg-background px-4 py-1.5 text-2xs text-muted-foreground",children:M}):null,e[40]=v,e[41]=M,e[42]=x,e[43]=oe):oe=e[43];let z;e[44]!==g||e[45]!==h||e[46]!==c?(z=g&&h?r.jsx("p",{className:"border-b bg-background px-4 py-1.5 text-2xs text-muted-foreground",children:c("thread.publishCompare.notOnAnyPage")}):null,e[44]=g,e[45]=h,e[46]=c,e[47]=z):z=e[47];let fe;e[48]!==o||e[49]!==h||e[50]!==c||e[51]!==f||e[52]!==m||e[53]!==x?(fe=x==="code"&&!h?f!==null&&m===void 0?r.jsx(We,{className:"m-4 h-64 rounded"}):o===null?r.jsx(zs,{icon:r.jsx(Ys,{className:"size-5 text-muted-foreground"}),title:c("thread.publishCompare.previewNotReadyTitle"),description:c("thread.publishCompare.draftUnavailable")}):r.jsx(zs,{icon:r.jsx(Ys,{className:"size-5 text-muted-foreground"}),title:c("thread.publishCompare.noPreviewTitle"),description:c("thread.publishCompare.noPreviewDescription")}):null,e[48]=o,e[49]=h,e[50]=c,e[51]=f,e[52]=m,e[53]=x,e[54]=fe):fe=e[54];let ke;e[55]!==n||e[56]!==q||e[57]!==L||e[58]!==h||e[59]!==c||e[60]!==x?(ke=x==="code"&&h?r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto bg-background [scrollbar-width:thin]",children:q?r.jsx(Ko,{diff:L,hideFileRows:!0,editorHeight:"70vh"}):n?r.jsx(We,{className:"m-4 h-64 rounded"}):r.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:c("thread.publishPopover.detailsUnavailable")})}):null,e[55]=n,e[56]=q,e[57]=L,e[58]=h,e[59]=c,e[60]=x,e[61]=ke):ke=e[61];let me;e[62]!==Pe||e[63]!==se||e[64]!==v||e[65]!==c||e[66]!==x?(me=v?r.jsxs("div",{className:G("flex min-h-0 flex-1 gap-3 p-3",x==="code"&&"hidden"),children:[r.jsx(mr,{label:c("thread.publishCompare.before"),hidden:x==="after",children:se}),r.jsx(mr,{label:c("thread.publishCompare.after"),highlight:!0,hidden:x==="before",children:Pe})]}):null,e[62]=Pe,e[63]=se,e[64]=v,e[65]=c,e[66]=x,e[67]=me):me=e[67];let Y;return e[68]!==te||e[69]!==de||e[70]!==oe||e[71]!==z||e[72]!==fe||e[73]!==ke||e[74]!==me?(Y=r.jsxs("div",{ref:te,className:"flex min-h-0 min-w-0 flex-1 flex-col bg-muted/40",children:[de,oe,z,fe,ke,me]}),e[68]=te,e[69]=de,e[70]=oe,e[71]=z,e[72]=fe,e[73]=ke,e[74]=me,e[75]=Y):Y=e[75],Y}function nc(){return new Set}function fr(t){const e=I.c(8),{active:s,label:a,onClick:n,children:o}=t,d=s&&"bg-accent text-foreground";let l;e[0]!==d?(l=G("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]!==a||e[5]!==n||e[6]!==l?(i=r.jsx("button",{type:"button","aria-label":a,"aria-pressed":s,title:a,onClick:n,className:l,children:o}),e[2]=s,e[3]=o,e[4]=a,e[5]=n,e[6]=l,e[7]=i):i=e[7],i}function mr(t){const e=I.c(18),{label:s,highlight:a,hidden:n,children:o}=t,d=a===void 0?!1:a,i=(n===void 0?!1:n)&&"hidden";let u;e[0]!==i?(u=G("flex min-h-0 min-w-0 flex-1 flex-col gap-1.5",i),e[0]=i,e[1]=u):u=e[1];const c=d&&"bg-brand";let h;e[2]!==c?(h=G("size-1.5 rounded-full bg-muted-foreground/50",c),e[2]=c,e[3]=h):h=e[3];let p;e[4]!==h?(p=r.jsx("span",{className:h}),e[4]=h,e[5]=p):p=e[5];let b;e[6]!==s||e[7]!==p?(b=r.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=G("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=r.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]!==u||e[16]!==b?(v=r.jsxs("div",{className:u,children:[b,g]}),e[14]=g,e[15]=u,e[16]=b,e[17]=v):v=e[17],v}function zs(t){const e=I.c(10),{icon:s,title:a,description:n}=t;let o;e[0]!==s?(o=r.jsx("div",{className:"mb-1",children:s}),e[0]=s,e[1]=o):o=e[1];let d;e[2]!==a?(d=r.jsx("p",{className:"text-sm font-medium",children:a}),e[2]=a,e[3]=d):d=e[3];let l;e[4]!==n?(l=r.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=r.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 rc(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 ac(t){const e=I.c(24),{url:s,device:a,title:n,missing:o}=t,[d,l]=Aa(),[i,u]=U.useState(null);if(!s){let y;return e[0]!==o?(y=r.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]!==a||e[3]!==s?(c=Un(s,a),e[2]=a,e[3]=s,e[4]=c):c=e[4];const h=c,p=Ba[a],b=d.width>0?Math.min(d.width/p,1):1,f=d.width>0?Math.max((d.width-p*b)/2,0):0;let m;e[5]!==h?(m=()=>u(h),e[5]=h,e[6]=m):m=e[6];const g=d.height>0?d.height/b:"100%",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]!==h||e[13]!==m||e[14]!==j||e[15]!==n?(w=r.jsx("iframe",{src:h,title:n,sandbox:"allow-scripts allow-same-origin",onLoad:m,className:"absolute top-0 border-0 bg-white",style:j},h),e[12]=h,e[13]=m,e[14]=j,e[15]=n,e[16]=w):w=e[16];let x;e[17]!==i||e[18]!==h?(x=i!==h?r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/60",children:r.jsx(ms,{className:"size-5 motion-reduce:animate-none"})}):null,e[17]=i,e[18]=h,e[19]=x):x=e[19];let P;return e[20]!==l||e[21]!==w||e[22]!==x?(P=r.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 lc(t){const e=I.c(21),{url:s,device:a,title:n,missing:o,onLoaded:d}=t,[l,i]=Aa(),[u,c]=U.useState(null),[h,p]=U.useState(null),b=l.width>0&&l.height>0;b&&(u?.width!==l.width||u?.height!==l.height)&&c(l);const f=b?l:u;if(!s){let P;return e[0]!==o?(P=r.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]!==a||e[4]!==d||e[5]!==i||e[6]!==h||e[7]!==n||e[8]!==s){const P=Un(s,a),y=Ba[a];m=h?.src!==P;const N=[...h&&m?[h]:[],{src:P,logicalWidth:y}];g=i,v="absolute inset-0",j=N.map(C=>{const A=C.src===P&&m;return r.jsx("iframe",{src:C.src,title:n,"aria-hidden":A&&h?!0:void 0,sandbox:"allow-scripts allow-same-origin",onLoad:()=>{C.src===P&&(p(C),d?.(C.src))},className:G("absolute top-0 border-0 bg-white",A&&"pointer-events-none opacity-0"),style:rc(f,C.logicalWidth)},C.src)}),e[2]=f,e[3]=a,e[4]=d,e[5]=i,e[6]=h,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]!==h?(w=m?h?r.jsx(ms,{className:"absolute right-2 top-2 size-4 text-muted-foreground motion-reduce:animate-none"}):r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/60",children:r.jsx(ms,{className:"size-5 motion-reduce:animate-none"})}):null,e[13]=m,e[14]=h,e[15]=w):w=e[15];let x;return e[16]!==g||e[17]!==v||e[18]!==j||e[19]!==w?(x=r.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 ic=/^Co-authored-by:\s*([^<\r\n]+?)(?:\s*<[^>\r\n]*>)?\s*$/im;function oc(t){if(!t)return null;const e=ic.exec(t)?.[1]?.trim();return e||null}function cc(t){return/\[bot\]$/i.test(t)||/-bot$/i.test(t)}function dc(t){const e=oc(t.body);if(e)return e;const s=t.author.trim();return!s||cc(s)?null:s}function uc(t,e,s,a,n,o){return["cms-publish-bodies",t,e,s,a,n,o]}const hc=6e4;function fc(t,e){return e?null:t.files.map(s=>`${s.index}${s.working_dir} ${s.path}`).sort().join(`
|
|
3
3
|
`)}function mc(t,e,s){const a=I.c(6);let n;a[0]!==s||a[1]!==t||a[2]!==e?(n=gs.decofile(`${t}/${e}/${s}`),a[0]=s,a[1]=t,a[2]=e,a[3]=n):n=a[3];let o;a[4]!==n?(o={queryKey:n,queryFn:kn},a[4]=n,a[5]=o):o=a[5];const{data:d}=bt(o);return d}function $a(t){const{orgSlug:e,virtualMcpId:s,branch:a,threadId:n,baseBranch:o,fastPreview:d,recoverSandbox:l}=t,i={orgSlug:e,virtualMcpId:s,branch:a,threadId:n},u=d?{fastPreview:!0}:void 0,c=U.useRef(null),h=async P=>{try{return await P()}catch(y){if(!l||!ua(y))throw y;return c.current??=l(),await c.current,P()}},p=Nr({...Mn(i),queryFn:()=>h(()=>ha(i))}),b=p.data,f=b.changedFiles??null,m=b.headSha??null,g=f?f.length>0:bi(b)||gi(b),v=bt({queryKey:uc(e,s,a,o,m,fc(b,d)),queryFn:()=>h(()=>xi(i,b,o,u)),enabled:g,staleTime:d?hc:0,gcTime:d?void 0:0,throwOnError:(P,y)=>!f&&y.state.data===void 0}),j=mc(e,s,a),w=v.data??null,x=f?ka({files:f,lookup:j,diff:w}):So(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 pc(t){const e=I.c(4);let s;e[0]!==t?(s=gs.decofile(t),e[0]=t,e[1]=s):s=e[1];let a;e[2]!==s?(a={queryKey:s,queryFn:kn},e[2]=s,e[3]=a):a=e[3];const{data:n}=bt(a);return n}function bc(t,e){const s=I.c(5);let a;s[0]!==t||s[1]!==e?(a=e?dl(e,t):gs.liveMeta("","no-scope"),s[0]=t,s[1]=e,s[2]=a):a=s[2];let n;s[3]!==a?(n={queryKey:a,queryFn:kn},s[3]=a,s[4]=n):n=s[4];const{data:o}=bt(n);return o}function Vn(t){const e=I.c(27),{backend:s,cacheKey:a,scope:n}=t,o=Cr();let d;e[0]!==a?(d=gs.contentChanges(a),e[0]=a,e[1]=d):d=e[1];let l;e[2]!==s.client||e[3]!==a||e[4]!==o?(l=()=>Vl(o,s.client,a),e[2]=s.client,e[3]=a,e[4]=o,e[5]=l):l=e[5];let i;e[6]!==d||e[7]!==l?(i={queryKey:d,queryFn:l,staleTime:0},e[6]=d,e[7]=l,e[8]=i):i=e[8];const u=Nr(i),c=u.data,h=Hl(s,a,c),p=pc(a),b=bc(s,n),f=h.data??null,m=s.source==="github";let g;e[9]!==c.changes||e[10]!==p||e[11]!==b||e[12]!==f||e[13]!==m?(g=Io({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(gc),e[15]=c.changes,e[16]=j):j=e[16];const w=v.count>0&&h.isPending,x=p??null;let P;e[17]!==u?(P=()=>u.refetch(),e[17]=u,e[18]=P):P=e[18];let y;return e[19]!==c||e[20]!==h.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:h.isError,blocks:x,refresh:P},e[19]=c,e[20]=h.isError,e[21]=v,e[22]=j,e[23]=w,e[24]=x,e[25]=P,e[26]=y):y=e[26],y}function gc(t){const[e,s]=t;return{name:e,version:s.version}}function xc(t){return["smart-review-verdict",t.orgSlug,t.virtualMcpId,t.branch,t.threadId,t.fastPreview?"fast-preview-upstream":"sandbox",t.signature,t.language]}function vc(t){const e=I.c(27),{orgSlug:s,virtualMcpId:a,branch:n,threadId:o,fastPreview:d,status:l,diff:i,enabled:u}=t,[c]=Ar(),{language:h}=c;let p,b,f;if(e[0]!==n||e[1]!==i||e[2]!==u||e[3]!==d||e[4]!==h||e[5]!==s||e[6]!==l||e[7]!==o||e[8]!==a){const P=i?En(i):"";p=u&&!!n&&!!l&&!!i&&P!=="",f=bt,b=xc({orgSlug:s,virtualMcpId:a,branch:n,threadId:o,fastPreview:d,signature:P,language:h}),e[0]=n,e[1]=i,e[2]=u,e[3]=d,e[4]=h,e[5]=s,e[6]=l,e[7]=o,e[8]=a,e[9]=p,e[10]=b,e[11]=f}else p=e[9],b=e[10],f=e[11];let m;e[12]!==n||e[13]!==i||e[14]!==h||e[15]!==s||e[16]!==l||e[17]!==o||e[18]!==a?(m=()=>vi({orgSlug:s,virtualMcpId:a,branch:n,threadId:o},{status:l,diff:i,language:h}),e[12]=n,e[13]=i,e[14]=h,e[15]=s,e[16]=l,e[17]=o,e[18]=a,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:yc},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 yc(t,e){return!ua(e)&&t<1}function Fa(t){const e=I.c(30),{orgSlug:s,virtualMcpId:a,branch:n,threadId:o,fastPreview:d,status:l,diff:i,policy:u,judgeEnabled:c,paths:h}=t,p=c===void 0?!0:c,b=h===void 0?null:h;let f;e[0]!==i||e[1]!==p||e[2]!==u?(f=p&&yi(i,u),e[0]=i,e[1]=p,e[2]=u,e[3]=f):f=e[3];const m=f;let g;e[4]!==n||e[5]!==i||e[6]!==d||e[7]!==m||e[8]!==s||e[9]!==l||e[10]!==o||e[11]!==a?(g={orgSlug:s,virtualMcpId:a,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]=a,e[12]=g):g=e[12];const{verdict:v,loading:j}=vc(g);if(!i&&b){let y;e[13]!==b||e[14]!==u?(y=ji(b,u),e[13]=b,e[14]=u,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]!==u?(y=wi(i,u),e[19]=i,e[20]=u,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=Pi(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 jc(t){return["main","master"].includes(t.trim().toLowerCase())}function wc(t,e,s,a){return t===0?a("thread.publishPopover.publish"):s||!jc(e)?t===1?a("thread.publishPopover.publishOne"):a("thread.publishPopover.publishCount",{count:t}):t===1?a("thread.publishPopover.publishOneInProduction"):a("thread.publishPopover.publishCountInProduction",{count:t})}function La(t){const e=I.c(61),{blocks:s,base:a,pending:n,onCancel:o,onConfirm:d}=t,l=ge();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];const[u,c]=U.useState(i);let h;if(e[1]!==s||e[2]!==u){let T;e[4]!==u?(T=F=>u[F.path]==="restore",e[4]=u,e[5]=T):T=e[5],h=new Set(s.filter(T).map(Pc)),e[1]=s,e[2]=u,e[3]=h}else h=e[3];const p=h;let b;if(e[6]!==s||e[7]!==u){let T;e[9]!==u?(T=F=>u[F.path],e[9]=u,e[10]=T):T=e[10],b=s.every(T),e[6]=s,e[7]=u,e[8]=b}else b=e[8];const f=b;let m;e[11]!==n?(m=T=>{n&&T.preventDefault()},e[11]=n,e[12]=m):m=e[12];let g;e[13]!==a||e[14]!==l?(g=l("thread.deletedBlocks.title",{base:a}),e[13]=a,e[14]=l,e[15]=g):g=e[15];let v;e[16]!==g?(v=r.jsx(Ss,{children:g}),e[16]=g,e[17]=v):v=e[17];let j;e[18]!==l?(j=l("thread.deletedBlocks.description"),e[18]=l,e[19]=j):j=e[19];let w;e[20]!==j?(w=r.jsx(Ns,{children:j}),e[20]=j,e[21]=w):w=e[21];let x;e[22]!==v||e[23]!==w?(x=r.jsxs(Cs,{className:"text-left",children:[v,w]}),e[22]=v,e[23]=w,e[24]=x):x=e[24];let P;if(e[25]!==s||e[26]!==u||e[27]!==n||e[28]!==p||e[29]!==l){let T;e[31]!==u||e[32]!==n||e[33]!==p||e[34]!==l?(T=F=>{const L=F.missingRefs.filter(W=>!p.has(W));return r.jsxs("li",{className:"flex flex-col gap-2",children:[r.jsxs("div",{className:"flex min-w-0 flex-col",children:[r.jsx("span",{className:"truncate text-sm font-medium",children:F.key}),F.renamedTo&&r.jsx("span",{className:"text-meta",children:l("thread.deletedBlocks.renamed",{name:F.renamedTo})}),u[F.path]==="restore"&&L.length>0&&r.jsx("span",{className:"text-meta text-warning",children:l("thread.deletedBlocks.missingRefs",{names:L.join(", ")})})]}),r.jsxs(Bi,{type:"single",variant:"segmented",size:"sm",value:u[F.path]??"",disabled:n,onValueChange:W=>{W!=="restore"&&W!=="drop"||c(q=>({...q,[F.path]:W}))},children:[r.jsx(rr,{value:"drop",children:l("thread.deletedBlocks.drop")}),r.jsx(rr,{value:"restore",children:l("thread.deletedBlocks.restore")})]})]},F.path)},e[31]=u,e[32]=n,e[33]=p,e[34]=l,e[35]=T):T=e[35],P=s.map(T),e[25]=s,e[26]=u,e[27]=n,e[28]=p,e[29]=l,e[30]=P}else P=e[30];let y;e[36]!==P?(y=r.jsx("ul",{className:"flex min-h-0 flex-col gap-4 overflow-y-auto",children:P}),e[36]=P,e[37]=y):y=e[37];let N;e[38]!==l?(N=l("thread.deletedBlocks.cancel"),e[38]=l,e[39]=N):N=e[39];let C;e[40]!==o||e[41]!==n||e[42]!==N?(C=r.jsx(be,{variant:"outline",onClick:o,disabled:n,children:N}),e[40]=o,e[41]=n,e[42]=N,e[43]=C):C=e[43];let A;e[44]!==u||e[45]!==d?(A=()=>d(u),e[44]=u,e[45]=d,e[46]=A):A=e[46];const k=!f||n;let D;e[47]!==l?(D=l("thread.deletedBlocks.continue"),e[47]=l,e[48]=D):D=e[48];let S;e[49]!==A||e[50]!==k||e[51]!==D?(S=r.jsx(be,{onClick:A,disabled:k,children:D}),e[49]=A,e[50]=k,e[51]=D,e[52]=S):S=e[52];let O;e[53]!==C||e[54]!==S?(O=r.jsxs(As,{children:[C,S]}),e[53]=C,e[54]=S,e[55]=O):O=e[55];let B;return e[56]!==y||e[57]!==O||e[58]!==m||e[59]!==x?(B=r.jsx(Ds,{open:!0,children:r.jsxs(Rs,{className:"max-h-[85vh] grid-rows-[auto_minmax(0,1fr)_auto] sm:max-w-lg",onEscapeKeyDown:m,children:[x,y,O]})}),e[56]=y,e[57]=O,e[58]=m,e[59]=x,e[60]=B):B=e[60],B}function Pc(t){return t.key}const kc=2500;function Sc(t){const{selectedId:e,readyIds:s,lastShownId:a,liveIds:n}=t;return e===null||s.has(e)?e:a!==null&&a!==e&&n.includes(a)?a:e}function Oa(t){const e=I.c(16),s=U.useRef(!1),a=ge();let n;e[0]!==t?(n=h=>{!h&&s.current||t.onOpenChange(h)},e[0]=t,e[1]=n):n=e[1];const o=n;let d;e[2]!==t.mode||e[3]!==a?(d=t.mode==="review"?a("thread.publishPopover.submitForReview"):a("thread.publishPopover.publish"),e[2]=t.mode,e[3]=a,e[4]=d):d=e[4];let l;e[5]!==d?(l=r.jsx(Dr,{className:"sr-only",children:d}),e[5]=d,e[6]=l):l=e[6];let i;e[7]!==t?(i=r.jsx(Nc,{...t,publishLockRef:s}),e[7]=t,e[8]=i):i=e[8];let u;e[9]!==l||e[10]!==i?(u=r.jsxs(Tr,{"aria-describedby":void 0,className:"flex h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] max-w-none flex-col md:flex-row md:h-[calc(100dvh-6rem)] md:w-[calc(100vw-6rem)] gap-0 overflow-hidden p-0 sm:max-w-none",closeButtonClassName:"top-3.5 right-3.5",children:[l,i]}),e[9]=l,e[10]=i,e[11]=u):u=e[11];let c;return e[12]!==o||e[13]!==t.open||e[14]!==u?(c=r.jsx(Rr,{open:t.open,onOpenChange:o,children:u}),e[12]=o,e[13]=t.open,e[14]=u,e[15]=c):c=e[15],c}function Nc(t){const e=I.c(3),s=Ot(t.virtualMcpId,t.branch),a=s.kind==="protocol"&&s.source==="github";let n;return e[0]!==a||e[1]!==t?(n=po({open:t.open,hosted:a})?r.jsx(Rc,{...t}):null,e[0]=a,e[1]=t,e[2]=n):n=e[2],n}const Cc=4,bs="flex h-[45%] min-h-0 min-w-0 shrink-0 md:h-auto md:flex-1";function $s(t){const e=I.c(5),{list:s,pane:a}=t;let n;e[0]!==s?(n=r.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]!==a||e[3]!==n?(o=r.jsxs(r.Fragment,{children:[a,n]}),e[2]=a,e[3]=n,e[4]=o):o=e[4],o}function Gn(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx("div",{className:G(bs,"bg-muted/40 p-3"),children:r.jsx(We,{className:"h-full w-full rounded-lg"})}),t[0]=e):e=t[0],e}function Wn(t){const e=I.c(11),{mode:s,title:a,subLine:n,trailing:o}=t,d=s==="review"?an:kl;let l;e[0]!==d?(l=r.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]!==a||e[4]!==o?(i=r.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[l,a,o]}),e[2]=l,e[3]=a,e[4]=o,e[5]=i):i=e[5];let u;e[6]!==n?(u=n?r.jsx("div",{className:"pl-6 text-xs text-muted-foreground",children:n}):null,e[6]=n,e[7]=u):u=e[7];let c;return e[8]!==i||e[9]!==u?(c=r.jsxs(r.Fragment,{children:[i,u]}),e[8]=i,e[9]=u,e[10]=c):c=e[10],c}function Qn(t){const e=I.c(9),{draftPreviewUrl:s,t:a}=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=r.jsx(Ys,{className:"size-4"}),e[2]=d):d=e[2];let l;e[3]!==a?(l=a("thread.publishPopover.preview"),e[3]=a,e[4]=l):l=e[4];let i;return e[5]!==n||e[6]!==o||e[7]!==l?(i=r.jsxs(be,{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 Ma(t){const e=I.c(21),{mode:s,draftPreviewUrl:a}=t,n=ge();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx(Gn,{}),e[0]=o):o=e[0];let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=r.jsx(We,{className:"h-3.5 w-48"}),e[1]=d):d=e[1];let l;e[2]!==s?(l=r.jsx(Wn,{mode:s,title:d}),e[2]=s,e[3]=l):l=e[3];let i,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(Ts,{children:r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(Lt,{}),r.jsx(Lt,{}),r.jsx(Lt,{})]})}),u=r.jsxs(r.Fragment,{children:[r.jsx(We,{className:"h-3 w-20"}),r.jsx(We,{className:"h-14 w-full rounded-lg"})]}),e[4]=i,e[5]=u):(i=e[4],u=e[5]);let c;e[6]!==a||e[7]!==n?(c=r.jsx(Qn,{draftPreviewUrl:a,t:n}),e[6]=a,e[7]=n,e[8]=c):c=e[8];const h=s==="review"?"default":"brand";let p;e[9]!==s||e[10]!==n?(p=n(s==="review"?"thread.publishPopover.submitForReview":"thread.publishPopover.publish"),e[9]=s,e[10]=n,e[11]=p):p=e[11];let b;e[12]!==h||e[13]!==p?(b=r.jsx(be,{type:"button",variant:h,className:"flex-1",disabled:!0,children:p}),e[12]=h,e[13]=p,e[14]=b):b=e[14];let f;e[15]!==c||e[16]!==b?(f=r.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=r.jsx($s,{pane:o,list:r.jsx(cn,{state:"loading",header:l,body:i,note:u,footer:f})}),e[18]=f,e[19]=l,e[20]=m):m=e[20],m}function Ac(t){const e=I.c(26),{mode:s,draftPreviewUrl:a,message:n,onRetry:o}=t,d=ge();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsx("div",{className:G(bs,"bg-muted/40")}),e[0]=l):l=e[0];let i;e[1]!==d?(i=d("thread.publishPopover.loadFailed"),e[1]=d,e[2]=i):i=e[2];let u;e[3]!==i?(u=r.jsx("span",{className:"truncate",children:i}),e[3]=i,e[4]=u):u=e[4];let c;e[5]!==s||e[6]!==u?(c=r.jsx(Wn,{mode:s,title:u}),e[5]=s,e[6]=u,e[7]=c):c=e[7];let h;e[8]!==n?(h=r.jsx("p",{className:"px-4 py-6 text-xs text-destructive",children:n}),e[8]=n,e[9]=h):h=e[9];let p;e[10]!==a||e[11]!==d?(p=r.jsx(Qn,{draftPreviewUrl:a,t:d}),e[10]=a,e[11]=d,e[12]=p):p=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Nn,{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=r.jsxs(be,{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=r.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]!==h?(v=r.jsx($s,{pane:l,list:r.jsx(cn,{state:"ready",header:c,body:h,footer:g})}),e[22]=g,e[23]=c,e[24]=h,e[25]=v):v=e[25],v}function Rc(t){const e=I.c(3),s=t.mode??"publish";let a;return e[0]!==s||e[1]!==t?(a=r.jsx(Br,{children:n=>{const{reset:o}=n;return r.jsx(Ir,{fallback:d=>{const{error:l,resetError:i}=d;return r.jsx(Ac,{mode:s,draftPreviewUrl:t.draftPreviewUrl,message:l?.message??"",onRetry:()=>{o(),i()}})},children:r.jsx(U.Suspense,{fallback:r.jsx(Ma,{mode:s,draftPreviewUrl:t.draftPreviewUrl}),children:r.jsx(Dc,{...t})})})}}),e[0]=s,e[1]=t,e[2]=a):a=e[2],a}function Dc(t){const e=I.c(13),s=Ot(t.virtualMcpId,t.branch);let a;e[0]!==t.branch||e[1]!==t.orgSlug||e[2]!==t.virtualMcpId?(a={orgSlug:t.orgSlug,virtualMcpId:t.virtualMcpId,branch:t.branch},e[0]=t.branch,e[1]=t.orgSlug,e[2]=t.virtualMcpId,e[3]=a):a=e[3];const n=Dn(a);if(s.kind==="protocol"&&n){let d;return e[4]!==s||e[5]!==n||e[6]!==t?(d=s.source==="sandbox"?r.jsx(Ic,{...t,backend:s,cacheKey:n}):r.jsx(Bc,{...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=r.jsx(Ma,{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=r.jsx(Tc,{...t}),e[11]=t,e[12]=o):o=e[12],o}function Tc(t){const e=I.c(52),s=xs()?.taskId??null;let a;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?(a={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]=a):a=e[7];const n=$a(a),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}=Fa(d),i=n.discardablePaths;let u;e[19]!==i?(u=j=>i===null||j.every(w=>i.has(w)),e[19]=i,e[20]=u):u=e[20];const c=u;let h;e[21]!==c?(h=j=>c(j.filepaths),e[21]=c,e[22]=h):h=e[22];let p;e[23]!==c||e[24]!==n.allPaths||e[25]!==n.changedFilesTruncated?(p=!n.changedFilesTruncated&&c(n.allPaths),e[23]=c,e[24]=n.allPaths,e[25]=n.changedFilesTruncated,e[26]=p):p=e[26];let b;e[27]!==t.branch||e[28]!==n.status?(b=_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:En(n.diff)}:{},e[30]=t.fastPreview,e[31]=n.diff,e[32]=m):m=e[32];let g;e[33]!==l||e[34]!==n.allPaths||e[35]!==n.bodiesFailed||e[36]!==n.bodiesPending||e[37]!==n.cardsPending||e[38]!==n.changedFilesTotal||e[39]!==n.changedFilesTruncated||e[40]!==n.diff||e[41]!==n.refresh||e[42]!==n.summary||e[43]!==h||e[44]!==p||e[45]!==b||e[46]!==f||e[47]!==m?(g={summary:n.summary,allPaths:n.allPaths,canDiscard:h,canDiscardAll:p,changedFilesTotal:n.changedFilesTotal,changedFilesTruncated:n.changedFilesTruncated,diff:n.diff,bodiesPending:n.bodiesPending,bodiesFailed:n.bodiesFailed,cardsPending:n.cardsPending,refresh:n.refresh,gate:l,headBranch:b,expectedHeadSha:f,...m,hosted:!1,otherWork:!1},e[33]=l,e[34]=n.allPaths,e[35]=n.bodiesFailed,e[36]=n.bodiesPending,e[37]=n.cardsPending,e[38]=n.changedFilesTotal,e[39]=n.changedFilesTruncated,e[40]=n.diff,e[41]=n.refresh,e[42]=n.summary,e[43]=h,e[44]=p,e[45]=b,e[46]=f,e[47]=m,e[48]=g):g=e[48];let v;return e[49]!==t||e[50]!==g?(v=r.jsx(Jn,{...t,source:g}),e[49]=t,e[50]=g,e[51]=v):v=e[51],v}function Ea(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 Bc(t){const e=I.c(23);let s,a,n;e[0]!==t?({backend:s,cacheKey:a,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n):(s=e[1],a=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]!==a||e[10]!==o?(d={backend:s,cacheKey:a,scope:o},e[8]=s,e[9]=a,e[10]=o,e[11]=d):d=e[11];const l=Vn(d),i=s.source==="github";let u;e[12]!==s||e[13]!==l?(u=Ea(l,s),e[12]=s,e[13]=l,e[14]=u):u=e[14];let c;e[15]===Symbol.for("react.memo_cache_sentinel")?(c={allowed:!0,reason:null},e[15]=c):c=e[15];let h;e[16]!==i||e[17]!==n.branch||e[18]!==u?(h={...u,gate:c,headBranch:n.branch,hosted:i,otherWork:!1},e[16]=i,e[17]=n.branch,e[18]=u,e[19]=h):h=e[19];let p;return e[20]!==n||e[21]!==h?(p=r.jsx(Jn,{...n,source:h}),e[20]=n,e[21]=h,e[22]=p):p=e[22],p}function Ic(t){const e=I.c(58);let s,a,n;e[0]!==t?({backend:s,cacheKey:a,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n):(s=e[1],a=e[2],n=e[3]);const o=xs()?.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]!==a||e[10]!==d?(l={backend:s,cacheKey:a,scope:d},e[8]=s,e[9]=a,e[10]=d,e[11]=l):l=e[11];const i=Vn(l);let u;e[12]!==n.baseBranch||e[13]!==n.branch||e[14]!==n.fastPreview||e[15]!==n.orgSlug||e[16]!==n.recoverSandbox||e[17]!==n.virtualMcpId||e[18]!==o?(u={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,threadId:o,baseBranch:n.baseBranch,fastPreview:n.fastPreview,recoverSandbox:n.recoverSandbox},e[12]=n.baseBranch,e[13]=n.branch,e[14]=n.fastPreview,e[15]=n.orgSlug,e[16]=n.recoverSandbox,e[17]=n.virtualMcpId,e[18]=o,e[19]=u):u=e[19];const c=$a(u),h=n.mode!=="review";let p;e[20]!==c.allPaths||e[21]!==c.diff||e[22]!==c.status||e[23]!==n.branch||e[24]!==n.fastPreview||e[25]!==n.orgSlug||e[26]!==n.publishPolicy||e[27]!==n.virtualMcpId||e[28]!==h||e[29]!==o?(p={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,threadId:o,fastPreview:n.fastPreview,status:c.status,diff:c.diff,paths:c.allPaths,policy:n.publishPolicy,judgeEnabled:h},e[20]=c.allPaths,e[21]=c.diff,e[22]=c.status,e[23]=n.branch,e[24]=n.fastPreview,e[25]=n.orgSlug,e[26]=n.publishPolicy,e[27]=n.virtualMcpId,e[28]=h,e[29]=o,e[30]=p):p=e[30];const{gate:b}=Fa(p);let f;if(e[31]!==c.allPaths||e[32]!==i){let N;e[34]!==i?(N=C=>{const A=Kn(C);return A===null?!On(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=Ea(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:En(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=r.jsx(Jn,{...n,source:P}),e[55]=n,e[56]=P,e[57]=y):y=e[57],y}function Jn(t){const e=I.c(137),{source:s,publishLockRef:a,onOpenChange:n,mode:o,fastPreview:d,orgSlug:l,virtualMcpId:i,branch:u,baseBranch:c,repoTarget:h,owner:p,repo:b,draftPreviewUrl:f,destinationHost:m,previewServerUrl:g,compareDraft: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,k=ge(),[D]=Ar(),{language:S}=D,O=xs()?.taskId??null,{data:B}=nn.useSession(),T=Fr(Lr(l,i,u)),{allPaths:F,changedFilesTotal:L,changedFilesTruncated:W,diff:q,bodiesFailed:X,refresh:M,gate:H,hosted:J,otherWork:ne}=s;let Q;e[0]!==v||e[1]!==s.bodiesPending||e[2]!==s.cardsPending||e[3]!==s.summary?(Q={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]=Q):Q=e[4];const he=Q;let Z;e[5]!==J?(Z={hosted:J},e[5]=J,e[6]=Z):Z=e[6];const re=mo(he,Z),{summary:$,cardsPending:ee,bodiesPending:K,compareDraft:te}=re.shown,[se,Pe]=U.useState(null),[ae,ie]=U.useState(!1),[de,oe]=U.useState(Fc);let z;e[7]===Symbol.for("react.memo_cache_sentinel")?(z=V=>oe(ue=>ue.has(V)?ue:new Set(ue).add(V)),e[7]=z):z=e[7];const fe=z,[ke,me]=U.useState(null);let Y;e[8]===Symbol.for("react.memo_cache_sentinel")?(Y=[],e[8]=Y):Y=e[8];const[E,ce]=U.useState(Y);let Ie;e[9]!==s.v8?(Ie=V=>{me(V),ce(ue=>[V,...ue.filter(je=>je!==V)]),s.v8&&setTimeout(()=>fe(V),kc)},e[9]=s.v8,e[10]=Ie):Ie=e[10];const Qe=Ie,[Se,gt]=U.useState(null);let Je;e[11]!==se||e[12]!==$?(Je=Co(se,Do($)),e[11]=se,e[12]=$,e[13]=Je):Je=e[13];const ve=Je,xe=[...$.pages,...$.blocks,...$.other],Ae=xe.find(V=>Ce(V)===ke)??xe[0]??null,Be=Ae?Ce(Ae):null,_e=[...new Set([...Be?[Be]:[],...E,...xe.map(Ce)])].filter(V=>xe.some(ue=>Ce(ue)===V)).slice(0,Cc),Te=!!s.v8,[Rt,Me]=U.useState(null),$e=Te?Sc({selectedId:Be,readyIds:de,lastShownId:Rt,liveIds:_e}):Be;Te&&$e===Be&&$e!==Rt&&Me($e);const pe=N==="review"&&!J,ot=ee?"loading":K?"manifest":"ready",Ye=A?.state==="open",ct=s.headBranch,Fe=B?.user;let _;e[14]!==Fe?(_=ga(Fe),e[14]=Fe,e[15]=_):_=e[15];let le;e[16]!==s.expectedDiffSignature?(le=s.expectedDiffSignature?{expectedDiffSignature:s.expectedDiffSignature}:{},e[16]=s.expectedDiffSignature,e[17]=le):le=e[17];let ye;e[18]!==c||e[19]!==u||e[20]!==d||e[21]!==l||e[22]!==p||e[23]!==b||e[24]!==h||e[25]!==s.expectedHeadSha||e[26]!==s.headBranch||e[27]!==_||e[28]!==le||e[29]!==O||e[30]!==i?(ye={orgSlug:l,virtualMcpId:i,branch:u,threadId:O,fastPreview:d,baseBranch:c,target:h,owner:p,repo:b,headBranch:ct,coAuthor:_,expectedHeadSha:s.expectedHeadSha,...le},e[18]=c,e[19]=u,e[20]=d,e[21]=l,e[22]=p,e[23]=b,e[24]=h,e[25]=s.expectedHeadSha,e[26]=s.headBranch,e[27]=_,e[28]=le,e[29]=O,e[30]=i,e[31]=ye):ye=e[31];const Re=ye,Xe=pe?"review":"publish",dt=B?.user?.name;let Et;e[32]!==F||e[33]!==m||e[34]!==J||e[35]!==ve||e[36]!==n||e[37]!==y||e[38]!==P||e[39]!==a||e[40]!==M||e[41]!==s.protocol||e[42]!==Xe||e[43]!==dt||e[44]!==Re?(Et={mode:Xe,target:Re,note:ve,allPaths:F,destinationHost:m,publishLockRef:a,onOpenChange:n,refresh:M,onPullRequestChanged:P,onPublished:y,hosted:J,authorName:dt,protocol:s.protocol},e[32]=F,e[33]=m,e[34]=J,e[35]=ve,e[36]=n,e[37]=y,e[38]=P,e[39]=a,e[40]=M,e[41]=s.protocol,e[42]=Xe,e[43]=dt,e[44]=Re,e[45]=Et):Et=e[45];const{isPublishing:Ne,publishError:Ze,publishErrorDetail:ut,submit:et,discardChange:_t,discardAll:ys,deletedBlocks:Dt,publishWithResolutions:xt,dismissDeletedBlocks:js}=oi(Et),tt=_r(l,i).phase==="saving",Tt=$.count>0||ne,vt=!Ne&&Tt&&(pe||H.allowed);let yt;e[46]!==c||e[47]!==pe||e[48]!==s.v8||e[49]!==$.count||e[50]!==k?(yt=pe?$.count===0?k("thread.publishPopover.submitForReview"):$.count===1?k("thread.publishPopover.submitOneForReview"):k("thread.publishPopover.submitCountForReview",{count:$.count}):wc($.count,c,!!s.v8,k),e[46]=c,e[47]=pe,e[48]=s.v8,e[49]=$.count,e[50]=k,e[51]=yt):yt=e[51];const jt=yt;let zt;e:{if(pe&&Ye){let je;e[52]!==A.number||e[53]!==k?(je=k("thread.publishPopover.updatesPullRequest",{number:A.number}),e[52]=A.number,e[53]=k,e[54]=je):je=e[54],zt=je;break e}const V=C;if(!V?.mergedAt){zt=null;break e}let ue;if(e[55]!==S||e[56]!==V||e[57]!==k){const je=tl(new Date(V.mergedAt),S),De=dc(V);ue=De?k("thread.publishPopover.lastPublishedBy",{when:je,name:De}):k("thread.publishPopover.lastPublished",{when:je}),e[55]=S,e[56]=V,e[57]=k,e[58]=ue}else ue=e[58];zt=ue}const wt=zt;let Ut;e[59]!==pe||e[60]!==$.count||e[61]!==k?(Ut=pe?k("thread.publishPopover.submitForReview"):$.count===1?k("thread.publishPopover.publishOne"):$.count>1?k("thread.publishPopover.publishCount",{count:$.count}):k("thread.publishPopover.publish"),e[59]=pe,e[60]=$.count,e[61]=k,e[62]=Ut):Ut=e[62];const Kt=Ut,Pt=(V,ue)=>ue.length===0?null:r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("div",{className:"px-0.5 text-2xs font-medium text-muted-foreground",children:V}),ue.map(je=>{const De=Ce(je);return r.jsx(Ca,{change:je,bodyPending:K,selected:Ae!==null&&Ce(Ae)===De,onSelect:()=>Qe(De),confirming:Se===De,onConfirmingChange:Oe=>gt(Oe?De:null),onDiscard:s.canDiscard(je)?()=>{_t(je)}:void 0,isPublishing:Ne,isDiscarding:tt,v8:!!s.v8},De)})]});let ht;e:{if(pe||!Tt){ht=null;break e}if(H.pending){let De;e[63]===Symbol.for("react.memo_cache_sentinel")?(De=r.jsx(ms,{className:"size-3.5 motion-reduce:animate-none"}),e[63]=De):De=e[63];let Oe;e[64]!==k?(Oe=k("thread.publishPopover.reviewing"),e[64]=k,e[65]=Oe):Oe=e[65];let Ve;e[66]!==Oe?(Ve=r.jsxs("div",{className:"flex items-center gap-2 border-t px-4 py-2.5 text-xs text-muted-foreground",children:[De,Oe]}),e[66]=Oe,e[67]=Ve):Ve=e[67],ht=Ve;break e}if(H.allowed){ht=null;break e}let V;e[68]===Symbol.for("react.memo_cache_sentinel")?(V=r.jsx(Sn,{className:"mt-0.5 size-3.5 shrink-0"}),e[68]=V):V=e[68];let ue;e[69]!==H.reason||e[70]!==k?(ue=H.reason??k("thread.publishPopover.needsReviewGeneric"),e[69]=H.reason,e[70]=k,e[71]=ue):ue=e[71];let je;e[72]!==ue?(je=r.jsxs("div",{className:"flex items-start gap-2 border-t px-4 py-2.5 text-xs text-warning",children:[V,r.jsx("span",{children:ue})]}),e[72]=ue,e[73]=je):je=e[73],ht=je}const Bt=ht;let ft;e[74]!==ys||e[75]!==ae||e[76]!==tt||e[77]!==Ne||e[78]!==s.canDiscardAll||e[79]!==$.count||e[80]!==k?(ft=$.count<=1||!s.canDiscardAll?null:r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"ml-auto shrink-0 text-2xs text-muted-foreground transition-colors hover:text-destructive disabled:opacity-50",onClick:()=>ie(!0),disabled:Ne||tt,children:k("thread.publishPopover.discardAll")}),r.jsx(Ds,{open:ae,onOpenChange:ie,children:r.jsxs(Rs,{children:[r.jsxs(Cs,{children:[r.jsx(Ss,{children:k("thread.publishPopover.discardAllTitle")}),r.jsx(Ns,{children:k("thread.publishPopover.discardAllConfirm")})]}),r.jsxs(As,{children:[r.jsx(Gs,{children:k("thread.publishDialog.cancel")}),r.jsx(Ws,{onClick:()=>{ys()},disabled:tt,className:G($r({variant:"destructive"})),children:k("thread.publishPopover.discardAll")})]})]})})]}),e[74]=ys,e[75]=ae,e[76]=tt,e[77]=Ne,e[78]=s.canDiscardAll,e[79]=$.count,e[80]=k,e[81]=ft):ft=e[81];const ws=ft,It=ee?r.jsx(Ts,{children:r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(Lt,{}),r.jsx(Lt,{})]})}):$.count===0&&ne?r.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:k("thread.publishPopover.onlyOtherWork")}):$.count===0?r.jsxs("div",{className:"flex flex-col items-center gap-1 py-10 text-center",children:[r.jsx(Ln,{className:"mb-1 size-5 text-success"}),r.jsx("p",{className:"text-sm font-medium",children:k(pe?"thread.publishPopover.nothingToSubmit":"thread.publishPopover.everythingLive")}),r.jsx("p",{className:"text-xs text-muted-foreground",children:k(pe?"thread.publishPopover.submitEmptyHint":"thread.publishPopover.emptyHint")})]}):r.jsxs(Ts,{children:[W?r.jsx("p",{className:"text-2xs text-muted-foreground",children:k("thread.publishPopover.showingFirst",{shown:$.count,total:L})}):null,Pt(k("thread.publishPopover.pagesGroup"),$.pages),Pt(k("thread.publishPopover.blocksGroup"),$.blocks),Pt(k("thread.publishPopover.otherGroup"),$.other),X?r.jsx("p",{className:"text-2xs text-muted-foreground",children:k("thread.publishPopover.detailsUnavailable")}):null,ne?r.jsx("p",{className:"text-2xs text-muted-foreground",children:k("thread.publishPopover.alsoOtherWork")}):null]}),$t=ee?r.jsx(Gn,{}):Ae?r.jsx("div",{className:G(bs,"relative"),children:xe.filter(V=>_e.includes(Ce(V))).map(V=>r.jsx("div",{className:G("absolute inset-0 flex",Te?Ce(V)===$e?"z-10":"pointer-events-none opacity-0":Ce(V)!==Be&&"hidden"),inert:Te&&Ce(V)!==$e,"aria-hidden":Te&&Ce(V)!==$e?!0:void 0,children:r.jsx(Ia,{change:V,diff:q,bodyPending:K,previewServerUrl:g,draft:te,lastPage:T,v8:s.v8,onReady:Te?()=>fe(Ce(V)):void 0})},Ce(V)))}):r.jsx("div",{className:G(bs,"bg-muted/40")});let mt;e[82]!==jt?(mt=r.jsx("span",{className:"truncate",children:jt}),e[82]=jt,e[83]=mt):mt=e[83];let ze;e[84]!==ws||e[85]!==N||e[86]!==wt||e[87]!==mt?(ze=r.jsx(Wn,{mode:N,title:mt,subLine:wt,trailing:ws}),e[84]=ws,e[85]=N,e[86]=wt,e[87]=mt,e[88]=ze):ze=e[88];let st;e[89]!==Ne||e[90]!==pe||e[91]!==ve||e[92]!==$.count||e[93]!==k?(st=$.count===0?null:r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"text-sm font-medium",children:k(pe?"thread.publishPopover.reviewNote":"thread.publishPopover.versionNote")}),r.jsx(ni,{value:ve,onChange:V=>Pe(V.target.value),placeholder:k(pe?"thread.publishPopover.reviewNotePlaceholder":"thread.publishPopover.versionNotePlaceholder"),rows:2,maxLength:ci,className:"resize-none text-sm",disabled:Ne})]}),e[89]=Ne,e[90]=pe,e[91]=ve,e[92]=$.count,e[93]=k,e[94]=st):st=e[94];let Ue;e[95]!==f||e[96]!==k?(Ue=r.jsx(Qn,{draftPreviewUrl:f,t:k}),e[95]=f,e[96]=k,e[97]=Ue):Ue=e[97];let Ke;e[98]!==vt||e[99]!==H||e[100]!==Tt||e[101]!==J||e[102]!==Ne||e[103]!==pe||e[104]!==w||e[105]!==Kt||e[106]!==re||e[107]!==et||e[108]!==k?(Ke=!pe&&!J&&Tt&&!H.allowed&&!H.pending?r.jsx(be,{type:"button",className:"flex-1",onClick:w,disabled:Ne,children:k("thread.publishPopover.requestApproval")}):r.jsxs(be,{type:"button",variant:pe?"default":"brand",className:"flex-1",onClick:()=>{re.hold(),et().then(V=>{V===!1&&re.release()})},disabled:!vt,children:[Ne?r.jsx(ms,{className:"size-4 motion-reduce:animate-none"}):null,Ne?k(pe?"thread.publishPopover.submitting":"thread.publishPopover.publishing"):Kt]}),e[98]=vt,e[99]=H,e[100]=Tt,e[101]=J,e[102]=Ne,e[103]=pe,e[104]=w,e[105]=Kt,e[106]=re,e[107]=et,e[108]=k,e[109]=Ke):Ke=e[109];let qe;e[110]!==Ue||e[111]!==Ke?(qe=r.jsxs("div",{className:"flex gap-2",children:[Ue,Ke]}),e[110]=Ue,e[111]=Ke,e[112]=qe):qe=e[112];let nt;e[113]!==Ze||e[114]!==ut||e[115]!==k?(nt=Ze?r.jsxs("div",{children:[r.jsx("p",{className:"text-xs text-destructive",children:Ze}),ut?r.jsx(ul,{label:k("siteEditor.details"),detail:ut}):null]}):null,e[113]=Ze,e[114]=ut,e[115]=k,e[116]=nt):nt=e[116];let kt;e[117]!==c||e[118]!==Dt||e[119]!==js||e[120]!==Ne||e[121]!==xt?(kt=Dt?r.jsx(La,{blocks:Dt,base:c,pending:Ne,onCancel:js,onConfirm:V=>{xt(V)}},Dt.map($c).join(`
|
|
4
4
|
`)):null,e[117]=c,e[118]=Dt,e[119]=js,e[120]=Ne,e[121]=xt,e[122]=kt):kt=e[122];let St;e[123]!==qe||e[124]!==nt||e[125]!==kt?(St=r.jsxs(r.Fragment,{children:[qe,nt,kt]}),e[123]=qe,e[124]=nt,e[125]=kt,e[126]=St):St=e[126];let Le;e[127]!==It||e[128]!==Bt||e[129]!==ot||e[130]!==ze||e[131]!==st||e[132]!==St?(Le=r.jsx(cn,{state:ot,header:ze,body:It,note:st,gate:Bt,footer:St}),e[127]=It,e[128]=Bt,e[129]=ot,e[130]=ze,e[131]=st,e[132]=St,e[133]=Le):Le=e[133];let He;return e[134]!==$t||e[135]!==Le?(He=r.jsx($s,{pane:$t,list:Le}),e[134]=$t,e[135]=Le,e[136]=He):He=e[136],He}function $c(t){return t.path}function Fc(){return new Set}function Lc(t){if(!(t==="claiming"||t==="ready"||t==="failed"))return Ti[t].short}const Oc=new Set(["failure","timed_out","cancelled","action_required"]);function _a(t){return t.status==="completed"&&Oc.has(t.conclusion)}function Yn(t){return t.status==="queued"||t.status==="in_progress"}function Vs(t){return t.isPending&&t.fetchStatus!=="idle"}function Mc(t){return{key:"view-change-request",label:t("thread.cmsActions.viewOnProvider"),action:"open-pr-page"}}function pt(t,e,s){return e?[...t,Mc(s)]:t}function Ge(t,e,s){return e.kind!=="ready"||e.behindBase<=0?t:[...t,{key:"get-latest",label:s("thread.cmsActions.getLatest"),action:"sync",tooltip:s("thread.cmsActions.getLatestTooltip")}]}function pr(t){return{key:"submit-for-review",label:t("thread.headerActions.submitForReview"),action:"create-pr"}}function Us(t,e,s){if(e.filter(Yn).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 Ec(t){const{lifecycle:e,branch:s,pr:a,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&&Lc(t.claimPhase.kind)||l("thread.headerActions.startingSandbox"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.waitingForDaemonTooltip"),menu:[]};case"cloning":return{label:l("thread.headerActions.cloningRepo"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.cloningRepoTooltip"),menu:[]};case"clone-failed":return{label:l("thread.headerActions.cloneFailed"),disabled:!0,variant:"outline",tooltip:e.error||l("thread.headerActions.cloneFailedDefaultTooltip"),menu:[]};case"checking-out":return{label:l("thread.headerActions.switchingTo",{branch:e.to}),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.checkingOutTooltip",{branch:e.to}),menu:[]};case"installing":return{label:l("thread.headerActions.installingPackages"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.installingPackagesTooltip"),menu:[]};case"starting":{if(!(s.kind==="ready"&&(s.workingTreeDirty||s.aheadOfBase>0||s.unpushed>0))&&!t.noReviewableDiff)return{label:l("thread.headerActions.startingApp"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.startingAppTooltip"),menu:[]};break}}if(s.kind!=="ready")return{label:l("thread.headerActions.loadingBranch"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.waitingForBranchTooltip"),menu:[]};const i=s,u=i.unpushed>0&&!(a&&i.headSha&&a.headSha&&i.headSha===a.headSha);if(t.noReviewableDiff&&!a)return{label:l("thread.headerActions.upToDate"),disabled:!0,variant:"outline",tooltip:l("thread.headerActions.branchInSyncTooltip",{base:i.base}),menu:Ge([],i,l)};if(i.workingTreeDirty||u)return{label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:Ge(pt([pr(l)],a,l),i,l)};if(pa("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:a?.merged??null,prState:a?.state??null}),a?.merged)return!!i.headSha&&!!a.headSha&&i.headSha!==a.headSha?{label:l("thread.headerActions.continue"),action:"create-pr",variant:"special",tooltip:l("thread.headerActions.openNewPrTooltip"),menu:Ge(pt([],a,l),i,l)}:{label:l("thread.headerActions.upToDate"),disabled:!0,variant:"outline",tooltip:l("thread.headerActions.prMergedTooltip",{prNumber:String(a.number),base:a.base}),menu:Ge(pt([],a,l),i,l)};if(i.aheadOfBase>0){if(a&&a.state==="closed"&&!a.merged)return{label:l("thread.headerActions.reopenPr"),action:"reopen",variant:"default",tooltip:l("thread.headerActions.reopenPrTooltip",{prNumber:String(a.number)}),menu:Ge(pt([],a,l),i,l)};if(!a)return{label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:Ge([pr(l)],i,l)};if((o?.mergeableState??"unknown")==="dirty")return{label:l("thread.cmsActions.getLatest"),action:"rebase",variant:"default",tooltip:l("thread.cmsActions.getLatestTooltip"),menu:[{key:"resolve-on-provider",label:l("thread.cmsActions.resolveOnProvider"),action:"open-pr-page"}]};const h=n.filter(Yn).length,p=n.filter(_a).map(f=>f.name);if(h===0&&p.length>0)return{label:l("thread.headerActions.fixChecks"),action:"fix-checks",variant:"default",tooltip:l("thread.headerActions.failingChecksTooltip",{checks:p.join(", ")}),meta:{failingChecks:p},menu:Ge(pt([{key:"publish-anyway",label:l("thread.headerActions.publishAnyway"),action:"merge",tooltip:l("thread.headerActions.squashMergeTooltip",{prNumber:String(a.number),base:a.base})}],a,l),i,l)};if(o?.draft)return Us({label:l("thread.headerActions.markReady"),action:"mark-ready",variant:"default",tooltip:l("thread.headerActions.markDraftReadyTooltip"),menu:Ge(pt([],a,l),i,l)},n,l);const b=o?.unresolvedConversations??0;return b>0?Us({label:l("thread.headerActions.addressFeedback"),action:"resolve-comments",variant:"default",tooltip:l("thread.headerActions.unresolvedConversationsTooltip",{count:String(b)}),menu:Ge(pt([],a,l),i,l)},n,l):o?.missingRequiredApprovals?Us({label:l("thread.cmsActions.waitingForReview"),action:"open-pr-page",variant:"outline",tooltip:l("thread.headerActions.waitingForApprovalsTooltip"),menu:Ge(pt([],a,l),i,l)},n,l):Us({label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",meta:{publishPolicyOverride:"open"},menu:Ge(pt([{key:"review",label:l("thread.headerActions.review"),action:"review"}],a,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 br(t){return{key:"view-change-request",label:t("thread.cmsActions.viewOnProvider"),action:"open-pr"}}function Ks(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 gr(t,e,s,a){const n=e.length;if(n===0)return t;if(e.filter(Yn).length>0){const l=e.filter(u=>u.status==="completed").length,i=a("thread.cmsActions.checksRunning",{done:l,total:n});return s==="loading"?{...t,loading:!0,tooltip:i}:{...t,tooltip:i}}const d=e.filter(_a).length;return d>0?{...t,variant:"warning",tooltip:a("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 zc(t){return Vs(t.prQuery)?!0:t.pr?.state!=="open"||t.pr.merged?!1:Vs(t.checksQuery)||Vs(t.reviewsQuery)}function Uc(t,e){return t.workingTreeDirty?!0:e!==null?e>0:t.aheadOfBase>0}function Kc(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 qc(t){return{...t,menu:[]}}function Hc(t){const{branch:e,pr:s,checks:a,reviews:n,publishing:o,saving:d,loading:l,publishableChangeCount:i,t:u}=t;if(e.kind!=="ready"&&t.statusError)return{label:u("thread.cmsActions.retry"),action:"retry-status",variant:"outline",disabled:t.statusRetrying,loading:t.statusRetrying,tooltip:t.statusError,menu:[]};if(l||e.kind!=="ready")return{label:u("thread.headerActions.loading"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(o)return{label:u("thread.cmsActions.publishing"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(t.syncing)return{label:u("thread.cmsActions.gettingLatest"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(d)return{label:u("thread.headerActions.saving"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(s&&s.state==="open"&&!s.merged?s:null){const h=n?.mergeableState??"unknown";return h==="dirty"?{label:u("thread.cmsActions.getLatest"),action:"get-latest",variant:"default",tooltip:u("thread.cmsActions.getLatestTooltip"),menu:[{key:"resolve-on-provider",label:u("thread.cmsActions.resolveOnProvider"),action:"open-pr"}]}:h==="blocked"||n?.draft?gr({label:u("thread.cmsActions.waitingForReview"),action:"open-pr",variant:"outline",menu:Ks([br(u)],e,u)},a,"loading",u):gr({label:u("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:Ks([br(u)],e,u)},a,"none",u)}return _c(s,e)?{label:u("thread.headerActions.upToDate"),variant:"outline",disabled:!0,menu:Ks([],e,u)}:Uc(e,i)?{label:u("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:Ks([{key:"request-approval",label:u("thread.headerActions.submitForReview"),action:"request-approval"}],e,u)}:e.behindBase>0?{label:u("thread.cmsActions.getLatest"),action:"get-latest",variant:"default",tooltip:u("thread.cmsActions.getLatestTooltip"),menu:[],autoRun:e.aheadOfBase===0}:{label:u("thread.headerActions.upToDate"),variant:"outline",disabled:!0,menu:[]}}function Vc(t){return t.conflicting===!0?"dirty":t.conflicting===null?"unknown":t.reviewBlocked||t.unresolvedConversations>0?"blocked":"clean"}function za(t){const e=I.c(4);let s;e[0]!==t?(s=Ll(t),e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a={...s,select:Gc},e[2]=s,e[3]=a):a=e[3],bt(a)}function Gc(t){const e=t.changeRequest;return e?{draft:e.draft,mergeableState:Vc(e),unresolvedConversations:e.unresolvedConversations,missingRequiredApprovals:e.reviewBlocked}:null}function xr(t,e){return t==="open-pr"||e==="resolve-on-provider"?r.jsx(oa,{size:16}):t==="publish"?r.jsx(Wr,{className:"size-4"}):t==="get-latest"||t==="retry-status"?r.jsx(Nn,{className:"size-4"}):r.jsx(an,{className:"size-4"})}function Wc(t){const e=I.c(67),{virtualMcpId:s}=t,a=ge(),{org:n}=Bs(),o=Cr(),d=Is(s),{data:l}=nn.useSession(),i=Tn(),{deleteRelease:u}=on(s),{currentBranch:c,setCurrentTaskBranch:h,taskId:p,createTask:b}=Or();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({open:!0,mode:_}),e[1]=v):v=e[1];const j=v,w=na(d),x=w.status==="attached"||w.status==="public-clone"?w.repo:null,{previewServerUrl:P}=vs(s),y=c?Fr(Lr(n.slug,s,c)):null,N=y?Fn(y.path,y.params):"/",C=Wl(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 k=Ql(A),D=Ot(s,c),S=D.kind==="protocol"&&D.source==="github";let O;e[6]!==c||e[7]!==n.slug||e[8]!==s?(O=c?{orgSlug:n.slug,virtualMcpId:s,branch:c}:null,e[6]=c,e[7]=n.slug,e[8]=s,e[9]=O):O=e[9];const B=Dn(O),T=ca(S?D:null,B);let F;e[10]!==n.slug||e[11]!==s?(F=hl(n.slug,s),e[10]=n.slug,e[11]=s,e[12]=F):F=e[12];const L=fl(F,S?k:null),W=S?ml(P,N,L):C.url,q=c??"",X=p??null;let M;e[13]!==n.slug||e[14]!==q||e[15]!==X||e[16]!==s?(M=Mn({orgSlug:n.slug,virtualMcpId:s,branch:q,threadId:X}),e[13]=n.slug,e[14]=q,e[15]=X,e[16]=s,e[17]=M):M=e[17];const H=!!c&&D.kind!=="pending"&&!S;let J;e[18]!==M||e[19]!==H?(J={...M,enabled:H},e[18]=M,e[19]=H,e[20]=J):J=e[20];const ne=bt(J),Q=S?null:ne.data??null,he=S?Kc(T.data,c??""):null,Z=he?he.branchMeta:Q?{kind:"ready",branch:_n(Q)??c??"",base:Q.base??"main",workingTreeDirty:ki(Q),unpushed:Q.unpushed??0,aheadOfBase:Q.aheadOfBase??0,behindBase:Q.behindBase??0,headSha:Q.headSha??""}:{kind:"unknown"},re=he?he.publishableChangeCount:Q?.changedFiles?ka({files:Q.changedFiles}).count:null,$=S?T:ne,ee=(Z.kind==="ready"?Z.branch:null)??c??null,K=Z.kind==="ready"?Z.base:"main",te=ra({orgId:n.id,orgSlug:n.slug,target:Ee(x),owner:x?.owner??"",repo:x?.name??"",branch:ee}),se=te.data??null,Pe=aa({orgId:n.id,orgSlug:n.slug,target:Ee(x),owner:x?.owner??"",repo:x?.name??"",base:K}),ae=la({orgId:n.id,orgSlug:n.slug,target:Ee(x),owner:x?.owner??"",repo:x?.name??"",branch:ee}),ie=za({orgId:n.id,orgSlug:n.slug,target:Ee(x),owner:x?.owner??"",repo:x?.name??"",branch:ee});let de;e[21]!==ae||e[22]!==se||e[23]!==te||e[24]!==ie?(de=zc({pr:se,prQuery:te,checksQuery:ae,reviewsQuery:ie}),e[21]=ae,e[22]=se,e[23]=te,e[24]=ie,e[25]=de):de=e[25];const oe=de;let z;e[26]!==te?(z=async()=>{await te.refetch()},e[26]=te,e[27]=z):z=e[27];const fe=z,ke=Zn({mutationFn:()=>ho({hosted:S,branch:c,baseBranch:K,nextBranch:()=>Nl(c,Bn(l?.user),i),setCurrentTaskBranch:h,deleteRelease:u}),onError:Yc}),[me,Y]=U.useState(null);let E;e[28]!==n.slug||e[29]!==p||e[30]!==s?(E=async _=>(await Si({orgSlug:n.slug,virtualMcpId:s,branch:_.branch,threadId:p??null},_.base,_.resolutions),_),e[28]=n.slug,e[29]=p,e[30]=s,e[31]=E):E=e[31];let ce;e[32]!==c||e[33]!==n.slug||e[34]!==o||e[35]!==a||e[36]!==p||e[37]!==s?(ce=async _=>{Y(null),rt.success(a("thread.headerActions.syncedWithBase",{base:_.base}));const le=gs.decofile(`${n.slug}/${s}/${_.branch}`);await o.cancelQueries({queryKey:le}),await Promise.all([o.invalidateQueries({queryKey:zn({orgSlug:n.slug,virtualMcpId:s,branch:c??_.branch,threadId:p??null})}),o.invalidateQueries({queryKey:le})])},e[32]=c,e[33]=n.slug,e[34]=o,e[35]=a,e[36]=p,e[37]=s,e[38]=ce):ce=e[38];let Ie;e[39]===Symbol.for("react.memo_cache_sentinel")?(Ie=(_,le)=>{if(_ instanceof Ni){Y({...le,blocks:_.blocks});return}rt.error(_ instanceof Error?_.message:String(_))},e[39]=Ie):Ie=e[39];let Qe;e[40]!==E||e[41]!==ce?(Qe={mutationFn:E,onSuccess:ce,onError:Ie},e[40]=E,e[41]=ce,e[42]=Qe):Qe=e[42];const Se=Zn(Qe),gt=zr(n.slug,s),Je=ke.isPending,ve=Hc({branch:Z,pr:se,checks:ae.data??[],reviews:ie.data??null,publishing:Je,saving:gt,syncing:Se.isPending,statusRetrying:$.isFetching&&!!$.error,statusError:$.error instanceof Error?$.error.message:$.error?String($.error):null,loading:!!oe,publishableChangeCount:re,t:a}),xe=S?qc(ve):ve,Ae=xe.autoRun&&Z.kind==="ready"&&x&&P?`${ee}@${Z.headSha}`:null,Be=U.useRef(null);if(U.useEffect(()=>{!Ae||!ee||Be.current!==Ae&&(Be.current=Ae,Se.mutate({branch:ee,base:K}))},[Ae,ee,K,Se]),w.status==="detached"){let _;e[43]!==a?(_=a("thread.headerActions.reconnectGithub"),e[43]=a,e[44]=_):_=e[44];let le;e[45]!==_?(le=r.jsx(lt,{asChild:!0,children:r.jsx("span",{children:r.jsx(be,{size:"sm",variant:"outline",disabled:!0,children:_})})}),e[45]=_,e[46]=le):le=e[46];let ye;e[47]!==a?(ye=a("thread.headerActions.githubConnectionRemoved"),e[47]=a,e[48]=ye):ye=e[48];let Re;e[49]!==ye?(Re=r.jsx(it,{children:ye}),e[49]=ye,e[50]=Re):Re=e[50];let Xe;return e[51]!==le||e[52]!==Re?(Xe=r.jsx(rn,{children:r.jsxs(at,{children:[le,Re]})}),e[51]=le,e[52]=Re,e[53]=Xe):Xe=e[53],Xe}if(!d)return null;if(!x||!P){const _=x?"noPreviewServer":"noRepo";let le;e[54]!==c||e[55]!==b?(le=c?()=>{const Re=b?.({runtime:"sandbox",branch:c});Re&&sl("coding_session_started",{thread_id:Re})}:void 0,e[54]=c,e[55]=b,e[56]=le):le=e[56];let ye;return e[57]!==_||e[58]!==le?(ye=r.jsx(Xc,{reason:_,onStartCodingSession:le}),e[57]=_,e[58]=le,e[59]=ye):ye=e[59],ye}if(!c)return null;const _e=_=>{switch(_){case"publish":{j("publish");return}case"request-approval":{j("review");return}case"get-latest":{if(!ee||Se.isPending)return;Se.mutate({branch:ee,base:K});return}case"retry-status":{$.refetch();return}case"open-pr":{se?.htmlUrl&&window.open(se.htmlUrl,"_blank","noopener,noreferrer");return}}};let Te;e[60]!==_e?(Te=_=>({key:_.key,label:_.label,icon:xr(_.action,_.key),..._.tooltip?{tooltip:_.tooltip}:{},onSelect:()=>_e(_.action)}),e[60]=_e,e[61]=Te):Te=e[61];const Rt=xe.menu.map(Te),Me=xe.action,$e=xe.label,pe=xe.variant,ot=!!xe.loading;let Ye;e[62]!==a?(Ye=a("thread.cmsActions.moreActionsAriaLabel"),e[62]=a,e[63]=Ye):Ye=e[63];const ct=r.jsx(ba,{size:"sm",label:$e,variant:pe,disabled:!!xe.disabled||!Me,loading:ot,...Me&&!xe.loading?{icon:xr(Me)}:{},...xe.tooltip?{tooltip:xe.tooltip}:{},items:Rt,menuAriaLabel:Ye,onClick:Me?()=>_e(Me):void 0});let Fe;return e[64]!==me||e[65]!==Se?(Fe=me?r.jsx(La,{blocks:me.blocks,base:me.base,pending:Se.isPending,onCancel:()=>Y(null),onConfirm:_=>Se.mutate({branch:me.branch,base:me.base,resolutions:_})},me.blocks.map(Jc).join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as I,j as r,n as v,b as M,a4 as P,bf as R}from"./index-
|
|
1
|
+
import{c as I,j as r,n as v,b as M,a4 as P,bf as R}from"./index-D9poEv_S.js";import{E as T}from"./empty-state-BtNfctJt.js";import{u as w}from"./chat-context-BLnGXGPp.js";import{u as B,j as L,k as _}from"./site-editor-toast-BEmWExuz.js";import{i as $,u as A,j as Q,S as U}from"./blocks-tab-states-BSrtLgq9.js";import{a as G}from"./use-panel-navigate-CWTvXMgS.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:D}=G();if(!u){const s=t.noDraftTitle,F=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]!==D?(f=()=>D("content"),e[2]=D,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:F,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 D=g,c=L(D),h=A(D),j=c.data,s=h.data;let F;e[5]!==t||e[6]!==l||e[7]!==i?(F={orgSlug:l,virtualMcpId:i,branch:t},e[5]=t,e[6]=l,e[7]=i,e[8]=F):F=e[8];const d=_(F,Q);if(!j||!s||!d.ready){if(c.isError||h.isError||d.failed){const N=o.loadFailed,O=o.loadFailedHint;let b;e[9]!==u?(b=u("sectionsEditor.namedRules.tryAgain"),e[9]=u,e[10]=b):b=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]!==b||e[16]!==E?(S={label:b,onClick:E},e[15]=b,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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as u,r as g,j as n,J as G,a0 as F,a as E,l as O,b as P,n as y,L as H}from"./index-D9poEv_S.js";import{C as M}from"./chat-context-BLnGXGPp.js";import{ChatLayout as x}from"./index-DfQA1GAT.js";import{L}from"./index-C302vCyS.js";import{B as J}from"./blocks-preview-workspace-context-GWtlleeP.js";import{e as T,p as K,s as V,a as W,r as U,T as $,u as R,b as z}from"./site-editor-toast-BEmWExuz.js";import{u as q,L as B,P as Q,S as X}from"./preview-tab-C-V2oAhZ.js";import{C as Y}from"./content-tab-vWa8SHR9.js";import{T as Z}from"./tab-icon-glyph-DU1L4T-q.js";import{r as tt}from"./resolve-tab-icon-BdVF5ixR.js";import ot from"./agent-site-editor-C1fA8VpJ.js";import"./use-panel-navigate-CWTvXMgS.js";import"./thread-route-DXN_3XgT.js";import"./use-project-scope-DFLIrTST.js";import"./repository-binding-DnDGprHj.js";import"./use-mcp-client-DUKo5caa.js";import"./auth-JsuyXQmx.js";import"./use-view-draft-kind-TCEqZWio.js";import"./use-blog-view-BD--oPX4.js";import"./use-organization-settings-eZ0X29xl.js";import"./schema-ur1hUUl7.js";import"./task-board-S28SxUs0.js";import"./thread-intent-DHr3JStM.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-ClMPSfwQ.js";import"./session-runtime-D87un1xV.js";import"./use-entitlements-DFIFwphq.js";import"./use-ai-providers-CV6RttZq.js";import"./use-current-view-DPlgL3Qy.js";import"./use-in-settings-CeajORvg.js";import"./use-decopilot-events-CjaQwgdu.js";import"./use-mobile-CwwSZrIf.js";import"./tooltip-BEauahba.js";import"./index-DMf-vAS9.js";import"./Minimize01-BSWAuJc_.js";import"./XClose-CbqnWE9C.js";import"./thread-button-B-htK7Vf.js";import"./use-sidebar-collapsed-mYa34tIq.js";import"./sheet-DCU86hqn.js";import"./use-chat-layout-state-CAyGUasr.js";import"./toolbar-icon-button-DeWs4WCs.js";import"./resizable-p6SPDaRS.js";import"./route-page-header-BHWZyk8y.js";import"./LayoutLeft-BgxQ02aQ.js";import"./task-key-CXYVACcD.js";import"./sortable.esm-YJOEuS_v.js";import"./Tool01-BVIO9Qty.js";import"./agent-icon-DkJRVLqK.js";import"./AlertCircle-BZ0BGwnM.js";import"./UserCheck01-C2z5zhQe.js";import"./ArrowUp-CwKaPNjB.js";import"./ArrowLeft-BTOFmFlT.js";import"./ArrowRight-BpkoTWQH.js";import"./BookOpen01-DhDZ7eNO.js";import"./Globe04-jkYXmi_b.js";import"./CheckCircle-CY8bNwGH.js";import"./TrendUp01-CLufuADE.js";import"./ChevronDown-BKlrlXc3.js";import"./ChevronSelectorVertical-BePvvjKF.js";import"./ChevronUp-CHCELrzp.js";import"./UserSquare-B9MlTUcx.js";import"./LinkBroken01-Cxiv48HY.js";import"./CreditCard01-uK4ZToQn.js";import"./File02-CKfJdGFc.js";import"./SwitchHorizontal01-BSYwKL4Y.js";import"./Eye-kjpbNZjZ.js";import"./Image01-Bo1SdsGt.js";import"./Key01-7H0qkrA1.js";import"./Minus-DcVQxn2x.js";import"./Monitor01-DihbBP9d.js";import"./Sun-CfU4AOYR.js";import"./Play-C20jb3jc.js";import"./Plus-i14Zi4mM.js";import"./SearchMd-fVOqR5XB.js";import"./ShoppingBag01-CGXAeyMk.js";import"./Trash01-P2MZx3ms.js";import"./Upload01-Dprp9ZwK.js";import"./Users01-BcGcy0wY.js";import"./Zap-DPxvV-Nt.js";import"./context-menu-725S94S-.js";import"./use-org-notice-Fc3F28TT.js";import"./create-organization-dialog-CQU8vsHz.js";import"./form-YdpHvMEe.js";import"./label-BCYFBbIw.js";import"./project-apps-hjYt3L4J.js";import"./use-recent-apps-ikKC1oeZ.js";import"./use-navigate-to-agent-BcceyDj5.js";import"./command-D_N7zpwy.js";import"./index-4hVIbVvu.js";import"./use-debounced-value-DcMmpwkI.js";import"./feedback-BqoIMOg7.js";import"./textarea-CUxYZmtB.js";import"./use-sandbox-events-lKDZ1Wyg.js";import"./sandbox-url-D3mC8qhT.js";import"./use-blocks-v8-project-CIRMr5RK.js";import"./use-voice-input-fhkEdy7b.js";import"./popover-CP-hSbhT.js";import"./drawer-BHd0Jra6.js";import"./index-BW7F0oP5.js";import"./checkbox-jFW417rg.js";import"./select-DbziOf0e.js";import"./index-BdQq_4o_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./utils-DHHEaoAA.js";import"./sandbox-git-api-Bi9RvPsJ.js";import"./save-status-CbKB2tgB.js";import"./use-never-published-rNVNFzx6.js";import"./hosted-reconcile-CACimEU-.js";import"./blocks-tab-states-BSrtLgq9.js";import"./empty-state-BGUxoSrw.js";import"./search-input-CAfR6Gbn.js";import"./tabs-DNtYd_FL.js";import"./active-indicator-CCMhAsc_.js";import"./use-file-configs-BQgzQxDR.js";import"./asset-utils-sFjfnFiW.js";import"./useInfiniteQuery-CA_opHOs.js";import"./infiniteQueryObserver-CaEK8ONs.js";import"./usage-stats-C3riqRUR.js";import"./utils-CVEq3hMx.js";import"./markdown-DYPhmlaF.js";import"./use-copy-CLhCSJsi.js";import"./gateway-client-BmjZ0joI.js";import"./switch-DwFzcsns.js";import"./toggle-group-7Kk4-ob3.js";import"./match-site-slug-config-B47_xZCi.js";import"./sandbox-lifecycle-context-C4V1kqms.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./frame-navigation-DjoSOUXB.js";import"./variant-matcher-override-DzGrqs7q.js";import"./section-array-field-BreHGIvy.js";import"./use-fast-preview-draft-url-DkfO7kpa.js";import"./parse-sections-WY1RJ27g.js";import"./held-block-view-BPyv_Bj9.js";import"./calendar-lMJXe0Vk.js";import"./editor-classes-B97Owa1G.js";import"./empty-message-CH3ICmuH.js";import"./pair-CiXtBbbF.js";import"./collapsible-IkM9Ewzf.js";import"./use-task-board-items-DDIJt2ov.js";import"./config-giA1KgEi.js";import"./task-route-CSEPljWs.js";import"./project-index-rV1NSwrP.js";import"./shell-layout-DhXO3kdV.js";import"./use-deployment-admin-BLj_HET-.js";import"./admin-fetch-BhTJlAsX.js";import"./integration-icon-NqhVgI3n.js";import"./project-icon-CtK060oN.js";import"./new-project-dialog-tmPiPwbR.js";import"./repository-picker-CoyA5imt.js";import"./github-icon-DBNhbuOq.js";import"./collection-search-bFfkZUb6.js";import"./new-project-store-RJXM205V.js";import"./legacy-admin-welcome-dialog-CmqRv0HT.js";import"./required-auth-layout-DDlu3UJb.js";import"./use-org-sso-CLb0Ca9G.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-Cs2iJUy6.js";import"./types-Dw1-yAGJ.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./use-connection-Bbf6g-lU.js";import"./use-mcp-prompts-92SLArS_.js";import"./use-thread-outputs-DAKjQ5Pu.js";import"./file-type-icon-CPmLjdw0.js";import"./named-rule-step-CKkqw0jp.js";import"./slider-DX6aptUe.js";import"./index-Big5zxJQ.js";import"./tooltipContext-BSzAb1Kl.js";import"./CategoricalChart-BnSCjdlG.js";import"./index-CxRVhGQ4.js";import"./combobox-CiGXUnCv.js";import"./scroll-area-Od2oOAKa.js";import"./monaco-editor-ISdNcoi4.js";import"./editor-BYfzbACz.js";import"./useQueries-CTvQGMKH.js";import"./device-hint-BeggFfp6.js";import"./alert-Bv02tf7n.js";import"./virtual-mcp-Cmf0LAEo.js";import"./url-slug-CauSsJ0r.js";import"./app-preview-url-9Od4s8Sz.js";import"./agent-capabilities-DepzNhfJ.js";import"./preview-source-BsRLGWUP.js";import"./use-task-metadata-CNDyuNbK.js";import"./delete-copy-tVwI6KKh.js";import"./category-tree-XVjkohBB.js";import"./use-move-blocks-DKQg1wdr.js";import"./index-hwrw3rkU.js";import"./view-header-1myD_Wkk.js";import"./use-cms-publish-actions-S499FS9c.js";import"./use-content-sync-36WIXZeF.js";import"./use-delete-block-SgRzkXSC.js";import"./item-actions-BZytzuQ9.js";import"./date-utils-CrvIKg-s.js";import"./badge-BcL569rK.js";import"./empty-state-BtNfctJt.js";import"./mustache-BocCKXOv.js";import"./collection-table-wrapper-B2jzfzUl.js";import"./table-DSVromj4.js";import"./site-draft-actions-BoCCfw5y.js";import"./separator-DCZYVGqN.js";import"./cms-store-drafts-Bi9z0Tv5.js";import"./serial-task-queue-CGOeQgpr.js";import"./index-BwUztF-N.js";import"./input-DP0rL1U_.js";import"./icon-button-BVEHdZYj.js";import"./chat-draft-jC339CDY.js";import"./use-deco-credits-C3HRZZ9R.js";import"./input-B9td9Urd.js";import"./suggestion-DrTYv82A.js";import"./use-org-fs-ChCg0GqS.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-B5dVUVm-.js";import"./plan-ladder-Dn5ZPJM9.js";import"./add-connection-dialog-C22z0dJk.js";import"./extract-connection-data-X90aKvel.js";import"./metadata-D72DunRR.js";import"./connection-C8CUAy7P.js";import"./connection-card-D_Uc1OoH.js";import"./connection-slug-BywwM0Xb.js";import"./schema-DH1Yp9e9.js";import"./connection-form-helpers-DASQdNW4.js";import"./authenticate-and-persist-oauth-bpkds3b0.js";import"./mcp-oauth-CdZI7dfM.js";import"./mcp-oauth-C6Tisjqi.js";import"./collection-tabs-DEboaJXk.js";import"./use-infinite-scroll-BtlabLXL.js";import"./useSuspenseInfiniteQuery-BN1c7Ych.js";import"./save-changes-debug-nBi-n9eV.js";import"./site-draft-view-B7wPj61X.js";import"./blog-view-gate-BhcycJ8-.js";function I(o){return o.kind==="unavailable"&&o.source==="local"&&(o.problem?.reason??"not-answering")==="not-answering"}const it=o=>o;function et(o){const t=u.c(10),{candidates:i,invalidLink:c,shell:s,editor:e}=o,r=c===void 0?!1:c,m=s===void 0?it:s,[p,a]=g.useState(null);if(p){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>a(null),t[0]=f):f=t[0];let h;return t[1]!==p||t[2]!==e?(h=e(p,f),t[1]=p,t[2]=e,t[3]=h):h=t[3],h}let l;t[4]!==i||t[5]!==r?(l=n.jsx(rt,{candidates:i,invalidLink:r,onConnect:a}),t[4]=i,t[5]=r,t[6]=l):l=t[6];let d;return t[7]!==m||t[8]!==l?(d=m(l),t[7]=m,t[8]=l,t[9]=d):d=t[9],d}function rt(o){const t=u.c(17),{candidates:i,invalidLink:c,onConnect:s}=o,e=c===void 0?!1:c,[r]=G(),{language:m}=r;let p;t[0]!==s?(p=N=>s({endpoint:N}),t[0]=s,t[1]=p):p=t[1];let a;t[2]!==i||t[3]!==p?(a={candidates:i,onFound:p},t[2]=i,t[3]=p,t[4]=a):a=t[4];const l=q(a),{state:d,access:f,needsGesture:h}=l;let k;t[5]!==i||t[6]!==m?(k=new Intl.ListFormat(m,{style:"long",type:"conjunction"}).format(i.map(T)),t[5]=i,t[6]=m,t[7]=k):k=t[7];const C=k;let S;t[8]!==f||t[9]!==l.start||t[10]!==h||t[11]!==d?(S=f==="denied"?{kind:"denied"}:h?{kind:"needs-gesture",onStart:l.start}:d.problem?{kind:"problem",problem:d.problem,host:T(d.problem.endpoint)}:{kind:"looking",paused:d.status==="paused"},t[8]=f,t[9]=l.start,t[10]=h,t[11]=d,t[12]=S):S=t[12];const _=S;let j;return t[13]!==C||t[14]!==e||t[15]!==_?(j=n.jsx(B,{wait:_,hosts:C,invalidLink:e}),t[13]=C,t[14]=e,t[15]=_,t[16]=j):j=t[16],j}const v="deco-serve",w="working-tree",nt={id:"",slug:"",name:"",logo:null},st={id:v,slug:v},mt={virtualMcpId:v,taskId:null,openTask:()=>{},createTask:()=>"",createTaskWithMessage:()=>{},activeTask:null,isThreadLocked:!1,lockedHarness:null,lockedBranch:null,currentBranch:w,setCurrentTaskBranch:()=>{}};function pt(){const o=window.location.hash,t=new URLSearchParams(o.replace(/^#/,"")).has("endpoint"),i=t?K(o):null;return t&&window.history.replaceState(null,"",window.location.pathname+window.location.search),i&&V(i),{candidates:W(i,U()),invalidLink:t&&!i}}const at=[{id:"site-editor",to:"/site-editor",label:"preview"},{id:"content",to:"/site-editor/content",label:"content"}];function lt(){const o=u.c(6),t=P();let i;o[0]===Symbol.for("react.memo_cache_sentinel")?(i={select:ct},o[0]=i):i=o[0];const c=O(i);let s;o[1]!==t||o[2]!==c?(s=at.map(r=>n.jsx(y.Tab,{asChild:!0,active:c==="content"==(r.id==="content"),children:n.jsxs(H,{to:r.to,activeOptions:{exact:!0},children:[n.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(Z,{icon:tt({tabId:r.id,kind:"system",connections:[]})})}),t(`common.mainPanelTabs.${r.label}`)]})},r.id)),o[1]=t,o[2]=c,o[3]=s):s=o[3];let e;return o[4]!==s?(e=n.jsx(y.Tabs,{children:s}),o[4]=s,o[5]=e):e=o[5],e}function ct(o){return o.matches.at(-1)?.staticData.siteEditorView}function A(o){const t=u.c(14),{children:i}=o,c=P(),{connection:s}=z(v),e=R(v,w);let r,m;if(t[0]!==e||t[1]!==i||t[2]!==s||t[3]!==c){m=Symbol.for("react.early_return_sentinel");t:{if(r=s?T(s.endpoint):"",e.kind==="protocol"){m=i;break t}if(e.kind!=="unavailable"||I(e)){m=n.jsx(X,{headingLevel:2,waiting:!0,title:c("decoServe.connect.reaching",{host:r})});break t}}t[0]=e,t[1]=i,t[2]=s,t[3]=c,t[4]=r,t[5]=m}else r=t[4],m=t[5];if(m!==Symbol.for("react.early_return_sentinel"))return m;let p;t[6]!==e.problem?(p=e.problem??{reason:"not-answering"},t[6]=e.problem,t[7]=p):p=t[7];let a;t[8]!==r||t[9]!==p?(a={kind:"problem",problem:p,host:r},t[8]=r,t[9]=p,t[10]=a):a=t[10];let l;return t[11]!==r||t[12]!==a?(l=n.jsx(B,{wait:a,hosts:r}),t[11]=r,t[12]=a,t[13]=l):l=t[13],l}function dt(o){const t=u.c(6),{onLost:i}=o,c=R(v,w);let s;t[0]!==c?(s=I(c),t[0]=c,t[1]=s):s=t[1];const e=s;let r,m;return t[2]!==e||t[3]!==i?(r=()=>{e&&i()},m=[e,i],t[2]=e,t[3]=i,t[4]=r,t[5]=m):(r=t[4],m=t[5]),g.useEffect(r,m),null}const D={threadOpen:!1,contentOpen:!0,toggleFullscreen:()=>{},toggleContent:()=>{}};function ut(){const o=u.c(11),{data:t}=E.useSession();let i;o[0]===Symbol.for("react.memo_cache_sentinel")?(i={select:ft},o[0]=i):i=o[0];const c=O(i),s=!!t?.user;let e;o[1]!==s?(e={rail:s},o[1]=s,o[2]=e):e=o[2];const r=c??"preview";let m,p,a;o[3]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(lt,{}),p=n.jsx(ot,{}),a=n.jsx(x.Thread,{children:null}),o[3]=m,o[4]=p,o[5]=a):(m=o[3],p=o[4],a=o[5]);let l;o[6]!==r?(l=n.jsx(L.Content,{children:n.jsxs(x,{...D,threadless:!0,contentKey:r,contentNavigation:m,children:[p,a]})}),o[6]=r,o[7]=l):l=o[7];let d;return o[8]!==e||o[9]!==l?(d=n.jsx(L,{outsideOrg:e,children:l}),o[8]=e,o[9]=l,o[10]=d):d=o[10],d}function ft(o){return o.matches.at(-1)?.staticData.siteEditorView}function ht(o){const t=u.c(10),{children:i}=o,{data:c}=E.useSession(),s=!!c?.user;let e;t[0]!==s?(e={rail:s},t[0]=s,t[1]=e):e=t[1];let r;t[2]!==i?(r=n.jsx(x.Content,{children:i}),t[2]=i,t[3]=r):r=t[3];let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(x.Thread,{children:null}),t[4]=m):m=t[4];let p;t[5]!==r?(p=n.jsx(L.Content,{children:n.jsxs(x,{...D,threadless:!0,contentKey:"guide",children:[r,m]})}),t[5]=r,t[6]=p):p=t[6];let a;return t[7]!==e||t[8]!==p?(a=n.jsx(L,{outsideOrg:e,children:p}),t[7]=e,t[8]=p,t[9]=a):a=t[9],a}const b=()=>{},vt={connection:null,set:b,clear:b};function Ir(){const o=u.c(3),[t]=g.useState(pt);let i;return o[0]!==t.candidates||o[1]!==t.invalidLink?(i=n.jsx(F,{org:nt,project:st,children:n.jsx(et,{candidates:t.candidates,invalidLink:t.invalidLink,shell:kt,editor:xt})}),o[0]=t.candidates,o[1]=t.invalidLink,o[2]=i):i=o[2],i}function xt(o,t){return n.jsxs($.Provider,{value:{connection:o,set:b,clear:b},children:[n.jsx(dt,{onLost:t}),n.jsx(M,{value:mt,children:n.jsx(J,{children:n.jsx(ut,{})})})]})}function kt(o){return n.jsx($.Provider,{value:vt,children:n.jsx(ht,{children:o})})}function Ar(){const o=u.c(1);let t;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(A,{children:n.jsx(Q,{virtualMcpId:v})}),o[0]=t):t=o[0],t}function Dr(){const o=u.c(1);let t;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(A,{children:n.jsx(Y,{virtualMcpId:v})}),o[0]=t):t=o[0],t}export{Dr as SiteEditorContent,Ar as SiteEditorPreview,Ir as default};
|