decocms 4.387.0 → 4.387.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-Da3tM0gY.js → AlertCircle-rBOBLMTR.js} +1 -1
- package/dist/client/assets/{AreaChart-8pK8iMto.js → AreaChart-DwjPEVYQ.js} +1 -1
- package/dist/client/assets/{ArrowLeft-EJr-YqTg.js → ArrowLeft-CuO4jsW4.js} +1 -1
- package/dist/client/assets/{ArrowRight-CdK41xWy.js → ArrowRight-BhK2Drg3.js} +1 -1
- package/dist/client/assets/{ArrowUp-Cr0h1eUU.js → ArrowUp-T0MWJ7w1.js} +1 -1
- package/dist/client/assets/{CartesianChart-Dk_Nu3H0.js → CartesianChart-BYy8VjM4.js} +1 -1
- package/dist/client/assets/{Check-BgFwywFf.js → Check-DPdzciCh.js} +1 -1
- package/dist/client/assets/{CheckCircle-5We5Va5L.js → CheckCircle-hKNQmIDB.js} +1 -1
- package/dist/client/assets/{ChevronUp-dgPQkcdv.js → ChevronUp-DEIyJ_Vu.js} +1 -1
- package/dist/client/assets/{Copy01-CMHlAzgS.js → Copy01-BpK5Df3h.js} +1 -1
- package/dist/client/assets/{CreditCard01-DCgVn3oV.js → CreditCard01-BJmBLHK1.js} +1 -1
- package/dist/client/assets/{DotsVertical-C9TkkMfe.js → DotsVertical-vgn5Fh71.js} +1 -1
- package/dist/client/assets/{Download01-ChBwr6yr.js → Download01-8R1CnQwL.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-Dx5toaO_.js → ErrorBarContext-xlcVFXmI.js} +1 -1
- package/dist/client/assets/{Eye-D5VumA7M.js → Eye-9R53138J.js} +1 -1
- package/dist/client/assets/{Globe04-ClJkKQrs.js → Globe04-FrRMGL3L.js} +1 -1
- package/dist/client/assets/{Image01-BOrVV_OY.js → Image01-CpS3B5dq.js} +1 -1
- package/dist/client/assets/{Key01-CyjVKKuN.js → Key01-Cs7m7Vrv.js} +1 -1
- package/dist/client/assets/{LayoutLeft-C-Lx98x9.js → LayoutLeft-Ctww3Qqs.js} +1 -1
- package/dist/client/assets/{Line-DESYdkiK.js → Line-WiImiXuE.js} +1 -1
- package/dist/client/assets/{Link01-C5bvI0ok.js → Link01-CYM_hI21.js} +1 -1
- package/dist/client/assets/{LinkExternal01-7ZLNL_9s.js → LinkExternal01-CaGzeOaP.js} +1 -1
- package/dist/client/assets/{Monitor01-CTvO6He0.js → Monitor01-Cbr91rpd.js} +1 -1
- package/dist/client/assets/{Package-zC5cSGJD.js → Package-BCrcbLGQ.js} +1 -1
- package/dist/client/assets/{Palette-Hb6mROVB.js → Palette-DaQdQhd0.js} +1 -1
- package/dist/client/assets/{Plus-C6g4VoC2.js → Plus-QBDZRDJ8.js} +1 -1
- package/dist/client/assets/{SearchLg-CF0JjYPh.js → SearchLg-GScJDtAM.js} +1 -1
- package/dist/client/assets/{SearchMd-BboWc_8K.js → SearchMd-CDlpYmI0.js} +1 -1
- package/dist/client/assets/{Sector-C-8narGG.js → Sector-D30hMSkQ.js} +1 -1
- package/dist/client/assets/{Share07-CbepO2bZ.js → Share07-oJ1NPf0p.js} +1 -1
- package/dist/client/assets/{Stars01-BSCYhMLo.js → Stars01-D5FZ-lZv.js} +1 -1
- package/dist/client/assets/{Sun--XqnAA9t.js → Sun-DyXA1H1E.js} +1 -1
- package/dist/client/assets/{Tool01-CwUt8jvw.js → Tool01-BKMWbMJa.js} +1 -1
- package/dist/client/assets/{Trash01-bzV9Pa75.js → Trash01-BB5hjVuV.js} +1 -1
- package/dist/client/assets/{Upload01-DKLqc8wc.js → Upload01-BaewsYxJ.js} +1 -1
- package/dist/client/assets/{User01-5UPFm-U6.js → User01-98m9yDHn.js} +1 -1
- package/dist/client/assets/{UserSquare-C_2Z4y9_.js → UserSquare-Bn9Rv2_g.js} +1 -1
- package/dist/client/assets/{Users01-CBoZFJLg.js → Users01-BTKiM2ut.js} +1 -1
- package/dist/client/assets/{X-i7IpcK8C.js → X-CyAhP1La.js} +1 -1
- package/dist/client/assets/{XCircle-ClHynDO9.js → XCircle-B9OjNR50.js} +1 -1
- package/dist/client/assets/{XClose-XZQSLHM2.js → XClose-edLJbxCC.js} +1 -1
- package/dist/client/assets/{Zap-13Bw0A-o.js → Zap-BZIP6Nks.js} +1 -1
- package/dist/client/assets/{ZoomOut-BJTVjnBu.js → ZoomOut-DdnLTgRO.js} +1 -1
- package/dist/client/assets/{access-gate-ZcxGf-TD.js → access-gate-CdCHdl3O.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BB4K9AtD.js → add-connection-dialog-DkRnizyZ.js} +1 -1
- package/dist/client/assets/{agent-analytics-Ba_H9uKD.js → agent-analytics-C9tv87-W.js} +1 -1
- package/dist/client/assets/agent-app-CBvM1aYJ.js +1 -0
- package/dist/client/assets/{agent-assets-CHstkwVO.js → agent-assets-B05-K-S7.js} +1 -1
- package/dist/client/assets/{agent-automation-fLrgKvmb.js → agent-automation-BgWgFSKd.js} +1 -1
- package/dist/client/assets/{agent-automations-x2k3Xyf9.js → agent-automations-CWTV52NW.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-CqfI5UWv.js → agent-connect-sources-ChTBROtQ.js} +1 -1
- package/dist/client/assets/agent-deck-DdNEncUD.js +1 -0
- package/dist/client/assets/{agent-e2e-CXJJJ6Gw.js → agent-e2e-BTy-0nVR.js} +1 -1
- package/dist/client/assets/{agent-experiments-BAAdxVE4.js → agent-experiments-Bd08kjA5.js} +1 -1
- package/dist/client/assets/agent-file-Cl1RRIaU.js +1 -0
- package/dist/client/assets/{agent-git-CMvu2d7w.js → agent-git-BR4REel_.js} +1 -1
- package/dist/client/assets/{agent-hosting-CvDl_6mC.js → agent-hosting-CWf-Kj9s.js} +1 -1
- package/dist/client/assets/{agent-icon-4F7jSNEB.js → agent-icon-DCx4QvHC.js} +1 -1
- package/dist/client/assets/agent-library-file-buZZrJNo.js +1 -0
- package/dist/client/assets/{agent-monitor-BkoB5cnN.js → agent-monitor-DEY1tUmn.js} +1 -1
- package/dist/client/assets/{agent-overview-Ce_1EsV_.js → agent-overview-DX22uggn.js} +1 -1
- package/dist/client/assets/agent-settings-DtYrifiQ.js +1 -0
- package/dist/client/assets/{agent-site-editor-4I6oPW-3.js → agent-site-editor-0eWmNWnk.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-BD70YtM4.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-DCyPeHZN.js → agent-site-editor-content-CMTrdWGC.js} +2 -2
- package/dist/client/assets/{agent-site-editor-preview-CMlz0qAL.js → agent-site-editor-preview-DUFjiXFa.js} +3 -3
- package/dist/client/assets/agent-view-BljdHoiY.js +1 -0
- package/dist/client/assets/{agent-view-guard-DRtIvPWQ.js → agent-view-guard-_Ag6Wipz.js} +1 -1
- package/dist/client/assets/{agents-list-D460o79D.js → agents-list-DTPSnuMT.js} +1 -1
- package/dist/client/assets/{ai-providers-BP9IRbNu.js → ai-providers-CQpBDFkJ.js} +1 -1
- package/dist/client/assets/{alert-Dk_6vTVk.js → alert-BTUlvH1R.js} +1 -1
- package/dist/client/assets/{alert-dialog-DAmr19x7.js → alert-dialog-pQ2rDgy1.js} +1 -1
- package/dist/client/assets/{api-keys-bKyXvobb.js → api-keys-CZPqjH6d.js} +1 -1
- package/dist/client/assets/api-keys-DFyHMUzC.js +1 -0
- package/dist/client/assets/app-editor-BvFwnnVI.js +1 -0
- package/dist/client/assets/{asset-utils-DtY2LEWI.js → asset-utils-D5cIpzz_.js} +1 -1
- package/dist/client/assets/{auth-BJh0XKDc.js → auth-CQFvi4px.js} +1 -1
- package/dist/client/assets/{auth-catchall-BYXjG1QL.js → auth-catchall-D-qp3kPt.js} +1 -1
- package/dist/client/assets/{auth-entry-DVCgvwZe.js → auth-entry-DBVZ2Q2j.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CXC2GWWn.js → auth-split-layout-Dm81Sr7Q.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DwKiV4n5.js → authenticate-and-persist-oauth-D0OQGpFS.js} +1 -1
- package/dist/client/assets/{automation-list-row-CTdbLZEd.js → automation-list-row-BJCC6fc9.js} +1 -1
- package/dist/client/assets/{automation-runs-CnJ5aGhK.js → automation-runs-BWW3TU99.js} +1 -1
- package/dist/client/assets/{automations-Br3Jz1gr.js → automations-CQypU6bh.js} +1 -1
- package/dist/client/assets/{autosend-BhoAi_fW.js → autosend-Bq5HvwxJ.js} +1 -1
- package/dist/client/assets/{avatar-SVBTSz6-.js → avatar-BStcvNht.js} +1 -1
- package/dist/client/assets/{badge-Tw_0Gnfk.js → badge-gamI6wY6.js} +1 -1
- package/dist/client/assets/{block-document-GOrRnpK9.js → block-document-DI383-kK.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-EH6speMF.js → blocks-preview-workspace-context-DzCpVAfw.js} +1 -1
- package/dist/client/assets/{breadcrumb-D4Wt1N2M.js → breadcrumb-CE92AOwu.js} +1 -1
- package/dist/client/assets/{buckets-tP0hGMmZ.js → buckets-Dtbt4-sm.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DiHbbOvk.js → build-improve-prompt-doc-Cnp1sKov.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-BZ9sB0IZ.js → bulk-category-panel-BM2yDxDT.js} +1 -1
- package/dist/client/assets/{calendar-PjjlUwcV.js → calendar-BwaCdvxO.js} +1 -1
- package/dist/client/assets/{capability-load-error-R2VQLYeI.js → capability-load-error-Cr6oFf-I.js} +1 -1
- package/dist/client/assets/{category-editor-CxqI2r6D.js → category-editor-PjVafxmN.js} +1 -1
- package/dist/client/assets/{chart-D8AtS0yx.js → chart-Dal9zwRo.js} +1 -1
- package/dist/client/assets/{chat-context-DUFRp2o5.js → chat-context-TwAso_gH.js} +1 -1
- package/dist/client/assets/{chat-draft-NKFUt1rK.js → chat-draft-DE3pPme6.js} +1 -1
- package/dist/client/assets/{checkbox-D0AAAikP.js → checkbox-ZOt4c7SO.js} +1 -1
- package/dist/client/assets/{choose-editor-B000DboW.js → choose-editor-D21bZ-4R.js} +1 -1
- package/dist/client/assets/{cli-auth-success-AUJoXJI_.js → cli-auth-success-ClQ7nIUu.js} +1 -1
- package/dist/client/assets/{client-icons-DCYyFEeJ.js → client-icons-DAMw72kV.js} +1 -1
- package/dist/client/assets/{collapsible-BQcY6rPc.js → collapsible-DPu-d7yP.js} +1 -1
- package/dist/client/assets/{collection-detail-DzOJuwuX.js → collection-detail-1v_Tbwfp.js} +1 -1
- package/dist/client/assets/{collection-display-button-TL4JNINs.js → collection-display-button-Co6o38wp.js} +1 -1
- package/dist/client/assets/{collection-search-Dz6UsoEM.js → collection-search-CWmqsx8-.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Dvc9tAft.js → collection-table-wrapper-COkmkSWr.js} +1 -1
- package/dist/client/assets/{collection-tabs-CstWw66H.js → collection-tabs-CB2d3WMR.js} +1 -1
- package/dist/client/assets/{combobox-Bt8qlvBP.js → combobox-DCprRtQW.js} +1 -1
- package/dist/client/assets/{command-BMFq9nQJ.js → command-cPei63M2.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-D1qbqBsw.js → companion-mcps-section-D4aKHaK_.js} +1 -1
- package/dist/client/assets/{connect-uHFLnX_o.js → connect-DqkTIidT.js} +1 -1
- package/dist/client/assets/{connect-layout-ChbbJuCS.js → connect-layout-CvREpE2n.js} +1 -1
- package/dist/client/assets/{connection-Bu_kYZuh.js → connection-Dm0MNEG4.js} +1 -1
- package/dist/client/assets/{connection-card-BR0rWuUi.js → connection-card-rwekWkEE.js} +1 -1
- package/dist/client/assets/{connection-detail-CuqAdmCe.js → connection-detail-C1_9i9lR.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-glicOBfm.js → connection-form-helpers-DIK4pNs8.js} +1 -1
- package/dist/client/assets/{connections-DE0s5wKI.js → connections-D5xtxneK.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-Btvjtxwc.js → create-organization-dialog-CAY01Lhs.js} +1 -1
- package/dist/client/assets/{decofile-api-DgTLnV1u.js → decofile-api-C865MOuX.js} +1 -1
- package/dist/client/assets/{decopilot-tLRiBCr4.js → decopilot-Bz3gxXOj.js} +1 -1
- package/dist/client/assets/{dialog-MzmGuLy9.js → dialog-B_W1p_MX.js} +1 -1
- package/dist/client/assets/{discover-Vh8ajle8.js → discover-No7oBhxK.js} +1 -1
- package/dist/client/assets/{domain-settings-B0_s17em.js → domain-settings-CNTMkcC5.js} +1 -1
- package/dist/client/assets/{download-app-dialog-CDDWmfdP.js → download-app-dialog-un8Y2qtJ.js} +1 -1
- package/dist/client/assets/{drawer-Cv924bvf.js → drawer-B8-404ai.js} +1 -1
- package/dist/client/assets/{editor-zW3jvuax.js → editor-CVUFFrZi.js} +1 -1
- package/dist/client/assets/{empty-state-DTUS3HtE.js → empty-state-BUX-AKkc.js} +1 -1
- package/dist/client/assets/{empty-state-BptHyu85.js → empty-state-CBmfAeTK.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DNxvULAk.js → extract-connection-data-BkAkT_y6.js} +1 -1
- package/dist/client/assets/{feature-gate-B9rqGCJb.js → feature-gate-CLprskBn.js} +1 -1
- package/dist/client/assets/{feature-paywall-CftG_N1J.js → feature-paywall-DKgY1ug6.js} +1 -1
- package/dist/client/assets/{file-explorer-DpIL2rDI.js → file-explorer-2CjmdQXF.js} +1 -1
- package/dist/client/assets/{file-preview-D8URAIQ-.js → file-preview-CVKqGWrD.js} +1 -1
- package/dist/client/assets/{file-share-button-CahJYVQ3.js → file-share-button-BYIYxFec.js} +1 -1
- package/dist/client/assets/{file-type-icon-D1D8leoE.js → file-type-icon-CmhUTJY2.js} +1 -1
- package/dist/client/assets/{folder-icon-BU_WAjfX.js → folder-icon-Bl6C1AtB.js} +1 -1
- package/dist/client/assets/{form-C4j126KK.js → form-C-wJTrTS.js} +1 -1
- package/dist/client/assets/{gateway-client-3gBYEcvM.js → gateway-client-V99FM7uw.js} +1 -1
- package/dist/client/assets/{general-CJkAPcsm.js → general-ZbjfXkKD.js} +1 -1
- package/dist/client/assets/{github-icon-l7M1zEUL.js → github-icon-D3voba1_.js} +1 -1
- package/dist/client/assets/{home-CsHK1Vud.js → home-BAdU5BzN.js} +1 -1
- package/dist/client/assets/{hooks-B23Jg659.js → hooks-B-eo4ZkC.js} +1 -1
- package/dist/client/assets/{hooks-D2YeBh8J.js → hooks-OnvEvvEV.js} +1 -1
- package/dist/client/assets/{icon-button-Du-P1XdE.js → icon-button-D-xorLWT.js} +1 -1
- package/dist/client/assets/{index-Ddaygbdd.js → index-8tNxX5U3.js} +1 -1
- package/dist/client/assets/{index-Clt0_ml3.js → index-AQ7a_nLC.js} +1 -1
- package/dist/client/assets/{index-DORz3VsI.js → index-BBS4Xs5i.js} +1 -1
- package/dist/client/assets/{index-CAYWsHcv.js → index-BPu32bsM.js} +1 -1
- package/dist/client/assets/{index-Cm-Yn4q_.js → index-BaUCsY53.js} +2 -2
- package/dist/client/assets/{index-CllSFgmg.js → index-Bwvc4gj1.js} +1 -1
- package/dist/client/assets/{index-Dd7WwYBf.js → index-C38ogrVR.js} +1 -1
- package/dist/client/assets/{index-DDt-mfSn.js → index-C5hwpgvj.js} +1 -1
- package/dist/client/assets/{index-CHLOyz8f.js → index-CsLxM554.js} +1 -1
- package/dist/client/assets/{index-D9u292hz.js → index-CwZlImIu.js} +1 -1
- package/dist/client/assets/{index-D4cAPfDs.js → index-DJgUu6Ow.js} +1 -1
- package/dist/client/assets/{index-B9AVbFn1.js → index-DaaMbICC.js} +1 -1
- package/dist/client/assets/{index-G_4wgESR.js → index-Dwz6P534.js} +1 -1
- package/dist/client/assets/{index-DiJK2wHU.js → index-a3j56WNr.js} +1 -1
- package/dist/client/assets/{index-redirect-CSA_uYqe.js → index-redirect-DDx8VKTm.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-kZQR6QZi.js → infiniteQueryObserver-CFGlXSE6.js} +1 -1
- package/dist/client/assets/{infra-billing-CzqGCEh_.js → infra-billing-CbaHdWUL.js} +1 -1
- package/dist/client/assets/{input-BqjhD7MF.js → input-BeZHRoN0.js} +1 -1
- package/dist/client/assets/{input-8i6Bk9mS.js → input-CgGJMTjB.js} +1 -1
- package/dist/client/assets/{input-IyrqyofH.js → input-DWjaAW1q.js} +1 -1
- package/dist/client/assets/{integration-icon-BPXGYcG_.js → integration-icon-DddQCTLH.js} +1 -1
- package/dist/client/assets/{label-Cq0XOqve.js → label-DyuYvOXR.js} +1 -1
- package/dist/client/assets/{last-preview-page-BiAM4n_B.js → last-preview-page-YvT2BeJz.js} +1 -1
- package/dist/client/assets/{layout-CE21QG_N.js → layout-B8vkzGNt.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-B_QAQTHc.js → legacy-agents-deep-DS98W1bJ.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BKBPh_b_.js → legacy-main-redirect-BZojF_Wn.js} +1 -1
- package/dist/client/assets/{library-CCtDJiGL.js → library-CkWJgl3z.js} +1 -1
- package/dist/client/assets/{login-TjjJ7hBC.js → login-Dd_ah983.js} +1 -1
- package/dist/client/assets/{markdown-BXZJduYq.js → markdown-C4yXnGlQ.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-znNhYyyo.js → mcp-app-renderer-CIoGKh0L.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DpctXbyl.js → mcp-oauth-CKC35fM0.js} +1 -1
- package/dist/client/assets/{members-C22vh0zf.js → members-2mqBoKlZ.js} +1 -1
- package/dist/client/assets/{message-templates-CJsxM1Aj.js → message-templates-qpRrHdzI.js} +1 -1
- package/dist/client/assets/{mini-report-page-EjA-mPMg.js → mini-report-page-7MtWGBIb.js} +1 -1
- package/dist/client/assets/{mock-board-C7y8-NQY.js → mock-board-OGKj5bbo.js} +3 -3
- package/dist/client/assets/{monaco-editor-D1EuV3RH.js → monaco-editor-ZVPCDy8r.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CtceWj8b.js → monitoring-stats-row-n7eR13oz.js} +1 -1
- package/dist/client/assets/{multi-select-YAftz-Zw.js → multi-select-Cy4uEt5t.js} +1 -1
- package/dist/client/assets/{mustache-LQdueZ7J.js → mustache-BKCalyZ3.js} +1 -1
- package/dist/client/assets/{oauth-callback-CMV31h-n.js → oauth-callback-B4s7-SjJ.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-De2DItw8.js → oauth-callback-ai-provider-A2ZdtMJh.js} +1 -1
- package/dist/client/assets/{onboarding-eH-IPrp7.js → onboarding-B18O_8PB.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-InMvM441.js → optimistic-project-sidebar-views-4M_SuNAd.js} +1 -1
- package/dist/client/assets/{org-file-open-context-lYlEwrS6.js → org-file-open-context-BHgP4Bt_.js} +1 -1
- package/dist/client/assets/{organization-choice-FGe4nTR_.js → organization-choice-B-ibJ7ga.js} +1 -1
- package/dist/client/assets/{orgs-DiYo2OSV.js → orgs-GoD0AKkt.js} +1 -1
- package/dist/client/assets/{page-seo-form-Dwe3nGYW.js → page-seo-form-CB3dZVsI.js} +1 -1
- package/dist/client/assets/{pair-BEtEaRoT.js → pair-CNSuc9Tx.js} +1 -1
- package/dist/client/assets/{plan-ladder-CuzeFHa4.js → plan-ladder-4OG8gxXk.js} +1 -1
- package/dist/client/assets/{popover-0yOMUN9V.js → popover-CfjNVxcy.js} +1 -1
- package/dist/client/assets/{post-calendar-BWXIOp26.js → post-calendar-BcZ1isTp.js} +1 -1
- package/dist/client/assets/{post-editor--ZAMVoRu.js → post-editor-D1cbn1uM.js} +1 -1
- package/dist/client/assets/{preview-content-DryeENmS.js → preview-content-Dqqx6aXo.js} +1 -1
- package/dist/client/assets/{preview-dialog-DA5gB4Zx.js → preview-dialog-CkdLs9JK.js} +1 -1
- package/dist/client/assets/{primitives-D1Uh-Z46.js → primitives-tALvZrdy.js} +1 -1
- package/dist/client/assets/{profile-CWTJPNwM.js → profile-Ba9pu0jg.js} +1 -1
- package/dist/client/assets/{project-app-view-BTrwboPy.js → project-app-view-DEPo_WV0.js} +1 -1
- package/dist/client/assets/{project-feed-DwPbuz1r.js → project-feed-t2B8x5Ds.js} +1 -1
- package/dist/client/assets/{project-icon-7mHVCrAj.js → project-icon-BcwIVgAi.js} +1 -1
- package/dist/client/assets/project-reports-CUmeFCeP.js +1 -0
- package/dist/client/assets/project-tasks-BKwgLbBt.js +1 -0
- package/dist/client/assets/{prompts-JpOZz60E.js → prompts-BIItFtZo.js} +1 -1
- package/dist/client/assets/record-editor-DsGWfuGc.js +1 -0
- package/dist/client/assets/{redirect-editor-Dm1Lv4vd.js → redirect-editor-aLV6ur5L.js} +1 -1
- package/dist/client/assets/reports--BThC_pS.js +1 -0
- package/dist/client/assets/{reports-DKNNx4qg.js → reports-WNBfGUXU.js} +1 -1
- package/dist/client/assets/{reports-onboarding-B2DiJAba.js → reports-onboarding-C_zdtSPw.js} +1 -1
- package/dist/client/assets/{reports-tab-b7qGy0mk.js → reports-tab-CdSuUi59.js} +2 -2
- package/dist/client/assets/{repositories-DD6Ukhrw.js → repositories-DIbQTfQ3.js} +1 -1
- package/dist/client/assets/{repository-import-picker-fxShIRss.js → repository-import-picker-9ArSxGfl.js} +1 -1
- package/dist/client/assets/{repository-picker-df_kLebP.js → repository-picker-DvlVOtfD.js} +1 -1
- package/dist/client/assets/{require-capability-C5sz4l9u.js → require-capability-ClEH2qMp.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Dx8h2y43.js → required-auth-layout-RPewxiQ7.js} +1 -1
- package/dist/client/assets/{reset-password-Dee2FaRd.js → reset-password-Cxc4nbro.js} +1 -1
- package/dist/client/assets/{resizable-CKKKCPOb.js → resizable-NlBg9ckH.js} +1 -1
- package/dist/client/assets/{review-settings-AoqfsyyE.js → review-settings-BMgKmSE3.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-B3amDY-g.js → rich-text-link-control-D4SUwojL.js} +1 -1
- package/dist/client/assets/{roles-C_pvm_A3.js → roles-KIX7T6DE.js} +1 -1
- package/dist/client/assets/{route-DhqILjJn.js → route-D21Ngue1.js} +1 -1
- package/dist/client/assets/{route-B5aRnclN.js → route-DY9P7gK6.js} +1 -1
- package/dist/client/assets/{route-BebMWENX.js → route-ZfAfNgUo.js} +1 -1
- package/dist/client/assets/{route-page-header-wQvHg13u.js → route-page-header-CZENWwKw.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-CTtbEokq.js → runnable-block-editor-CPrAfsrO.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-BfjBaS4k.js → sandbox-lifecycle-context-DDXdy5Um.js} +1 -1
- package/dist/client/assets/{schema-CfWSVtg9.js → schema-BlqfB0t-.js} +1 -1
- package/dist/client/assets/{scroll-area-D5XoGWja.js → scroll-area-CcTiw04W.js} +1 -1
- package/dist/client/assets/{search-input-oOSx8rAu.js → search-input-B3fXKYgx.js} +1 -1
- package/dist/client/assets/{search-toggle-CgpfZR25.js → search-toggle-CcKFXNOR.js} +1 -1
- package/dist/client/assets/{secrets-C0jZB_x3.js → secrets-BIq15tRb.js} +1 -1
- package/dist/client/assets/{sections-editor-ILck9TBW.js → sections-editor-CCdVMsOX.js} +1 -1
- package/dist/client/assets/{select-Dyq1d0JF.js → select-CbjypzjH.js} +1 -1
- package/dist/client/assets/{select-model-BmMrWwNd.js → select-model-DsaGbeBg.js} +1 -1
- package/dist/client/assets/{seo-editor-CzWbhfG4.js → seo-editor-DRs_jGJ9.js} +1 -1
- package/dist/client/assets/{separator-CeLCsnF4.js → separator-BV2scVYy.js} +1 -1
- package/dist/client/assets/{settings-tab-D6snhK7R.js → settings-tab-Dj_H0Amt.js} +1 -1
- package/dist/client/assets/{sheet-4N_7bh_n.js → sheet-CxPYeVzh.js} +1 -1
- package/dist/client/assets/{shell-layout-mxurnlT8.js → shell-layout-BMa1UITe.js} +1 -1
- package/dist/client/assets/{sidebar-C9HUL4Zk.js → sidebar--C0CUfPE.js} +1 -1
- package/dist/client/assets/{skill-preview-uy28GPTb.js → skill-preview-DEwaAGc-.js} +1 -1
- package/dist/client/assets/{skills-BFXrBkuz.js → skills-DOcoaaLu.js} +1 -1
- package/dist/client/assets/{sso-BthNdlgS.js → sso-DJhlkHXv.js} +1 -1
- package/dist/client/assets/{switch-BJbkn4iq.js → switch-BRCfrFjR.js} +1 -1
- package/dist/client/assets/{synced-repos-Bn3taHAf.js → synced-repos-Dl9LIbGN.js} +1 -1
- package/dist/client/assets/{table-Cqt3fFs7.js → table-DrtMEGvQ.js} +1 -1
- package/dist/client/assets/{tabs-DfTLJ-n_.js → tabs-RYmBG5CW.js} +1 -1
- package/dist/client/assets/{task-board-D_YhOLZh.js → task-board--muk7VRH.js} +1 -1
- package/dist/client/assets/{task-route-CCsvGOiX.js → task-route-CnsMYWtt.js} +1 -1
- package/dist/client/assets/{task-status-DpEZTwHj.js → task-status-Xn5XjVXY.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-ewF7fNbV.js → taskboard-analytics-BIHb-Xhs.js} +1 -1
- package/dist/client/assets/tasks-CcJH6m2j.js +1 -0
- package/dist/client/assets/{tasks-DH8JVPEr.js → tasks-CuaO3kyg.js} +1 -1
- package/dist/client/assets/{textarea-DwEKjGZF.js → textarea-o1CAWPw5.js} +1 -1
- package/dist/client/assets/{thread-button-C_b8KN5j.js → thread-button-BWsbfMUj.js} +1 -1
- package/dist/client/assets/{thread-intent-EyHIlLf5.js → thread-intent-D1qHfbwN.js} +1 -1
- package/dist/client/assets/{thread-route-D8to8sA5.js → thread-route-B1rApjJY.js} +1 -1
- package/dist/client/assets/{thread-route-RnLVS5MF.js → thread-route-CqH_sM7h.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-CeCoa5Lv.js → thread-sheet-body-C2LuWWxS.js} +1 -1
- package/dist/client/assets/{toggle-group-CHLe_ngX.js → toggle-group-IueCKZm2.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CAkp1a-v.js → toolbar-icon-button-BIl-1gw5.js} +1 -1
- package/dist/client/assets/{tooltip-Bja45eMa.js → tooltip-BdQDXOHs.js} +1 -1
- package/dist/client/assets/{track-BKTYoAt0.js → track-DfTrW9fq.js} +1 -1
- package/dist/client/assets/{types-imD2hCXv.js → types-CIf9swM1.js} +1 -1
- package/dist/client/assets/{usage-stats-DL6Mxcqj.js → usage-stats-Cm3pAzyE.js} +1 -1
- package/dist/client/assets/{use-ai-providers-VJDsVUMj.js → use-ai-providers-35xFsuWH.js} +1 -1
- package/dist/client/assets/{use-automations-YsQ3mp7f.js → use-automations-V-zDAIqP.js} +1 -1
- package/dist/client/assets/{use-autosave-B4Sy5dKm.js → use-autosave-BHlJuMUR.js} +1 -1
- package/dist/client/assets/{use-connect-companion-BaKonimr.js → use-connect-companion-Ec7FP8l3.js} +1 -1
- package/dist/client/assets/{use-connection-BNw2MaMd.js → use-connection-BG2oq1yI.js} +1 -1
- package/dist/client/assets/{use-copy-CeHMXkmI.js → use-copy-BO1bkgoB.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DYSVpRcW.js → use-create-virtual-mcp-Bt3Bu3eP.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-CRSpZTHr.js → use-date-fns-locale-De4RYU8R.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Bkd-RMtF.js → use-debounced-autosave-B5R1NUJ-.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CBSXKHwV.js → use-debounced-value-BvTGvr8H.js} +1 -1
- package/dist/client/assets/{use-deco-credits-C6itQLFB.js → use-deco-credits-Y9if5MSD.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-EQT-Ff7p.js → use-decopilot-events-DTs9feev.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DpRl8Clh.js → use-delete-connection-tBc9cw0q.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-2vhBPVeg.js → use-deployment-admin-Clxc-XIE.js} +1 -1
- package/dist/client/assets/{use-entitlements-CfU3YoB8.js → use-entitlements-CaMElBtz.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-3apT4hX9.js → use-fast-preview-draft-url-BcKKz-yw.js} +1 -1
- package/dist/client/assets/{use-file-configs-DV2TLqWx.js → use-file-configs-DUSWDNVW.js} +1 -1
- package/dist/client/assets/{use-in-settings-CYLMPJdc.js → use-in-settings-BOWyJIpk.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CcnUJvw1.js → use-infinite-scroll-CAVOqDLL.js} +1 -1
- package/dist/client/assets/{use-join-requests-CAJnDyFH.js → use-join-requests-CkoSfdnr.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-T0Kvslcy.js → use-main-panel-tabs-BmlQ7IRN.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-dN9WL_Cj.js → use-mcp-auth-status-0CAWGnHP.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DAbHG4oK.js → use-mcp-client-_WZbaqFW.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Dqrno6f9.js → use-mcp-prompts-Dffc2JiM.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-B9HxU8OQ.js → use-mcp-tools-8dhwnFZE.js} +1 -1
- package/dist/client/assets/{use-members-CX4Ep53P.js → use-members-DXr_yYWh.js} +1 -1
- package/dist/client/assets/{use-mobile-BlhybxdO.js → use-mobile-Cm9Gzoc8.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-UrDQ1j_Y.js → use-navigate-to-agent-DawRJCtN.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-Clbiqv9s.js → use-open-billing-url-7OBYPnFU.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-0lE24BYR.js → use-org-auth-client-DFrA1d0C.js} +1 -1
- package/dist/client/assets/{use-org-fs-Dm0MOI2N.js → use-org-fs-ZJnajDst.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DtP2qP0h.js → use-org-repo-syncs-CapfaJCS.js} +1 -1
- package/dist/client/assets/{use-org-sso-CaeEbX_L.js → use-org-sso-0vqSrOQw.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DoF8H4qR.js → use-organization-roles-C-SCAhjf.js} +1 -1
- package/dist/client/assets/{use-organization-settings-aVVw0VfM.js → use-organization-settings-D2bS0z2Y.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-BZ20L_1u.js → use-panel-navigate-11comAbX.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-B8m71d1U.js → use-project-native-view-presence-B2gAg465.js} +1 -1
- package/dist/client/assets/{use-project-scope-DNhflWSF.js → use-project-scope-D-IBCwWL.js} +1 -1
- package/dist/client/assets/{use-releases-DGcFLhQX.js → use-releases-kekUlCo4.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-BFhpAlDR.js → use-reports-diagnostic-Dps8_eEU.js} +1 -1
- package/dist/client/assets/{use-route-default-main-Cpujna-F.js → use-route-default-main-DvabDAyh.js} +1 -1
- package/dist/client/assets/{use-secrets-BuzOki6X.js → use-secrets-k3YB2zSU.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DOg0m0Oe.js → use-section-preview-base-Byx7bmxl.js} +1 -1
- package/dist/client/assets/{use-session-runtime-ttdCX595.js → use-session-runtime-Byx8MafX.js} +1 -1
- package/dist/client/assets/{use-tags-COwpPGb0.js → use-tags-Bq0jDvjf.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-Dfcytd4V.js → use-task-board-analytics-Dwvtx8Mt.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CIrvVpnI.js → use-task-metadata-DO-xqWSk.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-DFHmpQbO.js → use-thread-outputs-_jEERbVH.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-joDFMrl3.js → use-virtual-mcp-B6rtU_oH.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BdpYc7ny.js +1 -0
- package/dist/client/assets/{useQueries-BoM9aW6V.js → useQueries-BV0TeTxz.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Be9hvwi2.js +1 -0
- package/dist/client/assets/{users-i9Zh69o3.js → users-CnqS0BbF.js} +1 -1
- package/dist/client/assets/{utils-DjeQFU_k.js → utils-Cp06mEvu.js} +1 -1
- package/dist/client/assets/{variant-calendar-CmLSEJPW.js → variant-calendar-CHV7Bmlb.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-mXWxdv2F.js → variant-matcher-override-B6pOTot_.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-B2-sm_tc.js → view-mode-toggle-d-OLFzU5.js} +1 -1
- package/dist/client/assets/{virtual-mcp-C5gMOVS_.js → virtual-mcp-DJ3kz63h.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +542 -542
- package/dist/server/server.js +376 -376
- package/package.json +1 -1
- package/dist/client/assets/agent-app-B0yYw2Kn.js +0 -1
- package/dist/client/assets/agent-deck-BsRl1MeW.js +0 -1
- package/dist/client/assets/agent-file-BPpuqCrP.js +0 -1
- package/dist/client/assets/agent-library-file-WGFNhYmG.js +0 -1
- package/dist/client/assets/agent-settings-DvcVBQPF.js +0 -1
- package/dist/client/assets/agent-site-editor-code-P4w-qKSF.js +0 -2
- package/dist/client/assets/agent-view-Cm9nHUf9.js +0 -1
- package/dist/client/assets/api-keys-BEQ_tuCQ.js +0 -1
- package/dist/client/assets/app-editor-BC02Q4FF.js +0 -1
- package/dist/client/assets/project-reports-DOvb8BA4.js +0 -1
- package/dist/client/assets/project-tasks-C4121Jp_.js +0 -1
- package/dist/client/assets/record-editor-DcMeB_oO.js +0 -1
- package/dist/client/assets/reports-JVS2p_sy.js +0 -1
- package/dist/client/assets/tasks-BiwI0Nwu.js +0 -1
- package/dist/client/assets/useInfiniteQuery-ApIt4V4o.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Vryw3RBz.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-
|
|
2
|
-
import{c as je,j as s,m as Ds,K as As,b as Be,l as De,r as G,h as Qe,B as Oe,am as Kt,t as ve,aB as bt,aK as pt,F as It,aC as is,H as Mt,I as zt,G as lt,aL as Bt,aM as Dn,a0 as An,u as Bs,aI as Fe}from"./index-Cm-Yn4q_.js";import{A as Bn}from"./agent-view-guard-DRtIvPWQ.js";import{F as $n}from"./feature-gate-B9rqGCJb.js";import{u as _t,b as $s}from"./chat-context-DUFRp2o5.js";import{i as Ls}from"./AlertCircle-Da3tM0gY.js";import{z as jt,K as Os,L as Rs,M as Fs,N as Ln,O as On,P as Ks,Q as Rn,j as Vt,F as Is,R as Fn,S as Kn,T as In,x as Ms,U as Mn,V as zn}from"./agent-icon-4F7jSNEB.js";import{i as Ut}from"./ZoomOut-BJTVjnBu.js";import{c as zs}from"./XClose-XZQSLHM2.js";import{s as Vn}from"./Plus-C6g4VoC2.js";import{i as Vs}from"./SearchLg-CF0JjYPh.js";import{t as Us}from"./Users01-CBoZFJLg.js";import{f as Un,e as Gn,b as Hn,A as Jn,a as Wn,d as Yn,c as qn,g as Qn}from"./alert-dialog-DAmr19x7.js";import{S as Et}from"./scroll-area-D5XoGWja.js";import{T as Ie,a as Me,c as ze}from"./tooltip-Bja45eMa.js";import{S as $t,j as Xn,c as Zn,g as Gs,B as Lt,P as eo,k as to,n as so,o as no,u as Hs,l as oo,q as lo,R as ao,s as Js,r as io,t as ro,d as Ws,v as co,w as uo,x as Ys,y as mo,M as fo,h as po,z as ho,p as go,A as xo,C as bo,e as yo,f as vo,D as rs,E as qs,i as So,F as ko}from"./runnable-block-editor-CTtbEokq.js";import{r as Jt,S as jo,l as Wt,i as Co,m as wo,o as No,n as Ct,v as Po,R as Qs,G as Yt,g as To,q as _o,e as cs,t as Eo,d as Do,u as Ao,w as ds,h as Bo,x as $o,y as Lo}from"./claim-phase-copy-0btUuJoC.js";import{u as Oo,P as Ro}from"./mustache-LQdueZ7J.js";import{t as qt}from"./ChevronUp-dgPQkcdv.js";import{i as Xs}from"./Zap-13Bw0A-o.js";import{C as Fo,a as Ko,b as Io}from"./collapsible-BQcY6rPc.js";import{c as Mo,d as zo}from"./sandbox-lifecycle-context-BfjBaS4k.js";import{u as Vo}from"./use-session-runtime-ttdCX595.js";import{c as Qt,d as Xt,e as Zt,b as es,D as ts,h as Uo}from"./dialog-MzmGuLy9.js";import{I as rt}from"./input-BqjhD7MF.js";import{C as ss}from"./checkbox-D0AAAikP.js";import{L as Ot}from"./label-Cq0XOqve.js";import{c as Go,b as Ho,a as Jo,d as Wo,S as Yo}from"./select-Dyq1d0JF.js";import{a as Zs,d as en}from"./use-virtual-mcp-joDFMrl3.js";import{i as qo,a as us}from"./Share07-CbepO2bZ.js";import{c as Qo,b as Xo,s as Zo}from"./XCircle-ClHynDO9.js";import{i as ns}from"./X-i7IpcK8C.js";import"./rich-text-link-control-B3amDY-g.js";import{M as el}from"./monaco-editor-D1EuV3RH.js";import{s as tn}from"./Trash01-bzV9Pa75.js";import{a as tl}from"./Copy01-CMHlAzgS.js";import{b as sl}from"./Tool01-CwUt8jvw.js";import{b as ms}from"./use-project-scope-DNhflWSF.js";import{E as nl}from"./empty-state-BptHyu85.js";import{G as fs}from"./github-icon-l7M1zEUL.js";import{R as ol}from"./repository-import-picker-fxShIRss.js";import{b as ll}from"./thread-route-RnLVS5MF.js";function al(t,e){if(!t||!e?.length)return t;const n=Object.fromEntries(Object.entries(t.properties??{}).filter(([o])=>!e.includes(o)));return Object.keys(n).length>0?{...t,properties:n}:t}function il(t,e,n){return typeof t!="string"?null:al(Jt(t,e),n)}function sn(t,e,n){if(!e||typeof t!="string")return!1;const o=il(t,e,n);return!!o&&Object.keys(o.properties??{}).length>0}function at(t){const e=je.c(6),{hasItems:n,emptyLabel:o,emptyHint:c}=t;let l;e[0]!==c||e[1]!==o||e[2]!==n?(l=n?"No results match your search.":s.jsxs(s.Fragment,{children:[s.jsx("div",{children:o}),s.jsx("div",{className:"mt-1 text-muted-foreground/80",children:c})]}),e[0]=c,e[1]=o,e[2]=n,e[3]=l):l=e[3];let i;return e[4]!==l?(i=s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l}),e[4]=l,e[5]=i):i=e[5],i}function Dt(t,e){return`${t}-${e}`}function nn(t,e){return`site/apps/${t}/${e}.ts`}function on(t){const e=t.match(/^site\/apps\/([^/]+)\/([^/.]+)\.tsx?$/);if(e)return{vendor:e[1],app:e[2]};const n=t.match(/^([^/]+)\/apps\/([^/.]+)\.tsx?$/);return n?{vendor:n[1],app:n[2]}:null}function rl(t){const e=t.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function cl(t){return t==="local"?"Custom":"Installed"}function ln(t,e,n){const o=new Set([Dt(t,e),e].map(l=>l.toLowerCase())),c=nn(t,e);for(const[l,i]of Object.entries(n)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const r=i;if(o.has(l.toLowerCase())||r.__resolveType===c)return l}return null}function dl(t,e){const n=t.vendor.alias,o=t.name,c=ln(n,o,e);return{id:Dt(n,o),app:o,vendor:n,title:t.title||t.name,description:t.description,category:t.category??"Other",logo:t.logo||void 0,resolveType:nn(n,o),blockKey:c,installed:c!==null}}function ul(t,e,n){if(t===jo)return null;const o=on(t);if(!o)return null;const{vendor:c,app:l}=o,i=ln(c,l,n),r=Wt(t,e);return{id:Dt(c,l),app:l,vendor:c,title:r.title??l,description:r.description??"",category:"Others",logo:r.logo??r.icon,resolveType:t,blockKey:i,installed:i!==null}}function ml(t,e,n){const o=e.__resolveType;if(typeof o!="string"||Co(t,e)||!wo(o))return null;const c=on(o)??rl(t);if(!c)return null;const l=Wt(o,n),{vendor:i,app:r}=c;return{id:Dt(i,r),app:r,vendor:i,title:l.title??No(t,e,n),description:l.description??"",category:cl(i),logo:l.logo??l.icon,resolveType:o,blockKey:t,installed:!0}}function fl(t,e,n){const o=new Map;for(const l of t){const i=dl(l,n);o.set(i.id,i)}const c=e.manifest?.blocks?.apps??{};for(const l of Object.keys(c)){const i=ul(l,e,n);!i||o.has(i.id)||o.set(i.id,i)}for(const[l,i]of Object.entries(n)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const r=ml(l,i,e);!r||o.has(r.id)||o.set(r.id,r)}return[...o.values()].sort(pl)}function pl(t,e){return t.installed!==e.installed?t.installed?-1:1:t.title.localeCompare(e.title)}async function hl(){const t=await fetch("/api/deco-apps");if(!t.ok)throw new Error(`Failed to fetch deco apps: ${t.status}`);return(await t.json()).apps??[]}function gl(t,e,n){const o=je.c(12),c=n?.enabled??!0;let l;o[0]===Symbol.for("react.memo_cache_sentinel")?(l=As.decoApps(),o[0]=l):l=o[0];let i;o[1]!==c?(i={queryKey:l,queryFn:hl,staleTime:3e5,retry:1,enabled:c},o[1]=c,o[2]=i):i=o[2];const r=Ds(i);let a;o[3]!==e||o[4]!==t||o[5]!==r.data?(a=t&&e?fl(r.data??[],t,e):[],o[3]=e,o[4]=t,o[5]=r.data,o[6]=a):a=o[6];const u=a,x=r.isLoading&&!r.isError;let d;return o[7]!==u||o[8]!==r.isError||o[9]!==r.refetch||o[10]!==x?(d={catalog:u,isLoading:x,isError:r.isError,refetch:r.refetch},o[7]=u,o[8]=r.isError,o[9]=r.refetch,o[10]=x,o[11]=d):d=o[11],d}const xl=["sections","apps","loaders","actions"];function bl(t){const e=je.c(59),{active:n,counts:o,showBlog:c,onSelect:l}=t,i=Be();let r;e[0]!==i?(r=i("sandbox.collectionsSidebar.content"),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==r?(a=s.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:s.jsx("span",{className:"text-sm font-medium",children:r})}),e[2]=r,e[3]=a):a=e[3];let u;e[4]!==i?(u=i("sandbox.collectionsSidebar.pages"),e[4]=i,e[5]=u):u=e[5];const x=n==="pages";let d;e[6]!==o.pages||e[7]!==l||e[8]!==u||e[9]!==x?(d=s.jsx(Le,{id:"pages",icon:jt,label:u,count:o.pages,active:x,onSelect:l}),e[6]=o.pages,e[7]=l,e[8]=u,e[9]=x,e[10]=d):d=e[10];let h;e[11]!==i?(h=i("sandbox.collectionsSidebar.redirects"),e[11]=i,e[12]=h):h=e[12];const p=n==="redirects";let f;e[13]!==o.redirects||e[14]!==l||e[15]!==h||e[16]!==p?(f=s.jsx(Le,{id:"redirects",icon:Os,label:h,count:o.redirects,active:p,onSelect:l}),e[13]=o.redirects,e[14]=l,e[15]=h,e[16]=p,e[17]=f):f=e[17];let y;e[18]!==i?(y=i("sandbox.collectionsSidebar.site"),e[18]=i,e[19]=y):y=e[19];const g=n==="site";let v;e[20]!==l||e[21]!==g||e[22]!==y?(v=s.jsx(Le,{id:"site",icon:On,label:y,active:g,onSelect:l}),e[20]=l,e[21]=g,e[22]=y,e[23]=v):v=e[23];let S;e[24]!==i?(S=i("sandbox.collectionsSidebar.seo"),e[24]=i,e[25]=S):S=e[25];const k=n==="seo";let C;e[26]!==l||e[27]!==S||e[28]!==k?(C=s.jsx(Le,{id:"seo",icon:Ks,label:S,active:k,onSelect:l}),e[26]=l,e[27]=S,e[28]=k,e[29]=C):C=e[29];let w;e[30]!==i?(w=i("sandbox.collectionsSidebar.calendar"),e[30]=i,e[31]=w):w=e[31];const U=n==="calendar";let T;e[32]!==l||e[33]!==w||e[34]!==U?(T=s.jsx(Le,{id:"calendar",icon:Rn,label:w,active:U,onSelect:l}),e[32]=l,e[33]=w,e[34]=U,e[35]=T):T=e[35];let j;e[36]!==n||e[37]!==o||e[38]!==l?(j=s.jsx(yl,{active:n,counts:o,onSelect:l}),e[36]=n,e[37]=o,e[38]=l,e[39]=j):j=e[39];let I;e[40]!==n||e[41]!==o.authors||e[42]!==o.categories||e[43]!==o.posts||e[44]!==l||e[45]!==c||e[46]!==i?(I=c&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mt-3 flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",children:[s.jsx(Rs,{size:13,className:"shrink-0"}),i("sandbox.collectionsSidebar.blog")]}),s.jsx(Le,{id:"posts",icon:Ut,label:i("sandbox.collectionsSidebar.posts"),count:o.posts,active:n==="posts",onSelect:l}),s.jsx(Le,{id:"authors",icon:Us,label:i("sandbox.collectionsSidebar.authors"),count:o.authors,active:n==="authors",onSelect:l}),s.jsx(Le,{id:"categories",icon:Fs,label:i("sandbox.collectionsSidebar.categories"),count:o.categories,active:n==="categories",onSelect:l}),s.jsx(Le,{id:"post-schedule",icon:Ln,label:i("sandbox.collectionsSidebar.postSchedule"),active:n==="post-schedule",onSelect:l})]}),e[40]=n,e[41]=o.authors,e[42]=o.categories,e[43]=o.posts,e[44]=l,e[45]=c,e[46]=i,e[47]=I):I=e[47];let M;e[48]!==v||e[49]!==C||e[50]!==T||e[51]!==j||e[52]!==I||e[53]!==d||e[54]!==f?(M=s.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[d,f,v,C,T,j,I]}),e[48]=v,e[49]=C,e[50]=T,e[51]=j,e[52]=I,e[53]=d,e[54]=f,e[55]=M):M=e[55];let F;return e[56]!==a||e[57]!==M?(F=s.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[a,M]}),e[56]=a,e[57]=M,e[58]=F):F=e[58],F}function yl(t){const e=je.c(52),{active:n,counts:o,onSelect:c}=t,l=Be();let i;e[0]!==n?(i=xl.includes(n),e[0]=n,e[1]=i):i=e[1];const r=i,[a,u]=G.useState(!1),x=a||r;let d,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=De("flex w-full items-center gap-2 classic:rounded-md compact:rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer","text-muted-foreground hover:bg-muted hover:text-foreground"),h=s.jsx(Fn,{size:16,className:"shrink-0"}),e[2]=d,e[3]=h):(d=e[2],h=e[3]);let p;e[4]!==l?(p=l("sandbox.collectionsSidebar.advanced"),e[4]=l,e[5]=p):p=e[5];let f;e[6]!==p?(f=s.jsx("span",{className:"flex-1 truncate",children:p}),e[6]=p,e[7]=f):f=e[7];const y=x&&"rotate-180";let g;e[8]!==y?(g=De("shrink-0 text-muted-foreground/70 transition-transform",y),e[8]=y,e[9]=g):g=e[9];let v;e[10]!==g?(v=s.jsx(qt,{size:16,className:g}),e[10]=g,e[11]=v):v=e[11];let S;e[12]!==f||e[13]!==v?(S=s.jsxs(Fo,{className:d,children:[h,f,v]}),e[12]=f,e[13]=v,e[14]=S):S=e[14];let k;e[15]!==l?(k=l("sandbox.collectionsSidebar.sections"),e[15]=l,e[16]=k):k=e[16];const C=n==="sections";let w;e[17]!==o.sections||e[18]!==c||e[19]!==k||e[20]!==C?(w=s.jsx(Le,{id:"sections",icon:Vt,label:k,count:o.sections,active:C,onSelect:c,indent:!0}),e[17]=o.sections,e[18]=c,e[19]=k,e[20]=C,e[21]=w):w=e[21];let U;e[22]!==l?(U=l("sandbox.collectionsSidebar.apps"),e[22]=l,e[23]=U):U=e[23];const T=n==="apps";let j;e[24]!==o.apps||e[25]!==c||e[26]!==U||e[27]!==T?(j=s.jsx(Le,{id:"apps",icon:zs,label:U,count:o.apps,active:T,onSelect:c,indent:!0}),e[24]=o.apps,e[25]=c,e[26]=U,e[27]=T,e[28]=j):j=e[28];let I;e[29]!==l?(I=l("sandbox.collectionsSidebar.loaders"),e[29]=l,e[30]=I):I=e[30];const M=n==="loaders";let F;e[31]!==o.loaders||e[32]!==c||e[33]!==I||e[34]!==M?(F=s.jsx(Le,{id:"loaders",icon:Is,label:I,count:o.loaders,active:M,onSelect:c,indent:!0}),e[31]=o.loaders,e[32]=c,e[33]=I,e[34]=M,e[35]=F):F=e[35];let D;e[36]!==l?(D=l("sandbox.collectionsSidebar.actions"),e[36]=l,e[37]=D):D=e[37];const z=n==="actions";let K;e[38]!==o.actions||e[39]!==c||e[40]!==D||e[41]!==z?(K=s.jsx(Le,{id:"actions",icon:Xs,label:D,count:o.actions,active:z,onSelect:c,indent:!0}),e[38]=o.actions,e[39]=c,e[40]=D,e[41]=z,e[42]=K):K=e[42];let _;e[43]!==w||e[44]!==j||e[45]!==F||e[46]!==K?(_=s.jsxs(Ko,{className:"flex flex-col gap-0.5 pt-0.5",children:[w,j,F,K]}),e[43]=w,e[44]=j,e[45]=F,e[46]=K,e[47]=_):_=e[47];let $;return e[48]!==x||e[49]!==_||e[50]!==S?($=s.jsxs(Io,{open:x,onOpenChange:u,children:[S,_]}),e[48]=x,e[49]=_,e[50]=S,e[51]=$):$=e[51],$}function Le(t){const e=je.c(19),{id:n,icon:o,label:c,count:l,active:i,onSelect:r,indent:a}=t;let u;e[0]!==n||e[1]!==r?(u=()=>r(n),e[0]=n,e[1]=r,e[2]=u):u=e[2];const x=a&&"pl-6",d=i?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let h;e[3]!==x||e[4]!==d?(h=De("flex w-full items-center gap-2 classic:rounded-md compact:rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",x,d),e[3]=x,e[4]=d,e[5]=h):h=e[5];let p;e[6]!==o?(p=s.jsx(o,{size:16,className:"shrink-0"}),e[6]=o,e[7]=p):p=e[7];let f;e[8]!==c?(f=s.jsx("span",{className:"flex-1 truncate",children:c}),e[8]=c,e[9]=f):f=e[9];let y;e[10]!==i||e[11]!==l?(y=l!==void 0&&s.jsx("span",{className:De("shrink-0 text-xs tabular-nums",i?"text-accent-foreground/70":"text-muted-foreground/70"),children:l}),e[10]=i,e[11]=l,e[12]=y):y=e[12];let g;return e[13]!==u||e[14]!==h||e[15]!==p||e[16]!==f||e[17]!==y?(g=s.jsxs("button",{type:"button",onClick:u,className:h,children:[p,f,y]}),e[13]=u,e[14]=h,e[15]=p,e[16]=f,e[17]=y,e[18]=g):g=e[18],g}function vl(t){const e=je.c(12),{state:n,claimPhase:o,lifecycle:c,onStart:l,connectionsHref:i}=t;switch(n.kind){case"starting":{let r;e[0]!==o||e[1]!==c?(r=Xn({claimPhase:o,lifecycle:c}),e[0]=o,e[1]=c,e[2]=r):r=e[2];let a;return e[3]!==o||e[4]!==r?(a=s.jsx($t,{kind:"starting",progress:r,claimPhase:o}),e[3]=o,e[4]=r,e[5]=a):a=e[5],a}case"suspended":{let r;return e[6]!==l?(r=s.jsx($t,{kind:"suspended",onResume:l}),e[6]=l,e[7]=r):r=e[7],r}case"errored":{let r;return e[8]!==i||e[9]!==l||e[10]!==n.error?(r=s.jsx($t,{kind:"errored",error:n.error,onRetry:l,connectionsHref:i}),e[8]=i,e[9]=l,e[10]=n.error,e[11]=r):r=e[11],r}}}const Sl=new Set(["clone-failed","install-failed","start-failed","crashed"]);function kl(t){if(t.fastPreviewActive)return{kind:"ready",devServerReady:!1,sandboxWarming:!1};if(t.previewState.kind!=="iframe")return{kind:"sandbox-card",state:t.previewState};const e=t.lifecyclePhase==="running",n=!e&&!Sl.has(t.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:n}}function ps(t,e){const n=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),o=`${n} (copy)`;if(!t.has(o))return o;for(let c=2;c<1e3;c++){const l=`${n} (copy ${c})`;if(!t.has(l))return l}return`${n} (copy ${Date.now()})`}function jl(t,e){const n=Ct,o=e.replace(/-copy(?:-\d+)?$/,""),c=`${o}-copy`;if(!t.has(n(c)))return c;for(let l=2;l<1e3;l++){const i=`${o}-copy-${l}`;if(!t.has(n(i)))return i}return`${o}-copy-${Date.now()}`}function Cl(t,e){const n=e.replace(/_copy(?:_\d+)?$/,""),o=`${n}_copy`;if(!Object.hasOwn(t,o))return o;for(let c=2;c<1e3;c++){const l=`${n}_copy_${c}`;if(!Object.hasOwn(t,l))return l}return`${n}_copy_${Date.now()}`}function wl(t){const e=Gs(t.newName),n={...t.source,name:t.newName,path:t.newPath};return{key:e,data:n}}function Nl(t,e){return Zn(t,e)}const Pl=1e3;function Tl(t,e){for(let n=0;n<Pl;n++){const o=Gs(e);if(!Object.hasOwn(t,o))return o}throw new Error("Could not generate a unique page block key")}const _l={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},El={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},Dl={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function Al(t){const e=je.c(88),{open:n,mode:o,initialName:c,initialPath:l,isPending:i,error:r,templates:a,validate:u,onSubmit:x,onOpenChange:d}=t,h=i===void 0?!1:i,p=Be(),[f,y]=G.useState(c),[g,v]=G.useState(l),[S,k]=G.useState(Lt),[C,w]=G.useState(null),[U,T]=G.useState(n);n!==U&&(T(n),n&&(y(c),v(l),k(Lt),w(null)));const j=o==="create"&&!!a?.length;let I;e[0]!==h||e[1]!==d?(I=me=>{!me&&!h&&(w(null),d(!1))},e[0]=h,e[1]=d,e[2]=I):I=e[2];const M=I;let F;e[3]!==h||e[4]!==f||e[5]!==x||e[6]!==g||e[7]!==j||e[8]!==S||e[9]!==u?(F=async me=>{me.preventDefault();const fe=f.trim(),be=g.trim();if(!fe||!be||h)return;const ne=Po(be);if(ne){w(ne);return}const pe=u?.({name:fe,path:be});if(pe){w(pe);return}w(null),await x({name:fe,path:be,templateKey:j&&S!==Lt?S:null})},e[3]=h,e[4]=f,e[5]=x,e[6]=g,e[7]=j,e[8]=S,e[9]=u,e[10]=F):F=e[10];const D=F,z=C??r,K=_l[o];let _;e[11]!==p||e[12]!==K?(_=p(K),e[11]=p,e[12]=K,e[13]=_):_=e[13];let $;e[14]!==_?($=s.jsx(Qt,{children:s.jsx(Xt,{children:_})}),e[14]=_,e[15]=$):$=e[15];let V;e[16]!==h||e[17]!==j||e[18]!==p||e[19]!==S||e[20]!==a?(V=j&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"page-form-template",className:"text-xs font-medium text-muted-foreground",children:p("sandbox.pageFormDialog.labelTemplate")}),s.jsx(eo,{id:"page-form-template",value:S,onChange:k,templates:a??[],disabled:h})]}),e[16]=h,e[17]=j,e[18]=p,e[19]=S,e[20]=a,e[21]=V):V=e[21];let A;e[22]!==p?(A=p("sandbox.pageFormDialog.labelName"),e[22]=p,e[23]=A):A=e[23];let H;e[24]!==A?(H=s.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:A}),e[24]=A,e[25]=H):H=e[25];let X;e[26]===Symbol.for("react.memo_cache_sentinel")?(X=me=>y(me.target.value),e[26]=X):X=e[26];let B;e[27]!==p?(B=p("sandbox.pageFormDialog.placeholderName"),e[27]=p,e[28]=B):B=e[28];let J;e[29]!==h||e[30]!==f||e[31]!==B?(J=s.jsx(rt,{id:"page-form-name",value:f,onChange:X,placeholder:B,autoFocus:!0,disabled:h}),e[29]=h,e[30]=f,e[31]=B,e[32]=J):J=e[32];let Y;e[33]!==J||e[34]!==H?(Y=s.jsxs("div",{className:"space-y-1.5",children:[H,J]}),e[33]=J,e[34]=H,e[35]=Y):Y=e[35];let W;e[36]!==p?(W=p("sandbox.pageFormDialog.labelPath"),e[36]=p,e[37]=W):W=e[37];let L;e[38]!==W?(L=s.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:W}),e[38]=W,e[39]=L):L=e[39];let se;e[40]===Symbol.for("react.memo_cache_sentinel")?(se=me=>v(me.target.value),e[40]=se):se=e[40];let re;e[41]!==p?(re=p("sandbox.pageFormDialog.placeholderPath"),e[41]=p,e[42]=re):re=e[42];let le;e[43]!==h||e[44]!==g||e[45]!==re?(le=s.jsx(rt,{id:"page-form-path",value:g,onChange:se,placeholder:re,disabled:h}),e[43]=h,e[44]=g,e[45]=re,e[46]=le):le=e[46];let oe;e[47]!==L||e[48]!==le?(oe=s.jsxs("div",{className:"space-y-1.5",children:[L,le]}),e[47]=L,e[48]=le,e[49]=oe):oe=e[49];let ae;e[50]!==z?(ae=z&&s.jsx("p",{className:"text-xs text-destructive",children:z}),e[50]=z,e[51]=ae):ae=e[51];let ce;e[52]!==Y||e[53]!==oe||e[54]!==ae||e[55]!==V?(ce=s.jsxs("div",{className:"space-y-4 py-4",children:[V,Y,oe,ae]}),e[52]=Y,e[53]=oe,e[54]=ae,e[55]=V,e[56]=ce):ce=e[56];let O;e[57]!==d?(O=()=>d(!1),e[57]=d,e[58]=O):O=e[58];let te;e[59]!==p?(te=p("sandbox.pageFormDialog.buttonCancel"),e[59]=p,e[60]=te):te=e[60];let Z;e[61]!==h||e[62]!==O||e[63]!==te?(Z=s.jsx(Oe,{type:"button",variant:"outline",onClick:O,disabled:h,children:te}),e[61]=h,e[62]=O,e[63]=te,e[64]=Z):Z=e[64];let ee;e[65]!==h||e[66]!==f||e[67]!==g?(ee=!f.trim()||!g.trim()||h,e[65]=h,e[66]=f,e[67]=g,e[68]=ee):ee=e[68];let ie;e[69]!==h||e[70]!==o||e[71]!==p?(ie=h?s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"size-3.5"}),p(Dl[o])]}):p(El[o]),e[69]=h,e[70]=o,e[71]=p,e[72]=ie):ie=e[72];let R;e[73]!==ee||e[74]!==ie?(R=s.jsx(Oe,{type:"submit",disabled:ee,children:ie}),e[73]=ee,e[74]=ie,e[75]=R):R=e[75];let ge;e[76]!==Z||e[77]!==R?(ge=s.jsxs(Zt,{children:[Z,R]}),e[76]=Z,e[77]=R,e[78]=ge):ge=e[78];let E;e[79]!==D||e[80]!==ce||e[81]!==ge||e[82]!==$?(E=s.jsx(es,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:D,children:[$,ce,ge]})}),e[79]=D,e[80]=ce,e[81]=ge,e[82]=$,e[83]=E):E=e[83];let xe;return e[84]!==M||e[85]!==n||e[86]!==E?(xe=s.jsx(ts,{open:n,onOpenChange:M,children:E}),e[84]=M,e[85]=n,e[86]=E,e[87]=xe):xe=e[87],xe}const Bl=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],hs={from:"",to:"",type:"temporary",discardQueryParameters:!1};function $l(t){const e=je.c(111),{open:n,isPending:o,error:c,onSubmit:l,onOpenChange:i}=t,r=o===void 0?!1:o,a=Be(),[u,x]=G.useState(hs),[d,h]=G.useState(null),[p,f]=G.useState(n);n!==p&&(f(n),n&&(x(hs),h(null)));let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=he=>x(Te=>({...Te,...he})),e[0]=y):y=e[0];const g=y;let v;e[1]!==r||e[2]!==i?(v=he=>{!he&&!r&&(h(null),i(!1))},e[1]=r,e[2]=i,e[3]=v):v=e[3];const S=v;let k;e[4]!==r||e[5]!==l||e[6]!==u||e[7]!==a?(k=async he=>{he.preventDefault();const Te=u.from.trim(),$e=u.to.trim();if(!Te||!$e||r){h(a("sandbox.redirectFormDialog.errorRequired"));return}h(null),await l({...u,from:Te,to:$e})},e[4]=r,e[5]=l,e[6]=u,e[7]=a,e[8]=k):k=e[8];const C=k,w=d??c;let U;e[9]!==r||e[10]!==u.from||e[11]!==u.to?(U=!!u.from.trim()&&!!u.to.trim()&&!r,e[9]=r,e[10]=u.from,e[11]=u.to,e[12]=U):U=e[12];const T=U;let j;e[13]!==a?(j=a("sandbox.redirectFormDialog.title"),e[13]=a,e[14]=j):j=e[14];let I;e[15]!==j?(I=s.jsx(Qt,{children:s.jsx(Xt,{children:j})}),e[15]=j,e[16]=I):I=e[16];let M;e[17]!==a?(M=a("sandbox.redirectEditor.fromLabel"),e[17]=a,e[18]=M):M=e[18];let F;e[19]!==M?(F=s.jsx(Ot,{htmlFor:"redirect-form-from",children:M}),e[19]=M,e[20]=F):F=e[20];const D=u.from;let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=he=>g({from:he.target.value}),e[21]=z):z=e[21];let K;e[22]!==a?(K=a("sandbox.redirectEditor.fromPlaceholder"),e[22]=a,e[23]=K):K=e[23];let _;e[24]!==r||e[25]!==u.from||e[26]!==K?(_=s.jsx(rt,{id:"redirect-form-from",value:D,onChange:z,placeholder:K,autoFocus:!0,disabled:r}),e[24]=r,e[25]=u.from,e[26]=K,e[27]=_):_=e[27];let $;e[28]!==_||e[29]!==F?($=s.jsxs("div",{className:"space-y-1.5",children:[F,_]}),e[28]=_,e[29]=F,e[30]=$):$=e[30];let V;e[31]!==a?(V=a("sandbox.redirectEditor.toLabel"),e[31]=a,e[32]=V):V=e[32];let A;e[33]!==V?(A=s.jsx(Ot,{htmlFor:"redirect-form-to",children:V}),e[33]=V,e[34]=A):A=e[34];const H=u.to;let X;e[35]===Symbol.for("react.memo_cache_sentinel")?(X=he=>g({to:he.target.value}),e[35]=X):X=e[35];let B;e[36]!==a?(B=a("sandbox.redirectEditor.toPlaceholder"),e[36]=a,e[37]=B):B=e[37];let J;e[38]!==r||e[39]!==u.to||e[40]!==B?(J=s.jsx(rt,{id:"redirect-form-to",value:H,onChange:X,placeholder:B,disabled:r}),e[38]=r,e[39]=u.to,e[40]=B,e[41]=J):J=e[41];let Y;e[42]!==A||e[43]!==J?(Y=s.jsxs("div",{className:"space-y-1.5",children:[A,J]}),e[42]=A,e[43]=J,e[44]=Y):Y=e[44];let W;e[45]!==a?(W=a("sandbox.redirectEditor.typeLabel"),e[45]=a,e[46]=W):W=e[46];let L;e[47]!==W?(L=s.jsx(Ot,{htmlFor:"redirect-form-type",children:W}),e[47]=W,e[48]=L):L=e[48];const se=u.type;let re;e[49]===Symbol.for("react.memo_cache_sentinel")?(re=he=>g({type:he}),e[49]=re):re=e[49];let le;e[50]!==a?(le=a("sandbox.redirectEditor.typePlaceholder"),e[50]=a,e[51]=le):le=e[51];let oe;e[52]!==le?(oe=s.jsx(Ho,{id:"redirect-form-type",className:"w-full",children:s.jsx(Jo,{placeholder:le})}),e[52]=le,e[53]=oe):oe=e[53];let ae;e[54]!==a?(ae=Bl.map(he=>s.jsx(Go,{value:he.value,children:a(he.labelKey,{status:Qs[he.value]})},he.value)),e[54]=a,e[55]=ae):ae=e[55];let ce;e[56]!==ae?(ce=s.jsx(Wo,{children:ae}),e[56]=ae,e[57]=ce):ce=e[57];let O;e[58]!==r||e[59]!==u.type||e[60]!==oe||e[61]!==ce?(O=s.jsxs(Yo,{value:se,onValueChange:re,disabled:r,children:[oe,ce]}),e[58]=r,e[59]=u.type,e[60]=oe,e[61]=ce,e[62]=O):O=e[62];let te;e[63]!==L||e[64]!==O?(te=s.jsxs("div",{className:"space-y-1.5",children:[L,O]}),e[63]=L,e[64]=O,e[65]=te):te=e[65];let Z;e[66]===Symbol.for("react.memo_cache_sentinel")?(Z=he=>g({discardQueryParameters:he===!0}),e[66]=Z):Z=e[66];let ee;e[67]!==r||e[68]!==u.discardQueryParameters?(ee=s.jsx(ss,{checked:u.discardQueryParameters,disabled:r,onCheckedChange:Z}),e[67]=r,e[68]=u.discardQueryParameters,e[69]=ee):ee=e[69];let ie;e[70]!==a?(ie=a("sandbox.redirectEditor.discardQueryParameters"),e[70]=a,e[71]=ie):ie=e[71];let R;e[72]!==ie?(R=s.jsx("span",{className:"text-sm",children:ie}),e[72]=ie,e[73]=R):R=e[73];let ge;e[74]!==ee||e[75]!==R?(ge=s.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[ee,R]}),e[74]=ee,e[75]=R,e[76]=ge):ge=e[76];let E;e[77]!==w?(E=w&&s.jsx("p",{className:"text-xs text-destructive",children:w}),e[77]=w,e[78]=E):E=e[78];let xe;e[79]!==$||e[80]!==Y||e[81]!==te||e[82]!==ge||e[83]!==E?(xe=s.jsxs("div",{className:"space-y-4 py-4",children:[$,Y,te,ge,E]}),e[79]=$,e[80]=Y,e[81]=te,e[82]=ge,e[83]=E,e[84]=xe):xe=e[84];let me;e[85]!==i?(me=()=>i(!1),e[85]=i,e[86]=me):me=e[86];let fe;e[87]!==a?(fe=a("sandbox.redirectFormDialog.cancel"),e[87]=a,e[88]=fe):fe=e[88];let be;e[89]!==r||e[90]!==me||e[91]!==fe?(be=s.jsx(Oe,{type:"button",variant:"outline",onClick:me,disabled:r,children:fe}),e[89]=r,e[90]=me,e[91]=fe,e[92]=be):be=e[92];const ne=!T;let pe;e[93]!==r||e[94]!==a?(pe=r?s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"size-3.5"}),a("sandbox.redirectFormDialog.pending")]}):a("sandbox.redirectFormDialog.submit"),e[93]=r,e[94]=a,e[95]=pe):pe=e[95];let Ce;e[96]!==ne||e[97]!==pe?(Ce=s.jsx(Oe,{type:"submit",disabled:ne,children:pe}),e[96]=ne,e[97]=pe,e[98]=Ce):Ce=e[98];let we;e[99]!==be||e[100]!==Ce?(we=s.jsxs(Zt,{children:[be,Ce]}),e[99]=be,e[100]=Ce,e[101]=we):we=e[101];let Ne;e[102]!==C||e[103]!==xe||e[104]!==we||e[105]!==I?(Ne=s.jsx(es,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:C,children:[I,xe,we]})}),e[102]=C,e[103]=xe,e[104]=we,e[105]=I,e[106]=Ne):Ne=e[106];let Se;return e[107]!==S||e[108]!==n||e[109]!==Ne?(Se=s.jsx(ts,{open:n,onOpenChange:S,children:Ne}),e[107]=S,e[108]=n,e[109]=Ne,e[110]=Se):Se=e[110],Se}function Ll(t){const e=je.c(70),{open:n,blockKey:o,initialName:c,isPending:l,onSubmit:i,onOpenChange:r}=t,a=l===void 0?!1:l,u=Be(),[x,d]=G.useState(c),[h,p]=G.useState(n);n!==h&&(p(n),n&&d(c));let f;e[0]!==a||e[1]!==r?(f=se=>{!se&&!a&&r(!1)},e[0]=a,e[1]=r,e[2]=f):f=e[2];const y=f;let g;e[3]!==a||e[4]!==x||e[5]!==i?(g=async se=>{se.preventDefault();const re=x.trim();!re||a||await i(re)},e[3]=a,e[4]=x,e[5]=i,e[6]=g):g=e[6];const v=g;let S;e[7]!==u?(S=u("sandbox.sectionRenameDialog.title"),e[7]=u,e[8]=S):S=e[8];let k;e[9]!==S?(k=s.jsx(Xt,{children:S}),e[9]=S,e[10]=k):k=e[10];let C;e[11]!==u?(C=u("sandbox.sectionRenameDialog.description"),e[11]=u,e[12]=C):C=e[12];let w;e[13]!==C?(w=s.jsx(Uo,{children:C}),e[13]=C,e[14]=w):w=e[14];let U;e[15]!==k||e[16]!==w?(U=s.jsxs(Qt,{children:[k,w]}),e[15]=k,e[16]=w,e[17]=U):U=e[17];let T;e[18]!==u?(T=u("sandbox.sectionRenameDialog.nameLabel"),e[18]=u,e[19]=T):T=e[19];let j;e[20]!==T?(j=s.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:T}),e[20]=T,e[21]=j):j=e[21];let I;e[22]===Symbol.for("react.memo_cache_sentinel")?(I=se=>d(se.target.value),e[22]=I):I=e[22];let M;e[23]!==a||e[24]!==x?(M=s.jsx(rt,{id:"section-rename-name",value:x,onChange:I,autoFocus:!0,disabled:a}),e[23]=a,e[24]=x,e[25]=M):M=e[25];let F;e[26]!==j||e[27]!==M?(F=s.jsxs("div",{className:"space-y-1.5",children:[j,M]}),e[26]=j,e[27]=M,e[28]=F):F=e[28];let D;e[29]!==u?(D=u("sandbox.sectionRenameDialog.keyLabel"),e[29]=u,e[30]=D):D=e[30];let z;e[31]!==D?(z=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:D}),e[31]=D,e[32]=z):z=e[32];let K;e[33]!==o?(K=s.jsx(rt,{value:o,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=o,e[34]=K):K=e[34];let _;e[35]!==z||e[36]!==K?(_=s.jsxs("div",{className:"space-y-1.5",children:[z,K]}),e[35]=z,e[36]=K,e[37]=_):_=e[37];let $;e[38]!==F||e[39]!==_?($=s.jsxs("div",{className:"space-y-4 py-4",children:[F,_]}),e[38]=F,e[39]=_,e[40]=$):$=e[40];let V;e[41]!==r?(V=()=>r(!1),e[41]=r,e[42]=V):V=e[42];let A;e[43]!==u?(A=u("sandbox.sectionRenameDialog.cancel"),e[43]=u,e[44]=A):A=e[44];let H;e[45]!==a||e[46]!==V||e[47]!==A?(H=s.jsx(Oe,{type:"button",variant:"outline",onClick:V,disabled:a,children:A}),e[45]=a,e[46]=V,e[47]=A,e[48]=H):H=e[48];let X;e[49]!==a||e[50]!==x?(X=!x.trim()||a,e[49]=a,e[50]=x,e[51]=X):X=e[51];let B;e[52]!==a||e[53]!==u?(B=a?s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"size-3.5"}),u("sandbox.sectionRenameDialog.saving")]}):u("sandbox.sectionRenameDialog.save"),e[52]=a,e[53]=u,e[54]=B):B=e[54];let J;e[55]!==X||e[56]!==B?(J=s.jsx(Oe,{type:"submit",disabled:X,children:B}),e[55]=X,e[56]=B,e[57]=J):J=e[57];let Y;e[58]!==H||e[59]!==J?(Y=s.jsxs(Zt,{children:[H,J]}),e[58]=H,e[59]=J,e[60]=Y):Y=e[60];let W;e[61]!==v||e[62]!==$||e[63]!==Y||e[64]!==U?(W=s.jsx(es,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:v,children:[U,$,Y]})}),e[61]=v,e[62]=$,e[63]=Y,e[64]=U,e[65]=W):W=e[65];let L;return e[66]!==y||e[67]!==n||e[68]!==W?(L=s.jsx(ts,{open:n,onOpenChange:y,children:W}),e[66]=y,e[67]=n,e[68]=W,e[69]=L):L=e[69],L}function Ol(t){const e=je.c(7),{type:n}=t,o=Qs[n];let c;e[0]!==o?(c=s.jsx(Ie,{asChild:!0,children:s.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-muted-foreground",children:o})}),e[0]=o,e[1]=c):c=e[1];const l=n==="permanent"?"Permanent":"Temporary";let i;e[2]!==l?(i=s.jsx(Me,{side:"left",children:l}),e[2]=l,e[3]=i):i=e[3];let r;return e[4]!==c||e[5]!==i?(r=s.jsxs(ze,{children:[c,i]}),e[4]=c,e[5]=i,e[6]=r):r=e[6],r}const Rt={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},os=["posts","authors","categories"],yt={posts:"post",authors:"author",categories:"category"};function qe(t){return os.includes(t)}const ls={posts:"post",authors:"author",categories:"category"},an={posts:Rt.post,authors:Rt.author,categories:Rt.category},Rl=Object.fromEntries(Object.entries(an).map(([t,e])=>[e,t]));function Fl(t){return typeof t=="string"?Rl[t]??null:null}function Je(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Pe(t){return typeof t=="string"?t:""}function Kl(t,e){switch(t){case"posts":return{label:Pe(e.title)||"Untitled post",subtitle:Pe(e.slug)};case"authors":return{label:Pe(e.name)||"Unnamed author",subtitle:Pe(e.email)};case"categories":return{label:Pe(e.name)||"Unnamed category",subtitle:Pe(e.slug)};default:{const n=t;throw new Error(`Unhandled blog kind: ${String(n)}`)}}}function rn(t){const e={posts:[],authors:[],categories:[]};for(const[n,o]of Object.entries(t)){const c=Je(o);if(!c)continue;const l=Fl(c.__resolveType);if(!l)continue;const i=Je(c[ls[l]])??{},{label:r,subtitle:a}=Kl(l,i);e[l].push({key:n,kind:l,label:r,subtitle:a})}for(const n of os)e[n].sort((o,c)=>o.label.localeCompare(c.label));return e}function Il(t,e){return rn(t)[e]}function vt(t,e){return Il(t,e).map(n=>({key:n.key,payload:xt(Je(t[n.key])??void 0,e)}))}const gs=Object.freeze({});function xt(t,e){return t?Je(t[ls[e]])??gs:gs}function it(t,e,n){return{name:t,__resolveType:an[e],[ls[e]]:n}}function Hi({records:t,selected:e,valueField:n,toRef:o}){const c=Array.isArray(e)?e:[],l=h=>typeof h=="string"?h:Pe(Je(h)?.[n]),i=h=>typeof h=="string"?h:Pe(Je(h)?.name),r=h=>{const p=l(h),f=p?t.find(({payload:g})=>Pe(g[n])===p):void 0;if(f)return f;const y=i(h);return y?t.find(({payload:g})=>Pe(g.name)===y):void 0},a=t.map(({key:h,payload:p})=>({value:h,label:Pe(p.name)||Pe(p[n])||h})),u=new Map,x=[];return c.forEach((h,p)=>{const f=r(h);if(f){x.includes(f.key)||x.push(f.key);return}const y=`unresolved:${p}`;u.set(y,h),x.push(y),a.push({value:y,label:i(h)||l(h)||"Unknown"})}),{options:a,selectedValues:x,refsForValues:h=>h.map(p=>{const f=t.find(y=>y.key===p);return f?o(f.payload):u.get(p)}).filter(p=>p!==void 0)}}function Ze(t){return Array.isArray(t)?t:[]}function Ke(t){if(typeof t=="string")return t;const e=Je(t);return e?Pe(e.slug):""}function Ml(t){if(typeof t=="string")return t;const e=Je(t);return e?Pe(e.email):""}function cn(t){const e=[];return Pe(t.title).trim()||e.push("Title"),Pe(t.slug).trim()||e.push("Slug"),Ze(t.categories).map(Ke).filter(Boolean).length===0&&e.push("Category"),Pe(t.excerpt).trim()||e.push("Excerpt"),Pe(t.image).trim()||e.push("Cover image"),e}const dn=8;function un(t){const e=Pe(t.status);return e===""||e==="published"?"published":e==="scheduled"?"scheduled":"draft"}function Ji(t,e){return e!=="published"||un(t)==="published"?!1:cn(t).length>0}function zl(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1,dn).toISOString()}function Wi(t,e,n){if(e!=="scheduled")return{...t,status:e,scheduledDatetime:""};const o=Pe(t.scheduledDatetime);return{...t,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(o).getTime())?zl(n):o}}function mn(t){return vt(t,"posts").map(({key:e,payload:n})=>({key:e,title:Pe(n.title)||"Untitled post",slug:Pe(n.slug),date:Pe(n.date),scheduledDatetime:Pe(n.scheduledDatetime),categorySlugs:Ze(n.categories).map(Ke).filter(Boolean),authorEmails:Ze(n.authors).map(Ml).filter(Boolean),missing:cn(n),status:un(n)}))}function Vl(t,e){const n=Ze(t.categories);return n.some(o=>Ke(o)===e.slug)?t:{...t,categories:[...n,{name:e.name,slug:e.slug}]}}function Ul(t,e){const n=Ze(t.categories);return n.length===1&&Ke(n[0])===e.slug?t:{...t,categories:[{name:e.name,slug:e.slug}]}}function Yi(t,e,n){const o=Ze(t.categories);if(!o.some(r=>Ke(r)===e))return t;const c=o.map(r=>{const a=Ke(r);return a===e||a===n.slug?{name:n.name,slug:n.slug}:r}),l=new Set,i=c.filter(r=>{const a=Ke(r);return a?l.has(a)?!1:(l.add(a),!0):!0});return{...t,categories:i}}function Gl(t,e){const n=Ze(t.categories);return n.some(o=>Ke(o)===e)?{...t,categories:n.filter(o=>Ke(o)!==e)}:t}function xs(t){return{...t,dateModified:new Date().toISOString()}}function Gt(t){const e=new Uint8Array(Math.ceil(t/2));return crypto.getRandomValues(e),Array.from(e,n=>n.toString(16).padStart(2,"0")).join("").slice(0,t)}function Ft(t,e){const n=`collections/blog/${e}/${Gt(12)}`;if(!Object.hasOwn(t,n))return n;throw new Error("Could not generate a unique blog block key")}function fn(t){switch(t){case"posts":return{title:"Untitled post",excerpt:"",slug:`untitled-${Gt(8)}`,date:new Date().toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[]};case"authors":return{name:"New author",type:"Person",email:"",jobTitle:"",company:"",avatar:""};case"categories":return{name:"New category",slug:`category-${Gt(8)}`,description:"",sections:[]};default:{const e=t;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const Hl={Paragraph:{title:"Paragraph",description:"Rich text content",iconName:"Pilcrow01"},Heading:{title:"Heading",description:"Section title (H1–H6)",iconName:"HeadingSquare"},Quote:{title:"Quote",description:"Pull quote",iconName:"MessageTextSquare02"},Code:{title:"Code",description:"Code block with syntax highlighting",iconName:"Code02"},List:{title:"List",description:"Bulleted or numbered list",iconName:"List"},BlockImage:{title:"Image",description:"Image with optional caption",iconName:"Image01"},Video:{title:"Video",description:"Embedded video",iconName:"PlayCircle"},Divider:{title:"Divider",description:"Horizontal divider",iconName:"Divider"},Cta:{title:"Call to action",description:"Button linking to a URL",iconName:"CursorClick01"},Callout:{title:"Callout",description:"Highlighted note, tip or warning",iconName:"Lightbulb02"},Stat:{title:"Stat",description:"Single key metric",iconName:"BarChartSquareUp"},StatGroup:{title:"Stat group",description:"Row of metrics",iconName:"BarChartSquare02"},CardGroup:{title:"Card group",description:"Grid of cards",iconName:"LayoutGrid01"},Checklist:{title:"Checklist",description:"List of check items",iconName:"CheckSquare"},Steps:{title:"Steps",description:"Step-by-step guide",iconName:"LayersThree01"},Comparison:{title:"Comparison",description:"Side-by-side comparison",iconName:"Columns03"},Table:{title:"Table",description:"Rows and columns of structured data",iconName:"Table"},ProductCard:{title:"Product card",description:"Single product",iconName:"Tag01"},ProductShelf:{title:"Product shelf",description:"Row of products",iconName:"ShoppingBag01"}},bs="Box";function Jl(t){return t.startsWith("site/")?"site":"app"}function Wl(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||t.startsWith("/")}function ht(...t){for(const e of t)if(e!==void 0)return e}function qi(t){const e=new Set,n=[],o=t.manifest?.blocks??{};for(const c of Object.values(o))for(const l of Object.keys(c)){if(!Ql(l)||e.has(l))continue;e.add(l);const i=Wt(l,t),r=Yl(l),a=Hl[r],u=Jl(l),x=(u==="site"?ht(i.title,a?.title):ht(a?.title,i.title))??r,d=u==="site"?ht(i.description,a?.description):ht(a?.description,i.description),h=u==="site"?i.icon:void 0,p=h&&Wl(h)?h:void 0,f=p!==void 0?a?.iconName??bs:ht(h,a?.iconName)??bs;n.push({resolveType:l,title:x,description:d,iconName:f,iconUrl:p,source:u})}return n.sort((c,l)=>c.title.localeCompare(l.title))}function Yl(t){return(t.split("/").pop()??t).replace(/\.(tsx?|jsx?)$/,"")}const ql=["blog/sections/blocks/","site/sections/Blog/Post/"];function Ql(t){return ql.some(e=>t.startsWith(e))}const Qi=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Xi=["January","February","March","April","May","June","July","August","September","October","November","December"],pn=1440*60*1e3;function Xe(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function Zi(t){return new Date(t.getFullYear(),t.getMonth(),1)}function er(t,e){return new Date(t.getFullYear(),t.getMonth()+e,1)}function Nt(t,e){const n=new Date(t);return n.setDate(n.getDate()+e),n}function Ht(t,e){return Math.round((Xe(t).getTime()-Xe(e).getTime())/pn)}function Xl(t){const e=(t.getTime()-Xe(t).getTime())/pn;return Math.min(Math.max(e,0),1)}function ys(t,e){return Ht(t,e)+Xl(t)}function tr(t){const e=Nt(t,-t.getDay()),n=[];for(let o=0;o<6;o++){const c=[];for(let l=0;l<7;l++)c.push(Nt(e,o*7+l));n.push(c)}for(;n.length>0&&n[n.length-1].every(o=>o.getMonth()!==t.getMonth());)n.pop();return n}function sr(t,e){const n=Xe(t[0]),o=Nt(n,7),c=n.getTime(),l=o.getTime(),i=[];for(const u of e){const x=Xe(u.start),d=Xe(u.end);if(d.getTime()<n.getTime()||x.getTime()>=o.getTime())continue;const h=x.getTime()<n.getTime()?n:x,p=d.getTime()>=o.getTime()?Nt(o,-1):d,f=Ht(h,n),y=Ht(p,h)+1;if(y<=0)continue;const g=Math.max(u.start.getTime(),c),v=Math.min(u.end.getTime(),l),S=ys(new Date(g),n),k=Math.max(ys(new Date(v),n)-S,0);k<=0||i.push({variant:u,startCol:f,span:y,leftUnits:S,widthUnits:k})}i.sort((u,x)=>u.startCol-x.startCol||x.span-u.span||u.variant.blockKey.localeCompare(x.variant.blockKey));const r=[],a=[];for(const u of i){let x=r.findIndex(d=>d<=u.startCol);x===-1&&(x=r.length,r.push(0)),r[x]=u.startCol+u.span,a.push({...u,lane:x})}return a}function Pt(t){const e=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${t.getFullYear()}-${e}-${n}`}const hn=/^(\d{4})-(\d{2})-(\d{2})$/;function Tt(t){const e=t.trim();if(!e)return null;const n=hn.exec(e);if(n){const c=Number(n[1]),l=Number(n[2])-1,i=Number(n[3]),r=new Date(c,l,i);return r.getMonth()===l&&r.getDate()===i?r:null}const o=new Date(e);return Number.isNaN(o.getTime())?null:Xe(o)}function Zl(t){const e=new Date(t.getFullYear(),t.getMonth(),t.getDate(),dn);return{...fn("posts"),status:"scheduled",scheduledDatetime:e.toISOString(),date:Pt(t)}}function ea(t){if(typeof t!="string")return null;const e=t.trim();if(!e)return null;if(hn.test(e))return Tt(e);const n=new Date(e);return Number.isNaN(n.getTime())?null:n}function ta(t,e){const n=ea(t.scheduledDatetime);if(!n)return null;const o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),c={...t,scheduledDatetime:o.toISOString()};return(typeof t.date=="string"?t.date:"")===Pt(n)&&(c.date=Pt(o)),c}function sa(t){return Tt(t.scheduledDatetime)??Tt(t.date)}function nr(t){const e=new Map,n=[];for(const c of t){const l={post:c,scheduled:Tt(c.scheduledDatetime)!==null},i=sa(c);if(!i){n.push(l);continue}const r=Pt(i),a=e.get(r);a?a.push(l):e.set(r,[l])}const o=(c,l)=>Number(l.scheduled)-Number(c.scheduled)||c.post.title.localeCompare(l.post.title);for(const c of e.values())c.sort(o);return n.sort(o),{byDay:e,undated:n}}const na="0.161.0",oa="0.162.0",or="deno task update";function vs(t){const e=/^v?(\d+)\.(\d+)\.(\d+)$/.exec(t.trim());return e?[Number(e[1]),Number(e[2]),Number(e[3])]:null}function Ss(t,e){const n=vs(t),o=vs(e);if(!n||!o)return 0;for(let c=0;c<3;c++){const l=n[c]-o[c];if(l!==0)return l}return 0}const gn=/deco-cx\/apps@v?(\d+\.\d+\.\d+)/;function la(t){const e=t?.imports;if(!e||typeof e!="object")return null;for(const n of Object.values(e)){if(typeof n!="string")continue;const o=gn.exec(n)?.[1];if(o)return o}return null}function aa(t){const e=t?.schema?.definitions;if(!e||typeof e!="object")return null;for(const n of Object.values(e)){const o=n?.title;if(typeof o!="string")continue;const c=gn.exec(o)?.[1];if(c)return c}return null}function ia(t){if(t.packageManager!=="deno")return{kind:"unsupported-runtime"};const e=la(t.denoJson)??aa(t.meta);return!e||Ss(e,na)<0?{kind:"outdated",version:e}:Ss(e,oa)<0?{kind:"publish-only",version:e}:{kind:"full",version:e}}function lr(t){return t.kind==="publish-only"||t.kind==="full"}function ar(t){return t.kind==="full"}function ra(t){const e=je.c(16),n=Zs(t.virtualMcpId)?.metadata?.runtime?.selected??null,o=to(t.virtualMcpId),c=_t()?.taskId??null;let l;e[0]!==t.branch||e[1]!==t.orgSlug||e[2]!==t.virtualMcpId?(l=As.denoJson(t.orgSlug,t.virtualMcpId,t.branch),e[0]=t.branch,e[1]=t.orgSlug,e[2]=t.virtualMcpId,e[3]=l):l=e[3];let i;e[4]!==o||e[5]!==t||e[6]!==c?(i=async()=>{const h=await so({...t,threadId:c},no(o,"deno.json"));return h.kind==="data"?h.data:null},e[4]=o,e[5]=t,e[6]=c,e[7]=i):i=e[7];const r=n==="deno";let a;e[8]!==l||e[9]!==i||e[10]!==r?(a={queryKey:l,queryFn:i,enabled:r,staleTime:3e5},e[8]=l,e[9]=i,e[10]=r,e[11]=a):a=e[11];const{data:u}=Ds(a),x=u??null;let d;return e[12]!==n||e[13]!==t.meta||e[14]!==x?(d=ia({packageManager:n,denoJson:x,meta:t.meta}),e[12]=n,e[13]=t.meta,e[14]=x,e[15]=d):d=e[15],d}function Re(t){const e=je.c(46),{icon:n,logoUrl:o,title:c,subtitle:l,active:i,accent:r,variantCount:a,trailing:u,selectable:x,selectionActive:d,selected:h,invalid:p,invalidReason:f,onToggleSelect:y,onClick:g,menu:v}=t,S=Be(),k=r==="global";let C;e[0]!==n||e[1]!==i||e[2]!==k||e[3]!==o||e[4]!==a?(C=a&&a>1?s.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center",children:s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx(n,{size:16,className:"shrink-0 text-success"})}),s.jsxs(Me,{side:"right",children:[a," variants"]})]})}):o?s.jsx("img",{src:o,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):s.jsx("span",{className:De("flex size-8 shrink-0 items-center justify-center rounded-lg",k?"bg-global-section/15":"bg-muted"),children:s.jsx(n,{size:16,className:De("shrink-0",!k&&(i?"text-accent-foreground":"text-muted-foreground")),style:k?{color:Yt}:void 0})}),e[0]=n,e[1]=i,e[2]=k,e[3]=o,e[4]=a,e[5]=C):C=e[5];const w=C,U=i?k?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":k?"hover:bg-global-section/10":"hover:bg-muted";let T;e[6]!==U?(T=De("group relative flex min-w-0 items-center rounded-md transition-colors",U),e[6]=U,e[7]=T):T=e[7];let j;e[8]!==y||e[9]!==x||e[10]!==h||e[11]!==d||e[12]!==S||e[13]!==c?(j=x&&s.jsx("span",{className:De("flex shrink-0 items-center pl-2.5 transition-opacity",h||d?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:ca,children:s.jsx(ss,{checked:h,onCheckedChange:()=>y?.(),"aria-label":S("sandbox.itemRow.selectItem",{title:c})})}),e[8]=y,e[9]=x,e[10]=h,e[11]=d,e[12]=S,e[13]=c,e[14]=j):j=e[14];const I=p&&!i&&"text-destructive";let M;e[15]!==I?(M=De("block truncate text-sm font-medium",I),e[15]=I,e[16]=M):M=e[16];let F;e[17]!==M||e[18]!==c?(F=s.jsx("span",{className:M,children:c}),e[17]=M,e[18]=c,e[19]=F):F=e[19];const D=i?"text-accent-foreground/70":"text-muted-foreground";let z;e[20]!==D?(z=De("block truncate text-xs",D),e[20]=D,e[21]=z):z=e[21];let K;e[22]!==l||e[23]!==z?(K=s.jsx("span",{className:z,children:l}),e[22]=l,e[23]=z,e[24]=K):K=e[24];let _;e[25]!==K||e[26]!==F?(_=s.jsxs("span",{className:"min-w-0 flex-1",children:[F,K]}),e[25]=K,e[26]=F,e[27]=_):_=e[27];let $;e[28]!==i||e[29]!==p||e[30]!==f?($=p&&s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx("span",{className:De("flex shrink-0 items-center",i?"text-accent-foreground":"text-destructive"),children:s.jsx(Ls,{size:14})})}),f&&s.jsx(Me,{side:"bottom",children:f})]}),e[28]=i,e[29]=p,e[30]=f,e[31]=$):$=e[31];let V;e[32]!==g||e[33]!==w||e[34]!==_||e[35]!==$||e[36]!==u?(V=s.jsxs("button",{type:"button",onClick:g,className:"flex min-w-0 flex-1 items-center gap-2.5 classic:rounded-md compact:rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[w,_,$,u]}),e[32]=g,e[33]=w,e[34]=_,e[35]=$,e[36]=u,e[37]=V):V=e[37];let A;e[38]!==i||e[39]!==v?(A=v&&s.jsx("div",{className:De("pr-1 opacity-0 transition-opacity group-hover:opacity-100",i&&"opacity-100"),children:v}),e[38]=i,e[39]=v,e[40]=A):A=e[40];let H;return e[41]!==V||e[42]!==A||e[43]!==T||e[44]!==j?(H=s.jsxs("div",{className:T,children:[j,V,A]}),e[41]=V,e[42]=A,e[43]=T,e[44]=j,e[45]=H):H=e[45],H}function ca(t){return t.stopPropagation()}function He(t){const e=je.c(10),{icon:n,title:o,description:c}=t;let l;e[0]!==n?(l=n&&s.jsx(n,{size:24,className:"text-muted-foreground/60"}),e[0]=n,e[1]=l):l=e[1];let i;e[2]!==o?(i=s.jsx("div",{children:o}),e[2]=o,e[3]=i):i=e[3];let r;e[4]!==c?(r=c&&s.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:c}),e[4]=c,e[5]=r):r=e[5];let a;return e[6]!==l||e[7]!==i||e[8]!==r?(a=s.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-6 text-center text-sm text-muted-foreground",children:[l,i,r]}),e[6]=l,e[7]=i,e[8]=r,e[9]=a):a=e[9],a}const da={loaders:Is,actions:Xs},ua={loaders:"Loaders",actions:"Actions"},ma={analytics:Xo,blog:Rs,commerce:Qo,site:Kn,website:qo};function fa(t,e){return e===0?ma[t.toLowerCase()]??us:us}function kt(t,e){return e===0?ro(t):t}function pa(t){const e=je.c(98),{orgSlug:n,virtualMcpId:o,branch:c,previewUrl:l,meta:i,decofile:r,kind:a}=t,u=Be();let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[0]=x):x=e[0];const[d,h]=G.useState(x),[p,f]=G.useState(null),[y,g]=G.useState(""),[v,S]=G.useState(ka),[k,C]=G.useState(a);k!==a&&(C(a),h([]),f(null),g(""),S(new Set));let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w=W=>{S(L=>{const se=new Set(L);return se.has(W)?se.delete(W):se.add(W),se})},e[1]=w):w=e[1];const U=w;let T;e[2]!==c||e[3]!==n||e[4]!==o?(T={orgSlug:n,virtualMcpId:o,branch:c},e[2]=c,e[3]=n,e[4]=o,e[5]=T):T=e[5];const j=Hs(T);let I;e[6]!==j?(I=Ws((W,L)=>j.mutate({blockKey:W,data:L})),e[6]=j,e[7]=I):I=e[7];const M=I;let F;e[8]!==a?(F=co(a),e[8]=a,e[9]=F):F=e[9];const D=F,z=da[a];let K,_,$,V,A,H,X;if(e[10]!==z||e[11]!==c||e[12]!==r||e[13]!==a||e[14]!==i||e[15]!==v||e[16]!==n||e[17]!==d||e[18]!==l||e[19]!==j||e[20]!==M||e[21]!==y||e[22]!==p||e[23]!==D||e[24]!==u||e[25]!==o){$=Symbol.for("react.early_return_sentinel");e:{const W=[...oo(i,r,a).map(Sa),...lo(i,a).map(va)],L=y.trim().toLowerCase(),se=L.length>0,re=se?W.filter(N=>N.title.toLowerCase().includes(L)||N.resolveType.toLowerCase().includes(L)):[],le=new Map,oe=[],ae=new Map;if(!se){for(const N of W){const de=N.folderPath;if(!(de.length<d.length)&&d.every((ye,Ee)=>de[Ee]===ye))if(de.length===d.length)if(N.savedKey!==void 0){const ye=ae.get(N.resolveType);ye?ye.push(N):ae.set(N.resolveType,[N])}else oe.push(N);else{const ye=de[d.length],Ee=le.get(ye)??{count:0,savedCount:0};N.savedKey!==void 0?Ee.savedCount=Ee.savedCount+1:Ee.count=Ee.count+1,le.set(ye,Ee)}}oe.sort(ya);for(const N of ae.values())N.sort(ba)}const ce=[...ae.entries()].filter(N=>{const[de]=N;return!oe.some(ye=>ye.resolveType===de)}).flatMap(xa).sort(ga);let O;e[33]!==d?(O=(N,de)=>kt(N.name,d.length).localeCompare(kt(de.name,d.length)),e[33]=d,e[34]=O):O=e[34];const te=[...le.entries()].map(ha).sort(O);let Z;e[35]===Symbol.for("react.memo_cache_sentinel")?(Z=N=>{f(N.savedKey!==void 0?{mode:"saved",key:N.savedKey}:{mode:"available",resolveType:N.resolveType,title:N.title})},e[35]=Z):Z=e[35];const ee=Z;let ie;e[36]!==j||e[37]!==D||e[38]!==u?(ie=async(N,de)=>{await j.mutateAsync({blockKey:N,data:de}),ve.success(u("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:D,blockId:N})),f({mode:"saved",key:N})},e[36]=j,e[37]=D,e[38]=u,e[39]=ie):ie=e[39];const R=ie;let ge;e[40]!==r||e[41]!==p?(ge=ja(p,r),e[40]=r,e[41]=p,e[42]=ge):ge=e[42];const E=ge;if(E){const N=`${E.mode}:${E.mode==="saved"?E.blockKey:E.resolveType}`;let de;e[43]===Symbol.for("react.memo_cache_sentinel")?(de=()=>f(null),e[43]=de):de=e[43];let ye;e[44]!==c||e[45]!==r||e[46]!==R||e[47]!==a||e[48]!==i||e[49]!==n||e[50]!==l||e[51]!==j.isPending||e[52]!==M||e[53]!==N||e[54]!==E.editorTarget||e[55]!==E.initialValue||e[56]!==o?(ye=s.jsx(ao,{orgSlug:n,virtualMcpId:o,branch:c,previewUrl:l,meta:i,decofile:r,kind:a,target:E.editorTarget,initialValue:E.initialValue,isCreating:j.isPending,onCreate:R,onSaveReferencedBlock:M,onBack:de},N),e[44]=c,e[45]=r,e[46]=R,e[47]=a,e[48]=i,e[49]=n,e[50]=l,e[51]=j.isPending,e[52]=M,e[53]=N,e[54]=E.editorTarget,e[55]=E.initialValue,e[56]=o,e[57]=ye):ye=e[57],$=ye;break e}X="flex h-full w-full min-w-0 flex-col";let xe;e[58]!==u?(xe=u("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=u,e[59]=xe):xe=e[59];let me;e[60]===Symbol.for("react.memo_cache_sentinel")?(me=()=>h([]),e[60]=me):me=e[60];const fe=d.length===0?"font-medium text-foreground":"text-muted-foreground";let be;e[61]!==fe?(be=De("min-w-0 truncate classic:rounded-md compact:rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",fe),e[61]=fe,e[62]=be):be=e[62];const ne=ua[a];let pe;e[63]!==be||e[64]!==ne?(pe=s.jsx("button",{type:"button",onClick:me,className:be,children:ne}),e[63]=be,e[64]=ne,e[65]=pe):pe=e[65];let Ce;e[66]!==d?(Ce=d.map((N,de)=>{const ye=de===d.length-1;return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s.jsx(Kt,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>h(d.slice(0,de+1)),className:De("min-w-0 truncate classic:rounded-md compact:rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ye?"font-medium text-foreground":"text-muted-foreground"),children:kt(N,de)})]},`${N}-${de}`)}),e[66]=d,e[67]=Ce):Ce=e[67];let we;e[68]!==xe||e[69]!==pe||e[70]!==Ce?(we=s.jsxs("nav",{"aria-label":xe,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[pe,Ce]}),e[68]=xe,e[69]=pe,e[70]=Ce,e[71]=we):we=e[71];let Ne;e[72]===Symbol.for("react.memo_cache_sentinel")?(Ne=s.jsx(Vs,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Ne):Ne=e[72];let Se;e[73]===Symbol.for("react.memo_cache_sentinel")?(Se=N=>g(N.target.value),e[73]=Se):Se=e[73];let he;e[74]!==a||e[75]!==u?(he=u("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:a}),e[74]=a,e[75]=u,e[76]=he):he=e[76];let Te;e[77]!==a||e[78]!==u?(Te=u("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:a}),e[77]=a,e[78]=u,e[79]=Te):Te=e[79];let $e;e[80]!==y||e[81]!==he||e[82]!==Te?($e=s.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Ne,s.jsx("input",{type:"text",value:y,onChange:Se,placeholder:he,"aria-label":Te,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=y,e[81]=he,e[82]=Te,e[83]=$e):$e=e[83],e[84]!==we||e[85]!==$e?(_=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[we,$e]}),e[84]=we,e[85]=$e,e[86]=_):_=e[86],K=Et,H="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",V="mx-auto w-full max-w-4xl px-6 py-5",A=se?re.length===0?s.jsx(He,{title:u("sandbox.runnableBlocksBrowser.noSearchResults",{kind:a,query:y.trim()}),description:u("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):s.jsx("div",{className:"flex flex-col gap-1",children:re.map(N=>s.jsx(Re,{icon:z,accent:N.savedKey!==void 0?"global":void 0,title:N.title,subtitle:N.resolveType,active:!1,onClick:()=>ee(N)},N.savedKey??N.resolveType))}):te.length===0&&oe.length===0&&ce.length===0?s.jsx(He,{title:u("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:a}),description:d.length===0?u("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):u("sandbox.runnableBlocksBrowser.emptyFolder")}):s.jsxs(s.Fragment,{children:[te.length>0&&s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:te.map(N=>{const de=fa(N.name,d.length);return s.jsxs("button",{type:"button",onClick:()=>h([...d,N.name]),className:"flex items-center gap-2.5 rounded-lg border px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[s.jsx(de,{size:18,className:"shrink-0 text-muted-foreground"}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm font-medium",children:kt(N.name,d.length)}),s.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[N.count," ",N.count===1?D:a,N.savedCount>0&&s.jsxs(s.Fragment,{children:[" ","·"," ",u("sandbox.runnableBlocksBrowser.savedCountLabel",{count:N.savedCount})]})]})]})]},N.name)})}),(oe.length>0||ce.length>0)&&s.jsxs("div",{className:De("flex flex-col gap-1",te.length>0&&"mt-4"),children:[oe.map(N=>{const de=ae.get(N.resolveType)??[],ye=v.has(N.resolveType);return s.jsxs("div",{className:"flex flex-col",children:[s.jsx(Re,{icon:z,title:N.title,subtitle:N.resolveType,active:!1,onClick:()=>ee(N)}),de.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>U(N.resolveType),"aria-expanded":ye,className:"flex items-center gap-1 self-start classic:rounded-md compact:rounded-lg px-2.5 py-1 text-xs font-medium transition-colors hover:bg-global-section/10 cursor-pointer ml-11",style:{color:Yt},children:[ye?s.jsx(qt,{size:12,className:"shrink-0"}):s.jsx(Kt,{size:12,className:"shrink-0"}),u(ye?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",de.length,")"]}),ye&&s.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:de.map(Ee=>s.jsx(Re,{icon:z,accent:"global",title:Ee.title,subtitle:Ee.resolveType,active:!1,onClick:()=>ee(Ee)},Ee.savedKey))})]})]},N.resolveType)}),ce.map(N=>s.jsx(Re,{icon:z,accent:"global",title:N.title,subtitle:N.resolveType,active:!1,onClick:()=>ee(N)},N.savedKey))]})]})}e[10]=z,e[11]=c,e[12]=r,e[13]=a,e[14]=i,e[15]=v,e[16]=n,e[17]=d,e[18]=l,e[19]=j,e[20]=M,e[21]=y,e[22]=p,e[23]=D,e[24]=u,e[25]=o,e[26]=K,e[27]=_,e[28]=$,e[29]=V,e[30]=A,e[31]=H,e[32]=X}else K=e[26],_=e[27],$=e[28],V=e[29],A=e[30],H=e[31],X=e[32];if($!==Symbol.for("react.early_return_sentinel"))return $;let B;e[87]!==V||e[88]!==A?(B=s.jsx("div",{className:V,children:A}),e[87]=V,e[88]=A,e[89]=B):B=e[89];let J;e[90]!==K||e[91]!==B||e[92]!==H?(J=s.jsx(K,{className:H,children:B}),e[90]=K,e[91]=B,e[92]=H,e[93]=J):J=e[93];let Y;return e[94]!==_||e[95]!==J||e[96]!==X?(Y=s.jsxs("div",{className:X,children:[_,J]}),e[94]=_,e[95]=J,e[96]=X,e[97]=Y):Y=e[97],Y}function ha(t){const[e,n]=t;return{name:e,...n}}function ga(t,e){return t.title.localeCompare(e.title)}function xa(t){const[,e]=t;return e}function ba(t,e){return t.title.localeCompare(e.title)}function ya(t,e){return t.title.localeCompare(e.title)}function va(t){return{resolveType:t.resolveType,title:t.title,folderPath:Js(t.resolveType)}}function Sa(t){return{resolveType:t.resolveType,title:t.title,folderPath:Js(t.resolveType),savedKey:t.key}}function ka(){return new Set}function ja(t,e){if(!t)return null;if(t.mode==="available")return{mode:"available",resolveType:t.resolveType,editorTarget:{mode:"available",resolveType:t.resolveType,title:t.title},initialValue:{}};const{resolveType:n,props:o,title:c}=io(e,t.key);return{mode:"saved",blockKey:t.key,resolveType:n,editorTarget:{mode:"saved",blockKey:t.key,resolveType:n,title:c},initialValue:o}}function Ca(t){const e=je.c(106),{orgSlug:n,virtualMcpId:o,branch:c,previewUrl:l,meta:i,decofile:r,resolveType:a,title:u,defaultBlockId:x,isCreating:d,onCreate:h,onSaveReferencedBlock:p}=t,f=Be(),y=_t(),g=y?.virtualMcpId,S=en(g===o?o:null)?.metadata?.siteSlug??null;let k;e[0]===Symbol.for("react.memo_cache_sentinel")?(k={},e[0]=k):k=e[0];const[C,w]=G.useState(k);let U;e[1]===Symbol.for("react.memo_cache_sentinel")?(U=[],e[1]=U):U=e[1];const[T,j]=G.useState(U),[I,M]=G.useState(0),[F,D]=G.useState(!1);let z;e[2]!==i||e[3]!==a?(z=Jt(a,i),e[2]=i,e[3]=a,e[4]=z):z=e[4];const K=z;let _,$,V,A,H,X,B,J;if(e[5]!==S||e[6]!==c||e[7]!==r||e[8]!==T||e[9]!==C||e[10]!==d||e[11]!==h||e[12]!==n||e[13]!==l||e[14]!==a||e[15]!==f||e[16]!==y?.taskId||e[17]!==u||e[18]!==o){const oe=a.split("/").pop()?.replace(/\.tsx?$/,"")??a,ae=y?.taskId??null,ce=l??void 0;let O;e[27]!==S||e[28]!==c||e[29]!==n||e[30]!==ce||e[31]!==ae||e[32]!==o?(O={orgSlug:n,virtualMcpId:o,branch:c,threadId:ae,previewUrl:ce,siteSlug:S},e[27]=S,e[28]=c,e[29]=n,e[30]=ce,e[31]=ae,e[32]=o,e[33]=O):O=e[33],$=O;let te,Z,ee,ie;if(e[34]!==r||e[35]!==T||e[36]!==C||e[37]!==h||e[38]!==f||e[39]!==u){const pe=[u,...T],Ce=Ne=>{j(T.slice(0,Ne)),M(wa)};let we;e[48]!==r||e[49]!==C||e[50]!==h?(we=async Ne=>{const Se=mo(Ne,r);if(Se){ve.error(Se);return}await h(Ne,C),D(!1)},e[48]=r,e[49]=C,e[50]=h,e[51]=we):we=e[51],_=we,J="flex h-full w-full min-w-0",B="flex min-w-0 flex-1 flex-col",H="shrink-0 border-b px-3 py-2.5",ie="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==f?(te=f("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=f,e[53]=te):te=e[53],Z="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",ee=pe.map((Ne,Se)=>{const he=Se===pe.length-1,Te=uo(Ne);return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[Se>0&&s.jsx(Kt,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>Ce(Se),title:Te,className:De("min-w-0 truncate classic:rounded-md compact:rounded-lg px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",he?"font-medium text-foreground":"text-muted-foreground"),children:Te})]},`${Te}-${Se}`)}),e[34]=r,e[35]=T,e[36]=C,e[37]=h,e[38]=f,e[39]=u,e[40]=_,e[41]=te,e[42]=Z,e[43]=ee,e[44]=ie,e[45]=H,e[46]=B,e[47]=J}else _=e[40],te=e[41],Z=e[42],ee=e[43],ie=e[44],H=e[45],B=e[46],J=e[47];let R;e[54]!==te||e[55]!==Z||e[56]!==ee?(R=s.jsx("nav",{"aria-label":te,className:Z,children:ee}),e[54]=te,e[55]=Z,e[56]=ee,e[57]=R):R=e[57];let ge;e[58]===Symbol.for("react.memo_cache_sentinel")?(ge=()=>D(!0),e[58]=ge):ge=e[58];let E;e[59]!==f?(E=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=f,e[60]=E):E=e[60];let xe;e[61]===Symbol.for("react.memo_cache_sentinel")?(xe=s.jsx(In,{size:14}),e[61]=xe):xe=e[61];let me;e[62]!==d||e[63]!==E?(me=s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{size:"icon",className:"size-8 shrink-0",disabled:d,onClick:ge,"aria-label":E,children:xe})}),e[62]=d,e[63]=E,e[64]=me):me=e[64];let fe;e[65]!==f?(fe=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=f,e[66]=fe):fe=e[66];let be;e[67]!==fe?(be=s.jsx(Me,{side:"bottom",children:fe}),e[67]=fe,e[68]=be):be=e[68];let ne;e[69]!==me||e[70]!==be?(ne=s.jsxs(ze,{children:[me,be]}),e[69]=me,e[70]=be,e[71]=ne):ne=e[71],e[72]!==ie||e[73]!==R||e[74]!==ne?(X=s.jsxs("div",{className:ie,children:[R,ne]}),e[72]=ie,e[73]=R,e[74]=ne,e[75]=X):X=e[75],V="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",A=f("sandbox.availableSectionEditor.localEditsHint",{typeLabel:oe}),e[5]=S,e[6]=c,e[7]=r,e[8]=T,e[9]=C,e[10]=d,e[11]=h,e[12]=n,e[13]=l,e[14]=a,e[15]=f,e[16]=y?.taskId,e[17]=u,e[18]=o,e[19]=_,e[20]=$,e[21]=V,e[22]=A,e[23]=H,e[24]=X,e[25]=B,e[26]=J}else _=e[19],$=e[20],V=e[21],A=e[22],H=e[23],X=e[24],B=e[25],J=e[26];let Y;e[76]!==V||e[77]!==A?(Y=s.jsx("p",{className:V,children:A}),e[76]=V,e[77]=A,e[78]=Y):Y=e[78];let W;e[79]!==Y||e[80]!==H||e[81]!==X?(W=s.jsxs("div",{className:H,children:[X,Y]}),e[79]=Y,e[80]=H,e[81]=X,e[82]=W):W=e[82];let L;e[83]!==r||e[84]!==T||e[85]!==I||e[86]!==C||e[87]!==i||e[88]!==p||e[89]!==$||e[90]!==K||e[91]!==f?(L=s.jsx(Et,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:K?s.jsx(Ys,{schema:K,value:C,onChange:oe=>w(oe),basePath:"",breadcrumbPath:T,onBreadcrumbChange:j,meta:i,decofile:r,onSaveReferencedBlock:p,sandbox:$},I):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=r,e[84]=T,e[85]=I,e[86]=C,e[87]=i,e[88]=p,e[89]=$,e[90]=K,e[91]=f,e[92]=L):L=e[92];let se;e[93]!==W||e[94]!==L||e[95]!==B?(se=s.jsxs("div",{className:B,children:[W,L]}),e[93]=W,e[94]=L,e[95]=B,e[96]=se):se=e[96];let re;e[97]!==x||e[98]!==_||e[99]!==d||e[100]!==F?(re=s.jsx(fo,{open:F,onOpenChange:D,defaultBlockId:x,isPending:d,onSubmit:_}),e[97]=x,e[98]=_,e[99]=d,e[100]=F,e[101]=re):re=e[101];let le;return e[102]!==se||e[103]!==re||e[104]!==J?(le=s.jsxs("div",{className:J,children:[se,re]}),e[102]=se,e[103]=re,e[104]=J,e[105]=le):le=e[105],le}function wa(t){return t+1}function Na(t,e){const n={__resolveType:t},o=go([n],e)[0];return o?xo(n,o,e):null}function Pa({orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,meta:c,decofile:l,blockKey:i,onSaveReferencedBlock:r}){const a=Be(),u=_t(),x=u?.virtualMcpId,h=en(x===e?e:null)?.metadata?.siteSlug??null,[p]=G.useState(()=>Na(i,l)),[f,y]=G.useState(p?.data??{}),[g,v]=G.useState([]),[S,k]=G.useState(0),[C,w]=G.useState(!1),[U,T]=G.useState(null),j=U!==null,{save:I,flush:M}=po({orgSlug:t,virtualMcpId:e,branch:n}),F=p?.resolveType?Jt(p.resolveType,c):null,D=l[i],z=D?To(i,D):i,K=u?.taskId??null,_={orgSlug:t,virtualMcpId:e,branch:n,threadId:K,previewUrl:o??void 0,siteSlug:h},$=B=>{y(B),I(i,B)},V=()=>{j?(T(null),w(!1),k(B=>B+1)):T(JSON.stringify(f,null,2))},A=B=>{const J=B??"";try{const Y=JSON.parse(J);if(Y&&typeof Y=="object"&&!Array.isArray(Y)){w(!1),$(Y);return}w(!0)}catch{w(!0)}},H=[z,...g],X=B=>{v(g.slice(0,B)),k(J=>J+1)};return s.jsx("div",{className:"flex h-full w-full min-w-0",children:s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx(ho,{crumbs:H,onSelect:X}),s.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Yt},"aria-hidden":!0}),s.jsx("div",{className:"flex-1"}),s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{variant:j?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:V,"aria-label":a(j?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":j,children:j?s.jsx(ns,{size:14}):s.jsx(Ms,{size:14})})}),s.jsx(Me,{side:"bottom",children:a(j?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),s.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:a("sandbox.savedSectionEditor.globalSectionDescription")})]}),s.jsxs("div",{className:"relative min-h-0 flex-1",children:[s.jsx(Et,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:F?s.jsx(Ys,{schema:F,value:f,onChange:B=>$(B),basePath:"",breadcrumbPath:g,onBreadcrumbChange:v,meta:c,decofile:l,onSaveReferencedBlock:r,sandbox:_},S):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:a("sandbox.savedSectionEditor.noEditableFields")})})})}),U!==null&&s.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[C&&s.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:a("sandbox.savedSectionEditor.invalidJsonError")}),s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(el,{language:"json",height:"100%",code:U,onChange:A,onSave:B=>{A(B),M()}})})]})]})]})})}function Ta(t){const e=je.c(36),{selection:n,orgSlug:o,virtualMcpId:c,branch:l,previewUrl:i,meta:r,decofile:a,isCreating:u,onCreateAvailable:x,onSaveReferencedBlock:d}=t,h=Be();if(!n){let y;e[0]!==h?(y=h("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=h,e[1]=y):y=e[1];let g;e[2]!==h?(g=h("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=h,e[3]=g):g=e[3];let v;return e[4]!==y||e[5]!==g?(v=s.jsx(He,{title:y,description:g}),e[4]=y,e[5]=g,e[6]=v):v=e[6],v}if(n.collection==="available-section"){const y=`available:${n.resolveType}`,g=n.resolveType,v=n.title;let S;e[7]!==n.title?(S=bo(n.title),e[7]=n.title,e[8]=S):S=e[8];let k;e[9]!==x||e[10]!==n.resolveType?(k=(w,U)=>x(n.resolveType,w,U),e[9]=x,e[10]=n.resolveType,e[11]=k):k=e[11];let C;return e[12]!==l||e[13]!==a||e[14]!==u||e[15]!==r||e[16]!==d||e[17]!==o||e[18]!==i||e[19]!==n.resolveType||e[20]!==n.title||e[21]!==y||e[22]!==S||e[23]!==k||e[24]!==c?(C=s.jsx(Ca,{orgSlug:o,virtualMcpId:c,branch:l,previewUrl:i,meta:r,decofile:a,resolveType:g,title:v,defaultBlockId:S,isCreating:u,onCreate:k,onSaveReferencedBlock:d},y),e[12]=l,e[13]=a,e[14]=u,e[15]=r,e[16]=d,e[17]=o,e[18]=i,e[19]=n.resolveType,e[20]=n.title,e[21]=y,e[22]=S,e[23]=k,e[24]=c,e[25]=C):C=e[25],C}const p=`saved:${n.key}`;let f;return e[26]!==l||e[27]!==a||e[28]!==r||e[29]!==d||e[30]!==o||e[31]!==i||e[32]!==n.key||e[33]!==p||e[34]!==c?(f=s.jsx(Pa,{orgSlug:o,virtualMcpId:c,branch:l,previewUrl:i,meta:r,decofile:a,blockKey:n.key,onSaveReferencedBlock:d},p),e[26]=l,e[27]=a,e[28]=r,e[29]=d,e[30]=o,e[31]=i,e[32]=n.key,e[33]=p,e[34]=c,e[35]=f):f=e[35],f}const ks="__all__",js={"date-desc":"sandbox.postToolbar.sortNewestFirst","date-asc":"sandbox.postToolbar.sortOldestFirst",az:"sandbox.postToolbar.sortTitleAZ",za:"sandbox.postToolbar.sortTitleZA"},_a={"date-desc":"sandbox.postToolbar.sortNewest","date-asc":"sandbox.postToolbar.sortOldest",az:"sandbox.postToolbar.sortAZ",za:"sandbox.postToolbar.sortZA"},wt={published:"sandbox.postToolbar.statusPublished",scheduled:"sandbox.postToolbar.statusScheduled",draft:"sandbox.postToolbar.statusDraft"},Cs="status:";function ws(t){if(!t.startsWith(Cs))return null;const e=t.slice(Cs.length);return e in wt?e:null}const Ns=G.forwardRef(function(e,n){const o=je.c(20);let c,l,i,r,a;o[0]!==e?({icon:c,active:l,value:a,className:i,...r}=e,o[0]=e,o[1]=c,o[2]=l,o[3]=i,o[4]=r,o[5]=a):(c=o[1],l=o[2],i=o[3],r=o[4],a=o[5]);const u=l?"text-foreground":"text-muted-foreground";let x;o[6]!==i||o[7]!==u?(x=De("h-7 gap-1 px-1.5 text-xs",u,i),o[6]=i,o[7]=u,o[8]=x):x=o[8];let d;o[9]!==c?(d=s.jsx(c,{size:14,className:"shrink-0"}),o[9]=c,o[10]=d):d=o[10];let h;o[11]!==a?(h=a&&s.jsx("span",{className:"min-w-0 flex-1 truncate",children:a}),o[11]=a,o[12]=h):h=o[12];let p;o[13]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(qt,{size:12,className:"shrink-0 opacity-60"}),o[13]=p):p=o[13];let f;return o[14]!==r||o[15]!==n||o[16]!==x||o[17]!==d||o[18]!==h?(f=s.jsxs(Oe,{ref:n,type:"button",variant:"ghost",size:"sm",className:x,...r,children:[d,h,p]}),o[14]=r,o[15]=n,o[16]=x,o[17]=d,o[18]=h,o[19]=f):f=o[19],f});function as(t){const e=je.c(2),{count:n}=t;let o;return e[0]!==n?(o=s.jsx("span",{className:"ml-auto pl-3 text-xs text-muted-foreground tabular-nums",children:n}),e[0]=n,e[1]=o):o=e[1],o}function Ea(t){const e=je.c(101),{categories:n,authors:o,statusCounts:c,categoryFilter:l,authorFilter:i,statusFilter:r,sort:a,onCategoryFilterChange:u,onAuthorFilterChange:x,onStatusFilterChange:d,onSortChange:h}=t,p=Be();let f;if(e[0]!==n||e[1]!==l){let E;e[3]!==l?(E=xe=>xe.slug===l,e[3]=l,e[4]=E):E=e[4],f=n.find(E),e[0]=n,e[1]=l,e[2]=f}else f=e[2];const y=f;let g;if(e[5]!==i||e[6]!==o){let E;e[8]!==i?(E=xe=>xe.email===i,e[8]=i,e[9]=E):E=e[9],g=o.find(E),e[5]=i,e[6]=o,e[7]=g}else g=e[7];const v=g,S=!!(l||i||r);let k;e[10]!==v?.name||e[11]!==y?.name||e[12]!==r||e[13]!==p?(k=y?.name??v?.name??p(r?wt[r]:"sandbox.postToolbar.filterLabel"),e[10]=v?.name,e[11]=y?.name,e[12]=r,e[13]=p,e[14]=k):k=e[14];const C=k,w=l?`cat:${l}`:i?`author:${i}`:r?`status:${r}`:ks;let U;e[15]!==x||e[16]!==u||e[17]!==d?(U=()=>{u(null),x(null),d(null)},e[15]=x,e[16]=u,e[17]=d,e[18]=U):U=e[18];const T=U;let j;e[19]!==T||e[20]!==x||e[21]!==u||e[22]!==d?(j=E=>{E.startsWith("cat:")?(x(null),d(null),u(E.slice(4))):E.startsWith("author:")?(u(null),d(null),x(E.slice(7))):ws(E)?(u(null),x(null),d(ws(E))):T()},e[19]=T,e[20]=x,e[21]=u,e[22]=d,e[23]=j):j=e[23];const I=j;let M;e[24]!==C||e[25]!==S?(M=s.jsx(It,{asChild:!0,children:s.jsx(Ns,{icon:Mn,active:S,value:C,className:"min-w-0 shrink"})}),e[24]=C,e[25]=S,e[26]=M):M=e[26];let F;e[27]!==p?(F=p("sandbox.postToolbar.filterBy"),e[27]=p,e[28]=F):F=e[28];let D;e[29]!==F?(D=s.jsx(pt,{children:F}),e[29]=F,e[30]=D):D=e[30];let z;e[31]!==p?(z=p("sandbox.postToolbar.allPosts"),e[31]=p,e[32]=z):z=e[32];let K;e[33]!==z?(K=s.jsx(bt,{value:ks,children:z}),e[33]=z,e[34]=K):K=e[34];let _;e[35]!==p?(_=p("sandbox.postToolbar.statusLabel"),e[35]=p,e[36]=_):_=e[36];let $;e[37]!==_?($=s.jsx(pt,{className:"text-muted-foreground/70",children:_}),e[37]=_,e[38]=$):$=e[38];let V;e[39]===Symbol.for("react.memo_cache_sentinel")?(V=Object.keys(wt),e[39]=V):V=e[39];let A;e[40]!==c||e[41]!==p?(A=V.map(E=>s.jsxs(bt,{value:`status:${E}`,children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:p(wt[E])}),s.jsx(as,{count:c[E]})]},`status:${E}`)),e[40]=c,e[41]=p,e[42]=A):A=e[42];let H;e[43]!==n.length||e[44]!==p?(H=n.length>0&&s.jsx(pt,{className:"text-muted-foreground/70",children:p("sandbox.postToolbar.categoryLabel")}),e[43]=n.length,e[44]=p,e[45]=H):H=e[45];let X;e[46]!==n?(X=n.map(Aa),e[46]=n,e[47]=X):X=e[47];let B;e[48]!==o.length||e[49]!==p?(B=o.length>0&&s.jsx(pt,{className:"text-muted-foreground/70",children:p("sandbox.postToolbar.authorLabel")}),e[48]=o.length,e[49]=p,e[50]=B):B=e[50];let J;e[51]!==o?(J=o.map(Da),e[51]=o,e[52]=J):J=e[52];let Y;e[53]!==w||e[54]!==I||e[55]!==K||e[56]!==$||e[57]!==A||e[58]!==H||e[59]!==X||e[60]!==B||e[61]!==J?(Y=s.jsxs(is,{value:w,onValueChange:I,children:[K,$,A,H,X,B,J]}),e[53]=w,e[54]=I,e[55]=K,e[56]=$,e[57]=A,e[58]=H,e[59]=X,e[60]=B,e[61]=J,e[62]=Y):Y=e[62];let W;e[63]!==Y||e[64]!==D?(W=s.jsxs(Mt,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[D,Y]}),e[63]=Y,e[64]=D,e[65]=W):W=e[65];let L;e[66]!==W||e[67]!==M?(L=s.jsxs(zt,{children:[M,W]}),e[66]=W,e[67]=M,e[68]=L):L=e[68];let se;e[69]!==T||e[70]!==S||e[71]!==p?(se=S&&s.jsx(Ba,{label:p("sandbox.postToolbar.clearFilter"),onClick:T}),e[69]=T,e[70]=S,e[71]=p,e[72]=se):se=e[72];const re=_a[a];let le;e[73]!==p||e[74]!==re?(le=p(re),e[73]=p,e[74]=re,e[75]=le):le=e[75];let oe;e[76]!==le?(oe=s.jsx(It,{asChild:!0,children:s.jsx(Ns,{icon:zn,active:!0,value:le})}),e[76]=le,e[77]=oe):oe=e[77];let ae;e[78]!==p?(ae=p("sandbox.postToolbar.sortBy"),e[78]=p,e[79]=ae):ae=e[79];let ce;e[80]!==ae?(ce=s.jsx(pt,{children:ae}),e[80]=ae,e[81]=ce):ce=e[81];let O;e[82]!==h?(O=E=>h(E),e[82]=h,e[83]=O):O=e[83];let te;e[84]===Symbol.for("react.memo_cache_sentinel")?(te=Object.keys(js),e[84]=te):te=e[84];let Z;e[85]!==p?(Z=te.map(E=>s.jsx(bt,{value:E,children:p(js[E])},E)),e[85]=p,e[86]=Z):Z=e[86];let ee;e[87]!==a||e[88]!==O||e[89]!==Z?(ee=s.jsx(is,{value:a,onValueChange:O,children:Z}),e[87]=a,e[88]=O,e[89]=Z,e[90]=ee):ee=e[90];let ie;e[91]!==ce||e[92]!==ee?(ie=s.jsxs(Mt,{align:"end",className:"w-44",children:[ce,ee]}),e[91]=ce,e[92]=ee,e[93]=ie):ie=e[93];let R;e[94]!==oe||e[95]!==ie?(R=s.jsx("div",{className:"ml-auto shrink-0",children:s.jsxs(zt,{children:[oe,ie]})}),e[94]=oe,e[95]=ie,e[96]=R):R=e[96];let ge;return e[97]!==L||e[98]!==se||e[99]!==R?(ge=s.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[L,se,R]}),e[97]=L,e[98]=se,e[99]=R,e[100]=ge):ge=e[100],ge}function Da(t){return s.jsxs(bt,{value:`author:${t.email}`,children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),s.jsx(as,{count:t.count})]},`author:${t.email}`)}function Aa(t){return s.jsxs(bt,{value:`cat:${t.slug}`,children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),s.jsx(as,{count:t.count})]},`cat:${t.slug}`)}function Ba(t){const e=je.c(4),{label:n,onClick:o}=t;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ns,{size:12}),e[0]=c):c=e[0];let l;return e[1]!==n||e[2]!==o?(l=s.jsx("button",{type:"button","aria-label":n,onClick:o,className:"flex h-6 w-6 shrink-0 items-center justify-center classic:rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer compact:rounded-lg",children:c}),e[1]=n,e[2]=o,e[3]=l):l=e[3],l}function $a(t){const e=je.c(18),{checked:n,disabled:o,onToggle:c}=t,l=Be();let i;e[0]!==c?(i=()=>c(),e[0]=c,e[1]=i):i=e[1];let r;e[2]!==n||e[3]!==l?(r=l(n?"sandbox.postToolbar.deselectAllPosts":"sandbox.postToolbar.selectAllPosts"),e[2]=n,e[3]=l,e[4]=r):r=e[4];let a;e[5]!==n||e[6]!==o||e[7]!==i||e[8]!==r?(a=s.jsx(Ie,{asChild:!0,children:s.jsx("span",{className:"flex shrink-0 items-center px-1.5",onClick:La,children:s.jsx(ss,{checked:n,disabled:o,onCheckedChange:i,"aria-label":r})})}),e[5]=n,e[6]=o,e[7]=i,e[8]=r,e[9]=a):a=e[9];let u;e[10]!==n||e[11]!==l?(u=l(n?"sandbox.postToolbar.deselectAll":"sandbox.postToolbar.selectAll"),e[10]=n,e[11]=l,e[12]=u):u=e[12];let x;e[13]!==u?(x=s.jsx(Me,{side:"bottom",children:u}),e[13]=u,e[14]=x):x=e[14];let d;return e[15]!==a||e[16]!==x?(d=s.jsxs(ze,{children:[a,x]}),e[15]=a,e[16]=x,e[17]=d):d=e[17],d}function La(t){return t.stopPropagation()}function Oa(t){const e=je.c(42),{count:n,allSelected:o,onToggleSelectAll:c,onDelete:l,onExit:i}=t,r=Be();let a;e[0]!==o||e[1]!==c?(a=s.jsx($a,{checked:o,onToggle:c}),e[0]=o,e[1]=c,e[2]=a):a=e[2];let u;e[3]!==n||e[4]!==r?(u=r("sandbox.postToolbar.itemsSelected",{count:n}),e[3]=n,e[4]=r,e[5]=u):u=e[5];let x;e[6]!==u?(x=s.jsx("span",{className:"text-xs font-medium tabular-nums",children:u}),e[6]=u,e[7]=x):x=e[7];const d=n===0;let h;e[8]!==r?(h=r("sandbox.postToolbar.deleteSelectedPosts"),e[8]=r,e[9]=h):h=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(tn,{size:14}),e[10]=p):p=e[10];let f;e[11]!==l||e[12]!==d||e[13]!==h?(f=s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",disabled:d,onClick:l,"aria-label":h,children:p})}),e[11]=l,e[12]=d,e[13]=h,e[14]=f):f=e[14];let y;e[15]!==r?(y=r("sandbox.postToolbar.deleteSelected"),e[15]=r,e[16]=y):y=e[16];let g;e[17]!==y?(g=s.jsx(Me,{side:"bottom",children:y}),e[17]=y,e[18]=g):g=e[18];let v;e[19]!==f||e[20]!==g?(v=s.jsxs(ze,{children:[f,g]}),e[19]=f,e[20]=g,e[21]=v):v=e[21];let S;e[22]!==r?(S=r("sandbox.postToolbar.exitSelection"),e[22]=r,e[23]=S):S=e[23];let k;e[24]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(ns,{size:14}),e[24]=k):k=e[24];let C;e[25]!==i||e[26]!==S?(C=s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,"aria-label":S,children:k})}),e[25]=i,e[26]=S,e[27]=C):C=e[27];let w;e[28]!==r?(w=r("sandbox.postToolbar.exitSelection"),e[28]=r,e[29]=w):w=e[29];let U;e[30]!==w?(U=s.jsx(Me,{side:"bottom",children:w}),e[30]=w,e[31]=U):U=e[31];let T;e[32]!==C||e[33]!==U?(T=s.jsxs(ze,{children:[C,U]}),e[32]=C,e[33]=U,e[34]=T):T=e[34];let j;e[35]!==v||e[36]!==T?(j=s.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[v,T]}),e[35]=v,e[36]=T,e[37]=j):j=e[37];let I;return e[38]!==a||e[39]!==j||e[40]!==x?(I=s.jsxs("div",{className:"flex items-center gap-0.5 border-b bg-accent/40 px-2 py-1.5",children:[a,x,j]}),e[38]=a,e[39]=j,e[40]=x,e[41]=I):I=e[41],I}function gt(t){const e=je.c(34),{onDuplicate:n,onRename:o,onAddVariant:c,onEditSeo:l,onViewJson:i,onDelete:r}=t,a=Be();let u;e[0]!==a?(u=a("sandbox.itemActions.moreActions"),e[0]=a,e[1]=u):u=e[1];let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Dn,{size:14}),e[2]=x):x=e[2];let d;e[3]!==u?(d=s.jsx(It,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":u,className:"flex h-7 w-7 items-center justify-center classic:rounded-md compact:rounded-lg text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:Ra,children:x})}),e[3]=u,e[4]=d):d=e[4];let h;e[5]!==o||e[6]!==a?(h=o&&s.jsxs(lt,{onClick:o,children:[s.jsx(sl,{size:14}),a("sandbox.itemActions.rename")]}),e[5]=o,e[6]=a,e[7]=h):h=e[7];let p;e[8]!==n||e[9]!==a?(p=n&&s.jsxs(lt,{onClick:n,children:[s.jsx(tl,{size:14}),a("sandbox.itemActions.duplicate")]}),e[8]=n,e[9]=a,e[10]=p):p=e[10];let f;e[11]!==c||e[12]!==a?(f=c&&s.jsxs(s.Fragment,{children:[s.jsx(Bt,{}),s.jsxs(lt,{onClick:c,className:"cursor-pointer text-success focus:text-success",children:[s.jsx(Zo,{size:14}),a("sandbox.itemActions.addVariant")]})]}),e[11]=c,e[12]=a,e[13]=f):f=e[13];let y;e[14]!==l||e[15]!==i||e[16]!==a?(y=(l||i)&&s.jsxs(s.Fragment,{children:[s.jsx(Bt,{}),l&&s.jsxs(lt,{onClick:l,children:[s.jsx(Ks,{size:14}),a("sandbox.itemActions.editSeo")]}),i&&s.jsxs(lt,{onClick:i,children:[s.jsx(Ms,{size:14}),a("sandbox.itemActions.viewJson")]})]}),e[14]=l,e[15]=i,e[16]=a,e[17]=y):y=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Bt,{}),e[18]=g):g=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(tn,{size:14}),e[19]=v):v=e[19];let S;e[20]!==a?(S=a("sandbox.itemActions.delete"),e[20]=a,e[21]=S):S=e[21];let k;e[22]!==r||e[23]!==S?(k=s.jsxs(lt,{onClick:r,className:"text-destructive focus:text-destructive",children:[v,S]}),e[22]=r,e[23]=S,e[24]=k):k=e[24];let C;e[25]!==k||e[26]!==h||e[27]!==p||e[28]!==f||e[29]!==y?(C=s.jsxs(Mt,{align:"end",className:"w-44",children:[h,p,f,y,g,k]}),e[25]=k,e[26]=h,e[27]=p,e[28]=f,e[29]=y,e[30]=C):C=e[30];let w;return e[31]!==C||e[32]!==d?(w=s.jsxs(zt,{children:[d,C]}),e[31]=C,e[32]=d,e[33]=w):w=e[33],w}function Ra(t){return t.stopPropagation()}function Fa(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function Ka(t){const e=new Map;for(const n of t){const o=Fa(n.resolveType),c=e.get(o);c?c.push(n):e.set(o,[n])}return[...e.entries()].map(([n,o])=>({label:n,sections:o})).sort((n,o)=>n.label.localeCompare(o.label))}function Ps(t){const e=je.c(8),{icon:n,label:o,className:c}=t;let l;e[0]!==c?(l=De("flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",c),e[0]=c,e[1]=l):l=e[1];let i;e[2]!==n?(i=s.jsx(n,{size:13,className:"shrink-0"}),e[2]=n,e[3]=i):i=e[3];let r;return e[4]!==o||e[5]!==l||e[6]!==i?(r=s.jsxs("div",{className:l,children:[i,o]}),e[4]=o,e[5]=l,e[6]=i,e[7]=r):r=e[7],r}const Ts=G.lazy(()=>Fe(()=>import("./app-editor-BC02Q4FF.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177])).then(t=>({default:t.AppEditor}))),Ia=G.lazy(()=>Fe(()=>import("./post-editor--ZAMVoRu.js"),__vite__mapDeps([178,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,32,52,31,33,34,35,36,37,38,39,40,27,28,30,41,42,43,44,45,46,47,48,49,50,51,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,110,179,164,143,90,91,67,113,121,119,117,72,71,73,74,75,69,76,77,78,79,80,81,82,83,84,85,86,26,87,88,89,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,24,25,114,115,116,118,120,122,123,124,125,126,127,128,129,130,180,70,147,181,182,183,184,131,132,133,134,135,136,137,138,139,140,141,142,144,145,146,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,165,166,167,168,169,170,171,172,173,174,175,176,177])).then(t=>({default:t.PostEditor}))),Ma=G.lazy(()=>Fe(()=>import("./record-editor-DcMeB_oO.js"),__vite__mapDeps([185,1,2,68,110,25,26,27,28,117,72,71,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,73,74,38,48,75,69,31,32,33,34,35,36,37,39,40,30,41,42,43,44,45,46,47,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,76,77,78,79,80,81,82,83,67,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,24,114,115,116,118,119,120,121,122,123,124,125,126,127,128,129,130,182,184,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177])).then(t=>({default:t.RecordEditor}))),za=G.lazy(()=>Fe(()=>import("./category-editor-CxqI2r6D.js"),__vite__mapDeps([186,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,36,38,52,31,32,33,34,35,37,39,40,27,28,30,41,42,43,44,45,46,47,48,49,50,51,53,54,55,56,57,58,59,60,61,62,63,64,65,66,129,68,110,180,70,69,118,90,91,67,113,72,71,73,74,75,76,77,78,79,80,81,82,83,84,85,86,26,87,88,89,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,24,25,114,115,116,117,119,120,121,122,123,124,125,126,127,128,130,147,181,182,183,184,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177])).then(t=>({default:t.CategoryEditor}))),Va=G.lazy(()=>Fe(()=>import("./bulk-category-panel-BZ9sB0IZ.js"),__vite__mapDeps([187,1,2,38,65,110,188,25,26,27,28,86])).then(t=>({default:t.BulkCategoryPanel}))),Ua=G.lazy(()=>Fe(()=>import("./sections-editor-ILck9TBW.js"),__vite__mapDeps([189,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,72,71,73,74,38,48,75,69,31,32,33,34,35,36,37,39,40,27,28,30,41,42,43,44,45,46,47,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,76,77,78,79,80,81,82,83,67,84,85,86,26,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,68,111,112,113,24,25,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,173,190,29,70,191])).then(t=>({default:t.SectionsEditor}))),Ga=G.lazy(()=>Fe(()=>import("./seo-editor-CzWbhfG4.js"),__vite__mapDeps([192,1,2,31,32,33,34,35,36,37,38,39,40,27,28,30,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,24,25,26,72,71,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,73,74,75,69,76,77,78,79,80,81,82,83,67,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,68,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,190])).then(t=>({default:t.SeoEditor}))),Ha=G.lazy(()=>Fe(()=>import("./variant-calendar-CmLSEJPW.js"),__vite__mapDeps([193,1,2,31,32,33,34,35,36,37,38,39,40,27,28,30,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,110,24,25,26,119,86,194,131,132,133,105,8,9,134,7,99,103,6,10,135,3,4,5,11,12,13,14,15,16,17,18,19,20,21,22,23,101,67,136,137,85,107,108,109,68,84,138,87,88,89,90,91,92,93,94,95,96,139,71,82,81,83,78,79,121,140,128,102,141,142,143,144,113,145,146,147,148,149,150,151,152,153,154,155,156,157,158,125,126,159,117,160,161,162,163,164,165,166,77,80,97,98,100,104,106,111,112,167,75,76,168,169,127,123,170,171,172,129,72,73,74,69,114,115,116,118,120,122,124,130,173,174,175,176,177])).then(t=>({default:t.VariantCalendar}))),Ja=G.lazy(()=>Fe(()=>import("./post-calendar-BWXIOp26.js"),__vite__mapDeps([195,1,2,32,31,33,34,35,36,37,38,39,40,27,28,30,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,196,24,25,26,131,132,133,105,8,9,134,7,99,103,6,10,135,3,4,5,11,12,13,14,15,16,17,18,19,20,21,22,23,101,86,67,136,137,85,107,108,109,110,68,84,138,87,88,89,90,91,92,93,94,95,96,139,71,82,81,83,78,79,121,140,128,102,141,142,143,144,113,145,146,147,148,149,150,151,152,153,154,155,156,157,158,125,126,159,117,160,161,162,163,164,165,166,77,80,97,98,100,104,106,111,112,167,75,76,168,169,127,123,170,171,172,129,72,73,74,69,114,115,116,118,119,120,122,124,130,173,174,175,176,177])).then(t=>({default:t.PostCalendar}))),Wa=G.lazy(()=>Fe(()=>import("./redirect-editor-Dm1Lv4vd.js"),__vite__mapDeps([197,1,2,143,27,68,110,25,26,28,72,71,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,73,74,38,48,75,69,31,32,33,34,35,36,37,39,40,30,41,42,43,44,45,46,47,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,76,77,78,79,80,81,82,83,67,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,24,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,184])).then(t=>({default:t.RedirectEditor})));function Ya(t){const e=je.c(20),{deepLinkPage:n}=t,{currentBranch:o,virtualMcpId:c}=$s(),{org:l}=An(),i=Mo(),r=zo(),{runtime:a,previewServerUrl:u}=Vo(c),x=a==="cms";let d;e[0]!==x||e[1]!==r.previewState||e[2]!==i.lifecycle.phase?(d=kl({fastPreviewActive:x,previewState:r.previewState,lifecyclePhase:i.lifecycle.phase}),e[0]=x,e[1]=r.previewState,e[2]=i.lifecycle.phase,e[3]=d):d=e[3];const h=d;if(h.kind==="sandbox-card"){const y=`/${l.slug}/settings/connections`;let g;return e[4]!==h.state||e[5]!==r.start||e[6]!==y||e[7]!==i.lifecycle||e[8]!==i.phase?(g=s.jsx(vl,{state:h.state,claimPhase:i.phase,lifecycle:i.lifecycle,onStart:r.start,connectionsHref:y}),e[4]=h.state,e[5]=r.start,e[6]=y,e[7]=i.lifecycle,e[8]=i.phase,e[9]=g):g=e[9],g}if(!c||!o){let y;return e[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(He,{title:"Waiting for sandbox context…"}),e[10]=y):y=e[10],y}const p=x?u:r.previewUrl;let f;return e[11]!==o||e[12]!==n||e[13]!==h.devServerReady||e[14]!==h.sandboxWarming||e[15]!==r.previewUrl||e[16]!==l.slug||e[17]!==p||e[18]!==c?(f=s.jsx(Qa,{orgSlug:l.slug,virtualMcpId:c,branch:o,previewUrl:r.previewUrl,sitePreviewUrl:p,deepLinkPage:n,devServerReady:h.devServerReady,sandboxWarming:h.sandboxWarming}),e[11]=o,e[12]=n,e[13]=h.devServerReady,e[14]=h.sandboxWarming,e[15]=r.previewUrl,e[16]=l.slug,e[17]=p,e[18]=c,e[19]=f):f=e[19],f}const _s=2e3,qa=15;function Es(t,e,n,o){return typeof e!="string"||n&&(sn(e,n,o)||t.state.dataUpdateCount>=qa)?!1:_s}function Qa({orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,sitePreviewUrl:c,deepLinkPage:l,devServerReady:i,sandboxWarming:r}){const a=Be(),u=_t()?.taskId??null,x={orgSlug:t,virtualMcpId:e,branch:n,threadId:u,previewUrl:o},{data:d,isLoading:h}=yo(x,{fetchEnabled:i}),p=Bs({strict:!1}),[f,y]=G.useState(()=>p.contentCollection&&qe(p.contentCollection)&&p.contentCollection||"pages"),[g,v]=G.useState(()=>p.contentItem&&qe(f)?{collection:f,key:p.contentItem}:null),[S,k]=G.useState(null),C=!!(l?.pageId||l?.path||l?.pathTemplate),[w,U]=G.useState(!1);if(C&&!w&&g===null&&d){U(!0);const m=_o(cs(d),l??{});m&&(y("pages"),v({collection:"pages",key:m.key,path:m.path}))}const[T,j]=G.useState(""),[I,M]=G.useState(null),[F,D]=G.useState(null),[z,K]=G.useState(null),[_,$]=G.useState("date-desc"),[V,A]=G.useState(()=>new Set),[H,X]=G.useState(null),B=()=>{A(new Set),X(null)},J=m=>{v(m),k(null)},[Y,W]=G.useState(f);Y!==f&&(W(f),j(""),M(null),D(null),K(null),$("date-desc"),A(new Set),X(null));const{data:L,isLoading:se,isFetching:re}=vo(x,{fetchEnabled:i,refetchInterval:m=>{const P=m.state.data;if(f==="apps"&&g&&g.collection==="apps"){const q=d?.[g.key];return Es(m,typeof q?.__resolveType=="string"?q.__resolveType:void 0,P)}if(f==="site"&&d){const q=P?ds(d,P):null,Q=d.site,ke=q?.resolveType??(typeof Q?.__resolveType=="string"?Q.__resolveType:void 0);return Es(m,ke,P,["seo"])}return!1}}),le=(m,P)=>!sn(m,L,P)&&(se||re),{catalog:oe,isLoading:ae}=gl(L??void 0,d??void 0,{enabled:f==="apps"}),ce=ra({orgSlug:t,virtualMcpId:e,branch:n,meta:L}),O=Hs(x),te=Oo(x),[Z,ee]=G.useState(null),[ie,R]=G.useState(),[ge,E]=G.useState(!1),[xe,me]=G.useState(),[fe,be]=G.useState(null),[ne,pe]=G.useState(null),[Ce,we]=G.useState(null),Ne=!d||!L;if(h||se||Ne&&r)return s.jsx("div",{className:"h-full w-full flex items-center justify-center",children:s.jsx(Qe,{className:"size-5 text-muted-foreground"})});if(Ne)return s.jsx(He,{title:"Could not load site data."});const Se=cs(d).sort((m,P)=>m.name.localeCompare(P.name)),he=Eo(d).sort((m,P)=>m.from.localeCompare(P.from)),Te=Do(d,L),$e=f==="sections"?Ao(L):[],N=ds(d,L),de=rn(d),ye=os.some(m=>de[m].length>0),Ee=qe(f)?de[f]:[],ct=(ye?vt(d,"categories"):[]).map(({key:m,payload:P})=>{const q=typeof P.slug=="string"?P.slug:"",Q=typeof P.name=="string"?P.name:"";return{slug:q||m,name:Q||q||m}}).filter(m=>m.slug).sort((m,P)=>m.name.localeCompare(P.name)),et=f==="posts"&&(V.size>0||H!==null),dt=et?mn(d).filter(m=>V.has(m.key)):[],ut=rs(L,"loaders"),tt=rs(L,"actions");if(!Bo(d,L)&&!ye&&ut===0&&tt===0)return s.jsx(He,{icon:Ls,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const At={pages:Se.length,sections:Te.length,apps:oe.length,loaders:ut,actions:tt,redirects:he.length,posts:de.posts.length,authors:de.authors.length,categories:de.categories.length},We=new Set(Se.map(m=>Ct(m.path))),st=new Set(Se.map(m=>m.name)),mt=new Set(Te.map(m=>m.name)),nt=async m=>{const P=d[m.key];if(!P)return;const q=qs(d,m.key),Q=So(d,m.key,Math.max(0,q-1)),ke=ko(P.sections,Q);if(ke)try{await O.mutateAsync({blockKey:m.key,data:{...P,sections:ke}}),ve.success(`Variant added to "${m.name}"`),v({collection:"pages",key:m.key,path:m.path})}catch(_e){ve.error(_e instanceof Error?_e.message:"Could not add variant")}},Ve=()=>{R(void 0),ee({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},Ue=m=>{R(void 0),ee({mode:"duplicate",sourceKey:m.key,initialName:ps(st,m.name),initialPath:jl(We,m.path)})},Ge=m=>{R(void 0),ee({mode:"rename",sourceKey:m.key,initialName:m.name,initialPath:m.path})},b=async m=>{if(!Z)return;const{mode:P,sourceKey:q}=Z;try{if(P==="create"){let Q;if(m.templateKey){const _e=d[m.templateKey];if(!_e)throw new Error("Selected template no longer exists.");Q={..._e,name:m.name,path:m.path}}else Q=Nl(m.name,m.path);const ke=Tl(d,m.name);await O.mutateAsync({blockKey:ke,data:Q}),ve.success(`Created "${m.name}"`),v({collection:"pages",key:ke,path:m.path})}else if(P==="duplicate"&&q){const Q=d[q];if(!Q)throw new Error("Source page not found");const{key:ke,data:_e}=wl({source:Q,pages:Se,newName:m.name,newPath:m.path});await O.mutateAsync({blockKey:ke,data:_e}),ve.success(`Duplicated as "${m.name}"`),v({collection:"pages",key:ke,path:m.path})}else if(P==="rename"&&q){const Q=d[q];if(!Q)throw new Error("Page not found");const ke={...Q,name:m.name,path:m.path};await O.mutateAsync({blockKey:q,data:ke}),ve.success("Page updated"),g?.collection==="pages"&&g.key===q&&v({collection:"pages",key:q,path:m.path})}ee(null)}catch(Q){R(Q instanceof Error?Q.message:"Save failed")}},ue=({path:m})=>{if(!Z)return null;const P=Ct(m);return(Z.mode==="rename"?Ct(Z.initialPath):null)!==P&&We.has(P)?`A page with path "${m}" already exists.`:null},Ae=async(m,P,q)=>{await O.mutateAsync({blockKey:P,data:{...q,name:P,__resolveType:m}}),ve.success(a("sandbox.contentBrowser.createdSection",{name:P})),v({collection:"sections",key:P})},Ye=Ws((m,P)=>O.mutate({blockKey:m,data:P})),xn=async m=>{const P=d[m.key];if(!P){ve.error(a("sandbox.contentBrowser.sectionNotFound"));return}const q=Cl(d,m.key),Q=ps(mt,m.name),ke={...P,name:Q};try{await O.mutateAsync({blockKey:q,data:ke}),ve.success(a("sandbox.contentBrowser.duplicatedSection",{name:m.name})),v({collection:"sections",key:q})}catch(_e){ve.error(_e instanceof Error?_e.message:a("sandbox.contentBrowser.duplicateFailed"))}},bn=async m=>{if(!fe)return;const P=d[fe];if(!P){ve.error(a("sandbox.contentBrowser.sectionNotFound"));return}try{await O.mutateAsync({blockKey:fe,data:{...P,name:m}}),ve.success(a("sandbox.contentBrowser.sectionRenamed")),be(null)}catch(q){ve.error(q instanceof Error?q.message:a("sandbox.contentBrowser.renameFailed"))}},yn=()=>{me(void 0),E(!0)},vn=async m=>{const P=$o(d,m.from),q=Lo(m);try{await O.mutateAsync({blockKey:P,data:q}),ve.success("Created redirect"),E(!1),v({collection:"redirects",key:P})}catch(Q){me(Q instanceof Error?Q.message:"Could not create redirect")}},Sn=async m=>{const P=Ft(d,m),q=it(P,m,fn(m));try{await O.mutateAsync({blockKey:P,data:q}),ve.success(`Created ${yt[m]}`),v({collection:m,key:P})}catch(Q){ve.error(Q instanceof Error?Q.message:"Could not create")}},kn=async m=>{const P=Ft(d,"posts"),q=it(P,"posts",Zl(m));try{await O.mutateAsync({blockKey:P,data:q}),ve.success(a("sandbox.postCalendar.createdScheduledPost")),y("posts"),W("posts"),v({collection:"posts",key:P}),k(null)}catch(Q){ve.error(Q instanceof Error?Q.message:a("sandbox.postCalendar.couldNotCreate"))}},jn=async(m,P)=>{const q=d[m],Q=q?ta(xt(q,"posts"),P):null;if(!Q){ve.error(a("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await O.mutateAsync({blockKey:m,data:it(m,"posts",Q)})}catch(ke){ve.error(ke instanceof Error?ke.message:a("sandbox.postCalendar.couldNotReschedule"))}},Cn=async m=>{const P=d[m.key];if(!P){ve.error("Record not found.");return}const q=Ft(d,m.kind),Q=m.kind==="posts"?"title":"name",ke={...structuredClone(xt(P,m.kind)),[Q]:`${m.label} (copy)`};try{await O.mutateAsync({blockKey:q,data:it(q,m.kind,ke)}),ve.success(`Duplicated "${m.label}"`),v({collection:m.kind,key:q})}catch(_e){ve.error(_e instanceof Error?_e.message:"Duplicate failed")}},wn=m=>{A(P=>{const q=new Set(P);return q.has(m)?q.delete(m):q.add(m),q})},Nn=m=>{y("posts"),W("posts"),v(null),k(null),j(""),M(null),D(null),K(null),$("date-desc"),A(new Set),X(m||null)},Pn=async(m,P)=>{const q=[...V];let Q=0;for(const ke of q){const _e=d[ke],ot=xt(_e,"posts"),ft=m==="add"?Vl(ot,P):Ul(ot,P);ft!==ot&&(await O.mutateAsync({blockKey:ke,data:it(ke,"posts",xs(ft))}),Q+=1)}return Q},Tn=async(m,P)=>{const q=V.size;try{const Q=await Pn(m,P),ke=m==="add"?"Added to":"Moved",_e=q-Q;ve.success(`${ke} ${Q} ${Q===1?"post":"posts"}`+(_e>0?` (${_e} already set)`:"")),B()}catch(Q){ve.error(Q instanceof Error?Q.message:"Bulk update failed")}},_n=async()=>{if(ne)try{if(ne.kind==="blog-bulk"){for(const Q of ne.keys)await te.mutateAsync({blockKey:Q});ve.success(`Deleted ${ne.count} ${ne.count===1?"post":"posts"}`),g&&g.collection!=="available-section"&&ne.keys.includes(g.key)&&v(null),B(),pe(null);return}const{kind:m,key:P,label:q}=ne;if(m==="blog"){if(ne.blogKind==="categories"){const Q=xt(d[P],"categories").slug,ke=typeof Q=="string"?Q:"";if(ke)for(const{key:_e,payload:ot}of vt(d,"posts")){const ft=Gl(ot,ke);ft!==ot&&await O.mutateAsync({blockKey:_e,data:it(_e,"posts",xs(ft))})}}await te.mutateAsync({blockKey:P})}else await te.mutateAsync({blockKey:P});ve.success(`Deleted "${q}"`),g&&g.collection!=="available-section"&&g.key===P&&v(null),pe(null)}catch(m){ve.error(m instanceof Error?m.message:"Delete failed")}},St=te.isPending||O.isPending,En=ne?.kind==="blog"?yt[ne.blogKind]:ne?.kind==="blog-bulk"?`${ne.count} ${ne.count===1?"post":"posts"}`:ne?.kind??"item";return s.jsxs("div",{className:"flex h-full w-full",children:[s.jsx(bl,{active:f,counts:At,showBlog:ye,onSelect:m=>{y(m),v(null),k(null)}}),f!=="seo"&&f!=="site"&&f!=="calendar"&&f!=="post-schedule"&&f!=="loaders"&&f!=="actions"&&s.jsx(Xa,{activeCollection:f,pages:Se,redirects:he,sections:Te,availableSections:$e,appCatalog:oe,appCatalogLoading:ae,blogEntries:Ee,decofile:d,searchQuery:T,onSearchChange:j,postCategoryFilter:I,postAuthorFilter:F,postStatusFilter:z,postSort:_,onPostCategoryFilterChange:m=>{M(m),A(new Set)},onPostAuthorFilterChange:m=>{D(m),A(new Set)},onPostStatusFilterChange:m=>{K(m),A(new Set)},onPostSortChange:$,selectedPostKeys:V,postBulkPanelOpen:et,onTogglePostSelect:wn,onSelectAllPosts:m=>A(new Set(m)),onClearPostSelection:()=>A(new Set),onExitPostSelection:B,onBulkDeletePosts:()=>pe({kind:"blog-bulk",keys:[...V],count:V.size}),selection:g,onSelect:J,onCreate:()=>{f==="pages"?Ve():f==="redirects"?yn():qe(f)&&Sn(f)},onDuplicatePage:Ue,onRenamePage:Ge,onAddPageVariant:nt,onDeletePage:m=>pe({kind:"page",key:m.key,label:m.name}),onEditPageSeo:m=>{const P={collection:"pages",key:m.key,path:m.path};v(P),k(m.key)},onViewPageJson:m=>we(m.key),onDuplicateSection:xn,onRenameSection:m=>be(m.key),onDeleteSection:m=>pe({kind:"section",key:m.key,label:m.name}),onDeleteRedirect:m=>pe({kind:"redirect",key:m.key,label:m.from||m.key}),onDuplicateBlog:Cn,onDeleteBlog:m=>pe({kind:"blog",blogKind:m.kind,key:m.key,label:m.label})}),s.jsx("div",{className:"flex-1 min-w-0",children:f==="loaders"||f==="actions"?s.jsx(pa,{orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,meta:L,decofile:d,kind:f}):s.jsx(G.Suspense,{fallback:s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(Qe,{className:"size-5 text-muted-foreground"})}),children:f==="calendar"?s.jsx(Ha,{decofile:d}):f==="post-schedule"?s.jsx(Ja,{decofile:d,support:ce,isCreating:O.isPending,onCreate:m=>{kn(m)},onReschedule:(m,P)=>{jn(m,P)},onSelect:m=>{y("posts"),W("posts"),v({collection:"posts",key:m}),k(null)}}):f==="site"?N?s.jsx(Ts,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:N.key,block:d[N.key],decofile:d,meta:L,title:"Site",excludeFields:["seo"],schemaPending:le(N.resolveType,["seo"]),previewBaseUrl:o},`site:${N.key}`):s.jsx(He,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):f==="seo"?s.jsx(Ga,{orgSlug:t,virtualMcpId:e,branch:n,decofile:d,meta:L,target:{kind:"site"},previewBaseUrl:c}):f==="sections"?s.jsx(Ta,{selection:g?.collection==="sections"||g?.collection==="available-section"?g:null,orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,meta:L,decofile:d,isCreating:O.isPending,onCreateAvailable:Ae,onSaveReferencedBlock:Ye}):et?s.jsx(Va,{posts:dt,categories:ct,initialSlug:H,isPending:O.isPending,onApply:(m,P)=>{Tn(m,P)},onClose:B},H??"selection"):g&&g.collection!=="available-section"?g.collection==="apps"?s.jsx(Ts,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:g.key,block:d[g.key],decofile:d,meta:L,previewBaseUrl:o,schemaPending:le(typeof d[g.key]?.__resolveType=="string"?String(d[g.key].__resolveType):void 0)},`app:${g.key}`):g.collection==="posts"?s.jsx(Ia,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:g.key,block:d[g.key],decofile:d,meta:L,previewBaseUrl:c},`post:${g.key}`):g.collection==="categories"?s.jsx(za,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:g.key,block:d[g.key],decofile:d,meta:L,onManagePosts:Nn,onOpenPost:m=>{y("posts"),W("posts"),v({collection:"posts",key:m}),k(null)},previewBaseUrl:c},`category:${g.key}`):g.collection==="authors"?s.jsx(Ma,{orgSlug:t,virtualMcpId:e,branch:n,kind:"authors",blockKey:g.key,block:d[g.key]},`authors:${g.key}`):g.collection==="redirects"?s.jsx(Wa,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:g.key,block:d[g.key]},`redirect:${g.key}`):s.jsx(Ua,{orgSlug:t,virtualMcpId:e,branch:n,previewReady:!0,previewUrl:o??void 0,currentPath:g.collection==="pages"?g.path:"/",activePageBlockKey:g.collection==="pages"?g.key:null,activeGlobalBlockKey:g.collection==="sections"?g.key:null,initialEditSeo:g.collection==="pages"&&S===g.key,onExitSeo:()=>k(null),onSelectRoot:()=>{v(null),k(null)}},g.collection==="pages"?`page:${g.key}`:`section:${g.key}`):s.jsx(He,{title:`Select ${qe(f)?`a ${yt[f]}`:f==="pages"?"a page":f==="apps"?"an app":f==="redirects"?"a redirect":"a section"} to edit`,description:f==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),Z&&s.jsx(Al,{open:!!Z,mode:Z.mode,initialName:Z.initialName,initialPath:Z.initialPath,isPending:O.isPending,error:ie,templates:Se,validate:ue,onSubmit:b,onOpenChange:m=>{m||(ee(null),R(void 0))}}),s.jsx($l,{open:ge,isPending:O.isPending,error:xe,onSubmit:vn,onOpenChange:m=>{m||(E(!1),me(void 0))}}),fe&&s.jsx(Ll,{open:!!fe,blockKey:fe,initialName:Te.find(m=>m.key===fe)?.name??fe,isPending:O.isPending,onSubmit:bn,onOpenChange:m=>{m||be(null)}}),Ce&&s.jsx(Ro,{open:!!Ce,onOpenChange:m=>{m||we(null)},pageKey:Ce,decofile:d,onSave:m=>O.mutateAsync({blockKey:Ce,data:m})}),s.jsx(Un,{open:!!ne,onOpenChange:m=>{!m&&!St&&pe(null)},children:s.jsxs(Gn,{children:[s.jsxs(Hn,{children:[s.jsx(Jn,{children:`Delete ${En}?`}),s.jsx(Wn,{children:ne?.kind==="section"?`"${ne.label}" will be removed. Pages that still reference it will lose this section.`:ne?.kind==="blog-bulk"?`${ne.count} ${ne.count===1?"post":"posts"} will be removed permanently. This can't be undone.`:ne?`"${ne.label}" will be removed permanently. This can't be undone.`:null})]}),s.jsxs(Yn,{children:[s.jsx(qn,{disabled:St,children:"Cancel"}),s.jsx(Qn,{onClick:m=>{m.preventDefault(),_n()},disabled:St,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:St?s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"size-3.5"}),"Deleting…"]}):"Delete"})]})]})})]})}function Xa(t){const e=je.c(82),{activeCollection:n,pages:o,redirects:c,sections:l,availableSections:i,appCatalog:r,appCatalogLoading:a,blogEntries:u,decofile:x,searchQuery:d,onSearchChange:h,postCategoryFilter:p,postAuthorFilter:f,postStatusFilter:y,postSort:g,onPostCategoryFilterChange:v,onPostAuthorFilterChange:S,onPostStatusFilterChange:k,onPostSortChange:C,selectedPostKeys:w,postBulkPanelOpen:U,onTogglePostSelect:T,onSelectAllPosts:j,onClearPostSelection:I,onExitPostSelection:M,onBulkDeletePosts:F,selection:D,onSelect:z,onCreate:K,onDuplicatePage:_,onRenamePage:$,onAddPageVariant:V,onDeletePage:A,onEditPageSeo:H,onViewPageJson:X,onDuplicateSection:B,onRenameSection:J,onDeleteSection:Y,onDeleteRedirect:W,onDuplicateBlog:L,onDeleteBlog:se}=t;let re,le,oe,ae,ce,O,te;if(e[0]!==n||e[1]!==r||e[2]!==a||e[3]!==i||e[4]!==u||e[5]!==x||e[6]!==V||e[7]!==F||e[8]!==I||e[9]!==K||e[10]!==se||e[11]!==A||e[12]!==W||e[13]!==Y||e[14]!==L||e[15]!==_||e[16]!==B||e[17]!==H||e[18]!==M||e[19]!==S||e[20]!==v||e[21]!==C||e[22]!==k||e[23]!==$||e[24]!==J||e[25]!==h||e[26]!==z||e[27]!==j||e[28]!==T||e[29]!==X||e[30]!==o||e[31]!==f||e[32]!==U||e[33]!==p||e[34]!==g||e[35]!==y||e[36]!==c||e[37]!==d||e[38]!==l||e[39]!==w||e[40]!==D){const R=d.toLowerCase(),ge=o.filter(b=>!R||b.name.toLowerCase().includes(R)||b.path.toLowerCase().includes(R)),E=c.filter(b=>!R||b.from.toLowerCase().includes(R)||b.to.toLowerCase().includes(R)),xe=l.filter(b=>!R||b.name.toLowerCase().includes(R)||b.key.toLowerCase().includes(R)||b.resolveType.toLowerCase().includes(R)),me=i.filter(b=>!R||b.title.toLowerCase().includes(R)||b.resolveType.toLowerCase().includes(R)||(b.description?.toLowerCase().includes(R)??!1)),fe=Ka(xe),be=r.filter(b=>!R||b.title.toLowerCase().includes(R)||b.app.toLowerCase().includes(R)||b.vendor.toLowerCase().includes(R)||b.category.toLowerCase().includes(R)),ne=u.filter(b=>!R||b.label.toLowerCase().includes(R)||b.subtitle.toLowerCase().includes(R)),pe=n==="posts",Ce=si,we=pe?mn(x):[],Ne=new Map,Se=new Map,he={published:0,scheduled:0,draft:0};for(const b of we)he[b.status]=he[b.status]+1;for(const b of we){for(const ue of b.categorySlugs)Ne.set(ue,(Ne.get(ue)??0)+1);for(const ue of b.authorEmails)Se.set(ue,(Se.get(ue)??0)+1)}const Te=(pe?vt(x,"categories"):[]).map(b=>{const{key:ue,payload:Ae}=b,Ye=Ce(Ae.slug)||ue;return{slug:Ye,name:Ce(Ae.name)||Ce(Ae.slug)||ue,count:Ne.get(Ye)??0}}).filter(ti),$e=(pe?vt(x,"authors"):[]).map(b=>{const{key:ue,payload:Ae}=b,Ye=Ce(Ae.email);return{email:Ye,name:Ce(Ae.name)||Ce(Ae.email)||ue,count:Se.get(Ye)??0}}).filter(ei);let N;e[48]!==p?(N=b=>!p||b.categorySlugs.includes(p),e[48]=p,e[49]=N):N=e[49];let de;e[50]!==f?(de=b=>!f||b.authorEmails.includes(f),e[50]=f,e[51]=de):de=e[51];let ye;e[52]!==y?(ye=b=>!y||b.status===y,e[52]=y,e[53]=ye):ye=e[53];let Ee;e[54]!==g?(Ee=(b,ue)=>{if(g==="az")return b.title.localeCompare(ue.title);if(g==="za")return ue.title.localeCompare(b.title);const Ae=b.date.localeCompare(ue.date);return g==="date-asc"?Ae:-Ae},e[54]=g,e[55]=Ee):Ee=e[55];const ct=we.filter(b=>!R||b.title.toLowerCase().includes(R)||b.slug.toLowerCase().includes(R)).filter(N).filter(de).filter(ye).sort(Ee),et=w.size,dt=ct.map(Za),ut=dt.length>0&&dt.every(b=>w.has(b)),tt=et>0||U,At=()=>{ut?I():j(dt)},We=`Search ${n}…`,st=qe(n)?`Create new ${yt[n]}`:n==="redirects"?"Create new redirect":"Create new page",mt=n!=="apps"&&n!=="sections";ce="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let nt;e[56]===Symbol.for("react.memo_cache_sentinel")?(nt=s.jsx(Vs,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[56]=nt):nt=e[56];let Ve;e[57]!==h?(Ve=b=>h(b.target.value),e[57]=h,e[58]=Ve):Ve=e[58];let Ue;e[59]!==We||e[60]!==d||e[61]!==Ve?(Ue=s.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[nt,s.jsx("input",{type:"text",value:d,onChange:Ve,placeholder:We,"aria-label":We,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[59]=We,e[60]=d,e[61]=Ve,e[62]=Ue):Ue=e[62];let Ge;e[63]!==st||e[64]!==K||e[65]!==mt?(Ge=mt&&s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{variant:"ghost",size:"icon",onClick:K,"aria-label":st,children:s.jsx(Vn,{size:14})})}),s.jsx(Me,{side:"bottom",children:st})]}),e[63]=st,e[64]=K,e[65]=mt,e[66]=Ge):Ge=e[66],e[67]!==Ue||e[68]!==Ge?(O=s.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[Ue,Ge]}),e[67]=Ue,e[68]=Ge,e[69]=O):O=e[69],te=pe&&(tt?s.jsx(Oa,{count:et,allSelected:ut,onToggleSelectAll:At,onDelete:F,onExit:M}):s.jsx(Ea,{categories:Te,authors:$e,categoryFilter:p,statusCounts:he,authorFilter:f,statusFilter:y,sort:g,onCategoryFilterChange:v,onAuthorFilterChange:S,onStatusFilterChange:k,onSortChange:C})),re=Et,ae="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",le="flex flex-col gap-1 p-1.5",oe=n==="pages"?ge.length===0?s.jsx(at,{hasItems:o.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):ge.map(b=>{const ue=D?.collection==="pages"&&D.key===b.key,Ae=qs(x,b.key);return s.jsx(Re,{icon:jt,title:b.name,subtitle:b.path,active:ue,variantCount:Ae,onClick:()=>z({collection:"pages",key:b.key,path:b.path}),menu:s.jsx(gt,{onDuplicate:()=>_(b),onRename:()=>$(b),onAddVariant:()=>V(b),onEditSeo:()=>H(b),onViewJson:()=>X(b),onDelete:()=>A(b)})},b.key)}):n==="sections"?xe.length===0&&me.length===0?s.jsx(at,{hasItems:l.length>0||i.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):s.jsxs(s.Fragment,{children:[fe.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ps,{icon:Vt,label:"Saved sections"}),fe.map(b=>s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:b.label}),b.sections.map(ue=>{const Ae=D?.collection==="sections"&&D.key===ue.key;return s.jsx(Re,{icon:Vt,accent:"global",title:ue.name,subtitle:b.label,active:Ae,onClick:()=>z({collection:"sections",key:ue.key}),menu:s.jsx(gt,{onDuplicate:()=>B(ue),onRename:()=>J(ue),onDelete:()=>Y(ue)})},ue.key)})]},b.label))]}),me.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ps,{icon:jt,label:"Available sections",className:De(fe.length>0&&"mt-3")}),me.map(b=>{const ue=D?.collection==="available-section"&&D.resolveType===b.resolveType,Ae=b.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return s.jsx(Re,{icon:jt,title:b.title,subtitle:Ae??b.resolveType,active:ue,onClick:()=>z({collection:"available-section",resolveType:b.resolveType,title:b.title})},b.resolveType)})]})]}):n==="apps"?a?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Qe,{className:"size-4.5 text-muted-foreground"})}):be.length===0?s.jsx(at,{hasItems:r.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):be.map(b=>{const ue=D?.collection==="apps"&&b.blockKey!==null&&D.key===b.blockKey;return s.jsx(Re,{icon:zs,logoUrl:b.logo,title:b.title,subtitle:b.category,active:ue,trailing:b.installed?s.jsx("span",{className:"shrink-0 rounded-full bg-success/15 px-1.5 py-0.5 text-[10px] font-medium text-success",children:"Installed"}):void 0,onClick:()=>{if(!b.installed||!b.blockKey){ve.message(`${b.title} is not installed on this site.`);return}z({collection:"apps",key:b.blockKey})}},b.id)}):n==="redirects"?E.length===0?s.jsx(at,{hasItems:c.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):E.map(b=>s.jsx(Re,{icon:Os,title:b.from||"(no source)",subtitle:`→ ${b.to||"(no target)"}`,active:D?.collection==="redirects"&&D.key===b.key,trailing:s.jsx(Ol,{type:b.type}),onClick:()=>z({collection:"redirects",key:b.key}),menu:s.jsx(gt,{onDelete:()=>W(b)})},b.key)):pe?ct.length===0?s.jsx(at,{hasItems:we.length>0,emptyLabel:"No posts yet.",emptyHint:'Click "+" to create your first post.'}):ct.map(b=>{const ue={key:b.key,kind:"posts",label:b.title,subtitle:b.slug};return s.jsx(Re,{icon:Ut,title:b.title,subtitle:b.slug||"no slug",invalid:b.missing.length>0,invalidReason:`Missing: ${b.missing.join(", ")}`,active:D?.collection==="posts"&&D.key===b.key,selectable:!0,selectionActive:tt,selected:w.has(b.key),onToggleSelect:()=>T(b.key),onClick:()=>tt?T(b.key):z({collection:"posts",key:b.key}),menu:s.jsx(gt,{onDuplicate:()=>L(ue),onDelete:()=>se(ue)})},b.key)}):ne.length===0?s.jsx(at,{hasItems:u.length>0,emptyLabel:`No ${n} yet.`,emptyHint:`Click "+" to create your first ${qe(n)?yt[n]:"item"}.`}):ne.map(b=>{const ue=D?.collection===b.kind&&D.key===b.key;return s.jsx(Re,{icon:b.kind==="posts"?Ut:b.kind==="authors"?Us:Fs,title:b.label,subtitle:b.subtitle,active:ue,onClick:()=>z({collection:b.kind,key:b.key}),menu:s.jsx(gt,{onDuplicate:()=>L(b),onDelete:()=>se(b)})},b.key)}),e[0]=n,e[1]=r,e[2]=a,e[3]=i,e[4]=u,e[5]=x,e[6]=V,e[7]=F,e[8]=I,e[9]=K,e[10]=se,e[11]=A,e[12]=W,e[13]=Y,e[14]=L,e[15]=_,e[16]=B,e[17]=H,e[18]=M,e[19]=S,e[20]=v,e[21]=C,e[22]=k,e[23]=$,e[24]=J,e[25]=h,e[26]=z,e[27]=j,e[28]=T,e[29]=X,e[30]=o,e[31]=f,e[32]=U,e[33]=p,e[34]=g,e[35]=y,e[36]=c,e[37]=d,e[38]=l,e[39]=w,e[40]=D,e[41]=re,e[42]=le,e[43]=oe,e[44]=ae,e[45]=ce,e[46]=O,e[47]=te}else re=e[41],le=e[42],oe=e[43],ae=e[44],ce=e[45],O=e[46],te=e[47];let Z;e[70]!==le||e[71]!==oe?(Z=s.jsx("div",{className:le,children:oe}),e[70]=le,e[71]=oe,e[72]=Z):Z=e[72];let ee;e[73]!==re||e[74]!==ae||e[75]!==Z?(ee=s.jsx(re,{className:ae,children:Z}),e[73]=re,e[74]=ae,e[75]=Z,e[76]=ee):ee=e[76];let ie;return e[77]!==ce||e[78]!==O||e[79]!==te||e[80]!==ee?(ie=s.jsxs("div",{className:ce,children:[O,te,ee]}),e[77]=ce,e[78]=O,e[79]=te,e[80]=ee,e[81]=ie):ie=e[81],ie}function Za(t){return t.key}function ei(t){return t.email}function ti(t){return t.slug}function si(t){return typeof t=="string"?t:""}function ni(t){const e=je.c(25),{virtualMcpId:n}=t,o=Be(),[c,l]=G.useState(!1),i=Zs(n),{activeTask:r}=$s();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const u=Bs(a);if(!(ms(i?.metadata)||ms(r?.metadata))){let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:s.jsx(fs,{className:"size-7 text-foreground"})}),e[1]=h):h=e[1];let p;e[2]!==o?(p=o("mainPanelTabs.contentTab.noContentToEdit"),e[2]=o,e[3]=p):p=e[3];let f;e[4]!==o?(f=o("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=o,e[5]=f):f=e[5];let y,g;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>l(!0),g=s.jsx(fs,{className:"size-4"}),e[6]=y,e[7]=g):(y=e[6],g=e[7]);let v;e[8]!==o?(v=o("mainPanelTabs.previewTab.connectGithub"),e[8]=o,e[9]=v):v=e[9];let S;e[10]!==v?(S=s.jsxs(Oe,{onClick:y,children:[g,v]}),e[10]=v,e[11]=S):S=e[11];let k;e[12]!==p||e[13]!==f||e[14]!==S?(k=s.jsx(nl,{className:"h-full",image:h,title:p,description:f,actions:S}),e[12]=p,e[13]=f,e[14]=S,e[15]=k):k=e[15];let C;e[16]!==c?(C=s.jsx(ol,{open:c,onOpenChange:l,mode:"agent"}),e[16]=c,e[17]=C):C=e[17];let w;return e[18]!==C||e[19]!==k?(w=s.jsxs(s.Fragment,{children:[k,C]}),e[18]=C,e[19]=k,e[20]=w):w=e[20],w}let d;return e[21]!==u.contentPageId||e[22]!==u.contentPath||e[23]!==u.contentPathTemplate?(d=s.jsx(Ya,{deepLinkPage:{pageId:u.contentPageId,path:u.contentPath,pathTemplate:u.contentPathTemplate}}),e[21]=u.contentPageId,e[22]=u.contentPath,e[23]=u.contentPathTemplate,e[24]=d):d=e[24],d}function oi(){const t=je.c(2),e=ll();let n;return t[0]!==e?(n=s.jsx(Bn,{tabId:"content",children:s.jsx($n,{feature:"cms",children:s.jsx(ni,{virtualMcpId:e})})}),t[0]=e,t[1]=n):n=t[1],n}const ir=Object.freeze(Object.defineProperty({__proto__:null,default:oi},Symbol.toStringTag,{value:"Module"}));export{oa as A,or as B,ir as C,Xi as M,Qi as W,lr as a,it as b,ar as c,Ji as d,Hi as e,Wi as f,xt as g,Yl as h,Ql as i,qi as j,mn as k,vt as l,cn as m,Cl as n,Yi as o,un as p,Zi as q,il as r,xs as s,tr as t,ra as u,Xe as v,sr as w,er as x,nr as y,Pt as z};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-BvFwnnVI.js","assets/index-BaUCsY53.js","assets/index-xA_kfo6T.css","assets/chat-context-TwAso_gH.js","assets/use-panel-navigate-11comAbX.js","assets/thread-route-CqH_sM7h.js","assets/use-project-scope-D-IBCwWL.js","assets/use-virtual-mcp-B6rtU_oH.js","assets/use-mcp-client-_WZbaqFW.js","assets/auth-CQFvi4px.js","assets/github-repo-BknN0SVI.js","assets/autosend-Bq5HvwxJ.js","assets/thread-intent-D1qHfbwN.js","assets/slugify-CEUa2lfQ.js","assets/hooks-OnvEvvEV.js","assets/backoff-8mStPHYB.js","assets/task-board--muk7VRH.js","assets/schema-BlqfB0t-.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-entitlements-CaMElBtz.js","assets/use-ai-providers-35xFsuWH.js","assets/location-oTTXFrSF.js","assets/use-decopilot-events-DTs9feev.js","assets/use-organization-settings-D2bS0z2Y.js","assets/scroll-area-CcTiw04W.js","assets/select-CbjypzjH.js","assets/index-Dwz6P534.js","assets/Check-DPdzciCh.js","assets/ChevronUp-DEIyJ_Vu.js","assets/use-section-preview-base-Byx7bmxl.js","assets/UserSquare-Bn9Rv2_g.js","assets/agent-icon-DCx4QvHC.js","assets/AlertCircle-rBOBLMTR.js","assets/Tool01-BKMWbMJa.js","assets/ArrowUp-T0MWJ7w1.js","assets/ArrowLeft-CuO4jsW4.js","assets/ArrowRight-BhK2Drg3.js","assets/XCircle-B9OjNR50.js","assets/ZoomOut-DdnLTgRO.js","assets/Globe04-FrRMGL3L.js","assets/CheckCircle-hKNQmIDB.js","assets/Copy01-BpK5Df3h.js","assets/CreditCard01-BJmBLHK1.js","assets/DotsVertical-vgn5Fh71.js","assets/Download01-8R1CnQwL.js","assets/Eye-9R53138J.js","assets/Share07-oJ1NPf0p.js","assets/XClose-edLJbxCC.js","assets/Image01-CpS3B5dq.js","assets/Key01-Cs7m7Vrv.js","assets/LayoutLeft-Ctww3Qqs.js","assets/Link01-CYM_hI21.js","assets/LinkExternal01-CaGzeOaP.js","assets/Monitor01-Cbr91rpd.js","assets/Sun-DyXA1H1E.js","assets/Package-BCrcbLGQ.js","assets/Palette-DaQdQhd0.js","assets/Plus-QBDZRDJ8.js","assets/SearchLg-GScJDtAM.js","assets/SearchMd-CDlpYmI0.js","assets/Stars01-D5FZ-lZv.js","assets/Trash01-BB5hjVuV.js","assets/Upload01-BaewsYxJ.js","assets/User01-98m9yDHn.js","assets/Users01-BTKiM2ut.js","assets/X-CyAhP1La.js","assets/Zap-BZIP6Nks.js","assets/dialog-B_W1p_MX.js","assets/input-BeZHRoN0.js","assets/claim-phase-copy-0btUuJoC.js","assets/section-preview-url-Csj0_ZDg.js","assets/use-session-runtime-Byx8MafX.js","assets/runnable-block-editor-CPrAfsrO.js","assets/decofile-api-C865MOuX.js","assets/utils-Cp06mEvu.js","assets/sandbox-url-D3mC8qhT.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-CNSuc9Tx.js","assets/format-time-BtXRrtv4.js","assets/differenceInSeconds-C3x8sHUj.js","assets/collapsible-DPu-d7yP.js","assets/use-copy-BO1bkgoB.js","assets/usage-stats-Cm3pAzyE.js","assets/markdown-C4yXnGlQ.js","assets/org-file-open-context-BHgP4Bt_.js","assets/use-mobile-Cm9Gzoc8.js","assets/tooltip-BdQDXOHs.js","assets/shell-layout-BMa1UITe.js","assets/avatar-BStcvNht.js","assets/download-app-dialog-un8Y2qtJ.js","assets/command-cPei63M2.js","assets/index-DJgUu6Ow.js","assets/integration-icon-DddQCTLH.js","assets/project-icon-BcwIVgAi.js","assets/required-auth-layout-RPewxiQ7.js","assets/use-org-sso-0vqSrOQw.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-CIoGKh0L.js","assets/types-CIf9swM1.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/gateway-client-V99FM7uw.js","assets/tool-namespace-DmnQIdtF.js","assets/utils-CVEq3hMx.js","assets/sheet-CxPYeVzh.js","assets/use-connection-BG2oq1yI.js","assets/use-navigate-to-agent-DawRJCtN.js","assets/use-mcp-prompts-Dffc2JiM.js","assets/index-AQ7a_nLC.js","assets/form-C-wJTrTS.js","assets/label-DyuYvOXR.js","assets/use-thread-outputs-_jEERbVH.js","assets/file-type-icon-CmhUTJY2.js","assets/popover-CfjNVxcy.js","assets/monaco-editor-ZVPCDy8r.js","assets/editor-CVUFFrZi.js","assets/calendar-BwaCdvxO.js","assets/textarea-o1CAWPw5.js","assets/rich-text-link-control-D4SUwojL.js","assets/switch-BRCfrFjR.js","assets/search-input-B3fXKYgx.js","assets/tabs-RYmBG5CW.js","assets/use-debounced-value-BvTGvr8H.js","assets/use-file-configs-DUSWDNVW.js","assets/asset-utils-D5cIpzz_.js","assets/useInfiniteQuery-BdpYc7ny.js","assets/infiniteQueryObserver-CFGlXSE6.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/toggle-group-IueCKZm2.js","assets/alert-dialog-pQ2rDgy1.js","assets/sandbox-git-api-B1R0585s.js","assets/agent-view-guard-_Ag6Wipz.js","assets/use-main-panel-tabs-BmlQ7IRN.js","assets/use-route-default-main-DvabDAyh.js","assets/use-mcp-tools-8dhwnFZE.js","assets/index-C38ogrVR.js","assets/drawer-B8-404ai.js","assets/collection-search-CWmqsx8-.js","assets/input-CgGJMTjB.js","assets/chat-draft-DE3pPme6.js","assets/use-deco-credits-Y9if5MSD.js","assets/use-open-billing-url-7OBYPnFU.js","assets/decopilot-Bz3gxXOj.js","assets/checkbox-ZOt4c7SO.js","assets/ai-providers-logos-DD3qZ33J.js","assets/index-C5hwpgvj.js","assets/input-DWjaAW1q.js","assets/hooks-B-eo4ZkC.js","assets/use-org-fs-ZJnajDst.js","assets/question-004-sINsf4GQ.js","assets/use-members-DXr_yYWh.js","assets/use-org-auth-client-DFrA1d0C.js","assets/feature-paywall-DKgY1ug6.js","assets/plan-ladder-4OG8gxXk.js","assets/add-connection-dialog-DkRnizyZ.js","assets/extract-connection-data-BkAkT_y6.js","assets/metadata-D72DunRR.js","assets/connection-Dm0MNEG4.js","assets/connection-card-rwekWkEE.js","assets/connection-slug-CITJ0kGN.js","assets/connection-form-helpers-DIK4pNs8.js","assets/authenticate-and-persist-oauth-D0OQGpFS.js","assets/mcp-oauth-CKC35fM0.js","assets/collection-tabs-CB2d3WMR.js","assets/badge-gamI6wY6.js","assets/use-infinite-scroll-CAVOqDLL.js","assets/useSuspenseInfiniteQuery-Be9hvwi2.js","assets/sandbox-lifecycle-context-DDXdy5Um.js","assets/use-task-metadata-DO-xqWSk.js","assets/use-project-native-view-presence-B2gAg465.js","assets/site-slug-uya6Wp4-.js","assets/virtual-mcp-DJ3kz63h.js","assets/feature-gate-CLprskBn.js","assets/mustache-BKCalyZ3.js","assets/empty-state-CBmfAeTK.js","assets/github-icon-D3voba1_.js","assets/repository-import-picker-9ArSxGfl.js","assets/repository-picker-DvlVOtfD.js","assets/post-editor-D1cbn1uM.js","assets/multi-select-Cy4uEt5t.js","assets/block-document-DI383-kK.js","assets/index-CsLxM554.js","assets/primitives-tALvZrdy.js","assets/use-fast-preview-draft-url-BcKKz-yw.js","assets/use-autosave-BHlJuMUR.js","assets/record-editor-DsGWfuGc.js","assets/category-editor-PjVafxmN.js","assets/bulk-category-panel-BM2yDxDT.js","assets/index-Bwvc4gj1.js","assets/sections-editor-CCdVMsOX.js","assets/page-seo-form-CB3dZVsI.js","assets/variant-matcher-override-B6pOTot_.js","assets/seo-editor-DRs_jGJ9.js","assets/variant-calendar-CHV7Bmlb.js","assets/view-mode-toggle-d-OLFzU5.js","assets/post-calendar-BcZ1isTp.js","assets/alert-BTUlvH1R.js","assets/redirect-editor-aLV6ur5L.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as je,j as s,m as Ds,K as As,b as Be,l as De,r as G,h as Qe,B as Oe,am as Kt,t as ve,aB as bt,aK as pt,F as It,aC as is,H as Mt,I as zt,G as lt,aL as Bt,aM as Dn,a0 as An,u as Bs,aI as Fe}from"./index-BaUCsY53.js";import{A as Bn}from"./agent-view-guard-_Ag6Wipz.js";import{F as $n}from"./feature-gate-CLprskBn.js";import{u as _t,b as $s}from"./chat-context-TwAso_gH.js";import{i as Ls}from"./AlertCircle-rBOBLMTR.js";import{z as jt,K as Os,L as Rs,M as Fs,N as Ln,O as On,P as Ks,Q as Rn,j as Vt,F as Is,R as Fn,S as Kn,T as In,x as Ms,U as Mn,V as zn}from"./agent-icon-DCx4QvHC.js";import{i as Ut}from"./ZoomOut-DdnLTgRO.js";import{c as zs}from"./XClose-edLJbxCC.js";import{s as Vn}from"./Plus-QBDZRDJ8.js";import{i as Vs}from"./SearchLg-GScJDtAM.js";import{t as Us}from"./Users01-BTKiM2ut.js";import{f as Un,e as Gn,b as Hn,A as Jn,a as Wn,d as Yn,c as qn,g as Qn}from"./alert-dialog-pQ2rDgy1.js";import{S as Et}from"./scroll-area-CcTiw04W.js";import{T as Ie,a as Me,c as ze}from"./tooltip-BdQDXOHs.js";import{S as $t,j as Xn,c as Zn,g as Gs,B as Lt,P as eo,k as to,n as so,o as no,u as Hs,l as oo,q as lo,R as ao,s as Js,r as io,t as ro,d as Ws,v as co,w as uo,x as Ys,y as mo,M as fo,h as po,z as ho,p as go,A as xo,C as bo,e as yo,f as vo,D as rs,E as qs,i as So,F as ko}from"./runnable-block-editor-CPrAfsrO.js";import{r as Jt,S as jo,l as Wt,i as Co,m as wo,o as No,n as Ct,v as Po,R as Qs,G as Yt,g as To,q as _o,e as cs,t as Eo,d as Do,u as Ao,w as ds,h as Bo,x as $o,y as Lo}from"./claim-phase-copy-0btUuJoC.js";import{u as Oo,P as Ro}from"./mustache-BKCalyZ3.js";import{t as qt}from"./ChevronUp-DEIyJ_Vu.js";import{i as Xs}from"./Zap-BZIP6Nks.js";import{C as Fo,a as Ko,b as Io}from"./collapsible-DPu-d7yP.js";import{c as Mo,d as zo}from"./sandbox-lifecycle-context-DDXdy5Um.js";import{u as Vo}from"./use-session-runtime-Byx8MafX.js";import{c as Qt,d as Xt,e as Zt,b as es,D as ts,h as Uo}from"./dialog-B_W1p_MX.js";import{I as rt}from"./input-BeZHRoN0.js";import{C as ss}from"./checkbox-ZOt4c7SO.js";import{L as Ot}from"./label-DyuYvOXR.js";import{c as Go,b as Ho,a as Jo,d as Wo,S as Yo}from"./select-CbjypzjH.js";import{a as Zs,d as en}from"./use-virtual-mcp-B6rtU_oH.js";import{i as qo,a as us}from"./Share07-oJ1NPf0p.js";import{c as Qo,b as Xo,s as Zo}from"./XCircle-B9OjNR50.js";import{i as ns}from"./X-CyAhP1La.js";import"./rich-text-link-control-D4SUwojL.js";import{M as el}from"./monaco-editor-ZVPCDy8r.js";import{s as tn}from"./Trash01-BB5hjVuV.js";import{a as tl}from"./Copy01-BpK5Df3h.js";import{b as sl}from"./Tool01-BKMWbMJa.js";import{b as ms}from"./use-project-scope-D-IBCwWL.js";import{E as nl}from"./empty-state-CBmfAeTK.js";import{G as fs}from"./github-icon-D3voba1_.js";import{R as ol}from"./repository-import-picker-9ArSxGfl.js";import{b as ll}from"./thread-route-CqH_sM7h.js";function al(t,e){if(!t||!e?.length)return t;const n=Object.fromEntries(Object.entries(t.properties??{}).filter(([o])=>!e.includes(o)));return Object.keys(n).length>0?{...t,properties:n}:t}function il(t,e,n){return typeof t!="string"?null:al(Jt(t,e),n)}function sn(t,e,n){if(!e||typeof t!="string")return!1;const o=il(t,e,n);return!!o&&Object.keys(o.properties??{}).length>0}function at(t){const e=je.c(6),{hasItems:n,emptyLabel:o,emptyHint:c}=t;let l;e[0]!==c||e[1]!==o||e[2]!==n?(l=n?"No results match your search.":s.jsxs(s.Fragment,{children:[s.jsx("div",{children:o}),s.jsx("div",{className:"mt-1 text-muted-foreground/80",children:c})]}),e[0]=c,e[1]=o,e[2]=n,e[3]=l):l=e[3];let i;return e[4]!==l?(i=s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l}),e[4]=l,e[5]=i):i=e[5],i}function Dt(t,e){return`${t}-${e}`}function nn(t,e){return`site/apps/${t}/${e}.ts`}function on(t){const e=t.match(/^site\/apps\/([^/]+)\/([^/.]+)\.tsx?$/);if(e)return{vendor:e[1],app:e[2]};const n=t.match(/^([^/]+)\/apps\/([^/.]+)\.tsx?$/);return n?{vendor:n[1],app:n[2]}:null}function rl(t){const e=t.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function cl(t){return t==="local"?"Custom":"Installed"}function ln(t,e,n){const o=new Set([Dt(t,e),e].map(l=>l.toLowerCase())),c=nn(t,e);for(const[l,i]of Object.entries(n)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const r=i;if(o.has(l.toLowerCase())||r.__resolveType===c)return l}return null}function dl(t,e){const n=t.vendor.alias,o=t.name,c=ln(n,o,e);return{id:Dt(n,o),app:o,vendor:n,title:t.title||t.name,description:t.description,category:t.category??"Other",logo:t.logo||void 0,resolveType:nn(n,o),blockKey:c,installed:c!==null}}function ul(t,e,n){if(t===jo)return null;const o=on(t);if(!o)return null;const{vendor:c,app:l}=o,i=ln(c,l,n),r=Wt(t,e);return{id:Dt(c,l),app:l,vendor:c,title:r.title??l,description:r.description??"",category:"Others",logo:r.logo??r.icon,resolveType:t,blockKey:i,installed:i!==null}}function ml(t,e,n){const o=e.__resolveType;if(typeof o!="string"||Co(t,e)||!wo(o))return null;const c=on(o)??rl(t);if(!c)return null;const l=Wt(o,n),{vendor:i,app:r}=c;return{id:Dt(i,r),app:r,vendor:i,title:l.title??No(t,e,n),description:l.description??"",category:cl(i),logo:l.logo??l.icon,resolveType:o,blockKey:t,installed:!0}}function fl(t,e,n){const o=new Map;for(const l of t){const i=dl(l,n);o.set(i.id,i)}const c=e.manifest?.blocks?.apps??{};for(const l of Object.keys(c)){const i=ul(l,e,n);!i||o.has(i.id)||o.set(i.id,i)}for(const[l,i]of Object.entries(n)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const r=ml(l,i,e);!r||o.has(r.id)||o.set(r.id,r)}return[...o.values()].sort(pl)}function pl(t,e){return t.installed!==e.installed?t.installed?-1:1:t.title.localeCompare(e.title)}async function hl(){const t=await fetch("/api/deco-apps");if(!t.ok)throw new Error(`Failed to fetch deco apps: ${t.status}`);return(await t.json()).apps??[]}function gl(t,e,n){const o=je.c(12),c=n?.enabled??!0;let l;o[0]===Symbol.for("react.memo_cache_sentinel")?(l=As.decoApps(),o[0]=l):l=o[0];let i;o[1]!==c?(i={queryKey:l,queryFn:hl,staleTime:3e5,retry:1,enabled:c},o[1]=c,o[2]=i):i=o[2];const r=Ds(i);let a;o[3]!==e||o[4]!==t||o[5]!==r.data?(a=t&&e?fl(r.data??[],t,e):[],o[3]=e,o[4]=t,o[5]=r.data,o[6]=a):a=o[6];const u=a,x=r.isLoading&&!r.isError;let d;return o[7]!==u||o[8]!==r.isError||o[9]!==r.refetch||o[10]!==x?(d={catalog:u,isLoading:x,isError:r.isError,refetch:r.refetch},o[7]=u,o[8]=r.isError,o[9]=r.refetch,o[10]=x,o[11]=d):d=o[11],d}const xl=["sections","apps","loaders","actions"];function bl(t){const e=je.c(59),{active:n,counts:o,showBlog:c,onSelect:l}=t,i=Be();let r;e[0]!==i?(r=i("sandbox.collectionsSidebar.content"),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==r?(a=s.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:s.jsx("span",{className:"text-sm font-medium",children:r})}),e[2]=r,e[3]=a):a=e[3];let u;e[4]!==i?(u=i("sandbox.collectionsSidebar.pages"),e[4]=i,e[5]=u):u=e[5];const x=n==="pages";let d;e[6]!==o.pages||e[7]!==l||e[8]!==u||e[9]!==x?(d=s.jsx(Le,{id:"pages",icon:jt,label:u,count:o.pages,active:x,onSelect:l}),e[6]=o.pages,e[7]=l,e[8]=u,e[9]=x,e[10]=d):d=e[10];let h;e[11]!==i?(h=i("sandbox.collectionsSidebar.redirects"),e[11]=i,e[12]=h):h=e[12];const p=n==="redirects";let f;e[13]!==o.redirects||e[14]!==l||e[15]!==h||e[16]!==p?(f=s.jsx(Le,{id:"redirects",icon:Os,label:h,count:o.redirects,active:p,onSelect:l}),e[13]=o.redirects,e[14]=l,e[15]=h,e[16]=p,e[17]=f):f=e[17];let y;e[18]!==i?(y=i("sandbox.collectionsSidebar.site"),e[18]=i,e[19]=y):y=e[19];const g=n==="site";let v;e[20]!==l||e[21]!==g||e[22]!==y?(v=s.jsx(Le,{id:"site",icon:On,label:y,active:g,onSelect:l}),e[20]=l,e[21]=g,e[22]=y,e[23]=v):v=e[23];let S;e[24]!==i?(S=i("sandbox.collectionsSidebar.seo"),e[24]=i,e[25]=S):S=e[25];const k=n==="seo";let C;e[26]!==l||e[27]!==S||e[28]!==k?(C=s.jsx(Le,{id:"seo",icon:Ks,label:S,active:k,onSelect:l}),e[26]=l,e[27]=S,e[28]=k,e[29]=C):C=e[29];let w;e[30]!==i?(w=i("sandbox.collectionsSidebar.calendar"),e[30]=i,e[31]=w):w=e[31];const U=n==="calendar";let T;e[32]!==l||e[33]!==w||e[34]!==U?(T=s.jsx(Le,{id:"calendar",icon:Rn,label:w,active:U,onSelect:l}),e[32]=l,e[33]=w,e[34]=U,e[35]=T):T=e[35];let j;e[36]!==n||e[37]!==o||e[38]!==l?(j=s.jsx(yl,{active:n,counts:o,onSelect:l}),e[36]=n,e[37]=o,e[38]=l,e[39]=j):j=e[39];let I;e[40]!==n||e[41]!==o.authors||e[42]!==o.categories||e[43]!==o.posts||e[44]!==l||e[45]!==c||e[46]!==i?(I=c&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mt-3 flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",children:[s.jsx(Rs,{size:13,className:"shrink-0"}),i("sandbox.collectionsSidebar.blog")]}),s.jsx(Le,{id:"posts",icon:Ut,label:i("sandbox.collectionsSidebar.posts"),count:o.posts,active:n==="posts",onSelect:l}),s.jsx(Le,{id:"authors",icon:Us,label:i("sandbox.collectionsSidebar.authors"),count:o.authors,active:n==="authors",onSelect:l}),s.jsx(Le,{id:"categories",icon:Fs,label:i("sandbox.collectionsSidebar.categories"),count:o.categories,active:n==="categories",onSelect:l}),s.jsx(Le,{id:"post-schedule",icon:Ln,label:i("sandbox.collectionsSidebar.postSchedule"),active:n==="post-schedule",onSelect:l})]}),e[40]=n,e[41]=o.authors,e[42]=o.categories,e[43]=o.posts,e[44]=l,e[45]=c,e[46]=i,e[47]=I):I=e[47];let M;e[48]!==v||e[49]!==C||e[50]!==T||e[51]!==j||e[52]!==I||e[53]!==d||e[54]!==f?(M=s.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[d,f,v,C,T,j,I]}),e[48]=v,e[49]=C,e[50]=T,e[51]=j,e[52]=I,e[53]=d,e[54]=f,e[55]=M):M=e[55];let F;return e[56]!==a||e[57]!==M?(F=s.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[a,M]}),e[56]=a,e[57]=M,e[58]=F):F=e[58],F}function yl(t){const e=je.c(52),{active:n,counts:o,onSelect:c}=t,l=Be();let i;e[0]!==n?(i=xl.includes(n),e[0]=n,e[1]=i):i=e[1];const r=i,[a,u]=G.useState(!1),x=a||r;let d,h;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=De("flex w-full items-center gap-2 classic:rounded-md compact:rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer","text-muted-foreground hover:bg-muted hover:text-foreground"),h=s.jsx(Fn,{size:16,className:"shrink-0"}),e[2]=d,e[3]=h):(d=e[2],h=e[3]);let p;e[4]!==l?(p=l("sandbox.collectionsSidebar.advanced"),e[4]=l,e[5]=p):p=e[5];let f;e[6]!==p?(f=s.jsx("span",{className:"flex-1 truncate",children:p}),e[6]=p,e[7]=f):f=e[7];const y=x&&"rotate-180";let g;e[8]!==y?(g=De("shrink-0 text-muted-foreground/70 transition-transform",y),e[8]=y,e[9]=g):g=e[9];let v;e[10]!==g?(v=s.jsx(qt,{size:16,className:g}),e[10]=g,e[11]=v):v=e[11];let S;e[12]!==f||e[13]!==v?(S=s.jsxs(Fo,{className:d,children:[h,f,v]}),e[12]=f,e[13]=v,e[14]=S):S=e[14];let k;e[15]!==l?(k=l("sandbox.collectionsSidebar.sections"),e[15]=l,e[16]=k):k=e[16];const C=n==="sections";let w;e[17]!==o.sections||e[18]!==c||e[19]!==k||e[20]!==C?(w=s.jsx(Le,{id:"sections",icon:Vt,label:k,count:o.sections,active:C,onSelect:c,indent:!0}),e[17]=o.sections,e[18]=c,e[19]=k,e[20]=C,e[21]=w):w=e[21];let U;e[22]!==l?(U=l("sandbox.collectionsSidebar.apps"),e[22]=l,e[23]=U):U=e[23];const T=n==="apps";let j;e[24]!==o.apps||e[25]!==c||e[26]!==U||e[27]!==T?(j=s.jsx(Le,{id:"apps",icon:zs,label:U,count:o.apps,active:T,onSelect:c,indent:!0}),e[24]=o.apps,e[25]=c,e[26]=U,e[27]=T,e[28]=j):j=e[28];let I;e[29]!==l?(I=l("sandbox.collectionsSidebar.loaders"),e[29]=l,e[30]=I):I=e[30];const M=n==="loaders";let F;e[31]!==o.loaders||e[32]!==c||e[33]!==I||e[34]!==M?(F=s.jsx(Le,{id:"loaders",icon:Is,label:I,count:o.loaders,active:M,onSelect:c,indent:!0}),e[31]=o.loaders,e[32]=c,e[33]=I,e[34]=M,e[35]=F):F=e[35];let D;e[36]!==l?(D=l("sandbox.collectionsSidebar.actions"),e[36]=l,e[37]=D):D=e[37];const z=n==="actions";let K;e[38]!==o.actions||e[39]!==c||e[40]!==D||e[41]!==z?(K=s.jsx(Le,{id:"actions",icon:Xs,label:D,count:o.actions,active:z,onSelect:c,indent:!0}),e[38]=o.actions,e[39]=c,e[40]=D,e[41]=z,e[42]=K):K=e[42];let _;e[43]!==w||e[44]!==j||e[45]!==F||e[46]!==K?(_=s.jsxs(Ko,{className:"flex flex-col gap-0.5 pt-0.5",children:[w,j,F,K]}),e[43]=w,e[44]=j,e[45]=F,e[46]=K,e[47]=_):_=e[47];let $;return e[48]!==x||e[49]!==_||e[50]!==S?($=s.jsxs(Io,{open:x,onOpenChange:u,children:[S,_]}),e[48]=x,e[49]=_,e[50]=S,e[51]=$):$=e[51],$}function Le(t){const e=je.c(19),{id:n,icon:o,label:c,count:l,active:i,onSelect:r,indent:a}=t;let u;e[0]!==n||e[1]!==r?(u=()=>r(n),e[0]=n,e[1]=r,e[2]=u):u=e[2];const x=a&&"pl-6",d=i?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let h;e[3]!==x||e[4]!==d?(h=De("flex w-full items-center gap-2 classic:rounded-md compact:rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",x,d),e[3]=x,e[4]=d,e[5]=h):h=e[5];let p;e[6]!==o?(p=s.jsx(o,{size:16,className:"shrink-0"}),e[6]=o,e[7]=p):p=e[7];let f;e[8]!==c?(f=s.jsx("span",{className:"flex-1 truncate",children:c}),e[8]=c,e[9]=f):f=e[9];let y;e[10]!==i||e[11]!==l?(y=l!==void 0&&s.jsx("span",{className:De("shrink-0 text-xs tabular-nums",i?"text-accent-foreground/70":"text-muted-foreground/70"),children:l}),e[10]=i,e[11]=l,e[12]=y):y=e[12];let g;return e[13]!==u||e[14]!==h||e[15]!==p||e[16]!==f||e[17]!==y?(g=s.jsxs("button",{type:"button",onClick:u,className:h,children:[p,f,y]}),e[13]=u,e[14]=h,e[15]=p,e[16]=f,e[17]=y,e[18]=g):g=e[18],g}function vl(t){const e=je.c(12),{state:n,claimPhase:o,lifecycle:c,onStart:l,connectionsHref:i}=t;switch(n.kind){case"starting":{let r;e[0]!==o||e[1]!==c?(r=Xn({claimPhase:o,lifecycle:c}),e[0]=o,e[1]=c,e[2]=r):r=e[2];let a;return e[3]!==o||e[4]!==r?(a=s.jsx($t,{kind:"starting",progress:r,claimPhase:o}),e[3]=o,e[4]=r,e[5]=a):a=e[5],a}case"suspended":{let r;return e[6]!==l?(r=s.jsx($t,{kind:"suspended",onResume:l}),e[6]=l,e[7]=r):r=e[7],r}case"errored":{let r;return e[8]!==i||e[9]!==l||e[10]!==n.error?(r=s.jsx($t,{kind:"errored",error:n.error,onRetry:l,connectionsHref:i}),e[8]=i,e[9]=l,e[10]=n.error,e[11]=r):r=e[11],r}}}const Sl=new Set(["clone-failed","install-failed","start-failed","crashed"]);function kl(t){if(t.fastPreviewActive)return{kind:"ready",devServerReady:!1,sandboxWarming:!1};if(t.previewState.kind!=="iframe")return{kind:"sandbox-card",state:t.previewState};const e=t.lifecyclePhase==="running",n=!e&&!Sl.has(t.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:n}}function ps(t,e){const n=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),o=`${n} (copy)`;if(!t.has(o))return o;for(let c=2;c<1e3;c++){const l=`${n} (copy ${c})`;if(!t.has(l))return l}return`${n} (copy ${Date.now()})`}function jl(t,e){const n=Ct,o=e.replace(/-copy(?:-\d+)?$/,""),c=`${o}-copy`;if(!t.has(n(c)))return c;for(let l=2;l<1e3;l++){const i=`${o}-copy-${l}`;if(!t.has(n(i)))return i}return`${o}-copy-${Date.now()}`}function Cl(t,e){const n=e.replace(/_copy(?:_\d+)?$/,""),o=`${n}_copy`;if(!Object.hasOwn(t,o))return o;for(let c=2;c<1e3;c++){const l=`${n}_copy_${c}`;if(!Object.hasOwn(t,l))return l}return`${n}_copy_${Date.now()}`}function wl(t){const e=Gs(t.newName),n={...t.source,name:t.newName,path:t.newPath};return{key:e,data:n}}function Nl(t,e){return Zn(t,e)}const Pl=1e3;function Tl(t,e){for(let n=0;n<Pl;n++){const o=Gs(e);if(!Object.hasOwn(t,o))return o}throw new Error("Could not generate a unique page block key")}const _l={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},El={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},Dl={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function Al(t){const e=je.c(88),{open:n,mode:o,initialName:c,initialPath:l,isPending:i,error:r,templates:a,validate:u,onSubmit:x,onOpenChange:d}=t,h=i===void 0?!1:i,p=Be(),[f,y]=G.useState(c),[g,v]=G.useState(l),[S,k]=G.useState(Lt),[C,w]=G.useState(null),[U,T]=G.useState(n);n!==U&&(T(n),n&&(y(c),v(l),k(Lt),w(null)));const j=o==="create"&&!!a?.length;let I;e[0]!==h||e[1]!==d?(I=me=>{!me&&!h&&(w(null),d(!1))},e[0]=h,e[1]=d,e[2]=I):I=e[2];const M=I;let F;e[3]!==h||e[4]!==f||e[5]!==x||e[6]!==g||e[7]!==j||e[8]!==S||e[9]!==u?(F=async me=>{me.preventDefault();const fe=f.trim(),be=g.trim();if(!fe||!be||h)return;const ne=Po(be);if(ne){w(ne);return}const pe=u?.({name:fe,path:be});if(pe){w(pe);return}w(null),await x({name:fe,path:be,templateKey:j&&S!==Lt?S:null})},e[3]=h,e[4]=f,e[5]=x,e[6]=g,e[7]=j,e[8]=S,e[9]=u,e[10]=F):F=e[10];const D=F,z=C??r,K=_l[o];let _;e[11]!==p||e[12]!==K?(_=p(K),e[11]=p,e[12]=K,e[13]=_):_=e[13];let $;e[14]!==_?($=s.jsx(Qt,{children:s.jsx(Xt,{children:_})}),e[14]=_,e[15]=$):$=e[15];let V;e[16]!==h||e[17]!==j||e[18]!==p||e[19]!==S||e[20]!==a?(V=j&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"page-form-template",className:"text-xs font-medium text-muted-foreground",children:p("sandbox.pageFormDialog.labelTemplate")}),s.jsx(eo,{id:"page-form-template",value:S,onChange:k,templates:a??[],disabled:h})]}),e[16]=h,e[17]=j,e[18]=p,e[19]=S,e[20]=a,e[21]=V):V=e[21];let A;e[22]!==p?(A=p("sandbox.pageFormDialog.labelName"),e[22]=p,e[23]=A):A=e[23];let H;e[24]!==A?(H=s.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:A}),e[24]=A,e[25]=H):H=e[25];let X;e[26]===Symbol.for("react.memo_cache_sentinel")?(X=me=>y(me.target.value),e[26]=X):X=e[26];let B;e[27]!==p?(B=p("sandbox.pageFormDialog.placeholderName"),e[27]=p,e[28]=B):B=e[28];let J;e[29]!==h||e[30]!==f||e[31]!==B?(J=s.jsx(rt,{id:"page-form-name",value:f,onChange:X,placeholder:B,autoFocus:!0,disabled:h}),e[29]=h,e[30]=f,e[31]=B,e[32]=J):J=e[32];let Y;e[33]!==J||e[34]!==H?(Y=s.jsxs("div",{className:"space-y-1.5",children:[H,J]}),e[33]=J,e[34]=H,e[35]=Y):Y=e[35];let W;e[36]!==p?(W=p("sandbox.pageFormDialog.labelPath"),e[36]=p,e[37]=W):W=e[37];let L;e[38]!==W?(L=s.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:W}),e[38]=W,e[39]=L):L=e[39];let se;e[40]===Symbol.for("react.memo_cache_sentinel")?(se=me=>v(me.target.value),e[40]=se):se=e[40];let re;e[41]!==p?(re=p("sandbox.pageFormDialog.placeholderPath"),e[41]=p,e[42]=re):re=e[42];let le;e[43]!==h||e[44]!==g||e[45]!==re?(le=s.jsx(rt,{id:"page-form-path",value:g,onChange:se,placeholder:re,disabled:h}),e[43]=h,e[44]=g,e[45]=re,e[46]=le):le=e[46];let oe;e[47]!==L||e[48]!==le?(oe=s.jsxs("div",{className:"space-y-1.5",children:[L,le]}),e[47]=L,e[48]=le,e[49]=oe):oe=e[49];let ae;e[50]!==z?(ae=z&&s.jsx("p",{className:"text-xs text-destructive",children:z}),e[50]=z,e[51]=ae):ae=e[51];let ce;e[52]!==Y||e[53]!==oe||e[54]!==ae||e[55]!==V?(ce=s.jsxs("div",{className:"space-y-4 py-4",children:[V,Y,oe,ae]}),e[52]=Y,e[53]=oe,e[54]=ae,e[55]=V,e[56]=ce):ce=e[56];let O;e[57]!==d?(O=()=>d(!1),e[57]=d,e[58]=O):O=e[58];let te;e[59]!==p?(te=p("sandbox.pageFormDialog.buttonCancel"),e[59]=p,e[60]=te):te=e[60];let Z;e[61]!==h||e[62]!==O||e[63]!==te?(Z=s.jsx(Oe,{type:"button",variant:"outline",onClick:O,disabled:h,children:te}),e[61]=h,e[62]=O,e[63]=te,e[64]=Z):Z=e[64];let ee;e[65]!==h||e[66]!==f||e[67]!==g?(ee=!f.trim()||!g.trim()||h,e[65]=h,e[66]=f,e[67]=g,e[68]=ee):ee=e[68];let ie;e[69]!==h||e[70]!==o||e[71]!==p?(ie=h?s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"size-3.5"}),p(Dl[o])]}):p(El[o]),e[69]=h,e[70]=o,e[71]=p,e[72]=ie):ie=e[72];let R;e[73]!==ee||e[74]!==ie?(R=s.jsx(Oe,{type:"submit",disabled:ee,children:ie}),e[73]=ee,e[74]=ie,e[75]=R):R=e[75];let ge;e[76]!==Z||e[77]!==R?(ge=s.jsxs(Zt,{children:[Z,R]}),e[76]=Z,e[77]=R,e[78]=ge):ge=e[78];let E;e[79]!==D||e[80]!==ce||e[81]!==ge||e[82]!==$?(E=s.jsx(es,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:D,children:[$,ce,ge]})}),e[79]=D,e[80]=ce,e[81]=ge,e[82]=$,e[83]=E):E=e[83];let xe;return e[84]!==M||e[85]!==n||e[86]!==E?(xe=s.jsx(ts,{open:n,onOpenChange:M,children:E}),e[84]=M,e[85]=n,e[86]=E,e[87]=xe):xe=e[87],xe}const Bl=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],hs={from:"",to:"",type:"temporary",discardQueryParameters:!1};function $l(t){const e=je.c(111),{open:n,isPending:o,error:c,onSubmit:l,onOpenChange:i}=t,r=o===void 0?!1:o,a=Be(),[u,x]=G.useState(hs),[d,h]=G.useState(null),[p,f]=G.useState(n);n!==p&&(f(n),n&&(x(hs),h(null)));let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=he=>x(Te=>({...Te,...he})),e[0]=y):y=e[0];const g=y;let v;e[1]!==r||e[2]!==i?(v=he=>{!he&&!r&&(h(null),i(!1))},e[1]=r,e[2]=i,e[3]=v):v=e[3];const S=v;let k;e[4]!==r||e[5]!==l||e[6]!==u||e[7]!==a?(k=async he=>{he.preventDefault();const Te=u.from.trim(),$e=u.to.trim();if(!Te||!$e||r){h(a("sandbox.redirectFormDialog.errorRequired"));return}h(null),await l({...u,from:Te,to:$e})},e[4]=r,e[5]=l,e[6]=u,e[7]=a,e[8]=k):k=e[8];const C=k,w=d??c;let U;e[9]!==r||e[10]!==u.from||e[11]!==u.to?(U=!!u.from.trim()&&!!u.to.trim()&&!r,e[9]=r,e[10]=u.from,e[11]=u.to,e[12]=U):U=e[12];const T=U;let j;e[13]!==a?(j=a("sandbox.redirectFormDialog.title"),e[13]=a,e[14]=j):j=e[14];let I;e[15]!==j?(I=s.jsx(Qt,{children:s.jsx(Xt,{children:j})}),e[15]=j,e[16]=I):I=e[16];let M;e[17]!==a?(M=a("sandbox.redirectEditor.fromLabel"),e[17]=a,e[18]=M):M=e[18];let F;e[19]!==M?(F=s.jsx(Ot,{htmlFor:"redirect-form-from",children:M}),e[19]=M,e[20]=F):F=e[20];const D=u.from;let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=he=>g({from:he.target.value}),e[21]=z):z=e[21];let K;e[22]!==a?(K=a("sandbox.redirectEditor.fromPlaceholder"),e[22]=a,e[23]=K):K=e[23];let _;e[24]!==r||e[25]!==u.from||e[26]!==K?(_=s.jsx(rt,{id:"redirect-form-from",value:D,onChange:z,placeholder:K,autoFocus:!0,disabled:r}),e[24]=r,e[25]=u.from,e[26]=K,e[27]=_):_=e[27];let $;e[28]!==_||e[29]!==F?($=s.jsxs("div",{className:"space-y-1.5",children:[F,_]}),e[28]=_,e[29]=F,e[30]=$):$=e[30];let V;e[31]!==a?(V=a("sandbox.redirectEditor.toLabel"),e[31]=a,e[32]=V):V=e[32];let A;e[33]!==V?(A=s.jsx(Ot,{htmlFor:"redirect-form-to",children:V}),e[33]=V,e[34]=A):A=e[34];const H=u.to;let X;e[35]===Symbol.for("react.memo_cache_sentinel")?(X=he=>g({to:he.target.value}),e[35]=X):X=e[35];let B;e[36]!==a?(B=a("sandbox.redirectEditor.toPlaceholder"),e[36]=a,e[37]=B):B=e[37];let J;e[38]!==r||e[39]!==u.to||e[40]!==B?(J=s.jsx(rt,{id:"redirect-form-to",value:H,onChange:X,placeholder:B,disabled:r}),e[38]=r,e[39]=u.to,e[40]=B,e[41]=J):J=e[41];let Y;e[42]!==A||e[43]!==J?(Y=s.jsxs("div",{className:"space-y-1.5",children:[A,J]}),e[42]=A,e[43]=J,e[44]=Y):Y=e[44];let W;e[45]!==a?(W=a("sandbox.redirectEditor.typeLabel"),e[45]=a,e[46]=W):W=e[46];let L;e[47]!==W?(L=s.jsx(Ot,{htmlFor:"redirect-form-type",children:W}),e[47]=W,e[48]=L):L=e[48];const se=u.type;let re;e[49]===Symbol.for("react.memo_cache_sentinel")?(re=he=>g({type:he}),e[49]=re):re=e[49];let le;e[50]!==a?(le=a("sandbox.redirectEditor.typePlaceholder"),e[50]=a,e[51]=le):le=e[51];let oe;e[52]!==le?(oe=s.jsx(Ho,{id:"redirect-form-type",className:"w-full",children:s.jsx(Jo,{placeholder:le})}),e[52]=le,e[53]=oe):oe=e[53];let ae;e[54]!==a?(ae=Bl.map(he=>s.jsx(Go,{value:he.value,children:a(he.labelKey,{status:Qs[he.value]})},he.value)),e[54]=a,e[55]=ae):ae=e[55];let ce;e[56]!==ae?(ce=s.jsx(Wo,{children:ae}),e[56]=ae,e[57]=ce):ce=e[57];let O;e[58]!==r||e[59]!==u.type||e[60]!==oe||e[61]!==ce?(O=s.jsxs(Yo,{value:se,onValueChange:re,disabled:r,children:[oe,ce]}),e[58]=r,e[59]=u.type,e[60]=oe,e[61]=ce,e[62]=O):O=e[62];let te;e[63]!==L||e[64]!==O?(te=s.jsxs("div",{className:"space-y-1.5",children:[L,O]}),e[63]=L,e[64]=O,e[65]=te):te=e[65];let Z;e[66]===Symbol.for("react.memo_cache_sentinel")?(Z=he=>g({discardQueryParameters:he===!0}),e[66]=Z):Z=e[66];let ee;e[67]!==r||e[68]!==u.discardQueryParameters?(ee=s.jsx(ss,{checked:u.discardQueryParameters,disabled:r,onCheckedChange:Z}),e[67]=r,e[68]=u.discardQueryParameters,e[69]=ee):ee=e[69];let ie;e[70]!==a?(ie=a("sandbox.redirectEditor.discardQueryParameters"),e[70]=a,e[71]=ie):ie=e[71];let R;e[72]!==ie?(R=s.jsx("span",{className:"text-sm",children:ie}),e[72]=ie,e[73]=R):R=e[73];let ge;e[74]!==ee||e[75]!==R?(ge=s.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[ee,R]}),e[74]=ee,e[75]=R,e[76]=ge):ge=e[76];let E;e[77]!==w?(E=w&&s.jsx("p",{className:"text-xs text-destructive",children:w}),e[77]=w,e[78]=E):E=e[78];let xe;e[79]!==$||e[80]!==Y||e[81]!==te||e[82]!==ge||e[83]!==E?(xe=s.jsxs("div",{className:"space-y-4 py-4",children:[$,Y,te,ge,E]}),e[79]=$,e[80]=Y,e[81]=te,e[82]=ge,e[83]=E,e[84]=xe):xe=e[84];let me;e[85]!==i?(me=()=>i(!1),e[85]=i,e[86]=me):me=e[86];let fe;e[87]!==a?(fe=a("sandbox.redirectFormDialog.cancel"),e[87]=a,e[88]=fe):fe=e[88];let be;e[89]!==r||e[90]!==me||e[91]!==fe?(be=s.jsx(Oe,{type:"button",variant:"outline",onClick:me,disabled:r,children:fe}),e[89]=r,e[90]=me,e[91]=fe,e[92]=be):be=e[92];const ne=!T;let pe;e[93]!==r||e[94]!==a?(pe=r?s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"size-3.5"}),a("sandbox.redirectFormDialog.pending")]}):a("sandbox.redirectFormDialog.submit"),e[93]=r,e[94]=a,e[95]=pe):pe=e[95];let Ce;e[96]!==ne||e[97]!==pe?(Ce=s.jsx(Oe,{type:"submit",disabled:ne,children:pe}),e[96]=ne,e[97]=pe,e[98]=Ce):Ce=e[98];let we;e[99]!==be||e[100]!==Ce?(we=s.jsxs(Zt,{children:[be,Ce]}),e[99]=be,e[100]=Ce,e[101]=we):we=e[101];let Ne;e[102]!==C||e[103]!==xe||e[104]!==we||e[105]!==I?(Ne=s.jsx(es,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:C,children:[I,xe,we]})}),e[102]=C,e[103]=xe,e[104]=we,e[105]=I,e[106]=Ne):Ne=e[106];let Se;return e[107]!==S||e[108]!==n||e[109]!==Ne?(Se=s.jsx(ts,{open:n,onOpenChange:S,children:Ne}),e[107]=S,e[108]=n,e[109]=Ne,e[110]=Se):Se=e[110],Se}function Ll(t){const e=je.c(70),{open:n,blockKey:o,initialName:c,isPending:l,onSubmit:i,onOpenChange:r}=t,a=l===void 0?!1:l,u=Be(),[x,d]=G.useState(c),[h,p]=G.useState(n);n!==h&&(p(n),n&&d(c));let f;e[0]!==a||e[1]!==r?(f=se=>{!se&&!a&&r(!1)},e[0]=a,e[1]=r,e[2]=f):f=e[2];const y=f;let g;e[3]!==a||e[4]!==x||e[5]!==i?(g=async se=>{se.preventDefault();const re=x.trim();!re||a||await i(re)},e[3]=a,e[4]=x,e[5]=i,e[6]=g):g=e[6];const v=g;let S;e[7]!==u?(S=u("sandbox.sectionRenameDialog.title"),e[7]=u,e[8]=S):S=e[8];let k;e[9]!==S?(k=s.jsx(Xt,{children:S}),e[9]=S,e[10]=k):k=e[10];let C;e[11]!==u?(C=u("sandbox.sectionRenameDialog.description"),e[11]=u,e[12]=C):C=e[12];let w;e[13]!==C?(w=s.jsx(Uo,{children:C}),e[13]=C,e[14]=w):w=e[14];let U;e[15]!==k||e[16]!==w?(U=s.jsxs(Qt,{children:[k,w]}),e[15]=k,e[16]=w,e[17]=U):U=e[17];let T;e[18]!==u?(T=u("sandbox.sectionRenameDialog.nameLabel"),e[18]=u,e[19]=T):T=e[19];let j;e[20]!==T?(j=s.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:T}),e[20]=T,e[21]=j):j=e[21];let I;e[22]===Symbol.for("react.memo_cache_sentinel")?(I=se=>d(se.target.value),e[22]=I):I=e[22];let M;e[23]!==a||e[24]!==x?(M=s.jsx(rt,{id:"section-rename-name",value:x,onChange:I,autoFocus:!0,disabled:a}),e[23]=a,e[24]=x,e[25]=M):M=e[25];let F;e[26]!==j||e[27]!==M?(F=s.jsxs("div",{className:"space-y-1.5",children:[j,M]}),e[26]=j,e[27]=M,e[28]=F):F=e[28];let D;e[29]!==u?(D=u("sandbox.sectionRenameDialog.keyLabel"),e[29]=u,e[30]=D):D=e[30];let z;e[31]!==D?(z=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:D}),e[31]=D,e[32]=z):z=e[32];let K;e[33]!==o?(K=s.jsx(rt,{value:o,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=o,e[34]=K):K=e[34];let _;e[35]!==z||e[36]!==K?(_=s.jsxs("div",{className:"space-y-1.5",children:[z,K]}),e[35]=z,e[36]=K,e[37]=_):_=e[37];let $;e[38]!==F||e[39]!==_?($=s.jsxs("div",{className:"space-y-4 py-4",children:[F,_]}),e[38]=F,e[39]=_,e[40]=$):$=e[40];let V;e[41]!==r?(V=()=>r(!1),e[41]=r,e[42]=V):V=e[42];let A;e[43]!==u?(A=u("sandbox.sectionRenameDialog.cancel"),e[43]=u,e[44]=A):A=e[44];let H;e[45]!==a||e[46]!==V||e[47]!==A?(H=s.jsx(Oe,{type:"button",variant:"outline",onClick:V,disabled:a,children:A}),e[45]=a,e[46]=V,e[47]=A,e[48]=H):H=e[48];let X;e[49]!==a||e[50]!==x?(X=!x.trim()||a,e[49]=a,e[50]=x,e[51]=X):X=e[51];let B;e[52]!==a||e[53]!==u?(B=a?s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"size-3.5"}),u("sandbox.sectionRenameDialog.saving")]}):u("sandbox.sectionRenameDialog.save"),e[52]=a,e[53]=u,e[54]=B):B=e[54];let J;e[55]!==X||e[56]!==B?(J=s.jsx(Oe,{type:"submit",disabled:X,children:B}),e[55]=X,e[56]=B,e[57]=J):J=e[57];let Y;e[58]!==H||e[59]!==J?(Y=s.jsxs(Zt,{children:[H,J]}),e[58]=H,e[59]=J,e[60]=Y):Y=e[60];let W;e[61]!==v||e[62]!==$||e[63]!==Y||e[64]!==U?(W=s.jsx(es,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:v,children:[U,$,Y]})}),e[61]=v,e[62]=$,e[63]=Y,e[64]=U,e[65]=W):W=e[65];let L;return e[66]!==y||e[67]!==n||e[68]!==W?(L=s.jsx(ts,{open:n,onOpenChange:y,children:W}),e[66]=y,e[67]=n,e[68]=W,e[69]=L):L=e[69],L}function Ol(t){const e=je.c(7),{type:n}=t,o=Qs[n];let c;e[0]!==o?(c=s.jsx(Ie,{asChild:!0,children:s.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-muted-foreground",children:o})}),e[0]=o,e[1]=c):c=e[1];const l=n==="permanent"?"Permanent":"Temporary";let i;e[2]!==l?(i=s.jsx(Me,{side:"left",children:l}),e[2]=l,e[3]=i):i=e[3];let r;return e[4]!==c||e[5]!==i?(r=s.jsxs(ze,{children:[c,i]}),e[4]=c,e[5]=i,e[6]=r):r=e[6],r}const Rt={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},os=["posts","authors","categories"],yt={posts:"post",authors:"author",categories:"category"};function qe(t){return os.includes(t)}const ls={posts:"post",authors:"author",categories:"category"},an={posts:Rt.post,authors:Rt.author,categories:Rt.category},Rl=Object.fromEntries(Object.entries(an).map(([t,e])=>[e,t]));function Fl(t){return typeof t=="string"?Rl[t]??null:null}function Je(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Pe(t){return typeof t=="string"?t:""}function Kl(t,e){switch(t){case"posts":return{label:Pe(e.title)||"Untitled post",subtitle:Pe(e.slug)};case"authors":return{label:Pe(e.name)||"Unnamed author",subtitle:Pe(e.email)};case"categories":return{label:Pe(e.name)||"Unnamed category",subtitle:Pe(e.slug)};default:{const n=t;throw new Error(`Unhandled blog kind: ${String(n)}`)}}}function rn(t){const e={posts:[],authors:[],categories:[]};for(const[n,o]of Object.entries(t)){const c=Je(o);if(!c)continue;const l=Fl(c.__resolveType);if(!l)continue;const i=Je(c[ls[l]])??{},{label:r,subtitle:a}=Kl(l,i);e[l].push({key:n,kind:l,label:r,subtitle:a})}for(const n of os)e[n].sort((o,c)=>o.label.localeCompare(c.label));return e}function Il(t,e){return rn(t)[e]}function vt(t,e){return Il(t,e).map(n=>({key:n.key,payload:xt(Je(t[n.key])??void 0,e)}))}const gs=Object.freeze({});function xt(t,e){return t?Je(t[ls[e]])??gs:gs}function it(t,e,n){return{name:t,__resolveType:an[e],[ls[e]]:n}}function Hi({records:t,selected:e,valueField:n,toRef:o}){const c=Array.isArray(e)?e:[],l=h=>typeof h=="string"?h:Pe(Je(h)?.[n]),i=h=>typeof h=="string"?h:Pe(Je(h)?.name),r=h=>{const p=l(h),f=p?t.find(({payload:g})=>Pe(g[n])===p):void 0;if(f)return f;const y=i(h);return y?t.find(({payload:g})=>Pe(g.name)===y):void 0},a=t.map(({key:h,payload:p})=>({value:h,label:Pe(p.name)||Pe(p[n])||h})),u=new Map,x=[];return c.forEach((h,p)=>{const f=r(h);if(f){x.includes(f.key)||x.push(f.key);return}const y=`unresolved:${p}`;u.set(y,h),x.push(y),a.push({value:y,label:i(h)||l(h)||"Unknown"})}),{options:a,selectedValues:x,refsForValues:h=>h.map(p=>{const f=t.find(y=>y.key===p);return f?o(f.payload):u.get(p)}).filter(p=>p!==void 0)}}function Ze(t){return Array.isArray(t)?t:[]}function Ke(t){if(typeof t=="string")return t;const e=Je(t);return e?Pe(e.slug):""}function Ml(t){if(typeof t=="string")return t;const e=Je(t);return e?Pe(e.email):""}function cn(t){const e=[];return Pe(t.title).trim()||e.push("Title"),Pe(t.slug).trim()||e.push("Slug"),Ze(t.categories).map(Ke).filter(Boolean).length===0&&e.push("Category"),Pe(t.excerpt).trim()||e.push("Excerpt"),Pe(t.image).trim()||e.push("Cover image"),e}const dn=8;function un(t){const e=Pe(t.status);return e===""||e==="published"?"published":e==="scheduled"?"scheduled":"draft"}function Ji(t,e){return e!=="published"||un(t)==="published"?!1:cn(t).length>0}function zl(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1,dn).toISOString()}function Wi(t,e,n){if(e!=="scheduled")return{...t,status:e,scheduledDatetime:""};const o=Pe(t.scheduledDatetime);return{...t,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(o).getTime())?zl(n):o}}function mn(t){return vt(t,"posts").map(({key:e,payload:n})=>({key:e,title:Pe(n.title)||"Untitled post",slug:Pe(n.slug),date:Pe(n.date),scheduledDatetime:Pe(n.scheduledDatetime),categorySlugs:Ze(n.categories).map(Ke).filter(Boolean),authorEmails:Ze(n.authors).map(Ml).filter(Boolean),missing:cn(n),status:un(n)}))}function Vl(t,e){const n=Ze(t.categories);return n.some(o=>Ke(o)===e.slug)?t:{...t,categories:[...n,{name:e.name,slug:e.slug}]}}function Ul(t,e){const n=Ze(t.categories);return n.length===1&&Ke(n[0])===e.slug?t:{...t,categories:[{name:e.name,slug:e.slug}]}}function Yi(t,e,n){const o=Ze(t.categories);if(!o.some(r=>Ke(r)===e))return t;const c=o.map(r=>{const a=Ke(r);return a===e||a===n.slug?{name:n.name,slug:n.slug}:r}),l=new Set,i=c.filter(r=>{const a=Ke(r);return a?l.has(a)?!1:(l.add(a),!0):!0});return{...t,categories:i}}function Gl(t,e){const n=Ze(t.categories);return n.some(o=>Ke(o)===e)?{...t,categories:n.filter(o=>Ke(o)!==e)}:t}function xs(t){return{...t,dateModified:new Date().toISOString()}}function Gt(t){const e=new Uint8Array(Math.ceil(t/2));return crypto.getRandomValues(e),Array.from(e,n=>n.toString(16).padStart(2,"0")).join("").slice(0,t)}function Ft(t,e){const n=`collections/blog/${e}/${Gt(12)}`;if(!Object.hasOwn(t,n))return n;throw new Error("Could not generate a unique blog block key")}function fn(t){switch(t){case"posts":return{title:"Untitled post",excerpt:"",slug:`untitled-${Gt(8)}`,date:new Date().toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[]};case"authors":return{name:"New author",type:"Person",email:"",jobTitle:"",company:"",avatar:""};case"categories":return{name:"New category",slug:`category-${Gt(8)}`,description:"",sections:[]};default:{const e=t;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const Hl={Paragraph:{title:"Paragraph",description:"Rich text content",iconName:"Pilcrow01"},Heading:{title:"Heading",description:"Section title (H1–H6)",iconName:"HeadingSquare"},Quote:{title:"Quote",description:"Pull quote",iconName:"MessageTextSquare02"},Code:{title:"Code",description:"Code block with syntax highlighting",iconName:"Code02"},List:{title:"List",description:"Bulleted or numbered list",iconName:"List"},BlockImage:{title:"Image",description:"Image with optional caption",iconName:"Image01"},Video:{title:"Video",description:"Embedded video",iconName:"PlayCircle"},Divider:{title:"Divider",description:"Horizontal divider",iconName:"Divider"},Cta:{title:"Call to action",description:"Button linking to a URL",iconName:"CursorClick01"},Callout:{title:"Callout",description:"Highlighted note, tip or warning",iconName:"Lightbulb02"},Stat:{title:"Stat",description:"Single key metric",iconName:"BarChartSquareUp"},StatGroup:{title:"Stat group",description:"Row of metrics",iconName:"BarChartSquare02"},CardGroup:{title:"Card group",description:"Grid of cards",iconName:"LayoutGrid01"},Checklist:{title:"Checklist",description:"List of check items",iconName:"CheckSquare"},Steps:{title:"Steps",description:"Step-by-step guide",iconName:"LayersThree01"},Comparison:{title:"Comparison",description:"Side-by-side comparison",iconName:"Columns03"},Table:{title:"Table",description:"Rows and columns of structured data",iconName:"Table"},ProductCard:{title:"Product card",description:"Single product",iconName:"Tag01"},ProductShelf:{title:"Product shelf",description:"Row of products",iconName:"ShoppingBag01"}},bs="Box";function Jl(t){return t.startsWith("site/")?"site":"app"}function Wl(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||t.startsWith("/")}function ht(...t){for(const e of t)if(e!==void 0)return e}function qi(t){const e=new Set,n=[],o=t.manifest?.blocks??{};for(const c of Object.values(o))for(const l of Object.keys(c)){if(!Ql(l)||e.has(l))continue;e.add(l);const i=Wt(l,t),r=Yl(l),a=Hl[r],u=Jl(l),x=(u==="site"?ht(i.title,a?.title):ht(a?.title,i.title))??r,d=u==="site"?ht(i.description,a?.description):ht(a?.description,i.description),h=u==="site"?i.icon:void 0,p=h&&Wl(h)?h:void 0,f=p!==void 0?a?.iconName??bs:ht(h,a?.iconName)??bs;n.push({resolveType:l,title:x,description:d,iconName:f,iconUrl:p,source:u})}return n.sort((c,l)=>c.title.localeCompare(l.title))}function Yl(t){return(t.split("/").pop()??t).replace(/\.(tsx?|jsx?)$/,"")}const ql=["blog/sections/blocks/","site/sections/Blog/Post/"];function Ql(t){return ql.some(e=>t.startsWith(e))}const Qi=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Xi=["January","February","March","April","May","June","July","August","September","October","November","December"],pn=1440*60*1e3;function Xe(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function Zi(t){return new Date(t.getFullYear(),t.getMonth(),1)}function er(t,e){return new Date(t.getFullYear(),t.getMonth()+e,1)}function Nt(t,e){const n=new Date(t);return n.setDate(n.getDate()+e),n}function Ht(t,e){return Math.round((Xe(t).getTime()-Xe(e).getTime())/pn)}function Xl(t){const e=(t.getTime()-Xe(t).getTime())/pn;return Math.min(Math.max(e,0),1)}function ys(t,e){return Ht(t,e)+Xl(t)}function tr(t){const e=Nt(t,-t.getDay()),n=[];for(let o=0;o<6;o++){const c=[];for(let l=0;l<7;l++)c.push(Nt(e,o*7+l));n.push(c)}for(;n.length>0&&n[n.length-1].every(o=>o.getMonth()!==t.getMonth());)n.pop();return n}function sr(t,e){const n=Xe(t[0]),o=Nt(n,7),c=n.getTime(),l=o.getTime(),i=[];for(const u of e){const x=Xe(u.start),d=Xe(u.end);if(d.getTime()<n.getTime()||x.getTime()>=o.getTime())continue;const h=x.getTime()<n.getTime()?n:x,p=d.getTime()>=o.getTime()?Nt(o,-1):d,f=Ht(h,n),y=Ht(p,h)+1;if(y<=0)continue;const g=Math.max(u.start.getTime(),c),v=Math.min(u.end.getTime(),l),S=ys(new Date(g),n),k=Math.max(ys(new Date(v),n)-S,0);k<=0||i.push({variant:u,startCol:f,span:y,leftUnits:S,widthUnits:k})}i.sort((u,x)=>u.startCol-x.startCol||x.span-u.span||u.variant.blockKey.localeCompare(x.variant.blockKey));const r=[],a=[];for(const u of i){let x=r.findIndex(d=>d<=u.startCol);x===-1&&(x=r.length,r.push(0)),r[x]=u.startCol+u.span,a.push({...u,lane:x})}return a}function Pt(t){const e=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${t.getFullYear()}-${e}-${n}`}const hn=/^(\d{4})-(\d{2})-(\d{2})$/;function Tt(t){const e=t.trim();if(!e)return null;const n=hn.exec(e);if(n){const c=Number(n[1]),l=Number(n[2])-1,i=Number(n[3]),r=new Date(c,l,i);return r.getMonth()===l&&r.getDate()===i?r:null}const o=new Date(e);return Number.isNaN(o.getTime())?null:Xe(o)}function Zl(t){const e=new Date(t.getFullYear(),t.getMonth(),t.getDate(),dn);return{...fn("posts"),status:"scheduled",scheduledDatetime:e.toISOString(),date:Pt(t)}}function ea(t){if(typeof t!="string")return null;const e=t.trim();if(!e)return null;if(hn.test(e))return Tt(e);const n=new Date(e);return Number.isNaN(n.getTime())?null:n}function ta(t,e){const n=ea(t.scheduledDatetime);if(!n)return null;const o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),c={...t,scheduledDatetime:o.toISOString()};return(typeof t.date=="string"?t.date:"")===Pt(n)&&(c.date=Pt(o)),c}function sa(t){return Tt(t.scheduledDatetime)??Tt(t.date)}function nr(t){const e=new Map,n=[];for(const c of t){const l={post:c,scheduled:Tt(c.scheduledDatetime)!==null},i=sa(c);if(!i){n.push(l);continue}const r=Pt(i),a=e.get(r);a?a.push(l):e.set(r,[l])}const o=(c,l)=>Number(l.scheduled)-Number(c.scheduled)||c.post.title.localeCompare(l.post.title);for(const c of e.values())c.sort(o);return n.sort(o),{byDay:e,undated:n}}const na="0.161.0",oa="0.162.0",or="deno task update";function vs(t){const e=/^v?(\d+)\.(\d+)\.(\d+)$/.exec(t.trim());return e?[Number(e[1]),Number(e[2]),Number(e[3])]:null}function Ss(t,e){const n=vs(t),o=vs(e);if(!n||!o)return 0;for(let c=0;c<3;c++){const l=n[c]-o[c];if(l!==0)return l}return 0}const gn=/deco-cx\/apps@v?(\d+\.\d+\.\d+)/;function la(t){const e=t?.imports;if(!e||typeof e!="object")return null;for(const n of Object.values(e)){if(typeof n!="string")continue;const o=gn.exec(n)?.[1];if(o)return o}return null}function aa(t){const e=t?.schema?.definitions;if(!e||typeof e!="object")return null;for(const n of Object.values(e)){const o=n?.title;if(typeof o!="string")continue;const c=gn.exec(o)?.[1];if(c)return c}return null}function ia(t){if(t.packageManager!=="deno")return{kind:"unsupported-runtime"};const e=la(t.denoJson)??aa(t.meta);return!e||Ss(e,na)<0?{kind:"outdated",version:e}:Ss(e,oa)<0?{kind:"publish-only",version:e}:{kind:"full",version:e}}function lr(t){return t.kind==="publish-only"||t.kind==="full"}function ar(t){return t.kind==="full"}function ra(t){const e=je.c(16),n=Zs(t.virtualMcpId)?.metadata?.runtime?.selected??null,o=to(t.virtualMcpId),c=_t()?.taskId??null;let l;e[0]!==t.branch||e[1]!==t.orgSlug||e[2]!==t.virtualMcpId?(l=As.denoJson(t.orgSlug,t.virtualMcpId,t.branch),e[0]=t.branch,e[1]=t.orgSlug,e[2]=t.virtualMcpId,e[3]=l):l=e[3];let i;e[4]!==o||e[5]!==t||e[6]!==c?(i=async()=>{const h=await so({...t,threadId:c},no(o,"deno.json"));return h.kind==="data"?h.data:null},e[4]=o,e[5]=t,e[6]=c,e[7]=i):i=e[7];const r=n==="deno";let a;e[8]!==l||e[9]!==i||e[10]!==r?(a={queryKey:l,queryFn:i,enabled:r,staleTime:3e5},e[8]=l,e[9]=i,e[10]=r,e[11]=a):a=e[11];const{data:u}=Ds(a),x=u??null;let d;return e[12]!==n||e[13]!==t.meta||e[14]!==x?(d=ia({packageManager:n,denoJson:x,meta:t.meta}),e[12]=n,e[13]=t.meta,e[14]=x,e[15]=d):d=e[15],d}function Re(t){const e=je.c(46),{icon:n,logoUrl:o,title:c,subtitle:l,active:i,accent:r,variantCount:a,trailing:u,selectable:x,selectionActive:d,selected:h,invalid:p,invalidReason:f,onToggleSelect:y,onClick:g,menu:v}=t,S=Be(),k=r==="global";let C;e[0]!==n||e[1]!==i||e[2]!==k||e[3]!==o||e[4]!==a?(C=a&&a>1?s.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center",children:s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx(n,{size:16,className:"shrink-0 text-success"})}),s.jsxs(Me,{side:"right",children:[a," variants"]})]})}):o?s.jsx("img",{src:o,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):s.jsx("span",{className:De("flex size-8 shrink-0 items-center justify-center rounded-lg",k?"bg-global-section/15":"bg-muted"),children:s.jsx(n,{size:16,className:De("shrink-0",!k&&(i?"text-accent-foreground":"text-muted-foreground")),style:k?{color:Yt}:void 0})}),e[0]=n,e[1]=i,e[2]=k,e[3]=o,e[4]=a,e[5]=C):C=e[5];const w=C,U=i?k?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":k?"hover:bg-global-section/10":"hover:bg-muted";let T;e[6]!==U?(T=De("group relative flex min-w-0 items-center rounded-md transition-colors",U),e[6]=U,e[7]=T):T=e[7];let j;e[8]!==y||e[9]!==x||e[10]!==h||e[11]!==d||e[12]!==S||e[13]!==c?(j=x&&s.jsx("span",{className:De("flex shrink-0 items-center pl-2.5 transition-opacity",h||d?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:ca,children:s.jsx(ss,{checked:h,onCheckedChange:()=>y?.(),"aria-label":S("sandbox.itemRow.selectItem",{title:c})})}),e[8]=y,e[9]=x,e[10]=h,e[11]=d,e[12]=S,e[13]=c,e[14]=j):j=e[14];const I=p&&!i&&"text-destructive";let M;e[15]!==I?(M=De("block truncate text-sm font-medium",I),e[15]=I,e[16]=M):M=e[16];let F;e[17]!==M||e[18]!==c?(F=s.jsx("span",{className:M,children:c}),e[17]=M,e[18]=c,e[19]=F):F=e[19];const D=i?"text-accent-foreground/70":"text-muted-foreground";let z;e[20]!==D?(z=De("block truncate text-xs",D),e[20]=D,e[21]=z):z=e[21];let K;e[22]!==l||e[23]!==z?(K=s.jsx("span",{className:z,children:l}),e[22]=l,e[23]=z,e[24]=K):K=e[24];let _;e[25]!==K||e[26]!==F?(_=s.jsxs("span",{className:"min-w-0 flex-1",children:[F,K]}),e[25]=K,e[26]=F,e[27]=_):_=e[27];let $;e[28]!==i||e[29]!==p||e[30]!==f?($=p&&s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx("span",{className:De("flex shrink-0 items-center",i?"text-accent-foreground":"text-destructive"),children:s.jsx(Ls,{size:14})})}),f&&s.jsx(Me,{side:"bottom",children:f})]}),e[28]=i,e[29]=p,e[30]=f,e[31]=$):$=e[31];let V;e[32]!==g||e[33]!==w||e[34]!==_||e[35]!==$||e[36]!==u?(V=s.jsxs("button",{type:"button",onClick:g,className:"flex min-w-0 flex-1 items-center gap-2.5 classic:rounded-md compact:rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[w,_,$,u]}),e[32]=g,e[33]=w,e[34]=_,e[35]=$,e[36]=u,e[37]=V):V=e[37];let A;e[38]!==i||e[39]!==v?(A=v&&s.jsx("div",{className:De("pr-1 opacity-0 transition-opacity group-hover:opacity-100",i&&"opacity-100"),children:v}),e[38]=i,e[39]=v,e[40]=A):A=e[40];let H;return e[41]!==V||e[42]!==A||e[43]!==T||e[44]!==j?(H=s.jsxs("div",{className:T,children:[j,V,A]}),e[41]=V,e[42]=A,e[43]=T,e[44]=j,e[45]=H):H=e[45],H}function ca(t){return t.stopPropagation()}function He(t){const e=je.c(10),{icon:n,title:o,description:c}=t;let l;e[0]!==n?(l=n&&s.jsx(n,{size:24,className:"text-muted-foreground/60"}),e[0]=n,e[1]=l):l=e[1];let i;e[2]!==o?(i=s.jsx("div",{children:o}),e[2]=o,e[3]=i):i=e[3];let r;e[4]!==c?(r=c&&s.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:c}),e[4]=c,e[5]=r):r=e[5];let a;return e[6]!==l||e[7]!==i||e[8]!==r?(a=s.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-6 text-center text-sm text-muted-foreground",children:[l,i,r]}),e[6]=l,e[7]=i,e[8]=r,e[9]=a):a=e[9],a}const da={loaders:Is,actions:Xs},ua={loaders:"Loaders",actions:"Actions"},ma={analytics:Xo,blog:Rs,commerce:Qo,site:Kn,website:qo};function fa(t,e){return e===0?ma[t.toLowerCase()]??us:us}function kt(t,e){return e===0?ro(t):t}function pa(t){const e=je.c(98),{orgSlug:n,virtualMcpId:o,branch:c,previewUrl:l,meta:i,decofile:r,kind:a}=t,u=Be();let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[0]=x):x=e[0];const[d,h]=G.useState(x),[p,f]=G.useState(null),[y,g]=G.useState(""),[v,S]=G.useState(ka),[k,C]=G.useState(a);k!==a&&(C(a),h([]),f(null),g(""),S(new Set));let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w=W=>{S(L=>{const se=new Set(L);return se.has(W)?se.delete(W):se.add(W),se})},e[1]=w):w=e[1];const U=w;let T;e[2]!==c||e[3]!==n||e[4]!==o?(T={orgSlug:n,virtualMcpId:o,branch:c},e[2]=c,e[3]=n,e[4]=o,e[5]=T):T=e[5];const j=Hs(T);let I;e[6]!==j?(I=Ws((W,L)=>j.mutate({blockKey:W,data:L})),e[6]=j,e[7]=I):I=e[7];const M=I;let F;e[8]!==a?(F=co(a),e[8]=a,e[9]=F):F=e[9];const D=F,z=da[a];let K,_,$,V,A,H,X;if(e[10]!==z||e[11]!==c||e[12]!==r||e[13]!==a||e[14]!==i||e[15]!==v||e[16]!==n||e[17]!==d||e[18]!==l||e[19]!==j||e[20]!==M||e[21]!==y||e[22]!==p||e[23]!==D||e[24]!==u||e[25]!==o){$=Symbol.for("react.early_return_sentinel");e:{const W=[...oo(i,r,a).map(Sa),...lo(i,a).map(va)],L=y.trim().toLowerCase(),se=L.length>0,re=se?W.filter(N=>N.title.toLowerCase().includes(L)||N.resolveType.toLowerCase().includes(L)):[],le=new Map,oe=[],ae=new Map;if(!se){for(const N of W){const de=N.folderPath;if(!(de.length<d.length)&&d.every((ye,Ee)=>de[Ee]===ye))if(de.length===d.length)if(N.savedKey!==void 0){const ye=ae.get(N.resolveType);ye?ye.push(N):ae.set(N.resolveType,[N])}else oe.push(N);else{const ye=de[d.length],Ee=le.get(ye)??{count:0,savedCount:0};N.savedKey!==void 0?Ee.savedCount=Ee.savedCount+1:Ee.count=Ee.count+1,le.set(ye,Ee)}}oe.sort(ya);for(const N of ae.values())N.sort(ba)}const ce=[...ae.entries()].filter(N=>{const[de]=N;return!oe.some(ye=>ye.resolveType===de)}).flatMap(xa).sort(ga);let O;e[33]!==d?(O=(N,de)=>kt(N.name,d.length).localeCompare(kt(de.name,d.length)),e[33]=d,e[34]=O):O=e[34];const te=[...le.entries()].map(ha).sort(O);let Z;e[35]===Symbol.for("react.memo_cache_sentinel")?(Z=N=>{f(N.savedKey!==void 0?{mode:"saved",key:N.savedKey}:{mode:"available",resolveType:N.resolveType,title:N.title})},e[35]=Z):Z=e[35];const ee=Z;let ie;e[36]!==j||e[37]!==D||e[38]!==u?(ie=async(N,de)=>{await j.mutateAsync({blockKey:N,data:de}),ve.success(u("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:D,blockId:N})),f({mode:"saved",key:N})},e[36]=j,e[37]=D,e[38]=u,e[39]=ie):ie=e[39];const R=ie;let ge;e[40]!==r||e[41]!==p?(ge=ja(p,r),e[40]=r,e[41]=p,e[42]=ge):ge=e[42];const E=ge;if(E){const N=`${E.mode}:${E.mode==="saved"?E.blockKey:E.resolveType}`;let de;e[43]===Symbol.for("react.memo_cache_sentinel")?(de=()=>f(null),e[43]=de):de=e[43];let ye;e[44]!==c||e[45]!==r||e[46]!==R||e[47]!==a||e[48]!==i||e[49]!==n||e[50]!==l||e[51]!==j.isPending||e[52]!==M||e[53]!==N||e[54]!==E.editorTarget||e[55]!==E.initialValue||e[56]!==o?(ye=s.jsx(ao,{orgSlug:n,virtualMcpId:o,branch:c,previewUrl:l,meta:i,decofile:r,kind:a,target:E.editorTarget,initialValue:E.initialValue,isCreating:j.isPending,onCreate:R,onSaveReferencedBlock:M,onBack:de},N),e[44]=c,e[45]=r,e[46]=R,e[47]=a,e[48]=i,e[49]=n,e[50]=l,e[51]=j.isPending,e[52]=M,e[53]=N,e[54]=E.editorTarget,e[55]=E.initialValue,e[56]=o,e[57]=ye):ye=e[57],$=ye;break e}X="flex h-full w-full min-w-0 flex-col";let xe;e[58]!==u?(xe=u("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=u,e[59]=xe):xe=e[59];let me;e[60]===Symbol.for("react.memo_cache_sentinel")?(me=()=>h([]),e[60]=me):me=e[60];const fe=d.length===0?"font-medium text-foreground":"text-muted-foreground";let be;e[61]!==fe?(be=De("min-w-0 truncate classic:rounded-md compact:rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",fe),e[61]=fe,e[62]=be):be=e[62];const ne=ua[a];let pe;e[63]!==be||e[64]!==ne?(pe=s.jsx("button",{type:"button",onClick:me,className:be,children:ne}),e[63]=be,e[64]=ne,e[65]=pe):pe=e[65];let Ce;e[66]!==d?(Ce=d.map((N,de)=>{const ye=de===d.length-1;return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s.jsx(Kt,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>h(d.slice(0,de+1)),className:De("min-w-0 truncate classic:rounded-md compact:rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ye?"font-medium text-foreground":"text-muted-foreground"),children:kt(N,de)})]},`${N}-${de}`)}),e[66]=d,e[67]=Ce):Ce=e[67];let we;e[68]!==xe||e[69]!==pe||e[70]!==Ce?(we=s.jsxs("nav",{"aria-label":xe,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[pe,Ce]}),e[68]=xe,e[69]=pe,e[70]=Ce,e[71]=we):we=e[71];let Ne;e[72]===Symbol.for("react.memo_cache_sentinel")?(Ne=s.jsx(Vs,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Ne):Ne=e[72];let Se;e[73]===Symbol.for("react.memo_cache_sentinel")?(Se=N=>g(N.target.value),e[73]=Se):Se=e[73];let he;e[74]!==a||e[75]!==u?(he=u("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:a}),e[74]=a,e[75]=u,e[76]=he):he=e[76];let Te;e[77]!==a||e[78]!==u?(Te=u("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:a}),e[77]=a,e[78]=u,e[79]=Te):Te=e[79];let $e;e[80]!==y||e[81]!==he||e[82]!==Te?($e=s.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Ne,s.jsx("input",{type:"text",value:y,onChange:Se,placeholder:he,"aria-label":Te,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=y,e[81]=he,e[82]=Te,e[83]=$e):$e=e[83],e[84]!==we||e[85]!==$e?(_=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[we,$e]}),e[84]=we,e[85]=$e,e[86]=_):_=e[86],K=Et,H="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",V="mx-auto w-full max-w-4xl px-6 py-5",A=se?re.length===0?s.jsx(He,{title:u("sandbox.runnableBlocksBrowser.noSearchResults",{kind:a,query:y.trim()}),description:u("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):s.jsx("div",{className:"flex flex-col gap-1",children:re.map(N=>s.jsx(Re,{icon:z,accent:N.savedKey!==void 0?"global":void 0,title:N.title,subtitle:N.resolveType,active:!1,onClick:()=>ee(N)},N.savedKey??N.resolveType))}):te.length===0&&oe.length===0&&ce.length===0?s.jsx(He,{title:u("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:a}),description:d.length===0?u("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):u("sandbox.runnableBlocksBrowser.emptyFolder")}):s.jsxs(s.Fragment,{children:[te.length>0&&s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:te.map(N=>{const de=fa(N.name,d.length);return s.jsxs("button",{type:"button",onClick:()=>h([...d,N.name]),className:"flex items-center gap-2.5 rounded-lg border px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[s.jsx(de,{size:18,className:"shrink-0 text-muted-foreground"}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm font-medium",children:kt(N.name,d.length)}),s.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[N.count," ",N.count===1?D:a,N.savedCount>0&&s.jsxs(s.Fragment,{children:[" ","·"," ",u("sandbox.runnableBlocksBrowser.savedCountLabel",{count:N.savedCount})]})]})]})]},N.name)})}),(oe.length>0||ce.length>0)&&s.jsxs("div",{className:De("flex flex-col gap-1",te.length>0&&"mt-4"),children:[oe.map(N=>{const de=ae.get(N.resolveType)??[],ye=v.has(N.resolveType);return s.jsxs("div",{className:"flex flex-col",children:[s.jsx(Re,{icon:z,title:N.title,subtitle:N.resolveType,active:!1,onClick:()=>ee(N)}),de.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>U(N.resolveType),"aria-expanded":ye,className:"flex items-center gap-1 self-start classic:rounded-md compact:rounded-lg px-2.5 py-1 text-xs font-medium transition-colors hover:bg-global-section/10 cursor-pointer ml-11",style:{color:Yt},children:[ye?s.jsx(qt,{size:12,className:"shrink-0"}):s.jsx(Kt,{size:12,className:"shrink-0"}),u(ye?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",de.length,")"]}),ye&&s.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:de.map(Ee=>s.jsx(Re,{icon:z,accent:"global",title:Ee.title,subtitle:Ee.resolveType,active:!1,onClick:()=>ee(Ee)},Ee.savedKey))})]})]},N.resolveType)}),ce.map(N=>s.jsx(Re,{icon:z,accent:"global",title:N.title,subtitle:N.resolveType,active:!1,onClick:()=>ee(N)},N.savedKey))]})]})}e[10]=z,e[11]=c,e[12]=r,e[13]=a,e[14]=i,e[15]=v,e[16]=n,e[17]=d,e[18]=l,e[19]=j,e[20]=M,e[21]=y,e[22]=p,e[23]=D,e[24]=u,e[25]=o,e[26]=K,e[27]=_,e[28]=$,e[29]=V,e[30]=A,e[31]=H,e[32]=X}else K=e[26],_=e[27],$=e[28],V=e[29],A=e[30],H=e[31],X=e[32];if($!==Symbol.for("react.early_return_sentinel"))return $;let B;e[87]!==V||e[88]!==A?(B=s.jsx("div",{className:V,children:A}),e[87]=V,e[88]=A,e[89]=B):B=e[89];let J;e[90]!==K||e[91]!==B||e[92]!==H?(J=s.jsx(K,{className:H,children:B}),e[90]=K,e[91]=B,e[92]=H,e[93]=J):J=e[93];let Y;return e[94]!==_||e[95]!==J||e[96]!==X?(Y=s.jsxs("div",{className:X,children:[_,J]}),e[94]=_,e[95]=J,e[96]=X,e[97]=Y):Y=e[97],Y}function ha(t){const[e,n]=t;return{name:e,...n}}function ga(t,e){return t.title.localeCompare(e.title)}function xa(t){const[,e]=t;return e}function ba(t,e){return t.title.localeCompare(e.title)}function ya(t,e){return t.title.localeCompare(e.title)}function va(t){return{resolveType:t.resolveType,title:t.title,folderPath:Js(t.resolveType)}}function Sa(t){return{resolveType:t.resolveType,title:t.title,folderPath:Js(t.resolveType),savedKey:t.key}}function ka(){return new Set}function ja(t,e){if(!t)return null;if(t.mode==="available")return{mode:"available",resolveType:t.resolveType,editorTarget:{mode:"available",resolveType:t.resolveType,title:t.title},initialValue:{}};const{resolveType:n,props:o,title:c}=io(e,t.key);return{mode:"saved",blockKey:t.key,resolveType:n,editorTarget:{mode:"saved",blockKey:t.key,resolveType:n,title:c},initialValue:o}}function Ca(t){const e=je.c(106),{orgSlug:n,virtualMcpId:o,branch:c,previewUrl:l,meta:i,decofile:r,resolveType:a,title:u,defaultBlockId:x,isCreating:d,onCreate:h,onSaveReferencedBlock:p}=t,f=Be(),y=_t(),g=y?.virtualMcpId,S=en(g===o?o:null)?.metadata?.siteSlug??null;let k;e[0]===Symbol.for("react.memo_cache_sentinel")?(k={},e[0]=k):k=e[0];const[C,w]=G.useState(k);let U;e[1]===Symbol.for("react.memo_cache_sentinel")?(U=[],e[1]=U):U=e[1];const[T,j]=G.useState(U),[I,M]=G.useState(0),[F,D]=G.useState(!1);let z;e[2]!==i||e[3]!==a?(z=Jt(a,i),e[2]=i,e[3]=a,e[4]=z):z=e[4];const K=z;let _,$,V,A,H,X,B,J;if(e[5]!==S||e[6]!==c||e[7]!==r||e[8]!==T||e[9]!==C||e[10]!==d||e[11]!==h||e[12]!==n||e[13]!==l||e[14]!==a||e[15]!==f||e[16]!==y?.taskId||e[17]!==u||e[18]!==o){const oe=a.split("/").pop()?.replace(/\.tsx?$/,"")??a,ae=y?.taskId??null,ce=l??void 0;let O;e[27]!==S||e[28]!==c||e[29]!==n||e[30]!==ce||e[31]!==ae||e[32]!==o?(O={orgSlug:n,virtualMcpId:o,branch:c,threadId:ae,previewUrl:ce,siteSlug:S},e[27]=S,e[28]=c,e[29]=n,e[30]=ce,e[31]=ae,e[32]=o,e[33]=O):O=e[33],$=O;let te,Z,ee,ie;if(e[34]!==r||e[35]!==T||e[36]!==C||e[37]!==h||e[38]!==f||e[39]!==u){const pe=[u,...T],Ce=Ne=>{j(T.slice(0,Ne)),M(wa)};let we;e[48]!==r||e[49]!==C||e[50]!==h?(we=async Ne=>{const Se=mo(Ne,r);if(Se){ve.error(Se);return}await h(Ne,C),D(!1)},e[48]=r,e[49]=C,e[50]=h,e[51]=we):we=e[51],_=we,J="flex h-full w-full min-w-0",B="flex min-w-0 flex-1 flex-col",H="shrink-0 border-b px-3 py-2.5",ie="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==f?(te=f("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=f,e[53]=te):te=e[53],Z="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",ee=pe.map((Ne,Se)=>{const he=Se===pe.length-1,Te=uo(Ne);return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[Se>0&&s.jsx(Kt,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>Ce(Se),title:Te,className:De("min-w-0 truncate classic:rounded-md compact:rounded-lg px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",he?"font-medium text-foreground":"text-muted-foreground"),children:Te})]},`${Te}-${Se}`)}),e[34]=r,e[35]=T,e[36]=C,e[37]=h,e[38]=f,e[39]=u,e[40]=_,e[41]=te,e[42]=Z,e[43]=ee,e[44]=ie,e[45]=H,e[46]=B,e[47]=J}else _=e[40],te=e[41],Z=e[42],ee=e[43],ie=e[44],H=e[45],B=e[46],J=e[47];let R;e[54]!==te||e[55]!==Z||e[56]!==ee?(R=s.jsx("nav",{"aria-label":te,className:Z,children:ee}),e[54]=te,e[55]=Z,e[56]=ee,e[57]=R):R=e[57];let ge;e[58]===Symbol.for("react.memo_cache_sentinel")?(ge=()=>D(!0),e[58]=ge):ge=e[58];let E;e[59]!==f?(E=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=f,e[60]=E):E=e[60];let xe;e[61]===Symbol.for("react.memo_cache_sentinel")?(xe=s.jsx(In,{size:14}),e[61]=xe):xe=e[61];let me;e[62]!==d||e[63]!==E?(me=s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{size:"icon",className:"size-8 shrink-0",disabled:d,onClick:ge,"aria-label":E,children:xe})}),e[62]=d,e[63]=E,e[64]=me):me=e[64];let fe;e[65]!==f?(fe=f("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=f,e[66]=fe):fe=e[66];let be;e[67]!==fe?(be=s.jsx(Me,{side:"bottom",children:fe}),e[67]=fe,e[68]=be):be=e[68];let ne;e[69]!==me||e[70]!==be?(ne=s.jsxs(ze,{children:[me,be]}),e[69]=me,e[70]=be,e[71]=ne):ne=e[71],e[72]!==ie||e[73]!==R||e[74]!==ne?(X=s.jsxs("div",{className:ie,children:[R,ne]}),e[72]=ie,e[73]=R,e[74]=ne,e[75]=X):X=e[75],V="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",A=f("sandbox.availableSectionEditor.localEditsHint",{typeLabel:oe}),e[5]=S,e[6]=c,e[7]=r,e[8]=T,e[9]=C,e[10]=d,e[11]=h,e[12]=n,e[13]=l,e[14]=a,e[15]=f,e[16]=y?.taskId,e[17]=u,e[18]=o,e[19]=_,e[20]=$,e[21]=V,e[22]=A,e[23]=H,e[24]=X,e[25]=B,e[26]=J}else _=e[19],$=e[20],V=e[21],A=e[22],H=e[23],X=e[24],B=e[25],J=e[26];let Y;e[76]!==V||e[77]!==A?(Y=s.jsx("p",{className:V,children:A}),e[76]=V,e[77]=A,e[78]=Y):Y=e[78];let W;e[79]!==Y||e[80]!==H||e[81]!==X?(W=s.jsxs("div",{className:H,children:[X,Y]}),e[79]=Y,e[80]=H,e[81]=X,e[82]=W):W=e[82];let L;e[83]!==r||e[84]!==T||e[85]!==I||e[86]!==C||e[87]!==i||e[88]!==p||e[89]!==$||e[90]!==K||e[91]!==f?(L=s.jsx(Et,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:K?s.jsx(Ys,{schema:K,value:C,onChange:oe=>w(oe),basePath:"",breadcrumbPath:T,onBreadcrumbChange:j,meta:i,decofile:r,onSaveReferencedBlock:p,sandbox:$},I):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=r,e[84]=T,e[85]=I,e[86]=C,e[87]=i,e[88]=p,e[89]=$,e[90]=K,e[91]=f,e[92]=L):L=e[92];let se;e[93]!==W||e[94]!==L||e[95]!==B?(se=s.jsxs("div",{className:B,children:[W,L]}),e[93]=W,e[94]=L,e[95]=B,e[96]=se):se=e[96];let re;e[97]!==x||e[98]!==_||e[99]!==d||e[100]!==F?(re=s.jsx(fo,{open:F,onOpenChange:D,defaultBlockId:x,isPending:d,onSubmit:_}),e[97]=x,e[98]=_,e[99]=d,e[100]=F,e[101]=re):re=e[101];let le;return e[102]!==se||e[103]!==re||e[104]!==J?(le=s.jsxs("div",{className:J,children:[se,re]}),e[102]=se,e[103]=re,e[104]=J,e[105]=le):le=e[105],le}function wa(t){return t+1}function Na(t,e){const n={__resolveType:t},o=go([n],e)[0];return o?xo(n,o,e):null}function Pa({orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,meta:c,decofile:l,blockKey:i,onSaveReferencedBlock:r}){const a=Be(),u=_t(),x=u?.virtualMcpId,h=en(x===e?e:null)?.metadata?.siteSlug??null,[p]=G.useState(()=>Na(i,l)),[f,y]=G.useState(p?.data??{}),[g,v]=G.useState([]),[S,k]=G.useState(0),[C,w]=G.useState(!1),[U,T]=G.useState(null),j=U!==null,{save:I,flush:M}=po({orgSlug:t,virtualMcpId:e,branch:n}),F=p?.resolveType?Jt(p.resolveType,c):null,D=l[i],z=D?To(i,D):i,K=u?.taskId??null,_={orgSlug:t,virtualMcpId:e,branch:n,threadId:K,previewUrl:o??void 0,siteSlug:h},$=B=>{y(B),I(i,B)},V=()=>{j?(T(null),w(!1),k(B=>B+1)):T(JSON.stringify(f,null,2))},A=B=>{const J=B??"";try{const Y=JSON.parse(J);if(Y&&typeof Y=="object"&&!Array.isArray(Y)){w(!1),$(Y);return}w(!0)}catch{w(!0)}},H=[z,...g],X=B=>{v(g.slice(0,B)),k(J=>J+1)};return s.jsx("div",{className:"flex h-full w-full min-w-0",children:s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx(ho,{crumbs:H,onSelect:X}),s.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Yt},"aria-hidden":!0}),s.jsx("div",{className:"flex-1"}),s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{variant:j?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:V,"aria-label":a(j?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":j,children:j?s.jsx(ns,{size:14}):s.jsx(Ms,{size:14})})}),s.jsx(Me,{side:"bottom",children:a(j?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),s.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:a("sandbox.savedSectionEditor.globalSectionDescription")})]}),s.jsxs("div",{className:"relative min-h-0 flex-1",children:[s.jsx(Et,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:F?s.jsx(Ys,{schema:F,value:f,onChange:B=>$(B),basePath:"",breadcrumbPath:g,onBreadcrumbChange:v,meta:c,decofile:l,onSaveReferencedBlock:r,sandbox:_},S):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:a("sandbox.savedSectionEditor.noEditableFields")})})})}),U!==null&&s.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[C&&s.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:a("sandbox.savedSectionEditor.invalidJsonError")}),s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(el,{language:"json",height:"100%",code:U,onChange:A,onSave:B=>{A(B),M()}})})]})]})]})})}function Ta(t){const e=je.c(36),{selection:n,orgSlug:o,virtualMcpId:c,branch:l,previewUrl:i,meta:r,decofile:a,isCreating:u,onCreateAvailable:x,onSaveReferencedBlock:d}=t,h=Be();if(!n){let y;e[0]!==h?(y=h("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=h,e[1]=y):y=e[1];let g;e[2]!==h?(g=h("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=h,e[3]=g):g=e[3];let v;return e[4]!==y||e[5]!==g?(v=s.jsx(He,{title:y,description:g}),e[4]=y,e[5]=g,e[6]=v):v=e[6],v}if(n.collection==="available-section"){const y=`available:${n.resolveType}`,g=n.resolveType,v=n.title;let S;e[7]!==n.title?(S=bo(n.title),e[7]=n.title,e[8]=S):S=e[8];let k;e[9]!==x||e[10]!==n.resolveType?(k=(w,U)=>x(n.resolveType,w,U),e[9]=x,e[10]=n.resolveType,e[11]=k):k=e[11];let C;return e[12]!==l||e[13]!==a||e[14]!==u||e[15]!==r||e[16]!==d||e[17]!==o||e[18]!==i||e[19]!==n.resolveType||e[20]!==n.title||e[21]!==y||e[22]!==S||e[23]!==k||e[24]!==c?(C=s.jsx(Ca,{orgSlug:o,virtualMcpId:c,branch:l,previewUrl:i,meta:r,decofile:a,resolveType:g,title:v,defaultBlockId:S,isCreating:u,onCreate:k,onSaveReferencedBlock:d},y),e[12]=l,e[13]=a,e[14]=u,e[15]=r,e[16]=d,e[17]=o,e[18]=i,e[19]=n.resolveType,e[20]=n.title,e[21]=y,e[22]=S,e[23]=k,e[24]=c,e[25]=C):C=e[25],C}const p=`saved:${n.key}`;let f;return e[26]!==l||e[27]!==a||e[28]!==r||e[29]!==d||e[30]!==o||e[31]!==i||e[32]!==n.key||e[33]!==p||e[34]!==c?(f=s.jsx(Pa,{orgSlug:o,virtualMcpId:c,branch:l,previewUrl:i,meta:r,decofile:a,blockKey:n.key,onSaveReferencedBlock:d},p),e[26]=l,e[27]=a,e[28]=r,e[29]=d,e[30]=o,e[31]=i,e[32]=n.key,e[33]=p,e[34]=c,e[35]=f):f=e[35],f}const ks="__all__",js={"date-desc":"sandbox.postToolbar.sortNewestFirst","date-asc":"sandbox.postToolbar.sortOldestFirst",az:"sandbox.postToolbar.sortTitleAZ",za:"sandbox.postToolbar.sortTitleZA"},_a={"date-desc":"sandbox.postToolbar.sortNewest","date-asc":"sandbox.postToolbar.sortOldest",az:"sandbox.postToolbar.sortAZ",za:"sandbox.postToolbar.sortZA"},wt={published:"sandbox.postToolbar.statusPublished",scheduled:"sandbox.postToolbar.statusScheduled",draft:"sandbox.postToolbar.statusDraft"},Cs="status:";function ws(t){if(!t.startsWith(Cs))return null;const e=t.slice(Cs.length);return e in wt?e:null}const Ns=G.forwardRef(function(e,n){const o=je.c(20);let c,l,i,r,a;o[0]!==e?({icon:c,active:l,value:a,className:i,...r}=e,o[0]=e,o[1]=c,o[2]=l,o[3]=i,o[4]=r,o[5]=a):(c=o[1],l=o[2],i=o[3],r=o[4],a=o[5]);const u=l?"text-foreground":"text-muted-foreground";let x;o[6]!==i||o[7]!==u?(x=De("h-7 gap-1 px-1.5 text-xs",u,i),o[6]=i,o[7]=u,o[8]=x):x=o[8];let d;o[9]!==c?(d=s.jsx(c,{size:14,className:"shrink-0"}),o[9]=c,o[10]=d):d=o[10];let h;o[11]!==a?(h=a&&s.jsx("span",{className:"min-w-0 flex-1 truncate",children:a}),o[11]=a,o[12]=h):h=o[12];let p;o[13]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(qt,{size:12,className:"shrink-0 opacity-60"}),o[13]=p):p=o[13];let f;return o[14]!==r||o[15]!==n||o[16]!==x||o[17]!==d||o[18]!==h?(f=s.jsxs(Oe,{ref:n,type:"button",variant:"ghost",size:"sm",className:x,...r,children:[d,h,p]}),o[14]=r,o[15]=n,o[16]=x,o[17]=d,o[18]=h,o[19]=f):f=o[19],f});function as(t){const e=je.c(2),{count:n}=t;let o;return e[0]!==n?(o=s.jsx("span",{className:"ml-auto pl-3 text-xs text-muted-foreground tabular-nums",children:n}),e[0]=n,e[1]=o):o=e[1],o}function Ea(t){const e=je.c(101),{categories:n,authors:o,statusCounts:c,categoryFilter:l,authorFilter:i,statusFilter:r,sort:a,onCategoryFilterChange:u,onAuthorFilterChange:x,onStatusFilterChange:d,onSortChange:h}=t,p=Be();let f;if(e[0]!==n||e[1]!==l){let E;e[3]!==l?(E=xe=>xe.slug===l,e[3]=l,e[4]=E):E=e[4],f=n.find(E),e[0]=n,e[1]=l,e[2]=f}else f=e[2];const y=f;let g;if(e[5]!==i||e[6]!==o){let E;e[8]!==i?(E=xe=>xe.email===i,e[8]=i,e[9]=E):E=e[9],g=o.find(E),e[5]=i,e[6]=o,e[7]=g}else g=e[7];const v=g,S=!!(l||i||r);let k;e[10]!==v?.name||e[11]!==y?.name||e[12]!==r||e[13]!==p?(k=y?.name??v?.name??p(r?wt[r]:"sandbox.postToolbar.filterLabel"),e[10]=v?.name,e[11]=y?.name,e[12]=r,e[13]=p,e[14]=k):k=e[14];const C=k,w=l?`cat:${l}`:i?`author:${i}`:r?`status:${r}`:ks;let U;e[15]!==x||e[16]!==u||e[17]!==d?(U=()=>{u(null),x(null),d(null)},e[15]=x,e[16]=u,e[17]=d,e[18]=U):U=e[18];const T=U;let j;e[19]!==T||e[20]!==x||e[21]!==u||e[22]!==d?(j=E=>{E.startsWith("cat:")?(x(null),d(null),u(E.slice(4))):E.startsWith("author:")?(u(null),d(null),x(E.slice(7))):ws(E)?(u(null),x(null),d(ws(E))):T()},e[19]=T,e[20]=x,e[21]=u,e[22]=d,e[23]=j):j=e[23];const I=j;let M;e[24]!==C||e[25]!==S?(M=s.jsx(It,{asChild:!0,children:s.jsx(Ns,{icon:Mn,active:S,value:C,className:"min-w-0 shrink"})}),e[24]=C,e[25]=S,e[26]=M):M=e[26];let F;e[27]!==p?(F=p("sandbox.postToolbar.filterBy"),e[27]=p,e[28]=F):F=e[28];let D;e[29]!==F?(D=s.jsx(pt,{children:F}),e[29]=F,e[30]=D):D=e[30];let z;e[31]!==p?(z=p("sandbox.postToolbar.allPosts"),e[31]=p,e[32]=z):z=e[32];let K;e[33]!==z?(K=s.jsx(bt,{value:ks,children:z}),e[33]=z,e[34]=K):K=e[34];let _;e[35]!==p?(_=p("sandbox.postToolbar.statusLabel"),e[35]=p,e[36]=_):_=e[36];let $;e[37]!==_?($=s.jsx(pt,{className:"text-muted-foreground/70",children:_}),e[37]=_,e[38]=$):$=e[38];let V;e[39]===Symbol.for("react.memo_cache_sentinel")?(V=Object.keys(wt),e[39]=V):V=e[39];let A;e[40]!==c||e[41]!==p?(A=V.map(E=>s.jsxs(bt,{value:`status:${E}`,children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:p(wt[E])}),s.jsx(as,{count:c[E]})]},`status:${E}`)),e[40]=c,e[41]=p,e[42]=A):A=e[42];let H;e[43]!==n.length||e[44]!==p?(H=n.length>0&&s.jsx(pt,{className:"text-muted-foreground/70",children:p("sandbox.postToolbar.categoryLabel")}),e[43]=n.length,e[44]=p,e[45]=H):H=e[45];let X;e[46]!==n?(X=n.map(Aa),e[46]=n,e[47]=X):X=e[47];let B;e[48]!==o.length||e[49]!==p?(B=o.length>0&&s.jsx(pt,{className:"text-muted-foreground/70",children:p("sandbox.postToolbar.authorLabel")}),e[48]=o.length,e[49]=p,e[50]=B):B=e[50];let J;e[51]!==o?(J=o.map(Da),e[51]=o,e[52]=J):J=e[52];let Y;e[53]!==w||e[54]!==I||e[55]!==K||e[56]!==$||e[57]!==A||e[58]!==H||e[59]!==X||e[60]!==B||e[61]!==J?(Y=s.jsxs(is,{value:w,onValueChange:I,children:[K,$,A,H,X,B,J]}),e[53]=w,e[54]=I,e[55]=K,e[56]=$,e[57]=A,e[58]=H,e[59]=X,e[60]=B,e[61]=J,e[62]=Y):Y=e[62];let W;e[63]!==Y||e[64]!==D?(W=s.jsxs(Mt,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[D,Y]}),e[63]=Y,e[64]=D,e[65]=W):W=e[65];let L;e[66]!==W||e[67]!==M?(L=s.jsxs(zt,{children:[M,W]}),e[66]=W,e[67]=M,e[68]=L):L=e[68];let se;e[69]!==T||e[70]!==S||e[71]!==p?(se=S&&s.jsx(Ba,{label:p("sandbox.postToolbar.clearFilter"),onClick:T}),e[69]=T,e[70]=S,e[71]=p,e[72]=se):se=e[72];const re=_a[a];let le;e[73]!==p||e[74]!==re?(le=p(re),e[73]=p,e[74]=re,e[75]=le):le=e[75];let oe;e[76]!==le?(oe=s.jsx(It,{asChild:!0,children:s.jsx(Ns,{icon:zn,active:!0,value:le})}),e[76]=le,e[77]=oe):oe=e[77];let ae;e[78]!==p?(ae=p("sandbox.postToolbar.sortBy"),e[78]=p,e[79]=ae):ae=e[79];let ce;e[80]!==ae?(ce=s.jsx(pt,{children:ae}),e[80]=ae,e[81]=ce):ce=e[81];let O;e[82]!==h?(O=E=>h(E),e[82]=h,e[83]=O):O=e[83];let te;e[84]===Symbol.for("react.memo_cache_sentinel")?(te=Object.keys(js),e[84]=te):te=e[84];let Z;e[85]!==p?(Z=te.map(E=>s.jsx(bt,{value:E,children:p(js[E])},E)),e[85]=p,e[86]=Z):Z=e[86];let ee;e[87]!==a||e[88]!==O||e[89]!==Z?(ee=s.jsx(is,{value:a,onValueChange:O,children:Z}),e[87]=a,e[88]=O,e[89]=Z,e[90]=ee):ee=e[90];let ie;e[91]!==ce||e[92]!==ee?(ie=s.jsxs(Mt,{align:"end",className:"w-44",children:[ce,ee]}),e[91]=ce,e[92]=ee,e[93]=ie):ie=e[93];let R;e[94]!==oe||e[95]!==ie?(R=s.jsx("div",{className:"ml-auto shrink-0",children:s.jsxs(zt,{children:[oe,ie]})}),e[94]=oe,e[95]=ie,e[96]=R):R=e[96];let ge;return e[97]!==L||e[98]!==se||e[99]!==R?(ge=s.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[L,se,R]}),e[97]=L,e[98]=se,e[99]=R,e[100]=ge):ge=e[100],ge}function Da(t){return s.jsxs(bt,{value:`author:${t.email}`,children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),s.jsx(as,{count:t.count})]},`author:${t.email}`)}function Aa(t){return s.jsxs(bt,{value:`cat:${t.slug}`,children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),s.jsx(as,{count:t.count})]},`cat:${t.slug}`)}function Ba(t){const e=je.c(4),{label:n,onClick:o}=t;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ns,{size:12}),e[0]=c):c=e[0];let l;return e[1]!==n||e[2]!==o?(l=s.jsx("button",{type:"button","aria-label":n,onClick:o,className:"flex h-6 w-6 shrink-0 items-center justify-center classic:rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer compact:rounded-lg",children:c}),e[1]=n,e[2]=o,e[3]=l):l=e[3],l}function $a(t){const e=je.c(18),{checked:n,disabled:o,onToggle:c}=t,l=Be();let i;e[0]!==c?(i=()=>c(),e[0]=c,e[1]=i):i=e[1];let r;e[2]!==n||e[3]!==l?(r=l(n?"sandbox.postToolbar.deselectAllPosts":"sandbox.postToolbar.selectAllPosts"),e[2]=n,e[3]=l,e[4]=r):r=e[4];let a;e[5]!==n||e[6]!==o||e[7]!==i||e[8]!==r?(a=s.jsx(Ie,{asChild:!0,children:s.jsx("span",{className:"flex shrink-0 items-center px-1.5",onClick:La,children:s.jsx(ss,{checked:n,disabled:o,onCheckedChange:i,"aria-label":r})})}),e[5]=n,e[6]=o,e[7]=i,e[8]=r,e[9]=a):a=e[9];let u;e[10]!==n||e[11]!==l?(u=l(n?"sandbox.postToolbar.deselectAll":"sandbox.postToolbar.selectAll"),e[10]=n,e[11]=l,e[12]=u):u=e[12];let x;e[13]!==u?(x=s.jsx(Me,{side:"bottom",children:u}),e[13]=u,e[14]=x):x=e[14];let d;return e[15]!==a||e[16]!==x?(d=s.jsxs(ze,{children:[a,x]}),e[15]=a,e[16]=x,e[17]=d):d=e[17],d}function La(t){return t.stopPropagation()}function Oa(t){const e=je.c(42),{count:n,allSelected:o,onToggleSelectAll:c,onDelete:l,onExit:i}=t,r=Be();let a;e[0]!==o||e[1]!==c?(a=s.jsx($a,{checked:o,onToggle:c}),e[0]=o,e[1]=c,e[2]=a):a=e[2];let u;e[3]!==n||e[4]!==r?(u=r("sandbox.postToolbar.itemsSelected",{count:n}),e[3]=n,e[4]=r,e[5]=u):u=e[5];let x;e[6]!==u?(x=s.jsx("span",{className:"text-xs font-medium tabular-nums",children:u}),e[6]=u,e[7]=x):x=e[7];const d=n===0;let h;e[8]!==r?(h=r("sandbox.postToolbar.deleteSelectedPosts"),e[8]=r,e[9]=h):h=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(tn,{size:14}),e[10]=p):p=e[10];let f;e[11]!==l||e[12]!==d||e[13]!==h?(f=s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",disabled:d,onClick:l,"aria-label":h,children:p})}),e[11]=l,e[12]=d,e[13]=h,e[14]=f):f=e[14];let y;e[15]!==r?(y=r("sandbox.postToolbar.deleteSelected"),e[15]=r,e[16]=y):y=e[16];let g;e[17]!==y?(g=s.jsx(Me,{side:"bottom",children:y}),e[17]=y,e[18]=g):g=e[18];let v;e[19]!==f||e[20]!==g?(v=s.jsxs(ze,{children:[f,g]}),e[19]=f,e[20]=g,e[21]=v):v=e[21];let S;e[22]!==r?(S=r("sandbox.postToolbar.exitSelection"),e[22]=r,e[23]=S):S=e[23];let k;e[24]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(ns,{size:14}),e[24]=k):k=e[24];let C;e[25]!==i||e[26]!==S?(C=s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,"aria-label":S,children:k})}),e[25]=i,e[26]=S,e[27]=C):C=e[27];let w;e[28]!==r?(w=r("sandbox.postToolbar.exitSelection"),e[28]=r,e[29]=w):w=e[29];let U;e[30]!==w?(U=s.jsx(Me,{side:"bottom",children:w}),e[30]=w,e[31]=U):U=e[31];let T;e[32]!==C||e[33]!==U?(T=s.jsxs(ze,{children:[C,U]}),e[32]=C,e[33]=U,e[34]=T):T=e[34];let j;e[35]!==v||e[36]!==T?(j=s.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[v,T]}),e[35]=v,e[36]=T,e[37]=j):j=e[37];let I;return e[38]!==a||e[39]!==j||e[40]!==x?(I=s.jsxs("div",{className:"flex items-center gap-0.5 border-b bg-accent/40 px-2 py-1.5",children:[a,x,j]}),e[38]=a,e[39]=j,e[40]=x,e[41]=I):I=e[41],I}function gt(t){const e=je.c(34),{onDuplicate:n,onRename:o,onAddVariant:c,onEditSeo:l,onViewJson:i,onDelete:r}=t,a=Be();let u;e[0]!==a?(u=a("sandbox.itemActions.moreActions"),e[0]=a,e[1]=u):u=e[1];let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Dn,{size:14}),e[2]=x):x=e[2];let d;e[3]!==u?(d=s.jsx(It,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":u,className:"flex h-7 w-7 items-center justify-center classic:rounded-md compact:rounded-lg text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:Ra,children:x})}),e[3]=u,e[4]=d):d=e[4];let h;e[5]!==o||e[6]!==a?(h=o&&s.jsxs(lt,{onClick:o,children:[s.jsx(sl,{size:14}),a("sandbox.itemActions.rename")]}),e[5]=o,e[6]=a,e[7]=h):h=e[7];let p;e[8]!==n||e[9]!==a?(p=n&&s.jsxs(lt,{onClick:n,children:[s.jsx(tl,{size:14}),a("sandbox.itemActions.duplicate")]}),e[8]=n,e[9]=a,e[10]=p):p=e[10];let f;e[11]!==c||e[12]!==a?(f=c&&s.jsxs(s.Fragment,{children:[s.jsx(Bt,{}),s.jsxs(lt,{onClick:c,className:"cursor-pointer text-success focus:text-success",children:[s.jsx(Zo,{size:14}),a("sandbox.itemActions.addVariant")]})]}),e[11]=c,e[12]=a,e[13]=f):f=e[13];let y;e[14]!==l||e[15]!==i||e[16]!==a?(y=(l||i)&&s.jsxs(s.Fragment,{children:[s.jsx(Bt,{}),l&&s.jsxs(lt,{onClick:l,children:[s.jsx(Ks,{size:14}),a("sandbox.itemActions.editSeo")]}),i&&s.jsxs(lt,{onClick:i,children:[s.jsx(Ms,{size:14}),a("sandbox.itemActions.viewJson")]})]}),e[14]=l,e[15]=i,e[16]=a,e[17]=y):y=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Bt,{}),e[18]=g):g=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(tn,{size:14}),e[19]=v):v=e[19];let S;e[20]!==a?(S=a("sandbox.itemActions.delete"),e[20]=a,e[21]=S):S=e[21];let k;e[22]!==r||e[23]!==S?(k=s.jsxs(lt,{onClick:r,className:"text-destructive focus:text-destructive",children:[v,S]}),e[22]=r,e[23]=S,e[24]=k):k=e[24];let C;e[25]!==k||e[26]!==h||e[27]!==p||e[28]!==f||e[29]!==y?(C=s.jsxs(Mt,{align:"end",className:"w-44",children:[h,p,f,y,g,k]}),e[25]=k,e[26]=h,e[27]=p,e[28]=f,e[29]=y,e[30]=C):C=e[30];let w;return e[31]!==C||e[32]!==d?(w=s.jsxs(zt,{children:[d,C]}),e[31]=C,e[32]=d,e[33]=w):w=e[33],w}function Ra(t){return t.stopPropagation()}function Fa(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function Ka(t){const e=new Map;for(const n of t){const o=Fa(n.resolveType),c=e.get(o);c?c.push(n):e.set(o,[n])}return[...e.entries()].map(([n,o])=>({label:n,sections:o})).sort((n,o)=>n.label.localeCompare(o.label))}function Ps(t){const e=je.c(8),{icon:n,label:o,className:c}=t;let l;e[0]!==c?(l=De("flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",c),e[0]=c,e[1]=l):l=e[1];let i;e[2]!==n?(i=s.jsx(n,{size:13,className:"shrink-0"}),e[2]=n,e[3]=i):i=e[3];let r;return e[4]!==o||e[5]!==l||e[6]!==i?(r=s.jsxs("div",{className:l,children:[i,o]}),e[4]=o,e[5]=l,e[6]=i,e[7]=r):r=e[7],r}const Ts=G.lazy(()=>Fe(()=>import("./app-editor-BvFwnnVI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177])).then(t=>({default:t.AppEditor}))),Ia=G.lazy(()=>Fe(()=>import("./post-editor-D1cbn1uM.js"),__vite__mapDeps([178,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,32,52,31,33,34,35,36,37,38,39,40,27,28,30,41,42,43,44,45,46,47,48,49,50,51,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,110,179,164,143,90,91,67,113,121,119,117,72,71,73,74,75,69,76,77,78,79,80,81,82,83,84,85,86,26,87,88,89,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,24,25,114,115,116,118,120,122,123,124,125,126,127,128,129,130,180,70,147,181,182,183,184,131,132,133,134,135,136,137,138,139,140,141,142,144,145,146,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,165,166,167,168,169,170,171,172,173,174,175,176,177])).then(t=>({default:t.PostEditor}))),Ma=G.lazy(()=>Fe(()=>import("./record-editor-DsGWfuGc.js"),__vite__mapDeps([185,1,2,68,110,25,26,27,28,117,72,71,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,73,74,38,48,75,69,31,32,33,34,35,36,37,39,40,30,41,42,43,44,45,46,47,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,76,77,78,79,80,81,82,83,67,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,24,114,115,116,118,119,120,121,122,123,124,125,126,127,128,129,130,182,184,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177])).then(t=>({default:t.RecordEditor}))),za=G.lazy(()=>Fe(()=>import("./category-editor-PjVafxmN.js"),__vite__mapDeps([186,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,36,38,52,31,32,33,34,35,37,39,40,27,28,30,41,42,43,44,45,46,47,48,49,50,51,53,54,55,56,57,58,59,60,61,62,63,64,65,66,129,68,110,180,70,69,118,90,91,67,113,72,71,73,74,75,76,77,78,79,80,81,82,83,84,85,86,26,87,88,89,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,24,25,114,115,116,117,119,120,121,122,123,124,125,126,127,128,130,147,181,182,183,184,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177])).then(t=>({default:t.CategoryEditor}))),Va=G.lazy(()=>Fe(()=>import("./bulk-category-panel-BM2yDxDT.js"),__vite__mapDeps([187,1,2,38,65,110,188,25,26,27,28,86])).then(t=>({default:t.BulkCategoryPanel}))),Ua=G.lazy(()=>Fe(()=>import("./sections-editor-CCdVMsOX.js"),__vite__mapDeps([189,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,72,71,73,74,38,48,75,69,31,32,33,34,35,36,37,39,40,27,28,30,41,42,43,44,45,46,47,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,76,77,78,79,80,81,82,83,67,84,85,86,26,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,68,111,112,113,24,25,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,173,190,29,70,191])).then(t=>({default:t.SectionsEditor}))),Ga=G.lazy(()=>Fe(()=>import("./seo-editor-DRs_jGJ9.js"),__vite__mapDeps([192,1,2,31,32,33,34,35,36,37,38,39,40,27,28,30,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,24,25,26,72,71,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,73,74,75,69,76,77,78,79,80,81,82,83,67,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,68,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,190])).then(t=>({default:t.SeoEditor}))),Ha=G.lazy(()=>Fe(()=>import("./variant-calendar-CHV7Bmlb.js"),__vite__mapDeps([193,1,2,31,32,33,34,35,36,37,38,39,40,27,28,30,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,110,24,25,26,119,86,194,131,132,133,105,8,9,134,7,99,103,6,10,135,3,4,5,11,12,13,14,15,16,17,18,19,20,21,22,23,101,67,136,137,85,107,108,109,68,84,138,87,88,89,90,91,92,93,94,95,96,139,71,82,81,83,78,79,121,140,128,102,141,142,143,144,113,145,146,147,148,149,150,151,152,153,154,155,156,157,158,125,126,159,117,160,161,162,163,164,165,166,77,80,97,98,100,104,106,111,112,167,75,76,168,169,127,123,170,171,172,129,72,73,74,69,114,115,116,118,120,122,124,130,173,174,175,176,177])).then(t=>({default:t.VariantCalendar}))),Ja=G.lazy(()=>Fe(()=>import("./post-calendar-BcZ1isTp.js"),__vite__mapDeps([195,1,2,32,31,33,34,35,36,37,38,39,40,27,28,30,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,196,24,25,26,131,132,133,105,8,9,134,7,99,103,6,10,135,3,4,5,11,12,13,14,15,16,17,18,19,20,21,22,23,101,86,67,136,137,85,107,108,109,110,68,84,138,87,88,89,90,91,92,93,94,95,96,139,71,82,81,83,78,79,121,140,128,102,141,142,143,144,113,145,146,147,148,149,150,151,152,153,154,155,156,157,158,125,126,159,117,160,161,162,163,164,165,166,77,80,97,98,100,104,106,111,112,167,75,76,168,169,127,123,170,171,172,129,72,73,74,69,114,115,116,118,119,120,122,124,130,173,174,175,176,177])).then(t=>({default:t.PostCalendar}))),Wa=G.lazy(()=>Fe(()=>import("./redirect-editor-aLV6ur5L.js"),__vite__mapDeps([197,1,2,143,27,68,110,25,26,28,72,71,12,13,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,73,74,38,48,75,69,31,32,33,34,35,36,37,39,40,30,41,42,43,44,45,46,47,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,76,77,78,79,80,81,82,83,67,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,24,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,184])).then(t=>({default:t.RedirectEditor})));function Ya(t){const e=je.c(20),{deepLinkPage:n}=t,{currentBranch:o,virtualMcpId:c}=$s(),{org:l}=An(),i=Mo(),r=zo(),{runtime:a,previewServerUrl:u}=Vo(c),x=a==="cms";let d;e[0]!==x||e[1]!==r.previewState||e[2]!==i.lifecycle.phase?(d=kl({fastPreviewActive:x,previewState:r.previewState,lifecyclePhase:i.lifecycle.phase}),e[0]=x,e[1]=r.previewState,e[2]=i.lifecycle.phase,e[3]=d):d=e[3];const h=d;if(h.kind==="sandbox-card"){const y=`/${l.slug}/settings/connections`;let g;return e[4]!==h.state||e[5]!==r.start||e[6]!==y||e[7]!==i.lifecycle||e[8]!==i.phase?(g=s.jsx(vl,{state:h.state,claimPhase:i.phase,lifecycle:i.lifecycle,onStart:r.start,connectionsHref:y}),e[4]=h.state,e[5]=r.start,e[6]=y,e[7]=i.lifecycle,e[8]=i.phase,e[9]=g):g=e[9],g}if(!c||!o){let y;return e[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(He,{title:"Waiting for sandbox context…"}),e[10]=y):y=e[10],y}const p=x?u:r.previewUrl;let f;return e[11]!==o||e[12]!==n||e[13]!==h.devServerReady||e[14]!==h.sandboxWarming||e[15]!==r.previewUrl||e[16]!==l.slug||e[17]!==p||e[18]!==c?(f=s.jsx(Qa,{orgSlug:l.slug,virtualMcpId:c,branch:o,previewUrl:r.previewUrl,sitePreviewUrl:p,deepLinkPage:n,devServerReady:h.devServerReady,sandboxWarming:h.sandboxWarming}),e[11]=o,e[12]=n,e[13]=h.devServerReady,e[14]=h.sandboxWarming,e[15]=r.previewUrl,e[16]=l.slug,e[17]=p,e[18]=c,e[19]=f):f=e[19],f}const _s=2e3,qa=15;function Es(t,e,n,o){return typeof e!="string"||n&&(sn(e,n,o)||t.state.dataUpdateCount>=qa)?!1:_s}function Qa({orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,sitePreviewUrl:c,deepLinkPage:l,devServerReady:i,sandboxWarming:r}){const a=Be(),u=_t()?.taskId??null,x={orgSlug:t,virtualMcpId:e,branch:n,threadId:u,previewUrl:o},{data:d,isLoading:h}=yo(x,{fetchEnabled:i}),p=Bs({strict:!1}),[f,y]=G.useState(()=>p.contentCollection&&qe(p.contentCollection)&&p.contentCollection||"pages"),[g,v]=G.useState(()=>p.contentItem&&qe(f)?{collection:f,key:p.contentItem}:null),[S,k]=G.useState(null),C=!!(l?.pageId||l?.path||l?.pathTemplate),[w,U]=G.useState(!1);if(C&&!w&&g===null&&d){U(!0);const m=_o(cs(d),l??{});m&&(y("pages"),v({collection:"pages",key:m.key,path:m.path}))}const[T,j]=G.useState(""),[I,M]=G.useState(null),[F,D]=G.useState(null),[z,K]=G.useState(null),[_,$]=G.useState("date-desc"),[V,A]=G.useState(()=>new Set),[H,X]=G.useState(null),B=()=>{A(new Set),X(null)},J=m=>{v(m),k(null)},[Y,W]=G.useState(f);Y!==f&&(W(f),j(""),M(null),D(null),K(null),$("date-desc"),A(new Set),X(null));const{data:L,isLoading:se,isFetching:re}=vo(x,{fetchEnabled:i,refetchInterval:m=>{const P=m.state.data;if(f==="apps"&&g&&g.collection==="apps"){const q=d?.[g.key];return Es(m,typeof q?.__resolveType=="string"?q.__resolveType:void 0,P)}if(f==="site"&&d){const q=P?ds(d,P):null,Q=d.site,ke=q?.resolveType??(typeof Q?.__resolveType=="string"?Q.__resolveType:void 0);return Es(m,ke,P,["seo"])}return!1}}),le=(m,P)=>!sn(m,L,P)&&(se||re),{catalog:oe,isLoading:ae}=gl(L??void 0,d??void 0,{enabled:f==="apps"}),ce=ra({orgSlug:t,virtualMcpId:e,branch:n,meta:L}),O=Hs(x),te=Oo(x),[Z,ee]=G.useState(null),[ie,R]=G.useState(),[ge,E]=G.useState(!1),[xe,me]=G.useState(),[fe,be]=G.useState(null),[ne,pe]=G.useState(null),[Ce,we]=G.useState(null),Ne=!d||!L;if(h||se||Ne&&r)return s.jsx("div",{className:"h-full w-full flex items-center justify-center",children:s.jsx(Qe,{className:"size-5 text-muted-foreground"})});if(Ne)return s.jsx(He,{title:"Could not load site data."});const Se=cs(d).sort((m,P)=>m.name.localeCompare(P.name)),he=Eo(d).sort((m,P)=>m.from.localeCompare(P.from)),Te=Do(d,L),$e=f==="sections"?Ao(L):[],N=ds(d,L),de=rn(d),ye=os.some(m=>de[m].length>0),Ee=qe(f)?de[f]:[],ct=(ye?vt(d,"categories"):[]).map(({key:m,payload:P})=>{const q=typeof P.slug=="string"?P.slug:"",Q=typeof P.name=="string"?P.name:"";return{slug:q||m,name:Q||q||m}}).filter(m=>m.slug).sort((m,P)=>m.name.localeCompare(P.name)),et=f==="posts"&&(V.size>0||H!==null),dt=et?mn(d).filter(m=>V.has(m.key)):[],ut=rs(L,"loaders"),tt=rs(L,"actions");if(!Bo(d,L)&&!ye&&ut===0&&tt===0)return s.jsx(He,{icon:Ls,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const At={pages:Se.length,sections:Te.length,apps:oe.length,loaders:ut,actions:tt,redirects:he.length,posts:de.posts.length,authors:de.authors.length,categories:de.categories.length},We=new Set(Se.map(m=>Ct(m.path))),st=new Set(Se.map(m=>m.name)),mt=new Set(Te.map(m=>m.name)),nt=async m=>{const P=d[m.key];if(!P)return;const q=qs(d,m.key),Q=So(d,m.key,Math.max(0,q-1)),ke=ko(P.sections,Q);if(ke)try{await O.mutateAsync({blockKey:m.key,data:{...P,sections:ke}}),ve.success(`Variant added to "${m.name}"`),v({collection:"pages",key:m.key,path:m.path})}catch(_e){ve.error(_e instanceof Error?_e.message:"Could not add variant")}},Ve=()=>{R(void 0),ee({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},Ue=m=>{R(void 0),ee({mode:"duplicate",sourceKey:m.key,initialName:ps(st,m.name),initialPath:jl(We,m.path)})},Ge=m=>{R(void 0),ee({mode:"rename",sourceKey:m.key,initialName:m.name,initialPath:m.path})},b=async m=>{if(!Z)return;const{mode:P,sourceKey:q}=Z;try{if(P==="create"){let Q;if(m.templateKey){const _e=d[m.templateKey];if(!_e)throw new Error("Selected template no longer exists.");Q={..._e,name:m.name,path:m.path}}else Q=Nl(m.name,m.path);const ke=Tl(d,m.name);await O.mutateAsync({blockKey:ke,data:Q}),ve.success(`Created "${m.name}"`),v({collection:"pages",key:ke,path:m.path})}else if(P==="duplicate"&&q){const Q=d[q];if(!Q)throw new Error("Source page not found");const{key:ke,data:_e}=wl({source:Q,pages:Se,newName:m.name,newPath:m.path});await O.mutateAsync({blockKey:ke,data:_e}),ve.success(`Duplicated as "${m.name}"`),v({collection:"pages",key:ke,path:m.path})}else if(P==="rename"&&q){const Q=d[q];if(!Q)throw new Error("Page not found");const ke={...Q,name:m.name,path:m.path};await O.mutateAsync({blockKey:q,data:ke}),ve.success("Page updated"),g?.collection==="pages"&&g.key===q&&v({collection:"pages",key:q,path:m.path})}ee(null)}catch(Q){R(Q instanceof Error?Q.message:"Save failed")}},ue=({path:m})=>{if(!Z)return null;const P=Ct(m);return(Z.mode==="rename"?Ct(Z.initialPath):null)!==P&&We.has(P)?`A page with path "${m}" already exists.`:null},Ae=async(m,P,q)=>{await O.mutateAsync({blockKey:P,data:{...q,name:P,__resolveType:m}}),ve.success(a("sandbox.contentBrowser.createdSection",{name:P})),v({collection:"sections",key:P})},Ye=Ws((m,P)=>O.mutate({blockKey:m,data:P})),xn=async m=>{const P=d[m.key];if(!P){ve.error(a("sandbox.contentBrowser.sectionNotFound"));return}const q=Cl(d,m.key),Q=ps(mt,m.name),ke={...P,name:Q};try{await O.mutateAsync({blockKey:q,data:ke}),ve.success(a("sandbox.contentBrowser.duplicatedSection",{name:m.name})),v({collection:"sections",key:q})}catch(_e){ve.error(_e instanceof Error?_e.message:a("sandbox.contentBrowser.duplicateFailed"))}},bn=async m=>{if(!fe)return;const P=d[fe];if(!P){ve.error(a("sandbox.contentBrowser.sectionNotFound"));return}try{await O.mutateAsync({blockKey:fe,data:{...P,name:m}}),ve.success(a("sandbox.contentBrowser.sectionRenamed")),be(null)}catch(q){ve.error(q instanceof Error?q.message:a("sandbox.contentBrowser.renameFailed"))}},yn=()=>{me(void 0),E(!0)},vn=async m=>{const P=$o(d,m.from),q=Lo(m);try{await O.mutateAsync({blockKey:P,data:q}),ve.success("Created redirect"),E(!1),v({collection:"redirects",key:P})}catch(Q){me(Q instanceof Error?Q.message:"Could not create redirect")}},Sn=async m=>{const P=Ft(d,m),q=it(P,m,fn(m));try{await O.mutateAsync({blockKey:P,data:q}),ve.success(`Created ${yt[m]}`),v({collection:m,key:P})}catch(Q){ve.error(Q instanceof Error?Q.message:"Could not create")}},kn=async m=>{const P=Ft(d,"posts"),q=it(P,"posts",Zl(m));try{await O.mutateAsync({blockKey:P,data:q}),ve.success(a("sandbox.postCalendar.createdScheduledPost")),y("posts"),W("posts"),v({collection:"posts",key:P}),k(null)}catch(Q){ve.error(Q instanceof Error?Q.message:a("sandbox.postCalendar.couldNotCreate"))}},jn=async(m,P)=>{const q=d[m],Q=q?ta(xt(q,"posts"),P):null;if(!Q){ve.error(a("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await O.mutateAsync({blockKey:m,data:it(m,"posts",Q)})}catch(ke){ve.error(ke instanceof Error?ke.message:a("sandbox.postCalendar.couldNotReschedule"))}},Cn=async m=>{const P=d[m.key];if(!P){ve.error("Record not found.");return}const q=Ft(d,m.kind),Q=m.kind==="posts"?"title":"name",ke={...structuredClone(xt(P,m.kind)),[Q]:`${m.label} (copy)`};try{await O.mutateAsync({blockKey:q,data:it(q,m.kind,ke)}),ve.success(`Duplicated "${m.label}"`),v({collection:m.kind,key:q})}catch(_e){ve.error(_e instanceof Error?_e.message:"Duplicate failed")}},wn=m=>{A(P=>{const q=new Set(P);return q.has(m)?q.delete(m):q.add(m),q})},Nn=m=>{y("posts"),W("posts"),v(null),k(null),j(""),M(null),D(null),K(null),$("date-desc"),A(new Set),X(m||null)},Pn=async(m,P)=>{const q=[...V];let Q=0;for(const ke of q){const _e=d[ke],ot=xt(_e,"posts"),ft=m==="add"?Vl(ot,P):Ul(ot,P);ft!==ot&&(await O.mutateAsync({blockKey:ke,data:it(ke,"posts",xs(ft))}),Q+=1)}return Q},Tn=async(m,P)=>{const q=V.size;try{const Q=await Pn(m,P),ke=m==="add"?"Added to":"Moved",_e=q-Q;ve.success(`${ke} ${Q} ${Q===1?"post":"posts"}`+(_e>0?` (${_e} already set)`:"")),B()}catch(Q){ve.error(Q instanceof Error?Q.message:"Bulk update failed")}},_n=async()=>{if(ne)try{if(ne.kind==="blog-bulk"){for(const Q of ne.keys)await te.mutateAsync({blockKey:Q});ve.success(`Deleted ${ne.count} ${ne.count===1?"post":"posts"}`),g&&g.collection!=="available-section"&&ne.keys.includes(g.key)&&v(null),B(),pe(null);return}const{kind:m,key:P,label:q}=ne;if(m==="blog"){if(ne.blogKind==="categories"){const Q=xt(d[P],"categories").slug,ke=typeof Q=="string"?Q:"";if(ke)for(const{key:_e,payload:ot}of vt(d,"posts")){const ft=Gl(ot,ke);ft!==ot&&await O.mutateAsync({blockKey:_e,data:it(_e,"posts",xs(ft))})}}await te.mutateAsync({blockKey:P})}else await te.mutateAsync({blockKey:P});ve.success(`Deleted "${q}"`),g&&g.collection!=="available-section"&&g.key===P&&v(null),pe(null)}catch(m){ve.error(m instanceof Error?m.message:"Delete failed")}},St=te.isPending||O.isPending,En=ne?.kind==="blog"?yt[ne.blogKind]:ne?.kind==="blog-bulk"?`${ne.count} ${ne.count===1?"post":"posts"}`:ne?.kind??"item";return s.jsxs("div",{className:"flex h-full w-full",children:[s.jsx(bl,{active:f,counts:At,showBlog:ye,onSelect:m=>{y(m),v(null),k(null)}}),f!=="seo"&&f!=="site"&&f!=="calendar"&&f!=="post-schedule"&&f!=="loaders"&&f!=="actions"&&s.jsx(Xa,{activeCollection:f,pages:Se,redirects:he,sections:Te,availableSections:$e,appCatalog:oe,appCatalogLoading:ae,blogEntries:Ee,decofile:d,searchQuery:T,onSearchChange:j,postCategoryFilter:I,postAuthorFilter:F,postStatusFilter:z,postSort:_,onPostCategoryFilterChange:m=>{M(m),A(new Set)},onPostAuthorFilterChange:m=>{D(m),A(new Set)},onPostStatusFilterChange:m=>{K(m),A(new Set)},onPostSortChange:$,selectedPostKeys:V,postBulkPanelOpen:et,onTogglePostSelect:wn,onSelectAllPosts:m=>A(new Set(m)),onClearPostSelection:()=>A(new Set),onExitPostSelection:B,onBulkDeletePosts:()=>pe({kind:"blog-bulk",keys:[...V],count:V.size}),selection:g,onSelect:J,onCreate:()=>{f==="pages"?Ve():f==="redirects"?yn():qe(f)&&Sn(f)},onDuplicatePage:Ue,onRenamePage:Ge,onAddPageVariant:nt,onDeletePage:m=>pe({kind:"page",key:m.key,label:m.name}),onEditPageSeo:m=>{const P={collection:"pages",key:m.key,path:m.path};v(P),k(m.key)},onViewPageJson:m=>we(m.key),onDuplicateSection:xn,onRenameSection:m=>be(m.key),onDeleteSection:m=>pe({kind:"section",key:m.key,label:m.name}),onDeleteRedirect:m=>pe({kind:"redirect",key:m.key,label:m.from||m.key}),onDuplicateBlog:Cn,onDeleteBlog:m=>pe({kind:"blog",blogKind:m.kind,key:m.key,label:m.label})}),s.jsx("div",{className:"flex-1 min-w-0",children:f==="loaders"||f==="actions"?s.jsx(pa,{orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,meta:L,decofile:d,kind:f}):s.jsx(G.Suspense,{fallback:s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(Qe,{className:"size-5 text-muted-foreground"})}),children:f==="calendar"?s.jsx(Ha,{decofile:d}):f==="post-schedule"?s.jsx(Ja,{decofile:d,support:ce,isCreating:O.isPending,onCreate:m=>{kn(m)},onReschedule:(m,P)=>{jn(m,P)},onSelect:m=>{y("posts"),W("posts"),v({collection:"posts",key:m}),k(null)}}):f==="site"?N?s.jsx(Ts,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:N.key,block:d[N.key],decofile:d,meta:L,title:"Site",excludeFields:["seo"],schemaPending:le(N.resolveType,["seo"]),previewBaseUrl:o},`site:${N.key}`):s.jsx(He,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):f==="seo"?s.jsx(Ga,{orgSlug:t,virtualMcpId:e,branch:n,decofile:d,meta:L,target:{kind:"site"},previewBaseUrl:c}):f==="sections"?s.jsx(Ta,{selection:g?.collection==="sections"||g?.collection==="available-section"?g:null,orgSlug:t,virtualMcpId:e,branch:n,previewUrl:o,meta:L,decofile:d,isCreating:O.isPending,onCreateAvailable:Ae,onSaveReferencedBlock:Ye}):et?s.jsx(Va,{posts:dt,categories:ct,initialSlug:H,isPending:O.isPending,onApply:(m,P)=>{Tn(m,P)},onClose:B},H??"selection"):g&&g.collection!=="available-section"?g.collection==="apps"?s.jsx(Ts,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:g.key,block:d[g.key],decofile:d,meta:L,previewBaseUrl:o,schemaPending:le(typeof d[g.key]?.__resolveType=="string"?String(d[g.key].__resolveType):void 0)},`app:${g.key}`):g.collection==="posts"?s.jsx(Ia,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:g.key,block:d[g.key],decofile:d,meta:L,previewBaseUrl:c},`post:${g.key}`):g.collection==="categories"?s.jsx(za,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:g.key,block:d[g.key],decofile:d,meta:L,onManagePosts:Nn,onOpenPost:m=>{y("posts"),W("posts"),v({collection:"posts",key:m}),k(null)},previewBaseUrl:c},`category:${g.key}`):g.collection==="authors"?s.jsx(Ma,{orgSlug:t,virtualMcpId:e,branch:n,kind:"authors",blockKey:g.key,block:d[g.key]},`authors:${g.key}`):g.collection==="redirects"?s.jsx(Wa,{orgSlug:t,virtualMcpId:e,branch:n,blockKey:g.key,block:d[g.key]},`redirect:${g.key}`):s.jsx(Ua,{orgSlug:t,virtualMcpId:e,branch:n,previewReady:!0,previewUrl:o??void 0,currentPath:g.collection==="pages"?g.path:"/",activePageBlockKey:g.collection==="pages"?g.key:null,activeGlobalBlockKey:g.collection==="sections"?g.key:null,initialEditSeo:g.collection==="pages"&&S===g.key,onExitSeo:()=>k(null),onSelectRoot:()=>{v(null),k(null)}},g.collection==="pages"?`page:${g.key}`:`section:${g.key}`):s.jsx(He,{title:`Select ${qe(f)?`a ${yt[f]}`:f==="pages"?"a page":f==="apps"?"an app":f==="redirects"?"a redirect":"a section"} to edit`,description:f==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),Z&&s.jsx(Al,{open:!!Z,mode:Z.mode,initialName:Z.initialName,initialPath:Z.initialPath,isPending:O.isPending,error:ie,templates:Se,validate:ue,onSubmit:b,onOpenChange:m=>{m||(ee(null),R(void 0))}}),s.jsx($l,{open:ge,isPending:O.isPending,error:xe,onSubmit:vn,onOpenChange:m=>{m||(E(!1),me(void 0))}}),fe&&s.jsx(Ll,{open:!!fe,blockKey:fe,initialName:Te.find(m=>m.key===fe)?.name??fe,isPending:O.isPending,onSubmit:bn,onOpenChange:m=>{m||be(null)}}),Ce&&s.jsx(Ro,{open:!!Ce,onOpenChange:m=>{m||we(null)},pageKey:Ce,decofile:d,onSave:m=>O.mutateAsync({blockKey:Ce,data:m})}),s.jsx(Un,{open:!!ne,onOpenChange:m=>{!m&&!St&&pe(null)},children:s.jsxs(Gn,{children:[s.jsxs(Hn,{children:[s.jsx(Jn,{children:`Delete ${En}?`}),s.jsx(Wn,{children:ne?.kind==="section"?`"${ne.label}" will be removed. Pages that still reference it will lose this section.`:ne?.kind==="blog-bulk"?`${ne.count} ${ne.count===1?"post":"posts"} will be removed permanently. This can't be undone.`:ne?`"${ne.label}" will be removed permanently. This can't be undone.`:null})]}),s.jsxs(Yn,{children:[s.jsx(qn,{disabled:St,children:"Cancel"}),s.jsx(Qn,{onClick:m=>{m.preventDefault(),_n()},disabled:St,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:St?s.jsxs(s.Fragment,{children:[s.jsx(Qe,{className:"size-3.5"}),"Deleting…"]}):"Delete"})]})]})})]})}function Xa(t){const e=je.c(82),{activeCollection:n,pages:o,redirects:c,sections:l,availableSections:i,appCatalog:r,appCatalogLoading:a,blogEntries:u,decofile:x,searchQuery:d,onSearchChange:h,postCategoryFilter:p,postAuthorFilter:f,postStatusFilter:y,postSort:g,onPostCategoryFilterChange:v,onPostAuthorFilterChange:S,onPostStatusFilterChange:k,onPostSortChange:C,selectedPostKeys:w,postBulkPanelOpen:U,onTogglePostSelect:T,onSelectAllPosts:j,onClearPostSelection:I,onExitPostSelection:M,onBulkDeletePosts:F,selection:D,onSelect:z,onCreate:K,onDuplicatePage:_,onRenamePage:$,onAddPageVariant:V,onDeletePage:A,onEditPageSeo:H,onViewPageJson:X,onDuplicateSection:B,onRenameSection:J,onDeleteSection:Y,onDeleteRedirect:W,onDuplicateBlog:L,onDeleteBlog:se}=t;let re,le,oe,ae,ce,O,te;if(e[0]!==n||e[1]!==r||e[2]!==a||e[3]!==i||e[4]!==u||e[5]!==x||e[6]!==V||e[7]!==F||e[8]!==I||e[9]!==K||e[10]!==se||e[11]!==A||e[12]!==W||e[13]!==Y||e[14]!==L||e[15]!==_||e[16]!==B||e[17]!==H||e[18]!==M||e[19]!==S||e[20]!==v||e[21]!==C||e[22]!==k||e[23]!==$||e[24]!==J||e[25]!==h||e[26]!==z||e[27]!==j||e[28]!==T||e[29]!==X||e[30]!==o||e[31]!==f||e[32]!==U||e[33]!==p||e[34]!==g||e[35]!==y||e[36]!==c||e[37]!==d||e[38]!==l||e[39]!==w||e[40]!==D){const R=d.toLowerCase(),ge=o.filter(b=>!R||b.name.toLowerCase().includes(R)||b.path.toLowerCase().includes(R)),E=c.filter(b=>!R||b.from.toLowerCase().includes(R)||b.to.toLowerCase().includes(R)),xe=l.filter(b=>!R||b.name.toLowerCase().includes(R)||b.key.toLowerCase().includes(R)||b.resolveType.toLowerCase().includes(R)),me=i.filter(b=>!R||b.title.toLowerCase().includes(R)||b.resolveType.toLowerCase().includes(R)||(b.description?.toLowerCase().includes(R)??!1)),fe=Ka(xe),be=r.filter(b=>!R||b.title.toLowerCase().includes(R)||b.app.toLowerCase().includes(R)||b.vendor.toLowerCase().includes(R)||b.category.toLowerCase().includes(R)),ne=u.filter(b=>!R||b.label.toLowerCase().includes(R)||b.subtitle.toLowerCase().includes(R)),pe=n==="posts",Ce=si,we=pe?mn(x):[],Ne=new Map,Se=new Map,he={published:0,scheduled:0,draft:0};for(const b of we)he[b.status]=he[b.status]+1;for(const b of we){for(const ue of b.categorySlugs)Ne.set(ue,(Ne.get(ue)??0)+1);for(const ue of b.authorEmails)Se.set(ue,(Se.get(ue)??0)+1)}const Te=(pe?vt(x,"categories"):[]).map(b=>{const{key:ue,payload:Ae}=b,Ye=Ce(Ae.slug)||ue;return{slug:Ye,name:Ce(Ae.name)||Ce(Ae.slug)||ue,count:Ne.get(Ye)??0}}).filter(ti),$e=(pe?vt(x,"authors"):[]).map(b=>{const{key:ue,payload:Ae}=b,Ye=Ce(Ae.email);return{email:Ye,name:Ce(Ae.name)||Ce(Ae.email)||ue,count:Se.get(Ye)??0}}).filter(ei);let N;e[48]!==p?(N=b=>!p||b.categorySlugs.includes(p),e[48]=p,e[49]=N):N=e[49];let de;e[50]!==f?(de=b=>!f||b.authorEmails.includes(f),e[50]=f,e[51]=de):de=e[51];let ye;e[52]!==y?(ye=b=>!y||b.status===y,e[52]=y,e[53]=ye):ye=e[53];let Ee;e[54]!==g?(Ee=(b,ue)=>{if(g==="az")return b.title.localeCompare(ue.title);if(g==="za")return ue.title.localeCompare(b.title);const Ae=b.date.localeCompare(ue.date);return g==="date-asc"?Ae:-Ae},e[54]=g,e[55]=Ee):Ee=e[55];const ct=we.filter(b=>!R||b.title.toLowerCase().includes(R)||b.slug.toLowerCase().includes(R)).filter(N).filter(de).filter(ye).sort(Ee),et=w.size,dt=ct.map(Za),ut=dt.length>0&&dt.every(b=>w.has(b)),tt=et>0||U,At=()=>{ut?I():j(dt)},We=`Search ${n}…`,st=qe(n)?`Create new ${yt[n]}`:n==="redirects"?"Create new redirect":"Create new page",mt=n!=="apps"&&n!=="sections";ce="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let nt;e[56]===Symbol.for("react.memo_cache_sentinel")?(nt=s.jsx(Vs,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[56]=nt):nt=e[56];let Ve;e[57]!==h?(Ve=b=>h(b.target.value),e[57]=h,e[58]=Ve):Ve=e[58];let Ue;e[59]!==We||e[60]!==d||e[61]!==Ve?(Ue=s.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[nt,s.jsx("input",{type:"text",value:d,onChange:Ve,placeholder:We,"aria-label":We,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[59]=We,e[60]=d,e[61]=Ve,e[62]=Ue):Ue=e[62];let Ge;e[63]!==st||e[64]!==K||e[65]!==mt?(Ge=mt&&s.jsxs(ze,{children:[s.jsx(Ie,{asChild:!0,children:s.jsx(Oe,{variant:"ghost",size:"icon",onClick:K,"aria-label":st,children:s.jsx(Vn,{size:14})})}),s.jsx(Me,{side:"bottom",children:st})]}),e[63]=st,e[64]=K,e[65]=mt,e[66]=Ge):Ge=e[66],e[67]!==Ue||e[68]!==Ge?(O=s.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[Ue,Ge]}),e[67]=Ue,e[68]=Ge,e[69]=O):O=e[69],te=pe&&(tt?s.jsx(Oa,{count:et,allSelected:ut,onToggleSelectAll:At,onDelete:F,onExit:M}):s.jsx(Ea,{categories:Te,authors:$e,categoryFilter:p,statusCounts:he,authorFilter:f,statusFilter:y,sort:g,onCategoryFilterChange:v,onAuthorFilterChange:S,onStatusFilterChange:k,onSortChange:C})),re=Et,ae="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",le="flex flex-col gap-1 p-1.5",oe=n==="pages"?ge.length===0?s.jsx(at,{hasItems:o.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):ge.map(b=>{const ue=D?.collection==="pages"&&D.key===b.key,Ae=qs(x,b.key);return s.jsx(Re,{icon:jt,title:b.name,subtitle:b.path,active:ue,variantCount:Ae,onClick:()=>z({collection:"pages",key:b.key,path:b.path}),menu:s.jsx(gt,{onDuplicate:()=>_(b),onRename:()=>$(b),onAddVariant:()=>V(b),onEditSeo:()=>H(b),onViewJson:()=>X(b),onDelete:()=>A(b)})},b.key)}):n==="sections"?xe.length===0&&me.length===0?s.jsx(at,{hasItems:l.length>0||i.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):s.jsxs(s.Fragment,{children:[fe.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ps,{icon:Vt,label:"Saved sections"}),fe.map(b=>s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:b.label}),b.sections.map(ue=>{const Ae=D?.collection==="sections"&&D.key===ue.key;return s.jsx(Re,{icon:Vt,accent:"global",title:ue.name,subtitle:b.label,active:Ae,onClick:()=>z({collection:"sections",key:ue.key}),menu:s.jsx(gt,{onDuplicate:()=>B(ue),onRename:()=>J(ue),onDelete:()=>Y(ue)})},ue.key)})]},b.label))]}),me.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ps,{icon:jt,label:"Available sections",className:De(fe.length>0&&"mt-3")}),me.map(b=>{const ue=D?.collection==="available-section"&&D.resolveType===b.resolveType,Ae=b.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return s.jsx(Re,{icon:jt,title:b.title,subtitle:Ae??b.resolveType,active:ue,onClick:()=>z({collection:"available-section",resolveType:b.resolveType,title:b.title})},b.resolveType)})]})]}):n==="apps"?a?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Qe,{className:"size-4.5 text-muted-foreground"})}):be.length===0?s.jsx(at,{hasItems:r.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):be.map(b=>{const ue=D?.collection==="apps"&&b.blockKey!==null&&D.key===b.blockKey;return s.jsx(Re,{icon:zs,logoUrl:b.logo,title:b.title,subtitle:b.category,active:ue,trailing:b.installed?s.jsx("span",{className:"shrink-0 rounded-full bg-success/15 px-1.5 py-0.5 text-[10px] font-medium text-success",children:"Installed"}):void 0,onClick:()=>{if(!b.installed||!b.blockKey){ve.message(`${b.title} is not installed on this site.`);return}z({collection:"apps",key:b.blockKey})}},b.id)}):n==="redirects"?E.length===0?s.jsx(at,{hasItems:c.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):E.map(b=>s.jsx(Re,{icon:Os,title:b.from||"(no source)",subtitle:`→ ${b.to||"(no target)"}`,active:D?.collection==="redirects"&&D.key===b.key,trailing:s.jsx(Ol,{type:b.type}),onClick:()=>z({collection:"redirects",key:b.key}),menu:s.jsx(gt,{onDelete:()=>W(b)})},b.key)):pe?ct.length===0?s.jsx(at,{hasItems:we.length>0,emptyLabel:"No posts yet.",emptyHint:'Click "+" to create your first post.'}):ct.map(b=>{const ue={key:b.key,kind:"posts",label:b.title,subtitle:b.slug};return s.jsx(Re,{icon:Ut,title:b.title,subtitle:b.slug||"no slug",invalid:b.missing.length>0,invalidReason:`Missing: ${b.missing.join(", ")}`,active:D?.collection==="posts"&&D.key===b.key,selectable:!0,selectionActive:tt,selected:w.has(b.key),onToggleSelect:()=>T(b.key),onClick:()=>tt?T(b.key):z({collection:"posts",key:b.key}),menu:s.jsx(gt,{onDuplicate:()=>L(ue),onDelete:()=>se(ue)})},b.key)}):ne.length===0?s.jsx(at,{hasItems:u.length>0,emptyLabel:`No ${n} yet.`,emptyHint:`Click "+" to create your first ${qe(n)?yt[n]:"item"}.`}):ne.map(b=>{const ue=D?.collection===b.kind&&D.key===b.key;return s.jsx(Re,{icon:b.kind==="posts"?Ut:b.kind==="authors"?Us:Fs,title:b.label,subtitle:b.subtitle,active:ue,onClick:()=>z({collection:b.kind,key:b.key}),menu:s.jsx(gt,{onDuplicate:()=>L(b),onDelete:()=>se(b)})},b.key)}),e[0]=n,e[1]=r,e[2]=a,e[3]=i,e[4]=u,e[5]=x,e[6]=V,e[7]=F,e[8]=I,e[9]=K,e[10]=se,e[11]=A,e[12]=W,e[13]=Y,e[14]=L,e[15]=_,e[16]=B,e[17]=H,e[18]=M,e[19]=S,e[20]=v,e[21]=C,e[22]=k,e[23]=$,e[24]=J,e[25]=h,e[26]=z,e[27]=j,e[28]=T,e[29]=X,e[30]=o,e[31]=f,e[32]=U,e[33]=p,e[34]=g,e[35]=y,e[36]=c,e[37]=d,e[38]=l,e[39]=w,e[40]=D,e[41]=re,e[42]=le,e[43]=oe,e[44]=ae,e[45]=ce,e[46]=O,e[47]=te}else re=e[41],le=e[42],oe=e[43],ae=e[44],ce=e[45],O=e[46],te=e[47];let Z;e[70]!==le||e[71]!==oe?(Z=s.jsx("div",{className:le,children:oe}),e[70]=le,e[71]=oe,e[72]=Z):Z=e[72];let ee;e[73]!==re||e[74]!==ae||e[75]!==Z?(ee=s.jsx(re,{className:ae,children:Z}),e[73]=re,e[74]=ae,e[75]=Z,e[76]=ee):ee=e[76];let ie;return e[77]!==ce||e[78]!==O||e[79]!==te||e[80]!==ee?(ie=s.jsxs("div",{className:ce,children:[O,te,ee]}),e[77]=ce,e[78]=O,e[79]=te,e[80]=ee,e[81]=ie):ie=e[81],ie}function Za(t){return t.key}function ei(t){return t.email}function ti(t){return t.slug}function si(t){return typeof t=="string"?t:""}function ni(t){const e=je.c(25),{virtualMcpId:n}=t,o=Be(),[c,l]=G.useState(!1),i=Zs(n),{activeTask:r}=$s();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const u=Bs(a);if(!(ms(i?.metadata)||ms(r?.metadata))){let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:s.jsx(fs,{className:"size-7 text-foreground"})}),e[1]=h):h=e[1];let p;e[2]!==o?(p=o("mainPanelTabs.contentTab.noContentToEdit"),e[2]=o,e[3]=p):p=e[3];let f;e[4]!==o?(f=o("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=o,e[5]=f):f=e[5];let y,g;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>l(!0),g=s.jsx(fs,{className:"size-4"}),e[6]=y,e[7]=g):(y=e[6],g=e[7]);let v;e[8]!==o?(v=o("mainPanelTabs.previewTab.connectGithub"),e[8]=o,e[9]=v):v=e[9];let S;e[10]!==v?(S=s.jsxs(Oe,{onClick:y,children:[g,v]}),e[10]=v,e[11]=S):S=e[11];let k;e[12]!==p||e[13]!==f||e[14]!==S?(k=s.jsx(nl,{className:"h-full",image:h,title:p,description:f,actions:S}),e[12]=p,e[13]=f,e[14]=S,e[15]=k):k=e[15];let C;e[16]!==c?(C=s.jsx(ol,{open:c,onOpenChange:l,mode:"agent"}),e[16]=c,e[17]=C):C=e[17];let w;return e[18]!==C||e[19]!==k?(w=s.jsxs(s.Fragment,{children:[k,C]}),e[18]=C,e[19]=k,e[20]=w):w=e[20],w}let d;return e[21]!==u.contentPageId||e[22]!==u.contentPath||e[23]!==u.contentPathTemplate?(d=s.jsx(Ya,{deepLinkPage:{pageId:u.contentPageId,path:u.contentPath,pathTemplate:u.contentPathTemplate}}),e[21]=u.contentPageId,e[22]=u.contentPath,e[23]=u.contentPathTemplate,e[24]=d):d=e[24],d}function oi(){const t=je.c(2),e=ll();let n;return t[0]!==e?(n=s.jsx(Bn,{tabId:"content",children:s.jsx($n,{feature:"cms",children:s.jsx(ni,{virtualMcpId:e})})}),t[0]=e,t[1]=n):n=t[1],n}const ir=Object.freeze(Object.defineProperty({__proto__:null,default:oi},Symbol.toStringTag,{value:"Module"}));export{oa as A,or as B,ir as C,Xi as M,Qi as W,lr as a,it as b,ar as c,Ji as d,Hi as e,Wi as f,xt as g,Yl as h,Ql as i,qi as j,mn as k,vt as l,cn as m,Cl as n,Yi as o,un as p,Zi as q,il as r,xs as s,tr as t,ra as u,Xe as v,sr as w,er as x,nr as y,Pt as z};
|