decocms 4.500.2 → 4.500.4
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/{ActiveShapeUtils-CeZzOoVf.js → ActiveShapeUtils-r8jaNALG.js} +1 -1
- package/dist/client/assets/{AlertCircle-D4iOZ3Bs.js → AlertCircle-BgwifFMG.js} +1 -1
- package/dist/client/assets/{AreaChart-CUWmFHwI.js → AreaChart-DB6yNBzt.js} +1 -1
- package/dist/client/assets/{ArrowLeft-iygYSRbQ.js → ArrowLeft-BP0atRPX.js} +1 -1
- package/dist/client/assets/{ArrowUp-KCSPs-fi.js → ArrowUp-AxzDl8Z3.js} +1 -1
- package/dist/client/assets/{BarChart-gbo6r8aY.js → BarChart-CwA-ga4F.js} +1 -1
- package/dist/client/assets/{Building02-EbX1A23K.js → Building02-DDW-F58b.js} +1 -1
- package/dist/client/assets/{CategoricalChart-DbqLrstZ.js → CategoricalChart-DVQp8mi8.js} +1 -1
- package/dist/client/assets/{CheckCircle-CoJfU94i.js → CheckCircle-pe1RxSse.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-DqpRXMOM.js → ChevronSelectorVertical-B9RLS3HF.js} +1 -1
- package/dist/client/assets/{ChevronUp-BSm7AtSf.js → ChevronUp-QaPEzxVx.js} +1 -1
- package/dist/client/assets/{Copy01-DlA26aBh.js → Copy01-YTn6AAPK.js} +1 -1
- package/dist/client/assets/{CreditCard01-CXGPcE51.js → CreditCard01-DPxzkwQY.js} +1 -1
- package/dist/client/assets/{DotsVertical-CTugBooH.js → DotsVertical-D1KewbnO.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-CJdWK23B.js → ErrorBarContext-DFDHSMqE.js} +1 -1
- package/dist/client/assets/{Globe04-DDiW2Onm.js → Globe04-Cq4nB1G2.js} +1 -1
- package/dist/client/assets/{Image01-BjUHwjIr.js → Image01-Bpynux_N.js} +1 -1
- package/dist/client/assets/{Key01-DMnhMxC3.js → Key01-ByMBFx-i.js} +1 -1
- package/dist/client/assets/{Link01-DKypA3Uf.js → Link01-Zi8wbjzB.js} +1 -1
- package/dist/client/assets/{LinkBroken01-Cjxu7rCw.js → LinkBroken01-tO8JEBqa.js} +1 -1
- package/dist/client/assets/{Monitor01-CTL-UG2p.js → Monitor01-wrmGnmsX.js} +1 -1
- package/dist/client/assets/{Play-NZWCLDah.js → Play-W6HcQ7l_.js} +1 -1
- package/dist/client/assets/{Plus-DLTeBarI.js → Plus-BKb3EUuT.js} +1 -1
- package/dist/client/assets/{SearchMd-BsNWsFDv.js → SearchMd-BXSC0WTH.js} +1 -1
- package/dist/client/assets/{Sector-BRgBibA6.js → Sector-DqutoVk-.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-CWlRU3Ye.js → ShoppingBag01-D0kKEJuH.js} +1 -1
- package/dist/client/assets/{Sun-DhZMu2lN.js → Sun-CfiICDcE.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DZEm8csq.js → SwitchHorizontal01-CAC-8ZOB.js} +1 -1
- package/dist/client/assets/{Tool01-o_nJ7Y1x.js → Tool01-C9pjFqwV.js} +1 -1
- package/dist/client/assets/{Trash01-JZaZB0vu.js → Trash01-BO35Cov_.js} +1 -1
- package/dist/client/assets/{Upload01-CpEePL13.js → Upload01-DJFAu4Mm.js} +1 -1
- package/dist/client/assets/{User01-BGOQS9vx.js → User01-B7hPiYB7.js} +1 -1
- package/dist/client/assets/{UserSquare-BFlEW2x5.js → UserSquare-CLXjlx3Y.js} +1 -1
- package/dist/client/assets/{Users01-C9dOtgmV.js → Users01-DxG-qkCG.js} +1 -1
- package/dist/client/assets/{XAxis-4jP2_ps6.js → XAxis-BlThxQ5X.js} +1 -1
- package/dist/client/assets/{XClose-DO008B8R.js → XClose-CMdSy1nN.js} +1 -1
- package/dist/client/assets/{ZoomOut-DA1sRe95.js → ZoomOut-DLs2h_6j.js} +1 -1
- package/dist/client/assets/{access-gate-DsVMqwjM.js → access-gate-3MCIFFcK.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BTQ6Snbx.js → add-connection-dialog-DNMm7BIu.js} +1 -1
- package/dist/client/assets/{agent-analytics-CpGEVH02.js → agent-analytics-CrniEuaQ.js} +1 -1
- package/dist/client/assets/agent-app-BQhyv8DF.js +1 -0
- package/dist/client/assets/{agent-assets-D1AunKzQ.js → agent-assets-IKAQ5dPz.js} +1 -1
- package/dist/client/assets/{agent-automation-Ds-y1bNp.js → agent-automation-D7MtRcpp.js} +1 -1
- package/dist/client/assets/{agent-automations-Bhv6Y5Fg.js → agent-automations-C6QL27by.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-BWYssaAs.js → agent-connect-sources-3TeEngKZ.js} +1 -1
- package/dist/client/assets/agent-deck-f6820vT8.js +1 -0
- package/dist/client/assets/{agent-e2e-mBRBGP-4.js → agent-e2e-BPlZoWAG.js} +1 -1
- package/dist/client/assets/{agent-experiments-aivx3wKk.js → agent-experiments-DUjuqx9x.js} +1 -1
- package/dist/client/assets/{agent-file-p8VPN5Ls.js → agent-file-Cx3yLMJg.js} +1 -1
- package/dist/client/assets/{agent-hosting-BLydMzz1.js → agent-hosting-D42N4TPy.js} +1 -1
- package/dist/client/assets/{agent-icon-DDBSTxwl.js → agent-icon-DjnOmCBc.js} +1 -1
- package/dist/client/assets/agent-library-BIn7dUjB.js +1 -0
- package/dist/client/assets/agent-library-file-CeiO8mwA.js +1 -0
- package/dist/client/assets/{agent-monitor-DwF-OeKx.js → agent-monitor-mP9taLUf.js} +1 -1
- package/dist/client/assets/{agent-overview-PzlD3Gdw.js → agent-overview-1r1Kovqy.js} +1 -1
- package/dist/client/assets/agent-settings-klWG-4n_.js +1 -0
- package/dist/client/assets/{agent-site-editor-BpVIjbEo.js → agent-site-editor-AFFGIJna.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-C4ytTmHW.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-UkRK2sPZ.js → agent-site-editor-content-8UmzG7GR.js} +3 -3
- package/dist/client/assets/agent-site-editor-preview-CKZy7Tmh.js +551 -0
- package/dist/client/assets/agent-view-Hz67HaQW.js +1 -0
- package/dist/client/assets/{agent-view-guard-CNj-ECwU.js → agent-view-guard-BlKWFB7P.js} +1 -1
- package/dist/client/assets/{agents-list-DIvEheHR.js → agents-list-CNENncPv.js} +1 -1
- package/dist/client/assets/{ai-providers-Bv4VnLS0.js → ai-providers-DurLhw5y.js} +1 -1
- package/dist/client/assets/{alert-DYBIxnQj.js → alert-BavK6rpL.js} +1 -1
- package/dist/client/assets/{alert-dialog-DpmCpPBI.js → alert-dialog-DLvf9XpO.js} +1 -1
- package/dist/client/assets/{analytics-sections-Dv6tHtpt.js → analytics-sections-BILOZ8xI.js} +1 -1
- package/dist/client/assets/api-keys-Bar4CNhW.js +1 -0
- package/dist/client/assets/{api-keys-BpociG2u.js → api-keys-DxfnV1wH.js} +1 -1
- package/dist/client/assets/app-editor-BpQwl80B.js +1 -0
- package/dist/client/assets/{asset-utils-BUihGB_o.js → asset-utils-RL-ZiBha.js} +1 -1
- package/dist/client/assets/{auth-D1PkW9Uj.js → auth-C11WExuf.js} +1 -1
- package/dist/client/assets/{auth-catchall-xah8Rp3j.js → auth-catchall-DtdWlB5Z.js} +1 -1
- package/dist/client/assets/{auth-entry-VLEYf8tT.js → auth-entry-DzUfVYJ4.js} +1 -1
- package/dist/client/assets/{auth-split-layout-HBBBJTJB.js → auth-split-layout-DdRT7pwN.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BfNR0joU.js → authenticate-and-persist-oauth-DyuZVm6i.js} +1 -1
- package/dist/client/assets/{automation-list-row-IGsRC78W.js → automation-list-row-DQWI_wwj.js} +1 -1
- package/dist/client/assets/{automation-runs-C60W3bGo.js → automation-runs-BMd-xJ2A.js} +1 -1
- package/dist/client/assets/{automations-CaS6shwH.js → automations-DEn-h47r.js} +1 -1
- package/dist/client/assets/{autosend-D3KZZhDs.js → autosend-BxzE8tXY.js} +1 -1
- package/dist/client/assets/{avatar-Brh_8d7a.js → avatar-BQ1clUOI.js} +1 -1
- package/dist/client/assets/{badge-Dp13ql_I.js → badge-NHL6jQ7U.js} +1 -1
- package/dist/client/assets/{block-document-Cxj1MUpK.js → block-document-Cn1hz4p_.js} +3 -3
- package/dist/client/assets/{blocks-preview-workspace-context-D7M7BwP7.js → blocks-preview-workspace-context-C7BK9yT5.js} +1 -1
- package/dist/client/assets/{blog-schema-G4wBIdc6.js → blog-schema-rNr5GnCl.js} +1 -1
- package/dist/client/assets/{board-analytics-DO-wkHdX.js → board-analytics-IRwojiVB.js} +1 -1
- package/dist/client/assets/{buckets-C5bRLlmM.js → buckets-CbnqPAbV.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DHL2uEEa.js → build-improve-prompt-doc-DIcVxtkz.js} +1 -1
- package/dist/client/assets/{calendar-DEB-AUfC.js → calendar-wJdw6sZE.js} +1 -1
- package/dist/client/assets/{capability-load-error-CR2FG7xy.js → capability-load-error-BegMkJwl.js} +1 -1
- package/dist/client/assets/{category-editor-DfXKd-cd.js → category-editor-D92K-w8g.js} +1 -1
- package/dist/client/assets/{chart-CXoR26LQ.js → chart-yyGN_0NT.js} +1 -1
- package/dist/client/assets/chat-context-Bdbu4aFj.js +39 -0
- package/dist/client/assets/{chat-draft-CWFQi3-d.js → chat-draft-CKhySLl4.js} +1 -1
- package/dist/client/assets/{checkbox-CGTvhz0x.js → checkbox-B6gj5-qt.js} +1 -1
- package/dist/client/assets/{choose-editor-DBCIeCbR.js → choose-editor-pJnZ58-b.js} +1 -1
- package/dist/client/assets/claim-phase-copy-CNoIfrVp.js +1 -0
- package/dist/client/assets/{cli-auth-success-Nd2PZ9ox.js → cli-auth-success-C2CP1C9i.js} +1 -1
- package/dist/client/assets/{client-icons-BI4heyKD.js → client-icons-BG3NCFov.js} +1 -1
- package/dist/client/assets/{collapsible-Cq1aFrCg.js → collapsible-8Gh0baiT.js} +1 -1
- package/dist/client/assets/{collection-detail-ClkMaErn.js → collection-detail-DgpOivN_.js} +1 -1
- package/dist/client/assets/{collection-display-button-BjwUZtSd.js → collection-display-button-Guyqw9do.js} +1 -1
- package/dist/client/assets/{collection-search-Cp82h57b.js → collection-search-ji1JjZMn.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BmpUFI8T.js → collection-table-wrapper-CSxKmndL.js} +1 -1
- package/dist/client/assets/{collection-tabs-C6HP7d51.js → collection-tabs-C39YFQ2E.js} +1 -1
- package/dist/client/assets/{column-rules-CJ4d_g8W.js → column-rules-vK8DsKaQ.js} +1 -1
- package/dist/client/assets/{combobox-CF6B9Wmt.js → combobox-sJwovF14.js} +1 -1
- package/dist/client/assets/{command-BfXTTBD9.js → command-CloMVJTp.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BLJLcZpb.js → companion-mcps-section-DkcpjKJu.js} +1 -1
- package/dist/client/assets/{config-BZYNAwT6.js → config-BGvl3kPw.js} +1 -1
- package/dist/client/assets/{connect-FZH1ks7l.js → connect-BXtTpX6G.js} +1 -1
- package/dist/client/assets/{connect-layout-BbzklNPm.js → connect-layout-3qTDxx-Z.js} +1 -1
- package/dist/client/assets/{connection-BTT1rt_2.js → connection-BKamaNd5.js} +1 -1
- package/dist/client/assets/{connection-card-CsIFgDe8.js → connection-card-VZBAZ1By.js} +1 -1
- package/dist/client/assets/{connection-detail-BSkgGFWF.js → connection-detail-DmNwjYLW.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Bg3g47y2.js → connection-form-helpers-T_Ai4T1w.js} +1 -1
- package/dist/client/assets/{connections-BcHX4l-p.js → connections-CRhKf5Aw.js} +1 -1
- package/dist/client/assets/{context-D9dob61q.js → context-DDqIS5x2.js} +1 -1
- package/dist/client/assets/{context-menu-DPNtSYt0.js → context-menu-BL7ReY3s.js} +1 -1
- package/dist/client/assets/{core.esm-C90YQIGJ.js → core.esm-CAijLSig.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BoHINOyM.js → create-organization-dialog-CzdjGKlM.js} +1 -1
- package/dist/client/assets/{daily-pulse-tLPif3nO.js → daily-pulse-Do7Bv4JX.js} +1 -1
- package/dist/client/assets/{device-hint-ClxhQWtk.js → device-hint-CWzU-IYs.js} +1 -1
- package/dist/client/assets/{discover-BGUAZcdZ.js → discover-BnV5JtgA.js} +1 -1
- package/dist/client/assets/{domain-settings-C1KL1CIp.js → domain-settings-Dp99mfI4.js} +1 -1
- package/dist/client/assets/{drawer-20Gv7XN0.js → drawer-CBMcEEQM.js} +1 -1
- package/dist/client/assets/{editor-CklcmkgZ.js → editor-B4h2oI8R.js} +1 -1
- package/dist/client/assets/{empty-state-CsVqjGqu.js → empty-state-BZTHulBK.js} +1 -1
- package/dist/client/assets/{empty-state-BWSdqiOv.js → empty-state-YI3BPcNO.js} +1 -1
- package/dist/client/assets/{extract-connection-data-C8Idk1Oj.js → extract-connection-data-U1HCpmI2.js} +1 -1
- package/dist/client/assets/{feature-gate-Brul-7Vc.js → feature-gate-Bz1_kJfU.js} +1 -1
- package/dist/client/assets/{feature-paywall-B1-Kq6zS.js → feature-paywall-Hzw839qS.js} +1 -1
- package/dist/client/assets/{file-explorer-0AwiXzsI.js → file-explorer-D-yZsL4s.js} +1 -1
- package/dist/client/assets/{file-preview-BTrgY74n.js → file-preview-BPquMk7t.js} +1 -1
- package/dist/client/assets/{file-share-button-kQh5APqr.js → file-share-button-CZio6GIv.js} +1 -1
- package/dist/client/assets/{file-type-icon-Dbuavq5L.js → file-type-icon-BQzv7Wym.js} +1 -1
- package/dist/client/assets/flat-project-xIeYzzyp.js +1 -0
- package/dist/client/assets/{folder-icon-D1xnfwm_.js → folder-icon-hFIrLwS2.js} +1 -1
- package/dist/client/assets/{form-BZ1i_2GJ.js → form-BRZ5DZiG.js} +1 -1
- package/dist/client/assets/{general-C8gjvVqx.js → general-D4j81pur.js} +1 -1
- package/dist/client/assets/{home-BnDlnEHu.js → home-BlQ7XxUT.js} +1 -1
- package/dist/client/assets/{icon-button-BDbIWVW3.js → icon-button-7qsU_2OV.js} +1 -1
- package/dist/client/assets/{index-Bs_Ow9qj.js → index-6SpfJF4P.js} +1 -1
- package/dist/client/assets/{index-D94af8m5.js → index-BFQV-2t6.js} +1 -1
- package/dist/client/assets/{index-pEr2eE8n.js → index-BXITXB61.js} +1 -1
- package/dist/client/assets/{index-4XFLhK7S.js → index-C3moojPl.js} +41 -41
- package/dist/client/assets/{index-C8VO6rJ2.js → index-CsiOLq0m.js} +3 -3
- package/dist/client/assets/{index-DlsOrQnt.js → index-Csp02eVI.js} +1 -1
- package/dist/client/assets/{index-CN8TQhg6.js → index-DOFxzI-C.js} +1 -1
- package/dist/client/assets/index-DQO0lnZr.css +1 -0
- package/dist/client/assets/{index-DujNp8wX.js → index-DjXrdMkW.js} +1 -1
- package/dist/client/assets/{index-COd_qFje.js → index-b34wBOnq.js} +1 -1
- package/dist/client/assets/{index-DrIzKTur.js → index-lfns9uh8.js} +1 -1
- package/dist/client/assets/{index-DVVx4F0i.js → index-p5cxA0SC.js} +1 -1
- package/dist/client/assets/{index-C0n7mPS1.js → index-qV0aMVfj.js} +1 -1
- package/dist/client/assets/{index-CWl9v4eu.js → index-rN0rlunX.js} +1 -1
- package/dist/client/assets/{index-redirect-BQGkKPeS.js → index-redirect-4gzc5Gy_.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DLzEnjM8.js → infiniteQueryObserver-DMRptffd.js} +1 -1
- package/dist/client/assets/{infra-billing-Df_WNbOe.js → infra-billing-BK2k2AIQ.js} +1 -1
- package/dist/client/assets/{input-BzdgO_dK.js → input-C8o95ZIl.js} +3 -3
- package/dist/client/assets/{input-DQtH0um6.js → input-Dy0JrrC0.js} +1 -1
- package/dist/client/assets/{integration-icon-BqsHjS-b.js → integration-icon-CmzyrNbk.js} +1 -1
- package/dist/client/assets/{jira-icon-CG6W0SJT.js → jira-icon-CaqntM3w.js} +1 -1
- package/dist/client/assets/{label-ByKoWpTn.js → label-C-C9Ou_x.js} +1 -1
- package/dist/client/assets/{layout-Ih9F7QDG.js → layout-SMB9U0zE.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-D4aZSj1S.js → legacy-agents-deep-DH5S5sM5.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-CawnT8bs.js → legacy-main-redirect-CgxK0F6X.js} +1 -1
- package/dist/client/assets/library-DxhILUSJ.js +1 -0
- package/dist/client/assets/{library-tab-CWnL_FfR.js → library-tab-BDN7_SPX.js} +1 -1
- package/dist/client/assets/{login-BV5vcG2Q.js → login-KvBjhXxT.js} +1 -1
- package/dist/client/assets/{markdown-BW2GJSHC.js → markdown-BUXU5oD6.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-fDcax7T2.js → mcp-app-renderer-DyZ3_ABn.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CVI2AkSu.js → mcp-oauth-BkcOWs3t.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BjHElKzR.js → mcp-oauth-L9MT2tEQ.js} +1 -1
- package/dist/client/assets/{members-f-Grp_Zc.js → members-DDmeZze3.js} +1 -1
- package/dist/client/assets/{memory-CYDtZWEC.js → memory-Bz_z-OHW.js} +1 -1
- package/dist/client/assets/{mini-report-page-BvYGpq5f.js → mini-report-page-Du9prRn4.js} +1 -1
- package/dist/client/assets/{mock-board-hNRrDjvq.js → mock-board-wu3yr1Uh.js} +1 -1
- package/dist/client/assets/{monaco-editor-DkahnDKS.js → monaco-editor-Cpw9JqW2.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Cx7S4sFz.js → monitoring-stats-row-CR8Pz4AG.js} +1 -1
- package/dist/client/assets/{multi-select-BsYgOBGm.js → multi-select-d0qSjN1D.js} +1 -1
- package/dist/client/assets/{mustache-D7UTScQH.js → mustache-BlQTgv16.js} +1 -1
- package/dist/client/assets/{new-project-dialog-DdG-RgMO.js → new-project-dialog-BLbuP-We.js} +1 -1
- package/dist/client/assets/{oauth-callback-GzdTg9VJ.js → oauth-callback-CEt2mysn.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BANi9OcB.js → oauth-callback-ai-provider-CrSicNp6.js} +1 -1
- package/dist/client/assets/{onboarding-w2z3NDRW.js → onboarding-ChZQ4_Cn.js} +1 -1
- package/dist/client/assets/{openai-conversation-C7TUEjal.js → openai-conversation-Qck38y07.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-7fDRNM1p.js → optimistic-project-sidebar-views-DBs2dIsI.js} +1 -1
- package/dist/client/assets/{organization-choice-DRyD5yII.js → organization-choice-W78BZNeA.js} +1 -1
- package/dist/client/assets/{orgs-EvyltNU-.js → orgs-DueEMR7Z.js} +1 -1
- package/dist/client/assets/{page-seo-form-0-tAzxyW.js → page-seo-form-CY1JVNQO.js} +1 -1
- package/dist/client/assets/{pair-Cm6oR2ES.js → pair-BL76LvR6.js} +1 -1
- package/dist/client/assets/{plan-ladder-D4-VvMwX.js → plan-ladder-CBREr6Ld.js} +1 -1
- package/dist/client/assets/{popover-DGVyEQ9q.js → popover-P9zPzqJX.js} +1 -1
- package/dist/client/assets/{post-calendar-CGDOG4Ay.js → post-calendar-JcrcT1nM.js} +1 -1
- package/dist/client/assets/{post-editor-BFSJ6I4d.js → post-editor-C5HYxFbJ.js} +1 -1
- package/dist/client/assets/{preview-content-KcSZme5m.js → preview-content-ChI0T8Cs.js} +1 -1
- package/dist/client/assets/{preview-dialog-DHH8biYM.js → preview-dialog-CFiVBx33.js} +1 -1
- package/dist/client/assets/{preview-panel-CMlsnFlv.js → preview-panel-BMAYjh5J.js} +1 -1
- package/dist/client/assets/{product-picker-dialog-Bz7bVPFI.js → product-picker-dialog-DZ5LfyYE.js} +1 -1
- package/dist/client/assets/{profile-be5NkG2U.js → profile-DB49xk9A.js} +1 -1
- package/dist/client/assets/{project-app-view-BV4H0rEJ.js → project-app-view-Dv1i76zf.js} +1 -1
- package/dist/client/assets/{project-feed-Dly67hgE.js → project-feed-CvGIQNLX.js} +1 -1
- package/dist/client/assets/{project-icon-CMe6LZd9.js → project-icon-Ds5KkwAm.js} +1 -1
- package/dist/client/assets/project-reports-Bt1ILOwc.js +1 -0
- package/dist/client/assets/project-tasks-CMbWkOn0.js +1 -0
- package/dist/client/assets/{projects-CDscJwj7.js → projects-8sHbBlFT.js} +1 -1
- package/dist/client/assets/{projects-empty-state-VFtNQKgJ.js → projects-empty-state-IOAu-wpI.js} +1 -1
- package/dist/client/assets/{prompts-CG--DGsd.js → prompts-Ce0XP9qb.js} +1 -1
- package/dist/client/assets/record-editor-C6Bydih8.js +1 -0
- package/dist/client/assets/redirect-editor-BH-M-WaR.js +1 -0
- package/dist/client/assets/{reports-CODPKkJO.js → reports-CE5LHXXr.js} +1 -1
- package/dist/client/assets/reports-CKooFM0m.js +1 -0
- package/dist/client/assets/{reports-onboarding-D0Irch0-.js → reports-onboarding-p3K1uYqw.js} +1 -1
- package/dist/client/assets/{reports-tab-NvqzpdHL.js → reports-tab-BXua1NQM.js} +2 -2
- package/dist/client/assets/{repositories-xZsmQvzi.js → repositories-ToQv_rZB.js} +1 -1
- package/dist/client/assets/{repository-binding-C_InVumU.js → repository-binding-CPA8-dMz.js} +1 -1
- package/dist/client/assets/{repository-import-picker-Bixi7zBc.js → repository-import-picker-DG4AirBH.js} +1 -1
- package/dist/client/assets/{repository-picker-BHgNNGrn.js → repository-picker-BfnPBGTa.js} +1 -1
- package/dist/client/assets/{require-capability-D49j17CD.js → require-capability-B_m0hTh2.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CxaLcttO.js → required-auth-layout-DqtVx04D.js} +1 -1
- package/dist/client/assets/{reset-password-Bg3-bOJi.js → reset-password-Badkqm_7.js} +1 -1
- package/dist/client/assets/{resizable-sj2QiDEc.js → resizable-BTJacEf8.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-Benn2iaL.js → resolve-tab-icon-rGkJ7QGs.js} +1 -1
- package/dist/client/assets/{review-settings-DjIYcWCV.js → review-settings-DFCkjKmA.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-C2ryIXD3.js → rich-text-link-control-CGRceWX2.js} +1 -1
- package/dist/client/assets/{roles-8gcvGZJw.js → roles-BirPgyBv.js} +1 -1
- package/dist/client/assets/route-AynshQR9.js +1 -0
- package/dist/client/assets/{route-C0mgkpSg.js → route-BelNzFge.js} +1 -1
- package/dist/client/assets/{route-DyDxvrHS.js → route-Dx6968P1.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-dTVVXX5v.js → runnable-block-editor-BfWUQRiS.js} +4 -4
- package/dist/client/assets/{sandbox-lifecycle-context-DzcFvw1G.js → sandbox-lifecycle-context-BUwLKKqW.js} +1 -1
- package/dist/client/assets/{schema-DyLXU88M.js → schema-DyDDwNs8.js} +1 -1
- package/dist/client/assets/{scroll-area-DYybJ63r.js → scroll-area-BJew8KVi.js} +1 -1
- package/dist/client/assets/{search-input-DJwYl_zW.js → search-input-iE4YnSAW.js} +1 -1
- package/dist/client/assets/{search-toggle-DOVOYril.js → search-toggle-BcxWLlTq.js} +1 -1
- package/dist/client/assets/{secret-picker-C40fL6uP.js → secret-picker-DPGoj7h_.js} +1 -1
- package/dist/client/assets/{secrets-Kq6gwxOB.js → secrets-B8z_kU7L.js} +1 -1
- package/dist/client/assets/sections-editor-CrDBRhDJ.js +4 -0
- package/dist/client/assets/{select-CEirlFRV.js → select-DStdJ5GE.js} +1 -1
- package/dist/client/assets/{select-model-5mFHKpuo.js → select-model-DktuB9we.js} +1 -1
- package/dist/client/assets/{seo-editor-DHTxrlCs.js → seo-editor-Do_o2mpU.js} +1 -1
- package/dist/client/assets/{separator-E-ZvgvRL.js → separator-DjT0GNN3.js} +1 -1
- package/dist/client/assets/{settings-tab-C9ihpTae.js → settings-tab-Bp_kIMZk.js} +1 -1
- package/dist/client/assets/{sheet-Bs1jJD9o.js → sheet-DrnvYUkv.js} +1 -1
- package/dist/client/assets/{shell-layout-DZBrJWAA.js → shell-layout-es79-GX2.js} +1 -1
- package/dist/client/assets/{skills-7xwa1ol9.js → skills-tgcVsI6y.js} +1 -1
- package/dist/client/assets/{slider-ki239RUG.js → slider-DDCTVa3c.js} +1 -1
- package/dist/client/assets/{sortable.esm-Dvqn6rnz.js → sortable.esm-DMnnxTnV.js} +1 -1
- package/dist/client/assets/{sso-n5eUQ_Xy.js → sso-CjxHBVq1.js} +1 -1
- package/dist/client/assets/{suggestion-DHADwupQ.js → suggestion-lK-gfS31.js} +1 -1
- package/dist/client/assets/{switch-BD8_vvWq.js → switch-Kct2nT2R.js} +1 -1
- package/dist/client/assets/{symbol-Dx-KpnN7.js → symbol-ConDXyHb.js} +1 -1
- package/dist/client/assets/{synced-repos-B-5rRFwb.js → synced-repos-BldmP6l5.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-B9KZAh18.js → tab-icon-glyph-TqQzdqzw.js} +1 -1
- package/dist/client/assets/{table-B1C2ctbL.js → table-D3NAm7Bc.js} +1 -1
- package/dist/client/assets/{tabs-tkvg_YSq.js → tabs-BmpbjUEc.js} +1 -1
- package/dist/client/assets/{task-board-DcolQ15W.js → task-board-B3rwHKUr.js} +1 -1
- package/dist/client/assets/{task-route-Dp4TtKUe.js → task-route-BuUiu92l.js} +1 -1
- package/dist/client/assets/{task-status-CF9KSEEA.js → task-status-D3rjOgq8.js} +1 -1
- package/dist/client/assets/taskboard-analytics-DQb8UlLT.js +1 -0
- package/dist/client/assets/tasks-B-ZKkcGw.js +1 -0
- package/dist/client/assets/{tasks-B6gqzeMQ.js → tasks-ChYbt0G7.js} +1 -1
- package/dist/client/assets/{textarea-BpBHfDQd.js → textarea-BWzL69YC.js} +1 -1
- package/dist/client/assets/{thread-analytics-DfV1z1-8.js → thread-analytics-tujDJaK3.js} +1 -1
- package/dist/client/assets/{thread-button-BNBHV_Wu.js → thread-button-BzqfKMW2.js} +1 -1
- package/dist/client/assets/{thread-intent-DqexYQAC.js → thread-intent-CJ-s3I0o.js} +1 -1
- package/dist/client/assets/{thread-route-B-yx1tFW.js → thread-route-CV6SbsTq.js} +1 -1
- package/dist/client/assets/{thread-route-BXR-ufCz.js → thread-route-GHLN4JK9.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-Bgp-QwJy.js → thread-sheet-body-D5eS4AiQ.js} +1 -1
- package/dist/client/assets/{time-range-picker-DILwkH82.js → time-range-picker-D2lucQp_.js} +1 -1
- package/dist/client/assets/{toggle-group-SSpwI-zE.js → toggle-group-OQufBZdd.js} +1 -1
- package/dist/client/assets/{tool-namespace-CsdkV2uo.js → tool-namespace-BNEevFqW.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CIXm0pyl.js → toolbar-icon-button-CXgkBoho.js} +1 -1
- package/dist/client/assets/{tooltip-CUk78XFR.js → tooltip-B7gx1fFf.js} +1 -1
- package/dist/client/assets/{tooltipContext-BY8Qgc3U.js → tooltipContext-C3VsicNY.js} +1 -1
- package/dist/client/assets/{track-DDd4x4-Y.js → track-BmECy8By.js} +1 -1
- package/dist/client/assets/{types-DPbXDbOS.js → types-D-iizAZX.js} +1 -1
- package/dist/client/assets/{url-slug-CFKzH8Z4.js → url-slug-yE9p_CBQ.js} +1 -1
- package/dist/client/assets/{usage-stats-wClM7TZ-.js → usage-stats-CmZMkNV4.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CAEoYJwC.js → use-ai-providers-BuM6ovEv.js} +1 -1
- package/dist/client/assets/{use-automations-DXjaaH0T.js → use-automations-LJ6ovb1E.js} +1 -1
- package/dist/client/assets/{use-autosave-BOlmY_xu.js → use-autosave-CF8yQfdB.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-BYcPLpFV.js → use-chat-layout-state-DSr0gtOa.js} +1 -1
- package/dist/client/assets/{use-chat-navigation-CKcbdotk.js → use-chat-navigation-CtLOIOM3.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CwQv-OCe.js → use-clock-tick-CjMIMPxr.js} +1 -1
- package/dist/client/assets/{use-connect-companion-PBAraKBj.js → use-connect-companion-CwbSClFC.js} +1 -1
- package/dist/client/assets/{use-connection-DldRXuvq.js → use-connection-CYbCdCg-.js} +1 -1
- package/dist/client/assets/{use-copy-BC3Fmh27.js → use-copy-DQJK1-Md.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D8P6CVcB.js → use-create-virtual-mcp-BUTNkXFZ.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-DquxgLdE.js → use-date-fns-locale-Co69xfV4.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-mYSK51JG.js → use-debounced-autosave-x27V8Nl7.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CNkuXNOW.js → use-debounced-value-gqRwYLiP.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DKtKOwIN.js → use-deco-credits-BXoQO4ZL.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DH5jig6y.js → use-decopilot-events-DTg4q8xq.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Dzg9cQZm.js → use-delete-connection-AGx8DbMG.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CyBWrUgL.js → use-deployment-admin-0LqCMWJq.js} +1 -1
- package/dist/client/assets/{use-ensure-project-folder-CdHM_a-9.js → use-ensure-project-folder-BJtbErXB.js} +1 -1
- package/dist/client/assets/use-fast-preview-draft-url-Cf70Sary.js +1 -0
- package/dist/client/assets/{use-file-configs-DsMQGho1.js → use-file-configs-yKzFEaLv.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-C0Ths8NM.js → use-infinite-scroll-bleQjS0V.js} +1 -1
- package/dist/client/assets/{use-join-requests-CoVXbvos.js → use-join-requests-hLy1Es2J.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-DlD2zr1g.js → use-main-panel-tabs-CnECwxGP.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-B2t4xmcR.js → use-mcp-auth-status-96a5nrqO.js} +1 -1
- package/dist/client/assets/{use-mcp-client-C5uLw7Lc.js → use-mcp-client-CaTe2ylT.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Dxu80Ack.js → use-mcp-prompts-CatolySn.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Cm9CvYn6.js → use-mcp-tools-DSK4UhCW.js} +1 -1
- package/dist/client/assets/{use-members-C9_S9nP9.js → use-members-DpzUOwzJ.js} +1 -1
- package/dist/client/assets/{use-mobile-Buz9Esa_.js → use-mobile-CW5odOpu.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C41zpB_Z.js → use-navigate-to-agent-d5laMYnC.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-Cz0Ycsmz.js +1 -0
- package/dist/client/assets/{use-open-billing-url-C1VukQDg.js → use-open-billing-url-Cp2-WoXr.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DjRiIxwH.js → use-org-auth-client-BK9SNEwg.js} +1 -1
- package/dist/client/assets/{use-org-fs-DqhUUlbQ.js → use-org-fs-CGkxTNmD.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-cx9r2nZl.js → use-org-repo-syncs-DD7U_Wvq.js} +1 -1
- package/dist/client/assets/{use-org-sso-DVCQNBfN.js → use-org-sso-BFc5mu2c.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Bp0RCVOK.js → use-organization-roles-_ra6WqmV.js} +1 -1
- package/dist/client/assets/{use-organization-settings-B0rQmLIX.js → use-organization-settings-DYBuXxZf.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-DOyxnt44.js → use-panel-navigate-BSNsfU5E.js} +1 -1
- package/dist/client/assets/{use-project-scope-DJTJDi3A.js → use-project-scope-B0llZYB3.js} +1 -1
- package/dist/client/assets/{use-releases-BXUiPgUU.js → use-releases-CtMKqMnj.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-frCP_UW9.js → use-reports-diagnostic-BUInMZkH.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-Clj9v6On.js → use-sandbox-events-BWuyZLCb.js} +1 -1
- package/dist/client/assets/{use-secrets-CIfBnw6x.js → use-secrets-DZiT1hfy.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BYZSxM0z.js → use-section-preview-base-C_HnXvmD.js} +1 -1
- package/dist/client/assets/{use-tags-Blq5AODj.js → use-tags-D9KDSClM.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-D09WT40p.js → use-task-board-analytics-BeVdM1sk.js} +1 -1
- package/dist/client/assets/{use-task-board-events-Bx8_k4aV.js → use-task-board-events-BGOp2VgA.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-Bsgf-2Zm.js → use-task-board-item-prs-CoAaBXmY.js} +1 -1
- package/dist/client/assets/{use-task-board-items-CIYsbBEM.js → use-task-board-items-5GcCOG2k.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DDV_r81k.js → use-task-metadata-BtjkeyMc.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-BuosijZj.js → use-thread-analytics-hmgxoK5f.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-D13C6fsy.js → use-thread-outputs-PMUX8yZJ.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Cogq3tDA.js +1 -0
- package/dist/client/assets/{useQueries-DZMzH0ea.js → useQueries-CYxeWZY5.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BbeYvXgw.js +1 -0
- package/dist/client/assets/{users-CE3WLjUJ.js → users-D-me7s_R.js} +1 -1
- package/dist/client/assets/{utils-qUv9_Hyk.js → utils-B68PenDU.js} +1 -1
- package/dist/client/assets/{variant-calendar-B604PCFx.js → variant-calendar-DRmc-Qwc.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-CgF3ujB9.js → variant-matcher-override-cnXBxn5m.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BaZ1kmhW.js → view-mode-toggle-t5oMnsLw.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CWsV4-pi.js → virtual-mcp-EknFjHGW.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-BjTl5yOD.js → watch-sse-pool-BBIuBzhf.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/agent-app-fS8AS09U.js +0 -1
- package/dist/client/assets/agent-deck-BSKZhX9C.js +0 -1
- package/dist/client/assets/agent-library-BORVKAKi.js +0 -1
- package/dist/client/assets/agent-library-file-CQVtmhou.js +0 -1
- package/dist/client/assets/agent-settings-CP8WaMNS.js +0 -1
- package/dist/client/assets/agent-site-editor-code-DBqdRzpW.js +0 -2
- package/dist/client/assets/agent-site-editor-preview-CMWo8Jpl.js +0 -518
- package/dist/client/assets/agent-view-BHgh3Lxp.js +0 -1
- package/dist/client/assets/api-keys-DLMcrFXL.js +0 -1
- package/dist/client/assets/app-editor-CJc6hCJ6.js +0 -1
- package/dist/client/assets/chat-context-BR-PmAJg.js +0 -39
- package/dist/client/assets/claim-phase-copy-C0pvoElR.js +0 -1
- package/dist/client/assets/flat-project-YGEAxpJq.js +0 -1
- package/dist/client/assets/index-D7k-FSss.css +0 -1
- package/dist/client/assets/library-BIKWwK0_.js +0 -1
- package/dist/client/assets/project-reports-BqyykKm5.js +0 -1
- package/dist/client/assets/project-tasks-DHxi49Je.js +0 -1
- package/dist/client/assets/record-editor-CQTy2--L.js +0 -1
- package/dist/client/assets/redirect-editor-Diq4Tlsx.js +0 -1
- package/dist/client/assets/reports-Bew0urwY.js +0 -1
- package/dist/client/assets/route-DQYAyMBI.js +0 -1
- package/dist/client/assets/sections-editor-5-gvD3vu.js +0 -1
- package/dist/client/assets/taskboard-analytics-C_zsZRzy.js +0 -1
- package/dist/client/assets/tasks-O62NX5lN.js +0 -1
- package/dist/client/assets/use-fast-preview-draft-url-Cuacxxyo.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-DuP8uKZj.js +0 -1
- package/dist/client/assets/useInfiniteQuery-B3MUNCKJ.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DPTWpcSJ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as b,r as i,b4 as ie,b5 as ce,e as le,b6 as j,c as de,a2 as fe,J as Se,j as me}from"./index-
|
|
1
|
+
import{o as b,r as i,b4 as ie,b5 as ce,e as le,b6 as j,c as de,a2 as fe,J as Se,j as me}from"./index-C3moojPl.js";import{u as pe}from"./use-mcp-client-CaTe2ylT.js";import{a as ye}from"./input-C8o95ZIl.js";import{b as Ee,u as he}from"./chat-context-Bdbu4aFj.js";import{u as Re}from"./thread-intent-CJ-s3I0o.js";import{e as xe}from"./backoff-CrEUbyZT.js";import{u as we}from"./use-sandbox-events-BWuyZLCb.js";import{d as Ae}from"./sandbox-start-errors-BK_aDCyt.js";function Te(e,t){const n=b(t);return be({filters:{...e,status:"pending"}},n).length}function X(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function be(e={},t){const n=b(t).getMutationCache(),r=i.useRef(e),s=i.useRef(null);return s.current===null&&(s.current=X(n,e)),i.useEffect(()=>{r.current=e}),i.useSyncExternalStore(i.useCallback(u=>n.subscribe(()=>{const a=ie(s.current,X(n,r.current));s.current!==a&&(s.current=a,ce.schedule(u))}),[n]),()=>s.current,()=>s.current)}async function Pe(e,t,n){const r=await e.callTool({name:t,arguments:n});if(r.isError){const s=r.content?.[0]?.text??`Tool ${t} failed without a message`;throw new Error(s)}return r}const q=["SANDBOX_START"],w=new Map,Ce=e=>`${e.virtualMcpId}::${e.branch??""}`,ke=e=>e.message.includes("retry shortly"),U=new Set,g={mark:(e,t)=>U.add(`${e}::${t}`),clear:(e,t)=>U.delete(`${e}::${t}`),isStopped:(e,t)=>U.has(`${e}::${t}`)};function _e(e,t){const n=b();return le({mutationKey:q,retry:(r,s)=>ke(s)&&r<6,retryDelay:r=>xe(5e3,500,r,2,0),mutationFn:async r=>{r.branch&&g.clear(r.virtualMcpId,r.branch);const s=Ce(r),u=w.get(s);if(u)return u;const a=(async()=>(await Pe(e,"SANDBOX_START",r)).structuredContent)();w.set(s,a);try{return await a}finally{w.get(s)===a&&w.delete(s)}},onSuccess:()=>{j(n),t?.onStarted?.()}})}function Me(e,t){const n=de.c(3);let r;return n[0]!==t||n[1]!==e?(r={mutationKey:q,predicate:u=>{if(!e)return!1;const a=u.state.variables;return!a||a.virtualMcpId!==e?!1:(a.branch??"")===(t??"")}},n[0]=t,n[1]=e,n[2]=r):r=n[2],Te(r)>0}function Ue(e){return e.appPaused||e.userStopped?{kind:"suspended"}:e.startError&&!e.previewUrl?{kind:"errored",error:e.startError}:e.previewUrl?{kind:"iframe",previewUrl:e.previewUrl}:{kind:"starting"}}function ge(e){return e.executionEnabled&&e.sessionRuntime==="sandbox"&&e.hasActiveRepository&&!!e.userId&&!!e.branch&&!e.vmEntry&&!e.userStopped&&!e.isPending&&!e.attempted}function We(e){return e.threadLoaded&&e.isOwner&&e.hasActiveRepository&&!e.branch&&!e.attempted}function De(e){return e.executionEnabled&&e.notFound&&!!e.deadVmId&&!e.isPending&&!e.userStopped&&e.deadVmId!==e.lastDeadVmId}function ze(e){const{agentSandboxMap:t,threadSandboxMap:n,userId:r,branch:s}=e,u=e.ownerId??r;if(!r||!u||!s)return t;const a=n?.[u]?.[s];return a?{...t??{},[r]:{...t?.[r]??{},[s]:a}}:t}function A(e,t,n){const r={virtualMcpId:e};return t&&(r.branch=t),n&&(r.threadId=n),r}const Y=2,Le=new Set(["scheduling-timeout","reconciler-error","claim-never-created","unknown"]);function J(e){return Le.has(e)}function Oe(e){return e.executionEnabled&&e.failedReason!==null&&J(e.failedReason)&&e.attempts<Y&&!e.isPending&&!e.userStopped&&!e.alreadyHandled}const $e={branch:null,count:0,handled:!1};function Be(e,t){return e.branch===t?e:{branch:t,count:0,handled:!1}}function Ve(e){return e.mutationError?e.mutationError:e.phase?.kind==="failed"&&!e.startPending&&e.claimRetryExhausted?{code:null,message:e.phase.message}:null}function Fe(e){switch(e.kind){case"suspended":return"suspended";case"iframe":return"running";case"starting":return"starting";case"errored":return"errored"}}function Q(e,t){return`${e??""}::${t??""}`}function ve(e){const t=e.vmEntry?.previewUrl??null;return t||(e.seeded?.key===e.key?e.seeded.url:null)}function T(e){const{data:t,virtualMcpId:n,branch:r}=e;t?.branch&&!r&&e.setCurrentTaskBranch(t.branch),t?.previewUrl&&e.setSeededPreviewUrl({key:Q(n,t.branch??r),url:t.previewUrl})}const Ne={branch:null,previewState:{kind:"starting"},status:"idle",vmEntry:null,previewUrl:null,userStopped:!1,start:()=>{},stop:async()=>{},restart:async()=>{},retry:()=>{},resume:()=>{}},M=i.createContext(Ne);function Ge(){return i.use(M)}function Ze({executionEnabled:e,virtualMcpId:t,branch:n,userId:r,hasActiveRepository:s,vmEntry:u,threadId:a,children:D}){const{org:L}=fe(),{setCurrentTaskBranch:l}=Ee(),W=Re(),p=we(),z=b(),O=ye(t),G=O.resolved?O.runtime:null,d=he()?.taskId??null,$=pe({connectionId:Se,orgId:L.id,orgSlug:L.slug}),c=_e($,{onStarted:()=>{a&&W?.refreshThreadMetadata(a)}}),{mutate:f,reset:Z}=c,[ee,S]=i.useState(null),P=i.useRef(new Set),C=i.useRef(null),[B,R]=i.useState($e),E=Be(B,n);E!==B&&R(E);const y=p.phase?.kind==="failed"?p.phase:null,V=ve({vmEntry:u,seeded:y?null:ee,key:Q(t,n)}),h=!!t&&!!n&&g.isStopped(t,n),te=p.status.state==="paused",ne=!y||!J(y.reason)||E.count>=Y,re=Ve({mutationError:c.isError&&c.error?Ae(c.error.message):null,phase:p.phase,startPending:c.isPending,claimRetryExhausted:ne}),F=Ue({previewUrl:V,appPaused:te,userStopped:h,startError:re}),se=Fe(F),k=n??"",oe=P.current.has(k),v=ge({executionEnabled:e,hasActiveRepository:s,userId:r,branch:n,vmEntry:u,userStopped:h,isPending:c.isPending,attempted:oe,sessionRuntime:G});i.useEffect(()=>{if(!v||!t)return;P.current.add(k);const m=A(t,n,d);f(m,{onSuccess:o=>{T({data:o,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:o=>{console.error("[sandbox-lifecycle] auto-start failed:",o)}})},[v,k,n,t,d,f,l,S]);const x=p.notFound?u?.sandboxHandle??null:null,N=De({executionEnabled:e,notFound:p.notFound,deadVmId:x,lastDeadVmId:C.current,isPending:c.isPending,userStopped:h});i.useEffect(()=>{if(!N||!x||!t)return;C.current=x;const m=A(t,n,d);f(m,{onSuccess:o=>{T({data:o,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:o=>{console.error("[sandbox-lifecycle] self-heal failed:",o)}})},[N,x,t,n,d,f,l,S]);const I=Oe({executionEnabled:e,failedReason:y?.reason??null,attempts:E.count,isPending:c.isPending,userStopped:h,alreadyHandled:E.handled});i.useEffect(()=>{if(!y){R(o=>o.handled?{...o,handled:!1}:o);return}if(!I||!t)return;R(o=>({...o,handled:!0,count:o.count+1}));const m=A(t,n,d);f(m,{onSuccess:o=>{T({data:o,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:o=>{console.error("[sandbox-lifecycle] claim auto-retry failed:",o)}})},[y,I,t,n,d,f,l,S]);const _=()=>{if(!e||!t)return;const m=A(t,n,d);f(m,{onSuccess:o=>{T({data:o,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:o=>{console.error("[sandbox-lifecycle] user start failed:",o)}})},K=async()=>{if(!(!e||!t||!n)&&u){g.mark(t,n);try{await $.callTool({name:"SANDBOX_DELETE",arguments:{virtualMcpId:t,branch:n}})}catch{}j(z)}},ae=async()=>{await K(),_()},H=()=>{P.current=new Set,C.current=null,R({branch:n,count:0,handled:!1}),Z(),_()},ue={branch:n,previewState:F,status:se,vmEntry:u,previewUrl:V,userStopped:h,start:_,stop:K,restart:ae,retry:H,resume:H};return me.jsx(M,{value:ue,children:D})}export{Ze as S,_e as a,Ge as b,Te as c,ze as o,We as s,Me as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aD as s,bS as e,aE as o,bT as d,bU as l}from"./index-
|
|
1
|
+
import{aD as s,bS as e,aE as o,bT as d,bU as l}from"./index-C3moojPl.js";const a=500;s({title:o().max(a),url:o().max(a),icon:o().max(a)});const t=s({keyId:o().max(a),modelId:o().max(a),title:o().max(a).optional()}).nullable();d(["fast","smart","thinking","image","web_search","deep_research"]);d(["fast","smart","thinking"]);const b=s({tiers:s({fast:t,smart:t,thinking:t,image:t,web_search:t,deep_research:t})});s({tiers:s({fast:t.optional(),smart:t.optional(),thinking:t.optional()})});const f=50,c=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/;s({host:o().min(1).max(a).regex(c).describe("Git host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:o().min(1).max(a).describe("Vault secret id holding the PAT used to authenticate this host.")});s({ids:l(o().max(a)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const u=s({voice_mode:e().optional(),home_task_intake_enabled:e().optional().describe("Show Task mode on the Home composer and allow reports to start tasks."),demo_mode:e().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:e().optional().describe("Curated Deco Score look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),reviewer_enabled:e().optional().describe("Run the Reviewer on a task's pull request when the card reaches In Review — it reviews the code with the repo's stack-appropriate skills, fixes what it finds on the PR's own branch, then exercises the change on the deploy preview and approves or hands the card to a human."),qa_agent_enabled:e().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:e().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:e().optional().describe("When a card reaches Ready for Deployment, merge its pull request automatically instead of waiting for someone to press Ship."),auto_resolve_conflicts:e().optional().describe("When a pull request in Ready for Deployment can't be merged because it conflicts with its base branch, hand it back to the Super Agent to resolve the conflict (check out the branch, merge the base, push). Unset, it follows `auto_merge`; set it explicitly to run one without the other."),cheap_reviewer_model:e().optional().describe("Run the Reviewer on a cheaper model than the Super Agent that wrote the code. On by default — turning it off trades cost for some review depth."),coding_agent_org_mcps:e().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow Studio surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),coding_agents_claude_code:e().optional().describe("Run chats on a Code Agent (an agent imported from a GitHub repo) with the claude-code harness inside its sandbox, instead of hosted Decopilot. Off by default: it changes the runtime of every such chat, and claude-code flushes whole turns rather than streaming tokens."),chat_harness_codex:e().optional().describe("Use Codex for new sandbox chats. Off by default; requires hosted sandboxes and a ChatGPT subscription or Responses API provider. Existing chats keep their pinned runtime."),chat_harness_sandbox_only:e().optional().describe("Run every chat with the claude-code harness in its own sandbox instead of hosted Decopilot. On by default (see DEFAULT_ON_FLAGS); a deployment without hosted sandboxes keeps Decopilot regardless."),sandbox_repo_snapshots:e().optional().describe("Keep a Freestyle snapshot of each project repo at its default branch's head, with its dependencies installed and its dev server running, so a new sandbox for that repo starts already serving. Off by default: each push to a default branch costs a snapshot build the next time a sandbox starts."),auto_assign_report_tasks_to_super_agent:e().optional().describe("When a Deco Score import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned."),hosting_enabled:e().optional().describe("Per-site Hosting tab (deployments, domains, deploy outcomes). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),deco_analytics_enabled:e().optional().describe("Per-site Deco Analytics tab (traffic, realtime, usage & limits). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),e2e_enabled:e().optional().describe("Per-site E2E tab (end-to-end test runs). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),experiments_enabled:e().optional().describe("Per-site Experiments tab (A/B tests + variant results). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org."),experiments_v2_enabled:e().optional().describe("Rebuilt Experiments tab: describe the test in prose and an agent drafts it, plus inline editing and the implement/preview tools that write the split into the site. Off by default — an org without it keeps the table-and-dialog tab, which only records experiment metadata. Requires `experiments_enabled`, which still decides whether the tab exists at all."),monitor_enabled:e().optional().describe("Per-site Monitor tab (CDN Performance + Audience from the stats-lake warehouse). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. Its own deployment-wide switch `MONITOR_GA` opens it to every org at once (independent of the control-plane trio)."),site_create_enabled:e().optional().describe('The "Create a new site" option under New project: generates a GitHub repository from a site template in an account the org connected, and opens it as a project. Off by default, for every org — deco.cx staff included.'),new_blocks_editor:e().optional().describe("Use the redesigned blocks editor for every member of the organization. Off by default — the classic editor stays until an admin opts the org in."),blog_ai_enabled:e().optional().describe("The blog's brand context tab and its agentic generation — campaigns, post drafting and link suggestions. Off by default; with it off the blog is written by hand and every BLOG_* tool refuses, over MCP and in the app alike, so an agent cannot spend the organization's credits on a feature it turned off."),hide_default_blog_blocks:e().optional().describe("Hide the `deco-cms/blog` built-in post blocks everywhere a post is written — the inserter, the format briefs, and generated drafts — so only the site's own `site/sections/Blog/Post/*` blocks are eligible. Off by default. Blocks already present in a post keep rendering; this only governs what can be added.")}),h=new Set(["reviewer_enabled","cheap_reviewer_model","chat_harness_sandbox_only"]);function g(i,n){const r=i?.[n];return h.has(n)?r!==!1:r===!0}function m(i){const n=i?.auto_resolve_conflicts;return typeof n=="boolean"?n:i?.auto_merge===!0}export{h as D,f as G,u as O,b as S,m as a,c as b,g as o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,by as A,bu as ce,j as b,bA as _,bN as ae,dl as O,bB as C,bH as P,bC as ie,c as F,l as $}from"./index-4XFLhK7S.js";import{c as de}from"./index-BdQq_4o_.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[T,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,H]=d.useState(!1),v=A(e,R=>c(R)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:T,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:H,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(J,o),a=d.useRef(null),c=A(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(B,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(B,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return E(o.viewport,c),E(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(B,{"data-state":n?"visible":"hidden",...t,ref:e})})}),B=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=A(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=A(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=m(g,o),[w,T]=d.useState(null),Y=A(e,v=>T(v)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(i),y=P(c),N=X(h,10);function H(v){if(x.current){const p=v.clientX-x.current.left,R=v.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),H(v))}),onPointerMove:C(r.onPointerMove,H),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),W="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(W,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(W,o),s=ee(W,o),{onThumbPositionChange:a}=s,c=A(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,T=h.clientY-S.top;s.onThumbPointerDown({x:w,y:T})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=W;var V="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(V,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=V;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(V,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function E(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Re=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Ee(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
|
|
1
|
+
import{r as d,by as A,bu as ce,j as b,bA as _,bN as ae,dl as O,bB as C,bH as P,bC as ie,c as F,l as $}from"./index-C3moojPl.js";import{c as de}from"./index-BdQq_4o_.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[T,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,H]=d.useState(!1),v=A(e,R=>c(R)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:T,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:H,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(J,o),a=d.useRef(null),c=A(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(B,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(B,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return E(o.viewport,c),E(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(B,{"data-state":n?"visible":"hidden",...t,ref:e})})}),B=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=A(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=A(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=m(g,o),[w,T]=d.useState(null),Y=A(e,v=>T(v)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(i),y=P(c),N=X(h,10);function H(v){if(x.current){const p=v.clientX-x.current.left,R=v.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),H(v))}),onPointerMove:C(r.onPointerMove,H),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),W="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(W,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(W,o),s=ee(W,o),{onThumbPositionChange:a}=s,c=A(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,T=h.clientY-S.top;s.onThumbPointerDown({x:w,y:T})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=W;var V="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(V,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=V;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(V,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function E(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Re=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Ee(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as b,l as w,j as a,h as j}from"./index-
|
|
1
|
+
import{c as b,l as w,j as a,h as j}from"./index-C3moojPl.js";import{i as v}from"./SearchMd-BXSC0WTH.js";function k(f){const e=b.c(17),{value:l,onChange:c,placeholder:m,onKeyDown:u,className:d,isSearching:p,disabled:r}=f,x=m===void 0?"Search...":m,h=r&&"pointer-events-none opacity-50";let t;e[0]!==d||e[1]!==h?(t=w("flex items-center gap-4 rounded-lg bg-[var(--studio-input-background)] px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",h,d),e[0]=d,e[1]=h,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{className:"size-4 text-muted-foreground/75 shrink-0"}):a.jsx(v,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=g=>c(g.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==r||e[8]!==u||e[9]!==x||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:u,placeholder:x,disabled:r,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=r,e[8]=u,e[9]=x,e[10]=s,e[11]=l,e[12]=o):o=e[12];let i;return e[13]!==t||e[14]!==n||e[15]!==o?(i=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=i):i=e[16],i}export{k as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as K,r as C,l as z,j as a,aV as M}from"./index-
|
|
1
|
+
import{c as K,r as C,l as z,j as a,aV as M}from"./index-C3moojPl.js";import{i as B}from"./SearchMd-BXSC0WTH.js";import{I as O}from"./icon-button-7qsU_2OV.js";function G(S){const e=K.c(34),{value:t,onChange:s,label:E,placeholder:D,clearLabel:F,expanded:o,className:j}=S,w=E===void 0?"Search":E,d=D===void 0?"Search…":D,y=F===void 0?"Clear search":F,[I,p]=C.useState(t!==""),[L,V]=C.useState(!1),[R,$]=C.useState(t);if(t!==R&&($(t),t===""&&!L&&p(!1)),!I&&!o){let l,g;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>p(!0),g=a.jsx(B,{}),e[0]=l,e[1]=g):(l=e[0],g=e[1]);let v;return e[2]!==w?(v=a.jsx(O,{label:w,tooltipSide:"bottom",variant:"secondary",onClick:l,children:g}),e[2]=w,e[3]=v):v=e[3],v}const _=o?"h-10 w-full px-3":"h-7 w-32 animate-search-expand px-2.5 sm:w-44";let n;e[4]!==j||e[5]!==_?(n=z("inline-flex shrink-0 items-center gap-1.5 overflow-hidden rounded-full bg-card text-card-foreground card-shadow",_,j),e[4]=j,e[5]=_,e[6]=n):n=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(B,{className:"size-4 shrink-0 text-muted-foreground"}),e[7]=x):x=e[7];const k=!o;let r;e[8]!==s?(r=l=>s(l.target.value),e[8]=s,e[9]=r):r=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>V(!0),e[10]=h):h=e[10];let c;e[11]!==t?(c=()=>{V(!1),t===""&&p(!1)},e[11]=t,e[12]=c):c=e[12];let i;e[13]!==s?(i=l=>{l.key==="Escape"&&s("")},e[13]=s,e[14]=i):i=e[14];const N=o?"text-sm":"text-xs";let f;e[15]!==N?(f=z("w-full min-w-0 bg-transparent outline-none placeholder:text-muted-foreground",N),e[15]=N,e[16]=f):f=e[16];let u;e[17]!==d||e[18]!==c||e[19]!==i||e[20]!==f||e[21]!==k||e[22]!==r||e[23]!==t?(u=a.jsx("input",{autoFocus:k,value:t,onChange:r,onFocus:h,onBlur:c,onKeyDown:i,placeholder:d,"aria-label":d,className:f}),e[17]=d,e[18]=c,e[19]=i,e[20]=f,e[21]=k,e[22]=r,e[23]=t,e[24]=u):u=e[24];let m;e[25]!==y||e[26]!==o||e[27]!==s||e[28]!==t?(m=t!==""&&a.jsx("button",{type:"button","aria-label":y,onMouseDown:P,onClick:()=>{s(""),o||p(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:a.jsx(M,{className:"size-3.5"})}),e[25]=y,e[26]=o,e[27]=s,e[28]=t,e[29]=m):m=e[29];let b;return e[30]!==u||e[31]!==m||e[32]!==n?(b=a.jsxs("div",{className:n,children:[x,u,m]}),e[30]=u,e[31]=m,e[32]=n,e[33]=b):b=e[33],b}function P(S){return S.preventDefault()}export{G as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as x,b as d,j as l}from"./index-
|
|
1
|
+
import{c as x,b as d,j as l}from"./index-C3moojPl.js";import{s as j}from"./User01-B7hPiYB7.js";import{t as E}from"./Users01-DxG-qkCG.js";const b=/^[A-Za-z0-9_.-]+$/;function h(u){const e=x.c(15),{field:p,secretById:t}=u,s=d(),n=p.value||"";if(!n)return null;let a;e[0]!==n||e[1]!==t?(a=t.get(n),e[0]=n,e[1]=t,e[2]=a):a=e[2];const c=a;if(!c){let i;e[3]!==n||e[4]!==s?(i=s("sandbox.envVarsField.missingSecret",{id:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5];let f;return e[6]!==i?(f=l.jsx("span",{className:"text-destructive",children:i}),e[6]=i,e[7]=f):f=e[7],f}let o;e[8]!==c.scope?(o=l.jsx(N,{scope:c.scope}),e[8]=c.scope,e[9]=o):o=e[9];let r;e[10]!==c.name?(r=l.jsx("span",{className:"truncate font-mono",children:c.name}),e[10]=c.name,e[11]=r):r=e[11];let m;return e[12]!==o||e[13]!==r?(m=l.jsxs("span",{className:"inline-flex items-center gap-1.5 truncate",children:[o,r]}),e[12]=o,e[13]=r,e[14]=m):m=e[14],m}function N(u){const e=x.c(2),{scope:p}=u,t=p==="user"?j:E;let s;return e[0]!==t?(s=l.jsx(t,{className:"size-3 text-muted-foreground"}),e[0]=t,e[1]=s):s=e[1],s}export{h as S,b as a,N as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as j,b as y,j as s,n as C,fG as E,H as F,r as N,b2 as L,B as D,af as T,D as O,q as B,s as A,v as R,aK as q,I as _,w as I,t as z}from"./index-
|
|
1
|
+
import{c as j,b as y,j as s,n as C,fG as E,H as F,r as N,b2 as L,B as D,af as T,D as O,q as B,s as A,v as R,aK as q,I as _,w as I,t as z}from"./index-C3moojPl.js";import{i as H}from"./AlertCircle-BgwifFMG.js";import{s as V}from"./Plus-BKb3EUuT.js";import{s as G}from"./User01-B7hPiYB7.js";import{t as K}from"./Users01-DxG-qkCG.js";import{L as w}from"./label-C-C9Ou_x.js";import{S as J,b as M,a as Q,d as U,c as P}from"./select-DStdJ5GE.js";import{T as W}from"./textarea-BWzL69YC.js";import{u as X,a as Y}from"./use-secrets-DZiT1hfy.js";import{R as Z}from"./require-capability-B_m0hTh2.js";import"./index-BdQq_4o_.js";import"./index-DjXrdMkW.js";import"./ChevronUp-QaPEzxVx.js";import"./access-gate-3MCIFFcK.js";import"./capability-load-error-BegMkJwl.js";function ee(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(H,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let a;return e[4]!==n?(a=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=a):a=e[5],a}function te(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?G:K;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const a=n;let l;e[3]!==c?(l=s.jsx(c,{size:12}),e[3]=c,e[4]=l):l=e[4];let o;return e[5]!==a||e[6]!==l?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[l,a]}),e[5]=a,e[6]=l,e[7]=o):o=e[7],o}function $(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(T,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(te,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let a;e[5]!==c||e[6]!==n?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=a):a=e[7];let l;e[8]!==r.description?(l=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=l):l=e[9];let o;e[10]!==a||e[11]!==l?(o=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[a,l]})]}),e[10]=a,e[11]=l,e[12]=o):o=e[12];let d;e[13]!==r.createdAt?(d=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=d):d=e[14];let m;e[15]!==d?(m=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:d}),e[15]=d,e[16]=m):m=e[16];let x;return e[17]!==o||e[18]!==m?(x=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[o,m]}),e[17]=o,e[18]=m,e[19]=x):x=e[19],x}function se(t){const e=j.c(15),{action:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(T,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let a;e[3]!==n?(a=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=a):a=e[4];let l;e[5]!==i?(l=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=l):l=e[6];let o;e[7]!==l?(o=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:l}),e[7]=l,e[8]=o):o=e[8];let d;e[9]!==a||e[10]!==o?(d=s.jsxs("div",{children:[a,o]}),e[9]=a,e[10]=o,e[11]=d):d=e[11];let m;return e[12]!==r||e[13]!==d?(m=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,d,r]}),e[12]=r,e[13]=d,e[14]=m):m=e[14],m}function k({open:t,onOpenChange:e}){const r=y(),[i,c]=N.useState("organization"),[n,a]=N.useState(""),[l,o]=N.useState(""),[d,m]=N.useState(""),x=Y();function g(){c("organization"),a(""),o(""),m("")}function p(){g(),e(!1)}async function b(u){if(u.preventDefault(),!(!n.trim()||!l))try{await x.mutateAsync({scope:i,name:n.trim(),value:l,description:d.trim()||void 0}),z.success(r("settings.secrets.secretCreated",{name:n.trim()})),p()}catch(f){z.error(f instanceof Error?f.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(O,{open:t,onOpenChange:u=>{u?e(u):p()},children:s.jsxs(B,{className:"sm:max-w-lg",children:[s.jsxs(A,{children:[s.jsx(R,{children:r("settings.secrets.newSecretTitle")}),s.jsx(q,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:b,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(J,{value:i,onValueChange:u=>c(u),children:[s.jsx(M,{id:"secret-scope",children:s.jsx(Q,{})}),s.jsxs(U,{children:[s.jsx(P,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(P,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(_,{id:"secret-name",value:n,onChange:u=>a(u.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(_,{id:"secret-value",type:"password",value:l,onChange:u=>o(u.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(W,{id:"secret-description",value:d,onChange:u=>m(u.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(I,{children:[s.jsx(D,{type:"button",variant:"outline",onClick:p,disabled:x.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(D,{type:"submit",disabled:x.isPending||!n.trim()||!l,children:x.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function re(){const t=j.c(34),e=y(),r=X(),[i,c]=N.useState(!1);let n,a;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>c(!0),a=s.jsx(V,{size:14}),t[0]=n,t[1]=a):(n=t[0],a=t[1]);let l;t[2]!==e?(l=e("settings.secrets.newSecret"),t[2]=e,t[3]=l):l=t[3];let o;t[4]!==l?(o=s.jsx(C.Actions,{children:s.jsxs(D,{size:"sm",onClick:n,children:[a,l]})}),t[4]=l,t[5]=o):o=t[5];const d=o;if(r.length===0){let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(se,{action:!1}),t[6]=u):u=t[6];let f;t[7]!==i?(f=s.jsx(k,{open:i,onOpenChange:c}),t[7]=i,t[8]=f):f=t[8];let h;return t[9]!==d||t[10]!==f?(h=s.jsxs(s.Fragment,{children:[d,u,f]}),t[9]=d,t[10]=f,t[11]=h):h=t[11],h}let m,x,g;if(t[12]!==d||t[13]!==r||t[14]!==e){const u=r.filter(le),f=r.filter(ce),h=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let S;t[18]!==r.length||t[19]!==e||t[20]!==h?(S=e(h,{count:r.length}),t[18]=r.length,t[19]=e,t[20]=h,t[21]=S):S=t[21];let v;t[22]!==S?(v=s.jsx("p",{className:"text-sm text-muted-foreground",children:S}),t[22]=S,t[23]=v):v=t[23],t[24]!==d||t[25]!==v?(m=s.jsxs("div",{className:"flex items-center justify-between",children:[v,d]}),t[24]=d,t[25]=v,t[26]=m):m=t[26],x=u.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:u.map(ie)})]}):null,g=f.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:f.map(ne)})]}):null,t[12]=d,t[13]=r,t[14]=e,t[15]=m,t[16]=x,t[17]=g}else m=t[15],x=t[16],g=t[17];let p;t[27]!==i?(p=s.jsx(k,{open:i,onOpenChange:c}),t[27]=i,t[28]=p):p=t[28];let b;return t[29]!==m||t[30]!==x||t[31]!==g||t[32]!==p?(b=s.jsxs(s.Fragment,{children:[m,x,g,p]}),t[29]=m,t[30]=x,t[31]=g,t[32]=p,t[33]=b):b=t[33],b}function ne(t){return s.jsx($,{secret:t},t.id)}function ie(t){return s.jsx($,{secret:t},t.id)}function ce(t){return t.scope==="user"}function le(t){return t.scope==="organization"}function ae(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{fallback:oe,children:s.jsx(N.Suspense,{fallback:s.jsx(L,{className:"h-32 w-full"}),children:s.jsx(re,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Container,{children:s.jsxs(E,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function oe(t){const{error:e}=t;return s.jsx(ee,{error:e??new Error("Failed to load secrets")})}function we(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Z,{capability:"secrets:manage",area:"secrets",children:s.jsx(ae,{})}),t[0]=e):e=t[0],e}export{we as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{c as ft,b as Dt,r as w,l as le,j as o,b1 as _i,B as xt,U as Qt,au as ki,X as Ei,V as Ri,a as Ai,o as Ni,h as Ci,t as z,K as Ti}from"./index-C3moojPl.js";import{u as Vi}from"./chat-context-Bdbu4aFj.js";import{u as In}from"./use-new-blocks-editor-Cz0Ycsmz.js";import{J as Mi,K as Di,N as Pi,O as Ki,Q as Ii,T as Bi,U as Fi,V as Li,W as Oi,X as kr,Y as $i,Z as zi,G as jt,_ as vt,$ as ze,a0 as Hi,H as Tn,E as Vn,e as Wi,f as Gi,j as qi,u as Ui,a1 as Er,o as Yi,a2 as Ji,q as Qi,n as Xi,a3 as to,p as vn,a4 as Zi,a5 as ea,C as Rr,a6 as ta,a7 as na,a8 as Nn,a9 as Ar,aa as Nr,ab as Cr,ac as ss,ad as sa,ae as ra,F as oa,af as Tr,ag as ia,ah as Vr,ai as Mr,M as aa,aj as Dr,d as la,ak as mn,al as ca,am as ua,an as pn,ao as da}from"./runnable-block-editor-BfWUQRiS.js";import{c as fa}from"./repository-binding-CPA8-dMz.js";import{n as ma,t as pa}from"./ChevronUp-QaPEzxVx.js";import{a6 as no,d as Pn,ak as ha,C as ga,$ as Pr,K as Kr}from"./agent-icon-DjnOmCBc.js";import{S as Xt}from"./scroll-area-BJew8KVi.js";import{b as wt,T as _t,a as kt}from"./tooltip-B7gx1fFf.js";import{m as va,u as xa,P as ya}from"./mustache-BlQTgv16.js";import{au as so,c as xs,av as ro,G as ba,aw as pt,ax as ls,ay as oo,ak as Ot,a8 as cs,az as us,al as Mt,a9 as Zt,j as Sa,l as ja,g as wa,r as Cn,ao as _a,aj as hn,aa as rs,ai as Vt,ah as gn,aA as ka,K as Ea,aB as Ra,am as Ir,a2 as Br,aC as Aa,aD as Lt,aE as Na,aF as Ca,aG as Ta,aH as Fr,aI as Va,aJ as Ma,aK as Da,ag as Pa,aL as Ka,aM as Ia,aN as Ba,X as Fa,aO as La,af as Oa,aP as $a}from"./claim-phase-copy-CNoIfrVp.js";import{a as za}from"./Copy01-YTn6AAPK.js";import{a as ds,e as io}from"./UserSquare-CLXjlx3Y.js";import{i as Lr}from"./Tool01-C9pjFqwV.js";import{s as Or}from"./Image01-Bpynux_N.js";import{s as Ha}from"./Plus-BKb3EUuT.js";import{s as Wa}from"./Trash01-BO35Cov_.js";import{i as fs}from"./ZoomOut-DLs2h_6j.js";import{u as Ga,a as $r,K as qa,P as Ua,b as Ya,C as Ja,D as Qa,c as Xa}from"./core.esm-CAijLSig.js";import{u as Za,s as el,a as Mn,S as tl,v as nl}from"./sortable.esm-DMnnxTnV.js";import{A as zr}from"./avatar-BQ1clUOI.js";import{e as sl,d as Hr,b as rl,A as ol,a as il,f as al}from"./alert-dialog-DLvf9XpO.js";import{d as ll}from"./shell-layout-es79-GX2.js";import{a as cl,P as Wr,b as ul}from"./page-seo-form-CY1JVNQO.js";import{u as dl,A as fl}from"./use-section-preview-base-C_HnXvmD.js";import{b as Gr,a as ml}from"./variant-matcher-override-cnXBxn5m.js";import"./use-panel-navigate-BSNsfU5E.js";import"./thread-route-CV6SbsTq.js";import"./use-project-scope-B0llZYB3.js";import"./autosend-BxzE8tXY.js";import"./thread-intent-CJ-s3I0o.js";import"./use-mcp-client-CaTe2ylT.js";import"./auth-C11WExuf.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BBIuBzhf.js";import"./task-board-B3rwHKUr.js";import"./schema-DyDDwNs8.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-DTg4q8xq.js";import"./use-ai-providers-BuM6ovEv.js";import"./use-chat-navigation-CtLOIOM3.js";import"./location-BjlyegC2.js";import"./use-organization-settings-DYBuXxZf.js";import"./input-C8o95ZIl.js";import"./usage-stats-CmZMkNV4.js";import"./tool-namespace-BNEevFqW.js";import"./form-BRZ5DZiG.js";import"./label-C-C9Ou_x.js";import"./utils-CVEq3hMx.js";import"./markdown-BUXU5oD6.js";import"./use-copy-DQJK1-Md.js";import"./use-mobile-CW5odOpu.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./XClose-CMdSy1nN.js";import"./icon-button-7qsU_2OV.js";import"./file-type-icon-BQzv7Wym.js";import"./chat-draft-CKhySLl4.js";import"./LinkBroken01-tO8JEBqa.js";import"./ArrowUp-AxzDl8Z3.js";import"./ShoppingBag01-D0kKEJuH.js";import"./Upload01-DJFAu4Mm.js";import"./AlertCircle-BgwifFMG.js";import"./select-DStdJ5GE.js";import"./index-BdQq_4o_.js";import"./index-DjXrdMkW.js";import"./ArrowLeft-BP0atRPX.js";import"./tabs-BmpbjUEc.js";import"./use-deco-credits-BXoQO4ZL.js";import"./toggle-group-OQufBZdd.js";import"./use-open-billing-url-Cp2-WoXr.js";import"./index-BXITXB61.js";import"./checkbox-B6gj5-qt.js";import"./ChevronSelectorVertical-B9RLS3HF.js";import"./Key01-ByMBFx-i.js";import"./SearchMd-BXSC0WTH.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-wrmGnmsX.js";import"./popover-P9zPzqJX.js";import"./drawer-CBMcEEQM.js";import"./input-Dy0JrrC0.js";import"./suggestion-lK-gfS31.js";import"./use-chat-layout-state-DSr0gtOa.js";import"./use-file-configs-yKzFEaLv.js";import"./site-slug-DebpOoQq.js";import"./use-mcp-prompts-CatolySn.js";import"./use-org-fs-CGkxTNmD.js";import"./useInfiniteQuery-Cogq3tDA.js";import"./infiniteQueryObserver-DMRptffd.js";import"./Link01-Zi8wbjzB.js";import"./question-004-sINsf4GQ.js";import"./use-members-DpzUOwzJ.js";import"./use-org-auth-client-BK9SNEwg.js";import"./feature-paywall-Hzw839qS.js";import"./plan-ladder-CBREr6Ld.js";import"./add-connection-dialog-DNMm7BIu.js";import"./collection-search-ji1JjZMn.js";import"./extract-connection-data-U1HCpmI2.js";import"./metadata-D72DunRR.js";import"./connection-BKamaNd5.js";import"./url-slug-yE9p_CBQ.js";import"./connection-card-VZBAZ1By.js";import"./connection-slug-CITJ0kGN.js";import"./integration-icon-CmzyrNbk.js";import"./textarea-BWzL69YC.js";import"./use-connection-CYbCdCg-.js";import"./connection-form-helpers-T_Ai4T1w.js";import"./authenticate-and-persist-oauth-DyuZVm6i.js";import"./mcp-oauth-L9MT2tEQ.js";import"./mcp-oauth-BkcOWs3t.js";import"./collection-tabs-C39YFQ2E.js";import"./badge-NHL6jQ7U.js";import"./use-infinite-scroll-bleQjS0V.js";import"./useSuspenseInfiniteQuery-BbeYvXgw.js";import"./use-task-board-events-BGOp2VgA.js";import"./Play-W6HcQ7l_.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-BL76LvR6.js";import"./collapsible-8Gh0baiT.js";import"./use-clock-tick-CjMIMPxr.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-DyZ3_ABn.js";import"./types-D-iizAZX.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./sheet-DrnvYUkv.js";import"./use-navigate-to-agent-d5laMYnC.js";import"./use-thread-outputs-PMUX8yZJ.js";import"./command-CloMVJTp.js";import"./index-p5cxA0SC.js";import"./utils-B68PenDU.js";import"./monaco-editor-Cpw9JqW2.js";import"./editor-B4h2oI8R.js";import"./calendar-wJdw6sZE.js";import"./SwitchHorizontal01-CAC-8ZOB.js";import"./rich-text-link-control-CGRceWX2.js";import"./switch-Kct2nT2R.js";import"./view-mode-toggle-t5oMnsLw.js";import"./combobox-sJwovF14.js";import"./sandbox-url-D3mC8qhT.js";import"./DotsVertical-D1KewbnO.js";import"./search-input-iE4YnSAW.js";import"./use-debounced-value-gqRwYLiP.js";import"./asset-utils-RL-ZiBha.js";import"./sandbox-git-api-C7JbVL7R.js";import"./Building02-DDW-F58b.js";import"./CheckCircle-pe1RxSse.js";import"./CreditCard01-DPxzkwQY.js";import"./Globe04-Cq4nB1G2.js";import"./Sun-CfiICDcE.js";import"./User01-B7hPiYB7.js";import"./Users01-DxG-qkCG.js";import"./project-icon-Ds5KkwAm.js";import"./new-project-dialog-BLbuP-We.js";import"./repository-import-picker-DG4AirBH.js";import"./repository-picker-BfnPBGTa.js";import"./required-auth-layout-DqtVx04D.js";import"./use-org-sso-BFc5mu2c.js";import"./section-preview-url-7zfngvgW.js";function pl(n){return n.schema?.definitions??n.schema?.$defs??{}}function ao(n,e){const s=pl(e),i=s[btoa(n)];if(!i)return[];const l=[i];if(Array.isArray(i.allOf)){const d=i.allOf.find(h=>typeof h.$ref=="string")?.$ref;if(typeof d=="string"){const h=s[d.replace("#/definitions/","")];h&&l.push(h)}}return l}function hl(n,e){for(const s of ao(n,e)){const i=typeof s.image=="string"?s.image:void 0;if(i?.includes("{{{"))return i}}function gl(n,e){if(!e)return;const s=so(n);if(!s)return;const i=hl(s.resolveType,e);if(!i)return;const l=Mi(i,s.data);if(l)return Di(l)}const vl={escape:Pi};function xl(n,e){for(const s of ao(n,e)){const i=typeof s.title=="string"?s.title:void 0;if(i?.includes("{{"))return i}}function yl(n,e){if(!e)return;const s=so(n);if(s)try{const i=xl(s.resolveType,e);return i&&va.render(i,s.data,{},vl).trim()||void 0}catch{return}}function bl(n){const e=ft.c(13),{icon:s,label:i,className:l}=n;let d;e[0]!==l?(d=le("size-3.5",l),e[0]=l,e[1]=d):d=e[1];let h;e[2]!==s||e[3]!==d?(h=o.jsx(s,{className:d}),e[2]=s,e[3]=d,e[4]=h):h=e[4];let u;e[5]!==i||e[6]!==h?(u=o.jsx(_t,{asChild:!0,children:o.jsx("span",{role:"img","aria-label":i,className:"shrink-0 cursor-help",children:h})}),e[5]=i,e[6]=h,e[7]=u):u=e[7];let b;e[8]!==i?(b=o.jsx(kt,{className:"max-w-56",children:i}),e[8]=i,e[9]=b):b=e[9];let g;return e[10]!==u||e[11]!==b?(g=o.jsxs(wt,{children:[u,b]}),e[10]=u,e[11]=b,e[12]=g):g=e[12],g}const Sl="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function qr(n){return Array.from({length:n},(e,s)=>({id:crypto.randomUUID(),index:s}))}function lo(n){return n.map((e,s)=>({...e,index:s}))}function jl(n,e){if(e===n.length)return n;if(e<n.length)return lo(n.slice(0,e));const s=Array.from({length:e-n.length},(i,l)=>({id:crypto.randomUUID(),index:n.length+l}));return[...n,...s]}function co(n){const e=ft.c(44),{section:s,raw:i,meta:l,decofile:d}=n,h=Dt(),u=In(),b=s.isSavedBlock===!0,g=s.isMultivariate===!0;let k;e[0]!==l||e[1]!==i?(k=i&&l?gl(i,l):void 0,e[0]=l,e[1]=i,e[2]=k):k=e[2];const E=k;let U;e[3]!==l||e[4]!==g||e[5]!==i||e[6]!==b?(U=i&&l&&!b&&!g?yl(i,l):void 0,e[3]=l,e[4]=g,e[5]=i,e[6]=b,e[7]=U):U=e[7];const X=U;let F;e[8]!==d||e[9]!==l||e[10]!==i||e[11]!==s?(F=Oi(i,s,d,l),e[8]=d,e[9]=l,e[10]=i,e[11]=s,e[12]=F):F=e[12];const L=F;let f;e[13]!==g||e[14]!==i?.__resolveType?(f=!g&&xs(i?.__resolveType??""),e[13]=g,e[14]=i?.__resolveType,e[15]=f):f=e[15];const A=f,Y=b?Pn:g?no:io;let j;e[16]!==g||e[17]!==b?(j=b?{color:ba}:g?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=g,e[17]=b,e[18]=j):j=e[18];const H=j;let V;e[19]!==Y||e[20]!==u?(V=u?o.jsxs("span",{className:"relative size-4 shrink-0",children:[o.jsx(Y,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),o.jsx(zi,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):o.jsx(ha,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=Y,e[20]=u,e[21]=V):V=e[21];let v;e[22]!==E?(v=E&&o.jsx("img",{src:E,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=E,e[23]=v):v=e[23];let C;e[24]!==u||e[25]!==H?(C=!u&&o.jsx(ds,{className:"h-4 w-4 shrink-0",style:H}),e[24]=u,e[25]=H,e[26]=C):C=e[26];const x=u?"shrink":"flex-1",re=s.isHidden&&"line-through opacity-50";let P;e[27]!==re||e[28]!==x?(P=le("min-w-0 truncate text-sm font-medium",x,re),e[27]=re,e[28]=x,e[29]=P):P=e[29];const oe=X??s.label;let de;e[30]!==P||e[31]!==oe?(de=o.jsx("span",{className:P,children:oe}),e[30]=P,e[31]=oe,e[32]=de):de=e[32];let Z;e[33]!==A||e[34]!==u||e[35]!==L||e[36]!==h?(Z=u?o.jsxs(o.Fragment,{children:[A&&o.jsx(bl,{icon:fs,label:h("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),L&&o.jsx(kr,{}),o.jsx("span",{className:"min-w-0 flex-1"})]}):L&&o.jsx(kr,{className:"absolute -right-0.5 -top-0.5"}),e[33]=A,e[34]=u,e[35]=L,e[36]=h,e[37]=Z):Z=e[37];let te;return e[38]!==de||e[39]!==Z||e[40]!==V||e[41]!==v||e[42]!==C?(te=o.jsxs(o.Fragment,{children:[V,v,C,de,Z]}),e[38]=de,e[39]=Z,e[40]=V,e[41]=v,e[42]=C,e[43]=te):te=e[43],te}const wl="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",_l="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]";function uo(n,e,s){if(s)return $i({selected:e});const i=n.isSavedBlock===!0,l=n.isMultivariate===!0;return le("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":i?wl:l?_l:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function os(n,e){return le("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":n?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function kl(n){const e=ft.c(90),{section:s,raw:i,meta:l,decofile:d,sortableId:h,selected:u,onSelect:b,onDelete:g,onDuplicate:k,onMakeReusable:E,onToggleHidden:U,onToggleLazy:X,onAddVariant:F,onDetach:L}=n,f=Dt(),A=In(),Y=i?xs(i.__resolveType??""):!1,j=s.isHidden===!0,H=Y||j;let V;e[0]!==s?(V=ro(s),e[0]=s,e[1]=V):V=e[1];const v=V;let C;e[2]!==h?(C={id:h,animateLayoutChanges:Al},e[2]=h,e[3]=C):C=e[3];const{attributes:x,listeners:re,setNodeRef:P,transform:oe,isDragging:de}=Za(C);let Z;e[4]!==oe?(Z=Ja.Transform.toString(oe?{...oe,x:0}:null),e[4]=oe,e[5]=Z):Z=e[5];const te=de?0:void 0;let S;e[6]!==Z||e[7]!==te?(S={transform:Z,opacity:te},e[6]=Z,e[7]=te,e[8]=S):S=e[8];const W=S;let je;e[9]!==s?(je=Ii(s),e[9]=s,e[10]=je):je=e[10];const K=je,He="button",G=0;let Ee;e[11]!==b?(Ee=ee=>{(ee.key==="Enter"||ee.key===" ")&&(ee.preventDefault(),b())},e[11]=b,e[12]=Ee):Ee=e[12];const xe=de?"cursor-grabbing":"cursor-pointer";let Re;e[13]!==A||e[14]!==s||e[15]!==u||e[16]!==xe?(Re=le("touch-none transition-colors",xe,uo(s,u,A)),e[13]=A,e[14]=s,e[15]=u,e[16]=xe,e[17]=Re):Re=e[17];let Be;e[18]!==d||e[19]!==l||e[20]!==i||e[21]!==s?(Be=o.jsx(co,{section:s,raw:i,meta:l,decofile:d}),e[18]=d,e[19]=l,e[20]=i,e[21]=s,e[22]=Be):Be=e[22];const we=!A&&!s.isMultivariate&&o.jsxs(wt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(xt,{type:"button",variant:"ghost",size:"icon","aria-label":f(Y?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:le(os(H,Y)),onClick:ee=>{ee.stopPropagation(),X()},onPointerDown:Rl,children:o.jsx(fs,{className:le("h-3.5 w-3.5",Y&&"text-warning")})})}),o.jsx(kt,{side:"bottom",children:f(Y?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),ie=A?o.jsx(Bi,{label:f(j?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:j,onToggle:U,children:j?o.jsx(Lr,{className:"h-3.5 w-3.5"}):o.jsx(Or,{className:"h-3.5 w-3.5"})}):o.jsxs(wt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(xt,{type:"button",variant:"ghost",size:"icon","aria-label":f(j?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:le(os(H,j)),onClick:ee=>{ee.stopPropagation(),U()},onPointerDown:El,children:j?o.jsx(Lr,{className:"h-3.5 w-3.5"}):o.jsx(Or,{className:"h-3.5 w-3.5"})})}),o.jsx(kt,{side:"bottom",children:f(j?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),B=Ei,O=Fi;let I;e[23]!==f?(I=f("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=f,e[24]=I):I=e[24];const D=le(os(H,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let Ce;e[25]!==O||e[26]!==I||e[27]!==D?(Ce=o.jsx(O,{label:I,classicClassName:D}),e[25]=O,e[26]=I,e[27]=D,e[28]=Ce):Ce=e[28];let Ye;e[29]!==A||e[30]!==Y||e[31]!==X||e[32]!==s.isMultivariate||e[33]!==f?(Ye=A&&!s.isMultivariate&&o.jsxs(o.Fragment,{children:[o.jsxs(Qt,{onClick:ee=>{ee.stopPropagation(),X()},children:[o.jsx(fs,{className:"h-4 w-4"}),f(Y?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),o.jsx(ki,{})]}),e[29]=A,e[30]=Y,e[31]=X,e[32]=s.isMultivariate,e[33]=f,e[34]=Ye):Ye=e[34];let Je;e[35]!==k?(Je=ee=>{ee.stopPropagation(),k()},e[35]=k,e[36]=Je):Je=e[36];let tt;e[37]===Symbol.for("react.memo_cache_sentinel")?(tt=o.jsx(za,{className:"h-4 w-4"}),e[37]=tt):tt=e[37];let ne;e[38]!==f?(ne=f("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=f,e[39]=ne):ne=e[39];let ye;e[40]!==Je||e[41]!==ne?(ye=o.jsxs(Qt,{onClick:Je,children:[tt,ne]}),e[40]=Je,e[41]=ne,e[42]=ye):ye=e[42];let Fe;e[43]!==A||e[44]!==v||e[45]!==F||e[46]!==f?(Fe=v&&o.jsxs(Qt,{className:le(!A&&Li),onClick:ee=>{ee.stopPropagation(),F()},children:[o.jsx(no,{className:"h-4 w-4"}),f("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=A,e[44]=v,e[45]=F,e[46]=f,e[47]=Fe):Fe=e[47];let Te;e[48]!==A||e[49]!==K||e[50]!==E||e[51]!==f?(Te=K&&o.jsxs(Qt,{className:le(!A&&Sl),onClick:ee=>{ee.stopPropagation(),E()},children:[A?o.jsx(Pn,{className:"h-4 w-4"}):o.jsx(ds,{className:"h-4 w-4"}),f("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=A,e[49]=K,e[50]=E,e[51]=f,e[52]=Te):Te=e[52];let fe;e[53]!==A||e[54]!==L||e[55]!==s.isMultivariate||e[56]!==s.isSavedBlock||e[57]!==f?(fe=s.isSavedBlock===!0&&!s.isMultivariate&&o.jsxs(Qt,{onClick:ee=>{ee.stopPropagation(),L()},children:[A?o.jsx(io,{className:"h-4 w-4"}):o.jsx(ds,{className:"h-4 w-4"}),f("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=A,e[54]=L,e[55]=s.isMultivariate,e[56]=s.isSavedBlock,e[57]=f,e[58]=fe):fe=e[58];let Ve;e[59]!==g?(Ve=ee=>{ee.stopPropagation(),g()},e[59]=g,e[60]=Ve):Ve=e[60];let Pe;e[61]===Symbol.for("react.memo_cache_sentinel")?(Pe=o.jsx(Wa,{className:"h-4 w-4"}),e[61]=Pe):Pe=e[61];let Qe;e[62]!==f?(Qe=f("sectionsEditor.sectionList.deleteMenuItem"),e[62]=f,e[63]=Qe):Qe=e[63];let Ae;e[64]!==Ve||e[65]!==Qe?(Ae=o.jsxs(Qt,{variant:"destructive",onClick:Ve,children:[Pe,Qe]}),e[64]=Ve,e[65]=Qe,e[66]=Ae):Ae=e[66];let We;e[67]!==Ye||e[68]!==ye||e[69]!==Fe||e[70]!==Te||e[71]!==fe||e[72]!==Ae?(We=o.jsxs(Ri,{align:"end",className:"w-44",children:[Ye,ye,Fe,Te,fe,Ae]}),e[67]=Ye,e[68]=ye,e[69]=Fe,e[70]=Te,e[71]=fe,e[72]=Ae,e[73]=We):We=e[73];let Le;e[74]!==B||e[75]!==Ce||e[76]!==We?(Le=o.jsxs(B,{children:[Ce,We]}),e[74]=B,e[75]=Ce,e[76]=We,e[77]=Le):Le=e[77];let Ge;return e[78]!==x||e[79]!==re||e[80]!==b||e[81]!==P||e[82]!==W||e[83]!==Re||e[84]!==Be||e[85]!==we||e[86]!==ie||e[87]!==Le||e[88]!==Ee?(Ge=o.jsxs("div",{ref:P,style:W,...x,...re,role:He,tabIndex:G,onClick:b,onKeyDown:Ee,className:Re,children:[Be,we,ie,Le]}),e[78]=x,e[79]=re,e[80]=b,e[81]=P,e[82]=W,e[83]=Re,e[84]=Be,e[85]=we,e[86]=ie,e[87]=Le,e[88]=Ee,e[89]=Ge):Ge=e[89],Ge}function El(n){return n.stopPropagation()}function Rl(n){return n.stopPropagation()}function Al(){return!1}function ms(n){const e=ft.c(11),{canAddSection:s,onAddSection:i,className:l,size:d}=n,h=Dt();let u;e[0]!==l?(u=le("w-full",l),e[0]=l,e[1]=u):u=e[1];const b=!s;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(Ha,{size:14}),e[2]=g):g=e[2];let k;e[3]!==h?(k=h("sectionsEditor.sectionList.addSectionButton"),e[3]=h,e[4]=k):k=e[4];let E;return e[5]!==i||e[6]!==d||e[7]!==u||e[8]!==b||e[9]!==k?(E=o.jsxs(xt,{type:"button",variant:"outline",size:d,className:u,disabled:b,onClick:i,children:[g,k]}),e[5]=i,e[6]=d,e[7]=u,e[8]=b,e[9]=k,e[10]=E):E=e[10],E}function Nl(n){const e=ft.c(101),{listKey:s,rawSections:i,sections:l,meta:d,decofile:h,selectedIndex:u,onSelect:b,onReorder:g,onDelete:k,onDuplicate:E,onMakeReusable:U,onToggleHidden:X,onToggleLazy:F,onAddVariant:L,onDetach:f,onAddSection:A,canAddSection:Y}=n,j=Y===void 0?!0:Y,H=Dt(),V=In();let v;e[0]!==l.length?(v=()=>qr(l.length),e[0]=l.length,e[1]=v):v=e[1];const[C,x]=w.useState(v),[re,P]=w.useState(null),[oe,de]=w.useState(s),[Z,te]=w.useState(l.length),S=w.useRef(!1);oe!==s?(de(s),te(l.length),x(qr(l.length))):Z!==l.length&&(te(l.length),x(nt=>jl(nt,l.length)));let W;e[2]===Symbol.for("react.memo_cache_sentinel")?(W={activationConstraint:{distance:8}},e[2]=W):W=e[2];let je;e[3]===Symbol.for("react.memo_cache_sentinel")?(je={coordinateGetter:el},e[3]=je):je=e[3];const K=Ga($r(Ua,W),$r(qa,je));let He;e[4]!==C?(He=C.map(Cl),e[4]=C,e[5]=He):He=e[5];const G=He;let Ee;e[6]===Symbol.for("react.memo_cache_sentinel")?(Ee=nt=>{P(String(nt.active.id))},e[6]=Ee):Ee=e[6];const xe=Ee;let Re;e[7]!==G||e[8]!==g?(Re=nt=>{P(null);const{active:se,over:pe}=nt;if(!pe||se.id===pe.id)return;const rt=G.indexOf(String(se.id)),ce=G.indexOf(String(pe.id));rt===-1||ce===-1||(x(it=>lo(Mn([...it],rt,ce))),S.current=!0,requestAnimationFrame(()=>{S.current=!1}),g?.(rt,ce))},e[7]=G,e[8]=g,e[9]=Re):Re=e[9];const Be=Re;let we;e[10]===Symbol.for("react.memo_cache_sentinel")?(we=()=>{P(null)},e[10]=we):we=e[10];const ie=we;let B,O,I,D,Ce,Ye,Je,tt,ne,ye,Fe,Te,fe,Ve,Pe;if(e[11]!==re||e[12]!==j||e[13]!==V||e[14]!==h||e[15]!==C||e[16]!==G||e[17]!==Be||e[18]!==d||e[19]!==A||e[20]!==L||e[21]!==k||e[22]!==f||e[23]!==E||e[24]!==U||e[25]!==b||e[26]!==X||e[27]!==F||e[28]!==i||e[29]!==l||e[30]!==u||e[31]!==K||e[32]!==H){Ve=Symbol.for("react.early_return_sentinel");e:{const nt=se=>{S.current||b(se)};if(e[48]!==re||e[49]!==j||e[50]!==V||e[51]!==C||e[52]!==A||e[53]!==i||e[54]!==l||e[55]!==H){const se=re?C.find(pe=>pe.id===re):null;if(D=se!=null?l[se.index]:null,I=se!=null?i[se.index]:void 0,C.length===0){let pe;e[59]!==H?(pe=H("sectionsEditor.sectionList.noSections"),e[59]=H,e[60]=pe):pe=e[60];let rt;e[61]!==pe?(rt=o.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:pe}),e[61]=pe,e[62]=rt):rt=e[62];const ce=rt;let it;e[63]!==j||e[64]!==V||e[65]!==ce||e[66]!==A?(it=V?ce:o.jsxs("div",{className:"space-y-2",children:[ce,o.jsx(ms,{canAddSection:j,onAddSection:A,size:"sm"})]}),e[63]=j,e[64]=V,e[65]=ce,e[66]=A,e[67]=it):it=e[67],Ve=it;break e}fe=le(se&&"cursor-grabbing"),e[48]=re,e[49]=j,e[50]=V,e[51]=C,e[52]=A,e[53]=i,e[54]=l,e[55]=H,e[56]=I,e[57]=D,e[58]=fe}else I=e[56],D=e[57],fe=e[58];O=Qa,tt=K,ne=Xa,ye=xe,Fe=Be,Te=ie,B=tl,Ye=G,Je=nl,Pe="space-y-1",Ce=C.map(se=>{const pe=l[se.index];return pe?o.jsx(kl,{sortableId:se.id,section:pe,raw:i[se.index],meta:d,decofile:h,selected:u===se.index,onSelect:()=>nt(se.index),onDelete:()=>k(se.index),onDuplicate:()=>E(se.index),onMakeReusable:()=>U(se.index),onToggleHidden:()=>X(se.index),onToggleLazy:()=>F(se.index),onAddVariant:()=>L(se.index),onDetach:()=>f(se.index)},se.id):null})}e[11]=re,e[12]=j,e[13]=V,e[14]=h,e[15]=C,e[16]=G,e[17]=Be,e[18]=d,e[19]=A,e[20]=L,e[21]=k,e[22]=f,e[23]=E,e[24]=U,e[25]=b,e[26]=X,e[27]=F,e[28]=i,e[29]=l,e[30]=u,e[31]=K,e[32]=H,e[33]=B,e[34]=O,e[35]=I,e[36]=D,e[37]=Ce,e[38]=Ye,e[39]=Je,e[40]=tt,e[41]=ne,e[42]=ye,e[43]=Fe,e[44]=Te,e[45]=fe,e[46]=Ve,e[47]=Pe}else B=e[33],O=e[34],I=e[35],D=e[36],Ce=e[37],Ye=e[38],Je=e[39],tt=e[40],ne=e[41],ye=e[42],Fe=e[43],Te=e[44],fe=e[45],Ve=e[46],Pe=e[47];if(Ve!==Symbol.for("react.early_return_sentinel"))return Ve;let Qe;e[68]!==Ce||e[69]!==Pe?(Qe=o.jsx("div",{className:Pe,children:Ce}),e[68]=Ce,e[69]=Pe,e[70]=Qe):Qe=e[70];let Ae;e[71]!==B||e[72]!==Ye||e[73]!==Je||e[74]!==Qe?(Ae=o.jsx(B,{items:Ye,strategy:Je,children:Qe}),e[71]=B,e[72]=Ye,e[73]=Je,e[74]=Qe,e[75]=Ae):Ae=e[75];let We;e[76]!==I||e[77]!==D||e[78]!==V||e[79]!==h||e[80]!==d?(We=D?o.jsx("div",{className:le("cursor-grabbing shadow-lg ring-1 ring-border/60",uo(D,!1,V)),children:o.jsx(co,{section:D,raw:I,meta:d,decofile:h})}):null,e[76]=I,e[77]=D,e[78]=V,e[79]=h,e[80]=d,e[81]=We):We=e[81];let Le;e[82]!==We?(Le=_i.createPortal(o.jsx(Ya,{dropAnimation:Ki,children:We}),document.body),e[82]=We,e[83]=Le):Le=e[83];let Ge;e[84]!==O||e[85]!==tt||e[86]!==ne||e[87]!==ye||e[88]!==Fe||e[89]!==Te||e[90]!==Ae||e[91]!==Le?(Ge=o.jsxs(O,{sensors:tt,collisionDetection:ne,onDragStart:ye,onDragEnd:Fe,onDragCancel:Te,children:[Ae,Le]}),e[84]=O,e[85]=tt,e[86]=ne,e[87]=ye,e[88]=Fe,e[89]=Te,e[90]=Ae,e[91]=Le,e[92]=Ge):Ge=e[92];let ee;e[93]!==j||e[94]!==V||e[95]!==A?(ee=!V&&o.jsx(ms,{canAddSection:j,onAddSection:A,size:"sm",className:"mt-2"}),e[93]=j,e[94]=V,e[95]=A,e[96]=ee):ee=e[96];let zt;return e[97]!==fe||e[98]!==Ge||e[99]!==ee?(zt=o.jsxs("div",{className:fe,children:[Ge,ee]}),e[97]=fe,e[98]=Ge,e[99]=ee,e[100]=zt):zt=e[100],zt}function Cl(n){return n.id}function is(n,e,s,i){if(!n||!e)return null;if(!e.isMultivariate)return jt(n,e,i)?.data??null;const l=pt(n,e),d=l?ls(l,vt)[s]:void 0;return d?oo(d.value,i)?.data??null:null}const Tl=50;function Vl(n,e){n.own.push(ze(e)),n.own.length>Tl&&n.own.shift()}function Ur(n,e){return n.own.includes(ze(e))}function Ml(n,e){const{sectionIndex:s,variantIndex:i,shown:l,next:d,sectionCount:h}=e;return n&&n.sectionIndex===s&&n.variantIndex===i&&n.emitted===l?(n.emitted=d,n):l?{sectionIndex:s,variantIndex:i,base:l,emitted:d,sectionCount:h,own:[ze(l)]}:null}function fo(n,e){return e!==null&&ze(n)!==ze(e)}function mo(n,e){return n.__resolveType!==e.__resolveType}function Dl(n,e,s,i){if(e.length===i)return"here";const l=ze(n),d=e.flatMap((h,u)=>u!==s&&h!==null&&ze(h)===l?[u]:[]);return d.length===1?d[0]:"unknown"}function Pl({merged:n,tracked:e,current:s,saved:i}){return!!n&&!!e&&s===e&&e.emitted===i}function Kl(n,e){return!!n&&!!e&&n.contains(e)}function ps(n){const e=[],s=hs("",n.ancestor,n.mine,n.theirs,e);return{...n,merged:s,pointers:e}}function hs(n,e,s,i,l){const d=(h,u)=>ze(h)===ze(u);if(d(s,i)||d(e,i))return s;if(d(e,s))return i;if(as(s)&&as(i)){const h=as(e)?e:{},u={},b=[...Object.keys(s),...Object.keys(i).filter(g=>!(g in s))];for(const g of b){const k=hs(`${n}/${g.replaceAll("~","~0").replaceAll("/","~1")}`,h[g],s[g],i[g],l);k!==void 0&&(u[g]=k)}return u}return Array.isArray(e)&&Array.isArray(s)&&Array.isArray(i)&&s.length===e.length&&i.length===e.length?e.map((h,u)=>hs(`${n}/${u}`,h,s[u],i[u],l)):(l.push(n),i)}function as(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function Il(n,e){let s=n.merged;for(const i of n.pointers)e[i]==="mine"&&(s=Ol(s,i,$t(n.mine,i)));return s}function Bl(n,e){return Object.fromEntries(n.pointers.map(s=>[s,e]))}function po(n){return Bl(n,"mine")}function gs(n,e,s){const i=po(s);for(const l of s.pointers){const d=e[l];if(!d||!n.pointers.includes(l))continue;["mine","theirs"].every(u=>ze($t(n[u],l))===ze($t(s[u],l)))&&(i[l]=d)}return i}function ho(n,e,s={}){const i=e.pointers.filter(l=>!n.pointers.includes(l)||ze($t(n.theirs,l))!==ze($t(e.theirs,l)));return i.length===0?s:{...s,...Object.fromEntries(i.map(l=>[l,(s[l]??0)+1]))}}function Fl(n,e,s){if(!e||mo(n.plan.ancestor,e)||!fo(n.plan.theirs,e)||s(e))return null;const i=ps({...n.plan,theirs:e});return i.pointers.length===0?null:{plan:i,choices:gs(n.plan,n.choices,i),fresh:ho(n.plan,i,n.fresh)}}function Ll(n,e){return n.pointers.map(s=>({pointer:s,label:Hi(s,e),mine:$t(n.mine,s),theirs:$t(n.theirs,s),schema:$l(e??null,s)}))}function ys(n){return n.split("/").slice(1).map(e=>e.replaceAll("~1","/").replaceAll("~0","~"))}function $t(n,e){let s=n;for(const i of ys(e))if(Array.isArray(s))s=s[Number(i)];else if(s&&typeof s=="object")s=s[i];else return;return s}function Ol(n,e,s){const i=ys(e),l=(d,h)=>{if(h===i.length)return s;const u=i[h];if(Array.isArray(d)){const k=[...d];return k[Number(u)]=l(d[Number(u)],h+1),k}const b=d&&typeof d=="object"?{...d}:{},g=l(b[u],h+1);return g===void 0?delete b[u]:b[u]=g,b};return l(n,0)}function $l(n,e){let s=n;for(const i of ys(e)){if(!s)return null;s=/^\d+$/.test(i)&&!s.properties?.[i]?s.items:s.properties?.[i]}return s??null}const zl=/\.(png|jpe?g|gif|webp|avif|svg)(\?.*)?$/i,Yr=60,Hl=3;function go(n,e){return e?.format==="image-uri"?!0:n.startsWith("data:image/")||/^(https?:)?\/\//.test(n)&&zl.test(n)}function vs(n,e){if(!(e?.format==="rich-text"||e?.format==="rich-text-inline"||e?.format==="html"||/<\/?[a-z][^>]*>/i.test(n)))return n;const i=n.replace(/<br\s*\/?>/gi,`
|
|
2
|
+
`).replace(/<\/(p|div|li|h[1-6])>/gi,`
|
|
3
|
+
`);return Gl(i).replace(/\u00a0/g," ").replace(/\n{2,}/g,`
|
|
4
|
+
`).trim()}const Wl={" ":" ","&":"&","<":"<",">":">",""":'"',"'":"'"};function Gl(n){if(typeof DOMParser<"u")return new DOMParser().parseFromString(n,"text/html").body.textContent??"";let e=n;for(let s="";s!==e;)s=e,e=e.replace(/<[^<>]*>/g,"");return e.replace(/<|>/g,"").replace(/&(nbsp|amp|lt|gt|quot|#39);/g,s=>Wl[s]??s)}function Dn(n){const e=n.replace(/\s+/g," ").trim();return e.length>Yr?`${e.slice(0,Yr-1)}…`:e}function ql(n){if(n.startsWith("data:"))return"image";const e=n.split(/[?#]/)[0]??n;return decodeURIComponent(e.split("/").pop()||n)}function Kn(n,e){if(n==null||n==="")return{kind:"empty"};if(typeof n=="string")return go(n,e)?{kind:"image",src:n}:{kind:"text",text:vs(n,e)};if(typeof n=="number"||typeof n=="bigint")return{kind:"text",text:String(n)};if(typeof n=="boolean")return{kind:"yesNo",value:n};if(Array.isArray(n)){const s=e?.items??null;return{kind:"list",count:n.length,items:n.slice(0,Hl).map(i=>Ul(i,s)??"")}}if(typeof n=="object"){const s=n;if("value"in s&&Object.keys(s).length<=2)return Kn(s.value,e?.properties?.value??e);const i=Object.entries(s).filter(([l,d])=>!l.startsWith("__")&&d!==void 0).flatMap(([l,d])=>{const h=e?.properties?.[l]??null,u=Kn(d,h);if(u.kind==="empty")return[];const b=u.kind==="text"?Dn(u.text):u.kind==="image"?ql(u.src):u.kind==="yesNo"?u.value?"✓":"✗":u.kind==="list"?`${u.count}`:"…";return[{label:h?.title?.trim()||l,text:b}]}).slice(0,4);return i.length>0?{kind:"fields",entries:i}:{kind:"empty"}}return{kind:"text",text:String(n)}}function Ul(n,e){if(typeof n=="string")return Dn(vs(n,e));if(!n||typeof n!="object"||Array.isArray(n))return null;const s=n,i=e?.titleBy,l=i?s[i]:void 0;if(typeof l=="string"&&l.trim())return Dn(l);for(const[d,h]of Object.entries(s))if(!(d.startsWith("__")||typeof h!="string"||!h.trim())&&!go(h,e?.properties?.[d]??null))return Dn(vs(h,null));return null}const Jr=1500;function Yl(n,e){const s=n.split(/(\s+)/).filter(k=>k!==""),i=e.split(/(\s+)/).filter(k=>k!=="");if(s.length>Jr||i.length>Jr)return{mine:[{text:n,kind:"changed"}],theirs:[{text:e,kind:"changed"}]};const l=Array.from({length:s.length+1},()=>new Array(i.length+1).fill(0));for(let k=s.length-1;k>=0;k--)for(let E=i.length-1;E>=0;E--){const U=l[k];U[E]=s[k]===i[E]?l[k+1][E+1]+1:Math.max(l[k+1][E],U[E+1])}const d=[],h=[],u=(k,E,U)=>{const X=k.at(-1);X&&(X.kind===U||U==="same"&&!E.trim())?X.text+=E:k.push({text:E,kind:U})};let b=0,g=0;for(;b<s.length&&g<i.length;)s[b]===i[g]?(u(d,s[b],"same"),u(h,i[g],"same"),b++,g++):l[b+1][g]>=l[b][g+1]?(u(d,s[b],"changed"),b++):(u(h,i[g],"changed"),g++);for(;b<s.length;b++)u(d,s[b],"changed");for(;g<i.length;g++)u(h,i[g],"changed");return{mine:d,theirs:h}}function Jl(n){const e=ft.c(10);let s,i;e[0]!==n?({open:s,...i}=n,e[0]=n,e[1]=s,e[2]=i):(s=e[1],i=e[2]);const{data:l}=Ai.useSession();let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=le("max-h-[85vh] grid-rows-[auto_minmax(0,1fr)_auto] sm:max-w-lg"),e[3]=d):d=e[3];const h=l?.user??null;let u;e[4]!==i||e[5]!==h?(u=o.jsx(sl,{className:d,"data-testid":"form-conflict-dialog",onEscapeKeyDown:Zl,onOpenAutoFocus:Xl,children:o.jsx(oc,{...i,viewer:h,heading:Ql})}),e[4]=i,e[5]=h,e[6]=u):u=e[6];let b;return e[7]!==s||e[8]!==u?(b=o.jsx(al,{open:s,children:u}),e[7]=s,e[8]=u,e[9]=b):b=e[9],b}function Ql(n,e){return o.jsxs(rl,{className:"text-left",children:[o.jsx(ol,{children:n}),o.jsx(il,{children:e})]})}function Xl(n){n.preventDefault(),n.currentTarget?.focus()}function Zl(n){return n.preventDefault()}const ec={},tc=(n,e)=>o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"text-lg font-semibold",children:n}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e})]});function nc(n,e,s=0,i={}){const l=e[Math.min(s,e.length-1)],d={field:l?rc(l.label):"",label:l?.label??""};return e.length<=1?{title:n("sectionsEditor.formConflict.titleOne",d),description:n("sectionsEditor.formConflict.descriptionOne")}:{title:n("sectionsEditor.formConflict.titleStep",d),description:s>=e.length-1?o.jsx(sc,{t:n,fields:e,choices:i}):n("sectionsEditor.formConflict.descriptionStep")}}function sc(n){const e=ft.c(9),{t:s,fields:i,choices:l}=n;let d;if(e[0]!==l||e[1]!==i||e[2]!==s){let u;e[4]!==l||e[5]!==s?(u=(b,g)=>o.jsxs(w.Fragment,{children:[g>0&&" · ",`${b.label}: `,o.jsx("span",{className:"font-medium text-foreground",children:s((l[b.pointer]??"mine")==="mine"?"sectionsEditor.formConflict.summaryYours":"sectionsEditor.formConflict.summaryTheirs")})]},b.pointer),e[4]=l,e[5]=s,e[6]=u):u=e[6],d=i.map(u),e[0]=l,e[1]=i,e[2]=s,e[3]=d}else d=e[3];let h;return e[7]!==d?(h=o.jsx("span",{"data-testid":"form-conflict-summary",children:d}),e[7]=d,e[8]=h):h=e[8],h}function rc(n){return/^[A-Z][a-z]/.test(n)&&!n.includes("›")?n.charAt(0).toLowerCase()+n.slice(1):n}function oc(n){const e=ft.c(68),s=Dt(),{fields:i,choices:l,changedAgain:d,fresh:h,heading:u}=n,b=d===void 0?!1:d,g=h===void 0?ec:h,k=u===void 0?tc:u,E=i.length>1,[U,X]=w.useState(0),[F,L]=w.useState(ic);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={},e[0]=f):f=e[0];const[A,Y]=w.useState(f),j=Math.max(0,Math.min(U,i.length-1)),H=i[j],V=j===i.length-1;let v;e[1]!==j||e[2]!==i||e[3]!==g?(v=we=>{const ie=i[j],B=i[we];!ie||!B||we===j||(L(O=>new Set(O).add(ie.pointer)),Y(O=>({...O,[ie.pointer]:g[ie.pointer]??0,[B.pointer]:g[B.pointer]??0})),X(we))},e[1]=j,e[2]=i,e[3]=g,e[4]=v):v=e[4];const C=v;let x;e[5]!==j||e[6]!==C?(x=we=>{if(!we)return;const ie=B=>{const O={ArrowLeft:-1,ArrowRight:1}[B.key];!O||B.defaultPrevented||B.altKey||B.ctrlKey||B.metaKey||B.shiftKey||ll(B.target)||(B.preventDefault(),C(j+O))};return we.ownerDocument.addEventListener("keydown",ie),()=>we.ownerDocument.removeEventListener("keydown",ie)},e[5]=j,e[6]=C,e[7]=x):x=e[7];const re=x;if(!H)return null;let P,oe,de,Z,te;if(e[8]!==F||e[9]!==j||e[10]!==l||e[11]!==i||e[12]!==g||e[13]!==C||e[14]!==k||e[15]!==re||e[16]!==E||e[17]!==n||e[18]!==A||e[19]!==s){const{title:we,description:ie}=nc(s,i,j,l);let B;e[25]!==n?(B=O=>{O.detail>1||n.onApply()},e[25]=n,e[26]=B):B=e[26],P=B,oe=E?re:void 0,de="flex min-w-0 flex-col gap-3",e[27]!==F||e[28]!==j||e[29]!==i||e[30]!==g||e[31]!==C||e[32]!==E||e[33]!==A||e[34]!==s?(Z=E&&o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx("div",{role:"group","aria-label":s("sectionsEditor.formConflict.steps"),className:"-m-1 flex flex-wrap items-center",children:i.map((O,I)=>{const D=I!==j&&(g[O.pointer]??0)>(A[O.pointer]??0);return o.jsx("button",{type:"button","aria-label":D?s("sectionsEditor.formConflict.stepChangedAgain",{label:O.label}):O.label,"aria-current":I===j?"step":void 0,"data-answered":I!==j&&F.has(O.pointer)?"":void 0,"data-changed-again":D?"":void 0,onClick:()=>C(I),className:"group cursor-pointer rounded-full p-1 outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:o.jsx("span",{className:le("block h-2 w-2 rounded-full bg-border transition-[width,background-color,box-shadow] motion-reduce:transition-none","group-hover:bg-muted-foreground/60","group-data-[answered]:bg-foreground/45","group-aria-[current=step]:w-5 group-aria-[current=step]:bg-foreground","group-data-[changed-again]:ring-2 group-data-[changed-again]:ring-warning group-data-[changed-again]:ring-offset-1 group-data-[changed-again]:ring-offset-background")})},O.pointer)})}),o.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:s("sectionsEditor.formConflict.stepCount",{step:String(j+1),count:String(i.length)})})]}),e[27]=F,e[28]=j,e[29]=i,e[30]=g,e[31]=C,e[32]=E,e[33]=A,e[34]=s,e[35]=Z):Z=e[35],te=k(we,ie),e[8]=F,e[9]=j,e[10]=l,e[11]=i,e[12]=g,e[13]=C,e[14]=k,e[15]=re,e[16]=E,e[17]=n,e[18]=A,e[19]=s,e[20]=P,e[21]=oe,e[22]=de,e[23]=Z,e[24]=te}else P=e[20],oe=e[21],de=e[22],Z=e[23],te=e[24];let S;e[36]!==oe||e[37]!==de||e[38]!==Z||e[39]!==te?(S=o.jsxs("div",{ref:oe,className:de,children:[Z,te]}),e[36]=oe,e[37]=de,e[38]=Z,e[39]=te,e[40]=S):S=e[40];const W=!b&&"sr-only";let je;e[41]!==W?(je=le("text-sm text-muted-foreground",W),e[41]=W,e[42]=je):je=e[42];let K;e[43]!==b||e[44]!==E||e[45]!==s?(K=b?s(E?"sectionsEditor.formConflict.changedAgainSteps":"sectionsEditor.formConflict.changedAgain"):"",e[43]=b,e[44]=E,e[45]=s,e[46]=K):K=e[46];let He;e[47]!==je||e[48]!==K?(He=o.jsx("p",{role:"status",className:je,children:K}),e[47]=je,e[48]=K,e[49]=He):He=e[49];const G=E?"vertical":"all";let Ee;e[50]!==H||e[51]!==n||e[52]!==G?(Ee=o.jsx(uc,{field:H,...n,arrows:G}),e[50]=H,e[51]=n,e[52]=G,e[53]=Ee):Ee=e[53];let xe;e[54]!==He||e[55]!==Ee?(xe=o.jsxs("div",{className:"-mx-2 flex min-h-0 flex-col gap-3 overflow-y-auto px-2 py-1",children:[He,Ee]}),e[54]=He,e[55]=Ee,e[56]=xe):xe=e[56];let Re;e[57]!==P||e[58]!==j||e[59]!==C||e[60]!==V||e[61]!==E||e[62]!==s?(Re=E?o.jsxs(Hr,{className:"flex-row flex-wrap items-center justify-between gap-2 sm:justify-between",children:[o.jsx(xt,{type:"button",variant:"outline","aria-disabled":j===0,onClick:()=>C(j-1),className:"aria-disabled:cursor-default aria-disabled:opacity-45",children:s("sectionsEditor.formConflict.back")}),o.jsx(xt,{type:"button","data-testid":"form-conflict-primary",onClick:V?P:()=>C(j+1),children:s(V?"sectionsEditor.formConflict.ok":"sectionsEditor.formConflict.next")})]}):o.jsx(Hr,{className:"items-center gap-2",children:o.jsx(xt,{type:"button","data-testid":"form-conflict-primary",onClick:P,children:s("sectionsEditor.formConflict.ok")})}),e[57]=P,e[58]=j,e[59]=C,e[60]=V,e[61]=E,e[62]=s,e[63]=Re):Re=e[63];let Be;return e[64]!==S||e[65]!==xe||e[66]!==Re?(Be=o.jsxs(o.Fragment,{children:[S,xe,Re]}),e[64]=S,e[65]=xe,e[66]=Re,e[67]=Be):Be=e[67],Be}function ic(){return new Set}function ac(n){const e=Kn(n.mine,n.schema),s=Kn(n.theirs,n.schema),i=e.kind==="text"&&s.kind==="text"?Yl(e.text,s.text):null;return l=>i?o.jsx(fc,{parts:i[l]}):o.jsx(pc,{preview:l==="mine"?e:s})}const lc={all:{ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1},vertical:{ArrowDown:1,ArrowUp:-1}};function cc(n,e){const s=lc[e][n.key];if(!s)return;const i=[...n.currentTarget.querySelectorAll('[role="radio"]')],l=i.indexOf(document.activeElement);if(l<0)return;n.preventDefault();const d=i[(l+s+i.length)%i.length];d?.focus(),d?.click()}function uc(n){const e=ft.c(59),{field:s,choices:i,viewer:l,onChoose:d,arrows:h}=n,u=Dt();let b,g,k,E,U,X,F,L,f,A,Y,j,H;if(e[0]!==h||e[1]!==i||e[2]!==s||e[3]!==d||e[4]!==u||e[5]!==l?.image||e[6]!==l?.name){const C=ac(s),x=i[s.pointer]??"mine";j="radiogroup",H=s.label,k="flex flex-col gap-2",e[20]!==h?(E=S=>cc(S,h),e[20]=h,e[21]=E):E=e[21];let re;e[22]!==s.pointer||e[23]!==d?(re=()=>d(s.pointer,"mine"),e[22]=s.pointer,e[23]=d,e[24]=re):re=e[24];const P=l?.image??void 0;let oe;e[25]!==u||e[26]!==l?.name?(oe=dc(l?.name)||u("sectionsEditor.formConflict.you"),e[25]=u,e[26]=l?.name,e[27]=oe):oe=e[27];let de;e[28]!==P||e[29]!==oe?(de=o.jsx(zr,{url:P,fallback:oe,shape:"circle",size:"sm",className:"text-xs"}),e[28]=P,e[29]=oe,e[30]=de):de=e[30];let Z;e[31]!==u?(Z=u("sectionsEditor.formConflict.you"),e[31]=u,e[32]=Z):Z=e[32];let te;e[33]!==u?(te=u("sectionsEditor.formConflict.yourVersionNotSaved"),e[33]=u,e[34]=te):te=e[34],U=o.jsx(Qr,{side:"mine",checked:x==="mine",onChoose:re,avatar:de,who:Z,meta:te,children:C("mine")}),b=Qr,g="theirs",X=x==="theirs",e[35]!==s.pointer||e[36]!==d?(F=()=>d(s.pointer,"theirs"),e[35]=s.pointer,e[36]=d,e[37]=F):F=e[37],e[38]===Symbol.for("react.memo_cache_sentinel")?(L=o.jsx(zr,{url:"icon://user",fallback:"",muted:!0,shape:"circle",size:"sm"}),e[38]=L):L=e[38],e[39]!==u?(f=u("sectionsEditor.formConflict.someoneElse"),e[39]=u,e[40]=f):f=e[40],e[41]!==u?(A=u("sectionsEditor.formConflict.theirVersionSaved"),e[41]=u,e[42]=A):A=e[42],Y=C("theirs"),e[0]=h,e[1]=i,e[2]=s,e[3]=d,e[4]=u,e[5]=l?.image,e[6]=l?.name,e[7]=b,e[8]=g,e[9]=k,e[10]=E,e[11]=U,e[12]=X,e[13]=F,e[14]=L,e[15]=f,e[16]=A,e[17]=Y,e[18]=j,e[19]=H}else b=e[7],g=e[8],k=e[9],E=e[10],U=e[11],X=e[12],F=e[13],L=e[14],f=e[15],A=e[16],Y=e[17],j=e[18],H=e[19];let V;e[43]!==b||e[44]!==g||e[45]!==X||e[46]!==F||e[47]!==L||e[48]!==f||e[49]!==A||e[50]!==Y?(V=o.jsx(b,{side:g,checked:X,onChoose:F,avatar:L,who:f,meta:A,children:Y}),e[43]=b,e[44]=g,e[45]=X,e[46]=F,e[47]=L,e[48]=f,e[49]=A,e[50]=Y,e[51]=V):V=e[51];let v;return e[52]!==k||e[53]!==E||e[54]!==U||e[55]!==V||e[56]!==j||e[57]!==H?(v=o.jsxs("div",{role:j,"aria-label":H,className:k,onKeyDown:E,children:[U,V]}),e[52]=k,e[53]=E,e[54]=U,e[55]=V,e[56]=j,e[57]=H,e[58]=v):v=e[58],v}function dc(n){return(n??"").trim().split(/\s+/).filter(Boolean).slice(0,2).map(e=>e.charAt(0).toUpperCase()).join("")}function Qr(n){const e=ft.c(27),{side:s,checked:i,onChoose:l,avatar:d,who:h,meta:u,children:b}=n,g=w.useId(),k=`${g}-who`,E=`${g}-meta ${g}-value`,U=i?0:-1,X=i?"border-primary bg-primary/5 ring-1 ring-primary":"hover:bg-muted/50";let F;e[0]!==X?(F=le("grid w-full cursor-pointer grid-cols-[auto_minmax(0,1fr)] items-start gap-3 rounded-xl border bg-background p-3 text-left transition-[border-color,box-shadow,background-color] outline-none","focus-visible:ring-2 focus-visible:ring-ring/50",X),e[0]=X,e[1]=F):F=e[1];const L=`${g}-who`;let f;e[2]!==L||e[3]!==h?(f=o.jsx("span",{id:L,className:"text-sm font-medium text-foreground",children:h}),e[2]=L,e[3]=h,e[4]=f):f=e[4];const A=`${g}-meta`;let Y;e[5]!==u||e[6]!==A?(Y=o.jsx("span",{id:A,children:u}),e[5]=u,e[6]=A,e[7]=Y):Y=e[7];let j;e[8]!==f||e[9]!==Y?(j=o.jsxs("span",{className:"flex flex-wrap items-baseline gap-x-1.5 text-xs text-muted-foreground",children:[f,Y]}),e[8]=f,e[9]=Y,e[10]=j):j=e[10];const H=`${g}-value`,V=`conflict-${s}`;let v;e[11]!==b||e[12]!==H||e[13]!==V?(v=o.jsx("span",{id:H,"data-testid":V,className:"min-w-0 text-sm",children:b}),e[11]=b,e[12]=H,e[13]=V,e[14]=v):v=e[14];let C;e[15]!==j||e[16]!==v?(C=o.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[j,v]}),e[15]=j,e[16]=v,e[17]=C):C=e[17];let x;return e[18]!==d||e[19]!==i||e[20]!==l||e[21]!==k||e[22]!==C||e[23]!==E||e[24]!==U||e[25]!==F?(x=o.jsxs("button",{type:"button",role:"radio","aria-checked":i,"aria-labelledby":k,"aria-describedby":E,tabIndex:U,onClick:l,className:F,children:[d,C]}),e[18]=d,e[19]=i,e[20]=l,e[21]=k,e[22]=C,e[23]=E,e[24]=U,e[25]=F,e[26]=x):x=e[26],x}function fc(n){const e=ft.c(4),{parts:s}=n;let i;e[0]!==s?(i=s.map(mc),e[0]=s,e[1]=i):i=e[1];let l;return e[2]!==i?(l=o.jsx("span",{className:"whitespace-pre-wrap break-words",children:i}),e[2]=i,e[3]=l):l=e[3],l}function mc(n,e){return n.kind==="changed"?o.jsx("mark",{className:"rounded-sm bg-warning/20 px-0.5 text-foreground",children:n.text},e):o.jsx("span",{children:n.text},e)}function pc(n){const e=ft.c(29),{preview:s}=n,i=Dt();switch(s.kind){case"empty":{let l;e[0]!==i?(l=i("sectionsEditor.formConflict.empty"),e[0]=i,e[1]=l):l=e[1];let d;return e[2]!==l?(d=o.jsx("span",{className:"italic text-muted-foreground",children:l}),e[2]=l,e[3]=d):d=e[3],d}case"text":{let l;return e[4]!==s.text?(l=o.jsx("span",{className:"whitespace-pre-wrap break-words",children:s.text}),e[4]=s.text,e[5]=l):l=e[5],l}case"image":{let l;return e[6]!==s.src?(l=o.jsx("img",{src:s.src,alt:"",className:"max-h-24 max-w-full rounded border object-contain"}),e[6]=s.src,e[7]=l):l=e[7],l}case"yesNo":{const l=s.value?"sectionsEditor.formConflict.yes":"sectionsEditor.formConflict.no";let d;e[8]!==i||e[9]!==l?(d=i(l),e[8]=i,e[9]=l,e[10]=d):d=e[10];let h;return e[11]!==d?(h=o.jsx("span",{children:d}),e[11]=d,e[12]=h):h=e[12],h}case"list":{const l=s.count===1?"sectionsEditor.formConflict.oneItem":"sectionsEditor.formConflict.items",d=String(s.count);let h;e[13]!==i||e[14]!==l||e[15]!==d?(h=i(l,{count:d}),e[13]=i,e[14]=l,e[15]=d,e[16]=h):h=e[16];let u;e[17]!==h?(u=o.jsx("span",{className:"text-muted-foreground",children:h}),e[17]=h,e[18]=u):u=e[18];let b;e[19]!==s.count||e[20]!==s.items?(b=s.items.some(Boolean)&&o.jsxs("span",{className:"flex flex-col",children:[s.items.map(gc),s.count>s.items.length&&o.jsx("span",{children:"…"})]}),e[19]=s.count,e[20]=s.items,e[21]=b):b=e[21];let g;return e[22]!==u||e[23]!==b?(g=o.jsxs("span",{className:"flex flex-col gap-1",children:[u,b]}),e[22]=u,e[23]=b,e[24]=g):g=e[24],g}case"fields":{let l;e[25]!==s.entries?(l=s.entries.map(hc),e[25]=s.entries,e[26]=l):l=e[26];let d;return e[27]!==l?(d=o.jsx("dl",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-0.5",children:l}),e[27]=l,e[28]=d):d=e[28],d}}}function hc(n){return o.jsxs("div",{className:"contents",children:[o.jsx("dt",{className:"text-muted-foreground",children:n.label}),o.jsx("dd",{className:"truncate",children:n.text})]},n.label)}function gc(n,e){return o.jsx("span",{className:"truncate",children:`${e+1}. ${n||"…"}`},e)}function vc(n,e,s,i){if(!n||typeof n!="object")return{kind:"error",reason:"no-matcher-rule"};const l=e.trim();if(!l)return Ot(n,s,i)?{kind:"inline",blockKey:n.__resolveType??"",inlinedRule:cs(n,s,i)}:{kind:"noop"};const d=us(n,s,i);if(!d)return{kind:"error",reason:"unreadable-rule"};if(d.blockKey)return{kind:"updateBlock",blockKey:d.blockKey,blockData:Mt(d.resolveType,d.data,l)};const h=Tn(l),u=Vn(h,s);return u?{kind:"error",reason:"invalid-block-id",message:u}:{kind:"createBlock",blockId:h,blockData:Mt(d.resolveType,d.data,l),reference:Zt(h)}}const Xr="section-form-stale-save",xc=3,yc=1e3;function Zr(n,e){const s=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:to(e.pageKey?n[e.pageKey]?.sections:void 0,n),i=Math.max(0,Math.min(e.pageVariantIndex,s.length-1)),l=s[i]?.sections??[];return{pageVariants:s,variantIndex:i,rawSections:l,parsedSections:vn(l,n)}}const eo=new WeakMap;let bc=0;function Sc(n){let e=eo.get(n);return e===void 0&&(e=++bc,eo.set(n,e)),e}function jf({orgSlug:n,virtualMcpId:e,branch:s,previewReady:i=!0,previewUrl:l,currentPath:d,activePageBlockKey:h=null,activeGlobalBlockKey:u=null,externalSelection:b,onSaved:g,initialEditSeo:k=!1,onExitSeo:E,onSelectRoot:U,onViewJsonFile:X,onFocusedBlockChange:F,onVariantPreviewOverride:L}){const f=Dt(),A=Vi(),Y=A?.taskId??null,j=i?{orgSlug:n,virtualMcpId:e,branch:s,threadId:Y,previewUrl:l}:null,[H,V]=w.useState([]),{data:v,isLoading:C}=Wi(j,{pollWhile:H.length>0}),{data:x,isLoading:re}=Gi(j),P=In(),oe=A?.virtualMcpId,Z=fa(oe===e?e:null)?.metadata?.siteSlug??null,te=dl({virtualMcpId:e,sandboxUrl:l}),[S,W]=w.useState(null),[je,K]=w.useState(null),[He,G]=w.useState(null),[Ee,xe]=w.useState(0),[Re,Be]=w.useState(void 0),[we,ie]=w.useState(null),[B,O]=w.useState(null),[I,D]=w.useState([]),Ce=w.useRef(null),[Ye,Je]=w.useState(I.length);Ye!==I.length&&(Je(I.length),requestAnimationFrame(()=>{Ce.current&&(Ce.current.scrollTop=0)}));const[tt,ne]=w.useState(0),[ye,Fe]=w.useState(null),[Te,fe]=w.useState(null),[Ve,Pe]=w.useState(null),[Qe,Ae]=w.useState(!1),[We,Le]=w.useState(!1),Ge=w.useRef(null),[ee,zt]=w.useState(!0),[nt,se]=w.useState(!1),[pe,rt]=w.useState(!1),[ce,it]=w.useState(k),[bs,Ss]=w.useState(k);k&&!bs&&(Ss(!0),it(!0),W(null),K(null),G(null),D([])),!k&&bs&&Ss(!1);const[vo,xn]=w.useState(null),[js,Bn]=w.useState(void 0),[ws,Pt]=w.useState([]),[_s,en]=w.useState(0),[Xe,at]=w.useState(0),[xo,Ze]=w.useState(null),[Ht,st]=w.useState(null),[ks,Es]=w.useState(null),yo=Ni(),bo=`${n}/${e}/${s}`,yn=qi({orgSlug:n,virtualMcpId:e,branch:s}),[So,jo]=w.useState(d),[wo,_o]=w.useState(h),[ko,Eo]=w.useState(u);(So!==d||wo!==h||ko!==u)&&(queueMicrotask(()=>yn.flush()),jo(d),_o(h),Eo(u),W(null),K(null),G(null),xe(0),ie(null),O(null),at(0),Ze(null),st(null),D([]),ne(t=>t+1),it(!1),xn(null),Bn(void 0),Pt([]),en(t=>t+1));const me=Ui({orgSlug:n,virtualMcpId:e,branch:s}),tn=la((t,r)=>{me.mutate({blockKey:t,data:r},{onSuccess:()=>g?.(),onError:a=>z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),bn=xa({orgSlug:n,virtualMcpId:e,branch:s}),[Wt,Gt]=w.useState(!1),J=w.useRef(null),qt=w.useRef(null),yt=w.useRef(null),bt=w.useRef(null),Fn=w.useRef({}),Kt=w.useRef(null),nn=w.useRef(!1),sn=w.useRef(!1),qe=w.useRef(new Map),rn=w.useRef(!1),ht=w.useRef([]),Ln=w.useRef(new WeakSet),Oe=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Rs,As]=w.useState(0),[Ro,Ao]=w.useState(0),[No,Co]=w.useState(null);if(!i||C||re)return o.jsx("div",{className:"h-full w-full flex items-center justify-center",children:o.jsx(Ci,{className:"size-5 text-muted-foreground"})});if(!v||!x)return o.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:f("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const To=Sa(v),ae=!!u,he=ae?null:ja(To,d,h),_=ae?u:he?.key??null,On=ae&&u?v[u]:void 0,Ns=ae&&u&&On?wa(u,On):ae&&u?u:"",on=!ae&&_&&v[_]?v[_]:null,$n=ce&&v&&x&&_&&he?Er(v,{kind:"page",pageKey:_,pageName:String(he.name??""),path:String(he.path??"")},x):null,Vo=ce?on?.seo:void 0,Sn=js!==void 0?js:Vo,Mo=ce?Yi(Sn):void 0,Cs=$n?.seoTypeOptions??[],Ts=ce&&x?Ji(x):"",zn=vo??Mo??{},jn=ce&&$n?cl(zn,$n):null,Vs=ce&&jn&&Qi(Sn)?Cn(jn,x):null,Ms=ce?Xi(v,x)?.seoData:void 0,Ne=ae?[{label:"Default",sections:[{__resolveType:u}]}]:to(on?.sections,v??{}),mt=Ne.length>1,ge=Math.min(Ee,Ne.length-1),ot=Ne[ge],Q=ot?.sections??[],Me=vn(Q,v),Hn=!ae&&_a(on?.sections);if(ae&&u&&ks!==u){Es(u);const t=Q[0],r=Me[0];if(t&&r){W(0),at(0),D([]);const a=jt(t,r,v);a&&(K(a.data),G(a.resolveType),st(null),Ze(null))}}!ae&&ks!==null&&Es(null),Oe.current={rawSections:Q,parsedSections:Me,decofile:v??{},activePageKey:_,pageVariants:Ne,variantIndex:ge,sectionVariantIndex:Xe,selectedSectionIndex:S};const Do=()=>({multivariate:Hn,index:ge,variants:Ne.map(t=>({rule:t.rule}))}),Wn=(t,r)=>{if(!L)return;if(!_||!Hn||t.length<=1){L(null);return}const a=Gr(_,{multivariate:!0,index:r,variants:t},v,x);L(a.length>0?a:null)},Gn=L&&_&&Hn&&mt&&!C&&!re?_:null;if(Gn!==No&&(Co(Gn),Gn)){const t=Ne.map(a=>({rule:a.rule})),r=ge;queueMicrotask(()=>Wn(t,r))}const Ut=(t,r,a)=>{if(!L)return;if(!_){L(null);return}const c=Do(),m=Gr(_,c,v,x);if(!t||r<0){L(m.length>0?m:null);return}const y=ml({pageKey:_,page:c,sectionIndex:r,sectionLazy:Me[r]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:v,meta:x}),p=[...m,...y];L(p.length>0?p:null)},St=(t,r,a,c=S??-1,m=!1)=>{const y=pt(t,r);if(!y){K(null),G(null),st(null),Ze(null),m&&Ut(null,c,a);return}const R=ls(y,vt)[a];if(!R){K(null),G(null),st(null),Ze(null),m&&Ut(null,c,a);return}const $=oo(R.value,v);K($?.data??null),G($?.resolveType??null);const{resolveType:N,formValue:T}=hn(R.rule,v,x??void 0);st(N),Ze(T),m&&Ut(y,c,a)},an=b?.index;if(b!==void 0&&(b?.seq??null)!==Re&&(Be(b?.seq??null),typeof an=="number")){const t=Q[an],r=Me[an];if(t&&r)if(W(an),at(0),D([]),ne(a=>a+1),r.isMultivariate)St(t,r,0,an);else{const a=jt(t,r,v);a?(K(a.data),G(a.resolveType)):(K(null),G(null)),st(null),Ze(null)}}if(Rs!==Ro){Ao(Rs);const t=S!==null?Q[S]:null,r=S!==null?Me[S]:null;if(t&&r&&S!==null)if(D([]),ne(a=>a+1),r.isMultivariate)St(t,r,Xe,S);else{const a=jt(t,r,v??{});K(a?.data??null),G(a?.resolveType??null)}}const lt=H[0];if(lt){const{formBase:t,target:r}=lt,a=Zr(v,r),c=t.sectionIndex,m=a.rawSections.length===t.sectionCount?is(a.rawSections[c],a.parsedSections[c],r.sectionVariantIndex,v):null,y=Fl(lt,m,p=>Ur(t,p));if(y){const R=[{...lt,...y,changedAgain:!0},...H.slice(1)];ht.current=R,V(R)}}const ln={orgSlug:n,virtualMcpId:e,branch:s,threadId:Y,previewUrl:l??void 0,siteSlug:Z},wn=He&&x?Cn(He,x):null,ct=(t,r)=>{if(!_)return;J.current&&(clearTimeout(J.current),J.current=null),qe.current.clear(),bt.current&&(clearTimeout(bt.current),bt.current=null),yt.current&&(clearTimeout(yt.current),yt.current=null);const a=mn(v,_,t,ge,Ne);me.mutate({blockKey:_,data:a},{onSuccess:()=>r?.onSuccess?.()??g?.(),onError:c=>{r?.onError?.(),z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))}})},It=()=>{F?.(null),W(null),rt(!1),K(null),G(null),at(0),Ze(null),st(null),D([]),ne(t=>t+1)},Ds=()=>Kl(Ce.current,document.activeElement),qn=(t=f("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(J.current&&(clearTimeout(J.current),J.current=null),qe.current.clear(),qt.current=null,z.error(t,{id:Xr}),Ds()){rn.current=!0;return}As(r=>r+1)},Ps=()=>{!rn.current||Ds()||ht.current.length>0||J.current!==null||nn.current||sn.current||qe.current.size>0||(rn.current=!1,As(t=>t+1))},Ks=()=>{rn.current&&setTimeout(Ps,0)},Is=t=>{qe.current.size!==0&&setTimeout(()=>{if(nn.current||sn.current)return;const r=[...qe.current.values()];qe.current.clear();for(const a of r)a()},t)},Po=t=>{const{activePageKey:r,variantIndex:a,sectionVariantIndex:c}=Oe.current,m=Kt.current;return{formBase:m?.sectionIndex===t&&m.variantIndex===c?m:null,pageKey:r,global:ae,pageVariantIndex:a,sectionVariantIndex:c,schema:wn}},cn=t=>{ht.current=t,V(t)},Ko=t=>{const r=ht.current,a=r.findIndex(y=>y.formBase===t.formBase),c=a>=0?r[a]:void 0,m=c?r.with(a,{...t,choices:gs(c.plan,c.choices,t.plan),fresh:ho(c.plan,t.plan,c.fresh),changedAgain:c.changedAgain||ze(c.plan.theirs)!==ze(t.plan.theirs)}):[...r,{...t,changedAgain:Ln.current.has(t.formBase)}];cn(m)},Bs=(t,r)=>{const a=ht.current,c=a.findIndex(p=>p.formBase===t),m=a[c];if(!m)return!1;if(ze(m.plan.mine)===ze(r))return!0;const y=ps({...m.plan,mine:r});if(y.pointers.length===0){const p=a.filter(R=>R!==m);return cn(p),!1}return cn(a.with(c,{...m,plan:y,choices:gs(m.plan,m.choices,y)})),!0},Io=t=>{const r=Oe.current;return r.selectedSectionIndex===t.formBase.sectionIndex&&r.activePageKey===t.target.pageKey&&r.variantIndex===t.target.pageVariantIndex&&r.sectionVariantIndex===t.target.sectionVariantIndex},Bo=()=>{const t=ht.current[0];if(!t)return null;const{formBase:r,target:a}=t;J.current&&qt.current?.sectionIndex===r.sectionIndex&&qt.current.sectionVariantIndex===a.sectionVariantIndex&&(clearTimeout(J.current),J.current=null,qt.current=null),qe.current.delete(`${a.pageKey}:${r.sectionIndex}:${a.sectionVariantIndex}`);const c=r.emitted;return c&&typeof c=="object"&&!Bs(r,c)&&un(c,r.sectionIndex,0,a),ht.current[0]??null},Fo=()=>{const t=ht.current[0],r=Bo();if(!r||!t||r.formBase!==t.formBase||r.plan.pointers.some(y=>!t.plan.pointers.includes(y)))return;const a=Il(r.plan,r.choices);cn(ht.current.slice(1));const{formBase:c,target:m}=r;c.base=r.plan.theirs,c.emitted=a,Ln.current.add(c),(Kt.current===c||Io(r))&&(Kt.current=c,K(a),ne(y=>y+1)),un(a,c.sectionIndex,0,m)},Lo=t=>{const[r,...a]=ht.current;r&&cn([{...r,choices:t},...a])},un=(t,r,a=0,c)=>{const m=c??Po(r),y=m.sectionVariantIndex,p=m.formBase,R=qt.current;J.current&&(clearTimeout(J.current),J.current=null,R&&(R.sectionIndex!==r||R.sectionVariantIndex!==y)&&R.write());const $=`${m.pageKey}:${r}:${y}`,N=()=>{if(nn.current||sn.current){qe.current.set($,N);return}const T=typeof t=="function"?t():t;if(p&&Bs(p,T))return;const M=Oe.current.decofile,{rawSections:ue,parsedSections:be,pageVariants:Ie,variantIndex:De}=Zr(M,m),Ue=m.pageKey,q=ue[r];if(!q)return;const ve=be[r];if(!ve)return;const _e=p?.base,$e=is(q,ve,y,M),dt=!!_e&&!!$e&&fo(_e,$e)&&!(p&&Ur(p,$e));if(dt&&_e&&$e){if(mo(_e,$e)){qn(f("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const Se=ve.isSavedBlock?"here":Dl(_e,ue.map((ke,Tt)=>is(ke,be[Tt],y,M)),r,p?.sectionCount??ue.length);if(Se==="unknown"){qn(f("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof Se=="number"&&p){p.sectionCount=ue.length,p.sectionIndex=Se,Kt.current===p&&W(Se),un(T,Se,a,m);return}}const et=dt&&_e&&$e?ps({ancestor:_e,mine:T,theirs:$e}):null;if(et&&et.pointers.length>0&&p){p.sectionCount=ue.length,Ko({plan:et,formBase:p,target:m,sectionIndex:r,choices:po(et),changedAgain:!1,fresh:{}});return}const gt=et?et.merged:null,Ct=gt??T,jr=Pl({merged:!!gt,tracked:p,current:Kt.current,saved:T});gt&&z.info(f("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:Xr}),jr&&p&&(p.emitted=gt,K(gt));const ns=jr||!gt?Ct:T;p&&(p.base=ns,p.sectionCount=ue.length,Vl(p,ns));const wr={onSuccess:()=>{p&&Ln.current.delete(p),g?.()},onError:Se=>{if(p?.base===ns&&_e&&(p.base=_e),Se instanceof Fa){a<xc?(qe.current.delete($),sn.current=!0,setTimeout(()=>{sn.current=!1,un(()=>{const ke=p?.emitted;return ke&&typeof ke=="object"?ke:T},r,a+1,m),qe.current.delete($),Is(pn)},yc*2**a)):qn();return}z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:Se.message}))}},_r=Se=>{nn.current=!0;let ke=!1;me.mutateAsync(Se).then(()=>wr.onSuccess(),Tt=>{ke=!0,wr.onError(Tt)}).finally(()=>{nn.current=!1,Is(ke?pn:0),Ps()})};if(ve.isSavedBlock){const Se=da(q,ve);if(!Se)return;_r({blockKey:Se,data:Ct,..._e?{base:{value:gt?$e:_e}}:{},rebaseOnConflict:!1});return}if(!Ue)return;const An={...M[Ue]},Ft=[...ue];if(ve.isMultivariate){const Se=pt(q,ve);if(!Se||!Ue)return;const ke=Ba(Se,y,Ct);Ft[r]=Lt(q,ve,ke)}else if(ve.isHidden){const Se=xs(q.__resolveType),ke=Se?{...q.section}:{...q},Tt=Array.isArray(ke.variants)?[...ke.variants]:[];Tt[0]&&(Tt[0]={...Tt[0],value:Ct}),ke.variants=Tt,Se?Ft[r]={...q,section:ke}:Ft[r]=ke}else ve.isLazy?Ft[r]={...q,section:Ct}:Ft[r]=Ct;if(Ie.length>1){const Se=An.sections,ke=[...Se?.variants??[]];ke[De]&&(ke[De]={...ke[De],value:Ft}),An.sections={...Se,variants:ke}}else An.sections=Ft;_r({blockKey:Ue,data:An,rebaseOnConflict:!1})};qt.current={sectionIndex:r,sectionVariantIndex:y,write:N},J.current=setTimeout(()=>{J.current=null,N()},pn)},Oo=t=>{rn.current=!1,W(t),at(0),D([]),ne(m=>m+1);const r=Q[t],a=Me[t];if(F?.(a?.isSavedBlock?a.resolveType??null:null),!r||!a)return;if(a.isMultivariate){St(r,a,0,t);return}const c=jt(r,a,v);if(!c){K(null),G(null),st(null),Ze(null),Ut(null,t,0);return}K(c.data),G(c.resolveType),st(null),Ze(null),Ut(null,t,0)},Fs=t=>{const r=t;S!==null&&(Kt.current=Ml(Kt.current,{sectionIndex:S,variantIndex:Oe.current.sectionVariantIndex,shown:je,next:r,sectionCount:Oe.current.rawSections.length})),K(r),S!==null&&un(r,S)},Un=t=>{if(!_||!v||!x||!he)return;const r={kind:"page",pageKey:_,pageName:String(he.name??""),path:String(he.path??"")},a=Er(v,r,x);a&&yn.save(_,()=>{const c=yo.getQueryData(Ti.decofile(bo))?.[_];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const m={...c,...Fn.current};return Fn.current={},t?.raw!==void 0?{...m,seo:t.raw}:t?.inner!==void 0?ul(r,a,m,t.inner):m})},Ls=(t,r)=>{_&&(Fn.current[t]=r,Un())},$o=(t,r)=>{if(!_)return;const a=Mn([...Q],t,r);S!==null&&(S===t?W(r):t<S&&r>=S?W(S-1):t>S&&r<=S&&W(S+1)),ct(a)},zo=t=>{if(!_)return;const r=Q.filter((a,c)=>c!==t);S===t?It():S!==null&&S>t&&W(S-1),ct(r)},Ho=t=>{if(!_)return;const r=Q[t];if(!r)return;const a=[...Q];a.splice(t+1,0,ca(r)),S!==null&&S>t&&W(S+1),ct(a)},Wo=t=>{if(!_)return;const r=Q[t],a=Me[t];if(!r||!a)return;const c=a.isHidden?Ma(r):Da(r);if(!c)return;const m=[...Q];m[t]=c,S===t&&It(),ct(m)},Go=t=>{if(!_)return;const r=Q[t],a=Me[t];if(!r||!a||a.isMultivariate)return;const c=Va(r);if(!c)return;const m=[...Q];m[t]=c,S===t&&It(),ct(m)},qo=t=>{if(!_)return;const r=Q[t],a=Me[t];if(!r||!a?.isSavedBlock)return;const c=jt(r,a,v);if(!c?.data)return;const{name:m,...y}=c.data,p=[...Q];a.isLazy?p[t]={...r,section:y}:p[t]=y,S===t&&It(),ct(p)},Uo=t=>{if(!_)return;const r=[...Q,{__resolveType:t.resolveType}],a=r.length-1;ct(r,{onError:()=>{Oe.current.selectedSectionIndex===a&&It()}}),Ae(!1),W(a),at(0),D([]),ne(p=>p+1);const c=r[a],m=vn(r,v)[a];if(!c||!m)return;if(m.isMultivariate){St(c,m,0);return}const y=jt(c,m,v);if(!y){K(null),G(null),st(null),Ze(null);return}K(y.data),G(y.resolveType),st(null),Ze(null)},Os=t=>{Ge.current=t.append,Ae(!0)},Yo=t=>{const r=Ge.current;if(!r){Uo(t);return}r({__resolveType:t.resolveType}),Ae(!1),Ge.current=null},$s=t=>{if(S===null)return;const r=Q[S],a=Me[S];!r||!a?.isMultivariate||(at(t),D([]),ne(c=>c+1),St(r,a,t,S,!0))},Jo=t=>{if(S===null||!_)return;const r=Q[S],a=Me[S];if(!r||!a?.isMultivariate)return;const c=pt(r,a);if(!c)return;const m=Ca(c,t);if(!m){z.error(f("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const y=[...Q];y[S]=Lt(r,a,m);const p=m.variants;let R=Xe;t===Xe?R=Math.min(t,p.length-1):t<Xe&&(R=Xe-1),at(R),D([]),ne($=>$+1),St(y[S],a,R),ct(y)},Qo=t=>{if(S===null||!_)return;const r=Q[S],a=Me[S];if(!r||!a?.isMultivariate)return;const c=pt(r,a);if(!c)return;const m=Ta(c,t),y=[...Q];y[S]=Lt(r,a,m);const p=t+1;at(p),D([]),ne(R=>R+1),St(y[S],a,p),ct(y)},Xo=(t,r)=>{if(S===null||!_||t===r)return;const a=Q[S],c=Me[S];if(!a||!c?.isMultivariate)return;const m=pt(a,c);if(!m)return;const y=Aa(m,t,r),p=[...Q];p[S]=Lt(a,c,y);let R=Xe;Xe===t?R=r:t<Xe&&r>=Xe?R=Xe-1:t>Xe&&r<=Xe&&(R=Xe+1),at(R),St(p[S],c,R),ct(p)},dn=t=>{const r=t??S;if(r===null||!_)return;const a=Q[r],c=Me[r];if(!a||!c)return;const m=ka(a,c);if(!m){z.error(f("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const y=[...Q];y[r]=m.section;const p=vn(y,v)[r];if(!p?.isMultivariate){z.error(f("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}W(r),at(m.newVariantIndex),D([]),ne(R=>R+1),St(m.section,p,m.newVariantIndex,r),ct(y)},zs=()=>{if(S===null||!_)return;const t=Q[S],r=Me[S];if(!t||!r?.isMultivariate)return;const a=pt(t,r);if(!a)return;const c=Na(t,r,a);if(!c){z.error(f("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const m=[...Q];m[S]=c;const y=vn(m,v)[S];if(!y)return;at(0),st(null),Ze(null),D([]),ne(R=>R+1);const p=jt(c,y,v);p?(K(p.data),G(p.resolveType)):(K(null),G(null)),Ut(null,S,0),ct(m)},Zo=async t=>{if(ye===null||!_)return;const r=Vn(t,v);if(r){z.error(r);return}const a=Q[ye],c=Me[ye];if(!a||!c)return;const m=jt(a,c,v);if(!m){z.error(f("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const y={...m.data,name:t};try{await me.mutateAsync({blockKey:t,data:y});const p=[...Q];p[ye]={__resolveType:t},await me.mutateAsync({blockKey:_,data:mn(v,_,p,ge,Ne)}),S===ye&&It(),Fe(null),z.success(f("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),g?.()}catch(p){z.error(p instanceof Error?p.message:f("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},Hs=ot?.rule;if(mt&&S===null&&B===null&&Hs){const{resolveType:t,formValue:r}=hn(Hs,v??{},x??void 0);O(t),ie(r)}const Yt=x?Zi(x):[],Yn=x&&v?ea(x,v):[],Ws=!ae&&!!(te&&x&&v),Gs=B&&x?Cn(B,x):null,Et=()=>{yt.current&&(clearTimeout(yt.current),yt.current=null),bt.current&&(clearTimeout(bt.current),bt.current=null)},Bt=async(t,r)=>{if(!(Ia(r,t,x)>0))try{await bn.mutateAsync({blockKey:t})}catch(a){z.error(a instanceof Error?a.message:f("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},qs=t=>{yt.current&&clearTimeout(yt.current),yt.current=setTimeout(()=>{const{activePageKey:r,decofile:a,variantIndex:c}=Oe.current;if(!r)return;const m={...a[r]},y={...m.sections},p=[...y.variants??[]],R=p[c],$=R?.rule;if(Ot($,a,x)){const N=$?.__resolveType??"",T=a[N],M=typeof T?.name=="string"?T.name:N,{__resolveType:ue,...be}=t;me.mutate({blockKey:N,data:Mt(ue??"",be,M)},{onSuccess:()=>g?.(),onError:Ie=>z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:Ie.message}))});return}R&&(p[c]={...R,rule:t}),m.sections={...y,variants:p},me.mutate({blockKey:r,data:m},{onSuccess:()=>g?.(),onError:N=>z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:N.message}))})},pn)},Us=t=>{O(t);const r=t?Ir(t,x):{__resolveType:Br};ie(t?r:{}),qs(r)},Ys=t=>{const r=t;ie(r);const a=B?{__resolveType:B,...r}:{...r};qs(a)},Js=async t=>{Et();const{activePageKey:r,decofile:a,variantIndex:c}=Oe.current;if(!r)return;const m=a[r],y=m?.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const p=y;if(!Array.isArray(p.variants))return;const R=[...p.variants],$=R[c];if(!$)return;const N=Vt($.rule,a,x),T=Zt(t);R[c]={...$,rule:T};const M={...a,[r]:{...m,sections:{...p,variants:R}}},{resolveType:ue,formValue:be}=hn(T,M,x??void 0);O(ue),ie(be);try{await me.mutateAsync({blockKey:r,data:M[r]}),N&&N!==t&&await Bt(N,M),g?.()}catch(Ie){z.error(Ie instanceof Error?Ie.message:f("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Qs=t=>{bt.current&&clearTimeout(bt.current);const{selectedSectionIndex:r,sectionVariantIndex:a}=Oe.current;r!==null&&(bt.current=setTimeout(()=>{const{rawSections:c,parsedSections:m,decofile:y,activePageKey:p,pageVariants:R,variantIndex:$}=Oe.current;if(!p)return;const N=c[r],T=m[r];if(!N||!T?.isMultivariate)return;const M=pt(N,T);if(!M)return;const be=(M.variants??[])[a]?.rule;if(Ot(be,y,x)){const q=be?.__resolveType??"",ve=y[q],_e=typeof ve?.name=="string"?ve.name:q,{__resolveType:$e,...dt}=t;me.mutate({blockKey:q,data:Mt($e??"",dt,_e)},{onSuccess:()=>g?.(),onError:et=>z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:et.message}))});return}const Ie=Fr(M,a,t),De=[...c];De[r]=Lt(N,T,Ie);const Ue=mn(y,p,De,$,R);me.mutate({blockKey:p,data:Ue},{onSuccess:()=>g?.(),onError:q=>z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:q.message}))})},pn))},ei=t=>{st(t);const r=t?Ir(t,x):{__resolveType:Br};Ze(t?r:{}),Qs(r)},ti=t=>{const r=t;Ze(r);const a=Ht?{__resolveType:Ht,...r}:{...r};Qs(a)},ni=async t=>{Et();const{selectedSectionIndex:r,sectionVariantIndex:a,rawSections:c,parsedSections:m,decofile:y,activePageKey:p,pageVariants:R,variantIndex:$}=Oe.current;if(r===null||!p)return;const N=c[r],T=m[r];if(!N||!T?.isMultivariate)return;const M=pt(N,T);if(!M)return;const ue=M.variants??[],be=Vt(ue[a]?.rule,y,x),Ie=Zt(t),De=Fr(M,a,Ie),Ue=[...c];Ue[r]=Lt(N,T,De);const q=mn(y,p,Ue,$,R),ve={...y,[p]:q},{resolveType:_e,formValue:$e}=hn(Ie,ve,x??void 0);st(_e),Ze($e);try{await me.mutateAsync({blockKey:p,data:q}),be&&be!==t&&await Bt(be,ve),g?.()}catch(dt){z.error(dt instanceof Error?dt.message:f("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!ae&&!he)return o.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:f("sectionsEditor.sectionsEditor.noPageFound",{currentPath:d})});if(ae&&!On)return o.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:f("sectionsEditor.sectionsEditor.globalBlockNotFound")});const Ke=S!==null?Me[S]??null:null,Xs=S!==null?Q[S]:null,Zs=Xs&&Ke?.isMultivariate?pt(Xs,Ke):null,Rt=Zs?ls(Zs,vt):[],_n=Math.min(Xe,Math.max(Rt.length-1,0)),Jt=Rt[_n]??null,At=Ke?.isMultivariate===!0,Jn=S!==null&&Ke!==null,Nt=Jn&&(At||!!(wn&&je)),si=Nt&&!ae&&Ke?.isSavedBlock===!0,ut=ae||si,er=ae?Ns:Ke?.label??"",ri=Ht&&x?Cn(Ht,x):null,tr=(t,r)=>r&&P?`${t} · ${r}`:t,nr=Ke?Ke.variantOf??Ke.label:"",oi=(()=>{const t=At&&Jt?Jt.label:null;return t?P?[tr(nr,t)]:[Ke.label,t]:[Ke?.label??""]})(),Qn=tr(he?.name??"",mt?ot?.label:null),kn=Nt&&(!ae||I.length>0)?ae?[Ns,...I]:[Qn,...oi,...I]:[],sr=ce&&he?[he.name,"SEO",...ws]:[],rr=f("sectionsEditor.pageVariantTabs.variantsLabel"),or=nt&&he?[he.name,rr]:pe&&he&&Ke?[Qn,nr,rr]:[],En=or.length>0?or:sr.length>0?sr:ut?kn.length>0?kn:[er]:kn.length>0?kn:[Qn],ir=Jn&&!At&&!Ke?.isHidden&&!!_,ii=ut||!ae&&mt&&!!ot||ir,ai=Jn&&!At&&!ae&&I.length===0&&!!Ke&&ro(Ke)&&!!_,li=P&&Nt&&!pe&&At&&I.length===0&&!!Jt,ar=P&&I.length>0?Rr(I[I.length-1]):null,ci=I.length>1?Rr(I[I.length-2]):null,lr=ut?er:Nt?Ke?.label??"":he?.name??"",ui=nt||pe?f("sectionsEditor.pageVariantTabs.variantsLabel"):ce?f("sectionsEditor.panelSections.seo"):ar??lr,cr=pe?Ke?.variantOf??Ke?.label??"":nt||ce?he?.name??"":ar?ci??lr:ut?f("sectionsEditor.sectionsEditor.globalSectionSubtitle"):Nt?he?.name??"":he?.path??"",Xn=!nt&&!pe&&!ce&&!Nt&&!ut,di=!P&&!ce&&!ae&&At&&I.length===0,fn=()=>{if(!_)return;Et(),J.current&&(clearTimeout(J.current),J.current=null),qe.current.clear();const t=v[_],r=Ea(t.sections,Q);if(!r)return;const a=Ra(r);me.mutate({blockKey:_,data:{...t,sections:r}},{onSuccess:()=>{xe(a),W(null),K(null),G(null),D([]),ie(null),O(null)},onError:c=>z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})},Rn=(t,r,a)=>{if(!_)return;Et(),J.current&&(clearTimeout(J.current),J.current=null),qe.current.clear();const c=v[_],m=c.sections;if(!m||typeof m!="object"||Array.isArray(m))return;const y=m;if(!Array.isArray(y.variants))return;const p=t([...y.variants]);if(!p)return;const R=Ka(y,p),$={...v,[_]:{...c,sections:R}};me.mutate({blockKey:_,data:$[_]},{onSuccess:()=>{r?.();const N=typeof a=="string"?[a]:a??[];(async()=>{for(const T of N)await Bt(T,$)})()},onError:N=>z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:N.message}))})},Zn=t=>{fe(null),xe(t),W(null),K(null),G(null),D([]);const r=Ne[t]?.rule,{resolveType:a,formValue:c}=hn(r,v??{},x??void 0);O(a),ie(c),Wn(Ne.map(m=>({rule:m.rule})),t)},ur=(t,r)=>{if(t===r)return;let a=ge;ge===t?a=r:t<ge&&r>=ge?a=ge-1:t>ge&&r<=ge&&(a=ge+1),xe(a);const c=Mn(Ne.map(m=>({rule:m.rule})),t,r);Wn(c,a),Rn(m=>Mn(m,t,r))},dr=t=>{const r=Ne[t]?.rule,a=Vt(r,v??{},x??void 0);Rn(c=>c.length<=1?null:(c.splice(t,1),c),()=>{Ne.length-1===1?xe(0):t<ge?xe(ge-1):t===ge&&xe(Math.max(0,t-1)),W(null),K(null),G(null),D([]),ie(null),O(null)},a)},fi=()=>{const t=Ne.map((r,a)=>({variant:r,index:a})).filter(({variant:r})=>!Pa(r.rule)).map(({variant:r})=>Vt(r.rule,v??{},x??void 0)).filter(r=>!!r);Rn(r=>{const a=La({variants:r}),c=r[a];return c?[{...c,rule:Oa()}]:null},()=>{xe(0),W(null),K(null),G(null),D([]),ie(null),O(null),se(!1)},t)},fr=t=>{Rn(r=>$a(r,t),()=>{xe(t+1),W(null),K(null),G(null),D([]),ie(null),O(null)})},mi=async(t,r)=>{Et(),J.current&&(clearTimeout(J.current),J.current=null),qe.current.clear();const a=Oe.current.activePageKey,c=Oe.current.decofile;if(!a)return;const m=c[a],y=m.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const p=y;if(!Array.isArray(p.variants))return;const R=[...p.variants],$=R[t];if(!$?.rule||typeof $.rule!="object"){z.error(f("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const N=$.rule,T=r.trim();Gt(!0);try{if(!T){if(!Ot(N,c,x)){fe(null);return}const Ue=N.__resolveType??"";R[t]={...$,rule:cs(N,c,x)};const q={...c,[a]:{...m,sections:{...p,variants:R}}};await me.mutateAsync({blockKey:a,data:q[a]}),await Bt(Ue,q),fe(null),g?.();return}const M=us(N,c,x);if(!M){z.error(f("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(M.blockKey){await me.mutateAsync({blockKey:M.blockKey,data:Mt(M.resolveType,M.data,T)}),fe(null),g?.();return}const ue=Tn(T),be=Vn(ue,c);if(be){z.error(be);return}const Ie=Mt(M.resolveType,M.data,T);let De=null;try{await me.mutateAsync({blockKey:ue,data:Ie}),De=ue,R[t]={...$,rule:Zt(ue)},await me.mutateAsync({blockKey:a,data:{...m,sections:{...p,variants:R}}}),De=null}catch(Ue){throw De&&await bn.mutateAsync({blockKey:De}).catch(()=>{}),Ue}fe(null),z.success(f("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:T})),g?.()}catch(M){z.error(M instanceof Error?M.message:f("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Gt(!1)}},pi=async(t,r)=>{Et(),J.current&&(clearTimeout(J.current),J.current=null),qe.current.clear();const{selectedSectionIndex:a,rawSections:c,parsedSections:m,decofile:y,activePageKey:p,pageVariants:R,variantIndex:$}=Oe.current;if(a===null||!p)return;const N=c[a],T=m[a];if(!N||!T?.isMultivariate)return;const M=pt(N,T);if(!M)return;const ue=M.variants??[],be=ue[t];if(!be?.rule||typeof be.rule!="object"){z.error(f("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Ie=be.rule,De=r.trim();Gt(!0);const Ue=async q=>{const ve={...M,variants:q},_e=[...c];_e[a]=Lt(N,T,ve);const $e=mn(y,p,_e,$,R);return await me.mutateAsync({blockKey:p,data:$e}),{...y,[p]:$e}};try{if(!De){if(!Ot(Ie,y,x)){Pe(null);return}const et=Ie.__resolveType??"",gt=[...ue];gt[t]={...be,rule:cs(Ie,y,x)};const Ct=await Ue(gt);await Bt(et,Ct),Pe(null),g?.();return}const q=us(Ie,y,x);if(!q){z.error(f("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(q.blockKey){await me.mutateAsync({blockKey:q.blockKey,data:Mt(q.resolveType,q.data,De)}),Pe(null),g?.();return}const ve=Tn(De),_e=Vn(ve,y);if(_e){z.error(_e);return}const $e=Mt(q.resolveType,q.data,De);let dt=null;try{await me.mutateAsync({blockKey:ve,data:$e}),dt=ve;const et=[...ue];et[t]={...be,rule:Zt(ve)},await Ue(et),dt=null}catch(et){throw dt&&await bn.mutateAsync({blockKey:dt}).catch(()=>{}),et}Pe(null),z.success(f("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:De})),g?.()}catch(q){z.error(q instanceof Error?q.message:f("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Gt(!1)}},mr=async(t,r,a)=>{K(a);try{await me.mutateAsync({blockKey:t,data:a})}catch(c){throw K(m=>m===a?r:m),c}},hi={rename:async(t,r,a)=>{Et(),J.current&&(clearTimeout(J.current),J.current=null),qe.current.clear();const{activePageKey:c,decofile:m}=Oe.current;if(!c)return;const y=Array.isArray(t.variants)?[...t.variants]:[],p=y[r],R=p?.rule&&typeof p.rule=="object"?p.rule:void 0,$=async T=>{const M={...t,variants:T};return await mr(c,t,M),{...m,[c]:M}},N=vc(R,a,m,x);if(N.kind!=="noop"){if(N.kind==="error"){z.error(N.reason==="no-matcher-rule"?f("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):N.reason==="unreadable-rule"?f("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):N.message??f("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}Gt(!0);try{if(N.kind==="inline"){const M=[...y];M[r]={...p,rule:N.inlinedRule};const ue=await $(M);await Bt(N.blockKey,ue),g?.();return}if(N.kind==="updateBlock"){await me.mutateAsync({blockKey:N.blockKey,data:N.blockData}),g?.();return}let T=null;try{await me.mutateAsync({blockKey:N.blockId,data:N.blockData}),T=N.blockId;const M=[...y];M[r]={...p,rule:N.reference},await $(M),T=null}catch(M){throw T&&await bn.mutateAsync({blockKey:T}).catch(()=>{}),M}z.success(f("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:a.trim()})),g?.()}catch(T){z.error(T instanceof Error?T.message:f("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Gt(!1)}}},selectGlobal:async(t,r,a)=>{Et(),J.current&&(clearTimeout(J.current),J.current=null),qe.current.clear();const{activePageKey:c,decofile:m}=Oe.current;if(!c)return;const y=Array.isArray(t.variants)?[...t.variants]:[],p=y[r];if(!p)return;const R=Vt(p.rule,m,x);y[r]={...p,rule:Zt(a)};const $={...t,variants:y},N={...m,[c]:$};try{await mr(c,t,$),R&&R!==a&&await Bt(R,N),g?.()}catch(T){z.error(T instanceof Error?T.message:f("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}}},pr=()=>{It()},hr=t=>{xn(t),Un({inner:t})},gr=t=>{Bn(t),Un({raw:t})},vr=()=>{xn(null),Pt([])},xr=()=>en(t=>t+1),yr=()=>{yn.flush(),it(!1),xn(null),Bn(void 0),Pt([]),en(t=>t+1),E?.()},gi=()=>{se(!1),rt(!1),W(null),it(!0)},vi=()=>{ce&&yr(),W(null),se(!0)},xi=()=>rt(!0),es=t=>{if(nt&&t===0){se(!1);return}if(pe&&t<2){rt(!1),t===0&&W(null);return}if(ce){if(t===0){yr();return}if(t===1){Pt([]),en(a=>a+1);return}Pt(ws.slice(0,t-1)),en(a=>a+1);return}if(ae){D(I.slice(0,t)),ne(a=>a+1);return}if(t===0){pr();return}if(t===1){D([]),ne(a=>a+1);return}const r=!P&&At&&Jt?1:0;if(r===1&&t===2){D([]),ne(a=>a+1);return}D(I.slice(0,t-1-r))},ts=En.length>1?o.jsx("button",{type:"button",onClick:()=>es(ua(En.length,{isMultivariateSectionTop:di})),title:f("sectionsEditor.sectionsEditor.back"),"aria-label":f("sectionsEditor.sectionsEditor.back"),className:le("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",ut?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:o.jsx(ga,{className:"size-4"})}):null,yi=ut||Nt||ce?ii&&o.jsxs("div",{className:le("border-b px-3 py-2.5",ut&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!ae&&mt&&ot&&o.jsxs("button",{type:"button",onClick:pr,title:f("sectionsEditor.sectionsEditor.editingInVariant",{variant:ot.label}),className:le("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",na),children:[o.jsx(ta,{rule:rs(ot.rule,v??{},x??void 0),matchers:Yt}),o.jsx("span",{className:"max-w-[160px] truncate",children:ot.label})]}),o.jsx("div",{className:"flex-1"}),ut&&o.jsxs(wt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx("span",{className:"shrink-0 cursor-help",children:o.jsx(Pn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),o.jsx(kt,{side:"bottom",className:"max-w-[260px]",children:f("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),ir&&o.jsx(Nn,{onClick:()=>dn()})]}),ut&&o.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:f("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):o.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(Ar,{pageKey:_,initialName:he.name,initialPath:he.path,onFieldChange:Ls,variant:"header"})}),o.jsxs(wt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(xt,{type:"button",variant:"ghost",size:"icon","aria-label":f("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>it(!0),children:o.jsx(Pr,{size:14})})}),o.jsx(kt,{side:"bottom",children:f("sectionsEditor.sectionsEditor.editSeo")})]}),o.jsxs(wt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(xt,{type:"button",variant:"ghost",size:"icon","aria-label":f("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>X&&_?X():Le(!0),children:o.jsx(Kr,{size:14})})}),o.jsx(kt,{side:"bottom",children:f("sectionsEditor.sectionsEditor.viewJson")})]}),o.jsx(Nn,{onClick:fn})]}),bi=o.jsxs(o.Fragment,{children:[mt&&_&&o.jsx(Nr,{listKey:_,variants:Ne,activeIndex:ge,decofile:v??{},meta:x,matchers:Yt,onSelect:Zn,onReorder:ur,onRename:fe,onDuplicate:fr,onDelete:dr,onAdd:fn}),mt&&B!==null&&o.jsx(Cr,{className:"mt-3",children:o.jsx("div",{className:le("space-y-3",Wt&&"pointer-events-none opacity-50"),children:o.jsx(ss,{currentRt:B,currentLabel:gn(ot?.rule,v??{},vt,x??void 0),currentGlobalKey:Vt(ot?.rule,v??{},x??void 0)??void 0,matchers:Yt,globals:Yn,onSelect:Us,onSelectGlobal:Js,schema:Gs,formValue:we,onChange:Ys,formKey:`${ge}:${B??""}`,formWrapperClassName:"space-y-3",meta:x??void 0,decofile:v,onSaveReferencedBlock:tn,sandbox:ln})})})]}),br=o.jsxs(o.Fragment,{children:[o.jsx(sa,{listKey:`${_??""}:${S??""}`,variants:Rt.map((t,r)=>({index:r,label:t.label})),selectedIndex:_n,onSelect:$s,onRename:Pe,onDuplicate:Qo,onDelete:Jo,onRemoveAll:zs,onReorder:Xo,onAdd:()=>dn()}),o.jsx(Cr,{children:o.jsx(ss,{currentRt:Ht??"",currentLabel:gn(Jt?.rule,v??{},vt,x??void 0),currentGlobalKey:Vt(Jt?.rule,v??{},x??void 0)??void 0,matchers:Yt,globals:Yn,onSelect:ei,onSelectGlobal:ni,schema:ri,formValue:xo,onChange:ti,formKey:`${S??"none"}:${_n}:${Ht??""}`,formWrapperClassName:"pt-1",meta:x??void 0,decofile:v,onSaveReferencedBlock:tn,sandbox:ln})})]}),Sr=o.jsx("div",{className:le(P?"px-2":"p-2 pt-3"),children:o.jsx(Nl,{listKey:`${_??""}-${ge}`,rawSections:Q,sections:Me,meta:x,decofile:v,selectedIndex:S,onSelect:Oo,onReorder:$o,onDelete:zo,onDuplicate:Ho,onMakeReusable:Fe,onToggleHidden:Wo,onToggleLazy:Go,onAddVariant:dn,onDetach:qo,onAddSection:()=>Ae(!0),canAddSection:Ws})}),Si=o.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[_&&he&&o.jsx(Ar,{pageKey:_,initialName:he.name,initialPath:he.path,onFieldChange:Ls}),on&&_?o.jsx(Wr,{rawSeo:Sn,innerSeo:zn,defaultResolveType:Ts,seoSchema:Vs,activeResolveType:jn,seoTypeOptions:Cs,formResetKey:_s,siteDefaultSeo:Ms,onBreadcrumbChange:Pt,onPersistRaw:gr,onInnerChange:hr,onClearForm:vr,onBumpFormKey:xr}):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),ji=o.jsx(Xt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:o.jsx("div",{className:"mx-auto max-w-2xl",children:on&&_?o.jsx(Wr,{rawSeo:Sn,innerSeo:zn,defaultResolveType:Ts,seoSchema:Vs,activeResolveType:jn,seoTypeOptions:Cs,formResetKey:_s,siteDefaultSeo:Ms,onBreadcrumbChange:Pt,onPersistRaw:gr,onInnerChange:hr,onClearForm:vr,onBumpFormKey:xr}):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),wi=o.jsxs(Xt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[mt&&_&&o.jsx(Nr,{listKey:_,variants:Ne,activeIndex:ge,decofile:v??{},meta:x,matchers:Yt,onSelect:Zn,onReorder:ur,onRename:fe,onDuplicate:fr,onDelete:dr,onAdd:fn}),mt&&B!==null&&o.jsxs("div",{className:le("px-3 border-b",ee?"pt-3 pb-5 space-y-3":"py-2"),children:[o.jsxs("button",{type:"button",onClick:()=>zt(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-muted/40","aria-expanded":ee,children:[o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:f("sectionsEditor.sectionsEditor.variantRule")}),ee?o.jsx(ma,{className:"size-3.5 shrink-0 text-muted-foreground"}):o.jsx(pa,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),ee&&o.jsx("div",{className:le("space-y-3",Wt&&"pointer-events-none opacity-50"),children:o.jsx(ss,{currentRt:B,currentLabel:gn(ot?.rule,v??{},vt,x??void 0),currentGlobalKey:Vt(ot?.rule,v??{},x??void 0)??void 0,matchers:Yt,globals:Yn,onSelect:Us,onSelectGlobal:Js,schema:Gs,formValue:we,onChange:Ys,formKey:`${ge}:${B??""}`,formWrapperClassName:"space-y-3",meta:x??void 0,decofile:v,onSaveReferencedBlock:tn,sandbox:ln})})]}),Sr]},"editor-section-list");return o.jsx(ra,{children:o.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!P&&ts&&o.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:ts}),(P||En.length>1)&&o.jsx(oa,{crumbs:En,onSelect:es,onSelectRoot:()=>{yn.flush(),U?U():es(0)}}),o.jsx("div",{className:"shrink-0",children:P?o.jsxs("div",{className:le("flex items-center gap-2 border-b px-3 py-2.5",ut&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[P&&ts,ut&&o.jsxs(wt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx("span",{className:"shrink-0 cursor-help",children:o.jsx(Pn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),o.jsx(kt,{side:"bottom",className:"max-w-[260px]",children:f("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[o.jsx("span",{className:"truncate text-sm font-semibold",children:ui}),cr&&o.jsx("span",{className:"truncate text-xs text-muted-foreground",children:cr})]}),Xn&&mt&&ot&&o.jsx(Tr,{variants:Ne,activeIndex:ge,onSelect:Zn,onManage:vi,onRemoveAll:fi}),li&&o.jsx(Tr,{variants:Rt,activeIndex:_n,onSelect:$s,onManage:xi,onRemoveAll:zs}),Xn&&!mt&&o.jsx(Nn,{onClick:fn}),ai&&o.jsx(Nn,{onClick:()=>dn()}),o.jsx(ia,{}),Xn&&o.jsxs(o.Fragment,{children:[o.jsxs(wt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(xt,{type:"button",variant:"outline",size:"icon","aria-label":f("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:gi,children:o.jsx(Pr,{size:14})})}),o.jsx(kt,{side:"bottom",children:f("sectionsEditor.sectionsEditor.editSeo")})]}),!X&&o.jsxs(wt,{children:[o.jsx(_t,{asChild:!0,children:o.jsx(xt,{type:"button",variant:"outline",size:"icon","aria-label":f("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Le(!0),children:o.jsx(Kr,{size:14})})}),o.jsx(kt,{side:"bottom",children:f("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):yi}),lt&&o.jsx(Jl,{open:!0,fields:Ll(lt.plan,lt.target.schema),choices:lt.choices,changedAgain:lt.changedAgain,fresh:lt.fresh,onChoose:(t,r)=>Lo({...lt.choices,[t]:r}),onApply:Fo},Sc(lt.formBase)),pe?o.jsx(Vr,{onAdd:()=>dn(),children:br},"editor-section-variants"):Nt?o.jsxs(Xt,{viewportRef:Ce,onBlur:Ks,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!P&&At&&Rt.length>0&&I.length===0&&br,o.jsx(Mr,{activeSchema:wn,formValue:je,formResetKey:tt,onFormChange:Fs,onBreadcrumbChange:D,breadcrumbPath:I,emptyMessage:f("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:x,decofile:v,onSaveReferencedBlock:tn,sandbox:ln,previewBaseUrl:te,onRequestAddSection:Os,onVariantMatcherOp:ae?hi:void 0})]},"editor-section-form"):ae?o.jsx(Xt,{viewportRef:Ce,onBlur:Ks,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx(Mr,{activeSchema:wn,formValue:je,formResetKey:tt,onFormChange:Fs,onBreadcrumbChange:D,breadcrumbPath:I,emptyMessage:f("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:x,decofile:v,onSaveReferencedBlock:tn,sandbox:ln,previewBaseUrl:te,onRequestAddSection:Os})},"editor-global-block"):ce?P?o.jsx(Xt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"p-3",children:Si})},"editor-seo"):ji:nt?o.jsx(Vr,{onAdd:fn,children:bi},"editor-variants"):P?o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[o.jsx(Xt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"py-2",children:Sr})}),o.jsx("div",{className:"shrink-0 border-t p-2",children:o.jsx(ms,{canAddSection:Ws,onAddSection:()=>Ae(!0)})})]},"editor-section-list"):wi,o.jsx(aa,{open:ye!==null,onOpenChange:t=>{t||Fe(null)},defaultBlockId:ye!==null?Tn(Me[ye]?.label??""):"",isPending:me.isPending,onSubmit:Zo}),te&&o.jsx(fl,{open:Qe,onOpenChange:t=>{Ae(t),t||(Ge.current=null)},meta:x,decofile:v,previewBaseUrl:te,onSelect:Yo}),We&&_&&v&&o.jsx(ya,{open:We,onOpenChange:Le,pageKey:_,decofile:v}),Te!==null&&o.jsx(Dr,{open:!0,initialName:Ot(Ne[Te]?.rule,v??{},x??void 0)?gn(Ne[Te]?.rule,v??{},vt,x??void 0):"",autoLabel:vt(rs(Ne[Te]?.rule,v??{},x??void 0)),isPending:Wt,onSubmit:async t=>{await mi(Te,t)},onOpenChange:t=>{!t&&!Wt&&fe(null)}}),Ve!==null&&o.jsx(Dr,{open:!0,initialName:Ot(Rt[Ve]?.rule,v??{},x??void 0)?gn(Rt[Ve]?.rule,v??{},vt,x??void 0):"",autoLabel:vt(rs(Rt[Ve]?.rule,v??{},x??void 0)),isPending:Wt,onSubmit:async t=>{await pi(Ve,t)},onOpenChange:t=>{!t&&!Wt&&Pe(null)}})]})})}export{jf as SectionsEditor};
|