decocms 4.455.0 → 4.455.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-BOPAUEgU.js → AlertCircle-SZjuoMGZ.js} +1 -1
- package/dist/client/assets/{AreaChart-CJHdSsRl.js → AreaChart-ezLCE2QB.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DGlO1CKr.js → ArrowLeft-BgUASx7T.js} +1 -1
- package/dist/client/assets/{ArrowUp-Duh-8Vv0.js → ArrowUp-CwQ1Q4VU.js} +1 -1
- package/dist/client/assets/{Building02-D_rXBsfQ.js → Building02-Dl4T9LNW.js} +1 -1
- package/dist/client/assets/{CartesianChart-DIS9sPOp.js → CartesianChart-CojVOGED.js} +1 -1
- package/dist/client/assets/{Check-CcPSzxsY.js → Check-BmlrCmw2.js} +1 -1
- package/dist/client/assets/{CheckCircle-CxJ9MBI3.js → CheckCircle-DgPqabhN.js} +1 -1
- package/dist/client/assets/{ChevronUp-C9klasvw.js → ChevronUp-6u3SxMoQ.js} +1 -1
- package/dist/client/assets/{Copy01-ByHdq7k3.js → Copy01-CkifUnly.js} +1 -1
- package/dist/client/assets/{CreditCard01-D7Ll8vXp.js → CreditCard01-K1-aiN4b.js} +1 -1
- package/dist/client/assets/{DotsVertical-CXVrXTYw.js → DotsVertical-DmnxoC5N.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-D4SFBJLe.js → ErrorBarContext-BaefuZVc.js} +1 -1
- package/dist/client/assets/{Image01-DAe5wd3u.js → Image01-0yU0yxN3.js} +1 -1
- package/dist/client/assets/{Key01-Dje7twgn.js → Key01-CUdVlBTP.js} +1 -1
- package/dist/client/assets/{Line-p8cNw9wz.js → Line-D6mMu8nu.js} +1 -1
- package/dist/client/assets/{Link01-BFa5_pnw.js → Link01-7z-hjzg6.js} +1 -1
- package/dist/client/assets/{LinkBroken01-BQ3rvf4O.js → LinkBroken01-Br_uH__F.js} +1 -1
- package/dist/client/assets/{LinkExternal01-ChFFafWR.js → LinkExternal01-DvsbzHx1.js} +1 -1
- package/dist/client/assets/{Monitor01-tvCvi4o_.js → Monitor01-DQFu-UId.js} +1 -1
- package/dist/client/assets/{Palette-BFtTwWPg.js → Palette-TILTwgWi.js} +1 -1
- package/dist/client/assets/{Plus-Dk5G0eGJ.js → Plus-Cn427okX.js} +1 -1
- package/dist/client/assets/{SearchMd-DJptVqPP.js → SearchMd-Pjthnah9.js} +1 -1
- package/dist/client/assets/{Sector-CoYmht1l.js → Sector-Xhgx4JKP.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-mUPmqGRd.js → ShoppingBag01-b6nsxdpv.js} +1 -1
- package/dist/client/assets/{Sun-Bl8Ky_if.js → Sun-CJnoMxxW.js} +1 -1
- package/dist/client/assets/{Tool01-CGCC9pfF.js → Tool01-bUbUk8P7.js} +1 -1
- package/dist/client/assets/{Trash01-BA-bFjuS.js → Trash01-CuygCR6g.js} +1 -1
- package/dist/client/assets/{Upload01-C13aB89v.js → Upload01-XLRbUIeR.js} +1 -1
- package/dist/client/assets/{User01-B42bcRzQ.js → User01-CVYpMQND.js} +1 -1
- package/dist/client/assets/{UserSquare-B6-k4uk5.js → UserSquare-COhFlYGn.js} +1 -1
- package/dist/client/assets/{Users01-BmXeKAri.js → Users01-pRhNWrqE.js} +1 -1
- package/dist/client/assets/{X-BdtW9stL.js → X-C5Ha4Ozq.js} +1 -1
- package/dist/client/assets/{XAxis-G213xRid.js → XAxis-BHJE6EzV.js} +1 -1
- package/dist/client/assets/{XClose-Bsj_jKUE.js → XClose-KiYAVi9i.js} +1 -1
- package/dist/client/assets/{ZoomOut-BQf_lYpX.js → ZoomOut-FmWelmyS.js} +1 -1
- package/dist/client/assets/{access-gate-BtTwTt-9.js → access-gate-jiNu9DZN.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-CwnC8yt-.js → add-connection-dialog-GjKD1wTC.js} +1 -1
- package/dist/client/assets/{agent-analytics-CPj4bxgs.js → agent-analytics-BeJKrtcQ.js} +1 -1
- package/dist/client/assets/agent-app-Do5ejS2P.js +1 -0
- package/dist/client/assets/{agent-assets-D5PkhLx3.js → agent-assets-DiAZ_mWn.js} +1 -1
- package/dist/client/assets/{agent-automation-Cd6QYcZt.js → agent-automation-CrHxUPPr.js} +1 -1
- package/dist/client/assets/{agent-automations-WUChl97S.js → agent-automations-CuCVxPFr.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-BTKe88uu.js → agent-connect-sources-GeY0E65Q.js} +1 -1
- package/dist/client/assets/agent-deck-CxzsNhg0.js +1 -0
- package/dist/client/assets/{agent-e2e-D92Tz-G3.js → agent-e2e-DZ7uBNEc.js} +1 -1
- package/dist/client/assets/{agent-experiments-B5NLiDa9.js → agent-experiments-UwQT4D0C.js} +1 -1
- package/dist/client/assets/{agent-file-BlaR5see.js → agent-file-Ce07C-Ee.js} +1 -1
- package/dist/client/assets/{agent-hosting-CoW01d6P.js → agent-hosting-DnoFF3km.js} +1 -1
- package/dist/client/assets/{agent-icon-QobcC4y1.js → agent-icon-Cy4Knhmf.js} +1 -1
- package/dist/client/assets/agent-library-JYcPcTMu.js +1 -0
- package/dist/client/assets/agent-library-file-D3Jksi3M.js +1 -0
- package/dist/client/assets/{agent-monitor-B-qOXS0c.js → agent-monitor-C43eVtFQ.js} +1 -1
- package/dist/client/assets/{agent-overview-CLWCQeaZ.js → agent-overview-vIXC5G1N.js} +1 -1
- package/dist/client/assets/agent-settings-Cfyz43YR.js +1 -0
- package/dist/client/assets/{agent-site-editor-DFNItXi0.js → agent-site-editor-D0zVo-Vf.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-ILiFF32S.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-DeSoO3Vu.js → agent-site-editor-content-4dMPOtfn.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-BQKa6vcQ.js → agent-site-editor-preview-BiJ7TdOp.js} +3 -3
- package/dist/client/assets/agent-view-BkydMMwW.js +1 -0
- package/dist/client/assets/{agent-view-guard-BggSlJ4I.js → agent-view-guard-D5KfTxlv.js} +1 -1
- package/dist/client/assets/{agents-list-Ckh7S6i4.js → agents-list-AbKO_jsf.js} +1 -1
- package/dist/client/assets/{ai-providers-KNbVRi9R.js → ai-providers-D1Du1MXh.js} +1 -1
- package/dist/client/assets/{alert-dialog-13GPwGkk.js → alert-dialog-BNhkZQ_x.js} +1 -1
- package/dist/client/assets/{alert-BZ6uRdL8.js → alert-mIYni7ha.js} +1 -1
- package/dist/client/assets/{analytics-sections-C4iGKBOV.js → analytics-sections-Bg673VR8.js} +1 -1
- package/dist/client/assets/{api-keys-Btl9HmTY.js → api-keys-Cr3l0gpB.js} +1 -1
- package/dist/client/assets/api-keys-DdRKMXqU.js +1 -0
- package/dist/client/assets/app-editor-COtME4c7.js +1 -0
- package/dist/client/assets/{asset-utils-B4wnf4gp.js → asset-utils-B80sbnEy.js} +1 -1
- package/dist/client/assets/{auth-BMIwdKU8.js → auth-Bj6m-efj.js} +1 -1
- package/dist/client/assets/{auth-catchall-CsvXshlN.js → auth-catchall-D4Dz-fGV.js} +1 -1
- package/dist/client/assets/{auth-entry-BuNH69Nv.js → auth-entry-CF8efX0d.js} +1 -1
- package/dist/client/assets/{auth-split-layout-rkoJUdAV.js → auth-split-layout-CRqrdELw.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DWogyy0B.js → authenticate-and-persist-oauth-BWVpVcAz.js} +1 -1
- package/dist/client/assets/{automation-list-row-db5LJ5pV.js → automation-list-row-a-sDX1L7.js} +1 -1
- package/dist/client/assets/{automation-runs-_74LLZTB.js → automation-runs-Be2AhhQU.js} +1 -1
- package/dist/client/assets/{automations-qyXzvoeZ.js → automations-BIY-zWGm.js} +1 -1
- package/dist/client/assets/{autosend-B5Obavo-.js → autosend-Bo0qMh1p.js} +1 -1
- package/dist/client/assets/{avatar-Bpp_lL_f.js → avatar-s9hDkne5.js} +1 -1
- package/dist/client/assets/{badge-DTNkOzY0.js → badge-BbvQ8-kh.js} +1 -1
- package/dist/client/assets/{block-document-BLOu51_T.js → block-document-DF2zCbSa.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-BmjkHogK.js → blocks-preview-workspace-context-C9Q4VcWA.js} +1 -1
- package/dist/client/assets/{blog-schema-B4_qQgjF.js → blog-schema-CsdFUd69.js} +1 -1
- package/dist/client/assets/{buckets-CCNSYAgt.js → buckets-BVpQmWhs.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-oJt1CVIT.js → build-improve-prompt-doc-DTV8byFL.js} +1 -1
- package/dist/client/assets/{calendar-BRUBvVES.js → calendar-DJKbaXkW.js} +1 -1
- package/dist/client/assets/{capability-load-error-th8zEGOp.js → capability-load-error-DToq0UrY.js} +1 -1
- package/dist/client/assets/{category-editor-CRqB5ots.js → category-editor-B8R6lxvV.js} +1 -1
- package/dist/client/assets/{chart-DBFqaeAD.js → chart-DXNUc0Wn.js} +1 -1
- package/dist/client/assets/{chat-context-BHWxNMFT.js → chat-context-DVCvFwd3.js} +1 -1
- package/dist/client/assets/{chat-draft-SnGEiSWm.js → chat-draft-CJgB-tPy.js} +1 -1
- package/dist/client/assets/{checkbox-DuccoC4e.js → checkbox-DUCWAAon.js} +1 -1
- package/dist/client/assets/{choose-editor-Blu_E7S8.js → choose-editor-lgVz_Mxm.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-J9IiJiw_.js → claim-phase-copy-yqhsaXjf.js} +1 -1
- package/dist/client/assets/{cli-auth-success-g5vIj6jD.js → cli-auth-success-DwgBWIew.js} +1 -1
- package/dist/client/assets/{client-icons-ByIvBqps.js → client-icons-DmzJtt6h.js} +1 -1
- package/dist/client/assets/{collapsible-qdaAxaaw.js → collapsible-BhnvXHYQ.js} +1 -1
- package/dist/client/assets/{collection-detail-CRpVPceB.js → collection-detail-DTU4uoSg.js} +1 -1
- package/dist/client/assets/{collection-display-button-CAE4H1Z5.js → collection-display-button-kGszYmIr.js} +1 -1
- package/dist/client/assets/{collection-search-BG7vK4NS.js → collection-search-BXjiZfAv.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-C-F_T5Eb.js → collection-table-wrapper-DdfR_Ktb.js} +1 -1
- package/dist/client/assets/{collection-tabs-DrZNeSEC.js → collection-tabs-BulYWegd.js} +1 -1
- package/dist/client/assets/{column-rules-C1VVvSzv.js → column-rules-BIwgwIU8.js} +1 -1
- package/dist/client/assets/{combobox-B0tRCuGZ.js → combobox-kDUiEF-N.js} +1 -1
- package/dist/client/assets/{command-D4xFqyr9.js → command-8n8txvgK.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-Cz5vCHft.js → companion-mcps-section-1uHuucoN.js} +1 -1
- package/dist/client/assets/{config-DPczwNxh.js → config-CV4o64fo.js} +1 -1
- package/dist/client/assets/{connect-pk9RQf7E.js → connect-BAQqdM6H.js} +1 -1
- package/dist/client/assets/{connect-layout-B5AnMnce.js → connect-layout-BpNxIzne.js} +1 -1
- package/dist/client/assets/{connection-BBVDOaSM.js → connection-MWqOhcq1.js} +1 -1
- package/dist/client/assets/{connection-card-D1TMmLIT.js → connection-card-BqicHzqi.js} +1 -1
- package/dist/client/assets/{connection-detail-DQ776dHS.js → connection-detail-BPnXf2m6.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CFQwZ1sv.js → connection-form-helpers-c3p1hlVt.js} +1 -1
- package/dist/client/assets/{connections-D5_-1i7h.js → connections-y97m_u9F.js} +1 -1
- package/dist/client/assets/{context-BzZmRn5A.js → context-D0fXSS45.js} +1 -1
- package/dist/client/assets/{context-menu-Dt0_Wi5C.js → context-menu-Cms7vHsB.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-SVvYPMqI.js → create-organization-dialog-DV81cdD7.js} +1 -1
- package/dist/client/assets/{daily-pulse-Dy2ScJNC.js → daily-pulse-BBf1JfuT.js} +1 -1
- package/dist/client/assets/{decopilot-Bh5nOuj8.js → decopilot-YF_T6wlZ.js} +1 -1
- package/dist/client/assets/{device-hint-BWrI1ZAV.js → device-hint-nzQNoBun.js} +1 -1
- package/dist/client/assets/{dialog-CwJ0Tacd.js → dialog-BI1xJ9QE.js} +1 -1
- package/dist/client/assets/{discover-BN5fZmxX.js → discover-BI727LpY.js} +1 -1
- package/dist/client/assets/{domain-settings-C0ggYD-b.js → domain-settings-BKNUQKjc.js} +1 -1
- package/dist/client/assets/{download-app-dialog-BlTQi4L1.js → download-app-dialog-D_tAj3wC.js} +1 -1
- package/dist/client/assets/{drawer-LGekY388.js → drawer-C_V65MTv.js} +1 -1
- package/dist/client/assets/{editor-DIJFF-Rn.js → editor-MmTYGWbR.js} +1 -1
- package/dist/client/assets/{empty-state-DdDKihxt.js → empty-state-CcAOCIdu.js} +1 -1
- package/dist/client/assets/{empty-state-Db66egMr.js → empty-state-DdqIwUzh.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BZKTCWVm.js → extract-connection-data-BphfLFqb.js} +1 -1
- package/dist/client/assets/{feature-gate-DIpT85T7.js → feature-gate-B_eK5iBD.js} +1 -1
- package/dist/client/assets/{feature-paywall--RganMza.js → feature-paywall-DWdxE8g5.js} +1 -1
- package/dist/client/assets/{file-explorer-B0caqImY.js → file-explorer-C0x2mX1a.js} +1 -1
- package/dist/client/assets/{file-preview-BVUwkvqy.js → file-preview-DraufLN1.js} +1 -1
- package/dist/client/assets/{file-share-button-Dfx-yCi-.js → file-share-button-nm9-puhb.js} +1 -1
- package/dist/client/assets/{file-type-icon-CYHSeMg9.js → file-type-icon---8xc9A3.js} +1 -1
- package/dist/client/assets/flat-project-DSx6ncsS.js +1 -0
- package/dist/client/assets/{folder-icon-Bz05bjxQ.js → folder-icon-BKl95mgA.js} +1 -1
- package/dist/client/assets/{form-DXEENu_8.js → form-DBZy3h_k.js} +1 -1
- package/dist/client/assets/{gateway-client-DafKkh5Q.js → gateway-client-DLwMoVSk.js} +1 -1
- package/dist/client/assets/{general-P5nYRAWt.js → general-JozDjOAF.js} +1 -1
- package/dist/client/assets/{home-C9qFKdi5.js → home-D816nm29.js} +1 -1
- package/dist/client/assets/{icon-button-c-SlONOU.js → icon-button-DJOiw-b_.js} +1 -1
- package/dist/client/assets/{index-CaP5SDB2.js → index-83q9Ewq1.js} +1 -1
- package/dist/client/assets/{index-ZDbB-PVr.js → index-BBLsGP5X.js} +1 -1
- package/dist/client/assets/{index-Dl3JXElC.js → index-BHxlMSIR.js} +1 -1
- package/dist/client/assets/{index-txkdKzZ6.js → index-B_hHkWjN.js} +1 -1
- package/dist/client/assets/{index-KD5FDUeP.js → index-BlUUh9y1.js} +1 -1
- package/dist/client/assets/{index-0glLJTM3.js → index-BnsOjLj5.js} +1 -1
- package/dist/client/assets/{index-D9bgHbh-.js → index-By8xil-d.js} +1 -1
- package/dist/client/assets/{index-DK7oXPIL.js → index-CS9Lxig6.js} +1 -1
- package/dist/client/assets/{index-mRG9os_M.js → index-CTTDNGFi.js} +1 -1
- package/dist/client/assets/{index-Ccz5AaI_.js → index-Co0BO1QR.js} +1 -1
- package/dist/client/assets/{index-DGWe6sla.js → index-D7YVnT5y.js} +1 -1
- package/dist/client/assets/{index-ehY3MQSN.js → index-DROc98p5.js} +3 -3
- package/dist/client/assets/{index-BOGZM7Pw.js → index-OBKgoLrS.js} +3 -3
- package/dist/client/assets/{index-DlDzsxeJ.js → index-nLAjrXPh.js} +1 -1
- package/dist/client/assets/{index-redirect-zukIYzlP.js → index-redirect-XmpHbWI0.js} +1 -1
- package/dist/client/assets/{index-DuKSozhT.js → index-yiQcNbRY.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CHVbl4Al.js → infiniteQueryObserver-Bysh3DKm.js} +1 -1
- package/dist/client/assets/{infra-billing-D94tvu0v.js → infra-billing-CrRHsYb5.js} +1 -1
- package/dist/client/assets/{input-qBVmxar0.js → input-CcBq0Qtl.js} +3 -3
- package/dist/client/assets/{input-C0ZWiiGy.js → input-Kws07Y5R.js} +1 -1
- package/dist/client/assets/{input-Cbyu0LGy.js → input-xNv48kMp.js} +1 -1
- package/dist/client/assets/{integration-icon-DUuPtqFs.js → integration-icon-D2va06Ai.js} +1 -1
- package/dist/client/assets/{label-CKukDnnz.js → label-BsArcFBD.js} +1 -1
- package/dist/client/assets/{layout-DZr1Z4Vi.js → layout-DgSCQhnk.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-O_a0ihqp.js → legacy-agents-deep-_Rsc7ywf.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-B6sO18wU.js → legacy-main-redirect-BKsErYAe.js} +1 -1
- package/dist/client/assets/library-DXXDvCqk.js +1 -0
- package/dist/client/assets/{library-tab-CGsiOX6E.js → library-tab-DsEkCV3p.js} +1 -1
- package/dist/client/assets/{login-hdkcuXfq.js → login-Lx_WumW3.js} +1 -1
- package/dist/client/assets/{markdown-DNk_PyOf.js → markdown-DNNvyUFL.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CJ5u3TPG.js → mcp-app-renderer-Bvvl0FWT.js} +1 -1
- package/dist/client/assets/{mcp-oauth-cSH4PfZY.js → mcp-oauth-3C0PcQv6.js} +1 -1
- package/dist/client/assets/{members-C-_zRkLX.js → members-DvRk0bvv.js} +1 -1
- package/dist/client/assets/{memory-DLRzHb1w.js → memory-B8oV5gBw.js} +1 -1
- package/dist/client/assets/{mini-report-page-CFzUUmyT.js → mini-report-page-DdQ7SKpZ.js} +1 -1
- package/dist/client/assets/{mock-board-Si0mPE9y.js → mock-board-DBOMi-p8.js} +1 -1
- package/dist/client/assets/{monaco-editor-C4uDUO_q.js → monaco-editor-0FKvs3m8.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CllZiW9E.js → monitoring-stats-row-bsHcY4Ek.js} +1 -1
- package/dist/client/assets/{multi-select-DiHVOPXR.js → multi-select-CsrBGXiU.js} +1 -1
- package/dist/client/assets/{mustache-C7f92o5k.js → mustache-R5ZIENHD.js} +1 -1
- package/dist/client/assets/{new-project-dialog-CiCMTA1C.js → new-project-dialog-BXg1Q86m.js} +1 -1
- package/dist/client/assets/{oauth-callback-Cb4S9fwE.js → oauth-callback-CJsOiTzu.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CD_A5mvP.js → oauth-callback-ai-provider-BQmwZWeP.js} +1 -1
- package/dist/client/assets/{onboarding-B2wyTbOl.js → onboarding-Cg9R0el4.js} +1 -1
- package/dist/client/assets/{openai-conversation-WSjKAhvH.js → openai-conversation-BL4VQkfR.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-BBFtzDV4.js → optimistic-project-sidebar-views-De10Nj6j.js} +1 -1
- package/dist/client/assets/{org-file-open-context--_UQSpdl.js → org-file-open-context-BosMDtdb.js} +1 -1
- package/dist/client/assets/{organization-choice-Bs4XFXgS.js → organization-choice-oi2kSFzc.js} +1 -1
- package/dist/client/assets/{orgs-DzdQslwf.js → orgs-YLkB30CC.js} +1 -1
- package/dist/client/assets/{page-seo-form-vON-l1GZ.js → page-seo-form-B7zbvDL2.js} +1 -1
- package/dist/client/assets/{pair-IorbWgZn.js → pair-BtqMUvq4.js} +1 -1
- package/dist/client/assets/{plan-ladder-DSodyL3Q.js → plan-ladder-2SN6IZxx.js} +1 -1
- package/dist/client/assets/{popover-DvKxqM1r.js → popover-Cb13NGPe.js} +1 -1
- package/dist/client/assets/{post-calendar-DiEfiKrj.js → post-calendar-RlXieGQw.js} +1 -1
- package/dist/client/assets/{post-editor-HV3DNHNH.js → post-editor-_9DsSzJD.js} +1 -1
- package/dist/client/assets/{preview-content-Bd42BahA.js → preview-content-DOOZEe7K.js} +1 -1
- package/dist/client/assets/{preview-dialog-DBXVi9mo.js → preview-dialog-hfrg0TdN.js} +1 -1
- package/dist/client/assets/{profile-C62VIFSL.js → profile-tDdLE8vh.js} +1 -1
- package/dist/client/assets/{project-app-view-DYaaNrnC.js → project-app-view-Rd2WBl7i.js} +1 -1
- package/dist/client/assets/{project-feed-DDiBGrsP.js → project-feed-CrFrudQ9.js} +1 -1
- package/dist/client/assets/{project-icon-DQrOXeEW.js → project-icon-DFU40NC2.js} +1 -1
- package/dist/client/assets/project-reports-D2_GUrbe.js +1 -0
- package/dist/client/assets/project-tasks-BulftSHT.js +1 -0
- package/dist/client/assets/{projects-C-62vsjh.js → projects-QV8eEeko.js} +1 -1
- package/dist/client/assets/{projects-empty-state-DllkKglW.js → projects-empty-state-xo5NNNQh.js} +1 -1
- package/dist/client/assets/{prompts-53mGvQlZ.js → prompts-BX7-kI7o.js} +1 -1
- package/dist/client/assets/record-editor-B0H5WqkE.js +1 -0
- package/dist/client/assets/{redirect-editor-C2CflIXw.js → redirect-editor-Bi6rLeHR.js} +1 -1
- package/dist/client/assets/{reports-DQcmX2XK.js → reports-CA7N6twS.js} +1 -1
- package/dist/client/assets/reports-CHglz2zQ.js +1 -0
- package/dist/client/assets/{reports-onboarding-DRfSptAM.js → reports-onboarding-DERDE-0k.js} +1 -1
- package/dist/client/assets/{reports-tab-BGRnmmWF.js → reports-tab-3gFhJXg-.js} +2 -2
- package/dist/client/assets/{repositories-ltvP9f3v.js → repositories-DMFw7emx.js} +1 -1
- package/dist/client/assets/{repository-binding-CEDkA6og.js → repository-binding-BXNOickW.js} +1 -1
- package/dist/client/assets/{repository-import-picker-BT060hhl.js → repository-import-picker-Tdhv79ml.js} +1 -1
- package/dist/client/assets/{repository-picker-Bowb7b9f.js → repository-picker-PURciVL4.js} +1 -1
- package/dist/client/assets/{require-capability-DN9BJlNM.js → require-capability-J3WiMSvq.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CKgEUo-z.js → required-auth-layout-D2VAA74b.js} +1 -1
- package/dist/client/assets/{reset-password-B6iTpX4u.js → reset-password-C0vsdMzy.js} +1 -1
- package/dist/client/assets/{resizable-Cd8jDRB7.js → resizable-pZE9eaKX.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-X0M-w-vv.js → resolve-tab-icon-vYim2A6S.js} +1 -1
- package/dist/client/assets/{review-settings-CsnvQ-Qq.js → review-settings-CgwxmK2U.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-ClsuTwdo.js → rich-text-link-control-B2JcdNT_.js} +1 -1
- package/dist/client/assets/{roles-CU8q7gVb.js → roles-DuPCSfd2.js} +1 -1
- package/dist/client/assets/{route-NLnkR9WP.js → route-Cg_bXToL.js} +1 -1
- package/dist/client/assets/{route-CIn0WnXQ.js → route-Ycp8NA6O.js} +1 -1
- package/dist/client/assets/route-eIs4MDaB.js +1 -0
- package/dist/client/assets/{runnable-block-editor-2ItVAsl7.js → runnable-block-editor-CEeBI7Ji.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-C0vkuH66.js → sandbox-lifecycle-context-D9pUeLC3.js} +1 -1
- package/dist/client/assets/{schema-W3hqtN1B.js → schema-EK91AuqK.js} +1 -1
- package/dist/client/assets/{scroll-area-BN7R6f0c.js → scroll-area-CGd0e1tw.js} +1 -1
- package/dist/client/assets/{search-input-dP8TWy_f.js → search-input-Z6QSPnUN.js} +1 -1
- package/dist/client/assets/{search-toggle-BY33vUyT.js → search-toggle-HnNumyyq.js} +1 -1
- package/dist/client/assets/{secret-picker-Bw0HhGwk.js → secret-picker-CqLw8TkH.js} +1 -1
- package/dist/client/assets/{secrets-D3WU-wHx.js → secrets-DlDhor0l.js} +1 -1
- package/dist/client/assets/{sections-editor-Bnb_Ii_2.js → sections-editor-BzSi4RpW.js} +1 -1
- package/dist/client/assets/{select-CGC5E9nf.js → select-BhJ8bhDe.js} +1 -1
- package/dist/client/assets/{select-model-B24PK9T9.js → select-model-R1qyXM2Q.js} +1 -1
- package/dist/client/assets/{seo-editor-C0eExFGM.js → seo-editor-CbZ5Ttz-.js} +1 -1
- package/dist/client/assets/{separator-CJCi7EK2.js → separator-DdUyNk8m.js} +1 -1
- package/dist/client/assets/{settings-tab-6YGWJaPP.js → settings-tab-CFhR9sQ7.js} +1 -1
- package/dist/client/assets/{sheet-DOIzAtMq.js → sheet-Bogqpryv.js} +1 -1
- package/dist/client/assets/{shell-layout-B9OaioSj.js → shell-layout-DG1i0o3w.js} +1 -1
- package/dist/client/assets/{skills-DdHXbE4c.js → skills-C6p2ywNh.js} +1 -1
- package/dist/client/assets/{sso-WAQdj9Pk.js → sso-CaX3-wST.js} +1 -1
- package/dist/client/assets/{suggestion-CotdwSyy.js → suggestion-hd077eb-.js} +1 -1
- package/dist/client/assets/{switch-Ctdc8it1.js → switch-CBzf58ch.js} +1 -1
- package/dist/client/assets/{synced-repos-DFq2CK-H.js → synced-repos-B3IgFu_d.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-CXhMb9aF.js → tab-icon-glyph-BfZAz2Nh.js} +1 -1
- package/dist/client/assets/{table-BCWfTyhH.js → table-DdKwpV9k.js} +1 -1
- package/dist/client/assets/{tabs-BCc9oqWy.js → tabs-8xIz4UtP.js} +1 -1
- package/dist/client/assets/{task-board-Dh6sWb9t.js → task-board-BzFCmVqC.js} +1 -1
- package/dist/client/assets/{task-route-BGcHuycG.js → task-route-BFxRMUrM.js} +1 -1
- package/dist/client/assets/{task-status-CjAgmdGY.js → task-status-BFjuRlF8.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-CgboMqfv.js → taskboard-analytics-CUklyXct.js} +1 -1
- package/dist/client/assets/{tasks-CQrn-rBP.js → tasks-BBOADBVx.js} +1 -1
- package/dist/client/assets/tasks-BklBZeO8.js +1 -0
- package/dist/client/assets/{textarea-e3h0PKfc.js → textarea-Cat7zkJf.js} +1 -1
- package/dist/client/assets/{thread-analytics-u-mhBpUO.js → thread-analytics-CVNcoFuI.js} +1 -1
- package/dist/client/assets/{thread-button-D5H005fQ.js → thread-button-9Si-8tRp.js} +1 -1
- package/dist/client/assets/{thread-intent-CNOpHUCE.js → thread-intent-Dk0A6ZtT.js} +1 -1
- package/dist/client/assets/{thread-route-DU2TTrlu.js → thread-route-BW9F2J6m.js} +1 -1
- package/dist/client/assets/{thread-route-esGiDSRu.js → thread-route-elF7W4D7.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-Bn55RhIb.js → thread-sheet-body-DjYFhNWp.js} +1 -1
- package/dist/client/assets/{toggle-group-BUS82Kqf.js → toggle-group-B9Z8QVLn.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-B8tRovqj.js → toolbar-icon-button-BZarRBLi.js} +1 -1
- package/dist/client/assets/{tooltip-DoWVDYxv.js → tooltip-B7_4-yXG.js} +1 -1
- package/dist/client/assets/{track-slrdEZ2N.js → track-oTFNmgLQ.js} +1 -1
- package/dist/client/assets/{types-BlCCVKMl.js → types-co2Ht9Mj.js} +1 -1
- package/dist/client/assets/{usage-stats-ELYwp3GN.js → usage-stats-BGChWuhD.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BuwFLwdC.js → use-ai-providers-DeSnAgnd.js} +1 -1
- package/dist/client/assets/{use-automations-B8HKsWEy.js → use-automations-D9GmwdRn.js} +1 -1
- package/dist/client/assets/{use-autosave-77sC71ka.js → use-autosave-CPw75416.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-Cd1SDWUO.js → use-chat-layout-state-Che4U26N.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DkYE6iX2.js → use-clock-tick-C5v7xKB3.js} +1 -1
- package/dist/client/assets/{use-connect-companion-sjR8VGIZ.js → use-connect-companion-DQZNt_6L.js} +1 -1
- package/dist/client/assets/{use-connection-C4j2pJbz.js → use-connection-CldQc5wk.js} +1 -1
- package/dist/client/assets/{use-copy-BiyQhtNG.js → use-copy-C60AwJfN.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-C0a_KTOz.js → use-create-virtual-mcp-C1-gls-6.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-dFt0Hwsj.js → use-date-fns-locale-DrogVNbI.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-D58XDw_5.js → use-debounced-autosave-DEq3njSh.js} +1 -1
- package/dist/client/assets/{use-debounced-value-C1TKx6na.js → use-debounced-value-8t15K3Ro.js} +1 -1
- package/dist/client/assets/{use-deco-credits--by3KJXE.js → use-deco-credits-odXtC5vU.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DL6Ppxgb.js → use-decopilot-events-PV6rJUEO.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Cc8dNIWp.js → use-delete-connection-ZGYKa162.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-D0_O_QSr.js → use-deployment-admin-WZmDKf2R.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-KJgu2gHZ.js → use-fast-preview-draft-url-DhkmOrTf.js} +1 -1
- package/dist/client/assets/{use-file-configs-j21JL3yE.js → use-file-configs-Cb37DNRD.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BAQqTty_.js → use-infinite-scroll-CUV2ONAi.js} +1 -1
- package/dist/client/assets/{use-join-requests-B2449AYt.js → use-join-requests-CTH575eV.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-NhZJRbOq.js → use-main-panel-tabs-Dlf1NeW3.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CG-b2BD1.js → use-mcp-auth-status-CdQemSFp.js} +1 -1
- package/dist/client/assets/{use-mcp-client-9jF2B0Tz.js → use-mcp-client-BLH9AyVn.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DNAsQeJA.js → use-mcp-prompts-Dn5An3ZZ.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Dbm0kb0W.js → use-mcp-tools-Dvd6qKab.js} +1 -1
- package/dist/client/assets/{use-members-CmQfPBAn.js → use-members-Bs-9PW58.js} +1 -1
- package/dist/client/assets/{use-mobile-9GiVme_1.js → use-mobile-VzbSoGMr.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CSgL519X.js → use-navigate-to-agent-DC1x2gVp.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-Dt6P6iFj.js +1 -0
- package/dist/client/assets/{use-open-billing-url-CIF0WByS.js → use-open-billing-url-CqWGNwIl.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BBAyh5Tz.js → use-org-auth-client-BwlmPJlb.js} +1 -1
- package/dist/client/assets/{use-org-fs-DF_BlZtj.js → use-org-fs-CAxytlY9.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-kX31P2gW.js → use-org-repo-syncs-7w0mnChN.js} +1 -1
- package/dist/client/assets/{use-org-sso-BmivjhbI.js → use-org-sso-pd_XhDQs.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DEPf_2N_.js → use-organization-roles-0bUJSiHD.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BgEtBsl7.js → use-organization-settings-HU4xq5ST.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-4MoLzTpw.js → use-panel-navigate-CRJv_Vri.js} +1 -1
- package/dist/client/assets/{use-project-scope-CUYDg9gO.js → use-project-scope-C7BcZz2G.js} +1 -1
- package/dist/client/assets/{use-releases-Dgq67fk3.js → use-releases-CWzjTbPz.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-D9eBWCCe.js → use-reports-diagnostic-C57CEzOi.js} +1 -1
- package/dist/client/assets/{use-secrets-D-qkpxrJ.js → use-secrets-DWHT5uVx.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-LT3afhUQ.js → use-section-preview-base-D8KaMaNX.js} +1 -1
- package/dist/client/assets/{use-session-runtime-C1jT9-WF.js → use-session-runtime-C3g9swZ6.js} +1 -1
- package/dist/client/assets/{use-tags-D0iZ2cgD.js → use-tags-UVdMm4OW.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-B0Mv4i0Z.js → use-task-board-analytics-BsB8uLyj.js} +1 -1
- package/dist/client/assets/{use-task-board-events-Q5BqAnUD.js → use-task-board-events-UNKoOCA_.js} +1 -1
- package/dist/client/assets/{use-task-metadata-B9tqJ9GP.js → use-task-metadata-Db3_7a5j.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-D5tK9O4P.js → use-thread-analytics-jm9iLDFp.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-CDQWo15F.js → use-thread-outputs-COXL75K0.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DsKCSoLS.js +1 -0
- package/dist/client/assets/{useQueries-DvMDA4qD.js → useQueries-DVNZ_TAh.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D4CsLbSw.js +1 -0
- package/dist/client/assets/{users-BE1CJVdF.js → users-BjcMnF7Q.js} +1 -1
- package/dist/client/assets/{utils-CZW3O45l.js → utils-BdWBNy3y.js} +1 -1
- package/dist/client/assets/{variant-calendar-C_oSHjpD.js → variant-calendar-COGidEDl.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-B9Dx0Ujt.js → variant-matcher-override-CffNE4hW.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BjrOeE_u.js → view-mode-toggle-EBcGWFvm.js} +1 -1
- package/dist/client/assets/{virtual-mcp-DkCjKqhT.js → virtual-mcp-CRDba5ev.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-CjNO2lXq.js +0 -1
- package/dist/client/assets/agent-deck-BBsYONOP.js +0 -1
- package/dist/client/assets/agent-library-DJDlIAqS.js +0 -1
- package/dist/client/assets/agent-library-file-CZjl7KSc.js +0 -1
- package/dist/client/assets/agent-settings-DhGEY9it.js +0 -1
- package/dist/client/assets/agent-site-editor-code-D1HLX1NJ.js +0 -2
- package/dist/client/assets/agent-view-YbbJ0c-k.js +0 -1
- package/dist/client/assets/api-keys-C1C00ELj.js +0 -1
- package/dist/client/assets/app-editor-Cr-wsjho.js +0 -1
- package/dist/client/assets/flat-project-CXofx1Tp.js +0 -1
- package/dist/client/assets/library-DOnOZswk.js +0 -1
- package/dist/client/assets/project-reports-HuiRnlkO.js +0 -1
- package/dist/client/assets/project-tasks-Ck5F7vye.js +0 -1
- package/dist/client/assets/record-editor-BAdOwM42.js +0 -1
- package/dist/client/assets/reports-Dyr-R6yJ.js +0 -1
- package/dist/client/assets/route-qm6cYbsf.js +0 -1
- package/dist/client/assets/tasks-L9jj-kWQ.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-CQ_89Cdt.js +0 -1
- package/dist/client/assets/useInfiniteQuery-pxyjNhep.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Cf0qcKEf.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-
|
|
2
|
-
import{c as le,b as je,j as n,m as Do,K as ys,l as ye,r as A,h as ot,B as Ae,o as _o,e as Ao,t as me,a2 as ks,aF as wt,aN as yt,F as Kt,aG as Is,H as zt,I as Mt,aA as Lo,G as Je,ak as Vt,al as fs,ag as $o,X as Oo,u as vn,aL as Qe}from"./index-BOGZM7Pw.js";import{A as Ro}from"./agent-view-guard-BggSlJ4I.js";import{F as Fo}from"./feature-gate-DIpT85T7.js";import{u as Xt,b as jn}from"./chat-context-BHWxNMFT.js";import{i as Tt}from"./AlertCircle-BOPAUEgU.js";import{K as Io,W as kn,X as nt,Y as Sn,Z as Ss,_ as Ko,$ as wn,a0 as zo,b as Gt,R as Nn,a1 as Mo,a2 as Vo,a3 as Nt,a4 as Go,a5 as Uo,n as Ho,a6 as Cn,a7 as qo,a8 as Wo,a9 as Yo,h as Ks,aa as Qo,I as Pn}from"./agent-icon-QobcC4y1.js";import{a as Tn,i as ws,d as Jo,e as zs}from"./UserSquare-B6-k4uk5.js";import{b as Bn,i as En}from"./ZoomOut-BQf_lYpX.js";import{c as Dn,i as Xo}from"./XClose-Bsj_jKUE.js";import{s as Ns}from"./Plus-Dk5G0eGJ.js";import{t as _n}from"./Users01-BmXeKAri.js";import{f as Zo,e as ea,b as ta,A as sa,a as na,d as oa,c as aa,g as la}from"./alert-dialog-13GPwGkk.js";import{S as Zt}from"./scroll-area-BN7R6f0c.js";import{T as qe,a as We,b as Ye}from"./tooltip-DoWVDYxv.js";import{B as mt}from"./badge-DTNkOzY0.js";import{S as ps,k as ia,c as ra,g as An,B as gs,P as ca,h as da,n as ua,s as ma,i as Ms,u as es,l as fa,o as pa,R as ga,q as Ln,r as ha,t as xa,d as $n,v as ba,w as ya,x as On,y as va,M as ja,j as ka,z as Sa,p as wa,A as Na,C as Ca,e as Pa,f as Ta,D as Vs}from"./runnable-block-editor-2ItVAsl7.js";import{r as Cs,S as Ba,t as Ps,i as Ea,w as Da,x as _a,n as Ft,v as Aa,R as Rn,u as La,y as $a,q as Oa,z as Ra,A as Fa,B as Gs,G as Ts,g as Ia,E as Ka,j as Us,F as za,k as Ma,H as Va,I as Hs,h as Ga,J as Fn,m as Ua,K as Ha,L as qa,M as Wa}from"./claim-phase-copy-J9IiJiw_.js";import{u as Ya,P as Qa}from"./mustache-C7f92o5k.js";import{n as In}from"./ShoppingBag01-mUPmqGRd.js";import{t as Bt}from"./ChevronUp-C9klasvw.js";import{C as Ja,a as Xa,b as Za}from"./collapsible-qdaAxaaw.js";import{c as el,d as tl}from"./sandbox-lifecycle-context-C0vkuH66.js";import{u as Kn}from"./use-session-runtime-C1jT9-WF.js";import{c as ft,d as at,e as pt,b as lt,D as it,h as Ut,a as sl}from"./dialog-CwJ0Tacd.js";import{I as Ze}from"./input-C0ZWiiGy.js";import{C as ts}from"./checkbox-DuccoC4e.js";import{L as Me}from"./label-CKukDnnz.js";import{c as nl,b as ol,a as al,d as ll,S as il}from"./select-CGC5E9nf.js";import{t as rl}from"./sandbox-git-api-DTIjDZTr.js";import{b as qs}from"./sandbox-url-D3mC8qhT.js";import{a as Ws}from"./utils-CZW3O45l.js";import{i as cl}from"./CheckCircle-CxJ9MBI3.js";import{a as Bs}from"./Copy01-ByHdq7k3.js";import{s as Es}from"./Trash01-BA-bFjuS.js";import{i as hs}from"./Upload01-C13aB89v.js";import{E as dl}from"./empty-state-Db66egMr.js";import{T as It}from"./textarea-e3h0PKfc.js";import{a as ul}from"./use-organization-settings-BgEtBsl7.js";import{u as ml}from"./use-ai-providers-BuwFLwdC.js";import{M as zn}from"./monaco-editor-C4uDUO_q.js";import{i as Ds}from"./X-BdtW9stL.js";import{c as Mn,a as fl}from"./repository-binding-CEDkA6og.js";import"./rich-text-link-control-ClsuTwdo.js";import{c as pl}from"./Tool01-CGCC9pfF.js";import{b as Ys}from"./use-project-scope-CUYDg9gO.js";import{E as gl}from"./empty-state-DdDKihxt.js";import{G as Qs}from"./repository-picker-Bowb7b9f.js";import{R as hl}from"./repository-import-picker-BT060hhl.js";import{b as xl}from"./thread-route-esGiDSRu.js";function bl(s){const e=le.c(18),{title:t,description:o,children:a}=s,l=je();let i;e[0]!==a?(i=n.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none h-full select-none overflow-hidden",children:a}),e[0]=a,e[1]=i):i=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Io,{}),e[2]=r):r=e[2];let c;e[3]!==l?(c=l("common.soon"),e[3]=l,e[4]=c):c=e[4];let d;e[5]!==c?(d=n.jsxs(mt,{variant:"secondary",children:[r,c]}),e[5]=c,e[6]=d):d=e[6];let g;e[7]!==t?(g=n.jsx("p",{className:"text-base font-semibold text-foreground",children:t}),e[7]=t,e[8]=g):g=e[8];let u;e[9]!==o?(u=o&&n.jsx("p",{className:"text-sm text-muted-foreground",children:o}),e[9]=o,e[10]=u):u=e[10];let m;e[11]!==d||e[12]!==g||e[13]!==u?(m=n.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-background/60 p-6 backdrop-blur-sm",children:n.jsxs("div",{className:"flex max-w-sm flex-col items-center gap-3 rounded-2xl border bg-card px-8 py-6 text-center shadow-lg",children:[d,g,u]})}),e[11]=d,e[12]=g,e[13]=u,e[14]=m):m=e[14];let f;return e[15]!==i||e[16]!==m?(f=n.jsxs("div",{className:"relative h-full min-h-0",children:[i,m]}),e[15]=i,e[16]=m,e[17]=f):f=e[17],f}function yl(s,e){if(!s||!e?.length)return s;const t=Object.fromEntries(Object.entries(s.properties??{}).filter(([o])=>!e.includes(o)));return Object.keys(t).length>0?{...s,properties:t}:s}function vl(s,e,t){return typeof s!="string"?null:yl(Cs(s,e),t)}function Vn(s,e,t){if(!e||typeof s!="string")return!1;const o=vl(s,e,t);return!!o&&Object.keys(o.properties??{}).length>0}function vt(s){const e=le.c(6),{hasItems:t,emptyLabel:o,emptyHint:a}=s;let l;e[0]!==a||e[1]!==o||e[2]!==t?(l=t?"No results match your search.":n.jsxs(n.Fragment,{children:[n.jsx("div",{children:o}),n.jsx("div",{className:"mt-1 text-muted-foreground/80",children:a})]}),e[0]=a,e[1]=o,e[2]=t,e[3]=l):l=e[3];let i;return e[4]!==l?(i=n.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 ss(s,e){return`${s}-${e}`}function Gn(s,e){return`site/apps/${s}/${e}.ts`}function Un(s){const e=s.match(/^site\/apps\/([^/]+)\/([^/.]+)\.tsx?$/);if(e)return{vendor:e[1],app:e[2]};const t=s.match(/^([^/]+)\/apps\/([^/.]+)\.tsx?$/);return t?{vendor:t[1],app:t[2]}:null}function jl(s){const e=s.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function kl(s){return s==="local"?"Custom":"Installed"}function Hn(s,e,t){const o=new Set([ss(s,e),e].map(l=>l.toLowerCase())),a=Gn(s,e);for(const[l,i]of Object.entries(t)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const r=i;if(o.has(l.toLowerCase())||r.__resolveType===a)return l}return null}function Sl(s,e){const t=s.vendor.alias,o=s.name,a=Hn(t,o,e);return{id:ss(t,o),app:o,vendor:t,title:s.title||s.name,description:s.description,category:s.category??"Other",logo:s.logo||void 0,resolveType:Gn(t,o),blockKey:a,installed:a!==null}}function wl(s,e,t){if(s===Ba)return null;const o=Un(s);if(!o)return null;const{vendor:a,app:l}=o,i=Hn(a,l,t),r=Ps(s,e);return{id:ss(a,l),app:l,vendor:a,title:r.title??l,description:r.description??"",category:"Others",logo:r.logo??r.icon,resolveType:s,blockKey:i,installed:i!==null}}function Nl(s,e,t){const o=e.__resolveType;if(typeof o!="string"||Ea(s,e)||!Da(o))return null;const a=Un(o)??jl(s);if(!a)return null;const l=Ps(o,t),{vendor:i,app:r}=a;return{id:ss(i,r),app:r,vendor:i,title:l.title??_a(s,e,t),description:l.description??"",category:kl(i),logo:l.logo??l.icon,resolveType:o,blockKey:s,installed:!0}}function Cl(s,e,t){const o=new Map;for(const l of s){const i=Sl(l,t);o.set(i.id,i)}const a=e.manifest?.blocks?.apps??{};for(const l of Object.keys(a)){const i=wl(l,e,t);!i||o.has(i.id)||o.set(i.id,i)}for(const[l,i]of Object.entries(t)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const r=Nl(l,i,e);!r||o.has(r.id)||o.set(r.id,r)}return[...o.values()].sort(Pl)}function Pl(s,e){return s.installed!==e.installed?s.installed?-1:1:s.title.localeCompare(e.title)}async function Tl(){const s=await fetch("/api/deco-apps");if(!s.ok)throw new Error(`Failed to fetch deco apps: ${s.status}`);return(await s.json()).apps??[]}function Bl(s,e,t){const o=le.c(12),a=t?.enabled??!0;let l;o[0]===Symbol.for("react.memo_cache_sentinel")?(l=ys.decoApps(),o[0]=l):l=o[0];let i;o[1]!==a?(i={queryKey:l,queryFn:Tl,staleTime:3e5,retry:1,enabled:a},o[1]=a,o[2]=i):i=o[2];const r=Do(i);let c;o[3]!==e||o[4]!==s||o[5]!==r.data?(c=s&&e?Cl(r.data??[],s,e):[],o[3]=e,o[4]=s,o[5]=r.data,o[6]=c):c=o[6];const d=c,g=r.isLoading&&!r.isError;let u;return o[7]!==d||o[8]!==r.isError||o[9]!==r.refetch||o[10]!==g?(u={catalog:d,isLoading:g,isError:r.isError,refetch:r.refetch},o[7]=d,o[8]=r.isError,o[9]=r.refetch,o[10]=g,o[11]=u):u=o[11],u}const El=["sections","apps","loaders","actions"];function Dl(s){const e=le.c(59),{active:t,counts:o,showBlog:a,onSelect:l}=s,i=je();let r;e[0]!==i?(r=i("sandbox.collectionsSidebar.content"),e[0]=i,e[1]=r):r=e[1];let c;e[2]!==r?(c=n.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:n.jsx("span",{className:"text-sm font-medium",children:r})}),e[2]=r,e[3]=c):c=e[3];let d;e[4]!==i?(d=i("sandbox.collectionsSidebar.pages"),e[4]=i,e[5]=d):d=e[5];const g=t==="pages";let u;e[6]!==o.pages||e[7]!==l||e[8]!==d||e[9]!==g?(u=n.jsx(Fe,{id:"pages",icon:Tn,label:d,count:o.pages,active:g,onSelect:l}),e[6]=o.pages,e[7]=l,e[8]=d,e[9]=g,e[10]=u):u=e[10];let m;e[11]!==i?(m=i("sandbox.collectionsSidebar.redirects"),e[11]=i,e[12]=m):m=e[12];const f=t==="redirects";let p;e[13]!==o.redirects||e[14]!==l||e[15]!==m||e[16]!==f?(p=n.jsx(Fe,{id:"redirects",icon:kn,label:m,count:o.redirects,active:f,onSelect:l}),e[13]=o.redirects,e[14]=l,e[15]=m,e[16]=f,e[17]=p):p=e[17];let b;e[18]!==i?(b=i("sandbox.collectionsSidebar.site"),e[18]=i,e[19]=b):b=e[19];const h=t==="site";let y;e[20]!==l||e[21]!==h||e[22]!==b?(y=n.jsx(Fe,{id:"site",icon:Ko,label:b,active:h,onSelect:l}),e[20]=l,e[21]=h,e[22]=b,e[23]=y):y=e[23];let j;e[24]!==i?(j=i("sandbox.collectionsSidebar.seo"),e[24]=i,e[25]=j):j=e[25];const k=t==="seo";let S;e[26]!==l||e[27]!==j||e[28]!==k?(S=n.jsx(Fe,{id:"seo",icon:wn,label:j,active:k,onSelect:l}),e[26]=l,e[27]=j,e[28]=k,e[29]=S):S=e[29];let w;e[30]!==i?(w=i("sandbox.collectionsSidebar.calendar"),e[30]=i,e[31]=w):w=e[31];const _=t==="calendar";let E;e[32]!==l||e[33]!==w||e[34]!==_?(E=n.jsx(Fe,{id:"calendar",icon:zo,label:w,active:_,onSelect:l}),e[32]=l,e[33]=w,e[34]=_,e[35]=E):E=e[35];let N;e[36]!==t||e[37]!==o||e[38]!==l?(N=n.jsx(_l,{active:t,counts:o,onSelect:l}),e[36]=t,e[37]=o,e[38]=l,e[39]=N):N=e[39];let B;e[40]!==t||e[41]!==o.authors||e[42]!==o.categories||e[43]!==o.posts||e[44]!==l||e[45]!==a||e[46]!==i?(B=a&&n.jsxs(n.Fragment,{children:[n.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:[n.jsx(In,{size:13,className:"shrink-0"}),i("sandbox.collectionsSidebar.blog")]}),n.jsx(Fe,{id:"context",icon:nt,label:i("sandbox.collectionsSidebar.context"),active:t==="context",onSelect:l}),n.jsx(Fe,{id:"posts",icon:Bn,label:i("sandbox.collectionsSidebar.posts"),count:o.posts,active:t==="posts",onSelect:l}),n.jsx(Fe,{id:"authors",icon:_n,label:i("sandbox.collectionsSidebar.authors"),count:o.authors,active:t==="authors",onSelect:l}),n.jsx(Fe,{id:"categories",icon:Sn,label:i("sandbox.collectionsSidebar.categories"),count:o.categories,active:t==="categories",onSelect:l}),n.jsx(Fe,{id:"post-schedule",icon:Ss,label:i("sandbox.collectionsSidebar.postSchedule"),active:t==="post-schedule",onSelect:l})]}),e[40]=t,e[41]=o.authors,e[42]=o.categories,e[43]=o.posts,e[44]=l,e[45]=a,e[46]=i,e[47]=B):B=e[47];let R;e[48]!==y||e[49]!==S||e[50]!==E||e[51]!==N||e[52]!==B||e[53]!==u||e[54]!==p?(R=n.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[u,p,y,S,E,N,B]}),e[48]=y,e[49]=S,e[50]=E,e[51]=N,e[52]=B,e[53]=u,e[54]=p,e[55]=R):R=e[55];let L;return e[56]!==c||e[57]!==R?(L=n.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[c,R]}),e[56]=c,e[57]=R,e[58]=L):L=e[58],L}function _l(s){const e=le.c(52),{active:t,counts:o,onSelect:a}=s,l=je();let i;e[0]!==t?(i=El.includes(t),e[0]=t,e[1]=i):i=e[1];const r=i,[c,d]=A.useState(!1),g=c||r;let u,m;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=ye("flex w-full items-center gap-2 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"),m=n.jsx(Mo,{size:16,className:"shrink-0"}),e[2]=u,e[3]=m):(u=e[2],m=e[3]);let f;e[4]!==l?(f=l("sandbox.collectionsSidebar.advanced"),e[4]=l,e[5]=f):f=e[5];let p;e[6]!==f?(p=n.jsx("span",{className:"flex-1 truncate",children:f}),e[6]=f,e[7]=p):p=e[7];const b=g&&"rotate-180";let h;e[8]!==b?(h=ye("shrink-0 text-muted-foreground/70 transition-transform",b),e[8]=b,e[9]=h):h=e[9];let y;e[10]!==h?(y=n.jsx(Bt,{size:16,className:h}),e[10]=h,e[11]=y):y=e[11];let j;e[12]!==p||e[13]!==y?(j=n.jsxs(Ja,{className:u,children:[m,p,y]}),e[12]=p,e[13]=y,e[14]=j):j=e[14];let k;e[15]!==l?(k=l("sandbox.collectionsSidebar.sections"),e[15]=l,e[16]=k):k=e[16];const S=t==="sections";let w;e[17]!==o.sections||e[18]!==a||e[19]!==k||e[20]!==S?(w=n.jsx(Fe,{id:"sections",icon:Gt,label:k,count:o.sections,active:S,onSelect:a,indent:!0}),e[17]=o.sections,e[18]=a,e[19]=k,e[20]=S,e[21]=w):w=e[21];let _;e[22]!==l?(_=l("sandbox.collectionsSidebar.apps"),e[22]=l,e[23]=_):_=e[23];const E=t==="apps";let N;e[24]!==o.apps||e[25]!==a||e[26]!==_||e[27]!==E?(N=n.jsx(Fe,{id:"apps",icon:Dn,label:_,count:o.apps,active:E,onSelect:a,indent:!0}),e[24]=o.apps,e[25]=a,e[26]=_,e[27]=E,e[28]=N):N=e[28];let B;e[29]!==l?(B=l("sandbox.collectionsSidebar.loaders"),e[29]=l,e[30]=B):B=e[30];const R=t==="loaders";let L;e[31]!==o.loaders||e[32]!==a||e[33]!==B||e[34]!==R?(L=n.jsx(Fe,{id:"loaders",icon:Nn,label:B,count:o.loaders,active:R,onSelect:a,indent:!0}),e[31]=o.loaders,e[32]=a,e[33]=B,e[34]=R,e[35]=L):L=e[35];let M;e[36]!==l?(M=l("sandbox.collectionsSidebar.actions"),e[36]=l,e[37]=M):M=e[37];const F=t==="actions";let T;e[38]!==o.actions||e[39]!==a||e[40]!==M||e[41]!==F?(T=n.jsx(Fe,{id:"actions",icon:En,label:M,count:o.actions,active:F,onSelect:a,indent:!0}),e[38]=o.actions,e[39]=a,e[40]=M,e[41]=F,e[42]=T):T=e[42];let $;e[43]!==w||e[44]!==N||e[45]!==L||e[46]!==T?($=n.jsxs(Xa,{className:"flex flex-col gap-0.5 pt-0.5",children:[w,N,L,T]}),e[43]=w,e[44]=N,e[45]=L,e[46]=T,e[47]=$):$=e[47];let K;return e[48]!==g||e[49]!==$||e[50]!==j?(K=n.jsxs(Za,{open:g,onOpenChange:d,children:[j,$]}),e[48]=g,e[49]=$,e[50]=j,e[51]=K):K=e[51],K}function Fe(s){const e=le.c(19),{id:t,icon:o,label:a,count:l,active:i,onSelect:r,indent:c}=s;let d;e[0]!==t||e[1]!==r?(d=()=>r(t),e[0]=t,e[1]=r,e[2]=d):d=e[2];const g=c&&"pl-6",u=i?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let m;e[3]!==g||e[4]!==u?(m=ye("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",g,u),e[3]=g,e[4]=u,e[5]=m):m=e[5];let f;e[6]!==o?(f=n.jsx(o,{size:16,className:"shrink-0"}),e[6]=o,e[7]=f):f=e[7];let p;e[8]!==a?(p=n.jsx("span",{className:"flex-1 truncate",children:a}),e[8]=a,e[9]=p):p=e[9];let b;e[10]!==i||e[11]!==l?(b=l!==void 0&&n.jsx("span",{className:ye("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]=b):b=e[12];let h;return e[13]!==d||e[14]!==m||e[15]!==f||e[16]!==p||e[17]!==b?(h=n.jsxs("button",{type:"button",onClick:d,className:m,children:[f,p,b]}),e[13]=d,e[14]=m,e[15]=f,e[16]=p,e[17]=b,e[18]=h):h=e[18],h}function Al(s){const e=le.c(12),{state:t,claimPhase:o,lifecycle:a,onStart:l,connectionsHref:i}=s;switch(t.kind){case"starting":{let r;e[0]!==o||e[1]!==a?(r=ia({claimPhase:o,lifecycle:a}),e[0]=o,e[1]=a,e[2]=r):r=e[2];let c;return e[3]!==o||e[4]!==r?(c=n.jsx(ps,{kind:"starting",progress:r,claimPhase:o}),e[3]=o,e[4]=r,e[5]=c):c=e[5],c}case"suspended":{let r;return e[6]!==l?(r=n.jsx(ps,{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]!==t.error?(r=n.jsx(ps,{kind:"errored",error:t.error,onRetry:l,connectionsHref:i}),e[8]=i,e[9]=l,e[10]=t.error,e[11]=r):r=e[11],r}}}const Ll=new Set(["clone-failed","install-failed","start-failed","crashed"]);function $l(s){if(s.fastPreviewActive)return{kind:"ready",devServerReady:!1,sandboxWarming:!1};if(s.previewState.kind!=="iframe")return{kind:"sandbox-card",state:s.previewState};const e=s.lifecyclePhase==="running",t=!e&&!Ll.has(s.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:t}}function Js(s,e){const t=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),o=`${t} (copy)`;if(!s.has(o))return o;for(let a=2;a<1e3;a++){const l=`${t} (copy ${a})`;if(!s.has(l))return l}return`${t} (copy ${Date.now()})`}function Ol(s,e){const t=Ft,o=e.replace(/-copy(?:-\d+)?$/,""),a=`${o}-copy`;if(!s.has(t(a)))return a;for(let l=2;l<1e3;l++){const i=`${o}-copy-${l}`;if(!s.has(t(i)))return i}return`${o}-copy-${Date.now()}`}function Rl(s,e){const t=e.replace(/_copy(?:_\d+)?$/,""),o=`${t}_copy`;if(!Object.hasOwn(s,o))return o;for(let a=2;a<1e3;a++){const l=`${t}_copy_${a}`;if(!Object.hasOwn(s,l))return l}return`${t}_copy_${Date.now()}`}function Fl(s){const e=An(s.newName),t={...s.source,name:s.newName,path:s.newPath};return{key:e,data:t}}function Il(s,e){return ra(s,e)}const Kl=1e3;function zl(s,e){for(let t=0;t<Kl;t++){const o=An(e);if(!Object.hasOwn(s,o))return o}throw new Error("Could not generate a unique page block key")}const Ml={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},Vl={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},Gl={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function Ul(s){const e=le.c(88),{open:t,mode:o,initialName:a,initialPath:l,isPending:i,error:r,templates:c,validate:d,onSubmit:g,onOpenChange:u}=s,m=i===void 0?!1:i,f=je(),[p,b]=A.useState(a),[h,y]=A.useState(l),[j,k]=A.useState(gs),[S,w]=A.useState(null),[_,E]=A.useState(t);t!==_&&(E(t),t&&(b(a),y(l),k(gs),w(null)));const N=o==="create"&&!!c?.length;let B;e[0]!==m||e[1]!==u?(B=ge=>{!ge&&!m&&(w(null),u(!1))},e[0]=m,e[1]=u,e[2]=B):B=e[2];const R=B;let L;e[3]!==m||e[4]!==p||e[5]!==g||e[6]!==h||e[7]!==N||e[8]!==j||e[9]!==d?(L=async ge=>{ge.preventDefault();const ve=p.trim(),he=h.trim();if(!ve||!he||m)return;const De=Aa(he);if(De){w(De);return}const ke=d?.({name:ve,path:he});if(ke){w(ke);return}w(null),await g({name:ve,path:he,templateKey:N&&j!==gs?j:null})},e[3]=m,e[4]=p,e[5]=g,e[6]=h,e[7]=N,e[8]=j,e[9]=d,e[10]=L):L=e[10];const M=L,F=S??r,T=Ml[o];let $;e[11]!==f||e[12]!==T?($=f(T),e[11]=f,e[12]=T,e[13]=$):$=e[13];let K;e[14]!==$?(K=n.jsx(ft,{children:n.jsx(at,{children:$})}),e[14]=$,e[15]=K):K=e[15];let z;e[16]!==m||e[17]!==N||e[18]!==f||e[19]!==j||e[20]!==c?(z=N&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("label",{htmlFor:"page-form-template",className:"text-xs font-medium text-muted-foreground",children:f("sandbox.pageFormDialog.labelTemplate")}),n.jsx(ca,{id:"page-form-template",value:j,onChange:k,templates:c??[],disabled:m})]}),e[16]=m,e[17]=N,e[18]=f,e[19]=j,e[20]=c,e[21]=z):z=e[21];let G;e[22]!==f?(G=f("sandbox.pageFormDialog.labelName"),e[22]=f,e[23]=G):G=e[23];let W;e[24]!==G?(W=n.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:G}),e[24]=G,e[25]=W):W=e[25];let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=ge=>b(ge.target.value),e[26]=O):O=e[26];let I;e[27]!==f?(I=f("sandbox.pageFormDialog.placeholderName"),e[27]=f,e[28]=I):I=e[28];let D;e[29]!==m||e[30]!==p||e[31]!==I?(D=n.jsx(Ze,{id:"page-form-name",value:p,onChange:O,placeholder:I,autoFocus:!0,disabled:m}),e[29]=m,e[30]=p,e[31]=I,e[32]=D):D=e[32];let U;e[33]!==D||e[34]!==W?(U=n.jsxs("div",{className:"space-y-1.5",children:[W,D]}),e[33]=D,e[34]=W,e[35]=U):U=e[35];let J;e[36]!==f?(J=f("sandbox.pageFormDialog.labelPath"),e[36]=f,e[37]=J):J=e[37];let Z;e[38]!==J?(Z=n.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:J}),e[38]=J,e[39]=Z):Z=e[39];let oe;e[40]===Symbol.for("react.memo_cache_sentinel")?(oe=ge=>y(ge.target.value),e[40]=oe):oe=e[40];let ae;e[41]!==f?(ae=f("sandbox.pageFormDialog.placeholderPath"),e[41]=f,e[42]=ae):ae=e[42];let ie;e[43]!==m||e[44]!==h||e[45]!==ae?(ie=n.jsx(Ze,{id:"page-form-path",value:h,onChange:oe,placeholder:ae,disabled:m}),e[43]=m,e[44]=h,e[45]=ae,e[46]=ie):ie=e[46];let te;e[47]!==Z||e[48]!==ie?(te=n.jsxs("div",{className:"space-y-1.5",children:[Z,ie]}),e[47]=Z,e[48]=ie,e[49]=te):te=e[49];let ue;e[50]!==F?(ue=F&&n.jsx("p",{className:"text-xs text-destructive",children:F}),e[50]=F,e[51]=ue):ue=e[51];let ee;e[52]!==U||e[53]!==te||e[54]!==ue||e[55]!==z?(ee=n.jsxs("div",{className:"space-y-4 py-4",children:[z,U,te,ue]}),e[52]=U,e[53]=te,e[54]=ue,e[55]=z,e[56]=ee):ee=e[56];let P;e[57]!==u?(P=()=>u(!1),e[57]=u,e[58]=P):P=e[58];let q;e[59]!==f?(q=f("sandbox.pageFormDialog.buttonCancel"),e[59]=f,e[60]=q):q=e[60];let ne;e[61]!==m||e[62]!==P||e[63]!==q?(ne=n.jsx(Ae,{type:"button",variant:"outline",onClick:P,disabled:m,children:q}),e[61]=m,e[62]=P,e[63]=q,e[64]=ne):ne=e[64];let se;e[65]!==m||e[66]!==p||e[67]!==h?(se=!p.trim()||!h.trim()||m,e[65]=m,e[66]=p,e[67]=h,e[68]=se):se=e[68];let re;e[69]!==m||e[70]!==o||e[71]!==f?(re=m?n.jsxs(n.Fragment,{children:[n.jsx(ot,{className:"size-3.5"}),f(Gl[o])]}):f(Vl[o]),e[69]=m,e[70]=o,e[71]=f,e[72]=re):re=e[72];let ce;e[73]!==se||e[74]!==re?(ce=n.jsx(Ae,{type:"submit",disabled:se,children:re}),e[73]=se,e[74]=re,e[75]=ce):ce=e[75];let v;e[76]!==ne||e[77]!==ce?(v=n.jsxs(pt,{children:[ne,ce]}),e[76]=ne,e[77]=ce,e[78]=v):v=e[78];let V;e[79]!==M||e[80]!==ee||e[81]!==v||e[82]!==K?(V=n.jsx(lt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:M,children:[K,ee,v]})}),e[79]=M,e[80]=ee,e[81]=v,e[82]=K,e[83]=V):V=e[83];let fe;return e[84]!==R||e[85]!==t||e[86]!==V?(fe=n.jsx(it,{open:t,onOpenChange:R,children:V}),e[84]=R,e[85]=t,e[86]=V,e[87]=fe):fe=e[87],fe}const Hl=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],Xs={from:"",to:"",type:"temporary",discardQueryParameters:!1};function ql(s){const e=le.c(111),{open:t,isPending:o,error:a,onSubmit:l,onOpenChange:i}=s,r=o===void 0?!1:o,c=je(),[d,g]=A.useState(Xs),[u,m]=A.useState(null),[f,p]=A.useState(t);t!==f&&(p(t),t&&(g(Xs),m(null)));let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=be=>g(Le=>({...Le,...be})),e[0]=b):b=e[0];const h=b;let y;e[1]!==r||e[2]!==i?(y=be=>{!be&&!r&&(m(null),i(!1))},e[1]=r,e[2]=i,e[3]=y):y=e[3];const j=y;let k;e[4]!==r||e[5]!==l||e[6]!==d||e[7]!==c?(k=async be=>{be.preventDefault();const Le=d.from.trim(),Ie=d.to.trim();if(!Le||!Ie||r){m(c("sandbox.redirectFormDialog.errorRequired"));return}m(null),await l({...d,from:Le,to:Ie})},e[4]=r,e[5]=l,e[6]=d,e[7]=c,e[8]=k):k=e[8];const S=k,w=u??a;let _;e[9]!==r||e[10]!==d.from||e[11]!==d.to?(_=!!d.from.trim()&&!!d.to.trim()&&!r,e[9]=r,e[10]=d.from,e[11]=d.to,e[12]=_):_=e[12];const E=_;let N;e[13]!==c?(N=c("sandbox.redirectFormDialog.title"),e[13]=c,e[14]=N):N=e[14];let B;e[15]!==N?(B=n.jsx(ft,{children:n.jsx(at,{children:N})}),e[15]=N,e[16]=B):B=e[16];let R;e[17]!==c?(R=c("sandbox.redirectEditor.fromLabel"),e[17]=c,e[18]=R):R=e[18];let L;e[19]!==R?(L=n.jsx(Me,{htmlFor:"redirect-form-from",children:R}),e[19]=R,e[20]=L):L=e[20];const M=d.from;let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=be=>h({from:be.target.value}),e[21]=F):F=e[21];let T;e[22]!==c?(T=c("sandbox.redirectEditor.fromPlaceholder"),e[22]=c,e[23]=T):T=e[23];let $;e[24]!==r||e[25]!==d.from||e[26]!==T?($=n.jsx(Ze,{id:"redirect-form-from",value:M,onChange:F,placeholder:T,autoFocus:!0,disabled:r}),e[24]=r,e[25]=d.from,e[26]=T,e[27]=$):$=e[27];let K;e[28]!==$||e[29]!==L?(K=n.jsxs("div",{className:"space-y-1.5",children:[L,$]}),e[28]=$,e[29]=L,e[30]=K):K=e[30];let z;e[31]!==c?(z=c("sandbox.redirectEditor.toLabel"),e[31]=c,e[32]=z):z=e[32];let G;e[33]!==z?(G=n.jsx(Me,{htmlFor:"redirect-form-to",children:z}),e[33]=z,e[34]=G):G=e[34];const W=d.to;let O;e[35]===Symbol.for("react.memo_cache_sentinel")?(O=be=>h({to:be.target.value}),e[35]=O):O=e[35];let I;e[36]!==c?(I=c("sandbox.redirectEditor.toPlaceholder"),e[36]=c,e[37]=I):I=e[37];let D;e[38]!==r||e[39]!==d.to||e[40]!==I?(D=n.jsx(Ze,{id:"redirect-form-to",value:W,onChange:O,placeholder:I,disabled:r}),e[38]=r,e[39]=d.to,e[40]=I,e[41]=D):D=e[41];let U;e[42]!==G||e[43]!==D?(U=n.jsxs("div",{className:"space-y-1.5",children:[G,D]}),e[42]=G,e[43]=D,e[44]=U):U=e[44];let J;e[45]!==c?(J=c("sandbox.redirectEditor.typeLabel"),e[45]=c,e[46]=J):J=e[46];let Z;e[47]!==J?(Z=n.jsx(Me,{htmlFor:"redirect-form-type",children:J}),e[47]=J,e[48]=Z):Z=e[48];const oe=d.type;let ae;e[49]===Symbol.for("react.memo_cache_sentinel")?(ae=be=>h({type:be}),e[49]=ae):ae=e[49];let ie;e[50]!==c?(ie=c("sandbox.redirectEditor.typePlaceholder"),e[50]=c,e[51]=ie):ie=e[51];let te;e[52]!==ie?(te=n.jsx(ol,{id:"redirect-form-type",className:"w-full",children:n.jsx(al,{placeholder:ie})}),e[52]=ie,e[53]=te):te=e[53];let ue;e[54]!==c?(ue=Hl.map(be=>n.jsx(nl,{value:be.value,children:c(be.labelKey,{status:Rn[be.value]})},be.value)),e[54]=c,e[55]=ue):ue=e[55];let ee;e[56]!==ue?(ee=n.jsx(ll,{children:ue}),e[56]=ue,e[57]=ee):ee=e[57];let P;e[58]!==r||e[59]!==d.type||e[60]!==te||e[61]!==ee?(P=n.jsxs(il,{value:oe,onValueChange:ae,disabled:r,children:[te,ee]}),e[58]=r,e[59]=d.type,e[60]=te,e[61]=ee,e[62]=P):P=e[62];let q;e[63]!==Z||e[64]!==P?(q=n.jsxs("div",{className:"space-y-1.5",children:[Z,P]}),e[63]=Z,e[64]=P,e[65]=q):q=e[65];let ne;e[66]===Symbol.for("react.memo_cache_sentinel")?(ne=be=>h({discardQueryParameters:be===!0}),e[66]=ne):ne=e[66];let se;e[67]!==r||e[68]!==d.discardQueryParameters?(se=n.jsx(ts,{checked:d.discardQueryParameters,disabled:r,onCheckedChange:ne}),e[67]=r,e[68]=d.discardQueryParameters,e[69]=se):se=e[69];let re;e[70]!==c?(re=c("sandbox.redirectEditor.discardQueryParameters"),e[70]=c,e[71]=re):re=e[71];let ce;e[72]!==re?(ce=n.jsx("span",{className:"text-sm",children:re}),e[72]=re,e[73]=ce):ce=e[73];let v;e[74]!==se||e[75]!==ce?(v=n.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[se,ce]}),e[74]=se,e[75]=ce,e[76]=v):v=e[76];let V;e[77]!==w?(V=w&&n.jsx("p",{className:"text-xs text-destructive",children:w}),e[77]=w,e[78]=V):V=e[78];let fe;e[79]!==K||e[80]!==U||e[81]!==q||e[82]!==v||e[83]!==V?(fe=n.jsxs("div",{className:"space-y-4 py-4",children:[K,U,q,v,V]}),e[79]=K,e[80]=U,e[81]=q,e[82]=v,e[83]=V,e[84]=fe):fe=e[84];let ge;e[85]!==i?(ge=()=>i(!1),e[85]=i,e[86]=ge):ge=e[86];let ve;e[87]!==c?(ve=c("sandbox.redirectFormDialog.cancel"),e[87]=c,e[88]=ve):ve=e[88];let he;e[89]!==r||e[90]!==ge||e[91]!==ve?(he=n.jsx(Ae,{type:"button",variant:"outline",onClick:ge,disabled:r,children:ve}),e[89]=r,e[90]=ge,e[91]=ve,e[92]=he):he=e[92];const De=!E;let ke;e[93]!==r||e[94]!==c?(ke=r?n.jsxs(n.Fragment,{children:[n.jsx(ot,{className:"size-3.5"}),c("sandbox.redirectFormDialog.pending")]}):c("sandbox.redirectFormDialog.submit"),e[93]=r,e[94]=c,e[95]=ke):ke=e[95];let Pe;e[96]!==De||e[97]!==ke?(Pe=n.jsx(Ae,{type:"submit",disabled:De,children:ke}),e[96]=De,e[97]=ke,e[98]=Pe):Pe=e[98];let Te;e[99]!==he||e[100]!==Pe?(Te=n.jsxs(pt,{children:[he,Pe]}),e[99]=he,e[100]=Pe,e[101]=Te):Te=e[101];let Be;e[102]!==S||e[103]!==fe||e[104]!==Te||e[105]!==B?(Be=n.jsx(lt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:S,children:[B,fe,Te]})}),e[102]=S,e[103]=fe,e[104]=Te,e[105]=B,e[106]=Be):Be=e[106];let _e;return e[107]!==j||e[108]!==t||e[109]!==Be?(_e=n.jsx(it,{open:t,onOpenChange:j,children:Be}),e[107]=j,e[108]=t,e[109]=Be,e[110]=_e):_e=e[110],_e}function Wl(s){const e=le.c(70),{open:t,blockKey:o,initialName:a,isPending:l,onSubmit:i,onOpenChange:r}=s,c=l===void 0?!1:l,d=je(),[g,u]=A.useState(a),[m,f]=A.useState(t);t!==m&&(f(t),t&&u(a));let p;e[0]!==c||e[1]!==r?(p=oe=>{!oe&&!c&&r(!1)},e[0]=c,e[1]=r,e[2]=p):p=e[2];const b=p;let h;e[3]!==c||e[4]!==g||e[5]!==i?(h=async oe=>{oe.preventDefault();const ae=g.trim();!ae||c||await i(ae)},e[3]=c,e[4]=g,e[5]=i,e[6]=h):h=e[6];const y=h;let j;e[7]!==d?(j=d("sandbox.sectionRenameDialog.title"),e[7]=d,e[8]=j):j=e[8];let k;e[9]!==j?(k=n.jsx(at,{children:j}),e[9]=j,e[10]=k):k=e[10];let S;e[11]!==d?(S=d("sandbox.sectionRenameDialog.description"),e[11]=d,e[12]=S):S=e[12];let w;e[13]!==S?(w=n.jsx(Ut,{children:S}),e[13]=S,e[14]=w):w=e[14];let _;e[15]!==k||e[16]!==w?(_=n.jsxs(ft,{children:[k,w]}),e[15]=k,e[16]=w,e[17]=_):_=e[17];let E;e[18]!==d?(E=d("sandbox.sectionRenameDialog.nameLabel"),e[18]=d,e[19]=E):E=e[19];let N;e[20]!==E?(N=n.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:E}),e[20]=E,e[21]=N):N=e[21];let B;e[22]===Symbol.for("react.memo_cache_sentinel")?(B=oe=>u(oe.target.value),e[22]=B):B=e[22];let R;e[23]!==c||e[24]!==g?(R=n.jsx(Ze,{id:"section-rename-name",value:g,onChange:B,autoFocus:!0,disabled:c}),e[23]=c,e[24]=g,e[25]=R):R=e[25];let L;e[26]!==N||e[27]!==R?(L=n.jsxs("div",{className:"space-y-1.5",children:[N,R]}),e[26]=N,e[27]=R,e[28]=L):L=e[28];let M;e[29]!==d?(M=d("sandbox.sectionRenameDialog.keyLabel"),e[29]=d,e[30]=M):M=e[30];let F;e[31]!==M?(F=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:M}),e[31]=M,e[32]=F):F=e[32];let T;e[33]!==o?(T=n.jsx(Ze,{value:o,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=o,e[34]=T):T=e[34];let $;e[35]!==F||e[36]!==T?($=n.jsxs("div",{className:"space-y-1.5",children:[F,T]}),e[35]=F,e[36]=T,e[37]=$):$=e[37];let K;e[38]!==L||e[39]!==$?(K=n.jsxs("div",{className:"space-y-4 py-4",children:[L,$]}),e[38]=L,e[39]=$,e[40]=K):K=e[40];let z;e[41]!==r?(z=()=>r(!1),e[41]=r,e[42]=z):z=e[42];let G;e[43]!==d?(G=d("sandbox.sectionRenameDialog.cancel"),e[43]=d,e[44]=G):G=e[44];let W;e[45]!==c||e[46]!==z||e[47]!==G?(W=n.jsx(Ae,{type:"button",variant:"outline",onClick:z,disabled:c,children:G}),e[45]=c,e[46]=z,e[47]=G,e[48]=W):W=e[48];let O;e[49]!==c||e[50]!==g?(O=!g.trim()||c,e[49]=c,e[50]=g,e[51]=O):O=e[51];let I;e[52]!==c||e[53]!==d?(I=c?n.jsxs(n.Fragment,{children:[n.jsx(ot,{className:"size-3.5"}),d("sandbox.sectionRenameDialog.saving")]}):d("sandbox.sectionRenameDialog.save"),e[52]=c,e[53]=d,e[54]=I):I=e[54];let D;e[55]!==O||e[56]!==I?(D=n.jsx(Ae,{type:"submit",disabled:O,children:I}),e[55]=O,e[56]=I,e[57]=D):D=e[57];let U;e[58]!==W||e[59]!==D?(U=n.jsxs(pt,{children:[W,D]}),e[58]=W,e[59]=D,e[60]=U):U=e[60];let J;e[61]!==y||e[62]!==K||e[63]!==U||e[64]!==_?(J=n.jsx(lt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:y,children:[_,K,U]})}),e[61]=y,e[62]=K,e[63]=U,e[64]=_,e[65]=J):J=e[65];let Z;return e[66]!==b||e[67]!==t||e[68]!==J?(Z=n.jsx(it,{open:t,onOpenChange:b,children:J}),e[66]=b,e[67]=t,e[68]=J,e[69]=Z):Z=e[69],Z}function Yl(s){const e=le.c(7),{type:t}=s,o=Rn[t];let a;e[0]!==o?(a=n.jsx(qe,{asChild:!0,children:n.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]=a):a=e[1];const l=t==="permanent"?"Permanent":"Temporary";let i;e[2]!==l?(i=n.jsx(We,{side:"left",children:l}),e[2]=l,e[3]=i):i=e[3];let r;return e[4]!==a||e[5]!==i?(r=n.jsxs(Ye,{children:[a,i]}),e[4]=a,e[5]=i,e[6]=r):r=e[6],r}const Ql=60,xs={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},_s=["posts","authors","categories"],Ct={posts:"post",authors:"author",categories:"category"};function st(s){return _s.includes(s)}const ns={posts:"post",authors:"author",categories:"category"},qn={posts:xs.post,authors:xs.author,categories:xs.category},Jl=Object.fromEntries(Object.entries(qn).map(([s,e])=>[e,s]));function Xl(s){return typeof s=="string"?Jl[s]??null:null}function Oe(s){return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function Y(s){return typeof s=="string"?s:""}function Zl(s,e){switch(s){case"posts":return{label:Y(e.title)||"Untitled post",subtitle:Y(e.slug),missing:os(e)};case"authors":return{label:Y(e.name)||"Unnamed author",subtitle:Y(e.email),missing:[]};case"categories":return{label:Y(e.name)||"Unnamed category",subtitle:Y(e.slug),slug:Y(e.slug),parentSlug:Y(e.parentSlug),missing:ui(e)};default:{const t=s;throw new Error(`Unhandled blog kind: ${String(t)}`)}}}function Wn(s){const e={posts:[],authors:[],categories:[]},t=[];for(const[o,a]of Object.entries(s)){const l=Oe(a);if(!l)continue;const i=Xl(l.__resolveType);if(!i)continue;const r=Oe(l[ns[i]])??{},c={key:o,kind:i,...Zl(i,r)};e[i].push(c),t.push({entry:c,key:ht(Y(r[i==="posts"?"title":"name"]))})}ei(t);for(const o of _s)e[o].sort((a,l)=>a.label.localeCompare(l.label));return e}function ei(s){const e=new Map;for(const{entry:t,key:o}of s){if(!o)continue;const a=`${t.kind}:${o}`;e.set(a,(e.get(a)??0)+1)}for(const{entry:t,key:o}of s)o&&(e.get(`${t.kind}:${o}`)??0)>1&&(t.duplicateName=!0)}function ti(s,e){return Wn(s)[e]}function Ue(s,e){return ti(s,e).map(t=>({key:t.key,payload:rt(Oe(s[t.key])??void 0,e)}))}const Zs=Object.freeze({});function rt(s,e){return s?Oe(s[ns[e]])??Zs:Zs}function ut(s,e,t){return{name:s,__resolveType:qn[e],[ns[e]]:t}}function dd({records:s,selected:e,valueField:t,toRef:o}){const a=Array.isArray(e)?e:[],l=m=>typeof m=="string"?m:Y(Oe(m)?.[t]),i=m=>typeof m=="string"?m:Y(Oe(m)?.name),r=m=>{const f=l(m),p=f?s.find(({payload:h})=>Y(h[t])===f):void 0;if(p)return p;const b=i(m);return b?s.find(({payload:h})=>Y(h.name)===b):void 0},c=s.map(({key:m,payload:f})=>({value:m,label:Y(f.name)||Y(f[t])||m})),d=new Map,g=[];return a.forEach((m,f)=>{const p=r(m);if(p){g.includes(p.key)||g.push(p.key);return}const b=`unresolved:${f}`;d.set(b,m),g.push(b),c.push({value:b,label:i(m)||l(m)||"Unknown"})}),{options:c,selectedValues:g,refsForValues:m=>m.map(f=>{const p=s.find(b=>b.key===f);return p?o(p.payload):d.get(f)}).filter(f=>f!==void 0)}}function Yn(s){return Ue(s,"authors").map(({payload:e})=>({...e,name:Y(e.name),email:Y(e.email)})).filter(e=>e.email)}function et(s){return Array.isArray(s)?s:[]}function Xe(s){if(typeof s=="string")return s;const e=Oe(s);return e?Y(e.slug):""}function Qn(s){if(typeof s=="string")return s;const e=Oe(s);return e?Y(e.email):""}const si={title:"sandbox.blogField.title",slug:"sandbox.blogField.slug",category:"sandbox.blogField.category",excerpt:"sandbox.blogField.excerpt",image:"sandbox.blogField.image",name:"sandbox.blogField.name"};function ni(s,e){return s.map(t=>e(si[t])).join(", ")}function os(s){const e=[];return Y(s.title).trim()||e.push("title"),Y(s.slug).trim()||e.push("slug"),et(s.categories).map(Xe).filter(Boolean).length===0&&e.push("category"),Y(s.excerpt).trim()||e.push("excerpt"),Y(s.image).trim()||e.push("image"),e}const As=["draft","generating","awaiting_review","scheduled","published","archived"],Jn=8;function xt(s){switch(Y(s.status)){case"draft":case"idea":return"draft";case"generating":return"generating";case"awaiting_review":case"in_review":return"awaiting_review";case"scheduled":return"scheduled";case"published":return"published";case"archived":return"archived";case"":return"published";default:return"awaiting_review"}}function ud(s){return xt(s)==="archived"}function oi(s,e){return e!=="published"&&e!=="scheduled"||xt(s)===e?!1:os(s).length>0}function ai(s){return new Date(s.getFullYear(),s.getMonth(),s.getDate()+1,Jn).toISOString()}function Ht(s,e,t){if(e!=="scheduled")return{...s,status:e,scheduledDatetime:""};const o=Y(s.scheduledDatetime);return{...s,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(o).getTime())?ai(t):o}}function Xn(s,e=po(s)){return Ue(s,"posts").map(({key:t,payload:o})=>({key:t,duplicateTitle:e.has(t),title:Y(o.title)||"Untitled post",slug:Y(o.slug),date:Y(o.date),scheduledDatetime:Y(o.scheduledDatetime),categorySlugs:et(o.categories).map(Xe).filter(Boolean),authorEmails:et(o.authors).map(Qn).filter(Boolean),missing:os(o),status:xt(o),form:"live"}))}const Zn="blog-manager/posts/";function eo(s){return s.startsWith(Zn)}function Pt(s){return s.split("/").pop()??s}function qt(s){return`${Zn}${s}`}function li(s){return`collections/blog/posts/${s}`}function vs(){return gt(12)}function ii(s){const e=Oe(s.planning)??{},t=Oe(e.format);return{ideaKey:Y(e.ideaKey)||void 0,pillarKey:Y(e.pillarKey)||void 0,pillarTitle:Y(e.pillarTitle)||void 0,format:t?{name:Y(t.name),value:Y(t.value)}:void 0,brief:Y(e.brief)||void 0}}function to(s){return{title:s.title,slug:"",excerpt:"",date:s.now.toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[],status:"draft",planning:s.planning??{}}}function ct(s,e){return{name:s,[ns.posts]:e}}function ri(s,e){return eo(s)?ct(s,e):ut(s,"posts",e)}function so(s){const e=[];for(const[t,o]of Object.entries(s)){if(!eo(t))continue;const a=Oe(o);a&&e.push({key:t,payload:rt(a,"posts")})}return e}function no(s){return[...so(s),...Ue(s,"posts")]}function ci(s){const e=po(s);return[...so(s).map(({key:o,payload:a})=>({key:o,duplicateTitle:e.has(o),title:Y(a.title)||"Untitled post",slug:Y(a.slug),date:Y(a.date),scheduledDatetime:Y(a.scheduledDatetime),categorySlugs:et(a.categories).map(Xe).filter(Boolean),authorEmails:et(a.authors).map(Qn).filter(Boolean),missing:os(a),status:xt(a),form:"planning"})),...Xn(s,e)]}function di(s,e,t){const o=Ht(s.payload,e,t),a=Pt(s.key),l=e==="scheduled"||e==="published"?"live":"planning",i=l==="live"?li(a):qt(a),r=l==="live"?ut(i,"posts",o):ct(i,o);return{writes:{[i]:r},deletes:i===s.key?[]:[s.key]}}function md(s,e,t){const o=et(s.categories);if(!o.some(c=>Xe(c)===e))return s;let a=!1;const l=o.map(c=>{const d=Xe(c);if(d!==e&&d!==t.slug)return c;const g=Oe(c);return g&&Y(g.slug)===t.slug&&Y(g.name)===t.name?c:(a=!0,{name:t.name,slug:t.slug})});if(!a){const c=o.map(Xe).filter(Boolean);if(new Set(c).size===c.length)return s}const i=new Set,r=l.filter(c=>{const d=Xe(c);return d?i.has(d)?!1:(i.add(d),!0):!0});return{...s,categories:r}}function ui(s){const e=[];return Y(s.name).trim()||e.push("name"),Y(s.slug).trim()||e.push("slug"),e}function mi(s,e){const t=et(s.categories);return t.some(o=>Xe(o)===e)?{...s,categories:t.filter(o=>Xe(o)!==e)}:s}function fd(s,e,t){return Y(s.parentSlug)!==e?s:{...s,parentSlug:t}}function fi(s){const e=Y(s.status),t=e==="idea"||e==="in_review"?{status:xt(s)}:{};return{...s,...t,dateModified:new Date().toISOString()}}function gt(s){const e=new Uint8Array(Math.ceil(s/2));return crypto.getRandomValues(e),Array.from(e,t=>t.toString(16).padStart(2,"0")).join("").slice(0,s)}function bs(s,e){const t=`collections/blog/${e}/${gt(12)}`;if(!Object.hasOwn(s,t))return t;throw new Error("Could not generate a unique blog block key")}function oo(s){switch(s){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:"",url:"",avatar:""};case"categories":return{name:"New category",slug:`category-${gt(8)}`,description:"",sections:[]};default:{const e=s;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const pi={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"}},en="Box";function ao(s){return s.startsWith("site/")?"site":"app"}function gi(s){return s.startsWith("http://")||s.startsWith("https://")||s.startsWith("data:")||s.startsWith("/")}function jt(...s){for(const e of s)if(e!==void 0)return e}function tn(s){if(s&&!(s.includes("/")||/\.(tsx?|jsx?)$/.test(s)))return s}function hi(s){const e=s.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim();return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():s}function xi(s,e){const t=Ps(s,e),o=as(s),a=pi[o],l=ao(s),i=tn(t.title),r=tn(t.description),c=(l==="site"?jt(i,a?.title):jt(a?.title,i))??hi(o),d=l==="site"?jt(r,a?.description):jt(a?.description,r),g=l==="site"?t.icon:void 0,u=g&&gi(g)?g:void 0,m=u!==void 0?a?.iconName??en:jt(g,a?.iconName)??en;return{resolveType:s,title:c,description:d,iconName:m,iconUrl:u,source:l}}function lo(s,{hideDefaults:e=!1}={}){const t=new Set,o=[],a=s.manifest?.blocks??{};for(const l of Object.values(a))for(const i of Object.keys(l))!yi(i)||t.has(i)||e&&ao(i)==="app"||(t.add(i),o.push(xi(i,s)));return o.sort((l,i)=>l.title.localeCompare(i.title))}function as(s){return(s.split("/").pop()??s).replace(/\.(tsx?|jsx?)$/,"")}const bi=["blog/sections/blocks/","site/sections/Blog/Post/"];function yi(s){return bi.some(e=>s.startsWith(e))}const Ls="blog-manager-brand";function ze(s){if(!Array.isArray(s))return[];const e=[];for(const t of s){if(typeof t=="string"){t.trim()&&e.push({name:t,value:""});continue}const o=Oe(t);o&&e.push({name:Y(o.name),value:Y(o.value)})}return e}function Ve(s){return s.filter(e=>e.name.trim()||e.value.trim())}const vi=6e4,ji=4e3;function ki(s){const e=[],t=new Set,o=(a,l)=>{if(typeof a=="string"){if(!a.includes(" ")||a.length<4||/^(https?:)?\/\//.test(a)||/^data:/.test(a))return;const i=`${l}: ${a.trim()}`;if(t.has(i))return;t.add(i),e.push(i);return}if(Array.isArray(a)){for(const i of a)o(i,l);return}if(a&&typeof a=="object")for(const[i,r]of Object.entries(a))i!=="__resolveType"&&o(r,i)};return o(s,"block"),e.join(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-COtME4c7.js","assets/index-OBKgoLrS.js","assets/index-Cj9p5mwA.css","assets/chat-context-DVCvFwd3.js","assets/use-panel-navigate-CRJv_Vri.js","assets/thread-route-elF7W4D7.js","assets/use-project-scope-C7BcZz2G.js","assets/repository-binding-BXNOickW.js","assets/use-mcp-client-BLH9AyVn.js","assets/auth-Bj6m-efj.js","assets/autosend-Bo0qMh1p.js","assets/thread-intent-Dk0A6ZtT.js","assets/backoff-8mStPHYB.js","assets/task-board-BzFCmVqC.js","assets/schema-EK91AuqK.js","assets/slugify-CEUa2lfQ.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-decopilot-events-PV6rJUEO.js","assets/use-ai-providers-DeSnAgnd.js","assets/location-DPIrGNp7.js","assets/use-organization-settings-HU4xq5ST.js","assets/scroll-area-CGd0e1tw.js","assets/select-BhJ8bhDe.js","assets/index-BnsOjLj5.js","assets/Check-BmlrCmw2.js","assets/ChevronUp-6u3SxMoQ.js","assets/use-section-preview-base-D8KaMaNX.js","assets/UserSquare-COhFlYGn.js","assets/agent-icon-Cy4Knhmf.js","assets/AlertCircle-SZjuoMGZ.js","assets/Tool01-bUbUk8P7.js","assets/ArrowUp-CwQ1Q4VU.js","assets/ArrowLeft-BgUASx7T.js","assets/LinkBroken01-Br_uH__F.js","assets/ShoppingBag01-b6nsxdpv.js","assets/ZoomOut-FmWelmyS.js","assets/Building02-Dl4T9LNW.js","assets/CheckCircle-DgPqabhN.js","assets/Copy01-CkifUnly.js","assets/CreditCard01-K1-aiN4b.js","assets/DotsVertical-DmnxoC5N.js","assets/Image01-0yU0yxN3.js","assets/Palette-TILTwgWi.js","assets/XClose-KiYAVi9i.js","assets/Key01-CUdVlBTP.js","assets/Link01-7z-hjzg6.js","assets/LinkExternal01-DvsbzHx1.js","assets/Monitor01-DQFu-UId.js","assets/Sun-CJnoMxxW.js","assets/Plus-Cn427okX.js","assets/SearchMd-Pjthnah9.js","assets/Trash01-CuygCR6g.js","assets/Upload01-XLRbUIeR.js","assets/User01-CVYpMQND.js","assets/Users01-pRhNWrqE.js","assets/X-C5Ha4Ozq.js","assets/dialog-BI1xJ9QE.js","assets/input-Kws07Y5R.js","assets/use-new-blocks-editor-Dt6P6iFj.js","assets/claim-phase-copy-yqhsaXjf.js","assets/section-preview-url-7zfngvgW.js","assets/use-session-runtime-C3g9swZ6.js","assets/runnable-block-editor-CEeBI7Ji.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-BtqMUvq4.js","assets/format-time-CjIPQhCN.js","assets/differenceInSeconds-C3x8sHUj.js","assets/collapsible-BhnvXHYQ.js","assets/use-copy-C60AwJfN.js","assets/usage-stats-BGChWuhD.js","assets/markdown-DNNvyUFL.js","assets/org-file-open-context-BosMDtdb.js","assets/use-mobile-VzbSoGMr.js","assets/tooltip-B7_4-yXG.js","assets/use-clock-tick-C5v7xKB3.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-Bvvl0FWT.js","assets/types-co2Ht9Mj.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/gateway-client-DLwMoVSk.js","assets/tool-namespace-DmnQIdtF.js","assets/utils-CVEq3hMx.js","assets/shell-layout-DG1i0o3w.js","assets/avatar-s9hDkne5.js","assets/download-app-dialog-D_tAj3wC.js","assets/command-8n8txvgK.js","assets/index-Co0BO1QR.js","assets/integration-icon-D2va06Ai.js","assets/project-icon-DFU40NC2.js","assets/new-project-dialog-BXg1Q86m.js","assets/label-BsArcFBD.js","assets/repository-import-picker-Tdhv79ml.js","assets/use-navigate-to-agent-DC1x2gVp.js","assets/repository-picker-PURciVL4.js","assets/useInfiniteQuery-DsKCSoLS.js","assets/infiniteQueryObserver-Bysh3DKm.js","assets/collection-search-BXjiZfAv.js","assets/use-debounced-value-8t15K3Ro.js","assets/required-auth-layout-D2VAA74b.js","assets/use-org-sso-pd_XhDQs.js","assets/shell-layout-CE2Eihra.css","assets/sheet-Bogqpryv.js","assets/use-connection-CldQc5wk.js","assets/use-mcp-prompts-Dn5An3ZZ.js","assets/index-yiQcNbRY.js","assets/form-DBZy3h_k.js","assets/use-thread-outputs-COXL75K0.js","assets/file-type-icon---8xc9A3.js","assets/popover-Cb13NGPe.js","assets/utils-BdWBNy3y.js","assets/monaco-editor-0FKvs3m8.js","assets/editor-MmTYGWbR.js","assets/calendar-DJKbaXkW.js","assets/textarea-Cat7zkJf.js","assets/rich-text-link-control-B2JcdNT_.js","assets/switch-CBzf58ch.js","assets/combobox-kDUiEF-N.js","assets/alert-dialog-BNhkZQ_x.js","assets/sandbox-url-D3mC8qhT.js","assets/search-input-Z6QSPnUN.js","assets/tabs-8xIz4UtP.js","assets/use-file-configs-Cb37DNRD.js","assets/asset-utils-B80sbnEy.js","assets/use-chat-layout-state-Che4U26N.js","assets/site-slug-DebpOoQq.js","assets/toggle-group-B9Z8QVLn.js","assets/sandbox-git-api-DTIjDZTr.js","assets/agent-view-guard-D5KfTxlv.js","assets/use-main-panel-tabs-Dlf1NeW3.js","assets/use-mcp-tools-Dvd6qKab.js","assets/index-CS9Lxig6.js","assets/drawer-C_V65MTv.js","assets/input-CcBq0Qtl.js","assets/chat-draft-CJgB-tPy.js","assets/use-deco-credits-odXtC5vU.js","assets/use-open-billing-url-CqWGNwIl.js","assets/decopilot-YF_T6wlZ.js","assets/checkbox-DUCWAAon.js","assets/ai-providers-logos-DD3qZ33J.js","assets/index-By8xil-d.js","assets/input-xNv48kMp.js","assets/suggestion-hd077eb-.js","assets/use-org-fs-CAxytlY9.js","assets/question-004-sINsf4GQ.js","assets/use-members-Bs-9PW58.js","assets/use-org-auth-client-BwlmPJlb.js","assets/feature-paywall-DWdxE8g5.js","assets/plan-ladder-2SN6IZxx.js","assets/add-connection-dialog-GjKD1wTC.js","assets/extract-connection-data-BphfLFqb.js","assets/metadata-D72DunRR.js","assets/connection-MWqOhcq1.js","assets/connection-card-BqicHzqi.js","assets/connection-slug-CITJ0kGN.js","assets/connection-form-helpers-c3p1hlVt.js","assets/authenticate-and-persist-oauth-BWVpVcAz.js","assets/mcp-oauth-3C0PcQv6.js","assets/collection-tabs-BulYWegd.js","assets/badge-BbvQ8-kh.js","assets/use-infinite-scroll-CUV2ONAi.js","assets/useSuspenseInfiniteQuery-D4CsLbSw.js","assets/use-task-board-events-UNKoOCA_.js","assets/input-Bwd_JSM8.css","assets/sandbox-lifecycle-context-D9pUeLC3.js","assets/resolve-tab-icon-vYim2A6S.js","assets/use-task-metadata-Db3_7a5j.js","assets/virtual-mcp-CRDba5ev.js","assets/feature-gate-B_eK5iBD.js","assets/mustache-R5ZIENHD.js","assets/empty-state-DdqIwUzh.js","assets/empty-state-CcAOCIdu.js","assets/post-editor-_9DsSzJD.js","assets/multi-select-CsrBGXiU.js","assets/block-document-DF2zCbSa.js","assets/index-BlUUh9y1.js","assets/blog-schema-CsdFUd69.js","assets/use-fast-preview-draft-url-DhkmOrTf.js","assets/use-autosave-CPw75416.js","assets/record-editor-B0H5WqkE.js","assets/context-D0fXSS45.js","assets/index-BBLsGP5X.js","assets/get-initials-D-f_fDFw.js","assets/icon-button-DJOiw-b_.js","assets/category-editor-B8R6lxvV.js","assets/sections-editor-BzSi4RpW.js","assets/page-seo-form-B7zbvDL2.js","assets/variant-matcher-override-CffNE4hW.js","assets/seo-editor-CbZ5Ttz-.js","assets/variant-calendar-COGidEDl.js","assets/view-mode-toggle-EBcGWFvm.js","assets/post-calendar-RlXieGQw.js","assets/redirect-editor-Bi6rLeHR.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as le,b as je,j as n,m as Do,K as ys,l as ye,r as A,h as ot,B as Ae,o as _o,e as Ao,t as me,a2 as ks,aF as wt,aN as yt,F as Kt,aG as Is,H as zt,I as Mt,aA as Lo,G as Je,ak as Vt,al as fs,ag as $o,X as Oo,u as vn,aL as Qe}from"./index-OBKgoLrS.js";import{A as Ro}from"./agent-view-guard-D5KfTxlv.js";import{F as Fo}from"./feature-gate-B_eK5iBD.js";import{u as Xt,b as jn}from"./chat-context-DVCvFwd3.js";import{i as Tt}from"./AlertCircle-SZjuoMGZ.js";import{K as Io,W as kn,X as nt,Y as Sn,Z as Ss,_ as Ko,$ as wn,a0 as zo,b as Gt,R as Nn,a1 as Mo,a2 as Vo,a3 as Nt,a4 as Go,a5 as Uo,n as Ho,a6 as Cn,a7 as qo,a8 as Wo,a9 as Yo,h as Ks,aa as Qo,I as Pn}from"./agent-icon-Cy4Knhmf.js";import{a as Tn,i as ws,d as Jo,e as zs}from"./UserSquare-COhFlYGn.js";import{b as Bn,i as En}from"./ZoomOut-FmWelmyS.js";import{c as Dn,i as Xo}from"./XClose-KiYAVi9i.js";import{s as Ns}from"./Plus-Cn427okX.js";import{t as _n}from"./Users01-pRhNWrqE.js";import{f as Zo,e as ea,b as ta,A as sa,a as na,d as oa,c as aa,g as la}from"./alert-dialog-BNhkZQ_x.js";import{S as Zt}from"./scroll-area-CGd0e1tw.js";import{T as qe,a as We,b as Ye}from"./tooltip-B7_4-yXG.js";import{B as mt}from"./badge-BbvQ8-kh.js";import{S as ps,k as ia,c as ra,g as An,B as gs,P as ca,h as da,n as ua,s as ma,i as Ms,u as es,l as fa,o as pa,R as ga,q as Ln,r as ha,t as xa,d as $n,v as ba,w as ya,x as On,y as va,M as ja,j as ka,z as Sa,p as wa,A as Na,C as Ca,e as Pa,f as Ta,D as Vs}from"./runnable-block-editor-CEeBI7Ji.js";import{r as Cs,S as Ba,t as Ps,i as Ea,w as Da,x as _a,n as Ft,v as Aa,R as Rn,u as La,y as $a,q as Oa,z as Ra,A as Fa,B as Gs,G as Ts,g as Ia,E as Ka,j as Us,F as za,k as Ma,H as Va,I as Hs,h as Ga,J as Fn,m as Ua,K as Ha,L as qa,M as Wa}from"./claim-phase-copy-yqhsaXjf.js";import{u as Ya,P as Qa}from"./mustache-R5ZIENHD.js";import{n as In}from"./ShoppingBag01-b6nsxdpv.js";import{t as Bt}from"./ChevronUp-6u3SxMoQ.js";import{C as Ja,a as Xa,b as Za}from"./collapsible-BhnvXHYQ.js";import{c as el,d as tl}from"./sandbox-lifecycle-context-D9pUeLC3.js";import{u as Kn}from"./use-session-runtime-C3g9swZ6.js";import{c as ft,d as at,e as pt,b as lt,D as it,h as Ut,a as sl}from"./dialog-BI1xJ9QE.js";import{I as Ze}from"./input-Kws07Y5R.js";import{C as ts}from"./checkbox-DUCWAAon.js";import{L as Me}from"./label-BsArcFBD.js";import{c as nl,b as ol,a as al,d as ll,S as il}from"./select-BhJ8bhDe.js";import{t as rl}from"./sandbox-git-api-DTIjDZTr.js";import{b as qs}from"./sandbox-url-D3mC8qhT.js";import{a as Ws}from"./utils-BdWBNy3y.js";import{i as cl}from"./CheckCircle-DgPqabhN.js";import{a as Bs}from"./Copy01-CkifUnly.js";import{s as Es}from"./Trash01-CuygCR6g.js";import{i as hs}from"./Upload01-XLRbUIeR.js";import{E as dl}from"./empty-state-DdqIwUzh.js";import{T as It}from"./textarea-Cat7zkJf.js";import{a as ul}from"./use-organization-settings-HU4xq5ST.js";import{u as ml}from"./use-ai-providers-DeSnAgnd.js";import{M as zn}from"./monaco-editor-0FKvs3m8.js";import{i as Ds}from"./X-C5Ha4Ozq.js";import{c as Mn,a as fl}from"./repository-binding-BXNOickW.js";import"./rich-text-link-control-B2JcdNT_.js";import{c as pl}from"./Tool01-bUbUk8P7.js";import{b as Ys}from"./use-project-scope-C7BcZz2G.js";import{E as gl}from"./empty-state-CcAOCIdu.js";import{G as Qs}from"./repository-picker-PURciVL4.js";import{R as hl}from"./repository-import-picker-Tdhv79ml.js";import{b as xl}from"./thread-route-elF7W4D7.js";function bl(s){const e=le.c(18),{title:t,description:o,children:a}=s,l=je();let i;e[0]!==a?(i=n.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none h-full select-none overflow-hidden",children:a}),e[0]=a,e[1]=i):i=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Io,{}),e[2]=r):r=e[2];let c;e[3]!==l?(c=l("common.soon"),e[3]=l,e[4]=c):c=e[4];let d;e[5]!==c?(d=n.jsxs(mt,{variant:"secondary",children:[r,c]}),e[5]=c,e[6]=d):d=e[6];let g;e[7]!==t?(g=n.jsx("p",{className:"text-base font-semibold text-foreground",children:t}),e[7]=t,e[8]=g):g=e[8];let u;e[9]!==o?(u=o&&n.jsx("p",{className:"text-sm text-muted-foreground",children:o}),e[9]=o,e[10]=u):u=e[10];let m;e[11]!==d||e[12]!==g||e[13]!==u?(m=n.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-background/60 p-6 backdrop-blur-sm",children:n.jsxs("div",{className:"flex max-w-sm flex-col items-center gap-3 rounded-2xl border bg-card px-8 py-6 text-center shadow-lg",children:[d,g,u]})}),e[11]=d,e[12]=g,e[13]=u,e[14]=m):m=e[14];let f;return e[15]!==i||e[16]!==m?(f=n.jsxs("div",{className:"relative h-full min-h-0",children:[i,m]}),e[15]=i,e[16]=m,e[17]=f):f=e[17],f}function yl(s,e){if(!s||!e?.length)return s;const t=Object.fromEntries(Object.entries(s.properties??{}).filter(([o])=>!e.includes(o)));return Object.keys(t).length>0?{...s,properties:t}:s}function vl(s,e,t){return typeof s!="string"?null:yl(Cs(s,e),t)}function Vn(s,e,t){if(!e||typeof s!="string")return!1;const o=vl(s,e,t);return!!o&&Object.keys(o.properties??{}).length>0}function vt(s){const e=le.c(6),{hasItems:t,emptyLabel:o,emptyHint:a}=s;let l;e[0]!==a||e[1]!==o||e[2]!==t?(l=t?"No results match your search.":n.jsxs(n.Fragment,{children:[n.jsx("div",{children:o}),n.jsx("div",{className:"mt-1 text-muted-foreground/80",children:a})]}),e[0]=a,e[1]=o,e[2]=t,e[3]=l):l=e[3];let i;return e[4]!==l?(i=n.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 ss(s,e){return`${s}-${e}`}function Gn(s,e){return`site/apps/${s}/${e}.ts`}function Un(s){const e=s.match(/^site\/apps\/([^/]+)\/([^/.]+)\.tsx?$/);if(e)return{vendor:e[1],app:e[2]};const t=s.match(/^([^/]+)\/apps\/([^/.]+)\.tsx?$/);return t?{vendor:t[1],app:t[2]}:null}function jl(s){const e=s.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function kl(s){return s==="local"?"Custom":"Installed"}function Hn(s,e,t){const o=new Set([ss(s,e),e].map(l=>l.toLowerCase())),a=Gn(s,e);for(const[l,i]of Object.entries(t)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const r=i;if(o.has(l.toLowerCase())||r.__resolveType===a)return l}return null}function Sl(s,e){const t=s.vendor.alias,o=s.name,a=Hn(t,o,e);return{id:ss(t,o),app:o,vendor:t,title:s.title||s.name,description:s.description,category:s.category??"Other",logo:s.logo||void 0,resolveType:Gn(t,o),blockKey:a,installed:a!==null}}function wl(s,e,t){if(s===Ba)return null;const o=Un(s);if(!o)return null;const{vendor:a,app:l}=o,i=Hn(a,l,t),r=Ps(s,e);return{id:ss(a,l),app:l,vendor:a,title:r.title??l,description:r.description??"",category:"Others",logo:r.logo??r.icon,resolveType:s,blockKey:i,installed:i!==null}}function Nl(s,e,t){const o=e.__resolveType;if(typeof o!="string"||Ea(s,e)||!Da(o))return null;const a=Un(o)??jl(s);if(!a)return null;const l=Ps(o,t),{vendor:i,app:r}=a;return{id:ss(i,r),app:r,vendor:i,title:l.title??_a(s,e,t),description:l.description??"",category:kl(i),logo:l.logo??l.icon,resolveType:o,blockKey:s,installed:!0}}function Cl(s,e,t){const o=new Map;for(const l of s){const i=Sl(l,t);o.set(i.id,i)}const a=e.manifest?.blocks?.apps??{};for(const l of Object.keys(a)){const i=wl(l,e,t);!i||o.has(i.id)||o.set(i.id,i)}for(const[l,i]of Object.entries(t)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const r=Nl(l,i,e);!r||o.has(r.id)||o.set(r.id,r)}return[...o.values()].sort(Pl)}function Pl(s,e){return s.installed!==e.installed?s.installed?-1:1:s.title.localeCompare(e.title)}async function Tl(){const s=await fetch("/api/deco-apps");if(!s.ok)throw new Error(`Failed to fetch deco apps: ${s.status}`);return(await s.json()).apps??[]}function Bl(s,e,t){const o=le.c(12),a=t?.enabled??!0;let l;o[0]===Symbol.for("react.memo_cache_sentinel")?(l=ys.decoApps(),o[0]=l):l=o[0];let i;o[1]!==a?(i={queryKey:l,queryFn:Tl,staleTime:3e5,retry:1,enabled:a},o[1]=a,o[2]=i):i=o[2];const r=Do(i);let c;o[3]!==e||o[4]!==s||o[5]!==r.data?(c=s&&e?Cl(r.data??[],s,e):[],o[3]=e,o[4]=s,o[5]=r.data,o[6]=c):c=o[6];const d=c,g=r.isLoading&&!r.isError;let u;return o[7]!==d||o[8]!==r.isError||o[9]!==r.refetch||o[10]!==g?(u={catalog:d,isLoading:g,isError:r.isError,refetch:r.refetch},o[7]=d,o[8]=r.isError,o[9]=r.refetch,o[10]=g,o[11]=u):u=o[11],u}const El=["sections","apps","loaders","actions"];function Dl(s){const e=le.c(59),{active:t,counts:o,showBlog:a,onSelect:l}=s,i=je();let r;e[0]!==i?(r=i("sandbox.collectionsSidebar.content"),e[0]=i,e[1]=r):r=e[1];let c;e[2]!==r?(c=n.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:n.jsx("span",{className:"text-sm font-medium",children:r})}),e[2]=r,e[3]=c):c=e[3];let d;e[4]!==i?(d=i("sandbox.collectionsSidebar.pages"),e[4]=i,e[5]=d):d=e[5];const g=t==="pages";let u;e[6]!==o.pages||e[7]!==l||e[8]!==d||e[9]!==g?(u=n.jsx(Fe,{id:"pages",icon:Tn,label:d,count:o.pages,active:g,onSelect:l}),e[6]=o.pages,e[7]=l,e[8]=d,e[9]=g,e[10]=u):u=e[10];let m;e[11]!==i?(m=i("sandbox.collectionsSidebar.redirects"),e[11]=i,e[12]=m):m=e[12];const f=t==="redirects";let p;e[13]!==o.redirects||e[14]!==l||e[15]!==m||e[16]!==f?(p=n.jsx(Fe,{id:"redirects",icon:kn,label:m,count:o.redirects,active:f,onSelect:l}),e[13]=o.redirects,e[14]=l,e[15]=m,e[16]=f,e[17]=p):p=e[17];let b;e[18]!==i?(b=i("sandbox.collectionsSidebar.site"),e[18]=i,e[19]=b):b=e[19];const h=t==="site";let y;e[20]!==l||e[21]!==h||e[22]!==b?(y=n.jsx(Fe,{id:"site",icon:Ko,label:b,active:h,onSelect:l}),e[20]=l,e[21]=h,e[22]=b,e[23]=y):y=e[23];let j;e[24]!==i?(j=i("sandbox.collectionsSidebar.seo"),e[24]=i,e[25]=j):j=e[25];const k=t==="seo";let S;e[26]!==l||e[27]!==j||e[28]!==k?(S=n.jsx(Fe,{id:"seo",icon:wn,label:j,active:k,onSelect:l}),e[26]=l,e[27]=j,e[28]=k,e[29]=S):S=e[29];let w;e[30]!==i?(w=i("sandbox.collectionsSidebar.calendar"),e[30]=i,e[31]=w):w=e[31];const _=t==="calendar";let E;e[32]!==l||e[33]!==w||e[34]!==_?(E=n.jsx(Fe,{id:"calendar",icon:zo,label:w,active:_,onSelect:l}),e[32]=l,e[33]=w,e[34]=_,e[35]=E):E=e[35];let N;e[36]!==t||e[37]!==o||e[38]!==l?(N=n.jsx(_l,{active:t,counts:o,onSelect:l}),e[36]=t,e[37]=o,e[38]=l,e[39]=N):N=e[39];let B;e[40]!==t||e[41]!==o.authors||e[42]!==o.categories||e[43]!==o.posts||e[44]!==l||e[45]!==a||e[46]!==i?(B=a&&n.jsxs(n.Fragment,{children:[n.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:[n.jsx(In,{size:13,className:"shrink-0"}),i("sandbox.collectionsSidebar.blog")]}),n.jsx(Fe,{id:"context",icon:nt,label:i("sandbox.collectionsSidebar.context"),active:t==="context",onSelect:l}),n.jsx(Fe,{id:"posts",icon:Bn,label:i("sandbox.collectionsSidebar.posts"),count:o.posts,active:t==="posts",onSelect:l}),n.jsx(Fe,{id:"authors",icon:_n,label:i("sandbox.collectionsSidebar.authors"),count:o.authors,active:t==="authors",onSelect:l}),n.jsx(Fe,{id:"categories",icon:Sn,label:i("sandbox.collectionsSidebar.categories"),count:o.categories,active:t==="categories",onSelect:l}),n.jsx(Fe,{id:"post-schedule",icon:Ss,label:i("sandbox.collectionsSidebar.postSchedule"),active:t==="post-schedule",onSelect:l})]}),e[40]=t,e[41]=o.authors,e[42]=o.categories,e[43]=o.posts,e[44]=l,e[45]=a,e[46]=i,e[47]=B):B=e[47];let R;e[48]!==y||e[49]!==S||e[50]!==E||e[51]!==N||e[52]!==B||e[53]!==u||e[54]!==p?(R=n.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[u,p,y,S,E,N,B]}),e[48]=y,e[49]=S,e[50]=E,e[51]=N,e[52]=B,e[53]=u,e[54]=p,e[55]=R):R=e[55];let L;return e[56]!==c||e[57]!==R?(L=n.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[c,R]}),e[56]=c,e[57]=R,e[58]=L):L=e[58],L}function _l(s){const e=le.c(52),{active:t,counts:o,onSelect:a}=s,l=je();let i;e[0]!==t?(i=El.includes(t),e[0]=t,e[1]=i):i=e[1];const r=i,[c,d]=A.useState(!1),g=c||r;let u,m;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=ye("flex w-full items-center gap-2 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"),m=n.jsx(Mo,{size:16,className:"shrink-0"}),e[2]=u,e[3]=m):(u=e[2],m=e[3]);let f;e[4]!==l?(f=l("sandbox.collectionsSidebar.advanced"),e[4]=l,e[5]=f):f=e[5];let p;e[6]!==f?(p=n.jsx("span",{className:"flex-1 truncate",children:f}),e[6]=f,e[7]=p):p=e[7];const b=g&&"rotate-180";let h;e[8]!==b?(h=ye("shrink-0 text-muted-foreground/70 transition-transform",b),e[8]=b,e[9]=h):h=e[9];let y;e[10]!==h?(y=n.jsx(Bt,{size:16,className:h}),e[10]=h,e[11]=y):y=e[11];let j;e[12]!==p||e[13]!==y?(j=n.jsxs(Ja,{className:u,children:[m,p,y]}),e[12]=p,e[13]=y,e[14]=j):j=e[14];let k;e[15]!==l?(k=l("sandbox.collectionsSidebar.sections"),e[15]=l,e[16]=k):k=e[16];const S=t==="sections";let w;e[17]!==o.sections||e[18]!==a||e[19]!==k||e[20]!==S?(w=n.jsx(Fe,{id:"sections",icon:Gt,label:k,count:o.sections,active:S,onSelect:a,indent:!0}),e[17]=o.sections,e[18]=a,e[19]=k,e[20]=S,e[21]=w):w=e[21];let _;e[22]!==l?(_=l("sandbox.collectionsSidebar.apps"),e[22]=l,e[23]=_):_=e[23];const E=t==="apps";let N;e[24]!==o.apps||e[25]!==a||e[26]!==_||e[27]!==E?(N=n.jsx(Fe,{id:"apps",icon:Dn,label:_,count:o.apps,active:E,onSelect:a,indent:!0}),e[24]=o.apps,e[25]=a,e[26]=_,e[27]=E,e[28]=N):N=e[28];let B;e[29]!==l?(B=l("sandbox.collectionsSidebar.loaders"),e[29]=l,e[30]=B):B=e[30];const R=t==="loaders";let L;e[31]!==o.loaders||e[32]!==a||e[33]!==B||e[34]!==R?(L=n.jsx(Fe,{id:"loaders",icon:Nn,label:B,count:o.loaders,active:R,onSelect:a,indent:!0}),e[31]=o.loaders,e[32]=a,e[33]=B,e[34]=R,e[35]=L):L=e[35];let M;e[36]!==l?(M=l("sandbox.collectionsSidebar.actions"),e[36]=l,e[37]=M):M=e[37];const F=t==="actions";let T;e[38]!==o.actions||e[39]!==a||e[40]!==M||e[41]!==F?(T=n.jsx(Fe,{id:"actions",icon:En,label:M,count:o.actions,active:F,onSelect:a,indent:!0}),e[38]=o.actions,e[39]=a,e[40]=M,e[41]=F,e[42]=T):T=e[42];let $;e[43]!==w||e[44]!==N||e[45]!==L||e[46]!==T?($=n.jsxs(Xa,{className:"flex flex-col gap-0.5 pt-0.5",children:[w,N,L,T]}),e[43]=w,e[44]=N,e[45]=L,e[46]=T,e[47]=$):$=e[47];let K;return e[48]!==g||e[49]!==$||e[50]!==j?(K=n.jsxs(Za,{open:g,onOpenChange:d,children:[j,$]}),e[48]=g,e[49]=$,e[50]=j,e[51]=K):K=e[51],K}function Fe(s){const e=le.c(19),{id:t,icon:o,label:a,count:l,active:i,onSelect:r,indent:c}=s;let d;e[0]!==t||e[1]!==r?(d=()=>r(t),e[0]=t,e[1]=r,e[2]=d):d=e[2];const g=c&&"pl-6",u=i?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let m;e[3]!==g||e[4]!==u?(m=ye("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",g,u),e[3]=g,e[4]=u,e[5]=m):m=e[5];let f;e[6]!==o?(f=n.jsx(o,{size:16,className:"shrink-0"}),e[6]=o,e[7]=f):f=e[7];let p;e[8]!==a?(p=n.jsx("span",{className:"flex-1 truncate",children:a}),e[8]=a,e[9]=p):p=e[9];let b;e[10]!==i||e[11]!==l?(b=l!==void 0&&n.jsx("span",{className:ye("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]=b):b=e[12];let h;return e[13]!==d||e[14]!==m||e[15]!==f||e[16]!==p||e[17]!==b?(h=n.jsxs("button",{type:"button",onClick:d,className:m,children:[f,p,b]}),e[13]=d,e[14]=m,e[15]=f,e[16]=p,e[17]=b,e[18]=h):h=e[18],h}function Al(s){const e=le.c(12),{state:t,claimPhase:o,lifecycle:a,onStart:l,connectionsHref:i}=s;switch(t.kind){case"starting":{let r;e[0]!==o||e[1]!==a?(r=ia({claimPhase:o,lifecycle:a}),e[0]=o,e[1]=a,e[2]=r):r=e[2];let c;return e[3]!==o||e[4]!==r?(c=n.jsx(ps,{kind:"starting",progress:r,claimPhase:o}),e[3]=o,e[4]=r,e[5]=c):c=e[5],c}case"suspended":{let r;return e[6]!==l?(r=n.jsx(ps,{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]!==t.error?(r=n.jsx(ps,{kind:"errored",error:t.error,onRetry:l,connectionsHref:i}),e[8]=i,e[9]=l,e[10]=t.error,e[11]=r):r=e[11],r}}}const Ll=new Set(["clone-failed","install-failed","start-failed","crashed"]);function $l(s){if(s.fastPreviewActive)return{kind:"ready",devServerReady:!1,sandboxWarming:!1};if(s.previewState.kind!=="iframe")return{kind:"sandbox-card",state:s.previewState};const e=s.lifecyclePhase==="running",t=!e&&!Ll.has(s.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:t}}function Js(s,e){const t=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),o=`${t} (copy)`;if(!s.has(o))return o;for(let a=2;a<1e3;a++){const l=`${t} (copy ${a})`;if(!s.has(l))return l}return`${t} (copy ${Date.now()})`}function Ol(s,e){const t=Ft,o=e.replace(/-copy(?:-\d+)?$/,""),a=`${o}-copy`;if(!s.has(t(a)))return a;for(let l=2;l<1e3;l++){const i=`${o}-copy-${l}`;if(!s.has(t(i)))return i}return`${o}-copy-${Date.now()}`}function Rl(s,e){const t=e.replace(/_copy(?:_\d+)?$/,""),o=`${t}_copy`;if(!Object.hasOwn(s,o))return o;for(let a=2;a<1e3;a++){const l=`${t}_copy_${a}`;if(!Object.hasOwn(s,l))return l}return`${t}_copy_${Date.now()}`}function Fl(s){const e=An(s.newName),t={...s.source,name:s.newName,path:s.newPath};return{key:e,data:t}}function Il(s,e){return ra(s,e)}const Kl=1e3;function zl(s,e){for(let t=0;t<Kl;t++){const o=An(e);if(!Object.hasOwn(s,o))return o}throw new Error("Could not generate a unique page block key")}const Ml={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},Vl={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},Gl={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function Ul(s){const e=le.c(88),{open:t,mode:o,initialName:a,initialPath:l,isPending:i,error:r,templates:c,validate:d,onSubmit:g,onOpenChange:u}=s,m=i===void 0?!1:i,f=je(),[p,b]=A.useState(a),[h,y]=A.useState(l),[j,k]=A.useState(gs),[S,w]=A.useState(null),[_,E]=A.useState(t);t!==_&&(E(t),t&&(b(a),y(l),k(gs),w(null)));const N=o==="create"&&!!c?.length;let B;e[0]!==m||e[1]!==u?(B=ge=>{!ge&&!m&&(w(null),u(!1))},e[0]=m,e[1]=u,e[2]=B):B=e[2];const R=B;let L;e[3]!==m||e[4]!==p||e[5]!==g||e[6]!==h||e[7]!==N||e[8]!==j||e[9]!==d?(L=async ge=>{ge.preventDefault();const ve=p.trim(),he=h.trim();if(!ve||!he||m)return;const De=Aa(he);if(De){w(De);return}const ke=d?.({name:ve,path:he});if(ke){w(ke);return}w(null),await g({name:ve,path:he,templateKey:N&&j!==gs?j:null})},e[3]=m,e[4]=p,e[5]=g,e[6]=h,e[7]=N,e[8]=j,e[9]=d,e[10]=L):L=e[10];const M=L,F=S??r,T=Ml[o];let $;e[11]!==f||e[12]!==T?($=f(T),e[11]=f,e[12]=T,e[13]=$):$=e[13];let K;e[14]!==$?(K=n.jsx(ft,{children:n.jsx(at,{children:$})}),e[14]=$,e[15]=K):K=e[15];let z;e[16]!==m||e[17]!==N||e[18]!==f||e[19]!==j||e[20]!==c?(z=N&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("label",{htmlFor:"page-form-template",className:"text-xs font-medium text-muted-foreground",children:f("sandbox.pageFormDialog.labelTemplate")}),n.jsx(ca,{id:"page-form-template",value:j,onChange:k,templates:c??[],disabled:m})]}),e[16]=m,e[17]=N,e[18]=f,e[19]=j,e[20]=c,e[21]=z):z=e[21];let G;e[22]!==f?(G=f("sandbox.pageFormDialog.labelName"),e[22]=f,e[23]=G):G=e[23];let W;e[24]!==G?(W=n.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:G}),e[24]=G,e[25]=W):W=e[25];let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=ge=>b(ge.target.value),e[26]=O):O=e[26];let I;e[27]!==f?(I=f("sandbox.pageFormDialog.placeholderName"),e[27]=f,e[28]=I):I=e[28];let D;e[29]!==m||e[30]!==p||e[31]!==I?(D=n.jsx(Ze,{id:"page-form-name",value:p,onChange:O,placeholder:I,autoFocus:!0,disabled:m}),e[29]=m,e[30]=p,e[31]=I,e[32]=D):D=e[32];let U;e[33]!==D||e[34]!==W?(U=n.jsxs("div",{className:"space-y-1.5",children:[W,D]}),e[33]=D,e[34]=W,e[35]=U):U=e[35];let J;e[36]!==f?(J=f("sandbox.pageFormDialog.labelPath"),e[36]=f,e[37]=J):J=e[37];let Z;e[38]!==J?(Z=n.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:J}),e[38]=J,e[39]=Z):Z=e[39];let oe;e[40]===Symbol.for("react.memo_cache_sentinel")?(oe=ge=>y(ge.target.value),e[40]=oe):oe=e[40];let ae;e[41]!==f?(ae=f("sandbox.pageFormDialog.placeholderPath"),e[41]=f,e[42]=ae):ae=e[42];let ie;e[43]!==m||e[44]!==h||e[45]!==ae?(ie=n.jsx(Ze,{id:"page-form-path",value:h,onChange:oe,placeholder:ae,disabled:m}),e[43]=m,e[44]=h,e[45]=ae,e[46]=ie):ie=e[46];let te;e[47]!==Z||e[48]!==ie?(te=n.jsxs("div",{className:"space-y-1.5",children:[Z,ie]}),e[47]=Z,e[48]=ie,e[49]=te):te=e[49];let ue;e[50]!==F?(ue=F&&n.jsx("p",{className:"text-xs text-destructive",children:F}),e[50]=F,e[51]=ue):ue=e[51];let ee;e[52]!==U||e[53]!==te||e[54]!==ue||e[55]!==z?(ee=n.jsxs("div",{className:"space-y-4 py-4",children:[z,U,te,ue]}),e[52]=U,e[53]=te,e[54]=ue,e[55]=z,e[56]=ee):ee=e[56];let P;e[57]!==u?(P=()=>u(!1),e[57]=u,e[58]=P):P=e[58];let q;e[59]!==f?(q=f("sandbox.pageFormDialog.buttonCancel"),e[59]=f,e[60]=q):q=e[60];let ne;e[61]!==m||e[62]!==P||e[63]!==q?(ne=n.jsx(Ae,{type:"button",variant:"outline",onClick:P,disabled:m,children:q}),e[61]=m,e[62]=P,e[63]=q,e[64]=ne):ne=e[64];let se;e[65]!==m||e[66]!==p||e[67]!==h?(se=!p.trim()||!h.trim()||m,e[65]=m,e[66]=p,e[67]=h,e[68]=se):se=e[68];let re;e[69]!==m||e[70]!==o||e[71]!==f?(re=m?n.jsxs(n.Fragment,{children:[n.jsx(ot,{className:"size-3.5"}),f(Gl[o])]}):f(Vl[o]),e[69]=m,e[70]=o,e[71]=f,e[72]=re):re=e[72];let ce;e[73]!==se||e[74]!==re?(ce=n.jsx(Ae,{type:"submit",disabled:se,children:re}),e[73]=se,e[74]=re,e[75]=ce):ce=e[75];let v;e[76]!==ne||e[77]!==ce?(v=n.jsxs(pt,{children:[ne,ce]}),e[76]=ne,e[77]=ce,e[78]=v):v=e[78];let V;e[79]!==M||e[80]!==ee||e[81]!==v||e[82]!==K?(V=n.jsx(lt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:M,children:[K,ee,v]})}),e[79]=M,e[80]=ee,e[81]=v,e[82]=K,e[83]=V):V=e[83];let fe;return e[84]!==R||e[85]!==t||e[86]!==V?(fe=n.jsx(it,{open:t,onOpenChange:R,children:V}),e[84]=R,e[85]=t,e[86]=V,e[87]=fe):fe=e[87],fe}const Hl=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],Xs={from:"",to:"",type:"temporary",discardQueryParameters:!1};function ql(s){const e=le.c(111),{open:t,isPending:o,error:a,onSubmit:l,onOpenChange:i}=s,r=o===void 0?!1:o,c=je(),[d,g]=A.useState(Xs),[u,m]=A.useState(null),[f,p]=A.useState(t);t!==f&&(p(t),t&&(g(Xs),m(null)));let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=be=>g(Le=>({...Le,...be})),e[0]=b):b=e[0];const h=b;let y;e[1]!==r||e[2]!==i?(y=be=>{!be&&!r&&(m(null),i(!1))},e[1]=r,e[2]=i,e[3]=y):y=e[3];const j=y;let k;e[4]!==r||e[5]!==l||e[6]!==d||e[7]!==c?(k=async be=>{be.preventDefault();const Le=d.from.trim(),Ie=d.to.trim();if(!Le||!Ie||r){m(c("sandbox.redirectFormDialog.errorRequired"));return}m(null),await l({...d,from:Le,to:Ie})},e[4]=r,e[5]=l,e[6]=d,e[7]=c,e[8]=k):k=e[8];const S=k,w=u??a;let _;e[9]!==r||e[10]!==d.from||e[11]!==d.to?(_=!!d.from.trim()&&!!d.to.trim()&&!r,e[9]=r,e[10]=d.from,e[11]=d.to,e[12]=_):_=e[12];const E=_;let N;e[13]!==c?(N=c("sandbox.redirectFormDialog.title"),e[13]=c,e[14]=N):N=e[14];let B;e[15]!==N?(B=n.jsx(ft,{children:n.jsx(at,{children:N})}),e[15]=N,e[16]=B):B=e[16];let R;e[17]!==c?(R=c("sandbox.redirectEditor.fromLabel"),e[17]=c,e[18]=R):R=e[18];let L;e[19]!==R?(L=n.jsx(Me,{htmlFor:"redirect-form-from",children:R}),e[19]=R,e[20]=L):L=e[20];const M=d.from;let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=be=>h({from:be.target.value}),e[21]=F):F=e[21];let T;e[22]!==c?(T=c("sandbox.redirectEditor.fromPlaceholder"),e[22]=c,e[23]=T):T=e[23];let $;e[24]!==r||e[25]!==d.from||e[26]!==T?($=n.jsx(Ze,{id:"redirect-form-from",value:M,onChange:F,placeholder:T,autoFocus:!0,disabled:r}),e[24]=r,e[25]=d.from,e[26]=T,e[27]=$):$=e[27];let K;e[28]!==$||e[29]!==L?(K=n.jsxs("div",{className:"space-y-1.5",children:[L,$]}),e[28]=$,e[29]=L,e[30]=K):K=e[30];let z;e[31]!==c?(z=c("sandbox.redirectEditor.toLabel"),e[31]=c,e[32]=z):z=e[32];let G;e[33]!==z?(G=n.jsx(Me,{htmlFor:"redirect-form-to",children:z}),e[33]=z,e[34]=G):G=e[34];const W=d.to;let O;e[35]===Symbol.for("react.memo_cache_sentinel")?(O=be=>h({to:be.target.value}),e[35]=O):O=e[35];let I;e[36]!==c?(I=c("sandbox.redirectEditor.toPlaceholder"),e[36]=c,e[37]=I):I=e[37];let D;e[38]!==r||e[39]!==d.to||e[40]!==I?(D=n.jsx(Ze,{id:"redirect-form-to",value:W,onChange:O,placeholder:I,disabled:r}),e[38]=r,e[39]=d.to,e[40]=I,e[41]=D):D=e[41];let U;e[42]!==G||e[43]!==D?(U=n.jsxs("div",{className:"space-y-1.5",children:[G,D]}),e[42]=G,e[43]=D,e[44]=U):U=e[44];let J;e[45]!==c?(J=c("sandbox.redirectEditor.typeLabel"),e[45]=c,e[46]=J):J=e[46];let Z;e[47]!==J?(Z=n.jsx(Me,{htmlFor:"redirect-form-type",children:J}),e[47]=J,e[48]=Z):Z=e[48];const oe=d.type;let ae;e[49]===Symbol.for("react.memo_cache_sentinel")?(ae=be=>h({type:be}),e[49]=ae):ae=e[49];let ie;e[50]!==c?(ie=c("sandbox.redirectEditor.typePlaceholder"),e[50]=c,e[51]=ie):ie=e[51];let te;e[52]!==ie?(te=n.jsx(ol,{id:"redirect-form-type",className:"w-full",children:n.jsx(al,{placeholder:ie})}),e[52]=ie,e[53]=te):te=e[53];let ue;e[54]!==c?(ue=Hl.map(be=>n.jsx(nl,{value:be.value,children:c(be.labelKey,{status:Rn[be.value]})},be.value)),e[54]=c,e[55]=ue):ue=e[55];let ee;e[56]!==ue?(ee=n.jsx(ll,{children:ue}),e[56]=ue,e[57]=ee):ee=e[57];let P;e[58]!==r||e[59]!==d.type||e[60]!==te||e[61]!==ee?(P=n.jsxs(il,{value:oe,onValueChange:ae,disabled:r,children:[te,ee]}),e[58]=r,e[59]=d.type,e[60]=te,e[61]=ee,e[62]=P):P=e[62];let q;e[63]!==Z||e[64]!==P?(q=n.jsxs("div",{className:"space-y-1.5",children:[Z,P]}),e[63]=Z,e[64]=P,e[65]=q):q=e[65];let ne;e[66]===Symbol.for("react.memo_cache_sentinel")?(ne=be=>h({discardQueryParameters:be===!0}),e[66]=ne):ne=e[66];let se;e[67]!==r||e[68]!==d.discardQueryParameters?(se=n.jsx(ts,{checked:d.discardQueryParameters,disabled:r,onCheckedChange:ne}),e[67]=r,e[68]=d.discardQueryParameters,e[69]=se):se=e[69];let re;e[70]!==c?(re=c("sandbox.redirectEditor.discardQueryParameters"),e[70]=c,e[71]=re):re=e[71];let ce;e[72]!==re?(ce=n.jsx("span",{className:"text-sm",children:re}),e[72]=re,e[73]=ce):ce=e[73];let v;e[74]!==se||e[75]!==ce?(v=n.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[se,ce]}),e[74]=se,e[75]=ce,e[76]=v):v=e[76];let V;e[77]!==w?(V=w&&n.jsx("p",{className:"text-xs text-destructive",children:w}),e[77]=w,e[78]=V):V=e[78];let fe;e[79]!==K||e[80]!==U||e[81]!==q||e[82]!==v||e[83]!==V?(fe=n.jsxs("div",{className:"space-y-4 py-4",children:[K,U,q,v,V]}),e[79]=K,e[80]=U,e[81]=q,e[82]=v,e[83]=V,e[84]=fe):fe=e[84];let ge;e[85]!==i?(ge=()=>i(!1),e[85]=i,e[86]=ge):ge=e[86];let ve;e[87]!==c?(ve=c("sandbox.redirectFormDialog.cancel"),e[87]=c,e[88]=ve):ve=e[88];let he;e[89]!==r||e[90]!==ge||e[91]!==ve?(he=n.jsx(Ae,{type:"button",variant:"outline",onClick:ge,disabled:r,children:ve}),e[89]=r,e[90]=ge,e[91]=ve,e[92]=he):he=e[92];const De=!E;let ke;e[93]!==r||e[94]!==c?(ke=r?n.jsxs(n.Fragment,{children:[n.jsx(ot,{className:"size-3.5"}),c("sandbox.redirectFormDialog.pending")]}):c("sandbox.redirectFormDialog.submit"),e[93]=r,e[94]=c,e[95]=ke):ke=e[95];let Pe;e[96]!==De||e[97]!==ke?(Pe=n.jsx(Ae,{type:"submit",disabled:De,children:ke}),e[96]=De,e[97]=ke,e[98]=Pe):Pe=e[98];let Te;e[99]!==he||e[100]!==Pe?(Te=n.jsxs(pt,{children:[he,Pe]}),e[99]=he,e[100]=Pe,e[101]=Te):Te=e[101];let Be;e[102]!==S||e[103]!==fe||e[104]!==Te||e[105]!==B?(Be=n.jsx(lt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:S,children:[B,fe,Te]})}),e[102]=S,e[103]=fe,e[104]=Te,e[105]=B,e[106]=Be):Be=e[106];let _e;return e[107]!==j||e[108]!==t||e[109]!==Be?(_e=n.jsx(it,{open:t,onOpenChange:j,children:Be}),e[107]=j,e[108]=t,e[109]=Be,e[110]=_e):_e=e[110],_e}function Wl(s){const e=le.c(70),{open:t,blockKey:o,initialName:a,isPending:l,onSubmit:i,onOpenChange:r}=s,c=l===void 0?!1:l,d=je(),[g,u]=A.useState(a),[m,f]=A.useState(t);t!==m&&(f(t),t&&u(a));let p;e[0]!==c||e[1]!==r?(p=oe=>{!oe&&!c&&r(!1)},e[0]=c,e[1]=r,e[2]=p):p=e[2];const b=p;let h;e[3]!==c||e[4]!==g||e[5]!==i?(h=async oe=>{oe.preventDefault();const ae=g.trim();!ae||c||await i(ae)},e[3]=c,e[4]=g,e[5]=i,e[6]=h):h=e[6];const y=h;let j;e[7]!==d?(j=d("sandbox.sectionRenameDialog.title"),e[7]=d,e[8]=j):j=e[8];let k;e[9]!==j?(k=n.jsx(at,{children:j}),e[9]=j,e[10]=k):k=e[10];let S;e[11]!==d?(S=d("sandbox.sectionRenameDialog.description"),e[11]=d,e[12]=S):S=e[12];let w;e[13]!==S?(w=n.jsx(Ut,{children:S}),e[13]=S,e[14]=w):w=e[14];let _;e[15]!==k||e[16]!==w?(_=n.jsxs(ft,{children:[k,w]}),e[15]=k,e[16]=w,e[17]=_):_=e[17];let E;e[18]!==d?(E=d("sandbox.sectionRenameDialog.nameLabel"),e[18]=d,e[19]=E):E=e[19];let N;e[20]!==E?(N=n.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:E}),e[20]=E,e[21]=N):N=e[21];let B;e[22]===Symbol.for("react.memo_cache_sentinel")?(B=oe=>u(oe.target.value),e[22]=B):B=e[22];let R;e[23]!==c||e[24]!==g?(R=n.jsx(Ze,{id:"section-rename-name",value:g,onChange:B,autoFocus:!0,disabled:c}),e[23]=c,e[24]=g,e[25]=R):R=e[25];let L;e[26]!==N||e[27]!==R?(L=n.jsxs("div",{className:"space-y-1.5",children:[N,R]}),e[26]=N,e[27]=R,e[28]=L):L=e[28];let M;e[29]!==d?(M=d("sandbox.sectionRenameDialog.keyLabel"),e[29]=d,e[30]=M):M=e[30];let F;e[31]!==M?(F=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:M}),e[31]=M,e[32]=F):F=e[32];let T;e[33]!==o?(T=n.jsx(Ze,{value:o,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=o,e[34]=T):T=e[34];let $;e[35]!==F||e[36]!==T?($=n.jsxs("div",{className:"space-y-1.5",children:[F,T]}),e[35]=F,e[36]=T,e[37]=$):$=e[37];let K;e[38]!==L||e[39]!==$?(K=n.jsxs("div",{className:"space-y-4 py-4",children:[L,$]}),e[38]=L,e[39]=$,e[40]=K):K=e[40];let z;e[41]!==r?(z=()=>r(!1),e[41]=r,e[42]=z):z=e[42];let G;e[43]!==d?(G=d("sandbox.sectionRenameDialog.cancel"),e[43]=d,e[44]=G):G=e[44];let W;e[45]!==c||e[46]!==z||e[47]!==G?(W=n.jsx(Ae,{type:"button",variant:"outline",onClick:z,disabled:c,children:G}),e[45]=c,e[46]=z,e[47]=G,e[48]=W):W=e[48];let O;e[49]!==c||e[50]!==g?(O=!g.trim()||c,e[49]=c,e[50]=g,e[51]=O):O=e[51];let I;e[52]!==c||e[53]!==d?(I=c?n.jsxs(n.Fragment,{children:[n.jsx(ot,{className:"size-3.5"}),d("sandbox.sectionRenameDialog.saving")]}):d("sandbox.sectionRenameDialog.save"),e[52]=c,e[53]=d,e[54]=I):I=e[54];let D;e[55]!==O||e[56]!==I?(D=n.jsx(Ae,{type:"submit",disabled:O,children:I}),e[55]=O,e[56]=I,e[57]=D):D=e[57];let U;e[58]!==W||e[59]!==D?(U=n.jsxs(pt,{children:[W,D]}),e[58]=W,e[59]=D,e[60]=U):U=e[60];let J;e[61]!==y||e[62]!==K||e[63]!==U||e[64]!==_?(J=n.jsx(lt,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:y,children:[_,K,U]})}),e[61]=y,e[62]=K,e[63]=U,e[64]=_,e[65]=J):J=e[65];let Z;return e[66]!==b||e[67]!==t||e[68]!==J?(Z=n.jsx(it,{open:t,onOpenChange:b,children:J}),e[66]=b,e[67]=t,e[68]=J,e[69]=Z):Z=e[69],Z}function Yl(s){const e=le.c(7),{type:t}=s,o=Rn[t];let a;e[0]!==o?(a=n.jsx(qe,{asChild:!0,children:n.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]=a):a=e[1];const l=t==="permanent"?"Permanent":"Temporary";let i;e[2]!==l?(i=n.jsx(We,{side:"left",children:l}),e[2]=l,e[3]=i):i=e[3];let r;return e[4]!==a||e[5]!==i?(r=n.jsxs(Ye,{children:[a,i]}),e[4]=a,e[5]=i,e[6]=r):r=e[6],r}const Ql=60,xs={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},_s=["posts","authors","categories"],Ct={posts:"post",authors:"author",categories:"category"};function st(s){return _s.includes(s)}const ns={posts:"post",authors:"author",categories:"category"},qn={posts:xs.post,authors:xs.author,categories:xs.category},Jl=Object.fromEntries(Object.entries(qn).map(([s,e])=>[e,s]));function Xl(s){return typeof s=="string"?Jl[s]??null:null}function Oe(s){return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function Y(s){return typeof s=="string"?s:""}function Zl(s,e){switch(s){case"posts":return{label:Y(e.title)||"Untitled post",subtitle:Y(e.slug),missing:os(e)};case"authors":return{label:Y(e.name)||"Unnamed author",subtitle:Y(e.email),missing:[]};case"categories":return{label:Y(e.name)||"Unnamed category",subtitle:Y(e.slug),slug:Y(e.slug),parentSlug:Y(e.parentSlug),missing:ui(e)};default:{const t=s;throw new Error(`Unhandled blog kind: ${String(t)}`)}}}function Wn(s){const e={posts:[],authors:[],categories:[]},t=[];for(const[o,a]of Object.entries(s)){const l=Oe(a);if(!l)continue;const i=Xl(l.__resolveType);if(!i)continue;const r=Oe(l[ns[i]])??{},c={key:o,kind:i,...Zl(i,r)};e[i].push(c),t.push({entry:c,key:ht(Y(r[i==="posts"?"title":"name"]))})}ei(t);for(const o of _s)e[o].sort((a,l)=>a.label.localeCompare(l.label));return e}function ei(s){const e=new Map;for(const{entry:t,key:o}of s){if(!o)continue;const a=`${t.kind}:${o}`;e.set(a,(e.get(a)??0)+1)}for(const{entry:t,key:o}of s)o&&(e.get(`${t.kind}:${o}`)??0)>1&&(t.duplicateName=!0)}function ti(s,e){return Wn(s)[e]}function Ue(s,e){return ti(s,e).map(t=>({key:t.key,payload:rt(Oe(s[t.key])??void 0,e)}))}const Zs=Object.freeze({});function rt(s,e){return s?Oe(s[ns[e]])??Zs:Zs}function ut(s,e,t){return{name:s,__resolveType:qn[e],[ns[e]]:t}}function dd({records:s,selected:e,valueField:t,toRef:o}){const a=Array.isArray(e)?e:[],l=m=>typeof m=="string"?m:Y(Oe(m)?.[t]),i=m=>typeof m=="string"?m:Y(Oe(m)?.name),r=m=>{const f=l(m),p=f?s.find(({payload:h})=>Y(h[t])===f):void 0;if(p)return p;const b=i(m);return b?s.find(({payload:h})=>Y(h.name)===b):void 0},c=s.map(({key:m,payload:f})=>({value:m,label:Y(f.name)||Y(f[t])||m})),d=new Map,g=[];return a.forEach((m,f)=>{const p=r(m);if(p){g.includes(p.key)||g.push(p.key);return}const b=`unresolved:${f}`;d.set(b,m),g.push(b),c.push({value:b,label:i(m)||l(m)||"Unknown"})}),{options:c,selectedValues:g,refsForValues:m=>m.map(f=>{const p=s.find(b=>b.key===f);return p?o(p.payload):d.get(f)}).filter(f=>f!==void 0)}}function Yn(s){return Ue(s,"authors").map(({payload:e})=>({...e,name:Y(e.name),email:Y(e.email)})).filter(e=>e.email)}function et(s){return Array.isArray(s)?s:[]}function Xe(s){if(typeof s=="string")return s;const e=Oe(s);return e?Y(e.slug):""}function Qn(s){if(typeof s=="string")return s;const e=Oe(s);return e?Y(e.email):""}const si={title:"sandbox.blogField.title",slug:"sandbox.blogField.slug",category:"sandbox.blogField.category",excerpt:"sandbox.blogField.excerpt",image:"sandbox.blogField.image",name:"sandbox.blogField.name"};function ni(s,e){return s.map(t=>e(si[t])).join(", ")}function os(s){const e=[];return Y(s.title).trim()||e.push("title"),Y(s.slug).trim()||e.push("slug"),et(s.categories).map(Xe).filter(Boolean).length===0&&e.push("category"),Y(s.excerpt).trim()||e.push("excerpt"),Y(s.image).trim()||e.push("image"),e}const As=["draft","generating","awaiting_review","scheduled","published","archived"],Jn=8;function xt(s){switch(Y(s.status)){case"draft":case"idea":return"draft";case"generating":return"generating";case"awaiting_review":case"in_review":return"awaiting_review";case"scheduled":return"scheduled";case"published":return"published";case"archived":return"archived";case"":return"published";default:return"awaiting_review"}}function ud(s){return xt(s)==="archived"}function oi(s,e){return e!=="published"&&e!=="scheduled"||xt(s)===e?!1:os(s).length>0}function ai(s){return new Date(s.getFullYear(),s.getMonth(),s.getDate()+1,Jn).toISOString()}function Ht(s,e,t){if(e!=="scheduled")return{...s,status:e,scheduledDatetime:""};const o=Y(s.scheduledDatetime);return{...s,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(o).getTime())?ai(t):o}}function Xn(s,e=po(s)){return Ue(s,"posts").map(({key:t,payload:o})=>({key:t,duplicateTitle:e.has(t),title:Y(o.title)||"Untitled post",slug:Y(o.slug),date:Y(o.date),scheduledDatetime:Y(o.scheduledDatetime),categorySlugs:et(o.categories).map(Xe).filter(Boolean),authorEmails:et(o.authors).map(Qn).filter(Boolean),missing:os(o),status:xt(o),form:"live"}))}const Zn="blog-manager/posts/";function eo(s){return s.startsWith(Zn)}function Pt(s){return s.split("/").pop()??s}function qt(s){return`${Zn}${s}`}function li(s){return`collections/blog/posts/${s}`}function vs(){return gt(12)}function ii(s){const e=Oe(s.planning)??{},t=Oe(e.format);return{ideaKey:Y(e.ideaKey)||void 0,pillarKey:Y(e.pillarKey)||void 0,pillarTitle:Y(e.pillarTitle)||void 0,format:t?{name:Y(t.name),value:Y(t.value)}:void 0,brief:Y(e.brief)||void 0}}function to(s){return{title:s.title,slug:"",excerpt:"",date:s.now.toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[],status:"draft",planning:s.planning??{}}}function ct(s,e){return{name:s,[ns.posts]:e}}function ri(s,e){return eo(s)?ct(s,e):ut(s,"posts",e)}function so(s){const e=[];for(const[t,o]of Object.entries(s)){if(!eo(t))continue;const a=Oe(o);a&&e.push({key:t,payload:rt(a,"posts")})}return e}function no(s){return[...so(s),...Ue(s,"posts")]}function ci(s){const e=po(s);return[...so(s).map(({key:o,payload:a})=>({key:o,duplicateTitle:e.has(o),title:Y(a.title)||"Untitled post",slug:Y(a.slug),date:Y(a.date),scheduledDatetime:Y(a.scheduledDatetime),categorySlugs:et(a.categories).map(Xe).filter(Boolean),authorEmails:et(a.authors).map(Qn).filter(Boolean),missing:os(a),status:xt(a),form:"planning"})),...Xn(s,e)]}function di(s,e,t){const o=Ht(s.payload,e,t),a=Pt(s.key),l=e==="scheduled"||e==="published"?"live":"planning",i=l==="live"?li(a):qt(a),r=l==="live"?ut(i,"posts",o):ct(i,o);return{writes:{[i]:r},deletes:i===s.key?[]:[s.key]}}function md(s,e,t){const o=et(s.categories);if(!o.some(c=>Xe(c)===e))return s;let a=!1;const l=o.map(c=>{const d=Xe(c);if(d!==e&&d!==t.slug)return c;const g=Oe(c);return g&&Y(g.slug)===t.slug&&Y(g.name)===t.name?c:(a=!0,{name:t.name,slug:t.slug})});if(!a){const c=o.map(Xe).filter(Boolean);if(new Set(c).size===c.length)return s}const i=new Set,r=l.filter(c=>{const d=Xe(c);return d?i.has(d)?!1:(i.add(d),!0):!0});return{...s,categories:r}}function ui(s){const e=[];return Y(s.name).trim()||e.push("name"),Y(s.slug).trim()||e.push("slug"),e}function mi(s,e){const t=et(s.categories);return t.some(o=>Xe(o)===e)?{...s,categories:t.filter(o=>Xe(o)!==e)}:s}function fd(s,e,t){return Y(s.parentSlug)!==e?s:{...s,parentSlug:t}}function fi(s){const e=Y(s.status),t=e==="idea"||e==="in_review"?{status:xt(s)}:{};return{...s,...t,dateModified:new Date().toISOString()}}function gt(s){const e=new Uint8Array(Math.ceil(s/2));return crypto.getRandomValues(e),Array.from(e,t=>t.toString(16).padStart(2,"0")).join("").slice(0,s)}function bs(s,e){const t=`collections/blog/${e}/${gt(12)}`;if(!Object.hasOwn(s,t))return t;throw new Error("Could not generate a unique blog block key")}function oo(s){switch(s){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:"",url:"",avatar:""};case"categories":return{name:"New category",slug:`category-${gt(8)}`,description:"",sections:[]};default:{const e=s;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const pi={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"}},en="Box";function ao(s){return s.startsWith("site/")?"site":"app"}function gi(s){return s.startsWith("http://")||s.startsWith("https://")||s.startsWith("data:")||s.startsWith("/")}function jt(...s){for(const e of s)if(e!==void 0)return e}function tn(s){if(s&&!(s.includes("/")||/\.(tsx?|jsx?)$/.test(s)))return s}function hi(s){const e=s.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim();return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():s}function xi(s,e){const t=Ps(s,e),o=as(s),a=pi[o],l=ao(s),i=tn(t.title),r=tn(t.description),c=(l==="site"?jt(i,a?.title):jt(a?.title,i))??hi(o),d=l==="site"?jt(r,a?.description):jt(a?.description,r),g=l==="site"?t.icon:void 0,u=g&&gi(g)?g:void 0,m=u!==void 0?a?.iconName??en:jt(g,a?.iconName)??en;return{resolveType:s,title:c,description:d,iconName:m,iconUrl:u,source:l}}function lo(s,{hideDefaults:e=!1}={}){const t=new Set,o=[],a=s.manifest?.blocks??{};for(const l of Object.values(a))for(const i of Object.keys(l))!yi(i)||t.has(i)||e&&ao(i)==="app"||(t.add(i),o.push(xi(i,s)));return o.sort((l,i)=>l.title.localeCompare(i.title))}function as(s){return(s.split("/").pop()??s).replace(/\.(tsx?|jsx?)$/,"")}const bi=["blog/sections/blocks/","site/sections/Blog/Post/"];function yi(s){return bi.some(e=>s.startsWith(e))}const Ls="blog-manager-brand";function ze(s){if(!Array.isArray(s))return[];const e=[];for(const t of s){if(typeof t=="string"){t.trim()&&e.push({name:t,value:""});continue}const o=Oe(t);o&&e.push({name:Y(o.name),value:Y(o.value)})}return e}function Ve(s){return s.filter(e=>e.name.trim()||e.value.trim())}const vi=6e4,ji=4e3;function ki(s){const e=[],t=new Set,o=(a,l)=>{if(typeof a=="string"){if(!a.includes(" ")||a.length<4||/^(https?:)?\/\//.test(a)||/^data:/.test(a))return;const i=`${l}: ${a.trim()}`;if(t.has(i))return;t.add(i),e.push(i);return}if(Array.isArray(a)){for(const i of a)o(i,l);return}if(a&&typeof a=="object")for(const[i,r]of Object.entries(a))i!=="__resolveType"&&o(r,i)};return o(s,"block"),e.join(`
|
|
3
3
|
`)}function pd(s,e){const t=new Map,o=d=>{const g=t.get(d);if(g!==void 0)return g;const u=ki(s[d]).slice(0,ji);return t.set(d,u),u},a=(d,g)=>o(g).length-o(d).length,l=[...Ue(s,"posts").map(d=>d.key).sort(a),...Ue(s,"categories").map(d=>d.key),...[...e].sort(a)],i=[],r=new Set;let c=vi;for(const d of l){if(i.length>=Ql)break;if(r.has(d)||!s[d])continue;r.add(d);const g=o(d);if(g.length>c)break;i.push({key:d,content:g}),c-=g.length}return i}const io="blog-manager/themes/";function Si(){return`${io}${crypto.randomUUID()}`}function wi(s,e){return{name:s,title:e.title,body:e.body,pillarKey:e.pillarKey??"",createdAt:e.createdAt}}function ro(s){const e=[];for(const[t,o]of Object.entries(s)){if(!t.startsWith(io))continue;const a=Oe(o);a&&e.push({key:t,title:Y(a.title),body:Y(a.body),pillarKey:Y(a.pillarKey)||void 0,createdAt:Y(a.createdAt)})}return e.sort((t,o)=>o.createdAt.localeCompare(t.createdAt)||t.title.localeCompare(o.title))}const co="blog-manager/pillars/";function gd(){return`${co}${crypto.randomUUID()}`}function uo(s){const e=[];for(const[t,o]of Object.entries(s)){if(!t.startsWith(co))continue;const a=Oe(o);a&&e.push({key:t,title:Y(a.title),body:Y(a.body),createdAt:Y(a.createdAt),formats:et(a.formats).map(l=>Y(l)).filter(Boolean)})}return e.sort((t,o)=>o.createdAt.localeCompare(t.createdAt)||t.title.localeCompare(o.title))}const mo="blog-manager-formats",Ni=40;function hd(s){return Ue(s,"posts").slice(0,Ni).map(({key:e,payload:t})=>({key:e,title:Y(t.title),sections:et(t.sections).map(o=>Y(Oe(o)?.__resolveType)).filter(Boolean).map(as)}))}function Ci(s,e){const t=new Map;for(const o of lo(s,e)){const a=as(o.resolveType);t.has(a)||t.set(a,{name:a,title:o.title,description:o.description})}return[...t.values()]}function Pi(s){const e=new Set;for(const t of s.matchAll(/(?:^|[\s([{>])@([A-Za-z][\w-]*)/g))t[1]&&e.add(t[1]);return[...e]}function xd(s,e){const t=new Set(e);return Pi(s).filter(o=>!t.has(o))}const Ti=["Heading","Paragraph","BlockImage","List","Cta"];function bd(s){const e=new Set(s);return Ti.filter(t=>e.has(t))}function ht(s){return s.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/\s+/g," ").trim()}function yd(s,e,t,o){const a=ht(o);return a?fo(s,e).some(l=>l.key!==t&&ht(l.name)===a):!1}function fo(s,e){return e!=="posts"?Ue(s,e).map(({key:t,payload:o})=>({key:t,name:Y(o.name)})):no(s).map(({key:t,payload:o})=>({key:t,name:Y(o.title)}))}function po(s){const e=new Map;for(const{key:o,name:a}of fo(s,"posts")){const l=ht(a);if(!l)continue;const i=e.get(l);i?i.push(o):e.set(l,[o])}const t=new Set;for(const o of e.values())if(o.length>1)for(const a of o)t.add(a);return t}function Bi(s,e){const t=new Set(s.map(ht)),o=[];for(const a of e){const l=ht(a.title);!l||t.has(l)||(t.add(l),o.push(a))}return o}const Ei=["companyName","language","description","tone","targetAudience"];function Di(s){const e=Oe(s)??{},t=[];for(const o of Ei)Y(e[o]).trim()||t.push(o);return Ve(ze(e.dos)).length===0&&t.push("dos"),Ve(ze(e.avoid)).length===0&&t.push("avoid"),t}function go(s,e){const t={};for(const o of lo(s,e)){const a=as(o.resolveType);a in t||(t[a]=o.resolveType)}return t}function _i(s,e){const t=[];for(const o of s){const a=e[o.type];if(a)switch(o.type){case"Heading":t.push({__resolveType:a,text:Y(o.text),level:o.level??"2"});break;case"Paragraph":t.push({__resolveType:a,html:Y(o.html)});break;case"List":t.push({__resolveType:a,items:(o.items??[]).join(`
|
|
4
4
|
`),style:o.style??"unordered"});break;case"Quote":t.push({__resolveType:a,quote:Y(o.quote)});break;case"Callout":t.push({__resolveType:a,title:Y(o.title),body:Y(o.body),variant:o.variant??"info"});break;case"Cta":t.push({__resolveType:a,text:Y(o.text),href:Y(o.href)});break;case"Divider":t.push({__resolveType:a});break}}return t}const $s=80;function ho(s){return s.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,$s)}function vd(s){return s.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+/,"").slice(0,$s)}function sn(s,e){const t=$s-e.length-1;return`${s.slice(0,t).replace(/-+$/,"")}-${e}`}function xo(s,e,t){const o=ho(s)||`${t}-${gt(6)}`,a=new Set(e);if(!a.has(o))return o;for(let l=2;l<100;l++){const i=sn(o,String(l));if(!a.has(i))return i}return sn(o,gt(4))}function bo(s,e){return xo(s,e,"post")}function Ai(s,e){return xo(s,e,"category")}function Li({draft:s,resolveTypes:e,categories:t,authors:o,planning:a,takenSlugs:l,now:i}){const r=new Set(s.categorySlugs),c=new Set(s.authorEmails),d={title:s.title,slug:bo(s.title,l),date:i.toISOString().slice(0,10),excerpt:s.excerpt,image:"",alt:"",authors:o.filter(g=>c.has(g.email)),categories:t.filter(g=>r.has(g.slug)),seo:{title:s.seo.title,description:s.seo.description,image:""},sections:_i(s.sections,e),planning:a??{}};return Ht(d,"awaiting_review",i)}const jd=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],kd=["January","February","March","April","May","June","July","August","September","October","November","December"],yo=1440*60*1e3;function dt(s){const e=new Date(s);return e.setHours(0,0,0,0),e}function Sd(s){return new Date(s.getFullYear(),s.getMonth(),1)}function wd(s,e){return new Date(s.getFullYear(),s.getMonth()+e,1)}function Wt(s,e){const t=new Date(s);return t.setDate(t.getDate()+e),t}function js(s,e){return Math.round((dt(s).getTime()-dt(e).getTime())/yo)}function $i(s){const e=(s.getTime()-dt(s).getTime())/yo;return Math.min(Math.max(e,0),1)}function nn(s,e){return js(s,e)+$i(s)}function Nd(s){const e=Wt(s,-s.getDay()),t=[];for(let o=0;o<6;o++){const a=[];for(let l=0;l<7;l++)a.push(Wt(e,o*7+l));t.push(a)}for(;t.length>0&&t[t.length-1].every(o=>o.getMonth()!==s.getMonth());)t.pop();return t}function Cd(s,e){const t=dt(s[0]),o=Wt(t,7),a=t.getTime(),l=o.getTime(),i=[];for(const d of e){const g=dt(d.start),u=dt(d.end);if(u.getTime()<t.getTime()||g.getTime()>=o.getTime())continue;const m=g.getTime()<t.getTime()?t:g,f=u.getTime()>=o.getTime()?Wt(o,-1):u,p=js(m,t),b=js(f,m)+1;if(b<=0)continue;const h=Math.max(d.start.getTime(),a),y=Math.min(d.end.getTime(),l),j=nn(new Date(h),t),k=Math.max(nn(new Date(y),t)-j,0);k<=0||i.push({variant:d,startCol:p,span:b,leftUnits:j,widthUnits:k})}i.sort((d,g)=>d.startCol-g.startCol||g.span-d.span||d.variant.blockKey.localeCompare(g.variant.blockKey));const r=[],c=[];for(const d of i){let g=r.findIndex(u=>u<=d.startCol);g===-1&&(g=r.length,r.push(0)),r[g]=d.startCol+d.span,c.push({...d,lane:g})}return c}function Yt(s){const e=String(s.getMonth()+1).padStart(2,"0"),t=String(s.getDate()).padStart(2,"0");return`${s.getFullYear()}-${e}-${t}`}const vo=/^(\d{4})-(\d{2})-(\d{2})$/;function Qt(s){const e=s.trim();if(!e)return null;const t=vo.exec(e);if(t){const a=Number(t[1]),l=Number(t[2])-1,i=Number(t[3]),r=new Date(a,l,i);return r.getMonth()===l&&r.getDate()===i?r:null}const o=new Date(e);return Number.isNaN(o.getTime())?null:dt(o)}function Oi(s){const e=new Date(s.getFullYear(),s.getMonth(),s.getDate(),Jn);return{...oo("posts"),status:"scheduled",scheduledDatetime:e.toISOString(),date:Yt(s)}}function Ri(s){if(typeof s!="string")return null;const e=s.trim();if(!e)return null;if(vo.test(e))return Qt(e);const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Fi(s,e){const t=Ri(s.scheduledDatetime);if(!t)return null;const o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),a={...s,scheduledDatetime:o.toISOString()};return(typeof s.date=="string"?s.date:"")===Yt(t)&&(a.date=Yt(o)),a}function Ii(s){return Qt(s.scheduledDatetime)??Qt(s.date)}function Pd(s){const e=new Map,t=[];for(const a of s){const l={post:a,scheduled:Qt(a.scheduledDatetime)!==null},i=Ii(a);if(!i){t.push(l);continue}const r=Yt(i),c=e.get(r);c?c.push(l):e.set(r,[l])}const o=(a,l)=>Number(l.scheduled)-Number(a.scheduled)||a.post.title.localeCompare(l.post.title);for(const a of e.values())a.sort(o);return t.sort(o),{byDay:e,undated:t}}function Ki(s){const e=le.c(40),{orgSlug:t,virtualMcpId:o,branch:a}=s,l=_o(),i=Xt()?.taskId??null,r=da(o),c=Kn(o).runtime==="cms",{url:d}=La(o);let g;e[0]!==a||e[1]!==d||e[2]!==t||e[3]!==o?(g=ys.decofile(ua({orgSlug:t,virtualMcpId:o,branch:a,localPreviewUrl:d})),e[0]=a,e[1]=d,e[2]=t,e[3]=o,e[4]=g):g=e[4];const u=g;let m;e[5]!==a||e[6]!==t||e[7]!==o?(m=Oa(t,o,a),e[5]=a,e[6]=t,e[7]=o,e[8]=m):m=e[8];let f;e[9]!==a||e[10]!==t||e[11]!==o?(f=$a(t,o,a),e[9]=a,e[10]=t,e[11]=o,e[12]=f):f=e[12];let p;e[13]!==a||e[14]!==c||e[15]!==d||e[16]!==t||e[17]!==r||e[18]!==l||e[19]!==i||e[20]!==o?(p=async w=>{const{writes:_,deletes:E}=w,N=ma(_);if(d)return{ok:!0};if(c){const R=await Ra({orgSlug:t,virtualMcpId:o,branch:a},{set:N,delete:E});return Fa(l,{orgSlug:t,virtualMcpId:o,branch:a},R),await l.invalidateQueries({queryKey:rl({orgSlug:t,virtualMcpId:o,branch:a,threadId:i})}),R}const B={orgSlug:t,virtualMcpId:o,branch:a,threadId:i};for(const[R,L]of Object.entries(N)){const M=await fetch(qs(B,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:Ms(r,Ws(R)),content:JSON.stringify(L,null,2)})});if(!M.ok)return Gs(M,"Write")}for(const R of E){const L=await fetch(qs(B,"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:Ms(r,Ws(R))})});if(!L.ok)return Gs(L,"Delete")}return{ok:!0}},e[13]=a,e[14]=c,e[15]=d,e[16]=t,e[17]=r,e[18]=l,e[19]=i,e[20]=o,e[21]=p):p=e[21];let b;e[22]!==a||e[23]!==t||e[24]!==l||e[25]!==o?(b=()=>{l.invalidateQueries({queryKey:ys.liveMeta(t,o,a)})},e[22]=a,e[23]=t,e[24]=l,e[25]=o,e[26]=b):b=e[26];let h;e[27]!==m||e[28]!==f||e[29]!==p||e[30]!==b?(h={mutationKey:m,scope:f,mutationFn:p,onSuccess:b},e[27]=m,e[28]=f,e[29]=p,e[30]=b,e[31]=h):h=e[31];const y=Ao(h);let j;e[32]!==y||e[33]!==l||e[34]!==u?(j=async w=>{const _=[...Object.keys(w.writes),...w.deletes],E=l.getQueryData(u),N=new Map;for(const B of _)E&&B in E&&N.set(B,E[B]);l.setQueryData(u,B=>zi(B,w)),l.cancelQueries({queryKey:u});try{return await y.mutateAsync(w)}catch(B){const R=B;throw l.setQueryData(u,L=>{if(!L)return L;const M={...L};for(const F of _)N.has(F)?M[F]=N.get(F):delete M[F];return M}),R}},e[32]=y,e[33]=l,e[34]=u,e[35]=j):j=e[35];const k=j;let S;return e[36]!==k||e[37]!==y.isError||e[38]!==y.isPending?(S={move:k,isPending:y.isPending,isError:y.isError},e[36]=k,e[37]=y.isError,e[38]=y.isPending,e[39]=S):S=e[39],S}function zi(s,{writes:e,deletes:t}){const o={...s??{},...e};for(const a of t)a in e||delete o[a];return o}const Et={draft:"sandbox.postBoard.laneDraft",generating:"sandbox.postBoard.laneGenerating",awaiting_review:"sandbox.postBoard.laneAwaitingReview",scheduled:"sandbox.postBoard.laneScheduled",published:"sandbox.postBoard.lanePublished",archived:"sandbox.postBoard.laneArchived"};function Mi({orgSlug:s,virtualMcpId:e,branch:t,decofile:o,onMoved:a}){const l=je(),i=Ki({orgSlug:s,virtualMcpId:e,branch:t}),[r,c]=A.useState(new Set),d=f=>rt(o[f],"posts"),g=(f,p,b=d(f))=>p==="generating"?{kind:"not-a-target"}:r.has(Pt(f))?{kind:"in-flight"}:oi(b,p)?{kind:"incomplete"}:null,u=f=>{switch(f.kind){case"incomplete":return l("sandbox.postBoard.moveBlocked");case"in-flight":return l("sandbox.postBoard.moveInFlight");case"not-a-target":return l("sandbox.postBoard.moveNotATarget");default:return String(f)}};return{apply:async(f,p,b)=>{const h=b??d(f);if(xt(h)===p)return null;const y=g(f,p,h);if(y)return y.kind!=="in-flight"&&me.error(u(y)),null;const j=Pt(f);c(w=>new Set(w).add(j));const k=di({key:f,payload:h},p,new Date),S=Object.keys(k.writes)[0]??f;S!==f&&a?.(f,S);try{return await i.move(k),S}catch(w){return S!==f&&a?.(S,f),me.error(w instanceof Error?w.message:l("sandbox.postBoard.moveFailed")),null}finally{c(w=>{const _=new Set(w);return _.delete(j),_})}},refuse:g,reasonText:u,isMoving:f=>r.has(Pt(f))}}function jo(){return ul("hide_default_blog_blocks")}function Vi(s){const e=le.c(15),{value:t,onChange:o,placeholder:a,className:l,onFocus:i,onBlur:r,onKeyDown:c,spellCheck:d,readOnly:g,inputRef:u}=s,m=d===void 0?!0:d;let f;e[0]!==o?(f=h=>o(h.target.value),e[0]=o,e[1]=f):f=e[1];let p;e[2]!==l?(p=ye("w-full resize-none border-0 bg-transparent p-0 outline-none [field-sizing:content] placeholder:text-muted-foreground/50 focus:ring-0",l),e[2]=l,e[3]=p):p=e[3];let b;return e[4]!==u||e[5]!==r||e[6]!==i||e[7]!==c||e[8]!==a||e[9]!==g||e[10]!==m||e[11]!==f||e[12]!==p||e[13]!==t?(b=n.jsx("textarea",{ref:u,value:t,onChange:f,onInput:Gi,onFocus:i,onBlur:r,onKeyDown:c,placeholder:a,spellCheck:m,readOnly:g,rows:1,className:p}),e[4]=u,e[5]=r,e[6]=i,e[7]=c,e[8]=a,e[9]=g,e[10]=m,e[11]=f,e[12]=p,e[13]=t,e[14]=b):b=e[14],b}function Gi(s){const e=s.currentTarget;e.style.height="auto",e.style.height=`${e.scrollHeight}px`}function Se(s){return typeof s=="string"?s:""}function Td(s){const e=le.c(11);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=ye(t,"pr-9"),e[3]=t,e[4]=a):a=e[4];let l;e[5]!==o||e[6]!==a?(l=n.jsx(Vi,{...o,className:a}),e[5]=o,e[6]=a,e[7]=l):l=e[7];let i;e[8]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Vo,{size:18,"aria-hidden":!0,className:"pointer-events-none absolute right-2 top-3 text-muted-foreground/40 transition-opacity group-hover/editable:text-muted-foreground group-focus-within/editable:text-muted-foreground"}),e[8]=i):i=e[8];let r;return e[9]!==l?(r=n.jsxs("div",{className:"group/editable relative -mx-2 rounded-md px-2 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",children:[l,i]}),e[9]=l,e[10]=r):r=e[10],r}function Bd(s){const e=le.c(5),{label:t,onClick:o,disabled:a}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Ns,{size:13}),e[0]=l):l=e[0];let i;return e[1]!==a||e[2]!==t||e[3]!==o?(i=n.jsxs("button",{type:"button",onClick:o,disabled:a,className:"flex items-center gap-1.5 rounded-lg border border-dashed px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground disabled:opacity-40 disabled:hover:border-dashed disabled:hover:text-muted-foreground cursor-pointer",children:[l,t]}),e[1]=a,e[2]=t,e[3]=o,e[4]=i):i=e[4],i}function Ed(s){const e=le.c(4),{label:t,onClick:o}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Es,{size:13}),e[0]=a):a=e[0];let l;return e[1]!==t||e[2]!==o?(l=n.jsx("button",{type:"button","aria-label":t,onClick:o,className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground/60 opacity-0 transition-opacity hover:text-destructive group-hover/item:opacity-100 cursor-pointer rounded-lg",children:a}),e[1]=t,e[2]=o,e[3]=l):l=e[3],l}function Dd(s){const e=le.c(2),{children:t}=s;let o;return e[0]!==t?(o=n.jsx("div",{className:"absolute -top-9 left-0 z-10 flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:t}),e[0]=t,e[1]=o):o=e[1],o}function _d(s){if(Array.isArray(s))return s;if(typeof s!="string"||s.trim()==="")return[];try{const e=JSON.parse(s);return Array.isArray(e)?e:[]}catch{return[]}}function St(s){const e=le.c(14),{options:t,value:o,emptyLabel:a,onChange:l}=s;let i;e[0]!==a||e[1]!==l||e[2]!==o?(i=a&&n.jsx(on,{active:!o,onClick:()=>l(""),children:a}),e[0]=a,e[1]=l,e[2]=o,e[3]=i):i=e[3];let r;if(e[4]!==l||e[5]!==t||e[6]!==o){let d;e[8]!==l||e[9]!==o?(d=g=>n.jsx(on,{active:g===o,onClick:()=>l(g),children:g},g),e[8]=l,e[9]=o,e[10]=d):d=e[10],r=t.filter(Boolean).map(d),e[4]=l,e[5]=t,e[6]=o,e[7]=r}else r=e[7];let c;return e[11]!==i||e[12]!==r?(c=n.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i,r]}),e[11]=i,e[12]=r,e[13]=c):c=e[13],c}function on(s){const e=le.c(7),{active:t,onClick:o,children:a}=s,l=t?"border-primary bg-primary text-primary-foreground":"bg-card hover:bg-muted";let i;e[0]!==l?(i=ye("cursor-pointer rounded-md border px-2.5 py-1 text-xs font-medium transition-colors",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==t||e[3]!==a||e[4]!==o||e[5]!==i?(r=n.jsx("button",{type:"button","aria-pressed":t,onClick:o,className:i,children:a}),e[2]=t,e[3]=a,e[4]=o,e[5]=i,e[6]=r):r=e[6],r}function Ad(s,e=[]){return typeof s=="string"?s:JSON.stringify(s??e)}const an=[{id:"idea",label:"sandbox.generatePost.stepIdea"},{id:"format",label:"sandbox.generatePost.stepFormat"},{id:"extra",label:"sandbox.generatePost.stepExtra"}],Ui={companyName:"sandbox.blogBrand.companyNameLabel",language:"sandbox.blogBrand.languageLabel",description:"sandbox.blogBrand.descriptionLabel",tone:"sandbox.blogBrand.toneLabel",targetAudience:"sandbox.blogBrand.audienceLabel",dos:"sandbox.blogBrand.tabDos",avoid:"sandbox.blogBrand.tabGuardrails"};function Hi({open:s,onOpenChange:e,decofile:t,hasAi:o,seed:a,onGenerate:l}){const i=je(),r=ks(),[c,d]=A.useState(a?"format":"idea"),[g,u]=A.useState(a?.key??""),[m,f]=A.useState(a?.title??""),[p,b]=A.useState(a?.body??""),[h,y]=A.useState([]),[j,k]=A.useState(""),[S,w]=A.useState(""),[_,E]=A.useState(""),[N,B]=A.useState(""),[R,L]=A.useState(""),[M,F]=A.useState(!1),T=t[Ls],$=Di(T),K={companyName:Se(T?.companyName),description:Se(T?.description),language:Se(T?.language),tone:Se(T?.tone),targetAudience:Se(T?.targetAudience),values:Ve(ze(T?.values)),dos:Ve(ze(T?.dos)),avoid:Ve(ze(T?.avoid))},z=ro(t),G=z.find(P=>P.key===g),W=uo(t).find(P=>P.key===G?.pillarKey),O=t[mo],I=Ve(ze(O?.formats)),D=Ue(t,"categories").map(({payload:P})=>({name:Se(P.name),slug:Se(P.slug)})).filter(P=>P.slug),U=Yn(t),J=()=>{d(a?"format":"idea"),u(a?.key??""),f(a?.title??""),b(a?.body??""),y([]),k(""),w(""),E(""),B(""),L("")},Z=P=>{e(P),P||J()},oe=async()=>{F(!0);try{const P=await r.call("BLOG_THEME_SUGGEST",{brand:K,existingTitles:[],formats:I.map(q=>q.name).filter(Boolean),guidance:W?`Every idea must be one angle inside the pillar "${W.title}": ${W.body}`:void 0,count:4});y(P.themes)}catch(P){me.error(P instanceof Error?P.message:i("sandbox.generatePost.suggestFailed"))}finally{F(!1)}},ae=a?an.filter(P=>P.id!=="idea"):an,ie=ae.findIndex(P=>P.id===c),te=c==="idea"?m.trim().length>0:c==="format"?j.trim().length>0&&S.trim().length>0:!0,ue=c==="extra",ee=()=>{l({idea:{key:g||void 0,title:m.trim(),body:p.trim()},pillar:W?{key:W.key,title:W.title,body:W.body}:void 0,format:{name:j.trim(),value:S.trim()},category:D.find(P=>P.slug===_),author:U.find(P=>P.email===N),extraInstructions:R.trim()||void 0}),Z(!1)};return n.jsx(it,{open:s,onOpenChange:Z,children:n.jsxs(lt,{className:"flex max-h-[85vh] flex-col sm:max-w-2xl",children:[n.jsxs(ft,{children:[n.jsx(at,{children:i("sandbox.generatePost.title")}),n.jsx(Ut,{children:i("sandbox.generatePost.subtitle")})]}),$.length>0?n.jsx("p",{className:"text-sm text-muted-foreground",children:i("sandbox.generatePost.blockedBrand",{fields:$.map(P=>i(Ui[P])).join(", ")})}):n.jsxs(n.Fragment,{children:[n.jsx("ol",{className:"flex shrink-0 items-center gap-1.5 text-xs",children:ae.map((P,q)=>n.jsx("li",{className:ye("rounded-md px-2 py-1",q===ie?"bg-primary text-primary-foreground":q<ie?"text-foreground":"text-muted-foreground"),children:i(P.label)},P.id))}),n.jsxs("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto py-1",children:[c==="idea"&&n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-xs text-muted-foreground",children:W?i("sandbox.generatePost.ideaHintInPillar",{pillar:W.title}):i("sandbox.generatePost.ideaHint")}),z.length>0&&n.jsx(St,{options:z.map(P=>P.title).filter(Boolean),value:G?.title??"",emptyLabel:i("sandbox.generatePost.writeAnIdea"),onChange:P=>{const q=z.find(ne=>ne.title===P);u(q?.key??""),f(q?.title??""),b(q?.body??"")}}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(Me,{htmlFor:"generate-idea-title",children:i("sandbox.generatePost.ideaTitleLabel")}),n.jsx(Ze,{id:"generate-idea-title",value:m,onChange:P=>{u(""),f(P.target.value)},placeholder:i("sandbox.generatePost.ideaTitlePlaceholder")})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(Me,{htmlFor:"generate-idea-body",children:i("sandbox.generatePost.ideaBodyLabel")}),n.jsx(It,{id:"generate-idea-body",value:p,onChange:P=>b(P.target.value),placeholder:i("sandbox.generatePost.ideaBodyPlaceholder"),rows:3})]}),n.jsx(qi,{label:i("sandbox.generatePost.suggestIdeas"),hint:i("sandbox.generatePost.suggestIdeasHint"),disabled:!o||M,busy:M,onSuggest:oe}),n.jsx(Wi,{suggestions:h,onPick:P=>{f(P.title),b(P.body)}})]}),c==="format"&&n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.formatHint")}),n.jsx(St,{options:I.map(P=>P.name),value:j,onChange:P=>{k(P),w(I.find(q=>q.name===P)?.value??"")}}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(Me,{htmlFor:"generate-format-name",children:i("sandbox.generatePost.formatNameLabel")}),n.jsx(Ze,{id:"generate-format-name",value:j,onChange:P=>k(P.target.value),placeholder:i("sandbox.generatePost.formatNamePlaceholder")})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(Me,{htmlFor:"generate-format-value",children:i("sandbox.generatePost.formatValueLabel")}),n.jsx(It,{id:"generate-format-value",value:S,onChange:P=>w(P.target.value),placeholder:i("sandbox.generatePost.formatValuePlaceholder"),rows:4})]})]}),c==="extra"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(Me,{htmlFor:"generate-category",children:i("sandbox.generatePost.categoryLabel")}),n.jsx(St,{options:D.map(P=>P.name),value:D.find(P=>P.slug===_)?.name??"",emptyLabel:i("sandbox.generatePost.inferIt"),onChange:P=>E(D.find(q=>q.name===P)?.slug??"")})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(Me,{htmlFor:"generate-author",children:i("sandbox.generatePost.authorLabel")}),n.jsx(St,{options:U.map(P=>P.name),value:U.find(P=>P.email===N)?.name??"",emptyLabel:i("sandbox.generatePost.inferIt"),onChange:P=>B(U.find(q=>q.name===P)?.email??"")})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(Me,{htmlFor:"generate-extra",children:i("sandbox.generatePost.extraLabel")}),n.jsx(It,{id:"generate-extra",value:R,onChange:P=>L(P.target.value),placeholder:i("sandbox.generatePost.extraPlaceholder"),rows:3})]}),n.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.inferHint")})]})]}),n.jsxs(pt,{className:"shrink-0 sm:justify-between",children:[n.jsx(Ae,{type:"button",variant:"outline",disabled:ie===0,onClick:()=>d(ae[ie-1].id),children:i("sandbox.generatePost.back")}),ue?n.jsxs(Ae,{type:"button",disabled:!o,onClick:ee,children:[n.jsx(nt,{size:14}),i("sandbox.generatePost.generate")]}):n.jsx(Ae,{type:"button",disabled:!te,onClick:()=>d(ae[ie+1].id),children:i("sandbox.generatePost.next")})]})]})]})})}function qi(s){const e=le.c(12),{label:t,hint:o,disabled:a,busy:l,onSuggest:i}=s;let r;e[0]!==o?(r=n.jsx("p",{className:"text-xs text-muted-foreground",children:o}),e[0]=o,e[1]=r):r=e[1];let c;e[2]!==l?(c=l?n.jsx(Nt,{size:14,className:"animate-spin"}):n.jsx(nt,{size:14}),e[2]=l,e[3]=c):c=e[3];let d;e[4]!==a||e[5]!==t||e[6]!==i||e[7]!==c?(d=n.jsxs(Ae,{type:"button",variant:"outline",size:"sm",disabled:a,onClick:i,children:[c,t]}),e[4]=a,e[5]=t,e[6]=i,e[7]=c,e[8]=d):d=e[8];let g;return e[9]!==r||e[10]!==d?(g=n.jsxs("div",{className:"flex items-center justify-between gap-3 border-t pt-3",children:[r,d]}),e[9]=r,e[10]=d,e[11]=g):g=e[11],g}function Wi(s){const e=le.c(7),{suggestions:t,onPick:o}=s;if(t.length===0)return null;let a;if(e[0]!==o||e[1]!==t){let i;e[3]!==o?(i=r=>n.jsx("li",{children:n.jsxs("button",{type:"button",onClick:()=>o(r),className:"w-full cursor-pointer rounded-lg border bg-card p-2.5 text-left transition-colors hover:border-primary/40",children:[n.jsx("p",{className:"text-sm font-medium",children:r.title}),n.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:r.body})]})},r.title),e[3]=o,e[4]=i):i=e[4],a=t.map(i),e[0]=o,e[1]=t,e[2]=a}else a=e[2];let l;return e[5]!==a?(l=n.jsx("ul",{className:"space-y-1.5",children:a}),e[5]=a,e[6]=l):l=e[6],l}const Yi=["Heading","Paragraph","List","Quote","Callout","Cta","Divider"];function Qi(s){return Yi.includes(s)}function Ji({orgSlug:s,virtualMcpId:e,branch:t,decofile:o,meta:a,onStarted:l}){const i=je(),r=ks(),c=jo(),d=es({orgSlug:s,virtualMcpId:e,branch:t});return async g=>{const u=qt(vs()),m={ideaKey:g.idea.key,pillarKey:g.pillar?.key,pillarTitle:g.pillar?.title,format:g.format,brief:g.idea.body},f=Ht(to({title:g.idea.title,planning:m,now:new Date}),"generating",new Date);await d.mutateAsync({blockKey:u,data:ct(u,f)}),l?.(u);const p=o[Ls],b=g.category?[g.category]:Ue(o,"categories").map(({payload:y})=>({name:Se(y.name),slug:Se(y.slug)})).filter(y=>y.slug),h=g.author?[g.author]:Yn(o);try{const y=await r.call("BLOG_POST_DRAFT",{brand:{companyName:Se(p?.companyName),description:Se(p?.description),language:Se(p?.language),tone:Se(p?.tone),targetAudience:Se(p?.targetAudience),values:Ve(ze(p?.values)),dos:Ve(ze(p?.dos)),avoid:Ve(ze(p?.avoid))},pillar:g.pillar?{title:g.pillar.title,body:g.pillar.body}:void 0,theme:{title:g.idea.title,body:g.idea.body},format:g.format,sections:Ci(a,{hideDefaults:c}).filter(k=>Qi(k.name)).map(k=>({type:k.name,purpose:k.description})),categories:b,authors:h.map(({name:k,email:S})=>({name:k,email:S})),extraInstructions:g.extraInstructions?.trim()||void 0}),j=Li({draft:y,resolveTypes:go(a,{hideDefaults:c}),categories:b,authors:h,planning:m,takenSlugs:Xn(o).map(k=>k.slug),now:new Date});await d.mutateAsync({blockKey:u,data:ct(u,j)}),me.success(i("sandbox.generatePost.done",{title:y.title}))}catch(y){await d.mutateAsync({blockKey:u,data:ct(u,Ht(f,"draft",new Date))}),me.error(y instanceof Error?y.message:i("sandbox.generatePost.failed"))}}}const Xi=/<(h[1-6]|p|ul|ol|div|img|br|blockquote|section|article|figure)\b|<\/[a-z]/i;function ko(s){return Xi.test(s)}function Zi(s){const e=s.trim();return e?ko(e)?ir(e):cr(e):{title:"",sections:[]}}function Os(s){return s.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/�?39;|'/gi,"'").replace(/&/gi,"&")}function kt(s){let e=s,t;do t=e,e=e.replace(/<[^>]+>/g,"");while(e!==t);return Os(e).replace(/\s+/g," ").trim()}function er(s){let e=s,t;do t=e,e=e.replace(/<!--[\s\S]*?-->/g,"");while(e!==t);return e}function tr(s){let e=s,t;do t=e,e=e.replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/gi,"");while(e!==t);return e}function So(s){let e=s,t;do t=e,e=tr(er(e));while(e!==t);return e}const sr=/^(a|b|strong|i|em|u|s|code|br|span|sub|sup)$/;function Jt(s){let e="";for(const t of s)t.charCodeAt(0)>31&&(e+=t);return e=e.trim(),!/^[a-z][a-z0-9+.-]*:/i.test(e)||/^(https?|mailto|tel):/i.test(e)}function nr(s){return s.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}const or=/^<\/?([a-z][a-z0-9]*)\b([^>]*)>/i;function ar(s,e,t){const o=e.toLowerCase();if(!sr.test(o))return"";if(s.startsWith("</"))return`</${o}>`;if(o!=="a")return`<${o}>`;const a=Os(t.match(/href\s*=\s*"([^"]*)"/i)?.[1]??"");return Jt(a)&&a?`<a href="${nr(a)}">`:"<a>"}function wo(s){const e=So(s);let t="",o=0;for(;o<e.length;){const a=e.indexOf("<",o);if(a===-1){t+=e.slice(o);break}t+=e.slice(o,a);const l=or.exec(e.slice(a));if(!l){t+="<",o=a+1;continue}t+=ar(l[0],l[1]??"",l[2]??""),o=a+l[0].length}return t}function $t(s,e){const t=s.match(new RegExp(`${e}\\s*=\\s*"([^"]*)"`,"i"));return t?.[1]?Os(t[1]):""}const lr=/<(h[1-6]|p|ul|ol|blockquote|figure)\b[^>]*>([\s\S]*?)<\/\1\s*>|<hr\b[^>]*\/?>|<img\b[^>]*>/gi;function ir(s){const e=So(s);let t="";const o=[];for(const a of e.matchAll(lr)){const l=a[1]?.toLowerCase(),i=a[2]??"",r=a[0];if(!l){if(/^<img/i.test(r)){const c=$t(r,"src");c&&Jt(c)&&o.push({kind:"image",url:c,alt:$t(r,"alt"),caption:""})}else o.push({kind:"divider"});continue}if(/^h[1-6]$/.test(l)){const c=kt(i);if(!c)continue;if(l==="h1"&&!t){t=c;continue}o.push({kind:"heading",text:c,level:l.slice(1)})}else if(l==="p"){const c=wo(i.trim());kt(c)&&o.push({kind:"paragraph",html:c})}else if(l==="ul"||l==="ol"){const c=[...i.matchAll(/<li\b[^>]*>([\s\S]*?)<\/li\s*>/gi)].map(d=>kt(d[1]??"")).filter(Boolean);c.length&&o.push({kind:"list",items:c,ordered:l==="ol"})}else if(l==="blockquote"){const c=kt(i);c&&o.push({kind:"quote",text:c})}else if(l==="figure"){const c=i.match(/<img\b[^>]*>/i)?.[0],d=c?$t(c,"src"):"",g=kt(i.match(/<figcaption\b[^>]*>([\s\S]*?)<\/figcaption\s*>/i)?.[1]??"");d&&Jt(d)&&o.push({kind:"image",url:d,alt:c?$t(c,"alt"):"",caption:g})}}return{title:t,sections:o}}function rr(s){return s.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,'<a href="$2">$1</a>').replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/(^|[^*])\*([^*]+)\*/g,"$1<em>$2</em>").replace(/`([^`]+)`/g,"<code>$1</code>")}function cr(s){const e=s.replace(/\r\n?/g,`
|
|
5
5
|
`).split(`
|
|
6
6
|
`);let t="";const o=[];let a=[],l=null,i=[];const r=()=>{a.length&&(o.push({kind:"paragraph",html:wo(rr(a.join(" ")))}),a=[])},c=()=>{l&&(o.push({kind:"list",items:l.items,ordered:l.ordered}),l=null)},d=()=>{i.length&&(o.push({kind:"quote",text:i.join(" ")}),i=[])},g=()=>{r(),c(),d()};for(const u of e){const m=u.trimEnd(),f=m.match(/^(#{1,6})\s+(.*)$/),p=m.match(/^!\[([^\]]*)\]\(([^)\s]+)\)\s*$/),b=m.match(/^\s*(?:[-*+]|\d+\.)\s+(.*)$/),h=/^\s*\d+\./.test(m),y=m.match(/^>\s?(.*)$/);if(!m.trim())g();else if(f){g();const j=f[2]?.trim()??"",k=String(f[1]?.length??1);k==="1"&&!t?t=j:j&&o.push({kind:"heading",text:j,level:k})}else if(/^(-{3,}|\*{3,}|_{3,})$/.test(m.trim()))g(),o.push({kind:"divider"});else if(p){g();const j=p[2]??"";Jt(j)&&o.push({kind:"image",url:j,alt:p[1]??"",caption:""})}else b?(r(),d(),l||(l={items:[],ordered:h}),l.items.push(b[1]?.trim()??"")):y?(r(),c(),i.push(y[1]?.trim()??"")):(c(),d(),a.push(m.trim()))}return g(),{title:t,sections:o}}const dr={heading:"Heading",paragraph:"Paragraph",list:"List",quote:"Quote",divider:"Divider",image:"BlockImage"};function ur(s,e){const t=[];for(const o of s){const a=e[dr[o.kind]];if(a)switch(o.kind){case"heading":t.push({__resolveType:a,text:o.text,level:o.level});break;case"paragraph":t.push({__resolveType:a,html:o.html});break;case"list":t.push({__resolveType:a,items:o.items.join(`
|
|
7
7
|
`),style:o.ordered?"ordered":"unordered"});break;case"quote":t.push({__resolveType:a,quote:o.text});break;case"divider":t.push({__resolveType:a});break;case"image":t.push({__resolveType:a,url:o.url,alt:o.alt,caption:o.caption,size:"normal"});break}}return t}function mr({title:s,blocks:e,takenSlugs:t,now:o}){const a=s.trim();return{title:a,slug:a?bo(a,t):ho(""),date:o.toISOString().slice(0,10),excerpt:"",image:"",alt:"",authors:[],categories:[],sections:e,status:"in_review"}}const ln="__all__",rn={"date-desc":"sandbox.postToolbar.sortNewestFirst","date-asc":"sandbox.postToolbar.sortOldestFirst",az:"sandbox.postToolbar.sortTitleAZ",za:"sandbox.postToolbar.sortTitleZA"},fr={"date-desc":"sandbox.postToolbar.sortNewest","date-asc":"sandbox.postToolbar.sortOldest",az:"sandbox.postToolbar.sortAZ",za:"sandbox.postToolbar.sortZA"},cn="status:";function dn(s){if(!s.startsWith(cn))return null;const e=s.slice(cn.length);return As.includes(e)?e:null}const un=A.forwardRef(function(e,t){const o=le.c(20);let a,l,i,r,c;o[0]!==e?({icon:a,active:l,value:c,className:i,...r}=e,o[0]=e,o[1]=a,o[2]=l,o[3]=i,o[4]=r,o[5]=c):(a=o[1],l=o[2],i=o[3],r=o[4],c=o[5]);const d=l?"text-foreground":"text-muted-foreground";let g;o[6]!==i||o[7]!==d?(g=ye("h-7 gap-1 px-1.5 text-xs",d,i),o[6]=i,o[7]=d,o[8]=g):g=o[8];let u;o[9]!==a?(u=n.jsx(a,{size:14,className:"shrink-0"}),o[9]=a,o[10]=u):u=o[10];let m;o[11]!==c?(m=c&&n.jsx("span",{className:"min-w-0 flex-1 truncate",children:c}),o[11]=c,o[12]=m):m=o[12];let f;o[13]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Bt,{size:12,className:"shrink-0 opacity-60"}),o[13]=f):f=o[13];let p;return o[14]!==r||o[15]!==t||o[16]!==g||o[17]!==u||o[18]!==m?(p=n.jsxs(Ae,{ref:t,type:"button",variant:"ghost",size:"sm",className:g,...r,children:[u,m,f]}),o[14]=r,o[15]=t,o[16]=g,o[17]=u,o[18]=m,o[19]=p):p=o[19],p});function Rs(s){const e=le.c(2),{count:t}=s;let o;return e[0]!==t?(o=n.jsx("span",{className:"ml-auto pl-3 text-xs text-muted-foreground tabular-nums",children:t}),e[0]=t,e[1]=o):o=e[1],o}function pr(s){const e=le.c(19),{value:t,onChange:o}=s,a=je();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(ws,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[0]=l):l=e[0];let i;e[1]!==o?(i=m=>o(m.target.value),e[1]=o,e[2]=i):i=e[2];let r;e[3]!==a?(r=a("sandbox.postToolbar.searchPlaceholder"),e[3]=a,e[4]=r):r=e[4];let c;e[5]!==a?(c=a("sandbox.postToolbar.searchAriaLabel"),e[5]=a,e[6]=c):c=e[6];let d;e[7]!==i||e[8]!==r||e[9]!==c||e[10]!==t?(d=n.jsx("input",{type:"text",value:t,onChange:i,placeholder:r,"aria-label":c,className:"min-w-0 flex-1 bg-transparent py-0.5 text-sm outline-none placeholder:text-muted-foreground"}),e[7]=i,e[8]=r,e[9]=c,e[10]=t,e[11]=d):d=e[11];let g;e[12]!==o||e[13]!==a||e[14]!==t?(g=t&&n.jsx(No,{label:a("sandbox.postToolbar.clearSearch"),onClick:()=>o("")}),e[12]=o,e[13]=a,e[14]=t,e[15]=g):g=e[15];let u;return e[16]!==d||e[17]!==g?(u=n.jsxs("div",{className:"flex items-center gap-2 border-b px-2.5 py-1.5",children:[l,d,g]}),e[16]=d,e[17]=g,e[18]=u):u=e[18],u}function gr(s){const e=le.c(100),{categories:t,authors:o,statusCounts:a,categoryFilter:l,authorFilter:i,statusFilter:r,sort:c,onCategoryFilterChange:d,onAuthorFilterChange:g,onStatusFilterChange:u,onSortChange:m}=s,f=je();let p;if(e[0]!==t||e[1]!==l){let v;e[3]!==l?(v=V=>V.slug===l,e[3]=l,e[4]=v):v=e[4],p=t.find(v),e[0]=t,e[1]=l,e[2]=p}else p=e[2];const b=p;let h;if(e[5]!==i||e[6]!==o){let v;e[8]!==i?(v=V=>V.email===i,e[8]=i,e[9]=v):v=e[9],h=o.find(v),e[5]=i,e[6]=o,e[7]=h}else h=e[7];const y=h,j=!!(l||i||r);let k;e[10]!==y?.name||e[11]!==b?.name||e[12]!==r||e[13]!==f?(k=b?.name??y?.name??f(r?Et[r]:"sandbox.postToolbar.filterLabel"),e[10]=y?.name,e[11]=b?.name,e[12]=r,e[13]=f,e[14]=k):k=e[14];const S=k,w=l?`cat:${l}`:i?`author:${i}`:r?`status:${r}`:ln;let _;e[15]!==g||e[16]!==d||e[17]!==u?(_=()=>{d(null),g(null),u(null)},e[15]=g,e[16]=d,e[17]=u,e[18]=_):_=e[18];const E=_;let N;e[19]!==E||e[20]!==g||e[21]!==d||e[22]!==u?(N=v=>{v.startsWith("cat:")?(g(null),u(null),d(v.slice(4))):v.startsWith("author:")?(d(null),u(null),g(v.slice(7))):dn(v)?(d(null),g(null),u(dn(v))):E()},e[19]=E,e[20]=g,e[21]=d,e[22]=u,e[23]=N):N=e[23];const B=N;let R;e[24]!==S||e[25]!==j?(R=n.jsx(Kt,{asChild:!0,children:n.jsx(un,{icon:Go,active:j,value:S,className:"min-w-0 shrink"})}),e[24]=S,e[25]=j,e[26]=R):R=e[26];let L;e[27]!==f?(L=f("sandbox.postToolbar.filterBy"),e[27]=f,e[28]=L):L=e[28];let M;e[29]!==L?(M=n.jsx(yt,{children:L}),e[29]=L,e[30]=M):M=e[30];let F;e[31]!==f?(F=f("sandbox.postToolbar.allPosts"),e[31]=f,e[32]=F):F=e[32];let T;e[33]!==F?(T=n.jsx(wt,{value:ln,children:F}),e[33]=F,e[34]=T):T=e[34];let $;e[35]!==f?($=f("sandbox.postToolbar.statusLabel"),e[35]=f,e[36]=$):$=e[36];let K;e[37]!==$?(K=n.jsx(yt,{className:"text-muted-foreground/70",children:$}),e[37]=$,e[38]=K):K=e[38];let z;e[39]!==a||e[40]!==f?(z=As.map(v=>n.jsxs(wt,{value:`status:${v}`,children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:f(Et[v])}),n.jsx(Rs,{count:a[v]??0})]},`status:${v}`)),e[39]=a,e[40]=f,e[41]=z):z=e[41];let G;e[42]!==t.length||e[43]!==f?(G=t.length>0&&n.jsx(yt,{className:"text-muted-foreground/70",children:f("sandbox.postToolbar.categoryLabel")}),e[42]=t.length,e[43]=f,e[44]=G):G=e[44];let W;e[45]!==t?(W=t.map(xr),e[45]=t,e[46]=W):W=e[46];let O;e[47]!==o.length||e[48]!==f?(O=o.length>0&&n.jsx(yt,{className:"text-muted-foreground/70",children:f("sandbox.postToolbar.authorLabel")}),e[47]=o.length,e[48]=f,e[49]=O):O=e[49];let I;e[50]!==o?(I=o.map(hr),e[50]=o,e[51]=I):I=e[51];let D;e[52]!==w||e[53]!==B||e[54]!==T||e[55]!==K||e[56]!==z||e[57]!==G||e[58]!==W||e[59]!==O||e[60]!==I?(D=n.jsxs(Is,{value:w,onValueChange:B,children:[T,K,z,G,W,O,I]}),e[52]=w,e[53]=B,e[54]=T,e[55]=K,e[56]=z,e[57]=G,e[58]=W,e[59]=O,e[60]=I,e[61]=D):D=e[61];let U;e[62]!==D||e[63]!==M?(U=n.jsxs(zt,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[M,D]}),e[62]=D,e[63]=M,e[64]=U):U=e[64];let J;e[65]!==U||e[66]!==R?(J=n.jsxs(Mt,{children:[R,U]}),e[65]=U,e[66]=R,e[67]=J):J=e[67];let Z;e[68]!==E||e[69]!==j||e[70]!==f?(Z=j&&n.jsx(No,{label:f("sandbox.postToolbar.clearFilter"),onClick:E}),e[68]=E,e[69]=j,e[70]=f,e[71]=Z):Z=e[71];const oe=fr[c];let ae;e[72]!==f||e[73]!==oe?(ae=f(oe),e[72]=f,e[73]=oe,e[74]=ae):ae=e[74];let ie;e[75]!==ae?(ie=n.jsx(Kt,{asChild:!0,children:n.jsx(un,{icon:Uo,active:!0,value:ae})}),e[75]=ae,e[76]=ie):ie=e[76];let te;e[77]!==f?(te=f("sandbox.postToolbar.sortBy"),e[77]=f,e[78]=te):te=e[78];let ue;e[79]!==te?(ue=n.jsx(yt,{children:te}),e[79]=te,e[80]=ue):ue=e[80];let ee;e[81]!==m?(ee=v=>m(v),e[81]=m,e[82]=ee):ee=e[82];let P;e[83]===Symbol.for("react.memo_cache_sentinel")?(P=Object.keys(rn),e[83]=P):P=e[83];let q;e[84]!==f?(q=P.map(v=>n.jsx(wt,{value:v,children:f(rn[v])},v)),e[84]=f,e[85]=q):q=e[85];let ne;e[86]!==c||e[87]!==ee||e[88]!==q?(ne=n.jsx(Is,{value:c,onValueChange:ee,children:q}),e[86]=c,e[87]=ee,e[88]=q,e[89]=ne):ne=e[89];let se;e[90]!==ue||e[91]!==ne?(se=n.jsxs(zt,{align:"end",className:"w-44",children:[ue,ne]}),e[90]=ue,e[91]=ne,e[92]=se):se=e[92];let re;e[93]!==ie||e[94]!==se?(re=n.jsx("div",{className:"ml-auto shrink-0",children:n.jsxs(Mt,{children:[ie,se]})}),e[93]=ie,e[94]=se,e[95]=re):re=e[95];let ce;return e[96]!==J||e[97]!==Z||e[98]!==re?(ce=n.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[J,Z,re]}),e[96]=J,e[97]=Z,e[98]=re,e[99]=ce):ce=e[99],ce}function hr(s){return n.jsxs(wt,{value:`author:${s.email}`,children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.name}),n.jsx(Rs,{count:s.count})]},`author:${s.email}`)}function xr(s){return n.jsxs(wt,{value:`cat:${s.slug}`,children:[n.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.name}),n.jsx(Rs,{count:s.count})]},`cat:${s.slug}`)}function No(s){const e=le.c(4),{label:t,onClick:o}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ds,{size:12}),e[0]=a):a=e[0];let l;return e[1]!==t||e[2]!==o?(l=n.jsx("button",{type:"button","aria-label":t,onClick:o,className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer rounded-lg",children:a}),e[1]=t,e[2]=o,e[3]=l):l=e[3],l}function br(s){const e=le.c(18),{checked:t,disabled:o,onToggle:a}=s,l=je();let i;e[0]!==a?(i=()=>a(),e[0]=a,e[1]=i):i=e[1];let r;e[2]!==t||e[3]!==l?(r=l(t?"sandbox.postToolbar.deselectAllPosts":"sandbox.postToolbar.selectAllPosts"),e[2]=t,e[3]=l,e[4]=r):r=e[4];let c;e[5]!==t||e[6]!==o||e[7]!==i||e[8]!==r?(c=n.jsx(qe,{asChild:!0,children:n.jsx("span",{className:"flex shrink-0 items-center px-1.5",onClick:yr,children:n.jsx(ts,{checked:t,disabled:o,onCheckedChange:i,"aria-label":r})})}),e[5]=t,e[6]=o,e[7]=i,e[8]=r,e[9]=c):c=e[9];let d;e[10]!==t||e[11]!==l?(d=l(t?"sandbox.postToolbar.deselectAll":"sandbox.postToolbar.selectAll"),e[10]=t,e[11]=l,e[12]=d):d=e[12];let g;e[13]!==d?(g=n.jsx(We,{side:"bottom",children:d}),e[13]=d,e[14]=g):g=e[14];let u;return e[15]!==c||e[16]!==g?(u=n.jsxs(Ye,{children:[c,g]}),e[15]=c,e[16]=g,e[17]=u):u=e[17],u}function yr(s){return s.stopPropagation()}function vr(s){const e=le.c(42),{count:t,allSelected:o,onToggleSelectAll:a,onArchive:l,onExit:i}=s,r=je();let c;e[0]!==o||e[1]!==a?(c=n.jsx(br,{checked:o,onToggle:a}),e[0]=o,e[1]=a,e[2]=c):c=e[2];let d;e[3]!==t||e[4]!==r?(d=r("sandbox.postToolbar.itemsSelected",{count:t}),e[3]=t,e[4]=r,e[5]=d):d=e[5];let g;e[6]!==d?(g=n.jsx("span",{className:"text-xs font-medium tabular-nums",children:d}),e[6]=d,e[7]=g):g=e[7];const u=t===0;let m;e[8]!==r?(m=r("sandbox.postToolbar.archiveSelectedPosts"),e[8]=r,e[9]=m):m=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Lo,{size:14}),e[10]=f):f=e[10];let p;e[11]!==l||e[12]!==u||e[13]!==m?(p=n.jsx(qe,{asChild:!0,children:n.jsx(Ae,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",disabled:u,onClick:l,"aria-label":m,children:f})}),e[11]=l,e[12]=u,e[13]=m,e[14]=p):p=e[14];let b;e[15]!==r?(b=r("sandbox.postToolbar.archiveSelected"),e[15]=r,e[16]=b):b=e[16];let h;e[17]!==b?(h=n.jsx(We,{side:"bottom",children:b}),e[17]=b,e[18]=h):h=e[18];let y;e[19]!==p||e[20]!==h?(y=n.jsxs(Ye,{children:[p,h]}),e[19]=p,e[20]=h,e[21]=y):y=e[21];let j;e[22]!==r?(j=r("sandbox.postToolbar.exitSelection"),e[22]=r,e[23]=j):j=e[23];let k;e[24]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(Ds,{size:14}),e[24]=k):k=e[24];let S;e[25]!==i||e[26]!==j?(S=n.jsx(qe,{asChild:!0,children:n.jsx(Ae,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,"aria-label":j,children:k})}),e[25]=i,e[26]=j,e[27]=S):S=e[27];let w;e[28]!==r?(w=r("sandbox.postToolbar.exitSelection"),e[28]=r,e[29]=w):w=e[29];let _;e[30]!==w?(_=n.jsx(We,{side:"bottom",children:w}),e[30]=w,e[31]=_):_=e[31];let E;e[32]!==S||e[33]!==_?(E=n.jsxs(Ye,{children:[S,_]}),e[32]=S,e[33]=_,e[34]=E):E=e[34];let N;e[35]!==y||e[36]!==E?(N=n.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[y,E]}),e[35]=y,e[36]=E,e[37]=N):N=e[37];let B;return e[38]!==c||e[39]!==N||e[40]!==g?(B=n.jsxs("div",{className:"flex items-center gap-0.5 border-b bg-accent/40 px-2 py-1.5",children:[c,g,N]}),e[38]=c,e[39]=N,e[40]=g,e[41]=B):B=e[41],B}const jr={draft:"outline",generating:"secondary",awaiting_review:"warning",scheduled:"secondary",published:"success",archived:"outline"},mn="generating",fn=s=>s.scheduledDatetime||s.date||"",kr=(s,e)=>fn(e).localeCompare(fn(s)),Sr=s=>s==="scheduled"||s==="published",Co="application/x-post-key";function wr({orgSlug:s,virtualMcpId:e,branch:t,decofile:o,view:a,selectedKey:l,onViewChange:i,onOpen:r,onClose:c,move:d,meta:g,renderDetail:u}){const m=je(),f=ks(),p=es({orgSlug:s,virtualMcpId:e,branch:t}),b=ml().length>0,h=jo(),[y,j]=A.useState(null),[k,S]=A.useState(!1),[w,_]=A.useState(!1),[E,N]=A.useState(""),[B,R]=A.useState(3),[L,M]=A.useState(""),[F,T]=A.useState(!1),[$,K]=A.useState(!1),[z,G]=A.useState(),[W,O]=A.useState(!1),[I,D]=A.useState(""),U=A.useRef(null),[J,Z]=A.useState({}),oe=(C,X)=>J[C]??X,ae=(C,X)=>Z(Ne=>({...Ne,[C]:X})),ie=Ji({orgSlug:s,virtualMcpId:e,branch:t,decofile:o,meta:g,onStarted:r}),te=ci(o),ue=ro(o),ee=uo(o),P=C=>rt(o[C],"posts"),q=l&&te.some(C=>C.key===l)?l:te[0]?.key??null,ne=async C=>{await d.apply(C.key,"archived")&&me.success(m("sandbox.postBoard.archived"))},[se,re]=A.useState(null),[ce,v]=A.useState(null),[V,fe]=A.useState(null),[ge,ve]=A.useState("date-desc"),[he,De]=A.useState(""),[ke,Pe]=A.useState(new Set),Te=te.reduce((C,X)=>(C[X.status]=(C[X.status]??0)+1,C),{}),Be=C=>{const X=new Map;for(const Ne of te)for(const Ge of C(Ne))X.set(Ge,(X.get(Ge)??0)+1);return X},_e=Be(C=>C.categorySlugs),be=Be(C=>C.authorEmails),Le=Ue(o,"categories").map(({payload:C})=>({slug:Se(C.slug),name:Se(C.name)||Se(C.slug),count:_e.get(Se(C.slug))??0})),Ie=Ue(o,"authors").map(({payload:C})=>({email:Se(C.email),name:Se(C.name)||Se(C.email),count:be.get(Se(C.email))??0})),H=he.trim().toLowerCase(),xe=te.filter(C=>!se||C.categorySlugs.includes(se)).filter(C=>!ce||C.authorEmails.includes(ce)).filter(C=>!V||C.status===V).filter(C=>!H||C.title.toLowerCase().includes(H)||C.slug.toLowerCase().includes(H)).sort((C,X)=>{if(ge==="az")return C.title.localeCompare(X.title);if(ge==="za")return X.title.localeCompare(C.title);const Ne=(C.scheduledDatetime||C.date).localeCompare(X.scheduledDatetime||X.date);return ge==="date-asc"?Ne:-Ne}),we=ke.size>0,Re=C=>Pe(X=>{const Ne=new Set(X);return Ne.delete(C)||Ne.add(C),Ne}),rs=()=>Pe(C=>xe.every(X=>C.has(X.key))?new Set:new Set(xe.map(X=>X.key))),cs=async()=>{let C=0;for(const X of ke)await d.apply(X,"archived")&&(C+=1);Pe(new Set),C>0&&me.success(m("sandbox.postBoard.archived"))},ds=(C,X)=>{j(null),d.apply(X,C)},Dt=()=>{const C=qt(vs()),X=to({title:"",now:new Date});p.mutate({blockKey:C,data:ct(C,X)}),r(C)},us=()=>{const C=Zi(I),X=ur(C.sections,go(g,{hideDefaults:h}));if(X.length===0&&!C.title.trim()){me.error(m("sandbox.postBoard.importEmpty"));return}const Ne=qt(vs()),Ge=mr({title:C.title,blocks:X,takenSlugs:te.map(Ee=>Ee.slug).filter(Boolean),now:new Date});p.mutate({blockKey:Ne,data:ct(Ne,Ge)}),O(!1),D(""),me.success(m("sandbox.postBoard.imported")),r(Ne)},ms=async()=>{S(!0);const C=ee.find(X=>X.key===L);try{const X=o[Ls]??{},Ne=o[mo],Ge=ze(Ne?.formats).map(Ke=>Ke.name).filter(Boolean),Ee=await f.call("BLOG_THEME_SUGGEST",{brand:{companyName:Se(X.companyName),description:Se(X.description),language:Se(X.language),tone:Se(X.tone),targetAudience:Se(X.targetAudience),values:Ve(ze(X.values)),dos:Ve(ze(X.dos)),avoid:Ve(ze(X.avoid))},existingTitles:ue.map(Ke=>Ke.title).filter(Boolean),formats:Ge,guidance:[C&&`Every idea must be one angle inside the pillar "${C.title}": ${C.body}`,E.trim()].filter(Boolean).join(`
|
|
8
8
|
|
|
9
|
-
`)||void 0,count:B}),_t=Bi(ue.map(Ke=>Ke.title),Ee.themes);if(_t.length===0){me.info(m("sandbox.postBoard.ideasFailed"));return}let bt=0;for(const Ke of _t){const At=Si();try{await p.mutateAsync({blockKey:At,data:wi(At,{title:Ke.title,body:Ke.body,pillarKey:C?.key,createdAt:new Date().toISOString()})}),bt++}catch(x){console.warn("[posts] could not save a generated idea",x)}}if(bt===0){me.error(m("sandbox.postBoard.ideasFailed"));return}me.success(m("sandbox.postBoard.ideasAdded",{count:String(bt)}))}catch(X){me.error(X instanceof Error?X.message:m("sandbox.postBoard.ideasFailed"))}finally{S(!1)}};return n.jsxs("div",{className:"relative flex h-full min-w-0 flex-col",children:[n.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b px-6 py-3",children:[n.jsx("div",{className:"flex items-center gap-3",children:n.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",children:[n.jsx(pn,{active:a==="list",onClick:()=>i("list"),icon:n.jsx(Xo,{size:14}),label:m("sandbox.postBoard.viewList")}),n.jsx(pn,{active:a==="board",onClick:()=>i("board"),icon:n.jsx(Ho,{size:14}),label:m("sandbox.postBoard.viewBoard")})]})}),n.jsxs("div",{className:"flex items-center gap-2",children:[k&&n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","aria-live":"polite",role:"status",children:[n.jsx(Nt,{size:12,className:"animate-spin"}),m("sandbox.postBoard.generatingLabel")]}),n.jsxs(it,{open:w,onOpenChange:_,children:[n.jsx(sl,{asChild:!0,children:n.jsxs(Ae,{type:"button",variant:"outline",size:"sm",disabled:!0,children:[n.jsx(nt,{size:14}),m("sandbox.postBoard.generateIdeas"),n.jsx(mt,{variant:"secondary",children:m("common.soon")})]})}),n.jsxs(lt,{className:"sm:max-w-lg",children:[n.jsxs(ft,{children:[n.jsx(at,{children:m("sandbox.postBoard.generateIdeas")}),n.jsx(Ut,{children:m("sandbox.postBoard.ideaGuidanceLabel")})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx(It,{id:"idea-guidance",value:E,rows:6,autoFocus:!0,onChange:C=>N(C.target.value),placeholder:m("sandbox.postBoard.ideaGuidancePlaceholder"),className:"resize-none text-sm"}),ee.length>0&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(Me,{className:"text-xs",children:m("sandbox.postBoard.ideaPillarLabel")}),n.jsx(St,{options:ee.map(C=>C.title),value:ee.find(C=>C.key===L)?.title??"",emptyLabel:m("sandbox.postBoard.ideaNoPillar"),onChange:C=>M(ee.find(X=>X.title===C)?.key??"")})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Me,{htmlFor:"idea-count",className:"text-xs",children:m("sandbox.postBoard.ideaCount")}),n.jsx(Ze,{id:"idea-count",type:"number",min:1,max:8,value:B,onChange:C=>R(Math.max(1,Math.min(8,Number(C.target.value)||1))),className:"h-9 w-16"}),n.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:m("sandbox.postBoard.usesCredits")})]})]}),n.jsx(pt,{children:n.jsxs(Ae,{type:"button",onClick:()=>{_(!1),ms()},children:[n.jsx(nt,{size:14}),m("sandbox.postBoard.generateIdeas")]})})]})]}),n.jsxs(Mt,{children:[n.jsx(Kt,{asChild:!0,children:n.jsxs(Ae,{type:"button",size:"sm",children:[n.jsx(Ns,{size:14}),m("sandbox.postBoard.newPost"),n.jsx(Bt,{size:14})]})}),n.jsxs(zt,{align:"end",className:"w-56",children:[n.jsxs(Je,{disabled:!0,onClick:()=>{G(void 0),K(!0)},children:[n.jsx(nt,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[m("sandbox.postBoard.newPostGenerate"),n.jsx(mt,{variant:"secondary",children:m("common.soon")})]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:m("sandbox.postBoard.newPostGenerateHint")})]})]}),n.jsxs(Je,{onClick:Dt,children:[n.jsx(Jo,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{children:m("sandbox.postBoard.newPostWrite")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:m("sandbox.postBoard.newPostWriteHint")})]})]}),n.jsxs(Je,{onClick:()=>O(!0),children:[n.jsx(hs,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{children:m("sandbox.postBoard.importContent")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:m("sandbox.postBoard.importContentHint")})]})]})]})]}),n.jsx(Hi,{open:$,onOpenChange:K,decofile:o,hasAi:b,seed:z,onGenerate:C=>{ie(C)}},z?.title??"scratch"),n.jsx(it,{open:W,onOpenChange:O,children:n.jsxs(lt,{className:"max-h-[85vh] sm:max-w-2xl",children:[n.jsxs(ft,{children:[n.jsx(at,{children:m("sandbox.postBoard.importTitle")}),n.jsx(Ut,{children:m("sandbox.postBoard.importDescription")})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"h-72 overflow-hidden rounded-[var(--studio-control-radius,var(--radius-xl))] border bg-[var(--studio-input-background)]",children:n.jsx(zn,{code:I,language:ko(I)?"html":"markdown",height:"100%",autoFocus:!0,onChange:C=>D(C??"")})}),n.jsx("input",{ref:U,type:"file",accept:".html,.htm,.md,.markdown,.txt",className:"hidden",onChange:async C=>{const X=C.target.files?.[0];X&&D(await X.text()),C.target.value=""}}),n.jsxs(Ae,{type:"button",variant:"outline",size:"sm",onClick:()=>U.current?.click(),children:[n.jsx(hs,{size:14}),m("sandbox.postBoard.importUpload")]})]}),n.jsx(pt,{children:n.jsxs(Ae,{type:"button",disabled:!I.trim(),onClick:us,children:[n.jsx(hs,{size:14}),m("sandbox.postBoard.importRun")]})})]})})]})]}),te.length===0?n.jsx(dl,{className:"flex-1",icon:n.jsx(nt,{size:22}),title:m("sandbox.postBoard.emptyTitle"),description:m("sandbox.postBoard.emptyDescription"),buttonProps:{children:m("sandbox.postBoard.newPost"),onClick:Dt}}):a==="board"?n.jsxs("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto p-4",children:[n.jsx(gn,{label:m("sandbox.postBoard.ideasTray")}),n.jsx(gn,{label:m(Et[mn])}),n.jsx("div",{"aria-hidden":!0,className:"my-1 w-px shrink-0 self-stretch bg-border"}),As.filter(C=>C!==mn).map(C=>{const X=m(Et[C]),Ne=te.filter(Ee=>Ee.status===C);Sr(C)&&Ne.sort(kr);const Ge=oe(C,Ne.length===0);return n.jsx("div",{onDragOver:Ee=>{Ee.preventDefault(),j(C)},onDragLeave:()=>j(Ee=>Ee===C?null:Ee),onDrop:Ee=>{Ee.preventDefault(),ds(C,Ee.dataTransfer.getData(Co))},className:ye("flex shrink-0 flex-col rounded-xl border bg-muted/30 transition-colors",Ge?"w-11":"w-72",y===C&&"border-primary bg-primary/5"),children:Ge?n.jsxs("button",{type:"button",onClick:()=>ae(C,!1),"aria-label":m("sandbox.postBoard.expandLane",{lane:X}),"aria-expanded":!1,className:"flex min-h-0 flex-1 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[n.jsx(Vt,{size:14,className:"shrink-0"}),n.jsx("span",{className:"text-xs tabular-nums",children:Ne.length}),n.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:X})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",children:[n.jsxs("button",{type:"button",onClick:()=>ae(C,!0),"aria-label":m("sandbox.postBoard.collapseLane",{lane:X}),"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[n.jsx(Bt,{size:14,className:"shrink-0"}),n.jsx("span",{className:"truncate",children:X})]}),n.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:Ne.length})]}),n.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-2 pb-2",children:Ne.length===0?n.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:m("sandbox.postBoard.laneEmpty")}):Ne.map(Ee=>n.jsx(Pr,{post:Ee,payload:P(Ee.key),moving:d.isMoving(Ee.key),onOpen:()=>r(Ee.key),onArchive:Ee.status==="archived"?void 0:()=>{ne(Ee)}},Ee.key))})]})},C)})]}):n.jsxs("div",{className:"flex min-h-0 flex-1",children:[n.jsxs("div",{className:"flex w-80 shrink-0 flex-col border-r",children:[n.jsx(pr,{value:he,onChange:De}),we?n.jsx(vr,{count:ke.size,allSelected:xe.length>0&&xe.every(C=>ke.has(C.key)),onToggleSelectAll:rs,onArchive:()=>{cs()},onExit:()=>Pe(new Set)}):n.jsx(gr,{categories:Le,authors:Ie,statusCounts:Te,categoryFilter:se,authorFilter:ce,statusFilter:V,sort:ge,onCategoryFilterChange:re,onAuthorFilterChange:v,onStatusFilterChange:fe,onSortChange:ve}),n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:n.jsx(Nr,{posts:xe,selectedKey:q,selectionActive:we,selectedKeys:ke,onToggleSelect:Re,onOpen:r,isMoving:d.isMoving,onArchive:C=>{ne(C)}})})]}),n.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:q&&u?n.jsx(A.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(Nt,{size:20,className:"animate-spin text-muted-foreground"})}),children:u(q)}):n.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:m("sandbox.postBoard.selectPrompt")})})]}),a==="board"&&l&&F&&u&&n.jsx("div",{className:"absolute inset-0 z-30 flex flex-col bg-background",children:u(l,{expanded:!0,onToggleExpand:()=>T(!1),onClose:()=>{T(!1),c?.()}})}),n.jsx(it,{open:a==="board"&&!!l&&!F,onOpenChange:C=>{C||(T(!1),c?.())},children:n.jsxs(lt,{closeButtonClassName:"hidden",className:"left-auto right-4 top-4 bottom-4 flex h-auto translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl",children:[n.jsx(at,{className:"sr-only",children:m("sandbox.collectionsSidebar.posts")}),l&&u?n.jsx(A.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(Nt,{size:20,className:"animate-spin text-muted-foreground"})}),children:u(l,{expanded:!1,onToggleExpand:()=>T(!0),onClose:()=>c?.()})}):null]})})]})}function pn(s){const e=le.c(7),{active:t,onClick:o,icon:a,label:l}=s,i=t?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground";let r;e[0]!==i?(r=ye("inline-flex cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",i),e[0]=i,e[1]=r):r=e[1];let c;return e[2]!==a||e[3]!==l||e[4]!==o||e[5]!==r?(c=n.jsxs("button",{type:"button",onClick:o,className:r,children:[a,l]}),e[2]=a,e[3]=l,e[4]=o,e[5]=r,e[6]=c):c=e[6],c}function Nr(s){const e=le.c(23),{posts:t,selectedKey:o,selectionActive:a,selectedKeys:l,onToggleSelect:i,onOpen:r,isMoving:c,onArchive:d}=s,g=je();if(t.length===0){let f;e[0]!==g?(f=g("sandbox.postList.noMatches"),e[0]=g,e[1]=f):f=e[1];let p;return e[2]!==f?(p=n.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f}),e[2]=f,e[3]=p):p=e[3],p}let u;if(e[4]!==c||e[5]!==d||e[6]!==r||e[7]!==i||e[8]!==t||e[9]!==o||e[10]!==l||e[11]!==a){let f;e[13]!==c||e[14]!==d||e[15]!==r||e[16]!==i||e[17]!==o||e[18]!==l||e[19]!==a?(f=p=>n.jsx(Cr,{post:p,selected:p.key===o,selectionActive:a,checked:l.has(p.key),onToggleSelect:()=>i(p.key),moving:c(p.key),onOpen:()=>r(p.key),onArchive:p.status==="archived"?void 0:()=>d(p)},p.key),e[13]=c,e[14]=d,e[15]=r,e[16]=i,e[17]=o,e[18]=l,e[19]=a,e[20]=f):f=e[20],u=t.map(f),e[4]=c,e[5]=d,e[6]=r,e[7]=i,e[8]=t,e[9]=o,e[10]=l,e[11]=a,e[12]=u}else u=e[12];let m;return e[21]!==u?(m=n.jsx("ul",{className:"divide-y",children:u}),e[21]=u,e[22]=m):m=e[22],m}function Cr(s){const e=le.c(60),{post:t,selected:o,selectionActive:a,checked:l,onToggleSelect:i,moving:r,onOpen:c,onArchive:d}=s,g=je(),u=t.status==="awaiting_review"&&t.missing.length>0,m=t.status==="scheduled"||t.status==="published",f=a||l?"opacity-100":"opacity-0 focus-within:opacity-100 group-hover/row:opacity-100";let p;e[0]!==f?(p=ye("absolute left-3 top-3 z-10 transition-opacity",f),e[0]=f,e[1]=p):p=e[1];let b;e[2]!==i?(b=()=>i(),e[2]=i,e[3]=b):b=e[3];let h;e[4]!==t.title||e[5]!==g?(h=t.title||g("sandbox.postBoard.untitled"),e[4]=t.title,e[5]=g,e[6]=h):h=e[6];let y;e[7]!==l||e[8]!==b||e[9]!==h?(y=n.jsx(ts,{checked:l,onCheckedChange:b,"aria-label":h}),e[7]=l,e[8]=b,e[9]=h,e[10]=y):y=e[10];let j;e[11]!==p||e[12]!==y?(j=n.jsx("span",{className:p,children:y}),e[11]=p,e[12]=y,e[13]=j):j=e[13];let k;e[14]!==r||e[15]!==d||e[16]!==a?(k=d&&!a&&n.jsx(Po,{onArchive:d,disabled:r,className:"top-2.5"}),e[14]=r,e[15]=d,e[16]=a,e[17]=k):k=e[17];let S;e[18]!==c||e[19]!==i||e[20]!==a?(S=()=>a?i():c(),e[18]=c,e[19]=i,e[20]=a,e[21]=S):S=e[21];const w=o?"bg-accent text-accent-foreground":"bg-card hover:bg-muted/50";let _;e[22]!==w?(_=ye("flex w-full cursor-pointer flex-col gap-1.5 py-2.5 pl-10 pr-3 text-left text-sm transition-colors",w),e[22]=w,e[23]=_):_=e[23];let E;e[24]!==t.title||e[25]!==g?(E=t.title||g("sandbox.postBoard.untitled"),e[24]=t.title,e[25]=g,e[26]=E):E=e[26];let N;e[27]!==E?(N=n.jsx("span",{className:"min-w-0 truncate pr-6 font-medium",children:E}),e[27]=E,e[28]=N):N=e[28];const B=jr[t.status],R=Et[t.status];let L;e[29]!==g||e[30]!==R?(L=g(R),e[29]=g,e[30]=R,e[31]=L):L=e[31];let M;e[32]!==B||e[33]!==L?(M=n.jsx(mt,{variant:B,className:"shrink-0",children:L}),e[32]=B,e[33]=L,e[34]=M):M=e[34];let F;e[35]!==u||e[36]!==t.missing?(F=u&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[n.jsx(Tt,{size:12}),t.missing.length]}),e[35]=u,e[36]=t.missing,e[37]=F):F=e[37];let T;e[38]!==t.duplicateTitle||e[39]!==g?(T=t.duplicateTitle&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",title:g("sandbox.postBoard.duplicateTitle"),children:[n.jsx(Bs,{size:12,"aria-hidden":!0}),n.jsx("span",{className:"sr-only",children:g("sandbox.postBoard.duplicateTitle")})]}),e[38]=t.duplicateTitle,e[39]=g,e[40]=T):T=e[40];let $;e[41]!==m||e[42]!==t.date||e[43]!==t.scheduledDatetime?($=m&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[n.jsx(Ss,{size:12}),(t.scheduledDatetime||t.date||"").slice(0,10)]}),e[41]=m,e[42]=t.date,e[43]=t.scheduledDatetime,e[44]=$):$=e[44];let K;e[45]!==M||e[46]!==F||e[47]!==T||e[48]!==$?(K=n.jsxs("div",{className:"flex items-center gap-2",children:[M,F,T,$]}),e[45]=M,e[46]=F,e[47]=T,e[48]=$,e[49]=K):K=e[49];let z;e[50]!==o||e[51]!==_||e[52]!==N||e[53]!==K||e[54]!==S?(z=n.jsxs("button",{type:"button",onClick:S,"aria-current":o,className:_,children:[N,K]}),e[50]=o,e[51]=_,e[52]=N,e[53]=K,e[54]=S,e[55]=z):z=e[55];let G;return e[56]!==z||e[57]!==j||e[58]!==k?(G=n.jsxs("li",{className:"group/row relative",children:[j,k,z]}),e[56]=z,e[57]=j,e[58]=k,e[59]=G):G=e[59],G}function Pr(s){const e=le.c(50),{post:t,payload:o,moving:a,onOpen:l,onArchive:i}=s,r=je(),c=t.status!=="generating"&&!a;let d;e[0]!==o?(d=ii(o),e[0]=o,e[1]=d):d=e[1];const g=d,u=!c&&"opacity-80";let m;e[2]!==u?(m=ye("group/card relative rounded-lg border bg-card shadow-sm transition-colors hover:border-primary/40",u),e[2]=u,e[3]=m):m=e[3];let f;e[4]!==a||e[5]!==i?(f=i&&n.jsx(Po,{onArchive:i,disabled:a,className:"top-2"}),e[4]=a,e[5]=i,e[6]=f):f=e[6];let p;e[7]!==t.key?(p=L=>L.dataTransfer.setData(Co,t.key),e[7]=t.key,e[8]=p):p=e[8];const b=c?"cursor-grab active:cursor-grabbing":"cursor-pointer";let h;e[9]!==b?(h=ye("block w-full p-3 text-left",b),e[9]=b,e[10]=h):h=e[10];let y;e[11]!==t.title||e[12]!==r?(y=t.title||r("sandbox.postBoard.untitled"),e[11]=t.title,e[12]=r,e[13]=y):y=e[13];let j;e[14]!==y?(j=n.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:y}),e[14]=y,e[15]=j):j=e[15];let k;e[16]!==g||e[17]!==t.status?(k=t.status==="draft"&&n.jsxs(n.Fragment,{children:[g.pillarTitle&&n.jsx(mt,{variant:"secondary",className:"max-w-full truncate",children:g.pillarTitle}),g.format?.name&&n.jsx(mt,{variant:"outline",className:"max-w-full truncate",children:g.format.name})]}),e[16]=g,e[17]=t.status,e[18]=k):k=e[18];let S;e[19]!==t.status||e[20]!==r?(S=t.status==="generating"&&n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[n.jsx(Nt,{size:12,className:"animate-spin"}),r("sandbox.postBoard.generatingLabel")]}),e[19]=t.status,e[20]=r,e[21]=S):S=e[21];let w;e[22]!==t.missing||e[23]!==t.status||e[24]!==r?(w=t.status==="awaiting_review"&&(t.missing.length>0?n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[n.jsx(Tt,{size:12}),r("sandbox.postBoard.nIssues",{count:String(t.missing.length)})]}):n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:[n.jsx(cl,{size:12}),r("sandbox.postBoard.readyToSchedule")]})),e[22]=t.missing,e[23]=t.status,e[24]=r,e[25]=w):w=e[25];let _;e[26]!==t.date||e[27]!==t.scheduledDatetime||e[28]!==t.status?(_=(t.status==="scheduled"||t.status==="published")&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[n.jsx(Ss,{size:12}),(t.scheduledDatetime||t.date||"").slice(0,10)]}),e[26]=t.date,e[27]=t.scheduledDatetime,e[28]=t.status,e[29]=_):_=e[29];let E;e[30]!==t.duplicateTitle||e[31]!==r?(E=t.duplicateTitle&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[n.jsx(Bs,{size:12,"aria-hidden":!0}),r("sandbox.postBoard.duplicateTitle")]}),e[30]=t.duplicateTitle,e[31]=r,e[32]=E):E=e[32];let N;e[33]!==k||e[34]!==S||e[35]!==w||e[36]!==_||e[37]!==E?(N=n.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[k,S,w,_,E]}),e[33]=k,e[34]=S,e[35]=w,e[36]=_,e[37]=E,e[38]=N):N=e[38];let B;e[39]!==c||e[40]!==l||e[41]!==N||e[42]!==p||e[43]!==h||e[44]!==j?(B=n.jsxs("button",{type:"button",draggable:c,onDragStart:p,onClick:l,className:h,children:[j,N]}),e[39]=c,e[40]=l,e[41]=N,e[42]=p,e[43]=h,e[44]=j,e[45]=B):B=e[45];let R;return e[46]!==B||e[47]!==m||e[48]!==f?(R=n.jsxs("div",{className:m,children:[f,B]}),e[46]=B,e[47]=m,e[48]=f,e[49]=R):R=e[49],R}function gn(s){const e=le.c(9),{label:t}=s,o=je();let a;e[0]!==t?(a=n.jsx("span",{className:"[writing-mode:vertical-rl] text-sm",children:t}),e[0]=t,e[1]=a):a=e[1];let l;e[2]!==o?(l=o("common.soon"),e[2]=o,e[3]=l):l=e[3];let i;e[4]!==l?(i=n.jsx("span",{className:"[writing-mode:vertical-rl] text-xs font-semibold",children:l}),e[4]=l,e[5]=i):i=e[5];let r;return e[6]!==a||e[7]!==i?(r=n.jsxs("div",{"aria-disabled":!0,className:"flex w-11 shrink-0 cursor-not-allowed flex-col items-center gap-2 rounded-xl border border-dashed border-primary/30 bg-primary/5 py-2.5 text-primary",children:[a,i]}),e[6]=a,e[7]=i,e[8]=r):r=e[8],r}function Po(s){const e=le.c(13),{label:t,onArchive:o,disabled:a,className:l}=s,i=je();let r;e[0]!==t||e[1]!==i?(r=t??i("sandbox.postBoard.delete"),e[0]=t,e[1]=i,e[2]=r):r=e[2];const c=r;let d;e[3]!==o?(d=f=>{f.stopPropagation(),o()},e[3]=o,e[4]=d):d=e[4];let g;e[5]!==l?(g=ye("absolute right-2 z-10 flex size-6 cursor-pointer items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-destructive focus-visible:opacity-100 group-hover/card:opacity-100 group-hover/row:opacity-100",l),e[5]=l,e[6]=g):g=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Es,{size:13}),e[7]=u):u=e[7];let m;return e[8]!==a||e[9]!==d||e[10]!==g||e[11]!==c?(m=n.jsx("button",{type:"button",disabled:a,"aria-label":c,title:c,onClick:d,className:g,children:u}),e[8]=a,e[9]=d,e[10]=g,e[11]=c,e[12]=m):m=e[12],m}function He(s){const e=le.c(54),{icon:t,logoUrl:o,title:a,subtitle:l,active:i,accent:r,variantCount:c,trailing:d,selectable:g,selectionActive:u,selected:m,invalid:f,invalidReason:p,warning:b,warningReason:h,onToggleSelect:y,onClick:j,menu:k}=s,S=je(),w=r==="global";let _;e[0]!==t||e[1]!==i||e[2]!==w||e[3]!==o?(_=o?n.jsx("img",{src:o,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):n.jsx("span",{className:ye("flex size-8 shrink-0 items-center justify-center rounded-lg",w?"bg-global-section/15":"bg-muted"),children:n.jsx(t,{size:16,className:ye("shrink-0",!w&&(i?"text-accent-foreground":"text-muted-foreground")),style:w?{color:Ts}:void 0})}),e[0]=t,e[1]=i,e[2]=w,e[3]=o,e[4]=_):_=e[4];const E=_,N=i?w?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":w?"hover:bg-global-section/10":"hover:bg-muted";let B;e[5]!==N?(B=ye("group relative flex min-w-0 items-center rounded-md transition-colors",N),e[5]=N,e[6]=B):B=e[6];let R;e[7]!==y||e[8]!==g||e[9]!==m||e[10]!==u||e[11]!==S||e[12]!==a?(R=g&&n.jsx("span",{className:ye("flex shrink-0 items-center pl-2.5 transition-opacity",m||u?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Tr,children:n.jsx(ts,{checked:m,onCheckedChange:()=>y?.(),"aria-label":S("sandbox.itemRow.selectItem",{title:a})})}),e[7]=y,e[8]=g,e[9]=m,e[10]=u,e[11]=S,e[12]=a,e[13]=R):R=e[13];const L=f&&!i&&"text-destructive";let M;e[14]!==L?(M=ye("block truncate text-sm font-medium",L),e[14]=L,e[15]=M):M=e[15];let F;e[16]!==M||e[17]!==a?(F=n.jsx("span",{className:M,children:a}),e[16]=M,e[17]=a,e[18]=F):F=e[18];const T=i?"text-accent-foreground/70":"text-muted-foreground";let $;e[19]!==T?($=ye("block truncate text-xs",T),e[19]=T,e[20]=$):$=e[20];let K;e[21]!==l||e[22]!==$?(K=n.jsx("span",{className:$,children:l}),e[21]=l,e[22]=$,e[23]=K):K=e[23];let z;e[24]!==K||e[25]!==F?(z=n.jsxs("span",{className:"min-w-0 flex-1",children:[F,K]}),e[24]=K,e[25]=F,e[26]=z):z=e[26];let G;e[27]!==i||e[28]!==S||e[29]!==c?(G=c!==void 0&&c>1&&n.jsxs(Ye,{children:[n.jsx(qe,{asChild:!0,children:n.jsxs("span",{className:ye("flex shrink-0 items-center gap-1 text-xs font-medium",i?"text-accent-foreground/70":"text-muted-foreground"),children:[n.jsx(Cn,{size:14}),c]})}),n.jsx(We,{side:"bottom",children:S("sandbox.itemRow.variantCount",{count:c})})]}),e[27]=i,e[28]=S,e[29]=c,e[30]=G):G=e[30];let W;e[31]!==b||e[32]!==h?(W=b&&n.jsxs(Ye,{children:[n.jsx(qe,{asChild:!0,children:n.jsx("span",{className:"flex shrink-0 items-center text-warning",children:n.jsx(Tt,{size:14})})}),h&&n.jsx(We,{side:"bottom",children:h})]}),e[31]=b,e[32]=h,e[33]=W):W=e[33];let O;e[34]!==i||e[35]!==f||e[36]!==p?(O=f&&n.jsxs(Ye,{children:[n.jsx(qe,{asChild:!0,children:n.jsx("span",{className:ye("flex shrink-0 items-center",i?"text-accent-foreground":"text-destructive"),children:n.jsx(Tt,{size:14})})}),p&&n.jsx(We,{side:"bottom",children:p})]}),e[34]=i,e[35]=f,e[36]=p,e[37]=O):O=e[37];let I;e[38]!==j||e[39]!==E||e[40]!==z||e[41]!==G||e[42]!==W||e[43]!==O||e[44]!==d?(I=n.jsxs("button",{type:"button",onClick:j,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[E,z,G,W,O,d]}),e[38]=j,e[39]=E,e[40]=z,e[41]=G,e[42]=W,e[43]=O,e[44]=d,e[45]=I):I=e[45];let D;e[46]!==i||e[47]!==k?(D=k&&n.jsx("div",{className:ye("pr-1 opacity-0 transition-opacity group-hover:opacity-100",i&&"opacity-100"),children:k}),e[46]=i,e[47]=k,e[48]=D):D=e[48];let U;return e[49]!==I||e[50]!==D||e[51]!==B||e[52]!==R?(U=n.jsxs("div",{className:B,children:[R,I,D]}),e[49]=I,e[50]=D,e[51]=B,e[52]=R,e[53]=U):U=e[53],U}function Tr(s){return s.stopPropagation()}function tt(s){const e=le.c(10),{icon:t,title:o,description:a}=s;let l;e[0]!==t?(l=t&&n.jsx(t,{size:24,className:"text-muted-foreground/60"}),e[0]=t,e[1]=l):l=e[1];let i;e[2]!==o?(i=n.jsx("div",{children:o}),e[2]=o,e[3]=i):i=e[3];let r;e[4]!==a?(r=a&&n.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:a}),e[4]=a,e[5]=r):r=e[5];let c;return e[6]!==l||e[7]!==i||e[8]!==r?(c=n.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]=c):c=e[9],c}const Br={loaders:Nn,actions:En},Er={loaders:"Loaders",actions:"Actions"},Dr={analytics:Yo,blog:In,commerce:Wo,site:qo,website:Gt};function _r(s,e){return e===0?Dr[s.toLowerCase()]??Ks:Ks}function Ot(s,e){return e===0?xa(s):s}function Ar(s){const e=le.c(98),{orgSlug:t,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:r,kind:c}=s,d=je();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[u,m]=A.useState(g),[f,p]=A.useState(null),[b,h]=A.useState(""),[y,j]=A.useState(zr),[k,S]=A.useState(c);k!==c&&(S(c),m([]),p(null),h(""),j(new Set));let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w=J=>{j(Z=>{const oe=new Set(Z);return oe.has(J)?oe.delete(J):oe.add(J),oe})},e[1]=w):w=e[1];const _=w;let E;e[2]!==a||e[3]!==t||e[4]!==o?(E={orgSlug:t,virtualMcpId:o,branch:a},e[2]=a,e[3]=t,e[4]=o,e[5]=E):E=e[5];const N=es(E);let B;e[6]!==N?(B=$n((J,Z)=>N.mutate({blockKey:J,data:Z})),e[6]=N,e[7]=B):B=e[7];const R=B;let L;e[8]!==c?(L=ba(c),e[8]=c,e[9]=L):L=e[9];const M=L,F=Br[c];let T,$,K,z,G,W,O;if(e[10]!==F||e[11]!==a||e[12]!==r||e[13]!==c||e[14]!==i||e[15]!==y||e[16]!==t||e[17]!==u||e[18]!==l||e[19]!==N||e[20]!==R||e[21]!==b||e[22]!==f||e[23]!==M||e[24]!==d||e[25]!==o){K=Symbol.for("react.early_return_sentinel");e:{const J=[...fa(i,r,c).map(Kr),...pa(i,c).map(Ir)],Z=b.trim().toLowerCase(),oe=Z.length>0,ae=oe?J.filter(H=>H.title.toLowerCase().includes(Z)||H.resolveType.toLowerCase().includes(Z)):[],ie=new Map,te=[],ue=new Map;if(!oe){for(const H of J){const xe=H.folderPath;if(!(xe.length<u.length)&&u.every((we,Re)=>xe[Re]===we))if(xe.length===u.length)if(H.savedKey!==void 0){const we=ue.get(H.resolveType);we?we.push(H):ue.set(H.resolveType,[H])}else te.push(H);else{const we=xe[u.length],Re=ie.get(we)??{count:0,savedCount:0};H.savedKey!==void 0?Re.savedCount=Re.savedCount+1:Re.count=Re.count+1,ie.set(we,Re)}}te.sort(Fr);for(const H of ue.values())H.sort(Rr)}const ee=[...ue.entries()].filter(H=>{const[xe]=H;return!te.some(we=>we.resolveType===xe)}).flatMap(Or).sort($r);let P;e[33]!==u?(P=(H,xe)=>Ot(H.name,u.length).localeCompare(Ot(xe.name,u.length)),e[33]=u,e[34]=P):P=e[34];const q=[...ie.entries()].map(Lr).sort(P);let ne;e[35]===Symbol.for("react.memo_cache_sentinel")?(ne=H=>{p(H.savedKey!==void 0?{mode:"saved",key:H.savedKey}:{mode:"available",resolveType:H.resolveType,title:H.title})},e[35]=ne):ne=e[35];const se=ne;let re;e[36]!==N||e[37]!==M||e[38]!==d?(re=async(H,xe)=>{await N.mutateAsync({blockKey:H,data:xe}),me.success(d("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:M,blockId:H})),p({mode:"saved",key:H})},e[36]=N,e[37]=M,e[38]=d,e[39]=re):re=e[39];const ce=re;let v;e[40]!==r||e[41]!==f?(v=Mr(f,r),e[40]=r,e[41]=f,e[42]=v):v=e[42];const V=v;if(V){const H=`${V.mode}:${V.mode==="saved"?V.blockKey:V.resolveType}`;let xe;e[43]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>p(null),e[43]=xe):xe=e[43];let we;e[44]!==a||e[45]!==r||e[46]!==ce||e[47]!==c||e[48]!==i||e[49]!==t||e[50]!==l||e[51]!==N.isPending||e[52]!==R||e[53]!==H||e[54]!==V.editorTarget||e[55]!==V.initialValue||e[56]!==o?(we=n.jsx(ga,{orgSlug:t,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:r,kind:c,target:V.editorTarget,initialValue:V.initialValue,isCreating:N.isPending,onCreate:ce,onSaveReferencedBlock:R,onBack:xe},H),e[44]=a,e[45]=r,e[46]=ce,e[47]=c,e[48]=i,e[49]=t,e[50]=l,e[51]=N.isPending,e[52]=R,e[53]=H,e[54]=V.editorTarget,e[55]=V.initialValue,e[56]=o,e[57]=we):we=e[57],K=we;break e}O="flex h-full w-full min-w-0 flex-col";let fe;e[58]!==d?(fe=d("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=d,e[59]=fe):fe=e[59];let ge;e[60]===Symbol.for("react.memo_cache_sentinel")?(ge=()=>m([]),e[60]=ge):ge=e[60];const ve=u.length===0?"font-medium text-foreground":"text-muted-foreground";let he;e[61]!==ve?(he=ye("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ve),e[61]=ve,e[62]=he):he=e[62];const De=Er[c];let ke;e[63]!==he||e[64]!==De?(ke=n.jsx("button",{type:"button",onClick:ge,className:he,children:De}),e[63]=he,e[64]=De,e[65]=ke):ke=e[65];let Pe;e[66]!==u?(Pe=u.map((H,xe)=>{const we=xe===u.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[n.jsx(Vt,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>m(u.slice(0,xe+1)),className:ye("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",we?"font-medium text-foreground":"text-muted-foreground"),children:Ot(H,xe)})]},`${H}-${xe}`)}),e[66]=u,e[67]=Pe):Pe=e[67];let Te;e[68]!==fe||e[69]!==ke||e[70]!==Pe?(Te=n.jsxs("nav",{"aria-label":fe,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[ke,Pe]}),e[68]=fe,e[69]=ke,e[70]=Pe,e[71]=Te):Te=e[71];let Be;e[72]===Symbol.for("react.memo_cache_sentinel")?(Be=n.jsx(ws,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Be):Be=e[72];let _e;e[73]===Symbol.for("react.memo_cache_sentinel")?(_e=H=>h(H.target.value),e[73]=_e):_e=e[73];let be;e[74]!==c||e[75]!==d?(be=d("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:c}),e[74]=c,e[75]=d,e[76]=be):be=e[76];let Le;e[77]!==c||e[78]!==d?(Le=d("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:c}),e[77]=c,e[78]=d,e[79]=Le):Le=e[79];let Ie;e[80]!==b||e[81]!==be||e[82]!==Le?(Ie=n.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Be,n.jsx("input",{type:"text",value:b,onChange:_e,placeholder:be,"aria-label":Le,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=b,e[81]=be,e[82]=Le,e[83]=Ie):Ie=e[83],e[84]!==Te||e[85]!==Ie?($=n.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[Te,Ie]}),e[84]=Te,e[85]=Ie,e[86]=$):$=e[86],T=Zt,W="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",z="mx-auto w-full max-w-4xl px-6 py-5",G=oe?ae.length===0?n.jsx(tt,{title:d("sandbox.runnableBlocksBrowser.noSearchResults",{kind:c,query:b.trim()}),description:d("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):n.jsx("div",{className:"flex flex-col gap-1",children:ae.map(H=>n.jsx(He,{icon:F,accent:H.savedKey!==void 0?"global":void 0,title:H.title,subtitle:H.resolveType,active:!1,onClick:()=>se(H)},H.savedKey??H.resolveType))}):q.length===0&&te.length===0&&ee.length===0?n.jsx(tt,{title:d("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:c}),description:u.length===0?d("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):d("sandbox.runnableBlocksBrowser.emptyFolder")}):n.jsxs(n.Fragment,{children:[q.length>0&&n.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:q.map(H=>{const xe=_r(H.name,u.length);return n.jsxs("button",{type:"button",onClick:()=>m([...u,H.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:[n.jsx(xe,{size:18,className:"shrink-0 text-muted-foreground"}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm font-medium",children:Ot(H.name,u.length)}),n.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[H.count," ",H.count===1?M:c,H.savedCount>0&&n.jsxs(n.Fragment,{children:[" ","·"," ",d("sandbox.runnableBlocksBrowser.savedCountLabel",{count:H.savedCount})]})]})]})]},H.name)})}),(te.length>0||ee.length>0)&&n.jsxs("div",{className:ye("flex flex-col gap-1",q.length>0&&"mt-4"),children:[te.map(H=>{const xe=ue.get(H.resolveType)??[],we=y.has(H.resolveType);return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(He,{icon:F,title:H.title,subtitle:H.resolveType,active:!1,onClick:()=>se(H)}),xe.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{type:"button",onClick:()=>_(H.resolveType),"aria-expanded":we,className:"flex items-center gap-1 self-start rounded-lg px-2.5 py-1 text-xs font-medium transition-colors hover:bg-global-section/10 cursor-pointer ml-11",style:{color:Ts},children:[we?n.jsx(Bt,{size:12,className:"shrink-0"}):n.jsx(Vt,{size:12,className:"shrink-0"}),d(we?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",xe.length,")"]}),we&&n.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:xe.map(Re=>n.jsx(He,{icon:F,accent:"global",title:Re.title,subtitle:Re.resolveType,active:!1,onClick:()=>se(Re)},Re.savedKey))})]})]},H.resolveType)}),ee.map(H=>n.jsx(He,{icon:F,accent:"global",title:H.title,subtitle:H.resolveType,active:!1,onClick:()=>se(H)},H.savedKey))]})]})}e[10]=F,e[11]=a,e[12]=r,e[13]=c,e[14]=i,e[15]=y,e[16]=t,e[17]=u,e[18]=l,e[19]=N,e[20]=R,e[21]=b,e[22]=f,e[23]=M,e[24]=d,e[25]=o,e[26]=T,e[27]=$,e[28]=K,e[29]=z,e[30]=G,e[31]=W,e[32]=O}else T=e[26],$=e[27],K=e[28],z=e[29],G=e[30],W=e[31],O=e[32];if(K!==Symbol.for("react.early_return_sentinel"))return K;let I;e[87]!==z||e[88]!==G?(I=n.jsx("div",{className:z,children:G}),e[87]=z,e[88]=G,e[89]=I):I=e[89];let D;e[90]!==T||e[91]!==I||e[92]!==W?(D=n.jsx(T,{className:W,children:I}),e[90]=T,e[91]=I,e[92]=W,e[93]=D):D=e[93];let U;return e[94]!==$||e[95]!==D||e[96]!==O?(U=n.jsxs("div",{className:O,children:[$,D]}),e[94]=$,e[95]=D,e[96]=O,e[97]=U):U=e[97],U}function Lr(s){const[e,t]=s;return{name:e,...t}}function $r(s,e){return s.title.localeCompare(e.title)}function Or(s){const[,e]=s;return e}function Rr(s,e){return s.title.localeCompare(e.title)}function Fr(s,e){return s.title.localeCompare(e.title)}function Ir(s){return{resolveType:s.resolveType,title:s.title,folderPath:Ln(s.resolveType)}}function Kr(s){return{resolveType:s.resolveType,title:s.title,folderPath:Ln(s.resolveType),savedKey:s.key}}function zr(){return new Set}function Mr(s,e){if(!s)return null;if(s.mode==="available")return{mode:"available",resolveType:s.resolveType,editorTarget:{mode:"available",resolveType:s.resolveType,title:s.title},initialValue:{}};const{resolveType:t,props:o,title:a}=ha(e,s.key);return{mode:"saved",blockKey:s.key,resolveType:t,editorTarget:{mode:"saved",blockKey:s.key,resolveType:t,title:a},initialValue:o}}function Vr(s){const e=le.c(106),{orgSlug:t,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:r,resolveType:c,title:d,defaultBlockId:g,isCreating:u,onCreate:m,onSaveReferencedBlock:f}=s,p=je(),b=Xt(),h=b?.virtualMcpId,j=Mn(h===o?o:null)?.metadata?.siteSlug??null;let k;e[0]===Symbol.for("react.memo_cache_sentinel")?(k={},e[0]=k):k=e[0];const[S,w]=A.useState(k);let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=[],e[1]=_):_=e[1];const[E,N]=A.useState(_),[B,R]=A.useState(0),[L,M]=A.useState(!1);let F;e[2]!==i||e[3]!==c?(F=Cs(c,i),e[2]=i,e[3]=c,e[4]=F):F=e[4];const T=F;let $,K,z,G,W,O,I,D;if(e[5]!==j||e[6]!==a||e[7]!==r||e[8]!==E||e[9]!==S||e[10]!==u||e[11]!==m||e[12]!==t||e[13]!==l||e[14]!==c||e[15]!==p||e[16]!==b?.taskId||e[17]!==d||e[18]!==o){const te=c.split("/").pop()?.replace(/\.tsx?$/,"")??c,ue=b?.taskId??null,ee=l??void 0;let P;e[27]!==j||e[28]!==a||e[29]!==t||e[30]!==ee||e[31]!==ue||e[32]!==o?(P={orgSlug:t,virtualMcpId:o,branch:a,threadId:ue,previewUrl:ee,siteSlug:j},e[27]=j,e[28]=a,e[29]=t,e[30]=ee,e[31]=ue,e[32]=o,e[33]=P):P=e[33],K=P;let q,ne,se,re;if(e[34]!==r||e[35]!==E||e[36]!==S||e[37]!==m||e[38]!==p||e[39]!==d){const ke=[d,...E],Pe=Be=>{N(E.slice(0,Be)),R(Gr)};let Te;e[48]!==r||e[49]!==S||e[50]!==m?(Te=async Be=>{const _e=va(Be,r);if(_e){me.error(_e);return}await m(Be,S),M(!1)},e[48]=r,e[49]=S,e[50]=m,e[51]=Te):Te=e[51],$=Te,D="flex h-full w-full min-w-0",I="flex min-w-0 flex-1 flex-col",W="shrink-0 border-b px-3 py-2.5",re="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==p?(q=p("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=p,e[53]=q):q=e[53],ne="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",se=ke.map((Be,_e)=>{const be=_e===ke.length-1,Le=ya(Be);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[_e>0&&n.jsx(Vt,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Pe(_e),title:Le,className:ye("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",be?"font-medium text-foreground":"text-muted-foreground"),children:Le})]},`${Le}-${_e}`)}),e[34]=r,e[35]=E,e[36]=S,e[37]=m,e[38]=p,e[39]=d,e[40]=$,e[41]=q,e[42]=ne,e[43]=se,e[44]=re,e[45]=W,e[46]=I,e[47]=D}else $=e[40],q=e[41],ne=e[42],se=e[43],re=e[44],W=e[45],I=e[46],D=e[47];let ce;e[54]!==q||e[55]!==ne||e[56]!==se?(ce=n.jsx("nav",{"aria-label":q,className:ne,children:se}),e[54]=q,e[55]=ne,e[56]=se,e[57]=ce):ce=e[57];let v;e[58]===Symbol.for("react.memo_cache_sentinel")?(v=()=>M(!0),e[58]=v):v=e[58];let V;e[59]!==p?(V=p("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=p,e[60]=V):V=e[60];let fe;e[61]===Symbol.for("react.memo_cache_sentinel")?(fe=n.jsx(Qo,{size:14}),e[61]=fe):fe=e[61];let ge;e[62]!==u||e[63]!==V?(ge=n.jsx(qe,{asChild:!0,children:n.jsx(Ae,{size:"icon",className:"size-8 shrink-0",disabled:u,onClick:v,"aria-label":V,children:fe})}),e[62]=u,e[63]=V,e[64]=ge):ge=e[64];let ve;e[65]!==p?(ve=p("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=p,e[66]=ve):ve=e[66];let he;e[67]!==ve?(he=n.jsx(We,{side:"bottom",children:ve}),e[67]=ve,e[68]=he):he=e[68];let De;e[69]!==ge||e[70]!==he?(De=n.jsxs(Ye,{children:[ge,he]}),e[69]=ge,e[70]=he,e[71]=De):De=e[71],e[72]!==re||e[73]!==ce||e[74]!==De?(O=n.jsxs("div",{className:re,children:[ce,De]}),e[72]=re,e[73]=ce,e[74]=De,e[75]=O):O=e[75],z="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",G=p("sandbox.availableSectionEditor.localEditsHint",{typeLabel:te}),e[5]=j,e[6]=a,e[7]=r,e[8]=E,e[9]=S,e[10]=u,e[11]=m,e[12]=t,e[13]=l,e[14]=c,e[15]=p,e[16]=b?.taskId,e[17]=d,e[18]=o,e[19]=$,e[20]=K,e[21]=z,e[22]=G,e[23]=W,e[24]=O,e[25]=I,e[26]=D}else $=e[19],K=e[20],z=e[21],G=e[22],W=e[23],O=e[24],I=e[25],D=e[26];let U;e[76]!==z||e[77]!==G?(U=n.jsx("p",{className:z,children:G}),e[76]=z,e[77]=G,e[78]=U):U=e[78];let J;e[79]!==U||e[80]!==W||e[81]!==O?(J=n.jsxs("div",{className:W,children:[O,U]}),e[79]=U,e[80]=W,e[81]=O,e[82]=J):J=e[82];let Z;e[83]!==r||e[84]!==E||e[85]!==B||e[86]!==S||e[87]!==i||e[88]!==f||e[89]!==K||e[90]!==T||e[91]!==p?(Z=n.jsx(Zt,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:T?n.jsx(On,{schema:T,value:S,onChange:te=>w(te),basePath:"",breadcrumbPath:E,onBreadcrumbChange:N,meta:i,decofile:r,onSaveReferencedBlock:f,sandbox:K},B):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:p("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=r,e[84]=E,e[85]=B,e[86]=S,e[87]=i,e[88]=f,e[89]=K,e[90]=T,e[91]=p,e[92]=Z):Z=e[92];let oe;e[93]!==J||e[94]!==Z||e[95]!==I?(oe=n.jsxs("div",{className:I,children:[J,Z]}),e[93]=J,e[94]=Z,e[95]=I,e[96]=oe):oe=e[96];let ae;e[97]!==g||e[98]!==$||e[99]!==u||e[100]!==L?(ae=n.jsx(ja,{open:L,onOpenChange:M,defaultBlockId:g,isPending:u,onSubmit:$}),e[97]=g,e[98]=$,e[99]=u,e[100]=L,e[101]=ae):ae=e[101];let ie;return e[102]!==oe||e[103]!==ae||e[104]!==D?(ie=n.jsxs("div",{className:D,children:[oe,ae]}),e[102]=oe,e[103]=ae,e[104]=D,e[105]=ie):ie=e[105],ie}function Gr(s){return s+1}function Ur(s,e){const t={__resolveType:s},o=wa([t],e)[0];return o?Na(t,o,e):null}function Hr({orgSlug:s,virtualMcpId:e,branch:t,previewUrl:o,meta:a,decofile:l,blockKey:i,onSaveReferencedBlock:r}){const c=je(),d=Xt(),g=d?.virtualMcpId,m=Mn(g===e?e:null)?.metadata?.siteSlug??null,[f]=A.useState(()=>Ur(i,l)),[p,b]=A.useState(f?.data??{}),[h,y]=A.useState([]),[j,k]=A.useState(0),[S,w]=A.useState(!1),[_,E]=A.useState(null),N=_!==null,{save:B,flush:R}=ka({orgSlug:s,virtualMcpId:e,branch:t}),L=f?.resolveType?Cs(f.resolveType,a):null,M=l[i],F=M?Ia(i,M):i,T=d?.taskId??null,$={orgSlug:s,virtualMcpId:e,branch:t,threadId:T,previewUrl:o??void 0,siteSlug:m},K=I=>{b(I),B(i,I)},z=()=>{N?(E(null),w(!1),k(I=>I+1)):E(JSON.stringify(p,null,2))},G=I=>{const D=I??"";try{const U=JSON.parse(D);if(U&&typeof U=="object"&&!Array.isArray(U)){w(!1),K(U);return}w(!0)}catch{w(!0)}},W=[F,...h],O=I=>{y(h.slice(0,I)),k(D=>D+1)};return n.jsx("div",{className:"flex h-full w-full min-w-0",children:n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsx(Sa,{crumbs:W,onSelect:O}),n.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[n.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Ts},"aria-hidden":!0}),n.jsx("div",{className:"flex-1"}),n.jsxs(Ye,{children:[n.jsx(qe,{asChild:!0,children:n.jsx(Ae,{variant:N?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:z,"aria-label":c(N?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":N,children:N?n.jsx(Ds,{size:14}):n.jsx(Pn,{size:14})})}),n.jsx(We,{side:"bottom",children:c(N?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),n.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:c("sandbox.savedSectionEditor.globalSectionDescription")})]}),n.jsxs("div",{className:"relative min-h-0 flex-1",children:[n.jsx(Zt,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:L?n.jsx(On,{schema:L,value:p,onChange:I=>K(I),basePath:"",breadcrumbPath:h,onBreadcrumbChange:y,meta:a,decofile:l,onSaveReferencedBlock:r,sandbox:$},j):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sandbox.savedSectionEditor.noEditableFields")})})})}),_!==null&&n.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[S&&n.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:c("sandbox.savedSectionEditor.invalidJsonError")}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(zn,{language:"json",height:"100%",code:_,onChange:G,onSave:I=>{G(I),R()}})})]})]})]})})}function qr(s){const e=le.c(36),{selection:t,orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:r,decofile:c,isCreating:d,onCreateAvailable:g,onSaveReferencedBlock:u}=s,m=je();if(!t){let b;e[0]!==m?(b=m("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=m,e[1]=b):b=e[1];let h;e[2]!==m?(h=m("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=m,e[3]=h):h=e[3];let y;return e[4]!==b||e[5]!==h?(y=n.jsx(tt,{title:b,description:h}),e[4]=b,e[5]=h,e[6]=y):y=e[6],y}if(t.collection==="available-section"){const b=`available:${t.resolveType}`,h=t.resolveType,y=t.title;let j;e[7]!==t.title?(j=Ca(t.title),e[7]=t.title,e[8]=j):j=e[8];let k;e[9]!==g||e[10]!==t.resolveType?(k=(w,_)=>g(t.resolveType,w,_),e[9]=g,e[10]=t.resolveType,e[11]=k):k=e[11];let S;return e[12]!==l||e[13]!==c||e[14]!==d||e[15]!==r||e[16]!==u||e[17]!==o||e[18]!==i||e[19]!==t.resolveType||e[20]!==t.title||e[21]!==b||e[22]!==j||e[23]!==k||e[24]!==a?(S=n.jsx(Vr,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:r,decofile:c,resolveType:h,title:y,defaultBlockId:j,isCreating:d,onCreate:k,onSaveReferencedBlock:u},b),e[12]=l,e[13]=c,e[14]=d,e[15]=r,e[16]=u,e[17]=o,e[18]=i,e[19]=t.resolveType,e[20]=t.title,e[21]=b,e[22]=j,e[23]=k,e[24]=a,e[25]=S):S=e[25],S}const f=`saved:${t.key}`;let p;return e[26]!==l||e[27]!==c||e[28]!==r||e[29]!==u||e[30]!==o||e[31]!==i||e[32]!==t.key||e[33]!==f||e[34]!==a?(p=n.jsx(Hr,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:r,decofile:c,blockKey:t.key,onSaveReferencedBlock:u},f),e[26]=l,e[27]=c,e[28]=r,e[29]=u,e[30]=o,e[31]=i,e[32]=t.key,e[33]=f,e[34]=a,e[35]=p):p=e[35],p}function Rt(s){const e=le.c(34),{onDuplicate:t,onRename:o,onAddVariant:a,onEditSeo:l,onViewJson:i,onDelete:r}=s,c=je();let d;e[0]!==c?(d=c("sandbox.itemActions.moreActions"),e[0]=c,e[1]=d):d=e[1];let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx($o,{size:14}),e[2]=g):g=e[2];let u;e[3]!==d?(u=n.jsx(Kt,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":d,className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:Wr,children:g})}),e[3]=d,e[4]=u):u=e[4];let m;e[5]!==o||e[6]!==c?(m=o&&n.jsxs(Je,{onClick:o,children:[n.jsx(pl,{size:14}),c("sandbox.itemActions.rename")]}),e[5]=o,e[6]=c,e[7]=m):m=e[7];let f;e[8]!==t||e[9]!==c?(f=t&&n.jsxs(Je,{onClick:t,children:[n.jsx(Bs,{size:14}),c("sandbox.itemActions.duplicate")]}),e[8]=t,e[9]=c,e[10]=f):f=e[10];let p;e[11]!==a||e[12]!==c?(p=a&&n.jsxs(n.Fragment,{children:[n.jsx(fs,{}),n.jsxs(Je,{onClick:a,className:"cursor-pointer text-success focus:text-success",children:[n.jsx(Cn,{size:14}),c("sandbox.itemActions.addVariant")]})]}),e[11]=a,e[12]=c,e[13]=p):p=e[13];let b;e[14]!==l||e[15]!==i||e[16]!==c?(b=(l||i)&&n.jsxs(n.Fragment,{children:[n.jsx(fs,{}),l&&n.jsxs(Je,{onClick:l,children:[n.jsx(wn,{size:14}),c("sandbox.itemActions.editSeo")]}),i&&n.jsxs(Je,{onClick:i,children:[n.jsx(Pn,{size:14}),c("sandbox.itemActions.viewJson")]})]}),e[14]=l,e[15]=i,e[16]=c,e[17]=b):b=e[17];let h;e[18]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(fs,{}),e[18]=h):h=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Es,{size:14}),e[19]=y):y=e[19];let j;e[20]!==c?(j=c("sandbox.itemActions.delete"),e[20]=c,e[21]=j):j=e[21];let k;e[22]!==r||e[23]!==j?(k=n.jsxs(Je,{onClick:r,className:"text-destructive focus:text-destructive",children:[y,j]}),e[22]=r,e[23]=j,e[24]=k):k=e[24];let S;e[25]!==k||e[26]!==m||e[27]!==f||e[28]!==p||e[29]!==b?(S=n.jsxs(zt,{align:"end",className:"w-44",children:[m,f,p,b,h,k]}),e[25]=k,e[26]=m,e[27]=f,e[28]=p,e[29]=b,e[30]=S):S=e[30];let w;return e[31]!==S||e[32]!==u?(w=n.jsxs(Mt,{children:[u,S]}),e[31]=S,e[32]=u,e[33]=w):w=e[33],w}function Wr(s){return s.stopPropagation()}const To=4;function ls(s){const e=new Map;for(const t of s)t.slug&&!e.has(t.slug)&&e.set(t.slug,t);return e}function is(s,e){const t=s.parentSlug;if(!s.slug||!t||t===s.slug)return;const o=e.get(t);return o===s?void 0:o}function Bo(s,e){const t=ls(e),o=[],a=new Set;let l=t.get(s);for(;l&&!a.has(l.slug??"")&&(a.add(l.slug??""),o.push(l),!(o.length>=To));)l=is(l,t);return o.reverse()}function Eo(s,e){const t=new Map;for(const o of s){const a=is(o,e);if(!a?.slug)continue;const l=t.get(a);l?l.push(o):t.set(a,[o])}for(const o of t.values())o.sort((a,l)=>a.label.localeCompare(l.label));return t}function Ld(s,e){const t=ls(e),o=Eo(e,t),a=new Set([s]),l=t.get(s);let i=l?[l]:[];for(;i.length;){const r=[];for(const c of i)for(const d of o.get(c)??[])d.slug&&!a.has(d.slug)&&(a.add(d.slug),r.push(d));i=r}return a.delete(s),a}function $d(s,e){if(!s)return[];const t=ls(e),o=Bo(s,e),a=o[0];return!a||is(a,t)?[s]:o.map(l=>l.slug??"")}function Yr(s){const e=ls(s),t=Eo(s,e),o=new Set,a=[],l=(r,c)=>{if(!o.has(r)&&(o.add(r),a.push({entry:r,depth:c}),!(c+1>=To)))for(const d of t.get(r)??[])l(d,c+1)},i=s.filter(r=>!is(r,e)).sort((r,c)=>r.label.localeCompare(c.label));for(const r of i)l(r,0);for(const r of s)l(r,0);return a}function Qr(s){return s.split("/").pop()?.replace(/\.tsx?$/,"")||s||"Section"}function Jr(s){const e=new Map;for(const t of s){const o=Qr(t.resolveType),a=e.get(o);a?a.push(t):e.set(o,[t])}return[...e.entries()].map(([t,o])=>({label:t,sections:o})).sort((t,o)=>t.label.localeCompare(o.label))}function hn(s){const e=le.c(8),{icon:t,label:o,className:a}=s;let l;e[0]!==a?(l=ye("flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",a),e[0]=a,e[1]=l):l=e[1];let i;e[2]!==t?(i=n.jsx(t,{size:13,className:"shrink-0"}),e[2]=t,e[3]=i):i=e[3];let r;return e[4]!==o||e[5]!==l||e[6]!==i?(r=n.jsxs("div",{className:l,children:[i,o]}),e[4]=o,e[5]=l,e[6]=i,e[7]=r):r=e[7],r}const xn=A.lazy(()=>Qe(()=>import("./app-editor-Cr-wsjho.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])).then(s=>({default:s.AppEditor}))),Xr=A.lazy(()=>Qe(()=>import("./post-editor-HV3DNHNH.js"),__vite__mapDeps([171,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,29,28,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,117,57,90,172,158,137,85,86,56,108,120,115,113,62,61,59,63,64,65,66,67,68,69,70,71,72,73,23,74,75,76,77,78,79,80,81,82,83,84,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,109,21,22,110,111,112,58,114,116,118,119,121,122,123,124,125,126,173,141,60,174,175,168,176,177,127,128,129,130,131,132,133,134,135,136,138,139,140,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,159,160,161,162,163,164,165,166,167,169,170])).then(s=>({default:s.PostEditor}))),Zr=A.lazy(()=>Qe(()=>import("./record-editor-BAdOwM42.js"),__vite__mapDeps([178,1,2,57,90,22,23,24,25,113,62,61,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,59,28,29,30,31,32,33,34,35,36,37,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,63,64,65,66,67,68,69,70,56,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,21,110,111,112,58,114,115,116,117,118,119,120,121,122,123,124,125,126,175,177,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])).then(s=>({default:s.RecordEditor}))),ec=A.lazy(()=>Qe(()=>import("./context-BzZmRn5A.js"),__vite__mapDeps([179,1,2,25,28,29,30,31,32,33,34,35,36,37,24,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,57,90,113,108,18,180,104,79,56,105,81,71,72,4,5,6,7,8,9,73,23,114,141,174,142,70,19,83,85,86,181,145,182,62,61,11,12,13,14,15,3,10,16,17,20,59,63,64,65,66,67,68,69,74,75,76,77,78,80,82,84,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,106,107,109,21,22,110,111,112,58,115,116,117,118,119,120,121,122,123,124,125,126,168,177,178,175,127,128,129,130,131,132,133,134,135,136,137,138,139,140,143,144,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,169,170,183,173,60,176])).then(s=>({default:s.BlogContext}))),tc=A.lazy(()=>Qe(()=>import("./category-editor-CRqB5ots.js"),__vite__mapDeps([183,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,29,33,35,46,27,117,57,90,22,23,24,25,175,28,30,31,32,34,36,37,38,39,40,41,42,43,44,45,47,48,49,50,51,52,53,54,55,62,61,59,63,64,65,66,67,68,69,70,56,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,21,110,111,112,113,58,114,115,116,118,119,120,121,122,123,124,125,126,173,141,60,174,176,177,127,128,129,130,131,132,133,134,135,136,137,138,139,140,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])).then(s=>({default:s.CategoryEditor}))),sc=A.lazy(()=>Qe(()=>import("./sections-editor-Bnb_Ii_2.js"),__vite__mapDeps([184,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,58,62,61,59,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,63,64,65,66,67,68,69,70,56,71,72,73,23,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,57,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,21,22,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,168,185,26,60,186])).then(s=>({default:s.SectionsEditor}))),nc=A.lazy(()=>Qe(()=>import("./seo-editor-C0eExFGM.js"),__vite__mapDeps([187,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,21,22,23,62,61,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,59,63,64,65,66,67,68,69,70,56,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,57,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,58,114,115,116,117,118,119,120,121,122,123,124,125,126,185])).then(s=>({default:s.SeoEditor}))),oc=A.lazy(()=>Qe(()=>import("./variant-calendar-C_oSHjpD.js"),__vite__mapDeps([188,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,90,21,22,23,115,73,189,127,128,123,121,20,14,13,124,5,4,6,7,8,9,11,12,15,102,129,77,81,130,3,10,16,17,18,19,79,56,131,96,72,103,104,105,57,71,132,82,83,84,74,85,86,87,88,89,91,92,93,94,95,97,98,99,100,133,61,69,68,70,65,66,120,134,125,80,135,136,137,138,108,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,113,154,155,156,157,158,159,160,161,162,64,67,75,76,78,101,106,107,163,118,63,164,165,166,167,117,62,59,109,110,111,112,58,114,116,119,122,126,168,169,170])).then(s=>({default:s.VariantCalendar}))),ac=A.lazy(()=>Qe(()=>import("./post-calendar-DiEfiKrj.js"),__vite__mapDeps([190,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,21,22,23,127,128,123,121,20,14,13,124,5,4,6,7,8,9,11,12,15,102,129,77,81,130,3,10,16,17,18,19,79,73,56,131,96,72,103,104,105,90,57,71,132,82,83,84,74,85,86,87,88,89,91,92,93,94,95,97,98,99,100,133,61,69,68,70,65,66,120,134,125,80,135,136,137,138,108,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,113,154,155,156,157,158,159,160,161,162,64,67,75,76,78,101,106,107,163,118,63,164,165,166,167,117,62,59,109,110,111,112,58,114,115,116,119,122,126,168,169,170])).then(s=>({default:s.PostCalendar}))),lc=A.lazy(()=>Qe(()=>import("./redirect-editor-C2CflIXw.js"),__vite__mapDeps([191,1,2,137,24,57,90,22,23,25,62,61,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,59,28,29,30,31,32,33,34,35,36,37,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,63,64,65,66,67,68,69,70,56,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,21,110,111,112,113,58,114,115,116,117,118,119,120,121,122,123,124,125,126,177])).then(s=>({default:s.RedirectEditor})));function ic(s){const e=le.c(20),{deepLinkPage:t}=s,{currentBranch:o,virtualMcpId:a}=jn(),{org:l}=Oo(),i=el(),r=tl(),{runtime:c,previewServerUrl:d}=Kn(a),g=c==="cms";let u;e[0]!==g||e[1]!==r.previewState||e[2]!==i.lifecycle.phase?(u=$l({fastPreviewActive:g,previewState:r.previewState,lifecyclePhase:i.lifecycle.phase}),e[0]=g,e[1]=r.previewState,e[2]=i.lifecycle.phase,e[3]=u):u=e[3];const m=u;if(m.kind==="sandbox-card"){const b=`/${l.slug}/settings/connections`;let h;return e[4]!==m.state||e[5]!==r.start||e[6]!==b||e[7]!==i.lifecycle||e[8]!==i.phase?(h=n.jsx(Al,{state:m.state,claimPhase:i.phase,lifecycle:i.lifecycle,onStart:r.start,connectionsHref:b}),e[4]=m.state,e[5]=r.start,e[6]=b,e[7]=i.lifecycle,e[8]=i.phase,e[9]=h):h=e[9],h}if(!a||!o){let b;return e[10]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(tt,{title:"Waiting for sandbox context…"}),e[10]=b):b=e[10],b}const f=g?d:r.previewUrl;let p;return e[11]!==o||e[12]!==t||e[13]!==m.devServerReady||e[14]!==m.sandboxWarming||e[15]!==r.previewUrl||e[16]!==l.slug||e[17]!==f||e[18]!==a?(p=n.jsx(cc,{orgSlug:l.slug,virtualMcpId:a,branch:o,previewUrl:r.previewUrl,sitePreviewUrl:f,deepLinkPage:t,devServerReady:m.devServerReady,sandboxWarming:m.sandboxWarming}),e[11]=o,e[12]=t,e[13]=m.devServerReady,e[14]=m.sandboxWarming,e[15]=r.previewUrl,e[16]=l.slug,e[17]=f,e[18]=a,e[19]=p):p=e[19],p}const bn=2e3,rc=15;function yn(s,e,t,o){return typeof e!="string"||t&&(Vn(e,t,o)||s.state.dataUpdateCount>=rc)?!1:bn}function cc({orgSlug:s,virtualMcpId:e,branch:t,previewUrl:o,sitePreviewUrl:a,deepLinkPage:l,devServerReady:i,sandboxWarming:r}){const c=je(),d=Xt()?.taskId??null,g={orgSlug:s,virtualMcpId:e,branch:t,threadId:d,previewUrl:o},{data:u,isLoading:m}=Pa(g,{fetchEnabled:i}),f=vn({strict:!1}),[p,b]=A.useState(()=>f.contentCollection&&st(f.contentCollection)&&f.contentCollection||"pages"),[h,y]=A.useState(()=>f.contentItem&&st(p)?{collection:p,key:f.contentItem}:null),[j,k]=A.useState(null),S=!!(l?.pageId||l?.path||l?.pathTemplate),[w,_]=A.useState(!1);if(S&&!w&&h===null&&u){_(!0);const x=Ka(Us(u),l??{});x&&(b("pages"),y({collection:"pages",key:x.key,path:x.path}))}const[E,N]=A.useState(""),[B,R]=A.useState("list"),L=x=>{y(x),k(null)},[M,F]=A.useState(p);M!==p&&(F(p),N(""));const{data:T,isLoading:$,isFetching:K}=Ta(g,{fetchEnabled:i,refetchInterval:x=>{const Q=x.state.data;if(p==="apps"&&h&&h.collection==="apps"){const de=u?.[h.key];return yn(x,typeof de?.__resolveType=="string"?de.__resolveType:void 0,Q)}if(p==="site"&&u){const de=Q?Hs(u,Q):null,pe=u.site,Ce=de?.resolveType??(typeof pe?.__resolveType=="string"?pe.__resolveType:void 0);return yn(x,Ce,Q,["seo"])}return!1}}),z=(x,Q)=>!Vn(x,T,Q)&&($||K),{catalog:G,isLoading:W}=Bl(T??void 0,u??void 0,{enabled:p==="apps"}),O=es(g),I=Ya(g),D=Mi({orgSlug:s,virtualMcpId:e,branch:t,decofile:u??{},onMoved:(x,Q)=>y(de=>de?.collection==="posts"&&de.key===x?{collection:"posts",key:Q}:de)}),[U,J]=A.useState(null),[Z,oe]=A.useState(),[ae,ie]=A.useState(!1),[te,ue]=A.useState(),[ee,P]=A.useState(null),[q,ne]=A.useState(null),[se,re]=A.useState(null),ce=!u||!T;if(m||$||ce&&r)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(ot,{className:"size-5 text-muted-foreground"})});if(ce)return n.jsx(tt,{title:"Could not load site data."});const v=Us(u).sort((x,Q)=>x.name.localeCompare(Q.name)),V=za(u).sort((x,Q)=>x.from.localeCompare(Q.from)),fe=Ma(u,T),ge=p==="sections"?Va(T):[],ve=Hs(u,T),he=Wn(u),De=_s.some(x=>he[x].length>0),ke=st(p)?he[p]:[],Pe=Vs(T,"loaders"),Te=Vs(T,"actions");if(!Ga(u,T)&&!De&&Pe===0&&Te===0)return n.jsx(tt,{icon:Tt,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const Be={pages:v.length,sections:fe.length,apps:G.length,loaders:Pe,actions:Te,redirects:V.length,posts:he.posts.length,authors:he.authors.length,categories:he.categories.length},_e=new Set(v.map(x=>Ft(x.path))),be=new Set(v.map(x=>x.name)),Le=new Set(fe.map(x=>x.name)),Ie=async x=>{const Q=u[x.key];if(!Q)return;const de=Fn(u,x.key),pe=Ua(u,x.key,Math.max(0,de-1)),Ce=Ha(Q.sections,pe);if(Ce)try{await O.mutateAsync({blockKey:x.key,data:{...Q,sections:Ce}}),me.success(`Variant added to "${x.name}"`),y({collection:"pages",key:x.key,path:x.path})}catch($e){me.error($e instanceof Error?$e.message:"Could not add variant")}},H=()=>{oe(void 0),J({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},xe=x=>{oe(void 0),J({mode:"duplicate",sourceKey:x.key,initialName:Js(be,x.name),initialPath:Ol(_e,x.path)})},we=x=>{oe(void 0),J({mode:"rename",sourceKey:x.key,initialName:x.name,initialPath:x.path})},Re=async x=>{if(!U)return;const{mode:Q,sourceKey:de}=U;try{if(Q==="create"){let pe;if(x.templateKey){const $e=u[x.templateKey];if(!$e)throw new Error("Selected template no longer exists.");pe={...$e,name:x.name,path:x.path}}else pe=Il(x.name,x.path);const Ce=zl(u,x.name);await O.mutateAsync({blockKey:Ce,data:pe}),me.success(`Created "${x.name}"`),y({collection:"pages",key:Ce,path:x.path})}else if(Q==="duplicate"&&de){const pe=u[de];if(!pe)throw new Error("Source page not found");const{key:Ce,data:$e}=Fl({source:pe,pages:v,newName:x.name,newPath:x.path});await O.mutateAsync({blockKey:Ce,data:$e}),me.success(`Duplicated as "${x.name}"`),y({collection:"pages",key:Ce,path:x.path})}else if(Q==="rename"&&de){const pe=u[de];if(!pe)throw new Error("Page not found");const Ce={...pe,name:x.name,path:x.path};await O.mutateAsync({blockKey:de,data:Ce}),me.success("Page updated"),h?.collection==="pages"&&h.key===de&&y({collection:"pages",key:de,path:x.path})}J(null)}catch(pe){oe(pe instanceof Error?pe.message:"Save failed")}},rs=({path:x})=>{if(!U)return null;const Q=Ft(x);return(U.mode==="rename"?Ft(U.initialPath):null)!==Q&&_e.has(Q)?`A page with path "${x}" already exists.`:null},cs=async(x,Q,de)=>{await O.mutateAsync({blockKey:Q,data:{...de,name:Q,__resolveType:x}}),me.success(c("sandbox.contentBrowser.createdSection",{name:Q})),y({collection:"sections",key:Q})},ds=$n((x,Q)=>O.mutate({blockKey:x,data:Q})),Dt=async x=>{const Q=u[x.key];if(!Q){me.error(c("sandbox.contentBrowser.sectionNotFound"));return}const de=Rl(u,x.key),pe=Js(Le,x.name),Ce={...Q,name:pe};try{await O.mutateAsync({blockKey:de,data:Ce}),me.success(c("sandbox.contentBrowser.duplicatedSection",{name:x.name})),y({collection:"sections",key:de})}catch($e){me.error($e instanceof Error?$e.message:c("sandbox.contentBrowser.duplicateFailed"))}},us=async x=>{if(!ee)return;const Q=u[ee];if(!Q){me.error(c("sandbox.contentBrowser.sectionNotFound"));return}try{await O.mutateAsync({blockKey:ee,data:{...Q,name:x}}),me.success(c("sandbox.contentBrowser.sectionRenamed")),P(null)}catch(de){me.error(de instanceof Error?de.message:c("sandbox.contentBrowser.renameFailed"))}},ms=()=>{ue(void 0),ie(!0)},C=async x=>{const Q=qa(u,x.from),de=Wa(x);try{await O.mutateAsync({blockKey:Q,data:de}),me.success("Created redirect"),ie(!1),y({collection:"redirects",key:Q})}catch(pe){ue(pe instanceof Error?pe.message:"Could not create redirect")}},X=async x=>{const Q=bs(u,x),de=ut(Q,x,oo(x));try{await O.mutateAsync({blockKey:Q,data:de}),me.success(`Created ${Ct[x]}`),y({collection:x,key:Q})}catch(pe){me.error(pe instanceof Error?pe.message:"Could not create")}},Ne=async x=>{const Q=bs(u,"posts"),de=ut(Q,"posts",Oi(x));try{await O.mutateAsync({blockKey:Q,data:de}),me.success(c("sandbox.postCalendar.createdScheduledPost")),b("posts"),F("posts"),y({collection:"posts",key:Q}),k(null)}catch(pe){me.error(pe instanceof Error?pe.message:c("sandbox.postCalendar.couldNotCreate"))}},Ge=async(x,Q)=>{const de=u[x],pe=de?Fi(rt(de,"posts"),Q):null;if(!pe){me.error(c("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await O.mutateAsync({blockKey:x,data:ut(x,"posts",pe)})}catch(Ce){me.error(Ce instanceof Error?Ce.message:c("sandbox.postCalendar.couldNotReschedule"))}},Ee=async x=>{const Q=u[x.key];if(!Q){me.error("Record not found.");return}const de=bs(u,x.kind),pe=x.kind==="posts"?"title":"name",Ce={...structuredClone(rt(Q,x.kind)),[pe]:`${x.label} (copy)`};if(x.kind==="categories"){const $e=he.categories.map(Lt=>Lt.slug??"").filter(Boolean);Ce.slug=Ai(String(Ce.slug??""),$e)}try{await O.mutateAsync({blockKey:de,data:ut(de,x.kind,Ce)}),me.success(`Duplicated "${x.label}"`),y({collection:x.kind,key:de})}catch($e){me.error($e instanceof Error?$e.message:"Duplicate failed")}},_t=()=>{b("posts"),F("posts"),y(null),k(null),N("")},bt=async()=>{if(q)try{const{kind:x,key:Q,label:de}=q;if(x==="blog"){if(q.blogKind==="categories"){const pe=rt(u[Q],"categories").slug,Ce=typeof pe=="string"?pe:"";if(Ce)for(const{key:$e,payload:Lt}of no(u)){const Fs=mi(Lt,Ce);Fs!==Lt&&await O.mutateAsync({blockKey:$e,data:ri($e,fi(Fs))})}}await I.mutateAsync({blockKey:Q})}else await I.mutateAsync({blockKey:Q});me.success(`Deleted "${de}"`),h&&h.collection!=="available-section"&&h.key===Q&&y(null),ne(null)}catch(x){me.error(x instanceof Error?x.message:"Delete failed")}},Ke=I.isPending||O.isPending,At=q?.kind==="blog"?Ct[q.blogKind]:q?.kind??"item";return n.jsxs("div",{className:"flex h-full w-full",children:[n.jsx(Dl,{active:p,counts:Be,showBlog:De,onSelect:x=>{b(x),y(null),k(null)}}),p!=="seo"&&p!=="site"&&p!=="context"&&p!=="calendar"&&p!=="post-schedule"&&p!=="posts"&&p!=="loaders"&&p!=="actions"&&n.jsx(dc,{activeCollection:p,pages:v,redirects:V,sections:fe,availableSections:ge,appCatalog:G,appCatalogLoading:W,blogEntries:ke,decofile:u,searchQuery:E,onSearchChange:N,selection:h,onSelect:L,onCreate:()=>{p==="pages"?H():p==="redirects"?ms():st(p)&&X(p)},onDuplicatePage:xe,onRenamePage:we,onAddPageVariant:Ie,onDeletePage:x=>ne({kind:"page",key:x.key,label:x.name}),onEditPageSeo:x=>{const Q={collection:"pages",key:x.key,path:x.path};y(Q),k(x.key)},onViewPageJson:x=>re(x.key),onDuplicateSection:Dt,onRenameSection:x=>P(x.key),onDeleteSection:x=>ne({kind:"section",key:x.key,label:x.name}),onDeleteRedirect:x=>ne({kind:"redirect",key:x.key,label:x.from||x.key}),onDuplicateBlog:Ee,onDeleteBlog:x=>ne({kind:"blog",blogKind:x.kind,key:x.key,label:x.label})}),n.jsx("div",{className:"flex-1 min-w-0",children:p==="loaders"||p==="actions"?n.jsx(Ar,{orgSlug:s,virtualMcpId:e,branch:t,previewUrl:o,meta:T,decofile:u,kind:p}):n.jsx(A.Suspense,{fallback:n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(ot,{className:"size-5 text-muted-foreground"})}),children:p==="calendar"?n.jsx(oc,{decofile:u}):p==="post-schedule"?n.jsx(ac,{decofile:u,isCreating:O.isPending,onCreate:x=>{Ne(x)},onReschedule:(x,Q)=>{Ge(x,Q)},onSelect:x=>{b("posts"),F("posts"),y({collection:"posts",key:x}),k(null)}}):p==="site"?ve?n.jsx(xn,{orgSlug:s,virtualMcpId:e,branch:t,blockKey:ve.key,block:u[ve.key],decofile:u,meta:T,title:"Site",excludeFields:["seo"],schemaPending:z(ve.resolveType,["seo"]),previewBaseUrl:o},`site:${ve.key}`):n.jsx(tt,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):p==="context"?n.jsx(bl,{title:c("sandbox.blogContext.soonTitle"),description:c("sandbox.blogContext.soonDescription"),children:n.jsx(ec,{orgSlug:s,virtualMcpId:e,branch:t,decofile:u,meta:T,onOpenPost:x=>{b("posts"),F("posts"),y({collection:"posts",key:x}),k(null)},onManageCategoryPosts:()=>{b("posts"),F("posts"),y(null),k(null)}})}):p==="seo"?n.jsx(nc,{orgSlug:s,virtualMcpId:e,branch:t,decofile:u,meta:T,target:{kind:"site"},previewBaseUrl:a}):p==="sections"?n.jsx(qr,{selection:h?.collection==="sections"||h?.collection==="available-section"?h:null,orgSlug:s,virtualMcpId:e,branch:t,previewUrl:o,meta:T,decofile:u,isCreating:O.isPending,onCreateAvailable:cs,onSaveReferencedBlock:ds}):p==="posts"?n.jsx(wr,{orgSlug:s,virtualMcpId:e,branch:t,decofile:u,view:B,selectedKey:h?.collection==="posts"?h.key:null,onViewChange:x=>{R(x),y(null)},onClose:()=>y(null),onOpen:x=>{y({collection:"posts",key:x}),k(null)},move:D,meta:T,renderDetail:(x,Q)=>n.jsx(Xr,{orgSlug:s,virtualMcpId:e,branch:t,blockKey:x,block:u[x],decofile:u,meta:T,previewBaseUrl:a,move:D,onClose:Q?.onClose,expanded:Q?.expanded,onToggleExpand:Q?.onToggleExpand},`post:${Pt(x)}`)}):h&&h.collection!=="available-section"?h.collection==="apps"?n.jsx(xn,{orgSlug:s,virtualMcpId:e,branch:t,blockKey:h.key,block:u[h.key],decofile:u,meta:T,previewBaseUrl:o,schemaPending:z(typeof u[h.key]?.__resolveType=="string"?String(u[h.key].__resolveType):void 0)},`app:${h.key}`):h.collection==="categories"?n.jsx(tc,{orgSlug:s,virtualMcpId:e,branch:t,blockKey:h.key,block:u[h.key],decofile:u,meta:T,onManagePosts:()=>_t(),onOpenPost:x=>{b("posts"),F("posts"),y({collection:"posts",key:x}),k(null)},previewBaseUrl:a},`category:${h.key}`):h.collection==="authors"?n.jsx(Zr,{orgSlug:s,virtualMcpId:e,branch:t,kind:"authors",blockKey:h.key,block:u[h.key],meta:T,decofile:u},`authors:${h.key}`):h.collection==="redirects"?n.jsx(lc,{orgSlug:s,virtualMcpId:e,branch:t,blockKey:h.key,block:u[h.key]},`redirect:${h.key}`):n.jsx(sc,{orgSlug:s,virtualMcpId:e,branch:t,previewReady:!0,previewUrl:o??void 0,currentPath:h.collection==="pages"?h.path:"/",activePageBlockKey:h.collection==="pages"?h.key:null,activeGlobalBlockKey:h.collection==="sections"?h.key:null,initialEditSeo:h.collection==="pages"&&j===h.key,onExitSeo:()=>k(null),onSelectRoot:()=>{y(null),k(null)}},h.collection==="pages"?`page:${h.key}`:`section:${h.key}`):n.jsx(tt,{title:`Select ${st(p)?`a ${Ct[p]}`:p==="pages"?"a page":p==="apps"?"an app":p==="redirects"?"a redirect":"a section"} to edit`,description:p==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),U&&n.jsx(Ul,{open:!!U,mode:U.mode,initialName:U.initialName,initialPath:U.initialPath,isPending:O.isPending,error:Z,templates:v,validate:rs,onSubmit:Re,onOpenChange:x=>{x||(J(null),oe(void 0))}}),n.jsx(ql,{open:ae,isPending:O.isPending,error:te,onSubmit:C,onOpenChange:x=>{x||(ie(!1),ue(void 0))}}),ee&&n.jsx(Wl,{open:!!ee,blockKey:ee,initialName:fe.find(x=>x.key===ee)?.name??ee,isPending:O.isPending,onSubmit:us,onOpenChange:x=>{x||P(null)}}),se&&n.jsx(Qa,{open:!!se,onOpenChange:x=>{x||re(null)},pageKey:se,decofile:u,onSave:x=>O.mutateAsync({blockKey:se,data:x})}),n.jsx(Zo,{open:!!q,onOpenChange:x=>{!x&&!Ke&&ne(null)},children:n.jsxs(ea,{children:[n.jsxs(ta,{children:[n.jsx(sa,{children:`Delete ${At}?`}),n.jsx(na,{children:q?.kind==="section"?`"${q.label}" will be removed. Pages that still reference it will lose this section.`:q?`"${q.label}" will be removed permanently. This can't be undone.`:null})]}),n.jsxs(oa,{children:[n.jsx(aa,{disabled:Ke,children:"Cancel"}),n.jsx(la,{onClick:x=>{x.preventDefault(),bt()},disabled:Ke,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ke?n.jsxs(n.Fragment,{children:[n.jsx(ot,{className:"size-3.5"}),"Deleting…"]}):"Delete"})]})]})})]})}function dc(s){const e=le.c(58),{activeCollection:t,pages:o,redirects:a,sections:l,availableSections:i,appCatalog:r,appCatalogLoading:c,blogEntries:d,decofile:g,searchQuery:u,onSearchChange:m,selection:f,onSelect:p,onCreate:b,onDuplicatePage:h,onRenamePage:y,onAddPageVariant:j,onDeletePage:k,onEditPageSeo:S,onViewPageJson:w,onDuplicateSection:_,onRenameSection:E,onDeleteSection:N,onDeleteRedirect:B,onDuplicateBlog:R,onDeleteBlog:L}=s,M=je();let F,T,$,K,z,G;if(e[0]!==t||e[1]!==r||e[2]!==c||e[3]!==i||e[4]!==d||e[5]!==g||e[6]!==j||e[7]!==b||e[8]!==L||e[9]!==k||e[10]!==B||e[11]!==N||e[12]!==R||e[13]!==h||e[14]!==_||e[15]!==S||e[16]!==y||e[17]!==E||e[18]!==m||e[19]!==p||e[20]!==w||e[21]!==o||e[22]!==a||e[23]!==u||e[24]!==l||e[25]!==f||e[26]!==M){const D=u.toLowerCase(),U=o.filter(v=>!D||v.name.toLowerCase().includes(D)||v.path.toLowerCase().includes(D)),J=a.filter(v=>!D||v.from.toLowerCase().includes(D)||v.to.toLowerCase().includes(D)),Z=l.filter(v=>!D||v.name.toLowerCase().includes(D)||v.key.toLowerCase().includes(D)||v.resolveType.toLowerCase().includes(D)),oe=i.filter(v=>!D||v.title.toLowerCase().includes(D)||v.resolveType.toLowerCase().includes(D)||(v.description?.toLowerCase().includes(D)??!1)),ae=Jr(Z),ie=r.filter(v=>!D||v.title.toLowerCase().includes(D)||v.app.toLowerCase().includes(D)||v.vendor.toLowerCase().includes(D)||v.category.toLowerCase().includes(D)),te=d.filter(v=>!D||v.label.toLowerCase().includes(D)||v.subtitle.toLowerCase().includes(D)),ue=t==="categories"&&!D?Yr(te):te.map(mc),ee=`Search ${t}…`,P=st(t)?`Create new ${Ct[t]}`:t==="redirects"?"Create new redirect":"Create new page",q=t!=="apps"&&t!=="sections";z="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let ne;e[33]===Symbol.for("react.memo_cache_sentinel")?(ne=n.jsx(ws,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[33]=ne):ne=e[33];let se;e[34]!==m?(se=v=>m(v.target.value),e[34]=m,e[35]=se):se=e[35];let re;e[36]!==ee||e[37]!==u||e[38]!==se?(re=n.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[ne,n.jsx("input",{type:"text",value:u,onChange:se,placeholder:ee,"aria-label":ee,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[36]=ee,e[37]=u,e[38]=se,e[39]=re):re=e[39];let ce;e[40]!==P||e[41]!==b||e[42]!==q?(ce=q&&n.jsxs(Ye,{children:[n.jsx(qe,{asChild:!0,children:n.jsx(Ae,{variant:"ghost",size:"icon",onClick:b,"aria-label":P,children:n.jsx(Ns,{size:14})})}),n.jsx(We,{side:"bottom",children:P})]}),e[40]=P,e[41]=b,e[42]=q,e[43]=ce):ce=e[43],e[44]!==re||e[45]!==ce?(G=n.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[re,ce]}),e[44]=re,e[45]=ce,e[46]=G):G=e[46],F=Zt,K="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",T="flex flex-col gap-1 p-1.5",$=t==="pages"?U.length===0?n.jsx(vt,{hasItems:o.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):U.map(v=>{const V=f?.collection==="pages"&&f.key===v.key,fe=Fn(g,v.key);return n.jsx(He,{icon:Tn,title:v.name,subtitle:v.path,active:V,variantCount:fe,onClick:()=>p({collection:"pages",key:v.key,path:v.path}),menu:n.jsx(Rt,{onDuplicate:()=>h(v),onRename:()=>y(v),onAddVariant:()=>j(v),onEditSeo:()=>S(v),onViewJson:()=>w(v),onDelete:()=>k(v)})},v.key)}):t==="sections"?Z.length===0&&oe.length===0?n.jsx(vt,{hasItems:l.length>0||i.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):n.jsxs(n.Fragment,{children:[ae.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(hn,{icon:Gt,label:"Saved sections"}),ae.map(v=>n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:v.label}),v.sections.map(V=>{const fe=f?.collection==="sections"&&f.key===V.key;return n.jsx(He,{icon:Gt,accent:"global",title:V.name,subtitle:v.label,active:fe,onClick:()=>p({collection:"sections",key:V.key}),menu:n.jsx(Rt,{onDuplicate:()=>_(V),onRename:()=>E(V),onDelete:()=>N(V)})},V.key)})]},v.label))]}),oe.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(hn,{icon:zs,label:"Available sections",className:ye(ae.length>0&&"mt-3")}),oe.map(v=>{const V=f?.collection==="available-section"&&f.resolveType===v.resolveType,fe=v.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return n.jsx(He,{icon:zs,title:v.title,subtitle:fe??v.resolveType,active:V,onClick:()=>p({collection:"available-section",resolveType:v.resolveType,title:v.title})},v.resolveType)})]})]}):t==="apps"?c?n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(ot,{className:"size-4.5 text-muted-foreground"})}):ie.length===0?n.jsx(vt,{hasItems:r.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):ie.map(v=>{const V=f?.collection==="apps"&&v.blockKey!==null&&f.key===v.blockKey;return n.jsx(He,{icon:Dn,logoUrl:v.logo,title:v.title,subtitle:v.category,active:V,trailing:v.installed?n.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(!v.installed||!v.blockKey){me.message(`${v.title} is not installed on this site.`);return}p({collection:"apps",key:v.blockKey})}},v.id)}):t==="redirects"?J.length===0?n.jsx(vt,{hasItems:a.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):J.map(v=>n.jsx(He,{icon:kn,title:v.from||"(no source)",subtitle:`→ ${v.to||"(no target)"}`,active:f?.collection==="redirects"&&f.key===v.key,trailing:n.jsx(Yl,{type:v.type}),onClick:()=>p({collection:"redirects",key:v.key}),menu:n.jsx(Rt,{onDelete:()=>B(v)})},v.key)):te.length===0?n.jsx(vt,{hasItems:d.length>0,emptyLabel:`No ${t} yet.`,emptyHint:`Click "+" to create your first ${st(t)?Ct[t]:"item"}.`}):ue.map(v=>{const{entry:V,depth:fe}=v,ge=f?.collection===V.kind&&f.key===V.key;return n.jsx("div",{style:{paddingLeft:fe*16},children:n.jsx(He,{icon:V.kind==="posts"?Bn:V.kind==="authors"?_n:Sn,title:V.label,invalid:V.missing.length>0,invalidReason:V.missing.length>0?M("sandbox.itemRow.missingFields",{fields:ni(V.missing,M)}):void 0,warning:V.duplicateName,warningReason:M("sandbox.itemRow.duplicateName"),subtitle:fe>0?Bo(V.slug??"",te).map(uc).join(" / "):V.subtitle,active:ge,onClick:()=>p({collection:V.kind,key:V.key}),menu:n.jsx(Rt,{onDuplicate:()=>R(V),onDelete:()=>L(V)})})},V.key)}),e[0]=t,e[1]=r,e[2]=c,e[3]=i,e[4]=d,e[5]=g,e[6]=j,e[7]=b,e[8]=L,e[9]=k,e[10]=B,e[11]=N,e[12]=R,e[13]=h,e[14]=_,e[15]=S,e[16]=y,e[17]=E,e[18]=m,e[19]=p,e[20]=w,e[21]=o,e[22]=a,e[23]=u,e[24]=l,e[25]=f,e[26]=M,e[27]=F,e[28]=T,e[29]=$,e[30]=K,e[31]=z,e[32]=G}else F=e[27],T=e[28],$=e[29],K=e[30],z=e[31],G=e[32];let W;e[47]!==T||e[48]!==$?(W=n.jsx("div",{className:T,children:$}),e[47]=T,e[48]=$,e[49]=W):W=e[49];let O;e[50]!==F||e[51]!==K||e[52]!==W?(O=n.jsx(F,{className:K,children:W}),e[50]=F,e[51]=K,e[52]=W,e[53]=O):O=e[53];let I;return e[54]!==z||e[55]!==G||e[56]!==O?(I=n.jsxs("div",{className:z,children:[G,O]}),e[54]=z,e[55]=G,e[56]=O,e[57]=I):I=e[57],I}function uc(s){return s.slug}function mc(s){return{entry:s,depth:0}}function fc(s){const e=le.c(25),{virtualMcpId:t}=s,o=je(),[a,l]=A.useState(!1),i=fl(t),{activeTask:r}=jn();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[0]=c):c=e[0];const d=vn(c);if(!(Ys(i?.metadata)||Ys(r?.metadata))){let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:n.jsx(Qs,{className:"size-7 text-foreground"})}),e[1]=m):m=e[1];let f;e[2]!==o?(f=o("mainPanelTabs.contentTab.noContentToEdit"),e[2]=o,e[3]=f):f=e[3];let p;e[4]!==o?(p=o("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=o,e[5]=p):p=e[5];let b,h;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=()=>l(!0),h=n.jsx(Qs,{className:"size-4"}),e[6]=b,e[7]=h):(b=e[6],h=e[7]);let y;e[8]!==o?(y=o("mainPanelTabs.previewTab.connectGithub"),e[8]=o,e[9]=y):y=e[9];let j;e[10]!==y?(j=n.jsxs(Ae,{onClick:b,children:[h,y]}),e[10]=y,e[11]=j):j=e[11];let k;e[12]!==f||e[13]!==p||e[14]!==j?(k=n.jsx(gl,{className:"h-full",image:m,title:f,description:p,actions:j}),e[12]=f,e[13]=p,e[14]=j,e[15]=k):k=e[15];let S;e[16]!==a?(S=n.jsx(hl,{open:a,onOpenChange:l,mode:"agent"}),e[16]=a,e[17]=S):S=e[17];let w;return e[18]!==S||e[19]!==k?(w=n.jsxs(n.Fragment,{children:[k,S]}),e[18]=S,e[19]=k,e[20]=w):w=e[20],w}let u;return e[21]!==d.contentPageId||e[22]!==d.contentPath||e[23]!==d.contentPathTemplate?(u=n.jsx(ic,{deepLinkPage:{pageId:d.contentPageId,path:d.contentPath,pathTemplate:d.contentPathTemplate}}),e[21]=d.contentPageId,e[22]=d.contentPath,e[23]=d.contentPathTemplate,e[24]=u):u=e[24],u}function pc(){const s=le.c(2),e=xl();let t;return s[0]!==e?(t=n.jsx(Ro,{tabId:"content",children:n.jsx(Fo,{feature:"cms",children:n.jsx(fc,{virtualMcpId:e})})}),s[0]=e,s[1]=t):t=s[1],t}const Od=Object.freeze(Object.defineProperty({__proto__:null,default:pc},Symbol.toStringTag,{value:"Module"}));export{Ld as $,Bd as A,lo as B,qn as C,ut as D,Td as E,Dd as F,Ls as G,mo as H,Vi as I,ze as J,Ci as K,pd as L,xd as M,Ve as N,bd as O,As as P,hd as Q,Ed as R,uo as S,ht as T,Bi as U,gd as V,ns as W,bs as X,oo as Y,Ki as Z,ci as _,ri as a,Yr as a0,To as a1,ui as a2,Ai as a3,no as a4,md as a5,fd as a6,kd as a7,Sd as a8,Nd as a9,dt as aa,Cd as ab,wd as ac,jd as ad,Pd as ae,Yt as af,Od as ag,as as b,Se as c,ud as d,ni as e,dd as f,rt as g,yd as h,Ue as i,ho as j,vd as k,Xn as l,os as m,Rl as n,Et as o,xt as p,Wn as q,vl as r,fi as s,$d as t,bo as u,_d as v,xi as w,yi as x,Ad as y,jo as z};
|
|
9
|
+
`)||void 0,count:B}),_t=Bi(ue.map(Ke=>Ke.title),Ee.themes);if(_t.length===0){me.info(m("sandbox.postBoard.ideasFailed"));return}let bt=0;for(const Ke of _t){const At=Si();try{await p.mutateAsync({blockKey:At,data:wi(At,{title:Ke.title,body:Ke.body,pillarKey:C?.key,createdAt:new Date().toISOString()})}),bt++}catch(x){console.warn("[posts] could not save a generated idea",x)}}if(bt===0){me.error(m("sandbox.postBoard.ideasFailed"));return}me.success(m("sandbox.postBoard.ideasAdded",{count:String(bt)}))}catch(X){me.error(X instanceof Error?X.message:m("sandbox.postBoard.ideasFailed"))}finally{S(!1)}};return n.jsxs("div",{className:"relative flex h-full min-w-0 flex-col",children:[n.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b px-6 py-3",children:[n.jsx("div",{className:"flex items-center gap-3",children:n.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",children:[n.jsx(pn,{active:a==="list",onClick:()=>i("list"),icon:n.jsx(Xo,{size:14}),label:m("sandbox.postBoard.viewList")}),n.jsx(pn,{active:a==="board",onClick:()=>i("board"),icon:n.jsx(Ho,{size:14}),label:m("sandbox.postBoard.viewBoard")})]})}),n.jsxs("div",{className:"flex items-center gap-2",children:[k&&n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","aria-live":"polite",role:"status",children:[n.jsx(Nt,{size:12,className:"animate-spin"}),m("sandbox.postBoard.generatingLabel")]}),n.jsxs(it,{open:w,onOpenChange:_,children:[n.jsx(sl,{asChild:!0,children:n.jsxs(Ae,{type:"button",variant:"outline",size:"sm",disabled:!0,children:[n.jsx(nt,{size:14}),m("sandbox.postBoard.generateIdeas"),n.jsx(mt,{variant:"secondary",children:m("common.soon")})]})}),n.jsxs(lt,{className:"sm:max-w-lg",children:[n.jsxs(ft,{children:[n.jsx(at,{children:m("sandbox.postBoard.generateIdeas")}),n.jsx(Ut,{children:m("sandbox.postBoard.ideaGuidanceLabel")})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx(It,{id:"idea-guidance",value:E,rows:6,autoFocus:!0,onChange:C=>N(C.target.value),placeholder:m("sandbox.postBoard.ideaGuidancePlaceholder"),className:"resize-none text-sm"}),ee.length>0&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(Me,{className:"text-xs",children:m("sandbox.postBoard.ideaPillarLabel")}),n.jsx(St,{options:ee.map(C=>C.title),value:ee.find(C=>C.key===L)?.title??"",emptyLabel:m("sandbox.postBoard.ideaNoPillar"),onChange:C=>M(ee.find(X=>X.title===C)?.key??"")})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Me,{htmlFor:"idea-count",className:"text-xs",children:m("sandbox.postBoard.ideaCount")}),n.jsx(Ze,{id:"idea-count",type:"number",min:1,max:8,value:B,onChange:C=>R(Math.max(1,Math.min(8,Number(C.target.value)||1))),className:"h-9 w-16"}),n.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:m("sandbox.postBoard.usesCredits")})]})]}),n.jsx(pt,{children:n.jsxs(Ae,{type:"button",onClick:()=>{_(!1),ms()},children:[n.jsx(nt,{size:14}),m("sandbox.postBoard.generateIdeas")]})})]})]}),n.jsxs(Mt,{children:[n.jsx(Kt,{asChild:!0,children:n.jsxs(Ae,{type:"button",size:"sm",children:[n.jsx(Ns,{size:14}),m("sandbox.postBoard.newPost"),n.jsx(Bt,{size:14})]})}),n.jsxs(zt,{align:"end",className:"w-56",children:[n.jsxs(Je,{disabled:!0,onClick:()=>{G(void 0),K(!0)},children:[n.jsx(nt,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[m("sandbox.postBoard.newPostGenerate"),n.jsx(mt,{variant:"secondary",children:m("common.soon")})]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:m("sandbox.postBoard.newPostGenerateHint")})]})]}),n.jsxs(Je,{onClick:Dt,children:[n.jsx(Jo,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{children:m("sandbox.postBoard.newPostWrite")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:m("sandbox.postBoard.newPostWriteHint")})]})]}),n.jsxs(Je,{onClick:()=>O(!0),children:[n.jsx(hs,{size:14}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{children:m("sandbox.postBoard.importContent")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:m("sandbox.postBoard.importContentHint")})]})]})]})]}),n.jsx(Hi,{open:$,onOpenChange:K,decofile:o,hasAi:b,seed:z,onGenerate:C=>{ie(C)}},z?.title??"scratch"),n.jsx(it,{open:W,onOpenChange:O,children:n.jsxs(lt,{className:"max-h-[85vh] sm:max-w-2xl",children:[n.jsxs(ft,{children:[n.jsx(at,{children:m("sandbox.postBoard.importTitle")}),n.jsx(Ut,{children:m("sandbox.postBoard.importDescription")})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"h-72 overflow-hidden rounded-[var(--studio-control-radius,var(--radius-xl))] border bg-[var(--studio-input-background)]",children:n.jsx(zn,{code:I,language:ko(I)?"html":"markdown",height:"100%",autoFocus:!0,onChange:C=>D(C??"")})}),n.jsx("input",{ref:U,type:"file",accept:".html,.htm,.md,.markdown,.txt",className:"hidden",onChange:async C=>{const X=C.target.files?.[0];X&&D(await X.text()),C.target.value=""}}),n.jsxs(Ae,{type:"button",variant:"outline",size:"sm",onClick:()=>U.current?.click(),children:[n.jsx(hs,{size:14}),m("sandbox.postBoard.importUpload")]})]}),n.jsx(pt,{children:n.jsxs(Ae,{type:"button",disabled:!I.trim(),onClick:us,children:[n.jsx(hs,{size:14}),m("sandbox.postBoard.importRun")]})})]})})]})]}),te.length===0?n.jsx(dl,{className:"flex-1",icon:n.jsx(nt,{size:22}),title:m("sandbox.postBoard.emptyTitle"),description:m("sandbox.postBoard.emptyDescription"),buttonProps:{children:m("sandbox.postBoard.newPost"),onClick:Dt}}):a==="board"?n.jsxs("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto p-4",children:[n.jsx(gn,{label:m("sandbox.postBoard.ideasTray")}),n.jsx(gn,{label:m(Et[mn])}),n.jsx("div",{"aria-hidden":!0,className:"my-1 w-px shrink-0 self-stretch bg-border"}),As.filter(C=>C!==mn).map(C=>{const X=m(Et[C]),Ne=te.filter(Ee=>Ee.status===C);Sr(C)&&Ne.sort(kr);const Ge=oe(C,Ne.length===0);return n.jsx("div",{onDragOver:Ee=>{Ee.preventDefault(),j(C)},onDragLeave:()=>j(Ee=>Ee===C?null:Ee),onDrop:Ee=>{Ee.preventDefault(),ds(C,Ee.dataTransfer.getData(Co))},className:ye("flex shrink-0 flex-col rounded-xl border bg-muted/30 transition-colors",Ge?"w-11":"w-72",y===C&&"border-primary bg-primary/5"),children:Ge?n.jsxs("button",{type:"button",onClick:()=>ae(C,!1),"aria-label":m("sandbox.postBoard.expandLane",{lane:X}),"aria-expanded":!1,className:"flex min-h-0 flex-1 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[n.jsx(Vt,{size:14,className:"shrink-0"}),n.jsx("span",{className:"text-xs tabular-nums",children:Ne.length}),n.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:X})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",children:[n.jsxs("button",{type:"button",onClick:()=>ae(C,!0),"aria-label":m("sandbox.postBoard.collapseLane",{lane:X}),"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[n.jsx(Bt,{size:14,className:"shrink-0"}),n.jsx("span",{className:"truncate",children:X})]}),n.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:Ne.length})]}),n.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-2 pb-2",children:Ne.length===0?n.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:m("sandbox.postBoard.laneEmpty")}):Ne.map(Ee=>n.jsx(Pr,{post:Ee,payload:P(Ee.key),moving:d.isMoving(Ee.key),onOpen:()=>r(Ee.key),onArchive:Ee.status==="archived"?void 0:()=>{ne(Ee)}},Ee.key))})]})},C)})]}):n.jsxs("div",{className:"flex min-h-0 flex-1",children:[n.jsxs("div",{className:"flex w-80 shrink-0 flex-col border-r",children:[n.jsx(pr,{value:he,onChange:De}),we?n.jsx(vr,{count:ke.size,allSelected:xe.length>0&&xe.every(C=>ke.has(C.key)),onToggleSelectAll:rs,onArchive:()=>{cs()},onExit:()=>Pe(new Set)}):n.jsx(gr,{categories:Le,authors:Ie,statusCounts:Te,categoryFilter:se,authorFilter:ce,statusFilter:V,sort:ge,onCategoryFilterChange:re,onAuthorFilterChange:v,onStatusFilterChange:fe,onSortChange:ve}),n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:n.jsx(Nr,{posts:xe,selectedKey:q,selectionActive:we,selectedKeys:ke,onToggleSelect:Re,onOpen:r,isMoving:d.isMoving,onArchive:C=>{ne(C)}})})]}),n.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:q&&u?n.jsx(A.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(Nt,{size:20,className:"animate-spin text-muted-foreground"})}),children:u(q)}):n.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:m("sandbox.postBoard.selectPrompt")})})]}),a==="board"&&l&&F&&u&&n.jsx("div",{className:"absolute inset-0 z-30 flex flex-col bg-background",children:u(l,{expanded:!0,onToggleExpand:()=>T(!1),onClose:()=>{T(!1),c?.()}})}),n.jsx(it,{open:a==="board"&&!!l&&!F,onOpenChange:C=>{C||(T(!1),c?.())},children:n.jsxs(lt,{closeButtonClassName:"hidden",className:"left-auto right-4 top-4 bottom-4 flex h-auto translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl",children:[n.jsx(at,{className:"sr-only",children:m("sandbox.collectionsSidebar.posts")}),l&&u?n.jsx(A.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(Nt,{size:20,className:"animate-spin text-muted-foreground"})}),children:u(l,{expanded:!1,onToggleExpand:()=>T(!0),onClose:()=>c?.()})}):null]})})]})}function pn(s){const e=le.c(7),{active:t,onClick:o,icon:a,label:l}=s,i=t?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground";let r;e[0]!==i?(r=ye("inline-flex cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",i),e[0]=i,e[1]=r):r=e[1];let c;return e[2]!==a||e[3]!==l||e[4]!==o||e[5]!==r?(c=n.jsxs("button",{type:"button",onClick:o,className:r,children:[a,l]}),e[2]=a,e[3]=l,e[4]=o,e[5]=r,e[6]=c):c=e[6],c}function Nr(s){const e=le.c(23),{posts:t,selectedKey:o,selectionActive:a,selectedKeys:l,onToggleSelect:i,onOpen:r,isMoving:c,onArchive:d}=s,g=je();if(t.length===0){let f;e[0]!==g?(f=g("sandbox.postList.noMatches"),e[0]=g,e[1]=f):f=e[1];let p;return e[2]!==f?(p=n.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f}),e[2]=f,e[3]=p):p=e[3],p}let u;if(e[4]!==c||e[5]!==d||e[6]!==r||e[7]!==i||e[8]!==t||e[9]!==o||e[10]!==l||e[11]!==a){let f;e[13]!==c||e[14]!==d||e[15]!==r||e[16]!==i||e[17]!==o||e[18]!==l||e[19]!==a?(f=p=>n.jsx(Cr,{post:p,selected:p.key===o,selectionActive:a,checked:l.has(p.key),onToggleSelect:()=>i(p.key),moving:c(p.key),onOpen:()=>r(p.key),onArchive:p.status==="archived"?void 0:()=>d(p)},p.key),e[13]=c,e[14]=d,e[15]=r,e[16]=i,e[17]=o,e[18]=l,e[19]=a,e[20]=f):f=e[20],u=t.map(f),e[4]=c,e[5]=d,e[6]=r,e[7]=i,e[8]=t,e[9]=o,e[10]=l,e[11]=a,e[12]=u}else u=e[12];let m;return e[21]!==u?(m=n.jsx("ul",{className:"divide-y",children:u}),e[21]=u,e[22]=m):m=e[22],m}function Cr(s){const e=le.c(60),{post:t,selected:o,selectionActive:a,checked:l,onToggleSelect:i,moving:r,onOpen:c,onArchive:d}=s,g=je(),u=t.status==="awaiting_review"&&t.missing.length>0,m=t.status==="scheduled"||t.status==="published",f=a||l?"opacity-100":"opacity-0 focus-within:opacity-100 group-hover/row:opacity-100";let p;e[0]!==f?(p=ye("absolute left-3 top-3 z-10 transition-opacity",f),e[0]=f,e[1]=p):p=e[1];let b;e[2]!==i?(b=()=>i(),e[2]=i,e[3]=b):b=e[3];let h;e[4]!==t.title||e[5]!==g?(h=t.title||g("sandbox.postBoard.untitled"),e[4]=t.title,e[5]=g,e[6]=h):h=e[6];let y;e[7]!==l||e[8]!==b||e[9]!==h?(y=n.jsx(ts,{checked:l,onCheckedChange:b,"aria-label":h}),e[7]=l,e[8]=b,e[9]=h,e[10]=y):y=e[10];let j;e[11]!==p||e[12]!==y?(j=n.jsx("span",{className:p,children:y}),e[11]=p,e[12]=y,e[13]=j):j=e[13];let k;e[14]!==r||e[15]!==d||e[16]!==a?(k=d&&!a&&n.jsx(Po,{onArchive:d,disabled:r,className:"top-2.5"}),e[14]=r,e[15]=d,e[16]=a,e[17]=k):k=e[17];let S;e[18]!==c||e[19]!==i||e[20]!==a?(S=()=>a?i():c(),e[18]=c,e[19]=i,e[20]=a,e[21]=S):S=e[21];const w=o?"bg-accent text-accent-foreground":"bg-card hover:bg-muted/50";let _;e[22]!==w?(_=ye("flex w-full cursor-pointer flex-col gap-1.5 py-2.5 pl-10 pr-3 text-left text-sm transition-colors",w),e[22]=w,e[23]=_):_=e[23];let E;e[24]!==t.title||e[25]!==g?(E=t.title||g("sandbox.postBoard.untitled"),e[24]=t.title,e[25]=g,e[26]=E):E=e[26];let N;e[27]!==E?(N=n.jsx("span",{className:"min-w-0 truncate pr-6 font-medium",children:E}),e[27]=E,e[28]=N):N=e[28];const B=jr[t.status],R=Et[t.status];let L;e[29]!==g||e[30]!==R?(L=g(R),e[29]=g,e[30]=R,e[31]=L):L=e[31];let M;e[32]!==B||e[33]!==L?(M=n.jsx(mt,{variant:B,className:"shrink-0",children:L}),e[32]=B,e[33]=L,e[34]=M):M=e[34];let F;e[35]!==u||e[36]!==t.missing?(F=u&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[n.jsx(Tt,{size:12}),t.missing.length]}),e[35]=u,e[36]=t.missing,e[37]=F):F=e[37];let T;e[38]!==t.duplicateTitle||e[39]!==g?(T=t.duplicateTitle&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",title:g("sandbox.postBoard.duplicateTitle"),children:[n.jsx(Bs,{size:12,"aria-hidden":!0}),n.jsx("span",{className:"sr-only",children:g("sandbox.postBoard.duplicateTitle")})]}),e[38]=t.duplicateTitle,e[39]=g,e[40]=T):T=e[40];let $;e[41]!==m||e[42]!==t.date||e[43]!==t.scheduledDatetime?($=m&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[n.jsx(Ss,{size:12}),(t.scheduledDatetime||t.date||"").slice(0,10)]}),e[41]=m,e[42]=t.date,e[43]=t.scheduledDatetime,e[44]=$):$=e[44];let K;e[45]!==M||e[46]!==F||e[47]!==T||e[48]!==$?(K=n.jsxs("div",{className:"flex items-center gap-2",children:[M,F,T,$]}),e[45]=M,e[46]=F,e[47]=T,e[48]=$,e[49]=K):K=e[49];let z;e[50]!==o||e[51]!==_||e[52]!==N||e[53]!==K||e[54]!==S?(z=n.jsxs("button",{type:"button",onClick:S,"aria-current":o,className:_,children:[N,K]}),e[50]=o,e[51]=_,e[52]=N,e[53]=K,e[54]=S,e[55]=z):z=e[55];let G;return e[56]!==z||e[57]!==j||e[58]!==k?(G=n.jsxs("li",{className:"group/row relative",children:[j,k,z]}),e[56]=z,e[57]=j,e[58]=k,e[59]=G):G=e[59],G}function Pr(s){const e=le.c(50),{post:t,payload:o,moving:a,onOpen:l,onArchive:i}=s,r=je(),c=t.status!=="generating"&&!a;let d;e[0]!==o?(d=ii(o),e[0]=o,e[1]=d):d=e[1];const g=d,u=!c&&"opacity-80";let m;e[2]!==u?(m=ye("group/card relative rounded-lg border bg-card shadow-sm transition-colors hover:border-primary/40",u),e[2]=u,e[3]=m):m=e[3];let f;e[4]!==a||e[5]!==i?(f=i&&n.jsx(Po,{onArchive:i,disabled:a,className:"top-2"}),e[4]=a,e[5]=i,e[6]=f):f=e[6];let p;e[7]!==t.key?(p=L=>L.dataTransfer.setData(Co,t.key),e[7]=t.key,e[8]=p):p=e[8];const b=c?"cursor-grab active:cursor-grabbing":"cursor-pointer";let h;e[9]!==b?(h=ye("block w-full p-3 text-left",b),e[9]=b,e[10]=h):h=e[10];let y;e[11]!==t.title||e[12]!==r?(y=t.title||r("sandbox.postBoard.untitled"),e[11]=t.title,e[12]=r,e[13]=y):y=e[13];let j;e[14]!==y?(j=n.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:y}),e[14]=y,e[15]=j):j=e[15];let k;e[16]!==g||e[17]!==t.status?(k=t.status==="draft"&&n.jsxs(n.Fragment,{children:[g.pillarTitle&&n.jsx(mt,{variant:"secondary",className:"max-w-full truncate",children:g.pillarTitle}),g.format?.name&&n.jsx(mt,{variant:"outline",className:"max-w-full truncate",children:g.format.name})]}),e[16]=g,e[17]=t.status,e[18]=k):k=e[18];let S;e[19]!==t.status||e[20]!==r?(S=t.status==="generating"&&n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[n.jsx(Nt,{size:12,className:"animate-spin"}),r("sandbox.postBoard.generatingLabel")]}),e[19]=t.status,e[20]=r,e[21]=S):S=e[21];let w;e[22]!==t.missing||e[23]!==t.status||e[24]!==r?(w=t.status==="awaiting_review"&&(t.missing.length>0?n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[n.jsx(Tt,{size:12}),r("sandbox.postBoard.nIssues",{count:String(t.missing.length)})]}):n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:[n.jsx(cl,{size:12}),r("sandbox.postBoard.readyToSchedule")]})),e[22]=t.missing,e[23]=t.status,e[24]=r,e[25]=w):w=e[25];let _;e[26]!==t.date||e[27]!==t.scheduledDatetime||e[28]!==t.status?(_=(t.status==="scheduled"||t.status==="published")&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[n.jsx(Ss,{size:12}),(t.scheduledDatetime||t.date||"").slice(0,10)]}),e[26]=t.date,e[27]=t.scheduledDatetime,e[28]=t.status,e[29]=_):_=e[29];let E;e[30]!==t.duplicateTitle||e[31]!==r?(E=t.duplicateTitle&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[n.jsx(Bs,{size:12,"aria-hidden":!0}),r("sandbox.postBoard.duplicateTitle")]}),e[30]=t.duplicateTitle,e[31]=r,e[32]=E):E=e[32];let N;e[33]!==k||e[34]!==S||e[35]!==w||e[36]!==_||e[37]!==E?(N=n.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[k,S,w,_,E]}),e[33]=k,e[34]=S,e[35]=w,e[36]=_,e[37]=E,e[38]=N):N=e[38];let B;e[39]!==c||e[40]!==l||e[41]!==N||e[42]!==p||e[43]!==h||e[44]!==j?(B=n.jsxs("button",{type:"button",draggable:c,onDragStart:p,onClick:l,className:h,children:[j,N]}),e[39]=c,e[40]=l,e[41]=N,e[42]=p,e[43]=h,e[44]=j,e[45]=B):B=e[45];let R;return e[46]!==B||e[47]!==m||e[48]!==f?(R=n.jsxs("div",{className:m,children:[f,B]}),e[46]=B,e[47]=m,e[48]=f,e[49]=R):R=e[49],R}function gn(s){const e=le.c(9),{label:t}=s,o=je();let a;e[0]!==t?(a=n.jsx("span",{className:"[writing-mode:vertical-rl] text-sm",children:t}),e[0]=t,e[1]=a):a=e[1];let l;e[2]!==o?(l=o("common.soon"),e[2]=o,e[3]=l):l=e[3];let i;e[4]!==l?(i=n.jsx("span",{className:"[writing-mode:vertical-rl] text-xs font-semibold",children:l}),e[4]=l,e[5]=i):i=e[5];let r;return e[6]!==a||e[7]!==i?(r=n.jsxs("div",{"aria-disabled":!0,className:"flex w-11 shrink-0 cursor-not-allowed flex-col items-center gap-2 rounded-xl border border-dashed border-primary/30 bg-primary/5 py-2.5 text-primary",children:[a,i]}),e[6]=a,e[7]=i,e[8]=r):r=e[8],r}function Po(s){const e=le.c(13),{label:t,onArchive:o,disabled:a,className:l}=s,i=je();let r;e[0]!==t||e[1]!==i?(r=t??i("sandbox.postBoard.delete"),e[0]=t,e[1]=i,e[2]=r):r=e[2];const c=r;let d;e[3]!==o?(d=f=>{f.stopPropagation(),o()},e[3]=o,e[4]=d):d=e[4];let g;e[5]!==l?(g=ye("absolute right-2 z-10 flex size-6 cursor-pointer items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-destructive focus-visible:opacity-100 group-hover/card:opacity-100 group-hover/row:opacity-100",l),e[5]=l,e[6]=g):g=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Es,{size:13}),e[7]=u):u=e[7];let m;return e[8]!==a||e[9]!==d||e[10]!==g||e[11]!==c?(m=n.jsx("button",{type:"button",disabled:a,"aria-label":c,title:c,onClick:d,className:g,children:u}),e[8]=a,e[9]=d,e[10]=g,e[11]=c,e[12]=m):m=e[12],m}function He(s){const e=le.c(54),{icon:t,logoUrl:o,title:a,subtitle:l,active:i,accent:r,variantCount:c,trailing:d,selectable:g,selectionActive:u,selected:m,invalid:f,invalidReason:p,warning:b,warningReason:h,onToggleSelect:y,onClick:j,menu:k}=s,S=je(),w=r==="global";let _;e[0]!==t||e[1]!==i||e[2]!==w||e[3]!==o?(_=o?n.jsx("img",{src:o,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):n.jsx("span",{className:ye("flex size-8 shrink-0 items-center justify-center rounded-lg",w?"bg-global-section/15":"bg-muted"),children:n.jsx(t,{size:16,className:ye("shrink-0",!w&&(i?"text-accent-foreground":"text-muted-foreground")),style:w?{color:Ts}:void 0})}),e[0]=t,e[1]=i,e[2]=w,e[3]=o,e[4]=_):_=e[4];const E=_,N=i?w?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":w?"hover:bg-global-section/10":"hover:bg-muted";let B;e[5]!==N?(B=ye("group relative flex min-w-0 items-center rounded-md transition-colors",N),e[5]=N,e[6]=B):B=e[6];let R;e[7]!==y||e[8]!==g||e[9]!==m||e[10]!==u||e[11]!==S||e[12]!==a?(R=g&&n.jsx("span",{className:ye("flex shrink-0 items-center pl-2.5 transition-opacity",m||u?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Tr,children:n.jsx(ts,{checked:m,onCheckedChange:()=>y?.(),"aria-label":S("sandbox.itemRow.selectItem",{title:a})})}),e[7]=y,e[8]=g,e[9]=m,e[10]=u,e[11]=S,e[12]=a,e[13]=R):R=e[13];const L=f&&!i&&"text-destructive";let M;e[14]!==L?(M=ye("block truncate text-sm font-medium",L),e[14]=L,e[15]=M):M=e[15];let F;e[16]!==M||e[17]!==a?(F=n.jsx("span",{className:M,children:a}),e[16]=M,e[17]=a,e[18]=F):F=e[18];const T=i?"text-accent-foreground/70":"text-muted-foreground";let $;e[19]!==T?($=ye("block truncate text-xs",T),e[19]=T,e[20]=$):$=e[20];let K;e[21]!==l||e[22]!==$?(K=n.jsx("span",{className:$,children:l}),e[21]=l,e[22]=$,e[23]=K):K=e[23];let z;e[24]!==K||e[25]!==F?(z=n.jsxs("span",{className:"min-w-0 flex-1",children:[F,K]}),e[24]=K,e[25]=F,e[26]=z):z=e[26];let G;e[27]!==i||e[28]!==S||e[29]!==c?(G=c!==void 0&&c>1&&n.jsxs(Ye,{children:[n.jsx(qe,{asChild:!0,children:n.jsxs("span",{className:ye("flex shrink-0 items-center gap-1 text-xs font-medium",i?"text-accent-foreground/70":"text-muted-foreground"),children:[n.jsx(Cn,{size:14}),c]})}),n.jsx(We,{side:"bottom",children:S("sandbox.itemRow.variantCount",{count:c})})]}),e[27]=i,e[28]=S,e[29]=c,e[30]=G):G=e[30];let W;e[31]!==b||e[32]!==h?(W=b&&n.jsxs(Ye,{children:[n.jsx(qe,{asChild:!0,children:n.jsx("span",{className:"flex shrink-0 items-center text-warning",children:n.jsx(Tt,{size:14})})}),h&&n.jsx(We,{side:"bottom",children:h})]}),e[31]=b,e[32]=h,e[33]=W):W=e[33];let O;e[34]!==i||e[35]!==f||e[36]!==p?(O=f&&n.jsxs(Ye,{children:[n.jsx(qe,{asChild:!0,children:n.jsx("span",{className:ye("flex shrink-0 items-center",i?"text-accent-foreground":"text-destructive"),children:n.jsx(Tt,{size:14})})}),p&&n.jsx(We,{side:"bottom",children:p})]}),e[34]=i,e[35]=f,e[36]=p,e[37]=O):O=e[37];let I;e[38]!==j||e[39]!==E||e[40]!==z||e[41]!==G||e[42]!==W||e[43]!==O||e[44]!==d?(I=n.jsxs("button",{type:"button",onClick:j,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[E,z,G,W,O,d]}),e[38]=j,e[39]=E,e[40]=z,e[41]=G,e[42]=W,e[43]=O,e[44]=d,e[45]=I):I=e[45];let D;e[46]!==i||e[47]!==k?(D=k&&n.jsx("div",{className:ye("pr-1 opacity-0 transition-opacity group-hover:opacity-100",i&&"opacity-100"),children:k}),e[46]=i,e[47]=k,e[48]=D):D=e[48];let U;return e[49]!==I||e[50]!==D||e[51]!==B||e[52]!==R?(U=n.jsxs("div",{className:B,children:[R,I,D]}),e[49]=I,e[50]=D,e[51]=B,e[52]=R,e[53]=U):U=e[53],U}function Tr(s){return s.stopPropagation()}function tt(s){const e=le.c(10),{icon:t,title:o,description:a}=s;let l;e[0]!==t?(l=t&&n.jsx(t,{size:24,className:"text-muted-foreground/60"}),e[0]=t,e[1]=l):l=e[1];let i;e[2]!==o?(i=n.jsx("div",{children:o}),e[2]=o,e[3]=i):i=e[3];let r;e[4]!==a?(r=a&&n.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:a}),e[4]=a,e[5]=r):r=e[5];let c;return e[6]!==l||e[7]!==i||e[8]!==r?(c=n.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]=c):c=e[9],c}const Br={loaders:Nn,actions:En},Er={loaders:"Loaders",actions:"Actions"},Dr={analytics:Yo,blog:In,commerce:Wo,site:qo,website:Gt};function _r(s,e){return e===0?Dr[s.toLowerCase()]??Ks:Ks}function Ot(s,e){return e===0?xa(s):s}function Ar(s){const e=le.c(98),{orgSlug:t,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:r,kind:c}=s,d=je();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[u,m]=A.useState(g),[f,p]=A.useState(null),[b,h]=A.useState(""),[y,j]=A.useState(zr),[k,S]=A.useState(c);k!==c&&(S(c),m([]),p(null),h(""),j(new Set));let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w=J=>{j(Z=>{const oe=new Set(Z);return oe.has(J)?oe.delete(J):oe.add(J),oe})},e[1]=w):w=e[1];const _=w;let E;e[2]!==a||e[3]!==t||e[4]!==o?(E={orgSlug:t,virtualMcpId:o,branch:a},e[2]=a,e[3]=t,e[4]=o,e[5]=E):E=e[5];const N=es(E);let B;e[6]!==N?(B=$n((J,Z)=>N.mutate({blockKey:J,data:Z})),e[6]=N,e[7]=B):B=e[7];const R=B;let L;e[8]!==c?(L=ba(c),e[8]=c,e[9]=L):L=e[9];const M=L,F=Br[c];let T,$,K,z,G,W,O;if(e[10]!==F||e[11]!==a||e[12]!==r||e[13]!==c||e[14]!==i||e[15]!==y||e[16]!==t||e[17]!==u||e[18]!==l||e[19]!==N||e[20]!==R||e[21]!==b||e[22]!==f||e[23]!==M||e[24]!==d||e[25]!==o){K=Symbol.for("react.early_return_sentinel");e:{const J=[...fa(i,r,c).map(Kr),...pa(i,c).map(Ir)],Z=b.trim().toLowerCase(),oe=Z.length>0,ae=oe?J.filter(H=>H.title.toLowerCase().includes(Z)||H.resolveType.toLowerCase().includes(Z)):[],ie=new Map,te=[],ue=new Map;if(!oe){for(const H of J){const xe=H.folderPath;if(!(xe.length<u.length)&&u.every((we,Re)=>xe[Re]===we))if(xe.length===u.length)if(H.savedKey!==void 0){const we=ue.get(H.resolveType);we?we.push(H):ue.set(H.resolveType,[H])}else te.push(H);else{const we=xe[u.length],Re=ie.get(we)??{count:0,savedCount:0};H.savedKey!==void 0?Re.savedCount=Re.savedCount+1:Re.count=Re.count+1,ie.set(we,Re)}}te.sort(Fr);for(const H of ue.values())H.sort(Rr)}const ee=[...ue.entries()].filter(H=>{const[xe]=H;return!te.some(we=>we.resolveType===xe)}).flatMap(Or).sort($r);let P;e[33]!==u?(P=(H,xe)=>Ot(H.name,u.length).localeCompare(Ot(xe.name,u.length)),e[33]=u,e[34]=P):P=e[34];const q=[...ie.entries()].map(Lr).sort(P);let ne;e[35]===Symbol.for("react.memo_cache_sentinel")?(ne=H=>{p(H.savedKey!==void 0?{mode:"saved",key:H.savedKey}:{mode:"available",resolveType:H.resolveType,title:H.title})},e[35]=ne):ne=e[35];const se=ne;let re;e[36]!==N||e[37]!==M||e[38]!==d?(re=async(H,xe)=>{await N.mutateAsync({blockKey:H,data:xe}),me.success(d("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:M,blockId:H})),p({mode:"saved",key:H})},e[36]=N,e[37]=M,e[38]=d,e[39]=re):re=e[39];const ce=re;let v;e[40]!==r||e[41]!==f?(v=Mr(f,r),e[40]=r,e[41]=f,e[42]=v):v=e[42];const V=v;if(V){const H=`${V.mode}:${V.mode==="saved"?V.blockKey:V.resolveType}`;let xe;e[43]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>p(null),e[43]=xe):xe=e[43];let we;e[44]!==a||e[45]!==r||e[46]!==ce||e[47]!==c||e[48]!==i||e[49]!==t||e[50]!==l||e[51]!==N.isPending||e[52]!==R||e[53]!==H||e[54]!==V.editorTarget||e[55]!==V.initialValue||e[56]!==o?(we=n.jsx(ga,{orgSlug:t,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:r,kind:c,target:V.editorTarget,initialValue:V.initialValue,isCreating:N.isPending,onCreate:ce,onSaveReferencedBlock:R,onBack:xe},H),e[44]=a,e[45]=r,e[46]=ce,e[47]=c,e[48]=i,e[49]=t,e[50]=l,e[51]=N.isPending,e[52]=R,e[53]=H,e[54]=V.editorTarget,e[55]=V.initialValue,e[56]=o,e[57]=we):we=e[57],K=we;break e}O="flex h-full w-full min-w-0 flex-col";let fe;e[58]!==d?(fe=d("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=d,e[59]=fe):fe=e[59];let ge;e[60]===Symbol.for("react.memo_cache_sentinel")?(ge=()=>m([]),e[60]=ge):ge=e[60];const ve=u.length===0?"font-medium text-foreground":"text-muted-foreground";let he;e[61]!==ve?(he=ye("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ve),e[61]=ve,e[62]=he):he=e[62];const De=Er[c];let ke;e[63]!==he||e[64]!==De?(ke=n.jsx("button",{type:"button",onClick:ge,className:he,children:De}),e[63]=he,e[64]=De,e[65]=ke):ke=e[65];let Pe;e[66]!==u?(Pe=u.map((H,xe)=>{const we=xe===u.length-1;return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[n.jsx(Vt,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>m(u.slice(0,xe+1)),className:ye("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",we?"font-medium text-foreground":"text-muted-foreground"),children:Ot(H,xe)})]},`${H}-${xe}`)}),e[66]=u,e[67]=Pe):Pe=e[67];let Te;e[68]!==fe||e[69]!==ke||e[70]!==Pe?(Te=n.jsxs("nav",{"aria-label":fe,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[ke,Pe]}),e[68]=fe,e[69]=ke,e[70]=Pe,e[71]=Te):Te=e[71];let Be;e[72]===Symbol.for("react.memo_cache_sentinel")?(Be=n.jsx(ws,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Be):Be=e[72];let _e;e[73]===Symbol.for("react.memo_cache_sentinel")?(_e=H=>h(H.target.value),e[73]=_e):_e=e[73];let be;e[74]!==c||e[75]!==d?(be=d("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:c}),e[74]=c,e[75]=d,e[76]=be):be=e[76];let Le;e[77]!==c||e[78]!==d?(Le=d("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:c}),e[77]=c,e[78]=d,e[79]=Le):Le=e[79];let Ie;e[80]!==b||e[81]!==be||e[82]!==Le?(Ie=n.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Be,n.jsx("input",{type:"text",value:b,onChange:_e,placeholder:be,"aria-label":Le,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=b,e[81]=be,e[82]=Le,e[83]=Ie):Ie=e[83],e[84]!==Te||e[85]!==Ie?($=n.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[Te,Ie]}),e[84]=Te,e[85]=Ie,e[86]=$):$=e[86],T=Zt,W="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",z="mx-auto w-full max-w-4xl px-6 py-5",G=oe?ae.length===0?n.jsx(tt,{title:d("sandbox.runnableBlocksBrowser.noSearchResults",{kind:c,query:b.trim()}),description:d("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):n.jsx("div",{className:"flex flex-col gap-1",children:ae.map(H=>n.jsx(He,{icon:F,accent:H.savedKey!==void 0?"global":void 0,title:H.title,subtitle:H.resolveType,active:!1,onClick:()=>se(H)},H.savedKey??H.resolveType))}):q.length===0&&te.length===0&&ee.length===0?n.jsx(tt,{title:d("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:c}),description:u.length===0?d("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):d("sandbox.runnableBlocksBrowser.emptyFolder")}):n.jsxs(n.Fragment,{children:[q.length>0&&n.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:q.map(H=>{const xe=_r(H.name,u.length);return n.jsxs("button",{type:"button",onClick:()=>m([...u,H.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:[n.jsx(xe,{size:18,className:"shrink-0 text-muted-foreground"}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm font-medium",children:Ot(H.name,u.length)}),n.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[H.count," ",H.count===1?M:c,H.savedCount>0&&n.jsxs(n.Fragment,{children:[" ","·"," ",d("sandbox.runnableBlocksBrowser.savedCountLabel",{count:H.savedCount})]})]})]})]},H.name)})}),(te.length>0||ee.length>0)&&n.jsxs("div",{className:ye("flex flex-col gap-1",q.length>0&&"mt-4"),children:[te.map(H=>{const xe=ue.get(H.resolveType)??[],we=y.has(H.resolveType);return n.jsxs("div",{className:"flex flex-col",children:[n.jsx(He,{icon:F,title:H.title,subtitle:H.resolveType,active:!1,onClick:()=>se(H)}),xe.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{type:"button",onClick:()=>_(H.resolveType),"aria-expanded":we,className:"flex items-center gap-1 self-start rounded-lg px-2.5 py-1 text-xs font-medium transition-colors hover:bg-global-section/10 cursor-pointer ml-11",style:{color:Ts},children:[we?n.jsx(Bt,{size:12,className:"shrink-0"}):n.jsx(Vt,{size:12,className:"shrink-0"}),d(we?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",xe.length,")"]}),we&&n.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:xe.map(Re=>n.jsx(He,{icon:F,accent:"global",title:Re.title,subtitle:Re.resolveType,active:!1,onClick:()=>se(Re)},Re.savedKey))})]})]},H.resolveType)}),ee.map(H=>n.jsx(He,{icon:F,accent:"global",title:H.title,subtitle:H.resolveType,active:!1,onClick:()=>se(H)},H.savedKey))]})]})}e[10]=F,e[11]=a,e[12]=r,e[13]=c,e[14]=i,e[15]=y,e[16]=t,e[17]=u,e[18]=l,e[19]=N,e[20]=R,e[21]=b,e[22]=f,e[23]=M,e[24]=d,e[25]=o,e[26]=T,e[27]=$,e[28]=K,e[29]=z,e[30]=G,e[31]=W,e[32]=O}else T=e[26],$=e[27],K=e[28],z=e[29],G=e[30],W=e[31],O=e[32];if(K!==Symbol.for("react.early_return_sentinel"))return K;let I;e[87]!==z||e[88]!==G?(I=n.jsx("div",{className:z,children:G}),e[87]=z,e[88]=G,e[89]=I):I=e[89];let D;e[90]!==T||e[91]!==I||e[92]!==W?(D=n.jsx(T,{className:W,children:I}),e[90]=T,e[91]=I,e[92]=W,e[93]=D):D=e[93];let U;return e[94]!==$||e[95]!==D||e[96]!==O?(U=n.jsxs("div",{className:O,children:[$,D]}),e[94]=$,e[95]=D,e[96]=O,e[97]=U):U=e[97],U}function Lr(s){const[e,t]=s;return{name:e,...t}}function $r(s,e){return s.title.localeCompare(e.title)}function Or(s){const[,e]=s;return e}function Rr(s,e){return s.title.localeCompare(e.title)}function Fr(s,e){return s.title.localeCompare(e.title)}function Ir(s){return{resolveType:s.resolveType,title:s.title,folderPath:Ln(s.resolveType)}}function Kr(s){return{resolveType:s.resolveType,title:s.title,folderPath:Ln(s.resolveType),savedKey:s.key}}function zr(){return new Set}function Mr(s,e){if(!s)return null;if(s.mode==="available")return{mode:"available",resolveType:s.resolveType,editorTarget:{mode:"available",resolveType:s.resolveType,title:s.title},initialValue:{}};const{resolveType:t,props:o,title:a}=ha(e,s.key);return{mode:"saved",blockKey:s.key,resolveType:t,editorTarget:{mode:"saved",blockKey:s.key,resolveType:t,title:a},initialValue:o}}function Vr(s){const e=le.c(106),{orgSlug:t,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:r,resolveType:c,title:d,defaultBlockId:g,isCreating:u,onCreate:m,onSaveReferencedBlock:f}=s,p=je(),b=Xt(),h=b?.virtualMcpId,j=Mn(h===o?o:null)?.metadata?.siteSlug??null;let k;e[0]===Symbol.for("react.memo_cache_sentinel")?(k={},e[0]=k):k=e[0];const[S,w]=A.useState(k);let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=[],e[1]=_):_=e[1];const[E,N]=A.useState(_),[B,R]=A.useState(0),[L,M]=A.useState(!1);let F;e[2]!==i||e[3]!==c?(F=Cs(c,i),e[2]=i,e[3]=c,e[4]=F):F=e[4];const T=F;let $,K,z,G,W,O,I,D;if(e[5]!==j||e[6]!==a||e[7]!==r||e[8]!==E||e[9]!==S||e[10]!==u||e[11]!==m||e[12]!==t||e[13]!==l||e[14]!==c||e[15]!==p||e[16]!==b?.taskId||e[17]!==d||e[18]!==o){const te=c.split("/").pop()?.replace(/\.tsx?$/,"")??c,ue=b?.taskId??null,ee=l??void 0;let P;e[27]!==j||e[28]!==a||e[29]!==t||e[30]!==ee||e[31]!==ue||e[32]!==o?(P={orgSlug:t,virtualMcpId:o,branch:a,threadId:ue,previewUrl:ee,siteSlug:j},e[27]=j,e[28]=a,e[29]=t,e[30]=ee,e[31]=ue,e[32]=o,e[33]=P):P=e[33],K=P;let q,ne,se,re;if(e[34]!==r||e[35]!==E||e[36]!==S||e[37]!==m||e[38]!==p||e[39]!==d){const ke=[d,...E],Pe=Be=>{N(E.slice(0,Be)),R(Gr)};let Te;e[48]!==r||e[49]!==S||e[50]!==m?(Te=async Be=>{const _e=va(Be,r);if(_e){me.error(_e);return}await m(Be,S),M(!1)},e[48]=r,e[49]=S,e[50]=m,e[51]=Te):Te=e[51],$=Te,D="flex h-full w-full min-w-0",I="flex min-w-0 flex-1 flex-col",W="shrink-0 border-b px-3 py-2.5",re="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==p?(q=p("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=p,e[53]=q):q=e[53],ne="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",se=ke.map((Be,_e)=>{const be=_e===ke.length-1,Le=ya(Be);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[_e>0&&n.jsx(Vt,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Pe(_e),title:Le,className:ye("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",be?"font-medium text-foreground":"text-muted-foreground"),children:Le})]},`${Le}-${_e}`)}),e[34]=r,e[35]=E,e[36]=S,e[37]=m,e[38]=p,e[39]=d,e[40]=$,e[41]=q,e[42]=ne,e[43]=se,e[44]=re,e[45]=W,e[46]=I,e[47]=D}else $=e[40],q=e[41],ne=e[42],se=e[43],re=e[44],W=e[45],I=e[46],D=e[47];let ce;e[54]!==q||e[55]!==ne||e[56]!==se?(ce=n.jsx("nav",{"aria-label":q,className:ne,children:se}),e[54]=q,e[55]=ne,e[56]=se,e[57]=ce):ce=e[57];let v;e[58]===Symbol.for("react.memo_cache_sentinel")?(v=()=>M(!0),e[58]=v):v=e[58];let V;e[59]!==p?(V=p("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=p,e[60]=V):V=e[60];let fe;e[61]===Symbol.for("react.memo_cache_sentinel")?(fe=n.jsx(Qo,{size:14}),e[61]=fe):fe=e[61];let ge;e[62]!==u||e[63]!==V?(ge=n.jsx(qe,{asChild:!0,children:n.jsx(Ae,{size:"icon",className:"size-8 shrink-0",disabled:u,onClick:v,"aria-label":V,children:fe})}),e[62]=u,e[63]=V,e[64]=ge):ge=e[64];let ve;e[65]!==p?(ve=p("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=p,e[66]=ve):ve=e[66];let he;e[67]!==ve?(he=n.jsx(We,{side:"bottom",children:ve}),e[67]=ve,e[68]=he):he=e[68];let De;e[69]!==ge||e[70]!==he?(De=n.jsxs(Ye,{children:[ge,he]}),e[69]=ge,e[70]=he,e[71]=De):De=e[71],e[72]!==re||e[73]!==ce||e[74]!==De?(O=n.jsxs("div",{className:re,children:[ce,De]}),e[72]=re,e[73]=ce,e[74]=De,e[75]=O):O=e[75],z="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",G=p("sandbox.availableSectionEditor.localEditsHint",{typeLabel:te}),e[5]=j,e[6]=a,e[7]=r,e[8]=E,e[9]=S,e[10]=u,e[11]=m,e[12]=t,e[13]=l,e[14]=c,e[15]=p,e[16]=b?.taskId,e[17]=d,e[18]=o,e[19]=$,e[20]=K,e[21]=z,e[22]=G,e[23]=W,e[24]=O,e[25]=I,e[26]=D}else $=e[19],K=e[20],z=e[21],G=e[22],W=e[23],O=e[24],I=e[25],D=e[26];let U;e[76]!==z||e[77]!==G?(U=n.jsx("p",{className:z,children:G}),e[76]=z,e[77]=G,e[78]=U):U=e[78];let J;e[79]!==U||e[80]!==W||e[81]!==O?(J=n.jsxs("div",{className:W,children:[O,U]}),e[79]=U,e[80]=W,e[81]=O,e[82]=J):J=e[82];let Z;e[83]!==r||e[84]!==E||e[85]!==B||e[86]!==S||e[87]!==i||e[88]!==f||e[89]!==K||e[90]!==T||e[91]!==p?(Z=n.jsx(Zt,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:T?n.jsx(On,{schema:T,value:S,onChange:te=>w(te),basePath:"",breadcrumbPath:E,onBreadcrumbChange:N,meta:i,decofile:r,onSaveReferencedBlock:f,sandbox:K},B):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:p("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=r,e[84]=E,e[85]=B,e[86]=S,e[87]=i,e[88]=f,e[89]=K,e[90]=T,e[91]=p,e[92]=Z):Z=e[92];let oe;e[93]!==J||e[94]!==Z||e[95]!==I?(oe=n.jsxs("div",{className:I,children:[J,Z]}),e[93]=J,e[94]=Z,e[95]=I,e[96]=oe):oe=e[96];let ae;e[97]!==g||e[98]!==$||e[99]!==u||e[100]!==L?(ae=n.jsx(ja,{open:L,onOpenChange:M,defaultBlockId:g,isPending:u,onSubmit:$}),e[97]=g,e[98]=$,e[99]=u,e[100]=L,e[101]=ae):ae=e[101];let ie;return e[102]!==oe||e[103]!==ae||e[104]!==D?(ie=n.jsxs("div",{className:D,children:[oe,ae]}),e[102]=oe,e[103]=ae,e[104]=D,e[105]=ie):ie=e[105],ie}function Gr(s){return s+1}function Ur(s,e){const t={__resolveType:s},o=wa([t],e)[0];return o?Na(t,o,e):null}function Hr({orgSlug:s,virtualMcpId:e,branch:t,previewUrl:o,meta:a,decofile:l,blockKey:i,onSaveReferencedBlock:r}){const c=je(),d=Xt(),g=d?.virtualMcpId,m=Mn(g===e?e:null)?.metadata?.siteSlug??null,[f]=A.useState(()=>Ur(i,l)),[p,b]=A.useState(f?.data??{}),[h,y]=A.useState([]),[j,k]=A.useState(0),[S,w]=A.useState(!1),[_,E]=A.useState(null),N=_!==null,{save:B,flush:R}=ka({orgSlug:s,virtualMcpId:e,branch:t}),L=f?.resolveType?Cs(f.resolveType,a):null,M=l[i],F=M?Ia(i,M):i,T=d?.taskId??null,$={orgSlug:s,virtualMcpId:e,branch:t,threadId:T,previewUrl:o??void 0,siteSlug:m},K=I=>{b(I),B(i,I)},z=()=>{N?(E(null),w(!1),k(I=>I+1)):E(JSON.stringify(p,null,2))},G=I=>{const D=I??"";try{const U=JSON.parse(D);if(U&&typeof U=="object"&&!Array.isArray(U)){w(!1),K(U);return}w(!0)}catch{w(!0)}},W=[F,...h],O=I=>{y(h.slice(0,I)),k(D=>D+1)};return n.jsx("div",{className:"flex h-full w-full min-w-0",children:n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsx(Sa,{crumbs:W,onSelect:O}),n.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[n.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Ts},"aria-hidden":!0}),n.jsx("div",{className:"flex-1"}),n.jsxs(Ye,{children:[n.jsx(qe,{asChild:!0,children:n.jsx(Ae,{variant:N?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:z,"aria-label":c(N?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":N,children:N?n.jsx(Ds,{size:14}):n.jsx(Pn,{size:14})})}),n.jsx(We,{side:"bottom",children:c(N?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),n.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:c("sandbox.savedSectionEditor.globalSectionDescription")})]}),n.jsxs("div",{className:"relative min-h-0 flex-1",children:[n.jsx(Zt,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:L?n.jsx(On,{schema:L,value:p,onChange:I=>K(I),basePath:"",breadcrumbPath:h,onBreadcrumbChange:y,meta:a,decofile:l,onSaveReferencedBlock:r,sandbox:$},j):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sandbox.savedSectionEditor.noEditableFields")})})})}),_!==null&&n.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[S&&n.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:c("sandbox.savedSectionEditor.invalidJsonError")}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(zn,{language:"json",height:"100%",code:_,onChange:G,onSave:I=>{G(I),R()}})})]})]})]})})}function qr(s){const e=le.c(36),{selection:t,orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:r,decofile:c,isCreating:d,onCreateAvailable:g,onSaveReferencedBlock:u}=s,m=je();if(!t){let b;e[0]!==m?(b=m("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=m,e[1]=b):b=e[1];let h;e[2]!==m?(h=m("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=m,e[3]=h):h=e[3];let y;return e[4]!==b||e[5]!==h?(y=n.jsx(tt,{title:b,description:h}),e[4]=b,e[5]=h,e[6]=y):y=e[6],y}if(t.collection==="available-section"){const b=`available:${t.resolveType}`,h=t.resolveType,y=t.title;let j;e[7]!==t.title?(j=Ca(t.title),e[7]=t.title,e[8]=j):j=e[8];let k;e[9]!==g||e[10]!==t.resolveType?(k=(w,_)=>g(t.resolveType,w,_),e[9]=g,e[10]=t.resolveType,e[11]=k):k=e[11];let S;return e[12]!==l||e[13]!==c||e[14]!==d||e[15]!==r||e[16]!==u||e[17]!==o||e[18]!==i||e[19]!==t.resolveType||e[20]!==t.title||e[21]!==b||e[22]!==j||e[23]!==k||e[24]!==a?(S=n.jsx(Vr,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:r,decofile:c,resolveType:h,title:y,defaultBlockId:j,isCreating:d,onCreate:k,onSaveReferencedBlock:u},b),e[12]=l,e[13]=c,e[14]=d,e[15]=r,e[16]=u,e[17]=o,e[18]=i,e[19]=t.resolveType,e[20]=t.title,e[21]=b,e[22]=j,e[23]=k,e[24]=a,e[25]=S):S=e[25],S}const f=`saved:${t.key}`;let p;return e[26]!==l||e[27]!==c||e[28]!==r||e[29]!==u||e[30]!==o||e[31]!==i||e[32]!==t.key||e[33]!==f||e[34]!==a?(p=n.jsx(Hr,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:r,decofile:c,blockKey:t.key,onSaveReferencedBlock:u},f),e[26]=l,e[27]=c,e[28]=r,e[29]=u,e[30]=o,e[31]=i,e[32]=t.key,e[33]=f,e[34]=a,e[35]=p):p=e[35],p}function Rt(s){const e=le.c(34),{onDuplicate:t,onRename:o,onAddVariant:a,onEditSeo:l,onViewJson:i,onDelete:r}=s,c=je();let d;e[0]!==c?(d=c("sandbox.itemActions.moreActions"),e[0]=c,e[1]=d):d=e[1];let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx($o,{size:14}),e[2]=g):g=e[2];let u;e[3]!==d?(u=n.jsx(Kt,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":d,className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:Wr,children:g})}),e[3]=d,e[4]=u):u=e[4];let m;e[5]!==o||e[6]!==c?(m=o&&n.jsxs(Je,{onClick:o,children:[n.jsx(pl,{size:14}),c("sandbox.itemActions.rename")]}),e[5]=o,e[6]=c,e[7]=m):m=e[7];let f;e[8]!==t||e[9]!==c?(f=t&&n.jsxs(Je,{onClick:t,children:[n.jsx(Bs,{size:14}),c("sandbox.itemActions.duplicate")]}),e[8]=t,e[9]=c,e[10]=f):f=e[10];let p;e[11]!==a||e[12]!==c?(p=a&&n.jsxs(n.Fragment,{children:[n.jsx(fs,{}),n.jsxs(Je,{onClick:a,className:"cursor-pointer text-success focus:text-success",children:[n.jsx(Cn,{size:14}),c("sandbox.itemActions.addVariant")]})]}),e[11]=a,e[12]=c,e[13]=p):p=e[13];let b;e[14]!==l||e[15]!==i||e[16]!==c?(b=(l||i)&&n.jsxs(n.Fragment,{children:[n.jsx(fs,{}),l&&n.jsxs(Je,{onClick:l,children:[n.jsx(wn,{size:14}),c("sandbox.itemActions.editSeo")]}),i&&n.jsxs(Je,{onClick:i,children:[n.jsx(Pn,{size:14}),c("sandbox.itemActions.viewJson")]})]}),e[14]=l,e[15]=i,e[16]=c,e[17]=b):b=e[17];let h;e[18]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(fs,{}),e[18]=h):h=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Es,{size:14}),e[19]=y):y=e[19];let j;e[20]!==c?(j=c("sandbox.itemActions.delete"),e[20]=c,e[21]=j):j=e[21];let k;e[22]!==r||e[23]!==j?(k=n.jsxs(Je,{onClick:r,className:"text-destructive focus:text-destructive",children:[y,j]}),e[22]=r,e[23]=j,e[24]=k):k=e[24];let S;e[25]!==k||e[26]!==m||e[27]!==f||e[28]!==p||e[29]!==b?(S=n.jsxs(zt,{align:"end",className:"w-44",children:[m,f,p,b,h,k]}),e[25]=k,e[26]=m,e[27]=f,e[28]=p,e[29]=b,e[30]=S):S=e[30];let w;return e[31]!==S||e[32]!==u?(w=n.jsxs(Mt,{children:[u,S]}),e[31]=S,e[32]=u,e[33]=w):w=e[33],w}function Wr(s){return s.stopPropagation()}const To=4;function ls(s){const e=new Map;for(const t of s)t.slug&&!e.has(t.slug)&&e.set(t.slug,t);return e}function is(s,e){const t=s.parentSlug;if(!s.slug||!t||t===s.slug)return;const o=e.get(t);return o===s?void 0:o}function Bo(s,e){const t=ls(e),o=[],a=new Set;let l=t.get(s);for(;l&&!a.has(l.slug??"")&&(a.add(l.slug??""),o.push(l),!(o.length>=To));)l=is(l,t);return o.reverse()}function Eo(s,e){const t=new Map;for(const o of s){const a=is(o,e);if(!a?.slug)continue;const l=t.get(a);l?l.push(o):t.set(a,[o])}for(const o of t.values())o.sort((a,l)=>a.label.localeCompare(l.label));return t}function Ld(s,e){const t=ls(e),o=Eo(e,t),a=new Set([s]),l=t.get(s);let i=l?[l]:[];for(;i.length;){const r=[];for(const c of i)for(const d of o.get(c)??[])d.slug&&!a.has(d.slug)&&(a.add(d.slug),r.push(d));i=r}return a.delete(s),a}function $d(s,e){if(!s)return[];const t=ls(e),o=Bo(s,e),a=o[0];return!a||is(a,t)?[s]:o.map(l=>l.slug??"")}function Yr(s){const e=ls(s),t=Eo(s,e),o=new Set,a=[],l=(r,c)=>{if(!o.has(r)&&(o.add(r),a.push({entry:r,depth:c}),!(c+1>=To)))for(const d of t.get(r)??[])l(d,c+1)},i=s.filter(r=>!is(r,e)).sort((r,c)=>r.label.localeCompare(c.label));for(const r of i)l(r,0);for(const r of s)l(r,0);return a}function Qr(s){return s.split("/").pop()?.replace(/\.tsx?$/,"")||s||"Section"}function Jr(s){const e=new Map;for(const t of s){const o=Qr(t.resolveType),a=e.get(o);a?a.push(t):e.set(o,[t])}return[...e.entries()].map(([t,o])=>({label:t,sections:o})).sort((t,o)=>t.label.localeCompare(o.label))}function hn(s){const e=le.c(8),{icon:t,label:o,className:a}=s;let l;e[0]!==a?(l=ye("flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",a),e[0]=a,e[1]=l):l=e[1];let i;e[2]!==t?(i=n.jsx(t,{size:13,className:"shrink-0"}),e[2]=t,e[3]=i):i=e[3];let r;return e[4]!==o||e[5]!==l||e[6]!==i?(r=n.jsxs("div",{className:l,children:[i,o]}),e[4]=o,e[5]=l,e[6]=i,e[7]=r):r=e[7],r}const xn=A.lazy(()=>Qe(()=>import("./app-editor-COtME4c7.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])).then(s=>({default:s.AppEditor}))),Xr=A.lazy(()=>Qe(()=>import("./post-editor-_9DsSzJD.js"),__vite__mapDeps([171,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,29,28,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,117,57,90,172,158,137,85,86,56,108,120,115,113,62,61,59,63,64,65,66,67,68,69,70,71,72,73,23,74,75,76,77,78,79,80,81,82,83,84,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,109,21,22,110,111,112,58,114,116,118,119,121,122,123,124,125,126,173,141,60,174,175,168,176,177,127,128,129,130,131,132,133,134,135,136,138,139,140,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,159,160,161,162,163,164,165,166,167,169,170])).then(s=>({default:s.PostEditor}))),Zr=A.lazy(()=>Qe(()=>import("./record-editor-B0H5WqkE.js"),__vite__mapDeps([178,1,2,57,90,22,23,24,25,113,62,61,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,59,28,29,30,31,32,33,34,35,36,37,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,63,64,65,66,67,68,69,70,56,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,21,110,111,112,58,114,115,116,117,118,119,120,121,122,123,124,125,126,175,177,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])).then(s=>({default:s.RecordEditor}))),ec=A.lazy(()=>Qe(()=>import("./context-D0fXSS45.js"),__vite__mapDeps([179,1,2,25,28,29,30,31,32,33,34,35,36,37,24,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,57,90,113,108,18,180,104,79,56,105,81,71,72,4,5,6,7,8,9,73,23,114,141,174,142,70,19,83,85,86,181,145,182,62,61,11,12,13,14,15,3,10,16,17,20,59,63,64,65,66,67,68,69,74,75,76,77,78,80,82,84,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,106,107,109,21,22,110,111,112,58,115,116,117,118,119,120,121,122,123,124,125,126,168,177,178,175,127,128,129,130,131,132,133,134,135,136,137,138,139,140,143,144,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,169,170,183,173,60,176])).then(s=>({default:s.BlogContext}))),tc=A.lazy(()=>Qe(()=>import("./category-editor-B8R6lxvV.js"),__vite__mapDeps([183,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,29,33,35,46,27,117,57,90,22,23,24,25,175,28,30,31,32,34,36,37,38,39,40,41,42,43,44,45,47,48,49,50,51,52,53,54,55,62,61,59,63,64,65,66,67,68,69,70,56,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,21,110,111,112,113,58,114,115,116,118,119,120,121,122,123,124,125,126,173,141,60,174,176,177,127,128,129,130,131,132,133,134,135,136,137,138,139,140,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])).then(s=>({default:s.CategoryEditor}))),sc=A.lazy(()=>Qe(()=>import("./sections-editor-BzSi4RpW.js"),__vite__mapDeps([184,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,58,62,61,59,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,63,64,65,66,67,68,69,70,56,71,72,73,23,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,57,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,21,22,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,168,185,26,60,186])).then(s=>({default:s.SectionsEditor}))),nc=A.lazy(()=>Qe(()=>import("./seo-editor-CbZ5Ttz-.js"),__vite__mapDeps([187,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,21,22,23,62,61,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,59,63,64,65,66,67,68,69,70,56,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,57,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,58,114,115,116,117,118,119,120,121,122,123,124,125,126,185])).then(s=>({default:s.SeoEditor}))),oc=A.lazy(()=>Qe(()=>import("./variant-calendar-COGidEDl.js"),__vite__mapDeps([188,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,90,21,22,23,115,73,189,127,128,123,121,20,14,13,124,5,4,6,7,8,9,11,12,15,102,129,77,81,130,3,10,16,17,18,19,79,56,131,96,72,103,104,105,57,71,132,82,83,84,74,85,86,87,88,89,91,92,93,94,95,97,98,99,100,133,61,69,68,70,65,66,120,134,125,80,135,136,137,138,108,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,113,154,155,156,157,158,159,160,161,162,64,67,75,76,78,101,106,107,163,118,63,164,165,166,167,117,62,59,109,110,111,112,58,114,116,119,122,126,168,169,170])).then(s=>({default:s.VariantCalendar}))),ac=A.lazy(()=>Qe(()=>import("./post-calendar-RlXieGQw.js"),__vite__mapDeps([190,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,21,22,23,127,128,123,121,20,14,13,124,5,4,6,7,8,9,11,12,15,102,129,77,81,130,3,10,16,17,18,19,79,73,56,131,96,72,103,104,105,90,57,71,132,82,83,84,74,85,86,87,88,89,91,92,93,94,95,97,98,99,100,133,61,69,68,70,65,66,120,134,125,80,135,136,137,138,108,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,113,154,155,156,157,158,159,160,161,162,64,67,75,76,78,101,106,107,163,118,63,164,165,166,167,117,62,59,109,110,111,112,58,114,115,116,119,122,126,168,169,170])).then(s=>({default:s.PostCalendar}))),lc=A.lazy(()=>Qe(()=>import("./redirect-editor-Bi6rLeHR.js"),__vite__mapDeps([191,1,2,137,24,57,90,22,23,25,62,61,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,59,28,29,30,31,32,33,34,35,36,37,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,63,64,65,66,67,68,69,70,56,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,21,110,111,112,113,58,114,115,116,117,118,119,120,121,122,123,124,125,126,177])).then(s=>({default:s.RedirectEditor})));function ic(s){const e=le.c(20),{deepLinkPage:t}=s,{currentBranch:o,virtualMcpId:a}=jn(),{org:l}=Oo(),i=el(),r=tl(),{runtime:c,previewServerUrl:d}=Kn(a),g=c==="cms";let u;e[0]!==g||e[1]!==r.previewState||e[2]!==i.lifecycle.phase?(u=$l({fastPreviewActive:g,previewState:r.previewState,lifecyclePhase:i.lifecycle.phase}),e[0]=g,e[1]=r.previewState,e[2]=i.lifecycle.phase,e[3]=u):u=e[3];const m=u;if(m.kind==="sandbox-card"){const b=`/${l.slug}/settings/connections`;let h;return e[4]!==m.state||e[5]!==r.start||e[6]!==b||e[7]!==i.lifecycle||e[8]!==i.phase?(h=n.jsx(Al,{state:m.state,claimPhase:i.phase,lifecycle:i.lifecycle,onStart:r.start,connectionsHref:b}),e[4]=m.state,e[5]=r.start,e[6]=b,e[7]=i.lifecycle,e[8]=i.phase,e[9]=h):h=e[9],h}if(!a||!o){let b;return e[10]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(tt,{title:"Waiting for sandbox context…"}),e[10]=b):b=e[10],b}const f=g?d:r.previewUrl;let p;return e[11]!==o||e[12]!==t||e[13]!==m.devServerReady||e[14]!==m.sandboxWarming||e[15]!==r.previewUrl||e[16]!==l.slug||e[17]!==f||e[18]!==a?(p=n.jsx(cc,{orgSlug:l.slug,virtualMcpId:a,branch:o,previewUrl:r.previewUrl,sitePreviewUrl:f,deepLinkPage:t,devServerReady:m.devServerReady,sandboxWarming:m.sandboxWarming}),e[11]=o,e[12]=t,e[13]=m.devServerReady,e[14]=m.sandboxWarming,e[15]=r.previewUrl,e[16]=l.slug,e[17]=f,e[18]=a,e[19]=p):p=e[19],p}const bn=2e3,rc=15;function yn(s,e,t,o){return typeof e!="string"||t&&(Vn(e,t,o)||s.state.dataUpdateCount>=rc)?!1:bn}function cc({orgSlug:s,virtualMcpId:e,branch:t,previewUrl:o,sitePreviewUrl:a,deepLinkPage:l,devServerReady:i,sandboxWarming:r}){const c=je(),d=Xt()?.taskId??null,g={orgSlug:s,virtualMcpId:e,branch:t,threadId:d,previewUrl:o},{data:u,isLoading:m}=Pa(g,{fetchEnabled:i}),f=vn({strict:!1}),[p,b]=A.useState(()=>f.contentCollection&&st(f.contentCollection)&&f.contentCollection||"pages"),[h,y]=A.useState(()=>f.contentItem&&st(p)?{collection:p,key:f.contentItem}:null),[j,k]=A.useState(null),S=!!(l?.pageId||l?.path||l?.pathTemplate),[w,_]=A.useState(!1);if(S&&!w&&h===null&&u){_(!0);const x=Ka(Us(u),l??{});x&&(b("pages"),y({collection:"pages",key:x.key,path:x.path}))}const[E,N]=A.useState(""),[B,R]=A.useState("list"),L=x=>{y(x),k(null)},[M,F]=A.useState(p);M!==p&&(F(p),N(""));const{data:T,isLoading:$,isFetching:K}=Ta(g,{fetchEnabled:i,refetchInterval:x=>{const Q=x.state.data;if(p==="apps"&&h&&h.collection==="apps"){const de=u?.[h.key];return yn(x,typeof de?.__resolveType=="string"?de.__resolveType:void 0,Q)}if(p==="site"&&u){const de=Q?Hs(u,Q):null,pe=u.site,Ce=de?.resolveType??(typeof pe?.__resolveType=="string"?pe.__resolveType:void 0);return yn(x,Ce,Q,["seo"])}return!1}}),z=(x,Q)=>!Vn(x,T,Q)&&($||K),{catalog:G,isLoading:W}=Bl(T??void 0,u??void 0,{enabled:p==="apps"}),O=es(g),I=Ya(g),D=Mi({orgSlug:s,virtualMcpId:e,branch:t,decofile:u??{},onMoved:(x,Q)=>y(de=>de?.collection==="posts"&&de.key===x?{collection:"posts",key:Q}:de)}),[U,J]=A.useState(null),[Z,oe]=A.useState(),[ae,ie]=A.useState(!1),[te,ue]=A.useState(),[ee,P]=A.useState(null),[q,ne]=A.useState(null),[se,re]=A.useState(null),ce=!u||!T;if(m||$||ce&&r)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(ot,{className:"size-5 text-muted-foreground"})});if(ce)return n.jsx(tt,{title:"Could not load site data."});const v=Us(u).sort((x,Q)=>x.name.localeCompare(Q.name)),V=za(u).sort((x,Q)=>x.from.localeCompare(Q.from)),fe=Ma(u,T),ge=p==="sections"?Va(T):[],ve=Hs(u,T),he=Wn(u),De=_s.some(x=>he[x].length>0),ke=st(p)?he[p]:[],Pe=Vs(T,"loaders"),Te=Vs(T,"actions");if(!Ga(u,T)&&!De&&Pe===0&&Te===0)return n.jsx(tt,{icon:Tt,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const Be={pages:v.length,sections:fe.length,apps:G.length,loaders:Pe,actions:Te,redirects:V.length,posts:he.posts.length,authors:he.authors.length,categories:he.categories.length},_e=new Set(v.map(x=>Ft(x.path))),be=new Set(v.map(x=>x.name)),Le=new Set(fe.map(x=>x.name)),Ie=async x=>{const Q=u[x.key];if(!Q)return;const de=Fn(u,x.key),pe=Ua(u,x.key,Math.max(0,de-1)),Ce=Ha(Q.sections,pe);if(Ce)try{await O.mutateAsync({blockKey:x.key,data:{...Q,sections:Ce}}),me.success(`Variant added to "${x.name}"`),y({collection:"pages",key:x.key,path:x.path})}catch($e){me.error($e instanceof Error?$e.message:"Could not add variant")}},H=()=>{oe(void 0),J({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},xe=x=>{oe(void 0),J({mode:"duplicate",sourceKey:x.key,initialName:Js(be,x.name),initialPath:Ol(_e,x.path)})},we=x=>{oe(void 0),J({mode:"rename",sourceKey:x.key,initialName:x.name,initialPath:x.path})},Re=async x=>{if(!U)return;const{mode:Q,sourceKey:de}=U;try{if(Q==="create"){let pe;if(x.templateKey){const $e=u[x.templateKey];if(!$e)throw new Error("Selected template no longer exists.");pe={...$e,name:x.name,path:x.path}}else pe=Il(x.name,x.path);const Ce=zl(u,x.name);await O.mutateAsync({blockKey:Ce,data:pe}),me.success(`Created "${x.name}"`),y({collection:"pages",key:Ce,path:x.path})}else if(Q==="duplicate"&&de){const pe=u[de];if(!pe)throw new Error("Source page not found");const{key:Ce,data:$e}=Fl({source:pe,pages:v,newName:x.name,newPath:x.path});await O.mutateAsync({blockKey:Ce,data:$e}),me.success(`Duplicated as "${x.name}"`),y({collection:"pages",key:Ce,path:x.path})}else if(Q==="rename"&&de){const pe=u[de];if(!pe)throw new Error("Page not found");const Ce={...pe,name:x.name,path:x.path};await O.mutateAsync({blockKey:de,data:Ce}),me.success("Page updated"),h?.collection==="pages"&&h.key===de&&y({collection:"pages",key:de,path:x.path})}J(null)}catch(pe){oe(pe instanceof Error?pe.message:"Save failed")}},rs=({path:x})=>{if(!U)return null;const Q=Ft(x);return(U.mode==="rename"?Ft(U.initialPath):null)!==Q&&_e.has(Q)?`A page with path "${x}" already exists.`:null},cs=async(x,Q,de)=>{await O.mutateAsync({blockKey:Q,data:{...de,name:Q,__resolveType:x}}),me.success(c("sandbox.contentBrowser.createdSection",{name:Q})),y({collection:"sections",key:Q})},ds=$n((x,Q)=>O.mutate({blockKey:x,data:Q})),Dt=async x=>{const Q=u[x.key];if(!Q){me.error(c("sandbox.contentBrowser.sectionNotFound"));return}const de=Rl(u,x.key),pe=Js(Le,x.name),Ce={...Q,name:pe};try{await O.mutateAsync({blockKey:de,data:Ce}),me.success(c("sandbox.contentBrowser.duplicatedSection",{name:x.name})),y({collection:"sections",key:de})}catch($e){me.error($e instanceof Error?$e.message:c("sandbox.contentBrowser.duplicateFailed"))}},us=async x=>{if(!ee)return;const Q=u[ee];if(!Q){me.error(c("sandbox.contentBrowser.sectionNotFound"));return}try{await O.mutateAsync({blockKey:ee,data:{...Q,name:x}}),me.success(c("sandbox.contentBrowser.sectionRenamed")),P(null)}catch(de){me.error(de instanceof Error?de.message:c("sandbox.contentBrowser.renameFailed"))}},ms=()=>{ue(void 0),ie(!0)},C=async x=>{const Q=qa(u,x.from),de=Wa(x);try{await O.mutateAsync({blockKey:Q,data:de}),me.success("Created redirect"),ie(!1),y({collection:"redirects",key:Q})}catch(pe){ue(pe instanceof Error?pe.message:"Could not create redirect")}},X=async x=>{const Q=bs(u,x),de=ut(Q,x,oo(x));try{await O.mutateAsync({blockKey:Q,data:de}),me.success(`Created ${Ct[x]}`),y({collection:x,key:Q})}catch(pe){me.error(pe instanceof Error?pe.message:"Could not create")}},Ne=async x=>{const Q=bs(u,"posts"),de=ut(Q,"posts",Oi(x));try{await O.mutateAsync({blockKey:Q,data:de}),me.success(c("sandbox.postCalendar.createdScheduledPost")),b("posts"),F("posts"),y({collection:"posts",key:Q}),k(null)}catch(pe){me.error(pe instanceof Error?pe.message:c("sandbox.postCalendar.couldNotCreate"))}},Ge=async(x,Q)=>{const de=u[x],pe=de?Fi(rt(de,"posts"),Q):null;if(!pe){me.error(c("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await O.mutateAsync({blockKey:x,data:ut(x,"posts",pe)})}catch(Ce){me.error(Ce instanceof Error?Ce.message:c("sandbox.postCalendar.couldNotReschedule"))}},Ee=async x=>{const Q=u[x.key];if(!Q){me.error("Record not found.");return}const de=bs(u,x.kind),pe=x.kind==="posts"?"title":"name",Ce={...structuredClone(rt(Q,x.kind)),[pe]:`${x.label} (copy)`};if(x.kind==="categories"){const $e=he.categories.map(Lt=>Lt.slug??"").filter(Boolean);Ce.slug=Ai(String(Ce.slug??""),$e)}try{await O.mutateAsync({blockKey:de,data:ut(de,x.kind,Ce)}),me.success(`Duplicated "${x.label}"`),y({collection:x.kind,key:de})}catch($e){me.error($e instanceof Error?$e.message:"Duplicate failed")}},_t=()=>{b("posts"),F("posts"),y(null),k(null),N("")},bt=async()=>{if(q)try{const{kind:x,key:Q,label:de}=q;if(x==="blog"){if(q.blogKind==="categories"){const pe=rt(u[Q],"categories").slug,Ce=typeof pe=="string"?pe:"";if(Ce)for(const{key:$e,payload:Lt}of no(u)){const Fs=mi(Lt,Ce);Fs!==Lt&&await O.mutateAsync({blockKey:$e,data:ri($e,fi(Fs))})}}await I.mutateAsync({blockKey:Q})}else await I.mutateAsync({blockKey:Q});me.success(`Deleted "${de}"`),h&&h.collection!=="available-section"&&h.key===Q&&y(null),ne(null)}catch(x){me.error(x instanceof Error?x.message:"Delete failed")}},Ke=I.isPending||O.isPending,At=q?.kind==="blog"?Ct[q.blogKind]:q?.kind??"item";return n.jsxs("div",{className:"flex h-full w-full",children:[n.jsx(Dl,{active:p,counts:Be,showBlog:De,onSelect:x=>{b(x),y(null),k(null)}}),p!=="seo"&&p!=="site"&&p!=="context"&&p!=="calendar"&&p!=="post-schedule"&&p!=="posts"&&p!=="loaders"&&p!=="actions"&&n.jsx(dc,{activeCollection:p,pages:v,redirects:V,sections:fe,availableSections:ge,appCatalog:G,appCatalogLoading:W,blogEntries:ke,decofile:u,searchQuery:E,onSearchChange:N,selection:h,onSelect:L,onCreate:()=>{p==="pages"?H():p==="redirects"?ms():st(p)&&X(p)},onDuplicatePage:xe,onRenamePage:we,onAddPageVariant:Ie,onDeletePage:x=>ne({kind:"page",key:x.key,label:x.name}),onEditPageSeo:x=>{const Q={collection:"pages",key:x.key,path:x.path};y(Q),k(x.key)},onViewPageJson:x=>re(x.key),onDuplicateSection:Dt,onRenameSection:x=>P(x.key),onDeleteSection:x=>ne({kind:"section",key:x.key,label:x.name}),onDeleteRedirect:x=>ne({kind:"redirect",key:x.key,label:x.from||x.key}),onDuplicateBlog:Ee,onDeleteBlog:x=>ne({kind:"blog",blogKind:x.kind,key:x.key,label:x.label})}),n.jsx("div",{className:"flex-1 min-w-0",children:p==="loaders"||p==="actions"?n.jsx(Ar,{orgSlug:s,virtualMcpId:e,branch:t,previewUrl:o,meta:T,decofile:u,kind:p}):n.jsx(A.Suspense,{fallback:n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(ot,{className:"size-5 text-muted-foreground"})}),children:p==="calendar"?n.jsx(oc,{decofile:u}):p==="post-schedule"?n.jsx(ac,{decofile:u,isCreating:O.isPending,onCreate:x=>{Ne(x)},onReschedule:(x,Q)=>{Ge(x,Q)},onSelect:x=>{b("posts"),F("posts"),y({collection:"posts",key:x}),k(null)}}):p==="site"?ve?n.jsx(xn,{orgSlug:s,virtualMcpId:e,branch:t,blockKey:ve.key,block:u[ve.key],decofile:u,meta:T,title:"Site",excludeFields:["seo"],schemaPending:z(ve.resolveType,["seo"]),previewBaseUrl:o},`site:${ve.key}`):n.jsx(tt,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):p==="context"?n.jsx(bl,{title:c("sandbox.blogContext.soonTitle"),description:c("sandbox.blogContext.soonDescription"),children:n.jsx(ec,{orgSlug:s,virtualMcpId:e,branch:t,decofile:u,meta:T,onOpenPost:x=>{b("posts"),F("posts"),y({collection:"posts",key:x}),k(null)},onManageCategoryPosts:()=>{b("posts"),F("posts"),y(null),k(null)}})}):p==="seo"?n.jsx(nc,{orgSlug:s,virtualMcpId:e,branch:t,decofile:u,meta:T,target:{kind:"site"},previewBaseUrl:a}):p==="sections"?n.jsx(qr,{selection:h?.collection==="sections"||h?.collection==="available-section"?h:null,orgSlug:s,virtualMcpId:e,branch:t,previewUrl:o,meta:T,decofile:u,isCreating:O.isPending,onCreateAvailable:cs,onSaveReferencedBlock:ds}):p==="posts"?n.jsx(wr,{orgSlug:s,virtualMcpId:e,branch:t,decofile:u,view:B,selectedKey:h?.collection==="posts"?h.key:null,onViewChange:x=>{R(x),y(null)},onClose:()=>y(null),onOpen:x=>{y({collection:"posts",key:x}),k(null)},move:D,meta:T,renderDetail:(x,Q)=>n.jsx(Xr,{orgSlug:s,virtualMcpId:e,branch:t,blockKey:x,block:u[x],decofile:u,meta:T,previewBaseUrl:a,move:D,onClose:Q?.onClose,expanded:Q?.expanded,onToggleExpand:Q?.onToggleExpand},`post:${Pt(x)}`)}):h&&h.collection!=="available-section"?h.collection==="apps"?n.jsx(xn,{orgSlug:s,virtualMcpId:e,branch:t,blockKey:h.key,block:u[h.key],decofile:u,meta:T,previewBaseUrl:o,schemaPending:z(typeof u[h.key]?.__resolveType=="string"?String(u[h.key].__resolveType):void 0)},`app:${h.key}`):h.collection==="categories"?n.jsx(tc,{orgSlug:s,virtualMcpId:e,branch:t,blockKey:h.key,block:u[h.key],decofile:u,meta:T,onManagePosts:()=>_t(),onOpenPost:x=>{b("posts"),F("posts"),y({collection:"posts",key:x}),k(null)},previewBaseUrl:a},`category:${h.key}`):h.collection==="authors"?n.jsx(Zr,{orgSlug:s,virtualMcpId:e,branch:t,kind:"authors",blockKey:h.key,block:u[h.key],meta:T,decofile:u},`authors:${h.key}`):h.collection==="redirects"?n.jsx(lc,{orgSlug:s,virtualMcpId:e,branch:t,blockKey:h.key,block:u[h.key]},`redirect:${h.key}`):n.jsx(sc,{orgSlug:s,virtualMcpId:e,branch:t,previewReady:!0,previewUrl:o??void 0,currentPath:h.collection==="pages"?h.path:"/",activePageBlockKey:h.collection==="pages"?h.key:null,activeGlobalBlockKey:h.collection==="sections"?h.key:null,initialEditSeo:h.collection==="pages"&&j===h.key,onExitSeo:()=>k(null),onSelectRoot:()=>{y(null),k(null)}},h.collection==="pages"?`page:${h.key}`:`section:${h.key}`):n.jsx(tt,{title:`Select ${st(p)?`a ${Ct[p]}`:p==="pages"?"a page":p==="apps"?"an app":p==="redirects"?"a redirect":"a section"} to edit`,description:p==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),U&&n.jsx(Ul,{open:!!U,mode:U.mode,initialName:U.initialName,initialPath:U.initialPath,isPending:O.isPending,error:Z,templates:v,validate:rs,onSubmit:Re,onOpenChange:x=>{x||(J(null),oe(void 0))}}),n.jsx(ql,{open:ae,isPending:O.isPending,error:te,onSubmit:C,onOpenChange:x=>{x||(ie(!1),ue(void 0))}}),ee&&n.jsx(Wl,{open:!!ee,blockKey:ee,initialName:fe.find(x=>x.key===ee)?.name??ee,isPending:O.isPending,onSubmit:us,onOpenChange:x=>{x||P(null)}}),se&&n.jsx(Qa,{open:!!se,onOpenChange:x=>{x||re(null)},pageKey:se,decofile:u,onSave:x=>O.mutateAsync({blockKey:se,data:x})}),n.jsx(Zo,{open:!!q,onOpenChange:x=>{!x&&!Ke&&ne(null)},children:n.jsxs(ea,{children:[n.jsxs(ta,{children:[n.jsx(sa,{children:`Delete ${At}?`}),n.jsx(na,{children:q?.kind==="section"?`"${q.label}" will be removed. Pages that still reference it will lose this section.`:q?`"${q.label}" will be removed permanently. This can't be undone.`:null})]}),n.jsxs(oa,{children:[n.jsx(aa,{disabled:Ke,children:"Cancel"}),n.jsx(la,{onClick:x=>{x.preventDefault(),bt()},disabled:Ke,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ke?n.jsxs(n.Fragment,{children:[n.jsx(ot,{className:"size-3.5"}),"Deleting…"]}):"Delete"})]})]})})]})}function dc(s){const e=le.c(58),{activeCollection:t,pages:o,redirects:a,sections:l,availableSections:i,appCatalog:r,appCatalogLoading:c,blogEntries:d,decofile:g,searchQuery:u,onSearchChange:m,selection:f,onSelect:p,onCreate:b,onDuplicatePage:h,onRenamePage:y,onAddPageVariant:j,onDeletePage:k,onEditPageSeo:S,onViewPageJson:w,onDuplicateSection:_,onRenameSection:E,onDeleteSection:N,onDeleteRedirect:B,onDuplicateBlog:R,onDeleteBlog:L}=s,M=je();let F,T,$,K,z,G;if(e[0]!==t||e[1]!==r||e[2]!==c||e[3]!==i||e[4]!==d||e[5]!==g||e[6]!==j||e[7]!==b||e[8]!==L||e[9]!==k||e[10]!==B||e[11]!==N||e[12]!==R||e[13]!==h||e[14]!==_||e[15]!==S||e[16]!==y||e[17]!==E||e[18]!==m||e[19]!==p||e[20]!==w||e[21]!==o||e[22]!==a||e[23]!==u||e[24]!==l||e[25]!==f||e[26]!==M){const D=u.toLowerCase(),U=o.filter(v=>!D||v.name.toLowerCase().includes(D)||v.path.toLowerCase().includes(D)),J=a.filter(v=>!D||v.from.toLowerCase().includes(D)||v.to.toLowerCase().includes(D)),Z=l.filter(v=>!D||v.name.toLowerCase().includes(D)||v.key.toLowerCase().includes(D)||v.resolveType.toLowerCase().includes(D)),oe=i.filter(v=>!D||v.title.toLowerCase().includes(D)||v.resolveType.toLowerCase().includes(D)||(v.description?.toLowerCase().includes(D)??!1)),ae=Jr(Z),ie=r.filter(v=>!D||v.title.toLowerCase().includes(D)||v.app.toLowerCase().includes(D)||v.vendor.toLowerCase().includes(D)||v.category.toLowerCase().includes(D)),te=d.filter(v=>!D||v.label.toLowerCase().includes(D)||v.subtitle.toLowerCase().includes(D)),ue=t==="categories"&&!D?Yr(te):te.map(mc),ee=`Search ${t}…`,P=st(t)?`Create new ${Ct[t]}`:t==="redirects"?"Create new redirect":"Create new page",q=t!=="apps"&&t!=="sections";z="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let ne;e[33]===Symbol.for("react.memo_cache_sentinel")?(ne=n.jsx(ws,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[33]=ne):ne=e[33];let se;e[34]!==m?(se=v=>m(v.target.value),e[34]=m,e[35]=se):se=e[35];let re;e[36]!==ee||e[37]!==u||e[38]!==se?(re=n.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[ne,n.jsx("input",{type:"text",value:u,onChange:se,placeholder:ee,"aria-label":ee,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[36]=ee,e[37]=u,e[38]=se,e[39]=re):re=e[39];let ce;e[40]!==P||e[41]!==b||e[42]!==q?(ce=q&&n.jsxs(Ye,{children:[n.jsx(qe,{asChild:!0,children:n.jsx(Ae,{variant:"ghost",size:"icon",onClick:b,"aria-label":P,children:n.jsx(Ns,{size:14})})}),n.jsx(We,{side:"bottom",children:P})]}),e[40]=P,e[41]=b,e[42]=q,e[43]=ce):ce=e[43],e[44]!==re||e[45]!==ce?(G=n.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[re,ce]}),e[44]=re,e[45]=ce,e[46]=G):G=e[46],F=Zt,K="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",T="flex flex-col gap-1 p-1.5",$=t==="pages"?U.length===0?n.jsx(vt,{hasItems:o.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):U.map(v=>{const V=f?.collection==="pages"&&f.key===v.key,fe=Fn(g,v.key);return n.jsx(He,{icon:Tn,title:v.name,subtitle:v.path,active:V,variantCount:fe,onClick:()=>p({collection:"pages",key:v.key,path:v.path}),menu:n.jsx(Rt,{onDuplicate:()=>h(v),onRename:()=>y(v),onAddVariant:()=>j(v),onEditSeo:()=>S(v),onViewJson:()=>w(v),onDelete:()=>k(v)})},v.key)}):t==="sections"?Z.length===0&&oe.length===0?n.jsx(vt,{hasItems:l.length>0||i.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):n.jsxs(n.Fragment,{children:[ae.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(hn,{icon:Gt,label:"Saved sections"}),ae.map(v=>n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:v.label}),v.sections.map(V=>{const fe=f?.collection==="sections"&&f.key===V.key;return n.jsx(He,{icon:Gt,accent:"global",title:V.name,subtitle:v.label,active:fe,onClick:()=>p({collection:"sections",key:V.key}),menu:n.jsx(Rt,{onDuplicate:()=>_(V),onRename:()=>E(V),onDelete:()=>N(V)})},V.key)})]},v.label))]}),oe.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(hn,{icon:zs,label:"Available sections",className:ye(ae.length>0&&"mt-3")}),oe.map(v=>{const V=f?.collection==="available-section"&&f.resolveType===v.resolveType,fe=v.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return n.jsx(He,{icon:zs,title:v.title,subtitle:fe??v.resolveType,active:V,onClick:()=>p({collection:"available-section",resolveType:v.resolveType,title:v.title})},v.resolveType)})]})]}):t==="apps"?c?n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(ot,{className:"size-4.5 text-muted-foreground"})}):ie.length===0?n.jsx(vt,{hasItems:r.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):ie.map(v=>{const V=f?.collection==="apps"&&v.blockKey!==null&&f.key===v.blockKey;return n.jsx(He,{icon:Dn,logoUrl:v.logo,title:v.title,subtitle:v.category,active:V,trailing:v.installed?n.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(!v.installed||!v.blockKey){me.message(`${v.title} is not installed on this site.`);return}p({collection:"apps",key:v.blockKey})}},v.id)}):t==="redirects"?J.length===0?n.jsx(vt,{hasItems:a.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):J.map(v=>n.jsx(He,{icon:kn,title:v.from||"(no source)",subtitle:`→ ${v.to||"(no target)"}`,active:f?.collection==="redirects"&&f.key===v.key,trailing:n.jsx(Yl,{type:v.type}),onClick:()=>p({collection:"redirects",key:v.key}),menu:n.jsx(Rt,{onDelete:()=>B(v)})},v.key)):te.length===0?n.jsx(vt,{hasItems:d.length>0,emptyLabel:`No ${t} yet.`,emptyHint:`Click "+" to create your first ${st(t)?Ct[t]:"item"}.`}):ue.map(v=>{const{entry:V,depth:fe}=v,ge=f?.collection===V.kind&&f.key===V.key;return n.jsx("div",{style:{paddingLeft:fe*16},children:n.jsx(He,{icon:V.kind==="posts"?Bn:V.kind==="authors"?_n:Sn,title:V.label,invalid:V.missing.length>0,invalidReason:V.missing.length>0?M("sandbox.itemRow.missingFields",{fields:ni(V.missing,M)}):void 0,warning:V.duplicateName,warningReason:M("sandbox.itemRow.duplicateName"),subtitle:fe>0?Bo(V.slug??"",te).map(uc).join(" / "):V.subtitle,active:ge,onClick:()=>p({collection:V.kind,key:V.key}),menu:n.jsx(Rt,{onDuplicate:()=>R(V),onDelete:()=>L(V)})})},V.key)}),e[0]=t,e[1]=r,e[2]=c,e[3]=i,e[4]=d,e[5]=g,e[6]=j,e[7]=b,e[8]=L,e[9]=k,e[10]=B,e[11]=N,e[12]=R,e[13]=h,e[14]=_,e[15]=S,e[16]=y,e[17]=E,e[18]=m,e[19]=p,e[20]=w,e[21]=o,e[22]=a,e[23]=u,e[24]=l,e[25]=f,e[26]=M,e[27]=F,e[28]=T,e[29]=$,e[30]=K,e[31]=z,e[32]=G}else F=e[27],T=e[28],$=e[29],K=e[30],z=e[31],G=e[32];let W;e[47]!==T||e[48]!==$?(W=n.jsx("div",{className:T,children:$}),e[47]=T,e[48]=$,e[49]=W):W=e[49];let O;e[50]!==F||e[51]!==K||e[52]!==W?(O=n.jsx(F,{className:K,children:W}),e[50]=F,e[51]=K,e[52]=W,e[53]=O):O=e[53];let I;return e[54]!==z||e[55]!==G||e[56]!==O?(I=n.jsxs("div",{className:z,children:[G,O]}),e[54]=z,e[55]=G,e[56]=O,e[57]=I):I=e[57],I}function uc(s){return s.slug}function mc(s){return{entry:s,depth:0}}function fc(s){const e=le.c(25),{virtualMcpId:t}=s,o=je(),[a,l]=A.useState(!1),i=fl(t),{activeTask:r}=jn();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[0]=c):c=e[0];const d=vn(c);if(!(Ys(i?.metadata)||Ys(r?.metadata))){let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:n.jsx(Qs,{className:"size-7 text-foreground"})}),e[1]=m):m=e[1];let f;e[2]!==o?(f=o("mainPanelTabs.contentTab.noContentToEdit"),e[2]=o,e[3]=f):f=e[3];let p;e[4]!==o?(p=o("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=o,e[5]=p):p=e[5];let b,h;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=()=>l(!0),h=n.jsx(Qs,{className:"size-4"}),e[6]=b,e[7]=h):(b=e[6],h=e[7]);let y;e[8]!==o?(y=o("mainPanelTabs.previewTab.connectGithub"),e[8]=o,e[9]=y):y=e[9];let j;e[10]!==y?(j=n.jsxs(Ae,{onClick:b,children:[h,y]}),e[10]=y,e[11]=j):j=e[11];let k;e[12]!==f||e[13]!==p||e[14]!==j?(k=n.jsx(gl,{className:"h-full",image:m,title:f,description:p,actions:j}),e[12]=f,e[13]=p,e[14]=j,e[15]=k):k=e[15];let S;e[16]!==a?(S=n.jsx(hl,{open:a,onOpenChange:l,mode:"agent"}),e[16]=a,e[17]=S):S=e[17];let w;return e[18]!==S||e[19]!==k?(w=n.jsxs(n.Fragment,{children:[k,S]}),e[18]=S,e[19]=k,e[20]=w):w=e[20],w}let u;return e[21]!==d.contentPageId||e[22]!==d.contentPath||e[23]!==d.contentPathTemplate?(u=n.jsx(ic,{deepLinkPage:{pageId:d.contentPageId,path:d.contentPath,pathTemplate:d.contentPathTemplate}}),e[21]=d.contentPageId,e[22]=d.contentPath,e[23]=d.contentPathTemplate,e[24]=u):u=e[24],u}function pc(){const s=le.c(2),e=xl();let t;return s[0]!==e?(t=n.jsx(Ro,{tabId:"content",children:n.jsx(Fo,{feature:"cms",children:n.jsx(fc,{virtualMcpId:e})})}),s[0]=e,s[1]=t):t=s[1],t}const Od=Object.freeze(Object.defineProperty({__proto__:null,default:pc},Symbol.toStringTag,{value:"Module"}));export{Ld as $,Bd as A,lo as B,qn as C,ut as D,Td as E,Dd as F,Ls as G,mo as H,Vi as I,ze as J,Ci as K,pd as L,xd as M,Ve as N,bd as O,As as P,hd as Q,Ed as R,uo as S,ht as T,Bi as U,gd as V,ns as W,bs as X,oo as Y,Ki as Z,ci as _,ri as a,Yr as a0,To as a1,ui as a2,Ai as a3,no as a4,md as a5,fd as a6,kd as a7,Sd as a8,Nd as a9,dt as aa,Cd as ab,wd as ac,jd as ad,Pd as ae,Yt as af,Od as ag,as as b,Se as c,ud as d,ni as e,dd as f,rt as g,yd as h,Ue as i,ho as j,vd as k,Xn as l,os as m,Rl as n,Et as o,xt as p,Wn as q,vl as r,fi as s,$d as t,bo as u,_d as v,xi as w,yi as x,Ad as y,jo as z};
|