decocms 4.429.16 → 4.430.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CluHBBJz.js → AlertCircle-XbZvoIme.js} +1 -1
- package/dist/client/assets/{AreaChart-gzB7TDWG.js → AreaChart-DgiTy9h6.js} +1 -1
- package/dist/client/assets/{ArrowLeft-C0DToker.js → ArrowLeft-B10qZSXl.js} +1 -1
- package/dist/client/assets/{ArrowRight-BTAZM0Ij.js → ArrowRight-CP95Quaz.js} +1 -1
- package/dist/client/assets/{ArrowUp-D9zmSnBg.js → ArrowUp-DVQxLZsm.js} +1 -1
- package/dist/client/assets/{CartesianChart-C5gEa-Ka.js → CartesianChart-Con2E8cB.js} +1 -1
- package/dist/client/assets/{Check-DIF4jj4B.js → Check-BF-m6KVY.js} +1 -1
- package/dist/client/assets/{CheckCircle-P8cxOWEE.js → CheckCircle-nfgGUSlr.js} +1 -1
- package/dist/client/assets/{ChevronUp-CS6cAw-m.js → ChevronUp-B_dZipHr.js} +1 -1
- package/dist/client/assets/{Copy01-DxUtxQJf.js → Copy01-BFL2IBar.js} +1 -1
- package/dist/client/assets/{CreditCard01-vcF3-oXu.js → CreditCard01-BAkQ0X2j.js} +1 -1
- package/dist/client/assets/{DotsVertical-BD_FArKy.js → DotsVertical-DGakKoqS.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-Cmz4WIH3.js → ErrorBarContext-Bm1DecRA.js} +1 -1
- package/dist/client/assets/{Image01-BIN_EGim.js → Image01-B2iIQy-h.js} +1 -1
- package/dist/client/assets/{Key01-TuNVI2WF.js → Key01-Ber36HHc.js} +1 -1
- package/dist/client/assets/{Line-C2xJb0ZB.js → Line-CbPZhUx3.js} +1 -1
- package/dist/client/assets/{Link01-BfTVY3h_.js → Link01-BHCX0_Et.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CYa5EQLc.js → LinkExternal01-CCWGUCuX.js} +1 -1
- package/dist/client/assets/{Monitor01-CqReyFma.js → Monitor01-fVJ_bHaY.js} +1 -1
- package/dist/client/assets/{Palette-DggabiBL.js → Palette-8KWyiFK4.js} +1 -1
- package/dist/client/assets/{Plus-CXLWqdUi.js → Plus-D2NCmLMx.js} +1 -1
- package/dist/client/assets/{SearchMd-ctfjl1FW.js → SearchMd-DIg_EfRC.js} +1 -1
- package/dist/client/assets/{Sector-DgkDmX5m.js → Sector-Bzv2W17P.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-EJMIdp90.js → ShoppingBag01-DgGunmMH.js} +1 -1
- package/dist/client/assets/{Sun-mRbBp_4T.js → Sun-1iBslaEq.js} +1 -1
- package/dist/client/assets/{Tool01-B-GeYbOl.js → Tool01-BPIKi6tL.js} +1 -1
- package/dist/client/assets/{Trash01-DCuU-TO1.js → Trash01-C4lIUVMq.js} +1 -1
- package/dist/client/assets/{Upload01-CoI3wIgf.js → Upload01-DTwqTWTg.js} +1 -1
- package/dist/client/assets/{User01-BZw2NouY.js → User01-CBT9xTuN.js} +1 -1
- package/dist/client/assets/{UserSquare-CpvurJvE.js → UserSquare-CEg6M02N.js} +1 -1
- package/dist/client/assets/{Users01-DdWpFPgu.js → Users01-DFZY90Ue.js} +1 -1
- package/dist/client/assets/{X-B0JPynZq.js → X-DbvoChXn.js} +1 -1
- package/dist/client/assets/{XAxis-CM7i28RB.js → XAxis-HjIKt32K.js} +1 -1
- package/dist/client/assets/{XClose-DyG0hQfD.js → XClose-BSHHLYGF.js} +1 -1
- package/dist/client/assets/{ZoomOut-C_UybJsX.js → ZoomOut-gRGmlA24.js} +1 -1
- package/dist/client/assets/{access-gate-C96k8M-E.js → access-gate-iiCKuWh8.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-0-UStyjk.js → add-connection-dialog-BeoWUU4I.js} +1 -1
- package/dist/client/assets/{agent-analytics-CuTcoe5C.js → agent-analytics-Dyh1FUjY.js} +1 -1
- package/dist/client/assets/agent-app-CpEpBbQI.js +1 -0
- package/dist/client/assets/{agent-assets-BrNIIwtQ.js → agent-assets-BkF9YqMO.js} +1 -1
- package/dist/client/assets/{agent-automation-BnQBf0Lv.js → agent-automation-C4sl_JYI.js} +1 -1
- package/dist/client/assets/{agent-automations-BDD7t6zG.js → agent-automations-3llEiyfb.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-1I2IfQ0O.js → agent-connect-sources-D4k-BofW.js} +1 -1
- package/dist/client/assets/agent-deck-Dh-fu1Bj.js +1 -0
- package/dist/client/assets/{agent-e2e-DqaqLK_A.js → agent-e2e-rGZnFzQB.js} +1 -1
- package/dist/client/assets/{agent-experiments-C7yHHyTE.js → agent-experiments-C_Orr_pN.js} +1 -1
- package/dist/client/assets/{agent-file-DQ13HDU6.js → agent-file--QF0bjPt.js} +1 -1
- package/dist/client/assets/{agent-git-dKR8pghg.js → agent-git-drq2r2pk.js} +1 -1
- package/dist/client/assets/{agent-hosting-4BbqWC7W.js → agent-hosting-fPLpwPLT.js} +1 -1
- package/dist/client/assets/{agent-icon-YlfaZ_bB.js → agent-icon-qkd0b8kr.js} +1 -1
- package/dist/client/assets/agent-library-BKmIVAuT.js +1 -0
- package/dist/client/assets/agent-library-file-CZRrGQIz.js +1 -0
- package/dist/client/assets/{agent-monitor-CAiXOqVz.js → agent-monitor-TNBOwUUV.js} +1 -1
- package/dist/client/assets/{agent-overview-CTKP8hEq.js → agent-overview-Dn4HQgzA.js} +1 -1
- package/dist/client/assets/agent-settings-B2aM7Rjl.js +1 -0
- package/dist/client/assets/{agent-site-editor-DSoTDcIf.js → agent-site-editor-CdZPFXVo.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-CjzPQ1zX.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-DpVII3vb.js → agent-site-editor-content-CIp4eQrh.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-BYq7FfZP.js → agent-site-editor-preview-DQZZ8SjU.js} +3 -3
- package/dist/client/assets/agent-view-CAMcAw5u.js +1 -0
- package/dist/client/assets/{agent-view-guard-Dwlvb-4P.js → agent-view-guard-BJZgGtJ7.js} +1 -1
- package/dist/client/assets/{agents-list-p999PQGn.js → agents-list-CC0W0zd5.js} +1 -1
- package/dist/client/assets/{ai-providers-Dj5Ds5RR.js → ai-providers-_fc11t3H.js} +1 -1
- package/dist/client/assets/{alert-aXK9n4Ls.js → alert-DXfR80Fa.js} +1 -1
- package/dist/client/assets/{alert-dialog-D6TKfZxD.js → alert-dialog-BKZ0Im5W.js} +1 -1
- package/dist/client/assets/{analytics-sections-itOd6L68.js → analytics-sections-KYJOqwBG.js} +1 -1
- package/dist/client/assets/{api-keys-C7dszvGH.js → api-keys-CBMWpvu2.js} +1 -1
- package/dist/client/assets/api-keys-CSYokKBE.js +1 -0
- package/dist/client/assets/{app-editor-DkqHwp-T.js → app-editor-B7Nsc7ju.js} +1 -1
- package/dist/client/assets/{asset-utils-2GPH14oX.js → asset-utils-BjIs8swm.js} +1 -1
- package/dist/client/assets/{auth-D7nGP-WI.js → auth-CCqcRSEL.js} +1 -1
- package/dist/client/assets/{auth-catchall-fI1By2HC.js → auth-catchall-g13-y4aH.js} +1 -1
- package/dist/client/assets/{auth-entry-BnGB9ygk.js → auth-entry-BLEaS9fp.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Deu_DO7u.js → auth-split-layout-1Dl0T7JX.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CDFoa6fH.js → authenticate-and-persist-oauth-C8AOqaPu.js} +1 -1
- package/dist/client/assets/{automation-list-row-Z-SiEu50.js → automation-list-row-D-JHd4A2.js} +1 -1
- package/dist/client/assets/{automation-runs-B18C1Who.js → automation-runs-DIe6agBL.js} +1 -1
- package/dist/client/assets/{automations-C5_U4h4W.js → automations-l9mL1mJI.js} +1 -1
- package/dist/client/assets/{autosend-BTYvqInV.js → autosend-laDWuWlf.js} +1 -1
- package/dist/client/assets/{avatar-C17PCkOS.js → avatar-BPqaE0VH.js} +1 -1
- package/dist/client/assets/{badge-CaeWiEJN.js → badge-CWIqgqp7.js} +1 -1
- package/dist/client/assets/{block-document-DBt-Q4m4.js → block-document-CU1ZTqNi.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-yjYZzdi_.js → blocks-preview-workspace-context-BUyGFTNF.js} +1 -1
- package/dist/client/assets/{buckets-fKvZ_MVl.js → buckets-BA_0MFY3.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-0sNZD3gl.js → build-improve-prompt-doc-C81cShjG.js} +1 -1
- package/dist/client/assets/{calendar-MmytmDrx.js → calendar-DxpzmF7P.js} +1 -1
- package/dist/client/assets/{capability-load-error-Cv1eny4F.js → capability-load-error-D9RMJc6U.js} +1 -1
- package/dist/client/assets/{category-editor-BfEINFQL.js → category-editor-CTqzJloK.js} +1 -1
- package/dist/client/assets/{chart-CF76rlpo.js → chart-JvIlgn3S.js} +1 -1
- package/dist/client/assets/{chat-context-BeJu-9nF.js → chat-context-KKDqDnLJ.js} +1 -1
- package/dist/client/assets/{chat-draft-CCLgdukU.js → chat-draft-B3PMzzHD.js} +1 -1
- package/dist/client/assets/{checkbox-CXpqhVP0.js → checkbox-D7D_a0UV.js} +1 -1
- package/dist/client/assets/{choose-editor-CFG57I6q.js → choose-editor-DTrZOsuM.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-BSv2g-ym.js → claim-phase-copy-7jmcIMfh.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BIJI3t9e.js → cli-auth-success-DsI7ktWj.js} +1 -1
- package/dist/client/assets/{client-icons-QrygHEbs.js → client-icons-DuciELoj.js} +1 -1
- package/dist/client/assets/{collapsible-NwNuo4WV.js → collapsible-DhA_7QTn.js} +1 -1
- package/dist/client/assets/{collection-detail-8fBObBKa.js → collection-detail-DvEGFSkK.js} +1 -1
- package/dist/client/assets/{collection-display-button-DQK-3s_t.js → collection-display-button-DUIKnbkF.js} +1 -1
- package/dist/client/assets/{collection-search-DKzCc0c3.js → collection-search-vcbSqk-s.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Oiiueqj2.js → collection-table-wrapper-BGS1IqHf.js} +1 -1
- package/dist/client/assets/{collection-tabs-BZH6m3wo.js → collection-tabs-G5T7wrxp.js} +1 -1
- package/dist/client/assets/{combobox-BjIwXkTw.js → combobox-DQWUplf-.js} +1 -1
- package/dist/client/assets/{command-B-F--EKi.js → command-DsgrxpbN.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-C7OO5knu.js → companion-mcps-section-ANNEAQlV.js} +1 -1
- package/dist/client/assets/{config-PG_e0-lM.js → config-BXLj-SUT.js} +1 -1
- package/dist/client/assets/{connect-DLYQJKxe.js → connect-BBlSuIqt.js} +1 -1
- package/dist/client/assets/{connect-layout-V_qHgxn2.js → connect-layout-hgdtcozj.js} +1 -1
- package/dist/client/assets/{connection-CD_W2qVv.js → connection-C9en2nsC.js} +1 -1
- package/dist/client/assets/{connection-card-Dx_tc9Bp.js → connection-card-BcX_TVU3.js} +1 -1
- package/dist/client/assets/{connection-detail-B_deSQLd.js → connection-detail-Cm6R8xBL.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CoEVyV10.js → connection-form-helpers--MSRlihS.js} +1 -1
- package/dist/client/assets/{connections-BOrP9X7R.js → connections-qV059Fy8.js} +1 -1
- package/dist/client/assets/{context-D0ZURMNn.js → context-BaQeVRiX.js} +1 -1
- package/dist/client/assets/{context-menu-DruTRnr3.js → context-menu-D7mMFtgb.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-dAG3j28t.js → create-organization-dialog-COVrN686.js} +1 -1
- package/dist/client/assets/{daily-pulse-BC54kOax.js → daily-pulse-BJq_Ru4B.js} +1 -1
- package/dist/client/assets/{decopilot-DPdeuC8p.js → decopilot-BWONoIQf.js} +1 -1
- package/dist/client/assets/{dialog-C7KZWChV.js → dialog-BznjKiRY.js} +1 -1
- package/dist/client/assets/{discover-DIiJwuht.js → discover-7KoGBvTE.js} +1 -1
- package/dist/client/assets/{domain-settings-YMlwSd9r.js → domain-settings-D8GVoKSb.js} +1 -1
- package/dist/client/assets/{download-app-dialog-D9IS-1mV.js → download-app-dialog-DoDz4zun.js} +1 -1
- package/dist/client/assets/{drawer-CcFNYv8T.js → drawer-B6sE6f7P.js} +1 -1
- package/dist/client/assets/{editor-DSoL6cNz.js → editor-D6TpDkcA.js} +1 -1
- package/dist/client/assets/{empty-state-Dq78ewuc.js → empty-state-B8ccHWsW.js} +1 -1
- package/dist/client/assets/{empty-state-2T0ndAGm.js → empty-state-CVVu5AVn.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DbRkPaOw.js → extract-connection-data-Bv2WkdTB.js} +1 -1
- package/dist/client/assets/{feature-gate-C1eBrQFm.js → feature-gate-HBbDX_TF.js} +1 -1
- package/dist/client/assets/{feature-paywall-D41mPySx.js → feature-paywall-B7ebNl1W.js} +1 -1
- package/dist/client/assets/{file-explorer-CAR5BJfK.js → file-explorer-CnMuqXal.js} +1 -1
- package/dist/client/assets/{file-preview-DZsS6-t1.js → file-preview-DGKbjCTE.js} +1 -1
- package/dist/client/assets/{file-share-button-Ru3-ztek.js → file-share-button-ETbgE7dQ.js} +1 -1
- package/dist/client/assets/{file-type-icon-CbvnxoFL.js → file-type-icon-C7QmtAGh.js} +1 -1
- package/dist/client/assets/flat-project-BkaYGwp0.js +1 -0
- package/dist/client/assets/{folder-icon-i-NAr8TG.js → folder-icon-URgn8Tw-.js} +1 -1
- package/dist/client/assets/{form-o9MJYHPF.js → form-CBlilZhp.js} +1 -1
- package/dist/client/assets/{gateway-client-C1CSAhxD.js → gateway-client-A5n0t7PH.js} +1 -1
- package/dist/client/assets/{general-Dy6ZZHxc.js → general-Cmlz8p9V.js} +1 -1
- package/dist/client/assets/{home-CaeUWvNd.js → home-BEjLgcEz.js} +1 -1
- package/dist/client/assets/{icon-button-BGMoV4NE.js → icon-button-Dy6oPcnk.js} +1 -1
- package/dist/client/assets/{index-Dbf4KTKc.js → index-BGdr5Wni.js} +1 -1
- package/dist/client/assets/{index-B4lIS8iH.js → index-BunKYTux.js} +1 -1
- package/dist/client/assets/{index-DNA9-sQK.js → index-C5DvSSdP.js} +1 -1
- package/dist/client/assets/{index-B845PPBZ.js → index-CJVime3H.js} +1 -1
- package/dist/client/assets/{index-DlW0hhOh.js → index-CLODCBHz.js} +1 -1
- package/dist/client/assets/{index-250bIbpJ.js → index-CPYFR8WQ.js} +1 -1
- package/dist/client/assets/{index-D9GSqgpC.js → index-CR-MIEa1.js} +1 -1
- package/dist/client/assets/{index-C-lMlSVz.js → index-CXW-1Dof.js} +1 -1
- package/dist/client/assets/{index-CwdnUaLB.js → index-CcC1h0lc.js} +3 -3
- package/dist/client/assets/{index-D00PMmrV.js → index-D2-H81h5.js} +1 -1
- package/dist/client/assets/{index-BpqBtgV9.js → index-DjOnrXC0.js} +1 -1
- package/dist/client/assets/{index-B-9dkNI2.js → index-P-mrsIrh.js} +1 -1
- package/dist/client/assets/{index-BcCPw8Y5.js → index-ScJQZLnv.js} +1 -1
- package/dist/client/assets/{index-B_GQbfJ4.js → index-f39IHbs-.js} +2 -2
- package/dist/client/assets/{index-redirect-BNUi4Xi9.js → index-redirect-DxJRX39r.js} +1 -1
- package/dist/client/assets/{index-PVbuxtc9.js → index-tUrogJm7.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-UXeUCJwN.js → infiniteQueryObserver-Dg3VmoCf.js} +1 -1
- package/dist/client/assets/{infra-billing-MGzxJhSq.js → infra-billing-Qj8V1Cdf.js} +1 -1
- package/dist/client/assets/{input-nvwr4_OQ.js → input-C7CtVR9B.js} +3 -3
- package/dist/client/assets/{input-CB512_rC.js → input-CPZgZmM_.js} +1 -1
- package/dist/client/assets/{input-DEuGHHla.js → input-CYc9CZTL.js} +1 -1
- package/dist/client/assets/{integration-icon-B9Q5_D9d.js → integration-icon-CJAhW3rI.js} +1 -1
- package/dist/client/assets/{label-BJSAKjPP.js → label-ZHwIbvCi.js} +1 -1
- package/dist/client/assets/{last-preview-page-D7XF6szw.js → last-preview-page-DLNlrcu7.js} +1 -1
- package/dist/client/assets/{layout-BDsxRPzS.js → layout-r6ui8W4A.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DaWAI8FA.js → legacy-agents-deep-F5KtYAqL.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-DU1vvsJZ.js → legacy-main-redirect-B05Sf3jP.js} +1 -1
- package/dist/client/assets/library-nAsUyO4m.js +1 -0
- package/dist/client/assets/{library-tab-B4N7jsKL.js → library-tab-CDcrtqRd.js} +1 -1
- package/dist/client/assets/{login-pHJBSy0b.js → login-Ci0zpT3U.js} +1 -1
- package/dist/client/assets/{markdown-hjTMBs3N.js → markdown-BdF7bf7e.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DFC5Ihaw.js → mcp-app-renderer-CSv506Jo.js} +1 -1
- package/dist/client/assets/{mcp-oauth-w8gAEr5X.js → mcp-oauth-BY4yvCaZ.js} +1 -1
- package/dist/client/assets/{members-Dpx48Nm6.js → members-BMIQIXzt.js} +1 -1
- package/dist/client/assets/{message-templates-C1ggzebt.js → message-templates-Ds9pej3A.js} +1 -1
- package/dist/client/assets/{mini-report-page-C_1J6sTc.js → mini-report-page-CtA0AqYC.js} +1 -1
- package/dist/client/assets/{mock-board-PSqtUs5M.js → mock-board-Bvv8IHKW.js} +1 -1
- package/dist/client/assets/{monaco-editor-D61JSaZf.js → monaco-editor-CRvwNvU3.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CCbpBYuM.js → monitoring-stats-row-CzkQQr_L.js} +1 -1
- package/dist/client/assets/{multi-select-CnqsUOVG.js → multi-select-CwupK_Vj.js} +1 -1
- package/dist/client/assets/{mustache-DuTQYlGx.js → mustache-BMIkDVKD.js} +1 -1
- package/dist/client/assets/{new-project-dialog-CGeywAqh.js → new-project-dialog-UxfAUjgw.js} +1 -1
- package/dist/client/assets/{oauth-callback-Dqa2owgf.js → oauth-callback-4QMDJBya.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CXTDQIQz.js → oauth-callback-ai-provider-DYBPMC6J.js} +1 -1
- package/dist/client/assets/{onboarding-k_7VUEOz.js → onboarding-CMEO3jyC.js} +1 -1
- package/dist/client/assets/{openai-conversation-CvWdK2DK.js → openai-conversation-CoBgv232.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-BWHSgfde.js → optimistic-project-sidebar-views-CVgrPSX-.js} +1 -1
- package/dist/client/assets/{org-file-open-context-BRc0HlC-.js → org-file-open-context-D4Slnz3H.js} +1 -1
- package/dist/client/assets/{organization-choice-CkcrQ-jk.js → organization-choice-CZHPVIgD.js} +1 -1
- package/dist/client/assets/{orgs-CT_IvRnq.js → orgs-F1JkqYSU.js} +1 -1
- package/dist/client/assets/{page-seo-form-_GhFRP9j.js → page-seo-form-5W5GZ3a_.js} +1 -1
- package/dist/client/assets/{pair-CGDsxmdV.js → pair-Clr7z8zc.js} +1 -1
- package/dist/client/assets/{plan-ladder-ChO9RKYO.js → plan-ladder-DR92oz2Q.js} +1 -1
- package/dist/client/assets/{popover-BfGmiBpE.js → popover-DFDkI7HF.js} +1 -1
- package/dist/client/assets/{post-calendar-De_ERymj.js → post-calendar-B54Q30LR.js} +1 -1
- package/dist/client/assets/{post-editor-DJs9s-q8.js → post-editor-CUSGyuhT.js} +1 -1
- package/dist/client/assets/{preview-content-C8dSFa7D.js → preview-content-mqI20uXy.js} +1 -1
- package/dist/client/assets/{preview-dialog-IVqdpCJl.js → preview-dialog-D73XdTrk.js} +1 -1
- package/dist/client/assets/{profile-BAX-gAQE.js → profile-CVt134wv.js} +1 -1
- package/dist/client/assets/{project-app-view-CFrdOIz6.js → project-app-view-BqK6jpfJ.js} +1 -1
- package/dist/client/assets/{project-feed-CVBvXG-Y.js → project-feed-DzoKJOdZ.js} +1 -1
- package/dist/client/assets/{project-icon-C9ROJoEg.js → project-icon-MntXC2t2.js} +1 -1
- package/dist/client/assets/project-reports-BbDcNujC.js +1 -0
- package/dist/client/assets/project-tasks-XmJmmvgX.js +1 -0
- package/dist/client/assets/{projects-empty-state-C8zgAFJY.js → projects-empty-state-BfZm5iE9.js} +1 -1
- package/dist/client/assets/{projects-BpfTSGLx.js → projects-lRJbeof_.js} +1 -1
- package/dist/client/assets/{prompts-YrrFIYzw.js → prompts-DYhtQhYh.js} +1 -1
- package/dist/client/assets/record-editor-nQxTrVjl.js +1 -0
- package/dist/client/assets/{redirect-editor-CC7_zjFk.js → redirect-editor-tG9stQvh.js} +1 -1
- package/dist/client/assets/{reports-BWg7Thh6.js → reports-Cp4AyPss.js} +1 -1
- package/dist/client/assets/reports-DKVruZnX.js +1 -0
- package/dist/client/assets/{reports-onboarding-D2-ccByp.js → reports-onboarding-fTUxzk5g.js} +1 -1
- package/dist/client/assets/{reports-tab-DGy8IiSl.js → reports-tab-C5rQA9j-.js} +2 -2
- package/dist/client/assets/{repositories-CZ19noNH.js → repositories-CfEuXF6c.js} +1 -1
- package/dist/client/assets/{repository-binding-Dwq7JZIx.js → repository-binding-DIPzyHMN.js} +1 -1
- package/dist/client/assets/{repository-import-picker-CJLbxphl.js → repository-import-picker-BrYWj8Sv.js} +1 -1
- package/dist/client/assets/{repository-picker-D1W4EaK-.js → repository-picker-0sYOPc_k.js} +1 -1
- package/dist/client/assets/{require-capability-_SzpmTyW.js → require-capability-Ck9lPTP2.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DSnywThK.js → required-auth-layout-DlCb1jZe.js} +1 -1
- package/dist/client/assets/{reset-password-BupPZWkO.js → reset-password-Da2RG3dF.js} +1 -1
- package/dist/client/assets/{resizable-3RkIPmow.js → resizable-CVfKa5BF.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-uTTf3ivB.js → resolve-tab-icon-C7ijqo28.js} +1 -1
- package/dist/client/assets/{review-settings-C2tfl9iq.js → review-settings-BSYDGael.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-DFPy4gwt.js → rich-text-link-control-xmLap9VX.js} +1 -1
- package/dist/client/assets/{roles-stCYqSJy.js → roles-Czoo9Xd_.js} +1 -1
- package/dist/client/assets/route-B88uRxxr.js +1 -0
- package/dist/client/assets/route-DE2WvAoz.js +1 -0
- package/dist/client/assets/{route-BXzpqDMq.js → route-iNmc9mGd.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-DiVfTIi2.js → runnable-block-editor-LemNiMQU.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-DmTuYXjO.js → sandbox-lifecycle-context-B2HVF9Cd.js} +1 -1
- package/dist/client/assets/{schema-0ivljl6L.js → schema-CiNjZ572.js} +1 -1
- package/dist/client/assets/{scroll-area-JiOebFwe.js → scroll-area-DgAgpCLV.js} +1 -1
- package/dist/client/assets/{search-input-D49Nja-x.js → search-input-Be3bcvAe.js} +1 -1
- package/dist/client/assets/{search-toggle-DJy-QTfe.js → search-toggle-DP2M7UdF.js} +1 -1
- package/dist/client/assets/{secret-picker-C6_xAm3c.js → secret-picker-D4INmrmq.js} +1 -1
- package/dist/client/assets/{secrets-Dz6Ulr5L.js → secrets-37nsP7Y0.js} +1 -1
- package/dist/client/assets/{sections-editor-MpIoijPg.js → sections-editor-BRxgIuOd.js} +1 -1
- package/dist/client/assets/{select-Bu6E3ch5.js → select-Bfo3T2tj.js} +1 -1
- package/dist/client/assets/{select-model-50cB_fTg.js → select-model-JC6yUvd7.js} +1 -1
- package/dist/client/assets/{seo-editor-DL9OQz4O.js → seo-editor-Bi35wszY.js} +1 -1
- package/dist/client/assets/{separator-DEn-xU6l.js → separator-B1D5Frt5.js} +1 -1
- package/dist/client/assets/{settings-tab-DwTuUdCe.js → settings-tab-QHUvTbkB.js} +1 -1
- package/dist/client/assets/{sheet-CELtmosE.js → sheet-DlJ3skV8.js} +1 -1
- package/dist/client/assets/{shell-layout-DrU9JC6X.js → shell-layout-CdgXHcFx.js} +1 -1
- package/dist/client/assets/{skills--xCnmDpX.js → skills-hOJsLnWs.js} +1 -1
- package/dist/client/assets/{sso-DgHqE_bb.js → sso-TR9V1h6b.js} +1 -1
- package/dist/client/assets/{suggestion-Dd0-EjDI.js → suggestion-pNUkmmQu.js} +1 -1
- package/dist/client/assets/{switch-C-L8ou5g.js → switch-D_YBFGTY.js} +1 -1
- package/dist/client/assets/{synced-repos-DGZxUv6K.js → synced-repos-BJy9OaWa.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-C0B4DLlE.js → tab-icon-glyph-BITVpvCO.js} +1 -1
- package/dist/client/assets/{table-kpi0hwgB.js → table-DfYRCksX.js} +1 -1
- package/dist/client/assets/{tabs-rdq6Mai0.js → tabs-QyCMiVpV.js} +1 -1
- package/dist/client/assets/{task-board-CreQNsGw.js → task-board-B1f0xPT9.js} +1 -1
- package/dist/client/assets/{task-route-CLvzlgrs.js → task-route-DuBSThnJ.js} +1 -1
- package/dist/client/assets/{task-status-BxR7OUFQ.js → task-status-B5axvsgk.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-CHkrX3I0.js → taskboard-analytics-Psf83NOY.js} +1 -1
- package/dist/client/assets/{tasks-DN9JUILj.js → tasks-DVu6deLO.js} +1 -1
- package/dist/client/assets/tasks-hnQGtxMG.js +1 -0
- package/dist/client/assets/{textarea-FncP6dZx.js → textarea-D74f_08r.js} +1 -1
- package/dist/client/assets/{thread-analytics-CpFJEMJu.js → thread-analytics-Cp_ROQKy.js} +1 -1
- package/dist/client/assets/{thread-intent-B6S93f1l.js → thread-intent-D8xEg1cX.js} +1 -1
- package/dist/client/assets/{thread-route-CeLeNbYj.js → thread-route-CLehskDo.js} +1 -1
- package/dist/client/assets/{thread-route-CKd0J-tY.js → thread-route-DQUa1SUf.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-YXoH4JHG.js → thread-sheet-body-BA6E1Y0N.js} +1 -1
- package/dist/client/assets/{toggle-group-6WPswneT.js → toggle-group-CtYGVDHt.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DSRiZ9ad.js → toolbar-icon-button-D1OYT6V_.js} +1 -1
- package/dist/client/assets/{tooltip-CwRl311h.js → tooltip-BHH6aqLS.js} +1 -1
- package/dist/client/assets/{track-DZMk38J5.js → track-ClyPnS3q.js} +1 -1
- package/dist/client/assets/{types-DW-ppwD1.js → types-lMvXvvPD.js} +1 -1
- package/dist/client/assets/{usage-stats-QdHJFC8U.js → usage-stats-CwmFwoim.js} +1 -1
- package/dist/client/assets/{use-ai-providers-rTlIRmQg.js → use-ai-providers-C3Q1VUYq.js} +1 -1
- package/dist/client/assets/{use-automations-EdVaoqEh.js → use-automations-gIdbhmry.js} +1 -1
- package/dist/client/assets/{use-autosave-DmN0Re7w.js → use-autosave-CxN99VaB.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-Drzc28-j.js → use-chat-layout-state-CKnLcfEg.js} +1 -1
- package/dist/client/assets/{use-connect-companion-C-CM2JGw.js → use-connect-companion-9Lmr4XR7.js} +1 -1
- package/dist/client/assets/{use-connection-ulWyp7Y5.js → use-connection-DdOS0ZCi.js} +1 -1
- package/dist/client/assets/{use-copy-CukC-xyC.js → use-copy-DkzJN0jC.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-MKqwwGnL.js → use-create-virtual-mcp-DTzyq_Du.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-CtzIH3Kp.js → use-date-fns-locale-wamRBL3Q.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CxjpMact.js → use-debounced-autosave-D1l1-OCx.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BJ5fTKyU.js → use-debounced-value-1di6Y1DY.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DppZlA6t.js → use-deco-credits-DkKPzrXt.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-C2238fKr.js → use-decopilot-events-DoOOc2MM.js} +1 -1
- package/dist/client/assets/{use-delete-connection-V-nW9SZP.js → use-delete-connection-G21UcXVZ.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-D9Z0X3B-.js → use-deployment-admin-BmhvJjWc.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-Dx8vZX49.js → use-fast-preview-draft-url-DYEcK7H7.js} +1 -1
- package/dist/client/assets/{use-file-configs-B6EBBsLD.js → use-file-configs-Tbk4brg3.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BJA3too6.js → use-infinite-scroll-DJ8Ch_2u.js} +1 -1
- package/dist/client/assets/{use-join-requests-ChAVyjmW.js → use-join-requests-D7yVl0ra.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-vJDjnxV5.js → use-main-panel-tabs-BmGCxDyv.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BiaX93cm.js → use-mcp-auth-status-BtIgOdda.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BWWPxM_H.js → use-mcp-client-C0_CZY2c.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-5TpAEFDN.js → use-mcp-prompts-jWqVXo_B.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-C9mqk8uS.js → use-mcp-tools-B2UD4-_a.js} +1 -1
- package/dist/client/assets/{use-members-XGKulIpr.js → use-members-BFThE7IB.js} +1 -1
- package/dist/client/assets/{use-mobile-CwEFgTis.js → use-mobile-wCYqTMWw.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BeWCLhWg.js → use-navigate-to-agent-CIcFb7om.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-BRH_LC9G.js +1 -0
- package/dist/client/assets/{use-open-billing-url-B3oW6y0m.js → use-open-billing-url-BM_6Xh6a.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BHo4ya1h.js → use-org-auth-client-CY2BIZNy.js} +1 -1
- package/dist/client/assets/{use-org-fs-BUxrh40Y.js → use-org-fs-CNNLjgmD.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-Z1TrY4BD.js → use-org-repo-syncs-DXMB5tyN.js} +1 -1
- package/dist/client/assets/{use-org-sso-DygFbAQg.js → use-org-sso-AHQDmwq7.js} +1 -1
- package/dist/client/assets/{use-organization-roles-bNnivSME.js → use-organization-roles-WiGcRRl4.js} +1 -1
- package/dist/client/assets/{use-organization-settings-C6bRFij4.js → use-organization-settings-CJVvbGmg.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-DUSA5qgZ.js → use-panel-navigate-B1JIdNap.js} +1 -1
- package/dist/client/assets/{use-project-scope-Cx3T9gsS.js → use-project-scope-Cf6JTJYu.js} +1 -1
- package/dist/client/assets/{use-releases-pA5NejVO.js → use-releases-Cfo8zO6l.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-CBommizy.js → use-reports-diagnostic-C7cMbtvp.js} +1 -1
- package/dist/client/assets/{use-secrets-BuXdDTMj.js → use-secrets-5vpFjUC3.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-Bpy012eg.js → use-section-preview-base-CJqXSslf.js} +1 -1
- package/dist/client/assets/{use-session-runtime-D0f8Dmwu.js → use-session-runtime-jmKpEVDe.js} +1 -1
- package/dist/client/assets/{use-tags-fGMUwXfx.js → use-tags-BBVy2_bz.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-Cyco3WCb.js → use-task-board-analytics-L1fMR-qJ.js} +1 -1
- package/dist/client/assets/{use-task-board-events-Cbxa91DI.js → use-task-board-events-YwZ2_qcB.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DWeqPw6O.js → use-task-metadata-DYSdUtau.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-DkSnfRTB.js → use-thread-analytics-CCpmNjkr.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-HIyhSgqV.js → use-thread-outputs-D3fmLO2h.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B96wRC7s.js +1 -0
- package/dist/client/assets/{useQueries-ezz_Hbto.js → useQueries--DNOO-hz.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BFTiTIXi.js +1 -0
- package/dist/client/assets/{users-CRaajwYf.js → users-BjbU03ZE.js} +1 -1
- package/dist/client/assets/{utils-k2uW2hHg.js → utils-DEDJ7GpZ.js} +1 -1
- package/dist/client/assets/{variant-calendar-BI8AIRqT.js → variant-calendar-BWEknJCb.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-BO07IZYr.js → variant-matcher-override-CMO-WAFG.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DMIj8Ucr.js → view-mode-toggle-PhQ9SDlt.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CJzJsj0a.js → virtual-mcp-C4dGwnO-.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +969 -950
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/agent-app-Ct0ihq2x.js +0 -1
- package/dist/client/assets/agent-deck-wGgV3UWt.js +0 -1
- package/dist/client/assets/agent-library-file-1IZx_nhQ.js +0 -1
- package/dist/client/assets/agent-library-lJbIMwLP.js +0 -1
- package/dist/client/assets/agent-settings-CoTK5M6y.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CMQRLpud.js +0 -2
- package/dist/client/assets/agent-view-1eArGax-.js +0 -1
- package/dist/client/assets/api-keys-DlK-xE92.js +0 -1
- package/dist/client/assets/flat-project-r2ZWTGgT.js +0 -1
- package/dist/client/assets/library-DXGzmJrn.js +0 -1
- package/dist/client/assets/project-reports-EVr0KcKz.js +0 -1
- package/dist/client/assets/project-tasks-C3H36qjp.js +0 -1
- package/dist/client/assets/record-editor-5TaEqCrU.js +0 -1
- package/dist/client/assets/reports-AZ-myZ_p.js +0 -1
- package/dist/client/assets/route-CsrEA5wC.js +0 -1
- package/dist/client/assets/route-urXco5p9.js +0 -1
- package/dist/client/assets/tasks-Crjrs3PH.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-wfbDgRss.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BPUCkQDM.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Bt-g_sIC.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as X,r as o,ds as Ce,dq as De,c as Pe,e as Ae,d3 as ee,X as ye,j as Ee,K as M,z as _e}from"./index-
|
|
1
|
+
import{o as X,r as o,ds as Ce,dq as De,c as Pe,e as Ae,d3 as ee,X as ye,j as Ee,K as M,z as _e}from"./index-f39IHbs-.js";import{u as Le}from"./use-mcp-client-C0_CZY2c.js";import{u as Ue}from"./use-session-runtime-jmKpEVDe.js";import{u as Re,b as Oe}from"./chat-context-KKDqDnLJ.js";import{u as Be}from"./thread-intent-D8xEg1cX.js";import{e as ge}from"./backoff-8mStPHYB.js";import{b as Ne}from"./sandbox-url-D3mC8qhT.js";import{a as Fe}from"./repository-binding-DIPzyHMN.js";import{d as $e}from"./sandbox-start-errors-BK_aDCyt.js";function Ke(e,t){const n=X(t);return Ve({filters:{...e,status:"pending"}},n).length}function fe(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function Ve(e={},t){const n=X(t).getMutationCache(),s=o.useRef(e),u=o.useRef(null);return u.current===null&&(u.current=fe(n,e)),o.useEffect(()=>{s.current=e}),o.useSyncExternalStore(o.useCallback(c=>n.subscribe(()=>{const a=Ce(u.current,fe(n,s.current));u.current!==a&&(u.current=a,De.schedule(c))}),[n]),()=>u.current,()=>u.current)}async function qe(e,t,n){const s=await e.callTool({name:t,arguments:n});if(s.isError){const u=s.content?.[0]?.text??`Tool ${t} failed without a message`;throw new Error(u)}return s}const be=["SANDBOX_START"],W=new Map,He=e=>`${e.virtualMcpId}::${e.branch??""}`,Qe=e=>e.message.includes("retry shortly"),ie=new Set,le={mark:(e,t)=>ie.add(`${e}::${t}`),clear:(e,t)=>ie.delete(`${e}::${t}`),isStopped:(e,t)=>ie.has(`${e}::${t}`)};function Ye(e,t){const n=X();return Ae({mutationKey:be,retry:(s,u)=>Qe(u)&&s<6,retryDelay:s=>ge(5e3,500,s,2,0),mutationFn:async s=>{s.branch&&le.clear(s.virtualMcpId,s.branch);const u=He(s),c=W.get(u);if(c)return c;const a=(async()=>(await qe(e,"SANDBOX_START",s)).structuredContent)();W.set(u,a);try{return await a}finally{W.get(u)===a&&W.delete(u)}},onSuccess:()=>{ee(n),t?.onStarted?.()}})}function Rt(e,t){const n=Pe.c(3);let s;return n[0]!==t||n[1]!==e?(s={mutationKey:be,predicate:c=>{if(!e)return!1;const a=c.state.variables;return!a||a.virtualMcpId!==e?!1:(a.branch??"")===(t??"")}},n[0]=t,n[1]=e,n[2]=s):s=n[2],Ke(s)>0}function Se(e){return e==="installing"||e==="install-failed"||e==="starting"||e==="start-failed"||e==="running"||e==="crashed"}const Me={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},ve=o.createContext(Me),me=16384;class Xe{data="";append(t){this.data+=t,this.data.length>me&&(this.data=this.data.slice(this.data.length-me))}get(){return this.data}clear(){this.data=""}}const je=1e3,Ge=3e4,Ie=3e3,he=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],pe="log";function Je(e){if(!e)return null;try{return new URL("/_sandbox/events",e).href}catch{return null}}function We(e){return e===404}async function ze(e){try{const t=await fetch(e,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Ie)});return await t.body?.cancel().catch(()=>{}),We(t.status)}catch{return!1}}function gt({virtualMcpId:e,branch:t,previewUrl:n=null,enabled:s=!0,children:u}){const{org:c}=ye(),a=X(),V=Re()?.taskId??null,[j,y]=o.useState(null),[te,b]=o.useState({phase:"idle"}),[ne,U]=o.useState({state:"running"}),[re,E]=o.useState({kind:"unknown"}),[G,h]=o.useState(!1),[k,q]=o.useState([]),[se,R]=o.useState([]),[,H]=o.useState(0),v=o.useRef(new Map),O=o.useRef(new Set),w=o.useRef(new Set),C=o.useRef(null),p=Je(n),Q=Fe(e)?.metadata?.runtime?.selected==="deno",_=d=>{let S=v.current.get(d);return S||(S=new Xe,v.current.set(d,S)),S};o.useEffect(()=>{if(y(null),b({phase:"idle"}),U({state:"running"}),E({kind:"unknown"}),C.current=null,h(!1),q([]),R([]),v.current.clear(),!e||!t||!s)return;const d=Ne({orgSlug:c.slug,virtualMcpId:e,branch:t,threadId:V??null},"events");let S=!1,D=0,L=null,T=null,P=null,g=null,m=null,A=null;const I=r=>{try{const i=JSON.parse(r.data);y(i),i.kind!=="failed"&&(h(!1),D=0),i.kind==="ready"&&ae()}catch(i){console.warn("[vm-events] bad phase payload",i)}},B=()=>{h(!0),y(null),b({phase:"idle"}),U({state:"running"}),E({kind:"unknown"}),q([]),R([]),v.current.clear()},Y=r=>{try{const i=JSON.parse(r.data);if(typeof i.data!="string")return;D=0;const f=i.data.replace(/\r?\n/g,`\r
|
|
2
2
|
`);_(i.source).append(f);for(const l of O.current)try{l(i.source,f)}catch{}H(l=>l+1)}catch{}},J=r=>{const i=r.type;try{const f=JSON.parse(r.data);switch(D=0,i){case"lifecycle":{const l=f;b(l.state);const F=`${c.slug}/${e}/${t}`;if(Se(l.state.phase)&&!(A&&Se(A))){ee(a,c.id);const K=M.decofile(F);a.getQueryData(K)===void 0&&a.invalidateQueries({queryKey:K})}l.state.phase==="running"&&A!=="running"&&(ee(a,c.id),a.invalidateQueries({queryKey:M.decofile(F)}),a.invalidateQueries({queryKey:M.liveMeta(c.slug,e,t)})),A=l.state.phase;const $=l.state.phase==="running"?l.state.port:null,ce=C.current;if(C.current=$,ce!==null&&$!==null&&ce!==$)for(const K of w.current)try{K()}catch{}return}case"status":U(f);return;case"tasks":{const F=f.active.map($=>$.logName??"").filter(Boolean);R(F);return}case"scripts":q(f.scripts);return;case"branch":{const l=f.meta;E(l);return}case"reload":for(const l of w.current)try{l()}catch{}return;case"file-changed":{const{path:l}=f,F=`${c.slug}/${e}/${t}`;if(l.startsWith(".deco/")||l.includes("/.deco/")){if(!(A==="running"))return;P&&clearTimeout(P),P=setTimeout(()=>{if(P=null,a.invalidateQueries({queryKey:M.decofile(F)}),Q)for(const K of w.current)try{K()}catch{}},500)}else T&&clearTimeout(T),T=setTimeout(()=>{T=null,a.invalidateQueries({queryKey:M.liveMeta(c.slug,e,t)})},1e3);return}}}catch{}};function N(){if(S)return;const r=new EventSource(d);g=r,r.onopen=()=>{},r.onerror=()=>{g===r&&r.readyState===EventSource.CLOSED&&x("studio")},r.addEventListener("phase",I),r.addEventListener("gone",B),r.addEventListener(pe,Y);for(const i of he)r.addEventListener(i,J)}function ae(){if(S||!p||m)return;const r=new EventSource(p);m=r;let i=!1;r.onopen=()=>{if(S||m!==r)return;i=!0,D=0;const f=g;g=null,f?.close()},r.onerror=()=>{m===r&&r.readyState===EventSource.CLOSED&&ue(r,i)},r.addEventListener(pe,Y);for(const f of he)r.addEventListener(f,J)}async function ue(r,i){const f=p?await ze(p):!1;if(!(S||m!==r)){if(r.close(),m=null,f){B(),g||N();return}i&&x("direct")}}function x(r){if(S||L)return;const i=ge(Ge,je,D,2,0);D++,L=setTimeout(()=>{if(L=null,!S){if(r==="direct"){m?.close(),m=null,ae();return}g?.close(),g=null,N()}},i)}return N(),()=>{S=!0,g?.close(),m?.close(),L&&clearTimeout(L),T&&clearTimeout(T),P&&clearTimeout(P)}},[e,t,c.slug,c.id,s,V,p,a,Q]);const oe={phase:j,lifecycle:te,status:ne,branch:re,notFound:G,scripts:k,activeProcesses:se,getBuffer:d=>v.current.get(d)?.get()??"",hasData:d=>(v.current.get(d)?.get().length??0)>0,subscribeChunks:d=>(O.current.add(d),()=>{O.current.delete(d)}),subscribeReload:d=>(w.current.add(d),()=>{w.current.delete(d)})};return Ee.jsx(ve,{value:oe,children:u})}function de(){return o.use(ve)}function bt(e){const{subscribeChunks:t}=de(),n=o.useRef(e);n.current=e,o.useEffect(()=>t((c,a)=>{n.current?.(c,a)}),[t])}function vt(e){const{subscribeReload:t}=de(),n=o.useRef(e);n.current=e,o.useEffect(()=>t(()=>{n.current?.()}),[t])}function Ze(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 et(e){return e.executionEnabled&&e.sessionRuntime==="sandbox"&&e.hasActiveRepository&&!!e.userId&&!!e.branch&&!e.vmEntry&&!e.userStopped&&!e.isPending&&!e.attempted}function wt(e){return e.threadLoaded&&e.isOwner&&e.hasActiveRepository&&!e.branch&&!e.attempted}function tt(e){return e.executionEnabled&&e.notFound&&!!e.deadVmId&&!e.isPending&&!e.userStopped&&e.deadVmId!==e.lastDeadVmId}function Tt(e){const{agentSandboxMap:t,threadSandboxMap:n,userId:s,branch:u}=e,c=e.ownerId??s;if(!s||!c||!u)return t;const a=n?.[c]?.[u];return a?{...t??{},[s]:{...t?.[s]??{},[u]:a}}:t}function z(e,t,n){const s={virtualMcpId:e};return t&&(s.branch=t),n&&(s.threadId=n),s}const we=2,nt=new Set(["scheduling-timeout","reconciler-error","claim-never-created","unknown"]);function Te(e){return nt.has(e)}function rt(e){return e.executionEnabled&&e.failedReason!==null&&Te(e.failedReason)&&e.attempts<we&&!e.isPending&&!e.userStopped&&!e.alreadyHandled}const st={branch:null,count:0,handled:!1};function ot(e,t){return e.branch===t?e:{branch:t,count:0,handled:!1}}function at(e){return e.mutationError?e.mutationError:e.phase?.kind==="failed"&&!e.startPending&&e.claimRetryExhausted?{code:null,message:e.phase.message}:null}function ut(e){switch(e.kind){case"suspended":return"suspended";case"iframe":return"running";case"starting":return"starting";case"errored":return"errored"}}function xe(e,t){return`${e??""}::${t??""}`}function ct(e){const t=e.vmEntry?.previewUrl??null;return t||(e.seeded?.key===e.key?e.seeded.url:null)}function Z(e){const{data:t,virtualMcpId:n,branch:s}=e;t?.branch&&!s&&e.setCurrentTaskBranch(t.branch),t?.previewUrl&&e.setSeededPreviewUrl({key:xe(n,t.branch??s),url:t.previewUrl})}const it={branch:null,previewState:{kind:"starting"},status:"idle",vmEntry:null,previewUrl:null,userStopped:!1,start:()=>{},stop:async()=>{},restart:async()=>{},retry:()=>{},resume:()=>{}},ke=o.createContext(it);function xt(){return o.use(ke)}function kt({executionEnabled:e,virtualMcpId:t,branch:n,userId:s,hasActiveRepository:u,vmEntry:c,threadId:a,children:V}){const{org:j}=ye(),{setCurrentTaskBranch:y}=Oe(),te=Be(),b=de(),ne=X(),U=Ue(t),re=U.resolved?U.runtime:null,E=Re()?.taskId??null,G=Le({connectionId:_e,orgId:j.id,orgSlug:j.slug}),h=Ye(G,{onStarted:()=>{a&&te?.refreshThreadMetadata(a)}}),{mutate:k,reset:q}=h,[se,R]=o.useState(null),H=o.useRef(new Set),v=o.useRef(null),[O,w]=o.useState(st),C=ot(O,n);C!==O&&w(C);const p=b.phase?.kind==="failed"?b.phase:null,Q=ct({vmEntry:c,seeded:p?null:se,key:xe(t,n)}),_=!!t&&!!n&&le.isStopped(t,n),oe=b.status.state==="paused",d=!p||!Te(p.reason)||C.count>=we,S=at({mutationError:h.isError&&h.error?$e(h.error.message):null,phase:b.phase,startPending:h.isPending,claimRetryExhausted:d}),D=Ze({previewUrl:Q,appPaused:oe,userStopped:_,startError:S}),L=ut(D),T=n??"",P=H.current.has(T),g=et({executionEnabled:e,hasActiveRepository:u,userId:s,branch:n,vmEntry:c,userStopped:_,isPending:h.isPending,attempted:P,sessionRuntime:re});o.useEffect(()=>{if(!g||!t)return;H.current.add(T);const x=z(t,n,E);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:y,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] auto-start failed:",r)}})},[g,T,n,t,E,k,y,R]);const m=b.notFound?c?.sandboxHandle??null:null,A=tt({executionEnabled:e,notFound:b.notFound,deadVmId:m,lastDeadVmId:v.current,isPending:h.isPending,userStopped:_});o.useEffect(()=>{if(!A||!m||!t)return;v.current=m;const x=z(t,n,E);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:y,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] self-heal failed:",r)}})},[A,m,t,n,E,k,y,R]);const I=rt({executionEnabled:e,failedReason:p?.reason??null,attempts:C.count,isPending:h.isPending,userStopped:_,alreadyHandled:C.handled});o.useEffect(()=>{if(!p){w(r=>r.handled?{...r,handled:!1}:r);return}if(!I||!t)return;w(r=>({...r,handled:!0,count:r.count+1}));const x=z(t,n,E);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:y,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] claim auto-retry failed:",r)}})},[p,I,t,n,E,k,y,R]);const B=()=>{if(!e||!t)return;const x=z(t,n,E);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:y,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] user start failed:",r)}})},Y=async()=>{if(!(!e||!t||!n)&&c){le.mark(t,n);try{await G.callTool({name:"SANDBOX_DELETE",arguments:{virtualMcpId:t,branch:n}})}catch{}ee(ne)}},J=async()=>{await Y(),B()},N=()=>{H.current=new Set,v.current=null,w({branch:n,count:0,handled:!1}),q(),B()},ue={branch:n,previewState:D,status:L,vmEntry:c,previewUrl:Q,userStopped:_,start:B,stop:Y,restart:J,retry:N,resume:N};return Ee.jsx(ke,{value:ue,children:V})}export{gt as S,kt as a,Ye as b,de as c,xt as d,bt as e,vt as f,Ke as g,Tt as o,wt as s,Rt as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{au as n,bK as t,av as e,bL as m,bM as p,bN as d,bO as h}from"./index-
|
|
1
|
+
import{au as n,bK as t,av as e,bL as m,bM as p,bN as d,bO as h}from"./index-f39IHbs-.js";const s=500;n({title:e().max(s),url:e().max(s),icon:e().max(s)});const i=n({keyId:e().max(s),modelId:e().max(s),title:e().max(s).optional()}).nullable();m(["fast","smart","thinking","image","web_search","deep_research"]);m(["fast","smart","thinking"]);const y=n({tiers:n({fast:i,smart:i,thinking:i,image:i,web_search:i,deep_research:i})});n({tiers:n({fast:i.optional(),smart:i.optional(),thinking:i.optional()})});const v=50,b=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/;n({host:e().min(1).max(s).regex(b).describe("Git host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:e().min(1).max(s).describe("Vault secret id holding the PAT used to authenticate this host.")});n({ids:p(e().max(s)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const x=n({voice_mode:t().optional(),home_task_intake_enabled:t().optional().describe("Show Task mode on the Home composer and allow reports to start tasks."),demo_mode:t().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:t().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:t().optional().describe("Run the Reviewer on a task's pull request once it's 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:t().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:t().optional().describe("When the Reviewer approves a task's pull request, merge it automatically instead of leaving the merge to a human."),auto_resolve_conflicts:t().optional().describe("When an approved pull request 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:t().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:t().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 task-run 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:t().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."),auto_assign_report_tasks_to_super_agent:t().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:t().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:t().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:t().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:t().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."),monitor_enabled:t().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:t().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.'),delivery_lanes_enabled:t().optional().describe("Board lanes for shipping: Approved, Merged and Post-deploy Validation sit between In Review and Done, and a merged pull request lands on Merged instead of Done. For teams whose release process continues after the merge. Off by default — with it off the board and the state machine behave exactly as if the lanes did not exist."),new_blocks_editor:t().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.")}),u=new Set(["reviewer_enabled","cheap_reviewer_model"]);function w(a,r){const c=a?.[r];return u.has(r)?c!==!1:c===!0}function A(a){const r=a?.auto_resolve_conflicts;return typeof r=="boolean"?r:a?.auto_merge===!0}const l=256*1024,f=50,o=500,g=5e3;n({id:e().describe("Brand context ID"),name:e().max(o).describe("Company name"),domain:e().max(o).describe("Company domain (e.g. example.com)"),overview:e().max(g).describe("Company overview / description"),logo:e().max(o).nullable().optional().describe("Logo URL"),favicon:e().max(o).nullable().optional().describe("Favicon URL"),ogImage:e().max(o).nullable().optional().describe("OG image URL"),fonts:n({heading:e().max(o).optional().describe("Font family for headings"),body:e().max(o).optional().describe("Font family for body text"),code:e().max(o).optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:n({primary:e().max(o).optional().describe("Primary brand color (hex)"),secondary:e().max(o).optional().describe("Secondary brand color (hex)"),accent:e().max(o).optional().describe("Accent / highlight color (hex)"),background:e().max(o).optional().describe("Background color (hex)"),foreground:e().max(o).optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:p(d(e(),h())).max(f).nullable().optional().refine(a=>a==null||JSON.stringify(a).length<=l,{message:`images must serialize to at most ${l} bytes`}).describe("Brand images"),metadata:d(e(),h()).nullable().optional().refine(a=>a==null||JSON.stringify(a).length<=l,{message:`metadata must serialize to at most ${l} bytes`}).describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:e().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:t().optional().describe("Whether this is the default brand for the organization")});export{u as D,v as G,x as O,y as S,A as a,b,w as o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,bm as T,bq as ce,j as b,bo as _,bF as ae,dc as O,bp as C,bz as P,bu as ie,c as F,l as $}from"./index-B_GQbfJ4.js";import{e as de}from"./select-Bu6E3ch5.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),[A,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,W]=d.useState(!1),v=T(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:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:W,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=T(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(V,{...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(V,{"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(V,{"data-state":n?"visible":"hidden",...t,ref:e})})}),V=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=T(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=T(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,A]=d.useState(null),Y=T(e,v=>A(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 W(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"),W(v))}),onPointerMove:C(r.onPointerMove,W),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})})})}),H="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,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(H,o),s=ee(H,o),{onThumbPositionChange:a}=s,c=T(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,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=H;var B="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(B,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=B;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(B,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,bm as T,bq as ce,j as b,bo as _,bF as ae,dc as O,bp as C,bz as P,bu as ie,c as F,l as $}from"./index-f39IHbs-.js";import{e as de}from"./select-Bfo3T2tj.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),[A,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,W]=d.useState(!1),v=T(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:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:W,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=T(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(V,{...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(V,{"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(V,{"data-state":n?"visible":"hidden",...t,ref:e})})}),V=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=T(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=T(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,A]=d.useState(null),Y=T(e,v=>A(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 W(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"),W(v))}),onPointerMove:C(r.onPointerMove,W),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})})})}),H="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,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(H,o),s=ee(H,o),{onThumbPositionChange:a}=s,c=T(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,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=H;var B="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(B,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=B;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(B,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-f39IHbs-.js";import{i as v}from"./SearchMd-DIg_EfRC.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 B,j as a}from"./index-
|
|
1
|
+
import{c as K,r as C,l as B,j as a}from"./index-f39IHbs-.js";import{i as I}from"./SearchMd-DIg_EfRC.js";import{i as M}from"./X-DbvoChXn.js";import{I as O}from"./icon-button-Dy6oPcnk.js";function H(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,[L,p]=C.useState(t!==""),[R,z]=C.useState(!1),[V,$]=C.useState(t);if(t!==V&&($(t),t===""&&!R&&p(!1)),!L&&!o){let l,g;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>p(!0),g=a.jsx(I,{}),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=B("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(I,{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=()=>z(!0),e[10]=h):h=e[10];let i;e[11]!==t?(i=()=>{z(!1),t===""&&p(!1)},e[11]=t,e[12]=i):i=e[12];let c;e[13]!==s?(c=l=>{l.key==="Escape"&&s("")},e[13]=s,e[14]=c):c=e[14];const N=o?"text-sm":"text-xs";let f;e[15]!==N?(f=B("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]!==i||e[19]!==c||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:i,onKeyDown:c,placeholder:d,"aria-label":d,className:f}),e[17]=d,e[18]=i,e[19]=c,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{H 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-f39IHbs-.js";import{s as j}from"./User01-CBT9xTuN.js";import{t as E}from"./Users01-DFZY90Ue.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,fn as $,E as F,r as N,aS as L,B as D,a6 as E,t as _}from"./index-
|
|
1
|
+
import{c as j,b as y,j as s,n as C,fn as $,E as F,r as N,aS as L,B as D,a6 as E,t as _}from"./index-f39IHbs-.js";import{i as O}from"./AlertCircle-XbZvoIme.js";import{s as B}from"./Plus-D2NCmLMx.js";import{s as A}from"./User01-CBT9xTuN.js";import{t as R}from"./Users01-DFZY90Ue.js";import{D as I,b as q,c as V,d as H,h as G,e as J}from"./dialog-BznjKiRY.js";import{I as z}from"./input-CPZgZmM_.js";import{L as w}from"./label-ZHwIbvCi.js";import{S as K,b as M,a as Q,d as U,c as P}from"./select-Bfo3T2tj.js";import{T as W}from"./textarea-D74f_08r.js";import{u as X,a as Y}from"./use-secrets-5vpFjUC3.js";import{R as Z}from"./require-capability-Ck9lPTP2.js";import"./X-DbvoChXn.js";import"./index-tUrogJm7.js";import"./Check-BF-m6KVY.js";import"./ChevronUp-B_dZipHr.js";import"./access-gate-iiCKuWh8.js";import"./capability-load-error-D9RMJc6U.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(O,{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"?A:R;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(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(E,{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(E,{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}),_.success(r("settings.secrets.secretCreated",{name:n.trim()})),p()}catch(f){_.error(f instanceof Error?f.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(I,{open:t,onOpenChange:u=>{u?e(u):p()},children:s.jsxs(q,{className:"sm:max-w-lg",children:[s.jsxs(V,{children:[s.jsx(H,{children:r("settings.secrets.newSecretTitle")}),s.jsx(G,{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(K,{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(z,{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(z,{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(J,{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(B,{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(T,{secret:t},t.id)}function ie(t){return s.jsx(T,{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($,{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 ze(){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{ze as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Jt,b as Yt,r as k,l as ne,j as n,aR as ho,B as Vt,G as Kt,al as go,I as vo,H as So,o as yo,h as bo,t as N,K as xo}from"./index-B_GQbfJ4.js";import{u as _o}from"./chat-context-BeJu-9nF.js";import{u as ps}from"./use-new-blocks-editor-wfbDgRss.js";import{J as aa,K as jo,L as Eo,N as ko,O as wo,Q as oa,T as Ro,U as Vo,V as To,W as No,X as Ao,Y as Kn,Z as Mo,_ as Po,H as Rt,$ as Cs,a0 as Ks,a1 as xt,D as us,z as ds,a2 as Lt,e as Do,f as Co,j as Ko,u as Bo,a3 as Bn,a4 as Lo,a5 as Fo,a6 as Io,a7 as Oo,a8 as zo,p as is,a9 as $o,C as kt,aa as qt,ab as Ho,ac as Go,ad as tt,ae as Ln,x as Fn,af as qo,ag as As,ah as Wo,ai as ls,aj as In,ak as On,al as zn,am as Ms,I as bt,an as Wt,ao as Uo,ap as Jo,A as Yo,aq as $n,ar as Qo,as as Hn,at as Gn,M as Xo,au as qn,av as lt,aw as Zo,ax as er,G as tr,ay as sr,d as nr,az as Wn,aA as ar,aB as wt,aC as or,aD as rr,aE as ir,aF as Un,aG as Ut,aH as lr,aI as cr,aJ as ur,aK as dr,aL as mr,aM as fr,aN as pr,aO as Ps,aP as hr,aQ as gr,aR as vr,aS as Sr,aT as yr}from"./runnable-block-editor-DiVfTIi2.js";import{f as br}from"./repository-binding-Dwq7JZIx.js";import{n as xr,t as _r}from"./ChevronUp-CS6cAw-m.js";import{a4 as ra,b as fs,ah as jr,x as Er,Y as Jn,G as Yn}from"./agent-icon-YlfaZ_bB.js";import{S as Bt}from"./scroll-area-JiOebFwe.js";import{b as ct,T as ut,a as dt}from"./tooltip-CwRl311h.js";import{m as kr,u as wr,P as Rr}from"./mustache-DuTQYlGx.js";import{b as Is,G as Vr,e as Tr,j as Nr,g as Ar,r as cs,X as Qn,Q as Mr}from"./claim-phase-copy-BSv2g-ym.js";import{a as Pr}from"./Copy01-DxUtxQJf.js";import{a as Bs,d as ia}from"./UserSquare-CpvurJvE.js";import{b as Xn}from"./Tool01-B-GeYbOl.js";import{s as Zn}from"./Image01-BIN_EGim.js";import{s as Dr}from"./Plus-CXLWqdUi.js";import{s as Cr}from"./Trash01-DCuU-TO1.js";import{i as Ls}from"./ZoomOut-C_UybJsX.js";import{a as Kr,b as ea,d as Br,K as Lr,P as Fr,u as Ir,C as Or,s as zr,e as ms,D as $r,c as Hr,S as Gr,v as qr}from"./rich-text-link-control-DFPy4gwt.js";import{a as Wr,P as ta,b as Ur}from"./page-seo-form-_GhFRP9j.js";import{u as Jr,A as Yr}from"./use-section-preview-base-Bpy012eg.js";import{b as sa,a as Qr}from"./variant-matcher-override-BO07IZYr.js";import"./use-panel-navigate-DUSA5qgZ.js";import"./thread-route-CeLeNbYj.js";import"./use-project-scope-Cx3T9gsS.js";import"./autosend-BTYvqInV.js";import"./thread-intent-B6S93f1l.js";import"./use-mcp-client-BWWPxM_H.js";import"./auth-D7nGP-WI.js";import"./backoff-8mStPHYB.js";import"./task-board-CreQNsGw.js";import"./schema-0ivljl6L.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-decopilot-events-C2238fKr.js";import"./use-ai-providers-rTlIRmQg.js";import"./location-DPIrGNp7.js";import"./use-organization-settings-C6bRFij4.js";import"./use-session-runtime-D0f8Dmwu.js";import"./Sun-mRbBp_4T.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-CGDsxmdV.js";import"./ArrowRight-BTAZM0Ij.js";import"./Check-DIF4jj4B.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-NwNuo4WV.js";import"./use-copy-CukC-xyC.js";import"./usage-stats-QdHJFC8U.js";import"./markdown-hjTMBs3N.js";import"./dialog-C7KZWChV.js";import"./X-B0JPynZq.js";import"./org-file-open-context-BRc0HlC-.js";import"./use-mobile-CwEFgTis.js";import"./shell-layout-DrU9JC6X.js";import"./avatar-C17PCkOS.js";import"./User01-BZw2NouY.js";import"./Palette-DggabiBL.js";import"./XClose-DyG0hQfD.js";import"./download-app-dialog-D9IS-1mV.js";import"./CheckCircle-P8cxOWEE.js";import"./Monitor01-CqReyFma.js";import"./command-B-F--EKi.js";import"./index-250bIbpJ.js";import"./SearchMd-ctfjl1FW.js";import"./integration-icon-B9Q5_D9d.js";import"./project-icon-C9ROJoEg.js";import"./new-project-dialog-CGeywAqh.js";import"./ArrowLeft-C0DToker.js";import"./input-CB512_rC.js";import"./label-BJSAKjPP.js";import"./repository-import-picker-CJLbxphl.js";import"./use-navigate-to-agent-BeWCLhWg.js";import"./repository-picker-D1W4EaK-.js";import"./LinkExternal01-CYa5EQLc.js";import"./useInfiniteQuery-BPUCkQDM.js";import"./infiniteQueryObserver-UXeUCJwN.js";import"./collection-search-DKzCc0c3.js";import"./ShoppingBag01-EJMIdp90.js";import"./use-debounced-value-BJ5fTKyU.js";import"./required-auth-layout-DSnywThK.js";import"./use-org-sso-DygFbAQg.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-DFC5Ihaw.js";import"./types-DW-ppwD1.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-C1CSAhxD.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./AlertCircle-CluHBBJz.js";import"./sheet-CELtmosE.js";import"./use-connection-ulWyp7Y5.js";import"./Link01-BfTVY3h_.js";import"./use-mcp-prompts-5TpAEFDN.js";import"./index-Dbf4KTKc.js";import"./form-o9MJYHPF.js";import"./use-thread-outputs-HIyhSgqV.js";import"./file-type-icon-CbvnxoFL.js";import"./popover-BfGmiBpE.js";import"./utils-k2uW2hHg.js";import"./monaco-editor-D61JSaZf.js";import"./editor-DSoL6cNz.js";import"./calendar-MmytmDrx.js";import"./textarea-FncP6dZx.js";import"./select-Bu6E3ch5.js";import"./index-PVbuxtc9.js";import"./switch-C-L8ou5g.js";import"./combobox-BjIwXkTw.js";import"./alert-dialog-D6TKfZxD.js";import"./sandbox-url-D3mC8qhT.js";import"./Upload01-CoI3wIgf.js";import"./DotsVertical-BD_FArKy.js";import"./search-input-D49Nja-x.js";import"./tabs-rdq6Mai0.js";import"./use-file-configs-B6EBBsLD.js";import"./asset-utils-2GPH14oX.js";import"./use-chat-layout-state-Drzc28-j.js";import"./site-slug-DebpOoQq.js";import"./toggle-group-6WPswneT.js";import"./sandbox-git-api-B1R0585s.js";import"./ArrowUp-D9zmSnBg.js";import"./CreditCard01-vcF3-oXu.js";import"./Key01-TuNVI2WF.js";import"./Users01-DdWpFPgu.js";import"./section-preview-url-Csj0_ZDg.js";function Xr(h){return h.schema?.definitions??h.schema?.$defs??{}}function la(h,e){const c=Xr(e),p=c[btoa(h)];if(!p)return[];const g=[p];if(Array.isArray(p.allOf)){const j=p.allOf.find(E=>typeof E.$ref=="string")?.$ref;if(typeof j=="string"){const E=c[j.replace("#/definitions/","")];E&&g.push(E)}}return g}function Zr(h,e){for(const c of la(h,e)){const p=typeof c.image=="string"?c.image:void 0;if(p?.includes("{{{"))return p}}function ei(h,e){if(!e)return;const c=aa(h);if(!c)return;const p=Zr(c.resolveType,e);if(!p)return;const g=jo(p,c.data);if(g)return Eo(g)}const ti={escape:ko};function si(h,e){for(const c of la(h,e)){const p=typeof c.title=="string"?c.title:void 0;if(p?.includes("{{"))return p}}function ni(h,e){if(!e)return;const c=aa(h);if(c)try{const p=si(c.resolveType,e);return p&&kr.render(p,c.data,{},ti).trim()||void 0}catch{return}}function ai(h){const e=Jt.c(13),{icon:c,label:p,className:g}=h;let j;e[0]!==g?(j=ne("size-3.5",g),e[0]=g,e[1]=j):j=e[1];let E;e[2]!==c||e[3]!==j?(E=n.jsx(c,{className:j}),e[2]=c,e[3]=j,e[4]=E):E=e[4];let y;e[5]!==p||e[6]!==E?(y=n.jsx(ut,{asChild:!0,children:n.jsx("span",{role:"img","aria-label":p,className:"shrink-0 cursor-help",children:E})}),e[5]=p,e[6]=E,e[7]=y):y=e[7];let R;e[8]!==p?(R=n.jsx(dt,{className:"max-w-56",children:p}),e[8]=p,e[9]=R):R=e[9];let b;return e[10]!==y||e[11]!==R?(b=n.jsxs(ct,{children:[y,R]}),e[10]=y,e[11]=R,e[12]=b):b=e[12],b}const oi="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 na(h){return Array.from({length:h},(e,c)=>({id:crypto.randomUUID(),index:c}))}function ca(h){return h.map((e,c)=>({...e,index:c}))}function ri(h,e){if(e===h.length)return h;if(e<h.length)return ca(h.slice(0,e));const c=Array.from({length:e-h.length},(p,g)=>({id:crypto.randomUUID(),index:h.length+g}));return[...h,...c]}function ua(h){const e=Jt.c(44),{section:c,raw:p,meta:g,decofile:j}=h,E=Yt(),y=ps(),R=c.isSavedBlock===!0,b=c.isMultivariate===!0;let Y;e[0]!==g||e[1]!==p?(Y=p&&g?ei(p,g):void 0,e[0]=g,e[1]=p,e[2]=Y):Y=e[2];const de=Y;let Ce;e[3]!==g||e[4]!==b||e[5]!==p||e[6]!==R?(Ce=p&&g&&!R&&!b?ni(p,g):void 0,e[3]=g,e[4]=b,e[5]=p,e[6]=R,e[7]=Ce):Ce=e[7];const Ke=Ce;let Ve;e[8]!==j||e[9]!==g||e[10]!==p||e[11]!==c?(Ve=Ao(p,c,j,g),e[8]=j,e[9]=g,e[10]=p,e[11]=c,e[12]=Ve):Ve=e[12];const ae=Ve;let r;e[13]!==b||e[14]!==p?.__resolveType?(r=!b&&Is(p?.__resolveType??""),e[13]=b,e[14]=p?.__resolveType,e[15]=r):r=e[15];const V=r,he=R?fs:b?ra:ia;let $;e[16]!==b||e[17]!==R?($=R?{color:Vr}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=b,e[17]=R,e[18]=$):$=e[18];const u=$;let O;e[19]!==he||e[20]!==y?(O=y?n.jsxs("span",{className:"relative size-4 shrink-0",children:[n.jsx(he,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),n.jsx(Po,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):n.jsx(jr,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=he,e[20]=y,e[21]=O):O=e[21];let l;e[22]!==de?(l=de&&n.jsx("img",{src:de,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=de,e[23]=l):l=e[23];let q;e[24]!==y||e[25]!==u?(q=!y&&n.jsx(Bs,{className:"h-4 w-4 shrink-0",style:u}),e[24]=y,e[25]=u,e[26]=q):q=e[26];const G=y?"shrink":"flex-1",Ee=c.isHidden&&"line-through opacity-50";let Te;e[27]!==Ee||e[28]!==G?(Te=ne("min-w-0 truncate text-sm font-medium",G,Ee),e[27]=Ee,e[28]=G,e[29]=Te):Te=e[29];const Ge=Ke??c.label;let xe;e[30]!==Te||e[31]!==Ge?(xe=n.jsx("span",{className:Te,children:Ge}),e[30]=Te,e[31]=Ge,e[32]=xe):xe=e[32];let m;e[33]!==V||e[34]!==y||e[35]!==ae||e[36]!==E?(m=y?n.jsxs(n.Fragment,{children:[V&&n.jsx(ai,{icon:Ls,label:E("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),ae&&n.jsx(Kn,{}),n.jsx("span",{className:"min-w-0 flex-1"})]}):ae&&n.jsx(Kn,{className:"absolute -right-0.5 -top-0.5"}),e[33]=V,e[34]=y,e[35]=ae,e[36]=E,e[37]=m):m=e[37];let M;return e[38]!==xe||e[39]!==m||e[40]!==O||e[41]!==l||e[42]!==q?(M=n.jsxs(n.Fragment,{children:[O,l,q,xe,m]}),e[38]=xe,e[39]=m,e[40]=O,e[41]=l,e[42]=q,e[43]=M):M=e[43],M}const ii="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",li="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 da(h,e,c){if(c)return Mo({selected:e});const p=h.isSavedBlock===!0,g=h.isMultivariate===!0;return ne("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":p?ii:g?li:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ds(h,e){return ne("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":h?"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 ci(h){const e=Jt.c(90),{section:c,raw:p,meta:g,decofile:j,sortableId:E,selected:y,onSelect:R,onDelete:b,onDuplicate:Y,onMakeReusable:de,onToggleHidden:Ce,onToggleLazy:Ke,onAddVariant:Ve,onDetach:ae}=h,r=Yt(),V=ps(),he=p?Is(p.__resolveType??""):!1,$=c.isHidden===!0,u=he||$;let O;e[0]!==c?(O=oa(c),e[0]=c,e[1]=O):O=e[1];const l=O;let q;e[2]!==E?(q={id:E,animateLayoutChanges:mi},e[2]=E,e[3]=q):q=e[3];const{attributes:G,listeners:Ee,setNodeRef:Te,transform:Ge,isDragging:xe}=Ir(q);let m;e[4]!==Ge?(m=Or.Transform.toString(Ge?{...Ge,x:0}:null),e[4]=Ge,e[5]=m):m=e[5];const M=xe?0:void 0;let qe;e[6]!==m||e[7]!==M?(qe={transform:m,opacity:M},e[6]=m,e[7]=M,e[8]=qe):qe=e[8];const C=qe;let We;e[9]!==c?(We=Ro(c),e[9]=c,e[10]=We):We=e[10];const z=We,mt="button",me=0;let Oe;e[11]!==R?(Oe=P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),R())},e[11]=R,e[12]=Oe):Oe=e[12];const _t=xe?"cursor-grabbing":"cursor-pointer";let Be;e[13]!==V||e[14]!==c||e[15]!==y||e[16]!==_t?(Be=ne("touch-none transition-colors",_t,da(c,y,V)),e[13]=V,e[14]=c,e[15]=y,e[16]=_t,e[17]=Be):Be=e[17];let oe;e[18]!==j||e[19]!==g||e[20]!==p||e[21]!==c?(oe=n.jsx(ua,{section:c,raw:p,meta:g,decofile:j}),e[18]=j,e[19]=g,e[20]=p,e[21]=c,e[22]=oe):oe=e[22];const re=!V&&!c.isMultivariate&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r(he?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ne(Ds(u,he)),onClick:P=>{P.stopPropagation(),Ke()},onPointerDown:di,children:n.jsx(Ls,{className:ne("h-3.5 w-3.5",he&&"text-warning")})})}),n.jsx(dt,{side:"bottom",children:r(he?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ne=V?n.jsx(Vo,{label:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:$,onToggle:Ce,children:$?n.jsx(Xn,{className:"h-3.5 w-3.5"}):n.jsx(Zn,{className:"h-3.5 w-3.5"})}):n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:ne(Ds(u,$)),onClick:P=>{P.stopPropagation(),Ce()},onPointerDown:ui,children:$?n.jsx(Xn,{className:"h-3.5 w-3.5"}):n.jsx(Zn,{className:"h-3.5 w-3.5"})})}),n.jsx(dt,{side:"bottom",children:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),L=vo,A=To;let ie;e[23]!==r?(ie=r("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=r,e[24]=ie):ie=e[24];const ke=ne(Ds(u,!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 Ae;e[25]!==A||e[26]!==ie||e[27]!==ke?(Ae=n.jsx(A,{label:ie,classicClassName:ke}),e[25]=A,e[26]=ie,e[27]=ke,e[28]=Ae):Ae=e[28];let we;e[29]!==V||e[30]!==he||e[31]!==Ke||e[32]!==c.isMultivariate||e[33]!==r?(we=V&&!c.isMultivariate&&n.jsxs(n.Fragment,{children:[n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),Ke()},children:[n.jsx(Ls,{className:"h-4 w-4"}),r(he?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),n.jsx(go,{})]}),e[29]=V,e[30]=he,e[31]=Ke,e[32]=c.isMultivariate,e[33]=r,e[34]=we):we=e[34];let H;e[35]!==Y?(H=P=>{P.stopPropagation(),Y()},e[35]=Y,e[36]=H):H=e[36];let le;e[37]===Symbol.for("react.memo_cache_sentinel")?(le=n.jsx(Pr,{className:"h-4 w-4"}),e[37]=le):le=e[37];let _e;e[38]!==r?(_e=r("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=r,e[39]=_e):_e=e[39];let fe;e[40]!==H||e[41]!==_e?(fe=n.jsxs(Kt,{onClick:H,children:[le,_e]}),e[40]=H,e[41]=_e,e[42]=fe):fe=e[42];let te;e[43]!==V||e[44]!==l||e[45]!==Ve||e[46]!==r?(te=l&&n.jsxs(Kt,{className:ne(!V&&No),onClick:P=>{P.stopPropagation(),Ve()},children:[n.jsx(ra,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=V,e[44]=l,e[45]=Ve,e[46]=r,e[47]=te):te=e[47];let pe;e[48]!==V||e[49]!==z||e[50]!==de||e[51]!==r?(pe=z&&n.jsxs(Kt,{className:ne(!V&&oi),onClick:P=>{P.stopPropagation(),de()},children:[V?n.jsx(fs,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=V,e[49]=z,e[50]=de,e[51]=r,e[52]=pe):pe=e[52];let se;e[53]!==V||e[54]!==ae||e[55]!==c.isMultivariate||e[56]!==c.isSavedBlock||e[57]!==r?(se=c.isSavedBlock===!0&&!c.isMultivariate&&n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),ae()},children:[V?n.jsx(ia,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=V,e[54]=ae,e[55]=c.isMultivariate,e[56]=c.isSavedBlock,e[57]=r,e[58]=se):se=e[58];let Me;e[59]!==b?(Me=P=>{P.stopPropagation(),b()},e[59]=b,e[60]=Me):Me=e[60];let ge;e[61]===Symbol.for("react.memo_cache_sentinel")?(ge=n.jsx(Cr,{className:"h-4 w-4"}),e[61]=ge):ge=e[61];let Re;e[62]!==r?(Re=r("sectionsEditor.sectionList.deleteMenuItem"),e[62]=r,e[63]=Re):Re=e[63];let je;e[64]!==Me||e[65]!==Re?(je=n.jsxs(Kt,{variant:"destructive",onClick:Me,children:[ge,Re]}),e[64]=Me,e[65]=Re,e[66]=je):je=e[66];let ve;e[67]!==we||e[68]!==fe||e[69]!==te||e[70]!==pe||e[71]!==se||e[72]!==je?(ve=n.jsxs(So,{align:"end",className:"w-44",children:[we,fe,te,pe,se,je]}),e[67]=we,e[68]=fe,e[69]=te,e[70]=pe,e[71]=se,e[72]=je,e[73]=ve):ve=e[73];let Se;e[74]!==L||e[75]!==Ae||e[76]!==ve?(Se=n.jsxs(L,{children:[Ae,ve]}),e[74]=L,e[75]=Ae,e[76]=ve,e[77]=Se):Se=e[77];let ze;return e[78]!==G||e[79]!==Ee||e[80]!==R||e[81]!==Te||e[82]!==C||e[83]!==Be||e[84]!==oe||e[85]!==re||e[86]!==Ne||e[87]!==Se||e[88]!==Oe?(ze=n.jsxs("div",{ref:Te,style:C,...G,...Ee,role:mt,tabIndex:me,onClick:R,onKeyDown:Oe,className:Be,children:[oe,re,Ne,Se]}),e[78]=G,e[79]=Ee,e[80]=R,e[81]=Te,e[82]=C,e[83]=Be,e[84]=oe,e[85]=re,e[86]=Ne,e[87]=Se,e[88]=Oe,e[89]=ze):ze=e[89],ze}function ui(h){return h.stopPropagation()}function di(h){return h.stopPropagation()}function mi(){return!1}function Fs(h){const e=Jt.c(11),{canAddSection:c,onAddSection:p,className:g,size:j}=h,E=Yt();let y;e[0]!==g?(y=ne("w-full",g),e[0]=g,e[1]=y):y=e[1];const R=!c;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Dr,{size:14}),e[2]=b):b=e[2];let Y;e[3]!==E?(Y=E("sectionsEditor.sectionList.addSectionButton"),e[3]=E,e[4]=Y):Y=e[4];let de;return e[5]!==p||e[6]!==j||e[7]!==y||e[8]!==R||e[9]!==Y?(de=n.jsxs(Vt,{type:"button",variant:"outline",size:j,className:y,disabled:R,onClick:p,children:[b,Y]}),e[5]=p,e[6]=j,e[7]=y,e[8]=R,e[9]=Y,e[10]=de):de=e[10],de}function fi(h){const e=Jt.c(101),{listKey:c,rawSections:p,sections:g,meta:j,decofile:E,selectedIndex:y,onSelect:R,onReorder:b,onDelete:Y,onDuplicate:de,onMakeReusable:Ce,onToggleHidden:Ke,onToggleLazy:Ve,onAddVariant:ae,onDetach:r,onAddSection:V,canAddSection:he}=h,$=he===void 0?!0:he,u=Yt(),O=ps();let l;e[0]!==g.length?(l=()=>na(g.length),e[0]=g.length,e[1]=l):l=e[1];const[q,G]=k.useState(l),[Ee,Te]=k.useState(null),[Ge,xe]=k.useState(c),[m,M]=k.useState(g.length),qe=k.useRef(!1);Ge!==c?(xe(c),M(g.length),G(na(g.length))):m!==g.length&&(M(g.length),G(Pe=>ri(Pe,g.length)));let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[2]=C):C=e[2];let We;e[3]===Symbol.for("react.memo_cache_sentinel")?(We={coordinateGetter:zr},e[3]=We):We=e[3];const z=Kr(ea(Fr,C),ea(Lr,We));let mt;e[4]!==q?(mt=q.map(pi),e[4]=q,e[5]=mt):mt=e[5];const me=mt;let Oe;e[6]===Symbol.for("react.memo_cache_sentinel")?(Oe=Pe=>{Te(String(Pe.active.id))},e[6]=Oe):Oe=e[6];const _t=Oe;let Be;e[7]!==me||e[8]!==b?(Be=Pe=>{Te(null);const{active:I,over:K}=Pe;if(!K||I.id===K.id)return;const Le=me.indexOf(String(I.id)),Xe=me.indexOf(String(K.id));Le===-1||Xe===-1||(G(nt=>ca(ms([...nt],Le,Xe))),qe.current=!0,requestAnimationFrame(()=>{qe.current=!1}),b?.(Le,Xe))},e[7]=me,e[8]=b,e[9]=Be):Be=e[9];const oe=Be;let re;e[10]===Symbol.for("react.memo_cache_sentinel")?(re=()=>{Te(null)},e[10]=re):re=e[10];const Ne=re;let L,A,ie,ke,Ae,we,H,le,_e,fe,te,pe,se,Me,ge;if(e[11]!==Ee||e[12]!==$||e[13]!==O||e[14]!==E||e[15]!==q||e[16]!==me||e[17]!==oe||e[18]!==j||e[19]!==V||e[20]!==ae||e[21]!==Y||e[22]!==r||e[23]!==de||e[24]!==Ce||e[25]!==R||e[26]!==Ke||e[27]!==Ve||e[28]!==p||e[29]!==g||e[30]!==y||e[31]!==z||e[32]!==u){Me=Symbol.for("react.early_return_sentinel");e:{const Pe=I=>{qe.current||R(I)};if(e[48]!==Ee||e[49]!==$||e[50]!==O||e[51]!==q||e[52]!==V||e[53]!==p||e[54]!==g||e[55]!==u){const I=Ee?q.find(K=>K.id===Ee):null;if(ke=I!=null?g[I.index]:null,ie=I!=null?p[I.index]:void 0,q.length===0){let K;e[59]!==u?(K=u("sectionsEditor.sectionList.noSections"),e[59]=u,e[60]=K):K=e[60];let Le;e[61]!==K?(Le=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:K}),e[61]=K,e[62]=Le):Le=e[62];const Xe=Le;let nt;e[63]!==$||e[64]!==O||e[65]!==Xe||e[66]!==V?(nt=O?Xe:n.jsxs("div",{className:"space-y-2",children:[Xe,n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm"})]}),e[63]=$,e[64]=O,e[65]=Xe,e[66]=V,e[67]=nt):nt=e[67],Me=nt;break e}se=ne(I&&"cursor-grabbing"),e[48]=Ee,e[49]=$,e[50]=O,e[51]=q,e[52]=V,e[53]=p,e[54]=g,e[55]=u,e[56]=ie,e[57]=ke,e[58]=se}else ie=e[56],ke=e[57],se=e[58];A=$r,le=z,_e=Hr,fe=_t,te=oe,pe=Ne,L=Gr,we=me,H=qr,ge="space-y-1",Ae=q.map(I=>{const K=g[I.index];return K?n.jsx(ci,{sortableId:I.id,section:K,raw:p[I.index],meta:j,decofile:E,selected:y===I.index,onSelect:()=>Pe(I.index),onDelete:()=>Y(I.index),onDuplicate:()=>de(I.index),onMakeReusable:()=>Ce(I.index),onToggleHidden:()=>Ke(I.index),onToggleLazy:()=>Ve(I.index),onAddVariant:()=>ae(I.index),onDetach:()=>r(I.index)},I.id):null})}e[11]=Ee,e[12]=$,e[13]=O,e[14]=E,e[15]=q,e[16]=me,e[17]=oe,e[18]=j,e[19]=V,e[20]=ae,e[21]=Y,e[22]=r,e[23]=de,e[24]=Ce,e[25]=R,e[26]=Ke,e[27]=Ve,e[28]=p,e[29]=g,e[30]=y,e[31]=z,e[32]=u,e[33]=L,e[34]=A,e[35]=ie,e[36]=ke,e[37]=Ae,e[38]=we,e[39]=H,e[40]=le,e[41]=_e,e[42]=fe,e[43]=te,e[44]=pe,e[45]=se,e[46]=Me,e[47]=ge}else L=e[33],A=e[34],ie=e[35],ke=e[36],Ae=e[37],we=e[38],H=e[39],le=e[40],_e=e[41],fe=e[42],te=e[43],pe=e[44],se=e[45],Me=e[46],ge=e[47];if(Me!==Symbol.for("react.early_return_sentinel"))return Me;let Re;e[68]!==Ae||e[69]!==ge?(Re=n.jsx("div",{className:ge,children:Ae}),e[68]=Ae,e[69]=ge,e[70]=Re):Re=e[70];let je;e[71]!==L||e[72]!==we||e[73]!==H||e[74]!==Re?(je=n.jsx(L,{items:we,strategy:H,children:Re}),e[71]=L,e[72]=we,e[73]=H,e[74]=Re,e[75]=je):je=e[75];let ve;e[76]!==ie||e[77]!==ke||e[78]!==O||e[79]!==E||e[80]!==j?(ve=ke?n.jsx("div",{className:ne("cursor-grabbing shadow-lg ring-1 ring-border/60",da(ke,!1,O)),children:n.jsx(ua,{section:ke,raw:ie,meta:j,decofile:E})}):null,e[76]=ie,e[77]=ke,e[78]=O,e[79]=E,e[80]=j,e[81]=ve):ve=e[81];let Se;e[82]!==ve?(Se=ho.createPortal(n.jsx(Br,{dropAnimation:wo,children:ve}),document.body),e[82]=ve,e[83]=Se):Se=e[83];let ze;e[84]!==A||e[85]!==le||e[86]!==_e||e[87]!==fe||e[88]!==te||e[89]!==pe||e[90]!==je||e[91]!==Se?(ze=n.jsxs(A,{sensors:le,collisionDetection:_e,onDragStart:fe,onDragEnd:te,onDragCancel:pe,children:[je,Se]}),e[84]=A,e[85]=le,e[86]=_e,e[87]=fe,e[88]=te,e[89]=pe,e[90]=je,e[91]=Se,e[92]=ze):ze=e[92];let P;e[93]!==$||e[94]!==O||e[95]!==V?(P=!O&&n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm",className:"mt-2"}),e[93]=$,e[94]=O,e[95]=V,e[96]=P):P=e[96];let st;return e[97]!==se||e[98]!==ze||e[99]!==P?(st=n.jsxs("div",{className:se,children:[ze,P]}),e[97]=se,e[98]=ze,e[99]=P,e[100]=st):st=e[100],st}function pi(h){return h.id}function ma(h,e){if(!h?.properties||e===null||typeof e!="object"||Array.isArray(e))return e;const c=e;let p=null;const g=()=>p??={...c};for(const[j,E]of Object.entries(h.properties)){if(!E||j.startsWith("__")||j==="@type")continue;const y=c[j];if(y===void 0){E.default!==void 0&&(g()[j]=E.default);continue}if(hi(E,y)){const R=ma(E,y);R!==y&&(g()[j]=R)}}return p??e}function hi(h,e){return h.type==="object"&&h.properties!=null&&e!==null&&typeof e=="object"&&!Array.isArray(e)&&!("__resolveType"in e)}function gi(h,e,c,p){if(!h||typeof h!="object")return{kind:"error",reason:"no-matcher-rule"};const g=e.trim();if(!g)return Rt(h,c,p)?{kind:"inline",blockKey:h.__resolveType??"",inlinedRule:Cs(h,c,p)}:{kind:"noop"};const j=Ks(h,c,p);if(!j)return{kind:"error",reason:"unreadable-rule"};if(j.blockKey)return{kind:"updateBlock",blockKey:j.blockKey,blockData:xt(j.resolveType,j.data,g)};const E=us(g),y=ds(E,c);return y?{kind:"error",reason:"invalid-block-id",message:y}:{kind:"createBlock",blockId:E,blockData:xt(j.resolveType,j.data,g),reference:Lt(E)}}function Kc({orgSlug:h,virtualMcpId:e,branch:c,previewReady:p=!0,previewUrl:g,currentPath:j,activePageBlockKey:E=null,activeGlobalBlockKey:y=null,externalSelection:R,onSaved:b,initialEditSeo:Y=!1,onExitSeo:de,onSelectRoot:Ce,onViewJsonFile:Ke,onFocusedBlockChange:Ve,onVariantPreviewOverride:ae}){const r=Yt(),V=_o(),he=V?.taskId??null,$=p?{orgSlug:h,virtualMcpId:e,branch:c,threadId:he,previewUrl:g}:null,{data:u,isLoading:O}=Do($),{data:l,isLoading:q}=Co($),G=ps(),Ee=V?.virtualMcpId,Ge=br(Ee===e?e:null)?.metadata?.siteSlug??null,xe=Jr({virtualMcpId:e,sandboxUrl:g}),[m,M]=k.useState(null),[qe,C]=k.useState(null),[We,z]=k.useState(null),[mt,me]=k.useState(0),[Oe,_t]=k.useState(void 0),[Be,oe]=k.useState(null),[re,Ne]=k.useState(null),[L,A]=k.useState([]),ie=k.useRef(null),[ke,Ae]=k.useState(L.length);ke!==L.length&&(Ae(L.length),requestAnimationFrame(()=>{ie.current&&(ie.current.scrollTop=0)}));const[we,H]=k.useState(0),[le,_e]=k.useState(null),[fe,te]=k.useState(null),[pe,se]=k.useState(null),[Me,ge]=k.useState(!1),[Re,je]=k.useState(!1),ve=k.useRef(null),[Se,ze]=k.useState(!0),[P,st]=k.useState(!1),[Pe,I]=k.useState(!1),[K,Le]=k.useState(Y),[Xe,nt]=k.useState(Y);Y&&!Xe&&(nt(!0),Le(!0),M(null),C(null),z(null),A([])),!Y&&Xe&&nt(!1);const[fa,Qt]=k.useState(null),[Os,hs]=k.useState(void 0),[zs,jt]=k.useState([]),[$s,Ft]=k.useState(0),[Fe,Ue]=k.useState(0),[pa,De]=k.useState(null),[Tt,Ie]=k.useState(null),[Hs,Gs]=k.useState(null),ha=yo(),ga=`${h}/${e}/${c}`,Xt=Ko({orgSlug:h,virtualMcpId:e,branch:c}),[va,Sa]=k.useState(j),[ya,ba]=k.useState(E),[xa,_a]=k.useState(y);(va!==j||ya!==E||xa!==y)&&(queueMicrotask(()=>Xt.flush()),Sa(j),ba(E),_a(y),M(null),C(null),z(null),me(0),oe(null),Ne(null),Ue(0),De(null),Ie(null),A([]),H(t=>t+1),Le(!1),Qt(null),hs(void 0),jt([]),Ft(t=>t+1));const W=Bo({orgSlug:h,virtualMcpId:e,branch:c}),It=nr((t,s)=>{W.mutate({blockKey:t,data:s},{onSuccess:()=>b?.(),onError:a=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Zt=wr({orgSlug:h,virtualMcpId:e,branch:c}),[Nt,At]=k.useState(!1),Q=k.useRef(null),at=k.useRef(null),ot=k.useRef(null),gs=k.useRef({}),$e=k.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[ja,Ea]=k.useState(null);if(!p||O||q)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(bo,{className:"size-5 text-muted-foreground"})});if(!u||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const ka=Tr(u),U=!!y,Z=U?null:Nr(ka,j,E),v=U?y:Z?.key??null,vs=U&&y?u[y]:void 0,qs=U&&y&&vs?Ar(y,vs):U&&y?y:"",Ot=!U&&v&&u[v]?u[v]:null,Ss=K&&u&&l&&v&&Z?Bn(u,{kind:"page",pageKey:v,pageName:String(Z.name??""),path:String(Z.path??"")},l):null,wa=K?Ot?.seo:void 0,es=Os!==void 0?Os:wa,Ra=K?Lo(es):void 0,Ws=Ss?.seoTypeOptions??[],Us=K&&l?Fo(l):"",ys=fa??Ra??{},ts=K&&Ss?Wr(ys,Ss):null,Js=K&&ts&&Io(es)?cs(ts,l):null,Ys=K?Oo(u,l)?.seoData:void 0,ce=U?[{label:"Default",sections:[{__resolveType:y}]}]:zo(Ot?.sections,u??{}),Ze=ce.length>1,ee=Math.min(mt,ce.length-1),He=ce[ee],B=He?.sections??[],ye=is(B,u),bs=!U&&$o(Ot?.sections);if(U&&y&&Hs!==y){Gs(y);const t=B[0],s=ye[0];if(t&&s){M(0),Ue(0),A([]);const a=kt(t,s,u);a&&(C(a.data),z(a.resolveType),Ie(null),De(null))}}!U&&Hs!==null&&Gs(null),$e.current={rawSections:B,parsedSections:ye,decofile:u??{},activePageKey:v,pageVariants:ce,variantIndex:ee,sectionVariantIndex:Fe,selectedSectionIndex:m};const Va=()=>({multivariate:bs,index:ee,variants:ce.map(t=>({rule:t.rule}))}),xs=(t,s)=>{if(!ae)return;if(!v||!bs||t.length<=1){ae(null);return}const a=sa(v,{multivariate:!0,index:s,variants:t},u,l);ae(a.length>0?a:null)},_s=ae&&v&&bs&&Ze&&!O&&!q?v:null;if(_s!==ja&&(Ea(_s),_s)){const t=ce.map(a=>({rule:a.rule})),s=ee;queueMicrotask(()=>xs(t,s))}const Mt=(t,s,a)=>{if(!ae)return;if(!v){ae(null);return}const o=Va(),i=sa(v,o,u,l);if(!t||s<0){ae(i.length>0?i:null);return}const f=Qr({pageKey:v,page:o,sectionIndex:s,sectionLazy:ye[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:u,meta:l}),d=[...i,...f];ae(d.length>0?d:null)},ft=(t,s,a,o=m??-1,i=!1)=>{const f=tt(t,s);if(!f){C(null),z(null),Ie(null),De(null),i&&Mt(null,o,a);return}const x=Ln(f,lt)[a];if(!x){C(null),z(null),Ie(null),De(null),i&&Mt(null,o,a);return}const T=Zo(x.value,u);C(T?.data??null),z(T?.resolveType??null);const{resolveType:S,formValue:_}=qt(x.rule,u,l??void 0);Ie(S),De(_),i&&Mt(f,o,a)},zt=R?.index;if(R!==void 0&&(R?.seq??null)!==Oe&&(_t(R?.seq??null),typeof zt=="number")){const t=B[zt],s=ye[zt];if(t&&s)if(M(zt),Ue(0),A([]),H(a=>a+1),s.isMultivariate)ft(t,s,0,zt);else{const a=kt(t,s,u);a?(C(a.data),z(a.resolveType)):(C(null),z(null)),Ie(null),De(null)}}const $t={orgSlug:h,virtualMcpId:e,branch:c,threadId:he,previewUrl:g??void 0,siteSlug:Ge},ss=We&&l?cs(We,l):null,Je=(t,s)=>{if(!v)return;Q.current&&(clearTimeout(Q.current),Q.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null);const a=Ut(u,v,t,ee,ce);W.mutate({blockKey:v,data:a},{onSuccess:()=>s?.onSuccess?.()??b?.(),onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},Pt=()=>{Ve?.(null),M(null),I(!1),C(null),z(null),Ue(0),De(null),Ie(null),A([]),H(t=>t+1)},Ta=(t,s)=>{Q.current&&clearTimeout(Q.current);const a=$e.current.sectionVariantIndex;Q.current=setTimeout(()=>{const{rawSections:o,parsedSections:i,decofile:f,activePageKey:d,pageVariants:x,variantIndex:T}=$e.current,S=o[s];if(!S)return;const _=i[s];if(!_)return;if(_.isSavedBlock){const D=gr(S,_);if(!D)return;W.mutate({blockKey:D,data:t},{onSuccess:()=>b?.(),onError:F=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:F.message}))});return}if(!d)return;const w={...f[d]},J=[...o];if(_.isMultivariate){const D=tt(S,_);if(!D||!d)return;const F=vr(D,a,t);J[s]=wt(S,_,F)}else if(_.isHidden){const D=Is(S.__resolveType),F=D?{...S.section}:{...S},ue=Array.isArray(F.variants)?[...F.variants]:[];ue[0]&&(ue[0]={...ue[0],value:t}),F.variants=ue,D?J[s]={...S,section:F}:J[s]=F}else _.isLazy?J[s]={...S,section:t}:J[s]=t;if(x.length>1){const D=w.sections,F=[...D?.variants??[]];F[T]&&(F[T]={...F[T],value:J}),w.sections={...D,variants:F}}else w.sections=J;W.mutate({blockKey:d,data:w},{onSuccess:()=>b?.(),onError:D=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:D.message}))})},Ps)},Na=t=>{M(t),Ue(0),A([]),H(i=>i+1);const s=B[t],a=ye[t];if(Ve?.(a?.isSavedBlock?a.resolveType??null:null),!s||!a)return;if(a.isMultivariate){ft(s,a,0,t);return}const o=kt(s,a,u);if(!o){C(null),z(null),Ie(null),De(null),Mt(null,t,0);return}C(o.data),z(o.resolveType),Ie(null),De(null),Mt(null,t,0)},Qs=t=>{const s=ma(ss,t);C(s),m!==null&&Ta(s,m)},js=t=>{if(!v||!u||!l||!Z)return;const s={kind:"page",pageKey:v,pageName:String(Z.name??""),path:String(Z.path??"")},a=Bn(u,s,l);a&&Xt.save(v,()=>{const o=ha.getQueryData(xo.decofile(ga))?.[v];if(!o||typeof o!="object"||o===null||Array.isArray(o))return null;const i={...o,...gs.current};return gs.current={},t?.raw!==void 0?{...i,seo:t.raw}:t?.inner!==void 0?Ur(s,a,i,t.inner):i})},Xs=(t,s)=>{v&&(gs.current[t]=s,js())},Aa=(t,s)=>{if(!v)return;const a=ms([...B],t,s);m!==null&&(m===t?M(s):t<m&&s>=m?M(m-1):t>m&&s<=m&&M(m+1)),Je(a)},Ma=t=>{if(!v)return;const s=B.filter((a,o)=>o!==t);m===t?Pt():m!==null&&m>t&&M(m-1),Je(s)},Pa=t=>{if(!v)return;const s=B[t];if(!s)return;const a=[...B];a.splice(t+1,0,dr(s)),m!==null&&m>t&&M(m+1),Je(a)},Da=t=>{if(!v)return;const s=B[t],a=ye[t];if(!s||!a)return;const o=a.isHidden?cr(s):ur(s);if(!o)return;const i=[...B];i[t]=o,m===t&&Pt(),Je(i)},Ca=t=>{if(!v)return;const s=B[t],a=ye[t];if(!s||!a||a.isMultivariate)return;const o=lr(s);if(!o)return;const i=[...B];i[t]=o,m===t&&Pt(),Je(i)},Ka=t=>{if(!v)return;const s=B[t],a=ye[t];if(!s||!a?.isSavedBlock)return;const o=kt(s,a,u);if(!o?.data)return;const{name:i,...f}=o.data,d=[...B];a.isLazy?d[t]={...s,section:f}:d[t]=f,m===t&&Pt(),Je(d)},Ba=t=>{if(!v)return;const s=[...B,{__resolveType:t.resolveType}],a=s.length-1;Je(s,{onSuccess:()=>{ge(!1),M(a),Ue(0),A([]),H(d=>d+1);const o=s[a],i=is(s,u)[a];if(!o||!i)return;if(i.isMultivariate){ft(o,i,0);return}const f=kt(o,i,u);if(!f){C(null),z(null),Ie(null),De(null);return}C(f.data),z(f.resolveType),Ie(null),De(null)}})},Zs=t=>{ve.current=t.append,ge(!0)},La=t=>{const s=ve.current;if(!s){Ba(t);return}s({__resolveType:t.resolveType}),ge(!1),ve.current=null},en=t=>{if(m===null)return;const s=B[m],a=ye[m];!s||!a?.isMultivariate||(Ue(t),A([]),H(o=>o+1),ft(s,a,t,m,!0))},Fa=t=>{if(m===null||!v)return;const s=B[m],a=ye[m];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const i=rr(o,t);if(!i){N.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const f=[...B];f[m]=wt(s,a,i);const d=i.variants;let x=Fe;t===Fe?x=Math.min(t,d.length-1):t<Fe&&(x=Fe-1),Ue(x),A([]),H(T=>T+1),ft(f[m],a,x),Je(f)},Ia=t=>{if(m===null||!v)return;const s=B[m],a=ye[m];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const i=ir(o,t),f=[...B];f[m]=wt(s,a,i);const d=t+1;Ue(d),A([]),H(x=>x+1),ft(f[m],a,d),Je(f)},Oa=(t,s)=>{if(m===null||!v||t===s)return;const a=B[m],o=ye[m];if(!a||!o?.isMultivariate)return;const i=tt(a,o);if(!i)return;const f=ar(i,t,s),d=[...B];d[m]=wt(a,o,f);let x=Fe;Fe===t?x=s:t<Fe&&s>=Fe?x=Fe-1:t>Fe&&s<=Fe&&(x=Fe+1),Ue(x),ft(d[m],o,x),Je(d)},Ht=t=>{const s=t??m;if(s===null||!v)return;const a=B[s],o=ye[s];if(!a||!o)return;const i=er(a,o);if(!i){N.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const f=[...B];f[s]=i.section;const d=is(f,u)[s];if(!d?.isMultivariate){N.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}M(s),Ue(i.newVariantIndex),A([]),H(x=>x+1),ft(i.section,d,i.newVariantIndex,s),Je(f)},tn=()=>{if(m===null||!v)return;const t=B[m],s=ye[m];if(!t||!s?.isMultivariate)return;const a=tt(t,s);if(!a)return;const o=or(t,s,a);if(!o){N.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const i=[...B];i[m]=o;const f=is(i,u)[m];if(!f)return;Ue(0),Ie(null),De(null),A([]),H(x=>x+1);const d=kt(o,f,u);d?(C(d.data),z(d.resolveType)):(C(null),z(null)),Mt(null,m,0),Je(i)},za=async t=>{if(le===null||!v)return;const s=ds(t,u);if(s){N.error(s);return}const a=B[le],o=ye[le];if(!a||!o)return;const i=kt(a,o,u);if(!i){N.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const f={...i.data,name:t};try{await W.mutateAsync({blockKey:t,data:f});const d=[...B];d[le]={__resolveType:t},await W.mutateAsync({blockKey:v,data:Ut(u,v,d,ee,ce)}),m===le&&Pt(),_e(null),N.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),b?.()}catch(d){N.error(d instanceof Error?d.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},sn=He?.rule;if(Ze&&m===null&&re===null&&sn){const{resolveType:t,formValue:s}=qt(sn,u??{},l??void 0);Ne(t),oe(s)}const Dt=l?Ho(l):[],Es=l&&u?Go(l,u):[],nn=!U&&!!(xe&&l&&u),an=re&&l?cs(re,l):null,pt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},Et=async(t,s)=>{if(!(hr(s,t,l)>0))try{await Zt.mutateAsync({blockKey:t})}catch(a){N.error(a instanceof Error?a.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},on=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:o}=$e.current;if(!s)return;const i={...a[s]},f={...i.sections},d=[...f.variants??[]],x=d[o],T=x?.rule;if(Rt(T,a,l)){const S=T?.__resolveType??"",_=a[S],w=typeof _?.name=="string"?_.name:S,{__resolveType:J,...D}=t;W.mutate({blockKey:S,data:xt(J??"",D,w)},{onSuccess:()=>b?.(),onError:F=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:F.message}))});return}x&&(d[o]={...x,rule:t}),i.sections={...f,variants:d},W.mutate({blockKey:s,data:i},{onSuccess:()=>b?.(),onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Ps)},rn=t=>{Ne(t);const s=t?Wn(t,l):{__resolveType:Qn};oe(t?s:{}),on(s)},ln=t=>{const s=t;oe(s);const a=re?{__resolveType:re,...s}:{...s};on(a)},cn=async t=>{pt();const{activePageKey:s,decofile:a,variantIndex:o}=$e.current;if(!s)return;const i=a[s],f=i?.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const d=f;if(!Array.isArray(d.variants))return;const x=[...d.variants],T=x[o];if(!T)return;const S=bt(T.rule,a,l),_=Lt(t);x[o]={...T,rule:_};const w={...a,[s]:{...i,sections:{...d,variants:x}}},{resolveType:J,formValue:D}=qt(_,w,l??void 0);Ne(J),oe(D);try{await W.mutateAsync({blockKey:s,data:w[s]}),S&&S!==t&&await Et(S,w),b?.()}catch(F){N.error(F instanceof Error?F.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},un=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=$e.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:o,parsedSections:i,decofile:f,activePageKey:d,pageVariants:x,variantIndex:T}=$e.current;if(!d)return;const S=o[s],_=i[s];if(!S||!_?.isMultivariate)return;const w=tt(S,_);if(!w)return;const D=(w.variants??[])[a]?.rule;if(Rt(D,f,l)){const X=D?.__resolveType??"",Qe=f[X],rt=typeof Qe?.name=="string"?Qe.name:X,{__resolveType:St,...it}=t;W.mutate({blockKey:X,data:xt(St??"",it,rt)},{onSuccess:()=>b?.(),onError:yt=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:yt.message}))});return}const F=Un(w,a,t),ue=[...o];ue[s]=wt(S,_,F);const et=Ut(f,d,ue,T,x);W.mutate({blockKey:d,data:et},{onSuccess:()=>b?.(),onError:X=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:X.message}))})},Ps))},$a=t=>{Ie(t);const s=t?Wn(t,l):{__resolveType:Qn};De(t?s:{}),un(s)},Ha=t=>{const s=t;De(s);const a=Tt?{__resolveType:Tt,...s}:{...s};un(a)},Ga=async t=>{pt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:o,parsedSections:i,decofile:f,activePageKey:d,pageVariants:x,variantIndex:T}=$e.current;if(s===null||!d)return;const S=o[s],_=i[s];if(!S||!_?.isMultivariate)return;const w=tt(S,_);if(!w)return;const J=w.variants??[],D=bt(J[a]?.rule,f,l),F=Lt(t),ue=Un(w,a,F),et=[...o];et[s]=wt(S,_,ue);const X=Ut(f,d,et,T,x),Qe={...f,[d]:X},{resolveType:rt,formValue:St}=qt(F,Qe,l??void 0);Ie(rt),De(St);try{await W.mutateAsync({blockKey:d,data:X}),D&&D!==t&&await Et(D,Qe),b?.()}catch(it){N.error(it instanceof Error?it.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!U&&!Z)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.noPageFound",{currentPath:j})});if(U&&!vs)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.globalBlockNotFound")});const be=m!==null?ye[m]??null:null,dn=m!==null?B[m]:null,mn=dn&&be?.isMultivariate?tt(dn,be):null,ht=mn?Ln(mn,lt):[],ns=Math.min(Fe,Math.max(ht.length-1,0)),Ct=ht[ns]??null,gt=be?.isMultivariate===!0,ks=m!==null&&be!==null,vt=ks&&(gt||!!(ss&&qe)),qa=vt&&!U&&be?.isSavedBlock===!0,Ye=U||qa,fn=U?qs:be?.label??"",Wa=Tt&&l?cs(Tt,l):null,pn=(t,s)=>s&&G?`${t} · ${s}`:t,hn=be?be.variantOf??be.label:"",Ua=(()=>{const t=gt&&Ct?Ct.label:null;return t?G?[pn(hn,t)]:[be.label,t]:[be?.label??""]})(),ws=pn(Z?.name??"",Ze?He?.label:null),as=vt&&(!U||L.length>0)?U?[qs,...L]:[ws,...Ua,...L]:[],gn=K&&Z?[Z.name,"SEO",...zs]:[],vn=r("sectionsEditor.pageVariantTabs.variantsLabel"),Sn=P&&Z?[Z.name,vn]:Pe&&Z&&be?[ws,hn,vn]:[],os=Sn.length>0?Sn:gn.length>0?gn:Ye?as.length>0?as:[fn]:as.length>0?as:[ws],yn=ks&&!gt&&!be?.isHidden&&!!v,Ja=Ye||!U&&Ze&&!!He||yn,Ya=ks&&!gt&&!U&&L.length===0&&!!be&&oa(be)&&!!v,Qa=G&&vt&&!Pe&>&&L.length===0&&!!Ct,bn=G&&L.length>0?Fn(L[L.length-1]):null,Xa=L.length>1?Fn(L[L.length-2]):null,xn=Ye?fn:vt?be?.label??"":Z?.name??"",Za=P||Pe?r("sectionsEditor.pageVariantTabs.variantsLabel"):K?r("sectionsEditor.panelSections.seo"):bn??xn,_n=Pe?be?.variantOf??be?.label??"":P||K?Z?.name??"":bn?Xa??xn:Ye?r("sectionsEditor.sectionsEditor.globalSectionSubtitle"):vt?Z?.name??"":Z?.path??"",Rs=!P&&!Pe&&!K&&!vt&&!Ye,eo=!G&&!K&&!U&>&&L.length===0,Gt=()=>{if(!v)return;pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const t=u[v],s=tr(t.sections,B);if(!s)return;const a=sr(s);W.mutate({blockKey:v,data:{...t,sections:s}},{onSuccess:()=>{me(a),M(null),C(null),z(null),A([]),oe(null),Ne(null)},onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},rs=(t,s,a)=>{if(!v)return;pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const o=u[v],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const f=i;if(!Array.isArray(f.variants))return;const d=t([...f.variants]);if(!d)return;const x=pr(f,d),T={...u,[v]:{...o,sections:x}};W.mutate({blockKey:v,data:T[v]},{onSuccess:()=>{s?.();const S=typeof a=="string"?[a]:a??[];(async()=>{for(const _ of S)await Et(_,T)})()},onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Vs=t=>{te(null),me(t),M(null),C(null),z(null),A([]);const s=ce[t]?.rule,{resolveType:a,formValue:o}=qt(s,u??{},l??void 0);Ne(a),oe(o),xs(ce.map(i=>({rule:i.rule})),t)},jn=(t,s)=>{if(t===s)return;let a=ee;ee===t?a=s:t<ee&&s>=ee?a=ee-1:t>ee&&s<=ee&&(a=ee+1),me(a);const o=ms(ce.map(i=>({rule:i.rule})),t,s);xs(o,a),rs(i=>ms(i,t,s))},En=t=>{const s=ce[t]?.rule,a=bt(s,u??{},l??void 0);rs(o=>o.length<=1?null:(o.splice(t,1),o),()=>{ce.length-1===1?me(0):t<ee?me(ee-1):t===ee&&me(Math.max(0,t-1)),M(null),C(null),z(null),A([]),oe(null),Ne(null)},a)},to=()=>{const t=ce.map((s,a)=>({variant:s,index:a})).filter(({variant:s})=>!fr(s.rule)).map(({variant:s})=>bt(s.rule,u??{},l??void 0)).filter(s=>!!s);rs(s=>{const a=Sr({variants:s}),o=s[a];return o?[{...o,rule:Mr()}]:null},()=>{me(0),M(null),C(null),z(null),A([]),oe(null),Ne(null),st(!1)},t)},kn=t=>{rs(s=>yr(s,t),()=>{me(t+1),M(null),C(null),z(null),A([]),oe(null),Ne(null)})},so=async(t,s)=>{pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const a=$e.current.activePageKey,o=$e.current.decofile;if(!a)return;const i=o[a],f=i.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const d=f;if(!Array.isArray(d.variants))return;const x=[...d.variants],T=x[t];if(!T?.rule||typeof T.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const S=T.rule,_=s.trim();At(!0);try{if(!_){if(!Rt(S,o,l)){te(null);return}const et=S.__resolveType??"";x[t]={...T,rule:Cs(S,o,l)};const X={...o,[a]:{...i,sections:{...d,variants:x}}};await W.mutateAsync({blockKey:a,data:X[a]}),await Et(et,X),te(null),b?.();return}const w=Ks(S,o,l);if(!w){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(w.blockKey){await W.mutateAsync({blockKey:w.blockKey,data:xt(w.resolveType,w.data,_)}),te(null),b?.();return}const J=us(_),D=ds(J,o);if(D){N.error(D);return}const F=xt(w.resolveType,w.data,_);let ue=null;try{await W.mutateAsync({blockKey:J,data:F}),ue=J,x[t]={...T,rule:Lt(J)},await W.mutateAsync({blockKey:a,data:{...i,sections:{...d,variants:x}}}),ue=null}catch(et){throw ue&&await Zt.mutateAsync({blockKey:ue}).catch(()=>{}),et}te(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:_})),b?.()}catch(w){N.error(w instanceof Error?w.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},no=async(t,s)=>{pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const{selectedSectionIndex:a,rawSections:o,parsedSections:i,decofile:f,activePageKey:d,pageVariants:x,variantIndex:T}=$e.current;if(a===null||!d)return;const S=o[a],_=i[a];if(!S||!_?.isMultivariate)return;const w=tt(S,_);if(!w)return;const J=w.variants??[],D=J[t];if(!D?.rule||typeof D.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const F=D.rule,ue=s.trim();At(!0);const et=async X=>{const Qe={...w,variants:X},rt=[...o];rt[a]=wt(S,_,Qe);const St=Ut(f,d,rt,T,x);return await W.mutateAsync({blockKey:d,data:St}),{...f,[d]:St}};try{if(!ue){if(!Rt(F,f,l)){se(null);return}const yt=F.__resolveType??"",Cn=[...J];Cn[t]={...D,rule:Cs(F,f,l)};const po=await et(Cn);await Et(yt,po),se(null),b?.();return}const X=Ks(F,f,l);if(!X){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(X.blockKey){await W.mutateAsync({blockKey:X.blockKey,data:xt(X.resolveType,X.data,ue)}),se(null),b?.();return}const Qe=us(ue),rt=ds(Qe,f);if(rt){N.error(rt);return}const St=xt(X.resolveType,X.data,ue);let it=null;try{await W.mutateAsync({blockKey:Qe,data:St}),it=Qe;const yt=[...J];yt[t]={...D,rule:Lt(Qe)},await et(yt),it=null}catch(yt){throw it&&await Zt.mutateAsync({blockKey:it}).catch(()=>{}),yt}se(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:ue})),b?.()}catch(X){N.error(X instanceof Error?X.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},wn=async(t,s,a)=>{C(a);try{await W.mutateAsync({blockKey:t,data:a})}catch(o){throw C(i=>i===a?s:i),o}},ao={rename:async(t,s,a)=>{pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const{activePageKey:o,decofile:i}=$e.current;if(!o)return;const f=Array.isArray(t.variants)?[...t.variants]:[],d=f[s],x=d?.rule&&typeof d.rule=="object"?d.rule:void 0,T=async _=>{const w={...t,variants:_};return await wn(o,t,w),{...i,[o]:w}},S=gi(x,a,i,l);if(S.kind!=="noop"){if(S.kind==="error"){N.error(S.reason==="no-matcher-rule"?r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):S.reason==="unreadable-rule"?r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):S.message??r("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}At(!0);try{if(S.kind==="inline"){const w=[...f];w[s]={...d,rule:S.inlinedRule};const J=await T(w);await Et(S.blockKey,J),b?.();return}if(S.kind==="updateBlock"){await W.mutateAsync({blockKey:S.blockKey,data:S.blockData}),b?.();return}let _=null;try{await W.mutateAsync({blockKey:S.blockId,data:S.blockData}),_=S.blockId;const w=[...f];w[s]={...d,rule:S.reference},await T(w),_=null}catch(w){throw _&&await Zt.mutateAsync({blockKey:_}).catch(()=>{}),w}N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:a.trim()})),b?.()}catch(_){N.error(_ instanceof Error?_.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}}},selectGlobal:async(t,s,a)=>{pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const{activePageKey:o,decofile:i}=$e.current;if(!o)return;const f=Array.isArray(t.variants)?[...t.variants]:[],d=f[s];if(!d)return;const x=bt(d.rule,i,l);f[s]={...d,rule:Lt(a)};const T={...t,variants:f},S={...i,[o]:T};try{await wn(o,t,T),x&&x!==a&&await Et(x,S),b?.()}catch(_){N.error(_ instanceof Error?_.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}}},Rn=()=>{Pt()},Vn=t=>{Qt(t),js({inner:t})},Tn=t=>{hs(t),js({raw:t})},Nn=()=>{Qt(null),jt([])},An=()=>Ft(t=>t+1),Mn=()=>{Xt.flush(),Le(!1),Qt(null),hs(void 0),jt([]),Ft(t=>t+1),de?.()},oo=()=>{st(!1),I(!1),M(null),Le(!0)},ro=()=>{K&&Mn(),M(null),st(!0)},io=()=>I(!0),Ts=t=>{if(P&&t===0){st(!1);return}if(Pe&&t<2){I(!1),t===0&&M(null);return}if(K){if(t===0){Mn();return}if(t===1){jt([]),Ft(a=>a+1);return}jt(zs.slice(0,t-1)),Ft(a=>a+1);return}if(U){A(L.slice(0,t)),H(a=>a+1);return}if(t===0){Rn();return}if(t===1){A([]),H(a=>a+1);return}const s=!G&>&&Ct?1:0;if(s===1&&t===2){A([]),H(a=>a+1);return}A(L.slice(0,t-1-s))},Ns=os.length>1?n.jsx("button",{type:"button",onClick:()=>Ts(mr(os.length,{isMultivariateSectionTop:eo})),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:ne("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",Ye?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(Er,{className:"size-4"})}):null,lo=Ye||vt||K?Ja&&n.jsxs("div",{className:ne("border-b px-3 py-2.5",Ye&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!U&&Ze&&He&&n.jsxs("button",{type:"button",onClick:Rn,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:He.label}),className:ne("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",Wo),children:[n.jsx(qo,{rule:As(He.rule,u??{},l??void 0),matchers:Dt}),n.jsx("span",{className:"max-w-[160px] truncate",children:He.label})]}),n.jsx("div",{className:"flex-1"}),Ye&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fs,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),yn&&n.jsx(ls,{onClick:()=>Ht()})]}),Ye&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:r("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(In,{pageKey:v,initialName:Z.name,initialPath:Z.path,onFieldChange:Xs,variant:"header"})}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Le(!0),children:n.jsx(Jn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Ke&&v?Ke():je(!0),children:n.jsx(Yn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(ls,{onClick:Gt})]}),co=n.jsxs(n.Fragment,{children:[Ze&&v&&n.jsx(On,{listKey:v,variants:ce,activeIndex:ee,decofile:u??{},meta:l,matchers:Dt,onSelect:Vs,onReorder:jn,onRename:te,onDuplicate:kn,onDelete:En,onAdd:Gt}),Ze&&re!==null&&n.jsx(zn,{className:"mt-3",children:n.jsx("div",{className:ne("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(Ms,{currentRt:re,currentLabel:Wt(He?.rule,u??{},lt,l??void 0),currentGlobalKey:bt(He?.rule,u??{},l??void 0)??void 0,matchers:Dt,globals:Es,onSelect:rn,onSelectGlobal:cn,schema:an,formValue:Be,onChange:ln,formKey:`${ee}:${re??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:u,onSaveReferencedBlock:It,sandbox:$t})})})]}),Pn=n.jsxs(n.Fragment,{children:[n.jsx(Uo,{listKey:`${v??""}:${m??""}`,variants:ht.map((t,s)=>({index:s,label:t.label})),selectedIndex:ns,onSelect:en,onRename:se,onDuplicate:Ia,onDelete:Fa,onRemoveAll:tn,onReorder:Oa,onAdd:()=>Ht()}),n.jsx(zn,{children:n.jsx(Ms,{currentRt:Tt??"",currentLabel:Wt(Ct?.rule,u??{},lt,l??void 0),currentGlobalKey:bt(Ct?.rule,u??{},l??void 0)??void 0,matchers:Dt,globals:Es,onSelect:$a,onSelectGlobal:Ga,schema:Wa,formValue:pa,onChange:Ha,formKey:`${m??"none"}:${ns}:${Tt??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:u,onSaveReferencedBlock:It,sandbox:$t})})]}),Dn=n.jsx("div",{className:ne(G?"px-2":"p-2 pt-3"),children:n.jsx(fi,{listKey:`${v??""}-${ee}`,rawSections:B,sections:ye,meta:l,decofile:u,selectedIndex:m,onSelect:Na,onReorder:Aa,onDelete:Ma,onDuplicate:Pa,onMakeReusable:_e,onToggleHidden:Da,onToggleLazy:Ca,onAddVariant:Ht,onDetach:Ka,onAddSection:()=>ge(!0),canAddSection:nn})}),uo=n.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[v&&Z&&n.jsx(In,{pageKey:v,initialName:Z.name,initialPath:Z.path,onFieldChange:Xs}),Ot&&v?n.jsx(ta,{rawSeo:es,innerSeo:ys,defaultResolveType:Us,seoSchema:Js,activeResolveType:ts,seoTypeOptions:Ws,formResetKey:$s,siteDefaultSeo:Ys,onBreadcrumbChange:jt,onPersistRaw:Tn,onInnerChange:Vn,onClearForm:Nn,onBumpFormKey:An}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),mo=n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&v?n.jsx(ta,{rawSeo:es,innerSeo:ys,defaultResolveType:Us,seoSchema:Js,activeResolveType:ts,seoTypeOptions:Ws,formResetKey:$s,siteDefaultSeo:Ys,onBreadcrumbChange:jt,onPersistRaw:Tn,onInnerChange:Vn,onClearForm:Nn,onBumpFormKey:An}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),fo=n.jsxs(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ze&&v&&n.jsx(On,{listKey:v,variants:ce,activeIndex:ee,decofile:u??{},meta:l,matchers:Dt,onSelect:Vs,onReorder:jn,onRename:te,onDuplicate:kn,onDelete:En,onAdd:Gt}),Ze&&re!==null&&n.jsxs("div",{className:ne("px-3 border-b",Se?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ze(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":Se,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),Se?n.jsx(xr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(_r,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),Se&&n.jsx("div",{className:ne("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(Ms,{currentRt:re,currentLabel:Wt(He?.rule,u??{},lt,l??void 0),currentGlobalKey:bt(He?.rule,u??{},l??void 0)??void 0,matchers:Dt,globals:Es,onSelect:rn,onSelectGlobal:cn,schema:an,formValue:Be,onChange:ln,formKey:`${ee}:${re??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:u,onSaveReferencedBlock:It,sandbox:$t})})]}),Dn]},"editor-section-list");return n.jsx(Jo,{children:n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!G&&Ns&&n.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:Ns}),(G||os.length>1)&&n.jsx(Yo,{crumbs:os,onSelect:Ts,onSelectRoot:()=>{Xt.flush(),Ce?Ce():Ts(0)}}),n.jsx("div",{className:"shrink-0",children:G?n.jsxs("div",{className:ne("flex items-center gap-2 border-b px-3 py-2.5",Ye&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[G&&Ns,Ye&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fs,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[n.jsx("span",{className:"truncate text-sm font-semibold",children:Za}),_n&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:_n})]}),Rs&&Ze&&He&&n.jsx($n,{variants:ce,activeIndex:ee,onSelect:Vs,onManage:ro,onRemoveAll:to}),Qa&&n.jsx($n,{variants:ht,activeIndex:ns,onSelect:en,onManage:io,onRemoveAll:tn}),Rs&&!Ze&&n.jsx(ls,{onClick:Gt}),Ya&&n.jsx(ls,{onClick:()=>Ht()}),n.jsx(Qo,{}),Rs&&n.jsxs(n.Fragment,{children:[n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:oo,children:n.jsx(Jn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),!Ke&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>je(!0),children:n.jsx(Yn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):lo}),Pe?n.jsx(Hn,{onAdd:()=>Ht(),children:Pn},"editor-section-variants"):vt?n.jsxs(Bt,{viewportRef:ie,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!G&>&&ht.length>0&&L.length===0&&Pn,n.jsx(Gn,{activeSchema:ss,formValue:qe,formResetKey:we,onFormChange:Qs,onBreadcrumbChange:A,breadcrumbPath:L,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:u,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:xe,onRequestAddSection:Zs,onVariantMatcherOp:U?ao:void 0})]},"editor-section-form"):U?n.jsx(Bt,{viewportRef:ie,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Gn,{activeSchema:ss,formValue:qe,formResetKey:we,onFormChange:Qs,onBreadcrumbChange:A,breadcrumbPath:L,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:u,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:xe,onRequestAddSection:Zs})},"editor-global-block"):K?G?n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3",children:uo})},"editor-seo"):mo:P?n.jsx(Hn,{onAdd:Gt,children:co},"editor-variants"):G?n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"py-2",children:Dn})}),n.jsx("div",{className:"shrink-0 border-t p-2",children:n.jsx(Fs,{canAddSection:nn,onAddSection:()=>ge(!0)})})]},"editor-section-list"):fo,n.jsx(Xo,{open:le!==null,onOpenChange:t=>{t||_e(null)},defaultBlockId:le!==null?us(ye[le]?.label??""):"",isPending:W.isPending,onSubmit:za}),xe&&n.jsx(Yr,{open:Me,onOpenChange:t=>{ge(t),t||(ve.current=null)},meta:l,decofile:u,previewBaseUrl:xe,onSelect:La}),Re&&v&&u&&n.jsx(Rr,{open:Re,onOpenChange:je,pageKey:v,decofile:u}),fe!==null&&n.jsx(qn,{open:!0,initialName:Rt(ce[fe]?.rule,u??{},l??void 0)?Wt(ce[fe]?.rule,u??{},lt,l??void 0):"",autoLabel:lt(As(ce[fe]?.rule,u??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await so(fe,t)},onOpenChange:t=>{!t&&!Nt&&te(null)}}),pe!==null&&n.jsx(qn,{open:!0,initialName:Rt(ht[pe]?.rule,u??{},l??void 0)?Wt(ht[pe]?.rule,u??{},lt,l??void 0):"",autoLabel:lt(As(ht[pe]?.rule,u??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await no(pe,t)},onOpenChange:t=>{!t&&!Nt&&se(null)}})]})})}export{Kc as SectionsEditor};
|
|
1
|
+
import{c as Jt,b as Yt,r as k,l as ne,j as n,aR as ho,B as Vt,G as Kt,al as go,I as vo,H as So,o as yo,h as bo,t as N,K as xo}from"./index-f39IHbs-.js";import{u as _o}from"./chat-context-KKDqDnLJ.js";import{u as ps}from"./use-new-blocks-editor-BRH_LC9G.js";import{J as aa,K as jo,L as Eo,N as ko,O as wo,Q as oa,T as Ro,U as Vo,V as To,W as No,X as Ao,Y as Kn,Z as Mo,_ as Po,H as Rt,$ as Cs,a0 as Ks,a1 as xt,D as us,z as ds,a2 as Lt,e as Do,f as Co,j as Ko,u as Bo,a3 as Bn,a4 as Lo,a5 as Fo,a6 as Io,a7 as Oo,a8 as zo,p as is,a9 as $o,C as kt,aa as qt,ab as Ho,ac as Go,ad as tt,ae as Ln,x as Fn,af as qo,ag as As,ah as Wo,ai as ls,aj as In,ak as On,al as zn,am as Ms,I as bt,an as Wt,ao as Uo,ap as Jo,A as Yo,aq as $n,ar as Qo,as as Hn,at as Gn,M as Xo,au as qn,av as lt,aw as Zo,ax as er,G as tr,ay as sr,d as nr,az as Wn,aA as ar,aB as wt,aC as or,aD as rr,aE as ir,aF as Un,aG as Ut,aH as lr,aI as cr,aJ as ur,aK as dr,aL as mr,aM as fr,aN as pr,aO as Ps,aP as hr,aQ as gr,aR as vr,aS as Sr,aT as yr}from"./runnable-block-editor-LemNiMQU.js";import{f as br}from"./repository-binding-DIPzyHMN.js";import{n as xr,t as _r}from"./ChevronUp-B_dZipHr.js";import{a4 as ra,b as fs,ah as jr,x as Er,Y as Jn,G as Yn}from"./agent-icon-qkd0b8kr.js";import{S as Bt}from"./scroll-area-DgAgpCLV.js";import{b as ct,T as ut,a as dt}from"./tooltip-BHH6aqLS.js";import{m as kr,u as wr,P as Rr}from"./mustache-BMIkDVKD.js";import{b as Is,G as Vr,e as Tr,j as Nr,g as Ar,r as cs,X as Qn,Q as Mr}from"./claim-phase-copy-7jmcIMfh.js";import{a as Pr}from"./Copy01-BFL2IBar.js";import{a as Bs,d as ia}from"./UserSquare-CEg6M02N.js";import{b as Xn}from"./Tool01-BPIKi6tL.js";import{s as Zn}from"./Image01-B2iIQy-h.js";import{s as Dr}from"./Plus-D2NCmLMx.js";import{s as Cr}from"./Trash01-C4lIUVMq.js";import{i as Ls}from"./ZoomOut-gRGmlA24.js";import{a as Kr,b as ea,d as Br,K as Lr,P as Fr,u as Ir,C as Or,s as zr,e as ms,D as $r,c as Hr,S as Gr,v as qr}from"./rich-text-link-control-xmLap9VX.js";import{a as Wr,P as ta,b as Ur}from"./page-seo-form-5W5GZ3a_.js";import{u as Jr,A as Yr}from"./use-section-preview-base-CJqXSslf.js";import{b as sa,a as Qr}from"./variant-matcher-override-CMO-WAFG.js";import"./use-panel-navigate-B1JIdNap.js";import"./thread-route-CLehskDo.js";import"./use-project-scope-Cf6JTJYu.js";import"./autosend-laDWuWlf.js";import"./thread-intent-D8xEg1cX.js";import"./use-mcp-client-C0_CZY2c.js";import"./auth-CCqcRSEL.js";import"./backoff-8mStPHYB.js";import"./task-board-B1f0xPT9.js";import"./schema-CiNjZ572.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-decopilot-events-DoOOc2MM.js";import"./use-ai-providers-C3Q1VUYq.js";import"./location-DPIrGNp7.js";import"./use-organization-settings-CJVvbGmg.js";import"./use-session-runtime-jmKpEVDe.js";import"./Sun-1iBslaEq.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-Clr7z8zc.js";import"./ArrowRight-CP95Quaz.js";import"./Check-BF-m6KVY.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-DhA_7QTn.js";import"./use-copy-DkzJN0jC.js";import"./usage-stats-CwmFwoim.js";import"./markdown-BdF7bf7e.js";import"./dialog-BznjKiRY.js";import"./X-DbvoChXn.js";import"./org-file-open-context-D4Slnz3H.js";import"./use-mobile-wCYqTMWw.js";import"./shell-layout-CdgXHcFx.js";import"./avatar-BPqaE0VH.js";import"./User01-CBT9xTuN.js";import"./Palette-8KWyiFK4.js";import"./XClose-BSHHLYGF.js";import"./download-app-dialog-DoDz4zun.js";import"./CheckCircle-nfgGUSlr.js";import"./Monitor01-fVJ_bHaY.js";import"./command-DsgrxpbN.js";import"./index-CPYFR8WQ.js";import"./SearchMd-DIg_EfRC.js";import"./integration-icon-CJAhW3rI.js";import"./project-icon-MntXC2t2.js";import"./new-project-dialog-UxfAUjgw.js";import"./ArrowLeft-B10qZSXl.js";import"./input-CPZgZmM_.js";import"./label-ZHwIbvCi.js";import"./repository-import-picker-BrYWj8Sv.js";import"./use-navigate-to-agent-CIcFb7om.js";import"./repository-picker-0sYOPc_k.js";import"./LinkExternal01-CCWGUCuX.js";import"./useInfiniteQuery-B96wRC7s.js";import"./infiniteQueryObserver-Dg3VmoCf.js";import"./collection-search-vcbSqk-s.js";import"./ShoppingBag01-DgGunmMH.js";import"./use-debounced-value-1di6Y1DY.js";import"./required-auth-layout-DlCb1jZe.js";import"./use-org-sso-AHQDmwq7.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CSv506Jo.js";import"./types-lMvXvvPD.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-A5n0t7PH.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./AlertCircle-XbZvoIme.js";import"./sheet-DlJ3skV8.js";import"./use-connection-DdOS0ZCi.js";import"./Link01-BHCX0_Et.js";import"./use-mcp-prompts-jWqVXo_B.js";import"./index-BGdr5Wni.js";import"./form-CBlilZhp.js";import"./use-thread-outputs-D3fmLO2h.js";import"./file-type-icon-C7QmtAGh.js";import"./popover-DFDkI7HF.js";import"./utils-DEDJ7GpZ.js";import"./monaco-editor-CRvwNvU3.js";import"./editor-D6TpDkcA.js";import"./calendar-DxpzmF7P.js";import"./textarea-D74f_08r.js";import"./select-Bfo3T2tj.js";import"./index-tUrogJm7.js";import"./switch-D_YBFGTY.js";import"./combobox-DQWUplf-.js";import"./alert-dialog-BKZ0Im5W.js";import"./sandbox-url-D3mC8qhT.js";import"./Upload01-DTwqTWTg.js";import"./DotsVertical-DGakKoqS.js";import"./search-input-Be3bcvAe.js";import"./tabs-QyCMiVpV.js";import"./use-file-configs-Tbk4brg3.js";import"./asset-utils-BjIs8swm.js";import"./use-chat-layout-state-CKnLcfEg.js";import"./site-slug-DebpOoQq.js";import"./toggle-group-CtYGVDHt.js";import"./sandbox-git-api-B1R0585s.js";import"./ArrowUp-DVQxLZsm.js";import"./CreditCard01-BAkQ0X2j.js";import"./Key01-Ber36HHc.js";import"./Users01-DFZY90Ue.js";import"./section-preview-url-Csj0_ZDg.js";function Xr(h){return h.schema?.definitions??h.schema?.$defs??{}}function la(h,e){const c=Xr(e),p=c[btoa(h)];if(!p)return[];const g=[p];if(Array.isArray(p.allOf)){const j=p.allOf.find(E=>typeof E.$ref=="string")?.$ref;if(typeof j=="string"){const E=c[j.replace("#/definitions/","")];E&&g.push(E)}}return g}function Zr(h,e){for(const c of la(h,e)){const p=typeof c.image=="string"?c.image:void 0;if(p?.includes("{{{"))return p}}function ei(h,e){if(!e)return;const c=aa(h);if(!c)return;const p=Zr(c.resolveType,e);if(!p)return;const g=jo(p,c.data);if(g)return Eo(g)}const ti={escape:ko};function si(h,e){for(const c of la(h,e)){const p=typeof c.title=="string"?c.title:void 0;if(p?.includes("{{"))return p}}function ni(h,e){if(!e)return;const c=aa(h);if(c)try{const p=si(c.resolveType,e);return p&&kr.render(p,c.data,{},ti).trim()||void 0}catch{return}}function ai(h){const e=Jt.c(13),{icon:c,label:p,className:g}=h;let j;e[0]!==g?(j=ne("size-3.5",g),e[0]=g,e[1]=j):j=e[1];let E;e[2]!==c||e[3]!==j?(E=n.jsx(c,{className:j}),e[2]=c,e[3]=j,e[4]=E):E=e[4];let y;e[5]!==p||e[6]!==E?(y=n.jsx(ut,{asChild:!0,children:n.jsx("span",{role:"img","aria-label":p,className:"shrink-0 cursor-help",children:E})}),e[5]=p,e[6]=E,e[7]=y):y=e[7];let R;e[8]!==p?(R=n.jsx(dt,{className:"max-w-56",children:p}),e[8]=p,e[9]=R):R=e[9];let b;return e[10]!==y||e[11]!==R?(b=n.jsxs(ct,{children:[y,R]}),e[10]=y,e[11]=R,e[12]=b):b=e[12],b}const oi="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 na(h){return Array.from({length:h},(e,c)=>({id:crypto.randomUUID(),index:c}))}function ca(h){return h.map((e,c)=>({...e,index:c}))}function ri(h,e){if(e===h.length)return h;if(e<h.length)return ca(h.slice(0,e));const c=Array.from({length:e-h.length},(p,g)=>({id:crypto.randomUUID(),index:h.length+g}));return[...h,...c]}function ua(h){const e=Jt.c(44),{section:c,raw:p,meta:g,decofile:j}=h,E=Yt(),y=ps(),R=c.isSavedBlock===!0,b=c.isMultivariate===!0;let Y;e[0]!==g||e[1]!==p?(Y=p&&g?ei(p,g):void 0,e[0]=g,e[1]=p,e[2]=Y):Y=e[2];const de=Y;let Ce;e[3]!==g||e[4]!==b||e[5]!==p||e[6]!==R?(Ce=p&&g&&!R&&!b?ni(p,g):void 0,e[3]=g,e[4]=b,e[5]=p,e[6]=R,e[7]=Ce):Ce=e[7];const Ke=Ce;let Ve;e[8]!==j||e[9]!==g||e[10]!==p||e[11]!==c?(Ve=Ao(p,c,j,g),e[8]=j,e[9]=g,e[10]=p,e[11]=c,e[12]=Ve):Ve=e[12];const ae=Ve;let r;e[13]!==b||e[14]!==p?.__resolveType?(r=!b&&Is(p?.__resolveType??""),e[13]=b,e[14]=p?.__resolveType,e[15]=r):r=e[15];const V=r,he=R?fs:b?ra:ia;let $;e[16]!==b||e[17]!==R?($=R?{color:Vr}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=b,e[17]=R,e[18]=$):$=e[18];const u=$;let O;e[19]!==he||e[20]!==y?(O=y?n.jsxs("span",{className:"relative size-4 shrink-0",children:[n.jsx(he,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),n.jsx(Po,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):n.jsx(jr,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=he,e[20]=y,e[21]=O):O=e[21];let l;e[22]!==de?(l=de&&n.jsx("img",{src:de,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=de,e[23]=l):l=e[23];let q;e[24]!==y||e[25]!==u?(q=!y&&n.jsx(Bs,{className:"h-4 w-4 shrink-0",style:u}),e[24]=y,e[25]=u,e[26]=q):q=e[26];const G=y?"shrink":"flex-1",Ee=c.isHidden&&"line-through opacity-50";let Te;e[27]!==Ee||e[28]!==G?(Te=ne("min-w-0 truncate text-sm font-medium",G,Ee),e[27]=Ee,e[28]=G,e[29]=Te):Te=e[29];const Ge=Ke??c.label;let xe;e[30]!==Te||e[31]!==Ge?(xe=n.jsx("span",{className:Te,children:Ge}),e[30]=Te,e[31]=Ge,e[32]=xe):xe=e[32];let m;e[33]!==V||e[34]!==y||e[35]!==ae||e[36]!==E?(m=y?n.jsxs(n.Fragment,{children:[V&&n.jsx(ai,{icon:Ls,label:E("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),ae&&n.jsx(Kn,{}),n.jsx("span",{className:"min-w-0 flex-1"})]}):ae&&n.jsx(Kn,{className:"absolute -right-0.5 -top-0.5"}),e[33]=V,e[34]=y,e[35]=ae,e[36]=E,e[37]=m):m=e[37];let M;return e[38]!==xe||e[39]!==m||e[40]!==O||e[41]!==l||e[42]!==q?(M=n.jsxs(n.Fragment,{children:[O,l,q,xe,m]}),e[38]=xe,e[39]=m,e[40]=O,e[41]=l,e[42]=q,e[43]=M):M=e[43],M}const ii="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",li="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 da(h,e,c){if(c)return Mo({selected:e});const p=h.isSavedBlock===!0,g=h.isMultivariate===!0;return ne("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":p?ii:g?li:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ds(h,e){return ne("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":h?"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 ci(h){const e=Jt.c(90),{section:c,raw:p,meta:g,decofile:j,sortableId:E,selected:y,onSelect:R,onDelete:b,onDuplicate:Y,onMakeReusable:de,onToggleHidden:Ce,onToggleLazy:Ke,onAddVariant:Ve,onDetach:ae}=h,r=Yt(),V=ps(),he=p?Is(p.__resolveType??""):!1,$=c.isHidden===!0,u=he||$;let O;e[0]!==c?(O=oa(c),e[0]=c,e[1]=O):O=e[1];const l=O;let q;e[2]!==E?(q={id:E,animateLayoutChanges:mi},e[2]=E,e[3]=q):q=e[3];const{attributes:G,listeners:Ee,setNodeRef:Te,transform:Ge,isDragging:xe}=Ir(q);let m;e[4]!==Ge?(m=Or.Transform.toString(Ge?{...Ge,x:0}:null),e[4]=Ge,e[5]=m):m=e[5];const M=xe?0:void 0;let qe;e[6]!==m||e[7]!==M?(qe={transform:m,opacity:M},e[6]=m,e[7]=M,e[8]=qe):qe=e[8];const C=qe;let We;e[9]!==c?(We=Ro(c),e[9]=c,e[10]=We):We=e[10];const z=We,mt="button",me=0;let Oe;e[11]!==R?(Oe=P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),R())},e[11]=R,e[12]=Oe):Oe=e[12];const _t=xe?"cursor-grabbing":"cursor-pointer";let Be;e[13]!==V||e[14]!==c||e[15]!==y||e[16]!==_t?(Be=ne("touch-none transition-colors",_t,da(c,y,V)),e[13]=V,e[14]=c,e[15]=y,e[16]=_t,e[17]=Be):Be=e[17];let oe;e[18]!==j||e[19]!==g||e[20]!==p||e[21]!==c?(oe=n.jsx(ua,{section:c,raw:p,meta:g,decofile:j}),e[18]=j,e[19]=g,e[20]=p,e[21]=c,e[22]=oe):oe=e[22];const re=!V&&!c.isMultivariate&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r(he?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ne(Ds(u,he)),onClick:P=>{P.stopPropagation(),Ke()},onPointerDown:di,children:n.jsx(Ls,{className:ne("h-3.5 w-3.5",he&&"text-warning")})})}),n.jsx(dt,{side:"bottom",children:r(he?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ne=V?n.jsx(Vo,{label:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:$,onToggle:Ce,children:$?n.jsx(Xn,{className:"h-3.5 w-3.5"}):n.jsx(Zn,{className:"h-3.5 w-3.5"})}):n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:ne(Ds(u,$)),onClick:P=>{P.stopPropagation(),Ce()},onPointerDown:ui,children:$?n.jsx(Xn,{className:"h-3.5 w-3.5"}):n.jsx(Zn,{className:"h-3.5 w-3.5"})})}),n.jsx(dt,{side:"bottom",children:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),L=vo,A=To;let ie;e[23]!==r?(ie=r("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=r,e[24]=ie):ie=e[24];const ke=ne(Ds(u,!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 Ae;e[25]!==A||e[26]!==ie||e[27]!==ke?(Ae=n.jsx(A,{label:ie,classicClassName:ke}),e[25]=A,e[26]=ie,e[27]=ke,e[28]=Ae):Ae=e[28];let we;e[29]!==V||e[30]!==he||e[31]!==Ke||e[32]!==c.isMultivariate||e[33]!==r?(we=V&&!c.isMultivariate&&n.jsxs(n.Fragment,{children:[n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),Ke()},children:[n.jsx(Ls,{className:"h-4 w-4"}),r(he?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),n.jsx(go,{})]}),e[29]=V,e[30]=he,e[31]=Ke,e[32]=c.isMultivariate,e[33]=r,e[34]=we):we=e[34];let H;e[35]!==Y?(H=P=>{P.stopPropagation(),Y()},e[35]=Y,e[36]=H):H=e[36];let le;e[37]===Symbol.for("react.memo_cache_sentinel")?(le=n.jsx(Pr,{className:"h-4 w-4"}),e[37]=le):le=e[37];let _e;e[38]!==r?(_e=r("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=r,e[39]=_e):_e=e[39];let fe;e[40]!==H||e[41]!==_e?(fe=n.jsxs(Kt,{onClick:H,children:[le,_e]}),e[40]=H,e[41]=_e,e[42]=fe):fe=e[42];let te;e[43]!==V||e[44]!==l||e[45]!==Ve||e[46]!==r?(te=l&&n.jsxs(Kt,{className:ne(!V&&No),onClick:P=>{P.stopPropagation(),Ve()},children:[n.jsx(ra,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=V,e[44]=l,e[45]=Ve,e[46]=r,e[47]=te):te=e[47];let pe;e[48]!==V||e[49]!==z||e[50]!==de||e[51]!==r?(pe=z&&n.jsxs(Kt,{className:ne(!V&&oi),onClick:P=>{P.stopPropagation(),de()},children:[V?n.jsx(fs,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=V,e[49]=z,e[50]=de,e[51]=r,e[52]=pe):pe=e[52];let se;e[53]!==V||e[54]!==ae||e[55]!==c.isMultivariate||e[56]!==c.isSavedBlock||e[57]!==r?(se=c.isSavedBlock===!0&&!c.isMultivariate&&n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),ae()},children:[V?n.jsx(ia,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=V,e[54]=ae,e[55]=c.isMultivariate,e[56]=c.isSavedBlock,e[57]=r,e[58]=se):se=e[58];let Me;e[59]!==b?(Me=P=>{P.stopPropagation(),b()},e[59]=b,e[60]=Me):Me=e[60];let ge;e[61]===Symbol.for("react.memo_cache_sentinel")?(ge=n.jsx(Cr,{className:"h-4 w-4"}),e[61]=ge):ge=e[61];let Re;e[62]!==r?(Re=r("sectionsEditor.sectionList.deleteMenuItem"),e[62]=r,e[63]=Re):Re=e[63];let je;e[64]!==Me||e[65]!==Re?(je=n.jsxs(Kt,{variant:"destructive",onClick:Me,children:[ge,Re]}),e[64]=Me,e[65]=Re,e[66]=je):je=e[66];let ve;e[67]!==we||e[68]!==fe||e[69]!==te||e[70]!==pe||e[71]!==se||e[72]!==je?(ve=n.jsxs(So,{align:"end",className:"w-44",children:[we,fe,te,pe,se,je]}),e[67]=we,e[68]=fe,e[69]=te,e[70]=pe,e[71]=se,e[72]=je,e[73]=ve):ve=e[73];let Se;e[74]!==L||e[75]!==Ae||e[76]!==ve?(Se=n.jsxs(L,{children:[Ae,ve]}),e[74]=L,e[75]=Ae,e[76]=ve,e[77]=Se):Se=e[77];let ze;return e[78]!==G||e[79]!==Ee||e[80]!==R||e[81]!==Te||e[82]!==C||e[83]!==Be||e[84]!==oe||e[85]!==re||e[86]!==Ne||e[87]!==Se||e[88]!==Oe?(ze=n.jsxs("div",{ref:Te,style:C,...G,...Ee,role:mt,tabIndex:me,onClick:R,onKeyDown:Oe,className:Be,children:[oe,re,Ne,Se]}),e[78]=G,e[79]=Ee,e[80]=R,e[81]=Te,e[82]=C,e[83]=Be,e[84]=oe,e[85]=re,e[86]=Ne,e[87]=Se,e[88]=Oe,e[89]=ze):ze=e[89],ze}function ui(h){return h.stopPropagation()}function di(h){return h.stopPropagation()}function mi(){return!1}function Fs(h){const e=Jt.c(11),{canAddSection:c,onAddSection:p,className:g,size:j}=h,E=Yt();let y;e[0]!==g?(y=ne("w-full",g),e[0]=g,e[1]=y):y=e[1];const R=!c;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Dr,{size:14}),e[2]=b):b=e[2];let Y;e[3]!==E?(Y=E("sectionsEditor.sectionList.addSectionButton"),e[3]=E,e[4]=Y):Y=e[4];let de;return e[5]!==p||e[6]!==j||e[7]!==y||e[8]!==R||e[9]!==Y?(de=n.jsxs(Vt,{type:"button",variant:"outline",size:j,className:y,disabled:R,onClick:p,children:[b,Y]}),e[5]=p,e[6]=j,e[7]=y,e[8]=R,e[9]=Y,e[10]=de):de=e[10],de}function fi(h){const e=Jt.c(101),{listKey:c,rawSections:p,sections:g,meta:j,decofile:E,selectedIndex:y,onSelect:R,onReorder:b,onDelete:Y,onDuplicate:de,onMakeReusable:Ce,onToggleHidden:Ke,onToggleLazy:Ve,onAddVariant:ae,onDetach:r,onAddSection:V,canAddSection:he}=h,$=he===void 0?!0:he,u=Yt(),O=ps();let l;e[0]!==g.length?(l=()=>na(g.length),e[0]=g.length,e[1]=l):l=e[1];const[q,G]=k.useState(l),[Ee,Te]=k.useState(null),[Ge,xe]=k.useState(c),[m,M]=k.useState(g.length),qe=k.useRef(!1);Ge!==c?(xe(c),M(g.length),G(na(g.length))):m!==g.length&&(M(g.length),G(Pe=>ri(Pe,g.length)));let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[2]=C):C=e[2];let We;e[3]===Symbol.for("react.memo_cache_sentinel")?(We={coordinateGetter:zr},e[3]=We):We=e[3];const z=Kr(ea(Fr,C),ea(Lr,We));let mt;e[4]!==q?(mt=q.map(pi),e[4]=q,e[5]=mt):mt=e[5];const me=mt;let Oe;e[6]===Symbol.for("react.memo_cache_sentinel")?(Oe=Pe=>{Te(String(Pe.active.id))},e[6]=Oe):Oe=e[6];const _t=Oe;let Be;e[7]!==me||e[8]!==b?(Be=Pe=>{Te(null);const{active:I,over:K}=Pe;if(!K||I.id===K.id)return;const Le=me.indexOf(String(I.id)),Xe=me.indexOf(String(K.id));Le===-1||Xe===-1||(G(nt=>ca(ms([...nt],Le,Xe))),qe.current=!0,requestAnimationFrame(()=>{qe.current=!1}),b?.(Le,Xe))},e[7]=me,e[8]=b,e[9]=Be):Be=e[9];const oe=Be;let re;e[10]===Symbol.for("react.memo_cache_sentinel")?(re=()=>{Te(null)},e[10]=re):re=e[10];const Ne=re;let L,A,ie,ke,Ae,we,H,le,_e,fe,te,pe,se,Me,ge;if(e[11]!==Ee||e[12]!==$||e[13]!==O||e[14]!==E||e[15]!==q||e[16]!==me||e[17]!==oe||e[18]!==j||e[19]!==V||e[20]!==ae||e[21]!==Y||e[22]!==r||e[23]!==de||e[24]!==Ce||e[25]!==R||e[26]!==Ke||e[27]!==Ve||e[28]!==p||e[29]!==g||e[30]!==y||e[31]!==z||e[32]!==u){Me=Symbol.for("react.early_return_sentinel");e:{const Pe=I=>{qe.current||R(I)};if(e[48]!==Ee||e[49]!==$||e[50]!==O||e[51]!==q||e[52]!==V||e[53]!==p||e[54]!==g||e[55]!==u){const I=Ee?q.find(K=>K.id===Ee):null;if(ke=I!=null?g[I.index]:null,ie=I!=null?p[I.index]:void 0,q.length===0){let K;e[59]!==u?(K=u("sectionsEditor.sectionList.noSections"),e[59]=u,e[60]=K):K=e[60];let Le;e[61]!==K?(Le=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:K}),e[61]=K,e[62]=Le):Le=e[62];const Xe=Le;let nt;e[63]!==$||e[64]!==O||e[65]!==Xe||e[66]!==V?(nt=O?Xe:n.jsxs("div",{className:"space-y-2",children:[Xe,n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm"})]}),e[63]=$,e[64]=O,e[65]=Xe,e[66]=V,e[67]=nt):nt=e[67],Me=nt;break e}se=ne(I&&"cursor-grabbing"),e[48]=Ee,e[49]=$,e[50]=O,e[51]=q,e[52]=V,e[53]=p,e[54]=g,e[55]=u,e[56]=ie,e[57]=ke,e[58]=se}else ie=e[56],ke=e[57],se=e[58];A=$r,le=z,_e=Hr,fe=_t,te=oe,pe=Ne,L=Gr,we=me,H=qr,ge="space-y-1",Ae=q.map(I=>{const K=g[I.index];return K?n.jsx(ci,{sortableId:I.id,section:K,raw:p[I.index],meta:j,decofile:E,selected:y===I.index,onSelect:()=>Pe(I.index),onDelete:()=>Y(I.index),onDuplicate:()=>de(I.index),onMakeReusable:()=>Ce(I.index),onToggleHidden:()=>Ke(I.index),onToggleLazy:()=>Ve(I.index),onAddVariant:()=>ae(I.index),onDetach:()=>r(I.index)},I.id):null})}e[11]=Ee,e[12]=$,e[13]=O,e[14]=E,e[15]=q,e[16]=me,e[17]=oe,e[18]=j,e[19]=V,e[20]=ae,e[21]=Y,e[22]=r,e[23]=de,e[24]=Ce,e[25]=R,e[26]=Ke,e[27]=Ve,e[28]=p,e[29]=g,e[30]=y,e[31]=z,e[32]=u,e[33]=L,e[34]=A,e[35]=ie,e[36]=ke,e[37]=Ae,e[38]=we,e[39]=H,e[40]=le,e[41]=_e,e[42]=fe,e[43]=te,e[44]=pe,e[45]=se,e[46]=Me,e[47]=ge}else L=e[33],A=e[34],ie=e[35],ke=e[36],Ae=e[37],we=e[38],H=e[39],le=e[40],_e=e[41],fe=e[42],te=e[43],pe=e[44],se=e[45],Me=e[46],ge=e[47];if(Me!==Symbol.for("react.early_return_sentinel"))return Me;let Re;e[68]!==Ae||e[69]!==ge?(Re=n.jsx("div",{className:ge,children:Ae}),e[68]=Ae,e[69]=ge,e[70]=Re):Re=e[70];let je;e[71]!==L||e[72]!==we||e[73]!==H||e[74]!==Re?(je=n.jsx(L,{items:we,strategy:H,children:Re}),e[71]=L,e[72]=we,e[73]=H,e[74]=Re,e[75]=je):je=e[75];let ve;e[76]!==ie||e[77]!==ke||e[78]!==O||e[79]!==E||e[80]!==j?(ve=ke?n.jsx("div",{className:ne("cursor-grabbing shadow-lg ring-1 ring-border/60",da(ke,!1,O)),children:n.jsx(ua,{section:ke,raw:ie,meta:j,decofile:E})}):null,e[76]=ie,e[77]=ke,e[78]=O,e[79]=E,e[80]=j,e[81]=ve):ve=e[81];let Se;e[82]!==ve?(Se=ho.createPortal(n.jsx(Br,{dropAnimation:wo,children:ve}),document.body),e[82]=ve,e[83]=Se):Se=e[83];let ze;e[84]!==A||e[85]!==le||e[86]!==_e||e[87]!==fe||e[88]!==te||e[89]!==pe||e[90]!==je||e[91]!==Se?(ze=n.jsxs(A,{sensors:le,collisionDetection:_e,onDragStart:fe,onDragEnd:te,onDragCancel:pe,children:[je,Se]}),e[84]=A,e[85]=le,e[86]=_e,e[87]=fe,e[88]=te,e[89]=pe,e[90]=je,e[91]=Se,e[92]=ze):ze=e[92];let P;e[93]!==$||e[94]!==O||e[95]!==V?(P=!O&&n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm",className:"mt-2"}),e[93]=$,e[94]=O,e[95]=V,e[96]=P):P=e[96];let st;return e[97]!==se||e[98]!==ze||e[99]!==P?(st=n.jsxs("div",{className:se,children:[ze,P]}),e[97]=se,e[98]=ze,e[99]=P,e[100]=st):st=e[100],st}function pi(h){return h.id}function ma(h,e){if(!h?.properties||e===null||typeof e!="object"||Array.isArray(e))return e;const c=e;let p=null;const g=()=>p??={...c};for(const[j,E]of Object.entries(h.properties)){if(!E||j.startsWith("__")||j==="@type")continue;const y=c[j];if(y===void 0){E.default!==void 0&&(g()[j]=E.default);continue}if(hi(E,y)){const R=ma(E,y);R!==y&&(g()[j]=R)}}return p??e}function hi(h,e){return h.type==="object"&&h.properties!=null&&e!==null&&typeof e=="object"&&!Array.isArray(e)&&!("__resolveType"in e)}function gi(h,e,c,p){if(!h||typeof h!="object")return{kind:"error",reason:"no-matcher-rule"};const g=e.trim();if(!g)return Rt(h,c,p)?{kind:"inline",blockKey:h.__resolveType??"",inlinedRule:Cs(h,c,p)}:{kind:"noop"};const j=Ks(h,c,p);if(!j)return{kind:"error",reason:"unreadable-rule"};if(j.blockKey)return{kind:"updateBlock",blockKey:j.blockKey,blockData:xt(j.resolveType,j.data,g)};const E=us(g),y=ds(E,c);return y?{kind:"error",reason:"invalid-block-id",message:y}:{kind:"createBlock",blockId:E,blockData:xt(j.resolveType,j.data,g),reference:Lt(E)}}function Kc({orgSlug:h,virtualMcpId:e,branch:c,previewReady:p=!0,previewUrl:g,currentPath:j,activePageBlockKey:E=null,activeGlobalBlockKey:y=null,externalSelection:R,onSaved:b,initialEditSeo:Y=!1,onExitSeo:de,onSelectRoot:Ce,onViewJsonFile:Ke,onFocusedBlockChange:Ve,onVariantPreviewOverride:ae}){const r=Yt(),V=_o(),he=V?.taskId??null,$=p?{orgSlug:h,virtualMcpId:e,branch:c,threadId:he,previewUrl:g}:null,{data:u,isLoading:O}=Do($),{data:l,isLoading:q}=Co($),G=ps(),Ee=V?.virtualMcpId,Ge=br(Ee===e?e:null)?.metadata?.siteSlug??null,xe=Jr({virtualMcpId:e,sandboxUrl:g}),[m,M]=k.useState(null),[qe,C]=k.useState(null),[We,z]=k.useState(null),[mt,me]=k.useState(0),[Oe,_t]=k.useState(void 0),[Be,oe]=k.useState(null),[re,Ne]=k.useState(null),[L,A]=k.useState([]),ie=k.useRef(null),[ke,Ae]=k.useState(L.length);ke!==L.length&&(Ae(L.length),requestAnimationFrame(()=>{ie.current&&(ie.current.scrollTop=0)}));const[we,H]=k.useState(0),[le,_e]=k.useState(null),[fe,te]=k.useState(null),[pe,se]=k.useState(null),[Me,ge]=k.useState(!1),[Re,je]=k.useState(!1),ve=k.useRef(null),[Se,ze]=k.useState(!0),[P,st]=k.useState(!1),[Pe,I]=k.useState(!1),[K,Le]=k.useState(Y),[Xe,nt]=k.useState(Y);Y&&!Xe&&(nt(!0),Le(!0),M(null),C(null),z(null),A([])),!Y&&Xe&&nt(!1);const[fa,Qt]=k.useState(null),[Os,hs]=k.useState(void 0),[zs,jt]=k.useState([]),[$s,Ft]=k.useState(0),[Fe,Ue]=k.useState(0),[pa,De]=k.useState(null),[Tt,Ie]=k.useState(null),[Hs,Gs]=k.useState(null),ha=yo(),ga=`${h}/${e}/${c}`,Xt=Ko({orgSlug:h,virtualMcpId:e,branch:c}),[va,Sa]=k.useState(j),[ya,ba]=k.useState(E),[xa,_a]=k.useState(y);(va!==j||ya!==E||xa!==y)&&(queueMicrotask(()=>Xt.flush()),Sa(j),ba(E),_a(y),M(null),C(null),z(null),me(0),oe(null),Ne(null),Ue(0),De(null),Ie(null),A([]),H(t=>t+1),Le(!1),Qt(null),hs(void 0),jt([]),Ft(t=>t+1));const W=Bo({orgSlug:h,virtualMcpId:e,branch:c}),It=nr((t,s)=>{W.mutate({blockKey:t,data:s},{onSuccess:()=>b?.(),onError:a=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Zt=wr({orgSlug:h,virtualMcpId:e,branch:c}),[Nt,At]=k.useState(!1),Q=k.useRef(null),at=k.useRef(null),ot=k.useRef(null),gs=k.useRef({}),$e=k.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[ja,Ea]=k.useState(null);if(!p||O||q)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(bo,{className:"size-5 text-muted-foreground"})});if(!u||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const ka=Tr(u),U=!!y,Z=U?null:Nr(ka,j,E),v=U?y:Z?.key??null,vs=U&&y?u[y]:void 0,qs=U&&y&&vs?Ar(y,vs):U&&y?y:"",Ot=!U&&v&&u[v]?u[v]:null,Ss=K&&u&&l&&v&&Z?Bn(u,{kind:"page",pageKey:v,pageName:String(Z.name??""),path:String(Z.path??"")},l):null,wa=K?Ot?.seo:void 0,es=Os!==void 0?Os:wa,Ra=K?Lo(es):void 0,Ws=Ss?.seoTypeOptions??[],Us=K&&l?Fo(l):"",ys=fa??Ra??{},ts=K&&Ss?Wr(ys,Ss):null,Js=K&&ts&&Io(es)?cs(ts,l):null,Ys=K?Oo(u,l)?.seoData:void 0,ce=U?[{label:"Default",sections:[{__resolveType:y}]}]:zo(Ot?.sections,u??{}),Ze=ce.length>1,ee=Math.min(mt,ce.length-1),He=ce[ee],B=He?.sections??[],ye=is(B,u),bs=!U&&$o(Ot?.sections);if(U&&y&&Hs!==y){Gs(y);const t=B[0],s=ye[0];if(t&&s){M(0),Ue(0),A([]);const a=kt(t,s,u);a&&(C(a.data),z(a.resolveType),Ie(null),De(null))}}!U&&Hs!==null&&Gs(null),$e.current={rawSections:B,parsedSections:ye,decofile:u??{},activePageKey:v,pageVariants:ce,variantIndex:ee,sectionVariantIndex:Fe,selectedSectionIndex:m};const Va=()=>({multivariate:bs,index:ee,variants:ce.map(t=>({rule:t.rule}))}),xs=(t,s)=>{if(!ae)return;if(!v||!bs||t.length<=1){ae(null);return}const a=sa(v,{multivariate:!0,index:s,variants:t},u,l);ae(a.length>0?a:null)},_s=ae&&v&&bs&&Ze&&!O&&!q?v:null;if(_s!==ja&&(Ea(_s),_s)){const t=ce.map(a=>({rule:a.rule})),s=ee;queueMicrotask(()=>xs(t,s))}const Mt=(t,s,a)=>{if(!ae)return;if(!v){ae(null);return}const o=Va(),i=sa(v,o,u,l);if(!t||s<0){ae(i.length>0?i:null);return}const f=Qr({pageKey:v,page:o,sectionIndex:s,sectionLazy:ye[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:u,meta:l}),d=[...i,...f];ae(d.length>0?d:null)},ft=(t,s,a,o=m??-1,i=!1)=>{const f=tt(t,s);if(!f){C(null),z(null),Ie(null),De(null),i&&Mt(null,o,a);return}const x=Ln(f,lt)[a];if(!x){C(null),z(null),Ie(null),De(null),i&&Mt(null,o,a);return}const T=Zo(x.value,u);C(T?.data??null),z(T?.resolveType??null);const{resolveType:S,formValue:_}=qt(x.rule,u,l??void 0);Ie(S),De(_),i&&Mt(f,o,a)},zt=R?.index;if(R!==void 0&&(R?.seq??null)!==Oe&&(_t(R?.seq??null),typeof zt=="number")){const t=B[zt],s=ye[zt];if(t&&s)if(M(zt),Ue(0),A([]),H(a=>a+1),s.isMultivariate)ft(t,s,0,zt);else{const a=kt(t,s,u);a?(C(a.data),z(a.resolveType)):(C(null),z(null)),Ie(null),De(null)}}const $t={orgSlug:h,virtualMcpId:e,branch:c,threadId:he,previewUrl:g??void 0,siteSlug:Ge},ss=We&&l?cs(We,l):null,Je=(t,s)=>{if(!v)return;Q.current&&(clearTimeout(Q.current),Q.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null);const a=Ut(u,v,t,ee,ce);W.mutate({blockKey:v,data:a},{onSuccess:()=>s?.onSuccess?.()??b?.(),onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},Pt=()=>{Ve?.(null),M(null),I(!1),C(null),z(null),Ue(0),De(null),Ie(null),A([]),H(t=>t+1)},Ta=(t,s)=>{Q.current&&clearTimeout(Q.current);const a=$e.current.sectionVariantIndex;Q.current=setTimeout(()=>{const{rawSections:o,parsedSections:i,decofile:f,activePageKey:d,pageVariants:x,variantIndex:T}=$e.current,S=o[s];if(!S)return;const _=i[s];if(!_)return;if(_.isSavedBlock){const D=gr(S,_);if(!D)return;W.mutate({blockKey:D,data:t},{onSuccess:()=>b?.(),onError:F=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:F.message}))});return}if(!d)return;const w={...f[d]},J=[...o];if(_.isMultivariate){const D=tt(S,_);if(!D||!d)return;const F=vr(D,a,t);J[s]=wt(S,_,F)}else if(_.isHidden){const D=Is(S.__resolveType),F=D?{...S.section}:{...S},ue=Array.isArray(F.variants)?[...F.variants]:[];ue[0]&&(ue[0]={...ue[0],value:t}),F.variants=ue,D?J[s]={...S,section:F}:J[s]=F}else _.isLazy?J[s]={...S,section:t}:J[s]=t;if(x.length>1){const D=w.sections,F=[...D?.variants??[]];F[T]&&(F[T]={...F[T],value:J}),w.sections={...D,variants:F}}else w.sections=J;W.mutate({blockKey:d,data:w},{onSuccess:()=>b?.(),onError:D=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:D.message}))})},Ps)},Na=t=>{M(t),Ue(0),A([]),H(i=>i+1);const s=B[t],a=ye[t];if(Ve?.(a?.isSavedBlock?a.resolveType??null:null),!s||!a)return;if(a.isMultivariate){ft(s,a,0,t);return}const o=kt(s,a,u);if(!o){C(null),z(null),Ie(null),De(null),Mt(null,t,0);return}C(o.data),z(o.resolveType),Ie(null),De(null),Mt(null,t,0)},Qs=t=>{const s=ma(ss,t);C(s),m!==null&&Ta(s,m)},js=t=>{if(!v||!u||!l||!Z)return;const s={kind:"page",pageKey:v,pageName:String(Z.name??""),path:String(Z.path??"")},a=Bn(u,s,l);a&&Xt.save(v,()=>{const o=ha.getQueryData(xo.decofile(ga))?.[v];if(!o||typeof o!="object"||o===null||Array.isArray(o))return null;const i={...o,...gs.current};return gs.current={},t?.raw!==void 0?{...i,seo:t.raw}:t?.inner!==void 0?Ur(s,a,i,t.inner):i})},Xs=(t,s)=>{v&&(gs.current[t]=s,js())},Aa=(t,s)=>{if(!v)return;const a=ms([...B],t,s);m!==null&&(m===t?M(s):t<m&&s>=m?M(m-1):t>m&&s<=m&&M(m+1)),Je(a)},Ma=t=>{if(!v)return;const s=B.filter((a,o)=>o!==t);m===t?Pt():m!==null&&m>t&&M(m-1),Je(s)},Pa=t=>{if(!v)return;const s=B[t];if(!s)return;const a=[...B];a.splice(t+1,0,dr(s)),m!==null&&m>t&&M(m+1),Je(a)},Da=t=>{if(!v)return;const s=B[t],a=ye[t];if(!s||!a)return;const o=a.isHidden?cr(s):ur(s);if(!o)return;const i=[...B];i[t]=o,m===t&&Pt(),Je(i)},Ca=t=>{if(!v)return;const s=B[t],a=ye[t];if(!s||!a||a.isMultivariate)return;const o=lr(s);if(!o)return;const i=[...B];i[t]=o,m===t&&Pt(),Je(i)},Ka=t=>{if(!v)return;const s=B[t],a=ye[t];if(!s||!a?.isSavedBlock)return;const o=kt(s,a,u);if(!o?.data)return;const{name:i,...f}=o.data,d=[...B];a.isLazy?d[t]={...s,section:f}:d[t]=f,m===t&&Pt(),Je(d)},Ba=t=>{if(!v)return;const s=[...B,{__resolveType:t.resolveType}],a=s.length-1;Je(s,{onSuccess:()=>{ge(!1),M(a),Ue(0),A([]),H(d=>d+1);const o=s[a],i=is(s,u)[a];if(!o||!i)return;if(i.isMultivariate){ft(o,i,0);return}const f=kt(o,i,u);if(!f){C(null),z(null),Ie(null),De(null);return}C(f.data),z(f.resolveType),Ie(null),De(null)}})},Zs=t=>{ve.current=t.append,ge(!0)},La=t=>{const s=ve.current;if(!s){Ba(t);return}s({__resolveType:t.resolveType}),ge(!1),ve.current=null},en=t=>{if(m===null)return;const s=B[m],a=ye[m];!s||!a?.isMultivariate||(Ue(t),A([]),H(o=>o+1),ft(s,a,t,m,!0))},Fa=t=>{if(m===null||!v)return;const s=B[m],a=ye[m];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const i=rr(o,t);if(!i){N.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const f=[...B];f[m]=wt(s,a,i);const d=i.variants;let x=Fe;t===Fe?x=Math.min(t,d.length-1):t<Fe&&(x=Fe-1),Ue(x),A([]),H(T=>T+1),ft(f[m],a,x),Je(f)},Ia=t=>{if(m===null||!v)return;const s=B[m],a=ye[m];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const i=ir(o,t),f=[...B];f[m]=wt(s,a,i);const d=t+1;Ue(d),A([]),H(x=>x+1),ft(f[m],a,d),Je(f)},Oa=(t,s)=>{if(m===null||!v||t===s)return;const a=B[m],o=ye[m];if(!a||!o?.isMultivariate)return;const i=tt(a,o);if(!i)return;const f=ar(i,t,s),d=[...B];d[m]=wt(a,o,f);let x=Fe;Fe===t?x=s:t<Fe&&s>=Fe?x=Fe-1:t>Fe&&s<=Fe&&(x=Fe+1),Ue(x),ft(d[m],o,x),Je(d)},Ht=t=>{const s=t??m;if(s===null||!v)return;const a=B[s],o=ye[s];if(!a||!o)return;const i=er(a,o);if(!i){N.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const f=[...B];f[s]=i.section;const d=is(f,u)[s];if(!d?.isMultivariate){N.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}M(s),Ue(i.newVariantIndex),A([]),H(x=>x+1),ft(i.section,d,i.newVariantIndex,s),Je(f)},tn=()=>{if(m===null||!v)return;const t=B[m],s=ye[m];if(!t||!s?.isMultivariate)return;const a=tt(t,s);if(!a)return;const o=or(t,s,a);if(!o){N.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const i=[...B];i[m]=o;const f=is(i,u)[m];if(!f)return;Ue(0),Ie(null),De(null),A([]),H(x=>x+1);const d=kt(o,f,u);d?(C(d.data),z(d.resolveType)):(C(null),z(null)),Mt(null,m,0),Je(i)},za=async t=>{if(le===null||!v)return;const s=ds(t,u);if(s){N.error(s);return}const a=B[le],o=ye[le];if(!a||!o)return;const i=kt(a,o,u);if(!i){N.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const f={...i.data,name:t};try{await W.mutateAsync({blockKey:t,data:f});const d=[...B];d[le]={__resolveType:t},await W.mutateAsync({blockKey:v,data:Ut(u,v,d,ee,ce)}),m===le&&Pt(),_e(null),N.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),b?.()}catch(d){N.error(d instanceof Error?d.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},sn=He?.rule;if(Ze&&m===null&&re===null&&sn){const{resolveType:t,formValue:s}=qt(sn,u??{},l??void 0);Ne(t),oe(s)}const Dt=l?Ho(l):[],Es=l&&u?Go(l,u):[],nn=!U&&!!(xe&&l&&u),an=re&&l?cs(re,l):null,pt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},Et=async(t,s)=>{if(!(hr(s,t,l)>0))try{await Zt.mutateAsync({blockKey:t})}catch(a){N.error(a instanceof Error?a.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},on=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:o}=$e.current;if(!s)return;const i={...a[s]},f={...i.sections},d=[...f.variants??[]],x=d[o],T=x?.rule;if(Rt(T,a,l)){const S=T?.__resolveType??"",_=a[S],w=typeof _?.name=="string"?_.name:S,{__resolveType:J,...D}=t;W.mutate({blockKey:S,data:xt(J??"",D,w)},{onSuccess:()=>b?.(),onError:F=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:F.message}))});return}x&&(d[o]={...x,rule:t}),i.sections={...f,variants:d},W.mutate({blockKey:s,data:i},{onSuccess:()=>b?.(),onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Ps)},rn=t=>{Ne(t);const s=t?Wn(t,l):{__resolveType:Qn};oe(t?s:{}),on(s)},ln=t=>{const s=t;oe(s);const a=re?{__resolveType:re,...s}:{...s};on(a)},cn=async t=>{pt();const{activePageKey:s,decofile:a,variantIndex:o}=$e.current;if(!s)return;const i=a[s],f=i?.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const d=f;if(!Array.isArray(d.variants))return;const x=[...d.variants],T=x[o];if(!T)return;const S=bt(T.rule,a,l),_=Lt(t);x[o]={...T,rule:_};const w={...a,[s]:{...i,sections:{...d,variants:x}}},{resolveType:J,formValue:D}=qt(_,w,l??void 0);Ne(J),oe(D);try{await W.mutateAsync({blockKey:s,data:w[s]}),S&&S!==t&&await Et(S,w),b?.()}catch(F){N.error(F instanceof Error?F.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},un=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=$e.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:o,parsedSections:i,decofile:f,activePageKey:d,pageVariants:x,variantIndex:T}=$e.current;if(!d)return;const S=o[s],_=i[s];if(!S||!_?.isMultivariate)return;const w=tt(S,_);if(!w)return;const D=(w.variants??[])[a]?.rule;if(Rt(D,f,l)){const X=D?.__resolveType??"",Qe=f[X],rt=typeof Qe?.name=="string"?Qe.name:X,{__resolveType:St,...it}=t;W.mutate({blockKey:X,data:xt(St??"",it,rt)},{onSuccess:()=>b?.(),onError:yt=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:yt.message}))});return}const F=Un(w,a,t),ue=[...o];ue[s]=wt(S,_,F);const et=Ut(f,d,ue,T,x);W.mutate({blockKey:d,data:et},{onSuccess:()=>b?.(),onError:X=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:X.message}))})},Ps))},$a=t=>{Ie(t);const s=t?Wn(t,l):{__resolveType:Qn};De(t?s:{}),un(s)},Ha=t=>{const s=t;De(s);const a=Tt?{__resolveType:Tt,...s}:{...s};un(a)},Ga=async t=>{pt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:o,parsedSections:i,decofile:f,activePageKey:d,pageVariants:x,variantIndex:T}=$e.current;if(s===null||!d)return;const S=o[s],_=i[s];if(!S||!_?.isMultivariate)return;const w=tt(S,_);if(!w)return;const J=w.variants??[],D=bt(J[a]?.rule,f,l),F=Lt(t),ue=Un(w,a,F),et=[...o];et[s]=wt(S,_,ue);const X=Ut(f,d,et,T,x),Qe={...f,[d]:X},{resolveType:rt,formValue:St}=qt(F,Qe,l??void 0);Ie(rt),De(St);try{await W.mutateAsync({blockKey:d,data:X}),D&&D!==t&&await Et(D,Qe),b?.()}catch(it){N.error(it instanceof Error?it.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!U&&!Z)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.noPageFound",{currentPath:j})});if(U&&!vs)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.globalBlockNotFound")});const be=m!==null?ye[m]??null:null,dn=m!==null?B[m]:null,mn=dn&&be?.isMultivariate?tt(dn,be):null,ht=mn?Ln(mn,lt):[],ns=Math.min(Fe,Math.max(ht.length-1,0)),Ct=ht[ns]??null,gt=be?.isMultivariate===!0,ks=m!==null&&be!==null,vt=ks&&(gt||!!(ss&&qe)),qa=vt&&!U&&be?.isSavedBlock===!0,Ye=U||qa,fn=U?qs:be?.label??"",Wa=Tt&&l?cs(Tt,l):null,pn=(t,s)=>s&&G?`${t} · ${s}`:t,hn=be?be.variantOf??be.label:"",Ua=(()=>{const t=gt&&Ct?Ct.label:null;return t?G?[pn(hn,t)]:[be.label,t]:[be?.label??""]})(),ws=pn(Z?.name??"",Ze?He?.label:null),as=vt&&(!U||L.length>0)?U?[qs,...L]:[ws,...Ua,...L]:[],gn=K&&Z?[Z.name,"SEO",...zs]:[],vn=r("sectionsEditor.pageVariantTabs.variantsLabel"),Sn=P&&Z?[Z.name,vn]:Pe&&Z&&be?[ws,hn,vn]:[],os=Sn.length>0?Sn:gn.length>0?gn:Ye?as.length>0?as:[fn]:as.length>0?as:[ws],yn=ks&&!gt&&!be?.isHidden&&!!v,Ja=Ye||!U&&Ze&&!!He||yn,Ya=ks&&!gt&&!U&&L.length===0&&!!be&&oa(be)&&!!v,Qa=G&&vt&&!Pe&>&&L.length===0&&!!Ct,bn=G&&L.length>0?Fn(L[L.length-1]):null,Xa=L.length>1?Fn(L[L.length-2]):null,xn=Ye?fn:vt?be?.label??"":Z?.name??"",Za=P||Pe?r("sectionsEditor.pageVariantTabs.variantsLabel"):K?r("sectionsEditor.panelSections.seo"):bn??xn,_n=Pe?be?.variantOf??be?.label??"":P||K?Z?.name??"":bn?Xa??xn:Ye?r("sectionsEditor.sectionsEditor.globalSectionSubtitle"):vt?Z?.name??"":Z?.path??"",Rs=!P&&!Pe&&!K&&!vt&&!Ye,eo=!G&&!K&&!U&>&&L.length===0,Gt=()=>{if(!v)return;pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const t=u[v],s=tr(t.sections,B);if(!s)return;const a=sr(s);W.mutate({blockKey:v,data:{...t,sections:s}},{onSuccess:()=>{me(a),M(null),C(null),z(null),A([]),oe(null),Ne(null)},onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},rs=(t,s,a)=>{if(!v)return;pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const o=u[v],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const f=i;if(!Array.isArray(f.variants))return;const d=t([...f.variants]);if(!d)return;const x=pr(f,d),T={...u,[v]:{...o,sections:x}};W.mutate({blockKey:v,data:T[v]},{onSuccess:()=>{s?.();const S=typeof a=="string"?[a]:a??[];(async()=>{for(const _ of S)await Et(_,T)})()},onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Vs=t=>{te(null),me(t),M(null),C(null),z(null),A([]);const s=ce[t]?.rule,{resolveType:a,formValue:o}=qt(s,u??{},l??void 0);Ne(a),oe(o),xs(ce.map(i=>({rule:i.rule})),t)},jn=(t,s)=>{if(t===s)return;let a=ee;ee===t?a=s:t<ee&&s>=ee?a=ee-1:t>ee&&s<=ee&&(a=ee+1),me(a);const o=ms(ce.map(i=>({rule:i.rule})),t,s);xs(o,a),rs(i=>ms(i,t,s))},En=t=>{const s=ce[t]?.rule,a=bt(s,u??{},l??void 0);rs(o=>o.length<=1?null:(o.splice(t,1),o),()=>{ce.length-1===1?me(0):t<ee?me(ee-1):t===ee&&me(Math.max(0,t-1)),M(null),C(null),z(null),A([]),oe(null),Ne(null)},a)},to=()=>{const t=ce.map((s,a)=>({variant:s,index:a})).filter(({variant:s})=>!fr(s.rule)).map(({variant:s})=>bt(s.rule,u??{},l??void 0)).filter(s=>!!s);rs(s=>{const a=Sr({variants:s}),o=s[a];return o?[{...o,rule:Mr()}]:null},()=>{me(0),M(null),C(null),z(null),A([]),oe(null),Ne(null),st(!1)},t)},kn=t=>{rs(s=>yr(s,t),()=>{me(t+1),M(null),C(null),z(null),A([]),oe(null),Ne(null)})},so=async(t,s)=>{pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const a=$e.current.activePageKey,o=$e.current.decofile;if(!a)return;const i=o[a],f=i.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const d=f;if(!Array.isArray(d.variants))return;const x=[...d.variants],T=x[t];if(!T?.rule||typeof T.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const S=T.rule,_=s.trim();At(!0);try{if(!_){if(!Rt(S,o,l)){te(null);return}const et=S.__resolveType??"";x[t]={...T,rule:Cs(S,o,l)};const X={...o,[a]:{...i,sections:{...d,variants:x}}};await W.mutateAsync({blockKey:a,data:X[a]}),await Et(et,X),te(null),b?.();return}const w=Ks(S,o,l);if(!w){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(w.blockKey){await W.mutateAsync({blockKey:w.blockKey,data:xt(w.resolveType,w.data,_)}),te(null),b?.();return}const J=us(_),D=ds(J,o);if(D){N.error(D);return}const F=xt(w.resolveType,w.data,_);let ue=null;try{await W.mutateAsync({blockKey:J,data:F}),ue=J,x[t]={...T,rule:Lt(J)},await W.mutateAsync({blockKey:a,data:{...i,sections:{...d,variants:x}}}),ue=null}catch(et){throw ue&&await Zt.mutateAsync({blockKey:ue}).catch(()=>{}),et}te(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:_})),b?.()}catch(w){N.error(w instanceof Error?w.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},no=async(t,s)=>{pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const{selectedSectionIndex:a,rawSections:o,parsedSections:i,decofile:f,activePageKey:d,pageVariants:x,variantIndex:T}=$e.current;if(a===null||!d)return;const S=o[a],_=i[a];if(!S||!_?.isMultivariate)return;const w=tt(S,_);if(!w)return;const J=w.variants??[],D=J[t];if(!D?.rule||typeof D.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const F=D.rule,ue=s.trim();At(!0);const et=async X=>{const Qe={...w,variants:X},rt=[...o];rt[a]=wt(S,_,Qe);const St=Ut(f,d,rt,T,x);return await W.mutateAsync({blockKey:d,data:St}),{...f,[d]:St}};try{if(!ue){if(!Rt(F,f,l)){se(null);return}const yt=F.__resolveType??"",Cn=[...J];Cn[t]={...D,rule:Cs(F,f,l)};const po=await et(Cn);await Et(yt,po),se(null),b?.();return}const X=Ks(F,f,l);if(!X){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(X.blockKey){await W.mutateAsync({blockKey:X.blockKey,data:xt(X.resolveType,X.data,ue)}),se(null),b?.();return}const Qe=us(ue),rt=ds(Qe,f);if(rt){N.error(rt);return}const St=xt(X.resolveType,X.data,ue);let it=null;try{await W.mutateAsync({blockKey:Qe,data:St}),it=Qe;const yt=[...J];yt[t]={...D,rule:Lt(Qe)},await et(yt),it=null}catch(yt){throw it&&await Zt.mutateAsync({blockKey:it}).catch(()=>{}),yt}se(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:ue})),b?.()}catch(X){N.error(X instanceof Error?X.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},wn=async(t,s,a)=>{C(a);try{await W.mutateAsync({blockKey:t,data:a})}catch(o){throw C(i=>i===a?s:i),o}},ao={rename:async(t,s,a)=>{pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const{activePageKey:o,decofile:i}=$e.current;if(!o)return;const f=Array.isArray(t.variants)?[...t.variants]:[],d=f[s],x=d?.rule&&typeof d.rule=="object"?d.rule:void 0,T=async _=>{const w={...t,variants:_};return await wn(o,t,w),{...i,[o]:w}},S=gi(x,a,i,l);if(S.kind!=="noop"){if(S.kind==="error"){N.error(S.reason==="no-matcher-rule"?r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):S.reason==="unreadable-rule"?r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):S.message??r("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}At(!0);try{if(S.kind==="inline"){const w=[...f];w[s]={...d,rule:S.inlinedRule};const J=await T(w);await Et(S.blockKey,J),b?.();return}if(S.kind==="updateBlock"){await W.mutateAsync({blockKey:S.blockKey,data:S.blockData}),b?.();return}let _=null;try{await W.mutateAsync({blockKey:S.blockId,data:S.blockData}),_=S.blockId;const w=[...f];w[s]={...d,rule:S.reference},await T(w),_=null}catch(w){throw _&&await Zt.mutateAsync({blockKey:_}).catch(()=>{}),w}N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:a.trim()})),b?.()}catch(_){N.error(_ instanceof Error?_.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}}},selectGlobal:async(t,s,a)=>{pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const{activePageKey:o,decofile:i}=$e.current;if(!o)return;const f=Array.isArray(t.variants)?[...t.variants]:[],d=f[s];if(!d)return;const x=bt(d.rule,i,l);f[s]={...d,rule:Lt(a)};const T={...t,variants:f},S={...i,[o]:T};try{await wn(o,t,T),x&&x!==a&&await Et(x,S),b?.()}catch(_){N.error(_ instanceof Error?_.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}}},Rn=()=>{Pt()},Vn=t=>{Qt(t),js({inner:t})},Tn=t=>{hs(t),js({raw:t})},Nn=()=>{Qt(null),jt([])},An=()=>Ft(t=>t+1),Mn=()=>{Xt.flush(),Le(!1),Qt(null),hs(void 0),jt([]),Ft(t=>t+1),de?.()},oo=()=>{st(!1),I(!1),M(null),Le(!0)},ro=()=>{K&&Mn(),M(null),st(!0)},io=()=>I(!0),Ts=t=>{if(P&&t===0){st(!1);return}if(Pe&&t<2){I(!1),t===0&&M(null);return}if(K){if(t===0){Mn();return}if(t===1){jt([]),Ft(a=>a+1);return}jt(zs.slice(0,t-1)),Ft(a=>a+1);return}if(U){A(L.slice(0,t)),H(a=>a+1);return}if(t===0){Rn();return}if(t===1){A([]),H(a=>a+1);return}const s=!G&>&&Ct?1:0;if(s===1&&t===2){A([]),H(a=>a+1);return}A(L.slice(0,t-1-s))},Ns=os.length>1?n.jsx("button",{type:"button",onClick:()=>Ts(mr(os.length,{isMultivariateSectionTop:eo})),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:ne("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",Ye?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(Er,{className:"size-4"})}):null,lo=Ye||vt||K?Ja&&n.jsxs("div",{className:ne("border-b px-3 py-2.5",Ye&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!U&&Ze&&He&&n.jsxs("button",{type:"button",onClick:Rn,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:He.label}),className:ne("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",Wo),children:[n.jsx(qo,{rule:As(He.rule,u??{},l??void 0),matchers:Dt}),n.jsx("span",{className:"max-w-[160px] truncate",children:He.label})]}),n.jsx("div",{className:"flex-1"}),Ye&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fs,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),yn&&n.jsx(ls,{onClick:()=>Ht()})]}),Ye&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:r("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(In,{pageKey:v,initialName:Z.name,initialPath:Z.path,onFieldChange:Xs,variant:"header"})}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Le(!0),children:n.jsx(Jn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Ke&&v?Ke():je(!0),children:n.jsx(Yn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(ls,{onClick:Gt})]}),co=n.jsxs(n.Fragment,{children:[Ze&&v&&n.jsx(On,{listKey:v,variants:ce,activeIndex:ee,decofile:u??{},meta:l,matchers:Dt,onSelect:Vs,onReorder:jn,onRename:te,onDuplicate:kn,onDelete:En,onAdd:Gt}),Ze&&re!==null&&n.jsx(zn,{className:"mt-3",children:n.jsx("div",{className:ne("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(Ms,{currentRt:re,currentLabel:Wt(He?.rule,u??{},lt,l??void 0),currentGlobalKey:bt(He?.rule,u??{},l??void 0)??void 0,matchers:Dt,globals:Es,onSelect:rn,onSelectGlobal:cn,schema:an,formValue:Be,onChange:ln,formKey:`${ee}:${re??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:u,onSaveReferencedBlock:It,sandbox:$t})})})]}),Pn=n.jsxs(n.Fragment,{children:[n.jsx(Uo,{listKey:`${v??""}:${m??""}`,variants:ht.map((t,s)=>({index:s,label:t.label})),selectedIndex:ns,onSelect:en,onRename:se,onDuplicate:Ia,onDelete:Fa,onRemoveAll:tn,onReorder:Oa,onAdd:()=>Ht()}),n.jsx(zn,{children:n.jsx(Ms,{currentRt:Tt??"",currentLabel:Wt(Ct?.rule,u??{},lt,l??void 0),currentGlobalKey:bt(Ct?.rule,u??{},l??void 0)??void 0,matchers:Dt,globals:Es,onSelect:$a,onSelectGlobal:Ga,schema:Wa,formValue:pa,onChange:Ha,formKey:`${m??"none"}:${ns}:${Tt??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:u,onSaveReferencedBlock:It,sandbox:$t})})]}),Dn=n.jsx("div",{className:ne(G?"px-2":"p-2 pt-3"),children:n.jsx(fi,{listKey:`${v??""}-${ee}`,rawSections:B,sections:ye,meta:l,decofile:u,selectedIndex:m,onSelect:Na,onReorder:Aa,onDelete:Ma,onDuplicate:Pa,onMakeReusable:_e,onToggleHidden:Da,onToggleLazy:Ca,onAddVariant:Ht,onDetach:Ka,onAddSection:()=>ge(!0),canAddSection:nn})}),uo=n.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[v&&Z&&n.jsx(In,{pageKey:v,initialName:Z.name,initialPath:Z.path,onFieldChange:Xs}),Ot&&v?n.jsx(ta,{rawSeo:es,innerSeo:ys,defaultResolveType:Us,seoSchema:Js,activeResolveType:ts,seoTypeOptions:Ws,formResetKey:$s,siteDefaultSeo:Ys,onBreadcrumbChange:jt,onPersistRaw:Tn,onInnerChange:Vn,onClearForm:Nn,onBumpFormKey:An}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),mo=n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&v?n.jsx(ta,{rawSeo:es,innerSeo:ys,defaultResolveType:Us,seoSchema:Js,activeResolveType:ts,seoTypeOptions:Ws,formResetKey:$s,siteDefaultSeo:Ys,onBreadcrumbChange:jt,onPersistRaw:Tn,onInnerChange:Vn,onClearForm:Nn,onBumpFormKey:An}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),fo=n.jsxs(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ze&&v&&n.jsx(On,{listKey:v,variants:ce,activeIndex:ee,decofile:u??{},meta:l,matchers:Dt,onSelect:Vs,onReorder:jn,onRename:te,onDuplicate:kn,onDelete:En,onAdd:Gt}),Ze&&re!==null&&n.jsxs("div",{className:ne("px-3 border-b",Se?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ze(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":Se,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),Se?n.jsx(xr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(_r,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),Se&&n.jsx("div",{className:ne("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(Ms,{currentRt:re,currentLabel:Wt(He?.rule,u??{},lt,l??void 0),currentGlobalKey:bt(He?.rule,u??{},l??void 0)??void 0,matchers:Dt,globals:Es,onSelect:rn,onSelectGlobal:cn,schema:an,formValue:Be,onChange:ln,formKey:`${ee}:${re??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:u,onSaveReferencedBlock:It,sandbox:$t})})]}),Dn]},"editor-section-list");return n.jsx(Jo,{children:n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!G&&Ns&&n.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:Ns}),(G||os.length>1)&&n.jsx(Yo,{crumbs:os,onSelect:Ts,onSelectRoot:()=>{Xt.flush(),Ce?Ce():Ts(0)}}),n.jsx("div",{className:"shrink-0",children:G?n.jsxs("div",{className:ne("flex items-center gap-2 border-b px-3 py-2.5",Ye&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[G&&Ns,Ye&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fs,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[n.jsx("span",{className:"truncate text-sm font-semibold",children:Za}),_n&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:_n})]}),Rs&&Ze&&He&&n.jsx($n,{variants:ce,activeIndex:ee,onSelect:Vs,onManage:ro,onRemoveAll:to}),Qa&&n.jsx($n,{variants:ht,activeIndex:ns,onSelect:en,onManage:io,onRemoveAll:tn}),Rs&&!Ze&&n.jsx(ls,{onClick:Gt}),Ya&&n.jsx(ls,{onClick:()=>Ht()}),n.jsx(Qo,{}),Rs&&n.jsxs(n.Fragment,{children:[n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:oo,children:n.jsx(Jn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),!Ke&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>je(!0),children:n.jsx(Yn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):lo}),Pe?n.jsx(Hn,{onAdd:()=>Ht(),children:Pn},"editor-section-variants"):vt?n.jsxs(Bt,{viewportRef:ie,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!G&>&&ht.length>0&&L.length===0&&Pn,n.jsx(Gn,{activeSchema:ss,formValue:qe,formResetKey:we,onFormChange:Qs,onBreadcrumbChange:A,breadcrumbPath:L,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:u,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:xe,onRequestAddSection:Zs,onVariantMatcherOp:U?ao:void 0})]},"editor-section-form"):U?n.jsx(Bt,{viewportRef:ie,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Gn,{activeSchema:ss,formValue:qe,formResetKey:we,onFormChange:Qs,onBreadcrumbChange:A,breadcrumbPath:L,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:u,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:xe,onRequestAddSection:Zs})},"editor-global-block"):K?G?n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3",children:uo})},"editor-seo"):mo:P?n.jsx(Hn,{onAdd:Gt,children:co},"editor-variants"):G?n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"py-2",children:Dn})}),n.jsx("div",{className:"shrink-0 border-t p-2",children:n.jsx(Fs,{canAddSection:nn,onAddSection:()=>ge(!0)})})]},"editor-section-list"):fo,n.jsx(Xo,{open:le!==null,onOpenChange:t=>{t||_e(null)},defaultBlockId:le!==null?us(ye[le]?.label??""):"",isPending:W.isPending,onSubmit:za}),xe&&n.jsx(Yr,{open:Me,onOpenChange:t=>{ge(t),t||(ve.current=null)},meta:l,decofile:u,previewBaseUrl:xe,onSelect:La}),Re&&v&&u&&n.jsx(Rr,{open:Re,onOpenChange:je,pageKey:v,decofile:u}),fe!==null&&n.jsx(qn,{open:!0,initialName:Rt(ce[fe]?.rule,u??{},l??void 0)?Wt(ce[fe]?.rule,u??{},lt,l??void 0):"",autoLabel:lt(As(ce[fe]?.rule,u??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await so(fe,t)},onOpenChange:t=>{!t&&!Nt&&te(null)}}),pe!==null&&n.jsx(qn,{open:!0,initialName:Rt(ht[pe]?.rule,u??{},l??void 0)?Wt(ht[pe]?.rule,u??{},lt,l??void 0):"",autoLabel:lt(As(ht[pe]?.rule,u??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await no(pe,t)},onOpenChange:t=>{!t&&!Nt&&se(null)}})]})})}export{Kc as SectionsEditor};
|