decocms 4.436.0 → 4.436.1
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-6ybYQ23i.js → AlertCircle-BcMtONTy.js} +1 -1
- package/dist/client/assets/{AreaChart-Dpo2DCFE.js → AreaChart-BZCoq1_V.js} +1 -1
- package/dist/client/assets/{ArrowLeft-c2TyzYV8.js → ArrowLeft-CvQ3hA6K.js} +1 -1
- package/dist/client/assets/{ArrowUp-Ck0_Bd3R.js → ArrowUp-B2SOfymG.js} +1 -1
- package/dist/client/assets/{CartesianChart-Bks6a_1V.js → CartesianChart-DoMOAHjZ.js} +1 -1
- package/dist/client/assets/{Check-B9MGwLYu.js → Check-DvlVwSY0.js} +1 -1
- package/dist/client/assets/{CheckCircle-D91123g-.js → CheckCircle-BfAtXKeX.js} +1 -1
- package/dist/client/assets/{ChevronUp-efnDWTJo.js → ChevronUp-C6-gUxpN.js} +1 -1
- package/dist/client/assets/{Copy01-rQNANcmU.js → Copy01-CbyKzYad.js} +1 -1
- package/dist/client/assets/{CreditCard01-iCMKKibk.js → CreditCard01-CvhxMZvT.js} +1 -1
- package/dist/client/assets/{DotsVertical-_TKSgZ_X.js → DotsVertical-xMdVQa8c.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-BTFCRzpt.js → ErrorBarContext-BSdglAhF.js} +1 -1
- package/dist/client/assets/{Image01-DAnmxYRB.js → Image01-EkAEptBw.js} +1 -1
- package/dist/client/assets/{Key01-DypAHQYR.js → Key01-UoOC1hzc.js} +1 -1
- package/dist/client/assets/{Line-CzSrIBNT.js → Line-CaKw3_OC.js} +1 -1
- package/dist/client/assets/{Link01-CXYgjG_2.js → Link01-CRPIbFnr.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CXUAHdkG.js → LinkBroken01-yaKPcgyZ.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DYpNBFe4.js → LinkExternal01-CBStRzz4.js} +1 -1
- package/dist/client/assets/{Monitor01-BAjB03YK.js → Monitor01-BvD5JOY7.js} +1 -1
- package/dist/client/assets/{Palette-DCK6DhCo.js → Palette-hSX4UYh2.js} +1 -1
- package/dist/client/assets/{Plus-BCvpEHBe.js → Plus-pdohMH0C.js} +1 -1
- package/dist/client/assets/{SearchMd-BZeBFgxn.js → SearchMd-Dvzi_iL7.js} +1 -1
- package/dist/client/assets/{Sector-CxmP4STa.js → Sector-C8IJQdFq.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-D9QLv3AR.js → ShoppingBag01-CBOKaqok.js} +1 -1
- package/dist/client/assets/{Sun-C0iRh-Gk.js → Sun-CwYLjowh.js} +1 -1
- package/dist/client/assets/{Tool01-BCWTP29t.js → Tool01-CeXTeg_f.js} +1 -1
- package/dist/client/assets/{Trash01-DYSwQZrr.js → Trash01-Dpe9Tntu.js} +1 -1
- package/dist/client/assets/{Upload01-D1n8mQmM.js → Upload01-Bn9-9K5y.js} +1 -1
- package/dist/client/assets/{User01-CqnrVGO2.js → User01-DP_CWS--.js} +1 -1
- package/dist/client/assets/{UserSquare-Cot0m-_1.js → UserSquare-WR18fNY8.js} +1 -1
- package/dist/client/assets/{Users01-CrCP--sh.js → Users01-DJZa484d.js} +1 -1
- package/dist/client/assets/{X-Cjtw5tqD.js → X-BBgrZ5uI.js} +1 -1
- package/dist/client/assets/{XAxis-BPHTmmQM.js → XAxis-CnM3W4iO.js} +1 -1
- package/dist/client/assets/{XClose-C8P0rFOP.js → XClose-B4O0rKSy.js} +1 -1
- package/dist/client/assets/{ZoomOut-DF2wOfg4.js → ZoomOut-Zf1vCzpA.js} +1 -1
- package/dist/client/assets/{access-gate-CDhQZ3bi.js → access-gate-nWfRMJBo.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BFVFfXC3.js → add-connection-dialog-DjvYTyUO.js} +1 -1
- package/dist/client/assets/{agent-analytics-CdZXo_mN.js → agent-analytics-DAcJHWuP.js} +1 -1
- package/dist/client/assets/agent-app-CMz5uqmM.js +1 -0
- package/dist/client/assets/{agent-assets-Cez9_bxl.js → agent-assets-CQzBPJIm.js} +1 -1
- package/dist/client/assets/{agent-automation-JjAIqJwX.js → agent-automation-DkGaMqoY.js} +1 -1
- package/dist/client/assets/{agent-automations-BOXHITiz.js → agent-automations-DUmNOa1Y.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-Bp_dzf1u.js → agent-connect-sources-BJ0M8Pkh.js} +1 -1
- package/dist/client/assets/agent-deck-BCDNm54x.js +1 -0
- package/dist/client/assets/{agent-e2e-Dm2VTiiE.js → agent-e2e-CafnXxeX.js} +1 -1
- package/dist/client/assets/{agent-experiments-A5wh_VSI.js → agent-experiments-g2uejxCF.js} +1 -1
- package/dist/client/assets/{agent-file-DaXlssWR.js → agent-file-CwwjlhVX.js} +1 -1
- package/dist/client/assets/{agent-git-3xYPhMt1.js → agent-git-Bxt1MSpd.js} +1 -1
- package/dist/client/assets/{agent-hosting-B_XS63CC.js → agent-hosting-DfBbxQIW.js} +1 -1
- package/dist/client/assets/{agent-icon-BSa4M47V.js → agent-icon-CU70YHcG.js} +1 -1
- package/dist/client/assets/agent-library-b0MnsuXP.js +1 -0
- package/dist/client/assets/agent-library-file-28T--SYY.js +1 -0
- package/dist/client/assets/{agent-monitor-BlyV0ube.js → agent-monitor-fwRhUil7.js} +1 -1
- package/dist/client/assets/{agent-overview-uCot9pZL.js → agent-overview-BplYvlrP.js} +1 -1
- package/dist/client/assets/agent-settings-SM-8_7Ex.js +1 -0
- package/dist/client/assets/{agent-site-editor-sYWtn6PH.js → agent-site-editor-CmPiLvoI.js} +13 -13
- package/dist/client/assets/agent-site-editor-code-B6XzsuP9.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-BxqSMWeE.js → agent-site-editor-content-Dqfb1Yy7.js} +5 -5
- package/dist/client/assets/{agent-site-editor-preview-30I-0d0y.js → agent-site-editor-preview-DZtxD3Nm.js} +4 -4
- package/dist/client/assets/agent-view-C2AdcUiu.js +1 -0
- package/dist/client/assets/{agent-view-guard-CoRznXPE.js → agent-view-guard-Bfwe9pmv.js} +1 -1
- package/dist/client/assets/{agents-list-CBDiY4gJ.js → agents-list-DMLQIiu_.js} +1 -1
- package/dist/client/assets/{ai-providers-CXvmgcfH.js → ai-providers-DjHSfHX_.js} +1 -1
- package/dist/client/assets/{alert-CQ4TnjsJ.js → alert-Bky1wlmY.js} +1 -1
- package/dist/client/assets/{alert-dialog-CRwe5o4p.js → alert-dialog-CX1VQigg.js} +1 -1
- package/dist/client/assets/{analytics-sections-D_eKWrvC.js → analytics-sections-BzasFT2Z.js} +1 -1
- package/dist/client/assets/{api-keys-CpUa8Qw-.js → api-keys-B1WR1hzG.js} +1 -1
- package/dist/client/assets/api-keys-hV88T8W1.js +1 -0
- package/dist/client/assets/app-editor-CDXlBKb5.js +1 -0
- package/dist/client/assets/{asset-utils-B1NexnMU.js → asset-utils-DDZiv2Z6.js} +1 -1
- package/dist/client/assets/{auth-DgAXBGyy.js → auth-BEWuraWE.js} +1 -1
- package/dist/client/assets/{auth-catchall-CFOUIt1A.js → auth-catchall-B9SIokPw.js} +1 -1
- package/dist/client/assets/{auth-entry-4kqX4ydS.js → auth-entry-DXLqLa57.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DpVaClFg.js → auth-split-layout-D2hyx7kL.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DVtkeUNt.js → authenticate-and-persist-oauth-C3rgw-1a.js} +1 -1
- package/dist/client/assets/{automation-list-row-DbEi-W0S.js → automation-list-row-v_kRijSb.js} +1 -1
- package/dist/client/assets/{automation-runs-B-nhvwsu.js → automation-runs-CGnmaX6K.js} +1 -1
- package/dist/client/assets/{automations-npS5rTDq.js → automations-DMBi46Vs.js} +1 -1
- package/dist/client/assets/{autosend-CLPSPXGZ.js → autosend-BVzqsL9-.js} +1 -1
- package/dist/client/assets/{avatar-Drtufyjw.js → avatar-_qaqoYk_.js} +1 -1
- package/dist/client/assets/{badge-DpFKAdGf.js → badge-Bjjo0IIW.js} +1 -1
- package/dist/client/assets/{block-document-B5Cc-Zg7.js → block-document-DDANonP2.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-Cjkrbhbk.js → blocks-preview-workspace-context-BQDgWm7t.js} +1 -1
- package/dist/client/assets/{buckets-DWUHnbQV.js → buckets-DZZn4yMb.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DIkN-a2Z.js → build-improve-prompt-doc-BEbaE1iV.js} +1 -1
- package/dist/client/assets/{calendar-CG4qsKlv.js → calendar-D8rOZOmJ.js} +1 -1
- package/dist/client/assets/{capability-load-error-CC0ntXvK.js → capability-load-error-C96DuehA.js} +1 -1
- package/dist/client/assets/{category-editor-DUUE5m8F.js → category-editor-By844vet.js} +1 -1
- package/dist/client/assets/{chart-Cj6b_hgB.js → chart-Wen8dXx8.js} +1 -1
- package/dist/client/assets/{chat-context-Drs6TfxR.js → chat-context-DpzZ39ci.js} +1 -1
- package/dist/client/assets/{chat-draft-C163y66v.js → chat-draft-Bw1bwSTB.js} +1 -1
- package/dist/client/assets/{checkbox-B-ptMPYE.js → checkbox-DPxcWhhA.js} +1 -1
- package/dist/client/assets/{choose-editor-DWFaS58D.js → choose-editor-MWPk8AvZ.js} +1 -1
- package/dist/client/assets/claim-phase-copy-BdgkyBTp.js +1 -0
- package/dist/client/assets/{cli-auth-success-DyIaQMZT.js → cli-auth-success-CvrgpjJ2.js} +1 -1
- package/dist/client/assets/{client-icons-BPy89KI8.js → client-icons-BaXeOvBm.js} +1 -1
- package/dist/client/assets/{collapsible-DuvoRmPZ.js → collapsible-DX3VGRWM.js} +1 -1
- package/dist/client/assets/{collection-detail-CgYpP227.js → collection-detail-Blk7VYi1.js} +1 -1
- package/dist/client/assets/{collection-display-button-Nbd-2qNC.js → collection-display-button-Cp0qesID.js} +1 -1
- package/dist/client/assets/{collection-search-RMk41ye0.js → collection-search-C5dhge9B.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Cty7TNa1.js → collection-table-wrapper-C54DiGer.js} +1 -1
- package/dist/client/assets/{collection-tabs-C7F9Kntb.js → collection-tabs-D5xl7Ng7.js} +1 -1
- package/dist/client/assets/{combobox-C2u0kYgx.js → combobox-CbOlDeot.js} +1 -1
- package/dist/client/assets/{command-Dae572-g.js → command-DYf2Omhs.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-L3Ob_Q-i.js → companion-mcps-section-CnrgB3kp.js} +1 -1
- package/dist/client/assets/{config-B644IckQ.js → config--uaTsVZx.js} +1 -1
- package/dist/client/assets/{connect-VkFeqP2u.js → connect-BPW2Zd4w.js} +1 -1
- package/dist/client/assets/{connect-layout-BzxwOLWE.js → connect-layout-D3iP2nQR.js} +1 -1
- package/dist/client/assets/{connection-DgUTLyWv.js → connection-DgX71WSo.js} +1 -1
- package/dist/client/assets/{connection-card-CYPVcyCl.js → connection-card-DYrnX2uM.js} +1 -1
- package/dist/client/assets/{connection-detail-BDDxe447.js → connection-detail-C-rhOHH_.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CnazKdgJ.js → connection-form-helpers-r54SluoH.js} +1 -1
- package/dist/client/assets/{connections-DGwh_Z7O.js → connections-CIEQgDOQ.js} +1 -1
- package/dist/client/assets/{context-D-BalDSl.js → context-Cw7nn4zN.js} +1 -1
- package/dist/client/assets/{context-menu-dYa0qKdh.js → context-menu-CBBz6X-t.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BJxhfVj3.js → create-organization-dialog-626g14fk.js} +1 -1
- package/dist/client/assets/{daily-pulse-Cv4xy4Nf.js → daily-pulse-C5a2TQcL.js} +1 -1
- package/dist/client/assets/{decopilot-BuBttE9O.js → decopilot-DyQr3aTZ.js} +1 -1
- package/dist/client/assets/device-hint-B6zbKkPI.js +1 -0
- package/dist/client/assets/{dialog-BDu7Odbi.js → dialog-ChgvvLIn.js} +1 -1
- package/dist/client/assets/{discover-CDb8l0Cf.js → discover-iglJj0aW.js} +1 -1
- package/dist/client/assets/{domain-settings-CTUbB8ul.js → domain-settings-BemRsnFM.js} +1 -1
- package/dist/client/assets/{download-app-dialog-C5pSTRZI.js → download-app-dialog-Bctwlvwg.js} +1 -1
- package/dist/client/assets/{drawer-B8K_Crzh.js → drawer-C8Nbrs_9.js} +1 -1
- package/dist/client/assets/{editor-CdyJu6ec.js → editor-BLMFhTre.js} +1 -1
- package/dist/client/assets/{empty-state-DjYKd98e.js → empty-state-Cg-KHjOk.js} +1 -1
- package/dist/client/assets/{empty-state-CxMYhC6p.js → empty-state-D3FqF9Ej.js} +1 -1
- package/dist/client/assets/{extract-connection-data-pEB9LnEc.js → extract-connection-data-C-dCftDR.js} +1 -1
- package/dist/client/assets/{feature-gate-CSsakESN.js → feature-gate-CbOjqNOW.js} +1 -1
- package/dist/client/assets/{feature-paywall-CK4QTePu.js → feature-paywall-zPlTWry9.js} +1 -1
- package/dist/client/assets/{file-explorer-xiGJikaa.js → file-explorer-DMMmp0J3.js} +1 -1
- package/dist/client/assets/{file-preview-EUC0kMwT.js → file-preview-D8r1Qbzy.js} +1 -1
- package/dist/client/assets/{file-share-button-DpDzBNlB.js → file-share-button-Cx68dWB1.js} +1 -1
- package/dist/client/assets/{file-type-icon-D1P4nIkr.js → file-type-icon-BDGP6Ldt.js} +1 -1
- package/dist/client/assets/flat-project-DBNLHTx1.js +1 -0
- package/dist/client/assets/{folder-icon-Ce07pgWj.js → folder-icon-BfCY29b0.js} +1 -1
- package/dist/client/assets/{form-C73wwUY1.js → form-C_ime4VH.js} +1 -1
- package/dist/client/assets/{gateway-client-DqxL5ILU.js → gateway-client-BJ472_3w.js} +1 -1
- package/dist/client/assets/{general-BgriYFfp.js → general-f37gChdw.js} +1 -1
- package/dist/client/assets/{home-B1Bms4Bc.js → home-u9cwTBo9.js} +1 -1
- package/dist/client/assets/{icon-button-CCkUXmCt.js → icon-button-BI_CutJE.js} +1 -1
- package/dist/client/assets/{index-CXcoN6fv.js → index-BhgMHoEK.js} +1 -1
- package/dist/client/assets/{index-CfB7uV8T.js → index-Bm7rcagF.js} +1 -1
- package/dist/client/assets/{index-w_gUXlZB.js → index-C68lWiz9.js} +1 -1
- package/dist/client/assets/{index-TEoPG_xF.js → index-CNngnM5t.js} +3 -3
- package/dist/client/assets/{index-DdlkV8jH.js → index-COmo1uEx.js} +1 -1
- package/dist/client/assets/{index-CTk6zrDI.css → index-Cg2pINn7.css} +1 -1
- package/dist/client/assets/{index-BhDEqgvq.js → index-Cg3Alqzj.js} +1 -1
- package/dist/client/assets/{index-Dq9aFrU7.js → index-DJCayhGC.js} +1 -1
- package/dist/client/assets/{index-DDMwhF4p.js → index-DV2tiEDy.js} +2 -2
- package/dist/client/assets/{index-BzpQR2a9.js → index-D_26d7wd.js} +1 -1
- package/dist/client/assets/{index-5DP27jDI.js → index-DlQdH_hl.js} +1 -1
- package/dist/client/assets/{index-CCpnBLTA.js → index-DoSo_B2m.js} +1 -1
- package/dist/client/assets/{index-MoGHGtG3.js → index-HDhvUYB-.js} +1 -1
- package/dist/client/assets/{index-CcDcBNLg.js → index-TOQ2hneH.js} +1 -1
- package/dist/client/assets/{index-dHzCl0SD.js → index-d7wCXgHR.js} +1 -1
- package/dist/client/assets/{index-redirect-Dw5ZHcG5.js → index-redirect-B7ek_SsX.js} +1 -1
- package/dist/client/assets/{index-BH0QOgT5.js → index-yp9ODcYP.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CJ5p49lP.js → infiniteQueryObserver-BVIMeLaW.js} +1 -1
- package/dist/client/assets/{infra-billing-DzUVLa9p.js → infra-billing-Bw-Tvlie.js} +1 -1
- package/dist/client/assets/{input-Bwjhgz40.js → input-CCuQ9g-u.js} +3 -3
- package/dist/client/assets/{input-eTKbvNZz.js → input-CXzblxoX.js} +1 -1
- package/dist/client/assets/{input-DByUKMMK.js → input-DistjIbs.js} +1 -1
- package/dist/client/assets/{integration-icon-zyUczR_u.js → integration-icon-7da8J_en.js} +1 -1
- package/dist/client/assets/{label-C-T1eS6J.js → label-Wib6sduZ.js} +1 -1
- package/dist/client/assets/{layout-BHcUl3VL.js → layout-CVPGeNFN.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CcuAWgCq.js → legacy-agents-deep-Ctiaef4m.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-Dc4dwfjW.js → legacy-main-redirect-fMho9cfi.js} +1 -1
- package/dist/client/assets/library-CbUayMD_.js +1 -0
- package/dist/client/assets/{library-tab-DEFxWXF-.js → library-tab-DDtUuEL8.js} +1 -1
- package/dist/client/assets/{login-Yo0oz80D.js → login-AGaEXHua.js} +1 -1
- package/dist/client/assets/{markdown-TyEv0NYc.js → markdown-DYMWaMLt.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BVvnriYN.js → mcp-app-renderer-CZn3uLbl.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DfYPCFNO.js → mcp-oauth-D0RKPivz.js} +1 -1
- package/dist/client/assets/{members-D-zmvBcH.js → members-CpsEoSoC.js} +1 -1
- package/dist/client/assets/{message-templates-DDSHBM61.js → message-templates-DOMi40bb.js} +1 -1
- package/dist/client/assets/{mini-report-page-BpQis9_u.js → mini-report-page-B1FRcSg6.js} +1 -1
- package/dist/client/assets/{mock-board-BFNKTSK0.js → mock-board--1yRD3zv.js} +1 -1
- package/dist/client/assets/{monaco-editor-wtpXDYYn.js → monaco-editor-D8MpECRM.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DrWKfMD3.js → monitoring-stats-row-CfJC6l7p.js} +1 -1
- package/dist/client/assets/{multi-select-CnSDCQuL.js → multi-select-CcKGNW0q.js} +1 -1
- package/dist/client/assets/{mustache-ByIPD-nA.js → mustache-CkphMDQt.js} +3 -3
- package/dist/client/assets/{new-project-dialog-C5yDBDMx.js → new-project-dialog-DlAV228u.js} +1 -1
- package/dist/client/assets/{oauth-callback-DCD2tfNQ.js → oauth-callback-CwDq660S.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-B-acjwSO.js → oauth-callback-ai-provider-BaPfINW0.js} +1 -1
- package/dist/client/assets/{onboarding-CVAxJadd.js → onboarding-nlr-BG6l.js} +1 -1
- package/dist/client/assets/{openai-conversation-DkewqNIs.js → openai-conversation-CcDvscMk.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-ZTOrpdg5.js → optimistic-project-sidebar-views-BXLse4f7.js} +1 -1
- package/dist/client/assets/{org-file-open-context-BHYqBnHw.js → org-file-open-context-DHAupDW3.js} +1 -1
- package/dist/client/assets/{organization-choice-CUVQJDxC.js → organization-choice-8VEgdDiW.js} +1 -1
- package/dist/client/assets/{orgs-DQHcKvo3.js → orgs-RQSmcLVn.js} +1 -1
- package/dist/client/assets/page-seo-form-C922sgVd.js +1 -0
- package/dist/client/assets/{pair-CcnGiyFG.js → pair-BLig-zhY.js} +1 -1
- package/dist/client/assets/{plan-ladder-BYdbNlFW.js → plan-ladder-vfAaIFpO.js} +1 -1
- package/dist/client/assets/{popover-D6rdo_8c.js → popover-DetcAb3z.js} +1 -1
- package/dist/client/assets/{post-calendar-Yn93DscO.js → post-calendar-CMTsS3_i.js} +1 -1
- package/dist/client/assets/{post-editor-DPLMVgB8.js → post-editor-CCSNcPTk.js} +2 -2
- package/dist/client/assets/{preview-content-98ufqmFe.js → preview-content-XBPwWZDi.js} +1 -1
- package/dist/client/assets/{preview-dialog-DmLb99XJ.js → preview-dialog-D4eXP3to.js} +1 -1
- package/dist/client/assets/{profile-BN74SJRo.js → profile-ChbTk-ed.js} +1 -1
- package/dist/client/assets/{project-app-view-B6vN4d6S.js → project-app-view-BCWhmKJd.js} +1 -1
- package/dist/client/assets/{project-feed-UldtDpQQ.js → project-feed-DfX8Tm2r.js} +1 -1
- package/dist/client/assets/{project-icon-DGJ2Og-0.js → project-icon-CefmE1dj.js} +1 -1
- package/dist/client/assets/project-reports-C02Bj9lv.js +1 -0
- package/dist/client/assets/project-tasks-B1IlGTJg.js +1 -0
- package/dist/client/assets/{projects-CoUK4NDR.js → projects-CE3elW5n.js} +1 -1
- package/dist/client/assets/{projects-empty-state-D39dlUwN.js → projects-empty-state-BgHkLfRG.js} +1 -1
- package/dist/client/assets/{prompts-DXN6Ivcg.js → prompts-D4_xCZFT.js} +1 -1
- package/dist/client/assets/record-editor-Dybth63X.js +1 -0
- package/dist/client/assets/redirect-editor-C0vABnTa.js +1 -0
- package/dist/client/assets/{reports-Dnv_tcK4.js → reports-778LOPaq.js} +1 -1
- package/dist/client/assets/{reports-onboarding-jAhkROIl.js → reports-onboarding-DIftoxkS.js} +1 -1
- package/dist/client/assets/reports-os1rvEEZ.js +1 -0
- package/dist/client/assets/{reports-tab-dX03q303.js → reports-tab-Cc0KggC7.js} +2 -2
- package/dist/client/assets/{repositories-BzKqKddF.js → repositories-CJYmapuH.js} +1 -1
- package/dist/client/assets/{repository-binding-DzWJ2UJM.js → repository-binding-BEXtvYFM.js} +1 -1
- package/dist/client/assets/{repository-import-picker-Bv59I2Eu.js → repository-import-picker-CeMw-zNS.js} +1 -1
- package/dist/client/assets/{repository-picker-DGluhbRv.js → repository-picker-BxH96PsW.js} +1 -1
- package/dist/client/assets/{require-capability-BBlF9FlD.js → require-capability-DiYCjXLj.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DEIqbZyY.js → required-auth-layout-CGXaj6Z0.js} +1 -1
- package/dist/client/assets/{reset-password-DrwXIP-H.js → reset-password-DhMMCSx-.js} +1 -1
- package/dist/client/assets/{resizable-C3nSVuvm.js → resizable-iIjAnc3o.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-C3ov5Rmg.js → resolve-tab-icon-Cdaiz7PD.js} +1 -1
- package/dist/client/assets/{review-settings-DesAsnsb.js → review-settings-BdFFvYoZ.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-DYjn6aCW.js → rich-text-link-control-BVIyTHF6.js} +1 -1
- package/dist/client/assets/{roles-DAknCPv7.js → roles-DErmbqDy.js} +1 -1
- package/dist/client/assets/route-AON70nz-.js +1 -0
- package/dist/client/assets/{route-ufiJKcWq.js → route-D6Ud_fvM.js} +1 -1
- package/dist/client/assets/{route--Wfo6oin.js → route-DXN3zvnU.js} +1 -1
- package/dist/client/assets/runnable-block-editor-D0A_7G33.js +17 -0
- package/dist/client/assets/{sandbox-lifecycle-context-DqpHXyQ8.js → sandbox-lifecycle-context-tEj7NeSK.js} +1 -1
- package/dist/client/assets/{schema-Rfnmg_Va.js → schema-CyM4H0X_.js} +1 -1
- package/dist/client/assets/{scroll-area-7XZbPxZx.js → scroll-area-CCLZd2D4.js} +1 -1
- package/dist/client/assets/{search-input-Cx23lHh9.js → search-input-DNE1KAk1.js} +1 -1
- package/dist/client/assets/{search-toggle-D-GqdL8M.js → search-toggle-B4YrNdpP.js} +1 -1
- package/dist/client/assets/{secret-picker-B9C-ibiZ.js → secret-picker-DoZMgivJ.js} +1 -1
- package/dist/client/assets/{secrets-BFZw7lDg.js → secrets-C1q3vZhr.js} +1 -1
- package/dist/client/assets/section-preview-url-7zfngvgW.js +1 -0
- package/dist/client/assets/sections-editor-CiGLlrkY.js +1 -0
- package/dist/client/assets/{select-Cm7-2WsF.js → select-CU7l4SPn.js} +1 -1
- package/dist/client/assets/{select-model-D3pjihNr.js → select-model-DYl2tU2O.js} +1 -1
- package/dist/client/assets/seo-editor-CbHeO3Xd.js +1 -0
- package/dist/client/assets/{separator-4YDN-oFo.js → separator-Cd6zs85N.js} +1 -1
- package/dist/client/assets/{settings-tab-ec2eSCVL.js → settings-tab-Du2PFP2x.js} +1 -1
- package/dist/client/assets/{sheet-J0gPDiWd.js → sheet-DtTEuIwy.js} +1 -1
- package/dist/client/assets/{shell-layout-Dnr_uzYF.js → shell-layout-C8axlHsv.js} +1 -1
- package/dist/client/assets/{skills-DScaY7fG.js → skills-J9o9rC2O.js} +1 -1
- package/dist/client/assets/{sso-DFl41agF.js → sso-bV7Ei3QZ.js} +1 -1
- package/dist/client/assets/{suggestion-C0k3QqCT.js → suggestion-CM7c__G-.js} +1 -1
- package/dist/client/assets/{switch-Bq60aCIw.js → switch-zCn72tWW.js} +1 -1
- package/dist/client/assets/{synced-repos-BInlREuH.js → synced-repos-B-motl3V.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-DkUk_qRB.js → tab-icon-glyph-CvTUM7WC.js} +1 -1
- package/dist/client/assets/{table-Cx8CjEtt.js → table-j7tpvhX7.js} +1 -1
- package/dist/client/assets/{tabs-BK_fP5GX.js → tabs-CamiZ6IK.js} +1 -1
- package/dist/client/assets/{task-board-BFfl1D46.js → task-board-Br7cqusE.js} +1 -1
- package/dist/client/assets/{task-route-Bu4cJrWx.js → task-route-ToJhBs_N.js} +1 -1
- package/dist/client/assets/{task-status-C9TjzByx.js → task-status-7L3an3eF.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-CUqMVWBV.js → taskboard-analytics-DwYSsuz1.js} +1 -1
- package/dist/client/assets/tasks-D1AbuoOZ.js +1 -0
- package/dist/client/assets/{tasks-jujyTQPa.js → tasks-TUc7G_tM.js} +1 -1
- package/dist/client/assets/{textarea-CnCfFKhD.js → textarea-Cs2ALVFi.js} +1 -1
- package/dist/client/assets/{thread-analytics-DsLVbGaY.js → thread-analytics-18vLkEQb.js} +1 -1
- package/dist/client/assets/{thread-button-CxepnIG6.js → thread-button-mBTAbNAB.js} +1 -1
- package/dist/client/assets/{thread-intent-C9kuh36t.js → thread-intent-BRFDEtsN.js} +1 -1
- package/dist/client/assets/{thread-route-C7AnvqYr.js → thread-route-3WJQl_5N.js} +1 -1
- package/dist/client/assets/{thread-route-C3M3jRBY.js → thread-route-CBdcNVEX.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-h0OpwJ8W.js → thread-sheet-body-DtI1FMdJ.js} +1 -1
- package/dist/client/assets/{toggle-group-p3YhZBU7.js → toggle-group-WQiIqlDP.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-PPGgz1s-.js → toolbar-icon-button-DI6lKL-s.js} +1 -1
- package/dist/client/assets/{tooltip-D1uOyILL.js → tooltip-Ca4Zuice.js} +1 -1
- package/dist/client/assets/{track-BauEW8uP.js → track-C_B8x08x.js} +1 -1
- package/dist/client/assets/{types-CajZUOS1.js → types-B9O8qT5G.js} +1 -1
- package/dist/client/assets/{usage-stats-DndHGCep.js → usage-stats-BHDbyrh8.js} +1 -1
- package/dist/client/assets/{use-ai-providers-fzwJF938.js → use-ai-providers-CdyQxdza.js} +1 -1
- package/dist/client/assets/{use-automations-C11dqaOx.js → use-automations-Dl9IpEMe.js} +1 -1
- package/dist/client/assets/{use-autosave-B_cEt1uS.js → use-autosave-BE2eLegN.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-7Ig_JdOB.js → use-chat-layout-state-ewW8znjZ.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DkLVJkUS.js → use-connect-companion-DaT_YSEk.js} +1 -1
- package/dist/client/assets/{use-connection-Dwv6oHsW.js → use-connection-Bh6yvYv8.js} +1 -1
- package/dist/client/assets/{use-copy-BQBzs990.js → use-copy-BsLAh-I5.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DMneE24Y.js → use-create-virtual-mcp-C6CagSpN.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BF1mSvUK.js → use-date-fns-locale-BbdJpcQT.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-ByCOPpJl.js → use-debounced-autosave-DnXjP8y9.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CH4y_C86.js → use-debounced-value-CWmFjMgl.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DfQPfB_s.js → use-deco-credits-DqjYUywC.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DPAyjg7V.js → use-decopilot-events-D-S_oS9l.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DQIa7_24.js → use-delete-connection-C_vJmNzd.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CZWREfNG.js → use-deployment-admin-UgKghI6y.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-CzmpSdfG.js → use-fast-preview-draft-url-CZpcNH3-.js} +1 -1
- package/dist/client/assets/{use-file-configs-HV0eV5oN.js → use-file-configs-BTh4qq0_.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DDhIk3H7.js → use-infinite-scroll-BiS7ALQJ.js} +1 -1
- package/dist/client/assets/{use-join-requests-BQSkOS_S.js → use-join-requests-EImmpcOk.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-CGDbxv6C.js → use-main-panel-tabs-tIcStt1Q.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DsJAhKAI.js → use-mcp-auth-status-B3xf3Gom.js} +1 -1
- package/dist/client/assets/{use-mcp-client-xmMYYBPZ.js → use-mcp-client-CByFtm0-.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DPkKxsp-.js → use-mcp-prompts-DB-V0vlN.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-rRIvhYM8.js → use-mcp-tools-Mj8i8mhD.js} +1 -1
- package/dist/client/assets/{use-members-PzBtBJpI.js → use-members-CJMFTALy.js} +1 -1
- package/dist/client/assets/{use-mobile-3IkoLh1U.js → use-mobile-WvNaKYwA.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-bOkMjgb4.js → use-navigate-to-agent-T5hUY94x.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-Cc_9d4Ik.js +1 -0
- package/dist/client/assets/{use-open-billing-url-CGP1bKOW.js → use-open-billing-url-fT3gU2Tm.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DvhI3uND.js → use-org-auth-client-qFqWUCjm.js} +1 -1
- package/dist/client/assets/{use-org-fs-BzaeparN.js → use-org-fs-DnDfHebH.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-C31wWX78.js → use-org-repo-syncs-Y4tjmBt8.js} +1 -1
- package/dist/client/assets/{use-org-sso-Digx4keO.js → use-org-sso-Df_SsXBV.js} +1 -1
- package/dist/client/assets/{use-organization-roles-5PbsFkhQ.js → use-organization-roles-fy9c2kgS.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Ba5qIUFc.js → use-organization-settings-DCzqLDlt.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-BAXybbqr.js → use-panel-navigate-AcNamGau.js} +1 -1
- package/dist/client/assets/{use-project-scope-CruROdaO.js → use-project-scope-BmVIC7K0.js} +1 -1
- package/dist/client/assets/{use-releases-X1G95Uob.js → use-releases-BAGQ808w.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-_7dZvFHt.js → use-reports-diagnostic-Du-PSYO7.js} +1 -1
- package/dist/client/assets/{use-secrets-B67HXR12.js → use-secrets-CCBBaxk4.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CgHQlaST.js → use-section-preview-base-DL4VGH7s.js} +1 -1
- package/dist/client/assets/{use-session-runtime-D0piPujV.js → use-session-runtime-CcKDXOgr.js} +1 -1
- package/dist/client/assets/{use-tags-DnY1YcOc.js → use-tags-BucTLujs.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-GV1BV282.js → use-task-board-analytics-CWulzxbI.js} +1 -1
- package/dist/client/assets/{use-task-board-events-3yXHnrTg.js → use-task-board-events-BFIYcelZ.js} +1 -1
- package/dist/client/assets/{use-task-metadata-BgGwUcnR.js → use-task-metadata-BCAlPeDJ.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-l2MVf4gO.js → use-thread-analytics-sDPuL63L.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-B-2LR7iv.js → use-thread-outputs-Qzs_VSoc.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BZSBGOtw.js +1 -0
- package/dist/client/assets/{useQueries-BXidqXZS.js → useQueries-BZORSVrx.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DVtxaxoA.js +1 -0
- package/dist/client/assets/{users-Axt4tfre.js → users-CmNy_e-w.js} +1 -1
- package/dist/client/assets/{utils-DLRFnj_1.js → utils-CbvBofjY.js} +1 -1
- package/dist/client/assets/{variant-calendar-YnefvkFK.js → variant-calendar-DV9Q6TPT.js} +1 -1
- package/dist/client/assets/variant-matcher-override-652bRaSy.js +1 -0
- package/dist/client/assets/{view-mode-toggle-D0juwS_t.js → view-mode-toggle-uHGU-MWg.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CIzV1BgR.js → virtual-mcp-2NoNlwpw.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-H_lA87ih.js +0 -1
- package/dist/client/assets/agent-deck-4S9mXIYh.js +0 -1
- package/dist/client/assets/agent-library-CGMqCDOd.js +0 -1
- package/dist/client/assets/agent-library-file-Ba6RU-PI.js +0 -1
- package/dist/client/assets/agent-settings-B-eYuC65.js +0 -1
- package/dist/client/assets/agent-site-editor-code-ehB-ysAx.js +0 -2
- package/dist/client/assets/agent-view-BKSeTQN0.js +0 -1
- package/dist/client/assets/api-keys-RhgnfloG.js +0 -1
- package/dist/client/assets/app-editor-O4jvZxzW.js +0 -1
- package/dist/client/assets/claim-phase-copy-N518EVoU.js +0 -1
- package/dist/client/assets/flat-project-D-LcYYjE.js +0 -1
- package/dist/client/assets/last-preview-page-CMEEXhSp.js +0 -1
- package/dist/client/assets/library-ChJFCyKu.js +0 -1
- package/dist/client/assets/page-seo-form-BDAt2-On.js +0 -1
- package/dist/client/assets/project-reports-CJkTPIKs.js +0 -1
- package/dist/client/assets/project-tasks-TKEKoUK5.js +0 -1
- package/dist/client/assets/record-editor-B4EOy63R.js +0 -1
- package/dist/client/assets/redirect-editor-AaUICYPD.js +0 -1
- package/dist/client/assets/reports-JjzpPdlR.js +0 -1
- package/dist/client/assets/route-0hJDzhXC.js +0 -1
- package/dist/client/assets/runnable-block-editor-DC1cxOAj.js +0 -17
- package/dist/client/assets/section-preview-url-Csj0_ZDg.js +0 -1
- package/dist/client/assets/sections-editor-BZmRuOnF.js +0 -1
- package/dist/client/assets/seo-editor-B-jyaCHB.js +0 -1
- package/dist/client/assets/tasks-CYSMbcgO.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-BN50qZ8G.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DalkWWtI.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CmIWBkvA.js +0 -1
- package/dist/client/assets/variant-matcher-override-Bq5p7Tw_.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as X,r as o,ds as Ce,dq as De,c as Pe,e as Ae,d3 as ee,X as ye,j as Ee,K as M,z as _e}from"./index-
|
|
1
|
+
import{o as X,r as o,ds as Ce,dq as De,c as Pe,e as Ae,d3 as ee,X as ye,j as Ee,K as M,z as _e}from"./index-DV2tiEDy.js";import{u as Le}from"./use-mcp-client-CByFtm0-.js";import{u as Ue}from"./use-session-runtime-CcKDXOgr.js";import{u as Re,b as Oe}from"./chat-context-DpzZ39ci.js";import{u as Be}from"./thread-intent-BRFDEtsN.js";import{e as ge}from"./backoff-8mStPHYB.js";import{b as Ne}from"./sandbox-url-D3mC8qhT.js";import{a as Fe}from"./repository-binding-BEXtvYFM.js";import{d as $e}from"./sandbox-start-errors-BK_aDCyt.js";function Ke(e,t){const n=X(t);return Ve({filters:{...e,status:"pending"}},n).length}function fe(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function Ve(e={},t){const n=X(t).getMutationCache(),s=o.useRef(e),u=o.useRef(null);return u.current===null&&(u.current=fe(n,e)),o.useEffect(()=>{s.current=e}),o.useSyncExternalStore(o.useCallback(c=>n.subscribe(()=>{const a=Ce(u.current,fe(n,s.current));u.current!==a&&(u.current=a,De.schedule(c))}),[n]),()=>u.current,()=>u.current)}async function qe(e,t,n){const s=await e.callTool({name:t,arguments:n});if(s.isError){const u=s.content?.[0]?.text??`Tool ${t} failed without a message`;throw new Error(u)}return s}const be=["SANDBOX_START"],W=new Map,He=e=>`${e.virtualMcpId}::${e.branch??""}`,Qe=e=>e.message.includes("retry shortly"),ie=new Set,le={mark:(e,t)=>ie.add(`${e}::${t}`),clear:(e,t)=>ie.delete(`${e}::${t}`),isStopped:(e,t)=>ie.has(`${e}::${t}`)};function Ye(e,t){const n=X();return Ae({mutationKey:be,retry:(s,u)=>Qe(u)&&s<6,retryDelay:s=>ge(5e3,500,s,2,0),mutationFn:async s=>{s.branch&&le.clear(s.virtualMcpId,s.branch);const u=He(s),c=W.get(u);if(c)return c;const a=(async()=>(await qe(e,"SANDBOX_START",s)).structuredContent)();W.set(u,a);try{return await a}finally{W.get(u)===a&&W.delete(u)}},onSuccess:()=>{ee(n),t?.onStarted?.()}})}function Rt(e,t){const n=Pe.c(3);let s;return n[0]!==t||n[1]!==e?(s={mutationKey:be,predicate:c=>{if(!e)return!1;const a=c.state.variables;return!a||a.virtualMcpId!==e?!1:(a.branch??"")===(t??"")}},n[0]=t,n[1]=e,n[2]=s):s=n[2],Ke(s)>0}function Se(e){return e==="installing"||e==="install-failed"||e==="starting"||e==="start-failed"||e==="running"||e==="crashed"}const Me={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},ve=o.createContext(Me),me=16384;class Xe{data="";append(t){this.data+=t,this.data.length>me&&(this.data=this.data.slice(this.data.length-me))}get(){return this.data}clear(){this.data=""}}const je=1e3,Ge=3e4,Ie=3e3,he=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],pe="log";function Je(e){if(!e)return null;try{return new URL("/_sandbox/events",e).href}catch{return null}}function We(e){return e===404}async function ze(e){try{const t=await fetch(e,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Ie)});return await t.body?.cancel().catch(()=>{}),We(t.status)}catch{return!1}}function gt({virtualMcpId:e,branch:t,previewUrl:n=null,enabled:s=!0,children:u}){const{org:c}=ye(),a=X(),V=Re()?.taskId??null,[j,y]=o.useState(null),[te,b]=o.useState({phase:"idle"}),[ne,U]=o.useState({state:"running"}),[re,E]=o.useState({kind:"unknown"}),[G,h]=o.useState(!1),[k,q]=o.useState([]),[se,R]=o.useState([]),[,H]=o.useState(0),v=o.useRef(new Map),O=o.useRef(new Set),w=o.useRef(new Set),C=o.useRef(null),p=Je(n),Q=Fe(e)?.metadata?.runtime?.selected==="deno",_=d=>{let S=v.current.get(d);return S||(S=new Xe,v.current.set(d,S)),S};o.useEffect(()=>{if(y(null),b({phase:"idle"}),U({state:"running"}),E({kind:"unknown"}),C.current=null,h(!1),q([]),R([]),v.current.clear(),!e||!t||!s)return;const d=Ne({orgSlug:c.slug,virtualMcpId:e,branch:t,threadId:V??null},"events");let S=!1,D=0,L=null,T=null,P=null,g=null,m=null,A=null;const I=r=>{try{const i=JSON.parse(r.data);y(i),i.kind!=="failed"&&(h(!1),D=0),i.kind==="ready"&&ae()}catch(i){console.warn("[vm-events] bad phase payload",i)}},B=()=>{h(!0),y(null),b({phase:"idle"}),U({state:"running"}),E({kind:"unknown"}),q([]),R([]),v.current.clear()},Y=r=>{try{const i=JSON.parse(r.data);if(typeof i.data!="string")return;D=0;const f=i.data.replace(/\r?\n/g,`\r
|
|
2
2
|
`);_(i.source).append(f);for(const l of O.current)try{l(i.source,f)}catch{}H(l=>l+1)}catch{}},J=r=>{const i=r.type;try{const f=JSON.parse(r.data);switch(D=0,i){case"lifecycle":{const l=f;b(l.state);const F=`${c.slug}/${e}/${t}`;if(Se(l.state.phase)&&!(A&&Se(A))){ee(a,c.id);const K=M.decofile(F);a.getQueryData(K)===void 0&&a.invalidateQueries({queryKey:K})}l.state.phase==="running"&&A!=="running"&&(ee(a,c.id),a.invalidateQueries({queryKey:M.decofile(F)}),a.invalidateQueries({queryKey:M.liveMeta(c.slug,e,t)})),A=l.state.phase;const $=l.state.phase==="running"?l.state.port:null,ce=C.current;if(C.current=$,ce!==null&&$!==null&&ce!==$)for(const K of w.current)try{K()}catch{}return}case"status":U(f);return;case"tasks":{const F=f.active.map($=>$.logName??"").filter(Boolean);R(F);return}case"scripts":q(f.scripts);return;case"branch":{const l=f.meta;E(l);return}case"reload":for(const l of w.current)try{l()}catch{}return;case"file-changed":{const{path:l}=f,F=`${c.slug}/${e}/${t}`;if(l.startsWith(".deco/")||l.includes("/.deco/")){if(!(A==="running"))return;P&&clearTimeout(P),P=setTimeout(()=>{if(P=null,a.invalidateQueries({queryKey:M.decofile(F)}),Q)for(const K of w.current)try{K()}catch{}},500)}else T&&clearTimeout(T),T=setTimeout(()=>{T=null,a.invalidateQueries({queryKey:M.liveMeta(c.slug,e,t)})},1e3);return}}}catch{}};function N(){if(S)return;const r=new EventSource(d);g=r,r.onopen=()=>{},r.onerror=()=>{g===r&&r.readyState===EventSource.CLOSED&&x("studio")},r.addEventListener("phase",I),r.addEventListener("gone",B),r.addEventListener(pe,Y);for(const i of he)r.addEventListener(i,J)}function ae(){if(S||!p||m)return;const r=new EventSource(p);m=r;let i=!1;r.onopen=()=>{if(S||m!==r)return;i=!0,D=0;const f=g;g=null,f?.close()},r.onerror=()=>{m===r&&r.readyState===EventSource.CLOSED&&ue(r,i)},r.addEventListener(pe,Y);for(const f of he)r.addEventListener(f,J)}async function ue(r,i){const f=p?await ze(p):!1;if(!(S||m!==r)){if(r.close(),m=null,f){B(),g||N();return}i&&x("direct")}}function x(r){if(S||L)return;const i=ge(Ge,je,D,2,0);D++,L=setTimeout(()=>{if(L=null,!S){if(r==="direct"){m?.close(),m=null,ae();return}g?.close(),g=null,N()}},i)}return N(),()=>{S=!0,g?.close(),m?.close(),L&&clearTimeout(L),T&&clearTimeout(T),P&&clearTimeout(P)}},[e,t,c.slug,c.id,s,V,p,a,Q]);const oe={phase:j,lifecycle:te,status:ne,branch:re,notFound:G,scripts:k,activeProcesses:se,getBuffer:d=>v.current.get(d)?.get()??"",hasData:d=>(v.current.get(d)?.get().length??0)>0,subscribeChunks:d=>(O.current.add(d),()=>{O.current.delete(d)}),subscribeReload:d=>(w.current.add(d),()=>{w.current.delete(d)})};return Ee.jsx(ve,{value:oe,children:u})}function de(){return o.use(ve)}function bt(e){const{subscribeChunks:t}=de(),n=o.useRef(e);n.current=e,o.useEffect(()=>t((c,a)=>{n.current?.(c,a)}),[t])}function vt(e){const{subscribeReload:t}=de(),n=o.useRef(e);n.current=e,o.useEffect(()=>t(()=>{n.current?.()}),[t])}function Ze(e){return e.appPaused||e.userStopped?{kind:"suspended"}:e.startError&&!e.previewUrl?{kind:"errored",error:e.startError}:e.previewUrl?{kind:"iframe",previewUrl:e.previewUrl}:{kind:"starting"}}function et(e){return e.executionEnabled&&e.sessionRuntime==="sandbox"&&e.hasActiveRepository&&!!e.userId&&!!e.branch&&!e.vmEntry&&!e.userStopped&&!e.isPending&&!e.attempted}function wt(e){return e.threadLoaded&&e.isOwner&&e.hasActiveRepository&&!e.branch&&!e.attempted}function tt(e){return e.executionEnabled&&e.notFound&&!!e.deadVmId&&!e.isPending&&!e.userStopped&&e.deadVmId!==e.lastDeadVmId}function Tt(e){const{agentSandboxMap:t,threadSandboxMap:n,userId:s,branch:u}=e,c=e.ownerId??s;if(!s||!c||!u)return t;const a=n?.[c]?.[u];return a?{...t??{},[s]:{...t?.[s]??{},[u]:a}}:t}function z(e,t,n){const s={virtualMcpId:e};return t&&(s.branch=t),n&&(s.threadId=n),s}const we=2,nt=new Set(["scheduling-timeout","reconciler-error","claim-never-created","unknown"]);function Te(e){return nt.has(e)}function rt(e){return e.executionEnabled&&e.failedReason!==null&&Te(e.failedReason)&&e.attempts<we&&!e.isPending&&!e.userStopped&&!e.alreadyHandled}const st={branch:null,count:0,handled:!1};function ot(e,t){return e.branch===t?e:{branch:t,count:0,handled:!1}}function at(e){return e.mutationError?e.mutationError:e.phase?.kind==="failed"&&!e.startPending&&e.claimRetryExhausted?{code:null,message:e.phase.message}:null}function ut(e){switch(e.kind){case"suspended":return"suspended";case"iframe":return"running";case"starting":return"starting";case"errored":return"errored"}}function xe(e,t){return`${e??""}::${t??""}`}function ct(e){const t=e.vmEntry?.previewUrl??null;return t||(e.seeded?.key===e.key?e.seeded.url:null)}function Z(e){const{data:t,virtualMcpId:n,branch:s}=e;t?.branch&&!s&&e.setCurrentTaskBranch(t.branch),t?.previewUrl&&e.setSeededPreviewUrl({key:xe(n,t.branch??s),url:t.previewUrl})}const it={branch:null,previewState:{kind:"starting"},status:"idle",vmEntry:null,previewUrl:null,userStopped:!1,start:()=>{},stop:async()=>{},restart:async()=>{},retry:()=>{},resume:()=>{}},ke=o.createContext(it);function xt(){return o.use(ke)}function kt({executionEnabled:e,virtualMcpId:t,branch:n,userId:s,hasActiveRepository:u,vmEntry:c,threadId:a,children:V}){const{org:j}=ye(),{setCurrentTaskBranch:y}=Oe(),te=Be(),b=de(),ne=X(),U=Ue(t),re=U.resolved?U.runtime:null,E=Re()?.taskId??null,G=Le({connectionId:_e,orgId:j.id,orgSlug:j.slug}),h=Ye(G,{onStarted:()=>{a&&te?.refreshThreadMetadata(a)}}),{mutate:k,reset:q}=h,[se,R]=o.useState(null),H=o.useRef(new Set),v=o.useRef(null),[O,w]=o.useState(st),C=ot(O,n);C!==O&&w(C);const p=b.phase?.kind==="failed"?b.phase:null,Q=ct({vmEntry:c,seeded:p?null:se,key:xe(t,n)}),_=!!t&&!!n&&le.isStopped(t,n),oe=b.status.state==="paused",d=!p||!Te(p.reason)||C.count>=we,S=at({mutationError:h.isError&&h.error?$e(h.error.message):null,phase:b.phase,startPending:h.isPending,claimRetryExhausted:d}),D=Ze({previewUrl:Q,appPaused:oe,userStopped:_,startError:S}),L=ut(D),T=n??"",P=H.current.has(T),g=et({executionEnabled:e,hasActiveRepository:u,userId:s,branch:n,vmEntry:c,userStopped:_,isPending:h.isPending,attempted:P,sessionRuntime:re});o.useEffect(()=>{if(!g||!t)return;H.current.add(T);const x=z(t,n,E);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:y,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] auto-start failed:",r)}})},[g,T,n,t,E,k,y,R]);const m=b.notFound?c?.sandboxHandle??null:null,A=tt({executionEnabled:e,notFound:b.notFound,deadVmId:m,lastDeadVmId:v.current,isPending:h.isPending,userStopped:_});o.useEffect(()=>{if(!A||!m||!t)return;v.current=m;const x=z(t,n,E);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:y,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] self-heal failed:",r)}})},[A,m,t,n,E,k,y,R]);const I=rt({executionEnabled:e,failedReason:p?.reason??null,attempts:C.count,isPending:h.isPending,userStopped:_,alreadyHandled:C.handled});o.useEffect(()=>{if(!p){w(r=>r.handled?{...r,handled:!1}:r);return}if(!I||!t)return;w(r=>({...r,handled:!0,count:r.count+1}));const x=z(t,n,E);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:y,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] claim auto-retry failed:",r)}})},[p,I,t,n,E,k,y,R]);const B=()=>{if(!e||!t)return;const x=z(t,n,E);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:y,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] user start failed:",r)}})},Y=async()=>{if(!(!e||!t||!n)&&c){le.mark(t,n);try{await G.callTool({name:"SANDBOX_DELETE",arguments:{virtualMcpId:t,branch:n}})}catch{}ee(ne)}},J=async()=>{await Y(),B()},N=()=>{H.current=new Set,v.current=null,w({branch:n,count:0,handled:!1}),q(),B()},ue={branch:n,previewState:D,status:L,vmEntry:c,previewUrl:Q,userStopped:_,start:B,stop:Y,restart:J,retry:N,resume:N};return Ee.jsx(ke,{value:ue,children:V})}export{gt as S,kt as a,Ye as b,de as c,xt as d,bt as e,vt as f,Ke as g,Tt as o,wt as s,Rt as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{au as n,bK as t,av as e,bL as m,bM as p,bN as d,bO as h}from"./index-
|
|
1
|
+
import{au as n,bK as t,av as e,bL as m,bM as p,bN as d,bO as h}from"./index-DV2tiEDy.js";const s=500;n({title:e().max(s),url:e().max(s),icon:e().max(s)});const i=n({keyId:e().max(s),modelId:e().max(s),title:e().max(s).optional()}).nullable();m(["fast","smart","thinking","image","web_search","deep_research"]);m(["fast","smart","thinking"]);const y=n({tiers:n({fast:i,smart:i,thinking:i,image:i,web_search:i,deep_research:i})});n({tiers:n({fast:i.optional(),smart:i.optional(),thinking:i.optional()})});const v=50,b=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/;n({host:e().min(1).max(s).regex(b).describe("Git host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:e().min(1).max(s).describe("Vault secret id holding the PAT used to authenticate this host.")});n({ids:p(e().max(s)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const x=n({voice_mode:t().optional(),home_task_intake_enabled:t().optional().describe("Show Task mode on the Home composer and allow reports to start tasks."),demo_mode:t().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:t().optional().describe("Curated Deco Score look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),reviewer_enabled:t().optional().describe("Run the Reviewer on a task's pull request once it's In Review — it reviews the code with the repo's stack-appropriate skills, fixes what it finds on the PR's own branch, then exercises the change on the deploy preview and approves or hands the card to a human."),qa_agent_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:t().optional().describe("When the Reviewer approves a task's pull request, merge it automatically instead of leaving the merge to a human."),auto_resolve_conflicts:t().optional().describe("When an approved pull request can't be merged because it conflicts with its base branch, hand it back to the Super Agent to resolve the conflict (check out the branch, merge the base, push). Unset, it follows `auto_merge`; set it explicitly to run one without the other."),cheap_reviewer_model:t().optional().describe("Run the Reviewer on a cheaper model than the Super Agent that wrote the code. On by default — turning it off trades cost for some review depth."),coding_agent_org_mcps:t().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow task-run surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),coding_agents_claude_code:t().optional().describe("Run chats on a Code Agent (an agent imported from a GitHub repo) with the claude-code harness inside its sandbox, instead of hosted Decopilot. Off by default: it changes the runtime of every such chat, and claude-code flushes whole turns rather than streaming tokens."),auto_assign_report_tasks_to_super_agent:t().optional().describe("When a Deco Score import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned."),hosting_enabled:t().optional().describe("Per-site Hosting tab (deployments, domains, deploy outcomes). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),deco_analytics_enabled:t().optional().describe("Per-site Deco Analytics tab (traffic, realtime, usage & limits). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),e2e_enabled:t().optional().describe("Per-site E2E tab (end-to-end test runs). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),experiments_enabled:t().optional().describe("Per-site Experiments tab (A/B tests + variant results). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org."),monitor_enabled:t().optional().describe("Per-site Monitor tab (CDN Performance + Audience from the stats-lake warehouse). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. Its own deployment-wide switch `MONITOR_GA` opens it to every org at once (independent of the control-plane trio)."),site_create_enabled:t().optional().describe('The "Create a new site" option under New project: generates a GitHub repository from a site template in an account the org connected, and opens it as a project. Off by default, for every org — deco.cx staff included.'),delivery_lanes_enabled:t().optional().describe("Board lanes for shipping: Approved, Merged and Post-deploy Validation sit between In Review and Done, and a merged pull request lands on Merged instead of Done. For teams whose release process continues after the merge. Off by default — with it off the board and the state machine behave exactly as if the lanes did not exist."),new_blocks_editor:t().optional().describe("Use the redesigned blocks editor for every member of the organization. Off by default — the classic editor stays until an admin opts the org in.")}),u=new Set(["reviewer_enabled","cheap_reviewer_model"]);function w(a,r){const c=a?.[r];return u.has(r)?c!==!1:c===!0}function A(a){const r=a?.auto_resolve_conflicts;return typeof r=="boolean"?r:a?.auto_merge===!0}const l=256*1024,f=50,o=500,g=5e3;n({id:e().describe("Brand context ID"),name:e().max(o).describe("Company name"),domain:e().max(o).describe("Company domain (e.g. example.com)"),overview:e().max(g).describe("Company overview / description"),logo:e().max(o).nullable().optional().describe("Logo URL"),favicon:e().max(o).nullable().optional().describe("Favicon URL"),ogImage:e().max(o).nullable().optional().describe("OG image URL"),fonts:n({heading:e().max(o).optional().describe("Font family for headings"),body:e().max(o).optional().describe("Font family for body text"),code:e().max(o).optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:n({primary:e().max(o).optional().describe("Primary brand color (hex)"),secondary:e().max(o).optional().describe("Secondary brand color (hex)"),accent:e().max(o).optional().describe("Accent / highlight color (hex)"),background:e().max(o).optional().describe("Background color (hex)"),foreground:e().max(o).optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:p(d(e(),h())).max(f).nullable().optional().refine(a=>a==null||JSON.stringify(a).length<=l,{message:`images must serialize to at most ${l} bytes`}).describe("Brand images"),metadata:d(e(),h()).nullable().optional().refine(a=>a==null||JSON.stringify(a).length<=l,{message:`metadata must serialize to at most ${l} bytes`}).describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:e().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:t().optional().describe("Whether this is the default brand for the organization")});export{u as D,v as G,x as O,y as S,A as a,b,w as o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,bm as T,bq as ce,j as b,bo as _,bF as ae,dc as O,bp as C,bz as P,bu as ie,c as F,l as $}from"./index-DDMwhF4p.js";import{e as de}from"./select-Cm7-2WsF.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[A,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,W]=d.useState(!1),v=T(e,R=>c(R)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:W,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(J,o),a=d.useRef(null),c=T(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(V,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(V,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return E(o.viewport,c),E(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(V,{"data-state":n?"visible":"hidden",...t,ref:e})})}),V=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=m(g,o),[w,A]=d.useState(null),Y=T(e,v=>A(v)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(i),y=P(c),N=X(h,10);function W(v){if(x.current){const p=v.clientX-x.current.left,R=v.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),W(v))}),onPointerMove:C(r.onPointerMove,W),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),H="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(H,o),s=ee(H,o),{onThumbPositionChange:a}=s,c=T(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=H;var B="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(B,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=B;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(B,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function E(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Re=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Ee(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
|
|
1
|
+
import{r as d,bm as T,bq as ce,j as b,bo as _,bF as ae,dc as O,bp as C,bz as P,bu as ie,c as F,l as $}from"./index-DV2tiEDy.js";import{e as de}from"./select-CU7l4SPn.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[A,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,W]=d.useState(!1),v=T(e,R=>c(R)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:W,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(J,o),a=d.useRef(null),c=T(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(V,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(V,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return E(o.viewport,c),E(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(V,{"data-state":n?"visible":"hidden",...t,ref:e})})}),V=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=m(g,o),[w,A]=d.useState(null),Y=T(e,v=>A(v)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(i),y=P(c),N=X(h,10);function W(v){if(x.current){const p=v.clientX-x.current.left,R=v.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),W(v))}),onPointerMove:C(r.onPointerMove,W),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),H="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(H,o),s=ee(H,o),{onThumbPositionChange:a}=s,c=T(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=H;var B="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(B,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=B;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(B,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function E(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Re=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Ee(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as b,l as w,j as a,h as j}from"./index-
|
|
1
|
+
import{c as b,l as w,j as a,h as j}from"./index-DV2tiEDy.js";import{i as v}from"./SearchMd-Dvzi_iL7.js";function k(f){const e=b.c(17),{value:l,onChange:c,placeholder:m,onKeyDown:u,className:d,isSearching:p,disabled:r}=f,x=m===void 0?"Search...":m,h=r&&"pointer-events-none opacity-50";let t;e[0]!==d||e[1]!==h?(t=w("flex items-center gap-4 rounded-lg bg-[var(--studio-input-background)] px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",h,d),e[0]=d,e[1]=h,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{className:"size-4 text-muted-foreground/75 shrink-0"}):a.jsx(v,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=g=>c(g.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==r||e[8]!==u||e[9]!==x||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:u,placeholder:x,disabled:r,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=r,e[8]=u,e[9]=x,e[10]=s,e[11]=l,e[12]=o):o=e[12];let i;return e[13]!==t||e[14]!==n||e[15]!==o?(i=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=i):i=e[16],i}export{k as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as K,r as C,l as B,j as a}from"./index-
|
|
1
|
+
import{c as K,r as C,l as B,j as a}from"./index-DV2tiEDy.js";import{i as I}from"./SearchMd-Dvzi_iL7.js";import{i as M}from"./X-BBgrZ5uI.js";import{I as O}from"./icon-button-BI_CutJE.js";function H(S){const e=K.c(34),{value:t,onChange:s,label:E,placeholder:D,clearLabel:F,expanded:o,className:j}=S,w=E===void 0?"Search":E,d=D===void 0?"Search…":D,y=F===void 0?"Clear search":F,[L,p]=C.useState(t!==""),[R,z]=C.useState(!1),[V,$]=C.useState(t);if(t!==V&&($(t),t===""&&!R&&p(!1)),!L&&!o){let l,g;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>p(!0),g=a.jsx(I,{}),e[0]=l,e[1]=g):(l=e[0],g=e[1]);let v;return e[2]!==w?(v=a.jsx(O,{label:w,tooltipSide:"bottom",variant:"secondary",onClick:l,children:g}),e[2]=w,e[3]=v):v=e[3],v}const _=o?"h-10 w-full px-3":"h-7 w-32 animate-search-expand px-2.5 sm:w-44";let n;e[4]!==j||e[5]!==_?(n=B("inline-flex shrink-0 items-center gap-1.5 overflow-hidden rounded-full bg-card text-card-foreground card-shadow",_,j),e[4]=j,e[5]=_,e[6]=n):n=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(I,{className:"size-4 shrink-0 text-muted-foreground"}),e[7]=x):x=e[7];const k=!o;let r;e[8]!==s?(r=l=>s(l.target.value),e[8]=s,e[9]=r):r=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>z(!0),e[10]=h):h=e[10];let i;e[11]!==t?(i=()=>{z(!1),t===""&&p(!1)},e[11]=t,e[12]=i):i=e[12];let c;e[13]!==s?(c=l=>{l.key==="Escape"&&s("")},e[13]=s,e[14]=c):c=e[14];const N=o?"text-sm":"text-xs";let f;e[15]!==N?(f=B("w-full min-w-0 bg-transparent outline-none placeholder:text-muted-foreground",N),e[15]=N,e[16]=f):f=e[16];let u;e[17]!==d||e[18]!==i||e[19]!==c||e[20]!==f||e[21]!==k||e[22]!==r||e[23]!==t?(u=a.jsx("input",{autoFocus:k,value:t,onChange:r,onFocus:h,onBlur:i,onKeyDown:c,placeholder:d,"aria-label":d,className:f}),e[17]=d,e[18]=i,e[19]=c,e[20]=f,e[21]=k,e[22]=r,e[23]=t,e[24]=u):u=e[24];let m;e[25]!==y||e[26]!==o||e[27]!==s||e[28]!==t?(m=t!==""&&a.jsx("button",{type:"button","aria-label":y,onMouseDown:P,onClick:()=>{s(""),o||p(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:a.jsx(M,{className:"size-3.5"})}),e[25]=y,e[26]=o,e[27]=s,e[28]=t,e[29]=m):m=e[29];let b;return e[30]!==u||e[31]!==m||e[32]!==n?(b=a.jsxs("div",{className:n,children:[x,u,m]}),e[30]=u,e[31]=m,e[32]=n,e[33]=b):b=e[33],b}function P(S){return S.preventDefault()}export{H as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as x,b as d,j as l}from"./index-
|
|
1
|
+
import{c as x,b as d,j as l}from"./index-DV2tiEDy.js";import{s as j}from"./User01-DP_CWS--.js";import{t as E}from"./Users01-DJZa484d.js";const b=/^[A-Za-z0-9_.-]+$/;function h(u){const e=x.c(15),{field:p,secretById:t}=u,s=d(),n=p.value||"";if(!n)return null;let a;e[0]!==n||e[1]!==t?(a=t.get(n),e[0]=n,e[1]=t,e[2]=a):a=e[2];const c=a;if(!c){let i;e[3]!==n||e[4]!==s?(i=s("sandbox.envVarsField.missingSecret",{id:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5];let f;return e[6]!==i?(f=l.jsx("span",{className:"text-destructive",children:i}),e[6]=i,e[7]=f):f=e[7],f}let o;e[8]!==c.scope?(o=l.jsx(N,{scope:c.scope}),e[8]=c.scope,e[9]=o):o=e[9];let r;e[10]!==c.name?(r=l.jsx("span",{className:"truncate font-mono",children:c.name}),e[10]=c.name,e[11]=r):r=e[11];let m;return e[12]!==o||e[13]!==r?(m=l.jsxs("span",{className:"inline-flex items-center gap-1.5 truncate",children:[o,r]}),e[12]=o,e[13]=r,e[14]=m):m=e[14],m}function N(u){const e=x.c(2),{scope:p}=u,t=p==="user"?j:E;let s;return e[0]!==t?(s=l.jsx(t,{className:"size-3 text-muted-foreground"}),e[0]=t,e[1]=s):s=e[1],s}export{h as S,b as a,N as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as j,b as y,j as s,n as C,fn as $,E as F,r as N,aS as L,B as D,a6 as E,t as _}from"./index-
|
|
1
|
+
import{c as j,b as y,j as s,n as C,fn as $,E as F,r as N,aS as L,B as D,a6 as E,t as _}from"./index-DV2tiEDy.js";import{i as O}from"./AlertCircle-BcMtONTy.js";import{s as B}from"./Plus-pdohMH0C.js";import{s as A}from"./User01-DP_CWS--.js";import{t as R}from"./Users01-DJZa484d.js";import{D as I,b as q,c as V,d as H,h as G,e as J}from"./dialog-ChgvvLIn.js";import{I as z}from"./input-DistjIbs.js";import{L as w}from"./label-Wib6sduZ.js";import{S as K,b as M,a as Q,d as U,c as P}from"./select-CU7l4SPn.js";import{T as W}from"./textarea-Cs2ALVFi.js";import{u as X,a as Y}from"./use-secrets-CCBBaxk4.js";import{R as Z}from"./require-capability-DiYCjXLj.js";import"./X-BBgrZ5uI.js";import"./index-D_26d7wd.js";import"./Check-DvlVwSY0.js";import"./ChevronUp-C6-gUxpN.js";import"./access-gate-nWfRMJBo.js";import"./capability-load-error-C96DuehA.js";function ee(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(O,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let a;return e[4]!==n?(a=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=a):a=e[5],a}function te(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?A:R;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const a=n;let l;e[3]!==c?(l=s.jsx(c,{size:12}),e[3]=c,e[4]=l):l=e[4];let o;return e[5]!==a||e[6]!==l?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[l,a]}),e[5]=a,e[6]=l,e[7]=o):o=e[7],o}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(E,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(te,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let a;e[5]!==c||e[6]!==n?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=a):a=e[7];let l;e[8]!==r.description?(l=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=l):l=e[9];let o;e[10]!==a||e[11]!==l?(o=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[a,l]})]}),e[10]=a,e[11]=l,e[12]=o):o=e[12];let d;e[13]!==r.createdAt?(d=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=d):d=e[14];let m;e[15]!==d?(m=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:d}),e[15]=d,e[16]=m):m=e[16];let x;return e[17]!==o||e[18]!==m?(x=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[o,m]}),e[17]=o,e[18]=m,e[19]=x):x=e[19],x}function se(t){const e=j.c(15),{action:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(E,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let a;e[3]!==n?(a=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=a):a=e[4];let l;e[5]!==i?(l=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=l):l=e[6];let o;e[7]!==l?(o=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:l}),e[7]=l,e[8]=o):o=e[8];let d;e[9]!==a||e[10]!==o?(d=s.jsxs("div",{children:[a,o]}),e[9]=a,e[10]=o,e[11]=d):d=e[11];let m;return e[12]!==r||e[13]!==d?(m=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,d,r]}),e[12]=r,e[13]=d,e[14]=m):m=e[14],m}function k({open:t,onOpenChange:e}){const r=y(),[i,c]=N.useState("organization"),[n,a]=N.useState(""),[l,o]=N.useState(""),[d,m]=N.useState(""),x=Y();function g(){c("organization"),a(""),o(""),m("")}function p(){g(),e(!1)}async function b(u){if(u.preventDefault(),!(!n.trim()||!l))try{await x.mutateAsync({scope:i,name:n.trim(),value:l,description:d.trim()||void 0}),_.success(r("settings.secrets.secretCreated",{name:n.trim()})),p()}catch(f){_.error(f instanceof Error?f.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(I,{open:t,onOpenChange:u=>{u?e(u):p()},children:s.jsxs(q,{className:"sm:max-w-lg",children:[s.jsxs(V,{children:[s.jsx(H,{children:r("settings.secrets.newSecretTitle")}),s.jsx(G,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:b,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(K,{value:i,onValueChange:u=>c(u),children:[s.jsx(M,{id:"secret-scope",children:s.jsx(Q,{})}),s.jsxs(U,{children:[s.jsx(P,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(P,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:u=>a(u.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:l,onChange:u=>o(u.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(W,{id:"secret-description",value:d,onChange:u=>m(u.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(J,{children:[s.jsx(D,{type:"button",variant:"outline",onClick:p,disabled:x.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(D,{type:"submit",disabled:x.isPending||!n.trim()||!l,children:x.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function re(){const t=j.c(34),e=y(),r=X(),[i,c]=N.useState(!1);let n,a;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>c(!0),a=s.jsx(B,{size:14}),t[0]=n,t[1]=a):(n=t[0],a=t[1]);let l;t[2]!==e?(l=e("settings.secrets.newSecret"),t[2]=e,t[3]=l):l=t[3];let o;t[4]!==l?(o=s.jsx(C.Actions,{children:s.jsxs(D,{size:"sm",onClick:n,children:[a,l]})}),t[4]=l,t[5]=o):o=t[5];const d=o;if(r.length===0){let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(se,{action:!1}),t[6]=u):u=t[6];let f;t[7]!==i?(f=s.jsx(k,{open:i,onOpenChange:c}),t[7]=i,t[8]=f):f=t[8];let h;return t[9]!==d||t[10]!==f?(h=s.jsxs(s.Fragment,{children:[d,u,f]}),t[9]=d,t[10]=f,t[11]=h):h=t[11],h}let m,x,g;if(t[12]!==d||t[13]!==r||t[14]!==e){const u=r.filter(le),f=r.filter(ce),h=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let S;t[18]!==r.length||t[19]!==e||t[20]!==h?(S=e(h,{count:r.length}),t[18]=r.length,t[19]=e,t[20]=h,t[21]=S):S=t[21];let v;t[22]!==S?(v=s.jsx("p",{className:"text-sm text-muted-foreground",children:S}),t[22]=S,t[23]=v):v=t[23],t[24]!==d||t[25]!==v?(m=s.jsxs("div",{className:"flex items-center justify-between",children:[v,d]}),t[24]=d,t[25]=v,t[26]=m):m=t[26],x=u.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:u.map(ie)})]}):null,g=f.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:f.map(ne)})]}):null,t[12]=d,t[13]=r,t[14]=e,t[15]=m,t[16]=x,t[17]=g}else m=t[15],x=t[16],g=t[17];let p;t[27]!==i?(p=s.jsx(k,{open:i,onOpenChange:c}),t[27]=i,t[28]=p):p=t[28];let b;return t[29]!==m||t[30]!==x||t[31]!==g||t[32]!==p?(b=s.jsxs(s.Fragment,{children:[m,x,g,p]}),t[29]=m,t[30]=x,t[31]=g,t[32]=p,t[33]=b):b=t[33],b}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return s.jsx(T,{secret:t},t.id)}function ce(t){return t.scope==="user"}function le(t){return t.scope==="organization"}function ae(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{fallback:oe,children:s.jsx(N.Suspense,{fallback:s.jsx(L,{className:"h-32 w-full"}),children:s.jsx(re,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Container,{children:s.jsxs($,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function oe(t){const{error:e}=t;return s.jsx(ee,{error:e??new Error("Failed to load secrets")})}function ze(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Z,{capability:"secrets:manage",area:"secrets",children:s.jsx(ae,{})}),t[0]=e):e=t[0],e}export{ze as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function c(e){return btoa(encodeURIComponent(e))}function p(e,r,n){const o=i(e,r,n);return o.searchParams.set("__cb",crypto.randomUUID()),o.toString()}function i(e,r,n){const o=new URL(e).origin,s=new URL(`/live/previews/${encodeURIComponent(r)}`,o);return s.searchParams.set("path","/"),s.searchParams.set("pathTemplate","/"),s.searchParams.set("props",c(JSON.stringify({path:"/",sections:[{__resolveType:n}]}))),s}const l="__draft";function v(e){return`${`${e.apiHost}/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}?token=${e.token}`}@${e.version}`}const _="off";function f(e,r){if(!r)return e;const n=new URL(e);return n.searchParams.set(l,r),n.toString()}function d(e){const r=e.pageBlock.__resolveType;if(typeof r!="string"||!r)return null;const n=new URL(e.previewBaseUrl).origin,o=new URL(`/live/previews/${encodeURIComponent(r)}`,n);o.searchParams.set("__decoFBT","0"),o.searchParams.set("__d",""),o.searchParams.set("path",e.path),o.searchParams.set("pathTemplate",e.pathTemplate);const{__resolveType:s,...t}=e.pageBlock,a=JSON.stringify({__props:t,__decofile:e.decofile});return{src:o.toString(),body:a}}function w(e,r,n,o){const s=new URL(e).origin,t=new URL(`/live/previews/${encodeURIComponent(r)}`,s);t.searchParams.set("__d","");const a=[{__resolveType:"preview",block:n}];return o&&a.push(o),t.searchParams.set("props",c(JSON.stringify({sections:a}))),t.toString()}function U(e){return e.fastPreviewActive&&e.previewServerUrl?e.previewServerUrl:e.sandboxUrl??null}export{_ as D,d as a,p as b,v as c,w as d,i as g,U as r,f as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as Jt,b as Yt,r as j,l as oe,j as n,aR as ho,B as Vt,G as Kt,al as go,I as vo,H as So,o as yo,h as bo,t as N,K as xo}from"./index-DV2tiEDy.js";import{u as _o}from"./chat-context-DpzZ39ci.js";import{u as fs}from"./use-new-blocks-editor-Cc_9d4Ik.js";import{E as jo,F as Eo,G as ko,H as wo,I as Ro,J as Vo,K as To,V as No,L as Ao,N as Bn,O as Mo,Q as Po,C as cs,y as us,e as Co,f as Do,j as Ko,u as Bo,T as Ln,U as Lo,W as Fo,X as Io,Y as Oo,Z as zo,p as rs,A as kt,_ as $o,$ as Ho,w as Fn,a0 as Go,a1 as qo,a2 as is,a3 as In,a4 as On,a5 as zn,a6 as As,a7 as Wo,a8 as Uo,z as Jo,a9 as $n,aa as Yo,ab as Hn,ac as Gn,M as Qo,ad as qn,ae as lt,d as Zo,af as qt,ag as Xo,ah as er,ai as Ms,aj as tr}from"./runnable-block-editor-D0A_7G33.js";import{f as sr}from"./repository-binding-BEXtvYFM.js";import{n as nr,t as ar}from"./ChevronUp-C6-gUxpN.js";import{a5 as oa,b as ms,ai as or,x as rr,Z as Wn,G as Un}from"./agent-icon-CU70YHcG.js";import{S as Bt}from"./scroll-area-CCLZd2D4.js";import{b as ct,T as ut,a as dt}from"./tooltip-Ca4Zuice.js";import{m as ir,u as lr,P as cr}from"./mustache-CkphMDQt.js";import{aq as ra,c as Is,ar as ia,G as ur,ag as Rt,a4 as Ds,as as Ks,ah as xt,a5 as Lt,j as dr,l as mr,g as fr,r as ls,ak as pr,af as Wt,at as tt,au as Jn,a6 as Ps,ae as bt,ad as Ut,av as hr,aw as gr,K as vr,ax as Sr,ai as Yn,_ as Qn,ay as yr,az as wt,aA as br,aB as xr,aC as _r,aD as Zn,aE as jr,aF as Er,aG as kr,ac as wr,aH as Rr,aI as Vr,aJ as Tr,aK as Nr,ab as Ar,aL as Mr}from"./claim-phase-copy-BdgkyBTp.js";import{a as Pr}from"./Copy01-CbyKzYad.js";import{a as Bs,d as la}from"./UserSquare-WR18fNY8.js";import{b as Xn}from"./Tool01-CeXTeg_f.js";import{s as ea}from"./Image01-EkAEptBw.js";import{s as Cr}from"./Plus-pdohMH0C.js";import{s as Dr}from"./Trash01-Dpe9Tntu.js";import{i as Ls}from"./ZoomOut-Zf1vCzpA.js";import{a as Kr,b as ta,d as Br,K as Lr,P as Fr,u as Ir,C as Or,s as zr,e as ds,D as $r,c as Hr,S as Gr,v as qr}from"./rich-text-link-control-BVIyTHF6.js";import{a as Wr,P as sa,b as Ur}from"./page-seo-form-C922sgVd.js";import{u as Jr,A as Yr}from"./use-section-preview-base-DL4VGH7s.js";import{b as na,a as Qr}from"./variant-matcher-override-652bRaSy.js";import"./use-panel-navigate-AcNamGau.js";import"./thread-route-3WJQl_5N.js";import"./use-project-scope-BmVIC7K0.js";import"./autosend-BVzqsL9-.js";import"./thread-intent-BRFDEtsN.js";import"./use-mcp-client-CByFtm0-.js";import"./auth-BEWuraWE.js";import"./backoff-8mStPHYB.js";import"./task-board-Br7cqusE.js";import"./schema-CyM4H0X_.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-decopilot-events-D-S_oS9l.js";import"./use-ai-providers-CdyQxdza.js";import"./location-DPIrGNp7.js";import"./use-organization-settings-DCzqLDlt.js";import"./use-session-runtime-CcKDXOgr.js";import"./Sun-CwYLjowh.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-BLig-zhY.js";import"./LinkBroken01-yaKPcgyZ.js";import"./Check-DvlVwSY0.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-DX3VGRWM.js";import"./use-copy-BsLAh-I5.js";import"./usage-stats-BHDbyrh8.js";import"./markdown-DYMWaMLt.js";import"./dialog-ChgvvLIn.js";import"./X-BBgrZ5uI.js";import"./org-file-open-context-DHAupDW3.js";import"./use-mobile-WvNaKYwA.js";import"./shell-layout-C8axlHsv.js";import"./avatar-_qaqoYk_.js";import"./User01-DP_CWS--.js";import"./Palette-hSX4UYh2.js";import"./XClose-B4O0rKSy.js";import"./download-app-dialog-Bctwlvwg.js";import"./CheckCircle-BfAtXKeX.js";import"./Monitor01-BvD5JOY7.js";import"./command-DYf2Omhs.js";import"./index-DoSo_B2m.js";import"./SearchMd-Dvzi_iL7.js";import"./integration-icon-7da8J_en.js";import"./project-icon-CefmE1dj.js";import"./new-project-dialog-DlAV228u.js";import"./ArrowLeft-CvQ3hA6K.js";import"./input-DistjIbs.js";import"./label-Wib6sduZ.js";import"./repository-import-picker-CeMw-zNS.js";import"./use-navigate-to-agent-T5hUY94x.js";import"./repository-picker-BxH96PsW.js";import"./LinkExternal01-CBStRzz4.js";import"./useInfiniteQuery-BZSBGOtw.js";import"./infiniteQueryObserver-BVIMeLaW.js";import"./collection-search-C5dhge9B.js";import"./ShoppingBag01-CBOKaqok.js";import"./use-debounced-value-CWmFjMgl.js";import"./required-auth-layout-CGXaj6Z0.js";import"./use-org-sso-Df_SsXBV.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CZn3uLbl.js";import"./types-B9O8qT5G.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-BJ472_3w.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./AlertCircle-BcMtONTy.js";import"./sheet-DtTEuIwy.js";import"./use-connection-Bh6yvYv8.js";import"./Link01-CRPIbFnr.js";import"./use-mcp-prompts-DB-V0vlN.js";import"./index-COmo1uEx.js";import"./form-C_ime4VH.js";import"./use-thread-outputs-Qzs_VSoc.js";import"./file-type-icon-BDGP6Ldt.js";import"./popover-DetcAb3z.js";import"./utils-CbvBofjY.js";import"./monaco-editor-D8MpECRM.js";import"./editor-BLMFhTre.js";import"./calendar-D8rOZOmJ.js";import"./textarea-Cs2ALVFi.js";import"./select-CU7l4SPn.js";import"./index-D_26d7wd.js";import"./switch-zCn72tWW.js";import"./combobox-CbOlDeot.js";import"./alert-dialog-CX1VQigg.js";import"./sandbox-url-D3mC8qhT.js";import"./Upload01-Bn9-9K5y.js";import"./DotsVertical-xMdVQa8c.js";import"./search-input-DNE1KAk1.js";import"./tabs-CamiZ6IK.js";import"./use-file-configs-BTh4qq0_.js";import"./asset-utils-DDZiv2Z6.js";import"./use-chat-layout-state-ewW8znjZ.js";import"./site-slug-DebpOoQq.js";import"./toggle-group-WQiIqlDP.js";import"./sandbox-git-api-B1R0585s.js";import"./ArrowUp-B2SOfymG.js";import"./CreditCard01-CvhxMZvT.js";import"./Key01-UoOC1hzc.js";import"./Users01-DJZa484d.js";import"./section-preview-url-7zfngvgW.js";function Zr(v){return v.schema?.definitions??v.schema?.$defs??{}}function ca(v,e){const u=Zr(e),p=u[btoa(v)];if(!p)return[];const h=[p];if(Array.isArray(p.allOf)){const k=p.allOf.find(w=>typeof w.$ref=="string")?.$ref;if(typeof k=="string"){const w=u[k.replace("#/definitions/","")];w&&h.push(w)}}return h}function Xr(v,e){for(const u of ca(v,e)){const p=typeof u.image=="string"?u.image:void 0;if(p?.includes("{{{"))return p}}function ei(v,e){if(!e)return;const u=ra(v);if(!u)return;const p=Xr(u.resolveType,e);if(!p)return;const h=jo(p,u.data);if(h)return Eo(h)}const ti={escape:ko};function si(v,e){for(const u of ca(v,e)){const p=typeof u.title=="string"?u.title:void 0;if(p?.includes("{{"))return p}}function ni(v,e){if(!e)return;const u=ra(v);if(u)try{const p=si(u.resolveType,e);return p&&ir.render(p,u.data,{},ti).trim()||void 0}catch{return}}function ai(v){const e=Jt.c(13),{icon:u,label:p,className:h}=v;let k;e[0]!==h?(k=oe("size-3.5",h),e[0]=h,e[1]=k):k=e[1];let w;e[2]!==u||e[3]!==k?(w=n.jsx(u,{className:k}),e[2]=u,e[3]=k,e[4]=w):w=e[4];let y;e[5]!==p||e[6]!==w?(y=n.jsx(ut,{asChild:!0,children:n.jsx("span",{role:"img","aria-label":p,className:"shrink-0 cursor-help",children:w})}),e[5]=p,e[6]=w,e[7]=y):y=e[7];let T;e[8]!==p?(T=n.jsx(dt,{className:"max-w-56",children:p}),e[8]=p,e[9]=T):T=e[9];let b;return e[10]!==y||e[11]!==T?(b=n.jsxs(ct,{children:[y,T]}),e[10]=y,e[11]=T,e[12]=b):b=e[12],b}const oi="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function aa(v){return Array.from({length:v},(e,u)=>({id:crypto.randomUUID(),index:u}))}function ua(v){return v.map((e,u)=>({...e,index:u}))}function ri(v,e){if(e===v.length)return v;if(e<v.length)return ua(v.slice(0,e));const u=Array.from({length:e-v.length},(p,h)=>({id:crypto.randomUUID(),index:v.length+h}));return[...v,...u]}function da(v){const e=Jt.c(44),{section:u,raw:p,meta:h,decofile:k}=v,w=Yt(),y=fs(),T=u.isSavedBlock===!0,b=u.isMultivariate===!0;let Z;e[0]!==h||e[1]!==p?(Z=p&&h?ei(p,h):void 0,e[0]=h,e[1]=p,e[2]=Z):Z=e[2];const me=Z;let Ke;e[3]!==h||e[4]!==b||e[5]!==p||e[6]!==T?(Ke=p&&h&&!T&&!b?ni(p,h):void 0,e[3]=h,e[4]=b,e[5]=p,e[6]=T,e[7]=Ke):Ke=e[7];const Be=Ke;let Te;e[8]!==k||e[9]!==h||e[10]!==p||e[11]!==u?(Te=Ao(p,u,k,h),e[8]=k,e[9]=h,e[10]=p,e[11]=u,e[12]=Te):Te=e[12];const re=Te;let r;e[13]!==b||e[14]!==p?.__resolveType?(r=!b&&Is(p?.__resolveType??""),e[13]=b,e[14]=p?.__resolveType,e[15]=r):r=e[15];const V=r,ge=T?ms:b?oa:la;let $;e[16]!==b||e[17]!==T?($=T?{color:ur}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=b,e[17]=T,e[18]=$):$=e[18];const c=$;let O;e[19]!==ge||e[20]!==y?(O=y?n.jsxs("span",{className:"relative size-4 shrink-0",children:[n.jsx(ge,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),n.jsx(Po,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):n.jsx(or,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=ge,e[20]=y,e[21]=O):O=e[21];let l;e[22]!==me?(l=me&&n.jsx("img",{src:me,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=me,e[23]=l):l=e[23];let J;e[24]!==y||e[25]!==c?(J=!y&&n.jsx(Bs,{className:"h-4 w-4 shrink-0",style:c}),e[24]=y,e[25]=c,e[26]=J):J=e[26];const G=y?"shrink":"flex-1",ke=u.isHidden&&"line-through opacity-50";let Ne;e[27]!==ke||e[28]!==G?(Ne=oe("min-w-0 truncate text-sm font-medium",G,ke),e[27]=ke,e[28]=G,e[29]=Ne):Ne=e[29];const qe=Be??u.label;let _e;e[30]!==Ne||e[31]!==qe?(_e=n.jsx("span",{className:Ne,children:qe}),e[30]=Ne,e[31]=qe,e[32]=_e):_e=e[32];let d;e[33]!==V||e[34]!==y||e[35]!==re||e[36]!==w?(d=y?n.jsxs(n.Fragment,{children:[V&&n.jsx(ai,{icon:Ls,label:w("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),re&&n.jsx(Bn,{}),n.jsx("span",{className:"min-w-0 flex-1"})]}):re&&n.jsx(Bn,{className:"absolute -right-0.5 -top-0.5"}),e[33]=V,e[34]=y,e[35]=re,e[36]=w,e[37]=d):d=e[37];let M;return e[38]!==_e||e[39]!==d||e[40]!==O||e[41]!==l||e[42]!==J?(M=n.jsxs(n.Fragment,{children:[O,l,J,_e,d]}),e[38]=_e,e[39]=d,e[40]=O,e[41]=l,e[42]=J,e[43]=M):M=e[43],M}const ii="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",li="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]";function ma(v,e,u){if(u)return Mo({selected:e});const p=v.isSavedBlock===!0,h=v.isMultivariate===!0;return oe("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":p?ii:h?li:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Cs(v,e){return oe("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":v?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function ci(v){const e=Jt.c(90),{section:u,raw:p,meta:h,decofile:k,sortableId:w,selected:y,onSelect:T,onDelete:b,onDuplicate:Z,onMakeReusable:me,onToggleHidden:Ke,onToggleLazy:Be,onAddVariant:Te,onDetach:re}=v,r=Yt(),V=fs(),ge=p?Is(p.__resolveType??""):!1,$=u.isHidden===!0,c=ge||$;let O;e[0]!==u?(O=ia(u),e[0]=u,e[1]=O):O=e[1];const l=O;let J;e[2]!==w?(J={id:w,animateLayoutChanges:mi},e[2]=w,e[3]=J):J=e[3];const{attributes:G,listeners:ke,setNodeRef:Ne,transform:qe,isDragging:_e}=Ir(J);let d;e[4]!==qe?(d=Or.Transform.toString(qe?{...qe,x:0}:null),e[4]=qe,e[5]=d):d=e[5];const M=_e?0:void 0;let We;e[6]!==d||e[7]!==M?(We={transform:d,opacity:M},e[6]=d,e[7]=M,e[8]=We):We=e[8];const C=We;let Ue;e[9]!==u?(Ue=Ro(u),e[9]=u,e[10]=Ue):Ue=e[10];const z=Ue,mt="button",fe=0;let ze;e[11]!==T?(ze=P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),T())},e[11]=T,e[12]=ze):ze=e[12];const _t=_e?"cursor-grabbing":"cursor-pointer";let Le;e[13]!==V||e[14]!==u||e[15]!==y||e[16]!==_t?(Le=oe("touch-none transition-colors",_t,ma(u,y,V)),e[13]=V,e[14]=u,e[15]=y,e[16]=_t,e[17]=Le):Le=e[17];let ie;e[18]!==k||e[19]!==h||e[20]!==p||e[21]!==u?(ie=n.jsx(da,{section:u,raw:p,meta:h,decofile:k}),e[18]=k,e[19]=h,e[20]=p,e[21]=u,e[22]=ie):ie=e[22];const le=!V&&!u.isMultivariate&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:oe(Cs(c,ge)),onClick:P=>{P.stopPropagation(),Be()},onPointerDown:di,children:n.jsx(Ls,{className:oe("h-3.5 w-3.5",ge&&"text-warning")})})}),n.jsx(dt,{side:"bottom",children:r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ae=V?n.jsx(Vo,{label:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:$,onToggle:Ke,children:$?n.jsx(Xn,{className:"h-3.5 w-3.5"}):n.jsx(ea,{className:"h-3.5 w-3.5"})}):n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:oe(Cs(c,$)),onClick:P=>{P.stopPropagation(),Ke()},onPointerDown:ui,children:$?n.jsx(Xn,{className:"h-3.5 w-3.5"}):n.jsx(ea,{className:"h-3.5 w-3.5"})})}),n.jsx(dt,{side:"bottom",children:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),B=vo,A=To;let ce;e[23]!==r?(ce=r("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=r,e[24]=ce):ce=e[24];const we=oe(Cs(c,!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 Me;e[25]!==A||e[26]!==ce||e[27]!==we?(Me=n.jsx(A,{label:ce,classicClassName:we}),e[25]=A,e[26]=ce,e[27]=we,e[28]=Me):Me=e[28];let Re;e[29]!==V||e[30]!==ge||e[31]!==Be||e[32]!==u.isMultivariate||e[33]!==r?(Re=V&&!u.isMultivariate&&n.jsxs(n.Fragment,{children:[n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),Be()},children:[n.jsx(Ls,{className:"h-4 w-4"}),r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),n.jsx(go,{})]}),e[29]=V,e[30]=ge,e[31]=Be,e[32]=u.isMultivariate,e[33]=r,e[34]=Re):Re=e[34];let H;e[35]!==Z?(H=P=>{P.stopPropagation(),Z()},e[35]=Z,e[36]=H):H=e[36];let ue;e[37]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(Pr,{className:"h-4 w-4"}),e[37]=ue):ue=e[37];let je;e[38]!==r?(je=r("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=r,e[39]=je):je=e[39];let pe;e[40]!==H||e[41]!==je?(pe=n.jsxs(Kt,{onClick:H,children:[ue,je]}),e[40]=H,e[41]=je,e[42]=pe):pe=e[42];let ne;e[43]!==V||e[44]!==l||e[45]!==Te||e[46]!==r?(ne=l&&n.jsxs(Kt,{className:oe(!V&&No),onClick:P=>{P.stopPropagation(),Te()},children:[n.jsx(oa,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=V,e[44]=l,e[45]=Te,e[46]=r,e[47]=ne):ne=e[47];let he;e[48]!==V||e[49]!==z||e[50]!==me||e[51]!==r?(he=z&&n.jsxs(Kt,{className:oe(!V&&oi),onClick:P=>{P.stopPropagation(),me()},children:[V?n.jsx(ms,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=V,e[49]=z,e[50]=me,e[51]=r,e[52]=he):he=e[52];let ae;e[53]!==V||e[54]!==re||e[55]!==u.isMultivariate||e[56]!==u.isSavedBlock||e[57]!==r?(ae=u.isSavedBlock===!0&&!u.isMultivariate&&n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),re()},children:[V?n.jsx(la,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=V,e[54]=re,e[55]=u.isMultivariate,e[56]=u.isSavedBlock,e[57]=r,e[58]=ae):ae=e[58];let Pe;e[59]!==b?(Pe=P=>{P.stopPropagation(),b()},e[59]=b,e[60]=Pe):Pe=e[60];let ve;e[61]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(Dr,{className:"h-4 w-4"}),e[61]=ve):ve=e[61];let Ve;e[62]!==r?(Ve=r("sectionsEditor.sectionList.deleteMenuItem"),e[62]=r,e[63]=Ve):Ve=e[63];let Ee;e[64]!==Pe||e[65]!==Ve?(Ee=n.jsxs(Kt,{variant:"destructive",onClick:Pe,children:[ve,Ve]}),e[64]=Pe,e[65]=Ve,e[66]=Ee):Ee=e[66];let Se;e[67]!==Re||e[68]!==pe||e[69]!==ne||e[70]!==he||e[71]!==ae||e[72]!==Ee?(Se=n.jsxs(So,{align:"end",className:"w-44",children:[Re,pe,ne,he,ae,Ee]}),e[67]=Re,e[68]=pe,e[69]=ne,e[70]=he,e[71]=ae,e[72]=Ee,e[73]=Se):Se=e[73];let ye;e[74]!==B||e[75]!==Me||e[76]!==Se?(ye=n.jsxs(B,{children:[Me,Se]}),e[74]=B,e[75]=Me,e[76]=Se,e[77]=ye):ye=e[77];let $e;return e[78]!==G||e[79]!==ke||e[80]!==T||e[81]!==Ne||e[82]!==C||e[83]!==Le||e[84]!==ie||e[85]!==le||e[86]!==Ae||e[87]!==ye||e[88]!==ze?($e=n.jsxs("div",{ref:Ne,style:C,...G,...ke,role:mt,tabIndex:fe,onClick:T,onKeyDown:ze,className:Le,children:[ie,le,Ae,ye]}),e[78]=G,e[79]=ke,e[80]=T,e[81]=Ne,e[82]=C,e[83]=Le,e[84]=ie,e[85]=le,e[86]=Ae,e[87]=ye,e[88]=ze,e[89]=$e):$e=e[89],$e}function ui(v){return v.stopPropagation()}function di(v){return v.stopPropagation()}function mi(){return!1}function Fs(v){const e=Jt.c(11),{canAddSection:u,onAddSection:p,className:h,size:k}=v,w=Yt();let y;e[0]!==h?(y=oe("w-full",h),e[0]=h,e[1]=y):y=e[1];const T=!u;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Cr,{size:14}),e[2]=b):b=e[2];let Z;e[3]!==w?(Z=w("sectionsEditor.sectionList.addSectionButton"),e[3]=w,e[4]=Z):Z=e[4];let me;return e[5]!==p||e[6]!==k||e[7]!==y||e[8]!==T||e[9]!==Z?(me=n.jsxs(Vt,{type:"button",variant:"outline",size:k,className:y,disabled:T,onClick:p,children:[b,Z]}),e[5]=p,e[6]=k,e[7]=y,e[8]=T,e[9]=Z,e[10]=me):me=e[10],me}function fi(v){const e=Jt.c(101),{listKey:u,rawSections:p,sections:h,meta:k,decofile:w,selectedIndex:y,onSelect:T,onReorder:b,onDelete:Z,onDuplicate:me,onMakeReusable:Ke,onToggleHidden:Be,onToggleLazy:Te,onAddVariant:re,onDetach:r,onAddSection:V,canAddSection:ge}=v,$=ge===void 0?!0:ge,c=Yt(),O=fs();let l;e[0]!==h.length?(l=()=>aa(h.length),e[0]=h.length,e[1]=l):l=e[1];const[J,G]=j.useState(l),[ke,Ne]=j.useState(null),[qe,_e]=j.useState(u),[d,M]=j.useState(h.length),We=j.useRef(!1);qe!==u?(_e(u),M(h.length),G(aa(h.length))):d!==h.length&&(M(h.length),G(Ce=>ri(Ce,h.length)));let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[2]=C):C=e[2];let Ue;e[3]===Symbol.for("react.memo_cache_sentinel")?(Ue={coordinateGetter:zr},e[3]=Ue):Ue=e[3];const z=Kr(ta(Fr,C),ta(Lr,Ue));let mt;e[4]!==J?(mt=J.map(pi),e[4]=J,e[5]=mt):mt=e[5];const fe=mt;let ze;e[6]===Symbol.for("react.memo_cache_sentinel")?(ze=Ce=>{Ne(String(Ce.active.id))},e[6]=ze):ze=e[6];const _t=ze;let Le;e[7]!==fe||e[8]!==b?(Le=Ce=>{Ne(null);const{active:L,over:D}=Ce;if(!D||L.id===D.id)return;const Fe=fe.indexOf(String(L.id)),Xe=fe.indexOf(String(D.id));Fe===-1||Xe===-1||(G(nt=>ua(ds([...nt],Fe,Xe))),We.current=!0,requestAnimationFrame(()=>{We.current=!1}),b?.(Fe,Xe))},e[7]=fe,e[8]=b,e[9]=Le):Le=e[9];const ie=Le;let le;e[10]===Symbol.for("react.memo_cache_sentinel")?(le=()=>{Ne(null)},e[10]=le):le=e[10];const Ae=le;let B,A,ce,we,Me,Re,H,ue,je,pe,ne,he,ae,Pe,ve;if(e[11]!==ke||e[12]!==$||e[13]!==O||e[14]!==w||e[15]!==J||e[16]!==fe||e[17]!==ie||e[18]!==k||e[19]!==V||e[20]!==re||e[21]!==Z||e[22]!==r||e[23]!==me||e[24]!==Ke||e[25]!==T||e[26]!==Be||e[27]!==Te||e[28]!==p||e[29]!==h||e[30]!==y||e[31]!==z||e[32]!==c){Pe=Symbol.for("react.early_return_sentinel");e:{const Ce=L=>{We.current||T(L)};if(e[48]!==ke||e[49]!==$||e[50]!==O||e[51]!==J||e[52]!==V||e[53]!==p||e[54]!==h||e[55]!==c){const L=ke?J.find(D=>D.id===ke):null;if(we=L!=null?h[L.index]:null,ce=L!=null?p[L.index]:void 0,J.length===0){let D;e[59]!==c?(D=c("sectionsEditor.sectionList.noSections"),e[59]=c,e[60]=D):D=e[60];let Fe;e[61]!==D?(Fe=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:D}),e[61]=D,e[62]=Fe):Fe=e[62];const Xe=Fe;let nt;e[63]!==$||e[64]!==O||e[65]!==Xe||e[66]!==V?(nt=O?Xe:n.jsxs("div",{className:"space-y-2",children:[Xe,n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm"})]}),e[63]=$,e[64]=O,e[65]=Xe,e[66]=V,e[67]=nt):nt=e[67],Pe=nt;break e}ae=oe(L&&"cursor-grabbing"),e[48]=ke,e[49]=$,e[50]=O,e[51]=J,e[52]=V,e[53]=p,e[54]=h,e[55]=c,e[56]=ce,e[57]=we,e[58]=ae}else ce=e[56],we=e[57],ae=e[58];A=$r,ue=z,je=Hr,pe=_t,ne=ie,he=Ae,B=Gr,Re=fe,H=qr,ve="space-y-1",Me=J.map(L=>{const D=h[L.index];return D?n.jsx(ci,{sortableId:L.id,section:D,raw:p[L.index],meta:k,decofile:w,selected:y===L.index,onSelect:()=>Ce(L.index),onDelete:()=>Z(L.index),onDuplicate:()=>me(L.index),onMakeReusable:()=>Ke(L.index),onToggleHidden:()=>Be(L.index),onToggleLazy:()=>Te(L.index),onAddVariant:()=>re(L.index),onDetach:()=>r(L.index)},L.id):null})}e[11]=ke,e[12]=$,e[13]=O,e[14]=w,e[15]=J,e[16]=fe,e[17]=ie,e[18]=k,e[19]=V,e[20]=re,e[21]=Z,e[22]=r,e[23]=me,e[24]=Ke,e[25]=T,e[26]=Be,e[27]=Te,e[28]=p,e[29]=h,e[30]=y,e[31]=z,e[32]=c,e[33]=B,e[34]=A,e[35]=ce,e[36]=we,e[37]=Me,e[38]=Re,e[39]=H,e[40]=ue,e[41]=je,e[42]=pe,e[43]=ne,e[44]=he,e[45]=ae,e[46]=Pe,e[47]=ve}else B=e[33],A=e[34],ce=e[35],we=e[36],Me=e[37],Re=e[38],H=e[39],ue=e[40],je=e[41],pe=e[42],ne=e[43],he=e[44],ae=e[45],Pe=e[46],ve=e[47];if(Pe!==Symbol.for("react.early_return_sentinel"))return Pe;let Ve;e[68]!==Me||e[69]!==ve?(Ve=n.jsx("div",{className:ve,children:Me}),e[68]=Me,e[69]=ve,e[70]=Ve):Ve=e[70];let Ee;e[71]!==B||e[72]!==Re||e[73]!==H||e[74]!==Ve?(Ee=n.jsx(B,{items:Re,strategy:H,children:Ve}),e[71]=B,e[72]=Re,e[73]=H,e[74]=Ve,e[75]=Ee):Ee=e[75];let Se;e[76]!==ce||e[77]!==we||e[78]!==O||e[79]!==w||e[80]!==k?(Se=we?n.jsx("div",{className:oe("cursor-grabbing shadow-lg ring-1 ring-border/60",ma(we,!1,O)),children:n.jsx(da,{section:we,raw:ce,meta:k,decofile:w})}):null,e[76]=ce,e[77]=we,e[78]=O,e[79]=w,e[80]=k,e[81]=Se):Se=e[81];let ye;e[82]!==Se?(ye=ho.createPortal(n.jsx(Br,{dropAnimation:wo,children:Se}),document.body),e[82]=Se,e[83]=ye):ye=e[83];let $e;e[84]!==A||e[85]!==ue||e[86]!==je||e[87]!==pe||e[88]!==ne||e[89]!==he||e[90]!==Ee||e[91]!==ye?($e=n.jsxs(A,{sensors:ue,collisionDetection:je,onDragStart:pe,onDragEnd:ne,onDragCancel:he,children:[Ee,ye]}),e[84]=A,e[85]=ue,e[86]=je,e[87]=pe,e[88]=ne,e[89]=he,e[90]=Ee,e[91]=ye,e[92]=$e):$e=e[92];let P;e[93]!==$||e[94]!==O||e[95]!==V?(P=!O&&n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm",className:"mt-2"}),e[93]=$,e[94]=O,e[95]=V,e[96]=P):P=e[96];let st;return e[97]!==ae||e[98]!==$e||e[99]!==P?(st=n.jsxs("div",{className:ae,children:[$e,P]}),e[97]=ae,e[98]=$e,e[99]=P,e[100]=st):st=e[100],st}function pi(v){return v.id}function hi(v,e,u,p){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const h=e.trim();if(!h)return Rt(v,u,p)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:Ds(v,u,p)}:{kind:"noop"};const k=Ks(v,u,p);if(!k)return{kind:"error",reason:"unreadable-rule"};if(k.blockKey)return{kind:"updateBlock",blockKey:k.blockKey,blockData:xt(k.resolveType,k.data,h)};const w=cs(h),y=us(w,u);return y?{kind:"error",reason:"invalid-block-id",message:y}:{kind:"createBlock",blockId:w,blockData:xt(k.resolveType,k.data,h),reference:Lt(w)}}function Dc({orgSlug:v,virtualMcpId:e,branch:u,previewReady:p=!0,previewUrl:h,currentPath:k,activePageBlockKey:w=null,activeGlobalBlockKey:y=null,externalSelection:T,onSaved:b,initialEditSeo:Z=!1,onExitSeo:me,onSelectRoot:Ke,onViewJsonFile:Be,onFocusedBlockChange:Te,onVariantPreviewOverride:re}){const r=Yt(),V=_o(),ge=V?.taskId??null,$=p?{orgSlug:v,virtualMcpId:e,branch:u,threadId:ge,previewUrl:h}:null,{data:c,isLoading:O}=Co($),{data:l,isLoading:J}=Do($),G=fs(),ke=V?.virtualMcpId,qe=sr(ke===e?e:null)?.metadata?.siteSlug??null,_e=Jr({virtualMcpId:e,sandboxUrl:h}),[d,M]=j.useState(null),[We,C]=j.useState(null),[Ue,z]=j.useState(null),[mt,fe]=j.useState(0),[ze,_t]=j.useState(void 0),[Le,ie]=j.useState(null),[le,Ae]=j.useState(null),[B,A]=j.useState([]),ce=j.useRef(null),[we,Me]=j.useState(B.length);we!==B.length&&(Me(B.length),requestAnimationFrame(()=>{ce.current&&(ce.current.scrollTop=0)}));const[Re,H]=j.useState(0),[ue,je]=j.useState(null),[pe,ne]=j.useState(null),[he,ae]=j.useState(null),[Pe,ve]=j.useState(!1),[Ve,Ee]=j.useState(!1),Se=j.useRef(null),[ye,$e]=j.useState(!0),[P,st]=j.useState(!1),[Ce,L]=j.useState(!1),[D,Fe]=j.useState(Z),[Xe,nt]=j.useState(Z);Z&&!Xe&&(nt(!0),Fe(!0),M(null),C(null),z(null),A([])),!Z&&Xe&&nt(!1);const[fa,Qt]=j.useState(null),[Os,ps]=j.useState(void 0),[zs,jt]=j.useState([]),[$s,Ft]=j.useState(0),[Ie,Je]=j.useState(0),[pa,De]=j.useState(null),[Tt,Oe]=j.useState(null),[Hs,Gs]=j.useState(null),ha=yo(),ga=`${v}/${e}/${u}`,Zt=Ko({orgSlug:v,virtualMcpId:e,branch:u}),[va,Sa]=j.useState(k),[ya,ba]=j.useState(w),[xa,_a]=j.useState(y);(va!==k||ya!==w||xa!==y)&&(queueMicrotask(()=>Zt.flush()),Sa(k),ba(w),_a(y),M(null),C(null),z(null),fe(0),ie(null),Ae(null),Je(0),De(null),Oe(null),A([]),H(t=>t+1),Fe(!1),Qt(null),ps(void 0),jt([]),Ft(t=>t+1));const Y=Bo({orgSlug:v,virtualMcpId:e,branch:u}),It=Zo((t,s)=>{Y.mutate({blockKey:t,data:s},{onSuccess:()=>b?.(),onError:a=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Xt=lr({orgSlug:v,virtualMcpId:e,branch:u}),[Nt,At]=j.useState(!1),q=j.useRef(null),qs=j.useRef(null),at=j.useRef(null),ot=j.useRef(null),hs=j.useRef({}),He=j.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[ja,Ea]=j.useState(null);if(!p||O||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(bo,{className:"size-5 text-muted-foreground"})});if(!c||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const ka=dr(c),Q=!!y,te=Q?null:mr(ka,k,w),g=Q?y:te?.key??null,gs=Q&&y?c[y]:void 0,Ws=Q&&y&&gs?fr(y,gs):Q&&y?y:"",Ot=!Q&&g&&c[g]?c[g]:null,vs=D&&c&&l&&g&&te?Ln(c,{kind:"page",pageKey:g,pageName:String(te.name??""),path:String(te.path??"")},l):null,wa=D?Ot?.seo:void 0,es=Os!==void 0?Os:wa,Ra=D?Lo(es):void 0,Us=vs?.seoTypeOptions??[],Js=D&&l?Fo(l):"",Ss=fa??Ra??{},ts=D&&vs?Wr(Ss,vs):null,Ys=D&&ts&&Io(es)?ls(ts,l):null,Qs=D?Oo(c,l)?.seoData:void 0,de=Q?[{label:"Default",sections:[{__resolveType:y}]}]:zo(Ot?.sections,c??{}),et=de.length>1,se=Math.min(mt,de.length-1),Ge=de[se],K=Ge?.sections??[],be=rs(K,c),ys=!Q&&pr(Ot?.sections);if(Q&&y&&Hs!==y){Gs(y);const t=K[0],s=be[0];if(t&&s){M(0),Je(0),A([]);const a=kt(t,s,c);a&&(C(a.data),z(a.resolveType),Oe(null),De(null))}}!Q&&Hs!==null&&Gs(null),He.current={rawSections:K,parsedSections:be,decofile:c??{},activePageKey:g,pageVariants:de,variantIndex:se,sectionVariantIndex:Ie,selectedSectionIndex:d};const Va=()=>({multivariate:ys,index:se,variants:de.map(t=>({rule:t.rule}))}),bs=(t,s)=>{if(!re)return;if(!g||!ys||t.length<=1){re(null);return}const a=na(g,{multivariate:!0,index:s,variants:t},c,l);re(a.length>0?a:null)},xs=re&&g&&ys&&et&&!O&&!J?g:null;if(xs!==ja&&(Ea(xs),xs)){const t=de.map(a=>({rule:a.rule})),s=se;queueMicrotask(()=>bs(t,s))}const Mt=(t,s,a)=>{if(!re)return;if(!g){re(null);return}const o=Va(),i=na(g,o,c,l);if(!t||s<0){re(i.length>0?i:null);return}const m=Qr({pageKey:g,page:o,sectionIndex:s,sectionLazy:be[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:c,meta:l}),f=[...i,...m];re(f.length>0?f:null)},ft=(t,s,a,o=d??-1,i=!1)=>{const m=tt(t,s);if(!m){C(null),z(null),Oe(null),De(null),i&&Mt(null,o,a);return}const x=Jn(m,lt)[a];if(!x){C(null),z(null),Oe(null),De(null),i&&Mt(null,o,a);return}const R=hr(x.value,c);C(R?.data??null),z(R?.resolveType??null);const{resolveType:S,formValue:E}=Wt(x.rule,c,l??void 0);Oe(S),De(E),i&&Mt(m,o,a)},zt=T?.index;if(T!==void 0&&(T?.seq??null)!==ze&&(_t(T?.seq??null),typeof zt=="number")){const t=K[zt],s=be[zt];if(t&&s)if(M(zt),Je(0),A([]),H(a=>a+1),s.isMultivariate)ft(t,s,0,zt);else{const a=kt(t,s,c);a?(C(a.data),z(a.resolveType)):(C(null),z(null)),Oe(null),De(null)}}const $t={orgSlug:v,virtualMcpId:e,branch:u,threadId:ge,previewUrl:h??void 0,siteSlug:qe},_s=Ue&&l?ls(Ue,l):null,Ye=(t,s)=>{if(!g)return;q.current&&(clearTimeout(q.current),q.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null);const a=qt(c,g,t,se,de);Y.mutate({blockKey:g,data:a},{onSuccess:()=>s?.onSuccess?.()??b?.(),onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},Pt=()=>{Te?.(null),M(null),L(!1),C(null),z(null),Je(0),De(null),Oe(null),A([]),H(t=>t+1)},Ta=(t,s)=>{const a=He.current.sectionVariantIndex,o=qs.current;q.current&&(clearTimeout(q.current),q.current=null,o&&(o.sectionIndex!==s||o.sectionVariantIndex!==a)&&o.write());const i=()=>{const{rawSections:m,parsedSections:f,decofile:x,activePageKey:R,pageVariants:S,variantIndex:E}=He.current,_=m[s];if(!_)return;const W=f[s];if(!W)return;if(W.isSavedBlock){const F=tr(_,W);if(!F)return;Y.mutate({blockKey:F,data:t},{onSuccess:()=>b?.(),onError:U=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:U.message}))});return}if(!R)return;const X={...x[R]},ee=[...m];if(W.isMultivariate){const F=tt(_,W);if(!F||!R)return;const U=Tr(F,a,t);ee[s]=wt(_,W,U)}else if(W.isHidden){const F=Is(_.__resolveType),U=F?{..._.section}:{..._},I=Array.isArray(U.variants)?[...U.variants]:[];I[0]&&(I[0]={...I[0],value:t}),U.variants=I,F?ee[s]={..._,section:U}:ee[s]=U}else W.isLazy?ee[s]={..._,section:t}:ee[s]=t;if(S.length>1){const F=X.sections,U=[...F?.variants??[]];U[E]&&(U[E]={...U[E],value:ee}),X.sections={...F,variants:U}}else X.sections=ee;Y.mutate({blockKey:R,data:X},{onSuccess:()=>b?.(),onError:F=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:F.message}))})};qs.current={sectionIndex:s,sectionVariantIndex:a,write:i},q.current=setTimeout(()=>{q.current=null,i()},Ms)},Na=t=>{M(t),Je(0),A([]),H(i=>i+1);const s=K[t],a=be[t];if(Te?.(a?.isSavedBlock?a.resolveType??null:null),!s||!a)return;if(a.isMultivariate){ft(s,a,0,t);return}const o=kt(s,a,c);if(!o){C(null),z(null),Oe(null),De(null),Mt(null,t,0);return}C(o.data),z(o.resolveType),Oe(null),De(null),Mt(null,t,0)},Zs=t=>{const s=t;C(s),d!==null&&Ta(s,d)},js=t=>{if(!g||!c||!l||!te)return;const s={kind:"page",pageKey:g,pageName:String(te.name??""),path:String(te.path??"")},a=Ln(c,s,l);a&&Zt.save(g,()=>{const o=ha.getQueryData(xo.decofile(ga))?.[g];if(!o||typeof o!="object"||o===null||Array.isArray(o))return null;const i={...o,...hs.current};return hs.current={},t?.raw!==void 0?{...i,seo:t.raw}:t?.inner!==void 0?Ur(s,a,i,t.inner):i})},Xs=(t,s)=>{g&&(hs.current[t]=s,js())},Aa=(t,s)=>{if(!g)return;const a=ds([...K],t,s);d!==null&&(d===t?M(s):t<d&&s>=d?M(d-1):t>d&&s<=d&&M(d+1)),Ye(a)},Ma=t=>{if(!g)return;const s=K.filter((a,o)=>o!==t);d===t?Pt():d!==null&&d>t&&M(d-1),Ye(s)},Pa=t=>{if(!g)return;const s=K[t];if(!s)return;const a=[...K];a.splice(t+1,0,Xo(s)),d!==null&&d>t&&M(d+1),Ye(a)},Ca=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a)return;const o=a.isHidden?Er(s):kr(s);if(!o)return;const i=[...K];i[t]=o,d===t&&Pt(),Ye(i)},Da=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a||a.isMultivariate)return;const o=jr(s);if(!o)return;const i=[...K];i[t]=o,d===t&&Pt(),Ye(i)},Ka=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a?.isSavedBlock)return;const o=kt(s,a,c);if(!o?.data)return;const{name:i,...m}=o.data,f=[...K];a.isLazy?f[t]={...s,section:m}:f[t]=m,d===t&&Pt(),Ye(f)},Ba=t=>{if(!g)return;const s=[...K,{__resolveType:t.resolveType}],a=s.length-1;Ye(s,{onSuccess:()=>{ve(!1),M(a),Je(0),A([]),H(f=>f+1);const o=s[a],i=rs(s,c)[a];if(!o||!i)return;if(i.isMultivariate){ft(o,i,0);return}const m=kt(o,i,c);if(!m){C(null),z(null),Oe(null),De(null);return}C(m.data),z(m.resolveType),Oe(null),De(null)}})},en=t=>{Se.current=t.append,ve(!0)},La=t=>{const s=Se.current;if(!s){Ba(t);return}s({__resolveType:t.resolveType}),ve(!1),Se.current=null},tn=t=>{if(d===null)return;const s=K[d],a=be[d];!s||!a?.isMultivariate||(Je(t),A([]),H(o=>o+1),ft(s,a,t,d,!0))},Fa=t=>{if(d===null||!g)return;const s=K[d],a=be[d];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const i=xr(o,t);if(!i){N.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const m=[...K];m[d]=wt(s,a,i);const f=i.variants;let x=Ie;t===Ie?x=Math.min(t,f.length-1):t<Ie&&(x=Ie-1),Je(x),A([]),H(R=>R+1),ft(m[d],a,x),Ye(m)},Ia=t=>{if(d===null||!g)return;const s=K[d],a=be[d];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const i=_r(o,t),m=[...K];m[d]=wt(s,a,i);const f=t+1;Je(f),A([]),H(x=>x+1),ft(m[d],a,f),Ye(m)},Oa=(t,s)=>{if(d===null||!g||t===s)return;const a=K[d],o=be[d];if(!a||!o?.isMultivariate)return;const i=tt(a,o);if(!i)return;const m=yr(i,t,s),f=[...K];f[d]=wt(a,o,m);let x=Ie;Ie===t?x=s:t<Ie&&s>=Ie?x=Ie-1:t>Ie&&s<=Ie&&(x=Ie+1),Je(x),ft(f[d],o,x),Ye(f)},Ht=t=>{const s=t??d;if(s===null||!g)return;const a=K[s],o=be[s];if(!a||!o)return;const i=gr(a,o);if(!i){N.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const m=[...K];m[s]=i.section;const f=rs(m,c)[s];if(!f?.isMultivariate){N.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}M(s),Je(i.newVariantIndex),A([]),H(x=>x+1),ft(i.section,f,i.newVariantIndex,s),Ye(m)},sn=()=>{if(d===null||!g)return;const t=K[d],s=be[d];if(!t||!s?.isMultivariate)return;const a=tt(t,s);if(!a)return;const o=br(t,s,a);if(!o){N.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const i=[...K];i[d]=o;const m=rs(i,c)[d];if(!m)return;Je(0),Oe(null),De(null),A([]),H(x=>x+1);const f=kt(o,m,c);f?(C(f.data),z(f.resolveType)):(C(null),z(null)),Mt(null,d,0),Ye(i)},za=async t=>{if(ue===null||!g)return;const s=us(t,c);if(s){N.error(s);return}const a=K[ue],o=be[ue];if(!a||!o)return;const i=kt(a,o,c);if(!i){N.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const m={...i.data,name:t};try{await Y.mutateAsync({blockKey:t,data:m});const f=[...K];f[ue]={__resolveType:t},await Y.mutateAsync({blockKey:g,data:qt(c,g,f,se,de)}),d===ue&&Pt(),je(null),N.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),b?.()}catch(f){N.error(f instanceof Error?f.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},nn=Ge?.rule;if(et&&d===null&&le===null&&nn){const{resolveType:t,formValue:s}=Wt(nn,c??{},l??void 0);Ae(t),ie(s)}const Ct=l?$o(l):[],Es=l&&c?Ho(l,c):[],an=!Q&&!!(_e&&l&&c),on=le&&l?ls(le,l):null,pt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},Et=async(t,s)=>{if(!(Vr(s,t,l)>0))try{await Xt.mutateAsync({blockKey:t})}catch(a){N.error(a instanceof Error?a.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},rn=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:o}=He.current;if(!s)return;const i={...a[s]},m={...i.sections},f=[...m.variants??[]],x=f[o],R=x?.rule;if(Rt(R,a,l)){const S=R?.__resolveType??"",E=a[S],_=typeof E?.name=="string"?E.name:S,{__resolveType:W,...X}=t;Y.mutate({blockKey:S,data:xt(W??"",X,_)},{onSuccess:()=>b?.(),onError:ee=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:ee.message}))});return}x&&(f[o]={...x,rule:t}),i.sections={...m,variants:f},Y.mutate({blockKey:s,data:i},{onSuccess:()=>b?.(),onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Ms)},ln=t=>{Ae(t);const s=t?Yn(t,l):{__resolveType:Qn};ie(t?s:{}),rn(s)},cn=t=>{const s=t;ie(s);const a=le?{__resolveType:le,...s}:{...s};rn(a)},un=async t=>{pt();const{activePageKey:s,decofile:a,variantIndex:o}=He.current;if(!s)return;const i=a[s],m=i?.sections;if(!m||typeof m!="object"||Array.isArray(m))return;const f=m;if(!Array.isArray(f.variants))return;const x=[...f.variants],R=x[o];if(!R)return;const S=bt(R.rule,a,l),E=Lt(t);x[o]={...R,rule:E};const _={...a,[s]:{...i,sections:{...f,variants:x}}},{resolveType:W,formValue:X}=Wt(E,_,l??void 0);Ae(W),ie(X);try{await Y.mutateAsync({blockKey:s,data:_[s]}),S&&S!==t&&await Et(S,_),b?.()}catch(ee){N.error(ee instanceof Error?ee.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},dn=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=He.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(!f)return;const S=o[s],E=i[s];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const X=(_.variants??[])[a]?.rule;if(Rt(X,m,l)){const I=X?.__resolveType??"",Ze=m[I],rt=typeof Ze?.name=="string"?Ze.name:I,{__resolveType:St,...it}=t;Y.mutate({blockKey:I,data:xt(St??"",it,rt)},{onSuccess:()=>b?.(),onError:yt=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:yt.message}))});return}const ee=Zn(_,a,t),F=[...o];F[s]=wt(S,E,ee);const U=qt(m,f,F,R,x);Y.mutate({blockKey:f,data:U},{onSuccess:()=>b?.(),onError:I=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:I.message}))})},Ms))},$a=t=>{Oe(t);const s=t?Yn(t,l):{__resolveType:Qn};De(t?s:{}),dn(s)},Ha=t=>{const s=t;De(s);const a=Tt?{__resolveType:Tt,...s}:{...s};dn(a)},Ga=async t=>{pt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(s===null||!f)return;const S=o[s],E=i[s];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const W=_.variants??[],X=bt(W[a]?.rule,m,l),ee=Lt(t),F=Zn(_,a,ee),U=[...o];U[s]=wt(S,E,F);const I=qt(m,f,U,R,x),Ze={...m,[f]:I},{resolveType:rt,formValue:St}=Wt(ee,Ze,l??void 0);Oe(rt),De(St);try{await Y.mutateAsync({blockKey:f,data:I}),X&&X!==t&&await Et(X,Ze),b?.()}catch(it){N.error(it instanceof Error?it.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Q&&!te)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.noPageFound",{currentPath:k})});if(Q&&!gs)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.globalBlockNotFound")});const xe=d!==null?be[d]??null:null,mn=d!==null?K[d]:null,fn=mn&&xe?.isMultivariate?tt(mn,xe):null,ht=fn?Jn(fn,lt):[],ss=Math.min(Ie,Math.max(ht.length-1,0)),Dt=ht[ss]??null,gt=xe?.isMultivariate===!0,ks=d!==null&&xe!==null,vt=ks&&(gt||!!(_s&&We)),qa=vt&&!Q&&xe?.isSavedBlock===!0,Qe=Q||qa,pn=Q?Ws:xe?.label??"",Wa=Tt&&l?ls(Tt,l):null,hn=(t,s)=>s&&G?`${t} · ${s}`:t,gn=xe?xe.variantOf??xe.label:"",Ua=(()=>{const t=gt&&Dt?Dt.label:null;return t?G?[hn(gn,t)]:[xe.label,t]:[xe?.label??""]})(),ws=hn(te?.name??"",et?Ge?.label:null),ns=vt&&(!Q||B.length>0)?Q?[Ws,...B]:[ws,...Ua,...B]:[],vn=D&&te?[te.name,"SEO",...zs]:[],Sn=r("sectionsEditor.pageVariantTabs.variantsLabel"),yn=P&&te?[te.name,Sn]:Ce&&te&&xe?[ws,gn,Sn]:[],as=yn.length>0?yn:vn.length>0?vn:Qe?ns.length>0?ns:[pn]:ns.length>0?ns:[ws],bn=ks&&!gt&&!xe?.isHidden&&!!g,Ja=Qe||!Q&&et&&!!Ge||bn,Ya=ks&&!gt&&!Q&&B.length===0&&!!xe&&ia(xe)&&!!g,Qa=G&&vt&&!Ce&>&&B.length===0&&!!Dt,xn=G&&B.length>0?Fn(B[B.length-1]):null,Za=B.length>1?Fn(B[B.length-2]):null,_n=Qe?pn:vt?xe?.label??"":te?.name??"",Xa=P||Ce?r("sectionsEditor.pageVariantTabs.variantsLabel"):D?r("sectionsEditor.panelSections.seo"):xn??_n,jn=Ce?xe?.variantOf??xe?.label??"":P||D?te?.name??"":xn?Za??_n:Qe?r("sectionsEditor.sectionsEditor.globalSectionSubtitle"):vt?te?.name??"":te?.path??"",Rs=!P&&!Ce&&!D&&!vt&&!Qe,eo=!G&&!D&&!Q&>&&B.length===0,Gt=()=>{if(!g)return;pt(),q.current&&(clearTimeout(q.current),q.current=null);const t=c[g],s=vr(t.sections,K);if(!s)return;const a=Sr(s);Y.mutate({blockKey:g,data:{...t,sections:s}},{onSuccess:()=>{fe(a),M(null),C(null),z(null),A([]),ie(null),Ae(null)},onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},os=(t,s,a)=>{if(!g)return;pt(),q.current&&(clearTimeout(q.current),q.current=null);const o=c[g],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const m=i;if(!Array.isArray(m.variants))return;const f=t([...m.variants]);if(!f)return;const x=Rr(m,f),R={...c,[g]:{...o,sections:x}};Y.mutate({blockKey:g,data:R[g]},{onSuccess:()=>{s?.();const S=typeof a=="string"?[a]:a??[];(async()=>{for(const E of S)await Et(E,R)})()},onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Vs=t=>{ne(null),fe(t),M(null),C(null),z(null),A([]);const s=de[t]?.rule,{resolveType:a,formValue:o}=Wt(s,c??{},l??void 0);Ae(a),ie(o),bs(de.map(i=>({rule:i.rule})),t)},En=(t,s)=>{if(t===s)return;let a=se;se===t?a=s:t<se&&s>=se?a=se-1:t>se&&s<=se&&(a=se+1),fe(a);const o=ds(de.map(i=>({rule:i.rule})),t,s);bs(o,a),os(i=>ds(i,t,s))},kn=t=>{const s=de[t]?.rule,a=bt(s,c??{},l??void 0);os(o=>o.length<=1?null:(o.splice(t,1),o),()=>{de.length-1===1?fe(0):t<se?fe(se-1):t===se&&fe(Math.max(0,t-1)),M(null),C(null),z(null),A([]),ie(null),Ae(null)},a)},to=()=>{const t=de.map((s,a)=>({variant:s,index:a})).filter(({variant:s})=>!wr(s.rule)).map(({variant:s})=>bt(s.rule,c??{},l??void 0)).filter(s=>!!s);os(s=>{const a=Nr({variants:s}),o=s[a];return o?[{...o,rule:Ar()}]:null},()=>{fe(0),M(null),C(null),z(null),A([]),ie(null),Ae(null),st(!1)},t)},wn=t=>{os(s=>Mr(s,t),()=>{fe(t+1),M(null),C(null),z(null),A([]),ie(null),Ae(null)})},so=async(t,s)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const a=He.current.activePageKey,o=He.current.decofile;if(!a)return;const i=o[a],m=i.sections;if(!m||typeof m!="object"||Array.isArray(m))return;const f=m;if(!Array.isArray(f.variants))return;const x=[...f.variants],R=x[t];if(!R?.rule||typeof R.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const S=R.rule,E=s.trim();At(!0);try{if(!E){if(!Rt(S,o,l)){ne(null);return}const U=S.__resolveType??"";x[t]={...R,rule:Ds(S,o,l)};const I={...o,[a]:{...i,sections:{...f,variants:x}}};await Y.mutateAsync({blockKey:a,data:I[a]}),await Et(U,I),ne(null),b?.();return}const _=Ks(S,o,l);if(!_){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(_.blockKey){await Y.mutateAsync({blockKey:_.blockKey,data:xt(_.resolveType,_.data,E)}),ne(null),b?.();return}const W=cs(E),X=us(W,o);if(X){N.error(X);return}const ee=xt(_.resolveType,_.data,E);let F=null;try{await Y.mutateAsync({blockKey:W,data:ee}),F=W,x[t]={...R,rule:Lt(W)},await Y.mutateAsync({blockKey:a,data:{...i,sections:{...f,variants:x}}}),F=null}catch(U){throw F&&await Xt.mutateAsync({blockKey:F}).catch(()=>{}),U}ne(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:E})),b?.()}catch(_){N.error(_ instanceof Error?_.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},no=async(t,s)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{selectedSectionIndex:a,rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(a===null||!f)return;const S=o[a],E=i[a];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const W=_.variants??[],X=W[t];if(!X?.rule||typeof X.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ee=X.rule,F=s.trim();At(!0);const U=async I=>{const Ze={..._,variants:I},rt=[...o];rt[a]=wt(S,E,Ze);const St=qt(m,f,rt,R,x);return await Y.mutateAsync({blockKey:f,data:St}),{...m,[f]:St}};try{if(!F){if(!Rt(ee,m,l)){ae(null);return}const yt=ee.__resolveType??"",Kn=[...W];Kn[t]={...X,rule:Ds(ee,m,l)};const po=await U(Kn);await Et(yt,po),ae(null),b?.();return}const I=Ks(ee,m,l);if(!I){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(I.blockKey){await Y.mutateAsync({blockKey:I.blockKey,data:xt(I.resolveType,I.data,F)}),ae(null),b?.();return}const Ze=cs(F),rt=us(Ze,m);if(rt){N.error(rt);return}const St=xt(I.resolveType,I.data,F);let it=null;try{await Y.mutateAsync({blockKey:Ze,data:St}),it=Ze;const yt=[...W];yt[t]={...X,rule:Lt(Ze)},await U(yt),it=null}catch(yt){throw it&&await Xt.mutateAsync({blockKey:it}).catch(()=>{}),yt}ae(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:F})),b?.()}catch(I){N.error(I instanceof Error?I.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},Rn=async(t,s,a)=>{C(a);try{await Y.mutateAsync({blockKey:t,data:a})}catch(o){throw C(i=>i===a?s:i),o}},ao={rename:async(t,s,a)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{activePageKey:o,decofile:i}=He.current;if(!o)return;const m=Array.isArray(t.variants)?[...t.variants]:[],f=m[s],x=f?.rule&&typeof f.rule=="object"?f.rule:void 0,R=async E=>{const _={...t,variants:E};return await Rn(o,t,_),{...i,[o]:_}},S=hi(x,a,i,l);if(S.kind!=="noop"){if(S.kind==="error"){N.error(S.reason==="no-matcher-rule"?r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):S.reason==="unreadable-rule"?r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):S.message??r("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}At(!0);try{if(S.kind==="inline"){const _=[...m];_[s]={...f,rule:S.inlinedRule};const W=await R(_);await Et(S.blockKey,W),b?.();return}if(S.kind==="updateBlock"){await Y.mutateAsync({blockKey:S.blockKey,data:S.blockData}),b?.();return}let E=null;try{await Y.mutateAsync({blockKey:S.blockId,data:S.blockData}),E=S.blockId;const _=[...m];_[s]={...f,rule:S.reference},await R(_),E=null}catch(_){throw E&&await Xt.mutateAsync({blockKey:E}).catch(()=>{}),_}N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:a.trim()})),b?.()}catch(E){N.error(E instanceof Error?E.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}}},selectGlobal:async(t,s,a)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{activePageKey:o,decofile:i}=He.current;if(!o)return;const m=Array.isArray(t.variants)?[...t.variants]:[],f=m[s];if(!f)return;const x=bt(f.rule,i,l);m[s]={...f,rule:Lt(a)};const R={...t,variants:m},S={...i,[o]:R};try{await Rn(o,t,R),x&&x!==a&&await Et(x,S),b?.()}catch(E){N.error(E instanceof Error?E.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}}},Vn=()=>{Pt()},Tn=t=>{Qt(t),js({inner:t})},Nn=t=>{ps(t),js({raw:t})},An=()=>{Qt(null),jt([])},Mn=()=>Ft(t=>t+1),Pn=()=>{Zt.flush(),Fe(!1),Qt(null),ps(void 0),jt([]),Ft(t=>t+1),me?.()},oo=()=>{st(!1),L(!1),M(null),Fe(!0)},ro=()=>{D&&Pn(),M(null),st(!0)},io=()=>L(!0),Ts=t=>{if(P&&t===0){st(!1);return}if(Ce&&t<2){L(!1),t===0&&M(null);return}if(D){if(t===0){Pn();return}if(t===1){jt([]),Ft(a=>a+1);return}jt(zs.slice(0,t-1)),Ft(a=>a+1);return}if(Q){A(B.slice(0,t)),H(a=>a+1);return}if(t===0){Vn();return}if(t===1){A([]),H(a=>a+1);return}const s=!G&>&&Dt?1:0;if(s===1&&t===2){A([]),H(a=>a+1);return}A(B.slice(0,t-1-s))},Ns=as.length>1?n.jsx("button",{type:"button",onClick:()=>Ts(er(as.length,{isMultivariateSectionTop:eo})),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:oe("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",Qe?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(rr,{className:"size-4"})}):null,lo=Qe||vt||D?Ja&&n.jsxs("div",{className:oe("border-b px-3 py-2.5",Qe&&"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:[!Q&&et&&Ge&&n.jsxs("button",{type:"button",onClick:Vn,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:Ge.label}),className:oe("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",qo),children:[n.jsx(Go,{rule:Ps(Ge.rule,c??{},l??void 0),matchers:Ct}),n.jsx("span",{className:"max-w-[160px] truncate",children:Ge.label})]}),n.jsx("div",{className:"flex-1"}),Qe&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(ms,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),bn&&n.jsx(is,{onClick:()=>Ht()})]}),Qe&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:r("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(In,{pageKey:g,initialName:te.name,initialPath:te.path,onFieldChange:Xs,variant:"header"})}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Fe(!0),children:n.jsx(Wn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Be&&g?Be():Ee(!0),children:n.jsx(Un,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(is,{onClick:Gt})]}),co=n.jsxs(n.Fragment,{children:[et&&g&&n.jsx(On,{listKey:g,variants:de,activeIndex:se,decofile:c??{},meta:l,matchers:Ct,onSelect:Vs,onReorder:En,onRename:ne,onDuplicate:wn,onDelete:kn,onAdd:Gt}),et&&le!==null&&n.jsx(zn,{className:"mt-3",children:n.jsx("div",{className:oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(As,{currentRt:le,currentLabel:Ut(Ge?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Ge?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:ln,onSelectGlobal:un,schema:on,formValue:Le,onChange:cn,formKey:`${se}:${le??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})})]}),Cn=n.jsxs(n.Fragment,{children:[n.jsx(Wo,{listKey:`${g??""}:${d??""}`,variants:ht.map((t,s)=>({index:s,label:t.label})),selectedIndex:ss,onSelect:tn,onRename:ae,onDuplicate:Ia,onDelete:Fa,onRemoveAll:sn,onReorder:Oa,onAdd:()=>Ht()}),n.jsx(zn,{children:n.jsx(As,{currentRt:Tt??"",currentLabel:Ut(Dt?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Dt?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:$a,onSelectGlobal:Ga,schema:Wa,formValue:pa,onChange:Ha,formKey:`${d??"none"}:${ss}:${Tt??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})]}),Dn=n.jsx("div",{className:oe(G?"px-2":"p-2 pt-3"),children:n.jsx(fi,{listKey:`${g??""}-${se}`,rawSections:K,sections:be,meta:l,decofile:c,selectedIndex:d,onSelect:Na,onReorder:Aa,onDelete:Ma,onDuplicate:Pa,onMakeReusable:je,onToggleHidden:Ca,onToggleLazy:Da,onAddVariant:Ht,onDetach:Ka,onAddSection:()=>ve(!0),canAddSection:an})}),uo=n.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[g&&te&&n.jsx(In,{pageKey:g,initialName:te.name,initialPath:te.path,onFieldChange:Xs}),Ot&&g?n.jsx(sa,{rawSeo:es,innerSeo:Ss,defaultResolveType:Js,seoSchema:Ys,activeResolveType:ts,seoTypeOptions:Us,formResetKey:$s,siteDefaultSeo:Qs,onBreadcrumbChange:jt,onPersistRaw:Nn,onInnerChange:Tn,onClearForm:An,onBumpFormKey:Mn}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),mo=n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&g?n.jsx(sa,{rawSeo:es,innerSeo:Ss,defaultResolveType:Js,seoSchema:Ys,activeResolveType:ts,seoTypeOptions:Us,formResetKey:$s,siteDefaultSeo:Qs,onBreadcrumbChange:jt,onPersistRaw:Nn,onInnerChange:Tn,onClearForm:An,onBumpFormKey:Mn}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),fo=n.jsxs(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[et&&g&&n.jsx(On,{listKey:g,variants:de,activeIndex:se,decofile:c??{},meta:l,matchers:Ct,onSelect:Vs,onReorder:En,onRename:ne,onDuplicate:wn,onDelete:kn,onAdd:Gt}),et&&le!==null&&n.jsxs("div",{className:oe("px-3 border-b",ye?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>$e(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-muted/40","aria-expanded":ye,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),ye?n.jsx(nr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(ar,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),ye&&n.jsx("div",{className:oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(As,{currentRt:le,currentLabel:Ut(Ge?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Ge?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:ln,onSelectGlobal:un,schema:on,formValue:Le,onChange:cn,formKey:`${se}:${le??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})]}),Dn]},"editor-section-list");return n.jsx(Uo,{children:n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!G&&Ns&&n.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:Ns}),(G||as.length>1)&&n.jsx(Jo,{crumbs:as,onSelect:Ts,onSelectRoot:()=>{Zt.flush(),Ke?Ke():Ts(0)}}),n.jsx("div",{className:"shrink-0",children:G?n.jsxs("div",{className:oe("flex items-center gap-2 border-b px-3 py-2.5",Qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[G&&Ns,Qe&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(ms,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[n.jsx("span",{className:"truncate text-sm font-semibold",children:Xa}),jn&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:jn})]}),Rs&&et&&Ge&&n.jsx($n,{variants:de,activeIndex:se,onSelect:Vs,onManage:ro,onRemoveAll:to}),Qa&&n.jsx($n,{variants:ht,activeIndex:ss,onSelect:tn,onManage:io,onRemoveAll:sn}),Rs&&!et&&n.jsx(is,{onClick:Gt}),Ya&&n.jsx(is,{onClick:()=>Ht()}),n.jsx(Yo,{}),Rs&&n.jsxs(n.Fragment,{children:[n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:oo,children:n.jsx(Wn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),!Be&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(Un,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):lo}),Ce?n.jsx(Hn,{onAdd:()=>Ht(),children:Cn},"editor-section-variants"):vt?n.jsxs(Bt,{viewportRef:ce,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!G&>&&ht.length>0&&B.length===0&&Cn,n.jsx(Gn,{activeSchema:_s,formValue:We,formResetKey:Re,onFormChange:Zs,onBreadcrumbChange:A,breadcrumbPath:B,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:c,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:_e,onRequestAddSection:en,onVariantMatcherOp:Q?ao:void 0})]},"editor-section-form"):Q?n.jsx(Bt,{viewportRef:ce,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Gn,{activeSchema:_s,formValue:We,formResetKey:Re,onFormChange:Zs,onBreadcrumbChange:A,breadcrumbPath:B,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:c,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:_e,onRequestAddSection:en})},"editor-global-block"):D?G?n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3",children:uo})},"editor-seo"):mo:P?n.jsx(Hn,{onAdd:Gt,children:co},"editor-variants"):G?n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"py-2",children:Dn})}),n.jsx("div",{className:"shrink-0 border-t p-2",children:n.jsx(Fs,{canAddSection:an,onAddSection:()=>ve(!0)})})]},"editor-section-list"):fo,n.jsx(Qo,{open:ue!==null,onOpenChange:t=>{t||je(null)},defaultBlockId:ue!==null?cs(be[ue]?.label??""):"",isPending:Y.isPending,onSubmit:za}),_e&&n.jsx(Yr,{open:Pe,onOpenChange:t=>{ve(t),t||(Se.current=null)},meta:l,decofile:c,previewBaseUrl:_e,onSelect:La}),Ve&&g&&c&&n.jsx(cr,{open:Ve,onOpenChange:Ee,pageKey:g,decofile:c}),pe!==null&&n.jsx(qn,{open:!0,initialName:Rt(de[pe]?.rule,c??{},l??void 0)?Ut(de[pe]?.rule,c??{},lt,l??void 0):"",autoLabel:lt(Ps(de[pe]?.rule,c??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await so(pe,t)},onOpenChange:t=>{!t&&!Nt&&ne(null)}}),he!==null&&n.jsx(qn,{open:!0,initialName:Rt(ht[he]?.rule,c??{},l??void 0)?Ut(ht[he]?.rule,c??{},lt,l??void 0):"",autoLabel:lt(Ps(ht[he]?.rule,c??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await no(he,t)},onOpenChange:t=>{!t&&!Nt&&ae(null)}})]})})}export{Dc as SectionsEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,bm as k,bn as Ie,j as c,bo as j,bp as P,bq as rt,br as Ne,bs as st,bt as lt,bu as $,bv as at,aR as Ee,bw as it,bx as Re,by as ct,bz as dt,bA as ut,bB as pt,bC as ft,bD as mt,bE as ht,bF as vt,bG as gt,bH as xt,bI as St,c as ee,l as oe}from"./index-DDMwhF4p.js";import{V as wt}from"./index-BzpQR2a9.js";import{i as yt}from"./Check-B9MGwLYu.js";import{t as je,n as Ct}from"./ChevronUp-efnDWTJo.js";function Pe(r,[e,t]){return Math.min(t,Math.max(e,r))}var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=it(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[Nt,G]=ne(J),[Pt,_t]=ne(J),Me=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:a,value:s,defaultValue:l,onValueChange:i,dir:u,name:m,autoComplete:g,disabled:w,required:y,form:S}=r,p=pe(e),[v,C]=d.useState(null),[h,x]=d.useState(null),[F,M]=d.useState(!1),re=rt(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:a,caller:J}),[U,q]=Ne({prop:s,defaultProp:l,onChange:i,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 c.jsx(st,{...p,children:c.jsxs(Nt,{required:y,scope:e,trigger:v,onTriggerChange:C,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[c.jsx(de.Provider,{scope:e,children:c.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?c.jsxs(et,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:g,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?c.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=J;var Ae="SelectTrigger",Oe=d.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,a=pe(t),s=G(Ae,t),l=s.disabled||o,i=k(e,s.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===s.value),h=nt(v,p,C);h!==void 0&&s.onValueChange(h.value)}),S=p=>{l||(s.onOpenChange(!0),y()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(lt,{asChild:!0,...a,children:c.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":tt(s.value)?"":void 0,...n,ref:i,onClick:P(n.onClick,p=>{p.currentTarget.focus(),m.current!=="mouse"&&S(p)}),onPointerDown:P(n.onPointerDown,p=>{m.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(v&&p.key===" ")&&bt.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:a,placeholder:s="",...l}=r,i=G(De,t),{onValueNodeHasChildrenChange:u}=i,m=a!==void 0,g=k(e,i.onValueNodeChange);return $(()=>{u(m)},[u,m]),c.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:s}):a})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return c.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=r=>c.jsx(at,{asChild:!0,...r});Be.displayName=Rt;var Q="SelectContent",Ve=d.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const a=o;return a?Ee.createPortal(c.jsx(He,{scope:r.__scopeSelect,children:c.jsx(de.Slot,{scope:r.__scopeSelect,children:c.jsx("div",{children:r.children})})}),a):null}return c.jsx(ze,{...r,ref:e})});Ve.displayName=Q;var A=10,[He,Y]=ne(Q),jt="SelectContentImpl",Mt=gt("SelectContent.RemoveScroll"),ze=d.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:s,side:l,sideOffset:i,align:u,alignOffset:m,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,h=G(Q,t),[x,F]=d.useState(null),[M,re]=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 ut(x)},[x]),pt();const E=d.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===b&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=h;d.useEffect(()=>{if(x){let f={x:0,y:0};const T=b=>{f={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{f.x<=10&&f.y<=10?b.preventDefault():x.contains(b.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=ot(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=nt(T,f,R);b&&setTimeout(()=>b.ref.current.focus())}),me=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&(U(f),b&&(H.current=!0))},[h.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&L(f)},[h.value]),ie=o==="popper"?Se:Fe,se=ie===Se?{side:l,sideOffset:i,align:u,alignOffset:m,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return c.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:c.jsx(ft,{as:Mt,allowPinchZoom:!0,children:c.jsx(mt,{asChild:!0,trapped:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:c.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:c.jsx(ie,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:f=>f.preventDefault(),...C,...se,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((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,a=G(Q,t),s=Y(Q,t),[l,i]=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}=s,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,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,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(ie,se+(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)+se)+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 re=d.useCallback(_=>{_&&S.current===!0&&(x(),h?.(),S.current=!1)},[x,h]);return c.jsx(Dt,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:re,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:c.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...a}=r,s=pe(t);return c.jsx(xt,{...s,...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((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,a=Y(we,t),s=Te(we,t),l=k(e,a.onViewportChange),i=d.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(de.Slot,{scope:t,children:c.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:P(n.onScroll,u=>{const m=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:w}=s;if(w?.current&&g){const y=Math.abs(i.current-m.scrollTop);if(y>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const h=C+y,x=Math.min(S,h),F=h-x;g.style.height=x+"px",g.style.bottom==="0px"&&(m.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}i.current=m.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Ie();return c.jsx(kt,{scope:t,id:n,children:c.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Lt(Ke,t);return c.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ce="SelectItem",[Ht,$e]=ne(ce),Ge=d.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:a,...s}=r,l=G(ce,t),i=Y(ce,t),u=l.value===o,[m,g]=d.useState(a??""),[w,y]=d.useState(!1),S=k(e,h=>i.itemRefCallback?.(h,o,n)),p=Ie(),v=d.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(h=>{g(x=>x||(h?.textContent??"").trim())},[]),children:c.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:m,children:c.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:P(s.onFocus,()=>y(!0)),onBlur:P(s.onBlur,()=>y(!1)),onClick:P(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:P(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:P(s.onPointerDown,h=>{v.current=h.pointerType}),onPointerMove:P(s.onPointerMove,h=>{v.current=h.pointerType,n?i.onItemLeave?.():v.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(s.onPointerLeave,h=>{h.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:P(s.onKeyDown,h=>{i.searchRef?.current!==""&&h.key===" "||(It.includes(h.key)&&C(),h.key===" "&&h.preventDefault())})})})})});Ge.displayName=ce;var le="SelectItemText",Ye=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...a}=r,s=G(le,t),l=Y(le,t),i=$e(le,t),u=_t(le,t),[m,g]=d.useState(null),w=k(e,C=>g(C),i.onItemTextChange,C=>l.itemTextRefCallback?.(C,i.value,i.disabled)),y=m?.textContent,S=d.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:y},i.value),[i.disabled,i.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...a,ref:w}),i.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(a.children,s.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return $e(qe,t).isSelected?c.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var ye="SelectScrollUpButton",Ze=d.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,a]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=i.scrollTop>0;a(u)};const i=t.viewport;return l(),i.addEventListener("scroll",l),()=>i.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:i}=t;l&&i&&(l.scrollTop=l.scrollTop-i.offsetHeight)}}):null});Ze.displayName=ye;var Ce="SelectScrollDownButton",Je=d.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,a]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=i.scrollHeight-i.clientHeight,m=Math.ceil(i.scrollTop)<u;a(m)};const i=t.viewport;return l(),i.addEventListener("scroll",l),()=>i.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:i}=t;l&&i&&(l.scrollTop=l.scrollTop+i.offsetHeight)}}):null});Je.displayName=Ce;var Qe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,a=Y("SelectScrollButton",t),s=d.useRef(null),l=ue(t),i=d.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return d.useEffect(()=>()=>i(),[i]),$(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),c.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:P(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:P(n.onPointerMove,()=>{a.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:P(n.onPointerLeave,()=>{i()})})}),zt="SelectSeparator",Ft=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return c.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var be="SelectArrow",Ut=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),a=G(be,t),s=Y(be,t);return a.open&&s.position==="popper"?c.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=be;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=d.useRef(null),a=k(o,n),s=ct(e);return d.useEffect(()=>{const l=n.current;if(!l)return;const i=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==e&&m){const g=new Event("change",{bubbles:!0});m.call(l,e),l.dispatchEvent(g)}},[s,e]),c.jsx(j.select,{...t,style:{...wt,...t.style},ref:a,defaultValue:e})});et.displayName=Wt;function tt(r){return r===""||r===void 0}function ot(r){const e=dt(r),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(s=>{const l=t.current+s;e(l),(function i(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>i(""),1e3))})(l)},[e]),a=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,a]}function nt(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=t?r.indexOf(t):-1;let s=Kt(r,Math.max(a,0));n.length===1&&(s=s.filter(u=>u!==t));const i=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==t?i:void 0}function Kt(r,e){return r.map((t,o)=>r[(e+o)%r.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(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(13);let t,o,n,a;e[0]!==r?({className:o,size:a,children:t,...n}=r,e[0]=r,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 s=a===void 0?"default":a;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-[var(--studio-outline-hover-background)] hover:text-accent-foreground flex w-fit items-center justify-between gap-2 rounded-[var(--studio-control-radius,var(--radius-lg))] bg-[var(--studio-input-background)] px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-[var(--studio-control-height,2rem)] data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-[var(--studio-control-radius,var(--radius-lg))] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-4 opacity-50"})}),e[7]=i):i=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,i]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function fo(r){const e=ee.c(25);let t,o,n,a,s;e[0]!==r?({className:o,children:t,position:a,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=s):(t=e[1],o=e[2],n=e[3],a=e[4],s=e[5]);const l=a===void 0?"popper":a,i=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let m;e[6]!==o||e[7]!==u?(m=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--studio-surface-radius,var(--radius-lg))] border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=m):m=e[8];let g;e[9]!==i?(g=!i&&c.jsx(no,{}),e[9]=i,e[10]=g):g=e[10];const w=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let y;e[11]!==w?(y=oe("p-1",w),e[11]=w,e[12]=y):y=e[12];let S;e[13]!==t||e[14]!==y?(S=c.jsx(Jt,{className:y,children:t}),e[13]=t,e[14]=y,e[15]=S):S=e[15];let p;e[16]!==i?(p=!i&&c.jsx(ro,{}),e[16]=i,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==m||e[21]!==g||e[22]!==S||e[23]!==p?(v=c.jsx(Xt,{children:c.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:m,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=m,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function mo(r){const e=ee.c(19);let t,o,n,a,s;e[0]!==r?({className:o,children:t,description:n,hideCheck:s,...a}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=s):(t=e[1],o=e[2],n=e[3],a=e[4],s=e[5]);const l=s===void 0?!1:s,i=n&&"items-start py-2";let u;e[6]!==o||e[7]!==i?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",i,o),e[6]=o,e[7]=i,e[8]=u):u=e[8];let m;e[9]!==l?(m=!l&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(yt,{className:"size-4"})})}),e[9]=l,e[10]=m):m=e[10];let g;e[11]!==t||e[12]!==n?(g=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(_e,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(_e,{children:t}),e[11]=t,e[12]=n,e[13]=g):g=e[13];let w;return e[14]!==a||e[15]!==u||e[16]!==m||e[17]!==g?(w=c.jsxs(Qt,{"data-slot":"select-item",className:u,...a,children:[m,g]}),e[14]=a,e[15]=u,e[16]=m,e[17]=g,e[18]=w):w=e[18],w}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(Ct,{className:"size-4"}),e[5]=a):a=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(je,{className:"size-4"}),e[5]=a):a=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{co as S,uo as a,po as b,mo as c,fo as d,Pe as e};
|
|
1
|
+
import{r as d,bm as k,bn as Ie,j as c,bo as j,bp as P,bq as rt,br as Ne,bs as st,bt as lt,bu as $,bv as at,aR as Ee,bw as it,bx as Re,by as ct,bz as dt,bA as ut,bB as pt,bC as ft,bD as mt,bE as ht,bF as vt,bG as gt,bH as xt,bI as St,c as ee,l as oe}from"./index-DV2tiEDy.js";import{V as wt}from"./index-D_26d7wd.js";import{i as yt}from"./Check-DvlVwSY0.js";import{t as je,n as Ct}from"./ChevronUp-C6-gUxpN.js";function Pe(r,[e,t]){return Math.min(t,Math.max(e,r))}var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=it(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[Nt,G]=ne(J),[Pt,_t]=ne(J),Me=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:a,value:s,defaultValue:l,onValueChange:i,dir:u,name:m,autoComplete:g,disabled:w,required:y,form:S}=r,p=pe(e),[v,C]=d.useState(null),[h,x]=d.useState(null),[F,M]=d.useState(!1),re=rt(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:a,caller:J}),[U,q]=Ne({prop:s,defaultProp:l,onChange:i,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 c.jsx(st,{...p,children:c.jsxs(Nt,{required:y,scope:e,trigger:v,onTriggerChange:C,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[c.jsx(de.Provider,{scope:e,children:c.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?c.jsxs(et,{"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:g,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?c.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=J;var Ae="SelectTrigger",Oe=d.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,a=pe(t),s=G(Ae,t),l=s.disabled||o,i=k(e,s.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===s.value),h=nt(v,p,C);h!==void 0&&s.onValueChange(h.value)}),S=p=>{l||(s.onOpenChange(!0),y()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(lt,{asChild:!0,...a,children:c.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":tt(s.value)?"":void 0,...n,ref:i,onClick:P(n.onClick,p=>{p.currentTarget.focus(),m.current!=="mouse"&&S(p)}),onPointerDown:P(n.onPointerDown,p=>{m.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(v&&p.key===" ")&&bt.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:a,placeholder:s="",...l}=r,i=G(De,t),{onValueNodeHasChildrenChange:u}=i,m=a!==void 0,g=k(e,i.onValueNodeChange);return $(()=>{u(m)},[u,m]),c.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:s}):a})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return c.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=r=>c.jsx(at,{asChild:!0,...r});Be.displayName=Rt;var Q="SelectContent",Ve=d.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const a=o;return a?Ee.createPortal(c.jsx(He,{scope:r.__scopeSelect,children:c.jsx(de.Slot,{scope:r.__scopeSelect,children:c.jsx("div",{children:r.children})})}),a):null}return c.jsx(ze,{...r,ref:e})});Ve.displayName=Q;var A=10,[He,Y]=ne(Q),jt="SelectContentImpl",Mt=gt("SelectContent.RemoveScroll"),ze=d.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:s,side:l,sideOffset:i,align:u,alignOffset:m,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,h=G(Q,t),[x,F]=d.useState(null),[M,re]=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 ut(x)},[x]),pt();const E=d.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===b&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=h;d.useEffect(()=>{if(x){let f={x:0,y:0};const T=b=>{f={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{f.x<=10&&f.y<=10?b.preventDefault():x.contains(b.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=ot(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=nt(T,f,R);b&&setTimeout(()=>b.ref.current.focus())}),me=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&(U(f),b&&(H.current=!0))},[h.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&L(f)},[h.value]),ie=o==="popper"?Se:Fe,se=ie===Se?{side:l,sideOffset:i,align:u,alignOffset:m,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return c.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:c.jsx(ft,{as:Mt,allowPinchZoom:!0,children:c.jsx(mt,{asChild:!0,trapped:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:c.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:c.jsx(ie,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:f=>f.preventDefault(),...C,...se,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((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,a=G(Q,t),s=Y(Q,t),[l,i]=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}=s,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,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,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(ie,se+(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)+se)+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 re=d.useCallback(_=>{_&&S.current===!0&&(x(),h?.(),S.current=!1)},[x,h]);return c.jsx(Dt,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:re,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:c.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...a}=r,s=pe(t);return c.jsx(xt,{...s,...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((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,a=Y(we,t),s=Te(we,t),l=k(e,a.onViewportChange),i=d.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(de.Slot,{scope:t,children:c.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:P(n.onScroll,u=>{const m=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:w}=s;if(w?.current&&g){const y=Math.abs(i.current-m.scrollTop);if(y>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const h=C+y,x=Math.min(S,h),F=h-x;g.style.height=x+"px",g.style.bottom==="0px"&&(m.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}i.current=m.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Ie();return c.jsx(kt,{scope:t,id:n,children:c.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Lt(Ke,t);return c.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ce="SelectItem",[Ht,$e]=ne(ce),Ge=d.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:a,...s}=r,l=G(ce,t),i=Y(ce,t),u=l.value===o,[m,g]=d.useState(a??""),[w,y]=d.useState(!1),S=k(e,h=>i.itemRefCallback?.(h,o,n)),p=Ie(),v=d.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(h=>{g(x=>x||(h?.textContent??"").trim())},[]),children:c.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:m,children:c.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:P(s.onFocus,()=>y(!0)),onBlur:P(s.onBlur,()=>y(!1)),onClick:P(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:P(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:P(s.onPointerDown,h=>{v.current=h.pointerType}),onPointerMove:P(s.onPointerMove,h=>{v.current=h.pointerType,n?i.onItemLeave?.():v.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(s.onPointerLeave,h=>{h.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:P(s.onKeyDown,h=>{i.searchRef?.current!==""&&h.key===" "||(It.includes(h.key)&&C(),h.key===" "&&h.preventDefault())})})})})});Ge.displayName=ce;var le="SelectItemText",Ye=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...a}=r,s=G(le,t),l=Y(le,t),i=$e(le,t),u=_t(le,t),[m,g]=d.useState(null),w=k(e,C=>g(C),i.onItemTextChange,C=>l.itemTextRefCallback?.(C,i.value,i.disabled)),y=m?.textContent,S=d.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:y},i.value),[i.disabled,i.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...a,ref:w}),i.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(a.children,s.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return $e(qe,t).isSelected?c.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var ye="SelectScrollUpButton",Ze=d.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,a]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=i.scrollTop>0;a(u)};const i=t.viewport;return l(),i.addEventListener("scroll",l),()=>i.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:i}=t;l&&i&&(l.scrollTop=l.scrollTop-i.offsetHeight)}}):null});Ze.displayName=ye;var Ce="SelectScrollDownButton",Je=d.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,a]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=i.scrollHeight-i.clientHeight,m=Math.ceil(i.scrollTop)<u;a(m)};const i=t.viewport;return l(),i.addEventListener("scroll",l),()=>i.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:i}=t;l&&i&&(l.scrollTop=l.scrollTop+i.offsetHeight)}}):null});Je.displayName=Ce;var Qe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,a=Y("SelectScrollButton",t),s=d.useRef(null),l=ue(t),i=d.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return d.useEffect(()=>()=>i(),[i]),$(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),c.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:P(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:P(n.onPointerMove,()=>{a.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:P(n.onPointerLeave,()=>{i()})})}),zt="SelectSeparator",Ft=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return c.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var be="SelectArrow",Ut=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),a=G(be,t),s=Y(be,t);return a.open&&s.position==="popper"?c.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=be;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=d.useRef(null),a=k(o,n),s=ct(e);return d.useEffect(()=>{const l=n.current;if(!l)return;const i=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==e&&m){const g=new Event("change",{bubbles:!0});m.call(l,e),l.dispatchEvent(g)}},[s,e]),c.jsx(j.select,{...t,style:{...wt,...t.style},ref:a,defaultValue:e})});et.displayName=Wt;function tt(r){return r===""||r===void 0}function ot(r){const e=dt(r),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(s=>{const l=t.current+s;e(l),(function i(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>i(""),1e3))})(l)},[e]),a=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,a]}function nt(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=t?r.indexOf(t):-1;let s=Kt(r,Math.max(a,0));n.length===1&&(s=s.filter(u=>u!==t));const i=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==t?i:void 0}function Kt(r,e){return r.map((t,o)=>r[(e+o)%r.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(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(13);let t,o,n,a;e[0]!==r?({className:o,size:a,children:t,...n}=r,e[0]=r,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 s=a===void 0?"default":a;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-[var(--studio-outline-hover-background)] hover:text-accent-foreground flex w-fit items-center justify-between gap-2 rounded-[var(--studio-control-radius,var(--radius-lg))] bg-[var(--studio-input-background)] px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-[var(--studio-control-height,2rem)] data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-[var(--studio-control-radius,var(--radius-lg))] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-4 opacity-50"})}),e[7]=i):i=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,i]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function fo(r){const e=ee.c(25);let t,o,n,a,s;e[0]!==r?({className:o,children:t,position:a,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=s):(t=e[1],o=e[2],n=e[3],a=e[4],s=e[5]);const l=a===void 0?"popper":a,i=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let m;e[6]!==o||e[7]!==u?(m=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--studio-surface-radius,var(--radius-lg))] border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=m):m=e[8];let g;e[9]!==i?(g=!i&&c.jsx(no,{}),e[9]=i,e[10]=g):g=e[10];const w=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let y;e[11]!==w?(y=oe("p-1",w),e[11]=w,e[12]=y):y=e[12];let S;e[13]!==t||e[14]!==y?(S=c.jsx(Jt,{className:y,children:t}),e[13]=t,e[14]=y,e[15]=S):S=e[15];let p;e[16]!==i?(p=!i&&c.jsx(ro,{}),e[16]=i,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==m||e[21]!==g||e[22]!==S||e[23]!==p?(v=c.jsx(Xt,{children:c.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:m,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=m,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function mo(r){const e=ee.c(19);let t,o,n,a,s;e[0]!==r?({className:o,children:t,description:n,hideCheck:s,...a}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=s):(t=e[1],o=e[2],n=e[3],a=e[4],s=e[5]);const l=s===void 0?!1:s,i=n&&"items-start py-2";let u;e[6]!==o||e[7]!==i?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",i,o),e[6]=o,e[7]=i,e[8]=u):u=e[8];let m;e[9]!==l?(m=!l&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(yt,{className:"size-4"})})}),e[9]=l,e[10]=m):m=e[10];let g;e[11]!==t||e[12]!==n?(g=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(_e,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(_e,{children:t}),e[11]=t,e[12]=n,e[13]=g):g=e[13];let w;return e[14]!==a||e[15]!==u||e[16]!==m||e[17]!==g?(w=c.jsxs(Qt,{"data-slot":"select-item",className:u,...a,children:[m,g]}),e[14]=a,e[15]=u,e[16]=m,e[17]=g,e[18]=w):w=e[18],w}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(Ct,{className:"size-4"}),e[5]=a):a=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(je,{className:"size-4"}),e[5]=a):a=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:a}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{co as S,uo as a,po as b,mo as c,fo as d,Pe as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as $,b as A,r as R,l as G,j as s,B as H}from"./index-
|
|
1
|
+
import{c as $,b as A,r as R,l as G,j as s,B as H}from"./index-DV2tiEDy.js";import{a as J,d as K,b as Q,D as U}from"./dialog-ChgvvLIn.js";import{c as V,b as W,a as X,D as Y}from"./drawer-C8Nbrs_9.js";import{u as Z}from"./use-mobile-WvNaKYwA.js";import{c as ee}from"./chat-context-DpzZ39ci.js";import{S as F,M as se}from"./decopilot-DyQr3aTZ.js";import{M as le,a as te}from"./index-TOQ2hneH.js";function he(L){const e=$.c(48),{variant:o,className:t,placeholder:n,model:l,isLoading:I,credentialId:P,onCredentialChange:k,onModelChange:v,filterModels:E}=L,z=o===void 0?"borderless":o,w=n===void 0?"Select model":n,r=A(),[a,S]=R.useState(!1),i=v!==void 0,q=Z(),O=z==="borderless"?"ghost":"outline",_=z==="borderless"&&"md:border-none";let d;e[0]!==t||e[1]!==_?(d=G("text-sm hover:bg-accent py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",_,t),e[0]=t,e[1]=_,e[2]=d):d=e[2];let c;e[3]!==I||e[4]!==l||e[5]!==w||e[6]!==i?(c=i?s.jsx(F,{model:l??null,placeholder:w,isLoading:I}):s.jsx(ne,{placeholder:w}),e[3]=I,e[4]=l,e[5]=w,e[6]=i,e[7]=c):c=e[7];let D;e[8]!==O||e[9]!==d||e[10]!==c?(D=s.jsx(H,{variant:O,size:"sm",className:d,children:c}),e[8]=O,e[9]=d,e[10]=c,e[11]=D):D=e[11];const f=D;let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(se,{}),e[12]=y):y=e[12];let N;e[13]!==P||e[14]!==E||e[15]!==l||e[16]!==k||e[17]!==v||e[18]!==i?(N=s.jsx(R.Suspense,{fallback:y,children:i?s.jsx(le,{onClose:()=>S(!1),credentialId:P??null,onCredentialChange:k??oe,selectedModel:l??null,onModelChange:v,filterModels:E}):s.jsx(te,{onClose:()=>S(!1)})}),e[13]=P,e[14]=E,e[15]=l,e[16]=k,e[17]=v,e[18]=i,e[19]=N):N=e[19];const m=N;if(q){let g;e[20]!==f?(g=s.jsx(V,{asChild:!0,children:f}),e[20]=f,e[21]=g):g=e[21];let j;e[22]!==r?(j=r("chat.selectModel.selectModel"),e[22]=r,e[23]=j):j=e[23];let M;e[24]!==j?(M=s.jsx(W,{className:"sr-only",children:j}),e[24]=j,e[25]=M):M=e[25];let b;e[26]!==m?(b=s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:m}),e[26]=m,e[27]=b):b=e[27];let C;e[28]!==M||e[29]!==b?(C=s.jsxs(X,{className:"p-0 flex flex-col max-h-[95vh]",children:[M,b]}),e[28]=M,e[29]=b,e[30]=C):C=e[30];let T;return e[31]!==a||e[32]!==g||e[33]!==C?(T=s.jsxs(Y,{open:a,onOpenChange:S,children:[g,C]}),e[31]=a,e[32]=g,e[33]=C,e[34]=T):T=e[34],T}let h;e[35]!==f?(h=s.jsx(J,{asChild:!0,children:f}),e[35]=f,e[36]=h):h=e[36];let x;e[37]!==r?(x=r("chat.selectModel.selectModel"),e[37]=r,e[38]=x):x=e[38];let p;e[39]!==x?(p=s.jsx(K,{className:"sr-only",children:x}),e[39]=x,e[40]=p):p=e[40];let u;e[41]!==m||e[42]!==p?(u=s.jsxs(Q,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[p,m]}),e[41]=m,e[42]=p,e[43]=u):u=e[43];let B;return e[44]!==a||e[45]!==h||e[46]!==u?(B=s.jsxs(U,{open:a,onOpenChange:S,children:[h,u]}),e[44]=a,e[45]=h,e[46]=u,e[47]=B):B=e[47],B}function oe(){}function ne(L){const e=$.c(4),{placeholder:o}=L,{selectedModel:t,isModelsLoading:n}=ee();let l;return e[0]!==n||e[1]!==t||e[2]!==o?(l=s.jsx(F,{model:t,placeholder:o,isLoading:n}),e[0]=n,e[1]=t,e[2]=o,e[3]=l):l=e[3],l}export{he as M};
|