decocms 4.499.3 → 4.500.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/{ActiveShapeUtils-DgcQq6OT.js → ActiveShapeUtils-CHPU_j8T.js} +1 -1
- package/dist/client/assets/{AlertCircle-CKip96zJ.js → AlertCircle-CgfWDsMW.js} +1 -1
- package/dist/client/assets/{AreaChart-D-FKmMV3.js → AreaChart-CZuIkHuk.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DWXC5SxX.js → ArrowLeft-BkyozCr0.js} +1 -1
- package/dist/client/assets/{ArrowUp-Dg7Kez2q.js → ArrowUp-C0O7U47F.js} +1 -1
- package/dist/client/assets/{BarChart-BI8-_eKz.js → BarChart-D_Vp8_nk.js} +1 -1
- package/dist/client/assets/{Building02-BhbGM34V.js → Building02-C5UvSZSt.js} +1 -1
- package/dist/client/assets/{CategoricalChart-Nb2-Y2lc.js → CategoricalChart-CYT1jRTo.js} +1 -1
- package/dist/client/assets/{CheckCircle-CHf8-Blx.js → CheckCircle-B1cLRmIj.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-B8uBkzm6.js → ChevronSelectorVertical-bEeSv3mr.js} +1 -1
- package/dist/client/assets/{ChevronUp-DdJdulw6.js → ChevronUp-D_qU7VrJ.js} +1 -1
- package/dist/client/assets/{Copy01-Tr_gU1aK.js → Copy01-CT_cEqll.js} +1 -1
- package/dist/client/assets/{CreditCard01-Cv44glOw.js → CreditCard01-DFGzM4td.js} +1 -1
- package/dist/client/assets/{DotsVertical-9_2O7H2x.js → DotsVertical-CGu7Zbqo.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-CSAzz0sp.js → ErrorBarContext-BOQmu79L.js} +1 -1
- package/dist/client/assets/{Globe04-D3iPe8Pc.js → Globe04-DtoCZsmb.js} +1 -1
- package/dist/client/assets/{Image01-BfROTBI_.js → Image01-CyU1b2Nz.js} +1 -1
- package/dist/client/assets/{Key01-BeLvSel3.js → Key01-CV4MPPMx.js} +1 -1
- package/dist/client/assets/{Link01-Cej02QtC.js → Link01-BL0KHGWk.js} +1 -1
- package/dist/client/assets/{LinkBroken01-C4y5s5BD.js → LinkBroken01-CImL6HGl.js} +1 -1
- package/dist/client/assets/{Monitor01-CDLuLXD2.js → Monitor01-jDiltU3l.js} +1 -1
- package/dist/client/assets/{Play-WH2tJGci.js → Play-HeD-LWQ6.js} +1 -1
- package/dist/client/assets/{Plus-B7ghEA56.js → Plus-BzLmRH_e.js} +1 -1
- package/dist/client/assets/{SearchMd-DyqBdeBV.js → SearchMd-X-m-ot0f.js} +1 -1
- package/dist/client/assets/{Sector-CR2hSKiQ.js → Sector-Dk1WFIe-.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-BZ853zJ_.js → ShoppingBag01-C30WMfg1.js} +1 -1
- package/dist/client/assets/{Sun-uTZ6vkYv.js → Sun-D5cuTnns.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CaMjqXcB.js → SwitchHorizontal01-iT36Ixqz.js} +1 -1
- package/dist/client/assets/{Tool01-DznnxM5_.js → Tool01-BLdqmAM-.js} +1 -1
- package/dist/client/assets/{Trash01-_5jcVImt.js → Trash01-DkcAHDGj.js} +1 -1
- package/dist/client/assets/{Upload01-thivCY-D.js → Upload01-CJxfk4_B.js} +1 -1
- package/dist/client/assets/{User01-B9FM9Mf_.js → User01-CuJbE_Yd.js} +1 -1
- package/dist/client/assets/{UserSquare-CyTwJikM.js → UserSquare-BlSFjBrQ.js} +1 -1
- package/dist/client/assets/{Users01-BZbPKUiW.js → Users01-CgCEjxiR.js} +1 -1
- package/dist/client/assets/{XAxis-CD5mzHHS.js → XAxis-B6hTknR7.js} +1 -1
- package/dist/client/assets/{XClose-CfzTTVMn.js → XClose-BcQlXPoY.js} +1 -1
- package/dist/client/assets/{ZoomOut-C1q2p3OF.js → ZoomOut-C_NtAfgt.js} +1 -1
- package/dist/client/assets/{access-gate-Bxq1Hlbn.js → access-gate-0Qu33vtT.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BGTbgW-i.js → add-connection-dialog-CmVGiYmi.js} +1 -1
- package/dist/client/assets/{agent-analytics-CDewKQCM.js → agent-analytics-DbQCZ1PQ.js} +1 -1
- package/dist/client/assets/agent-app-BExNHlBs.js +1 -0
- package/dist/client/assets/{agent-assets-DfijL9Fx.js → agent-assets-B-t0qw5_.js} +1 -1
- package/dist/client/assets/{agent-automation-BvBJkvGT.js → agent-automation-AdWBGK9-.js} +1 -1
- package/dist/client/assets/{agent-automations-9wDIPFhf.js → agent-automations-x2lM3jDX.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-DXnppISv.js → agent-connect-sources-DygiFIri.js} +1 -1
- package/dist/client/assets/agent-deck-GAA8uH06.js +1 -0
- package/dist/client/assets/{agent-e2e-CP-dgiPD.js → agent-e2e-CDURPj47.js} +1 -1
- package/dist/client/assets/{agent-experiments-BsCiftRb.js → agent-experiments-BIa2lB5Q.js} +1 -1
- package/dist/client/assets/{agent-file-DQXP6Kie.js → agent-file-BKXQWZUy.js} +1 -1
- package/dist/client/assets/{agent-hosting-lv0YqG7F.js → agent-hosting-BYQZVYMZ.js} +1 -1
- package/dist/client/assets/{agent-icon-BzQJojFn.js → agent-icon-CsQzAnP1.js} +1 -1
- package/dist/client/assets/agent-library-CJXihsv5.js +1 -0
- package/dist/client/assets/agent-library-file-Cnv04MVV.js +1 -0
- package/dist/client/assets/{agent-monitor-DIWW-oja.js → agent-monitor-CCT32NKJ.js} +1 -1
- package/dist/client/assets/{agent-overview-zU7UtX4N.js → agent-overview-dfgPX_7d.js} +1 -1
- package/dist/client/assets/agent-settings-BTMD0j_l.js +1 -0
- package/dist/client/assets/{agent-site-editor-6IARQa9S.js → agent-site-editor-CG3fYjTa.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-Crxw0pRq.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-BoR7A3J6.js → agent-site-editor-content-5eCWHoNS.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-CHew1bNX.js → agent-site-editor-preview-uwuaRHqi.js} +3 -3
- package/dist/client/assets/agent-view-DVbx7Not.js +1 -0
- package/dist/client/assets/{agent-view-guard-3DhesBoI.js → agent-view-guard-e44iAytb.js} +1 -1
- package/dist/client/assets/{agents-list-dewnUR-7.js → agents-list-C2x26zj4.js} +1 -1
- package/dist/client/assets/ai-providers-DwXqL2iz.js +6 -0
- package/dist/client/assets/{alert-Cr5T7eOh.js → alert-DYD14Lxr.js} +1 -1
- package/dist/client/assets/{alert-dialog-CAM3tof4.js → alert-dialog-D2yDyccd.js} +1 -1
- package/dist/client/assets/{analytics-sections-DOa20DSv.js → analytics-sections-CYXgA9AC.js} +1 -1
- package/dist/client/assets/api-keys-B_VU2t2_.js +1 -0
- package/dist/client/assets/{api-keys-D9dIGDrT.js → api-keys-BtQl5Awe.js} +1 -1
- package/dist/client/assets/app-editor-fWZMbht-.js +1 -0
- package/dist/client/assets/{asset-utils-koOjLbnD.js → asset-utils-cuI-wo7N.js} +1 -1
- package/dist/client/assets/{auth-CZA10nCD.js → auth-CsAAW7Ar.js} +1 -1
- package/dist/client/assets/{auth-catchall-D9UTG4dS.js → auth-catchall-CDMks_Rc.js} +1 -1
- package/dist/client/assets/{auth-entry-_sycQOT3.js → auth-entry-Cwn8f6E3.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Ch6Z-FVb.js → auth-split-layout-DFsDNY_O.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CxfxW_rA.js → authenticate-and-persist-oauth-HfpfV8ZS.js} +1 -1
- package/dist/client/assets/{automation-list-row-B8-Gomxx.js → automation-list-row-Bgtl2dei.js} +1 -1
- package/dist/client/assets/{automation-runs-BnEMFtu-.js → automation-runs-CBT3E_fm.js} +1 -1
- package/dist/client/assets/{automations-CoFLQY3y.js → automations-BSD8vInf.js} +1 -1
- package/dist/client/assets/{autosend-DutXByr0.js → autosend-8ZqTuUx9.js} +1 -1
- package/dist/client/assets/{avatar-DeVcKUjn.js → avatar-Da-P84-z.js} +1 -1
- package/dist/client/assets/{badge-BRYJjM8m.js → badge-CJ5q8uJu.js} +1 -1
- package/dist/client/assets/{block-document-Mhky6a-Y.js → block-document-Drzpg_bb.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-DzJ8SMZ1.js → blocks-preview-workspace-context-CJnlWxc-.js} +1 -1
- package/dist/client/assets/{blog-schema-CAX9wXaL.js → blog-schema-WI1e8zgj.js} +1 -1
- package/dist/client/assets/{board-analytics-D110DxNA.js → board-analytics-Cla3ZHOc.js} +1 -1
- package/dist/client/assets/{buckets-C9rFvK2M.js → buckets-BO0Sw74J.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DR2Es921.js → build-improve-prompt-doc-BWoapP6S.js} +1 -1
- package/dist/client/assets/{calendar-CKSj2y-l.js → calendar-DKYy6uOJ.js} +1 -1
- package/dist/client/assets/{capability-load-error-C29lQbTt.js → capability-load-error-DGJphxbe.js} +1 -1
- package/dist/client/assets/{category-editor-zrsILNC7.js → category-editor-C6uMv0OA.js} +1 -1
- package/dist/client/assets/{chart-BGPsHSIz.js → chart-CUhY88so.js} +1 -1
- package/dist/client/assets/chat-context-y8u3K9Tq.js +39 -0
- package/dist/client/assets/{chat-draft-BrKCO6YT.js → chat-draft-RqSOe2VX.js} +1 -1
- package/dist/client/assets/{checkbox-CVc_t6AM.js → checkbox-cuQOxwwj.js} +1 -1
- package/dist/client/assets/{choose-editor-DXM40rwk.js → choose-editor-DVY0m-0N.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-DhUnD0f3.js → claim-phase-copy-kSJ81npa.js} +1 -1
- package/dist/client/assets/{cli-auth-success-B_LhHRr2.js → cli-auth-success-BNNiQ0ff.js} +1 -1
- package/dist/client/assets/{client-icons-CeVn-7HQ.js → client-icons-k3K_Wm7m.js} +1 -1
- package/dist/client/assets/{collapsible-RIZMF3og.js → collapsible-DEfXG6Ht.js} +1 -1
- package/dist/client/assets/{collection-detail-BNdoguU8.js → collection-detail-CUR7b1nw.js} +1 -1
- package/dist/client/assets/{collection-display-button-B05GAPuS.js → collection-display-button-Bii74DZw.js} +1 -1
- package/dist/client/assets/{collection-search-BhTdq2ic.js → collection-search-C-3HPALa.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-iLWfdfAw.js → collection-table-wrapper-BI9XAUwm.js} +1 -1
- package/dist/client/assets/{collection-tabs-hvD3R6sE.js → collection-tabs-BNpEfqyd.js} +1 -1
- package/dist/client/assets/{column-rules-BmNAI4d1.js → column-rules-B7pcw_Gh.js} +1 -1
- package/dist/client/assets/{combobox-BP3ADxyT.js → combobox-ylZ1_mxm.js} +1 -1
- package/dist/client/assets/{command-CfJ_yZL1.js → command-d2fvY4gQ.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-vz_F8aij.js → companion-mcps-section--NCFPgCd.js} +1 -1
- package/dist/client/assets/{config-qgEB96wk.js → config-BDYRd6Wk.js} +1 -1
- package/dist/client/assets/{connect-CmA_24Lv.js → connect-CKDAuMYC.js} +1 -1
- package/dist/client/assets/{connect-layout-Df-yaTtv.js → connect-layout-Ca1Vr3vz.js} +1 -1
- package/dist/client/assets/{connection-BjQqCa6n.js → connection-DGqqVA7M.js} +1 -1
- package/dist/client/assets/{connection-card-B5kZBtAI.js → connection-card-gIhz0wdg.js} +1 -1
- package/dist/client/assets/{connection-detail-llruLhvc.js → connection-detail-B9omyXwb.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BiaAn5T-.js → connection-form-helpers-A2MriNrX.js} +1 -1
- package/dist/client/assets/{connections-Rhsq_PHY.js → connections-Dh4JuodF.js} +1 -1
- package/dist/client/assets/{context-k9qseXLi.js → context-BnF04rBC.js} +1 -1
- package/dist/client/assets/{context-menu-B1iKTjcY.js → context-menu-BD-010iM.js} +1 -1
- package/dist/client/assets/{core.esm-BDr1jUfa.js → core.esm-BH3HyyF2.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-C3LOlpX9.js → create-organization-dialog-DjZlmVnS.js} +1 -1
- package/dist/client/assets/{daily-pulse-D0hL2Mgc.js → daily-pulse-BXDtpJQU.js} +1 -1
- package/dist/client/assets/{device-hint-JTf0kvkS.js → device-hint-CN2khPPs.js} +1 -1
- package/dist/client/assets/{discover-BYjmCOgU.js → discover-C-mYnXQB.js} +1 -1
- package/dist/client/assets/{domain-settings-8ti6F4Nt.js → domain-settings-BEwECWE8.js} +1 -1
- package/dist/client/assets/{drawer-NA8X67Cn.js → drawer-DybzZn1x.js} +1 -1
- package/dist/client/assets/{editor-D7dKbHsZ.js → editor-CBqQFFb9.js} +1 -1
- package/dist/client/assets/{empty-state-CXB5kfzH.js → empty-state-B4qRMioD.js} +1 -1
- package/dist/client/assets/{empty-state-DZ11Jnto.js → empty-state-b6tRqzU8.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BTRj6ggn.js → extract-connection-data-CIO9f-TD.js} +1 -1
- package/dist/client/assets/{feature-gate-DUnCy-Qc.js → feature-gate-ChDRcm7b.js} +1 -1
- package/dist/client/assets/{feature-paywall-BtZlJS8N.js → feature-paywall-BN5FphJ8.js} +1 -1
- package/dist/client/assets/{file-explorer-ahAqk6OL.js → file-explorer-DCd1-8-d.js} +1 -1
- package/dist/client/assets/{file-preview-DLq_TOpg.js → file-preview-CNp5DdHM.js} +1 -1
- package/dist/client/assets/{file-share-button-Boymlg-_.js → file-share-button-DOQq6Wrq.js} +1 -1
- package/dist/client/assets/{file-type-icon-CR_8nRKJ.js → file-type-icon-ClWl2ykw.js} +1 -1
- package/dist/client/assets/flat-project-DPnFbnmE.js +1 -0
- package/dist/client/assets/{folder-icon-BKmLVsTk.js → folder-icon-BO5Hlc-b.js} +1 -1
- package/dist/client/assets/{form-BBSMmS7M.js → form-Dm1N7Fdz.js} +1 -1
- package/dist/client/assets/{general-C_ztpdNf.js → general-CszMiv7n.js} +1 -1
- package/dist/client/assets/{home-B4BBGMuj.js → home-DT4jq_ad.js} +1 -1
- package/dist/client/assets/{icon-button-DkGaGjbK.js → icon-button-UzqZkmgc.js} +1 -1
- package/dist/client/assets/{index-CIkbTjtJ.js → index-B4rQ5Ej9.js} +1 -1
- package/dist/client/assets/{index-CWwSTXul.js → index-BA22z-aT.js} +1 -1
- package/dist/client/assets/{index-JcJUDiMG.js → index-BkaImz4P.js} +1 -1
- package/dist/client/assets/{index-BFNmnlkM.js → index-CeuDCj_w.js} +1 -1
- package/dist/client/assets/{index-Dv-VqjPz.js → index-ChAMt2d-.js} +1 -1
- package/dist/client/assets/{index-BEWyz4IL.js → index-ClN0hPjk.js} +1 -1
- package/dist/client/assets/{index-CvkEkbZF.js → index-D984WV3U.js} +39 -39
- package/dist/client/assets/{index-m_iMIYWi.js → index-DXSiv_GM.js} +3 -3
- package/dist/client/assets/{index-CtrX9wjc.js → index-DiGKvbHH.js} +1 -1
- package/dist/client/assets/{index-wv7M3764.js → index-Dq9ehfIf.js} +1 -1
- package/dist/client/assets/{index-DNz5LfZo.js → index-QP5dyfS7.js} +1 -1
- package/dist/client/assets/{index-Cz6k2mHL.js → index-ba_EB2Zw.js} +1 -1
- package/dist/client/assets/{index-redirect-uIRRxmIA.js → index-redirect-8HspsPDC.js} +1 -1
- package/dist/client/assets/{index-C6YI2JtB.js → index-z9lysifj.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-D-zgijef.js → infiniteQueryObserver-Bmwf-SCt.js} +1 -1
- package/dist/client/assets/{infra-billing-B_ALAMr6.js → infra-billing-DlP3vLBN.js} +1 -1
- package/dist/client/assets/{input-BqrqWGgY.js → input-CG0PFhS0.js} +1 -1
- package/dist/client/assets/input-C_t2NUbp.js +17 -0
- package/dist/client/assets/{integration-icon-Cie7dlB4.js → integration-icon-B4EO_1fi.js} +1 -1
- package/dist/client/assets/{jira-icon-B-lNy42i.js → jira-icon-DAy3a9S9.js} +1 -1
- package/dist/client/assets/{label-B7m6NrjR.js → label-BszVxI8j.js} +1 -1
- package/dist/client/assets/{layout-Gg6sfuOK.js → layout-BsHSUbxL.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-BSjkPeUW.js → legacy-agents-deep-DCBghYlF.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-DGr5DSt-.js → legacy-main-redirect-C_9Fyd8e.js} +1 -1
- package/dist/client/assets/library-C2ZRDo2P.js +1 -0
- package/dist/client/assets/{library-tab-Bx7zV5q2.js → library-tab-CZxlOQVR.js} +1 -1
- package/dist/client/assets/{login-BvuIcKwC.js → login-CoP-xpgM.js} +1 -1
- package/dist/client/assets/{markdown-Cyku6Bit.js → markdown-C8b2SRJt.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-_GpfDdeh.js → mcp-app-renderer-qrtR9Z1h.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DeKiTKLu.js → mcp-oauth--_7bIOac.js} +1 -1
- package/dist/client/assets/{mcp-oauth-oyIK_tB1.js → mcp-oauth-BIr9y8Ow.js} +1 -1
- package/dist/client/assets/{members-DNBLZQhM.js → members-DX1jVu8f.js} +1 -1
- package/dist/client/assets/{memory-BtqyTWr8.js → memory-DGqh7MMN.js} +1 -1
- package/dist/client/assets/{mini-report-page-DfIvIWa4.js → mini-report-page-DeT726Qz.js} +1 -1
- package/dist/client/assets/{mock-board-xsoKwtdR.js → mock-board-DiXeO9l9.js} +1 -1
- package/dist/client/assets/{monaco-editor-BcVwR88i.js → monaco-editor-BmtkWb9u.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DNdMRFxn.js → monitoring-stats-row-CROD4XJo.js} +1 -1
- package/dist/client/assets/{multi-select-CfULd_Rx.js → multi-select-COcK2vp_.js} +1 -1
- package/dist/client/assets/{mustache-o_TIeFdF.js → mustache-B3B0mlPh.js} +1 -1
- package/dist/client/assets/{new-project-dialog-CCTwabFu.js → new-project-dialog-CQomS8HX.js} +1 -1
- package/dist/client/assets/{oauth-callback-DP4tF534.js → oauth-callback-BAjl2hrI.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DnRBh9uO.js → oauth-callback-ai-provider-Dfitdf7t.js} +1 -1
- package/dist/client/assets/{onboarding-yow8oG4G.js → onboarding-DuW4ryZs.js} +1 -1
- package/dist/client/assets/{openai-conversation-d_Xs65HZ.js → openai-conversation-klLH_0HC.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-9OadUgjT.js → optimistic-project-sidebar-views-CaTvAXwY.js} +1 -1
- package/dist/client/assets/{organization-choice-CDDi_uTO.js → organization-choice-DtdFVbBZ.js} +1 -1
- package/dist/client/assets/{orgs-CUmDeH_J.js → orgs-BBq2qsW_.js} +1 -1
- package/dist/client/assets/{page-seo-form--bS1Q_MY.js → page-seo-form-BJN0O5_N.js} +1 -1
- package/dist/client/assets/{pair-Bjrecdzi.js → pair-D3dg1naQ.js} +1 -1
- package/dist/client/assets/{plan-ladder-B2h7Dujg.js → plan-ladder-DUQWM1mB.js} +1 -1
- package/dist/client/assets/{popover-KZcyVDI5.js → popover-9tPVAoH5.js} +1 -1
- package/dist/client/assets/{post-calendar-Fmw8glqd.js → post-calendar-D9oVrQhS.js} +1 -1
- package/dist/client/assets/{post-editor-Dsj5Ibag.js → post-editor-C2tsxtV4.js} +1 -1
- package/dist/client/assets/{preview-content-Dh8Rmbe6.js → preview-content-BIpDQXJu.js} +1 -1
- package/dist/client/assets/{preview-dialog-Bml9zm4Y.js → preview-dialog-CH8GibCu.js} +1 -1
- package/dist/client/assets/{preview-panel-B_1L-tuG.js → preview-panel-CCFjojUE.js} +1 -1
- package/dist/client/assets/{product-picker-dialog-DoSgNDYX.js → product-picker-dialog-BoGvkEwe.js} +1 -1
- package/dist/client/assets/{profile-DjPOIV3n.js → profile-BKpvrH_P.js} +1 -1
- package/dist/client/assets/{project-app-view-DhXwsdyH.js → project-app-view-0HH2t56F.js} +1 -1
- package/dist/client/assets/{project-feed-Cg0FAsjP.js → project-feed-d2kKPzOq.js} +1 -1
- package/dist/client/assets/{project-icon-Da9vkmla.js → project-icon-DeUPWsC_.js} +1 -1
- package/dist/client/assets/project-reports-7r3buXCO.js +1 -0
- package/dist/client/assets/project-tasks-Dp-gjCz7.js +1 -0
- package/dist/client/assets/{projects--BD3Pi5O.js → projects-dI6btB5J.js} +1 -1
- package/dist/client/assets/{projects-empty-state-mNzYEnJq.js → projects-empty-state-DAa4wzAP.js} +1 -1
- package/dist/client/assets/{prompts-867OeL4C.js → prompts-D3LKfm14.js} +1 -1
- package/dist/client/assets/record-editor-BDN9ztWf.js +1 -0
- package/dist/client/assets/redirect-editor-DBLjC8Z9.js +1 -0
- package/dist/client/assets/{reports-CDcs9KF3.js → reports-B5aLNQGc.js} +1 -1
- package/dist/client/assets/reports-CvKnRIKX.js +1 -0
- package/dist/client/assets/{reports-onboarding-C1hpBv4P.js → reports-onboarding-D7Nsv0TX.js} +1 -1
- package/dist/client/assets/{reports-tab-ChkUNvxL.js → reports-tab-bgB5WodW.js} +2 -2
- package/dist/client/assets/{repositories-cVNrUSk6.js → repositories-Du_yi0rf.js} +1 -1
- package/dist/client/assets/{repository-binding-Diab2gJI.js → repository-binding-CrIQbyJh.js} +1 -1
- package/dist/client/assets/{repository-import-picker-CAPqT49B.js → repository-import-picker-n3EYoF9U.js} +1 -1
- package/dist/client/assets/{repository-picker-wpyEK2Xc.js → repository-picker-CjDs0ici.js} +1 -1
- package/dist/client/assets/{require-capability-BVRaCsRX.js → require-capability-BDLtPaM5.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BlMmzcBE.js → required-auth-layout-CTKRCLps.js} +1 -1
- package/dist/client/assets/{reset-password-DEXRYELW.js → reset-password-XiFYESJ5.js} +1 -1
- package/dist/client/assets/{resizable-B1DqKMtx.js → resizable-C3INc4c7.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-B4Xubt6P.js → resolve-tab-icon-DuWtsFCw.js} +1 -1
- package/dist/client/assets/{review-settings-x4SlctNv.js → review-settings-BCvIwiTZ.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-C0PrMBov.js → rich-text-link-control-B2KML_yp.js} +1 -1
- package/dist/client/assets/roles-B5KIhtIL.js +1 -0
- package/dist/client/assets/{route-DZ6_uTYn.js → route-BwivpFZQ.js} +1 -1
- package/dist/client/assets/route-Fylk_TVt.js +1 -0
- package/dist/client/assets/route-nHlGvnBX.js +1 -0
- package/dist/client/assets/{runnable-block-editor-BbKz7DQH.js → runnable-block-editor-v2diysES.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-DOC3PBsO.js → sandbox-lifecycle-context-CtphXAh2.js} +1 -1
- package/dist/client/assets/schema-BMqZTcjW.js +1 -0
- package/dist/client/assets/{scroll-area-ClRSjtLV.js → scroll-area-B9YHNZjL.js} +1 -1
- package/dist/client/assets/{search-input-9d3onxt-.js → search-input-BJ-xb_6w.js} +1 -1
- package/dist/client/assets/{search-toggle-BFbMmpZT.js → search-toggle-DviE2KK7.js} +1 -1
- package/dist/client/assets/{secret-picker-4GV6jMAI.js → secret-picker-MDfAhcKZ.js} +1 -1
- package/dist/client/assets/{secrets-DWQ4G6Sx.js → secrets-BWXZ9ADR.js} +1 -1
- package/dist/client/assets/{sections-editor-DLdVQU9n.js → sections-editor-DRPdyBr7.js} +1 -1
- package/dist/client/assets/{select-BYlHrgDe.js → select-Cmhyur65.js} +1 -1
- package/dist/client/assets/{select-model-1_S8Jip8.js → select-model-DlhjRyXh.js} +1 -1
- package/dist/client/assets/{seo-editor-DcLNXiwq.js → seo-editor-Cslo5GyR.js} +1 -1
- package/dist/client/assets/{separator-DtFDelDc.js → separator-XBrskDk1.js} +1 -1
- package/dist/client/assets/{settings-tab-D92XwErA.js → settings-tab-Bhjq-v1u.js} +1 -1
- package/dist/client/assets/{sheet-Dt9lpT7b.js → sheet-bMLuzpcl.js} +1 -1
- package/dist/client/assets/{shell-layout-Bv5Sek6Y.js → shell-layout-CX2kb4As.js} +1 -1
- package/dist/client/assets/{skills-6-fiePmJ.js → skills-smEsZOyf.js} +1 -1
- package/dist/client/assets/{slider-CKduu4Fn.js → slider-xDThp8gG.js} +1 -1
- package/dist/client/assets/{sortable.esm-DPSFDajj.js → sortable.esm-C4yl7HRk.js} +1 -1
- package/dist/client/assets/{sso-DkPhSrvw.js → sso-D5XcZRGg.js} +1 -1
- package/dist/client/assets/{suggestion-DOpLmNQe.js → suggestion-B9eDgKDC.js} +1 -1
- package/dist/client/assets/{switch-AEq1Ywu_.js → switch-D6SJRikA.js} +1 -1
- package/dist/client/assets/{symbol-C4xjMjdj.js → symbol-8pL_EbyE.js} +1 -1
- package/dist/client/assets/{synced-repos-DoTaXu1d.js → synced-repos-CvOi5sDr.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-D0kyNG52.js → tab-icon-glyph-B5Fq5S50.js} +1 -1
- package/dist/client/assets/{table-xlf7vkj_.js → table-BVuWDAYC.js} +1 -1
- package/dist/client/assets/{tabs-D7DC2cRI.js → tabs-CJiVz1UY.js} +1 -1
- package/dist/client/assets/{task-board-BdDYkWlj.js → task-board-BypYXBtD.js} +1 -1
- package/dist/client/assets/{task-route-CUv19cmC.js → task-route-CxLDxVTy.js} +1 -1
- package/dist/client/assets/{task-status-DBiu_sll.js → task-status-DR_ZGtmT.js} +1 -1
- package/dist/client/assets/taskboard-analytics-B5tiovFi.js +1 -0
- package/dist/client/assets/tasks-C5eWHl6J.js +1 -0
- package/dist/client/assets/{tasks-CqusizRk.js → tasks-pRlF9aKa.js} +1 -1
- package/dist/client/assets/{textarea-I3De7vqg.js → textarea-C3QvYVs6.js} +1 -1
- package/dist/client/assets/{thread-analytics-CRKk825k.js → thread-analytics-CVYD56Lv.js} +1 -1
- package/dist/client/assets/{thread-button-DXETp5tJ.js → thread-button-Dnwv5gXz.js} +1 -1
- package/dist/client/assets/{thread-intent-C-TbGTua.js → thread-intent-BouO_OhM.js} +1 -1
- package/dist/client/assets/{thread-route-BhnTkbv5.js → thread-route-CzzxiajL.js} +1 -1
- package/dist/client/assets/{thread-route-D_yIM5gK.js → thread-route-Dp3ppEkH.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BY8IWwzS.js → thread-sheet-body-Z8jKG5ht.js} +1 -1
- package/dist/client/assets/{time-range-picker-L6TIyBjU.js → time-range-picker-DE7fkhif.js} +1 -1
- package/dist/client/assets/{toggle-group-Br_OBwpv.js → toggle-group-BxPPN08u.js} +1 -1
- package/dist/client/assets/{tool-namespace-KxcOJjNS.js → tool-namespace-C5Z8tVC2.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CzlG5jfK.js → toolbar-icon-button-539CZpjb.js} +1 -1
- package/dist/client/assets/{tooltip-CQtbKEbv.js → tooltip-CfH7_UR9.js} +1 -1
- package/dist/client/assets/{tooltipContext-CRvwH17A.js → tooltipContext-Dt4926A5.js} +1 -1
- package/dist/client/assets/{track-DSZ6JNAX.js → track-D8kXLyAV.js} +1 -1
- package/dist/client/assets/{types-C1Mw_99A.js → types-PjheW3sm.js} +1 -1
- package/dist/client/assets/{url-slug-CTpJRedE.js → url-slug-D7hdnLPq.js} +1 -1
- package/dist/client/assets/{usage-stats-CUfUVubb.js → usage-stats-BcmMK-YO.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CjzrdRNJ.js → use-ai-providers-CeHzBmwD.js} +1 -1
- package/dist/client/assets/{use-automations-rSR1F0M4.js → use-automations-DLk4Zq7Y.js} +1 -1
- package/dist/client/assets/{use-autosave-DMLPE4t_.js → use-autosave-5IDmaWA6.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-C79Hg2yc.js → use-chat-layout-state-C4y1ngrz.js} +1 -1
- package/dist/client/assets/{use-chat-navigation-BRFRCeuv.js → use-chat-navigation-pwxRnoh5.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BXc6ohp1.js → use-clock-tick-DcGl_y28.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DSYtVNc7.js → use-connect-companion-DmQTaaXP.js} +1 -1
- package/dist/client/assets/{use-connection-BHRfoOud.js → use-connection-B96BwbcD.js} +1 -1
- package/dist/client/assets/{use-copy-Csln4Pda.js → use-copy-COXbZ1Gm.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CUR-7WWu.js → use-create-virtual-mcp-BuymUE2O.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-DLPMhDmo.js → use-date-fns-locale-D2o3Y11s.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DdZOXKrA.js → use-debounced-autosave-Yq56G4iL.js} +1 -1
- package/dist/client/assets/{use-debounced-value-C_VfXq2U.js → use-debounced-value-BZK5uiHm.js} +1 -1
- package/dist/client/assets/{use-deco-credits-PK7G7t4U.js → use-deco-credits-COvQvXnV.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-3d9-CwOW.js → use-decopilot-events-BDPMNEXz.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CDExFOVk.js → use-delete-connection-DT6vWhGX.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CvxHuxOS.js → use-deployment-admin-CoVHfZYT.js} +1 -1
- package/dist/client/assets/{use-ensure-project-folder-CiixVwYS.js → use-ensure-project-folder-peTgVhMP.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-nXHVGGIA.js → use-fast-preview-draft-url-BDHxUOYh.js} +1 -1
- package/dist/client/assets/{use-file-configs-BUqTgf7p.js → use-file-configs-DoW1VYTz.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CGgZOckb.js → use-infinite-scroll-1WuTfkvL.js} +1 -1
- package/dist/client/assets/{use-join-requests-BnD3GHpg.js → use-join-requests-uEHIq-wW.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-D2yVxw9s.js → use-main-panel-tabs-eZgXms3O.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-D-wQ9FWj.js → use-mcp-auth-status-GSONXJ6Y.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CBoRmtFo.js → use-mcp-client-D8-rDWEf.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-C3H87HP4.js → use-mcp-prompts-9xOCFCVM.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BfdbHPtH.js → use-mcp-tools-BYNW1IvH.js} +1 -1
- package/dist/client/assets/{use-members-DCcQy8NS.js → use-members-DuiAoVt0.js} +1 -1
- package/dist/client/assets/{use-mobile-DHDQrS92.js → use-mobile-Cz-N6vVG.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CBJVz0YU.js → use-navigate-to-agent-CWPsHr0w.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-B5DYqQrS.js +1 -0
- package/dist/client/assets/{use-open-billing-url-DYalJRBM.js → use-open-billing-url-CHALVI7F.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CQhEfpFE.js → use-org-auth-client-DQ6vSNUo.js} +1 -1
- package/dist/client/assets/{use-org-fs-CR48g8_P.js → use-org-fs-UdNnQzcG.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-C4CqaNPe.js → use-org-repo-syncs-CE9Yx0AE.js} +1 -1
- package/dist/client/assets/{use-org-sso-DqlYZMd5.js → use-org-sso-BRZ2xqKg.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Co0Vqzi3.js → use-organization-roles-5fHLGM-_.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BoQ-3bUn.js → use-organization-settings-BEUCQxuY.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-5IaTMf0W.js → use-panel-navigate-B348HV-V.js} +1 -1
- package/dist/client/assets/{use-project-scope-DhGkOd7x.js → use-project-scope-CJSvss5q.js} +1 -1
- package/dist/client/assets/{use-releases-B2i3mkXU.js → use-releases-DRDEblSZ.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-Z-QISjJo.js → use-reports-diagnostic-BQoNp5Lt.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-4HFbLlVd.js → use-sandbox-events-afI4fSp9.js} +1 -1
- package/dist/client/assets/{use-secrets-ObT7hB_J.js → use-secrets-6NdpjMzr.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CKThWLiS.js → use-section-preview-base-Du6Z-MWu.js} +1 -1
- package/dist/client/assets/{use-tags-BBeLFk4l.js → use-tags-Dkeb0fZQ.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BnXBdPT0.js → use-task-board-analytics-BsZ5fOsz.js} +1 -1
- package/dist/client/assets/{use-task-board-events-Dmw0mTzd.js → use-task-board-events-BZPWVwkQ.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-C8Xn9Vf_.js → use-task-board-item-prs-6pzJEXZH.js} +1 -1
- package/dist/client/assets/{use-task-board-items-xt5k2e3E.js → use-task-board-items-DDExwWH5.js} +1 -1
- package/dist/client/assets/{use-task-metadata-BtIFipqq.js → use-task-metadata-QX8Xm3F2.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-D9xOHQFN.js → use-thread-analytics-4YJ0wSzW.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-v6L6hLPo.js → use-thread-outputs-BaagK6yF.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BgN51nwo.js +1 -0
- package/dist/client/assets/{useQueries-D7sPNAbk.js → useQueries-BeM3koNG.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DnCmqaG2.js +1 -0
- package/dist/client/assets/{users-CohA04WM.js → users-DA2VVqSS.js} +1 -1
- package/dist/client/assets/{utils-CZAlkiGL.js → utils-DGIwcQET.js} +1 -1
- package/dist/client/assets/{variant-calendar-YlhockIc.js → variant-calendar-B2z-zkHQ.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-Ch08PbYs.js → variant-matcher-override-WuIO8MOW.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-6GOtrYS3.js → view-mode-toggle-DA847UFd.js} +1 -1
- package/dist/client/assets/{virtual-mcp-BvdMl-5h.js → virtual-mcp-ySkvJvwZ.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-CuB8RiNq.js → watch-sse-pool-jwr9yBFo.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/migrate.js +240 -240
- package/dist/server/server.js +623 -622
- package/package.json +1 -1
- package/dist/client/assets/agent-app-BP_zJSbn.js +0 -1
- package/dist/client/assets/agent-deck-RzemuGl7.js +0 -1
- package/dist/client/assets/agent-library-CC0bjZj1.js +0 -1
- package/dist/client/assets/agent-library-file-BSlUtfTI.js +0 -1
- package/dist/client/assets/agent-settings-6NCbPPF8.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CKJCcxe8.js +0 -2
- package/dist/client/assets/agent-view-B3KFsBPm.js +0 -1
- package/dist/client/assets/ai-providers-Bk7GpeLu.js +0 -6
- package/dist/client/assets/api-keys-CO4qUFEE.js +0 -1
- package/dist/client/assets/app-editor-C1ZLULDh.js +0 -1
- package/dist/client/assets/chat-context-B7ixwukH.js +0 -39
- package/dist/client/assets/flat-project-B34hikno.js +0 -1
- package/dist/client/assets/input-ChjC7XxY.js +0 -17
- package/dist/client/assets/library-BQTdBCeN.js +0 -1
- package/dist/client/assets/project-reports-D7AvO1-d.js +0 -1
- package/dist/client/assets/project-tasks-Bkis008g.js +0 -1
- package/dist/client/assets/record-editor-ujycT1Q2.js +0 -1
- package/dist/client/assets/redirect-editor-COyH32KW.js +0 -1
- package/dist/client/assets/reports-BdmJCm1H.js +0 -1
- package/dist/client/assets/roles-C7UEXuzR.js +0 -1
- package/dist/client/assets/route-BZiixBAG.js +0 -1
- package/dist/client/assets/route-C1lmUe_X.js +0 -1
- package/dist/client/assets/schema-3_3MP7ZZ.js +0 -1
- package/dist/client/assets/taskboard-analytics-Bea9cC2r.js +0 -1
- package/dist/client/assets/tasks-BX3JKxDq.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-BtqPnhyC.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DVc0gFuD.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-kmxM7DtM.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as tn,b as nn,r as E,l as oe,j as s,b1 as Ta,B as Mt,U as zt,au as Na,X as Aa,V as Ma,o as Ca,h as Pa,t as V,K as Da}from"./index-CvkEkbZF.js";import{u as Ka}from"./chat-context-B7ixwukH.js";import{u as En}from"./use-new-blocks-editor-BtqPnhyC.js";import{J as Ba,K as Fa,N as Ia,O as La,Q as Oa,T as za,U as $a,V as Ha,W as Ga,X as Js,Y as qa,Z as Wa,_ as Ct,G as pt,$ as lt,H as yn,E as bn,e as Ua,f as Ja,j as Ya,u as Qa,a0 as Ys,o as Xa,a1 as Za,q as er,n as tr,a2 as nr,p as gn,a3 as sr,a4 as or,C as Qs,a5 as ar,a6 as rr,a7 as vn,a8 as Xs,a9 as Zs,aa as eo,ab as Hn,ac as ir,ad as lr,F as cr,ae as to,af as ur,ag as no,ah as so,M as dr,ai as oo,d as mr,aj as Xt,ak as fr,al as pr,am as Gn,an as hr,ao as gr,ap as vr}from"./runnable-block-editor-BbKz7DQH.js";import{c as Sr}from"./repository-binding-Diab2gJI.js";import{n as yr,t as br}from"./ChevronUp-DdJdulw6.js";import{a6 as So,d as _n,ak as xr,C as _r,$ as ao,K as ro}from"./agent-icon-BzQJojFn.js";import{S as $t}from"./scroll-area-ClRSjtLV.js";import{b as ht,T as gt,a as vt}from"./tooltip-CQtbKEbv.js";import{m as Er,u as jr,P as kr}from"./mustache-o_TIeFdF.js";import{as as yo,c as es,at as bo,G as wr,au as it,av as Un,aw as xo,ai as At,a6 as Jn,ax as Yn,aj as jt,a7 as Ht,j as Rr,l as Vr,g as Tr,r as Sn,am as Nr,ah as Zt,a8 as qn,ag as Et,af as en,ay as Ar,K as Mr,az as Cr,ak as io,a0 as lo,aA as Pr,aB as Nt,aC as Dr,aD as Kr,aE as Br,aF as co,aG as Fr,aH as Ir,aI as Lr,ae as Or,aJ as zr,aK as $r,aL as Hr,V as Gr,aM as qr,ad as Wr,aN as Ur}from"./claim-phase-copy-DhUnD0f3.js";import{a as Jr}from"./Copy01-Tr_gU1aK.js";import{a as Qn,e as _o}from"./UserSquare-CyTwJikM.js";import{i as uo}from"./Tool01-DznnxM5_.js";import{s as mo}from"./Image01-BfROTBI_.js";import{s as Yr}from"./Plus-B7ghEA56.js";import{s as Qr}from"./Trash01-_5jcVImt.js";import{i as Xn}from"./ZoomOut-C1q2p3OF.js";import{u as Xr,a as fo,K as Zr,P as ei,b as ti,C as ni,D as si,c as oi}from"./core.esm-BDr1jUfa.js";import{u as ai,s as ri,a as xn,S as ii,v as li}from"./sortable.esm-DPSFDajj.js";import{a as ci,P as po,b as ui}from"./page-seo-form--bS1Q_MY.js";import{u as di,A as mi}from"./use-section-preview-base-CKThWLiS.js";import{b as ho,a as fi}from"./variant-matcher-override-Ch08PbYs.js";import"./use-panel-navigate-5IaTMf0W.js";import"./thread-route-D_yIM5gK.js";import"./use-project-scope-DhGkOd7x.js";import"./autosend-DutXByr0.js";import"./thread-intent-C-TbGTua.js";import"./use-mcp-client-CBoRmtFo.js";import"./auth-CZA10nCD.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-CuB8RiNq.js";import"./task-board-BdDYkWlj.js";import"./schema-3_3MP7ZZ.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-3d9-CwOW.js";import"./use-ai-providers-CjzrdRNJ.js";import"./use-chat-navigation-BRFRCeuv.js";import"./location-BjlyegC2.js";import"./use-organization-settings-BoQ-3bUn.js";import"./input-ChjC7XxY.js";import"./usage-stats-CUfUVubb.js";import"./tool-namespace-KxcOJjNS.js";import"./form-BBSMmS7M.js";import"./label-B7m6NrjR.js";import"./utils-CVEq3hMx.js";import"./markdown-Cyku6Bit.js";import"./use-copy-Csln4Pda.js";import"./use-mobile-DHDQrS92.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./XClose-CfzTTVMn.js";import"./icon-button-DkGaGjbK.js";import"./file-type-icon-CR_8nRKJ.js";import"./shell-layout-Bv5Sek6Y.js";import"./avatar-DeVcKUjn.js";import"./User01-B9FM9Mf_.js";import"./Building02-BhbGM34V.js";import"./CheckCircle-CHf8-Blx.js";import"./Monitor01-CDLuLXD2.js";import"./use-clock-tick-BXc6ohp1.js";import"./command-CfJ_yZL1.js";import"./index-Cz6k2mHL.js";import"./SearchMd-DyqBdeBV.js";import"./integration-icon-Cie7dlB4.js";import"./LinkBroken01-C4y5s5BD.js";import"./project-icon-Da9vkmla.js";import"./new-project-dialog-CCTwabFu.js";import"./ArrowLeft-DWXC5SxX.js";import"./repository-import-picker-CAPqT49B.js";import"./use-navigate-to-agent-CBJVz0YU.js";import"./repository-picker-wpyEK2Xc.js";import"./useInfiniteQuery-DVc0gFuD.js";import"./infiniteQueryObserver-D-zgijef.js";import"./collection-search-BhTdq2ic.js";import"./ShoppingBag01-BZ853zJ_.js";import"./use-debounced-value-C_VfXq2U.js";import"./required-auth-layout-BlMmzcBE.js";import"./use-org-sso-DqlYZMd5.js";import"./chat-draft-BrKCO6YT.js";import"./ArrowUp-Dg7Kez2q.js";import"./Upload01-thivCY-D.js";import"./AlertCircle-CKip96zJ.js";import"./select-BYlHrgDe.js";import"./index-BdQq_4o_.js";import"./index-Dv-VqjPz.js";import"./tabs-D7DC2cRI.js";import"./use-deco-credits-PK7G7t4U.js";import"./toggle-group-Br_OBwpv.js";import"./use-open-billing-url-DYalJRBM.js";import"./index-BFNmnlkM.js";import"./checkbox-CVc_t6AM.js";import"./ChevronSelectorVertical-B8uBkzm6.js";import"./Key01-BeLvSel3.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-KZcyVDI5.js";import"./drawer-NA8X67Cn.js";import"./input-BqrqWGgY.js";import"./suggestion-DOpLmNQe.js";import"./use-chat-layout-state-C79Hg2yc.js";import"./use-file-configs-BUqTgf7p.js";import"./site-slug-DebpOoQq.js";import"./use-mcp-prompts-C3H87HP4.js";import"./use-org-fs-CR48g8_P.js";import"./Link01-Cej02QtC.js";import"./question-004-sINsf4GQ.js";import"./use-members-DCcQy8NS.js";import"./use-org-auth-client-CQhEfpFE.js";import"./feature-paywall-BtZlJS8N.js";import"./plan-ladder-B2h7Dujg.js";import"./add-connection-dialog-BGTbgW-i.js";import"./extract-connection-data-BTRj6ggn.js";import"./metadata-D72DunRR.js";import"./connection-BjQqCa6n.js";import"./url-slug-CTpJRedE.js";import"./connection-card-B5kZBtAI.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-I3De7vqg.js";import"./use-connection-BHRfoOud.js";import"./connection-form-helpers-BiaAn5T-.js";import"./authenticate-and-persist-oauth-CxfxW_rA.js";import"./mcp-oauth-DeKiTKLu.js";import"./mcp-oauth-oyIK_tB1.js";import"./collection-tabs-hvD3R6sE.js";import"./badge-BRYJjM8m.js";import"./use-infinite-scroll-CGgZOckb.js";import"./useSuspenseInfiniteQuery-kmxM7DtM.js";import"./use-task-board-events-Dmw0mTzd.js";import"./Play-WH2tJGci.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-Bjrecdzi.js";import"./collapsible-RIZMF3og.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-_GpfDdeh.js";import"./types-C1Mw_99A.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./sheet-Dt9lpT7b.js";import"./use-thread-outputs-v6L6hLPo.js";import"./utils-CZAlkiGL.js";import"./monaco-editor-BcVwR88i.js";import"./editor-D7dKbHsZ.js";import"./calendar-CKSj2y-l.js";import"./SwitchHorizontal01-CaMjqXcB.js";import"./rich-text-link-control-C0PrMBov.js";import"./switch-AEq1Ywu_.js";import"./view-mode-toggle-6GOtrYS3.js";import"./combobox-BP3ADxyT.js";import"./alert-dialog-CAM3tof4.js";import"./sandbox-url-D3mC8qhT.js";import"./DotsVertical-9_2O7H2x.js";import"./search-input-9d3onxt-.js";import"./asset-utils-koOjLbnD.js";import"./sandbox-git-api-C7JbVL7R.js";import"./CreditCard01-Cv44glOw.js";import"./Globe04-D3iPe8Pc.js";import"./Sun-uTZ6vkYv.js";import"./Users01-BZbPKUiW.js";import"./section-preview-url-7zfngvgW.js";function pi(d){return d.schema?.definitions??d.schema?.$defs??{}}function Eo(d,e){const c=pi(e),h=c[btoa(d)];if(!h)return[];const g=[h];if(Array.isArray(h.allOf)){const b=h.allOf.find(j=>typeof j.$ref=="string")?.$ref;if(typeof b=="string"){const j=c[b.replace("#/definitions/","")];j&&g.push(j)}}return g}function hi(d,e){for(const c of Eo(d,e)){const h=typeof c.image=="string"?c.image:void 0;if(h?.includes("{{{"))return h}}function gi(d,e){if(!e)return;const c=yo(d);if(!c)return;const h=hi(c.resolveType,e);if(!h)return;const g=Ba(h,c.data);if(g)return Fa(g)}const vi={escape:Ia};function Si(d,e){for(const c of Eo(d,e)){const h=typeof c.title=="string"?c.title:void 0;if(h?.includes("{{"))return h}}function yi(d,e){if(!e)return;const c=yo(d);if(c)try{const h=Si(c.resolveType,e);return h&&Er.render(h,c.data,{},vi).trim()||void 0}catch{return}}function bi(d){const e=tn.c(13),{icon:c,label:h,className:g}=d;let b;e[0]!==g?(b=oe("size-3.5",g),e[0]=g,e[1]=b):b=e[1];let j;e[2]!==c||e[3]!==b?(j=s.jsx(c,{className:b}),e[2]=c,e[3]=b,e[4]=j):j=e[4];let S;e[5]!==h||e[6]!==j?(S=s.jsx(gt,{asChild:!0,children:s.jsx("span",{role:"img","aria-label":h,className:"shrink-0 cursor-help",children:j})}),e[5]=h,e[6]=j,e[7]=S):S=e[7];let N;e[8]!==h?(N=s.jsx(vt,{className:"max-w-56",children:h}),e[8]=h,e[9]=N):N=e[9];let _;return e[10]!==S||e[11]!==N?(_=s.jsxs(ht,{children:[S,N]}),e[10]=S,e[11]=N,e[12]=_):_=e[12],_}const xi="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 go(d){return Array.from({length:d},(e,c)=>({id:crypto.randomUUID(),index:c}))}function jo(d){return d.map((e,c)=>({...e,index:c}))}function _i(d,e){if(e===d.length)return d;if(e<d.length)return jo(d.slice(0,e));const c=Array.from({length:e-d.length},(h,g)=>({id:crypto.randomUUID(),index:d.length+g}));return[...d,...c]}function ko(d){const e=tn.c(44),{section:c,raw:h,meta:g,decofile:b}=d,j=nn(),S=En(),N=c.isSavedBlock===!0,_=c.isMultivariate===!0;let Q;e[0]!==g||e[1]!==h?(Q=h&&g?gi(h,g):void 0,e[0]=g,e[1]=h,e[2]=Q):Q=e[2];const me=Q;let $e;e[3]!==g||e[4]!==_||e[5]!==h||e[6]!==N?($e=h&&g&&!N&&!_?yi(h,g):void 0,e[3]=g,e[4]=_,e[5]=h,e[6]=N,e[7]=$e):$e=e[7];const He=$e;let Pe;e[8]!==b||e[9]!==g||e[10]!==h||e[11]!==c?(Pe=Ga(h,c,b,g),e[8]=b,e[9]=g,e[10]=h,e[11]=c,e[12]=Pe):Pe=e[12];const ae=Pe;let r;e[13]!==_||e[14]!==h?.__resolveType?(r=!_&&es(h?.__resolveType??""),e[13]=_,e[14]=h?.__resolveType,e[15]=r):r=e[15];const T=r,Se=N?_n:_?So:_o;let H;e[16]!==_||e[17]!==N?(H=N?{color:wr}:_?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=_,e[17]=N,e[18]=H):H=e[18];const m=H;let z;e[19]!==Se||e[20]!==S?(z=S?s.jsxs("span",{className:"relative size-4 shrink-0",children:[s.jsx(Se,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),s.jsx(Wa,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):s.jsx(xr,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=Se,e[20]=S,e[21]=z):z=e[21];let u;e[22]!==me?(u=me&&s.jsx("img",{src:me,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=me,e[23]=u):u=e[23];let U;e[24]!==S||e[25]!==m?(U=!S&&s.jsx(Qn,{className:"h-4 w-4 shrink-0",style:m}),e[24]=S,e[25]=m,e[26]=U):U=e[26];const q=S?"shrink":"flex-1",Re=c.isHidden&&"line-through opacity-50";let De;e[27]!==Re||e[28]!==q?(De=oe("min-w-0 truncate text-sm font-medium",q,Re),e[27]=Re,e[28]=q,e[29]=De):De=e[29];const Ze=He??c.label;let je;e[30]!==De||e[31]!==Ze?(je=s.jsx("span",{className:De,children:Ze}),e[30]=De,e[31]=Ze,e[32]=je):je=e[32];let f;e[33]!==T||e[34]!==S||e[35]!==ae||e[36]!==j?(f=S?s.jsxs(s.Fragment,{children:[T&&s.jsx(bi,{icon:Xn,label:j("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),ae&&s.jsx(Js,{}),s.jsx("span",{className:"min-w-0 flex-1"})]}):ae&&s.jsx(Js,{className:"absolute -right-0.5 -top-0.5"}),e[33]=T,e[34]=S,e[35]=ae,e[36]=j,e[37]=f):f=e[37];let M;return e[38]!==je||e[39]!==f||e[40]!==z||e[41]!==u||e[42]!==U?(M=s.jsxs(s.Fragment,{children:[z,u,U,je,f]}),e[38]=je,e[39]=f,e[40]=z,e[41]=u,e[42]=U,e[43]=M):M=e[43],M}const Ei="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",ji="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 wo(d,e,c){if(c)return qa({selected:e});const h=d.isSavedBlock===!0,g=d.isMultivariate===!0;return oe("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":h?Ei:g?ji:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Wn(d,e){return oe("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":d?"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 ki(d){const e=tn.c(90),{section:c,raw:h,meta:g,decofile:b,sortableId:j,selected:S,onSelect:N,onDelete:_,onDuplicate:Q,onMakeReusable:me,onToggleHidden:$e,onToggleLazy:He,onAddVariant:Pe,onDetach:ae}=d,r=nn(),T=En(),Se=h?es(h.__resolveType??""):!1,H=c.isHidden===!0,m=Se||H;let z;e[0]!==c?(z=bo(c),e[0]=c,e[1]=z):z=e[1];const u=z;let U;e[2]!==j?(U={id:j,animateLayoutChanges:Vi},e[2]=j,e[3]=U):U=e[3];const{attributes:q,listeners:Re,setNodeRef:De,transform:Ze,isDragging:je}=ai(U);let f;e[4]!==Ze?(f=ni.Transform.toString(Ze?{...Ze,x:0}:null),e[4]=Ze,e[5]=f):f=e[5];const M=je?0:void 0;let Ue;e[6]!==f||e[7]!==M?(Ue={transform:f,opacity:M},e[6]=f,e[7]=M,e[8]=Ue):Ue=e[8];const C=Ue;let et;e[9]!==c?(et=Oa(c),e[9]=c,e[10]=et):et=e[10];const I=et,St="button",fe=0;let Je;e[11]!==N?(Je=P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),N())},e[11]=N,e[12]=Je):Je=e[12];const kt=je?"cursor-grabbing":"cursor-pointer";let Ge;e[13]!==T||e[14]!==c||e[15]!==S||e[16]!==kt?(Ge=oe("touch-none transition-colors",kt,wo(c,S,T)),e[13]=T,e[14]=c,e[15]=S,e[16]=kt,e[17]=Ge):Ge=e[17];let re;e[18]!==b||e[19]!==g||e[20]!==h||e[21]!==c?(re=s.jsx(ko,{section:c,raw:h,meta:g,decofile:b}),e[18]=b,e[19]=g,e[20]=h,e[21]=c,e[22]=re):re=e[22];const ie=!T&&!c.isMultivariate&&s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"ghost",size:"icon","aria-label":r(Se?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:oe(Wn(m,Se)),onClick:P=>{P.stopPropagation(),He()},onPointerDown:Ri,children:s.jsx(Xn,{className:oe("h-3.5 w-3.5",Se&&"text-warning")})})}),s.jsx(vt,{side:"bottom",children:r(Se?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ke=T?s.jsx(za,{label:r(H?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:H,onToggle:$e,children:H?s.jsx(uo,{className:"h-3.5 w-3.5"}):s.jsx(mo,{className:"h-3.5 w-3.5"})}):s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"ghost",size:"icon","aria-label":r(H?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:oe(Wn(m,H)),onClick:P=>{P.stopPropagation(),$e()},onPointerDown:wi,children:H?s.jsx(uo,{className:"h-3.5 w-3.5"}):s.jsx(mo,{className:"h-3.5 w-3.5"})})}),s.jsx(vt,{side:"bottom",children:r(H?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),F=Aa,A=$a;let le;e[23]!==r?(le=r("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=r,e[24]=le):le=e[24];const Ve=oe(Wn(m,!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 Be;e[25]!==A||e[26]!==le||e[27]!==Ve?(Be=s.jsx(A,{label:le,classicClassName:Ve}),e[25]=A,e[26]=le,e[27]=Ve,e[28]=Be):Be=e[28];let Te;e[29]!==T||e[30]!==Se||e[31]!==He||e[32]!==c.isMultivariate||e[33]!==r?(Te=T&&!c.isMultivariate&&s.jsxs(s.Fragment,{children:[s.jsxs(zt,{onClick:P=>{P.stopPropagation(),He()},children:[s.jsx(Xn,{className:"h-4 w-4"}),r(Se?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),s.jsx(Na,{})]}),e[29]=T,e[30]=Se,e[31]=He,e[32]=c.isMultivariate,e[33]=r,e[34]=Te):Te=e[34];let $;e[35]!==Q?($=P=>{P.stopPropagation(),Q()},e[35]=Q,e[36]=$):$=e[36];let ce;e[37]===Symbol.for("react.memo_cache_sentinel")?(ce=s.jsx(Jr,{className:"h-4 w-4"}),e[37]=ce):ce=e[37];let ke;e[38]!==r?(ke=r("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=r,e[39]=ke):ke=e[39];let pe;e[40]!==$||e[41]!==ke?(pe=s.jsxs(zt,{onClick:$,children:[ce,ke]}),e[40]=$,e[41]=ke,e[42]=pe):pe=e[42];let ne;e[43]!==T||e[44]!==u||e[45]!==Pe||e[46]!==r?(ne=u&&s.jsxs(zt,{className:oe(!T&&Ha),onClick:P=>{P.stopPropagation(),Pe()},children:[s.jsx(So,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=T,e[44]=u,e[45]=Pe,e[46]=r,e[47]=ne):ne=e[47];let he;e[48]!==T||e[49]!==I||e[50]!==me||e[51]!==r?(he=I&&s.jsxs(zt,{className:oe(!T&&xi),onClick:P=>{P.stopPropagation(),me()},children:[T?s.jsx(_n,{className:"h-4 w-4"}):s.jsx(Qn,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=T,e[49]=I,e[50]=me,e[51]=r,e[52]=he):he=e[52];let se;e[53]!==T||e[54]!==ae||e[55]!==c.isMultivariate||e[56]!==c.isSavedBlock||e[57]!==r?(se=c.isSavedBlock===!0&&!c.isMultivariate&&s.jsxs(zt,{onClick:P=>{P.stopPropagation(),ae()},children:[T?s.jsx(_o,{className:"h-4 w-4"}):s.jsx(Qn,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=T,e[54]=ae,e[55]=c.isMultivariate,e[56]=c.isSavedBlock,e[57]=r,e[58]=se):se=e[58];let Fe;e[59]!==_?(Fe=P=>{P.stopPropagation(),_()},e[59]=_,e[60]=Fe):Fe=e[60];let ye;e[61]===Symbol.for("react.memo_cache_sentinel")?(ye=s.jsx(Qr,{className:"h-4 w-4"}),e[61]=ye):ye=e[61];let Ne;e[62]!==r?(Ne=r("sectionsEditor.sectionList.deleteMenuItem"),e[62]=r,e[63]=Ne):Ne=e[63];let we;e[64]!==Fe||e[65]!==Ne?(we=s.jsxs(zt,{variant:"destructive",onClick:Fe,children:[ye,Ne]}),e[64]=Fe,e[65]=Ne,e[66]=we):we=e[66];let be;e[67]!==Te||e[68]!==pe||e[69]!==ne||e[70]!==he||e[71]!==se||e[72]!==we?(be=s.jsxs(Ma,{align:"end",className:"w-44",children:[Te,pe,ne,he,se,we]}),e[67]=Te,e[68]=pe,e[69]=ne,e[70]=he,e[71]=se,e[72]=we,e[73]=be):be=e[73];let xe;e[74]!==F||e[75]!==Be||e[76]!==be?(xe=s.jsxs(F,{children:[Be,be]}),e[74]=F,e[75]=Be,e[76]=be,e[77]=xe):xe=e[77];let Ye;return e[78]!==q||e[79]!==Re||e[80]!==N||e[81]!==De||e[82]!==C||e[83]!==Ge||e[84]!==re||e[85]!==ie||e[86]!==Ke||e[87]!==xe||e[88]!==Je?(Ye=s.jsxs("div",{ref:De,style:C,...q,...Re,role:St,tabIndex:fe,onClick:N,onKeyDown:Je,className:Ge,children:[re,ie,Ke,xe]}),e[78]=q,e[79]=Re,e[80]=N,e[81]=De,e[82]=C,e[83]=Ge,e[84]=re,e[85]=ie,e[86]=Ke,e[87]=xe,e[88]=Je,e[89]=Ye):Ye=e[89],Ye}function wi(d){return d.stopPropagation()}function Ri(d){return d.stopPropagation()}function Vi(){return!1}function Zn(d){const e=tn.c(11),{canAddSection:c,onAddSection:h,className:g,size:b}=d,j=nn();let S;e[0]!==g?(S=oe("w-full",g),e[0]=g,e[1]=S):S=e[1];const N=!c;let _;e[2]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Yr,{size:14}),e[2]=_):_=e[2];let Q;e[3]!==j?(Q=j("sectionsEditor.sectionList.addSectionButton"),e[3]=j,e[4]=Q):Q=e[4];let me;return e[5]!==h||e[6]!==b||e[7]!==S||e[8]!==N||e[9]!==Q?(me=s.jsxs(Mt,{type:"button",variant:"outline",size:b,className:S,disabled:N,onClick:h,children:[_,Q]}),e[5]=h,e[6]=b,e[7]=S,e[8]=N,e[9]=Q,e[10]=me):me=e[10],me}function Ti(d){const e=tn.c(101),{listKey:c,rawSections:h,sections:g,meta:b,decofile:j,selectedIndex:S,onSelect:N,onReorder:_,onDelete:Q,onDuplicate:me,onMakeReusable:$e,onToggleHidden:He,onToggleLazy:Pe,onAddVariant:ae,onDetach:r,onAddSection:T,canAddSection:Se}=d,H=Se===void 0?!0:Se,m=nn(),z=En();let u;e[0]!==g.length?(u=()=>go(g.length),e[0]=g.length,e[1]=u):u=e[1];const[U,q]=E.useState(u),[Re,De]=E.useState(null),[Ze,je]=E.useState(c),[f,M]=E.useState(g.length),Ue=E.useRef(!1);Ze!==c?(je(c),M(g.length),q(go(g.length))):f!==g.length&&(M(g.length),q(Ie=>_i(Ie,g.length)));let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[2]=C):C=e[2];let et;e[3]===Symbol.for("react.memo_cache_sentinel")?(et={coordinateGetter:ri},e[3]=et):et=e[3];const I=Xr(fo(ei,C),fo(Zr,et));let St;e[4]!==U?(St=U.map(Ni),e[4]=U,e[5]=St):St=e[5];const fe=St;let Je;e[6]===Symbol.for("react.memo_cache_sentinel")?(Je=Ie=>{De(String(Ie.active.id))},e[6]=Je):Je=e[6];const kt=Je;let Ge;e[7]!==fe||e[8]!==_?(Ge=Ie=>{De(null);const{active:L,over:B}=Ie;if(!B||L.id===B.id)return;const qe=fe.indexOf(String(L.id)),ot=fe.indexOf(String(B.id));qe===-1||ot===-1||(q(ut=>jo(xn([...ut],qe,ot))),Ue.current=!0,requestAnimationFrame(()=>{Ue.current=!1}),_?.(qe,ot))},e[7]=fe,e[8]=_,e[9]=Ge):Ge=e[9];const re=Ge;let ie;e[10]===Symbol.for("react.memo_cache_sentinel")?(ie=()=>{De(null)},e[10]=ie):ie=e[10];const Ke=ie;let F,A,le,Ve,Be,Te,$,ce,ke,pe,ne,he,se,Fe,ye;if(e[11]!==Re||e[12]!==H||e[13]!==z||e[14]!==j||e[15]!==U||e[16]!==fe||e[17]!==re||e[18]!==b||e[19]!==T||e[20]!==ae||e[21]!==Q||e[22]!==r||e[23]!==me||e[24]!==$e||e[25]!==N||e[26]!==He||e[27]!==Pe||e[28]!==h||e[29]!==g||e[30]!==S||e[31]!==I||e[32]!==m){Fe=Symbol.for("react.early_return_sentinel");e:{const Ie=L=>{Ue.current||N(L)};if(e[48]!==Re||e[49]!==H||e[50]!==z||e[51]!==U||e[52]!==T||e[53]!==h||e[54]!==g||e[55]!==m){const L=Re?U.find(B=>B.id===Re):null;if(Ve=L!=null?g[L.index]:null,le=L!=null?h[L.index]:void 0,U.length===0){let B;e[59]!==m?(B=m("sectionsEditor.sectionList.noSections"),e[59]=m,e[60]=B):B=e[60];let qe;e[61]!==B?(qe=s.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:B}),e[61]=B,e[62]=qe):qe=e[62];const ot=qe;let ut;e[63]!==H||e[64]!==z||e[65]!==ot||e[66]!==T?(ut=z?ot:s.jsxs("div",{className:"space-y-2",children:[ot,s.jsx(Zn,{canAddSection:H,onAddSection:T,size:"sm"})]}),e[63]=H,e[64]=z,e[65]=ot,e[66]=T,e[67]=ut):ut=e[67],Fe=ut;break e}se=oe(L&&"cursor-grabbing"),e[48]=Re,e[49]=H,e[50]=z,e[51]=U,e[52]=T,e[53]=h,e[54]=g,e[55]=m,e[56]=le,e[57]=Ve,e[58]=se}else le=e[56],Ve=e[57],se=e[58];A=si,ce=I,ke=oi,pe=kt,ne=re,he=Ke,F=ii,Te=fe,$=li,ye="space-y-1",Be=U.map(L=>{const B=g[L.index];return B?s.jsx(ki,{sortableId:L.id,section:B,raw:h[L.index],meta:b,decofile:j,selected:S===L.index,onSelect:()=>Ie(L.index),onDelete:()=>Q(L.index),onDuplicate:()=>me(L.index),onMakeReusable:()=>$e(L.index),onToggleHidden:()=>He(L.index),onToggleLazy:()=>Pe(L.index),onAddVariant:()=>ae(L.index),onDetach:()=>r(L.index)},L.id):null})}e[11]=Re,e[12]=H,e[13]=z,e[14]=j,e[15]=U,e[16]=fe,e[17]=re,e[18]=b,e[19]=T,e[20]=ae,e[21]=Q,e[22]=r,e[23]=me,e[24]=$e,e[25]=N,e[26]=He,e[27]=Pe,e[28]=h,e[29]=g,e[30]=S,e[31]=I,e[32]=m,e[33]=F,e[34]=A,e[35]=le,e[36]=Ve,e[37]=Be,e[38]=Te,e[39]=$,e[40]=ce,e[41]=ke,e[42]=pe,e[43]=ne,e[44]=he,e[45]=se,e[46]=Fe,e[47]=ye}else F=e[33],A=e[34],le=e[35],Ve=e[36],Be=e[37],Te=e[38],$=e[39],ce=e[40],ke=e[41],pe=e[42],ne=e[43],he=e[44],se=e[45],Fe=e[46],ye=e[47];if(Fe!==Symbol.for("react.early_return_sentinel"))return Fe;let Ne;e[68]!==Be||e[69]!==ye?(Ne=s.jsx("div",{className:ye,children:Be}),e[68]=Be,e[69]=ye,e[70]=Ne):Ne=e[70];let we;e[71]!==F||e[72]!==Te||e[73]!==$||e[74]!==Ne?(we=s.jsx(F,{items:Te,strategy:$,children:Ne}),e[71]=F,e[72]=Te,e[73]=$,e[74]=Ne,e[75]=we):we=e[75];let be;e[76]!==le||e[77]!==Ve||e[78]!==z||e[79]!==j||e[80]!==b?(be=Ve?s.jsx("div",{className:oe("cursor-grabbing shadow-lg ring-1 ring-border/60",wo(Ve,!1,z)),children:s.jsx(ko,{section:Ve,raw:le,meta:b,decofile:j})}):null,e[76]=le,e[77]=Ve,e[78]=z,e[79]=j,e[80]=b,e[81]=be):be=e[81];let xe;e[82]!==be?(xe=Ta.createPortal(s.jsx(ti,{dropAnimation:La,children:be}),document.body),e[82]=be,e[83]=xe):xe=e[83];let Ye;e[84]!==A||e[85]!==ce||e[86]!==ke||e[87]!==pe||e[88]!==ne||e[89]!==he||e[90]!==we||e[91]!==xe?(Ye=s.jsxs(A,{sensors:ce,collisionDetection:ke,onDragStart:pe,onDragEnd:ne,onDragCancel:he,children:[we,xe]}),e[84]=A,e[85]=ce,e[86]=ke,e[87]=pe,e[88]=ne,e[89]=he,e[90]=we,e[91]=xe,e[92]=Ye):Ye=e[92];let P;e[93]!==H||e[94]!==z||e[95]!==T?(P=!z&&s.jsx(Zn,{canAddSection:H,onAddSection:T,size:"sm",className:"mt-2"}),e[93]=H,e[94]=z,e[95]=T,e[96]=P):P=e[96];let ct;return e[97]!==se||e[98]!==Ye||e[99]!==P?(ct=s.jsxs("div",{className:se,children:[Ye,P]}),e[97]=se,e[98]=Ye,e[99]=P,e[100]=ct):ct=e[100],ct}function Ni(d){return d.id}function vo(d,e,c,h){if(!d||!e)return null;if(!e.isMultivariate)return pt(d,e,h)?.data??null;const g=it(d,e),b=g?Un(g,lt)[c]:void 0;return b?xo(b.value,h)?.data??null:null}const Ai=50;function Mi(d,e){d.own.push(Ct(e)),d.own.length>Ai&&d.own.shift()}function Ci(d,e){return d.own.includes(Ct(e))}function Pi(d,e){const{sectionIndex:c,variantIndex:h,shown:g,next:b,sectionCount:j}=e;return d&&d.sectionIndex===c&&d.variantIndex===h&&d.emitted===g?(d.emitted=b,d):g?{sectionIndex:c,variantIndex:h,base:g,emitted:b,sectionCount:j,own:[Ct(g)]}:null}function Di(d,e){return e!==null&&Ct(d)!==Ct(e)}function Ki(d,e){return d.__resolveType!==e.__resolveType}function Bi(d,e,c,h){if(e.length===h)return"here";const g=Ct(d),b=e.flatMap((j,S)=>S!==c&&j!==null&&Ct(j)===g?[S]:[]);return b.length===1?b[0]:"unknown"}function Fi(d,e,c,h){if(!d||typeof d!="object")return{kind:"error",reason:"no-matcher-rule"};const g=e.trim();if(!g)return At(d,c,h)?{kind:"inline",blockKey:d.__resolveType??"",inlinedRule:Jn(d,c,h)}:{kind:"noop"};const b=Yn(d,c,h);if(!b)return{kind:"error",reason:"unreadable-rule"};if(b.blockKey)return{kind:"updateBlock",blockKey:b.blockKey,blockData:jt(b.resolveType,b.data,g)};const j=yn(g),S=bn(j,c);return S?{kind:"error",reason:"invalid-block-id",message:S}:{kind:"createBlock",blockId:j,blockData:jt(b.resolveType,b.data,g),reference:Ht(j)}}const Ii=3,Li=1e3;function Lu({orgSlug:d,virtualMcpId:e,branch:c,previewReady:h=!0,previewUrl:g,currentPath:b,activePageBlockKey:j=null,activeGlobalBlockKey:S=null,externalSelection:N,onSaved:_,initialEditSeo:Q=!1,onExitSeo:me,onSelectRoot:$e,onViewJsonFile:He,onFocusedBlockChange:Pe,onVariantPreviewOverride:ae}){const r=nn(),T=Ka(),Se=T?.taskId??null,H=h?{orgSlug:d,virtualMcpId:e,branch:c,threadId:Se,previewUrl:g}:null,{data:m,isLoading:z}=Ua(H),{data:u,isLoading:U}=Ja(H),q=En(),Re=T?.virtualMcpId,Ze=Sr(Re===e?e:null)?.metadata?.siteSlug??null,je=di({virtualMcpId:e,sandboxUrl:g}),[f,M]=E.useState(null),[Ue,C]=E.useState(null),[et,I]=E.useState(null),[St,fe]=E.useState(0),[Je,kt]=E.useState(void 0),[Ge,re]=E.useState(null),[ie,Ke]=E.useState(null),[F,A]=E.useState([]),le=E.useRef(null),[Ve,Be]=E.useState(F.length);Ve!==F.length&&(Be(F.length),requestAnimationFrame(()=>{le.current&&(le.current.scrollTop=0)}));const[Te,$]=E.useState(0),[ce,ke]=E.useState(null),[pe,ne]=E.useState(null),[he,se]=E.useState(null),[Fe,ye]=E.useState(!1),[Ne,we]=E.useState(!1),be=E.useRef(null),[xe,Ye]=E.useState(!0),[P,ct]=E.useState(!1),[Ie,L]=E.useState(!1),[B,qe]=E.useState(Q),[ot,ut]=E.useState(Q);Q&&!ot&&(ut(!0),qe(!0),M(null),C(null),I(null),A([])),!Q&&ot&&ut(!1);const[Ro,sn]=E.useState(null),[ts,jn]=E.useState(void 0),[ns,wt]=E.useState([]),[ss,Gt]=E.useState(0),[Le,tt]=E.useState(0),[Vo,Oe]=E.useState(null),[Pt,We]=E.useState(null),[os,as]=E.useState(null),To=Ca(),No=`${d}/${e}/${c}`,on=Ya({orgSlug:d,virtualMcpId:e,branch:c}),[Ao,Mo]=E.useState(b),[Co,Po]=E.useState(j),[Do,Ko]=E.useState(S);(Ao!==b||Co!==j||Do!==S)&&(queueMicrotask(()=>on.flush()),Mo(b),Po(j),Ko(S),M(null),C(null),I(null),fe(0),re(null),Ke(null),tt(0),Oe(null),We(null),A([]),$(t=>t+1),qe(!1),sn(null),jn(void 0),wt([]),Gt(t=>t+1));const J=Qa({orgSlug:d,virtualMcpId:e,branch:c}),qt=mr((t,n)=>{J.mutate({blockKey:t,data:n},{onSuccess:()=>_?.(),onError:o=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})}),an=jr({orgSlug:d,virtualMcpId:e,branch:c}),[Dt,Kt]=E.useState(!1),O=E.useRef(null),kn=E.useRef(null),dt=E.useRef(null),mt=E.useRef(null),wn=E.useRef({}),rn=E.useRef(null),Ae=E.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[rs,Bo]=E.useState(0),[Fo,Io]=E.useState(0),[Lo,Oo]=E.useState(null);if(!h||z||U)return s.jsx("div",{className:"h-full w-full flex items-center justify-center",children:s.jsx(Pa,{className:"size-5 text-muted-foreground"})});if(!m||!u)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const zo=Rr(m),Y=!!S,X=Y?null:Vr(zo,b,j),v=Y?S:X?.key??null,Rn=Y&&S?m[S]:void 0,is=Y&&S&&Rn?Tr(S,Rn):Y&&S?S:"",Wt=!Y&&v&&m[v]?m[v]:null,Vn=B&&m&&u&&v&&X?Ys(m,{kind:"page",pageKey:v,pageName:String(X.name??""),path:String(X.path??"")},u):null,$o=B?Wt?.seo:void 0,ln=ts!==void 0?ts:$o,Ho=B?Xa(ln):void 0,ls=Vn?.seoTypeOptions??[],cs=B&&u?Za(u):"",Tn=Ro??Ho??{},cn=B&&Vn?ci(Tn,Vn):null,us=B&&cn&&er(ln)?Sn(cn,u):null,ds=B?tr(m,u)?.seoData:void 0,ue=Y?[{label:"Default",sections:[{__resolveType:S}]}]:nr(Wt?.sections,m??{}),at=ue.length>1,Z=Math.min(St,ue.length-1),Qe=ue[Z],D=Qe?.sections??[],ge=gn(D,m),Nn=!Y&&Nr(Wt?.sections);if(Y&&S&&os!==S){as(S);const t=D[0],n=ge[0];if(t&&n){M(0),tt(0),A([]);const o=pt(t,n,m);o&&(C(o.data),I(o.resolveType),We(null),Oe(null))}}!Y&&os!==null&&as(null),Ae.current={rawSections:D,parsedSections:ge,decofile:m??{},activePageKey:v,pageVariants:ue,variantIndex:Z,sectionVariantIndex:Le,selectedSectionIndex:f};const Go=()=>({multivariate:Nn,index:Z,variants:ue.map(t=>({rule:t.rule}))}),An=(t,n)=>{if(!ae)return;if(!v||!Nn||t.length<=1){ae(null);return}const o=ho(v,{multivariate:!0,index:n,variants:t},m,u);ae(o.length>0?o:null)},Mn=ae&&v&&Nn&&at&&!z&&!U?v:null;if(Mn!==Lo&&(Oo(Mn),Mn)){const t=ue.map(o=>({rule:o.rule})),n=Z;queueMicrotask(()=>An(t,n))}const Bt=(t,n,o)=>{if(!ae)return;if(!v){ae(null);return}const a=Go(),l=ho(v,a,m,u);if(!t||n<0){ae(l.length>0?l:null);return}const i=fi({pageKey:v,page:a,sectionIndex:n,sectionLazy:ge[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:o,decofile:m,meta:u}),p=[...l,...i];ae(p.length>0?p:null)},ft=(t,n,o,a=f??-1,l=!1)=>{const i=it(t,n);if(!i){C(null),I(null),We(null),Oe(null),l&&Bt(null,a,o);return}const x=Un(i,lt)[o];if(!x){C(null),I(null),We(null),Oe(null),l&&Bt(null,a,o);return}const R=xo(x.value,m);C(R?.data??null),I(R?.resolveType??null);const{resolveType:y,formValue:k}=Zt(x.rule,m,u??void 0);We(y),Oe(k),l&&Bt(i,a,o)},Ut=N?.index;if(N!==void 0&&(N?.seq??null)!==Je&&(kt(N?.seq??null),typeof Ut=="number")){const t=D[Ut],n=ge[Ut];if(t&&n)if(M(Ut),tt(0),A([]),$(o=>o+1),n.isMultivariate)ft(t,n,0,Ut);else{const o=pt(t,n,m);o?(C(o.data),I(o.resolveType)):(C(null),I(null)),We(null),Oe(null)}}if(rs!==Fo){Io(rs);const t=f!==null?D[f]:null,n=f!==null?ge[f]:null;if(t&&n&&f!==null)if(A([]),$(o=>o+1),n.isMultivariate)ft(t,n,Le,f);else{const o=pt(t,n,m??{});C(o?.data??null),I(o?.resolveType??null)}}const Jt={orgSlug:d,virtualMcpId:e,branch:c,threadId:Se,previewUrl:g??void 0,siteSlug:Ze},Cn=et&&u?Sn(et,u):null,nt=(t,n)=>{if(!v)return;O.current&&(clearTimeout(O.current),O.current=null),mt.current&&(clearTimeout(mt.current),mt.current=null),dt.current&&(clearTimeout(dt.current),dt.current=null);const o=Xt(m,v,t,Z,ue);J.mutate({blockKey:v,data:o},{onSuccess:()=>n?.onSuccess?.()??_?.(),onError:a=>{n?.onError?.(),V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))}})},Rt=()=>{Pe?.(null),M(null),L(!1),C(null),I(null),tt(0),Oe(null),We(null),A([]),$(t=>t+1)},Pn=(t=r("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{O.current&&(clearTimeout(O.current),O.current=null),kn.current=null,V.error(t),Bo(n=>n+1)},Dn=(t,n,o=0)=>{const a=Ae.current.sectionVariantIndex,l=rn.current,i=l?.sectionIndex===n&&l.variantIndex===a?l:null,p=kn.current;O.current&&(clearTimeout(O.current),O.current=null,p&&(p.sectionIndex!==n||p.sectionVariantIndex!==a)&&p.write());const x=()=>{const{rawSections:R,parsedSections:y,decofile:k,activePageKey:w,pageVariants:ve,variantIndex:ee}=Ae.current,G=R[n];if(!G)return;const W=y[n];if(!W)return;const te=i?.base,K=vo(G,W,a,k),ze=!!te&&!!K&&Di(te,K)&&!(i&&Ci(i,K));if(ze&&te&&K){if(Ki(te,K)){Pn(r("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const de=W.isSavedBlock?"here":Bi(te,R.map((Ee,Ot)=>vo(Ee,y[Ot],a,k)),n,i?.sectionCount??R.length);if(de==="unknown"){Pn(r("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof de=="number"&&i){i.sectionCount=R.length,i.sectionIndex=de,M(de),Dn(t,de,o);return}}const Xe=[],Me=ze&&te&&K?hr(te,t,K,{prefer:"theirs",conflicts:Xe}):null,Ce=Me??t,rt=!!Me&&rn.current===i&&i?.emitted===t;Xe.length>0?V.warning(r("sectionsEditor.sectionsEditor.formFieldsKeptFromStored",{fields:gr(Xe)})):Me&&V.info(r("sectionsEditor.sectionsEditor.blockMergedWithOthers")),rt&&i&&(i.emitted=Me,C(Me));const Lt=rt||!Me?Ce:t;i&&(i.base=Lt,i.sectionCount=R.length,Mi(i,Lt));const pn={onSuccess:()=>_?.(),onError:de=>{if(i?.base===Lt&&te&&(i.base=te),de instanceof Gr){o<Ii?setTimeout(()=>{const Ee=i?.emitted;Dn(Ee&&typeof Ee=="object"?Ee:t,n,o+1)},Li*2**o):Pn();return}V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:de.message}))}};if(W.isSavedBlock){const de=vr(G,W);if(!de)return;J.mutate({blockKey:de,data:Ce,...te?{base:{value:Me?K:te}}:{},rebaseOnConflict:!1},pn);return}if(!w)return;const hn={...k[w]},Tt=[...R];if(W.isMultivariate){const de=it(G,W);if(!de||!w)return;const Ee=Hr(de,a,Ce);Tt[n]=Nt(G,W,Ee)}else if(W.isHidden){const de=es(G.__resolveType),Ee=de?{...G.section}:{...G},Ot=Array.isArray(Ee.variants)?[...Ee.variants]:[];Ot[0]&&(Ot[0]={...Ot[0],value:Ce}),Ee.variants=Ot,de?Tt[n]={...G,section:Ee}:Tt[n]=Ee}else W.isLazy?Tt[n]={...G,section:Ce}:Tt[n]=Ce;if(ve.length>1){const de=hn.sections,Ee=[...de?.variants??[]];Ee[ee]&&(Ee[ee]={...Ee[ee],value:Tt}),hn.sections={...de,variants:Ee}}else hn.sections=Tt;J.mutate({blockKey:w,data:hn,rebaseOnConflict:!1},pn)};kn.current={sectionIndex:n,sectionVariantIndex:a,write:x},O.current=setTimeout(()=>{O.current=null,x()},Gn)},qo=t=>{M(t),tt(0),A([]),$(l=>l+1);const n=D[t],o=ge[t];if(Pe?.(o?.isSavedBlock?o.resolveType??null:null),!n||!o)return;if(o.isMultivariate){ft(n,o,0,t);return}const a=pt(n,o,m);if(!a){C(null),I(null),We(null),Oe(null),Bt(null,t,0);return}C(a.data),I(a.resolveType),We(null),Oe(null),Bt(null,t,0)},ms=t=>{const n=t;f!==null&&(rn.current=Pi(rn.current,{sectionIndex:f,variantIndex:Ae.current.sectionVariantIndex,shown:Ue,next:n,sectionCount:Ae.current.rawSections.length})),C(n),f!==null&&Dn(n,f)},Kn=t=>{if(!v||!m||!u||!X)return;const n={kind:"page",pageKey:v,pageName:String(X.name??""),path:String(X.path??"")},o=Ys(m,n,u);o&&on.save(v,()=>{const a=To.getQueryData(Da.decofile(No))?.[v];if(!a||typeof a!="object"||a===null||Array.isArray(a))return null;const l={...a,...wn.current};return wn.current={},t?.raw!==void 0?{...l,seo:t.raw}:t?.inner!==void 0?ui(n,o,l,t.inner):l})},fs=(t,n)=>{v&&(wn.current[t]=n,Kn())},Wo=(t,n)=>{if(!v)return;const o=xn([...D],t,n);f!==null&&(f===t?M(n):t<f&&n>=f?M(f-1):t>f&&n<=f&&M(f+1)),nt(o)},Uo=t=>{if(!v)return;const n=D.filter((o,a)=>a!==t);f===t?Rt():f!==null&&f>t&&M(f-1),nt(n)},Jo=t=>{if(!v)return;const n=D[t];if(!n)return;const o=[...D];o.splice(t+1,0,fr(n)),f!==null&&f>t&&M(f+1),nt(o)},Yo=t=>{if(!v)return;const n=D[t],o=ge[t];if(!n||!o)return;const a=o.isHidden?Ir(n):Lr(n);if(!a)return;const l=[...D];l[t]=a,f===t&&Rt(),nt(l)},Qo=t=>{if(!v)return;const n=D[t],o=ge[t];if(!n||!o||o.isMultivariate)return;const a=Fr(n);if(!a)return;const l=[...D];l[t]=a,f===t&&Rt(),nt(l)},Xo=t=>{if(!v)return;const n=D[t],o=ge[t];if(!n||!o?.isSavedBlock)return;const a=pt(n,o,m);if(!a?.data)return;const{name:l,...i}=a.data,p=[...D];o.isLazy?p[t]={...n,section:i}:p[t]=i,f===t&&Rt(),nt(p)},Zo=t=>{if(!v)return;const n=[...D,{__resolveType:t.resolveType}],o=n.length-1;nt(n,{onError:()=>{Ae.current.selectedSectionIndex===o&&Rt()}}),ye(!1),M(o),tt(0),A([]),$(p=>p+1);const a=n[o],l=gn(n,m)[o];if(!a||!l)return;if(l.isMultivariate){ft(a,l,0);return}const i=pt(a,l,m);if(!i){C(null),I(null),We(null),Oe(null);return}C(i.data),I(i.resolveType),We(null),Oe(null)},ps=t=>{be.current=t.append,ye(!0)},ea=t=>{const n=be.current;if(!n){Zo(t);return}n({__resolveType:t.resolveType}),ye(!1),be.current=null},hs=t=>{if(f===null)return;const n=D[f],o=ge[f];!n||!o?.isMultivariate||(tt(t),A([]),$(a=>a+1),ft(n,o,t,f,!0))},ta=t=>{if(f===null||!v)return;const n=D[f],o=ge[f];if(!n||!o?.isMultivariate)return;const a=it(n,o);if(!a)return;const l=Kr(a,t);if(!l){V.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...D];i[f]=Nt(n,o,l);const p=l.variants;let x=Le;t===Le?x=Math.min(t,p.length-1):t<Le&&(x=Le-1),tt(x),A([]),$(R=>R+1),ft(i[f],o,x),nt(i)},na=t=>{if(f===null||!v)return;const n=D[f],o=ge[f];if(!n||!o?.isMultivariate)return;const a=it(n,o);if(!a)return;const l=Br(a,t),i=[...D];i[f]=Nt(n,o,l);const p=t+1;tt(p),A([]),$(x=>x+1),ft(i[f],o,p),nt(i)},sa=(t,n)=>{if(f===null||!v||t===n)return;const o=D[f],a=ge[f];if(!o||!a?.isMultivariate)return;const l=it(o,a);if(!l)return;const i=Pr(l,t,n),p=[...D];p[f]=Nt(o,a,i);let x=Le;Le===t?x=n:t<Le&&n>=Le?x=Le-1:t>Le&&n<=Le&&(x=Le+1),tt(x),ft(p[f],a,x),nt(p)},Yt=t=>{const n=t??f;if(n===null||!v)return;const o=D[n],a=ge[n];if(!o||!a)return;const l=Ar(o,a);if(!l){V.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...D];i[n]=l.section;const p=gn(i,m)[n];if(!p?.isMultivariate){V.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}M(n),tt(l.newVariantIndex),A([]),$(x=>x+1),ft(l.section,p,l.newVariantIndex,n),nt(i)},gs=()=>{if(f===null||!v)return;const t=D[f],n=ge[f];if(!t||!n?.isMultivariate)return;const o=it(t,n);if(!o)return;const a=Dr(t,n,o);if(!a){V.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const l=[...D];l[f]=a;const i=gn(l,m)[f];if(!i)return;tt(0),We(null),Oe(null),A([]),$(x=>x+1);const p=pt(a,i,m);p?(C(p.data),I(p.resolveType)):(C(null),I(null)),Bt(null,f,0),nt(l)},oa=async t=>{if(ce===null||!v)return;const n=bn(t,m);if(n){V.error(n);return}const o=D[ce],a=ge[ce];if(!o||!a)return;const l=pt(o,a,m);if(!l){V.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...l.data,name:t};try{await J.mutateAsync({blockKey:t,data:i});const p=[...D];p[ce]={__resolveType:t},await J.mutateAsync({blockKey:v,data:Xt(m,v,p,Z,ue)}),f===ce&&Rt(),ke(null),V.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),_?.()}catch(p){V.error(p instanceof Error?p.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},vs=Qe?.rule;if(at&&f===null&&ie===null&&vs){const{resolveType:t,formValue:n}=Zt(vs,m??{},u??void 0);Ke(t),re(n)}const Ft=u?sr(u):[],Bn=u&&m?or(u,m):[],Ss=!Y&&!!(je&&u&&m),ys=ie&&u?Sn(ie,u):null,yt=()=>{dt.current&&(clearTimeout(dt.current),dt.current=null),mt.current&&(clearTimeout(mt.current),mt.current=null)},Vt=async(t,n)=>{if(!($r(n,t,u)>0))try{await an.mutateAsync({blockKey:t})}catch(o){V.error(o instanceof Error?o.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},bs=t=>{dt.current&&clearTimeout(dt.current),dt.current=setTimeout(()=>{const{activePageKey:n,decofile:o,variantIndex:a}=Ae.current;if(!n)return;const l={...o[n]},i={...l.sections},p=[...i.variants??[]],x=p[a],R=x?.rule;if(At(R,o,u)){const y=R?.__resolveType??"",k=o[y],w=typeof k?.name=="string"?k.name:y,{__resolveType:ve,...ee}=t;J.mutate({blockKey:y,data:jt(ve??"",ee,w)},{onSuccess:()=>_?.(),onError:G=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}x&&(p[a]={...x,rule:t}),l.sections={...i,variants:p},J.mutate({blockKey:n,data:l},{onSuccess:()=>_?.(),onError:y=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:y.message}))})},Gn)},xs=t=>{Ke(t);const n=t?io(t,u):{__resolveType:lo};re(t?n:{}),bs(n)},_s=t=>{const n=t;re(n);const o=ie?{__resolveType:ie,...n}:{...n};bs(o)},Es=async t=>{yt();const{activePageKey:n,decofile:o,variantIndex:a}=Ae.current;if(!n)return;const l=o[n],i=l?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const p=i;if(!Array.isArray(p.variants))return;const x=[...p.variants],R=x[a];if(!R)return;const y=Et(R.rule,o,u),k=Ht(t);x[a]={...R,rule:k};const w={...o,[n]:{...l,sections:{...p,variants:x}}},{resolveType:ve,formValue:ee}=Zt(k,w,u??void 0);Ke(ve),re(ee);try{await J.mutateAsync({blockKey:n,data:w[n]}),y&&y!==t&&await Vt(y,w),_?.()}catch(G){V.error(G instanceof Error?G.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},js=t=>{mt.current&&clearTimeout(mt.current);const{selectedSectionIndex:n,sectionVariantIndex:o}=Ae.current;n!==null&&(mt.current=setTimeout(()=>{const{rawSections:a,parsedSections:l,decofile:i,activePageKey:p,pageVariants:x,variantIndex:R}=Ae.current;if(!p)return;const y=a[n],k=l[n];if(!y||!k?.isMultivariate)return;const w=it(y,k);if(!w)return;const ee=(w.variants??[])[o]?.rule;if(At(ee,i,u)){const K=ee?.__resolveType??"",ze=i[K],Xe=typeof ze?.name=="string"?ze.name:K,{__resolveType:Me,...Ce}=t;J.mutate({blockKey:K,data:jt(Me??"",Ce,Xe)},{onSuccess:()=>_?.(),onError:rt=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:rt.message}))});return}const G=co(w,o,t),W=[...a];W[n]=Nt(y,k,G);const te=Xt(i,p,W,R,x);J.mutate({blockKey:p,data:te},{onSuccess:()=>_?.(),onError:K=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:K.message}))})},Gn))},aa=t=>{We(t);const n=t?io(t,u):{__resolveType:lo};Oe(t?n:{}),js(n)},ra=t=>{const n=t;Oe(n);const o=Pt?{__resolveType:Pt,...n}:{...n};js(o)},ia=async t=>{yt();const{selectedSectionIndex:n,sectionVariantIndex:o,rawSections:a,parsedSections:l,decofile:i,activePageKey:p,pageVariants:x,variantIndex:R}=Ae.current;if(n===null||!p)return;const y=a[n],k=l[n];if(!y||!k?.isMultivariate)return;const w=it(y,k);if(!w)return;const ve=w.variants??[],ee=Et(ve[o]?.rule,i,u),G=Ht(t),W=co(w,o,G),te=[...a];te[n]=Nt(y,k,W);const K=Xt(i,p,te,R,x),ze={...i,[p]:K},{resolveType:Xe,formValue:Me}=Zt(G,ze,u??void 0);We(Xe),Oe(Me);try{await J.mutateAsync({blockKey:p,data:K}),ee&&ee!==t&&await Vt(ee,ze),_?.()}catch(Ce){V.error(Ce instanceof Error?Ce.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Y&&!X)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.noPageFound",{currentPath:b})});if(Y&&!Rn)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.globalBlockNotFound")});const _e=f!==null?ge[f]??null:null,ks=f!==null?D[f]:null,ws=ks&&_e?.isMultivariate?it(ks,_e):null,bt=ws?Un(ws,lt):[],un=Math.min(Le,Math.max(bt.length-1,0)),It=bt[un]??null,xt=_e?.isMultivariate===!0,Fn=f!==null&&_e!==null,_t=Fn&&(xt||!!(Cn&&Ue)),la=_t&&!Y&&_e?.isSavedBlock===!0,st=Y||la,Rs=Y?is:_e?.label??"",ca=Pt&&u?Sn(Pt,u):null,Vs=(t,n)=>n&&q?`${t} · ${n}`:t,Ts=_e?_e.variantOf??_e.label:"",ua=(()=>{const t=xt&&It?It.label:null;return t?q?[Vs(Ts,t)]:[_e.label,t]:[_e?.label??""]})(),In=Vs(X?.name??"",at?Qe?.label:null),dn=_t&&(!Y||F.length>0)?Y?[is,...F]:[In,...ua,...F]:[],Ns=B&&X?[X.name,"SEO",...ns]:[],As=r("sectionsEditor.pageVariantTabs.variantsLabel"),Ms=P&&X?[X.name,As]:Ie&&X&&_e?[In,Ts,As]:[],mn=Ms.length>0?Ms:Ns.length>0?Ns:st?dn.length>0?dn:[Rs]:dn.length>0?dn:[In],Cs=Fn&&!xt&&!_e?.isHidden&&!!v,da=st||!Y&&at&&!!Qe||Cs,ma=Fn&&!xt&&!Y&&F.length===0&&!!_e&&bo(_e)&&!!v,fa=q&&_t&&!Ie&&xt&&F.length===0&&!!It,Ps=q&&F.length>0?Qs(F[F.length-1]):null,pa=F.length>1?Qs(F[F.length-2]):null,Ds=st?Rs:_t?_e?.label??"":X?.name??"",ha=P||Ie?r("sectionsEditor.pageVariantTabs.variantsLabel"):B?r("sectionsEditor.panelSections.seo"):Ps??Ds,Ks=Ie?_e?.variantOf??_e?.label??"":P||B?X?.name??"":Ps?pa??Ds:st?r("sectionsEditor.sectionsEditor.globalSectionSubtitle"):_t?X?.name??"":X?.path??"",Ln=!P&&!Ie&&!B&&!_t&&!st,ga=!q&&!B&&!Y&&xt&&F.length===0,Qt=()=>{if(!v)return;yt(),O.current&&(clearTimeout(O.current),O.current=null);const t=m[v],n=Mr(t.sections,D);if(!n)return;const o=Cr(n);J.mutate({blockKey:v,data:{...t,sections:n}},{onSuccess:()=>{fe(o),M(null),C(null),I(null),A([]),re(null),Ke(null)},onError:a=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})},fn=(t,n,o)=>{if(!v)return;yt(),O.current&&(clearTimeout(O.current),O.current=null);const a=m[v],l=a.sections;if(!l||typeof l!="object"||Array.isArray(l))return;const i=l;if(!Array.isArray(i.variants))return;const p=t([...i.variants]);if(!p)return;const x=zr(i,p),R={...m,[v]:{...a,sections:x}};J.mutate({blockKey:v,data:R[v]},{onSuccess:()=>{n?.();const y=typeof o=="string"?[o]:o??[];(async()=>{for(const k of y)await Vt(k,R)})()},onError:y=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:y.message}))})},On=t=>{ne(null),fe(t),M(null),C(null),I(null),A([]);const n=ue[t]?.rule,{resolveType:o,formValue:a}=Zt(n,m??{},u??void 0);Ke(o),re(a),An(ue.map(l=>({rule:l.rule})),t)},Bs=(t,n)=>{if(t===n)return;let o=Z;Z===t?o=n:t<Z&&n>=Z?o=Z-1:t>Z&&n<=Z&&(o=Z+1),fe(o);const a=xn(ue.map(l=>({rule:l.rule})),t,n);An(a,o),fn(l=>xn(l,t,n))},Fs=t=>{const n=ue[t]?.rule,o=Et(n,m??{},u??void 0);fn(a=>a.length<=1?null:(a.splice(t,1),a),()=>{ue.length-1===1?fe(0):t<Z?fe(Z-1):t===Z&&fe(Math.max(0,t-1)),M(null),C(null),I(null),A([]),re(null),Ke(null)},o)},va=()=>{const t=ue.map((n,o)=>({variant:n,index:o})).filter(({variant:n})=>!Or(n.rule)).map(({variant:n})=>Et(n.rule,m??{},u??void 0)).filter(n=>!!n);fn(n=>{const o=qr({variants:n}),a=n[o];return a?[{...a,rule:Wr()}]:null},()=>{fe(0),M(null),C(null),I(null),A([]),re(null),Ke(null),ct(!1)},t)},Is=t=>{fn(n=>Ur(n,t),()=>{fe(t+1),M(null),C(null),I(null),A([]),re(null),Ke(null)})},Sa=async(t,n)=>{yt(),O.current&&(clearTimeout(O.current),O.current=null);const o=Ae.current.activePageKey,a=Ae.current.decofile;if(!o)return;const l=a[o],i=l.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const p=i;if(!Array.isArray(p.variants))return;const x=[...p.variants],R=x[t];if(!R?.rule||typeof R.rule!="object"){V.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const y=R.rule,k=n.trim();Kt(!0);try{if(!k){if(!At(y,a,u)){ne(null);return}const te=y.__resolveType??"";x[t]={...R,rule:Jn(y,a,u)};const K={...a,[o]:{...l,sections:{...p,variants:x}}};await J.mutateAsync({blockKey:o,data:K[o]}),await Vt(te,K),ne(null),_?.();return}const w=Yn(y,a,u);if(!w){V.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(w.blockKey){await J.mutateAsync({blockKey:w.blockKey,data:jt(w.resolveType,w.data,k)}),ne(null),_?.();return}const ve=yn(k),ee=bn(ve,a);if(ee){V.error(ee);return}const G=jt(w.resolveType,w.data,k);let W=null;try{await J.mutateAsync({blockKey:ve,data:G}),W=ve,x[t]={...R,rule:Ht(ve)},await J.mutateAsync({blockKey:o,data:{...l,sections:{...p,variants:x}}}),W=null}catch(te){throw W&&await an.mutateAsync({blockKey:W}).catch(()=>{}),te}ne(null),V.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:k})),_?.()}catch(w){V.error(w instanceof Error?w.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Kt(!1)}},ya=async(t,n)=>{yt(),O.current&&(clearTimeout(O.current),O.current=null);const{selectedSectionIndex:o,rawSections:a,parsedSections:l,decofile:i,activePageKey:p,pageVariants:x,variantIndex:R}=Ae.current;if(o===null||!p)return;const y=a[o],k=l[o];if(!y||!k?.isMultivariate)return;const w=it(y,k);if(!w)return;const ve=w.variants??[],ee=ve[t];if(!ee?.rule||typeof ee.rule!="object"){V.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const G=ee.rule,W=n.trim();Kt(!0);const te=async K=>{const ze={...w,variants:K},Xe=[...a];Xe[o]=Nt(y,k,ze);const Me=Xt(i,p,Xe,R,x);return await J.mutateAsync({blockKey:p,data:Me}),{...i,[p]:Me}};try{if(!W){if(!At(G,i,u)){se(null);return}const rt=G.__resolveType??"",Lt=[...ve];Lt[t]={...ee,rule:Jn(G,i,u)};const pn=await te(Lt);await Vt(rt,pn),se(null),_?.();return}const K=Yn(G,i,u);if(!K){V.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(K.blockKey){await J.mutateAsync({blockKey:K.blockKey,data:jt(K.resolveType,K.data,W)}),se(null),_?.();return}const ze=yn(W),Xe=bn(ze,i);if(Xe){V.error(Xe);return}const Me=jt(K.resolveType,K.data,W);let Ce=null;try{await J.mutateAsync({blockKey:ze,data:Me}),Ce=ze;const rt=[...ve];rt[t]={...ee,rule:Ht(ze)},await te(rt),Ce=null}catch(rt){throw Ce&&await an.mutateAsync({blockKey:Ce}).catch(()=>{}),rt}se(null),V.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:W})),_?.()}catch(K){V.error(K instanceof Error?K.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Kt(!1)}},Ls=async(t,n,o)=>{C(o);try{await J.mutateAsync({blockKey:t,data:o})}catch(a){throw C(l=>l===o?n:l),a}},ba={rename:async(t,n,o)=>{yt(),O.current&&(clearTimeout(O.current),O.current=null);const{activePageKey:a,decofile:l}=Ae.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],p=i[n],x=p?.rule&&typeof p.rule=="object"?p.rule:void 0,R=async k=>{const w={...t,variants:k};return await Ls(a,t,w),{...l,[a]:w}},y=Fi(x,o,l,u);if(y.kind!=="noop"){if(y.kind==="error"){V.error(y.reason==="no-matcher-rule"?r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):y.reason==="unreadable-rule"?r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):y.message??r("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}Kt(!0);try{if(y.kind==="inline"){const w=[...i];w[n]={...p,rule:y.inlinedRule};const ve=await R(w);await Vt(y.blockKey,ve),_?.();return}if(y.kind==="updateBlock"){await J.mutateAsync({blockKey:y.blockKey,data:y.blockData}),_?.();return}let k=null;try{await J.mutateAsync({blockKey:y.blockId,data:y.blockData}),k=y.blockId;const w=[...i];w[n]={...p,rule:y.reference},await R(w),k=null}catch(w){throw k&&await an.mutateAsync({blockKey:k}).catch(()=>{}),w}V.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:o.trim()})),_?.()}catch(k){V.error(k instanceof Error?k.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Kt(!1)}}},selectGlobal:async(t,n,o)=>{yt(),O.current&&(clearTimeout(O.current),O.current=null);const{activePageKey:a,decofile:l}=Ae.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],p=i[n];if(!p)return;const x=Et(p.rule,l,u);i[n]={...p,rule:Ht(o)};const R={...t,variants:i},y={...l,[a]:R};try{await Ls(a,t,R),x&&x!==o&&await Vt(x,y),_?.()}catch(k){V.error(k instanceof Error?k.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}}},Os=()=>{Rt()},zs=t=>{sn(t),Kn({inner:t})},$s=t=>{jn(t),Kn({raw:t})},Hs=()=>{sn(null),wt([])},Gs=()=>Gt(t=>t+1),qs=()=>{on.flush(),qe(!1),sn(null),jn(void 0),wt([]),Gt(t=>t+1),me?.()},xa=()=>{ct(!1),L(!1),M(null),qe(!0)},_a=()=>{B&&qs(),M(null),ct(!0)},Ea=()=>L(!0),zn=t=>{if(P&&t===0){ct(!1);return}if(Ie&&t<2){L(!1),t===0&&M(null);return}if(B){if(t===0){qs();return}if(t===1){wt([]),Gt(o=>o+1);return}wt(ns.slice(0,t-1)),Gt(o=>o+1);return}if(Y){A(F.slice(0,t)),$(o=>o+1);return}if(t===0){Os();return}if(t===1){A([]),$(o=>o+1);return}const n=!q&&xt&&It?1:0;if(n===1&&t===2){A([]),$(o=>o+1);return}A(F.slice(0,t-1-n))},$n=mn.length>1?s.jsx("button",{type:"button",onClick:()=>zn(pr(mn.length,{isMultivariateSectionTop:ga})),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:oe("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",st?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:s.jsx(_r,{className:"size-4"})}):null,ja=st||_t||B?da&&s.jsxs("div",{className:oe("border-b px-3 py-2.5",st&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!Y&&at&&Qe&&s.jsxs("button",{type:"button",onClick:Os,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:Qe.label}),className:oe("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",rr),children:[s.jsx(ar,{rule:qn(Qe.rule,m??{},u??void 0),matchers:Ft}),s.jsx("span",{className:"max-w-[160px] truncate",children:Qe.label})]}),s.jsx("div",{className:"flex-1"}),st&&s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx("span",{className:"shrink-0 cursor-help",children:s.jsx(_n,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),s.jsx(vt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Cs&&s.jsx(vn,{onClick:()=>Yt()})]}),st&&s.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:r("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):s.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Xs,{pageKey:v,initialName:X.name,initialPath:X.path,onFieldChange:fs,variant:"header"})}),s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>qe(!0),children:s.jsx(ao,{size:14})})}),s.jsx(vt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>He&&v?He():we(!0),children:s.jsx(ro,{size:14})})}),s.jsx(vt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),s.jsx(vn,{onClick:Qt})]}),ka=s.jsxs(s.Fragment,{children:[at&&v&&s.jsx(Zs,{listKey:v,variants:ue,activeIndex:Z,decofile:m??{},meta:u,matchers:Ft,onSelect:On,onReorder:Bs,onRename:ne,onDuplicate:Is,onDelete:Fs,onAdd:Qt}),at&&ie!==null&&s.jsx(eo,{className:"mt-3",children:s.jsx("div",{className:oe("space-y-3",Dt&&"pointer-events-none opacity-50"),children:s.jsx(Hn,{currentRt:ie,currentLabel:en(Qe?.rule,m??{},lt,u??void 0),currentGlobalKey:Et(Qe?.rule,m??{},u??void 0)??void 0,matchers:Ft,globals:Bn,onSelect:xs,onSelectGlobal:Es,schema:ys,formValue:Ge,onChange:_s,formKey:`${Z}:${ie??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt})})})]}),Ws=s.jsxs(s.Fragment,{children:[s.jsx(ir,{listKey:`${v??""}:${f??""}`,variants:bt.map((t,n)=>({index:n,label:t.label})),selectedIndex:un,onSelect:hs,onRename:se,onDuplicate:na,onDelete:ta,onRemoveAll:gs,onReorder:sa,onAdd:()=>Yt()}),s.jsx(eo,{children:s.jsx(Hn,{currentRt:Pt??"",currentLabel:en(It?.rule,m??{},lt,u??void 0),currentGlobalKey:Et(It?.rule,m??{},u??void 0)??void 0,matchers:Ft,globals:Bn,onSelect:aa,onSelectGlobal:ia,schema:ca,formValue:Vo,onChange:ra,formKey:`${f??"none"}:${un}:${Pt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt})})]}),Us=s.jsx("div",{className:oe(q?"px-2":"p-2 pt-3"),children:s.jsx(Ti,{listKey:`${v??""}-${Z}`,rawSections:D,sections:ge,meta:u,decofile:m,selectedIndex:f,onSelect:qo,onReorder:Wo,onDelete:Uo,onDuplicate:Jo,onMakeReusable:ke,onToggleHidden:Yo,onToggleLazy:Qo,onAddVariant:Yt,onDetach:Xo,onAddSection:()=>ye(!0),canAddSection:Ss})}),wa=s.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[v&&X&&s.jsx(Xs,{pageKey:v,initialName:X.name,initialPath:X.path,onFieldChange:fs}),Wt&&v?s.jsx(po,{rawSeo:ln,innerSeo:Tn,defaultResolveType:cs,seoSchema:us,activeResolveType:cn,seoTypeOptions:ls,formResetKey:ss,siteDefaultSeo:ds,onBreadcrumbChange:wt,onPersistRaw:$s,onInnerChange:zs,onClearForm:Hs,onBumpFormKey:Gs}):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),Ra=s.jsx($t,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:Wt&&v?s.jsx(po,{rawSeo:ln,innerSeo:Tn,defaultResolveType:cs,seoSchema:us,activeResolveType:cn,seoTypeOptions:ls,formResetKey:ss,siteDefaultSeo:ds,onBreadcrumbChange:wt,onPersistRaw:$s,onInnerChange:zs,onClearForm:Hs,onBumpFormKey:Gs}):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),Va=s.jsxs($t,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[at&&v&&s.jsx(Zs,{listKey:v,variants:ue,activeIndex:Z,decofile:m??{},meta:u,matchers:Ft,onSelect:On,onReorder:Bs,onRename:ne,onDuplicate:Is,onDelete:Fs,onAdd:Qt}),at&&ie!==null&&s.jsxs("div",{className:oe("px-3 border-b",xe?"pt-3 pb-5 space-y-3":"py-2"),children:[s.jsxs("button",{type:"button",onClick:()=>Ye(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":xe,children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),xe?s.jsx(yr,{className:"size-3.5 shrink-0 text-muted-foreground"}):s.jsx(br,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),xe&&s.jsx("div",{className:oe("space-y-3",Dt&&"pointer-events-none opacity-50"),children:s.jsx(Hn,{currentRt:ie,currentLabel:en(Qe?.rule,m??{},lt,u??void 0),currentGlobalKey:Et(Qe?.rule,m??{},u??void 0)??void 0,matchers:Ft,globals:Bn,onSelect:xs,onSelectGlobal:Es,schema:ys,formValue:Ge,onChange:_s,formKey:`${Z}:${ie??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt})})]}),Us]},"editor-section-list");return s.jsx(lr,{children:s.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!q&&$n&&s.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:$n}),(q||mn.length>1)&&s.jsx(cr,{crumbs:mn,onSelect:zn,onSelectRoot:()=>{on.flush(),$e?$e():zn(0)}}),s.jsx("div",{className:"shrink-0",children:q?s.jsxs("div",{className:oe("flex items-center gap-2 border-b px-3 py-2.5",st&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[q&&$n,st&&s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx("span",{className:"shrink-0 cursor-help",children:s.jsx(_n,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),s.jsx(vt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[s.jsx("span",{className:"truncate text-sm font-semibold",children:ha}),Ks&&s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Ks})]}),Ln&&at&&Qe&&s.jsx(to,{variants:ue,activeIndex:Z,onSelect:On,onManage:_a,onRemoveAll:va}),fa&&s.jsx(to,{variants:bt,activeIndex:un,onSelect:hs,onManage:Ea,onRemoveAll:gs}),Ln&&!at&&s.jsx(vn,{onClick:Qt}),ma&&s.jsx(vn,{onClick:()=>Yt()}),s.jsx(ur,{}),Ln&&s.jsxs(s.Fragment,{children:[s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:xa,children:s.jsx(ao,{size:14})})}),s.jsx(vt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),!He&&s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>we(!0),children:s.jsx(ro,{size:14})})}),s.jsx(vt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):ja}),Ie?s.jsx(no,{onAdd:()=>Yt(),children:Ws},"editor-section-variants"):_t?s.jsxs($t,{viewportRef:le,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!q&&xt&&bt.length>0&&F.length===0&&Ws,s.jsx(so,{activeSchema:Cn,formValue:Ue,formResetKey:Te,onFormChange:ms,onBreadcrumbChange:A,breadcrumbPath:F,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt,previewBaseUrl:je,onRequestAddSection:ps,onVariantMatcherOp:Y?ba:void 0})]},"editor-section-form"):Y?s.jsx($t,{viewportRef:le,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx(so,{activeSchema:Cn,formValue:Ue,formResetKey:Te,onFormChange:ms,onBreadcrumbChange:A,breadcrumbPath:F,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt,previewBaseUrl:je,onRequestAddSection:ps})},"editor-global-block"):B?q?s.jsx($t,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"p-3",children:wa})},"editor-seo"):Ra:P?s.jsx(no,{onAdd:Qt,children:ka},"editor-variants"):q?s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[s.jsx($t,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"py-2",children:Us})}),s.jsx("div",{className:"shrink-0 border-t p-2",children:s.jsx(Zn,{canAddSection:Ss,onAddSection:()=>ye(!0)})})]},"editor-section-list"):Va,s.jsx(dr,{open:ce!==null,onOpenChange:t=>{t||ke(null)},defaultBlockId:ce!==null?yn(ge[ce]?.label??""):"",isPending:J.isPending,onSubmit:oa}),je&&s.jsx(mi,{open:Fe,onOpenChange:t=>{ye(t),t||(be.current=null)},meta:u,decofile:m,previewBaseUrl:je,onSelect:ea}),Ne&&v&&m&&s.jsx(kr,{open:Ne,onOpenChange:we,pageKey:v,decofile:m}),pe!==null&&s.jsx(oo,{open:!0,initialName:At(ue[pe]?.rule,m??{},u??void 0)?en(ue[pe]?.rule,m??{},lt,u??void 0):"",autoLabel:lt(qn(ue[pe]?.rule,m??{},u??void 0)),isPending:Dt,onSubmit:async t=>{await Sa(pe,t)},onOpenChange:t=>{!t&&!Dt&&ne(null)}}),he!==null&&s.jsx(oo,{open:!0,initialName:At(bt[he]?.rule,m??{},u??void 0)?en(bt[he]?.rule,m??{},lt,u??void 0):"",autoLabel:lt(qn(bt[he]?.rule,m??{},u??void 0)),isPending:Dt,onSubmit:async t=>{await ya(he,t)},onOpenChange:t=>{!t&&!Dt&&se(null)}})]})})}export{Lu as SectionsEditor};
|
|
1
|
+
import{c as tn,b as nn,r as E,l as oe,j as s,b1 as Ta,B as Mt,U as zt,au as Na,X as Aa,V as Ma,o as Ca,h as Pa,t as V,K as Da}from"./index-D984WV3U.js";import{u as Ka}from"./chat-context-y8u3K9Tq.js";import{u as En}from"./use-new-blocks-editor-B5DYqQrS.js";import{J as Ba,K as Fa,N as Ia,O as La,Q as Oa,T as za,U as $a,V as Ha,W as Ga,X as Js,Y as qa,Z as Wa,_ as Ct,G as pt,$ as lt,H as yn,E as bn,e as Ua,f as Ja,j as Ya,u as Qa,a0 as Ys,o as Xa,a1 as Za,q as er,n as tr,a2 as nr,p as gn,a3 as sr,a4 as or,C as Qs,a5 as ar,a6 as rr,a7 as vn,a8 as Xs,a9 as Zs,aa as eo,ab as Hn,ac as ir,ad as lr,F as cr,ae as to,af as ur,ag as no,ah as so,M as dr,ai as oo,d as mr,aj as Xt,ak as fr,al as pr,am as Gn,an as hr,ao as gr,ap as vr}from"./runnable-block-editor-v2diysES.js";import{c as Sr}from"./repository-binding-CrIQbyJh.js";import{n as yr,t as br}from"./ChevronUp-D_qU7VrJ.js";import{a6 as So,d as _n,ak as xr,C as _r,$ as ao,K as ro}from"./agent-icon-CsQzAnP1.js";import{S as $t}from"./scroll-area-B9YHNZjL.js";import{b as ht,T as gt,a as vt}from"./tooltip-CfH7_UR9.js";import{m as Er,u as jr,P as kr}from"./mustache-B3B0mlPh.js";import{as as yo,c as es,at as bo,G as wr,au as it,av as Un,aw as xo,ai as At,a6 as Jn,ax as Yn,aj as jt,a7 as Ht,j as Rr,l as Vr,g as Tr,r as Sn,am as Nr,ah as Zt,a8 as qn,ag as Et,af as en,ay as Ar,K as Mr,az as Cr,ak as io,a0 as lo,aA as Pr,aB as Nt,aC as Dr,aD as Kr,aE as Br,aF as co,aG as Fr,aH as Ir,aI as Lr,ae as Or,aJ as zr,aK as $r,aL as Hr,V as Gr,aM as qr,ad as Wr,aN as Ur}from"./claim-phase-copy-kSJ81npa.js";import{a as Jr}from"./Copy01-CT_cEqll.js";import{a as Qn,e as _o}from"./UserSquare-BlSFjBrQ.js";import{i as uo}from"./Tool01-BLdqmAM-.js";import{s as mo}from"./Image01-CyU1b2Nz.js";import{s as Yr}from"./Plus-BzLmRH_e.js";import{s as Qr}from"./Trash01-DkcAHDGj.js";import{i as Xn}from"./ZoomOut-C_NtAfgt.js";import{u as Xr,a as fo,K as Zr,P as ei,b as ti,C as ni,D as si,c as oi}from"./core.esm-BH3HyyF2.js";import{u as ai,s as ri,a as xn,S as ii,v as li}from"./sortable.esm-C4yl7HRk.js";import{a as ci,P as po,b as ui}from"./page-seo-form-BJN0O5_N.js";import{u as di,A as mi}from"./use-section-preview-base-Du6Z-MWu.js";import{b as ho,a as fi}from"./variant-matcher-override-WuIO8MOW.js";import"./use-panel-navigate-B348HV-V.js";import"./thread-route-Dp3ppEkH.js";import"./use-project-scope-CJSvss5q.js";import"./autosend-8ZqTuUx9.js";import"./thread-intent-BouO_OhM.js";import"./use-mcp-client-D8-rDWEf.js";import"./auth-CsAAW7Ar.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-jwr9yBFo.js";import"./task-board-BypYXBtD.js";import"./schema-BMqZTcjW.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-BDPMNEXz.js";import"./use-ai-providers-CeHzBmwD.js";import"./use-chat-navigation-pwxRnoh5.js";import"./location-BjlyegC2.js";import"./use-organization-settings-BEUCQxuY.js";import"./input-C_t2NUbp.js";import"./usage-stats-BcmMK-YO.js";import"./tool-namespace-C5Z8tVC2.js";import"./form-Dm1N7Fdz.js";import"./label-BszVxI8j.js";import"./utils-CVEq3hMx.js";import"./markdown-C8b2SRJt.js";import"./use-copy-COXbZ1Gm.js";import"./use-mobile-Cz-N6vVG.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./XClose-BcQlXPoY.js";import"./icon-button-UzqZkmgc.js";import"./file-type-icon-ClWl2ykw.js";import"./shell-layout-CX2kb4As.js";import"./avatar-Da-P84-z.js";import"./User01-CuJbE_Yd.js";import"./Building02-C5UvSZSt.js";import"./CheckCircle-B1cLRmIj.js";import"./Monitor01-jDiltU3l.js";import"./use-clock-tick-DcGl_y28.js";import"./command-d2fvY4gQ.js";import"./index-ba_EB2Zw.js";import"./SearchMd-X-m-ot0f.js";import"./integration-icon-B4EO_1fi.js";import"./LinkBroken01-CImL6HGl.js";import"./project-icon-DeUPWsC_.js";import"./new-project-dialog-CQomS8HX.js";import"./ArrowLeft-BkyozCr0.js";import"./repository-import-picker-n3EYoF9U.js";import"./use-navigate-to-agent-CWPsHr0w.js";import"./repository-picker-CjDs0ici.js";import"./useInfiniteQuery-BgN51nwo.js";import"./infiniteQueryObserver-Bmwf-SCt.js";import"./collection-search-C-3HPALa.js";import"./ShoppingBag01-C30WMfg1.js";import"./use-debounced-value-BZK5uiHm.js";import"./required-auth-layout-CTKRCLps.js";import"./use-org-sso-BRZ2xqKg.js";import"./chat-draft-RqSOe2VX.js";import"./ArrowUp-C0O7U47F.js";import"./Upload01-CJxfk4_B.js";import"./AlertCircle-CgfWDsMW.js";import"./select-Cmhyur65.js";import"./index-BdQq_4o_.js";import"./index-ChAMt2d-.js";import"./tabs-CJiVz1UY.js";import"./use-deco-credits-COvQvXnV.js";import"./toggle-group-BxPPN08u.js";import"./use-open-billing-url-CHALVI7F.js";import"./index-CeuDCj_w.js";import"./checkbox-cuQOxwwj.js";import"./ChevronSelectorVertical-bEeSv3mr.js";import"./Key01-CV4MPPMx.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-9tPVAoH5.js";import"./drawer-DybzZn1x.js";import"./input-CG0PFhS0.js";import"./suggestion-B9eDgKDC.js";import"./use-chat-layout-state-C4y1ngrz.js";import"./use-file-configs-DoW1VYTz.js";import"./site-slug-DebpOoQq.js";import"./use-mcp-prompts-9xOCFCVM.js";import"./use-org-fs-UdNnQzcG.js";import"./Link01-BL0KHGWk.js";import"./question-004-sINsf4GQ.js";import"./use-members-DuiAoVt0.js";import"./use-org-auth-client-DQ6vSNUo.js";import"./feature-paywall-BN5FphJ8.js";import"./plan-ladder-DUQWM1mB.js";import"./add-connection-dialog-CmVGiYmi.js";import"./extract-connection-data-CIO9f-TD.js";import"./metadata-D72DunRR.js";import"./connection-DGqqVA7M.js";import"./url-slug-D7hdnLPq.js";import"./connection-card-gIhz0wdg.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-C3QvYVs6.js";import"./use-connection-B96BwbcD.js";import"./connection-form-helpers-A2MriNrX.js";import"./authenticate-and-persist-oauth-HfpfV8ZS.js";import"./mcp-oauth--_7bIOac.js";import"./mcp-oauth-BIr9y8Ow.js";import"./collection-tabs-BNpEfqyd.js";import"./badge-CJ5q8uJu.js";import"./use-infinite-scroll-1WuTfkvL.js";import"./useSuspenseInfiniteQuery-DnCmqaG2.js";import"./use-task-board-events-BZPWVwkQ.js";import"./Play-HeD-LWQ6.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-D3dg1naQ.js";import"./collapsible-DEfXG6Ht.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-qrtR9Z1h.js";import"./types-PjheW3sm.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./sheet-bMLuzpcl.js";import"./use-thread-outputs-BaagK6yF.js";import"./utils-DGIwcQET.js";import"./monaco-editor-BmtkWb9u.js";import"./editor-CBqQFFb9.js";import"./calendar-DKYy6uOJ.js";import"./SwitchHorizontal01-iT36Ixqz.js";import"./rich-text-link-control-B2KML_yp.js";import"./switch-D6SJRikA.js";import"./view-mode-toggle-DA847UFd.js";import"./combobox-ylZ1_mxm.js";import"./alert-dialog-D2yDyccd.js";import"./sandbox-url-D3mC8qhT.js";import"./DotsVertical-CGu7Zbqo.js";import"./search-input-BJ-xb_6w.js";import"./asset-utils-cuI-wo7N.js";import"./sandbox-git-api-C7JbVL7R.js";import"./CreditCard01-DFGzM4td.js";import"./Globe04-DtoCZsmb.js";import"./Sun-D5cuTnns.js";import"./Users01-CgCEjxiR.js";import"./section-preview-url-7zfngvgW.js";function pi(d){return d.schema?.definitions??d.schema?.$defs??{}}function Eo(d,e){const c=pi(e),h=c[btoa(d)];if(!h)return[];const g=[h];if(Array.isArray(h.allOf)){const b=h.allOf.find(j=>typeof j.$ref=="string")?.$ref;if(typeof b=="string"){const j=c[b.replace("#/definitions/","")];j&&g.push(j)}}return g}function hi(d,e){for(const c of Eo(d,e)){const h=typeof c.image=="string"?c.image:void 0;if(h?.includes("{{{"))return h}}function gi(d,e){if(!e)return;const c=yo(d);if(!c)return;const h=hi(c.resolveType,e);if(!h)return;const g=Ba(h,c.data);if(g)return Fa(g)}const vi={escape:Ia};function Si(d,e){for(const c of Eo(d,e)){const h=typeof c.title=="string"?c.title:void 0;if(h?.includes("{{"))return h}}function yi(d,e){if(!e)return;const c=yo(d);if(c)try{const h=Si(c.resolveType,e);return h&&Er.render(h,c.data,{},vi).trim()||void 0}catch{return}}function bi(d){const e=tn.c(13),{icon:c,label:h,className:g}=d;let b;e[0]!==g?(b=oe("size-3.5",g),e[0]=g,e[1]=b):b=e[1];let j;e[2]!==c||e[3]!==b?(j=s.jsx(c,{className:b}),e[2]=c,e[3]=b,e[4]=j):j=e[4];let S;e[5]!==h||e[6]!==j?(S=s.jsx(gt,{asChild:!0,children:s.jsx("span",{role:"img","aria-label":h,className:"shrink-0 cursor-help",children:j})}),e[5]=h,e[6]=j,e[7]=S):S=e[7];let N;e[8]!==h?(N=s.jsx(vt,{className:"max-w-56",children:h}),e[8]=h,e[9]=N):N=e[9];let _;return e[10]!==S||e[11]!==N?(_=s.jsxs(ht,{children:[S,N]}),e[10]=S,e[11]=N,e[12]=_):_=e[12],_}const xi="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 go(d){return Array.from({length:d},(e,c)=>({id:crypto.randomUUID(),index:c}))}function jo(d){return d.map((e,c)=>({...e,index:c}))}function _i(d,e){if(e===d.length)return d;if(e<d.length)return jo(d.slice(0,e));const c=Array.from({length:e-d.length},(h,g)=>({id:crypto.randomUUID(),index:d.length+g}));return[...d,...c]}function ko(d){const e=tn.c(44),{section:c,raw:h,meta:g,decofile:b}=d,j=nn(),S=En(),N=c.isSavedBlock===!0,_=c.isMultivariate===!0;let Q;e[0]!==g||e[1]!==h?(Q=h&&g?gi(h,g):void 0,e[0]=g,e[1]=h,e[2]=Q):Q=e[2];const me=Q;let $e;e[3]!==g||e[4]!==_||e[5]!==h||e[6]!==N?($e=h&&g&&!N&&!_?yi(h,g):void 0,e[3]=g,e[4]=_,e[5]=h,e[6]=N,e[7]=$e):$e=e[7];const He=$e;let Pe;e[8]!==b||e[9]!==g||e[10]!==h||e[11]!==c?(Pe=Ga(h,c,b,g),e[8]=b,e[9]=g,e[10]=h,e[11]=c,e[12]=Pe):Pe=e[12];const ae=Pe;let r;e[13]!==_||e[14]!==h?.__resolveType?(r=!_&&es(h?.__resolveType??""),e[13]=_,e[14]=h?.__resolveType,e[15]=r):r=e[15];const T=r,Se=N?_n:_?So:_o;let H;e[16]!==_||e[17]!==N?(H=N?{color:wr}:_?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=_,e[17]=N,e[18]=H):H=e[18];const m=H;let z;e[19]!==Se||e[20]!==S?(z=S?s.jsxs("span",{className:"relative size-4 shrink-0",children:[s.jsx(Se,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),s.jsx(Wa,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):s.jsx(xr,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=Se,e[20]=S,e[21]=z):z=e[21];let u;e[22]!==me?(u=me&&s.jsx("img",{src:me,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=me,e[23]=u):u=e[23];let U;e[24]!==S||e[25]!==m?(U=!S&&s.jsx(Qn,{className:"h-4 w-4 shrink-0",style:m}),e[24]=S,e[25]=m,e[26]=U):U=e[26];const q=S?"shrink":"flex-1",Re=c.isHidden&&"line-through opacity-50";let De;e[27]!==Re||e[28]!==q?(De=oe("min-w-0 truncate text-sm font-medium",q,Re),e[27]=Re,e[28]=q,e[29]=De):De=e[29];const Ze=He??c.label;let je;e[30]!==De||e[31]!==Ze?(je=s.jsx("span",{className:De,children:Ze}),e[30]=De,e[31]=Ze,e[32]=je):je=e[32];let f;e[33]!==T||e[34]!==S||e[35]!==ae||e[36]!==j?(f=S?s.jsxs(s.Fragment,{children:[T&&s.jsx(bi,{icon:Xn,label:j("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),ae&&s.jsx(Js,{}),s.jsx("span",{className:"min-w-0 flex-1"})]}):ae&&s.jsx(Js,{className:"absolute -right-0.5 -top-0.5"}),e[33]=T,e[34]=S,e[35]=ae,e[36]=j,e[37]=f):f=e[37];let M;return e[38]!==je||e[39]!==f||e[40]!==z||e[41]!==u||e[42]!==U?(M=s.jsxs(s.Fragment,{children:[z,u,U,je,f]}),e[38]=je,e[39]=f,e[40]=z,e[41]=u,e[42]=U,e[43]=M):M=e[43],M}const Ei="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",ji="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 wo(d,e,c){if(c)return qa({selected:e});const h=d.isSavedBlock===!0,g=d.isMultivariate===!0;return oe("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":h?Ei:g?ji:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Wn(d,e){return oe("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":d?"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 ki(d){const e=tn.c(90),{section:c,raw:h,meta:g,decofile:b,sortableId:j,selected:S,onSelect:N,onDelete:_,onDuplicate:Q,onMakeReusable:me,onToggleHidden:$e,onToggleLazy:He,onAddVariant:Pe,onDetach:ae}=d,r=nn(),T=En(),Se=h?es(h.__resolveType??""):!1,H=c.isHidden===!0,m=Se||H;let z;e[0]!==c?(z=bo(c),e[0]=c,e[1]=z):z=e[1];const u=z;let U;e[2]!==j?(U={id:j,animateLayoutChanges:Vi},e[2]=j,e[3]=U):U=e[3];const{attributes:q,listeners:Re,setNodeRef:De,transform:Ze,isDragging:je}=ai(U);let f;e[4]!==Ze?(f=ni.Transform.toString(Ze?{...Ze,x:0}:null),e[4]=Ze,e[5]=f):f=e[5];const M=je?0:void 0;let Ue;e[6]!==f||e[7]!==M?(Ue={transform:f,opacity:M},e[6]=f,e[7]=M,e[8]=Ue):Ue=e[8];const C=Ue;let et;e[9]!==c?(et=Oa(c),e[9]=c,e[10]=et):et=e[10];const I=et,St="button",fe=0;let Je;e[11]!==N?(Je=P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),N())},e[11]=N,e[12]=Je):Je=e[12];const kt=je?"cursor-grabbing":"cursor-pointer";let Ge;e[13]!==T||e[14]!==c||e[15]!==S||e[16]!==kt?(Ge=oe("touch-none transition-colors",kt,wo(c,S,T)),e[13]=T,e[14]=c,e[15]=S,e[16]=kt,e[17]=Ge):Ge=e[17];let re;e[18]!==b||e[19]!==g||e[20]!==h||e[21]!==c?(re=s.jsx(ko,{section:c,raw:h,meta:g,decofile:b}),e[18]=b,e[19]=g,e[20]=h,e[21]=c,e[22]=re):re=e[22];const ie=!T&&!c.isMultivariate&&s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"ghost",size:"icon","aria-label":r(Se?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:oe(Wn(m,Se)),onClick:P=>{P.stopPropagation(),He()},onPointerDown:Ri,children:s.jsx(Xn,{className:oe("h-3.5 w-3.5",Se&&"text-warning")})})}),s.jsx(vt,{side:"bottom",children:r(Se?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ke=T?s.jsx(za,{label:r(H?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:H,onToggle:$e,children:H?s.jsx(uo,{className:"h-3.5 w-3.5"}):s.jsx(mo,{className:"h-3.5 w-3.5"})}):s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"ghost",size:"icon","aria-label":r(H?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:oe(Wn(m,H)),onClick:P=>{P.stopPropagation(),$e()},onPointerDown:wi,children:H?s.jsx(uo,{className:"h-3.5 w-3.5"}):s.jsx(mo,{className:"h-3.5 w-3.5"})})}),s.jsx(vt,{side:"bottom",children:r(H?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),F=Aa,A=$a;let le;e[23]!==r?(le=r("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=r,e[24]=le):le=e[24];const Ve=oe(Wn(m,!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 Be;e[25]!==A||e[26]!==le||e[27]!==Ve?(Be=s.jsx(A,{label:le,classicClassName:Ve}),e[25]=A,e[26]=le,e[27]=Ve,e[28]=Be):Be=e[28];let Te;e[29]!==T||e[30]!==Se||e[31]!==He||e[32]!==c.isMultivariate||e[33]!==r?(Te=T&&!c.isMultivariate&&s.jsxs(s.Fragment,{children:[s.jsxs(zt,{onClick:P=>{P.stopPropagation(),He()},children:[s.jsx(Xn,{className:"h-4 w-4"}),r(Se?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),s.jsx(Na,{})]}),e[29]=T,e[30]=Se,e[31]=He,e[32]=c.isMultivariate,e[33]=r,e[34]=Te):Te=e[34];let $;e[35]!==Q?($=P=>{P.stopPropagation(),Q()},e[35]=Q,e[36]=$):$=e[36];let ce;e[37]===Symbol.for("react.memo_cache_sentinel")?(ce=s.jsx(Jr,{className:"h-4 w-4"}),e[37]=ce):ce=e[37];let ke;e[38]!==r?(ke=r("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=r,e[39]=ke):ke=e[39];let pe;e[40]!==$||e[41]!==ke?(pe=s.jsxs(zt,{onClick:$,children:[ce,ke]}),e[40]=$,e[41]=ke,e[42]=pe):pe=e[42];let ne;e[43]!==T||e[44]!==u||e[45]!==Pe||e[46]!==r?(ne=u&&s.jsxs(zt,{className:oe(!T&&Ha),onClick:P=>{P.stopPropagation(),Pe()},children:[s.jsx(So,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=T,e[44]=u,e[45]=Pe,e[46]=r,e[47]=ne):ne=e[47];let he;e[48]!==T||e[49]!==I||e[50]!==me||e[51]!==r?(he=I&&s.jsxs(zt,{className:oe(!T&&xi),onClick:P=>{P.stopPropagation(),me()},children:[T?s.jsx(_n,{className:"h-4 w-4"}):s.jsx(Qn,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=T,e[49]=I,e[50]=me,e[51]=r,e[52]=he):he=e[52];let se;e[53]!==T||e[54]!==ae||e[55]!==c.isMultivariate||e[56]!==c.isSavedBlock||e[57]!==r?(se=c.isSavedBlock===!0&&!c.isMultivariate&&s.jsxs(zt,{onClick:P=>{P.stopPropagation(),ae()},children:[T?s.jsx(_o,{className:"h-4 w-4"}):s.jsx(Qn,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=T,e[54]=ae,e[55]=c.isMultivariate,e[56]=c.isSavedBlock,e[57]=r,e[58]=se):se=e[58];let Fe;e[59]!==_?(Fe=P=>{P.stopPropagation(),_()},e[59]=_,e[60]=Fe):Fe=e[60];let ye;e[61]===Symbol.for("react.memo_cache_sentinel")?(ye=s.jsx(Qr,{className:"h-4 w-4"}),e[61]=ye):ye=e[61];let Ne;e[62]!==r?(Ne=r("sectionsEditor.sectionList.deleteMenuItem"),e[62]=r,e[63]=Ne):Ne=e[63];let we;e[64]!==Fe||e[65]!==Ne?(we=s.jsxs(zt,{variant:"destructive",onClick:Fe,children:[ye,Ne]}),e[64]=Fe,e[65]=Ne,e[66]=we):we=e[66];let be;e[67]!==Te||e[68]!==pe||e[69]!==ne||e[70]!==he||e[71]!==se||e[72]!==we?(be=s.jsxs(Ma,{align:"end",className:"w-44",children:[Te,pe,ne,he,se,we]}),e[67]=Te,e[68]=pe,e[69]=ne,e[70]=he,e[71]=se,e[72]=we,e[73]=be):be=e[73];let xe;e[74]!==F||e[75]!==Be||e[76]!==be?(xe=s.jsxs(F,{children:[Be,be]}),e[74]=F,e[75]=Be,e[76]=be,e[77]=xe):xe=e[77];let Ye;return e[78]!==q||e[79]!==Re||e[80]!==N||e[81]!==De||e[82]!==C||e[83]!==Ge||e[84]!==re||e[85]!==ie||e[86]!==Ke||e[87]!==xe||e[88]!==Je?(Ye=s.jsxs("div",{ref:De,style:C,...q,...Re,role:St,tabIndex:fe,onClick:N,onKeyDown:Je,className:Ge,children:[re,ie,Ke,xe]}),e[78]=q,e[79]=Re,e[80]=N,e[81]=De,e[82]=C,e[83]=Ge,e[84]=re,e[85]=ie,e[86]=Ke,e[87]=xe,e[88]=Je,e[89]=Ye):Ye=e[89],Ye}function wi(d){return d.stopPropagation()}function Ri(d){return d.stopPropagation()}function Vi(){return!1}function Zn(d){const e=tn.c(11),{canAddSection:c,onAddSection:h,className:g,size:b}=d,j=nn();let S;e[0]!==g?(S=oe("w-full",g),e[0]=g,e[1]=S):S=e[1];const N=!c;let _;e[2]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Yr,{size:14}),e[2]=_):_=e[2];let Q;e[3]!==j?(Q=j("sectionsEditor.sectionList.addSectionButton"),e[3]=j,e[4]=Q):Q=e[4];let me;return e[5]!==h||e[6]!==b||e[7]!==S||e[8]!==N||e[9]!==Q?(me=s.jsxs(Mt,{type:"button",variant:"outline",size:b,className:S,disabled:N,onClick:h,children:[_,Q]}),e[5]=h,e[6]=b,e[7]=S,e[8]=N,e[9]=Q,e[10]=me):me=e[10],me}function Ti(d){const e=tn.c(101),{listKey:c,rawSections:h,sections:g,meta:b,decofile:j,selectedIndex:S,onSelect:N,onReorder:_,onDelete:Q,onDuplicate:me,onMakeReusable:$e,onToggleHidden:He,onToggleLazy:Pe,onAddVariant:ae,onDetach:r,onAddSection:T,canAddSection:Se}=d,H=Se===void 0?!0:Se,m=nn(),z=En();let u;e[0]!==g.length?(u=()=>go(g.length),e[0]=g.length,e[1]=u):u=e[1];const[U,q]=E.useState(u),[Re,De]=E.useState(null),[Ze,je]=E.useState(c),[f,M]=E.useState(g.length),Ue=E.useRef(!1);Ze!==c?(je(c),M(g.length),q(go(g.length))):f!==g.length&&(M(g.length),q(Ie=>_i(Ie,g.length)));let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[2]=C):C=e[2];let et;e[3]===Symbol.for("react.memo_cache_sentinel")?(et={coordinateGetter:ri},e[3]=et):et=e[3];const I=Xr(fo(ei,C),fo(Zr,et));let St;e[4]!==U?(St=U.map(Ni),e[4]=U,e[5]=St):St=e[5];const fe=St;let Je;e[6]===Symbol.for("react.memo_cache_sentinel")?(Je=Ie=>{De(String(Ie.active.id))},e[6]=Je):Je=e[6];const kt=Je;let Ge;e[7]!==fe||e[8]!==_?(Ge=Ie=>{De(null);const{active:L,over:B}=Ie;if(!B||L.id===B.id)return;const qe=fe.indexOf(String(L.id)),ot=fe.indexOf(String(B.id));qe===-1||ot===-1||(q(ut=>jo(xn([...ut],qe,ot))),Ue.current=!0,requestAnimationFrame(()=>{Ue.current=!1}),_?.(qe,ot))},e[7]=fe,e[8]=_,e[9]=Ge):Ge=e[9];const re=Ge;let ie;e[10]===Symbol.for("react.memo_cache_sentinel")?(ie=()=>{De(null)},e[10]=ie):ie=e[10];const Ke=ie;let F,A,le,Ve,Be,Te,$,ce,ke,pe,ne,he,se,Fe,ye;if(e[11]!==Re||e[12]!==H||e[13]!==z||e[14]!==j||e[15]!==U||e[16]!==fe||e[17]!==re||e[18]!==b||e[19]!==T||e[20]!==ae||e[21]!==Q||e[22]!==r||e[23]!==me||e[24]!==$e||e[25]!==N||e[26]!==He||e[27]!==Pe||e[28]!==h||e[29]!==g||e[30]!==S||e[31]!==I||e[32]!==m){Fe=Symbol.for("react.early_return_sentinel");e:{const Ie=L=>{Ue.current||N(L)};if(e[48]!==Re||e[49]!==H||e[50]!==z||e[51]!==U||e[52]!==T||e[53]!==h||e[54]!==g||e[55]!==m){const L=Re?U.find(B=>B.id===Re):null;if(Ve=L!=null?g[L.index]:null,le=L!=null?h[L.index]:void 0,U.length===0){let B;e[59]!==m?(B=m("sectionsEditor.sectionList.noSections"),e[59]=m,e[60]=B):B=e[60];let qe;e[61]!==B?(qe=s.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:B}),e[61]=B,e[62]=qe):qe=e[62];const ot=qe;let ut;e[63]!==H||e[64]!==z||e[65]!==ot||e[66]!==T?(ut=z?ot:s.jsxs("div",{className:"space-y-2",children:[ot,s.jsx(Zn,{canAddSection:H,onAddSection:T,size:"sm"})]}),e[63]=H,e[64]=z,e[65]=ot,e[66]=T,e[67]=ut):ut=e[67],Fe=ut;break e}se=oe(L&&"cursor-grabbing"),e[48]=Re,e[49]=H,e[50]=z,e[51]=U,e[52]=T,e[53]=h,e[54]=g,e[55]=m,e[56]=le,e[57]=Ve,e[58]=se}else le=e[56],Ve=e[57],se=e[58];A=si,ce=I,ke=oi,pe=kt,ne=re,he=Ke,F=ii,Te=fe,$=li,ye="space-y-1",Be=U.map(L=>{const B=g[L.index];return B?s.jsx(ki,{sortableId:L.id,section:B,raw:h[L.index],meta:b,decofile:j,selected:S===L.index,onSelect:()=>Ie(L.index),onDelete:()=>Q(L.index),onDuplicate:()=>me(L.index),onMakeReusable:()=>$e(L.index),onToggleHidden:()=>He(L.index),onToggleLazy:()=>Pe(L.index),onAddVariant:()=>ae(L.index),onDetach:()=>r(L.index)},L.id):null})}e[11]=Re,e[12]=H,e[13]=z,e[14]=j,e[15]=U,e[16]=fe,e[17]=re,e[18]=b,e[19]=T,e[20]=ae,e[21]=Q,e[22]=r,e[23]=me,e[24]=$e,e[25]=N,e[26]=He,e[27]=Pe,e[28]=h,e[29]=g,e[30]=S,e[31]=I,e[32]=m,e[33]=F,e[34]=A,e[35]=le,e[36]=Ve,e[37]=Be,e[38]=Te,e[39]=$,e[40]=ce,e[41]=ke,e[42]=pe,e[43]=ne,e[44]=he,e[45]=se,e[46]=Fe,e[47]=ye}else F=e[33],A=e[34],le=e[35],Ve=e[36],Be=e[37],Te=e[38],$=e[39],ce=e[40],ke=e[41],pe=e[42],ne=e[43],he=e[44],se=e[45],Fe=e[46],ye=e[47];if(Fe!==Symbol.for("react.early_return_sentinel"))return Fe;let Ne;e[68]!==Be||e[69]!==ye?(Ne=s.jsx("div",{className:ye,children:Be}),e[68]=Be,e[69]=ye,e[70]=Ne):Ne=e[70];let we;e[71]!==F||e[72]!==Te||e[73]!==$||e[74]!==Ne?(we=s.jsx(F,{items:Te,strategy:$,children:Ne}),e[71]=F,e[72]=Te,e[73]=$,e[74]=Ne,e[75]=we):we=e[75];let be;e[76]!==le||e[77]!==Ve||e[78]!==z||e[79]!==j||e[80]!==b?(be=Ve?s.jsx("div",{className:oe("cursor-grabbing shadow-lg ring-1 ring-border/60",wo(Ve,!1,z)),children:s.jsx(ko,{section:Ve,raw:le,meta:b,decofile:j})}):null,e[76]=le,e[77]=Ve,e[78]=z,e[79]=j,e[80]=b,e[81]=be):be=e[81];let xe;e[82]!==be?(xe=Ta.createPortal(s.jsx(ti,{dropAnimation:La,children:be}),document.body),e[82]=be,e[83]=xe):xe=e[83];let Ye;e[84]!==A||e[85]!==ce||e[86]!==ke||e[87]!==pe||e[88]!==ne||e[89]!==he||e[90]!==we||e[91]!==xe?(Ye=s.jsxs(A,{sensors:ce,collisionDetection:ke,onDragStart:pe,onDragEnd:ne,onDragCancel:he,children:[we,xe]}),e[84]=A,e[85]=ce,e[86]=ke,e[87]=pe,e[88]=ne,e[89]=he,e[90]=we,e[91]=xe,e[92]=Ye):Ye=e[92];let P;e[93]!==H||e[94]!==z||e[95]!==T?(P=!z&&s.jsx(Zn,{canAddSection:H,onAddSection:T,size:"sm",className:"mt-2"}),e[93]=H,e[94]=z,e[95]=T,e[96]=P):P=e[96];let ct;return e[97]!==se||e[98]!==Ye||e[99]!==P?(ct=s.jsxs("div",{className:se,children:[Ye,P]}),e[97]=se,e[98]=Ye,e[99]=P,e[100]=ct):ct=e[100],ct}function Ni(d){return d.id}function vo(d,e,c,h){if(!d||!e)return null;if(!e.isMultivariate)return pt(d,e,h)?.data??null;const g=it(d,e),b=g?Un(g,lt)[c]:void 0;return b?xo(b.value,h)?.data??null:null}const Ai=50;function Mi(d,e){d.own.push(Ct(e)),d.own.length>Ai&&d.own.shift()}function Ci(d,e){return d.own.includes(Ct(e))}function Pi(d,e){const{sectionIndex:c,variantIndex:h,shown:g,next:b,sectionCount:j}=e;return d&&d.sectionIndex===c&&d.variantIndex===h&&d.emitted===g?(d.emitted=b,d):g?{sectionIndex:c,variantIndex:h,base:g,emitted:b,sectionCount:j,own:[Ct(g)]}:null}function Di(d,e){return e!==null&&Ct(d)!==Ct(e)}function Ki(d,e){return d.__resolveType!==e.__resolveType}function Bi(d,e,c,h){if(e.length===h)return"here";const g=Ct(d),b=e.flatMap((j,S)=>S!==c&&j!==null&&Ct(j)===g?[S]:[]);return b.length===1?b[0]:"unknown"}function Fi(d,e,c,h){if(!d||typeof d!="object")return{kind:"error",reason:"no-matcher-rule"};const g=e.trim();if(!g)return At(d,c,h)?{kind:"inline",blockKey:d.__resolveType??"",inlinedRule:Jn(d,c,h)}:{kind:"noop"};const b=Yn(d,c,h);if(!b)return{kind:"error",reason:"unreadable-rule"};if(b.blockKey)return{kind:"updateBlock",blockKey:b.blockKey,blockData:jt(b.resolveType,b.data,g)};const j=yn(g),S=bn(j,c);return S?{kind:"error",reason:"invalid-block-id",message:S}:{kind:"createBlock",blockId:j,blockData:jt(b.resolveType,b.data,g),reference:Ht(j)}}const Ii=3,Li=1e3;function Lu({orgSlug:d,virtualMcpId:e,branch:c,previewReady:h=!0,previewUrl:g,currentPath:b,activePageBlockKey:j=null,activeGlobalBlockKey:S=null,externalSelection:N,onSaved:_,initialEditSeo:Q=!1,onExitSeo:me,onSelectRoot:$e,onViewJsonFile:He,onFocusedBlockChange:Pe,onVariantPreviewOverride:ae}){const r=nn(),T=Ka(),Se=T?.taskId??null,H=h?{orgSlug:d,virtualMcpId:e,branch:c,threadId:Se,previewUrl:g}:null,{data:m,isLoading:z}=Ua(H),{data:u,isLoading:U}=Ja(H),q=En(),Re=T?.virtualMcpId,Ze=Sr(Re===e?e:null)?.metadata?.siteSlug??null,je=di({virtualMcpId:e,sandboxUrl:g}),[f,M]=E.useState(null),[Ue,C]=E.useState(null),[et,I]=E.useState(null),[St,fe]=E.useState(0),[Je,kt]=E.useState(void 0),[Ge,re]=E.useState(null),[ie,Ke]=E.useState(null),[F,A]=E.useState([]),le=E.useRef(null),[Ve,Be]=E.useState(F.length);Ve!==F.length&&(Be(F.length),requestAnimationFrame(()=>{le.current&&(le.current.scrollTop=0)}));const[Te,$]=E.useState(0),[ce,ke]=E.useState(null),[pe,ne]=E.useState(null),[he,se]=E.useState(null),[Fe,ye]=E.useState(!1),[Ne,we]=E.useState(!1),be=E.useRef(null),[xe,Ye]=E.useState(!0),[P,ct]=E.useState(!1),[Ie,L]=E.useState(!1),[B,qe]=E.useState(Q),[ot,ut]=E.useState(Q);Q&&!ot&&(ut(!0),qe(!0),M(null),C(null),I(null),A([])),!Q&&ot&&ut(!1);const[Ro,sn]=E.useState(null),[ts,jn]=E.useState(void 0),[ns,wt]=E.useState([]),[ss,Gt]=E.useState(0),[Le,tt]=E.useState(0),[Vo,Oe]=E.useState(null),[Pt,We]=E.useState(null),[os,as]=E.useState(null),To=Ca(),No=`${d}/${e}/${c}`,on=Ya({orgSlug:d,virtualMcpId:e,branch:c}),[Ao,Mo]=E.useState(b),[Co,Po]=E.useState(j),[Do,Ko]=E.useState(S);(Ao!==b||Co!==j||Do!==S)&&(queueMicrotask(()=>on.flush()),Mo(b),Po(j),Ko(S),M(null),C(null),I(null),fe(0),re(null),Ke(null),tt(0),Oe(null),We(null),A([]),$(t=>t+1),qe(!1),sn(null),jn(void 0),wt([]),Gt(t=>t+1));const J=Qa({orgSlug:d,virtualMcpId:e,branch:c}),qt=mr((t,n)=>{J.mutate({blockKey:t,data:n},{onSuccess:()=>_?.(),onError:o=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})}),an=jr({orgSlug:d,virtualMcpId:e,branch:c}),[Dt,Kt]=E.useState(!1),O=E.useRef(null),kn=E.useRef(null),dt=E.useRef(null),mt=E.useRef(null),wn=E.useRef({}),rn=E.useRef(null),Ae=E.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[rs,Bo]=E.useState(0),[Fo,Io]=E.useState(0),[Lo,Oo]=E.useState(null);if(!h||z||U)return s.jsx("div",{className:"h-full w-full flex items-center justify-center",children:s.jsx(Pa,{className:"size-5 text-muted-foreground"})});if(!m||!u)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const zo=Rr(m),Y=!!S,X=Y?null:Vr(zo,b,j),v=Y?S:X?.key??null,Rn=Y&&S?m[S]:void 0,is=Y&&S&&Rn?Tr(S,Rn):Y&&S?S:"",Wt=!Y&&v&&m[v]?m[v]:null,Vn=B&&m&&u&&v&&X?Ys(m,{kind:"page",pageKey:v,pageName:String(X.name??""),path:String(X.path??"")},u):null,$o=B?Wt?.seo:void 0,ln=ts!==void 0?ts:$o,Ho=B?Xa(ln):void 0,ls=Vn?.seoTypeOptions??[],cs=B&&u?Za(u):"",Tn=Ro??Ho??{},cn=B&&Vn?ci(Tn,Vn):null,us=B&&cn&&er(ln)?Sn(cn,u):null,ds=B?tr(m,u)?.seoData:void 0,ue=Y?[{label:"Default",sections:[{__resolveType:S}]}]:nr(Wt?.sections,m??{}),at=ue.length>1,Z=Math.min(St,ue.length-1),Qe=ue[Z],D=Qe?.sections??[],ge=gn(D,m),Nn=!Y&&Nr(Wt?.sections);if(Y&&S&&os!==S){as(S);const t=D[0],n=ge[0];if(t&&n){M(0),tt(0),A([]);const o=pt(t,n,m);o&&(C(o.data),I(o.resolveType),We(null),Oe(null))}}!Y&&os!==null&&as(null),Ae.current={rawSections:D,parsedSections:ge,decofile:m??{},activePageKey:v,pageVariants:ue,variantIndex:Z,sectionVariantIndex:Le,selectedSectionIndex:f};const Go=()=>({multivariate:Nn,index:Z,variants:ue.map(t=>({rule:t.rule}))}),An=(t,n)=>{if(!ae)return;if(!v||!Nn||t.length<=1){ae(null);return}const o=ho(v,{multivariate:!0,index:n,variants:t},m,u);ae(o.length>0?o:null)},Mn=ae&&v&&Nn&&at&&!z&&!U?v:null;if(Mn!==Lo&&(Oo(Mn),Mn)){const t=ue.map(o=>({rule:o.rule})),n=Z;queueMicrotask(()=>An(t,n))}const Bt=(t,n,o)=>{if(!ae)return;if(!v){ae(null);return}const a=Go(),l=ho(v,a,m,u);if(!t||n<0){ae(l.length>0?l:null);return}const i=fi({pageKey:v,page:a,sectionIndex:n,sectionLazy:ge[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:o,decofile:m,meta:u}),p=[...l,...i];ae(p.length>0?p:null)},ft=(t,n,o,a=f??-1,l=!1)=>{const i=it(t,n);if(!i){C(null),I(null),We(null),Oe(null),l&&Bt(null,a,o);return}const x=Un(i,lt)[o];if(!x){C(null),I(null),We(null),Oe(null),l&&Bt(null,a,o);return}const R=xo(x.value,m);C(R?.data??null),I(R?.resolveType??null);const{resolveType:y,formValue:k}=Zt(x.rule,m,u??void 0);We(y),Oe(k),l&&Bt(i,a,o)},Ut=N?.index;if(N!==void 0&&(N?.seq??null)!==Je&&(kt(N?.seq??null),typeof Ut=="number")){const t=D[Ut],n=ge[Ut];if(t&&n)if(M(Ut),tt(0),A([]),$(o=>o+1),n.isMultivariate)ft(t,n,0,Ut);else{const o=pt(t,n,m);o?(C(o.data),I(o.resolveType)):(C(null),I(null)),We(null),Oe(null)}}if(rs!==Fo){Io(rs);const t=f!==null?D[f]:null,n=f!==null?ge[f]:null;if(t&&n&&f!==null)if(A([]),$(o=>o+1),n.isMultivariate)ft(t,n,Le,f);else{const o=pt(t,n,m??{});C(o?.data??null),I(o?.resolveType??null)}}const Jt={orgSlug:d,virtualMcpId:e,branch:c,threadId:Se,previewUrl:g??void 0,siteSlug:Ze},Cn=et&&u?Sn(et,u):null,nt=(t,n)=>{if(!v)return;O.current&&(clearTimeout(O.current),O.current=null),mt.current&&(clearTimeout(mt.current),mt.current=null),dt.current&&(clearTimeout(dt.current),dt.current=null);const o=Xt(m,v,t,Z,ue);J.mutate({blockKey:v,data:o},{onSuccess:()=>n?.onSuccess?.()??_?.(),onError:a=>{n?.onError?.(),V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))}})},Rt=()=>{Pe?.(null),M(null),L(!1),C(null),I(null),tt(0),Oe(null),We(null),A([]),$(t=>t+1)},Pn=(t=r("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{O.current&&(clearTimeout(O.current),O.current=null),kn.current=null,V.error(t),Bo(n=>n+1)},Dn=(t,n,o=0)=>{const a=Ae.current.sectionVariantIndex,l=rn.current,i=l?.sectionIndex===n&&l.variantIndex===a?l:null,p=kn.current;O.current&&(clearTimeout(O.current),O.current=null,p&&(p.sectionIndex!==n||p.sectionVariantIndex!==a)&&p.write());const x=()=>{const{rawSections:R,parsedSections:y,decofile:k,activePageKey:w,pageVariants:ve,variantIndex:ee}=Ae.current,G=R[n];if(!G)return;const W=y[n];if(!W)return;const te=i?.base,K=vo(G,W,a,k),ze=!!te&&!!K&&Di(te,K)&&!(i&&Ci(i,K));if(ze&&te&&K){if(Ki(te,K)){Pn(r("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const de=W.isSavedBlock?"here":Bi(te,R.map((Ee,Ot)=>vo(Ee,y[Ot],a,k)),n,i?.sectionCount??R.length);if(de==="unknown"){Pn(r("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof de=="number"&&i){i.sectionCount=R.length,i.sectionIndex=de,M(de),Dn(t,de,o);return}}const Xe=[],Me=ze&&te&&K?hr(te,t,K,{prefer:"theirs",conflicts:Xe}):null,Ce=Me??t,rt=!!Me&&rn.current===i&&i?.emitted===t;Xe.length>0?V.warning(r("sectionsEditor.sectionsEditor.formFieldsKeptFromStored",{fields:gr(Xe)})):Me&&V.info(r("sectionsEditor.sectionsEditor.blockMergedWithOthers")),rt&&i&&(i.emitted=Me,C(Me));const Lt=rt||!Me?Ce:t;i&&(i.base=Lt,i.sectionCount=R.length,Mi(i,Lt));const pn={onSuccess:()=>_?.(),onError:de=>{if(i?.base===Lt&&te&&(i.base=te),de instanceof Gr){o<Ii?setTimeout(()=>{const Ee=i?.emitted;Dn(Ee&&typeof Ee=="object"?Ee:t,n,o+1)},Li*2**o):Pn();return}V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:de.message}))}};if(W.isSavedBlock){const de=vr(G,W);if(!de)return;J.mutate({blockKey:de,data:Ce,...te?{base:{value:Me?K:te}}:{},rebaseOnConflict:!1},pn);return}if(!w)return;const hn={...k[w]},Tt=[...R];if(W.isMultivariate){const de=it(G,W);if(!de||!w)return;const Ee=Hr(de,a,Ce);Tt[n]=Nt(G,W,Ee)}else if(W.isHidden){const de=es(G.__resolveType),Ee=de?{...G.section}:{...G},Ot=Array.isArray(Ee.variants)?[...Ee.variants]:[];Ot[0]&&(Ot[0]={...Ot[0],value:Ce}),Ee.variants=Ot,de?Tt[n]={...G,section:Ee}:Tt[n]=Ee}else W.isLazy?Tt[n]={...G,section:Ce}:Tt[n]=Ce;if(ve.length>1){const de=hn.sections,Ee=[...de?.variants??[]];Ee[ee]&&(Ee[ee]={...Ee[ee],value:Tt}),hn.sections={...de,variants:Ee}}else hn.sections=Tt;J.mutate({blockKey:w,data:hn,rebaseOnConflict:!1},pn)};kn.current={sectionIndex:n,sectionVariantIndex:a,write:x},O.current=setTimeout(()=>{O.current=null,x()},Gn)},qo=t=>{M(t),tt(0),A([]),$(l=>l+1);const n=D[t],o=ge[t];if(Pe?.(o?.isSavedBlock?o.resolveType??null:null),!n||!o)return;if(o.isMultivariate){ft(n,o,0,t);return}const a=pt(n,o,m);if(!a){C(null),I(null),We(null),Oe(null),Bt(null,t,0);return}C(a.data),I(a.resolveType),We(null),Oe(null),Bt(null,t,0)},ms=t=>{const n=t;f!==null&&(rn.current=Pi(rn.current,{sectionIndex:f,variantIndex:Ae.current.sectionVariantIndex,shown:Ue,next:n,sectionCount:Ae.current.rawSections.length})),C(n),f!==null&&Dn(n,f)},Kn=t=>{if(!v||!m||!u||!X)return;const n={kind:"page",pageKey:v,pageName:String(X.name??""),path:String(X.path??"")},o=Ys(m,n,u);o&&on.save(v,()=>{const a=To.getQueryData(Da.decofile(No))?.[v];if(!a||typeof a!="object"||a===null||Array.isArray(a))return null;const l={...a,...wn.current};return wn.current={},t?.raw!==void 0?{...l,seo:t.raw}:t?.inner!==void 0?ui(n,o,l,t.inner):l})},fs=(t,n)=>{v&&(wn.current[t]=n,Kn())},Wo=(t,n)=>{if(!v)return;const o=xn([...D],t,n);f!==null&&(f===t?M(n):t<f&&n>=f?M(f-1):t>f&&n<=f&&M(f+1)),nt(o)},Uo=t=>{if(!v)return;const n=D.filter((o,a)=>a!==t);f===t?Rt():f!==null&&f>t&&M(f-1),nt(n)},Jo=t=>{if(!v)return;const n=D[t];if(!n)return;const o=[...D];o.splice(t+1,0,fr(n)),f!==null&&f>t&&M(f+1),nt(o)},Yo=t=>{if(!v)return;const n=D[t],o=ge[t];if(!n||!o)return;const a=o.isHidden?Ir(n):Lr(n);if(!a)return;const l=[...D];l[t]=a,f===t&&Rt(),nt(l)},Qo=t=>{if(!v)return;const n=D[t],o=ge[t];if(!n||!o||o.isMultivariate)return;const a=Fr(n);if(!a)return;const l=[...D];l[t]=a,f===t&&Rt(),nt(l)},Xo=t=>{if(!v)return;const n=D[t],o=ge[t];if(!n||!o?.isSavedBlock)return;const a=pt(n,o,m);if(!a?.data)return;const{name:l,...i}=a.data,p=[...D];o.isLazy?p[t]={...n,section:i}:p[t]=i,f===t&&Rt(),nt(p)},Zo=t=>{if(!v)return;const n=[...D,{__resolveType:t.resolveType}],o=n.length-1;nt(n,{onError:()=>{Ae.current.selectedSectionIndex===o&&Rt()}}),ye(!1),M(o),tt(0),A([]),$(p=>p+1);const a=n[o],l=gn(n,m)[o];if(!a||!l)return;if(l.isMultivariate){ft(a,l,0);return}const i=pt(a,l,m);if(!i){C(null),I(null),We(null),Oe(null);return}C(i.data),I(i.resolveType),We(null),Oe(null)},ps=t=>{be.current=t.append,ye(!0)},ea=t=>{const n=be.current;if(!n){Zo(t);return}n({__resolveType:t.resolveType}),ye(!1),be.current=null},hs=t=>{if(f===null)return;const n=D[f],o=ge[f];!n||!o?.isMultivariate||(tt(t),A([]),$(a=>a+1),ft(n,o,t,f,!0))},ta=t=>{if(f===null||!v)return;const n=D[f],o=ge[f];if(!n||!o?.isMultivariate)return;const a=it(n,o);if(!a)return;const l=Kr(a,t);if(!l){V.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...D];i[f]=Nt(n,o,l);const p=l.variants;let x=Le;t===Le?x=Math.min(t,p.length-1):t<Le&&(x=Le-1),tt(x),A([]),$(R=>R+1),ft(i[f],o,x),nt(i)},na=t=>{if(f===null||!v)return;const n=D[f],o=ge[f];if(!n||!o?.isMultivariate)return;const a=it(n,o);if(!a)return;const l=Br(a,t),i=[...D];i[f]=Nt(n,o,l);const p=t+1;tt(p),A([]),$(x=>x+1),ft(i[f],o,p),nt(i)},sa=(t,n)=>{if(f===null||!v||t===n)return;const o=D[f],a=ge[f];if(!o||!a?.isMultivariate)return;const l=it(o,a);if(!l)return;const i=Pr(l,t,n),p=[...D];p[f]=Nt(o,a,i);let x=Le;Le===t?x=n:t<Le&&n>=Le?x=Le-1:t>Le&&n<=Le&&(x=Le+1),tt(x),ft(p[f],a,x),nt(p)},Yt=t=>{const n=t??f;if(n===null||!v)return;const o=D[n],a=ge[n];if(!o||!a)return;const l=Ar(o,a);if(!l){V.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...D];i[n]=l.section;const p=gn(i,m)[n];if(!p?.isMultivariate){V.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}M(n),tt(l.newVariantIndex),A([]),$(x=>x+1),ft(l.section,p,l.newVariantIndex,n),nt(i)},gs=()=>{if(f===null||!v)return;const t=D[f],n=ge[f];if(!t||!n?.isMultivariate)return;const o=it(t,n);if(!o)return;const a=Dr(t,n,o);if(!a){V.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const l=[...D];l[f]=a;const i=gn(l,m)[f];if(!i)return;tt(0),We(null),Oe(null),A([]),$(x=>x+1);const p=pt(a,i,m);p?(C(p.data),I(p.resolveType)):(C(null),I(null)),Bt(null,f,0),nt(l)},oa=async t=>{if(ce===null||!v)return;const n=bn(t,m);if(n){V.error(n);return}const o=D[ce],a=ge[ce];if(!o||!a)return;const l=pt(o,a,m);if(!l){V.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...l.data,name:t};try{await J.mutateAsync({blockKey:t,data:i});const p=[...D];p[ce]={__resolveType:t},await J.mutateAsync({blockKey:v,data:Xt(m,v,p,Z,ue)}),f===ce&&Rt(),ke(null),V.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),_?.()}catch(p){V.error(p instanceof Error?p.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},vs=Qe?.rule;if(at&&f===null&&ie===null&&vs){const{resolveType:t,formValue:n}=Zt(vs,m??{},u??void 0);Ke(t),re(n)}const Ft=u?sr(u):[],Bn=u&&m?or(u,m):[],Ss=!Y&&!!(je&&u&&m),ys=ie&&u?Sn(ie,u):null,yt=()=>{dt.current&&(clearTimeout(dt.current),dt.current=null),mt.current&&(clearTimeout(mt.current),mt.current=null)},Vt=async(t,n)=>{if(!($r(n,t,u)>0))try{await an.mutateAsync({blockKey:t})}catch(o){V.error(o instanceof Error?o.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},bs=t=>{dt.current&&clearTimeout(dt.current),dt.current=setTimeout(()=>{const{activePageKey:n,decofile:o,variantIndex:a}=Ae.current;if(!n)return;const l={...o[n]},i={...l.sections},p=[...i.variants??[]],x=p[a],R=x?.rule;if(At(R,o,u)){const y=R?.__resolveType??"",k=o[y],w=typeof k?.name=="string"?k.name:y,{__resolveType:ve,...ee}=t;J.mutate({blockKey:y,data:jt(ve??"",ee,w)},{onSuccess:()=>_?.(),onError:G=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}x&&(p[a]={...x,rule:t}),l.sections={...i,variants:p},J.mutate({blockKey:n,data:l},{onSuccess:()=>_?.(),onError:y=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:y.message}))})},Gn)},xs=t=>{Ke(t);const n=t?io(t,u):{__resolveType:lo};re(t?n:{}),bs(n)},_s=t=>{const n=t;re(n);const o=ie?{__resolveType:ie,...n}:{...n};bs(o)},Es=async t=>{yt();const{activePageKey:n,decofile:o,variantIndex:a}=Ae.current;if(!n)return;const l=o[n],i=l?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const p=i;if(!Array.isArray(p.variants))return;const x=[...p.variants],R=x[a];if(!R)return;const y=Et(R.rule,o,u),k=Ht(t);x[a]={...R,rule:k};const w={...o,[n]:{...l,sections:{...p,variants:x}}},{resolveType:ve,formValue:ee}=Zt(k,w,u??void 0);Ke(ve),re(ee);try{await J.mutateAsync({blockKey:n,data:w[n]}),y&&y!==t&&await Vt(y,w),_?.()}catch(G){V.error(G instanceof Error?G.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},js=t=>{mt.current&&clearTimeout(mt.current);const{selectedSectionIndex:n,sectionVariantIndex:o}=Ae.current;n!==null&&(mt.current=setTimeout(()=>{const{rawSections:a,parsedSections:l,decofile:i,activePageKey:p,pageVariants:x,variantIndex:R}=Ae.current;if(!p)return;const y=a[n],k=l[n];if(!y||!k?.isMultivariate)return;const w=it(y,k);if(!w)return;const ee=(w.variants??[])[o]?.rule;if(At(ee,i,u)){const K=ee?.__resolveType??"",ze=i[K],Xe=typeof ze?.name=="string"?ze.name:K,{__resolveType:Me,...Ce}=t;J.mutate({blockKey:K,data:jt(Me??"",Ce,Xe)},{onSuccess:()=>_?.(),onError:rt=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:rt.message}))});return}const G=co(w,o,t),W=[...a];W[n]=Nt(y,k,G);const te=Xt(i,p,W,R,x);J.mutate({blockKey:p,data:te},{onSuccess:()=>_?.(),onError:K=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:K.message}))})},Gn))},aa=t=>{We(t);const n=t?io(t,u):{__resolveType:lo};Oe(t?n:{}),js(n)},ra=t=>{const n=t;Oe(n);const o=Pt?{__resolveType:Pt,...n}:{...n};js(o)},ia=async t=>{yt();const{selectedSectionIndex:n,sectionVariantIndex:o,rawSections:a,parsedSections:l,decofile:i,activePageKey:p,pageVariants:x,variantIndex:R}=Ae.current;if(n===null||!p)return;const y=a[n],k=l[n];if(!y||!k?.isMultivariate)return;const w=it(y,k);if(!w)return;const ve=w.variants??[],ee=Et(ve[o]?.rule,i,u),G=Ht(t),W=co(w,o,G),te=[...a];te[n]=Nt(y,k,W);const K=Xt(i,p,te,R,x),ze={...i,[p]:K},{resolveType:Xe,formValue:Me}=Zt(G,ze,u??void 0);We(Xe),Oe(Me);try{await J.mutateAsync({blockKey:p,data:K}),ee&&ee!==t&&await Vt(ee,ze),_?.()}catch(Ce){V.error(Ce instanceof Error?Ce.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Y&&!X)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.noPageFound",{currentPath:b})});if(Y&&!Rn)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.globalBlockNotFound")});const _e=f!==null?ge[f]??null:null,ks=f!==null?D[f]:null,ws=ks&&_e?.isMultivariate?it(ks,_e):null,bt=ws?Un(ws,lt):[],un=Math.min(Le,Math.max(bt.length-1,0)),It=bt[un]??null,xt=_e?.isMultivariate===!0,Fn=f!==null&&_e!==null,_t=Fn&&(xt||!!(Cn&&Ue)),la=_t&&!Y&&_e?.isSavedBlock===!0,st=Y||la,Rs=Y?is:_e?.label??"",ca=Pt&&u?Sn(Pt,u):null,Vs=(t,n)=>n&&q?`${t} · ${n}`:t,Ts=_e?_e.variantOf??_e.label:"",ua=(()=>{const t=xt&&It?It.label:null;return t?q?[Vs(Ts,t)]:[_e.label,t]:[_e?.label??""]})(),In=Vs(X?.name??"",at?Qe?.label:null),dn=_t&&(!Y||F.length>0)?Y?[is,...F]:[In,...ua,...F]:[],Ns=B&&X?[X.name,"SEO",...ns]:[],As=r("sectionsEditor.pageVariantTabs.variantsLabel"),Ms=P&&X?[X.name,As]:Ie&&X&&_e?[In,Ts,As]:[],mn=Ms.length>0?Ms:Ns.length>0?Ns:st?dn.length>0?dn:[Rs]:dn.length>0?dn:[In],Cs=Fn&&!xt&&!_e?.isHidden&&!!v,da=st||!Y&&at&&!!Qe||Cs,ma=Fn&&!xt&&!Y&&F.length===0&&!!_e&&bo(_e)&&!!v,fa=q&&_t&&!Ie&&xt&&F.length===0&&!!It,Ps=q&&F.length>0?Qs(F[F.length-1]):null,pa=F.length>1?Qs(F[F.length-2]):null,Ds=st?Rs:_t?_e?.label??"":X?.name??"",ha=P||Ie?r("sectionsEditor.pageVariantTabs.variantsLabel"):B?r("sectionsEditor.panelSections.seo"):Ps??Ds,Ks=Ie?_e?.variantOf??_e?.label??"":P||B?X?.name??"":Ps?pa??Ds:st?r("sectionsEditor.sectionsEditor.globalSectionSubtitle"):_t?X?.name??"":X?.path??"",Ln=!P&&!Ie&&!B&&!_t&&!st,ga=!q&&!B&&!Y&&xt&&F.length===0,Qt=()=>{if(!v)return;yt(),O.current&&(clearTimeout(O.current),O.current=null);const t=m[v],n=Mr(t.sections,D);if(!n)return;const o=Cr(n);J.mutate({blockKey:v,data:{...t,sections:n}},{onSuccess:()=>{fe(o),M(null),C(null),I(null),A([]),re(null),Ke(null)},onError:a=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})},fn=(t,n,o)=>{if(!v)return;yt(),O.current&&(clearTimeout(O.current),O.current=null);const a=m[v],l=a.sections;if(!l||typeof l!="object"||Array.isArray(l))return;const i=l;if(!Array.isArray(i.variants))return;const p=t([...i.variants]);if(!p)return;const x=zr(i,p),R={...m,[v]:{...a,sections:x}};J.mutate({blockKey:v,data:R[v]},{onSuccess:()=>{n?.();const y=typeof o=="string"?[o]:o??[];(async()=>{for(const k of y)await Vt(k,R)})()},onError:y=>V.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:y.message}))})},On=t=>{ne(null),fe(t),M(null),C(null),I(null),A([]);const n=ue[t]?.rule,{resolveType:o,formValue:a}=Zt(n,m??{},u??void 0);Ke(o),re(a),An(ue.map(l=>({rule:l.rule})),t)},Bs=(t,n)=>{if(t===n)return;let o=Z;Z===t?o=n:t<Z&&n>=Z?o=Z-1:t>Z&&n<=Z&&(o=Z+1),fe(o);const a=xn(ue.map(l=>({rule:l.rule})),t,n);An(a,o),fn(l=>xn(l,t,n))},Fs=t=>{const n=ue[t]?.rule,o=Et(n,m??{},u??void 0);fn(a=>a.length<=1?null:(a.splice(t,1),a),()=>{ue.length-1===1?fe(0):t<Z?fe(Z-1):t===Z&&fe(Math.max(0,t-1)),M(null),C(null),I(null),A([]),re(null),Ke(null)},o)},va=()=>{const t=ue.map((n,o)=>({variant:n,index:o})).filter(({variant:n})=>!Or(n.rule)).map(({variant:n})=>Et(n.rule,m??{},u??void 0)).filter(n=>!!n);fn(n=>{const o=qr({variants:n}),a=n[o];return a?[{...a,rule:Wr()}]:null},()=>{fe(0),M(null),C(null),I(null),A([]),re(null),Ke(null),ct(!1)},t)},Is=t=>{fn(n=>Ur(n,t),()=>{fe(t+1),M(null),C(null),I(null),A([]),re(null),Ke(null)})},Sa=async(t,n)=>{yt(),O.current&&(clearTimeout(O.current),O.current=null);const o=Ae.current.activePageKey,a=Ae.current.decofile;if(!o)return;const l=a[o],i=l.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const p=i;if(!Array.isArray(p.variants))return;const x=[...p.variants],R=x[t];if(!R?.rule||typeof R.rule!="object"){V.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const y=R.rule,k=n.trim();Kt(!0);try{if(!k){if(!At(y,a,u)){ne(null);return}const te=y.__resolveType??"";x[t]={...R,rule:Jn(y,a,u)};const K={...a,[o]:{...l,sections:{...p,variants:x}}};await J.mutateAsync({blockKey:o,data:K[o]}),await Vt(te,K),ne(null),_?.();return}const w=Yn(y,a,u);if(!w){V.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(w.blockKey){await J.mutateAsync({blockKey:w.blockKey,data:jt(w.resolveType,w.data,k)}),ne(null),_?.();return}const ve=yn(k),ee=bn(ve,a);if(ee){V.error(ee);return}const G=jt(w.resolveType,w.data,k);let W=null;try{await J.mutateAsync({blockKey:ve,data:G}),W=ve,x[t]={...R,rule:Ht(ve)},await J.mutateAsync({blockKey:o,data:{...l,sections:{...p,variants:x}}}),W=null}catch(te){throw W&&await an.mutateAsync({blockKey:W}).catch(()=>{}),te}ne(null),V.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:k})),_?.()}catch(w){V.error(w instanceof Error?w.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Kt(!1)}},ya=async(t,n)=>{yt(),O.current&&(clearTimeout(O.current),O.current=null);const{selectedSectionIndex:o,rawSections:a,parsedSections:l,decofile:i,activePageKey:p,pageVariants:x,variantIndex:R}=Ae.current;if(o===null||!p)return;const y=a[o],k=l[o];if(!y||!k?.isMultivariate)return;const w=it(y,k);if(!w)return;const ve=w.variants??[],ee=ve[t];if(!ee?.rule||typeof ee.rule!="object"){V.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const G=ee.rule,W=n.trim();Kt(!0);const te=async K=>{const ze={...w,variants:K},Xe=[...a];Xe[o]=Nt(y,k,ze);const Me=Xt(i,p,Xe,R,x);return await J.mutateAsync({blockKey:p,data:Me}),{...i,[p]:Me}};try{if(!W){if(!At(G,i,u)){se(null);return}const rt=G.__resolveType??"",Lt=[...ve];Lt[t]={...ee,rule:Jn(G,i,u)};const pn=await te(Lt);await Vt(rt,pn),se(null),_?.();return}const K=Yn(G,i,u);if(!K){V.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(K.blockKey){await J.mutateAsync({blockKey:K.blockKey,data:jt(K.resolveType,K.data,W)}),se(null),_?.();return}const ze=yn(W),Xe=bn(ze,i);if(Xe){V.error(Xe);return}const Me=jt(K.resolveType,K.data,W);let Ce=null;try{await J.mutateAsync({blockKey:ze,data:Me}),Ce=ze;const rt=[...ve];rt[t]={...ee,rule:Ht(ze)},await te(rt),Ce=null}catch(rt){throw Ce&&await an.mutateAsync({blockKey:Ce}).catch(()=>{}),rt}se(null),V.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:W})),_?.()}catch(K){V.error(K instanceof Error?K.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Kt(!1)}},Ls=async(t,n,o)=>{C(o);try{await J.mutateAsync({blockKey:t,data:o})}catch(a){throw C(l=>l===o?n:l),a}},ba={rename:async(t,n,o)=>{yt(),O.current&&(clearTimeout(O.current),O.current=null);const{activePageKey:a,decofile:l}=Ae.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],p=i[n],x=p?.rule&&typeof p.rule=="object"?p.rule:void 0,R=async k=>{const w={...t,variants:k};return await Ls(a,t,w),{...l,[a]:w}},y=Fi(x,o,l,u);if(y.kind!=="noop"){if(y.kind==="error"){V.error(y.reason==="no-matcher-rule"?r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):y.reason==="unreadable-rule"?r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):y.message??r("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}Kt(!0);try{if(y.kind==="inline"){const w=[...i];w[n]={...p,rule:y.inlinedRule};const ve=await R(w);await Vt(y.blockKey,ve),_?.();return}if(y.kind==="updateBlock"){await J.mutateAsync({blockKey:y.blockKey,data:y.blockData}),_?.();return}let k=null;try{await J.mutateAsync({blockKey:y.blockId,data:y.blockData}),k=y.blockId;const w=[...i];w[n]={...p,rule:y.reference},await R(w),k=null}catch(w){throw k&&await an.mutateAsync({blockKey:k}).catch(()=>{}),w}V.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:o.trim()})),_?.()}catch(k){V.error(k instanceof Error?k.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Kt(!1)}}},selectGlobal:async(t,n,o)=>{yt(),O.current&&(clearTimeout(O.current),O.current=null);const{activePageKey:a,decofile:l}=Ae.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],p=i[n];if(!p)return;const x=Et(p.rule,l,u);i[n]={...p,rule:Ht(o)};const R={...t,variants:i},y={...l,[a]:R};try{await Ls(a,t,R),x&&x!==o&&await Vt(x,y),_?.()}catch(k){V.error(k instanceof Error?k.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}}},Os=()=>{Rt()},zs=t=>{sn(t),Kn({inner:t})},$s=t=>{jn(t),Kn({raw:t})},Hs=()=>{sn(null),wt([])},Gs=()=>Gt(t=>t+1),qs=()=>{on.flush(),qe(!1),sn(null),jn(void 0),wt([]),Gt(t=>t+1),me?.()},xa=()=>{ct(!1),L(!1),M(null),qe(!0)},_a=()=>{B&&qs(),M(null),ct(!0)},Ea=()=>L(!0),zn=t=>{if(P&&t===0){ct(!1);return}if(Ie&&t<2){L(!1),t===0&&M(null);return}if(B){if(t===0){qs();return}if(t===1){wt([]),Gt(o=>o+1);return}wt(ns.slice(0,t-1)),Gt(o=>o+1);return}if(Y){A(F.slice(0,t)),$(o=>o+1);return}if(t===0){Os();return}if(t===1){A([]),$(o=>o+1);return}const n=!q&&xt&&It?1:0;if(n===1&&t===2){A([]),$(o=>o+1);return}A(F.slice(0,t-1-n))},$n=mn.length>1?s.jsx("button",{type:"button",onClick:()=>zn(pr(mn.length,{isMultivariateSectionTop:ga})),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:oe("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",st?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:s.jsx(_r,{className:"size-4"})}):null,ja=st||_t||B?da&&s.jsxs("div",{className:oe("border-b px-3 py-2.5",st&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!Y&&at&&Qe&&s.jsxs("button",{type:"button",onClick:Os,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:Qe.label}),className:oe("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",rr),children:[s.jsx(ar,{rule:qn(Qe.rule,m??{},u??void 0),matchers:Ft}),s.jsx("span",{className:"max-w-[160px] truncate",children:Qe.label})]}),s.jsx("div",{className:"flex-1"}),st&&s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx("span",{className:"shrink-0 cursor-help",children:s.jsx(_n,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),s.jsx(vt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Cs&&s.jsx(vn,{onClick:()=>Yt()})]}),st&&s.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:r("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):s.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Xs,{pageKey:v,initialName:X.name,initialPath:X.path,onFieldChange:fs,variant:"header"})}),s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>qe(!0),children:s.jsx(ao,{size:14})})}),s.jsx(vt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>He&&v?He():we(!0),children:s.jsx(ro,{size:14})})}),s.jsx(vt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),s.jsx(vn,{onClick:Qt})]}),ka=s.jsxs(s.Fragment,{children:[at&&v&&s.jsx(Zs,{listKey:v,variants:ue,activeIndex:Z,decofile:m??{},meta:u,matchers:Ft,onSelect:On,onReorder:Bs,onRename:ne,onDuplicate:Is,onDelete:Fs,onAdd:Qt}),at&&ie!==null&&s.jsx(eo,{className:"mt-3",children:s.jsx("div",{className:oe("space-y-3",Dt&&"pointer-events-none opacity-50"),children:s.jsx(Hn,{currentRt:ie,currentLabel:en(Qe?.rule,m??{},lt,u??void 0),currentGlobalKey:Et(Qe?.rule,m??{},u??void 0)??void 0,matchers:Ft,globals:Bn,onSelect:xs,onSelectGlobal:Es,schema:ys,formValue:Ge,onChange:_s,formKey:`${Z}:${ie??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt})})})]}),Ws=s.jsxs(s.Fragment,{children:[s.jsx(ir,{listKey:`${v??""}:${f??""}`,variants:bt.map((t,n)=>({index:n,label:t.label})),selectedIndex:un,onSelect:hs,onRename:se,onDuplicate:na,onDelete:ta,onRemoveAll:gs,onReorder:sa,onAdd:()=>Yt()}),s.jsx(eo,{children:s.jsx(Hn,{currentRt:Pt??"",currentLabel:en(It?.rule,m??{},lt,u??void 0),currentGlobalKey:Et(It?.rule,m??{},u??void 0)??void 0,matchers:Ft,globals:Bn,onSelect:aa,onSelectGlobal:ia,schema:ca,formValue:Vo,onChange:ra,formKey:`${f??"none"}:${un}:${Pt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt})})]}),Us=s.jsx("div",{className:oe(q?"px-2":"p-2 pt-3"),children:s.jsx(Ti,{listKey:`${v??""}-${Z}`,rawSections:D,sections:ge,meta:u,decofile:m,selectedIndex:f,onSelect:qo,onReorder:Wo,onDelete:Uo,onDuplicate:Jo,onMakeReusable:ke,onToggleHidden:Yo,onToggleLazy:Qo,onAddVariant:Yt,onDetach:Xo,onAddSection:()=>ye(!0),canAddSection:Ss})}),wa=s.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[v&&X&&s.jsx(Xs,{pageKey:v,initialName:X.name,initialPath:X.path,onFieldChange:fs}),Wt&&v?s.jsx(po,{rawSeo:ln,innerSeo:Tn,defaultResolveType:cs,seoSchema:us,activeResolveType:cn,seoTypeOptions:ls,formResetKey:ss,siteDefaultSeo:ds,onBreadcrumbChange:wt,onPersistRaw:$s,onInnerChange:zs,onClearForm:Hs,onBumpFormKey:Gs}):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),Ra=s.jsx($t,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:Wt&&v?s.jsx(po,{rawSeo:ln,innerSeo:Tn,defaultResolveType:cs,seoSchema:us,activeResolveType:cn,seoTypeOptions:ls,formResetKey:ss,siteDefaultSeo:ds,onBreadcrumbChange:wt,onPersistRaw:$s,onInnerChange:zs,onClearForm:Hs,onBumpFormKey:Gs}):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),Va=s.jsxs($t,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[at&&v&&s.jsx(Zs,{listKey:v,variants:ue,activeIndex:Z,decofile:m??{},meta:u,matchers:Ft,onSelect:On,onReorder:Bs,onRename:ne,onDuplicate:Is,onDelete:Fs,onAdd:Qt}),at&&ie!==null&&s.jsxs("div",{className:oe("px-3 border-b",xe?"pt-3 pb-5 space-y-3":"py-2"),children:[s.jsxs("button",{type:"button",onClick:()=>Ye(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":xe,children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),xe?s.jsx(yr,{className:"size-3.5 shrink-0 text-muted-foreground"}):s.jsx(br,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),xe&&s.jsx("div",{className:oe("space-y-3",Dt&&"pointer-events-none opacity-50"),children:s.jsx(Hn,{currentRt:ie,currentLabel:en(Qe?.rule,m??{},lt,u??void 0),currentGlobalKey:Et(Qe?.rule,m??{},u??void 0)??void 0,matchers:Ft,globals:Bn,onSelect:xs,onSelectGlobal:Es,schema:ys,formValue:Ge,onChange:_s,formKey:`${Z}:${ie??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt})})]}),Us]},"editor-section-list");return s.jsx(lr,{children:s.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!q&&$n&&s.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:$n}),(q||mn.length>1)&&s.jsx(cr,{crumbs:mn,onSelect:zn,onSelectRoot:()=>{on.flush(),$e?$e():zn(0)}}),s.jsx("div",{className:"shrink-0",children:q?s.jsxs("div",{className:oe("flex items-center gap-2 border-b px-3 py-2.5",st&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[q&&$n,st&&s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx("span",{className:"shrink-0 cursor-help",children:s.jsx(_n,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),s.jsx(vt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[s.jsx("span",{className:"truncate text-sm font-semibold",children:ha}),Ks&&s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Ks})]}),Ln&&at&&Qe&&s.jsx(to,{variants:ue,activeIndex:Z,onSelect:On,onManage:_a,onRemoveAll:va}),fa&&s.jsx(to,{variants:bt,activeIndex:un,onSelect:hs,onManage:Ea,onRemoveAll:gs}),Ln&&!at&&s.jsx(vn,{onClick:Qt}),ma&&s.jsx(vn,{onClick:()=>Yt()}),s.jsx(ur,{}),Ln&&s.jsxs(s.Fragment,{children:[s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:xa,children:s.jsx(ao,{size:14})})}),s.jsx(vt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),!He&&s.jsxs(ht,{children:[s.jsx(gt,{asChild:!0,children:s.jsx(Mt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>we(!0),children:s.jsx(ro,{size:14})})}),s.jsx(vt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):ja}),Ie?s.jsx(no,{onAdd:()=>Yt(),children:Ws},"editor-section-variants"):_t?s.jsxs($t,{viewportRef:le,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!q&&xt&&bt.length>0&&F.length===0&&Ws,s.jsx(so,{activeSchema:Cn,formValue:Ue,formResetKey:Te,onFormChange:ms,onBreadcrumbChange:A,breadcrumbPath:F,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt,previewBaseUrl:je,onRequestAddSection:ps,onVariantMatcherOp:Y?ba:void 0})]},"editor-section-form"):Y?s.jsx($t,{viewportRef:le,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx(so,{activeSchema:Cn,formValue:Ue,formResetKey:Te,onFormChange:ms,onBreadcrumbChange:A,breadcrumbPath:F,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:m,onSaveReferencedBlock:qt,sandbox:Jt,previewBaseUrl:je,onRequestAddSection:ps})},"editor-global-block"):B?q?s.jsx($t,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"p-3",children:wa})},"editor-seo"):Ra:P?s.jsx(no,{onAdd:Qt,children:ka},"editor-variants"):q?s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[s.jsx($t,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"py-2",children:Us})}),s.jsx("div",{className:"shrink-0 border-t p-2",children:s.jsx(Zn,{canAddSection:Ss,onAddSection:()=>ye(!0)})})]},"editor-section-list"):Va,s.jsx(dr,{open:ce!==null,onOpenChange:t=>{t||ke(null)},defaultBlockId:ce!==null?yn(ge[ce]?.label??""):"",isPending:J.isPending,onSubmit:oa}),je&&s.jsx(mi,{open:Fe,onOpenChange:t=>{ye(t),t||(be.current=null)},meta:u,decofile:m,previewBaseUrl:je,onSelect:ea}),Ne&&v&&m&&s.jsx(kr,{open:Ne,onOpenChange:we,pageKey:v,decofile:m}),pe!==null&&s.jsx(oo,{open:!0,initialName:At(ue[pe]?.rule,m??{},u??void 0)?en(ue[pe]?.rule,m??{},lt,u??void 0):"",autoLabel:lt(qn(ue[pe]?.rule,m??{},u??void 0)),isPending:Dt,onSubmit:async t=>{await Sa(pe,t)},onOpenChange:t=>{!t&&!Dt&&ne(null)}}),he!==null&&s.jsx(oo,{open:!0,initialName:At(bt[he]?.rule,m??{},u??void 0)?en(bt[he]?.rule,m??{},lt,u??void 0):"",autoLabel:lt(qn(bt[he]?.rule,m??{},u??void 0)),isPending:Dt,onSubmit:async t=>{await ya(he,t)},onOpenChange:t=>{!t&&!Dt&&se(null)}})]})})}export{Lu as SectionsEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,bu as st,bv as Ne,j as c,bw as rt,bx as Ie,by as L,bz as lt,bA as j,bB as P,bC as $,bD as at,b1 as Ee,bE as Re,bF as it,bG as ct,bH as dt,bI as ut,bJ as pt,bK as ft,bL as mt,bM as ht,bN as vt,bO as gt,bP as xt,bQ as St,c as ee,l as oe,ah as wt}from"./index-CvkEkbZF.js";import{c as Pe}from"./index-BdQq_4o_.js";import{V as yt}from"./index-Dv-VqjPz.js";import{t as je,n as Ct}from"./ChevronUp-DdJdulw6.js";var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=it(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[Nt,G]=ne(J),[Pt,_t]=ne(J),Me=s=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:a,value:r,defaultValue:l,onValueChange:i,dir:u,name:m,autoComplete:g,disabled:w,required:y,form:S}=s,p=pe(e),[v,C]=d.useState(null),[h,x]=d.useState(null),[F,M]=d.useState(!1),se=st(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:a,caller:J}),[U,q]=Ne({prop:r,defaultProp:l,onChange:i,caller:J}),k=d.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return c.jsx(rt,{...p,children:c.jsxs(Nt,{required:y,scope:e,trigger:v,onTriggerChange:C,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:se,triggerPointerDownPosRef:k,disabled:w,children:[c.jsx(de.Provider,{scope:e,children:c.jsx(Pt,{scope:s.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?c.jsxs(et,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:g,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?c.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=J;var Ae="SelectTrigger",Oe=d.forwardRef((s,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=s,a=pe(t),r=G(Ae,t),l=r.disabled||o,i=L(e,r.onTriggerChange),u=ue(t),m=d.useRef("touch"),[g,w,y]=ot(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===r.value),h=nt(v,p,C);h!==void 0&&r.onValueChange(h.value)}),S=p=>{l||(r.onOpenChange(!0),y()),p&&(r.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(lt,{asChild:!0,...a,children:c.jsx(j.button,{type:"button",role:"combobox","aria-controls":r.contentId,"aria-expanded":r.open,"aria-required":r.required,"aria-autocomplete":"none",dir:r.dir,"data-state":r.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":tt(r.value)?"":void 0,...n,ref:i,onClick:P(n.onClick,p=>{p.currentTarget.focus(),m.current!=="mouse"&&S(p)}),onPointerDown:P(n.onPointerDown,p=>{m.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(v&&p.key===" ")&&bt.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",Le=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,children:a,placeholder:r="",...l}=s,i=G(De,t),{onValueNodeHasChildrenChange:u}=i,m=a!==void 0,g=L(e,i.onValueNodeChange);return $(()=>{u(m)},[u,m]),c.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:r}):a})});Le.displayName=De;var Et="SelectIcon",ke=d.forwardRef((s,e)=>{const{__scopeSelect:t,children:o,...n}=s;return c.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=Et;var Rt="SelectPortal",Be=s=>c.jsx(at,{asChild:!0,...s});Be.displayName=Rt;var Q="SelectContent",Ve=d.forwardRef((s,e)=>{const t=G(Q,s.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const a=o;return a?Ee.createPortal(c.jsx(He,{scope:s.__scopeSelect,children:c.jsx(de.Slot,{scope:s.__scopeSelect,children:c.jsx("div",{children:s.children})})}),a):null}return c.jsx(ze,{...s,ref:e})});Ve.displayName=Q;var A=10,[He,Y]=ne(Q),jt="SelectContentImpl",Mt=gt("SelectContent.RemoveScroll"),ze=d.forwardRef((s,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:r,side:l,sideOffset:i,align:u,alignOffset:m,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=s,h=G(Q,t),[x,F]=d.useState(null),[M,se]=d.useState(null),_=L(e,f=>F(f)),[O,U]=d.useState(null),[q,k]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return ut(x)},[x]),pt();const E=d.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===b&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=h;d.useEffect(()=>{if(x){let f={x:0,y:0};const T=b=>{f={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{f.x<=10&&f.y<=10?b.preventDefault():x.contains(b.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=ot(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=nt(T,f,R);b&&setTimeout(()=>b.ref.current.focus())}),me=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&(U(f),b&&(H.current=!0))},[h.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&k(f)},[h.value]),ie=o==="popper"?Se:Fe,re=ie===Se?{side:l,sideOffset:i,align:u,alignOffset:m,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return c.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:se,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:c.jsx(ft,{as:Mt,allowPinchZoom:!0,children:c.jsx(mt,{asChild:!0,trapped:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:c.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:c.jsx(ie,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:f=>f.preventDefault(),...C,...re,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let b=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=b.indexOf(I);b=b.slice(N+1)}setTimeout(()=>E(b)),f.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=s,a=G(Q,t),r=Y(Q,t),[l,i]=d.useState(null),[u,m]=d.useState(null),g=L(e,_=>m(_)),w=ue(t),y=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:h}=r,x=d.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&p&&v&&C){const _=a.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=a.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(a.dir!=="rtl"){const I=q.left-O.left,N=U.left-I,X=_.left-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-U.right-I,X=window.innerWidth-_.right-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const k=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ie=B-te,re=v.offsetHeight/2,f=v.offsetTop+re,T=H+E+f,R=K-T;if(T<=te){const I=k.length>0&&v===k[k.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,re+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=k.length>0&&v===k[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+re)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>y.current=!0)}},[w,a.trigger,a.valueNode,l,u,p,v,C,a.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const se=d.useCallback(_=>{_&&S.current===!0&&(x(),h?.(),S.current=!1)},[x,h]);return c.jsx(Dt,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:se,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:c.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((s,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...a}=s,r=pe(t);return c.jsx(xt,{...r,...a,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Ot;var[Dt,Te]=ne(Q,{}),we="SelectViewport",Ue=d.forwardRef((s,e)=>{const{__scopeSelect:t,nonce:o,...n}=s,a=Y(we,t),r=Te(we,t),l=L(e,a.onViewportChange),i=d.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(de.Slot,{scope:t,children:c.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:P(n.onScroll,u=>{const m=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:w}=r;if(w?.current&&g){const y=Math.abs(i.current-m.scrollTop);if(y>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const h=C+y,x=Math.min(S,h),F=h-x;g.style.height=x+"px",g.style.bottom==="0px"&&(m.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}i.current=m.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[Lt,kt]=ne(We),Bt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Ie();return c.jsx(Lt,{scope:t,id:n,children:c.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=kt(Ke,t);return c.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ce="SelectItem",[Ht,$e]=ne(ce),Ge=d.forwardRef((s,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:a,...r}=s,l=G(ce,t),i=Y(ce,t),u=l.value===o,[m,g]=d.useState(a??""),[w,y]=d.useState(!1),S=L(e,h=>i.itemRefCallback?.(h,o,n)),p=Ie(),v=d.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(h=>{g(x=>x||(h?.textContent??"").trim())},[]),children:c.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:m,children:c.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...r,ref:S,onFocus:P(r.onFocus,()=>y(!0)),onBlur:P(r.onBlur,()=>y(!1)),onClick:P(r.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:P(r.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:P(r.onPointerDown,h=>{v.current=h.pointerType}),onPointerMove:P(r.onPointerMove,h=>{v.current=h.pointerType,n?i.onItemLeave?.():v.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(r.onPointerLeave,h=>{h.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:P(r.onKeyDown,h=>{i.searchRef?.current!==""&&h.key===" "||(It.includes(h.key)&&C(),h.key===" "&&h.preventDefault())})})})})});Ge.displayName=ce;var le="SelectItemText",Ye=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,...a}=s,r=G(le,t),l=Y(le,t),i=$e(le,t),u=_t(le,t),[m,g]=d.useState(null),w=L(e,C=>g(C),i.onItemTextChange,C=>l.itemTextRefCallback?.(C,i.value,i.disabled)),y=m?.textContent,S=d.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:y},i.value),[i.disabled,i.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...a,ref:w}),i.isSelected&&r.valueNode&&!r.valueNodeHasChildren?Ee.createPortal(a.children,r.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return $e(qe,t).isSelected?c.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var ye="SelectScrollUpButton",Ze=d.forwardRef((s,e)=>{const t=Y(ye,s.__scopeSelect),o=Te(ye,s.__scopeSelect),[n,a]=d.useState(!1),r=L(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=i.scrollTop>0;a(u)};const i=t.viewport;return l(),i.addEventListener("scroll",l),()=>i.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:i}=t;l&&i&&(l.scrollTop=l.scrollTop-i.offsetHeight)}}):null});Ze.displayName=ye;var Ce="SelectScrollDownButton",Je=d.forwardRef((s,e)=>{const t=Y(Ce,s.__scopeSelect),o=Te(Ce,s.__scopeSelect),[n,a]=d.useState(!1),r=L(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=i.scrollHeight-i.clientHeight,m=Math.ceil(i.scrollTop)<u;a(m)};const i=t.viewport;return l(),i.addEventListener("scroll",l),()=>i.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:i}=t;l&&i&&(l.scrollTop=l.scrollTop+i.offsetHeight)}}):null});Je.displayName=Ce;var Qe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=s,a=Y("SelectScrollButton",t),r=d.useRef(null),l=ue(t),i=d.useCallback(()=>{r.current!==null&&(window.clearInterval(r.current),r.current=null)},[]);return d.useEffect(()=>()=>i(),[i]),$(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),c.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:P(n.onPointerDown,()=>{r.current===null&&(r.current=window.setInterval(o,50))}),onPointerMove:P(n.onPointerMove,()=>{a.onItemLeave?.(),r.current===null&&(r.current=window.setInterval(o,50))}),onPointerLeave:P(n.onPointerLeave,()=>{i()})})}),zt="SelectSeparator",Ft=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return c.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var be="SelectArrow",Ut=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=pe(t),a=G(be,t),r=Y(be,t);return a.open&&r.position==="popper"?c.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=be;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:s,value:e,...t},o)=>{const n=d.useRef(null),a=L(o,n),r=ct(e);return d.useEffect(()=>{const l=n.current;if(!l)return;const i=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(i,"value").set;if(r!==e&&m){const g=new Event("change",{bubbles:!0});m.call(l,e),l.dispatchEvent(g)}},[r,e]),c.jsx(j.select,{...t,style:{...yt,...t.style},ref:a,defaultValue:e})});et.displayName=Wt;function tt(s){return s===""||s===void 0}function ot(s){const e=dt(s),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(r=>{const l=t.current+r;e(l),(function i(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>i(""),1e3))})(l)},[e]),a=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,a]}function nt(s,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=t?s.indexOf(t):-1;let r=Kt(s,Math.max(a,0));n.length===1&&(r=r.filter(u=>u!==t));const i=r.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==t?i:void 0}function Kt(s,e){return s.map((t,o)=>s[(e+o)%s.length])}var $t=Me,Gt=Oe,Yt=Le,qt=ke,Xt=Be,Zt=Ve,Jt=Ue,Qt=Ge,_e=Ye,eo=Xe,to=Ze,oo=Je;function co(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(s){const e=ee.c(13);let t,o,n,a;e[0]!==s?({className:o,size:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a):(t=e[1],o=e[2],n=e[3],a=e[4]);const r=a===void 0?"default":a;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-[var(--studio-outline-hover-background)] hover:text-accent-foreground flex w-fit items-center justify-between gap-2 rounded-[var(--studio-control-radius,var(--radius-lg))] bg-[var(--studio-input-background)] px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-[var(--studio-control-height,2rem)] data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-[var(--studio-control-radius,var(--radius-lg))] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-4 opacity-50"})}),e[7]=i):i=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==r||e[11]!==l?(u=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":r,className:l,...n,children:[t,i]}),e[8]=t,e[9]=n,e[10]=r,e[11]=l,e[12]=u):u=e[12],u}function fo(s){const e=ee.c(25);let t,o,n,a,r;e[0]!==s?({className:o,children:t,position:a,hideScrollButtons:r,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=a===void 0?"popper":a,i=r===void 0?!1:r,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let m;e[6]!==o||e[7]!==u?(m=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--studio-surface-radius,var(--radius-lg))] border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=m):m=e[8];let g;e[9]!==i?(g=!i&&c.jsx(no,{}),e[9]=i,e[10]=g):g=e[10];const w=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let y;e[11]!==w?(y=oe("p-1",w),e[11]=w,e[12]=y):y=e[12];let S;e[13]!==t||e[14]!==y?(S=c.jsx(Jt,{className:y,children:t}),e[13]=t,e[14]=y,e[15]=S):S=e[15];let p;e[16]!==i?(p=!i&&c.jsx(so,{}),e[16]=i,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==m||e[21]!==g||e[22]!==S||e[23]!==p?(v=c.jsx(Xt,{children:c.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:m,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=m,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function mo(s){const e=ee.c(19);let t,o,n,a,r;e[0]!==s?({className:o,children:t,description:n,hideCheck:r,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=r===void 0?!1:r,i=n&&"items-start py-2";let u;e[6]!==o||e[7]!==i?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",i,o),e[6]=o,e[7]=i,e[8]=u):u=e[8];let m;e[9]!==l?(m=!l&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(wt,{className:"size-4"})})}),e[9]=l,e[10]=m):m=e[10];let g;e[11]!==t||e[12]!==n?(g=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(_e,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(_e,{children:t}),e[11]=t,e[12]=n,e[13]=g):g=e[13];let w;return e[14]!==a||e[15]!==u||e[16]!==m||e[17]!==g?(w=c.jsxs(Qt,{"data-slot":"select-item",className:u,...a,children:[m,g]}),e[14]=a,e[15]=u,e[16]=m,e[17]=g,e[18]=w):w=e[18],w}function no(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(Ct,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}function so(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(je,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}export{co as S,uo as a,po as b,mo as c,fo as d};
|
|
1
|
+
import{r as d,bu as st,bv as Ne,j as c,bw as rt,bx as Ie,by as L,bz as lt,bA as j,bB as P,bC as $,bD as at,b1 as Ee,bE as Re,bF as it,bG as ct,bH as dt,bI as ut,bJ as pt,bK as ft,bL as mt,bM as ht,bN as vt,bO as gt,bP as xt,bQ as St,c as ee,l as oe,ah as wt}from"./index-D984WV3U.js";import{c as Pe}from"./index-BdQq_4o_.js";import{V as yt}from"./index-ChAMt2d-.js";import{t as je,n as Ct}from"./ChevronUp-D_qU7VrJ.js";var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=it(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[Nt,G]=ne(J),[Pt,_t]=ne(J),Me=s=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:a,value:r,defaultValue:l,onValueChange:i,dir:u,name:m,autoComplete:g,disabled:w,required:y,form:S}=s,p=pe(e),[v,C]=d.useState(null),[h,x]=d.useState(null),[F,M]=d.useState(!1),se=st(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:a,caller:J}),[U,q]=Ne({prop:r,defaultProp:l,onChange:i,caller:J}),k=d.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return c.jsx(rt,{...p,children:c.jsxs(Nt,{required:y,scope:e,trigger:v,onTriggerChange:C,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:se,triggerPointerDownPosRef:k,disabled:w,children:[c.jsx(de.Provider,{scope:e,children:c.jsx(Pt,{scope:s.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?c.jsxs(et,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:g,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?c.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=J;var Ae="SelectTrigger",Oe=d.forwardRef((s,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=s,a=pe(t),r=G(Ae,t),l=r.disabled||o,i=L(e,r.onTriggerChange),u=ue(t),m=d.useRef("touch"),[g,w,y]=ot(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===r.value),h=nt(v,p,C);h!==void 0&&r.onValueChange(h.value)}),S=p=>{l||(r.onOpenChange(!0),y()),p&&(r.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(lt,{asChild:!0,...a,children:c.jsx(j.button,{type:"button",role:"combobox","aria-controls":r.contentId,"aria-expanded":r.open,"aria-required":r.required,"aria-autocomplete":"none",dir:r.dir,"data-state":r.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":tt(r.value)?"":void 0,...n,ref:i,onClick:P(n.onClick,p=>{p.currentTarget.focus(),m.current!=="mouse"&&S(p)}),onPointerDown:P(n.onPointerDown,p=>{m.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(v&&p.key===" ")&&bt.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",Le=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,children:a,placeholder:r="",...l}=s,i=G(De,t),{onValueNodeHasChildrenChange:u}=i,m=a!==void 0,g=L(e,i.onValueNodeChange);return $(()=>{u(m)},[u,m]),c.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:r}):a})});Le.displayName=De;var Et="SelectIcon",ke=d.forwardRef((s,e)=>{const{__scopeSelect:t,children:o,...n}=s;return c.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=Et;var Rt="SelectPortal",Be=s=>c.jsx(at,{asChild:!0,...s});Be.displayName=Rt;var Q="SelectContent",Ve=d.forwardRef((s,e)=>{const t=G(Q,s.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const a=o;return a?Ee.createPortal(c.jsx(He,{scope:s.__scopeSelect,children:c.jsx(de.Slot,{scope:s.__scopeSelect,children:c.jsx("div",{children:s.children})})}),a):null}return c.jsx(ze,{...s,ref:e})});Ve.displayName=Q;var A=10,[He,Y]=ne(Q),jt="SelectContentImpl",Mt=gt("SelectContent.RemoveScroll"),ze=d.forwardRef((s,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:r,side:l,sideOffset:i,align:u,alignOffset:m,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=s,h=G(Q,t),[x,F]=d.useState(null),[M,se]=d.useState(null),_=L(e,f=>F(f)),[O,U]=d.useState(null),[q,k]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return ut(x)},[x]),pt();const E=d.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===b&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=h;d.useEffect(()=>{if(x){let f={x:0,y:0};const T=b=>{f={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{f.x<=10&&f.y<=10?b.preventDefault():x.contains(b.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=ot(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=nt(T,f,R);b&&setTimeout(()=>b.ref.current.focus())}),me=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&(U(f),b&&(H.current=!0))},[h.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&k(f)},[h.value]),ie=o==="popper"?Se:Fe,re=ie===Se?{side:l,sideOffset:i,align:u,alignOffset:m,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return c.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:se,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:c.jsx(ft,{as:Mt,allowPinchZoom:!0,children:c.jsx(mt,{asChild:!0,trapped:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:c.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:c.jsx(ie,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:f=>f.preventDefault(),...C,...re,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let b=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=b.indexOf(I);b=b.slice(N+1)}setTimeout(()=>E(b)),f.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=s,a=G(Q,t),r=Y(Q,t),[l,i]=d.useState(null),[u,m]=d.useState(null),g=L(e,_=>m(_)),w=ue(t),y=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:h}=r,x=d.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&p&&v&&C){const _=a.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=a.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(a.dir!=="rtl"){const I=q.left-O.left,N=U.left-I,X=_.left-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-U.right-I,X=window.innerWidth-_.right-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const k=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ie=B-te,re=v.offsetHeight/2,f=v.offsetTop+re,T=H+E+f,R=K-T;if(T<=te){const I=k.length>0&&v===k[k.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,re+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=k.length>0&&v===k[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+re)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>y.current=!0)}},[w,a.trigger,a.valueNode,l,u,p,v,C,a.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const se=d.useCallback(_=>{_&&S.current===!0&&(x(),h?.(),S.current=!1)},[x,h]);return c.jsx(Dt,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:se,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:c.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((s,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...a}=s,r=pe(t);return c.jsx(xt,{...r,...a,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Ot;var[Dt,Te]=ne(Q,{}),we="SelectViewport",Ue=d.forwardRef((s,e)=>{const{__scopeSelect:t,nonce:o,...n}=s,a=Y(we,t),r=Te(we,t),l=L(e,a.onViewportChange),i=d.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(de.Slot,{scope:t,children:c.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:P(n.onScroll,u=>{const m=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:w}=r;if(w?.current&&g){const y=Math.abs(i.current-m.scrollTop);if(y>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const h=C+y,x=Math.min(S,h),F=h-x;g.style.height=x+"px",g.style.bottom==="0px"&&(m.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}i.current=m.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[Lt,kt]=ne(We),Bt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Ie();return c.jsx(Lt,{scope:t,id:n,children:c.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=kt(Ke,t);return c.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ce="SelectItem",[Ht,$e]=ne(ce),Ge=d.forwardRef((s,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:a,...r}=s,l=G(ce,t),i=Y(ce,t),u=l.value===o,[m,g]=d.useState(a??""),[w,y]=d.useState(!1),S=L(e,h=>i.itemRefCallback?.(h,o,n)),p=Ie(),v=d.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(h=>{g(x=>x||(h?.textContent??"").trim())},[]),children:c.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:m,children:c.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...r,ref:S,onFocus:P(r.onFocus,()=>y(!0)),onBlur:P(r.onBlur,()=>y(!1)),onClick:P(r.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:P(r.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:P(r.onPointerDown,h=>{v.current=h.pointerType}),onPointerMove:P(r.onPointerMove,h=>{v.current=h.pointerType,n?i.onItemLeave?.():v.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(r.onPointerLeave,h=>{h.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:P(r.onKeyDown,h=>{i.searchRef?.current!==""&&h.key===" "||(It.includes(h.key)&&C(),h.key===" "&&h.preventDefault())})})})})});Ge.displayName=ce;var le="SelectItemText",Ye=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,...a}=s,r=G(le,t),l=Y(le,t),i=$e(le,t),u=_t(le,t),[m,g]=d.useState(null),w=L(e,C=>g(C),i.onItemTextChange,C=>l.itemTextRefCallback?.(C,i.value,i.disabled)),y=m?.textContent,S=d.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:y},i.value),[i.disabled,i.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...a,ref:w}),i.isSelected&&r.valueNode&&!r.valueNodeHasChildren?Ee.createPortal(a.children,r.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return $e(qe,t).isSelected?c.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var ye="SelectScrollUpButton",Ze=d.forwardRef((s,e)=>{const t=Y(ye,s.__scopeSelect),o=Te(ye,s.__scopeSelect),[n,a]=d.useState(!1),r=L(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=i.scrollTop>0;a(u)};const i=t.viewport;return l(),i.addEventListener("scroll",l),()=>i.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:i}=t;l&&i&&(l.scrollTop=l.scrollTop-i.offsetHeight)}}):null});Ze.displayName=ye;var Ce="SelectScrollDownButton",Je=d.forwardRef((s,e)=>{const t=Y(Ce,s.__scopeSelect),o=Te(Ce,s.__scopeSelect),[n,a]=d.useState(!1),r=L(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=i.scrollHeight-i.clientHeight,m=Math.ceil(i.scrollTop)<u;a(m)};const i=t.viewport;return l(),i.addEventListener("scroll",l),()=>i.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:i}=t;l&&i&&(l.scrollTop=l.scrollTop+i.offsetHeight)}}):null});Je.displayName=Ce;var Qe=d.forwardRef((s,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=s,a=Y("SelectScrollButton",t),r=d.useRef(null),l=ue(t),i=d.useCallback(()=>{r.current!==null&&(window.clearInterval(r.current),r.current=null)},[]);return d.useEffect(()=>()=>i(),[i]),$(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),c.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:P(n.onPointerDown,()=>{r.current===null&&(r.current=window.setInterval(o,50))}),onPointerMove:P(n.onPointerMove,()=>{a.onItemLeave?.(),r.current===null&&(r.current=window.setInterval(o,50))}),onPointerLeave:P(n.onPointerLeave,()=>{i()})})}),zt="SelectSeparator",Ft=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return c.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var be="SelectArrow",Ut=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=pe(t),a=G(be,t),r=Y(be,t);return a.open&&r.position==="popper"?c.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=be;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:s,value:e,...t},o)=>{const n=d.useRef(null),a=L(o,n),r=ct(e);return d.useEffect(()=>{const l=n.current;if(!l)return;const i=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(i,"value").set;if(r!==e&&m){const g=new Event("change",{bubbles:!0});m.call(l,e),l.dispatchEvent(g)}},[r,e]),c.jsx(j.select,{...t,style:{...yt,...t.style},ref:a,defaultValue:e})});et.displayName=Wt;function tt(s){return s===""||s===void 0}function ot(s){const e=dt(s),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(r=>{const l=t.current+r;e(l),(function i(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>i(""),1e3))})(l)},[e]),a=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,a]}function nt(s,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=t?s.indexOf(t):-1;let r=Kt(s,Math.max(a,0));n.length===1&&(r=r.filter(u=>u!==t));const i=r.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==t?i:void 0}function Kt(s,e){return s.map((t,o)=>s[(e+o)%s.length])}var $t=Me,Gt=Oe,Yt=Le,qt=ke,Xt=Be,Zt=Ve,Jt=Ue,Qt=Ge,_e=Ye,eo=Xe,to=Ze,oo=Je;function co(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(s){const e=ee.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(s){const e=ee.c(13);let t,o,n,a;e[0]!==s?({className:o,size:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a):(t=e[1],o=e[2],n=e[3],a=e[4]);const r=a===void 0?"default":a;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-[var(--studio-outline-hover-background)] hover:text-accent-foreground flex w-fit items-center justify-between gap-2 rounded-[var(--studio-control-radius,var(--radius-lg))] bg-[var(--studio-input-background)] px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-[var(--studio-control-height,2rem)] data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-[var(--studio-control-radius,var(--radius-lg))] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-4 opacity-50"})}),e[7]=i):i=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==r||e[11]!==l?(u=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":r,className:l,...n,children:[t,i]}),e[8]=t,e[9]=n,e[10]=r,e[11]=l,e[12]=u):u=e[12],u}function fo(s){const e=ee.c(25);let t,o,n,a,r;e[0]!==s?({className:o,children:t,position:a,hideScrollButtons:r,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=a===void 0?"popper":a,i=r===void 0?!1:r,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let m;e[6]!==o||e[7]!==u?(m=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--studio-surface-radius,var(--radius-lg))] border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=m):m=e[8];let g;e[9]!==i?(g=!i&&c.jsx(no,{}),e[9]=i,e[10]=g):g=e[10];const w=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let y;e[11]!==w?(y=oe("p-1",w),e[11]=w,e[12]=y):y=e[12];let S;e[13]!==t||e[14]!==y?(S=c.jsx(Jt,{className:y,children:t}),e[13]=t,e[14]=y,e[15]=S):S=e[15];let p;e[16]!==i?(p=!i&&c.jsx(so,{}),e[16]=i,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==m||e[21]!==g||e[22]!==S||e[23]!==p?(v=c.jsx(Xt,{children:c.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:m,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=m,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function mo(s){const e=ee.c(19);let t,o,n,a,r;e[0]!==s?({className:o,children:t,description:n,hideCheck:r,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=r):(t=e[1],o=e[2],n=e[3],a=e[4],r=e[5]);const l=r===void 0?!1:r,i=n&&"items-start py-2";let u;e[6]!==o||e[7]!==i?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",i,o),e[6]=o,e[7]=i,e[8]=u):u=e[8];let m;e[9]!==l?(m=!l&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(wt,{className:"size-4"})})}),e[9]=l,e[10]=m):m=e[10];let g;e[11]!==t||e[12]!==n?(g=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(_e,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(_e,{children:t}),e[11]=t,e[12]=n,e[13]=g):g=e[13];let w;return e[14]!==a||e[15]!==u||e[16]!==m||e[17]!==g?(w=c.jsxs(Qt,{"data-slot":"select-item",className:u,...a,children:[m,g]}),e[14]=a,e[15]=u,e[16]=m,e[17]=g,e[18]=w):w=e[18],w}function no(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(Ct,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}function so(s){const e=ee.c(9);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(je,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}export{co as S,uo as a,po as b,mo as c,fo as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as $,b as A,r as R,l as G,j as s,B as H,p as J,v as K,q as Q,D as U}from"./index-
|
|
1
|
+
import{c as $,b as A,r as R,l as G,j as s,B as H,p as J,v as K,q as Q,D as U}from"./index-D984WV3U.js";import{c as V,b as W,a as X,D as Y}from"./drawer-DybzZn1x.js";import{u as Z}from"./use-mobile-Cz-N6vVG.js";import{c as ee}from"./chat-context-y8u3K9Tq.js";import{S as q,a as se,M as le,c as te}from"./index-CeuDCj_w.js";function fe(L){const e=$.c(48),{variant:o,className:t,placeholder:n,model:l,isLoading:I,credentialId:P,onCredentialChange:k,onModelChange:b,filterModels:E}=L,z=o===void 0?"borderless":o,w=n===void 0?"Select model":n,r=A(),[a,S]=R.useState(!1),i=b!==void 0,F=Z(),O=z==="borderless"?"ghost":"outline",_=z==="borderless"&&"md:border-none";let d;e[0]!==t||e[1]!==_?(d=G("text-sm hover:bg-accent py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",_,t),e[0]=t,e[1]=_,e[2]=d):d=e[2];let c;e[3]!==I||e[4]!==l||e[5]!==w||e[6]!==i?(c=i?s.jsx(q,{model:l??null,placeholder:w,isLoading:I}):s.jsx(ne,{placeholder:w}),e[3]=I,e[4]=l,e[5]=w,e[6]=i,e[7]=c):c=e[7];let D;e[8]!==O||e[9]!==d||e[10]!==c?(D=s.jsx(H,{variant:O,size:"sm",className:d,children:c}),e[8]=O,e[9]=d,e[10]=c,e[11]=D):D=e[11];const f=D;let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(se,{}),e[12]=y):y=e[12];let N;e[13]!==P||e[14]!==E||e[15]!==l||e[16]!==k||e[17]!==b||e[18]!==i?(N=s.jsx(R.Suspense,{fallback:y,children:i?s.jsx(le,{onClose:()=>S(!1),credentialId:P??null,onCredentialChange:k??oe,selectedModel:l??null,onModelChange:b,filterModels:E}):s.jsx(te,{onClose:()=>S(!1)})}),e[13]=P,e[14]=E,e[15]=l,e[16]=k,e[17]=b,e[18]=i,e[19]=N):N=e[19];const m=N;if(F){let g;e[20]!==f?(g=s.jsx(V,{asChild:!0,children:f}),e[20]=f,e[21]=g):g=e[21];let j;e[22]!==r?(j=r("chat.selectModel.selectModel"),e[22]=r,e[23]=j):j=e[23];let M;e[24]!==j?(M=s.jsx(W,{className:"sr-only",children:j}),e[24]=j,e[25]=M):M=e[25];let v;e[26]!==m?(v=s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:m}),e[26]=m,e[27]=v):v=e[27];let C;e[28]!==M||e[29]!==v?(C=s.jsxs(X,{className:"p-0 flex flex-col max-h-[95vh]",children:[M,v]}),e[28]=M,e[29]=v,e[30]=C):C=e[30];let T;return e[31]!==a||e[32]!==g||e[33]!==C?(T=s.jsxs(Y,{open:a,onOpenChange:S,children:[g,C]}),e[31]=a,e[32]=g,e[33]=C,e[34]=T):T=e[34],T}let h;e[35]!==f?(h=s.jsx(J,{asChild:!0,children:f}),e[35]=f,e[36]=h):h=e[36];let x;e[37]!==r?(x=r("chat.selectModel.selectModel"),e[37]=r,e[38]=x):x=e[38];let p;e[39]!==x?(p=s.jsx(K,{className:"sr-only",children:x}),e[39]=x,e[40]=p):p=e[40];let u;e[41]!==m||e[42]!==p?(u=s.jsxs(Q,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[p,m]}),e[41]=m,e[42]=p,e[43]=u):u=e[43];let B;return e[44]!==a||e[45]!==h||e[46]!==u?(B=s.jsxs(U,{open:a,onOpenChange:S,children:[h,u]}),e[44]=a,e[45]=h,e[46]=u,e[47]=B):B=e[47],B}function oe(){}function ne(L){const e=$.c(4),{placeholder:o}=L,{selectedModel:t,isModelsLoading:n}=ee();let l;return e[0]!==n||e[1]!==t||e[2]!==o?(l=s.jsx(q,{model:t,placeholder:o,isLoading:n}),e[0]=n,e[1]=t,e[2]=o,e[3]=l):l=e[3],l}export{fe as M};
|