decocms 4.351.3 → 4.351.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-D7GTpU5u.js → AlertCircle-BD4Ehwuv.js} +1 -1
- package/dist/client/assets/{AreaChart-pBkQ8NUM.js → AreaChart-BTLd7pmk.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DOsfcVpQ.js → ArrowLeft-DS5O-nPg.js} +1 -1
- package/dist/client/assets/{ArrowRight-kewb9yfw.js → ArrowRight-CB11uB5G.js} +1 -1
- package/dist/client/assets/{ArrowUp-CrZjSeOw.js → ArrowUp-BFiyUw6W.js} +1 -1
- package/dist/client/assets/{Check-WOdACBHP.js → Check-CUhXORQg.js} +1 -1
- package/dist/client/assets/{CheckCircle-COil-lpa.js → CheckCircle-DceIKHuw.js} +1 -1
- package/dist/client/assets/{ChevronRight-FzrX6Yqi.js → ChevronRight-Ib0VueJf.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BxfSl5d-.js → ChevronSelectorVertical-3_WN5_kz.js} +1 -1
- package/dist/client/assets/{ChevronUp-CrgwCowE.js → ChevronUp-hRy5Y6dA.js} +1 -1
- package/dist/client/assets/{Copy01-C_TzGbsT.js → Copy01-CJc3fzc5.js} +1 -1
- package/dist/client/assets/{CreditCard01-Ca7yOBSx.js → CreditCard01-RbuyzXlw.js} +1 -1
- package/dist/client/assets/{DotsVertical-uAsbz0Xj.js → DotsVertical-D9fs0quN.js} +1 -1
- package/dist/client/assets/{Download01-CI6XdCC7.js → Download01-DvwC8I2w.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-JhutqPTs.js → ErrorBarContext-BX_qU1UV.js} +1 -1
- package/dist/client/assets/{Eye-zsk7RgKS.js → Eye-C75di5qO.js} +1 -1
- package/dist/client/assets/{GitBranch01-CKZOyXBi.js → GitBranch01-CwOiGDey.js} +1 -1
- package/dist/client/assets/{Globe01-e2N2c9MU.js → Globe01-B-Ta7CI6.js} +1 -1
- package/dist/client/assets/{HardDrive-Dc8yQFms.js → HardDrive-Dc4ZUX13.js} +1 -1
- package/dist/client/assets/{Image01-GJm4zGNf.js → Image01-DjADDtfX.js} +1 -1
- package/dist/client/assets/{Key01-BrpZk5jx.js → Key01-jTjGi47C.js} +1 -1
- package/dist/client/assets/{Link01-CFPKetUp.js → Link01-Bf55lOlN.js} +1 -1
- package/dist/client/assets/{LinkExternal01-C_nh_qx5.js → LinkExternal01-C4pu7AaO.js} +1 -1
- package/dist/client/assets/{Monitor01-zLCkt_2U.js → Monitor01-Bl3tMKAt.js} +1 -1
- package/dist/client/assets/{Package-DoDQSR1T.js → Package-CJV1-UUp.js} +1 -1
- package/dist/client/assets/{Palette-ByiCnlRx.js → Palette-D9DE5Eb8.js} +1 -1
- package/dist/client/assets/{Play-CKeSWw6P.js → Play-CQQ0AurK.js} +1 -1
- package/dist/client/assets/{Plus-B_YFqxFl.js → Plus-e4LgHrPK.js} +1 -1
- package/dist/client/assets/{SearchLg-C-hFlHrA.js → SearchLg-DN0F1HdI.js} +1 -1
- package/dist/client/assets/{SearchMd-B7V86Yex.js → SearchMd-Ce3cYdD-.js} +1 -1
- package/dist/client/assets/{Sector-qKKeNNm8.js → Sector-sJ69BKN3.js} +1 -1
- package/dist/client/assets/{Settings02-DfeubPhz.js → Settings02-BWjUwQJb.js} +1 -1
- package/dist/client/assets/{Share07-BknBMTUP.js → Share07-CUGuimFL.js} +1 -1
- package/dist/client/assets/{Shield01-CDyo-oM6.js → Shield01-Bd90NSFN.js} +1 -1
- package/dist/client/assets/{Stars01--dnJhLsV.js → Stars01-IM5cNkdT.js} +1 -1
- package/dist/client/assets/{Sun-DX7SuCd3.js → Sun-Bd7eQ88j.js} +1 -1
- package/dist/client/assets/{Tool01-DR2cJ0xA.js → Tool01-BlgjjpdU.js} +1 -1
- package/dist/client/assets/{Tool02-BX9-C9Hm.js → Tool02-DfO1mWu7.js} +1 -1
- package/dist/client/assets/{Trash01-DFtP5AQV.js → Trash01-uHTzO_Kp.js} +1 -1
- package/dist/client/assets/{TrendUp01-NvHPRoEK.js → TrendUp01-DEqnI6NC.js} +1 -1
- package/dist/client/assets/{Upload01-D_RGpjKA.js → Upload01-BSbk7V4P.js} +1 -1
- package/dist/client/assets/{User01-QVT4OUHF.js → User01-B4Taz9S2.js} +1 -1
- package/dist/client/assets/{UserSquare-CiC2Kuwr.js → UserSquare-6pF99VSX.js} +1 -1
- package/dist/client/assets/{Users01-D31zqd7L.js → Users01-tKH9Db85.js} +1 -1
- package/dist/client/assets/{Users03-DM0idEzv.js → Users03-4uL2zwAj.js} +1 -1
- package/dist/client/assets/{XCircle-BEuyvCpK.js → XCircle-B3f6peLD.js} +1 -1
- package/dist/client/assets/{XClose-ByBViMX2.js → XClose-CoIRwc3C.js} +1 -1
- package/dist/client/assets/{Zap-B_urtRww.js → Zap-BfTXP7i6.js} +1 -1
- package/dist/client/assets/{ZoomOut-Ba1EiaXb.js → ZoomOut-Bvoav6Ew.js} +1 -1
- package/dist/client/assets/{access-gate-CeltO4o7.js → access-gate-CItNVjU5.js} +1 -1
- package/dist/client/assets/{agent-icon-DxzlVMHP.js → agent-icon-CQcUcvve.js} +1 -1
- package/dist/client/assets/{agents-list-BZ7XlSad.js → agents-list-CY7Hq0U5.js} +1 -1
- package/dist/client/assets/{ai-providers-BswyuX2m.js → ai-providers-DNbUDICi.js} +1 -1
- package/dist/client/assets/{alert-dialog-D-cLBTS5.js → alert-dialog-DpiA8C8s.js} +1 -1
- package/dist/client/assets/{alert-B_uPSg2s.js → alert-qtqe4TxD.js} +1 -1
- package/dist/client/assets/{analytics-tab-BCoFiw_G.js → analytics-tab-5CqMFJq7.js} +1 -1
- package/dist/client/assets/{api-keys-XzWDZ60w.js → api-keys-C3qagzHb.js} +1 -1
- package/dist/client/assets/api-keys-KNkovbM_.js +1 -0
- package/dist/client/assets/app-editor-BQBdB_QM.js +1 -0
- package/dist/client/assets/{auth-BSCLV6HR.js → auth-B0Q3AWKa.js} +1 -1
- package/dist/client/assets/{auth-catchall-BsbhzdsT.js → auth-catchall-ZwoSso4m.js} +1 -1
- package/dist/client/assets/{auth-entry-3eDSAOIs.js → auth-entry-ZomZZEkc.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CIdnqM6g.js → auth-split-layout-CX1THvFj.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-C8gF-Uva.js → authenticate-and-persist-oauth-L2eUUanh.js} +1 -1
- package/dist/client/assets/{automation-list-row-CTSkCOuS.js → automation-list-row-D6hZ6N_I.js} +1 -1
- package/dist/client/assets/{automation-runs-B-K-KKIY.js → automation-runs-BdSZGBxD.js} +1 -1
- package/dist/client/assets/{automations-ahIODoBf.js → automations-BHlal6_g.js} +1 -1
- package/dist/client/assets/{autosend-BFlr-CPR.js → autosend-BEuqxEF1.js} +1 -1
- package/dist/client/assets/{avatar-C469vj3f.js → avatar-40AFRZLg.js} +1 -1
- package/dist/client/assets/{badge-DSOp7wJZ.js → badge-CrU7iVuf.js} +1 -1
- package/dist/client/assets/{block-document-BcUNbcIO.js → block-document-zydP5eFo.js} +3 -3
- package/dist/client/assets/{breadcrumb-8cuEhunm.js → breadcrumb-BQA_HhdN.js} +1 -1
- package/dist/client/assets/{buckets-LrOWLwCV.js → buckets-DwYFOj_e.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-D-ZCTF9B.js → bulk-category-panel-lLkDTwbe.js} +1 -1
- package/dist/client/assets/{capability-load-error-FaNcY7K8.js → capability-load-error-DoM21xYu.js} +1 -1
- package/dist/client/assets/{cards-CcTRV1au.js → cards-ChgGMPVL.js} +1 -1
- package/dist/client/assets/{category-editor-C7SQjyOh.js → category-editor-Bv4D6ETh.js} +1 -1
- package/dist/client/assets/{cdn-tab-B1kBK4Kv.js → cdn-tab-NLHaE5JR.js} +1 -1
- package/dist/client/assets/{chart-jmDIBSVe.js → chart-CBqULrhW.js} +1 -1
- package/dist/client/assets/{chat-context-BbDV9BV6.js → chat-context-foSLlJNl.js} +1 -1
- package/dist/client/assets/{checkbox-DqTToLdH.js → checkbox-C7ZJRwhO.js} +1 -1
- package/dist/client/assets/{choose-editor-DnyopiSw.js → choose-editor-zOoSjOtj.js} +1 -1
- package/dist/client/assets/{cli-auth-success-AgHt8h1m.js → cli-auth-success-D3ZB9tDJ.js} +1 -1
- package/dist/client/assets/{client-icons-CiSugsLO.js → client-icons-ByEXfNCg.js} +1 -1
- package/dist/client/assets/{collection-detail-Dwf2LBAV.js → collection-detail-CreoK17B.js} +1 -1
- package/dist/client/assets/{collection-display-button-CvuLfkv2.js → collection-display-button-DPw8CjhH.js} +1 -1
- package/dist/client/assets/{collection-search-Dp1BmkMV.js → collection-search-BuLaB5Nt.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-JQ0eNeQ_.js → collection-table-wrapper-D5fNS8Qv.js} +1 -1
- package/dist/client/assets/{collection-tabs-Bf_jNqrr.js → collection-tabs-Dz6jwhDl.js} +1 -1
- package/dist/client/assets/{command-CQ-Hp2iw.js → command-LWZ4r8Jn.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-D5iZs918.js → commerce-onboarding-Bas5VtxF.js} +1 -1
- package/dist/client/assets/{connect-DDhSj_Lj.js → connect-CAgpie6z.js} +1 -1
- package/dist/client/assets/{connect-layout-uT81yO1S.js → connect-layout-BTbdWkSE.js} +1 -1
- package/dist/client/assets/{connection-BCNJWGbO.js → connection-D-ncxT-9.js} +1 -1
- package/dist/client/assets/{connection-card-CeajMGs5.js → connection-card-IYQHjVFd.js} +1 -1
- package/dist/client/assets/{connection-detail-Daz7WhKK.js → connection-detail-DluHXiIw.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CuUX9hrF.js → connection-form-helpers-CWmILpdf.js} +1 -1
- package/dist/client/assets/{connections-DsXv1Z9u.js → connections-DOjRyJqw.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BREeVd3J.js → create-organization-dialog-ffXFAk4i.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DiXU4pg8.js → decopilot-sse-pool-BZONSf6V.js} +1 -1
- package/dist/client/assets/{dialog-BHWMosDF.js → dialog-DHoQukig.js} +1 -1
- package/dist/client/assets/{domain-settings-D8l38HpT.js → domain-settings-BkGiAPBw.js} +1 -1
- package/dist/client/assets/{drawer-DxpmrE8v.js → drawer-Cn-uFGEW.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BaJBR6n4.js → dropdown-menu-fZhMHO3o.js} +1 -1
- package/dist/client/assets/{e2e-tab-UV-U8L2P.js → e2e-tab-D_mMk7-o.js} +1 -1
- package/dist/client/assets/{editor-C79Kr8tp.js → editor-BXQFpUyX.js} +1 -1
- package/dist/client/assets/{empty-state-DYNE_J_1.js → empty-state-Bribmzrp.js} +1 -1
- package/dist/client/assets/{empty-state-B45S2R-k.js → empty-state-D8otpdEW.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CAMtkd3W.js → extract-connection-data-epPsd6xZ.js} +1 -1
- package/dist/client/assets/{file-explorer-DiLjNC9F.js → file-explorer-C_xUKfYh.js} +1 -1
- package/dist/client/assets/{file-type-icon-DQ1RszhD.js → file-type-icon-BZtV73B-.js} +1 -1
- package/dist/client/assets/{folder-icon-dGq7Jywk.js → folder-icon-DTK_rt9o.js} +1 -1
- package/dist/client/assets/{form-kr0xrNXO.js → form-DxmscRm0.js} +1 -1
- package/dist/client/assets/{general-Bg4Pi6xi.js → general-Cugy_jpI.js} +1 -1
- package/dist/client/assets/{github-icon-Do42C8KD.js → github-icon-7izIvLJY.js} +1 -1
- package/dist/client/assets/{hooks-C2qHMp0K.js → hooks-CdVl8C2_.js} +1 -1
- package/dist/client/assets/{hosting-tab-ns0qJSUE.js → hosting-tab-BTa4aol1.js} +1 -1
- package/dist/client/assets/{index-BMpJX8O0.js → index-407LbEAz.js} +1 -1
- package/dist/client/assets/{index-CLkj-tnL.js → index-BOAqkLju.js} +1 -1
- package/dist/client/assets/{index-DXMX1cpn.js → index-BVgfQ06E.js} +1 -1
- package/dist/client/assets/{index-BtDMAhk0.js → index-B_qo0S8c.js} +1 -1
- package/dist/client/assets/{index-2gWMBbIl.js → index-C1FWhrGF.js} +1 -1
- package/dist/client/assets/{index-B9yJUb21.js → index-CRd2lpW1.js} +1 -1
- package/dist/client/assets/{index-B4kPlQiU.js → index-Cpd5hkp3.js} +1 -1
- package/dist/client/assets/{index-C2gO2iaU.js → index-CzA_DxE-.js} +1 -1
- package/dist/client/assets/{index-BiOXch_9.js → index-Drqimf3D.js} +1 -1
- package/dist/client/assets/{index-CwHQnMKq.js → index-HLLIv__u.js} +42 -42
- package/dist/client/assets/{index-Bli69brb.js → index-mEkmCgyQ.js} +2 -2
- package/dist/client/assets/{index-redirect-IkUQnEJC.js → index-redirect-BdtVNyx_.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Bao230pI.js → infiniteQueryObserver-D4gwR6aT.js} +1 -1
- package/dist/client/assets/{infra-billing-BX8OxHgC.js → infra-billing-BiLycXmr.js} +1 -1
- package/dist/client/assets/{input-Dfp4Tp0D.js → input-CZHjAV-J.js} +1 -1
- package/dist/client/assets/{integration-icon-CMt4RWAE.js → integration-icon-2_lJ7cqC.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-mC0Wqc8j.js → invite-member-dialog-CoJurSgS.js} +1 -1
- package/dist/client/assets/{label-Cju2eBo8.js → label-CsxoBnvt.js} +1 -1
- package/dist/client/assets/{layout-CMPpEaHG.js → layout-Cr30Eo9X.js} +1 -1
- package/dist/client/assets/{login-DIIIWCVW.js → login-DXn430sJ.js} +1 -1
- package/dist/client/assets/{markdown-BEIrXbHA.js → markdown-DYJqw4Y7.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CfCGFNDH.js → mcp-app-renderer-DMitrCab.js} +1 -1
- package/dist/client/assets/{mcp-oauth-B5Cmepg9.js → mcp-oauth-DjFtPYWS.js} +1 -1
- package/dist/client/assets/{members-CaqBh5YA.js → members-BvPUy7KQ.js} +1 -1
- package/dist/client/assets/{monaco-editor-hTpJV8ZO.js → monaco-editor-C5_ftRpi.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-D9NcQv3p.js → monitoring-stats-row-CFOEKYJn.js} +1 -1
- package/dist/client/assets/{multi-select-Zn3HInOp.js → multi-select-DOw2tSk1.js} +1 -1
- package/dist/client/assets/{oauth-callback-DpDhw69H.js → oauth-callback-Cdg8FC1g.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-FfSXi2bE.js → oauth-callback-ai-provider-k6ekxiNL.js} +1 -1
- package/dist/client/assets/{onboarding-CohL7c0q.js → onboarding-B-eg3FzI.js} +1 -1
- package/dist/client/assets/{org-layout-DI6YvHnW.js → org-layout-DeIMU6dJ.js} +1 -1
- package/dist/client/assets/{organization-choice-SH8pG5oz.js → organization-choice-DsS9UtS4.js} +1 -1
- package/dist/client/assets/{orgs-DQmOF6dt.js → orgs-Cfo1_VJo.js} +1 -1
- package/dist/client/assets/page-seo-form-gXG1ggZW.js +1 -0
- package/dist/client/assets/{popover-Byi9ngG5.js → popover-BxPcez1r.js} +1 -1
- package/dist/client/assets/post-calendar-DZ8aW3nu.js +1 -0
- package/dist/client/assets/{post-editor-B9TFh50M.js → post-editor-BumrOR12.js} +1 -1
- package/dist/client/assets/{primitives-B_HTTLKf.js → primitives-DifNIFwZ.js} +1 -1
- package/dist/client/assets/{profile-8LTJf1KC.js → profile-CBf3MR6w.js} +1 -1
- package/dist/client/assets/{project-app-view-BIGxVDCa.js → project-app-view-Cn6cZN-e.js} +1 -1
- package/dist/client/assets/{project-icon-B0VkxhC7.js → project-icon-Luvy1DKq.js} +1 -1
- package/dist/client/assets/{prompts-B2XwsyjA.js → prompts-ByKJ_cVv.js} +1 -1
- package/dist/client/assets/record-editor-COeAunzP.js +1 -0
- package/dist/client/assets/redirect-editor-DGg47Pi6.js +1 -0
- package/dist/client/assets/registry-_u5Fo24a.js +2 -0
- package/dist/client/assets/{registry-layout-SUdnzfsX.js → registry-layout-CqCtHC95.js} +1 -1
- package/dist/client/assets/{reports-DZxISHgY.js → reports-DVjKqVV_.js} +1 -1
- package/dist/client/assets/{repositories-JVgI2xXl.js → repositories-BnHkVGWA.js} +1 -1
- package/dist/client/assets/{repository-import-picker-CwhN144y.js → repository-import-picker-CHRLh3h0.js} +1 -1
- package/dist/client/assets/{repository-picker-TPEh5ZeS.js → repository-picker-sMM9I4tH.js} +1 -1
- package/dist/client/assets/{require-capability-Co8X562i.js → require-capability-B1wosXTl.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BnBK32GG.js → required-auth-layout-BfcH2WaP.js} +1 -1
- package/dist/client/assets/{reset-password-BPet83b7.js → reset-password-CVTDcv1m.js} +1 -1
- package/dist/client/assets/{review-settings-Cps4SM4C.js → review-settings-BA9Xulyu.js} +1 -1
- package/dist/client/assets/{roles-B2Hz4DBC.js → roles-QrF-ucK7.js} +1 -1
- package/dist/client/assets/{schema-2DEGNtDB.js → schema-BBwxBHJW.js} +1 -1
- package/dist/client/assets/{scroll-area-CcuJ1M7l.js → scroll-area-CNDSe7wF.js} +1 -1
- package/dist/client/assets/{search-input-B72yvRx-.js → search-input-C2qtSXhm.js} +1 -1
- package/dist/client/assets/{secrets-C6ZQ9ge9.js → secrets-smzSJEC6.js} +1 -1
- package/dist/client/assets/{sections-editor-Cz1EPxM_.js → sections-editor-CvRTvsPd.js} +2 -2
- package/dist/client/assets/{select-q7bwgVlW.js → select-CbLguDhI.js} +1 -1
- package/dist/client/assets/{select-model-B-t0Omon.js → select-model-C4TTnWHJ.js} +1 -1
- package/dist/client/assets/{self-tool-result-KiqRkZ9E.js → self-tool-result-Dmc-MJCE.js} +1 -1
- package/dist/client/assets/{seo-editor-H9l5Q1ua.js → seo-editor-DxiqoeDo.js} +1 -1
- package/dist/client/assets/settings-layout-BuNhrly0.js +1 -0
- package/dist/client/assets/{settings-sidebar-CXOBWKMw.js → settings-sidebar-CJEljOXs.js} +1 -1
- package/dist/client/assets/{shell-controls-DZhnGiiV.js → shell-controls-DwirkxVE.js} +1 -1
- package/dist/client/assets/{shell-layout-DpNlR09x.js → shell-layout-Bq-tGwBU.js} +1 -1
- package/dist/client/assets/{skill-preview-BnoljyyK.js → skill-preview-CIuWU7Nw.js} +1 -1
- package/dist/client/assets/{skills-DskF3HxQ.js → skills-Ddf5LbGZ.js} +1 -1
- package/dist/client/assets/{sso-DcqypTaq.js → sso-B2hl7p8l.js} +1 -1
- package/dist/client/assets/{store-BDfUDvbY.js → store-C_OpZ05y.js} +1 -1
- package/dist/client/assets/store-registry-qnRXNC07.js +2 -0
- package/dist/client/assets/{switch-CoPmWWmx.js → switch-25j9zQlB.js} +1 -1
- package/dist/client/assets/{synced-repos-C6Qw1HLU.js → synced-repos-CZFAcGtp.js} +1 -1
- package/dist/client/assets/{table-DRHsa37V.js → table-DrdbdRwh.js} +1 -1
- package/dist/client/assets/{tabs-DpGdQrxa.js → tabs-ZOxnjSsA.js} +1 -1
- package/dist/client/assets/{task-board-DpPKcKaR.js → task-board-BHx9zXNG.js} +1 -1
- package/dist/client/assets/{task-route-DEqOXA_E.js → task-route-DiFmkBJF.js} +1 -1
- package/dist/client/assets/{tasks-utK88bYa.js → tasks-DFpk-Rsf.js} +1 -1
- package/dist/client/assets/{textarea-6J7mjd8C.js → textarea-CvmzMdyB.js} +1 -1
- package/dist/client/assets/{thread-intent-DG5KNzB6.js → thread-intent-DTrIT9-4.js} +1 -1
- package/dist/client/assets/{thread-route-fSzBkj9_.js → thread-route-BQ3Tyiss.js} +1 -1
- package/dist/client/assets/{toggle-group-BwBH_M5s.js → toggle-group-DYQwhQaR.js} +1 -1
- package/dist/client/assets/{toolbar-SXqB5mu6.js → toolbar-CFelrcI5.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BM-TgkaV.js → toolbar-icon-button-sDj_3mQn.js} +1 -1
- package/dist/client/assets/{track-_ENcXd80.js → track-KM7IYQ9I.js} +1 -1
- package/dist/client/assets/{types-BmZgcsb-.js → types-Dvdbmqdv.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BK1WEkgv.js → use-ai-providers-BNJWTIAi.js} +1 -1
- package/dist/client/assets/{use-automations-MZy4FwtS.js → use-automations-D_5b7tED.js} +1 -1
- package/dist/client/assets/{use-autosave-BrN6mZHb.js → use-autosave-Ut8GK8k5.js} +1 -1
- package/dist/client/assets/{use-connection-B3u95z7-.js → use-connection-DxplHklY.js} +1 -1
- package/dist/client/assets/{use-copy-B2OPz7ZV.js → use-copy-BTz4ZWfx.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DE4gaWvI.js → use-create-virtual-mcp-C9o9pfco.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-WkIh6xp4.js → use-date-fns-locale-70CVQ3U3.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BSOF20-i.js → use-debounced-autosave-CWwOfVu-.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CoHr5F5x.js → use-debounced-value-CYMpa1LX.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CDgWyOO6.js → use-decopilot-events-1dyZcIvw.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DSNyZSwA.js → use-delete-connection-DPqF7Lj9.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-B8dqqrBE.js → use-deployment-admin-HWGSxPjg.js} +1 -1
- package/dist/client/assets/{use-destination-route-D0pf021a.js → use-destination-route-DEPAwZCV.js} +1 -1
- package/dist/client/assets/{use-file-configs-BVutza5n.js → use-file-configs-CCn7Bt-b.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DFx_Wa9j.js → use-infinite-scroll-D_XtdGUF.js} +1 -1
- package/dist/client/assets/{use-join-requests-BBUu5xdO.js → use-join-requests-zFHFI6vG.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BxON_Lid.js → use-mcp-auth-status-DZMnrNk8.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CV5MugLI.js → use-mcp-client-BNWdeK8c.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-B0CPxUXG.js → use-mcp-prompts-CGnJDO4l.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-G_2Sjdq4.js → use-mcp-tools-CCLGFzAl.js} +1 -1
- package/dist/client/assets/{use-members-DP5AFPI6.js → use-members-DiNuKylV.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-cicMYdPm.js → use-navigate-to-agent-CWiGCrUj.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CO44x0nT.js → use-org-auth-client-BiFxJFF2.js} +1 -1
- package/dist/client/assets/{use-org-notice-DS9fTg09.js → use-org-notice-CKY8gj43.js} +1 -1
- package/dist/client/assets/{use-org-sso-BMECEZqy.js → use-org-sso-Bpie5re1.js} +1 -1
- package/dist/client/assets/{use-organization-roles-D9omOb8s.js → use-organization-roles-D-SsKuOr.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Cqm27voU.js → use-organization-settings-DzpGFT0-.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-C3CvXZBJ.js → use-panel-navigate-YeHpiZRs.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BGtFCFtR.js → use-registry-connections-3nGcPcNL.js} +1 -1
- package/dist/client/assets/{use-secrets-CCa_RsgT.js → use-secrets-BtC1D0xM.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-ChXTpr83.js → use-section-preview-base-_PInq-ho.js} +1 -1
- package/dist/client/assets/{use-status-sounds-D9voeIk1.js → use-status-sounds-BTH1A_aQ.js} +1 -1
- package/dist/client/assets/{use-tags-6BqFWDu5.js → use-tags-BbFV3F9t.js} +1 -1
- package/dist/client/assets/{use-view-mode-f2oWvk5H.js → use-view-mode-BnLqmimv.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DYf9pXPl.js → use-virtual-mcp-BLvX-qkO.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-riEiBpsB.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BWopWYpr.js +1 -0
- package/dist/client/assets/{users-Bc-PxIzK.js → users-DoSmgFvG.js} +1 -1
- package/dist/client/assets/{variant-calendar-Aop8gvE4.js → variant-calendar-Dj3bNBhN.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CJROazA3.js → view-mode-toggle-CKTuIKV8.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/api-keys-cSXb7MiL.js +0 -1
- package/dist/client/assets/app-editor-CeqsbL6e.js +0 -1
- package/dist/client/assets/page-seo-form-D9Kysi3K.js +0 -1
- package/dist/client/assets/post-calendar-J9OZi_gA.js +0 -1
- package/dist/client/assets/record-editor-DVM4-TVb.js +0 -1
- package/dist/client/assets/redirect-editor-Bj1zW7U7.js +0 -1
- package/dist/client/assets/registry-DGnMy9Lw.js +0 -2
- package/dist/client/assets/settings-layout-C_7p05jt.js +0 -1
- package/dist/client/assets/store-registry-vaZqYWDt.js +0 -2
- package/dist/client/assets/useInfiniteQuery-9j5iAQTS.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DDBa8Qsp.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as st,b as Vt,r as R,l as Ue,j as n,aB as es,B as tt,a4 as wt,a1 as kt,a2 as Tt,h as ts,n as Ma,t as q,K as Ka}from"./index-Bli69brb.js";import{b as La}from"./chat-context-BbDV9BV6.js";import{a7 as ns,a8 as Ba,a9 as Ia,aa as Oa,N as ss,O as Zt,ab as as,ac as os,P as is,Q as rs,ad as ls,ae as Fa,_ as cs,$ as us,af as $a,ag as za,ah as ds,G as Ha,U as ms,V as Lt,Y as fs,Z as ps,W as gs,a4 as hs,ai as Ua,aj as Bt,ak as vs,al as Ga,am as qa,an as Wa,ao as Ya,ap as Ja,d as Qa,e as Za,aq as Xa,ar as eo,as as to,at as no,au as In,av as so,aw as ao,ax as oo,a2 as qt,ay as io,az as ro,aA as Wt,aB as lo,aC as bt,aD as Ct,aE as co,aF as uo,aG as nt,aH as On,aI as mo,g as fo,aJ as Fn,aK as po,aL as go,aM as Mt,aN as Yt,aO as $n,aP as ho,aQ as hn,aR as vo,aS as ht,aT as Et,aU as zn,aV as So,aW as bo,aX as yo,aY as xo,aZ as _o,a_ as yt,a$ as jo,b0 as Eo,b1 as Ro,i as wo,b2 as Hn,b3 as Kt,b4 as Un,b5 as Gn,b6 as ko,b7 as To,b8 as Vo,b9 as Do,ba as vn,bb as qn,bc as Wn,bd as Rt,be as Jt,bf as No,bg as Sn,bh as Ao,bi as Po,bj as Co,bk as Mo,bl as Ko,bm as Lo}from"./index-CwHQnMKq.js";import{n as Bo,t as Io}from"./ChevronUp-CrgwCowE.js";import{al as yn,B as Oo,a3 as Ss,F as Fo,z as $o,ax as zo,w as Ho}from"./agent-icon-DxzlVMHP.js";import{i as Uo}from"./ChevronRight-FzrX6Yqi.js";import{i as Go}from"./Globe01-e2N2c9MU.js";import{S as Qt}from"./scroll-area-CcuJ1M7l.js";import{d as qo,h as Wo,c as Yo,e as Jo,b as Qo,D as Zo}from"./dialog-BHWMosDF.js";import{I as Xo}from"./input-Dfp4Tp0D.js";import{a as bs}from"./Copy01-C_TzGbsT.js";import{i as ei}from"./Settings02-DfeubPhz.js";import{s as ti}from"./Eye-zsk7RgKS.js";import{s as ni}from"./TrendUp01-NvHPRoEK.js";import{s as xn}from"./Plus-B_YFqxFl.js";import{s as ys}from"./Trash01-DFtP5AQV.js";import{i as si}from"./Zap-B_urtRww.js";import{D as xs,a as vt,c as _s,b as js,i as ai}from"./dropdown-menu-BaJBR6n4.js";import{s as oi}from"./safe-image-url-D5z803Ot.js";import{a as ii,P as ri,b as li}from"./page-seo-form-D9Kysi3K.js";import{a as ci}from"./Tool01-DR2cJ0xA.js";import{u as ui,A as di}from"./use-section-preview-base-ChXTpr83.js";import"./use-panel-navigate-C3CvXZBJ.js";import"./use-destination-route-D0pf021a.js";import"./autosend-BFlr-CPR.js";import"./thread-intent-DG5KNzB6.js";import"./slugify-CEUa2lfQ.js";import"./hooks-C2qHMp0K.js";import"./use-mcp-client-CV5MugLI.js";import"./auth-BSCLV6HR.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DiXU4pg8.js";import"./task-board-DpPKcKaR.js";import"./schema-2DEGNtDB.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-DYf9pXPl.js";import"./use-ai-providers-BK1WEkgv.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-CDgWyOO6.js";import"./thread-route-fSzBkj9_.js";import"./Check-WOdACBHP.js";import"./Download01-CI6XdCC7.js";import"./use-organization-settings-Cqm27voU.js";import"./ArrowUp-CrZjSeOw.js";import"./automation-runs-B-K-KKIY.js";import"./useInfiniteQuery-9j5iAQTS.js";import"./infiniteQueryObserver-Bao230pI.js";import"./use-connection-B3u95z7-.js";import"./table-DRHsa37V.js";import"./empty-state-B45S2R-k.js";import"./use-infinite-scroll-DFx_Wa9j.js";import"./use-members-DP5AFPI6.js";import"./use-org-auth-client-CO44x0nT.js";import"./AlertCircle-D7GTpU5u.js";import"./CheckCircle-COil-lpa.js";import"./DotsVertical-uAsbz0Xj.js";import"./XCircle-BEuyvCpK.js";import"./use-automations-MZy4FwtS.js";import"./useSuspenseInfiniteQuery-DDBa8Qsp.js";import"./avatar-C469vj3f.js";import"./User01-QVT4OUHF.js";import"./Tool02-BX9-C9Hm.js";import"./Stars01--dnJhLsV.js";import"./ArrowRight-kewb9yfw.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-copy-B2OPz7ZV.js";import"./markdown-BEIrXbHA.js";import"./ZoomOut-Ba1EiaXb.js";import"./monaco-editor-hTpJV8ZO.js";import"./editor-C79Kr8tp.js";import"./mcp-app-renderer-CfCGFNDH.js";import"./types-BmZgcsb-.js";import"./XClose-ByBViMX2.js";import"./Share07-BknBMTUP.js";import"./SearchMd-B7V86Yex.js";import"./shell-layout-DpNlR09x.js";import"./Users03-DM0idEzv.js";import"./SearchLg-C-hFlHrA.js";import"./project-icon-B0VkxhC7.js";import"./github-repo-CTPv5ZM2.js";import"./source-system-tabs-CnEGUb4r.js";import"./Monitor01-zLCkt_2U.js";import"./command-CQ-Hp2iw.js";import"./index-B4kPlQiU.js";import"./required-auth-layout-BnBK32GG.js";import"./use-org-sso-BMECEZqy.js";import"./use-org-notice-DS9fTg09.js";import"./Image01-GJm4zGNf.js";import"./LinkExternal01-C_nh_qx5.js";import"./integration-icon-CMt4RWAE.js";import"./Palette-ByiCnlRx.js";import"./use-navigate-to-agent-cicMYdPm.js";import"./Link01-CFPKetUp.js";import"./use-mcp-prompts-B0CPxUXG.js";import"./form-kr0xrNXO.js";import"./label-Cju2eBo8.js";import"./file-type-icon-DQ1RszhD.js";import"./drawer-DxpmrE8v.js";import"./collection-search-Dp1BmkMV.js";import"./Upload01-D_RGpjKA.js";import"./select-q7bwgVlW.js";import"./ArrowLeft-DOsfcVpQ.js";import"./tabs-DpGdQrxa.js";import"./toggle-group-BwBH_M5s.js";import"./task-route-DEqOXA_E.js";import"./extract-connection-data-CAMtkd3W.js";import"./metadata-dUsYcpuu.js";import"./connection-BCNJWGbO.js";import"./connection-card-CeajMGs5.js";import"./use-registry-connections-BGtFCFtR.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-6J7mjd8C.js";import"./UserSquare-CiC2Kuwr.js";import"./connection-form-helpers-CuUX9hrF.js";import"./authenticate-and-persist-oauth-C8gF-Uva.js";import"./mcp-oauth-B5Cmepg9.js";import"./collection-tabs-Bf_jNqrr.js";import"./badge-DSOp7wJZ.js";import"./use-file-configs-BVutza5n.js";import"./site-slug-uya6Wp4-.js";import"./popover-Byi9ngG5.js";import"./github-icon-Do42C8KD.js";import"./get-initials-D-f_fDFw.js";import"./Shield01-CDyo-oM6.js";import"./select-model-B-t0Omon.js";import"./checkbox-DqTToLdH.js";import"./ChevronSelectorVertical-BxfSl5d-.js";import"./Key01-BrpZk5jx.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-dGq7Jywk.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D9voeIk1.js";import"./toolbar-SXqB5mu6.js";import"./use-mcp-tools-G_2Sjdq4.js";import"./GitBranch01-CKZOyXBi.js";import"./Package-DoDQSR1T.js";import"./skill-preview-BnoljyyK.js";import"./use-date-fns-locale-WkIh6xp4.js";import"./alert-dialog-D-cLBTS5.js";import"./Play-CKeSWw6P.js";import"./use-debounced-autosave-BSOF20-i.js";import"./search-input-B72yvRx-.js";import"./use-mcp-auth-status-BxON_Lid.js";import"./switch-CoPmWWmx.js";import"./breadcrumb-8cuEhunm.js";import"./repository-import-picker-CwhN144y.js";import"./repository-picker-TPEh5ZeS.js";import"./use-debounced-value-CoHr5F5x.js";import"./Users01-D31zqd7L.js";import"./use-secrets-CCa_RsgT.js";import"./client-icons-CiSugsLO.js";import"./connect-layout-uT81yO1S.js";import"./self-tool-result-KiqRkZ9E.js";import"./provision-repo-scoped-github-connection-WQFARyHG.js";import"./track-_ENcXd80.js";import"./use-tags-6BqFWDu5.js";import"./toolbar-icon-button-BM-TgkaV.js";import"./automation-list-row-CTSkCOuS.js";import"./site-error--i37Vnuw.js";import"./cards-CcTRV1au.js";import"./CreditCard01-Ca7yOBSx.js";import"./HardDrive-Dc8yQFms.js";import"./Sun-DX7SuCd3.js";function mi(d){return d.schema?.definitions??d.schema?.$defs??{}}function Es(d,e){const o=mi(e),u=o[btoa(d)];if(!u)return[];const p=[u];if(Array.isArray(u.allOf)){const x=u.allOf.find(j=>typeof j.$ref=="string")?.$ref;if(typeof x=="string"){const j=o[x.replace("#/definitions/","")];j&&p.push(j)}}return p}function fi(d,e){for(const o of Es(d,e)){const u=typeof o.image=="string"?o.image:void 0;if(u?.includes("{{{"))return u}}function pi(d,e){if(!e)return;const o=ns(d);if(!o)return;const u=fi(o.resolveType,e);if(!u)return;const p=Ba(u,o.data);if(p)return oi(p)}const gi={escape:Oa};function hi(d,e){for(const o of Es(d,e)){const u=typeof o.title=="string"?o.title:void 0;if(u?.includes("{{"))return u}}function vi(d,e){if(!e)return;const o=ns(d);if(o)try{const u=hi(o.resolveType,e);return u&&Ia.render(u,o.data,{},gi).trim()||void 0}catch{return}}const Si="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",bi="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 Yn(d){return Array.from({length:d},(e,o)=>({id:crypto.randomUUID(),index:o}))}function Rs(d){return d.map((e,o)=>({...e,index:o}))}function yi(d,e){if(e===d.length)return d;if(e<d.length)return Rs(d.slice(0,e));const o=Array.from({length:e-d.length},(u,p)=>({id:crypto.randomUUID(),index:d.length+p}));return[...d,...o]}function ws(d){const e=st.c(25),{section:o,raw:u,meta:p}=d,x=o.isSavedBlock===!0,j=o.isMultivariate===!0;let v;e[0]!==p||e[1]!==u?(v=u&&p?pi(u,p):void 0,e[0]=p,e[1]=u,e[2]=v):v=e[2];const y=v;let g;e[3]!==p||e[4]!==j||e[5]!==u||e[6]!==x?(g=u&&p&&!x&&!j?vi(u,p):void 0,e[3]=p,e[4]=j,e[5]=u,e[6]=x,e[7]=g):g=e[7];const k=g;let L;e[8]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(Oo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=L):L=e[8];let M;e[9]!==y?(M=y&&n.jsx("img",{src:y,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[9]=y,e[10]=M):M=e[10];let V;e[11]!==j||e[12]!==x?(V=x?{color:Ha}:j?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=j,e[12]=x,e[13]=V):V=e[13];let c;e[14]!==V?(c=n.jsx(yn,{className:"h-4 w-4 shrink-0",style:V}),e[14]=V,e[15]=c):c=e[15];const b=o.isHidden&&"line-through opacity-50";let w;e[16]!==b?(w=Ue("min-w-0 flex-1 truncate text-sm font-medium",b),e[16]=b,e[17]=w):w=e[17];const l=k??o.label;let D;e[18]!==w||e[19]!==l?(D=n.jsx("span",{className:w,children:l}),e[18]=w,e[19]=l,e[20]=D):D=e[20];let i;return e[21]!==D||e[22]!==M||e[23]!==c?(i=n.jsxs(n.Fragment,{children:[L,M,c,D]}),e[21]=D,e[22]=M,e[23]=c,e[24]=i):i=e[24],i}const xi="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",_i="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]",ji="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";function bn(d,e){return Ue("h-7 shrink-0 overflow-hidden",e?xi:d?ji:_i)}function ks(d,e){const o=d.isSavedBlock===!0,u=d.isMultivariate===!0;return Ue("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?Si:u?ds:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ei(d){const e=st.c(82),{section:o,raw:u,meta:p,sortableId:x,selected:j,onSelect:v,onDelete:y,onDuplicate:g,onMakeReusable:k,onToggleHidden:L,onToggleLazy:M,onAddVariant:V,onDetach:c}=d,b=Vt(),w=u?ls(u.__resolveType??""):!1,l=o.isHidden===!0,D=w||l;let i;e[0]!==o?(i=Fa(o),e[0]=o,e[1]=i):i=e[1];const W=i;let U;e[2]!==x?(U={id:x,animateLayoutChanges:Vi},e[2]=x,e[3]=U):U=e[3];const{attributes:Ke,listeners:J,setNodeRef:m,transform:C,isDragging:we}=cs(U);let N;e[4]!==C?(N=us.Transform.toString(C?{...C,x:0}:null),e[4]=C,e[5]=N):N=e[5];const X=we?0:void 0;let T;e[6]!==N||e[7]!==X?(T={transform:N,opacity:X},e[6]=N,e[7]=X,e[8]=T):T=e[8];const oe=T;let B;e[9]!==o?(B=$a(o),e[9]=o,e[10]=B):B=e[10];const Pe=B;let ee;e[11]!==v?(ee=_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),v())},e[11]=v,e[12]=ee):ee=e[12];const de=we?"cursor-grabbing":"cursor-pointer";let Q;e[13]!==o||e[14]!==j||e[15]!==de?(Q=Ue("touch-none transition-colors",de,ks(o,j)),e[13]=o,e[14]=j,e[15]=de,e[16]=Q):Q=e[16];let ie;e[17]!==p||e[18]!==u||e[19]!==o?(ie=n.jsx(ws,{section:o,raw:u,meta:p}),e[17]=p,e[18]=u,e[19]=o,e[20]=ie):ie=e[20];let ye;e[21]!==l||e[22]!==b?(ye=b(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[21]=l,e[22]=b,e[23]=ye):ye=e[23];let re;e[24]!==L?(re=_=>{_.stopPropagation(),L()},e[24]=L,e[25]=re):re=e[25];let K;e[26]!==l?(K=l?n.jsx(ei,{className:"h-3.5 w-3.5"}):n.jsx(ti,{className:"h-3.5 w-3.5"}),e[26]=l,e[27]=K):K=e[27];let qe;e[28]!==l||e[29]!==b?(qe=b(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[28]=l,e[29]=b,e[30]=qe):qe=e[30];let Le;e[31]!==qe?(Le=n.jsx(Tt,{side:"bottom",children:qe}),e[31]=qe,e[32]=Le):Le=e[32];const Oe=_s,ke=xs,F=!0,te=tt,Fe="button",Ce="ghost",xe="icon";let ne;e[33]!==b?(ne=b("sectionsEditor.sectionList.sectionActionsMenu"),e[33]=b,e[34]=ne):ne=e[34];const me=Ue(bn(D,!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 _e;e[35]===Symbol.for("react.memo_cache_sentinel")?(_e=n.jsx(Ss,{className:"h-3.5 w-3.5"}),e[35]=_e):_e=e[35];let fe;e[36]!==te||e[37]!==ne||e[38]!==me?(fe=n.jsx(te,{type:Fe,variant:Ce,size:xe,"aria-label":ne,className:me,onClick:wi,onPointerDown:Ri,children:_e}),e[36]=te,e[37]=ne,e[38]=me,e[39]=fe):fe=e[39];let pe;e[40]!==ke||e[41]!==fe?(pe=n.jsx(ke,{asChild:F,children:fe}),e[40]=ke,e[41]=fe,e[42]=pe):pe=e[42];let se;e[43]!==g?(se=_=>{_.stopPropagation(),g()},e[43]=g,e[44]=se):se=e[44];let Me;e[45]===Symbol.for("react.memo_cache_sentinel")?(Me=n.jsx(bs,{className:"h-4 w-4"}),e[45]=Me):Me=e[45];let je;e[46]!==b?(je=b("sectionsEditor.sectionList.duplicateMenuItem"),e[46]=b,e[47]=je):je=e[47];let le;e[48]!==se||e[49]!==je?(le=n.jsxs(vt,{onClick:se,children:[Me,je]}),e[48]=se,e[49]=je,e[50]=le):le=e[50];let I;e[51]!==W||e[52]!==V||e[53]!==b?(I=W&&n.jsxs(vt,{className:za,onClick:_=>{_.stopPropagation(),V()},children:[n.jsx(ni,{className:"h-4 w-4"}),b("sectionsEditor.sectionList.addVariantMenuItem")]}),e[51]=W,e[52]=V,e[53]=b,e[54]=I):I=e[54];let Ee;e[55]!==Pe||e[56]!==k||e[57]!==b?(Ee=Pe&&n.jsxs(vt,{className:bi,onClick:_=>{_.stopPropagation(),k()},children:[n.jsx(yn,{className:"h-4 w-4"}),b("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[55]=Pe,e[56]=k,e[57]=b,e[58]=Ee):Ee=e[58];let ge;e[59]!==c||e[60]!==o.isMultivariate||e[61]!==o.isSavedBlock||e[62]!==b?(ge=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(vt,{onClick:_=>{_.stopPropagation(),c()},children:[n.jsx(yn,{className:"h-4 w-4"}),b("sectionsEditor.sectionList.detachMenuItem")]}),e[59]=c,e[60]=o.isMultivariate,e[61]=o.isSavedBlock,e[62]=b,e[63]=ge):ge=e[63];let ce;e[64]!==y?(ce=_=>{_.stopPropagation(),y()},e[64]=y,e[65]=ce):ce=e[65];let he;e[66]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(ys,{className:"h-4 w-4"}),e[66]=he):he=e[66];let Z;e[67]!==b?(Z=b("sectionsEditor.sectionList.deleteMenuItem"),e[67]=b,e[68]=Z):Z=e[68];let ue;e[69]!==ce||e[70]!==Z?(ue=n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:ce,children:[he,Z]}),e[69]=ce,e[70]=Z,e[71]=ue):ue=e[71];let ve;e[72]!==le||e[73]!==I||e[74]!==Ee||e[75]!==ge||e[76]!==ue?(ve=n.jsxs(js,{align:"end",className:"w-44",children:[le,I,Ee,ge,ue]}),e[72]=le,e[73]=I,e[74]=Ee,e[75]=ge,e[76]=ue,e[77]=ve):ve=e[77];let Te;return e[78]!==Oe||e[79]!==pe||e[80]!==ve?(Te=n.jsxs(Oe,{children:[pe,ve]}),e[78]=Oe,e[79]=pe,e[80]=ve,e[81]=Te):Te=e[81],n.jsxs("div",{ref:m,style:oe,...Ke,...J,role:"button",tabIndex:0,onClick:v,onKeyDown:ee,className:Q,children:[ie,!o.isMultivariate&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":b(w?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Ue(bn(D,w)),onClick:_=>{_.stopPropagation(),M()},onPointerDown:Ti,children:n.jsx(si,{className:Ue("h-3.5 w-3.5",w&&"text-yellow-500")})})}),n.jsx(Tt,{side:"bottom",children:b(w?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":ye,className:Ue(bn(D,l)),onClick:re,onPointerDown:ki,children:K})}),Le]}),Te]})}function Ri(d){return d.stopPropagation()}function wi(d){return d.stopPropagation()}function ki(d){return d.stopPropagation()}function Ti(d){return d.stopPropagation()}function Vi(){return!1}function Di(d){const e=st.c(104),{listKey:o,rawSections:u,sections:p,meta:x,selectedIndex:j,onSelect:v,onReorder:y,onDelete:g,onDuplicate:k,onMakeReusable:L,onToggleHidden:M,onToggleLazy:V,onAddVariant:c,onDetach:b,onAddSection:w,canAddSection:l}=d,D=l===void 0?!0:l,i=Vt();let W;e[0]!==p.length?(W=()=>Yn(p.length),e[0]=p.length,e[1]=W):W=e[1];const[U,Ke]=R.useState(W),[J,m]=R.useState(null),[C,we]=R.useState(o),[N,X]=R.useState(p.length),T=R.useRef(!1);C!==o?(we(o),X(p.length),Ke(Yn(p.length))):N!==p.length&&(X(p.length),Ke(Te=>yi(Te,p.length)));let oe;e[2]===Symbol.for("react.memo_cache_sentinel")?(oe={activationConstraint:{distance:8}},e[2]=oe):oe=e[2];let B;e[3]===Symbol.for("react.memo_cache_sentinel")?(B={coordinateGetter:ms},e[3]=B):B=e[3];const Pe=ss(Zt(rs,oe),Zt(is,B));let ee;e[4]!==U?(ee=U.map(Ni),e[4]=U,e[5]=ee):ee=e[5];const de=ee;let Q;e[6]===Symbol.for("react.memo_cache_sentinel")?(Q=Te=>{m(String(Te.active.id))},e[6]=Q):Q=e[6];const ie=Q;let ye;e[7]!==de||e[8]!==y?(ye=Te=>{m(null);const{active:_,over:Se}=Te;if(!Se||_.id===Se.id)return;const ae=de.indexOf(String(_.id)),Ve=de.indexOf(String(Se.id));ae===-1||Ve===-1||(Ke($e=>Rs(Lt([...$e],ae,Ve))),T.current=!0,requestAnimationFrame(()=>{T.current=!1}),y?.(ae,Ve))},e[7]=de,e[8]=y,e[9]=ye):ye=e[9];const re=ye;let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=()=>{m(null)},e[10]=K):K=e[10];const qe=K;let Le,Oe,ke,F,te,Fe,Ce,xe,ne,me,_e,fe,pe,se,Me;if(e[11]!==J||e[12]!==D||e[13]!==U||e[14]!==de||e[15]!==re||e[16]!==x||e[17]!==w||e[18]!==c||e[19]!==g||e[20]!==b||e[21]!==k||e[22]!==L||e[23]!==v||e[24]!==M||e[25]!==V||e[26]!==u||e[27]!==p||e[28]!==j||e[29]!==Pe||e[30]!==i){se=Symbol.for("react.early_return_sentinel");e:{const Te=_=>{T.current||v(_)};if(e[46]!==J||e[47]!==D||e[48]!==U||e[49]!==w||e[50]!==u||e[51]!==p||e[52]!==i){const _=J?U.find(Se=>Se.id===J):null;if(F=_!=null?p[_.index]:null,ke=_!=null?u[_.index]:void 0,U.length===0){let Se;e[56]!==i?(Se=i("sectionsEditor.sectionList.noSections"),e[56]=i,e[57]=Se):Se=e[57];let ae;e[58]!==Se?(ae=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Se}),e[58]=Se,e[59]=ae):ae=e[59];const Ve=!D;let $e;e[60]===Symbol.for("react.memo_cache_sentinel")?($e=n.jsx(xn,{size:14}),e[60]=$e):$e=e[60];let ct;e[61]!==i?(ct=i("sectionsEditor.sectionList.addSectionButton"),e[61]=i,e[62]=ct):ct=e[62];let De;e[63]!==w||e[64]!==Ve||e[65]!==ct?(De=n.jsxs(tt,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ve,onClick:w,children:[$e,ct]}),e[63]=w,e[64]=Ve,e[65]=ct,e[66]=De):De=e[66];let Ze;e[67]!==ae||e[68]!==De?(Ze=n.jsxs("div",{className:"space-y-2",children:[ae,De]}),e[67]=ae,e[68]=De,e[69]=Ze):Ze=e[69],se=Ze;break e}pe=Ue(_&&"cursor-grabbing"),e[46]=J,e[47]=D,e[48]=U,e[49]=w,e[50]=u,e[51]=p,e[52]=i,e[53]=ke,e[54]=F,e[55]=pe}else ke=e[53],F=e[54],pe=e[55];Oe=fs,xe=Pe,ne=ps,me=ie,_e=re,fe=qe,Le=gs,Fe=de,Ce=hs,Me="space-y-1",te=U.map(_=>{const Se=p[_.index];return Se?n.jsx(Ei,{sortableId:_.id,section:Se,raw:u[_.index],meta:x,selected:j===_.index,onSelect:()=>Te(_.index),onDelete:()=>g(_.index),onDuplicate:()=>k(_.index),onMakeReusable:()=>L(_.index),onToggleHidden:()=>M(_.index),onToggleLazy:()=>V(_.index),onAddVariant:()=>c(_.index),onDetach:()=>b(_.index)},_.id):null})}e[11]=J,e[12]=D,e[13]=U,e[14]=de,e[15]=re,e[16]=x,e[17]=w,e[18]=c,e[19]=g,e[20]=b,e[21]=k,e[22]=L,e[23]=v,e[24]=M,e[25]=V,e[26]=u,e[27]=p,e[28]=j,e[29]=Pe,e[30]=i,e[31]=Le,e[32]=Oe,e[33]=ke,e[34]=F,e[35]=te,e[36]=Fe,e[37]=Ce,e[38]=xe,e[39]=ne,e[40]=me,e[41]=_e,e[42]=fe,e[43]=pe,e[44]=se,e[45]=Me}else Le=e[31],Oe=e[32],ke=e[33],F=e[34],te=e[35],Fe=e[36],Ce=e[37],xe=e[38],ne=e[39],me=e[40],_e=e[41],fe=e[42],pe=e[43],se=e[44],Me=e[45];if(se!==Symbol.for("react.early_return_sentinel"))return se;let je;e[70]!==te||e[71]!==Me?(je=n.jsx("div",{className:Me,children:te}),e[70]=te,e[71]=Me,e[72]=je):je=e[72];let le;e[73]!==Le||e[74]!==Fe||e[75]!==Ce||e[76]!==je?(le=n.jsx(Le,{items:Fe,strategy:Ce,children:je}),e[73]=Le,e[74]=Fe,e[75]=Ce,e[76]=je,e[77]=le):le=e[77];let I;e[78]!==ke||e[79]!==F||e[80]!==x?(I=F?n.jsx("div",{className:Ue("cursor-grabbing shadow-lg ring-1 ring-border/60",ks(F,!1)),children:n.jsx(ws,{section:F,raw:ke,meta:x})}):null,e[78]=ke,e[79]=F,e[80]=x,e[81]=I):I=e[81];let Ee;e[82]!==I?(Ee=es.createPortal(n.jsx(as,{dropAnimation:os,children:I}),document.body),e[82]=I,e[83]=Ee):Ee=e[83];let ge;e[84]!==Oe||e[85]!==xe||e[86]!==ne||e[87]!==me||e[88]!==_e||e[89]!==fe||e[90]!==le||e[91]!==Ee?(ge=n.jsxs(Oe,{sensors:xe,collisionDetection:ne,onDragStart:me,onDragEnd:_e,onDragCancel:fe,children:[le,Ee]}),e[84]=Oe,e[85]=xe,e[86]=ne,e[87]=me,e[88]=_e,e[89]=fe,e[90]=le,e[91]=Ee,e[92]=ge):ge=e[92];const ce=!D;let he;e[93]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(xn,{size:14}),e[93]=he):he=e[93];let Z;e[94]!==i?(Z=i("sectionsEditor.sectionList.addSectionButton"),e[94]=i,e[95]=Z):Z=e[95];let ue;e[96]!==w||e[97]!==ce||e[98]!==Z?(ue=n.jsxs(tt,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:ce,onClick:w,children:[he,Z]}),e[96]=w,e[97]=ce,e[98]=Z,e[99]=ue):ue=e[99];let ve;return e[100]!==pe||e[101]!==ge||e[102]!==ue?(ve=n.jsxs("div",{className:pe,children:[ge,ue]}),e[100]=pe,e[101]=ge,e[102]=ue,e[103]=ve):ve=e[103],ve}function Ni(d){return d.id}function Jn(d){const e=st.c(57),{open:o,initialName:u,autoLabel:p,isPending:x,onSubmit:j,onOpenChange:v}=d,y=x===void 0?!1:x,g=Vt(),[k,L]=R.useState(u),[M,V]=R.useState(o);o!==M&&(V(o),o&&L(u));let c;e[0]!==y||e[1]!==v?(c=ie=>{!ie&&!y&&v(!1)},e[0]=y,e[1]=v,e[2]=c):c=e[2];const b=c;let w;e[3]!==y||e[4]!==k||e[5]!==j?(w=async ie=>{ie.preventDefault(),!y&&await j(k.trim())},e[3]=y,e[4]=k,e[5]=j,e[6]=w):w=e[6];const l=w;let D;e[7]!==g?(D=g("sectionsEditor.variantRenameDialog.title"),e[7]=g,e[8]=D):D=e[8];let i;e[9]!==D?(i=n.jsx(qo,{children:D}),e[9]=D,e[10]=i):i=e[10];let W;e[11]!==p||e[12]!==g?(W=g("sectionsEditor.variantRenameDialog.description",{fallback:p||g("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=p,e[12]=g,e[13]=W):W=e[13];let U;e[14]!==W?(U=n.jsx(Wo,{children:W}),e[14]=W,e[15]=U):U=e[15];let Ke;e[16]!==i||e[17]!==U?(Ke=n.jsxs(Yo,{children:[i,U]}),e[16]=i,e[17]=U,e[18]=Ke):Ke=e[18];let J;e[19]!==g?(J=g("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=g,e[20]=J):J=e[20];let m;e[21]!==J?(m=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:J}),e[21]=J,e[22]=m):m=e[22];let C;e[23]===Symbol.for("react.memo_cache_sentinel")?(C=ie=>L(ie.target.value),e[23]=C):C=e[23];let we;e[24]!==p||e[25]!==y||e[26]!==k?(we=n.jsx(Xo,{id:"variant-rename-name",value:k,onChange:C,placeholder:p,autoFocus:!0,disabled:y}),e[24]=p,e[25]=y,e[26]=k,e[27]=we):we=e[27];let N;e[28]!==m||e[29]!==we?(N=n.jsxs("div",{className:"space-y-1.5 py-4",children:[m,we]}),e[28]=m,e[29]=we,e[30]=N):N=e[30];let X;e[31]!==v?(X=()=>v(!1),e[31]=v,e[32]=X):X=e[32];let T;e[33]!==g?(T=g("sectionsEditor.variantRenameDialog.cancel"),e[33]=g,e[34]=T):T=e[34];let oe;e[35]!==y||e[36]!==X||e[37]!==T?(oe=n.jsx(tt,{type:"button",variant:"outline",onClick:X,disabled:y,children:T}),e[35]=y,e[36]=X,e[37]=T,e[38]=oe):oe=e[38];let B;e[39]!==y||e[40]!==g?(B=y?n.jsxs(n.Fragment,{children:[n.jsx(ts,{className:"size-3.5"}),g("sectionsEditor.variantRenameDialog.saving")]}):g("sectionsEditor.variantRenameDialog.save"),e[39]=y,e[40]=g,e[41]=B):B=e[41];let Pe;e[42]!==y||e[43]!==B?(Pe=n.jsx(tt,{type:"submit",disabled:y,children:B}),e[42]=y,e[43]=B,e[44]=Pe):Pe=e[44];let ee;e[45]!==oe||e[46]!==Pe?(ee=n.jsxs(Jo,{children:[oe,Pe]}),e[45]=oe,e[46]=Pe,e[47]=ee):ee=e[47];let de;e[48]!==l||e[49]!==N||e[50]!==ee||e[51]!==Ke?(de=n.jsx(Qo,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:l,children:[Ke,N,ee]})}),e[48]=l,e[49]=N,e[50]=ee,e[51]=Ke,e[52]=de):de=e[52];let Q;return e[53]!==b||e[54]!==o||e[55]!==de?(Q=n.jsx(Zo,{open:o,onOpenChange:b,children:de}),e[53]=b,e[54]=o,e[55]=de,e[56]=Q):Q=e[56],Q}function Ts(d){const e=st.c(5),{rule:o,matchers:u}=d,p=o?.__resolveType??"";let x;if(e[0]!==u||e[1]!==p){const g=u.find(k=>k.resolveType===p)?.iconName??Ua(p);x=Fo(g),e[0]=u,e[1]=p,e[2]=x}else x=e[2];const j=x;if(!j)return null;let v;return e[3]!==j?(v=n.jsx(j,{size:14,className:"shrink-0"}),e[3]=j,e[4]=v):v=e[4],v}function Qn(d){return d.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
-
`)}function Zn(d){return d.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function Ai(d,e){const o=new Map;for(const u of d){const p=o.get(u.variant.label);p?p.push(u):o.set(u.variant.label,[u])}return e.map((u,p)=>({id:o.get(u.label)?.shift()?.id??crypto.randomUUID(),index:p,variant:u}))}function Pi(d){return d.map((e,o)=>({...e,index:o}))}function Vs(d){const e=st.c(17),{label:o,effectiveRule:u,matchers:p,canDelete:x,dragging:j,onRename:v,onDuplicate:y,onDelete:g}=d,k=Vt();let L;e[0]!==u||e[1]!==p?(L=n.jsx(Ts,{rule:u,matchers:p}),e[0]=u,e[1]=p,e[2]=L):L=e[2];let M;e[3]!==o?(M=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[3]=o,e[4]=M):M=e[4];let V;e[5]!==x||e[6]!==j||e[7]!==o||e[8]!==g||e[9]!==y||e[10]!==v||e[11]!==k?(V=!j&&n.jsxs(_s,{children:[n.jsx(xs,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":k("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Mi,onPointerDown:Ci,children:n.jsx(Ss,{size:14})})}),n.jsxs(js,{align:"end",className:"w-36",children:[n.jsxs(vt,{onClick:b=>{b.stopPropagation(),v?.()},children:[n.jsx(ci,{size:14}),k("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(vt,{onClick:b=>{b.stopPropagation(),y?.()},children:[n.jsx(bs,{size:14}),k("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(ai,{}),n.jsxs(vt,{variant:"destructive",disabled:!x,onClick:b=>{b.stopPropagation(),g?.()},children:[n.jsx(ys,{size:14}),k("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=x,e[6]=j,e[7]=o,e[8]=g,e[9]=y,e[10]=v,e[11]=k,e[12]=V):V=e[12];let c;return e[13]!==L||e[14]!==M||e[15]!==V?(c=n.jsxs(n.Fragment,{children:[L,M,V]}),e[13]=L,e[14]=M,e[15]=V,e[16]=c):c=e[16],c}function Ci(d){return d.stopPropagation()}function Mi(d){return d.stopPropagation()}function Ki(d){const e=st.c(33),{entry:o,isActive:u,canDelete:p,decofile:x,meta:j,matchers:v,onSelect:y,onRename:g,onDuplicate:k,onDelete:L}=d;let M;e[0]!==o.id?(M={id:o.id,animateLayoutChanges:Li},e[0]=o.id,e[1]=M):M=e[1];const{attributes:V,listeners:c,setNodeRef:b,transform:w,isDragging:l}=cs(M);let D;e[2]!==w?(D=us.Transform.toString(w?{...w,x:0}:null),e[2]=w,e[3]=D):D=e[3];const i=l?0:void 0;let W;e[4]!==D||e[5]!==i?(W={transform:D,opacity:i},e[4]=D,e[5]=i,e[6]=W):W=e[6];const U=W,Ke=j??void 0;let J;e[7]!==x||e[8]!==o.variant.rule||e[9]!==Ke?(J=Bt(o.variant.rule,x,Ke),e[7]=x,e[8]=o.variant.rule,e[9]=Ke,e[10]=J):J=e[10];const m=J;let C;e[11]!==y?(C=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),y())},e[11]=y,e[12]=C):C=e[12];const we=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",N=u?vs:ds;let X;e[13]!==we||e[14]!==N?(X=Ue("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",we,N),e[13]=we,e[14]=N,e[15]=X):X=e[15];let T;e[16]!==p||e[17]!==m||e[18]!==o.variant.label||e[19]!==v||e[20]!==L||e[21]!==k||e[22]!==g?(T=n.jsx(Vs,{label:o.variant.label,effectiveRule:m,matchers:v,canDelete:p,onRename:g,onDuplicate:k,onDelete:L}),e[16]=p,e[17]=m,e[18]=o.variant.label,e[19]=v,e[20]=L,e[21]=k,e[22]=g,e[23]=T):T=e[23];let oe;return e[24]!==V||e[25]!==c||e[26]!==y||e[27]!==b||e[28]!==U||e[29]!==X||e[30]!==T||e[31]!==C?(oe=n.jsx("div",{ref:b,style:U,...V,...c,onClick:y,onKeyDown:C,className:X,children:T}),e[24]=V,e[25]=c,e[26]=y,e[27]=b,e[28]=U,e[29]=X,e[30]=T,e[31]=C,e[32]=oe):oe=e[32],oe}function Li(){return!1}function Bi(d){const e=st.c(9),{variant:o,decofile:u,meta:p,matchers:x}=d,j=p??void 0;let v;e[0]!==u||e[1]!==j||e[2]!==o.rule?(v=Bt(o.rule,u,j),e[0]=u,e[1]=j,e[2]=o.rule,e[3]=v):v=e[3];const y=v;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ue("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",vs),e[4]=g):g=e[4];let k;return e[5]!==y||e[6]!==x||e[7]!==o.label?(k=n.jsx("div",{className:g,children:n.jsx(Vs,{label:o.label,effectiveRule:y,matchers:x,canDelete:!1,dragging:!0})}),e[5]=y,e[6]=x,e[7]=o.label,e[8]=k):k=e[8],k}function Ii(d){const e=st.c(91),{listKey:o,variants:u,activeIndex:p,decofile:x,meta:j,matchers:v,onSelect:y,onReorder:g,onRename:k,onDuplicate:L,onDelete:M,onAdd:V}=d,c=Vt();let b;e[0]!==u?(b=()=>Zn(u),e[0]=u,e[1]=b):b=e[1];const[w,l]=R.useState(b),[D,i]=R.useState(null),[W,U]=R.useState(o),[Ke,J]=R.useState(u.length);let m;e[2]!==u?(m=()=>Qn(u),e[2]=u,e[3]=m):m=e[3];const[C,we]=R.useState(m),N=R.useRef(!1),X=Qn(u);W!==o?(U(o),J(u.length),we(X),l(Zn(u))):(Ke!==u.length||C!==X)&&(J(u.length),we(X),l(ge=>Ai(ge,u)));let T;e[4]===Symbol.for("react.memo_cache_sentinel")?(T={activationConstraint:{distance:8}},e[4]=T):T=e[4];let oe;e[5]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:ms},e[5]=oe):oe=e[5];const B=ss(Zt(rs,T),Zt(is,oe));let Pe;e[6]!==w?(Pe=w.map(Oi),e[6]=w,e[7]=Pe):Pe=e[7];const ee=Pe,de=u.length>1;let Q;e[8]!==w?(Q=ge=>{const ce=String(ge.active.id);i(w.find(he=>he.id===ce)??null)},e[8]=w,e[9]=Q):Q=e[9];const ie=Q;let ye;e[10]!==ee||e[11]!==g?(ye=ge=>{i(null);const{active:ce,over:he}=ge;if(!he||ce.id===he.id)return;const Z=ee.indexOf(String(ce.id)),ue=ee.indexOf(String(he.id));Z===-1||ue===-1||(l(ve=>Pi(Lt([...ve],Z,ue))),N.current=!0,requestAnimationFrame(()=>{N.current=!1}),g(Z,ue))},e[10]=ee,e[11]=g,e[12]=ye):ye=e[12];const re=ye;let K;e[13]===Symbol.for("react.memo_cache_sentinel")?(K=()=>{i(null)},e[13]=K):K=e[13];const qe=K;let Le,Oe,ke,F,te,Fe,Ce,xe,ne,me,_e,fe,pe;if(e[14]!==p||e[15]!==de||e[16]!==x||e[17]!==w||e[18]!==ee||e[19]!==re||e[20]!==ie||e[21]!==v||e[22]!==j||e[23]!==V||e[24]!==M||e[25]!==L||e[26]!==k||e[27]!==y||e[28]!==B||e[29]!==c){const ge=ae=>{N.current||y(ae)};_e="space-y-1 border-b p-2";let ce;e[43]!==c?(ce=c("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=c,e[44]=ce):ce=e[44];let he;e[45]!==ce?(he=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:ce}),e[45]=ce,e[46]=he):he=e[46];let Z;e[47]!==c?(Z=c("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=c,e[48]=Z):Z=e[48];let ue;e[49]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(xn,{size:14}),e[49]=ue):ue=e[49];let ve;e[50]!==V||e[51]!==Z?(ve=n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":Z,className:"size-6",onClick:V,children:ue})}),e[50]=V,e[51]=Z,e[52]=ve):ve=e[52];let Te;e[53]!==c?(Te=c("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=c,e[54]=Te):Te=e[54];let _;e[55]!==Te?(_=n.jsx(Tt,{children:Te}),e[55]=Te,e[56]=_):_=e[56];let Se;e[57]!==ve||e[58]!==_?(Se=n.jsxs(wt,{children:[ve,_]}),e[57]=ve,e[58]=_,e[59]=Se):Se=e[59],e[60]!==he||e[61]!==Se?(fe=n.jsxs("div",{className:"flex items-center justify-between",children:[he,Se]}),e[60]=he,e[61]=Se,e[62]=fe):fe=e[62],Oe=fs,Fe=B,Ce=ps,xe=ie,ne=re,me=qe,Le=gs,F=ee,te=hs,pe="space-y-0.5",ke=w.map(ae=>n.jsx(Ki,{entry:ae,isActive:ae.index===p,canDelete:de,decofile:x,meta:j,matchers:v,onSelect:()=>ge(ae.index),onRename:()=>k(ae.index),onDuplicate:()=>L(ae.index),onDelete:()=>M(ae.index)},ae.id)),e[14]=p,e[15]=de,e[16]=x,e[17]=w,e[18]=ee,e[19]=re,e[20]=ie,e[21]=v,e[22]=j,e[23]=V,e[24]=M,e[25]=L,e[26]=k,e[27]=y,e[28]=B,e[29]=c,e[30]=Le,e[31]=Oe,e[32]=ke,e[33]=F,e[34]=te,e[35]=Fe,e[36]=Ce,e[37]=xe,e[38]=ne,e[39]=me,e[40]=_e,e[41]=fe,e[42]=pe}else Le=e[30],Oe=e[31],ke=e[32],F=e[33],te=e[34],Fe=e[35],Ce=e[36],xe=e[37],ne=e[38],me=e[39],_e=e[40],fe=e[41],pe=e[42];let se;e[63]!==ke||e[64]!==pe?(se=n.jsx("div",{className:pe,children:ke}),e[63]=ke,e[64]=pe,e[65]=se):se=e[65];let Me;e[66]!==Le||e[67]!==F||e[68]!==te||e[69]!==se?(Me=n.jsx(Le,{items:F,strategy:te,children:se}),e[66]=Le,e[67]=F,e[68]=te,e[69]=se,e[70]=Me):Me=e[70];let je;e[71]!==D||e[72]!==x||e[73]!==v||e[74]!==j?(je=D?n.jsx(Bi,{variant:D.variant,decofile:x,meta:j,matchers:v}):null,e[71]=D,e[72]=x,e[73]=v,e[74]=j,e[75]=je):je=e[75];let le;e[76]!==je?(le=es.createPortal(n.jsx(as,{dropAnimation:os,children:je}),document.body),e[76]=je,e[77]=le):le=e[77];let I;e[78]!==Oe||e[79]!==Fe||e[80]!==Ce||e[81]!==xe||e[82]!==ne||e[83]!==me||e[84]!==Me||e[85]!==le?(I=n.jsxs(Oe,{sensors:Fe,collisionDetection:Ce,onDragStart:xe,onDragEnd:ne,onDragCancel:me,children:[Me,le]}),e[78]=Oe,e[79]=Fe,e[80]=Ce,e[81]=xe,e[82]=ne,e[83]=me,e[84]=Me,e[85]=le,e[86]=I):I=e[86];let Ee;return e[87]!==_e||e[88]!==fe||e[89]!==I?(Ee=n.jsxs("div",{className:_e,children:[fe,I]}),e[87]=_e,e[88]=fe,e[89]=I,e[90]=Ee):Ee=e[90],Ee}function Oi(d){return d.id}function Xn(d){const e=st.c(21),{currentRt:o,currentLabel:u,currentGlobalKey:p,matchers:x,globals:j,onSelect:v,onSelectGlobal:y,schema:g,formValue:k,onChange:L,formKey:M,formWrapperClassName:V,meta:c,decofile:b,onSaveReferencedBlock:w,sandbox:l}=d;let D;e[0]!==p||e[1]!==u||e[2]!==o||e[3]!==j||e[4]!==x||e[5]!==v||e[6]!==y?(D=n.jsx(Ga,{currentRt:o,currentLabel:u,currentGlobalKey:p,matchers:x,globals:j,onSelect:v,onSelectGlobal:y}),e[0]=p,e[1]=u,e[2]=o,e[3]=j,e[4]=x,e[5]=v,e[6]=y,e[7]=D):D=e[7];let i;e[8]!==b||e[9]!==M||e[10]!==k||e[11]!==V||e[12]!==c||e[13]!==L||e[14]!==w||e[15]!==l||e[16]!==g?(i=g&&k&&n.jsx("div",{className:V,children:n.jsx(qa,{schema:g,value:k,onChange:L,meta:c,decofile:b,onSaveReferencedBlock:w,sandbox:l},M)}),e[8]=b,e[9]=M,e[10]=k,e[11]=V,e[12]=c,e[13]=L,e[14]=w,e[15]=l,e[16]=g,e[17]=i):i=e[17];let W;return e[18]!==D||e[19]!==i?(W=n.jsxs(n.Fragment,{children:[D,i]}),e[18]=D,e[19]=i,e[20]=W):W=e[20],W}function Uc({orgSlug:d,virtualMcpId:e,branch:o,previewReady:u=!0,previewUrl:p,currentPath:x,activePageBlockKey:j=null,activeGlobalBlockKey:v=null,externalSelection:y,onSaved:g,initialEditSeo:k=!1,onExitSeo:L,onViewJsonFile:M,onVariantPreviewOverride:V}){const c=Vt(),b=La()?.taskId??null,w=u?{orgSlug:d,virtualMcpId:e,branch:o,threadId:b,previewUrl:p}:null,{data:l,isLoading:D}=Wa(w),{data:i,isLoading:W}=Ya(w),U=Ja(),Ke=U?.entity?.id===e?U.entity.metadata?.siteSlug??null:null,J=ui({virtualMcpId:e,sandboxUrl:p}),[m,C]=R.useState(null),[we,N]=R.useState(null),[X,T]=R.useState(null),[oe,B]=R.useState(0),[Pe,ee]=R.useState(void 0),[de,Q]=R.useState(null),[ie,ye]=R.useState(null),[re,K]=R.useState([]),qe=R.useRef(null),[Le,Oe]=R.useState(re.length);Le!==re.length&&(Oe(re.length),requestAnimationFrame(()=>{qe.current&&(qe.current.scrollTop=0)}));const[ke,F]=R.useState(0),[te,Fe]=R.useState(null),[Ce,xe]=R.useState(null),[ne,me]=R.useState(null),[_e,fe]=R.useState(!0),[pe,se]=R.useState(!1),[Me,je]=R.useState(!1),le=R.useRef(null),[I,Ee]=R.useState(k),[ge,ce]=R.useState(k);k&&!ge&&(ce(!0),Ee(!0),C(null),N(null),T(null),K([])),!k&&ge&&ce(!1);const[he,Z]=R.useState(null),[ue,ve]=R.useState(void 0),[Te,_]=R.useState([]),[Se,ae]=R.useState(0),[Ve,$e]=R.useState(0),[ct,De]=R.useState(null),[Ze,We]=R.useState(null),[_n,jn]=R.useState(null),Ds=Ma(),Ns=`${d}/${e}/${o}`,Xt=Qa({orgSlug:d,virtualMcpId:e,branch:o}),[As,Ps]=R.useState(x),[Cs,Ms]=R.useState(j),[Ks,Ls]=R.useState(v);(As!==x||Cs!==j||Ks!==v)&&(queueMicrotask(()=>Xt.flush()),Ps(x),Ms(j),Ls(v),C(null),N(null),T(null),B(0),Q(null),ye(null),$e(0),De(null),We(null),K([]),F(t=>t+1),Ee(!1),Z(null),ve(void 0),_([]),ae(t=>t+1));const Ne=Za({orgSlug:d,virtualMcpId:e,branch:o}),It=wo((t,s)=>{Ne.mutate({blockKey:t,data:s},{onSuccess:()=>g?.(),onError:a=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),en=Xa({orgSlug:d,virtualMcpId:e,branch:o}),[Dt,Ot]=R.useState(!1),ze=R.useRef(null),at=R.useRef(null),ot=R.useRef(null),tn=R.useRef({}),Xe=R.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!u||D||W)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(ts,{className:"size-5 text-muted-foreground"})});if(!l||!i)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Bs=eo(l),Ae=!!v,Ye=Ae?null:to(Bs,x,j),E=Ae?v:Ye?.key??null,nn=Ae&&v?l[v]:void 0,En=Ae&&v&&nn?no(v,nn):Ae&&v?v:"",Ft=!Ae&&E&&l[E]?l[E]:null,sn=I&&l&&i&&E&&Ye?In(l,{kind:"page",pageKey:E,pageName:String(Ye.name??""),path:String(Ye.path??"")},i):null,Is=I?Ft?.seo:void 0,an=ue!==void 0?ue:Is,Os=I?so(an):void 0,Fs=sn?.seoTypeOptions??[],$s=I&&i?ao(i):"",Rn=he??Os??{},on=I&&sn?ii(Rn,sn):null,zs=I&&on&&oo(an)?qt(on,i):null,Hs=I?io(l,i)?.seoData:void 0,Ge=Ae?[{label:"Default",sections:[{__resolveType:v}]}]:ro(Ft?.sections,l??{}),Nt=Ge.length>1,Be=Math.min(oe,Ge.length-1),ut=Ge[Be],H=ut?.sections??[],He=Wt(H,l),rn=!Ae&&lo(Ft?.sections);if(Ae&&v&&_n!==v){jn(v);const t=H[0],s=He[0];if(t&&s){C(0),$e(0),K([]);const a=bt(t,s,l);a&&(N(a.data),T(a.resolveType),We(null),De(null))}}!Ae&&_n!==null&&jn(null),Xe.current={rawSections:H,parsedSections:He,decofile:l??{},activePageKey:E,pageVariants:Ge,variantIndex:Be,sectionVariantIndex:Ve,selectedSectionIndex:m};const Us=()=>({multivariate:rn,index:Be,variants:Ge.map(t=>({rule:t.rule}))}),ln=(t,s)=>{if(!V)return;if(!E||!rn||t.length<=1){V(null);return}const a=zn(E,{multivariate:!0,index:s,variants:t},l,i);V(a.length>0?a:null)},cn=V&&E&&rn&&Nt&&!D&&!W?E:null,[Gs,qs]=R.useState(null);if(cn!==Gs&&(qs(cn),cn)){const t=Ge.map(a=>({rule:a.rule})),s=Be;queueMicrotask(()=>ln(t,s))}const xt=(t,s,a)=>{if(!V)return;if(!E){V(null);return}const r=Us(),f=zn(E,r,l,i);if(!t||s<0){V(f.length>0?f:null);return}const S=No({pageKey:E,page:r,sectionIndex:s,sectionLazy:He[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:l,meta:i}),h=[...f,...S];V(h.length>0?h:null)},dt=(t,s,a,r=m??-1,f=!1)=>{const S=nt(t,s);if(!S){N(null),T(null),We(null),De(null),f&&xt(null,r,a);return}const A=On(S,ht)[a];if(!A){N(null),T(null),We(null),De(null),f&&xt(null,r,a);return}const Y=So(A.value,l);N(Y?.data??null),T(Y?.resolveType??null);const{resolveType:P,formValue:O}=Ct(A.rule,l,i??void 0);We(P),De(O),f&&xt(S,r,a)},At=y?.index;if(y!==void 0&&(y?.seq??null)!==Pe&&(ee(y?.seq??null),typeof At=="number")){const t=H[At],s=He[At];if(t&&s)if(C(At),$e(0),K([]),F(a=>a+1),s.isMultivariate)dt(t,s,0,At);else{const a=bt(t,s,l);a?(N(a.data),T(a.resolveType)):(N(null),T(null)),We(null),De(null)}}const $t={orgSlug:d,virtualMcpId:e,branch:o,threadId:b,previewUrl:p??void 0,siteSlug:Ke},un=X&&i?qt(X,i):null,Je=(t,s)=>{if(!E)return;ze.current&&(clearTimeout(ze.current),ze.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null);const a=Kt(l,E,t,Be,Ge);Ne.mutate({blockKey:E,data:a},{onSuccess:()=>s?.onSuccess?.()??g?.(),onError:r=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},_t=()=>{C(null),N(null),T(null),$e(0),De(null),We(null),K([]),F(t=>t+1)},Ws=(t,s)=>{ze.current&&clearTimeout(ze.current);const a=Xe.current.sectionVariantIndex;ze.current=setTimeout(()=>{const{rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:A,variantIndex:Y}=Xe.current,P=r[s];if(!P)return;const O=f[s];if(!O)return;if(O.isSavedBlock){const z=Po(P,O);if(!z)return;Ne.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:G=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}if(!h)return;const $={...S[h]},Re=[...r];if(O.isMultivariate){const z=nt(P,O);if(!z||!h)return;const G=Co(z,a,t);Re[s]=yt(P,O,G)}else if(O.isHidden){const z=ls(P.__resolveType),G=z?{...P.section}:{...P},Ie=Array.isArray(G.variants)?[...G.variants]:[];Ie[0]&&(Ie[0]={...Ie[0],value:t}),G.variants=Ie,z?Re[s]={...P,section:G}:Re[s]=G}else O.isLazy?Re[s]={...P,section:t}:Re[s]=t;if(A.length>1){const z=$.sections,G=[...z?.variants??[]];G[Y]&&(G[Y]={...G[Y],value:Re}),$.sections={...z,variants:G}}else $.sections=Re;Ne.mutate({blockKey:h,data:$},{onSuccess:()=>g?.(),onError:z=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:z.message}))})},Sn)},Ys=t=>{C(t),$e(0),K([]),F(f=>f+1);const s=H[t],a=He[t];if(!s||!a)return;if(a.isMultivariate){dt(s,a,0,t);return}const r=bt(s,a,l);if(!r){N(null),T(null),We(null),De(null),xt(null,t,0);return}N(r.data),T(r.resolveType),We(null),De(null),xt(null,t,0)},wn=t=>{const s=t;N(s),m!==null&&Ws(s,m)},dn=t=>{if(!E||!l||!i||!Ye)return;const s={kind:"page",pageKey:E,pageName:String(Ye.name??""),path:String(Ye.path??"")},a=In(l,s,i);a&&Xt.save(E,()=>{const r=Ds.getQueryData(Ka.decofile(Ns))?.[E];if(!r||typeof r!="object"||r===null||Array.isArray(r))return null;const f={...r,...tn.current};return tn.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?li(s,a,f,t.inner):f})},Js=(t,s)=>{E&&(tn.current[t]=s,dn())},Qs=(t,s)=>{if(!E)return;const a=Lt([...H],t,s);m!==null&&(m===t?C(s):t<m&&s>=m?C(m-1):t>m&&s<=m&&C(m+1)),Je(a)},Zs=t=>{if(!E)return;const s=H.filter((a,r)=>r!==t);m===t?_t():m!==null&&m>t&&C(m-1),Je(s)},Xs=t=>{if(!E)return;const s=H[t];if(!s)return;const a=[...H];a.splice(t+1,0,Do(s)),m!==null&&m>t&&C(m+1),Je(a)},ea=t=>{if(!E)return;const s=H[t],a=He[t];if(!s||!a)return;const r=a.isHidden?To(s):Vo(s);if(!r)return;const f=[...H];f[t]=r,m===t&&_t(),Je(f)},ta=t=>{if(!E)return;const s=H[t],a=He[t];if(!s||!a||a.isMultivariate)return;const r=ko(s);if(!r)return;const f=[...H];f[t]=r,m===t&&_t(),Je(f)},na=t=>{if(!E)return;const s=H[t],a=He[t];if(!s||!a?.isSavedBlock)return;const r=bt(s,a,l);if(!r?.data)return;const{name:f,...S}=r.data,h=[...H];a.isLazy?h[t]={...s,section:S}:h[t]=S,m===t&&_t(),Je(h)},sa=t=>{if(!E)return;const s=[...H,{__resolveType:t.resolveType}],a=s.length-1;Je(s,{onSuccess:()=>{se(!1),C(a),$e(0),K([]),F(h=>h+1);const r=s[a],f=Wt(s,l)[a];if(!r||!f)return;if(f.isMultivariate){dt(r,f,0);return}const S=bt(r,f,l);if(!S){N(null),T(null),We(null),De(null);return}N(S.data),T(S.resolveType),We(null),De(null)}})},kn=t=>{le.current=t.append,se(!0)},aa=t=>{const s=le.current;if(!s){sa(t);return}s({__resolveType:t.resolveType}),se(!1),le.current=null},oa=t=>{if(m===null)return;const s=H[m],a=He[m];!s||!a?.isMultivariate||($e(t),K([]),F(r=>r+1),dt(s,a,t,m,!0))},ia=t=>{if(m===null||!E)return;const s=H[m],a=He[m];if(!s||!a?.isMultivariate)return;const r=nt(s,a);if(!r)return;const f=Eo(r,t);if(!f){q.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const S=[...H];S[m]=yt(s,a,f);const h=f.variants;let A=Ve;t===Ve?A=Math.min(t,h.length-1):t<Ve&&(A=Ve-1),$e(A),K([]),F(Y=>Y+1),dt(S[m],a,A),Je(S)},ra=t=>{if(m===null||!E)return;const s=H[m],a=He[m];if(!s||!a?.isMultivariate)return;const r=nt(s,a);if(!r)return;const f=Ro(r,t),S=[...H];S[m]=yt(s,a,f);const h=t+1;$e(h),K([]),F(A=>A+1),dt(S[m],a,h),Je(S)},la=(t,s)=>{if(m===null||!E||t===s)return;const a=H[m],r=He[m];if(!a||!r?.isMultivariate)return;const f=nt(a,r);if(!f)return;const S=_o(f,t,s),h=[...H];h[m]=yt(a,r,S);let A=Ve;Ve===t?A=s:t<Ve&&s>=Ve?A=Ve-1:t>Ve&&s<=Ve&&(A=Ve+1),$e(A),dt(h[m],r,A),Je(h)},mn=t=>{const s=t??m;if(s===null||!E)return;const a=H[s],r=He[s];if(!a||!r)return;const f=bo(a,r);if(!f){q.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const S=[...H];S[s]=f.section;const h=Wt(S,l)[s];if(!h?.isMultivariate){q.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}C(s),$e(f.newVariantIndex),K([]),F(A=>A+1),dt(f.section,h,f.newVariantIndex,s),Je(S)},ca=()=>{if(m===null||!E)return;const t=H[m],s=He[m];if(!t||!s?.isMultivariate)return;const a=nt(t,s);if(!a)return;const r=jo(t,s,a);if(!r){q.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const f=[...H];f[m]=r;const S=Wt(f,l)[m];if(!S)return;$e(0),We(null),De(null),K([]),F(A=>A+1);const h=bt(r,S,l);h?(N(h.data),T(h.resolveType)):(N(null),T(null)),xt(null,m,0),Je(f)},ua=async t=>{if(te===null||!E)return;const s=vn(t,l);if(s){q.error(s);return}const a=H[te],r=He[te];if(!a||!r)return;const f=bt(a,r,l);if(!f){q.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const S={...f.data,name:t};try{await Ne.mutateAsync({blockKey:t,data:S});const h=[...H];h[te]={__resolveType:t},await Ne.mutateAsync({blockKey:E,data:Kt(l,E,h,Be,Ge)}),m===te&&_t(),Fe(null),q.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),g?.()}catch(h){q.error(h instanceof Error?h.message:c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},Tn=ut?.rule;if(Nt&&m===null&&ie===null&&Tn){const{resolveType:t,formValue:s}=Ct(Tn,l??{},i??void 0);ye(t),Q(s)}const zt=i?co(i):[],Vn=i&&l?uo(i,l):[],da=!Ae&&!!(J&&i&&l),ma=ie&&i?qt(ie,i):null,jt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},Pt=async(t,s)=>{if(!(Ao(s,t,i)>0))try{await en.mutateAsync({blockKey:t})}catch(a){q.error(a instanceof Error?a.message:c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Dn=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:r}=Xe.current;if(!s)return;const f={...a[s]},S={...f.sections},h=[...S.variants??[]],A=h[r],Y=A?.rule;if(Et(Y,a,i)){const P=Y?.__resolveType??"",O=a[P],$=typeof O?.name=="string"?O.name:P,{__resolveType:Re,...z}=t;Ne.mutate({blockKey:P,data:Rt(Re??"",z,$)},{onSuccess:()=>g?.(),onError:G=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}A&&(h[r]={...A,rule:t}),f.sections={...S,variants:h},Ne.mutate({blockKey:s,data:f},{onSuccess:()=>g?.(),onError:P=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:P.message}))})},Sn)},fa=t=>{ye(t);const s=t?Un(t,i):{__resolveType:Gn};Q(t?s:{}),Dn(s)},pa=t=>{const s=t;Q(s);const a=ie?{__resolveType:ie,...s}:{...s};Dn(a)},ga=async t=>{jt();const{activePageKey:s,decofile:a,variantIndex:r}=Xe.current;if(!s)return;const f=a[s],S=f?.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const h=S;if(!Array.isArray(h.variants))return;const A=[...h.variants],Y=A[r];if(!Y)return;const P=Mt(Y.rule,a,i),O=Jt(t);A[r]={...Y,rule:O};const $={...a,[s]:{...f,sections:{...h,variants:A}}},{resolveType:Re,formValue:z}=Ct(O,$,i??void 0);ye(Re),Q(z);try{await Ne.mutateAsync({blockKey:s,data:$[s]}),P&&P!==t&&await Pt(P,$),g?.()}catch(G){q.error(G instanceof Error?G.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Nn=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Xe.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:A,variantIndex:Y}=Xe.current;if(!h)return;const P=r[s],O=f[s];if(!P||!O?.isMultivariate)return;const $=nt(P,O);if(!$)return;const z=($.variants??[])[a]?.rule;if(Et(z,S,i)){const be=z?.__resolveType??"",Qe=S[be],rt=typeof Qe?.name=="string"?Qe.name:be,{__resolveType:pt,...lt}=t;Ne.mutate({blockKey:be,data:Rt(pt??"",lt,rt)},{onSuccess:()=>g?.(),onError:gt=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const G=Hn($,a,t),Ie=[...r];Ie[s]=yt(P,O,G);const et=Kt(S,h,Ie,Y,A);Ne.mutate({blockKey:h,data:et},{onSuccess:()=>g?.(),onError:be=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:be.message}))})},Sn))},ha=t=>{We(t);const s=t?Un(t,i):{__resolveType:Gn};De(t?s:{}),Nn(s)},va=t=>{const s=t;De(s);const a=Ze?{__resolveType:Ze,...s}:{...s};Nn(a)},Sa=async t=>{jt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:A,variantIndex:Y}=Xe.current;if(s===null||!h)return;const P=r[s],O=f[s];if(!P||!O?.isMultivariate)return;const $=nt(P,O);if(!$)return;const Re=$.variants??[],z=Mt(Re[a]?.rule,S,i),G=Jt(t),Ie=Hn($,a,G),et=[...r];et[s]=yt(P,O,Ie);const be=Kt(S,h,et,Y,A),Qe={...S,[h]:be},{resolveType:rt,formValue:pt}=Ct(G,Qe,i??void 0);We(rt),De(pt);try{await Ne.mutateAsync({blockKey:h,data:be}),z&&z!==t&&await Pt(z,Qe),g?.()}catch(lt){q.error(lt instanceof Error?lt.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ae&&!Ye)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:x})});if(Ae&&!nn)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const mt=m!==null?He[m]??null:null,An=m!==null?H[m]:null,Pn=An&&mt?.isMultivariate?nt(An,mt):null,St=Pn?On(Pn,ht):[],fn=Math.min(Ve,Math.max(St.length-1,0)),Ht=St[fn]??null,ft=mt?.isMultivariate===!0,Cn=m!==null&&mt!==null,Ut=Cn&&(ft||!!(un&&we)),ba=Ut&&!Ae&&mt?.isSavedBlock===!0,it=Ae||ba,ya=Ae?En:mt?.label??"",xa=Ze&&i?qt(Ze,i):null,pn=Ut&&(!Ae||re.length>0)?Ae?[En,...re]:[Ye.name,mt.label,...ft&&Ht?[Ht.label]:[],...re]:[],_a=I&&Ye?[Ye.name,"SEO",...Te]:[],Gt=I?_a:it?pn.length>0?pn:[ya]:pn,ja=!I&&!Ae&&ft&&re.length===0,Mn=()=>{if(!E)return;jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const t=l[E],s=yo(t.sections,H);if(!s)return;const a=xo(s);Ne.mutate({blockKey:E,data:{...t,sections:s}},{onSuccess:()=>{B(a),C(null),N(null),T(null),K([]),Q(null),ye(null)},onError:r=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},gn=(t,s,a)=>{if(!E)return;jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const r=l[E],f=r.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const S=f;if(!Array.isArray(S.variants))return;const h=t([...S.variants]);if(!h)return;const A=Mo(S,h),Y={...l,[E]:{...r,sections:A}};Ne.mutate({blockKey:E,data:Y[E]},{onSuccess:()=>{s?.(),a&&Pt(a,Y)},onError:P=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:P.message}))})},Ea=t=>{xe(null),B(t),C(null),N(null),T(null),K([]);const s=Ge[t]?.rule,{resolveType:a,formValue:r}=Ct(s,l??{},i??void 0);ye(a),Q(r),ln(Ge.map(f=>({rule:f.rule})),t)},Ra=(t,s)=>{if(t===s)return;let a=Be;Be===t?a=s:t<Be&&s>=Be?a=Be-1:t>Be&&s<=Be&&(a=Be+1),B(a);const r=Lt(Ge.map(f=>({rule:f.rule})),t,s);ln(r,a),gn(f=>Lt(f,t,s))},wa=t=>{const s=Ge[t]?.rule,a=Mt(s,l??{},i??void 0);gn(r=>r.length<=1?null:(r.splice(t,1),r),()=>{Ge.length-1===1?B(0):t<Be?B(Be-1):t===Be&&B(Math.max(0,t-1)),C(null),N(null),T(null),K([]),Q(null),ye(null)},a)},ka=t=>{gn(s=>Ko(s,t),()=>{B(t+1),C(null),N(null),T(null),K([]),Q(null),ye(null)})},Ta=async(t,s)=>{jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const a=Xe.current.activePageKey,r=Xe.current.decofile;if(!a)return;const f=r[a],S=f.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const h=S;if(!Array.isArray(h.variants))return;const A=[...h.variants],Y=A[t];if(!Y?.rule||typeof Y.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const P=Y.rule,O=s.trim();Ot(!0);try{if(!O){if(!Et(P,r,i)){xe(null);return}const et=P.__resolveType??"";A[t]={...Y,rule:qn(P,r,i)};const be={...r,[a]:{...f,sections:{...h,variants:A}}};await Ne.mutateAsync({blockKey:a,data:be[a]}),await Pt(et,be),xe(null),g?.();return}const $=Wn(P,r,i);if(!$){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if($.blockKey){await Ne.mutateAsync({blockKey:$.blockKey,data:Rt($.resolveType,$.data,O)}),xe(null),g?.();return}const Re=hn(O),z=vn(Re,r);if(z){q.error(z);return}const G=Rt($.resolveType,$.data,O);let Ie=null;try{await Ne.mutateAsync({blockKey:Re,data:G}),Ie=Re,A[t]={...Y,rule:Jt(Re)},await Ne.mutateAsync({blockKey:a,data:{...f,sections:{...h,variants:A}}}),Ie=null}catch(et){throw Ie&&await en.mutateAsync({blockKey:Ie}).catch(()=>{}),et}xe(null),q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:O})),g?.()}catch($){q.error($ instanceof Error?$.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Ot(!1)}},Va=async(t,s)=>{jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const{selectedSectionIndex:a,rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:A,variantIndex:Y}=Xe.current;if(a===null||!h)return;const P=r[a],O=f[a];if(!P||!O?.isMultivariate)return;const $=nt(P,O);if(!$)return;const Re=$.variants??[],z=Re[t];if(!z?.rule||typeof z.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const G=z.rule,Ie=s.trim();Ot(!0);const et=async be=>{const Qe={...$,variants:be},rt=[...r];rt[a]=yt(P,O,Qe);const pt=Kt(S,h,rt,Y,A);return await Ne.mutateAsync({blockKey:h,data:pt}),{...S,[h]:pt}};try{if(!Ie){if(!Et(G,S,i)){me(null);return}const gt=G.__resolveType??"",Bn=[...Re];Bn[t]={...z,rule:qn(G,S,i)};const Ca=await et(Bn);await Pt(gt,Ca),me(null),g?.();return}const be=Wn(G,S,i);if(!be){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(be.blockKey){await Ne.mutateAsync({blockKey:be.blockKey,data:Rt(be.resolveType,be.data,Ie)}),me(null),g?.();return}const Qe=hn(Ie),rt=vn(Qe,S);if(rt){q.error(rt);return}const pt=Rt(be.resolveType,be.data,Ie);let lt=null;try{await Ne.mutateAsync({blockKey:Qe,data:pt}),lt=Qe;const gt=[...Re];gt[t]={...z,rule:Jt(Qe)},await et(gt),lt=null}catch(gt){throw lt&&await en.mutateAsync({blockKey:lt}).catch(()=>{}),gt}me(null),q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Ie})),g?.()}catch(be){q.error(be instanceof Error?be.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Ot(!1)}},Kn=()=>{_t()},Da=t=>{Z(t),dn({inner:t})},Na=t=>{ve(t),dn({raw:t})},Aa=()=>{Z(null),_([])},Pa=()=>ae(t=>t+1),Ln=t=>{if(I){if(t===0){Xt.flush(),Ee(!1),Z(null),ve(void 0),_([]),ae(a=>a+1),L?.();return}if(t===1){_([]),ae(a=>a+1);return}_(Te.slice(0,t-1)),ae(a=>a+1);return}if(Ae){K(re.slice(0,t)),F(a=>a+1);return}if(t===0){Kn();return}if(t===1){K([]),F(a=>a+1);return}if(ft&&t===2){K([]),F(a=>a+1);return}const s=ft?2:1;K(re.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:it||Ut||I?n.jsxs("div",{className:Ue("border-b px-3 py-2.5",it&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[Gt.length>1&&n.jsx("button",{type:"button",onClick:()=>Ln(Lo(Gt.length,{isMultivariateSectionTop:ja})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:Ue("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",it?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx($o,{className:"size-4"})}),!Ae&&Nt&&ut&&n.jsxs("button",{type:"button",onClick:Kn,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:ut.label}),className:Ue("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",mo),children:[n.jsx(Ts,{rule:Bt(ut.rule,l??{},i??void 0),matchers:zt}),n.jsx("span",{className:"max-w-[160px] truncate",children:ut.label})]}),n.jsx("nav",{"aria-label":c("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Gt.map((t,s)=>{const a=s===Gt.length-1,r=fo(t);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(Uo,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Ln(s),title:r,className:Ue("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?it?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":it?"text-foreground/80":"text-muted-foreground",it?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:r})]},`${r}-${s}`)})}),it&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Go,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Cn&&!ft&&!mt?.isHidden&&E&&n.jsx(Fn,{onClick:()=>mn()})]}),it&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(po,{pageKey:E,initialName:Ye.name,initialPath:Ye.path,onFieldChange:Js})}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(zo,{size:14})})}),n.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>M&&E?M():je(!0),children:n.jsx(Ho,{size:14})})}),n.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(Fn,{onClick:Mn})]})}),I?n.jsx(Qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ft&&E?n.jsx(ri,{rawSeo:an,innerSeo:Rn,defaultResolveType:$s,seoSchema:zs,activeResolveType:on,seoTypeOptions:Fs,formResetKey:Se,siteDefaultSeo:Hs,onBreadcrumbChange:_,onPersistRaw:Na,onInnerChange:Da,onClearForm:Aa,onBumpFormKey:Pa}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Ut?n.jsxs(Qt,{viewportRef:qe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ft&&St.length>0&&re.length===0&&n.jsxs(n.Fragment,{children:[n.jsx(go,{listKey:`${E??""}:${m??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:fn,onSelect:oa,onRename:me,onDuplicate:ra,onDelete:ia,onRemoveAll:ca,onReorder:la,onAdd:()=>mn()}),ft&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Xn,{currentRt:Ze??"",currentLabel:Yt(Ht?.rule,l??{},ht,i??void 0),currentGlobalKey:Mt(Ht?.rule,l??{},i??void 0)??void 0,matchers:zt,globals:Vn,onSelect:ha,onSelectGlobal:Sa,schema:xa,formValue:ct,onChange:va,formKey:`${m??"none"}:${fn}:${Ze??""}`,formWrapperClassName:"pt-1",meta:i??void 0,decofile:l,onSaveReferencedBlock:It,sandbox:$t})]})]}),n.jsx($n,{activeSchema:un,formValue:we,formResetKey:ke,onFormChange:wn,onBreadcrumbChange:K,breadcrumbPath:re,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:i,decofile:l,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:J,onRequestAddSection:kn})]},"editor-section-form"):Ae?n.jsx(Qt,{viewportRef:qe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx($n,{activeSchema:un,formValue:we,formResetKey:ke,onFormChange:wn,onBreadcrumbChange:K,breadcrumbPath:re,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:i,decofile:l,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:J,onRequestAddSection:kn})},"editor-global-block"):n.jsxs(Qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Nt&&E&&n.jsx(Ii,{listKey:E,variants:Ge,activeIndex:Be,decofile:l??{},meta:i,matchers:zt,onSelect:Ea,onReorder:Ra,onRename:xe,onDuplicate:ka,onDelete:wa,onAdd:Mn}),Nt&&ie!==null&&n.jsxs("div",{className:Ue("px-3 border-b",_e?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>fe(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":_e,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),_e?n.jsx(Bo,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Io,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),_e&&n.jsx("div",{className:Ue("space-y-3",Dt&&"pointer-events-none opacity-50"),children:n.jsx(Xn,{currentRt:ie,currentLabel:Yt(ut?.rule,l??{},ht,i??void 0),currentGlobalKey:Mt(ut?.rule,l??{},i??void 0)??void 0,matchers:zt,globals:Vn,onSelect:fa,onSelectGlobal:ga,schema:ma,formValue:de,onChange:pa,formKey:`${Be}:${ie??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:l,onSaveReferencedBlock:It,sandbox:$t})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(Di,{listKey:`${E??""}-${Be}`,rawSections:H,sections:He,meta:i,selectedIndex:m,onSelect:Ys,onReorder:Qs,onDelete:Zs,onDuplicate:Xs,onMakeReusable:Fe,onToggleHidden:ea,onToggleLazy:ta,onAddVariant:mn,onDetach:na,onAddSection:()=>se(!0),canAddSection:da})})]},"editor-section-list"),n.jsx(ho,{open:te!==null,onOpenChange:t=>{t||Fe(null)},defaultBlockId:te!==null?hn(He[te]?.label??""):"",isPending:Ne.isPending,onSubmit:ua}),J&&n.jsx(di,{open:pe,onOpenChange:t=>{se(t),t||(le.current=null)},meta:i,decofile:l,previewBaseUrl:J,onSelect:aa}),Me&&E&&l&&n.jsx(vo,{open:Me,onOpenChange:je,pageKey:E,decofile:l}),Ce!==null&&n.jsx(Jn,{open:!0,initialName:Et(Ge[Ce]?.rule,l??{},i??void 0)?Yt(Ge[Ce]?.rule,l??{},ht,i??void 0):"",autoLabel:ht(Bt(Ge[Ce]?.rule,l??{},i??void 0)),isPending:Dt,onSubmit:async t=>{await Ta(Ce,t)},onOpenChange:t=>{!t&&!Dt&&xe(null)}}),ne!==null&&n.jsx(Jn,{open:!0,initialName:Et(St[ne]?.rule,l??{},i??void 0)?Yt(St[ne]?.rule,l??{},ht,i??void 0):"",autoLabel:ht(Bt(St[ne]?.rule,l??{},i??void 0)),isPending:Dt,onSubmit:async t=>{await Va(ne,t)},onOpenChange:t=>{!t&&!Dt&&me(null)}})]})}export{Uc as SectionsEditor};
|
|
1
|
+
import{c as st,b as Vt,r as R,l as Ue,j as n,aB as es,B as tt,a4 as wt,a1 as kt,a2 as Tt,h as ts,n as Ma,t as q,K as Ka}from"./index-mEkmCgyQ.js";import{b as La}from"./chat-context-foSLlJNl.js";import{a8 as ns,a9 as Ba,aa as Ia,ab as Oa,O as ss,P as Xt,ac as as,ad as os,Q as is,U as rs,ae as ls,af as Fa,$ as cs,a0 as us,ag as $a,ah as za,ai as ds,G as Ha,V as ms,W as Lt,Z as fs,_ as ps,X as gs,a5 as hs,aj as Ua,ak as Bt,al as vs,am as Ga,an as qa,ao as Wa,ap as Ya,aq as Ja,d as Qa,e as Xa,ar as Za,as as eo,at as to,au as no,av as In,aw as so,ax as ao,ay as oo,a3 as qt,az as io,aA as ro,aB as Wt,aC as lo,aD as bt,aE as Ct,aF as co,aG as uo,aH as nt,aI as On,aJ as mo,g as fo,aK as Fn,aL as po,aM as go,aN as Mt,aO as Yt,aP as $n,aQ as ho,aR as hn,aS as vo,aT as ht,aU as Et,aV as zn,aW as So,aX as bo,aY as yo,aZ as xo,a_ as _o,a$ as yt,b0 as jo,b1 as Eo,b2 as Ro,i as wo,b3 as Hn,b4 as Kt,b5 as Un,b6 as Gn,b7 as ko,b8 as To,b9 as Vo,ba as Do,bb as vn,bc as qn,bd as Wn,be as Rt,bf as Jt,bg as No,bh as Sn,bi as Ao,bj as Po,bk as Co,bl as Mo,bm as Ko,bn as Lo}from"./index-HLLIv__u.js";import{n as Bo,t as Io}from"./ChevronUp-hRy5Y6dA.js";import{al as yn,B as Oo,a3 as Ss,F as Fo,z as $o,ax as zo,w as Ho}from"./agent-icon-CQcUcvve.js";import{i as Uo}from"./ChevronRight-Ib0VueJf.js";import{i as Go}from"./Globe01-B-Ta7CI6.js";import{S as Qt}from"./scroll-area-CNDSe7wF.js";import{d as qo,h as Wo,c as Yo,e as Jo,b as Qo,D as Xo}from"./dialog-DHoQukig.js";import{I as Zo}from"./input-CZHjAV-J.js";import{a as bs}from"./Copy01-CJc3fzc5.js";import{i as ei}from"./Settings02-BWjUwQJb.js";import{s as ti}from"./Eye-C75di5qO.js";import{s as ni}from"./TrendUp01-DEqnI6NC.js";import{s as xn}from"./Plus-e4LgHrPK.js";import{s as ys}from"./Trash01-uHTzO_Kp.js";import{i as si}from"./Zap-BfTXP7i6.js";import{D as xs,a as vt,c as _s,b as js,i as ai}from"./dropdown-menu-fZhMHO3o.js";import{s as oi}from"./safe-image-url-D5z803Ot.js";import{a as ii,P as ri,b as li}from"./page-seo-form-gXG1ggZW.js";import{a as ci}from"./Tool01-BlgjjpdU.js";import{u as ui,A as di}from"./use-section-preview-base-_PInq-ho.js";import"./use-panel-navigate-YeHpiZRs.js";import"./use-destination-route-DEPAwZCV.js";import"./autosend-BEuqxEF1.js";import"./thread-intent-DTrIT9-4.js";import"./slugify-CEUa2lfQ.js";import"./hooks-CdVl8C2_.js";import"./use-mcp-client-BNWdeK8c.js";import"./auth-B0Q3AWKa.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BZONSf6V.js";import"./task-board-BHx9zXNG.js";import"./schema-BBwxBHJW.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-BLvX-qkO.js";import"./use-ai-providers-BNJWTIAi.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-1dyZcIvw.js";import"./thread-route-BQ3Tyiss.js";import"./Check-CUhXORQg.js";import"./Download01-DvwC8I2w.js";import"./use-organization-settings-DzpGFT0-.js";import"./ArrowUp-BFiyUw6W.js";import"./automation-runs-BdSZGBxD.js";import"./useInfiniteQuery-riEiBpsB.js";import"./infiniteQueryObserver-D4gwR6aT.js";import"./use-connection-DxplHklY.js";import"./table-DrdbdRwh.js";import"./empty-state-D8otpdEW.js";import"./use-infinite-scroll-D_XtdGUF.js";import"./use-members-DiNuKylV.js";import"./use-org-auth-client-BiFxJFF2.js";import"./AlertCircle-BD4Ehwuv.js";import"./CheckCircle-DceIKHuw.js";import"./DotsVertical-D9fs0quN.js";import"./XCircle-B3f6peLD.js";import"./use-automations-D_5b7tED.js";import"./useSuspenseInfiniteQuery-BWopWYpr.js";import"./avatar-40AFRZLg.js";import"./User01-B4Taz9S2.js";import"./Tool02-DfO1mWu7.js";import"./Stars01-IM5cNkdT.js";import"./ArrowRight-CB11uB5G.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-copy-BTz4ZWfx.js";import"./markdown-DYJqw4Y7.js";import"./ZoomOut-Bvoav6Ew.js";import"./monaco-editor-C5_ftRpi.js";import"./editor-BXQFpUyX.js";import"./mcp-app-renderer-DMitrCab.js";import"./types-Dvdbmqdv.js";import"./XClose-CoIRwc3C.js";import"./Share07-CUGuimFL.js";import"./SearchMd-Ce3cYdD-.js";import"./shell-layout-Bq-tGwBU.js";import"./Users03-4uL2zwAj.js";import"./SearchLg-DN0F1HdI.js";import"./project-icon-Luvy1DKq.js";import"./github-repo-CTPv5ZM2.js";import"./source-system-tabs-CnEGUb4r.js";import"./Monitor01-Bl3tMKAt.js";import"./command-LWZ4r8Jn.js";import"./index-Cpd5hkp3.js";import"./required-auth-layout-BfcH2WaP.js";import"./use-org-sso-Bpie5re1.js";import"./use-org-notice-CKY8gj43.js";import"./Image01-DjADDtfX.js";import"./LinkExternal01-C4pu7AaO.js";import"./integration-icon-2_lJ7cqC.js";import"./Palette-D9DE5Eb8.js";import"./use-navigate-to-agent-CWiGCrUj.js";import"./Link01-Bf55lOlN.js";import"./use-mcp-prompts-CGnJDO4l.js";import"./form-DxmscRm0.js";import"./label-CsxoBnvt.js";import"./file-type-icon-BZtV73B-.js";import"./drawer-Cn-uFGEW.js";import"./collection-search-BuLaB5Nt.js";import"./Upload01-BSbk7V4P.js";import"./select-CbLguDhI.js";import"./ArrowLeft-DS5O-nPg.js";import"./tabs-ZOxnjSsA.js";import"./toggle-group-DYQwhQaR.js";import"./task-route-DiFmkBJF.js";import"./extract-connection-data-epPsd6xZ.js";import"./metadata-dUsYcpuu.js";import"./connection-D-ncxT-9.js";import"./connection-card-IYQHjVFd.js";import"./use-registry-connections-3nGcPcNL.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-CvmzMdyB.js";import"./UserSquare-6pF99VSX.js";import"./connection-form-helpers-CWmILpdf.js";import"./authenticate-and-persist-oauth-L2eUUanh.js";import"./mcp-oauth-DjFtPYWS.js";import"./collection-tabs-Dz6jwhDl.js";import"./badge-CrU7iVuf.js";import"./use-file-configs-CCn7Bt-b.js";import"./site-slug-uya6Wp4-.js";import"./popover-BxPcez1r.js";import"./github-icon-7izIvLJY.js";import"./get-initials-D-f_fDFw.js";import"./Shield01-Bd90NSFN.js";import"./select-model-C4TTnWHJ.js";import"./checkbox-C7ZJRwhO.js";import"./ChevronSelectorVertical-3_WN5_kz.js";import"./Key01-jTjGi47C.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-DTK_rt9o.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BTH1A_aQ.js";import"./toolbar-CFelrcI5.js";import"./use-mcp-tools-CCLGFzAl.js";import"./GitBranch01-CwOiGDey.js";import"./Package-CJV1-UUp.js";import"./skill-preview-CIuWU7Nw.js";import"./use-date-fns-locale-70CVQ3U3.js";import"./alert-dialog-DpiA8C8s.js";import"./Play-CQQ0AurK.js";import"./use-debounced-autosave-CWwOfVu-.js";import"./search-input-C2qtSXhm.js";import"./use-mcp-auth-status-DZMnrNk8.js";import"./switch-25j9zQlB.js";import"./breadcrumb-BQA_HhdN.js";import"./repository-import-picker-CHRLh3h0.js";import"./repository-picker-sMM9I4tH.js";import"./use-debounced-value-CYMpa1LX.js";import"./Users01-tKH9Db85.js";import"./use-secrets-BtC1D0xM.js";import"./client-icons-ByEXfNCg.js";import"./connect-layout-BTbdWkSE.js";import"./self-tool-result-Dmc-MJCE.js";import"./provision-repo-scoped-github-connection-WQFARyHG.js";import"./track-KM7IYQ9I.js";import"./use-tags-BbFV3F9t.js";import"./toolbar-icon-button-sDj_3mQn.js";import"./automation-list-row-D6hZ6N_I.js";import"./site-error--i37Vnuw.js";import"./cards-ChgGMPVL.js";import"./CreditCard01-RbuyzXlw.js";import"./HardDrive-Dc4ZUX13.js";import"./Sun-Bd7eQ88j.js";function mi(d){return d.schema?.definitions??d.schema?.$defs??{}}function Es(d,e){const o=mi(e),u=o[btoa(d)];if(!u)return[];const p=[u];if(Array.isArray(u.allOf)){const x=u.allOf.find(j=>typeof j.$ref=="string")?.$ref;if(typeof x=="string"){const j=o[x.replace("#/definitions/","")];j&&p.push(j)}}return p}function fi(d,e){for(const o of Es(d,e)){const u=typeof o.image=="string"?o.image:void 0;if(u?.includes("{{{"))return u}}function pi(d,e){if(!e)return;const o=ns(d);if(!o)return;const u=fi(o.resolveType,e);if(!u)return;const p=Ba(u,o.data);if(p)return oi(p)}const gi={escape:Oa};function hi(d,e){for(const o of Es(d,e)){const u=typeof o.title=="string"?o.title:void 0;if(u?.includes("{{"))return u}}function vi(d,e){if(!e)return;const o=ns(d);if(o)try{const u=hi(o.resolveType,e);return u&&Ia.render(u,o.data,{},gi).trim()||void 0}catch{return}}const Si="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",bi="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 Yn(d){return Array.from({length:d},(e,o)=>({id:crypto.randomUUID(),index:o}))}function Rs(d){return d.map((e,o)=>({...e,index:o}))}function yi(d,e){if(e===d.length)return d;if(e<d.length)return Rs(d.slice(0,e));const o=Array.from({length:e-d.length},(u,p)=>({id:crypto.randomUUID(),index:d.length+p}));return[...d,...o]}function ws(d){const e=st.c(25),{section:o,raw:u,meta:p}=d,x=o.isSavedBlock===!0,j=o.isMultivariate===!0;let v;e[0]!==p||e[1]!==u?(v=u&&p?pi(u,p):void 0,e[0]=p,e[1]=u,e[2]=v):v=e[2];const y=v;let g;e[3]!==p||e[4]!==j||e[5]!==u||e[6]!==x?(g=u&&p&&!x&&!j?vi(u,p):void 0,e[3]=p,e[4]=j,e[5]=u,e[6]=x,e[7]=g):g=e[7];const k=g;let L;e[8]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(Oo,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=L):L=e[8];let M;e[9]!==y?(M=y&&n.jsx("img",{src:y,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[9]=y,e[10]=M):M=e[10];let V;e[11]!==j||e[12]!==x?(V=x?{color:Ha}:j?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=j,e[12]=x,e[13]=V):V=e[13];let c;e[14]!==V?(c=n.jsx(yn,{className:"h-4 w-4 shrink-0",style:V}),e[14]=V,e[15]=c):c=e[15];const b=o.isHidden&&"line-through opacity-50";let w;e[16]!==b?(w=Ue("min-w-0 flex-1 truncate text-sm font-medium",b),e[16]=b,e[17]=w):w=e[17];const l=k??o.label;let D;e[18]!==w||e[19]!==l?(D=n.jsx("span",{className:w,children:l}),e[18]=w,e[19]=l,e[20]=D):D=e[20];let i;return e[21]!==D||e[22]!==M||e[23]!==c?(i=n.jsxs(n.Fragment,{children:[L,M,c,D]}),e[21]=D,e[22]=M,e[23]=c,e[24]=i):i=e[24],i}const xi="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",_i="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]",ji="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";function bn(d,e){return Ue("h-7 shrink-0 overflow-hidden",e?xi:d?ji:_i)}function ks(d,e){const o=d.isSavedBlock===!0,u=d.isMultivariate===!0;return Ue("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?Si:u?ds:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ei(d){const e=st.c(82),{section:o,raw:u,meta:p,sortableId:x,selected:j,onSelect:v,onDelete:y,onDuplicate:g,onMakeReusable:k,onToggleHidden:L,onToggleLazy:M,onAddVariant:V,onDetach:c}=d,b=Vt(),w=u?ls(u.__resolveType??""):!1,l=o.isHidden===!0,D=w||l;let i;e[0]!==o?(i=Fa(o),e[0]=o,e[1]=i):i=e[1];const W=i;let U;e[2]!==x?(U={id:x,animateLayoutChanges:Vi},e[2]=x,e[3]=U):U=e[3];const{attributes:Ke,listeners:J,setNodeRef:m,transform:C,isDragging:we}=cs(U);let N;e[4]!==C?(N=us.Transform.toString(C?{...C,x:0}:null),e[4]=C,e[5]=N):N=e[5];const Z=we?0:void 0;let T;e[6]!==N||e[7]!==Z?(T={transform:N,opacity:Z},e[6]=N,e[7]=Z,e[8]=T):T=e[8];const oe=T;let B;e[9]!==o?(B=$a(o),e[9]=o,e[10]=B):B=e[10];const Pe=B;let ee;e[11]!==v?(ee=_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),v())},e[11]=v,e[12]=ee):ee=e[12];const de=we?"cursor-grabbing":"cursor-pointer";let Q;e[13]!==o||e[14]!==j||e[15]!==de?(Q=Ue("touch-none transition-colors",de,ks(o,j)),e[13]=o,e[14]=j,e[15]=de,e[16]=Q):Q=e[16];let ie;e[17]!==p||e[18]!==u||e[19]!==o?(ie=n.jsx(ws,{section:o,raw:u,meta:p}),e[17]=p,e[18]=u,e[19]=o,e[20]=ie):ie=e[20];let ye;e[21]!==l||e[22]!==b?(ye=b(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[21]=l,e[22]=b,e[23]=ye):ye=e[23];let re;e[24]!==L?(re=_=>{_.stopPropagation(),L()},e[24]=L,e[25]=re):re=e[25];let K;e[26]!==l?(K=l?n.jsx(ei,{className:"h-3.5 w-3.5"}):n.jsx(ti,{className:"h-3.5 w-3.5"}),e[26]=l,e[27]=K):K=e[27];let qe;e[28]!==l||e[29]!==b?(qe=b(l?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[28]=l,e[29]=b,e[30]=qe):qe=e[30];let Le;e[31]!==qe?(Le=n.jsx(Tt,{side:"bottom",children:qe}),e[31]=qe,e[32]=Le):Le=e[32];const Oe=_s,ke=xs,F=!0,te=tt,Fe="button",Ce="ghost",xe="icon";let ne;e[33]!==b?(ne=b("sectionsEditor.sectionList.sectionActionsMenu"),e[33]=b,e[34]=ne):ne=e[34];const me=Ue(bn(D,!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 _e;e[35]===Symbol.for("react.memo_cache_sentinel")?(_e=n.jsx(Ss,{className:"h-3.5 w-3.5"}),e[35]=_e):_e=e[35];let fe;e[36]!==te||e[37]!==ne||e[38]!==me?(fe=n.jsx(te,{type:Fe,variant:Ce,size:xe,"aria-label":ne,className:me,onClick:wi,onPointerDown:Ri,children:_e}),e[36]=te,e[37]=ne,e[38]=me,e[39]=fe):fe=e[39];let pe;e[40]!==ke||e[41]!==fe?(pe=n.jsx(ke,{asChild:F,children:fe}),e[40]=ke,e[41]=fe,e[42]=pe):pe=e[42];let se;e[43]!==g?(se=_=>{_.stopPropagation(),g()},e[43]=g,e[44]=se):se=e[44];let Me;e[45]===Symbol.for("react.memo_cache_sentinel")?(Me=n.jsx(bs,{className:"h-4 w-4"}),e[45]=Me):Me=e[45];let je;e[46]!==b?(je=b("sectionsEditor.sectionList.duplicateMenuItem"),e[46]=b,e[47]=je):je=e[47];let le;e[48]!==se||e[49]!==je?(le=n.jsxs(vt,{onClick:se,children:[Me,je]}),e[48]=se,e[49]=je,e[50]=le):le=e[50];let I;e[51]!==W||e[52]!==V||e[53]!==b?(I=W&&n.jsxs(vt,{className:za,onClick:_=>{_.stopPropagation(),V()},children:[n.jsx(ni,{className:"h-4 w-4"}),b("sectionsEditor.sectionList.addVariantMenuItem")]}),e[51]=W,e[52]=V,e[53]=b,e[54]=I):I=e[54];let Ee;e[55]!==Pe||e[56]!==k||e[57]!==b?(Ee=Pe&&n.jsxs(vt,{className:bi,onClick:_=>{_.stopPropagation(),k()},children:[n.jsx(yn,{className:"h-4 w-4"}),b("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[55]=Pe,e[56]=k,e[57]=b,e[58]=Ee):Ee=e[58];let ge;e[59]!==c||e[60]!==o.isMultivariate||e[61]!==o.isSavedBlock||e[62]!==b?(ge=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(vt,{onClick:_=>{_.stopPropagation(),c()},children:[n.jsx(yn,{className:"h-4 w-4"}),b("sectionsEditor.sectionList.detachMenuItem")]}),e[59]=c,e[60]=o.isMultivariate,e[61]=o.isSavedBlock,e[62]=b,e[63]=ge):ge=e[63];let ce;e[64]!==y?(ce=_=>{_.stopPropagation(),y()},e[64]=y,e[65]=ce):ce=e[65];let he;e[66]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(ys,{className:"h-4 w-4"}),e[66]=he):he=e[66];let X;e[67]!==b?(X=b("sectionsEditor.sectionList.deleteMenuItem"),e[67]=b,e[68]=X):X=e[68];let ue;e[69]!==ce||e[70]!==X?(ue=n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:ce,children:[he,X]}),e[69]=ce,e[70]=X,e[71]=ue):ue=e[71];let ve;e[72]!==le||e[73]!==I||e[74]!==Ee||e[75]!==ge||e[76]!==ue?(ve=n.jsxs(js,{align:"end",className:"w-44",children:[le,I,Ee,ge,ue]}),e[72]=le,e[73]=I,e[74]=Ee,e[75]=ge,e[76]=ue,e[77]=ve):ve=e[77];let Te;return e[78]!==Oe||e[79]!==pe||e[80]!==ve?(Te=n.jsxs(Oe,{children:[pe,ve]}),e[78]=Oe,e[79]=pe,e[80]=ve,e[81]=Te):Te=e[81],n.jsxs("div",{ref:m,style:oe,...Ke,...J,role:"button",tabIndex:0,onClick:v,onKeyDown:ee,className:Q,children:[ie,!o.isMultivariate&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":b(w?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Ue(bn(D,w)),onClick:_=>{_.stopPropagation(),M()},onPointerDown:Ti,children:n.jsx(si,{className:Ue("h-3.5 w-3.5",w&&"text-yellow-500")})})}),n.jsx(Tt,{side:"bottom",children:b(w?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":ye,className:Ue(bn(D,l)),onClick:re,onPointerDown:ki,children:K})}),Le]}),Te]})}function Ri(d){return d.stopPropagation()}function wi(d){return d.stopPropagation()}function ki(d){return d.stopPropagation()}function Ti(d){return d.stopPropagation()}function Vi(){return!1}function Di(d){const e=st.c(104),{listKey:o,rawSections:u,sections:p,meta:x,selectedIndex:j,onSelect:v,onReorder:y,onDelete:g,onDuplicate:k,onMakeReusable:L,onToggleHidden:M,onToggleLazy:V,onAddVariant:c,onDetach:b,onAddSection:w,canAddSection:l}=d,D=l===void 0?!0:l,i=Vt();let W;e[0]!==p.length?(W=()=>Yn(p.length),e[0]=p.length,e[1]=W):W=e[1];const[U,Ke]=R.useState(W),[J,m]=R.useState(null),[C,we]=R.useState(o),[N,Z]=R.useState(p.length),T=R.useRef(!1);C!==o?(we(o),Z(p.length),Ke(Yn(p.length))):N!==p.length&&(Z(p.length),Ke(Te=>yi(Te,p.length)));let oe;e[2]===Symbol.for("react.memo_cache_sentinel")?(oe={activationConstraint:{distance:8}},e[2]=oe):oe=e[2];let B;e[3]===Symbol.for("react.memo_cache_sentinel")?(B={coordinateGetter:ms},e[3]=B):B=e[3];const Pe=ss(Xt(rs,oe),Xt(is,B));let ee;e[4]!==U?(ee=U.map(Ni),e[4]=U,e[5]=ee):ee=e[5];const de=ee;let Q;e[6]===Symbol.for("react.memo_cache_sentinel")?(Q=Te=>{m(String(Te.active.id))},e[6]=Q):Q=e[6];const ie=Q;let ye;e[7]!==de||e[8]!==y?(ye=Te=>{m(null);const{active:_,over:Se}=Te;if(!Se||_.id===Se.id)return;const ae=de.indexOf(String(_.id)),Ve=de.indexOf(String(Se.id));ae===-1||Ve===-1||(Ke($e=>Rs(Lt([...$e],ae,Ve))),T.current=!0,requestAnimationFrame(()=>{T.current=!1}),y?.(ae,Ve))},e[7]=de,e[8]=y,e[9]=ye):ye=e[9];const re=ye;let K;e[10]===Symbol.for("react.memo_cache_sentinel")?(K=()=>{m(null)},e[10]=K):K=e[10];const qe=K;let Le,Oe,ke,F,te,Fe,Ce,xe,ne,me,_e,fe,pe,se,Me;if(e[11]!==J||e[12]!==D||e[13]!==U||e[14]!==de||e[15]!==re||e[16]!==x||e[17]!==w||e[18]!==c||e[19]!==g||e[20]!==b||e[21]!==k||e[22]!==L||e[23]!==v||e[24]!==M||e[25]!==V||e[26]!==u||e[27]!==p||e[28]!==j||e[29]!==Pe||e[30]!==i){se=Symbol.for("react.early_return_sentinel");e:{const Te=_=>{T.current||v(_)};if(e[46]!==J||e[47]!==D||e[48]!==U||e[49]!==w||e[50]!==u||e[51]!==p||e[52]!==i){const _=J?U.find(Se=>Se.id===J):null;if(F=_!=null?p[_.index]:null,ke=_!=null?u[_.index]:void 0,U.length===0){let Se;e[56]!==i?(Se=i("sectionsEditor.sectionList.noSections"),e[56]=i,e[57]=Se):Se=e[57];let ae;e[58]!==Se?(ae=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Se}),e[58]=Se,e[59]=ae):ae=e[59];const Ve=!D;let $e;e[60]===Symbol.for("react.memo_cache_sentinel")?($e=n.jsx(xn,{size:14}),e[60]=$e):$e=e[60];let ct;e[61]!==i?(ct=i("sectionsEditor.sectionList.addSectionButton"),e[61]=i,e[62]=ct):ct=e[62];let De;e[63]!==w||e[64]!==Ve||e[65]!==ct?(De=n.jsxs(tt,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ve,onClick:w,children:[$e,ct]}),e[63]=w,e[64]=Ve,e[65]=ct,e[66]=De):De=e[66];let Xe;e[67]!==ae||e[68]!==De?(Xe=n.jsxs("div",{className:"space-y-2",children:[ae,De]}),e[67]=ae,e[68]=De,e[69]=Xe):Xe=e[69],se=Xe;break e}pe=Ue(_&&"cursor-grabbing"),e[46]=J,e[47]=D,e[48]=U,e[49]=w,e[50]=u,e[51]=p,e[52]=i,e[53]=ke,e[54]=F,e[55]=pe}else ke=e[53],F=e[54],pe=e[55];Oe=fs,xe=Pe,ne=ps,me=ie,_e=re,fe=qe,Le=gs,Fe=de,Ce=hs,Me="space-y-1",te=U.map(_=>{const Se=p[_.index];return Se?n.jsx(Ei,{sortableId:_.id,section:Se,raw:u[_.index],meta:x,selected:j===_.index,onSelect:()=>Te(_.index),onDelete:()=>g(_.index),onDuplicate:()=>k(_.index),onMakeReusable:()=>L(_.index),onToggleHidden:()=>M(_.index),onToggleLazy:()=>V(_.index),onAddVariant:()=>c(_.index),onDetach:()=>b(_.index)},_.id):null})}e[11]=J,e[12]=D,e[13]=U,e[14]=de,e[15]=re,e[16]=x,e[17]=w,e[18]=c,e[19]=g,e[20]=b,e[21]=k,e[22]=L,e[23]=v,e[24]=M,e[25]=V,e[26]=u,e[27]=p,e[28]=j,e[29]=Pe,e[30]=i,e[31]=Le,e[32]=Oe,e[33]=ke,e[34]=F,e[35]=te,e[36]=Fe,e[37]=Ce,e[38]=xe,e[39]=ne,e[40]=me,e[41]=_e,e[42]=fe,e[43]=pe,e[44]=se,e[45]=Me}else Le=e[31],Oe=e[32],ke=e[33],F=e[34],te=e[35],Fe=e[36],Ce=e[37],xe=e[38],ne=e[39],me=e[40],_e=e[41],fe=e[42],pe=e[43],se=e[44],Me=e[45];if(se!==Symbol.for("react.early_return_sentinel"))return se;let je;e[70]!==te||e[71]!==Me?(je=n.jsx("div",{className:Me,children:te}),e[70]=te,e[71]=Me,e[72]=je):je=e[72];let le;e[73]!==Le||e[74]!==Fe||e[75]!==Ce||e[76]!==je?(le=n.jsx(Le,{items:Fe,strategy:Ce,children:je}),e[73]=Le,e[74]=Fe,e[75]=Ce,e[76]=je,e[77]=le):le=e[77];let I;e[78]!==ke||e[79]!==F||e[80]!==x?(I=F?n.jsx("div",{className:Ue("cursor-grabbing shadow-lg ring-1 ring-border/60",ks(F,!1)),children:n.jsx(ws,{section:F,raw:ke,meta:x})}):null,e[78]=ke,e[79]=F,e[80]=x,e[81]=I):I=e[81];let Ee;e[82]!==I?(Ee=es.createPortal(n.jsx(as,{dropAnimation:os,children:I}),document.body),e[82]=I,e[83]=Ee):Ee=e[83];let ge;e[84]!==Oe||e[85]!==xe||e[86]!==ne||e[87]!==me||e[88]!==_e||e[89]!==fe||e[90]!==le||e[91]!==Ee?(ge=n.jsxs(Oe,{sensors:xe,collisionDetection:ne,onDragStart:me,onDragEnd:_e,onDragCancel:fe,children:[le,Ee]}),e[84]=Oe,e[85]=xe,e[86]=ne,e[87]=me,e[88]=_e,e[89]=fe,e[90]=le,e[91]=Ee,e[92]=ge):ge=e[92];const ce=!D;let he;e[93]===Symbol.for("react.memo_cache_sentinel")?(he=n.jsx(xn,{size:14}),e[93]=he):he=e[93];let X;e[94]!==i?(X=i("sectionsEditor.sectionList.addSectionButton"),e[94]=i,e[95]=X):X=e[95];let ue;e[96]!==w||e[97]!==ce||e[98]!==X?(ue=n.jsxs(tt,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:ce,onClick:w,children:[he,X]}),e[96]=w,e[97]=ce,e[98]=X,e[99]=ue):ue=e[99];let ve;return e[100]!==pe||e[101]!==ge||e[102]!==ue?(ve=n.jsxs("div",{className:pe,children:[ge,ue]}),e[100]=pe,e[101]=ge,e[102]=ue,e[103]=ve):ve=e[103],ve}function Ni(d){return d.id}function Jn(d){const e=st.c(57),{open:o,initialName:u,autoLabel:p,isPending:x,onSubmit:j,onOpenChange:v}=d,y=x===void 0?!1:x,g=Vt(),[k,L]=R.useState(u),[M,V]=R.useState(o);o!==M&&(V(o),o&&L(u));let c;e[0]!==y||e[1]!==v?(c=ie=>{!ie&&!y&&v(!1)},e[0]=y,e[1]=v,e[2]=c):c=e[2];const b=c;let w;e[3]!==y||e[4]!==k||e[5]!==j?(w=async ie=>{ie.preventDefault(),!y&&await j(k.trim())},e[3]=y,e[4]=k,e[5]=j,e[6]=w):w=e[6];const l=w;let D;e[7]!==g?(D=g("sectionsEditor.variantRenameDialog.title"),e[7]=g,e[8]=D):D=e[8];let i;e[9]!==D?(i=n.jsx(qo,{children:D}),e[9]=D,e[10]=i):i=e[10];let W;e[11]!==p||e[12]!==g?(W=g("sectionsEditor.variantRenameDialog.description",{fallback:p||g("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=p,e[12]=g,e[13]=W):W=e[13];let U;e[14]!==W?(U=n.jsx(Wo,{children:W}),e[14]=W,e[15]=U):U=e[15];let Ke;e[16]!==i||e[17]!==U?(Ke=n.jsxs(Yo,{children:[i,U]}),e[16]=i,e[17]=U,e[18]=Ke):Ke=e[18];let J;e[19]!==g?(J=g("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=g,e[20]=J):J=e[20];let m;e[21]!==J?(m=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:J}),e[21]=J,e[22]=m):m=e[22];let C;e[23]===Symbol.for("react.memo_cache_sentinel")?(C=ie=>L(ie.target.value),e[23]=C):C=e[23];let we;e[24]!==p||e[25]!==y||e[26]!==k?(we=n.jsx(Zo,{id:"variant-rename-name",value:k,onChange:C,placeholder:p,autoFocus:!0,disabled:y}),e[24]=p,e[25]=y,e[26]=k,e[27]=we):we=e[27];let N;e[28]!==m||e[29]!==we?(N=n.jsxs("div",{className:"space-y-1.5 py-4",children:[m,we]}),e[28]=m,e[29]=we,e[30]=N):N=e[30];let Z;e[31]!==v?(Z=()=>v(!1),e[31]=v,e[32]=Z):Z=e[32];let T;e[33]!==g?(T=g("sectionsEditor.variantRenameDialog.cancel"),e[33]=g,e[34]=T):T=e[34];let oe;e[35]!==y||e[36]!==Z||e[37]!==T?(oe=n.jsx(tt,{type:"button",variant:"outline",onClick:Z,disabled:y,children:T}),e[35]=y,e[36]=Z,e[37]=T,e[38]=oe):oe=e[38];let B;e[39]!==y||e[40]!==g?(B=y?n.jsxs(n.Fragment,{children:[n.jsx(ts,{className:"size-3.5"}),g("sectionsEditor.variantRenameDialog.saving")]}):g("sectionsEditor.variantRenameDialog.save"),e[39]=y,e[40]=g,e[41]=B):B=e[41];let Pe;e[42]!==y||e[43]!==B?(Pe=n.jsx(tt,{type:"submit",disabled:y,children:B}),e[42]=y,e[43]=B,e[44]=Pe):Pe=e[44];let ee;e[45]!==oe||e[46]!==Pe?(ee=n.jsxs(Jo,{children:[oe,Pe]}),e[45]=oe,e[46]=Pe,e[47]=ee):ee=e[47];let de;e[48]!==l||e[49]!==N||e[50]!==ee||e[51]!==Ke?(de=n.jsx(Qo,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:l,children:[Ke,N,ee]})}),e[48]=l,e[49]=N,e[50]=ee,e[51]=Ke,e[52]=de):de=e[52];let Q;return e[53]!==b||e[54]!==o||e[55]!==de?(Q=n.jsx(Xo,{open:o,onOpenChange:b,children:de}),e[53]=b,e[54]=o,e[55]=de,e[56]=Q):Q=e[56],Q}function Ts(d){const e=st.c(5),{rule:o,matchers:u}=d,p=o?.__resolveType??"";let x;if(e[0]!==u||e[1]!==p){const g=u.find(k=>k.resolveType===p)?.iconName??Ua(p);x=Fo(g),e[0]=u,e[1]=p,e[2]=x}else x=e[2];const j=x;if(!j)return null;let v;return e[3]!==j?(v=n.jsx(j,{size:14,className:"shrink-0"}),e[3]=j,e[4]=v):v=e[4],v}function Qn(d){return d.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
|
|
2
|
+
`)}function Xn(d){return d.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function Ai(d,e){const o=new Map;for(const u of d){const p=o.get(u.variant.label);p?p.push(u):o.set(u.variant.label,[u])}return e.map((u,p)=>({id:o.get(u.label)?.shift()?.id??crypto.randomUUID(),index:p,variant:u}))}function Pi(d){return d.map((e,o)=>({...e,index:o}))}function Vs(d){const e=st.c(17),{label:o,effectiveRule:u,matchers:p,canDelete:x,dragging:j,onRename:v,onDuplicate:y,onDelete:g}=d,k=Vt();let L;e[0]!==u||e[1]!==p?(L=n.jsx(Ts,{rule:u,matchers:p}),e[0]=u,e[1]=p,e[2]=L):L=e[2];let M;e[3]!==o?(M=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[3]=o,e[4]=M):M=e[4];let V;e[5]!==x||e[6]!==j||e[7]!==o||e[8]!==g||e[9]!==y||e[10]!==v||e[11]!==k?(V=!j&&n.jsxs(_s,{children:[n.jsx(xs,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":k("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Mi,onPointerDown:Ci,children:n.jsx(Ss,{size:14})})}),n.jsxs(js,{align:"end",className:"w-36",children:[n.jsxs(vt,{onClick:b=>{b.stopPropagation(),v?.()},children:[n.jsx(ci,{size:14}),k("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(vt,{onClick:b=>{b.stopPropagation(),y?.()},children:[n.jsx(bs,{size:14}),k("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(ai,{}),n.jsxs(vt,{variant:"destructive",disabled:!x,onClick:b=>{b.stopPropagation(),g?.()},children:[n.jsx(ys,{size:14}),k("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=x,e[6]=j,e[7]=o,e[8]=g,e[9]=y,e[10]=v,e[11]=k,e[12]=V):V=e[12];let c;return e[13]!==L||e[14]!==M||e[15]!==V?(c=n.jsxs(n.Fragment,{children:[L,M,V]}),e[13]=L,e[14]=M,e[15]=V,e[16]=c):c=e[16],c}function Ci(d){return d.stopPropagation()}function Mi(d){return d.stopPropagation()}function Ki(d){const e=st.c(33),{entry:o,isActive:u,canDelete:p,decofile:x,meta:j,matchers:v,onSelect:y,onRename:g,onDuplicate:k,onDelete:L}=d;let M;e[0]!==o.id?(M={id:o.id,animateLayoutChanges:Li},e[0]=o.id,e[1]=M):M=e[1];const{attributes:V,listeners:c,setNodeRef:b,transform:w,isDragging:l}=cs(M);let D;e[2]!==w?(D=us.Transform.toString(w?{...w,x:0}:null),e[2]=w,e[3]=D):D=e[3];const i=l?0:void 0;let W;e[4]!==D||e[5]!==i?(W={transform:D,opacity:i},e[4]=D,e[5]=i,e[6]=W):W=e[6];const U=W,Ke=j??void 0;let J;e[7]!==x||e[8]!==o.variant.rule||e[9]!==Ke?(J=Bt(o.variant.rule,x,Ke),e[7]=x,e[8]=o.variant.rule,e[9]=Ke,e[10]=J):J=e[10];const m=J;let C;e[11]!==y?(C=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),y())},e[11]=y,e[12]=C):C=e[12];const we=l?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",N=u?vs:ds;let Z;e[13]!==we||e[14]!==N?(Z=Ue("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",we,N),e[13]=we,e[14]=N,e[15]=Z):Z=e[15];let T;e[16]!==p||e[17]!==m||e[18]!==o.variant.label||e[19]!==v||e[20]!==L||e[21]!==k||e[22]!==g?(T=n.jsx(Vs,{label:o.variant.label,effectiveRule:m,matchers:v,canDelete:p,onRename:g,onDuplicate:k,onDelete:L}),e[16]=p,e[17]=m,e[18]=o.variant.label,e[19]=v,e[20]=L,e[21]=k,e[22]=g,e[23]=T):T=e[23];let oe;return e[24]!==V||e[25]!==c||e[26]!==y||e[27]!==b||e[28]!==U||e[29]!==Z||e[30]!==T||e[31]!==C?(oe=n.jsx("div",{ref:b,style:U,...V,...c,onClick:y,onKeyDown:C,className:Z,children:T}),e[24]=V,e[25]=c,e[26]=y,e[27]=b,e[28]=U,e[29]=Z,e[30]=T,e[31]=C,e[32]=oe):oe=e[32],oe}function Li(){return!1}function Bi(d){const e=st.c(9),{variant:o,decofile:u,meta:p,matchers:x}=d,j=p??void 0;let v;e[0]!==u||e[1]!==j||e[2]!==o.rule?(v=Bt(o.rule,u,j),e[0]=u,e[1]=j,e[2]=o.rule,e[3]=v):v=e[3];const y=v;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ue("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",vs),e[4]=g):g=e[4];let k;return e[5]!==y||e[6]!==x||e[7]!==o.label?(k=n.jsx("div",{className:g,children:n.jsx(Vs,{label:o.label,effectiveRule:y,matchers:x,canDelete:!1,dragging:!0})}),e[5]=y,e[6]=x,e[7]=o.label,e[8]=k):k=e[8],k}function Ii(d){const e=st.c(91),{listKey:o,variants:u,activeIndex:p,decofile:x,meta:j,matchers:v,onSelect:y,onReorder:g,onRename:k,onDuplicate:L,onDelete:M,onAdd:V}=d,c=Vt();let b;e[0]!==u?(b=()=>Xn(u),e[0]=u,e[1]=b):b=e[1];const[w,l]=R.useState(b),[D,i]=R.useState(null),[W,U]=R.useState(o),[Ke,J]=R.useState(u.length);let m;e[2]!==u?(m=()=>Qn(u),e[2]=u,e[3]=m):m=e[3];const[C,we]=R.useState(m),N=R.useRef(!1),Z=Qn(u);W!==o?(U(o),J(u.length),we(Z),l(Xn(u))):(Ke!==u.length||C!==Z)&&(J(u.length),we(Z),l(ge=>Ai(ge,u)));let T;e[4]===Symbol.for("react.memo_cache_sentinel")?(T={activationConstraint:{distance:8}},e[4]=T):T=e[4];let oe;e[5]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:ms},e[5]=oe):oe=e[5];const B=ss(Xt(rs,T),Xt(is,oe));let Pe;e[6]!==w?(Pe=w.map(Oi),e[6]=w,e[7]=Pe):Pe=e[7];const ee=Pe,de=u.length>1;let Q;e[8]!==w?(Q=ge=>{const ce=String(ge.active.id);i(w.find(he=>he.id===ce)??null)},e[8]=w,e[9]=Q):Q=e[9];const ie=Q;let ye;e[10]!==ee||e[11]!==g?(ye=ge=>{i(null);const{active:ce,over:he}=ge;if(!he||ce.id===he.id)return;const X=ee.indexOf(String(ce.id)),ue=ee.indexOf(String(he.id));X===-1||ue===-1||(l(ve=>Pi(Lt([...ve],X,ue))),N.current=!0,requestAnimationFrame(()=>{N.current=!1}),g(X,ue))},e[10]=ee,e[11]=g,e[12]=ye):ye=e[12];const re=ye;let K;e[13]===Symbol.for("react.memo_cache_sentinel")?(K=()=>{i(null)},e[13]=K):K=e[13];const qe=K;let Le,Oe,ke,F,te,Fe,Ce,xe,ne,me,_e,fe,pe;if(e[14]!==p||e[15]!==de||e[16]!==x||e[17]!==w||e[18]!==ee||e[19]!==re||e[20]!==ie||e[21]!==v||e[22]!==j||e[23]!==V||e[24]!==M||e[25]!==L||e[26]!==k||e[27]!==y||e[28]!==B||e[29]!==c){const ge=ae=>{N.current||y(ae)};_e="space-y-1 border-b p-2";let ce;e[43]!==c?(ce=c("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=c,e[44]=ce):ce=e[44];let he;e[45]!==ce?(he=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:ce}),e[45]=ce,e[46]=he):he=e[46];let X;e[47]!==c?(X=c("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=c,e[48]=X):X=e[48];let ue;e[49]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(xn,{size:14}),e[49]=ue):ue=e[49];let ve;e[50]!==V||e[51]!==X?(ve=n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":X,className:"size-6",onClick:V,children:ue})}),e[50]=V,e[51]=X,e[52]=ve):ve=e[52];let Te;e[53]!==c?(Te=c("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=c,e[54]=Te):Te=e[54];let _;e[55]!==Te?(_=n.jsx(Tt,{children:Te}),e[55]=Te,e[56]=_):_=e[56];let Se;e[57]!==ve||e[58]!==_?(Se=n.jsxs(wt,{children:[ve,_]}),e[57]=ve,e[58]=_,e[59]=Se):Se=e[59],e[60]!==he||e[61]!==Se?(fe=n.jsxs("div",{className:"flex items-center justify-between",children:[he,Se]}),e[60]=he,e[61]=Se,e[62]=fe):fe=e[62],Oe=fs,Fe=B,Ce=ps,xe=ie,ne=re,me=qe,Le=gs,F=ee,te=hs,pe="space-y-0.5",ke=w.map(ae=>n.jsx(Ki,{entry:ae,isActive:ae.index===p,canDelete:de,decofile:x,meta:j,matchers:v,onSelect:()=>ge(ae.index),onRename:()=>k(ae.index),onDuplicate:()=>L(ae.index),onDelete:()=>M(ae.index)},ae.id)),e[14]=p,e[15]=de,e[16]=x,e[17]=w,e[18]=ee,e[19]=re,e[20]=ie,e[21]=v,e[22]=j,e[23]=V,e[24]=M,e[25]=L,e[26]=k,e[27]=y,e[28]=B,e[29]=c,e[30]=Le,e[31]=Oe,e[32]=ke,e[33]=F,e[34]=te,e[35]=Fe,e[36]=Ce,e[37]=xe,e[38]=ne,e[39]=me,e[40]=_e,e[41]=fe,e[42]=pe}else Le=e[30],Oe=e[31],ke=e[32],F=e[33],te=e[34],Fe=e[35],Ce=e[36],xe=e[37],ne=e[38],me=e[39],_e=e[40],fe=e[41],pe=e[42];let se;e[63]!==ke||e[64]!==pe?(se=n.jsx("div",{className:pe,children:ke}),e[63]=ke,e[64]=pe,e[65]=se):se=e[65];let Me;e[66]!==Le||e[67]!==F||e[68]!==te||e[69]!==se?(Me=n.jsx(Le,{items:F,strategy:te,children:se}),e[66]=Le,e[67]=F,e[68]=te,e[69]=se,e[70]=Me):Me=e[70];let je;e[71]!==D||e[72]!==x||e[73]!==v||e[74]!==j?(je=D?n.jsx(Bi,{variant:D.variant,decofile:x,meta:j,matchers:v}):null,e[71]=D,e[72]=x,e[73]=v,e[74]=j,e[75]=je):je=e[75];let le;e[76]!==je?(le=es.createPortal(n.jsx(as,{dropAnimation:os,children:je}),document.body),e[76]=je,e[77]=le):le=e[77];let I;e[78]!==Oe||e[79]!==Fe||e[80]!==Ce||e[81]!==xe||e[82]!==ne||e[83]!==me||e[84]!==Me||e[85]!==le?(I=n.jsxs(Oe,{sensors:Fe,collisionDetection:Ce,onDragStart:xe,onDragEnd:ne,onDragCancel:me,children:[Me,le]}),e[78]=Oe,e[79]=Fe,e[80]=Ce,e[81]=xe,e[82]=ne,e[83]=me,e[84]=Me,e[85]=le,e[86]=I):I=e[86];let Ee;return e[87]!==_e||e[88]!==fe||e[89]!==I?(Ee=n.jsxs("div",{className:_e,children:[fe,I]}),e[87]=_e,e[88]=fe,e[89]=I,e[90]=Ee):Ee=e[90],Ee}function Oi(d){return d.id}function Zn(d){const e=st.c(21),{currentRt:o,currentLabel:u,currentGlobalKey:p,matchers:x,globals:j,onSelect:v,onSelectGlobal:y,schema:g,formValue:k,onChange:L,formKey:M,formWrapperClassName:V,meta:c,decofile:b,onSaveReferencedBlock:w,sandbox:l}=d;let D;e[0]!==p||e[1]!==u||e[2]!==o||e[3]!==j||e[4]!==x||e[5]!==v||e[6]!==y?(D=n.jsx(Ga,{currentRt:o,currentLabel:u,currentGlobalKey:p,matchers:x,globals:j,onSelect:v,onSelectGlobal:y}),e[0]=p,e[1]=u,e[2]=o,e[3]=j,e[4]=x,e[5]=v,e[6]=y,e[7]=D):D=e[7];let i;e[8]!==b||e[9]!==M||e[10]!==k||e[11]!==V||e[12]!==c||e[13]!==L||e[14]!==w||e[15]!==l||e[16]!==g?(i=g&&k&&n.jsx("div",{className:V,children:n.jsx(qa,{schema:g,value:k,onChange:L,meta:c,decofile:b,onSaveReferencedBlock:w,sandbox:l},M)}),e[8]=b,e[9]=M,e[10]=k,e[11]=V,e[12]=c,e[13]=L,e[14]=w,e[15]=l,e[16]=g,e[17]=i):i=e[17];let W;return e[18]!==D||e[19]!==i?(W=n.jsxs(n.Fragment,{children:[D,i]}),e[18]=D,e[19]=i,e[20]=W):W=e[20],W}function Uc({orgSlug:d,virtualMcpId:e,branch:o,previewReady:u=!0,previewUrl:p,currentPath:x,activePageBlockKey:j=null,activeGlobalBlockKey:v=null,externalSelection:y,onSaved:g,initialEditSeo:k=!1,onExitSeo:L,onViewJsonFile:M,onVariantPreviewOverride:V}){const c=Vt(),b=La()?.taskId??null,w=u?{orgSlug:d,virtualMcpId:e,branch:o,threadId:b,previewUrl:p}:null,{data:l,isLoading:D}=Wa(w),{data:i,isLoading:W}=Ya(w),U=Ja(),Ke=U?.entity?.id===e?U.entity.metadata?.siteSlug??null:null,J=ui({virtualMcpId:e,sandboxUrl:p}),[m,C]=R.useState(null),[we,N]=R.useState(null),[Z,T]=R.useState(null),[oe,B]=R.useState(0),[Pe,ee]=R.useState(void 0),[de,Q]=R.useState(null),[ie,ye]=R.useState(null),[re,K]=R.useState([]),qe=R.useRef(null),[Le,Oe]=R.useState(re.length);Le!==re.length&&(Oe(re.length),requestAnimationFrame(()=>{qe.current&&(qe.current.scrollTop=0)}));const[ke,F]=R.useState(0),[te,Fe]=R.useState(null),[Ce,xe]=R.useState(null),[ne,me]=R.useState(null),[_e,fe]=R.useState(!0),[pe,se]=R.useState(!1),[Me,je]=R.useState(!1),le=R.useRef(null),[I,Ee]=R.useState(k),[ge,ce]=R.useState(k);k&&!ge&&(ce(!0),Ee(!0),C(null),N(null),T(null),K([])),!k&&ge&&ce(!1);const[he,X]=R.useState(null),[ue,ve]=R.useState(void 0),[Te,_]=R.useState([]),[Se,ae]=R.useState(0),[Ve,$e]=R.useState(0),[ct,De]=R.useState(null),[Xe,We]=R.useState(null),[_n,jn]=R.useState(null),Ds=Ma(),Ns=`${d}/${e}/${o}`,Zt=Qa({orgSlug:d,virtualMcpId:e,branch:o}),[As,Ps]=R.useState(x),[Cs,Ms]=R.useState(j),[Ks,Ls]=R.useState(v);(As!==x||Cs!==j||Ks!==v)&&(queueMicrotask(()=>Zt.flush()),Ps(x),Ms(j),Ls(v),C(null),N(null),T(null),B(0),Q(null),ye(null),$e(0),De(null),We(null),K([]),F(t=>t+1),Ee(!1),X(null),ve(void 0),_([]),ae(t=>t+1));const Ne=Xa({orgSlug:d,virtualMcpId:e,branch:o}),It=wo((t,s)=>{Ne.mutate({blockKey:t,data:s},{onSuccess:()=>g?.(),onError:a=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),en=Za({orgSlug:d,virtualMcpId:e,branch:o}),[Dt,Ot]=R.useState(!1),ze=R.useRef(null),at=R.useRef(null),ot=R.useRef(null),tn=R.useRef({}),Ze=R.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!u||D||W)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(ts,{className:"size-5 text-muted-foreground"})});if(!l||!i)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Bs=eo(l),Ae=!!v,Ye=Ae?null:to(Bs,x,j),E=Ae?v:Ye?.key??null,nn=Ae&&v?l[v]:void 0,En=Ae&&v&&nn?no(v,nn):Ae&&v?v:"",Ft=!Ae&&E&&l[E]?l[E]:null,sn=I&&l&&i&&E&&Ye?In(l,{kind:"page",pageKey:E,pageName:String(Ye.name??""),path:String(Ye.path??"")},i):null,Is=I?Ft?.seo:void 0,an=ue!==void 0?ue:Is,Os=I?so(an):void 0,Fs=sn?.seoTypeOptions??[],$s=I&&i?ao(i):"",Rn=he??Os??{},on=I&&sn?ii(Rn,sn):null,zs=I&&on&&oo(an)?qt(on,i):null,Hs=I?io(l,i)?.seoData:void 0,Ge=Ae?[{label:"Default",sections:[{__resolveType:v}]}]:ro(Ft?.sections,l??{}),Nt=Ge.length>1,Be=Math.min(oe,Ge.length-1),ut=Ge[Be],H=ut?.sections??[],He=Wt(H,l),rn=!Ae&&lo(Ft?.sections);if(Ae&&v&&_n!==v){jn(v);const t=H[0],s=He[0];if(t&&s){C(0),$e(0),K([]);const a=bt(t,s,l);a&&(N(a.data),T(a.resolveType),We(null),De(null))}}!Ae&&_n!==null&&jn(null),Ze.current={rawSections:H,parsedSections:He,decofile:l??{},activePageKey:E,pageVariants:Ge,variantIndex:Be,sectionVariantIndex:Ve,selectedSectionIndex:m};const Us=()=>({multivariate:rn,index:Be,variants:Ge.map(t=>({rule:t.rule}))}),ln=(t,s)=>{if(!V)return;if(!E||!rn||t.length<=1){V(null);return}const a=zn(E,{multivariate:!0,index:s,variants:t},l,i);V(a.length>0?a:null)},cn=V&&E&&rn&&Nt&&!D&&!W?E:null,[Gs,qs]=R.useState(null);if(cn!==Gs&&(qs(cn),cn)){const t=Ge.map(a=>({rule:a.rule})),s=Be;queueMicrotask(()=>ln(t,s))}const xt=(t,s,a)=>{if(!V)return;if(!E){V(null);return}const r=Us(),f=zn(E,r,l,i);if(!t||s<0){V(f.length>0?f:null);return}const S=No({pageKey:E,page:r,sectionIndex:s,sectionLazy:He[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:l,meta:i}),h=[...f,...S];V(h.length>0?h:null)},dt=(t,s,a,r=m??-1,f=!1)=>{const S=nt(t,s);if(!S){N(null),T(null),We(null),De(null),f&&xt(null,r,a);return}const A=On(S,ht)[a];if(!A){N(null),T(null),We(null),De(null),f&&xt(null,r,a);return}const Y=So(A.value,l);N(Y?.data??null),T(Y?.resolveType??null);const{resolveType:P,formValue:O}=Ct(A.rule,l,i??void 0);We(P),De(O),f&&xt(S,r,a)},At=y?.index;if(y!==void 0&&(y?.seq??null)!==Pe&&(ee(y?.seq??null),typeof At=="number")){const t=H[At],s=He[At];if(t&&s)if(C(At),$e(0),K([]),F(a=>a+1),s.isMultivariate)dt(t,s,0,At);else{const a=bt(t,s,l);a?(N(a.data),T(a.resolveType)):(N(null),T(null)),We(null),De(null)}}const $t={orgSlug:d,virtualMcpId:e,branch:o,threadId:b,previewUrl:p??void 0,siteSlug:Ke},un=Z&&i?qt(Z,i):null,Je=(t,s)=>{if(!E)return;ze.current&&(clearTimeout(ze.current),ze.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null);const a=Kt(l,E,t,Be,Ge);Ne.mutate({blockKey:E,data:a},{onSuccess:()=>s?.onSuccess?.()??g?.(),onError:r=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},_t=()=>{C(null),N(null),T(null),$e(0),De(null),We(null),K([]),F(t=>t+1)},Ws=(t,s)=>{ze.current&&clearTimeout(ze.current);const a=Ze.current.sectionVariantIndex;ze.current=setTimeout(()=>{const{rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:A,variantIndex:Y}=Ze.current,P=r[s];if(!P)return;const O=f[s];if(!O)return;if(O.isSavedBlock){const z=Po(P,O);if(!z)return;Ne.mutate({blockKey:z,data:t},{onSuccess:()=>g?.(),onError:G=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}if(!h)return;const $={...S[h]},Re=[...r];if(O.isMultivariate){const z=nt(P,O);if(!z||!h)return;const G=Co(z,a,t);Re[s]=yt(P,O,G)}else if(O.isHidden){const z=ls(P.__resolveType),G=z?{...P.section}:{...P},Ie=Array.isArray(G.variants)?[...G.variants]:[];Ie[0]&&(Ie[0]={...Ie[0],value:t}),G.variants=Ie,z?Re[s]={...P,section:G}:Re[s]=G}else O.isLazy?Re[s]={...P,section:t}:Re[s]=t;if(A.length>1){const z=$.sections,G=[...z?.variants??[]];G[Y]&&(G[Y]={...G[Y],value:Re}),$.sections={...z,variants:G}}else $.sections=Re;Ne.mutate({blockKey:h,data:$},{onSuccess:()=>g?.(),onError:z=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:z.message}))})},Sn)},Ys=t=>{C(t),$e(0),K([]),F(f=>f+1);const s=H[t],a=He[t];if(!s||!a)return;if(a.isMultivariate){dt(s,a,0,t);return}const r=bt(s,a,l);if(!r){N(null),T(null),We(null),De(null),xt(null,t,0);return}N(r.data),T(r.resolveType),We(null),De(null),xt(null,t,0)},wn=t=>{const s=t;N(s),m!==null&&Ws(s,m)},dn=t=>{if(!E||!l||!i||!Ye)return;const s={kind:"page",pageKey:E,pageName:String(Ye.name??""),path:String(Ye.path??"")},a=In(l,s,i);a&&Zt.save(E,()=>{const r=Ds.getQueryData(Ka.decofile(Ns))?.[E];if(!r||typeof r!="object"||r===null||Array.isArray(r))return null;const f={...r,...tn.current};return tn.current={},t?.raw!==void 0?{...f,seo:t.raw}:t?.inner!==void 0?li(s,a,f,t.inner):f})},Js=(t,s)=>{E&&(tn.current[t]=s,dn())},Qs=(t,s)=>{if(!E)return;const a=Lt([...H],t,s);m!==null&&(m===t?C(s):t<m&&s>=m?C(m-1):t>m&&s<=m&&C(m+1)),Je(a)},Xs=t=>{if(!E)return;const s=H.filter((a,r)=>r!==t);m===t?_t():m!==null&&m>t&&C(m-1),Je(s)},Zs=t=>{if(!E)return;const s=H[t];if(!s)return;const a=[...H];a.splice(t+1,0,Do(s)),m!==null&&m>t&&C(m+1),Je(a)},ea=t=>{if(!E)return;const s=H[t],a=He[t];if(!s||!a)return;const r=a.isHidden?To(s):Vo(s);if(!r)return;const f=[...H];f[t]=r,m===t&&_t(),Je(f)},ta=t=>{if(!E)return;const s=H[t],a=He[t];if(!s||!a||a.isMultivariate)return;const r=ko(s);if(!r)return;const f=[...H];f[t]=r,m===t&&_t(),Je(f)},na=t=>{if(!E)return;const s=H[t],a=He[t];if(!s||!a?.isSavedBlock)return;const r=bt(s,a,l);if(!r?.data)return;const{name:f,...S}=r.data,h=[...H];a.isLazy?h[t]={...s,section:S}:h[t]=S,m===t&&_t(),Je(h)},sa=t=>{if(!E)return;const s=[...H,{__resolveType:t.resolveType}],a=s.length-1;Je(s,{onSuccess:()=>{se(!1),C(a),$e(0),K([]),F(h=>h+1);const r=s[a],f=Wt(s,l)[a];if(!r||!f)return;if(f.isMultivariate){dt(r,f,0);return}const S=bt(r,f,l);if(!S){N(null),T(null),We(null),De(null);return}N(S.data),T(S.resolveType),We(null),De(null)}})},kn=t=>{le.current=t.append,se(!0)},aa=t=>{const s=le.current;if(!s){sa(t);return}s({__resolveType:t.resolveType}),se(!1),le.current=null},oa=t=>{if(m===null)return;const s=H[m],a=He[m];!s||!a?.isMultivariate||($e(t),K([]),F(r=>r+1),dt(s,a,t,m,!0))},ia=t=>{if(m===null||!E)return;const s=H[m],a=He[m];if(!s||!a?.isMultivariate)return;const r=nt(s,a);if(!r)return;const f=Eo(r,t);if(!f){q.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const S=[...H];S[m]=yt(s,a,f);const h=f.variants;let A=Ve;t===Ve?A=Math.min(t,h.length-1):t<Ve&&(A=Ve-1),$e(A),K([]),F(Y=>Y+1),dt(S[m],a,A),Je(S)},ra=t=>{if(m===null||!E)return;const s=H[m],a=He[m];if(!s||!a?.isMultivariate)return;const r=nt(s,a);if(!r)return;const f=Ro(r,t),S=[...H];S[m]=yt(s,a,f);const h=t+1;$e(h),K([]),F(A=>A+1),dt(S[m],a,h),Je(S)},la=(t,s)=>{if(m===null||!E||t===s)return;const a=H[m],r=He[m];if(!a||!r?.isMultivariate)return;const f=nt(a,r);if(!f)return;const S=_o(f,t,s),h=[...H];h[m]=yt(a,r,S);let A=Ve;Ve===t?A=s:t<Ve&&s>=Ve?A=Ve-1:t>Ve&&s<=Ve&&(A=Ve+1),$e(A),dt(h[m],r,A),Je(h)},mn=t=>{const s=t??m;if(s===null||!E)return;const a=H[s],r=He[s];if(!a||!r)return;const f=bo(a,r);if(!f){q.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const S=[...H];S[s]=f.section;const h=Wt(S,l)[s];if(!h?.isMultivariate){q.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}C(s),$e(f.newVariantIndex),K([]),F(A=>A+1),dt(f.section,h,f.newVariantIndex,s),Je(S)},ca=()=>{if(m===null||!E)return;const t=H[m],s=He[m];if(!t||!s?.isMultivariate)return;const a=nt(t,s);if(!a)return;const r=jo(t,s,a);if(!r){q.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const f=[...H];f[m]=r;const S=Wt(f,l)[m];if(!S)return;$e(0),We(null),De(null),K([]),F(A=>A+1);const h=bt(r,S,l);h?(N(h.data),T(h.resolveType)):(N(null),T(null)),xt(null,m,0),Je(f)},ua=async t=>{if(te===null||!E)return;const s=vn(t,l);if(s){q.error(s);return}const a=H[te],r=He[te];if(!a||!r)return;const f=bt(a,r,l);if(!f){q.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const S={...f.data,name:t};try{await Ne.mutateAsync({blockKey:t,data:S});const h=[...H];h[te]={__resolveType:t},await Ne.mutateAsync({blockKey:E,data:Kt(l,E,h,Be,Ge)}),m===te&&_t(),Fe(null),q.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),g?.()}catch(h){q.error(h instanceof Error?h.message:c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},Tn=ut?.rule;if(Nt&&m===null&&ie===null&&Tn){const{resolveType:t,formValue:s}=Ct(Tn,l??{},i??void 0);ye(t),Q(s)}const zt=i?co(i):[],Vn=i&&l?uo(i,l):[],da=!Ae&&!!(J&&i&&l),ma=ie&&i?qt(ie,i):null,jt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},Pt=async(t,s)=>{if(!(Ao(s,t,i)>0))try{await en.mutateAsync({blockKey:t})}catch(a){q.error(a instanceof Error?a.message:c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Dn=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:r}=Ze.current;if(!s)return;const f={...a[s]},S={...f.sections},h=[...S.variants??[]],A=h[r],Y=A?.rule;if(Et(Y,a,i)){const P=Y?.__resolveType??"",O=a[P],$=typeof O?.name=="string"?O.name:P,{__resolveType:Re,...z}=t;Ne.mutate({blockKey:P,data:Rt(Re??"",z,$)},{onSuccess:()=>g?.(),onError:G=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))});return}A&&(h[r]={...A,rule:t}),f.sections={...S,variants:h},Ne.mutate({blockKey:s,data:f},{onSuccess:()=>g?.(),onError:P=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:P.message}))})},Sn)},fa=t=>{ye(t);const s=t?Un(t,i):{__resolveType:Gn};Q(t?s:{}),Dn(s)},pa=t=>{const s=t;Q(s);const a=ie?{__resolveType:ie,...s}:{...s};Dn(a)},ga=async t=>{jt();const{activePageKey:s,decofile:a,variantIndex:r}=Ze.current;if(!s)return;const f=a[s],S=f?.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const h=S;if(!Array.isArray(h.variants))return;const A=[...h.variants],Y=A[r];if(!Y)return;const P=Mt(Y.rule,a,i),O=Jt(t);A[r]={...Y,rule:O};const $={...a,[s]:{...f,sections:{...h,variants:A}}},{resolveType:Re,formValue:z}=Ct(O,$,i??void 0);ye(Re),Q(z);try{await Ne.mutateAsync({blockKey:s,data:$[s]}),P&&P!==t&&await Pt(P,$),g?.()}catch(G){q.error(G instanceof Error?G.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Nn=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Ze.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:A,variantIndex:Y}=Ze.current;if(!h)return;const P=r[s],O=f[s];if(!P||!O?.isMultivariate)return;const $=nt(P,O);if(!$)return;const z=($.variants??[])[a]?.rule;if(Et(z,S,i)){const be=z?.__resolveType??"",Qe=S[be],rt=typeof Qe?.name=="string"?Qe.name:be,{__resolveType:pt,...lt}=t;Ne.mutate({blockKey:be,data:Rt(pt??"",lt,rt)},{onSuccess:()=>g?.(),onError:gt=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const G=Hn($,a,t),Ie=[...r];Ie[s]=yt(P,O,G);const et=Kt(S,h,Ie,Y,A);Ne.mutate({blockKey:h,data:et},{onSuccess:()=>g?.(),onError:be=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:be.message}))})},Sn))},ha=t=>{We(t);const s=t?Un(t,i):{__resolveType:Gn};De(t?s:{}),Nn(s)},va=t=>{const s=t;De(s);const a=Xe?{__resolveType:Xe,...s}:{...s};Nn(a)},Sa=async t=>{jt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:A,variantIndex:Y}=Ze.current;if(s===null||!h)return;const P=r[s],O=f[s];if(!P||!O?.isMultivariate)return;const $=nt(P,O);if(!$)return;const Re=$.variants??[],z=Mt(Re[a]?.rule,S,i),G=Jt(t),Ie=Hn($,a,G),et=[...r];et[s]=yt(P,O,Ie);const be=Kt(S,h,et,Y,A),Qe={...S,[h]:be},{resolveType:rt,formValue:pt}=Ct(G,Qe,i??void 0);We(rt),De(pt);try{await Ne.mutateAsync({blockKey:h,data:be}),z&&z!==t&&await Pt(z,Qe),g?.()}catch(lt){q.error(lt instanceof Error?lt.message:c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ae&&!Ye)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:x})});if(Ae&&!nn)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const mt=m!==null?He[m]??null:null,An=m!==null?H[m]:null,Pn=An&&mt?.isMultivariate?nt(An,mt):null,St=Pn?On(Pn,ht):[],fn=Math.min(Ve,Math.max(St.length-1,0)),Ht=St[fn]??null,ft=mt?.isMultivariate===!0,Cn=m!==null&&mt!==null,Ut=Cn&&(ft||!!(un&&we)),ba=Ut&&!Ae&&mt?.isSavedBlock===!0,it=Ae||ba,ya=Ae?En:mt?.label??"",xa=Xe&&i?qt(Xe,i):null,pn=Ut&&(!Ae||re.length>0)?Ae?[En,...re]:[Ye.name,mt.label,...ft&&Ht?[Ht.label]:[],...re]:[],_a=I&&Ye?[Ye.name,"SEO",...Te]:[],Gt=I?_a:it?pn.length>0?pn:[ya]:pn,ja=!I&&!Ae&&ft&&re.length===0,Mn=()=>{if(!E)return;jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const t=l[E],s=yo(t.sections,H);if(!s)return;const a=xo(s);Ne.mutate({blockKey:E,data:{...t,sections:s}},{onSuccess:()=>{B(a),C(null),N(null),T(null),K([]),Q(null),ye(null)},onError:r=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},gn=(t,s,a)=>{if(!E)return;jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const r=l[E],f=r.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const S=f;if(!Array.isArray(S.variants))return;const h=t([...S.variants]);if(!h)return;const A=Mo(S,h),Y={...l,[E]:{...r,sections:A}};Ne.mutate({blockKey:E,data:Y[E]},{onSuccess:()=>{s?.(),a&&Pt(a,Y)},onError:P=>q.error(c("sectionsEditor.sectionsEditor.saveFailed",{error:P.message}))})},Ea=t=>{xe(null),B(t),C(null),N(null),T(null),K([]);const s=Ge[t]?.rule,{resolveType:a,formValue:r}=Ct(s,l??{},i??void 0);ye(a),Q(r),ln(Ge.map(f=>({rule:f.rule})),t)},Ra=(t,s)=>{if(t===s)return;let a=Be;Be===t?a=s:t<Be&&s>=Be?a=Be-1:t>Be&&s<=Be&&(a=Be+1),B(a);const r=Lt(Ge.map(f=>({rule:f.rule})),t,s);ln(r,a),gn(f=>Lt(f,t,s))},wa=t=>{const s=Ge[t]?.rule,a=Mt(s,l??{},i??void 0);gn(r=>r.length<=1?null:(r.splice(t,1),r),()=>{Ge.length-1===1?B(0):t<Be?B(Be-1):t===Be&&B(Math.max(0,t-1)),C(null),N(null),T(null),K([]),Q(null),ye(null)},a)},ka=t=>{gn(s=>Ko(s,t),()=>{B(t+1),C(null),N(null),T(null),K([]),Q(null),ye(null)})},Ta=async(t,s)=>{jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const a=Ze.current.activePageKey,r=Ze.current.decofile;if(!a)return;const f=r[a],S=f.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const h=S;if(!Array.isArray(h.variants))return;const A=[...h.variants],Y=A[t];if(!Y?.rule||typeof Y.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const P=Y.rule,O=s.trim();Ot(!0);try{if(!O){if(!Et(P,r,i)){xe(null);return}const et=P.__resolveType??"";A[t]={...Y,rule:qn(P,r,i)};const be={...r,[a]:{...f,sections:{...h,variants:A}}};await Ne.mutateAsync({blockKey:a,data:be[a]}),await Pt(et,be),xe(null),g?.();return}const $=Wn(P,r,i);if(!$){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if($.blockKey){await Ne.mutateAsync({blockKey:$.blockKey,data:Rt($.resolveType,$.data,O)}),xe(null),g?.();return}const Re=hn(O),z=vn(Re,r);if(z){q.error(z);return}const G=Rt($.resolveType,$.data,O);let Ie=null;try{await Ne.mutateAsync({blockKey:Re,data:G}),Ie=Re,A[t]={...Y,rule:Jt(Re)},await Ne.mutateAsync({blockKey:a,data:{...f,sections:{...h,variants:A}}}),Ie=null}catch(et){throw Ie&&await en.mutateAsync({blockKey:Ie}).catch(()=>{}),et}xe(null),q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:O})),g?.()}catch($){q.error($ instanceof Error?$.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Ot(!1)}},Va=async(t,s)=>{jt(),ze.current&&(clearTimeout(ze.current),ze.current=null);const{selectedSectionIndex:a,rawSections:r,parsedSections:f,decofile:S,activePageKey:h,pageVariants:A,variantIndex:Y}=Ze.current;if(a===null||!h)return;const P=r[a],O=f[a];if(!P||!O?.isMultivariate)return;const $=nt(P,O);if(!$)return;const Re=$.variants??[],z=Re[t];if(!z?.rule||typeof z.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const G=z.rule,Ie=s.trim();Ot(!0);const et=async be=>{const Qe={...$,variants:be},rt=[...r];rt[a]=yt(P,O,Qe);const pt=Kt(S,h,rt,Y,A);return await Ne.mutateAsync({blockKey:h,data:pt}),{...S,[h]:pt}};try{if(!Ie){if(!Et(G,S,i)){me(null);return}const gt=G.__resolveType??"",Bn=[...Re];Bn[t]={...z,rule:qn(G,S,i)};const Ca=await et(Bn);await Pt(gt,Ca),me(null),g?.();return}const be=Wn(G,S,i);if(!be){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(be.blockKey){await Ne.mutateAsync({blockKey:be.blockKey,data:Rt(be.resolveType,be.data,Ie)}),me(null),g?.();return}const Qe=hn(Ie),rt=vn(Qe,S);if(rt){q.error(rt);return}const pt=Rt(be.resolveType,be.data,Ie);let lt=null;try{await Ne.mutateAsync({blockKey:Qe,data:pt}),lt=Qe;const gt=[...Re];gt[t]={...z,rule:Jt(Qe)},await et(gt),lt=null}catch(gt){throw lt&&await en.mutateAsync({blockKey:lt}).catch(()=>{}),gt}me(null),q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Ie})),g?.()}catch(be){q.error(be instanceof Error?be.message:c("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Ot(!1)}},Kn=()=>{_t()},Da=t=>{X(t),dn({inner:t})},Na=t=>{ve(t),dn({raw:t})},Aa=()=>{X(null),_([])},Pa=()=>ae(t=>t+1),Ln=t=>{if(I){if(t===0){Zt.flush(),Ee(!1),X(null),ve(void 0),_([]),ae(a=>a+1),L?.();return}if(t===1){_([]),ae(a=>a+1);return}_(Te.slice(0,t-1)),ae(a=>a+1);return}if(Ae){K(re.slice(0,t)),F(a=>a+1);return}if(t===0){Kn();return}if(t===1){K([]),F(a=>a+1);return}if(ft&&t===2){K([]),F(a=>a+1);return}const s=ft?2:1;K(re.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:it||Ut||I?n.jsxs("div",{className:Ue("border-b px-3 py-2.5",it&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[Gt.length>1&&n.jsx("button",{type:"button",onClick:()=>Ln(Lo(Gt.length,{isMultivariateSectionTop:ja})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:Ue("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",it?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx($o,{className:"size-4"})}),!Ae&&Nt&&ut&&n.jsxs("button",{type:"button",onClick:Kn,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:ut.label}),className:Ue("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",mo),children:[n.jsx(Ts,{rule:Bt(ut.rule,l??{},i??void 0),matchers:zt}),n.jsx("span",{className:"max-w-[160px] truncate",children:ut.label})]}),n.jsx("nav",{"aria-label":c("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Gt.map((t,s)=>{const a=s===Gt.length-1,r=fo(t);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(Uo,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Ln(s),title:r,className:Ue("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?it?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":it?"text-foreground/80":"text-muted-foreground",it?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:r})]},`${r}-${s}`)})}),it&&n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Go,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Cn&&!ft&&!mt?.isHidden&&E&&n.jsx(Fn,{onClick:()=>mn()})]}),it&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(po,{pageKey:E,initialName:Ye.name,initialPath:Ye.path,onFieldChange:Js})}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(zo,{size:14})})}),n.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(wt,{children:[n.jsx(kt,{asChild:!0,children:n.jsx(tt,{type:"button",variant:"ghost",size:"icon","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>M&&E?M():je(!0),children:n.jsx(Ho,{size:14})})}),n.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(Fn,{onClick:Mn})]})}),I?n.jsx(Qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ft&&E?n.jsx(ri,{rawSeo:an,innerSeo:Rn,defaultResolveType:$s,seoSchema:zs,activeResolveType:on,seoTypeOptions:Fs,formResetKey:Se,siteDefaultSeo:Hs,onBreadcrumbChange:_,onPersistRaw:Na,onInnerChange:Da,onClearForm:Aa,onBumpFormKey:Pa}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Ut?n.jsxs(Qt,{viewportRef:qe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[ft&&St.length>0&&re.length===0&&n.jsxs(n.Fragment,{children:[n.jsx(go,{listKey:`${E??""}:${m??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:fn,onSelect:oa,onRename:me,onDuplicate:ra,onDelete:ia,onRemoveAll:ca,onReorder:la,onAdd:()=>mn()}),ft&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Zn,{currentRt:Xe??"",currentLabel:Yt(Ht?.rule,l??{},ht,i??void 0),currentGlobalKey:Mt(Ht?.rule,l??{},i??void 0)??void 0,matchers:zt,globals:Vn,onSelect:ha,onSelectGlobal:Sa,schema:xa,formValue:ct,onChange:va,formKey:`${m??"none"}:${fn}:${Xe??""}`,formWrapperClassName:"pt-1",meta:i??void 0,decofile:l,onSaveReferencedBlock:It,sandbox:$t})]})]}),n.jsx($n,{activeSchema:un,formValue:we,formResetKey:ke,onFormChange:wn,onBreadcrumbChange:K,breadcrumbPath:re,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:i,decofile:l,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:J,onRequestAddSection:kn})]},"editor-section-form"):Ae?n.jsx(Qt,{viewportRef:qe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx($n,{activeSchema:un,formValue:we,formResetKey:ke,onFormChange:wn,onBreadcrumbChange:K,breadcrumbPath:re,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:i,decofile:l,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:J,onRequestAddSection:kn})},"editor-global-block"):n.jsxs(Qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Nt&&E&&n.jsx(Ii,{listKey:E,variants:Ge,activeIndex:Be,decofile:l??{},meta:i,matchers:zt,onSelect:Ea,onReorder:Ra,onRename:xe,onDuplicate:ka,onDelete:wa,onAdd:Mn}),Nt&&ie!==null&&n.jsxs("div",{className:Ue("px-3 border-b",_e?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>fe(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":_e,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),_e?n.jsx(Bo,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Io,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),_e&&n.jsx("div",{className:Ue("space-y-3",Dt&&"pointer-events-none opacity-50"),children:n.jsx(Zn,{currentRt:ie,currentLabel:Yt(ut?.rule,l??{},ht,i??void 0),currentGlobalKey:Mt(ut?.rule,l??{},i??void 0)??void 0,matchers:zt,globals:Vn,onSelect:fa,onSelectGlobal:ga,schema:ma,formValue:de,onChange:pa,formKey:`${Be}:${ie??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:l,onSaveReferencedBlock:It,sandbox:$t})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(Di,{listKey:`${E??""}-${Be}`,rawSections:H,sections:He,meta:i,selectedIndex:m,onSelect:Ys,onReorder:Qs,onDelete:Xs,onDuplicate:Zs,onMakeReusable:Fe,onToggleHidden:ea,onToggleLazy:ta,onAddVariant:mn,onDetach:na,onAddSection:()=>se(!0),canAddSection:da})})]},"editor-section-list"),n.jsx(ho,{open:te!==null,onOpenChange:t=>{t||Fe(null)},defaultBlockId:te!==null?hn(He[te]?.label??""):"",isPending:Ne.isPending,onSubmit:ua}),J&&n.jsx(di,{open:pe,onOpenChange:t=>{se(t),t||(le.current=null)},meta:i,decofile:l,previewBaseUrl:J,onSelect:aa}),Me&&E&&l&&n.jsx(vo,{open:Me,onOpenChange:je,pageKey:E,decofile:l}),Ce!==null&&n.jsx(Jn,{open:!0,initialName:Et(Ge[Ce]?.rule,l??{},i??void 0)?Yt(Ge[Ce]?.rule,l??{},ht,i??void 0):"",autoLabel:ht(Bt(Ge[Ce]?.rule,l??{},i??void 0)),isPending:Dt,onSubmit:async t=>{await Ta(Ce,t)},onOpenChange:t=>{!t&&!Dt&&xe(null)}}),ne!==null&&n.jsx(Jn,{open:!0,initialName:Et(St[ne]?.rule,l??{},i??void 0)?Yt(St[ne]?.rule,l??{},ht,i??void 0):"",autoLabel:ht(Bt(St[ne]?.rule,l??{},i??void 0)),isPending:Dt,onSubmit:async t=>{await Va(ne,t)},onOpenChange:t=>{!t&&!Dt&&me(null)}})]})}export{Uc as SectionsEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,bw as st,bu as Ne,j as i,e0 as rt,by as Ie,bv as k,e1 as lt,br as j,bx as P,cK as $,e2 as at,aB as Ee,e3 as Re,bs as ct,e4 as it,e5 as dt,cO as ut,e6 as pt,e7 as ft,e8 as mt,e9 as ht,ea as vt,bt as gt,eb as xt,ec as St,ed as wt,c as ee,l as oe}from"./index-Bli69brb.js";import{i as yt}from"./Check-WOdACBHP.js";import{t as je,n as Ct}from"./ChevronUp-CrgwCowE.js";function Pe(s,[e,t]){return Math.min(t,Math.max(e,s))}var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=ct(J),[ne]=gt(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:c,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:c,caller:J}),L=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 i.jsx(rt,{...p,children:i.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:L,disabled:w,children:[i.jsx(de.Provider,{scope:e,children:i.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?i.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?i.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,c=k(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 i.jsx(lt,{asChild:!0,...a,children:i.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:c,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",ke=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,children:a,placeholder:r="",...l}=s,c=G(De,t),{onValueNodeHasChildrenChange:u}=c,m=a!==void 0,g=k(e,c.onValueNodeChange);return $(()=>{u(m)},[u,m]),i.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:tt(c.value)?i.jsx(i.Fragment,{children:r}):a})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((s,e)=>{const{__scopeSelect:t,children:o,...n}=s;return i.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=s=>i.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(i.jsx(He,{scope:s.__scopeSelect,children:i.jsx(de.Slot,{scope:s.__scopeSelect,children:i.jsx("div",{children:s.children})})}),a):null}return i.jsx(ze,{...s,ref:e})});Ve.displayName=Q;var A=10,[He,Y]=ne(Q),jt="SelectContentImpl",Mt=xt("SelectContent.RemoveScroll"),ze=d.forwardRef((s,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:r,side:l,sideOffset:c,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),_=k(e,f=>F(f)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return pt(x)},[x]),ft();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)&&L(f)},[h.value]),ce=o==="popper"?Se:Fe,re=ce===Se?{side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return i.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:i.jsx(mt,{as:Mt,allowPinchZoom:!0,children:i.jsx(ht,{asChild:!0,trapped:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:i.jsx(vt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:i.jsx(ce,{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,c]=d.useState(null),[u,m]=d.useState(null),g=k(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 L=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,ce=B-te,re=v.offsetHeight/2,f=v.offsetTop+re,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,re+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[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 i.jsx(Dt,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:se,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:i.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 i.jsx(St,{...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=k(e,a.onViewportChange),c=d.useRef(0);return i.jsxs(i.Fragment,{children:[i.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}),i.jsx(de.Slot,{scope:t,children:i.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(c.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")}}}c.current=m.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Ie();return i.jsx(kt,{scope:t,id:n,children:i.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=Lt(Ke,t);return i.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ie="SelectItem",[Ht,$e]=ne(ie),Ge=d.forwardRef((s,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:a,...r}=s,l=G(ie,t),c=Y(ie,t),u=l.value===o,[m,g]=d.useState(a??""),[w,y]=d.useState(!1),S=k(e,h=>c.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 i.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(h=>{g(x=>x||(h?.textContent??"").trim())},[]),children:i.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:m,children:i.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?c.onItemLeave?.():v.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(r.onPointerLeave,h=>{h.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:P(r.onKeyDown,h=>{c.searchRef?.current!==""&&h.key===" "||(It.includes(h.key)&&C(),h.key===" "&&h.preventDefault())})})})})});Ge.displayName=ie;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),c=$e(le,t),u=_t(le,t),[m,g]=d.useState(null),w=k(e,C=>g(C),c.onItemTextChange,C=>l.itemTextRefCallback?.(C,c.value,c.disabled)),y=m?.textContent,S=d.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:y},c.value),[c.disabled,c.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),i.jsxs(i.Fragment,{children:[i.jsx(j.span,{id:c.textId,...a,ref:w}),c.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?i.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=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop-c.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=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<u;a(m)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop+c.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),c=d.useCallback(()=>{r.current!==null&&(window.clearInterval(r.current),r.current=null)},[]);return d.useEffect(()=>()=>c(),[c]),$(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),i.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,()=>{c()})})}),zt="SelectSeparator",Ft=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return i.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"?i.jsx(wt,{...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=k(o,n),r=it(e);return d.useEffect(()=>{const l=n.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(r!==e&&m){const g=new Event("change",{bubbles:!0});m.call(l,e),l.dispatchEvent(g)}},[r,e]),i.jsx(j.select,{...t,style:{...dt,...t.style},ref:a,defaultValue:e})});et.displayName=Wt;function tt(s){return s===""||s===void 0}function ot(s){const e=ut(s),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(r=>{const l=t.current+r;e(l),(function c(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>c(""),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 c=r.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return c!==t?c:void 0}function Kt(s,e){return s.map((t,o)=>s[(e+o)%s.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,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=i.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function io(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=i.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(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 dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-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-8 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-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 c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(qt,{asChild:!0,children:i.jsx(je,{className:"size-4 opacity-50"})}),e[7]=c):c=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==r||e[11]!==l?(u=i.jsxs(Gt,{"data-slot":"select-trigger","data-size":r,className:l,...n,children:[t,c]}),e[8]=t,e[9]=n,e[10]=r,e[11]=l,e[12]=u):u=e[12],u}function po(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,c=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-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=m):m=e[8];let g;e[9]!==c?(g=!c&&i.jsx(no,{}),e[9]=c,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=i.jsx(Jt,{className:y,children:t}),e[13]=t,e[14]=y,e[15]=S):S=e[15];let p;e[16]!==c?(p=!c&&i.jsx(so,{}),e[16]=c,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=i.jsx(Xt,{children:i.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 fo(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,c=n&&"items-start py-2";let u;e[6]!==o||e[7]!==c?(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",c,o),e[6]=o,e[7]=c,e[8]=u):u=e[8];let m;e[9]!==l?(m=!l&&i.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:i.jsx(eo,{children:i.jsx(yt,{className:"size-4"})})}),e[9]=l,e[10]=m):m=e[10];let g;e[11]!==t||e[12]!==n?(g=n?i.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[i.jsx(_e,{children:t}),i.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):i.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=i.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=i.jsx(Ct,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.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=i.jsx(je,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.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,io as a,uo as b,fo as c,po as d,Pe as e};
|
|
1
|
+
import{r as d,bw as st,bu as Ne,j as i,e0 as rt,by as Ie,bv as k,e1 as lt,br as j,bx as P,cK as $,e2 as at,aB as Ee,e3 as Re,bs as ct,e4 as it,e5 as dt,cO as ut,e6 as pt,e7 as ft,e8 as mt,e9 as ht,ea as vt,bt as gt,eb as xt,ec as St,ed as wt,c as ee,l as oe}from"./index-mEkmCgyQ.js";import{i as yt}from"./Check-CUhXORQg.js";import{t as je,n as Ct}from"./ChevronUp-hRy5Y6dA.js";function Pe(s,[e,t]){return Math.min(t,Math.max(e,s))}var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=ct(J),[ne]=gt(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:c,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:c,caller:J}),L=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 i.jsx(rt,{...p,children:i.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:L,disabled:w,children:[i.jsx(de.Provider,{scope:e,children:i.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?i.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?i.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,c=k(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 i.jsx(lt,{asChild:!0,...a,children:i.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:c,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",ke=d.forwardRef((s,e)=>{const{__scopeSelect:t,className:o,style:n,children:a,placeholder:r="",...l}=s,c=G(De,t),{onValueNodeHasChildrenChange:u}=c,m=a!==void 0,g=k(e,c.onValueNodeChange);return $(()=>{u(m)},[u,m]),i.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:tt(c.value)?i.jsx(i.Fragment,{children:r}):a})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((s,e)=>{const{__scopeSelect:t,children:o,...n}=s;return i.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=s=>i.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(i.jsx(He,{scope:s.__scopeSelect,children:i.jsx(de.Slot,{scope:s.__scopeSelect,children:i.jsx("div",{children:s.children})})}),a):null}return i.jsx(ze,{...s,ref:e})});Ve.displayName=Q;var A=10,[He,Y]=ne(Q),jt="SelectContentImpl",Mt=xt("SelectContent.RemoveScroll"),ze=d.forwardRef((s,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:r,side:l,sideOffset:c,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),_=k(e,f=>F(f)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return pt(x)},[x]),ft();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)&&L(f)},[h.value]),ce=o==="popper"?Se:Fe,re=ce===Se?{side:l,sideOffset:c,align:u,alignOffset:m,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return i.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:i.jsx(mt,{as:Mt,allowPinchZoom:!0,children:i.jsx(ht,{asChild:!0,trapped:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:i.jsx(vt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:i.jsx(ce,{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,c]=d.useState(null),[u,m]=d.useState(null),g=k(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 L=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,ce=B-te,re=v.offsetHeight/2,f=v.offsetTop+re,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,re+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[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 i.jsx(Dt,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:se,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:i.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 i.jsx(St,{...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=k(e,a.onViewportChange),c=d.useRef(0);return i.jsxs(i.Fragment,{children:[i.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}),i.jsx(de.Slot,{scope:t,children:i.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(c.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")}}}c.current=m.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s,n=Ie();return i.jsx(kt,{scope:t,id:n,children:i.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=Lt(Ke,t);return i.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ie="SelectItem",[Ht,$e]=ne(ie),Ge=d.forwardRef((s,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:a,...r}=s,l=G(ie,t),c=Y(ie,t),u=l.value===o,[m,g]=d.useState(a??""),[w,y]=d.useState(!1),S=k(e,h=>c.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 i.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(h=>{g(x=>x||(h?.textContent??"").trim())},[]),children:i.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:m,children:i.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?c.onItemLeave?.():v.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(r.onPointerLeave,h=>{h.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:P(r.onKeyDown,h=>{c.searchRef?.current!==""&&h.key===" "||(It.includes(h.key)&&C(),h.key===" "&&h.preventDefault())})})})})});Ge.displayName=ie;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),c=$e(le,t),u=_t(le,t),[m,g]=d.useState(null),w=k(e,C=>g(C),c.onItemTextChange,C=>l.itemTextRefCallback?.(C,c.value,c.disabled)),y=m?.textContent,S=d.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:y},c.value),[c.disabled,c.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),i.jsxs(i.Fragment,{children:[i.jsx(j.span,{id:c.textId,...a,ref:w}),c.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?i.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=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop-c.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=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<u;a(m)};const c=t.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?i.jsx(Qe,{...s,ref:r,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=t;l&&c&&(l.scrollTop=l.scrollTop+c.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),c=d.useCallback(()=>{r.current!==null&&(window.clearInterval(r.current),r.current=null)},[]);return d.useEffect(()=>()=>c(),[c]),$(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),i.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,()=>{c()})})}),zt="SelectSeparator",Ft=d.forwardRef((s,e)=>{const{__scopeSelect:t,...o}=s;return i.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"?i.jsx(wt,{...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=k(o,n),r=it(e);return d.useEffect(()=>{const l=n.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(r!==e&&m){const g=new Event("change",{bubbles:!0});m.call(l,e),l.dispatchEvent(g)}},[r,e]),i.jsx(j.select,{...t,style:{...dt,...t.style},ref:a,defaultValue:e})});et.displayName=Wt;function tt(s){return s===""||s===void 0}function ot(s){const e=ut(s),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(r=>{const l=t.current+r;e(l),(function c(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>c(""),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 c=r.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return c!==t?c:void 0}function Kt(s,e){return s.map((t,o)=>s[(e+o)%s.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,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=i.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function io(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=i.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(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 dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-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-8 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-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 c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(qt,{asChild:!0,children:i.jsx(je,{className:"size-4 opacity-50"})}),e[7]=c):c=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==r||e[11]!==l?(u=i.jsxs(Gt,{"data-slot":"select-trigger","data-size":r,className:l,...n,children:[t,c]}),e[8]=t,e[9]=n,e[10]=r,e[11]=l,e[12]=u):u=e[12],u}function po(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,c=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-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=m):m=e[8];let g;e[9]!==c?(g=!c&&i.jsx(no,{}),e[9]=c,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=i.jsx(Jt,{className:y,children:t}),e[13]=t,e[14]=y,e[15]=S):S=e[15];let p;e[16]!==c?(p=!c&&i.jsx(so,{}),e[16]=c,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=i.jsx(Xt,{children:i.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 fo(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,c=n&&"items-start py-2";let u;e[6]!==o||e[7]!==c?(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",c,o),e[6]=o,e[7]=c,e[8]=u):u=e[8];let m;e[9]!==l?(m=!l&&i.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:i.jsx(eo,{children:i.jsx(yt,{className:"size-4"})})}),e[9]=l,e[10]=m):m=e[10];let g;e[11]!==t||e[12]!==n?(g=n?i.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[i.jsx(_e,{children:t}),i.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):i.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=i.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=i.jsx(Ct,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.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=i.jsx(je,{className:"size-4"}),e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==n?(r=i.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,io as a,uo as b,fo as c,po as d,Pe as e};
|