decocms 4.576.5 → 4.577.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-C4gtVV8B.js → AlertCircle-Bj2NuHQY.js} +1 -1
- package/dist/client/assets/{AreaChart-DoDuLI5t.js → AreaChart-wF798x8i.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DpMV6ZsI.js → ArrowLeft-DCMq103h.js} +1 -1
- package/dist/client/assets/{ArrowUp-BZtzDI6h.js → ArrowUp-AwRcCsuH.js} +1 -1
- package/dist/client/assets/BookOpen01-D2g_6Ti1.js +1 -0
- package/dist/client/assets/{CartesianChart-T_ULwjNy.js → CartesianChart-B6p3i5Ce.js} +1 -1
- package/dist/client/assets/{CategoricalChart-ysoAqy8Y.js → CategoricalChart-Bjq2Qe33.js} +1 -1
- package/dist/client/assets/{CheckCircle-DSJM5Ipe.js → CheckCircle-BfCYdSA_.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-Y1qRZSrs.js → ChevronSelectorVertical-Bwduw2Hp.js} +1 -1
- package/dist/client/assets/{ChevronUp-DlMNWluH.js → ChevronUp-JSFuaLqF.js} +1 -1
- package/dist/client/assets/{CreditCard01-DDsAjKey.js → CreditCard01-DsaJOWgX.js} +1 -1
- package/dist/client/assets/{Globe04-xh_ZOoQS.js → Globe04-BBKBtEaK.js} +1 -1
- package/dist/client/assets/{Key01-BnxP0_QL.js → Key01-BTIXWKkS.js} +1 -1
- package/dist/client/assets/{LinkBroken01-4XuFjBFS.js → LinkBroken01-DjOOxf0e.js} +1 -1
- package/dist/client/assets/{Minus-D8UqNYy4.js → Minus-BAq-AD33.js} +1 -1
- package/dist/client/assets/{Monitor01-CVDkBVET.js → Monitor01-CqtNhdJN.js} +1 -1
- package/dist/client/assets/{Play--aCtxlXx.js → Play-kmXfE4Am.js} +1 -1
- package/dist/client/assets/{Plus-DXpzgENj.js → Plus-Bq5KiXqn.js} +1 -1
- package/dist/client/assets/ReferenceLine-CcfMMo9r.js +1 -0
- package/dist/client/assets/{SearchMd-CWmEKOOP.js → SearchMd-D1P7yVqT.js} +1 -1
- package/dist/client/assets/ShoppingBag01-CAQ4NRTU.js +1 -0
- package/dist/client/assets/{Sun-wXzOhHYv.js → Sun-C5iV1Zpq.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-C42vJfgE.js → SwitchHorizontal01-CP6L8rlm.js} +1 -1
- package/dist/client/assets/{Tool01-DB3xqZeL.js → Tool01-DAYJL0v-.js} +1 -1
- package/dist/client/assets/{Tooltip-Dz7b9lTi.js → Tooltip-DiDmzDgy.js} +1 -1
- package/dist/client/assets/{Trash01-BAWUFhrC.js → Trash01-Dt7pyOwE.js} +1 -1
- package/dist/client/assets/{Upload01-CMkGIZuR.js → Upload01-CZ2h76oj.js} +1 -1
- package/dist/client/assets/{UserSquare-NNxs0RWc.js → UserSquare-CBWDFbi3.js} +1 -1
- package/dist/client/assets/{Users01-DIshv_Ib.js → Users01-BZzvQda-.js} +1 -1
- package/dist/client/assets/{XClose-E_Sbr7JC.js → XClose-D2u966Hj.js} +1 -1
- package/dist/client/assets/{Zap-BFWL2aD-.js → Zap-CDj8jJFt.js} +1 -1
- package/dist/client/assets/{access-gate-H6si3iA0.js → access-gate-DL6Fx00C.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BCsDq0oB.js → add-connection-dialog-DXVmpebU.js} +1 -1
- package/dist/client/assets/agent-app-DClrb2ok.js +1 -0
- package/dist/client/assets/agent-assets-C4JxM7ek.js +1 -0
- package/dist/client/assets/agent-automation-BRLWOY9Z.js +20 -0
- package/dist/client/assets/agent-automations-Bi4PZQpt.js +1 -0
- package/dist/client/assets/agent-blog-CZFhSkNf.js +2 -0
- package/dist/client/assets/agent-blog-post-DWjaJsuP.js +2 -0
- package/dist/client/assets/agent-calendar-DVRrZoQI.js +1 -0
- package/dist/client/assets/{agent-capabilities-C7nwtlfn.js → agent-capabilities-DHVCvnvi.js} +1 -1
- package/dist/client/assets/agent-connect-sources-zocgSqV4.js +1 -0
- package/dist/client/assets/agent-deck-BQ_G3Xvk.js +1 -0
- package/dist/client/assets/agent-e2e-C7P50BKx.js +1 -0
- package/dist/client/assets/agent-experiments-B7tgn9fP.js +1 -0
- package/dist/client/assets/agent-file-CVIHN4Pv.js +1 -0
- package/dist/client/assets/agent-hosting-DmUbTOe2.js +1 -0
- package/dist/client/assets/agent-icon-BwEytdmh.js +1 -0
- package/dist/client/assets/agent-library-BhTWSN-a.js +1 -0
- package/dist/client/assets/agent-library-file-C9nXPWjk.js +1 -0
- package/dist/client/assets/agent-overview-gQqe-_Zq.js +1 -0
- package/dist/client/assets/agent-releases-Bxmxt--5.js +2 -0
- package/dist/client/assets/agent-settings-BZlQcdRN.js +1 -0
- package/dist/client/assets/{agent-site-editor-D7f7n9V8.js → agent-site-editor-Bxgpwy-D.js} +9 -9
- package/dist/client/assets/agent-site-editor-code-D3XwSBBo.js +2 -0
- package/dist/client/assets/agent-site-editor-content-5EK8c-yC.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-DtbJe_5m.js +1 -0
- package/dist/client/assets/agent-view-DJh235b7.js +1 -0
- package/dist/client/assets/agent-view-guard-B4P_nOY3.js +1 -0
- package/dist/client/assets/ai-providers-CvpoHUFb.js +1 -0
- package/dist/client/assets/{alert-gT8z0xwu.js → alert-0-4Lk02S.js} +1 -1
- package/dist/client/assets/{analytics-sections-eEEKYoEI.js → analytics-sections-DEuK9yNO.js} +1 -1
- package/dist/client/assets/{api-keys-DQU6MrN9.js → api-keys-BWb-_Fqf.js} +1 -1
- package/dist/client/assets/api-keys-PaXWWj2O.js +1 -0
- package/dist/client/assets/app-editor-DVjFa_ip.js +1 -0
- package/dist/client/assets/{asset-utils-ClCcVH6C.js → asset-utils-DSh1-4fR.js} +1 -1
- package/dist/client/assets/{auth-DzshLgt0.js → auth-DFCgioOs.js} +1 -1
- package/dist/client/assets/{auth-catchall-knKXQdld.js → auth-catchall-_w9pWMK8.js} +1 -1
- package/dist/client/assets/{auth-entry-CjhDapLF.js → auth-entry-HAlWF4UX.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Cs3K7qF9.js → auth-split-layout-BSaVPfK6.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DyNu9KE-.js → authenticate-and-persist-oauth-BGX0Y23v.js} +1 -1
- package/dist/client/assets/{automation-list-row-BIIymyig.js → automation-list-row-Xayp8iFs.js} +1 -1
- package/dist/client/assets/{automation-runs-BJn2B7cC.js → automation-runs-CUwzltO7.js} +1 -1
- package/dist/client/assets/automations-C0bs2qin.js +1 -0
- package/dist/client/assets/{badge-FhnYiqmQ.js → badge-DbKUf3vA.js} +1 -1
- package/dist/client/assets/block-document-zkAHP8m2.js +3 -0
- package/dist/client/assets/{blocks-preview-workspace-context-DPP_AgWW.js → blocks-preview-workspace-context-DQL_zlqC.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-DS5PjKyJ.js → blocks-tab-states-BUfMyINR.js} +1 -1
- package/dist/client/assets/blog-preview-url-CT-VZElJ.js +1 -0
- package/dist/client/assets/blog-schema-Dys-tzF0.js +1 -0
- package/dist/client/assets/blog-source-gate-CYaEgV9t.js +1 -0
- package/dist/client/assets/blog-view-gate-zXMdlu7Q.js +1 -0
- package/dist/client/assets/{buckets-Cm1lK-tx.js → buckets-DOgpbimo.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-CKmcH9eT.js → build-improve-prompt-doc-BMf33123.js} +1 -1
- package/dist/client/assets/{calendar-Dj2F2D9c.js → calendar-5Nt9EKO9.js} +1 -1
- package/dist/client/assets/{capability-load-error-YlZMyLIu.js → capability-load-error-BSxnBi9L.js} +1 -1
- package/dist/client/assets/category-editor-DziWemO6.js +1 -0
- package/dist/client/assets/category-tree-Cm0a3nBT.js +4 -0
- package/dist/client/assets/{chart-4euqV-4L.js → chart-DPgJVmAl.js} +1 -1
- package/dist/client/assets/chat-context-D8Eje7xK.js +39 -0
- package/dist/client/assets/{chat-draft-B1Q_ptQ-.js → chat-draft-ArmxHiV6.js} +1 -1
- package/dist/client/assets/{checkbox-Bq5cgSkE.js → checkbox-CCw3an34.js} +1 -1
- package/dist/client/assets/choose-editor-CXiL24Bl.js +1 -0
- package/dist/client/assets/{cli-auth-success-C9VZDuEf.js → cli-auth-success-c7wBWUO5.js} +1 -1
- package/dist/client/assets/{client-icons-x0Kj4XXu.js → client-icons-CuJeSv2A.js} +1 -1
- package/dist/client/assets/cms-settings-editor-gxtK9SOp.js +1 -0
- package/dist/client/assets/cms-store-drafts-chLFxeWf.js +1 -0
- package/dist/client/assets/collapsible-CVtLl5wO.js +1 -0
- package/dist/client/assets/collection-detail-D_Bcp_j6.js +1 -0
- package/dist/client/assets/{collection-display-button-B9tDNz3Q.js → collection-display-button-CnhRvkGN.js} +1 -1
- package/dist/client/assets/{collection-search-o_TUN55Q.js → collection-search-CC2QUXh2.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CovrSOmj.js → collection-table-wrapper-DSy_nx4_.js} +1 -1
- package/dist/client/assets/{collection-tabs-C-HhSJ3V.js → collection-tabs-DHZJ_O9U.js} +1 -1
- package/dist/client/assets/{combobox-N56ErTGA.js → combobox-CB15NqGc.js} +1 -1
- package/dist/client/assets/{command-C4A_k1m6.js → command-BOSLOC8n.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BIgg4-5f.js → companion-mcps-section-CeNpBYo7.js} +1 -1
- package/dist/client/assets/config-DqdBgCnO.js +1 -0
- package/dist/client/assets/{connect-CAWALh6X.js → connect-WyHpmSHS.js} +3 -3
- package/dist/client/assets/{connect-layout-BGSvt_fK.js → connect-layout-D_zQARSX.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-zXoRskIf.js → connect-source-dialog-DHtZw9ff.js} +1 -1
- package/dist/client/assets/{connection-DWztoPJi.js → connection-D0YCkaZO.js} +1 -1
- package/dist/client/assets/{connection-card-CWeiT8GU.js → connection-card-B1Rl2nXN.js} +1 -1
- package/dist/client/assets/connection-detail-LxUhih2_.js +1 -0
- package/dist/client/assets/{connection-form-helpers-DvFcvjHg.js → connection-form-helpers-CAOx4zgX.js} +1 -1
- package/dist/client/assets/{connection-slug-7qrL1eY0.js → connection-slug-BH_NX0Ks.js} +1 -1
- package/dist/client/assets/connections-BhxOwljy.js +1 -0
- package/dist/client/assets/content-tab-BdaE3oCc.js +19 -0
- package/dist/client/assets/context-BmOpD-Hr.js +1 -0
- package/dist/client/assets/{context-menu-CzVow7cK.js → context-menu-Df7WW_d5.js} +1 -1
- package/dist/client/assets/{context-shell-A1z9qMT_.js → context-shell-cJbikpSJ.js} +3 -3
- package/dist/client/assets/{core.esm-DbuDfvWF.js → core.esm-CAA73EV4.js} +2 -2
- package/dist/client/assets/{create-organization-dialog-D6MpLXO5.js → create-organization-dialog-BLvG9G-Z.js} +1 -1
- package/dist/client/assets/delete-copy-CAFEtw8Z.js +4 -0
- package/dist/client/assets/{device-hint-DKfCoj9a.js → device-hint-DgkMhcRQ.js} +1 -1
- package/dist/client/assets/discover-Cceep_sX.js +1 -0
- package/dist/client/assets/{domain-settings-EcbckpYF.js → domain-settings-52h_8fKM.js} +1 -1
- package/dist/client/assets/{drawer-DO5xJQb9.js → drawer-B9PFQFcy.js} +1 -1
- package/dist/client/assets/{editor-T1DFIh20.js → editor-DZ4pzlHx.js} +2 -2
- package/dist/client/assets/{editor-classes-XhTpecj4.js → editor-classes-Cb5f4sl2.js} +1 -1
- package/dist/client/assets/empty-message-CXYzekmD.js +15 -0
- package/dist/client/assets/{empty-state-DPWCLNrd.js → empty-state-BkAAjXrp.js} +1 -1
- package/dist/client/assets/{empty-state-DtO_Mv2g.js → empty-state-DMtSEEQ1.js} +1 -1
- package/dist/client/assets/experiments-tab-choice-CDm4A9Wq.js +1 -0
- package/dist/client/assets/{extract-connection-data-DBROTNmw.js → extract-connection-data-u6K4j2aJ.js} +1 -1
- package/dist/client/assets/feature-gate-DFWAlRCv.js +1 -0
- package/dist/client/assets/{feature-paywall-jPIGYZOc.js → feature-paywall-BiIzjBeB.js} +1 -1
- package/dist/client/assets/file-explorer-M__gA7Xu.js +2 -0
- package/dist/client/assets/{file-preview-D0iM2K-b.js → file-preview-D7WeSAA4.js} +1 -1
- package/dist/client/assets/{file-share-button-BsYWO9Hm.js → file-share-button-BtW_yxzc.js} +1 -1
- package/dist/client/assets/{file-type-icon-HeI2BZTs.js → file-type-icon-mKSSLPP8.js} +1 -1
- package/dist/client/assets/{folder-icon-DTWsvVbL.js → folder-icon-DCyvwLH6.js} +1 -1
- package/dist/client/assets/{form-BTSAyeiz.js → form-8HJUl2GV.js} +1 -1
- package/dist/client/assets/frame-navigation-Bp6fuuV5.js +1 -0
- package/dist/client/assets/general-C9cj7tJH.js +1 -0
- package/dist/client/assets/{github-icon-B_en9n_0.js → github-icon-DEvD-SlA.js} +1 -1
- package/dist/client/assets/held-block-view-DRxUlNuB.js +3 -0
- package/dist/client/assets/home-DR1hV3al.js +1 -0
- package/dist/client/assets/{home-overview-BRS8Q3rl.js → home-overview-CgBJdfHr.js} +1 -1
- package/dist/client/assets/hosted-reconcile-DH_YtUfF.js +1 -0
- package/dist/client/assets/{icon-button-BMTp1-QM.js → icon-button-CadQrI05.js} +1 -1
- package/dist/client/assets/{index-DwNl1Km0.js → index-8kUWDN7v.js} +1 -1
- package/dist/client/assets/index-BLdRRqFU.js +1 -0
- package/dist/client/assets/index-Bkf6As2Q.js +1 -0
- package/dist/client/assets/index-ButqNodW.js +4 -0
- package/dist/client/assets/{index-dCHDMdOx.js → index-BvGbwvSS.js} +1 -1
- package/dist/client/assets/{index-qsOMiawp.js → index-C1fc6W9Q.js} +1 -1
- package/dist/client/assets/{index-DGy42Noz.js → index-C5aoCNXr.js} +1 -1
- package/dist/client/assets/{index-DFaIOW9N.js → index-C9E0iqgh.js} +2 -2
- package/dist/client/assets/{index-DVvmeJMJ.js → index-CWKxkTwy.js} +47 -47
- package/dist/client/assets/{index-CWuPd_va.js → index-CcTmEE1N.js} +6 -6
- package/dist/client/assets/index-CzrYE4jE.js +1 -0
- package/dist/client/assets/{index-DlkOiyYS.js → index-DVdV24aR.js} +2 -2
- package/dist/client/assets/index-DYPWHH-M.css +1 -0
- package/dist/client/assets/{index-DlxA0Tmo.js → index-Tvs593C1.js} +1 -1
- package/dist/client/assets/{index-D1ksSwz3.js → index-_sPF1edR.js} +1 -1
- package/dist/client/assets/{index-DTVEZmhV.js → index-gX7QfQio.js} +1 -1
- package/dist/client/assets/{index-redirect-BEZcO3ft.js → index-redirect-DOlNtcAX.js} +1 -1
- package/dist/client/assets/{index-laonBzOU.js → index-t9nYrZiR.js} +1 -1
- package/dist/client/assets/{index-DyEEK3cc.js → index-yzkfeOP2.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Depn9DGH.js → infiniteQueryObserver-DCK-YXw1.js} +1 -1
- package/dist/client/assets/{infra-billing-BGMskgUq.js → infra-billing-B-pN25L9.js} +1 -1
- package/dist/client/assets/{input-aWrDx9Iy.js → input-1NX4JUHA.js} +3 -3
- package/dist/client/assets/{input-D4HN-yNN.js → input-DA-TtdGL.js} +1 -1
- package/dist/client/assets/{integration-icon-C9OIwyFH.js → integration-icon-C1bpkd7s.js} +1 -1
- package/dist/client/assets/item-actions-kNG-BlG3.js +1 -0
- package/dist/client/assets/{jira-icon-CnIpLe3l.js → jira-icon-CnBOGlR6.js} +1 -1
- package/dist/client/assets/{label-DxsI69Ti.js → label-BXSXPHWU.js} +1 -1
- package/dist/client/assets/{layout-m_pr21sI.js → layout-C0J9eFzL.js} +1 -1
- package/dist/client/assets/{legacy-admin-welcome-dialog-DIDvLt4b.js → legacy-admin-welcome-dialog-DbVWjlJ6.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CK9Gbzky.js → legacy-agents-deep-DVKmxbFS.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-Cep_68fb.js → legacy-main-redirect-D0wT4Yry.js} +1 -1
- package/dist/client/assets/library-sYbbN7ux.js +1 -0
- package/dist/client/assets/{library-tab-Dy0wbynU.js → library-tab-gK_7g-te.js} +4 -4
- package/dist/client/assets/{login-FVvIKUmZ.js → login-DnxvVl1t.js} +1 -1
- package/dist/client/assets/{markdown-DY1gkJzE.js → markdown-DiEygcQw.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CbbHrG36.js → mcp-app-renderer-BbTTGmQC.js} +1 -1
- package/dist/client/assets/{mcp-oauth-B4bma3Oc.js → mcp-oauth-CQGGouuy.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Dz6mx5UF.js → mcp-oauth-TUUsAJpA.js} +1 -1
- package/dist/client/assets/{members-CoNUsoOs.js → members-nUmVbnC9.js} +1 -1
- package/dist/client/assets/{memory-CJmsq8GA.js → memory-Blrtbn8a.js} +2 -2
- package/dist/client/assets/{mock-board-C-Bptu2a.js → mock-board-CC-isAOX.js} +3 -3
- package/dist/client/assets/{monaco-editor-ChRuLOCA.js → monaco-editor-C9ZwdTpU.js} +1 -1
- package/dist/client/assets/{monitoring-DOIwwqmT.js → monitoring-B36SUiOP.js} +2 -2
- package/dist/client/assets/{monitoring-stats-row-MlJzIKBz.js → monitoring-stats-row-H3pnSbDz.js} +1 -1
- package/dist/client/assets/{multi-select-HzpZ3y0m.js → multi-select-obeT7dRo.js} +1 -1
- package/dist/client/assets/mustache-gM754ehf.js +4 -0
- package/dist/client/assets/named-rule-step-W9P9uG-f.js +1 -0
- package/dist/client/assets/named-rule-view-BJLbVNsp.js +1 -0
- package/dist/client/assets/{new-project-dialog-DNs6nXJU.js → new-project-dialog-Cfdy4DZo.js} +1 -1
- package/dist/client/assets/{oauth-callback-DJ1LZft0.js → oauth-callback-Cxz67hG6.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DdjujeOM.js → oauth-callback-ai-provider-Diui0sS6.js} +1 -1
- package/dist/client/assets/{oauth-consent-C7arrnjn.js → oauth-consent-BWS32jU1.js} +1 -1
- package/dist/client/assets/{onboarding-DCEuM15Q.js → onboarding-Cg2Txb26.js} +1 -1
- package/dist/client/assets/openai-conversation-CGGu6BWJ.js +3 -0
- package/dist/client/assets/{optimistic-project-sidebar-views-Bxu9JyYq.js → optimistic-project-sidebar-views-cd4O2LnM.js} +1 -1
- package/dist/client/assets/{order-monitor-day-BHRAsIfi.js → order-monitor-day-DrziIuIu.js} +1 -1
- package/dist/client/assets/{organization-choice-BLi_jfq-.js → organization-choice-CPef1x_g.js} +1 -1
- package/dist/client/assets/{orgs-B0FFSMlY.js → orgs--h6JaB89.js} +1 -1
- package/dist/client/assets/{own-accounts-section-BPiQsCnH.js → own-accounts-section-D0sCVz2F.js} +1 -1
- package/dist/client/assets/{pair-BefVcuJk.js → pair-DbwVEDlq.js} +7 -7
- package/dist/client/assets/parse-sections-CMxFIp3d.js +4 -0
- package/dist/client/assets/plan-1pM1JHac.js +1 -0
- package/dist/client/assets/{plan-ladder-BIrfRC9w.js → plan-ladder-XiZUV3-n.js} +1 -1
- package/dist/client/assets/{plan-usage-card-9-4sECew.js → plan-usage-card-BsCyr1kn.js} +2 -2
- package/dist/client/assets/{popover-DVbSl4_S.js → popover-CTEYICXO.js} +1 -1
- package/dist/client/assets/post-calendar-DbsJgYWp.js +1 -0
- package/dist/client/assets/post-editor-GP7cTHEm.js +2 -0
- package/dist/client/assets/{preview-content-4sXQQAYj.js → preview-content-BYvAegAr.js} +1 -1
- package/dist/client/assets/{preview-dialog-DdT5D37e.js → preview-dialog-tONoLcHy.js} +1 -1
- package/dist/client/assets/{preview-panel-08gBYjqh.js → preview-panel-CxdwWGtV.js} +1 -1
- package/dist/client/assets/preview-tab-BJQS3_gN.js +551 -0
- package/dist/client/assets/{product-picker-dialog-CK0DishF.js → product-picker-dialog-DVmdugXw.js} +1 -1
- package/dist/client/assets/{profile-D-F6LVIp.js → profile-CFEIL030.js} +1 -1
- package/dist/client/assets/project-app-view-DpcLMitT.js +1 -0
- package/dist/client/assets/project-apps-T4OBSnxG.js +1 -0
- package/dist/client/assets/{project-icon-BfdBakvS.js → project-icon-CsM5Xu_3.js} +1 -1
- package/dist/client/assets/{project-index-CIwgcHHa.js → project-index-CnwYmkRd.js} +1 -1
- package/dist/client/assets/project-reports-Bsj_xvMI.js +1 -0
- package/dist/client/assets/project-tasks-BGrqP4mL.js +1 -0
- package/dist/client/assets/projects-D9OLRq0V.js +1 -0
- package/dist/client/assets/{projects-empty-state-CNEfVw65.js → projects-empty-state-DAdhJyFi.js} +1 -1
- package/dist/client/assets/{prompts-xdLcYGyB.js → prompts-hNC_o6uG.js} +1 -1
- package/dist/client/assets/record-editor-BUh6IBbj.js +1 -0
- package/dist/client/assets/redirect-editor-CRbYvUNE.js +1 -0
- package/dist/client/assets/{reports-BoYTb5US.js → reports-CoqdbgJH.js} +1 -1
- package/dist/client/assets/reports-D5qXQXTJ.js +1 -0
- package/dist/client/assets/reports-onboarding-B8pLePIS.js +1 -0
- package/dist/client/assets/reports-tab-BTcGlLJG.js +2 -0
- package/dist/client/assets/repositories-Cb1lXF50.js +1 -0
- package/dist/client/assets/repositories-cxta7jGt.js +1 -0
- package/dist/client/assets/{repository-binding-DJpVzzIq.js → repository-binding-DScgU6HN.js} +1 -1
- package/dist/client/assets/repository-picker-BUWqEoln.js +1 -0
- package/dist/client/assets/{require-capability-BpMqCrIS.js → require-capability-Cqs162cO.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BIQCwVTO.js → required-auth-layout-BiIyXd3D.js} +1 -1
- package/dist/client/assets/{reset-password-BKzfgMBU.js → reset-password-da4PvhID.js} +1 -1
- package/dist/client/assets/{resizable-C9_scy3R.js → resizable-Bf-xwR0k.js} +1 -1
- package/dist/client/assets/resolve-tab-icon-CGJDnTEl.js +1 -0
- package/dist/client/assets/review-settings-Ulx4CyPZ.js +1 -0
- package/dist/client/assets/role-color-C7dBdDUi.js +1 -0
- package/dist/client/assets/roles-z96sRIvs.js +1 -0
- package/dist/client/assets/route-CNldsqd_.js +1 -0
- package/dist/client/assets/route-D7eWiLEQ.js +1 -0
- package/dist/client/assets/route-UFlyMaLZ.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-_uINbsP3.js → sandbox-lifecycle-context-DY2xu0Uo.js} +1 -1
- package/dist/client/assets/save-status-DshwUBI8.js +1 -0
- package/dist/client/assets/{schema-ChSE97DN.js → schema-DUByfd2Y.js} +1 -1
- package/dist/client/assets/{schema-CzuWRpLl.js → schema-DWYnTC39.js} +1 -1
- package/dist/client/assets/{scroll-area-D1j-ZNOk.js → scroll-area-EO9hsjie.js} +1 -1
- package/dist/client/assets/search-input-Dc1w2xyv.js +1 -0
- package/dist/client/assets/{search-toggle-BSwOQVMD.js → search-toggle-BZIowSkC.js} +1 -1
- package/dist/client/assets/{secret-picker-zgl1t1WE.js → secret-picker-t9uXEG8-.js} +1 -1
- package/dist/client/assets/{secrets-Dvs-hzm1.js → secrets-CPHCsh_T.js} +1 -1
- package/dist/client/assets/section-array-field-BFg67nYp.js +1 -0
- package/dist/client/assets/{sections-COYsDPZ3.js → sections-CrmI_GQr.js} +1 -1
- package/dist/client/assets/sections-editor-CrXI2Bvd.js +1 -0
- package/dist/client/assets/{select-CBAbBtbp.js → select-CWL8C0Pw.js} +1 -1
- package/dist/client/assets/{select-model-CScqhZ6D.js → select-model-_wNlq-Z9.js} +1 -1
- package/dist/client/assets/seo-editor-B3mQn1CH.js +1 -0
- package/dist/client/assets/{separator-B-2WnIuS.js → separator-Cyq4ZO_K.js} +1 -1
- package/dist/client/assets/settings-tab-CDHhpvzE.js +1 -0
- package/dist/client/assets/{sheet-BSTYuLMa.js → sheet-Bqz29cSo.js} +1 -1
- package/dist/client/assets/shell-layout-DVIwCYxA.js +1 -0
- package/dist/client/assets/site-draft-actions-DQ2Ndjsf.js +3 -0
- package/dist/client/assets/site-draft-view-CIEvFlZ7.js +1 -0
- package/dist/client/assets/site-editor-C927WhHx.js +1 -0
- package/dist/client/assets/{site-editor-toast-Bz5hIXUq.js → site-editor-toast-BLqoqKy_.js} +1 -1
- package/dist/client/assets/skills-0h7pumIQ.js +1 -0
- package/dist/client/assets/{slider-B-4p3Nob.js → slider-GCMZAdst.js} +1 -1
- package/dist/client/assets/{sortable.esm-BMq0DSBR.js → sortable.esm-CYzspn3s.js} +1 -1
- package/dist/client/assets/{sso-D7rzaxll.js → sso-Ca2H_kJv.js} +1 -1
- package/dist/client/assets/suggestion-CppSMZxc.js +2 -0
- package/dist/client/assets/{super-agent-icon-CSXn8PV0.js → super-agent-icon-Dq0ZAaMf.js} +1 -1
- package/dist/client/assets/{switch-BoeP0_DT.js → switch-DBO_GrNe.js} +1 -1
- package/dist/client/assets/synced-repos-BTn3MABM.js +1 -0
- package/dist/client/assets/{tab-icon-glyph-DWwnpbAG.js → tab-icon-glyph-BaeBTavE.js} +1 -1
- package/dist/client/assets/{table-XIxdhyNo.js → table-xCmpwB0s.js} +1 -1
- package/dist/client/assets/{tabs-B314G2il.js → tabs-rkhPwLiJ.js} +1 -1
- package/dist/client/assets/{task-board-D-pfBnAn.js → task-board-D7RCmGkN.js} +1 -1
- package/dist/client/assets/{task-route-DrEh97G3.js → task-route-BJeZEOaQ.js} +1 -1
- package/dist/client/assets/{task-status-B5Pet88z.js → task-status-ISwbNtXh.js} +1 -1
- package/dist/client/assets/taskboard-analytics-B3vmd83_.js +1 -0
- package/dist/client/assets/{tasks-D1UDrE84.js → tasks-BLz1W4rF.js} +3 -3
- package/dist/client/assets/tasks-hZ3cVL1W.js +1 -0
- package/dist/client/assets/{textarea-yEyl1P1k.js → textarea-CvY2QE-l.js} +1 -1
- package/dist/client/assets/thread-analytics-DmP3G179.js +1 -0
- package/dist/client/assets/{thread-intent-BNVTtSHt.js → thread-intent-0TjSPqLd.js} +6 -6
- package/dist/client/assets/thread-route-4ZjlovaL.js +1 -0
- package/dist/client/assets/{thread-route-C8VqFbkH.js → thread-route-BbSych2c.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BPfgeSL4.js → thread-sheet-body-JQX8n1oy.js} +1 -1
- package/dist/client/assets/{time-range-picker-BvmuiVyh.js → time-range-picker-Bcp8sqUk.js} +1 -1
- package/dist/client/assets/{toggle-group-pyWm-TzL.js → toggle-group-BPubP3Pi.js} +1 -1
- package/dist/client/assets/{tool-namespace-CtWbol20.js → tool-namespace-c-MaHIy3.js} +1 -1
- package/dist/client/assets/{tool-set-selector-o7QGolVt.js → tool-set-selector-qnchAzSg.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DJE3OEfz.js → toolbar-icon-button-DqW_CkJO.js} +1 -1
- package/dist/client/assets/{tooltip-BVrosRIK.js → tooltip-mM1fQXaq.js} +1 -1
- package/dist/client/assets/{tooltipContext-qYwD6VMh.js → tooltipContext-B2y0_sWP.js} +1 -1
- package/dist/client/assets/{track-CeXWn-zt.js → track-XkKLQQJT.js} +1 -1
- package/dist/client/assets/{types-DDm1cJJv.js → types-E9_eqrxO.js} +3 -3
- package/dist/client/assets/{url-slug-W6aFEmJF.js → url-slug-BVpN8K6B.js} +1 -1
- package/dist/client/assets/{usage-stats-Dhf-DrML.js → usage-stats-DT9jvl-J.js} +2 -2
- package/dist/client/assets/{use-ai-providers-Cq3xA9Zt.js → use-ai-providers-Bku85sJ3.js} +1 -1
- package/dist/client/assets/use-apply-named-rule-Bwm7LB-d.js +1 -0
- package/dist/client/assets/use-ask-in-chat-C5w0G3Ru.js +1 -0
- package/dist/client/assets/{use-automations-BVThKMGQ.js → use-automations-D9iFnWhp.js} +1 -1
- package/dist/client/assets/use-autosave-CLbBIg-P.js +1 -0
- package/dist/client/assets/use-blocks-v8-project-BTQz7erp.js +1 -0
- package/dist/client/assets/use-chat-layout-state-Cbkyo6cP.js +1 -0
- package/dist/client/assets/{use-cms-publish-actions-C7zW1hZf.js → use-cms-publish-actions-XYKTfqt2.js} +5 -5
- package/dist/client/assets/{use-connect-companion-B9VAml3x.js → use-connect-companion-DCIdJC0W.js} +1 -1
- package/dist/client/assets/use-connection-CLoaxXGr.js +1 -0
- package/dist/client/assets/use-content-sync-14ry1gRC.js +1 -0
- package/dist/client/assets/{use-copy-DT5ZzrsX.js → use-copy-D3ELC0tX.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-Co74b8Ww.js → use-date-fns-locale-DU1bARSL.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-4hpLvgm-.js → use-debounced-autosave-Dxp05968.js} +1 -1
- package/dist/client/assets/{use-debounced-value-jJnqowMI.js → use-debounced-value-CgYJanEq.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BQqUH0BV.js → use-deco-credits-DlgC2mIc.js} +1 -1
- package/dist/client/assets/use-decopilot-events-DhxeqkWl.js +1 -0
- package/dist/client/assets/use-delete-block-BJD7162e.js +1 -0
- package/dist/client/assets/use-delete-connection-DtzGQTsr.js +1 -0
- package/dist/client/assets/{use-deployment-admin-CDyLX01_.js → use-deployment-admin-8guQU4GC.js} +1 -1
- package/dist/client/assets/{use-entitlements-u-J4FrTi.js → use-entitlements-J4XPZF2l.js} +1 -1
- package/dist/client/assets/use-fast-preview-draft-url-BX0PGrG_.js +1 -0
- package/dist/client/assets/{use-file-configs-BbIIeRpu.js → use-file-configs-DngvlIXa.js} +1 -1
- package/dist/client/assets/{use-id-selection-CUD8oDcN.js → use-id-selection-Dkbf-QZH.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-CcPQJJTK.js → use-inbox-feed-b7aNeh2-.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CfhQVaOS.js → use-infinite-scroll-BWIp-OKY.js} +1 -1
- package/dist/client/assets/{use-join-requests-CkLvGQO2.js → use-join-requests-CdvnKUpu.js} +1 -1
- package/dist/client/assets/use-main-panel-tabs-i0OC0oRI.js +1 -0
- package/dist/client/assets/{use-mcp-auth-status-KGdhyspi.js → use-mcp-auth-status-CxxAbIdU.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Bh7kEUBS.js → use-mcp-client-CmWEhN6T.js} +10 -10
- package/dist/client/assets/{use-mcp-prompts-BvdRcLVu.js → use-mcp-prompts-RB8yW0_L.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BXarw5nj.js → use-mcp-tools-Bfew76Ae.js} +1 -1
- package/dist/client/assets/{use-mobile-Dc6kWu8K.js → use-mobile-BZ5I1Gts.js} +1 -1
- package/dist/client/assets/use-move-blocks-a-Gpcz1Q.js +1 -0
- package/dist/client/assets/use-navigate-to-agent-CMbT8SLE.js +1 -0
- package/dist/client/assets/use-never-published-Cq663vOp.js +1 -0
- package/dist/client/assets/{use-org-fs-DrGQDt6z.js → use-org-fs-D8fqy59B.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CJN2n862.js → use-org-repo-syncs-D0tdQJ2P.js} +1 -1
- package/dist/client/assets/{use-org-sso-3rJKFGHZ.js → use-org-sso-D-kGbeq_.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Dw2wmQuO.js → use-organization-settings-BZz5ibUN.js} +1 -1
- package/dist/client/assets/use-project-native-view-presence-BbI14MhH.js +1 -0
- package/dist/client/assets/use-project-scope-3ijTexFj.js +1 -0
- package/dist/client/assets/use-recent-apps-CWPH7SDm.js +1 -0
- package/dist/client/assets/{use-reports-diagnostic-CnV_YMfp.js → use-reports-diagnostic-V-qftvBJ.js} +1 -1
- package/dist/client/assets/use-sandbox-events-CBP-Uwww.js +2 -0
- package/dist/client/assets/{use-secrets-CYyoVB7k.js → use-secrets-CfMZEME2.js} +1 -1
- package/dist/client/assets/use-section-preview-base-DxIpbqPr.js +1 -0
- package/dist/client/assets/{use-sidebar-collapsed-CGsrtxLO.js → use-sidebar-collapsed-Cbxz0vjB.js} +1 -1
- package/dist/client/assets/{use-tags-D570CleN.js → use-tags-DTSxZWpz.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-DCDiNKaK.js → use-task-board-analytics-BKNhIlpV.js} +1 -1
- package/dist/client/assets/{use-task-board-events-DUIQmo3-.js → use-task-board-events-MfMFlaj-.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-CG0dFrGw.js → use-task-board-item-prs-i0iDRtks.js} +1 -1
- package/dist/client/assets/{use-task-board-items-BB9JhdmM.js → use-task-board-items-6-h_Haer.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-DTmkMV_c.js → use-task-board-prompts-BzepMvGT.js} +1 -1
- package/dist/client/assets/{use-task-metadata-qW9LtgU4.js → use-task-metadata-CkJg1Id-.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-CtFiUcL7.js → use-thread-outputs-DegzudvH.js} +1 -1
- package/dist/client/assets/use-view-draft-kind-BQ4N5uEB.js +1 -0
- package/dist/client/assets/{use-voice-input-DyZTYy5g.js → use-voice-input-vD0BpiqU.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-njPYFTao.js +1 -0
- package/dist/client/assets/{useQueries-1XxIGeEN.js → useQueries-D6BmTkII.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CSPS7F0z.js +1 -0
- package/dist/client/assets/{users-I0fvIaz3.js → users-RduqDlHV.js} +1 -1
- package/dist/client/assets/{utils-Pt7-9-Ev.js → utils-CkU_P8Ie.js} +2 -2
- package/dist/client/assets/variant-calendar-1rTVvyAx.js +1 -0
- package/dist/client/assets/{variant-matcher-override-BZrGhjnT.js → variant-matcher-override-B3zGkPXZ.js} +1 -1
- package/dist/client/assets/{view-header-D7Xjp31c.js → view-header-B-Vek7fH.js} +1 -1
- package/dist/client/assets/virtual-mcp-DPJ0M-HO.js +1 -0
- package/dist/client/assets/{watch-sse-pool-B9yUO9oy.js → watch-sse-pool-DqTWfbxM.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server.js +584 -584
- package/package.json +1 -1
- package/dist/client/assets/ReferenceLine-CyROiAPM.js +0 -1
- package/dist/client/assets/ShoppingBag01-ClDrdJV2.js +0 -1
- package/dist/client/assets/agent-app-Bl_mPh_t.js +0 -1
- package/dist/client/assets/agent-assets-B5UWuXnl.js +0 -1
- package/dist/client/assets/agent-automation-C9PBjiVk.js +0 -20
- package/dist/client/assets/agent-automations-CMf5dE3K.js +0 -1
- package/dist/client/assets/agent-calendar-DfZ4ErN1.js +0 -1
- package/dist/client/assets/agent-connect-sources-DwgsD8vQ.js +0 -1
- package/dist/client/assets/agent-deck-DjXPR_Nl.js +0 -1
- package/dist/client/assets/agent-e2e-BRjoGfW2.js +0 -1
- package/dist/client/assets/agent-experiments-CA2mbR8k.js +0 -1
- package/dist/client/assets/agent-file-BQdiAqSO.js +0 -1
- package/dist/client/assets/agent-hosting-D5KChDQU.js +0 -1
- package/dist/client/assets/agent-icon-uDqFfzhf.js +0 -1
- package/dist/client/assets/agent-library-2kWug_zO.js +0 -1
- package/dist/client/assets/agent-library-file-DtPgl6Sc.js +0 -1
- package/dist/client/assets/agent-overview-CXQy1R3G.js +0 -1
- package/dist/client/assets/agent-releases-CaysxAFQ.js +0 -2
- package/dist/client/assets/agent-settings-Bt8gf0xs.js +0 -1
- package/dist/client/assets/agent-site-editor-code-DfcTCTxX.js +0 -2
- package/dist/client/assets/agent-site-editor-content-B47YLbhf.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-Ci1e5zpi.js +0 -1
- package/dist/client/assets/agent-view-FTi4q4vz.js +0 -1
- package/dist/client/assets/agent-view-guard-BP5FCFpQ.js +0 -1
- package/dist/client/assets/ai-providers-CQ29Z6f1.js +0 -1
- package/dist/client/assets/api-keys-h9YcYrMI.js +0 -1
- package/dist/client/assets/app-editor-BSqFGCuO.js +0 -1
- package/dist/client/assets/automations-Xmpwvi6F.js +0 -1
- package/dist/client/assets/autosend-D-UTWUhf.js +0 -1
- package/dist/client/assets/block-document-0w5M-3LO.js +0 -3
- package/dist/client/assets/blog-schema-CYWT4exY.js +0 -1
- package/dist/client/assets/category-editor-BRFXJMj8.js +0 -1
- package/dist/client/assets/chat-context-bTdV0PQS.js +0 -39
- package/dist/client/assets/choose-editor-CKJ9YUAD.js +0 -1
- package/dist/client/assets/cms-settings-editor-Bl0s5YWk.js +0 -1
- package/dist/client/assets/cms-store-drafts-B8sdeq2z.js +0 -1
- package/dist/client/assets/collapsible-B2pXVUPn.js +0 -1
- package/dist/client/assets/collection-detail-D-ELQuvL.js +0 -1
- package/dist/client/assets/config-CaohtXWJ.js +0 -1
- package/dist/client/assets/connection-detail-CyQt5Knq.js +0 -1
- package/dist/client/assets/connections-Dfx8FH4D.js +0 -1
- package/dist/client/assets/content-tab-Bd4lKzez.js +0 -25
- package/dist/client/assets/context-DkOsTTFI.js +0 -1
- package/dist/client/assets/discover-Blhzpr1h.js +0 -1
- package/dist/client/assets/experiments-tab-choice-BKIwz3b9.js +0 -1
- package/dist/client/assets/feature-gate-B_FyKX76.js +0 -1
- package/dist/client/assets/file-explorer-mKoJ95H9.js +0 -2
- package/dist/client/assets/general-DQnQVbWU.js +0 -1
- package/dist/client/assets/home-CLDIpUPQ.js +0 -1
- package/dist/client/assets/hosted-reconcile-C7zHteUc.js +0 -1
- package/dist/client/assets/index-CnFz3TOs.js +0 -4
- package/dist/client/assets/index-DO-A5xCQ.css +0 -1
- package/dist/client/assets/index-DPvgRnv7.js +0 -1
- package/dist/client/assets/index-DisDzI9Z.js +0 -1
- package/dist/client/assets/index-MBimNXd5.js +0 -1
- package/dist/client/assets/library-CYKhZ1Xb.js +0 -1
- package/dist/client/assets/mustache-CtUZw69D.js +0 -4
- package/dist/client/assets/named-rule-view-CkgbSbSg.js +0 -1
- package/dist/client/assets/openai-conversation-D4xjY3_1.js +0 -3
- package/dist/client/assets/parse-sections-D2w3wSuP.js +0 -20
- package/dist/client/assets/plan-Da6szJuR.js +0 -1
- package/dist/client/assets/post-calendar-DEqb8d3G.js +0 -1
- package/dist/client/assets/post-editor-B-zzeLVe.js +0 -2
- package/dist/client/assets/preview-tab-DBOLhpj4.js +0 -551
- package/dist/client/assets/project-app-view-etnu6fhD.js +0 -1
- package/dist/client/assets/project-apps-D4MFXbKC.js +0 -1
- package/dist/client/assets/project-reports-B9YT4T_3.js +0 -1
- package/dist/client/assets/project-tasks-DhwbKHKQ.js +0 -1
- package/dist/client/assets/projects-DN5f4v6V.js +0 -1
- package/dist/client/assets/record-editor-DtXYbHpV.js +0 -1
- package/dist/client/assets/redirect-editor-BGoLXzQs.js +0 -1
- package/dist/client/assets/reports-BVe3MPdv.js +0 -1
- package/dist/client/assets/reports-onboarding-hafGLqtC.js +0 -1
- package/dist/client/assets/reports-tab-BGeZEsTL.js +0 -2
- package/dist/client/assets/repositories-B9hLcljS.js +0 -1
- package/dist/client/assets/repositories-DMPvx5Vv.js +0 -1
- package/dist/client/assets/repository-picker-8FkfYDdf.js +0 -1
- package/dist/client/assets/resolve-tab-icon-DO940wY_.js +0 -1
- package/dist/client/assets/review-settings-Bj89Yxea.js +0 -1
- package/dist/client/assets/role-color-Dy-P6oaY.js +0 -1
- package/dist/client/assets/roles-CvbfU6et.js +0 -1
- package/dist/client/assets/route-93-1A9vt.js +0 -1
- package/dist/client/assets/route-BdH_uLpp.js +0 -1
- package/dist/client/assets/route-y8ZhYa0n.js +0 -1
- package/dist/client/assets/search-input-Cvdta6ZJ.js +0 -1
- package/dist/client/assets/section-array-field-AXi3Vg_u.js +0 -1
- package/dist/client/assets/sections-editor-CyIATot1.js +0 -1
- package/dist/client/assets/seo-editor-C0rSQsv3.js +0 -1
- package/dist/client/assets/settings-tab-DFF8W9c5.js +0 -1
- package/dist/client/assets/shell-layout-CU0v0Q3J.js +0 -1
- package/dist/client/assets/site-draft-actions-D4mgl3Il.js +0 -3
- package/dist/client/assets/site-draft-view-BlOBzJMo.js +0 -1
- package/dist/client/assets/site-editor-BoWcMF8-.js +0 -1
- package/dist/client/assets/skills-CPsP4uSN.js +0 -1
- package/dist/client/assets/suggestion-UmoyYDA6.js +0 -2
- package/dist/client/assets/synced-repos-MPQrTxDL.js +0 -1
- package/dist/client/assets/taskboard-analytics-BCgYqiKL.js +0 -1
- package/dist/client/assets/tasks-D2QsX8U7.js +0 -1
- package/dist/client/assets/thread-analytics-DEw5nqD5.js +0 -1
- package/dist/client/assets/thread-route-0xQXgTvr.js +0 -1
- package/dist/client/assets/use-apply-named-rule-V-RgXu1D.js +0 -1
- package/dist/client/assets/use-ask-in-chat-CIVcbye6.js +0 -1
- package/dist/client/assets/use-autosave-CCiDACSS.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-Cbqo1QTy.js +0 -1
- package/dist/client/assets/use-chat-layout-state-CGYfM8sf.js +0 -1
- package/dist/client/assets/use-connection-DnLlCwu6.js +0 -1
- package/dist/client/assets/use-content-sync-D9eluVVW.js +0 -1
- package/dist/client/assets/use-decopilot-events-B2tjImS_.js +0 -1
- package/dist/client/assets/use-delete-connection-DpEMQiOo.js +0 -1
- package/dist/client/assets/use-fast-preview-draft-url-BxKgK3r2.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-DyYS88nS.js +0 -1
- package/dist/client/assets/use-move-blocks-D35xWi_f.js +0 -1
- package/dist/client/assets/use-navigate-to-agent-BNznjjAZ.js +0 -1
- package/dist/client/assets/use-project-native-view-presence-BNwJJKFa.js +0 -1
- package/dist/client/assets/use-project-scope-BbUTPXSS.js +0 -1
- package/dist/client/assets/use-recent-apps-BkGr3MbC.js +0 -1
- package/dist/client/assets/use-sandbox-events-C8uDi6Yt.js +0 -2
- package/dist/client/assets/use-section-preview-base-DqcwcHAy.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BuWYzJlw.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BofrdpH6.js +0 -1
- package/dist/client/assets/variant-calendar-WNfoLO6H.js +0 -1
- package/dist/client/assets/virtual-mcp-CSkG36xb.js +0 -1
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-BSqFGCuO.js","assets/index-DVvmeJMJ.js","assets/index-DO-A5xCQ.css","assets/chat-context-bTdV0PQS.js","assets/autosend-D-UTWUhf.js","assets/thread-route-C8VqFbkH.js","assets/use-project-scope-BbUTPXSS.js","assets/repository-binding-DJpVzzIq.js","assets/use-mcp-client-Bh7kEUBS.js","assets/auth-DzshLgt0.js","assets/thread-intent-BNVTtSHt.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-B9yUO9oy.js","assets/task-board-D-pfBnAn.js","assets/schema-CzuWRpLl.js","assets/use-entitlements-u-J4FrTi.js","assets/use-ai-providers-Cq3xA9Zt.js","assets/use-decopilot-events-B2tjImS_.js","assets/use-organization-settings-Dw2wmQuO.js","assets/use-voice-input-DyZTYy5g.js","assets/popover-DVbSl4_S.js","assets/drawer-DO5xJQb9.js","assets/tooltip-BVrosRIK.js","assets/index-DwNl1Km0.js","assets/use-mobile-Dc6kWu8K.js","assets/agent-icon-uDqFfzhf.js","assets/AlertCircle-C4gtVV8B.js","assets/Tool01-DB3xqZeL.js","assets/ArrowUp-BZtzDI6h.js","assets/ArrowLeft-DpMV6ZsI.js","assets/LinkBroken01-4XuFjBFS.js","assets/ShoppingBag01-ClDrdJV2.js","assets/Globe04-xh_ZOoQS.js","assets/CheckCircle-DSJM5Ipe.js","assets/ChevronUp-DlMNWluH.js","assets/ChevronSelectorVertical-Y1qRZSrs.js","assets/UserSquare-NNxs0RWc.js","assets/CreditCard01-DDsAjKey.js","assets/SwitchHorizontal01-C42vJfgE.js","assets/Key01-BnxP0_QL.js","assets/Minus-D8UqNYy4.js","assets/Monitor01-CVDkBVET.js","assets/Sun-wXzOhHYv.js","assets/Play--aCtxlXx.js","assets/Plus-DXpzgENj.js","assets/SearchMd-CWmEKOOP.js","assets/Trash01-BAWUFhrC.js","assets/Upload01-CMkGIZuR.js","assets/Users01-DIshv_Ib.js","assets/XClose-E_Sbr7JC.js","assets/Zap-BFWL2aD-.js","assets/index-DFaIOW9N.js","assets/checkbox-Bq5cgSkE.js","assets/select-CBAbBtbp.js","assets/index-BdQq_4o_.js","assets/ai-providers-logos-DD3qZ33J.js","assets/openai-compatible-presets-BKGfVqEx.js","assets/scroll-area-D1j-ZNOk.js","assets/use-section-preview-base-DqcwcHAy.js","assets/parse-sections-D2w3wSuP.js","assets/utils-Pt7-9-Ev.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-BefVcuJk.js","assets/collapsible-B2pXVUPn.js","assets/use-copy-DT5ZzrsX.js","assets/usage-stats-Dhf-DrML.js","assets/tool-namespace-CtWbol20.js","assets/form-BTSAyeiz.js","assets/label-DxsI69Ti.js","assets/utils-CVEq3hMx.js","assets/markdown-DY1gkJzE.js","assets/shell-layout-CU0v0Q3J.js","assets/use-deployment-admin-CDyLX01_.js","assets/admin-fetch-BhTJlAsX.js","assets/command-C4A_k1m6.js","assets/index-DyEEK3cc.js","assets/integration-icon-C9OIwyFH.js","assets/project-icon-BfdBakvS.js","assets/use-navigate-to-agent-BNznjjAZ.js","assets/use-debounced-value-jJnqowMI.js","assets/new-project-dialog-DNs6nXJU.js","assets/repository-picker-8FkfYDdf.js","assets/github-icon-B_en9n_0.js","assets/useInfiniteQuery-BuWYzJlw.js","assets/infiniteQueryObserver-Depn9DGH.js","assets/collection-search-o_TUN55Q.js","assets/legacy-admin-welcome-dialog-DIDvLt4b.js","assets/required-auth-layout-BIQCwVTO.js","assets/use-org-sso-3rJKFGHZ.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-CbbHrG36.js","assets/types-DDm1cJJv.js","assets/omit-server-managed-metadata-L5IhjRZB.js","assets/sheet-BSTYuLMa.js","assets/use-connection-DnLlCwu6.js","assets/use-mcp-prompts-BvdRcLVu.js","assets/use-thread-outputs-CtFiUcL7.js","assets/file-type-icon-HeI2BZTs.js","assets/section-array-field-AXi3Vg_u.js","assets/blocks-tab-states-DS5PjKyJ.js","assets/site-editor-toast-Bz5hIXUq.js","assets/sandbox-url-D3mC8qhT.js","assets/use-sandbox-events-C8uDi6Yt.js","assets/use-blocks-v8-project-Cbqo1QTy.js","assets/sandbox-git-api-DcqI6XE4.js","assets/empty-state-DPWCLNrd.js","assets/hosted-reconcile-C7zHteUc.js","assets/slider-B-4p3Nob.js","assets/index-DTVEZmhV.js","assets/tooltipContext-qYwD6VMh.js","assets/CategoricalChart-ysoAqy8Y.js","assets/index-D1ksSwz3.js","assets/switch-BoeP0_DT.js","assets/textarea-yEyl1P1k.js","assets/monaco-editor-ChRuLOCA.js","assets/editor-T1DFIh20.js","assets/calendar-Dj2F2D9c.js","assets/editor-classes-XhTpecj4.js","assets/core.esm-DbuDfvWF.js","assets/sortable.esm-BMq0DSBR.js","assets/toggle-group-pyWm-TzL.js","assets/active-indicator-CCMhAsc_.js","assets/combobox-N56ErTGA.js","assets/search-input-Cvdta6ZJ.js","assets/tabs-B314G2il.js","assets/use-file-configs-BbIIeRpu.js","assets/asset-utils-ClCcVH6C.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/view-header-D7Xjp31c.js","assets/use-cms-publish-actions-C7zW1hZf.js","assets/use-content-sync-D9eluVVW.js","assets/mustache-CtUZw69D.js","assets/sandbox-lifecycle-context-_uINbsP3.js","assets/date-utils-CrvIKg-s.js","assets/use-move-blocks-D35xWi_f.js","assets/badge-FhnYiqmQ.js","assets/empty-state-DtO_Mv2g.js","assets/index-qsOMiawp.js","assets/collection-table-wrapper-CovrSOmj.js","assets/table-XIxdhyNo.js","assets/agent-capabilities-C7nwtlfn.js","assets/cms-settings-editor-Bl0s5YWk.js","assets/post-editor-B-zzeLVe.js","assets/multi-select-HzpZ3y0m.js","assets/block-document-0w5M-3LO.js","assets/suggestion-UmoyYDA6.js","assets/product-picker-dialog-CK0DishF.js","assets/index-DlxA0Tmo.js","assets/blog-schema-CYWT4exY.js","assets/use-fast-preview-draft-url-BxKgK3r2.js","assets/use-autosave-CCiDACSS.js","assets/record-editor-DtXYbHpV.js","assets/context-DkOsTTFI.js","assets/index-CWuPd_va.js","assets/use-org-fs-DrGQDt6z.js","assets/icon-button-BMTp1-QM.js","assets/category-editor-BRFXJMj8.js","assets/sections-editor-CyIATot1.js","assets/seo-editor-C0rSQsv3.js","assets/use-apply-named-rule-V-RgXu1D.js","assets/variant-matcher-override-BZrGhjnT.js","assets/variant-calendar-WNfoLO6H.js","assets/post-calendar-DEqb8d3G.js","assets/redirect-editor-BGoLXzQs.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as ce,b as Pe,j as o,B as $e,h as mt,q as fl,e as ml,K as _o,m as we,r as K,w as tn,x as Rs,I as ws,y as sn,v as $s,D as Os,aS as ao,ba as gl,aF as hl,t as ve,aj as xl,bb as Ws,bc as Ms,X as un,bd as Bo,Z as pn,_ as fn,b1 as io,aT as yl,Y as Ht,ar as mn,be as lo,bf as bl,bg as vl,at as Fn,al as kl,bh as Na,a4 as wl,bi as jl,u as Ta,b8 as xt,aM as Sl,aL as Cl,aI as Nl,aG as Tl,aH as El,aK as Pl,aJ as Al,bj as _l,bk as Bl,b9 as Do}from"./index-DVvmeJMJ.js";import{f as zn,e as Dl,c as Rl,g as Ea,B as Mn,P as $l,h as Ol,i as Pa,j as Ll,k as Il,n as Kl,L as Fl,u as Nn,T as zl,F as Ml,C as Vl,s as Ul,o as Aa,a as _a,l as Gl,q as Hl,R as Yl,E as ft,t as Ba,r as Wl,v as ql,w as Xl,x as at,H as Da,y as Jl,z as Ra,A as Ql,M as Zl,d as er,D as tr,p as sr,G as nr,I as or,b as ar,S as ir,J as Ro,K as lr,O as rr,N as cr}from"./parse-sections-D2w3wSuP.js";import{a as ro}from"./use-organization-settings-Dw2wmQuO.js";import{u as co,b as $a}from"./repository-binding-DJpVzzIq.js";import{u as Tn,c as uo}from"./chat-context-bTdV0PQS.js";import{H as dr,N as ur}from"./hosted-reconcile-C7zHteUc.js";import{S as pr,a as fr}from"./view-header-D7Xjp31c.js";import{i as Js}from"./AlertCircle-C4gtVV8B.js";import{Z as Oa,l as Xn,r as mr,_ as La,$ as Ia,a0 as po,a1 as Ka,b as gn,T as Fa,a2 as gr,a3 as hr,a4 as xr,a5 as yr,a6 as Jn,e as fo,n as br,a7 as za,a8 as vr,a9 as kr,aa as wr,m as $o,ab as jr,Y as Ma}from"./agent-icon-uDqFfzhf.js";import{a as Va,s as hn,i as mo,d as Sr,e as Oo}from"./UserSquare-NNxs0RWc.js";import{c as go,i as Cr}from"./SwitchHorizontal01-C42vJfgE.js";import{s as En}from"./Plus-DXpzgENj.js";import{t as Ua}from"./Users01-DIshv_Ib.js";import{S as nn}from"./scroll-area-D1j-ZNOk.js";import{T as Tt,a as Et,c as Pt}from"./tooltip-BVrosRIK.js";import{o as Nr,c as Ga,W as Tr,X as Er,Y as Pr,Z as Ar,q as Ha,_ as ho,u as xo,m as Ya,$ as _r,A as Br,a0 as Dr,a1 as Rr,a2 as $r,k as Or,a3 as Lr,t as Lo,C as Ir,n as Kr,b as Fr}from"./site-editor-toast-Bz5hIXUq.js";import{l as zr,m as Mr,o as Vr,q as Ur,t as Gr,w as Wa,n as qt,v as Hr,R as Yr,x as Wr,y as qr,z as Xr,A as qa,D as Jr,E as Xa,F as Qr,G as Zr,H as ec,I as tc,i as sc,J as Vs,u as nc,K as oc,e as Io,L as Ko,S as ac,C as ic,M as lc,c as rc,O as cc,h as dc,P as uc,Q as pc,T as Fo,U as fc,V as mc,W as gc,X as hc}from"./blocks-tab-states-DS5PjKyJ.js";import{C as Ja,u as xc,h as zo}from"./use-cms-publish-actions-C7zW1hZf.js";import{u as yc,S as bc}from"./mustache-CtUZw69D.js";import{u as vc}from"./use-content-sync-D9eluVVW.js";import{s as kc}from"./sandbox-git-api-DcqI6XE4.js";import{u as yo}from"./use-voice-input-DyZTYy5g.js";import{b as bo}from"./sandbox-url-D3mC8qhT.js";import{d as wc}from"./utils-Pt7-9-Ev.js";import{a as jc}from"./autosend-D-UTWUhf.js";import{g as Qa,a as Za,b as Sc}from"./section-array-field-AXi3Vg_u.js";import{n as ei}from"./ShoppingBag01-ClDrdJV2.js";import{t as Qs}from"./ChevronUp-DlMNWluH.js";import{i as ti}from"./Zap-BFWL2aD-.js";import{C as Cc,a as Nc,b as Tc}from"./collapsible-B2pXVUPn.js";import{u as Ec}from"./use-sandbox-events-C8uDi6Yt.js";import{a as Pc}from"./sandbox-lifecycle-context-_uINbsP3.js";import{C as Pn}from"./checkbox-Bq5cgSkE.js";import{L as xs}from"./label-DxsI69Ti.js";import{c as Ac,b as _c,a as Bc,d as Dc,S as Rc}from"./select-CBAbBtbp.js";import{s as $c}from"./thread-intent-BNVTtSHt.js";import{s as Oc}from"./date-utils-CrvIKg-s.js";import{u as Lc}from"./use-move-blocks-D35xWi_f.js";import{i as Ic}from"./CheckCircle-DSJM5Ipe.js";import{s as vo}from"./Trash01-BAWUFhrC.js";import{i as Vn}from"./Upload01-CMkGIZuR.js";import{B as An}from"./badge-FhnYiqmQ.js";import{E as Kc}from"./empty-state-DtO_Mv2g.js";import{u as Fc}from"./use-ai-providers-Cq3xA9Zt.js";import{T as Mo}from"./textarea-yEyl1P1k.js";import{u as zc}from"./use-file-configs-BbIIeRpu.js";import{M as Mc,m as Vc,a as Uc,b as Gc,g as Hc,s as Yc,c as Wc,d as qc}from"./usage-stats-Dhf-DrML.js";import{m as Xc}from"./markdown-DY1gkJzE.js";import{s as Jc,T as Qc}from"./index-qsOMiawp.js";import{MonacoCodeEditor as si}from"./monaco-editor-ChRuLOCA.js";import"./core.esm-DbuDfvWF.js";import"./sortable.esm-BMq0DSBR.js";import{c as Zc}from"./Tool01-DB3xqZeL.js";import{S as ed}from"./search-input-Cvdta6ZJ.js";import{a as td,T as Un}from"./toggle-group-pyWm-TzL.js";import{C as sd}from"./collection-table-wrapper-CovrSOmj.js";import{a as Vo}from"./agent-capabilities-C7nwtlfn.js";import{E as nd}from"./empty-state-DPWCLNrd.js";import{G as Uo}from"./github-icon-B_en9n_0.js";import{R as od}from"./new-project-dialog-DNs6nXJU.js";function ni(){return ro("blog_ai_enabled")}function oi(t){return co(t)?.metadata?.legacyBlogPostFormat??!1}const Go=2e3,ad=45;function id(t){const{resolveType:e,meta:s,reads:n,window:a}=t;return typeof e!="string"||e===""?{interval:!1,window:null}:s&&zr(e,s)?{interval:!1,window:null}:!a||a.resolveType!==e?{interval:Go,window:{resolveType:e,reads:n}}:n-a.reads>=ad?{interval:!1,window:a}:{interval:Go,window:a}}const ld=[{blockKey:"deco-vtex",vendor:"deco",app:"vtex",title:"VTEX",description:"Loaders, actions and workflows for adding VTEX Commerce Platform to your website.",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/vtex/logo.png"},{blockKey:"deco-shopify",vendor:"deco",app:"shopify",title:"Shopify",description:"Loaders, actions and workflows for adding Shopify Commerce Platform to your website.",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/shopify/logo.png"},{blockKey:"deco-vnda",vendor:"deco",app:"vnda",title:"VNDA",description:"Loaders, actions and workflows for adding VNDA Commerce Platform to your website.",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/vnda/logo.png"},{blockKey:"deco-wake",vendor:"deco",app:"wake",title:"Wake",description:"Loaders, actions and workflows for adding Wake Commerce Platform to your website.",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/wake/logo.png"},{blockKey:"deco-nuvemshop",vendor:"deco",app:"nuvemshop",title:"Nuvemshop",description:"Loaders, actions and workflows for adding Nuvemshop Commerce Platform to your website.",category:"Ecommerce",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/nuvemshop.png"},{blockKey:"deco-linx",vendor:"deco",app:"linx",title:"Linx",description:"Loaders, actions and workflows for adding Linx Commerce Platform to your website.",category:"Ecommerce",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/linx.png"},{blockKey:"deco-wap",vendor:"deco",app:"wap",title:"Uappi",description:"Loaders, actions and workflows for adding Uappi Commerce Platform to your website.",category:"Ecommerce",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/uappi.png"},{blockKey:"deco-sap",vendor:"deco",app:"sap",title:"SAP Commerce",description:"Loaders, actions and workflows for adding SAP Commerce Platform to your website.",category:"Ecommerce",logo:"https://decoims.com/decocms/389b8d9b-e102-4ee7-9e9b-9c81c433581a/Sap_fav.png"},{blockKey:"deco-streamshop",vendor:"deco",app:"streamshop",title:"Streamshop",description:"Incorporate videos into your eCommerce. Boost sales significantly with Video Commerce Streamshop.",category:"Ecommerce"},{blockKey:"deco-algolia",vendor:"deco",app:"algolia",title:"Algolia",description:"Product search & discovery that increases conversions at scale.",category:"Search",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/algolia/logo.png"},{blockKey:"deco-typesense",vendor:"deco",app:"typesense",title:"TypeSense",description:"Open source search engine meticulously engineered for performance & ease-of-use.",category:"Search",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/typesense/logo.png"},{blockKey:"deco-smarthint",vendor:"deco",app:"smarthint",title:"SmartHint",description:"Smart search and product recommendation to improve your eCommerce customer experience.",category:"Search",logo:"https://github.com/deco-cx/apps/blob/main/smarthint/logo.png?raw=true"},{blockKey:"deco-linx-impulse",vendor:"deco",app:"linx-impulse",title:"Linx Impulse",description:"Build, manage and deliver B2B, B2C and Marketplace commerce experiences.",category:"Search",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/linx-impulse/logo.png"},{blockKey:"deco-verified-reviews",vendor:"deco",app:"verified-reviews",title:"Verified Reviews",description:"A specialized solution in the collection of customer reviews",category:"Review",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/verified-reviews/logo.png"},{blockKey:"deco-power-reviews",vendor:"deco",app:"power-reviews",title:"Power Reviews",description:"Collect more and better Ratings & Reviews and other UGC. Create UGC displays that convert. Analyze to enhance product experience and positioning.",category:"Review",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/power-reviews/logo.png"},{blockKey:"deco-konfidency",vendor:"deco",app:"konfidency",title:"Konfidency",description:"Product reviews and store reviews.",category:"Review",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/konfidency.png"},{blockKey:"deco-ra-trustvox",vendor:"deco",app:"ra-trustvox",title:"RA Trustvox",description:"RA Trustvox reviews.",category:"Review",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/ra-trustvox.png"},{blockKey:"deco-analytics",vendor:"deco",app:"analytics",title:"Deco Analytics",description:"Measure your site traffic at a glance in a simple and modern web analytics dashboard.",category:"Analytics",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/analytics/logo.png"},{blockKey:"deco-posthog",vendor:"deco",app:"posthog",title:"PostHog",description:"All-in-one platform for product analytics, feature flags, session replays, experiments, and surveys, built for developers.",category:"Analytics",logo:"https://decoims.com/decocms/cb17e9dc-8772-4873-8dae-f5a9f99694d4/posthog-icon-logo-png_seeklogo-483563.png"},{blockKey:"deco-resend",vendor:"deco",app:"resend",title:"Resend",description:"Resend is an email platform that helps developers build and send transactional and marketing emails.",category:"Email",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/resend-logo.png"},{blockKey:"deco-mailchimp",vendor:"deco",app:"mailchimp",title:"Mailchimp",description:"Email and marketing automations platform for growing businesses.",category:"Email",logo:"https://assets.decocache.com/admin/094cf93f-f1cb-4ef1-b993-9d9785b3cd0c/channels4_profile-(1).jpg"},{blockKey:"deco-blog",vendor:"deco",app:"blog",title:"Deco Blog",description:"Manage your posts.",category:"Content",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/weather/logo.png"},{blockKey:"deco-weather",vendor:"deco",app:"weather",title:"Weather",description:"Vary your content based on the current weather of your visitors.",category:"Tool",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/weather/logo.png"}],rd=[{blockKey:"deco-vtex",vendor:"deco",app:"vtex",title:"VTEX",description:"VTEX IO commerce integration",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/vtex/logo.png",npm:{name:"@decocms/apps-vtex",registryExport:"VTEX_REGISTRY_ENTRY"}},{blockKey:"deco-shopify",vendor:"deco",app:"shopify",title:"Shopify",description:"Shopify Storefront API commerce integration",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/shopify/logo.png",npm:{name:"@decocms/apps-shopify",registryExport:"SHOPIFY_REGISTRY_ENTRY"}},{blockKey:"deco-wake",vendor:"deco",app:"wake",title:"Wake",description:"Wake Commerce (Storefront API) integration",category:"Ecommerce",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/wake/logo.png",npm:{name:"@decocms/apps-wake",registryExport:"WAKE_REGISTRY_ENTRY"}},{blockKey:"deco-nuvemshop",vendor:"deco",app:"nuvemshop",title:"Nuvemshop",description:"Nuvemshop (Tiendanube) Storefront API commerce integration",category:"Ecommerce",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/nuvemshop.png",npm:{name:"@decocms/apps-nuvemshop",registryExport:"NUVEMSHOP_REGISTRY_ENTRY"}},{blockKey:"deco-resend",vendor:"deco",app:"resend",title:"Resend",description:"Transactional email via Resend",category:"Email",logo:"https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/resend-logo.png",npm:{name:"@decocms/apps-resend",registryExport:"RESEND_REGISTRY_ENTRY"}},{blockKey:"deco-blog",vendor:"deco",app:"blog",title:"Blog",description:"Blog posts, categories, and authors from CMS collections",category:"Content",logo:"https://raw.githubusercontent.com/deco-cx/apps/main/weather/logo.png",npm:{name:"@decocms/apps-blog",registryExport:"BLOG_REGISTRY_ENTRY"}}];function _n(t,e){return`${t}-${e}`}function Bn(t,e){return`site/apps/${t}/${e}.ts`}const cd="@decocms/",dd=["@decocms/blocks","@decocms/tanstack","@decocms/blocks-admin"];function ud(t){switch(t){case"deno":return"deno";case"bun":case"npm":case"pnpm":case"yarn":return"tanstack";default:return null}}const pd={"tanstack-start":"tanstack"};function fd(t){return t?pd[t]??null:"deno"}function ai(t){if(!t)return null;try{const e=JSON.parse(t);return e&&typeof e=="object"&&!Array.isArray(e)?e:null}catch{return null}}function ii(t){const e={};for(const s of["dependencies","devDependencies"]){const n=t[s];if(!(!n||typeof n!="object"||Array.isArray(n)))for(const[a,i]of Object.entries(n))typeof i=="string"&&!(a in e)&&(e[a]=i)}return e}const md=/^(?:workspace|catalog|link|file|portal|npm|git|github):/;function li(t){return md.test(t)}function gd(t){const e=ai(t);if(!e)return null;const s=ii(e),n=[...dd,...Object.keys(s).filter(i=>i.startsWith(cd)).sort()];let a=null;for(const i of n){const r=s[i];if(r){if(!li(r))return r;a??=r}}return a}function hd(t,e){const s=ai(t);return s?ii(s)[e]??null:null}function xd(t){return t.denoJson!==null?{technology:"deno",decocmsVersion:null}:t.packageJson!==null?{technology:"tanstack",decocmsVersion:gd(t.packageJson)}:null}class ze extends Error{constructor(e){super(e),this.name="SiteAppInstallError"}}function ri(t){const s=t.replace(/[-_.]+(.)/g,(n,a)=>a.toUpperCase()).replace(/[^A-Za-z0-9$_]/g,"");return/^[0-9]/.test(s)?`app${s}`:s}function yd(t){return`${ri(t)}Mod`}const bd=/"apps"\s*:\s*\{/;function Ho(t){const e=`apps/${t.app}/mod.ts`;return{path:`apps/${t.vendor}/${t.app}.ts`,content:`export { default } from "${e}";
|
|
3
|
-
export * from "${e}";
|
|
4
|
-
`}}function vd(t,e){const s=`${e}/mod`;return{path:`src/apps/${t.vendor}/${t.app}.ts`,content:`export { default } from "${s}";
|
|
5
|
-
export * from "${s}";
|
|
6
|
-
`}}function kd(t,e){const s=`./apps/${t.vendor}/${t.app}.ts`,n=Bn(t.vendor,t.app);if(e.includes(`"${n}"`))return null;const a=bd.exec(e);if(!a)throw new ze("manifest.gen.ts declares no `apps` map, so this site's runtime has no place to register the app. Run `deno task dev` once and reinstall.");const i=`${ri(t.app)}App`;if(new RegExp(`\\b${i}\\b`).test(e))throw new ze(`manifest.gen.ts already declares \`${i}\`, which this install needs as its own name`);const r=[...e.matchAll(ci)].filter(d=>d.index<a.index).pop();if(!r)throw new ze("manifest.gen.ts has no imports to extend");const c=r.index+r[0].length,l=a.index+a[0].length;return{path:"manifest.gen.ts",content:[e.slice(0,c),`
|
|
7
|
-
import * as ${i} from "${s}";`,e.slice(c,l),`
|
|
8
|
-
"${n}": ${i},`,e.slice(l)].join("")}}function wd(t,e){let s=0,n=null;for(let a=e;a<t.length;a++){const i=t[a];if(n){i==="\\"?a++:i===n&&(n=null);continue}if(i==='"'||i==="'")n=i;else if(i==="{")s++;else if(i==="}"&&--s===0)return a}throw new ze("package.json: unbalanced braces")}function Yo(t,e){let s=e;for(;s<t.length&&` \r
|
|
9
|
-
`.includes(t[s]);)s++;return s}function jd(t){let e=0,s=!1,n=-1;for(let a=0;a<t.length;a++){const i=t[a];if(s){if(i==="\\")a++;else if(i==='"'){if(s=!1,e!==1||t.slice(n+1,a)!=="dependencies")continue;const r=Yo(t,a+1);if(t[r]!==":")continue;const c=Yo(t,r+1);if(t[c]==="{")return c}continue}i==='"'?(s=!0,n=a):i==="{"||i==="["?e++:(i==="}"||i==="]")&&e--}return-1}function Sd(t,e,s){const n=jd(t);if(n===-1)throw new ze('package.json has no "dependencies" — add it before installing an app');const a=wd(t,n),i=t.slice(n+1,a),r=[...i.matchAll(/^([ \t]*)"((?:[^"\\]|\\.)*)"\s*:/gm)],c=r[0]?.[1]??" ",l=/(^|\n)([ \t]*)$/.exec(i)?.[2]??" ",d=`${c}${JSON.stringify(e)}: ${JSON.stringify(s)}`;if(r.length===0)return`${t.slice(0,n+1)}
|
|
10
|
-
${d}
|
|
11
|
-
${l}${t.slice(a)}`;const u=r.find(p=>p[2]>e);if(u){const p=n+1+u.index;return`${t.slice(0,p)}${d},
|
|
12
|
-
${t.slice(p)}`}const g=r[r.length-1],m=i.indexOf(`
|
|
13
|
-
`,g.index),f=n+1+(m===-1?i.length:m);return`${t.slice(0,f)},
|
|
14
|
-
${d}${t.slice(f)}`}const ci=/(?:^import\s*|\bfrom\s*)(["'])[^"'\n]*\1[ \t]*;?/gm,di=/const\s+APP_REGISTRY\b[^=]*=\s*\[/;function Cd(t){return(t.match(/\bimport\s*\{[^{}]*\}\s*from\b/g)??[]).some(s=>/\bAPP_REGISTRY\b/.test(s))}function Nd(t,e,s){const n=yd(e.app),a=`
|
|
15
|
-
import { ${s.registryExport} } from "${s.name}/registry";
|
|
16
|
-
import * as ${n} from "${s.name}/mod";`,i=` { ...${s.registryExport}, module: async () => ${n} as never },`,r=di.exec(t);if(!r)throw new ze("This site does not register apps through `autoconfigApps`: src/setup.ts declares no `APP_REGISTRY` array for the entry. Add one and call `autoconfigApps(blocks, APP_REGISTRY)`, then reinstall — or wire this app by hand.");const c=[...t.matchAll(ci)].filter(g=>g.index<r.index).pop();if(!c)throw new ze("src/setup.ts has no imports to extend");const l=c.index+c[0].length,d=r.index+r[0].length,u=t.slice(d);return[t.slice(0,l),a,t.slice(l,d),`
|
|
17
|
-
${i}`,/^\s*\]/.test(u)?`
|
|
18
|
-
${u.replace(/^\s*\]/,"]")}`:u].join("")}function Td(t){const{entry:e,technology:s}=t,n={key:e.blockKey,value:{__resolveType:Bn(e.vendor,e.app)}};if(s==="deno"){const d=t.manifestGenTs;if(d==null)throw new ze("Could not read the site's manifest.gen.ts, which is where a Deno site registers its apps");const u=kd(e,d);return{files:u?[Ho(e),u]:[Ho(e)],block:n,dependency:null}}const a=e.npm;if(!a)throw new ze(`${e.title} has no TanStack package — it is only available on Deno sites`);const i=t.packageJson,r=t.setupTs;if(i==null||r==null)throw new ze("Could not read the site's package.json and src/setup.ts");const c=t.decocmsVersion;if(!c)throw new ze("This repository declares no @decocms/* dependency, so it is not a TanStack deco site");if(li(c))throw new ze(`@decocms/* is pinned at "${c}", which resolves only for a package this workspace already declares — add ${a.name} there, then reinstall`);const l=[vd(e,a.name)];if(hd(i,a.name)===null&&l.push({path:"package.json",content:Sd(i,a.name,c)}),!di.test(r)&&Cd(r))throw new ze("This branch still wires apps through the monolithic `@decocms/apps` registry, which cannot see the split `@decocms/apps-*` packages. Move src/setup.ts to a local `APP_REGISTRY` array first.");return r.includes(a.registryExport)||l.push({path:"src/setup.ts",content:Nd(r,e,a)}),{files:l,block:n,dependency:a.name}}function ui(t){return t==="deno"?ld:rd}function Qn(t,e){return ui(t).find(s=>s.blockKey===e)??null}function Ed(t){return Qn("tanstack",t)??Qn("deno",t)??null}function pi(t){const e=t.match(/^site\/apps\/([^/]+)\/([^/.]+)\.tsx?$/);if(e)return{vendor:e[1],app:e[2]};const s=t.match(/^([^/]+)\/apps\/([^/.]+)\.tsx?$/);return s?{vendor:s[1],app:s[2]}:null}function Pd(t){const e=t.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function Ad(t){return t==="local"?"Custom":"Installed"}function _d(t){return t.split(/[-_.]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function fi(t,e,s,n,a,i){const r=Wa(t,i),c=r.title&&r.title!==t?r.title:void 0,l=Ed(_n(e,s));return{title:c??l?.title??n,description:r.description??l?.description??"",category:l?.category??a,logo:r.logo??r.icon??l?.logo}}function mi(t,e,s){const n=new Set([_n(t,e),e].map(i=>i.toLowerCase())),a=Bn(t,e);for(const[i,r]of Object.entries(s)){if(i.includes("/")||!r||typeof r!="object"||Array.isArray(r))continue;const c=r;if(n.has(i.toLowerCase())||c.__resolveType===a)return i}return null}function Bd(t,e){const{vendor:s,app:n}=t,a=mi(s,n,e);return{id:t.blockKey,app:n,vendor:s,title:t.title,description:t.description,category:t.category,logo:t.logo,resolveType:Bn(s,n),blockKey:a,installed:a!==null,installable:!0}}function Dd(t,e,s){if(t===Mr)return null;const n=pi(t);if(!n)return null;const{vendor:a,app:i}=n,r=mi(a,i,s);return{id:_n(a,i),app:i,vendor:a,...fi(t,a,i,_d(i),a==="local"?"Custom":"Others",e),resolveType:t,blockKey:r,installed:r!==null,installable:!1}}function Rd(t,e,s){const n=e.__resolveType;if(typeof n!="string"||Vr(t,e)||!Ur(n))return null;const a=pi(n)??Pd(t);if(!a)return null;const{vendor:i,app:r}=a;return{id:_n(i,r),app:r,vendor:i,...fi(n,i,r,Gr(t,e,s),Ad(i),s),resolveType:n,blockKey:t,installed:!0,installable:!1}}function $d(t,e,s){const n=new Map;for(const i of t){const r=Bd(i,s);n.set(r.id,r)}const a=e.manifest?.blocks?.apps??{};for(const i of Object.keys(a)){const r=Dd(i,e,s);!r||n.has(r.id)||n.set(r.id,r)}for(const[i,r]of Object.entries(s)){if(i.includes("/")||!r||typeof r!="object"||Array.isArray(r))continue;const c=Rd(i,r,e);!c||n.has(c.id)||n.set(c.id,c)}return[...n.values()].sort(Od)}function Od(t,e){return t.installed!==e.installed?t.installed?-1:1:t.title.localeCompare(e.title)}function Ld(t){const e=ce.c(38),{entry:s,technology:n,blocked:a,isInstalling:i,installError:r,onInstall:c}=t,l=Pe();let d;e[0]!==a||e[1]!==s.installable||e[2]!==l?(d=s.installable?a:{reason:l("sandbox.appInstallPanel.notInstallable")},e[0]=a,e[1]=s.installable,e[2]=l,e[3]=d):d=e[3];const u=d;let g;e[4]!==s.title?(g=o.jsx("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:o.jsx("span",{className:"truncate text-sm font-medium",children:s.title})}),e[4]=s.title,e[5]=g):g=e[5];let m;e[6]!==s.logo?(m=s.logo?o.jsx("img",{src:s.logo,alt:"",className:"size-12 shrink-0 rounded-xl bg-muted object-cover"}):o.jsx("span",{className:"flex size-12 shrink-0 items-center justify-center rounded-xl bg-muted",children:o.jsx(go,{size:20,className:"text-muted-foreground"})}),e[6]=s.logo,e[7]=m):m=e[7];let f;e[8]!==s.title?(f=o.jsx("div",{className:"truncate text-base font-medium",children:s.title}),e[8]=s.title,e[9]=f):f=e[9];let p;e[10]!==s.category?(p=o.jsx("div",{className:"truncate text-xs text-muted-foreground",children:s.category}),e[10]=s.category,e[11]=p):p=e[11];let y;e[12]!==f||e[13]!==p?(y=o.jsxs("div",{className:"min-w-0",children:[f,p]}),e[12]=f,e[13]=p,e[14]=y):y=e[14];let j;e[15]!==m||e[16]!==y?(j=o.jsxs("div",{className:"flex items-center gap-3",children:[m,y]}),e[15]=m,e[16]=y,e[17]=j):j=e[17];let T;e[18]!==s.description?(T=s.description&&o.jsx("p",{className:"text-sm text-muted-foreground",children:s.description}),e[18]=s.description,e[19]=T):T=e[19];let v;e[20]!==s.app||e[21]!==s.vendor||e[22]!==i||e[23]!==c||e[24]!==u||e[25]!==l||e[26]!==n?(v=u?o.jsxs("div",{className:"flex flex-col items-start gap-2",children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:u.reason}),u.action&&o.jsx($e,{type:"button",variant:"outline",onClick:u.action.onClick,children:u.action.label})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:l(n==="deno"?"sandbox.appInstallPanel.writesDeno":"sandbox.appInstallPanel.writesTanstack",{vendor:s.vendor,app:s.app})}),o.jsx("div",{children:o.jsxs($e,{type:"button",onClick:c,disabled:i,className:"gap-2",children:[i&&o.jsx(mt,{className:"size-3.5"}),l(i?"sandbox.appInstallPanel.installing":"sandbox.appInstallPanel.install")]})})]}),e[20]=s.app,e[21]=s.vendor,e[22]=i,e[23]=c,e[24]=u,e[25]=l,e[26]=n,e[27]=v):v=e[27];let k;e[28]!==r?(k=r&&o.jsx("p",{className:"text-xs text-destructive",children:r}),e[28]=r,e[29]=k):k=e[29];let C;e[30]!==k||e[31]!==j||e[32]!==T||e[33]!==v?(C=o.jsx(nn,{className:"min-h-0 min-w-0 flex-1",children:o.jsx("div",{className:"px-6 py-6",children:o.jsxs("div",{className:"mx-auto flex max-w-xl flex-col gap-4",children:[j,T,v,k]})})}),e[30]=k,e[31]=j,e[32]=T,e[33]=v,e[34]=C):C=e[34];let x;return e[35]!==C||e[36]!==g?(x=o.jsxs("div",{className:"flex h-full flex-col",children:[g,C]}),e[35]=C,e[36]=g,e[37]=x):x=e[37],x}function Us(t){const e=ce.c(6),{hasItems:s,emptyLabel:n,emptyHint:a}=t;let i;e[0]!==a||e[1]!==n||e[2]!==s?(i=s?"No results match your search.":o.jsxs(o.Fragment,{children:[o.jsx("div",{children:n}),o.jsx("div",{className:"mt-1 text-muted-foreground/80",children:a})]}),e[0]=a,e[1]=n,e[2]=s,e[3]=i):i=e[3];let r;return e[4]!==i?(r=o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i}),e[4]=i,e[5]=r):r=e[5],r}function Id(t){return t.dependency?{force:t.files.some(e=>e.path==="package.json")}:null}function Kd(t,e){return t.files.length===0?!1:e?.force!==!0}function Fd(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function Wo(t){return new ze(`Could not read ${t} — the sandbox is not answering yet. Try again in a moment.`)}async function an(t,e,s){const n=await Ar(t,Ha(e,s)).catch(a=>{const i=Fd(a);throw i!==void 0&&i>=500?Wo(s):a});if(n.kind==="unavailable")throw Wo(s);return n.kind==="data"?n.data:null}async function qo(t,e,s){const n=await fetch(bo(t,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:Ha(e,s.path),content:s.content})});n.ok||await ho(n,"Write")}async function zd(t,e){const s=await fetch(bo({...t,threadId:null},"setup/install",{force:e?"1":"0"}),{method:"POST"});s.ok||await ho(s,"Dependency install"),await gi(s,e,"install")}async function gi(t,e,s){if(!e)return;const n=await t.clone().json().catch(()=>null);if((typeof n=="object"&&n!==null&&"force"in n?n.force:void 0)!==!0)throw new ze(`This sandbox is running a daemon that ignores a forced ${s}, so the install would answer "done" without doing it. Restart the sandbox to pick up a current image, then install again.`)}async function Md(t){const e=await fetch(bo({...t,threadId:null},"setup/start",{force:"1"}),{method:"POST"});e.ok||await ho(e,"Dev restart"),await gi(e,!0,"restart")}function Vd(t){const e=ce.c(30),{orgSlug:s,virtualMcpId:n,branch:a}=t,i=fl(),r=Tn()?.taskId??null,c=Nr(n),l=yo(n).runtime==="cms",{url:d}=Ga(n);let u;e[0]!==a||e[1]!==s||e[2]!==n?(u={orgSlug:s,virtualMcpId:n,branch:a},e[0]=a,e[1]=s,e[2]=n,e[3]=u):u=e[3];const g=vc(u);let m;e[4]!==a||e[5]!==s||e[6]!==n?(m=Er(s,n,a),e[4]=a,e[5]=s,e[6]=n,e[7]=m):m=e[7];let f;e[8]!==a||e[9]!==s||e[10]!==n?(f=Tr(s,n,a),e[8]=a,e[9]=s,e[10]=n,e[11]=f):f=e[11];let p;e[12]!==a||e[13]!==g||e[14]!==l||e[15]!==d||e[16]!==s||e[17]!==c||e[18]!==i||e[19]!==r||e[20]!==n?(p=async T=>{const{blockKey:v}=T;if(d)throw new ze("Local preview has no repository to install into");if(l)throw new ze("Installing an app writes code, which a Fast Preview session cannot do");const k={orgSlug:s,virtualMcpId:n,branch:a,threadId:r},[C,x]=await Promise.all([an(k,c,"deno.json"),an(k,c,"package.json")]),w=xd({denoJson:C,packageJson:x});if(!w)throw new ze("This repository has no deno.json or package.json");const P=Qn(w.technology,v);if(!P)throw new ze(`No app "${v}" is available for a ${w.technology} site`);const S=Td({technology:w.technology,entry:P,decocmsVersion:w.decocmsVersion,packageJson:x,setupTs:w.technology==="tanstack"?await an(k,c,"src/setup.ts"):null,manifestGenTs:w.technology==="deno"?await an(k,c,"manifest.gen.ts"):null});return Pr(g,{kind:"edit",write:async()=>{for(const $ of S.files)await qo(k,c,$);const A=Id(S);return A&&await zd(k,A.force),Kd(S,A)&&await Md(k),await qo(k,c,{path:wc(S.block.key),content:`${JSON.stringify(S.block.value,null,2)}
|
|
19
|
-
`}),await i.invalidateQueries({queryKey:kc(k)}),await i.invalidateQueries({queryKey:_o.liveMeta(s,n,a)}),S.block}})},e[12]=a,e[13]=g,e[14]=l,e[15]=d,e[16]=s,e[17]=c,e[18]=i,e[19]=r,e[20]=n,e[21]=p):p=e[21];let y;e[22]!==g||e[23]!==i?(y=T=>{g.cacheKey&&i.setQueryData(_o.decofile(g.cacheKey),v=>({...v??{},[T.key]:T.value}))},e[22]=g,e[23]=i,e[24]=y):y=e[24];let j;return e[25]!==m||e[26]!==f||e[27]!==p||e[28]!==y?(j={mutationKey:m,scope:f,mutationFn:p,onSuccess:y},e[25]=m,e[26]=f,e[27]=p,e[28]=y,e[29]=j):j=e[29],ml(j)}function Ud(t,e){const s=ce.c(3),n=co(t)?.metadata?.runtime?.selected;let a;return s[0]!==e||s[1]!==n?(a=(e?fd(e.framework):null)??ud(n),s[0]=e,s[1]=n,s[2]=a):a=s[2],a}function Ye(t){const e=ce.c(18),{icon:s,label:n,count:a,mark:i,active:r,onClick:c,indent:l,"aria-current":d}=t,u=l&&"pl-6",g=r?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground";let m;e[0]!==u||e[1]!==g?(m=we("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",u,g),e[0]=u,e[1]=g,e[2]=m):m=e[2];let f;e[3]!==s?(f=o.jsx(s,{size:16,className:"shrink-0"}),e[3]=s,e[4]=f):f=e[4];let p;e[5]!==n?(p=o.jsx("span",{className:"flex-1 truncate",children:n}),e[5]=n,e[6]=p):p=e[6];let y;e[7]!==r||e[8]!==a?(y=a!==void 0&&o.jsx("span",{className:we("shrink-0 text-xs tabular-nums",r?"text-accent-foreground/70":"text-muted-foreground/70"),children:a}),e[7]=r,e[8]=a,e[9]=y):y=e[9];let j;return e[10]!==d||e[11]!==i||e[12]!==c||e[13]!==m||e[14]!==f||e[15]!==p||e[16]!==y?(j=o.jsxs("button",{type:"button",onClick:c,"aria-current":d,className:m,children:[f,p,i,y]}),e[10]=d,e[11]=i,e[12]=c,e[13]=m,e[14]=f,e[15]=p,e[16]=y,e[17]=j):j=e[17],j}function Gd(t){const e=ce.c(5),{icon:s,label:n}=t;let a;e[0]!==s?(a=s&&o.jsx(s,{size:13,className:"shrink-0"}),e[0]=s,e[1]=a):a=e[1];let i;return e[2]!==n||e[3]!==a?(i=o.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:[a,n]}),e[2]=n,e[3]=a,e[4]=i):i=e[4],i}const Hd=["sections","apps","loaders","actions"],Yd=[];function Wd(t){const e=ce.c(73),{active:s,counts:n,hidden:a,showBlog:i,showContext:r,onSelect:c}=t,l=a===void 0?Yd:a,d=Pe();let u;e[0]!==l?(u=M=>!l.includes(M),e[0]=l,e[1]=u):u=e[1];const g=u;let m;e[2]!==d?(m=d("sandbox.collectionsSidebar.content"),e[2]=d,e[3]=m):m=e[3];let f;e[4]!==m?(f=o.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:o.jsx("span",{className:"text-sm font-medium",children:m})}),e[4]=m,e[5]=f):f=e[5];let p;e[6]!==d?(p=d("sandbox.collectionsSidebar.pages"),e[6]=d,e[7]=p):p=e[7];const y=s==="pages";let j;e[8]!==c?(j=()=>c("pages"),e[8]=c,e[9]=j):j=e[9];let T;e[10]!==n.pages||e[11]!==p||e[12]!==y||e[13]!==j?(T=o.jsx(Ye,{icon:Va,label:p,count:n.pages,active:y,onClick:j}),e[10]=n.pages,e[11]=p,e[12]=y,e[13]=j,e[14]=T):T=e[14];let v;e[15]!==d?(v=d("sandbox.collectionsSidebar.redirects"),e[15]=d,e[16]=v):v=e[16];const k=s==="redirects";let C;e[17]!==c?(C=()=>c("redirects"),e[17]=c,e[18]=C):C=e[18];let x;e[19]!==n.redirects||e[20]!==k||e[21]!==C||e[22]!==v?(x=o.jsx(Ye,{icon:Oa,label:v,count:n.redirects,active:k,onClick:C}),e[19]=n.redirects,e[20]=k,e[21]=C,e[22]=v,e[23]=x):x=e[23];let w;e[24]!==s||e[25]!==c||e[26]!==g||e[27]!==d?(w=g("site")&&o.jsx(Ye,{icon:Xn,label:d("sandbox.collectionsSidebar.site"),active:s==="site",onClick:()=>c("site")}),e[24]=s,e[25]=c,e[26]=g,e[27]=d,e[28]=w):w=e[28];let P;e[29]!==d?(P=d("sandbox.collectionsSidebar.seo"),e[29]=d,e[30]=P):P=e[30];const S=s==="seo";let A;e[31]!==c?(A=()=>c("seo"),e[31]=c,e[32]=A):A=e[32];let $;e[33]!==P||e[34]!==S||e[35]!==A?($=o.jsx(Ye,{icon:Ka,label:P,active:S,onClick:A}),e[33]=P,e[34]=S,e[35]=A,e[36]=$):$=e[36];let D;e[37]!==s||e[38]!==c||e[39]!==g||e[40]!==d?(D=g("settings")&&o.jsx(Ye,{icon:Xn,label:d("sandbox.collectionsSidebar.settings"),active:s==="settings",onClick:()=>c("settings")}),e[37]=s,e[38]=c,e[39]=g,e[40]=d,e[41]=D):D=e[41];let z;e[42]!==s||e[43]!==c||e[44]!==g||e[45]!==d?(z=g("calendar")&&o.jsx(Ye,{icon:mr,label:d("sandbox.collectionsSidebar.calendar"),active:s==="calendar",onClick:()=>c("calendar")}),e[42]=s,e[43]=c,e[44]=g,e[45]=d,e[46]=z):z=e[46];let L;e[47]!==s||e[48]!==n||e[49]!==c||e[50]!==g?(L=o.jsx(qd,{active:s,counts:n,shown:g,onSelect:c}),e[47]=s,e[48]=n,e[49]=c,e[50]=g,e[51]=L):L=e[51];let b;e[52]!==s||e[53]!==n.authors||e[54]!==n.categories||e[55]!==n.posts||e[56]!==c||e[57]!==i||e[58]!==r||e[59]!==d?(b=i&&o.jsxs(o.Fragment,{children:[o.jsx(Gd,{icon:ei,label:d("sandbox.collectionsSidebar.blog")}),r&&o.jsx(Ye,{icon:hn,label:d("sandbox.collectionsSidebar.context"),active:s==="context",onClick:()=>c("context")}),o.jsx(Ye,{icon:La,label:d("sandbox.collectionsSidebar.posts"),count:n.posts,active:s==="posts",onClick:()=>c("posts")}),o.jsx(Ye,{icon:Ua,label:d("sandbox.collectionsSidebar.authors"),count:n.authors,active:s==="authors",onClick:()=>c("authors")}),o.jsx(Ye,{icon:Ia,label:d("sandbox.collectionsSidebar.categories"),count:n.categories,active:s==="categories",onClick:()=>c("categories")}),o.jsx(Ye,{icon:po,label:d("sandbox.collectionsSidebar.postSchedule"),active:s==="post-schedule",onClick:()=>c("post-schedule")})]}),e[52]=s,e[53]=n.authors,e[54]=n.categories,e[55]=n.posts,e[56]=c,e[57]=i,e[58]=r,e[59]=d,e[60]=b):b=e[60];let _;e[61]!==x||e[62]!==w||e[63]!==$||e[64]!==D||e[65]!==z||e[66]!==L||e[67]!==b||e[68]!==T?(_=o.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[T,x,w,$,D,z,L,b]}),e[61]=x,e[62]=w,e[63]=$,e[64]=D,e[65]=z,e[66]=L,e[67]=b,e[68]=T,e[69]=_):_=e[69];let I;return e[70]!==_||e[71]!==f?(I=o.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[f,_]}),e[70]=_,e[71]=f,e[72]=I):I=e[72],I}function qd(t){const e=ce.c(54),{active:s,counts:n,shown:a,onSelect:i}=t,r=Pe();let c;e[0]!==s?(c=Hd.includes(s),e[0]=s,e[1]=c):c=e[1];const l=c,[d,u]=K.useState(!1),g=d||l;let m,f;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=we("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-accent hover:text-foreground"),f=o.jsx(gr,{size:16,className:"shrink-0"}),e[2]=m,e[3]=f):(m=e[2],f=e[3]);let p;e[4]!==r?(p=r("sandbox.collectionsSidebar.advanced"),e[4]=r,e[5]=p):p=e[5];let y;e[6]!==p?(y=o.jsx("span",{className:"flex-1 truncate",children:p}),e[6]=p,e[7]=y):y=e[7];const j=g&&"rotate-180";let T;e[8]!==j?(T=we("shrink-0 text-muted-foreground/70 transition-transform",j),e[8]=j,e[9]=T):T=e[9];let v;e[10]!==T?(v=o.jsx(Qs,{size:16,className:T}),e[10]=T,e[11]=v):v=e[11];let k;e[12]!==y||e[13]!==v?(k=o.jsxs(Cc,{className:m,children:[f,y,v]}),e[12]=y,e[13]=v,e[14]=k):k=e[14];let C;e[15]!==r?(C=r("sandbox.collectionsSidebar.sections"),e[15]=r,e[16]=C):C=e[16];const x=s==="sections";let w;e[17]!==i?(w=()=>i("sections"),e[17]=i,e[18]=w):w=e[18];let P;e[19]!==n.sections||e[20]!==C||e[21]!==x||e[22]!==w?(P=o.jsx(Ye,{icon:gn,label:C,count:n.sections,active:x,onClick:w,indent:!0}),e[19]=n.sections,e[20]=C,e[21]=x,e[22]=w,e[23]=P):P=e[23];let S;e[24]!==s||e[25]!==n.apps||e[26]!==i||e[27]!==a||e[28]!==r?(S=a("apps")&&o.jsx(Ye,{icon:go,label:r("sandbox.collectionsSidebar.apps"),count:n.apps,active:s==="apps",onClick:()=>i("apps"),indent:!0}),e[24]=s,e[25]=n.apps,e[26]=i,e[27]=a,e[28]=r,e[29]=S):S=e[29];let A;e[30]!==r?(A=r("sandbox.collectionsSidebar.loaders"),e[30]=r,e[31]=A):A=e[31];const $=s==="loaders";let D;e[32]!==i?(D=()=>i("loaders"),e[32]=i,e[33]=D):D=e[33];let z;e[34]!==n.loaders||e[35]!==A||e[36]!==$||e[37]!==D?(z=o.jsx(Ye,{icon:Fa,label:A,count:n.loaders,active:$,onClick:D,indent:!0}),e[34]=n.loaders,e[35]=A,e[36]=$,e[37]=D,e[38]=z):z=e[38];let L;e[39]!==s||e[40]!==n.actions||e[41]!==i||e[42]!==a||e[43]!==r?(L=a("actions")&&o.jsx(Ye,{icon:ti,label:r("sandbox.collectionsSidebar.actions"),count:n.actions,active:s==="actions",onClick:()=>i("actions"),indent:!0}),e[39]=s,e[40]=n.actions,e[41]=i,e[42]=a,e[43]=r,e[44]=L):L=e[44];let b;e[45]!==P||e[46]!==S||e[47]!==z||e[48]!==L?(b=o.jsxs(Nc,{className:"flex flex-col gap-0.5 pt-0.5",children:[P,S,z,L]}),e[45]=P,e[46]=S,e[47]=z,e[48]=L,e[49]=b):b=e[49];let _;return e[50]!==g||e[51]!==b||e[52]!==k?(_=o.jsxs(Tc,{open:g,onOpenChange:u,children:[k,b]}),e[50]=g,e[51]=b,e[52]=k,e[53]=_):_=e[53],_}function Xd(t){const e=ce.c(12),{state:s,claimPhase:n,lifecycle:a,onStart:i,connectionsHref:r}=t;switch(s.kind){case"starting":{let c;e[0]!==n||e[1]!==a?(c=Dl({claimPhase:n,lifecycle:a}),e[0]=n,e[1]=a,e[2]=c):c=e[2];let l;return e[3]!==n||e[4]!==c?(l=o.jsx(zn,{kind:"starting",progress:c,claimPhase:n}),e[3]=n,e[4]=c,e[5]=l):l=e[5],l}case"suspended":{let c;return e[6]!==i?(c=o.jsx(zn,{kind:"suspended",onResume:i}),e[6]=i,e[7]=c):c=e[7],c}case"errored":{let c;return e[8]!==r||e[9]!==i||e[10]!==s.error?(c=o.jsx(zn,{kind:"errored",error:s.error,onRetry:i,connectionsHref:r}),e[8]=r,e[9]=i,e[10]=s.error,e[11]=c):c=e[11],c}}}const Jd=new Set(["clone-failed","install-failed","start-failed","crashed"]);function Qd(t){if(t.fastPreviewActive)return{kind:"ready",devServerReady:!1,sandboxWarming:!1};if(t.previewState.kind!=="iframe")return{kind:"sandbox-card",state:t.previewState};const e=t.lifecyclePhase==="running",s=!e&&!Jd.has(t.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:s}}function Xo(t,e){const s=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),n=`${s} (copy)`;if(!t.has(n))return n;for(let a=2;a<1e3;a++){const i=`${s} (copy ${a})`;if(!t.has(i))return i}return`${s} (copy ${Date.now()})`}function Zd(t,e){const s=qt,n=e.replace(/-copy(?:-\d+)?$/,""),a=`${n}-copy`;if(!t.has(s(a)))return a;for(let i=2;i<1e3;i++){const r=`${n}-copy-${i}`;if(!t.has(s(r)))return r}return`${n}-copy-${Date.now()}`}function eu(t,e){const s=e.replace(/_copy(?:_\d+)?$/,""),n=`${s}_copy`;if(!Object.hasOwn(t,n))return n;for(let a=2;a<1e3;a++){const i=`${s}_copy_${a}`;if(!Object.hasOwn(t,i))return i}return`${s}_copy_${Date.now()}`}function tu(t){const e=Ea(t.newName),s={...t.source,name:t.newName,path:t.newPath};return{key:e,data:s}}function su(t,e,s){return Rl(t,e,s)}const nu=1e3;function ou(t,e){for(let s=0;s<nu;s++){const n=Ea(e);if(!Object.hasOwn(t,n))return n}throw new Error("Could not generate a unique page block key")}const au={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},iu={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},lu={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function ru(t){const e=ce.c(88),{open:s,mode:n,initialName:a,initialPath:i,isPending:r,error:c,templates:l,validate:d,onSubmit:u,onOpenChange:g}=t,m=r===void 0?!1:r,f=Pe(),[p,y]=K.useState(a),[j,T]=K.useState(i),[v,k]=K.useState(Mn),[C,x]=K.useState(null),[w,P]=K.useState(s);s!==w&&(P(s),s&&(y(a),T(i),k(Mn),x(null)));const S=n==="create"&&!!l?.length;let A;e[0]!==m||e[1]!==g?(A=fe=>{!fe&&!m&&(x(null),g(!1))},e[0]=m,e[1]=g,e[2]=A):A=e[2];const $=A;let D;e[3]!==m||e[4]!==p||e[5]!==u||e[6]!==j||e[7]!==S||e[8]!==v||e[9]!==d?(D=async fe=>{fe.preventDefault();const je=p.trim(),Se=j.trim();if(!je||!Se||m)return;const Ce=Hr(Se);if(Ce){x(Ce);return}const Ae=d?.({name:je,path:Se});if(Ae){x(Ae);return}x(null),await u({name:je,path:Se,templateKey:S&&v!==Mn?v:null})},e[3]=m,e[4]=p,e[5]=u,e[6]=j,e[7]=S,e[8]=v,e[9]=d,e[10]=D):D=e[10];const z=D,L=C??c,b=au[n];let _;e[11]!==f||e[12]!==b?(_=f(b),e[11]=f,e[12]=b,e[13]=_):_=e[13];let I;e[14]!==_?(I=o.jsx(tn,{children:o.jsx(Rs,{children:_})}),e[14]=_,e[15]=I):I=e[15];let M;e[16]!==m||e[17]!==S||e[18]!==f||e[19]!==v||e[20]!==l?(M=S&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{htmlFor:"page-form-template",className:"text-xs font-medium text-muted-foreground",children:f("sandbox.pageFormDialog.labelTemplate")}),o.jsx($l,{id:"page-form-template",value:v,onChange:k,templates:l??[],disabled:m})]}),e[16]=m,e[17]=S,e[18]=f,e[19]=v,e[20]=l,e[21]=M):M=e[21];let X;e[22]!==f?(X=f("sandbox.pageFormDialog.labelName"),e[22]=f,e[23]=X):X=e[23];let Q;e[24]!==X?(Q=o.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:X}),e[24]=X,e[25]=Q):Q=e[25];let J;e[26]===Symbol.for("react.memo_cache_sentinel")?(J=fe=>y(fe.target.value),e[26]=J):J=e[26];let H;e[27]!==f?(H=f("sandbox.pageFormDialog.placeholderName"),e[27]=f,e[28]=H):H=e[28];let W;e[29]!==m||e[30]!==p||e[31]!==H?(W=o.jsx(ws,{id:"page-form-name",value:p,onChange:J,placeholder:H,autoFocus:!0,disabled:m}),e[29]=m,e[30]=p,e[31]=H,e[32]=W):W=e[32];let O;e[33]!==W||e[34]!==Q?(O=o.jsxs("div",{className:"space-y-1.5",children:[Q,W]}),e[33]=W,e[34]=Q,e[35]=O):O=e[35];let E;e[36]!==f?(E=f("sandbox.pageFormDialog.labelPath"),e[36]=f,e[37]=E):E=e[37];let te;e[38]!==E?(te=o.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:E}),e[38]=E,e[39]=te):te=e[39];let ue;e[40]===Symbol.for("react.memo_cache_sentinel")?(ue=fe=>T(fe.target.value),e[40]=ue):ue=e[40];let B;e[41]!==f?(B=f("sandbox.pageFormDialog.placeholderPath"),e[41]=f,e[42]=B):B=e[42];let G;e[43]!==m||e[44]!==j||e[45]!==B?(G=o.jsx(ws,{id:"page-form-path",value:j,onChange:ue,placeholder:B,disabled:m}),e[43]=m,e[44]=j,e[45]=B,e[46]=G):G=e[46];let me;e[47]!==te||e[48]!==G?(me=o.jsxs("div",{className:"space-y-1.5",children:[te,G]}),e[47]=te,e[48]=G,e[49]=me):me=e[49];let pe;e[50]!==L?(pe=L&&o.jsx("p",{className:"text-xs text-destructive",children:L}),e[50]=L,e[51]=pe):pe=e[51];let xe;e[52]!==O||e[53]!==me||e[54]!==pe||e[55]!==M?(xe=o.jsxs("div",{className:"space-y-4 py-4",children:[M,O,me,pe]}),e[52]=O,e[53]=me,e[54]=pe,e[55]=M,e[56]=xe):xe=e[56];let ge;e[57]!==g?(ge=()=>g(!1),e[57]=g,e[58]=ge):ge=e[58];let ne;e[59]!==f?(ne=f("sandbox.pageFormDialog.buttonCancel"),e[59]=f,e[60]=ne):ne=e[60];let ye;e[61]!==m||e[62]!==ge||e[63]!==ne?(ye=o.jsx($e,{type:"button",variant:"outline",onClick:ge,disabled:m,children:ne}),e[61]=m,e[62]=ge,e[63]=ne,e[64]=ye):ye=e[64];let se;e[65]!==m||e[66]!==p||e[67]!==j?(se=!p.trim()||!j.trim()||m,e[65]=m,e[66]=p,e[67]=j,e[68]=se):se=e[68];let re;e[69]!==m||e[70]!==n||e[71]!==f?(re=m?o.jsxs(o.Fragment,{children:[o.jsx(mt,{className:"size-3.5"}),f(lu[n])]}):f(iu[n]),e[69]=m,e[70]=n,e[71]=f,e[72]=re):re=e[72];let de;e[73]!==se||e[74]!==re?(de=o.jsx($e,{type:"submit",disabled:se,children:re}),e[73]=se,e[74]=re,e[75]=de):de=e[75];let Z;e[76]!==ye||e[77]!==de?(Z=o.jsxs(sn,{children:[ye,de]}),e[76]=ye,e[77]=de,e[78]=Z):Z=e[78];let N;e[79]!==z||e[80]!==xe||e[81]!==Z||e[82]!==I?(N=o.jsx($s,{className:"sm:max-w-md",children:o.jsxs("form",{onSubmit:z,children:[I,xe,Z]})}),e[79]=z,e[80]=xe,e[81]=Z,e[82]=I,e[83]=N):N=e[83];let oe;return e[84]!==$||e[85]!==s||e[86]!==N?(oe=o.jsx(Os,{open:s,onOpenChange:$,children:N}),e[84]=$,e[85]=s,e[86]=N,e[87]=oe):oe=e[87],oe}const cu=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],Jo={from:"",to:"",type:"temporary",discardQueryParameters:!1};function du(t){const e=ce.c(111),{open:s,isPending:n,error:a,onSubmit:i,onOpenChange:r}=t,c=n===void 0?!1:n,l=Pe(),[d,u]=K.useState(Jo),[g,m]=K.useState(null),[f,p]=K.useState(s);s!==f&&(p(s),s&&(u(Jo),m(null)));let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=he=>u(Ke=>({...Ke,...he})),e[0]=y):y=e[0];const j=y;let T;e[1]!==c||e[2]!==r?(T=he=>{!he&&!c&&(m(null),r(!1))},e[1]=c,e[2]=r,e[3]=T):T=e[3];const v=T;let k;e[4]!==c||e[5]!==i||e[6]!==d||e[7]!==l?(k=async he=>{he.preventDefault();const Ke=d.from.trim(),Me=d.to.trim();if(!Ke||!Me||c){m(l("sandbox.redirectFormDialog.errorRequired"));return}m(null),await i({...d,from:Ke,to:Me})},e[4]=c,e[5]=i,e[6]=d,e[7]=l,e[8]=k):k=e[8];const C=k,x=g??a;let w;e[9]!==c||e[10]!==d.from||e[11]!==d.to?(w=!!d.from.trim()&&!!d.to.trim()&&!c,e[9]=c,e[10]=d.from,e[11]=d.to,e[12]=w):w=e[12];const P=w;let S;e[13]!==l?(S=l("sandbox.redirectFormDialog.title"),e[13]=l,e[14]=S):S=e[14];let A;e[15]!==S?(A=o.jsx(tn,{children:o.jsx(Rs,{children:S})}),e[15]=S,e[16]=A):A=e[16];let $;e[17]!==l?($=l("sandbox.redirectEditor.fromLabel"),e[17]=l,e[18]=$):$=e[18];let D;e[19]!==$?(D=o.jsx(xs,{htmlFor:"redirect-form-from",children:$}),e[19]=$,e[20]=D):D=e[20];const z=d.from;let L;e[21]===Symbol.for("react.memo_cache_sentinel")?(L=he=>j({from:he.target.value}),e[21]=L):L=e[21];let b;e[22]!==l?(b=l("sandbox.redirectEditor.fromPlaceholder"),e[22]=l,e[23]=b):b=e[23];let _;e[24]!==c||e[25]!==d.from||e[26]!==b?(_=o.jsx(ws,{id:"redirect-form-from",value:z,onChange:L,placeholder:b,autoFocus:!0,disabled:c}),e[24]=c,e[25]=d.from,e[26]=b,e[27]=_):_=e[27];let I;e[28]!==_||e[29]!==D?(I=o.jsxs("div",{className:"space-y-1.5",children:[D,_]}),e[28]=_,e[29]=D,e[30]=I):I=e[30];let M;e[31]!==l?(M=l("sandbox.redirectEditor.toLabel"),e[31]=l,e[32]=M):M=e[32];let X;e[33]!==M?(X=o.jsx(xs,{htmlFor:"redirect-form-to",children:M}),e[33]=M,e[34]=X):X=e[34];const Q=d.to;let J;e[35]===Symbol.for("react.memo_cache_sentinel")?(J=he=>j({to:he.target.value}),e[35]=J):J=e[35];let H;e[36]!==l?(H=l("sandbox.redirectEditor.toPlaceholder"),e[36]=l,e[37]=H):H=e[37];let W;e[38]!==c||e[39]!==d.to||e[40]!==H?(W=o.jsx(ws,{id:"redirect-form-to",value:Q,onChange:J,placeholder:H,disabled:c}),e[38]=c,e[39]=d.to,e[40]=H,e[41]=W):W=e[41];let O;e[42]!==X||e[43]!==W?(O=o.jsxs("div",{className:"space-y-1.5",children:[X,W]}),e[42]=X,e[43]=W,e[44]=O):O=e[44];let E;e[45]!==l?(E=l("sandbox.redirectEditor.typeLabel"),e[45]=l,e[46]=E):E=e[46];let te;e[47]!==E?(te=o.jsx(xs,{htmlFor:"redirect-form-type",children:E}),e[47]=E,e[48]=te):te=e[48];const ue=d.type;let B;e[49]===Symbol.for("react.memo_cache_sentinel")?(B=he=>j({type:he}),e[49]=B):B=e[49];let G;e[50]!==l?(G=l("sandbox.redirectEditor.typePlaceholder"),e[50]=l,e[51]=G):G=e[51];let me;e[52]!==G?(me=o.jsx(_c,{id:"redirect-form-type",className:"w-full",children:o.jsx(Bc,{placeholder:G})}),e[52]=G,e[53]=me):me=e[53];let pe;e[54]!==l?(pe=cu.map(he=>o.jsx(Ac,{value:he.value,children:l(he.labelKey,{status:Yr[he.value]})},he.value)),e[54]=l,e[55]=pe):pe=e[55];let xe;e[56]!==pe?(xe=o.jsx(Dc,{children:pe}),e[56]=pe,e[57]=xe):xe=e[57];let ge;e[58]!==c||e[59]!==d.type||e[60]!==me||e[61]!==xe?(ge=o.jsxs(Rc,{value:ue,onValueChange:B,disabled:c,children:[me,xe]}),e[58]=c,e[59]=d.type,e[60]=me,e[61]=xe,e[62]=ge):ge=e[62];let ne;e[63]!==te||e[64]!==ge?(ne=o.jsxs("div",{className:"space-y-1.5",children:[te,ge]}),e[63]=te,e[64]=ge,e[65]=ne):ne=e[65];let ye;e[66]===Symbol.for("react.memo_cache_sentinel")?(ye=he=>j({discardQueryParameters:he===!0}),e[66]=ye):ye=e[66];let se;e[67]!==c||e[68]!==d.discardQueryParameters?(se=o.jsx(Pn,{checked:d.discardQueryParameters,disabled:c,onCheckedChange:ye}),e[67]=c,e[68]=d.discardQueryParameters,e[69]=se):se=e[69];let re;e[70]!==l?(re=l("sandbox.redirectEditor.discardQueryParameters"),e[70]=l,e[71]=re):re=e[71];let de;e[72]!==re?(de=o.jsx("span",{className:"text-sm",children:re}),e[72]=re,e[73]=de):de=e[73];let Z;e[74]!==se||e[75]!==de?(Z=o.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[se,de]}),e[74]=se,e[75]=de,e[76]=Z):Z=e[76];let N;e[77]!==x?(N=x&&o.jsx("p",{className:"text-xs text-destructive",children:x}),e[77]=x,e[78]=N):N=e[78];let oe;e[79]!==I||e[80]!==O||e[81]!==ne||e[82]!==Z||e[83]!==N?(oe=o.jsxs("div",{className:"space-y-4 py-4",children:[I,O,ne,Z,N]}),e[79]=I,e[80]=O,e[81]=ne,e[82]=Z,e[83]=N,e[84]=oe):oe=e[84];let fe;e[85]!==r?(fe=()=>r(!1),e[85]=r,e[86]=fe):fe=e[86];let je;e[87]!==l?(je=l("sandbox.redirectFormDialog.cancel"),e[87]=l,e[88]=je):je=e[88];let Se;e[89]!==c||e[90]!==fe||e[91]!==je?(Se=o.jsx($e,{type:"button",variant:"outline",onClick:fe,disabled:c,children:je}),e[89]=c,e[90]=fe,e[91]=je,e[92]=Se):Se=e[92];const Ce=!P;let Ae;e[93]!==c||e[94]!==l?(Ae=c?o.jsxs(o.Fragment,{children:[o.jsx(mt,{className:"size-3.5"}),l("sandbox.redirectFormDialog.pending")]}):l("sandbox.redirectFormDialog.submit"),e[93]=c,e[94]=l,e[95]=Ae):Ae=e[95];let _e;e[96]!==Ce||e[97]!==Ae?(_e=o.jsx($e,{type:"submit",disabled:Ce,children:Ae}),e[96]=Ce,e[97]=Ae,e[98]=_e):_e=e[98];let q;e[99]!==Se||e[100]!==_e?(q=o.jsxs(sn,{children:[Se,_e]}),e[99]=Se,e[100]=_e,e[101]=q):q=e[101];let ie;e[102]!==C||e[103]!==oe||e[104]!==q||e[105]!==A?(ie=o.jsx($s,{className:"sm:max-w-md",children:o.jsxs("form",{onSubmit:C,children:[A,oe,q]})}),e[102]=C,e[103]=oe,e[104]=q,e[105]=A,e[106]=ie):ie=e[106];let ke;return e[107]!==v||e[108]!==s||e[109]!==ie?(ke=o.jsx(Os,{open:s,onOpenChange:v,children:ie}),e[107]=v,e[108]=s,e[109]=ie,e[110]=ke):ke=e[110],ke}function uu(t){const e=ce.c(70),{open:s,blockKey:n,initialName:a,isPending:i,onSubmit:r,onOpenChange:c}=t,l=i===void 0?!1:i,d=Pe(),[u,g]=K.useState(a),[m,f]=K.useState(s);s!==m&&(f(s),s&&g(a));let p;e[0]!==l||e[1]!==c?(p=ue=>{!ue&&!l&&c(!1)},e[0]=l,e[1]=c,e[2]=p):p=e[2];const y=p;let j;e[3]!==l||e[4]!==u||e[5]!==r?(j=async ue=>{ue.preventDefault();const B=u.trim();!B||l||await r(B)},e[3]=l,e[4]=u,e[5]=r,e[6]=j):j=e[6];const T=j;let v;e[7]!==d?(v=d("sandbox.sectionRenameDialog.title"),e[7]=d,e[8]=v):v=e[8];let k;e[9]!==v?(k=o.jsx(Rs,{children:v}),e[9]=v,e[10]=k):k=e[10];let C;e[11]!==d?(C=d("sandbox.sectionRenameDialog.description"),e[11]=d,e[12]=C):C=e[12];let x;e[13]!==C?(x=o.jsx(ao,{children:C}),e[13]=C,e[14]=x):x=e[14];let w;e[15]!==k||e[16]!==x?(w=o.jsxs(tn,{children:[k,x]}),e[15]=k,e[16]=x,e[17]=w):w=e[17];let P;e[18]!==d?(P=d("sandbox.sectionRenameDialog.nameLabel"),e[18]=d,e[19]=P):P=e[19];let S;e[20]!==P?(S=o.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:P}),e[20]=P,e[21]=S):S=e[21];let A;e[22]===Symbol.for("react.memo_cache_sentinel")?(A=ue=>g(ue.target.value),e[22]=A):A=e[22];let $;e[23]!==l||e[24]!==u?($=o.jsx(ws,{id:"section-rename-name",value:u,onChange:A,autoFocus:!0,disabled:l}),e[23]=l,e[24]=u,e[25]=$):$=e[25];let D;e[26]!==S||e[27]!==$?(D=o.jsxs("div",{className:"space-y-1.5",children:[S,$]}),e[26]=S,e[27]=$,e[28]=D):D=e[28];let z;e[29]!==d?(z=d("sandbox.sectionRenameDialog.keyLabel"),e[29]=d,e[30]=z):z=e[30];let L;e[31]!==z?(L=o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:z}),e[31]=z,e[32]=L):L=e[32];let b;e[33]!==n?(b=o.jsx(ws,{value:n,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=n,e[34]=b):b=e[34];let _;e[35]!==L||e[36]!==b?(_=o.jsxs("div",{className:"space-y-1.5",children:[L,b]}),e[35]=L,e[36]=b,e[37]=_):_=e[37];let I;e[38]!==D||e[39]!==_?(I=o.jsxs("div",{className:"space-y-4 py-4",children:[D,_]}),e[38]=D,e[39]=_,e[40]=I):I=e[40];let M;e[41]!==c?(M=()=>c(!1),e[41]=c,e[42]=M):M=e[42];let X;e[43]!==d?(X=d("sandbox.sectionRenameDialog.cancel"),e[43]=d,e[44]=X):X=e[44];let Q;e[45]!==l||e[46]!==M||e[47]!==X?(Q=o.jsx($e,{type:"button",variant:"outline",onClick:M,disabled:l,children:X}),e[45]=l,e[46]=M,e[47]=X,e[48]=Q):Q=e[48];let J;e[49]!==l||e[50]!==u?(J=!u.trim()||l,e[49]=l,e[50]=u,e[51]=J):J=e[51];let H;e[52]!==l||e[53]!==d?(H=l?o.jsxs(o.Fragment,{children:[o.jsx(mt,{className:"size-3.5"}),d("sandbox.sectionRenameDialog.saving")]}):d("sandbox.sectionRenameDialog.save"),e[52]=l,e[53]=d,e[54]=H):H=e[54];let W;e[55]!==J||e[56]!==H?(W=o.jsx($e,{type:"submit",disabled:J,children:H}),e[55]=J,e[56]=H,e[57]=W):W=e[57];let O;e[58]!==Q||e[59]!==W?(O=o.jsxs(sn,{children:[Q,W]}),e[58]=Q,e[59]=W,e[60]=O):O=e[60];let E;e[61]!==T||e[62]!==I||e[63]!==O||e[64]!==w?(E=o.jsx($s,{className:"sm:max-w-md",children:o.jsxs("form",{onSubmit:T,children:[w,I,O]})}),e[61]=T,e[62]=I,e[63]=O,e[64]=w,e[65]=E):E=e[65];let te;return e[66]!==y||e[67]!==s||e[68]!==E?(te=o.jsx(Os,{open:s,onOpenChange:y,children:E}),e[66]=y,e[67]=s,e[68]=E,e[69]=te):te=e[69],te}function pu(t,e){const[s,n]=K.useState(t);return t!==null&&(t.title!==s?.title||t.description!==s?.description)&&n(t),t??(e?s:null)}function fu(t){const e=ce.c(9),{redirect:s}=t,n=s.type;let a;e[0]!==s?(a=Wr(s),e[0]=s,e[1]=a):a=e[1];let i;e[2]!==a?(i=o.jsx(Tt,{asChild:!0,children:o.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-2xs font-medium tabular-nums text-muted-foreground",children:a})}),e[2]=a,e[3]=i):i=e[3];const r=n==="permanent"?"Permanent":"Temporary";let c;e[4]!==r?(c=o.jsx(Et,{side:"left",children:r}),e[4]=r,e[5]=c):c=e[5];let l;return e[6]!==i||e[7]!==c?(l=o.jsxs(Pt,{children:[i,c]}),e[6]=i,e[7]=c,e[8]=l):l=e[8],l}const mu=["draft","active","paused","finished"],gu=["launch","seasonal","trend","seo_gap","inventory","partnership","reputation"],hu=["awareness","education","conversion","retention","repositioning"],xu=["category","collection"],yu=3,Qo=12,bu=60,vu=25,ku=8e3,wu=2e3,ju="vtex/loaders/intelligentSearch/productList.ts";function Yt(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Gn(t){return typeof t=="string"||typeof t=="number"?String(t):""}function Hn(t){const e=Yt(t);return!!e&&typeof e.__resolveType=="string"&&"productId"in e}function dh(t){if(typeof t=="string")return t?[t]:[];if(Array.isArray(t))return t.every(n=>typeof n=="string")?t:t.map(n=>Gn(Yt(n)?.productId));const e=Yt(t),s=Yt(e?.props);return s&&Array.isArray(s.ids)?s.ids.map(Gn):e&&"productId"in e?[Gn(e.productId)]:[]}function Su(t){const e=Yt(t)??{};return typeof e.__resolveType=="string"?e.__resolveType:ju}function Cu(t,e){if(typeof t=="string")return e[0]??"";if(Array.isArray(t)){if(t.length>0&&t.every(r=>typeof r=="string"))return e;const i=t.find(Hn);if(i)return e.map((r,c)=>{const l=Yt(t[c]);return{...Hn(l)?l:{__resolveType:i.__resolveType},productId:r}})}const s=Yt(t);if(Hn(s)&&!Yt(s.props)?.ids)return{...s,productId:e[0]??""};const n=Yt(s?.props)??{},a=Su(t);return{...s??{},__resolveType:a,props:{...n,ids:e,simulationBehavior:n.simulationBehavior??"default"}}}const Nu=["title","titleTemplate","description","descriptionTemplate"];function hi(t){return typeof t=="string"?t.trim():""}function Zo(t){if(!Il(t))return"";const e=Pa(t);if(!e)return"";const s=[];for(const n of Nu){const a=hi(e[n]);a&&s.push(`${n}: ${a}`)}return s.join(`
|
|
20
|
-
`).slice(0,wu)}function xi(t,e){const s=t[e.key],n=s&&typeof s=="object"?Pa(s.seo):null,a=hi(n?.__resolveType);if(a){const i=Ll(a);if(i==="pdp"||i==="plp")return"commerce"}return qr(e.path).length>0?"commerce":e.path==="/"?"home":"institutional"}function Tu(t,e){const s=[],n=new Set;let a=ku;const i=(d,u)=>{!u||n.has(u)||s.length>=vu||u.length>a||(n.add(u),s.push({key:d,content:u}),a-=u.length)},r=Ol(t);r&&i("site",Zo(r.seoData));const c={home:[],institutional:[],commerce:[]};for(const d of e)c[xi(t,d)].push(d);const l=[...c.home,...c.institutional,...c.commerce.slice(0,2)];for(const d of l){const u=t[d.key];!u||typeof u!="object"||i(d.path,Zo(u.seo))}return s}const Yn={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},ko=["posts","authors","categories"],qs={posts:"post",authors:"author",categories:"category"};function ys(t){return ko.includes(t)}const Dn={posts:"post",authors:"author",categories:"category"},yi={posts:Yn.post,authors:Yn.author,categories:Yn.category},Eu=Object.fromEntries(Object.entries(yi).map(([t,e])=>[e,t]));function bi(t){return typeof t=="string"?Eu[t]??null:null}function Ee(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function U(t){return typeof t=="string"?t:""}function Pu(t,e){switch(t){case"posts":return{label:U(e.title)||"Untitled post",subtitle:U(e.slug),missing:Rn(e)};case"authors":return{label:U(e.name)||"Unnamed author",subtitle:U(e.email),missing:[]};case"categories":return{label:U(e.name)||"Unnamed category",subtitle:U(e.slug),slug:U(e.slug),parentSlug:U(e.parentSlug),missing:Mu(e)};default:{const s=t;throw new Error(`Unhandled blog kind: ${String(s)}`)}}}function vi(t){const e={posts:[],authors:[],categories:[]},s=[];for(const[n,a]of Object.entries(t)){const i=Ee(a);if(!i)continue;const r=bi(i.__resolveType);if(!r)continue;const c=Ee(i[Dn[r]])??{},l={key:n,kind:r,...Pu(r,c)};e[r].push(l),s.push({entry:l,key:vn(U(c[r==="posts"?"title":"name"]))})}Au(s);for(const n of ko)e[n].sort((a,i)=>a.label.localeCompare(i.label));return e}function Au(t){const e=new Map;for(const{entry:s,key:n}of t){if(!n)continue;const a=`${s.kind}:${n}`;e.set(a,(e.get(a)??0)+1)}for(const{entry:s,key:n}of t)n&&(e.get(`${s.kind}:${n}`)??0)>1&&(s.duplicateName=!0)}function _u(t,e){return vi(t)[e]}function ht(t,e){return _u(t,e).map(s=>({key:s.key,payload:vs(Ee(t[s.key])??void 0,e)}))}const Zn=Object.freeze({});function vs(t,e){return t?Ee(t[Dn[e]])??Zn:Zn}function _s(t,e,s){return{name:t,__resolveType:yi[e],[Dn[e]]:s}}function uh({records:t,selected:e,valueField:s,toRef:n}){const a=Array.isArray(e)?e:[],i=m=>typeof m=="string"?m:U(Ee(m)?.[s]),r=m=>typeof m=="string"?m:U(Ee(m)?.name),c=m=>{const f=i(m),p=f?t.find(({payload:j})=>U(j[s])===f):void 0;if(p)return p;const y=r(m);return y?t.find(({payload:j})=>U(j.name)===y):void 0},l=t.map(({key:m,payload:f})=>({value:m,label:U(f.name)||U(f[s])||m})),d=new Map,u=[];return a.forEach((m,f)=>{const p=c(m);if(p){u.includes(p.key)||u.push(p.key);return}const y=`unresolved:${f}`;d.set(y,m),u.push(y),l.push({value:y,label:r(m)||i(m)||"Unknown"})}),{options:l,selectedValues:u,refsForValues:m=>m.map(f=>{const p=t.find(y=>y.key===f);return p?n(p.payload):d.get(f)}).filter(f=>f!==void 0)}}function Bu(t){return ht(t,"authors").map(({payload:e})=>({...e,name:U(e.name),email:U(e.email)})).filter(e=>e.email)}function ct(t){return Array.isArray(t)?t:[]}function Wt(t){if(typeof t=="string")return t;const e=Ee(t);return e?U(e.slug):""}function ki(t){if(typeof t=="string")return t;const e=Ee(t);return e?U(e.email):""}const Du={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 Ru(t,e){return t.map(s=>e(Du[s])).join(", ")}function Rn(t){const e=[];return U(t.title).trim()||e.push("title"),U(t.slug).trim()||e.push("slug"),ct(t.categories).map(Wt).filter(Boolean).length===0&&e.push("category"),U(t.excerpt).trim()||e.push("excerpt"),U(t.image).trim()||e.push("image"),e}const wo=["draft","generating","awaiting_review","scheduled","published","archived"],wi=8;function Is(t){switch(U(t.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 ph(t){return Is(t)==="archived"}function $u(t,e){return e!=="published"&&e!=="scheduled"||Is(t)===e?!1:Rn(t).length>0}function Ou(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1,wi).toISOString()}function xn(t,e,s){if(e!=="scheduled")return{...t,status:e,scheduledDatetime:""};const n=U(t.scheduledDatetime);return{...t,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(n).getTime())?Ou(s):n}}function ji(t,e=Ui(t)){return ht(t,"posts").map(({key:s,payload:n})=>({key:s,duplicateTitle:e.has(s),title:U(n.title)||"Untitled post",slug:U(n.slug),date:U(n.date),scheduledDatetime:U(n.scheduledDatetime),categorySlugs:ct(n.categories).map(Wt).filter(Boolean),authorEmails:ct(n.authors).map(ki).filter(Boolean),missing:Rn(n),status:Is(n),form:"live"}))}const Si="blog-manager/posts/";function Ci(t){return t.startsWith(Si)}function Xs(t){return t.split("/").pop()??t}function yn(t){return`${Si}${t}`}function Lu(t){return`collections/blog/posts/${t}`}function eo(){return Ls(12)}function Iu(t){const e=Ee(t.planning)??{},s=Ee(e.format);return{campaignKey:U(e.campaignKey)||void 0,format:s?{name:U(s.name),value:U(s.value)}:void 0,brief:U(e.brief)||void 0}}function Ni(t=!1){return t?{content:""}:{sections:[]}}function Ti(t){return{title:t.title,slug:"",excerpt:"",date:t.now.toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],...Ni(t.legacyContent),status:"draft",planning:t.planning??{}}}function ks(t,e){return{name:t,[Dn.posts]:e}}function Ku(t,e){return Ci(t)?ks(t,e):_s(t,"posts",e)}function Ei(t){const e=[];for(const[s,n]of Object.entries(t)){if(!Ci(s))continue;const a=Ee(n);a&&e.push({key:s,payload:vs(a,"posts")})}return e}function Pi(t){return[...Ei(t),...ht(t,"posts")]}function Fu(t){const e=Ui(t);return[...Ei(t).map(({key:n,payload:a})=>({key:n,duplicateTitle:e.has(n),title:U(a.title)||"Untitled post",slug:U(a.slug),date:U(a.date),scheduledDatetime:U(a.scheduledDatetime),categorySlugs:ct(a.categories).map(Wt).filter(Boolean),authorEmails:ct(a.authors).map(ki).filter(Boolean),missing:Rn(a),status:Is(a),form:"planning"})),...ji(t,e)]}function zu(t,e,s){const n=xn(t.payload,e,s),a=Xs(t.key),i=e==="scheduled"||e==="published"?"live":"planning",r=i==="live"?Lu(a):yn(a),c=i==="live"?_s(r,"posts",n):ks(r,n);return{writes:{[r]:c},deletes:r===t.key?[]:[t.key]}}function fh(t,e,s){const n=ct(t.categories);if(!n.some(l=>Wt(l)===e))return t;let a=!1;const i=n.map(l=>{const d=Wt(l);if(d!==e&&d!==s.slug)return l;const u=Ee(l);return u&&U(u.slug)===s.slug&&U(u.name)===s.name?l:(a=!0,{name:s.name,slug:s.slug})});if(!a){const l=n.map(Wt).filter(Boolean);if(new Set(l).size===l.length)return t}const r=new Set,c=i.filter(l=>{const d=Wt(l);return d?r.has(d)?!1:(r.add(d),!0):!0});return{...t,categories:c}}function Mu(t){const e=[];return U(t.name).trim()||e.push("name"),U(t.slug).trim()||e.push("slug"),e}function Vu(t,e){const s=ct(t.categories);return s.some(n=>Wt(n)===e)?{...t,categories:s.filter(n=>Wt(n)!==e)}:t}function mh(t,e,s){return U(t.parentSlug)!==e?t:{...t,parentSlug:s}}function Uu(t){const e=U(t.status),s=e==="idea"||e==="in_review"?{status:Is(t)}:{};return{...t,...s,dateModified:new Date().toISOString()}}function Ls(t){const e=new Uint8Array(Math.ceil(t/2));return crypto.getRandomValues(e),Array.from(e,s=>s.toString(16).padStart(2,"0")).join("").slice(0,t)}function Wn(t,e){const s=`collections/blog/${e}/${Ls(12)}`;if(!Object.hasOwn(t,s))return s;throw new Error("Could not generate a unique blog block key")}function Ai(t,{legacyContent:e=!1}={}){switch(t){case"posts":return{title:"Untitled post",excerpt:"",slug:`untitled-${Ls(8)}`,date:new Date().toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],...Ni(e)};case"authors":return{name:"New author",type:"Person",email:"",jobTitle:"",company:"",url:"",avatar:""};case"categories":return{name:"New category",slug:`category-${Ls(8)}`,description:"",sections:[]};default:{const s=t;throw new Error(`Unhandled blog kind: ${String(s)}`)}}}const Gu={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"}},ea="Box";function _i(t){return t.startsWith("blog/")?"app":"site"}function Hu(t){return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")||t.startsWith("/")}function Gs(...t){for(const e of t)if(e!==void 0)return e}function ta(t){if(t&&!(t.includes("/")||/\.(tsx?|jsx?)$/.test(t)))return t}function Yu(t){const e=t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim();return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():t}function Wu(t,e){const s=Wa(t,e),n=$n(t),a=Gu[n],i=_i(t),r=ta(s.title),c=ta(s.description),l=(i==="site"?Gs(r,a?.title):Gs(a?.title,r))??Yu(n),d=i==="site"?Gs(c,a?.description):Gs(a?.description,c),u=i==="site"?s.icon:void 0,g=u&&Hu(u)?u:void 0,m=g!==void 0?a?.iconName??ea:Gs(u,a?.iconName)??ea;return{resolveType:t,title:l,description:d,iconName:m,iconUrl:g,source:i}}function Bi(t,{hideDefaults:e=!1,customPaths:s=[]}={}){const n=new Set,a=[],i=t.manifest?.blocks??{};for(const[r,c]of Object.entries(i))for(const l of Object.keys(c))n.has(l)||!(r==="sections"&&Di(l,s)&&!Xr(l,t))&&!Xu(l)||e&&_i(l)==="app"||(n.add(l),a.push(Wu(l,t)));return a.sort((r,c)=>r.title.localeCompare(c.title))}function $n(t){return(t.split("/").pop()??t).replace(/\.(tsx?|jsx?)$/,"")}const qu=["blog/sections/blocks/","site/sections/Blog/Post/"];function Xu(t,e=[]){return qu.some(s=>t.startsWith(s))||Di(t,e)}function Di(t,e){if(e.length===0)return!1;const s=t.toLowerCase();return e.some(n=>s===n||s.startsWith(`${n}/`))}const Ju=/\/blog\.tsx?$/;function Qu(t){const e=[];for(const[s,n]of Object.entries(t)){if(s.includes("/")||!n||typeof n!="object"||Array.isArray(n))continue;const a=n;typeof a.__resolveType=="string"&&Ju.test(a.__resolveType)&&e.push(a)}return e}const Zu=gl(hl());function gh(t){const e=new Set;for(const s of Qu(t)){const n=Zu.safeParse(s.customSectionPaths);if(n.success)for(const a of n.data){const i=a.trim().replace(/^\/+|\/+$/g,"").toLowerCase();i&&e.add(i)}}return[...e]}const Ri="blog-manager-brand",$i="blog-manager-context",Oi=["companyName","description","language","storeUrl","targetAudience","values","competitors","keywords","commercialPolicies","specialDates"],Li=["tone","dos","avoid","categories","vocabulary","voiceExamples"];function hh(t){return Ee(t)??Zn}function bn(t,e){const s={};for(const n of e)n in t&&(s[n]=t[n]);return s}function xh(t,e,s){const n=bn(t,Oi);if(Ee(s))return n;const a=Ee(e)??{};return{...bn(a,Li),...n}}function ep(t,e){const s=Ee(t)??{},n=Ee(e),a=bn(s,Oi),i=n??bn(s,Li);return{brand:a,context:i,merged:{...a,...i}}}function Ii(t){return ep(t[Ri],t[$i])}function tp(t){return{companyName:U(t.companyName),description:U(t.description),language:U(t.language),storeUrl:$c(U(t.storeUrl))??"",tone:U(t.tone),targetAudience:U(t.targetAudience),values:rt(it(t.values)),competitors:rt(it(t.competitors)),specialDates:rt(it(t.specialDates)),dos:rt(it(t.dos)),avoid:rt(it(t.avoid)),keywords:en(Zs(t.keywords)),commercialPolicies:rt(it(t.commercialPolicies)),vocabulary:rt(it(t.vocabulary)),voiceExamples:so(to(t.voiceExamples))}}function to(t){if(!Array.isArray(t))return[];const e=[];for(const s of t){if(typeof s=="string"){s.trim()&&e.push({text:s,sounds:!0});continue}const n=Ee(s);if(!n)continue;const a=U(n.text)||U(n.value);e.push({text:a,sounds:n.sounds!==!1})}return e}function so(t){return t.filter(e=>e.text.trim())}function yh(t,e,s){const n=[];for(const a of s.textFields){const i=U(e[a]).trim();i&&(s.mode==="empty"&&U(t[a]).trim()||(t[a]=i,n.push(a)))}for(const a of s.ruleFields){const i=rt(it(e[a]));i.length!==0&&(s.mode==="empty"&&rt(it(t[a])).length>0||(t[a]=i,n.push(a)))}for(const a of s.termFields??[]){const i=en(Zs(e[a]));i.length!==0&&(s.mode==="empty"&&en(Zs(t[a])).length>0||(t[a]=i,n.push(a)))}for(const a of s.exampleFields??[]){const i=so(to(e[a]));i.length!==0&&(s.mode==="empty"&&so(to(t[a])).length>0||(t[a]=i,n.push(a)))}return n}function Zs(t){if(!Array.isArray(t))return[];const e=[];for(const s of t){if(typeof s=="string"){e.push(s);continue}const n=Ee(s);n&&e.push(U(n.name)||U(n.value))}return e}function en(t){return t.filter(e=>e.trim())}function it(t){if(!Array.isArray(t))return[];const e=[];for(const s of t){if(typeof s=="string"){s.trim()&&e.push({name:s,value:""});continue}const n=Ee(s);n&&e.push({name:U(n.name),value:U(n.value)})}return e}function rt(t){return t.filter(e=>e.name.trim()||e.value.trim())}const sp=6e4,np=4e3;function op(t){const e=[],s=new Set,n=(a,i)=>{if(typeof a=="string"){if(!a.includes(" ")||a.length<4||/^(https?:)?\/\//.test(a)||/^data:/.test(a))return;const r=`${i}: ${a.trim()}`;if(s.has(r))return;s.add(r),e.push(r);return}if(Array.isArray(a)){for(const r of a)n(r,i);return}if(a&&typeof a=="object")for(const[r,c]of Object.entries(a))r!=="__resolveType"&&n(c,r)};return n(t,"block"),e.join(`
|
|
21
|
-
`)}function bh(t,e){const s=new Map,n=m=>{const f=s.get(m);if(f!==void 0)return f;const p=op(t[m]).slice(0,np);return s.set(m,p),p},a=(m,f)=>n(f).length-n(m).length,i=Tu(t,e),r=i.reduce((m,f)=>m+f.content.length,0),c={home:[],institutional:[],commerce:[]};for(const m of e)c[xi(t,m)].push(m.key);const l=[...ht(t,"posts").map(m=>m.key).sort(a),...ht(t,"categories").map(m=>m.key),...c.home,...c.institutional.sort(a),...c.commerce.sort(a)],d=[],u=new Set;let g=Math.max(0,sp-r);for(const m of l){if(d.length>=bu)break;if(u.has(m)||!t[m])continue;u.add(m);const f=n(m);if(f.length>g)break;d.push({key:m,content:f}),g-=f.length}return{blocks:d,seo:i}}const Ki="blog-manager/campaigns/";function vh(){return`${Ki}${crypto.randomUUID()}`}function cn(t,e,s){return t.find(n=>n===e)??s}function sa(t){return U(t)||null}function ap(t){const e=[];for(const s of ct(t)){const n=Ee(s);n&&e.push({kind:cn(xu,n.kind,"category"),id:U(n.id),name:U(n.name),url:U(n.url),description:U(n.description)})}return e}function ip(t){const e=ct(t.images).map(n=>U(n));return(e.length>0?e:[U(t.image)].filter(Boolean)).slice(0,yu)}function lp(t){const e=[];for(const s of ct(t)){const n=Ee(s);n&&e.push({id:U(n.id),name:U(n.name),url:U(n.url),images:ip(n),category:U(n.category),description:U(n.description)})}return e}function kh(t,e){return{name:t,campaignName:e.name,seedKey:e.seedKey,status:e.status,period:{start:e.period.start??"",end:e.period.end??""},trigger:{type:e.trigger.type,note:e.trigger.note},intent:{objective:e.intent.objective,targets:e.intent.targets,products:e.intent.products,keywords:e.intent.keywords},guardrails:{avoidComplements:e.guardrails.avoidComplements,toneOverrides:e.guardrails.toneOverrides},createdAt:e.createdAt,updatedAt:e.updatedAt}}function rp(t){const e=[];for(const[s,n]of Object.entries(t)){if(!s.startsWith(Ki))continue;const a=Ee(n);if(!a)continue;const i=Ee(a.period)??{},r=Ee(a.trigger)??{},c=Ee(a.intent)??{},l=Ee(a.guardrails)??{};e.push({key:s,name:U(a.campaignName),seedKey:U(a.seedKey),status:cn(mu,a.status,"draft"),period:{start:sa(i.start),end:sa(i.end)},trigger:{type:cn(gu,r.type,"seasonal"),note:U(r.note)},intent:{objective:cn(hu,c.objective,"awareness"),targets:ap(c.targets),products:lp(c.products),keywords:en(Zs(c.keywords))},guardrails:{avoidComplements:it(l.avoidComplements),toneOverrides:U(l.toneOverrides)},createdAt:U(a.createdAt),updatedAt:U(a.updatedAt)})}return e.sort((s,n)=>n.createdAt.localeCompare(s.createdAt)||s.name.localeCompare(n.name))}function wh(t){const e=t.toISOString();return{name:"",seedKey:"",status:"draft",period:{start:null,end:null},trigger:{type:"seasonal",note:""},intent:{objective:"awareness",targets:[],products:[],keywords:[]},guardrails:{avoidComplements:[],toneOverrides:""},createdAt:e,updatedAt:e}}const Fi="blog-manager/campaign-seeds/";function jh(){return`${Fi}${crypto.randomUUID()}`}function Sh(t,e){return{name:t,seedName:e.name,keywords:e.keywords,prompt:e.prompt,createdAt:e.createdAt,updatedAt:e.updatedAt}}function Ch(t){const e=[];for(const[s,n]of Object.entries(t)){if(!s.startsWith(Fi))continue;const a=Ee(n);a&&e.push({key:s,name:U(a.seedName),keywords:en(Zs(a.keywords)),prompt:U(a.prompt),createdAt:U(a.createdAt),updatedAt:U(a.updatedAt)})}return e.sort((s,n)=>n.createdAt.localeCompare(s.createdAt)||s.name.localeCompare(n.name))}function Nh(t){const e=t.toISOString();return{name:"",keywords:[],prompt:"",createdAt:e,updatedAt:e}}const zi="blog-manager-formats",cp=40;function Th(t){return ht(t,"posts").slice(0,cp).map(({key:e,payload:s})=>({key:e,title:U(s.title),sections:ct(s.sections).map(n=>U(Ee(n)?.__resolveType)).filter(Boolean).map($n)}))}function dp(t,e){return Bi(t,e).map(s=>({name:$n(s.resolveType),resolveType:s.resolveType,title:s.title,description:s.description}))}function Mi(t,e={}){const s=new Set,n=/\[@[^\]]+\]\(([^)\s]+)\)/g;for(const i of t.matchAll(n))i[1]&&s.add(i[1]);const a=/(?:^|[\s([{>])@([A-Za-z][\w-]*)/g;for(const i of t.replace(n," ").matchAll(a)){const r=i[1];r&&s.add(e[r]??r)}return[...s]}function Eh(t,e,s={}){const n=new Set(e);return Mi(t,s).filter(a=>!n.has(a))}function Ph(t,e){const s=/\[@[^\]]+\]\([^)\s]+\)/g,n=[];let a=0;for(const i of t.matchAll(s)){const r=i.index??0;n.push(na(t.slice(a,r),e),i[0]),a=r+i[0].length}return n.push(na(t.slice(a),e)),n.join("")}function na(t,e){return t.replace(/(^|[\s([{>])@([A-Za-z][\w-]*)/g,(s,n,a)=>{const i=e[a];return i?`${n}[@${a}](${i})`:s})}const up=["Heading","Paragraph","BlockImage","List","Cta"];function Ah(t){return up.filter(e=>e in t)}function vn(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/\s+/g," ").trim()}function _h(t,e,s,n){const a=vn(n);return a?Vi(t,e).some(i=>i.key!==s&&vn(i.name)===a):!1}function Vi(t,e){return e!=="posts"?ht(t,e).map(({key:s,payload:n})=>({key:s,name:U(n.name)})):Pi(t).map(({key:s,payload:n})=>({key:s,name:U(n.title)}))}function Ui(t){const e=new Map;for(const{key:n,name:a}of Vi(t,"posts")){const i=vn(a);if(!i)continue;const r=e.get(i);r?r.push(n):e.set(i,[n])}const s=new Set;for(const n of e.values())if(n.length>1)for(const a of n)s.add(a);return s}const pp=["companyName","language","description","tone","targetAudience"];function fp(t){const e=Ee(t)??{},s=[];for(const n of pp)U(e[n]).trim()||s.push(n);return rt(it(e.dos)).length===0&&s.push("dos"),rt(it(e.avoid)).length===0&&s.push("avoid"),s}function mp(t,e){const s=t.required;if(!Array.isArray(s))return;const n=new Set(e&&typeof e=="object"?Object.keys(e):[]),a=s.filter(i=>typeof i=="string"&&n.has(i));return a.length>0?a:void 0}const gp=6,hp=6e3;function xp(t){const e=t.schema??{},s=e.$defs??e.definitions;return s&&typeof s=="object"?s:{}}function yp(t,e){for(const s of Object.values(e.manifest?.blocks??{})){const n=s[t];if(n)return n}}function dn(t,e,s){if(Array.isArray(t))return t.map(i=>dn(i,e,s));if(!t||typeof t!="object")return t;const n=t;if(typeof n.$ref=="string"){if(s>=gp)return{};const i=n.$ref.split("/").pop()??"",r=e[i];return r===void 0?{}:dn(r,e,s+1)}const a={};for(const[i,r]of Object.entries(n))a[i]=dn(r,e,s);return a}function bp(t,e){const s=xp(e),n=dn(yp(t,e),s,0);if(!n||typeof n!="object")return{};const a=n,i=a.allOf,r=Array.isArray(i)&&i.length===1?i[0]:a;if(!r||typeof r!="object")return{};const{$schema:c,...l}=r,d=oa(l);return JSON.stringify(d).length>hp?oa(l,!0):d}function oa(t,e=!1){const s={...t},n=s.properties;if(n&&typeof n=="object"){const a=Object.fromEntries(Object.entries(n).filter(([i])=>!i.startsWith("__")).map(([i,r])=>[i,e?Gi(r):r]));s.properties=a,s.required=mp(s,a),s.required||delete s.required}return s}function Gi(t){if(!t||typeof t!="object")return t;const e=t,s={};for(const n of["type","description","format","options","enum"])n in e&&(s[n]=e[n]);return Array.isArray(e.anyOf)&&(s.anyOf=e.anyOf.map(Gi)),s}function vp(t){if(t==null)return null;if(Array.isArray(t))return"array";const e=typeof t;return e==="number"||e==="boolean"||e==="string"||e==="object"?e:null}function kp(t,e){const s=t.properties;if(!e||!s||typeof s!="object")return t;const n=s;let a=!1;const i={};for(const[r,c]of Object.entries(n)){const l=c&&typeof c=="object"?{...c}:c,d=l?.type,u=vp(e[r]);l&&typeof l=="object"&&u&&typeof d=="string"&&d!==u&&(delete l.type,delete l.enum,a=!0),i[r]=l}return a?{...t,properties:i}:t}const wp={Paragraph:{html:"<p>A dúvida entre 9000 ou 12000 BTUs é a mais comum na hora de escolher.</p>"},Heading:{text:"Antes de escolher: o resumo",level:"h2"},Quote:{quote:"Levei só a mala de bordo e não senti falta de nada.",attribution:"Ana, leitora"},List:{items:`<strong>Tecnologia Inverter:</strong> temperatura mais estável;
|
|
22
|
-
<strong>Gaveta HortiNatura:</strong> frescor por duas vezes mais tempo;`,style:"unordered"},BlockImage:{url:"https://cdn.exemplo.com/2026/10/mochila.webp",alt:"Mochila escolar azul apoiada em uma cadeira de sala de aula",size:"full"},Video:{url:"https://www.youtube.com/watch?v=dQw4w9WgXcQ",caption:"Como medir a capacidade da mala"},Divider:{},Cta:{text:"Ver toda a linha Escolar",href:"/escolar"},Callout:{title:"VOCÊ SABIA?",body:"Pediatras recomendam que a mochila carregada não passe de 10% do peso da criança.",variant:"tip"},Code:{code:"const total = itens.length;",language:"ts"},Stat:{value:"30%",label:"menos desperdício",description:"Comparado ao modelo anterior da mesma linha."},StatGroup:{stats:'[{"value":"30%","label":"menos desperdício"},{"value":"2x","label":"mais frescor"}]'},CardGroup:{cards:'[{"title":"Pré-escola","body":"Pouco material, mochila pequena."},{"title":"Fundamental","body":"Cadernos e livros pesam; considere rodinhas."}]'},Checklist:{title:"Antes de comprar, confira",items:'["Capacidade em litros","Alças acolchoadas","Compartimento para notebook"]'},Steps:{title:"Como medir",steps:'[{"title":"Meça a altura","description":"Da base ao topo, sem as alças."},{"title":"Some a profundidade"}]'},Comparison:{left:'{"title":"Com rodinhas","items":["Poupa a coluna","Mais pesada vazia"]}',right:'{"title":"De costas","items":["Mais leve","Exige ajuste das alças"]}'},Table:{headers:'["Modelo","Capacidade","Preço"]',rows:'[["Bordo","38L","R$ 399"],["Média","68L","R$ 599"]]'}},jp=600;function Sp(t,e){for(const{payload:s}of ht(e,"posts"))for(const n of ct(s.sections)){const a=Ee(n);if(!a||a.__resolveType!==t)continue;const{__resolveType:i,...r}=a;if(Object.keys(r).length!==0&&!(JSON.stringify(r).length>jp))return r}}function Cp(t,e,s,n){const a=dp(e,n),i=jo(e,n),r=new Set(Mi(t.value,i)),c=a.filter(g=>r.has(g.resolveType)),l=c.length>0?c:a,d=new Set,u=[];for(const g of l){if(d.has(g.name)||i[g.name]!==g.resolveType)continue;d.add(g.name);const m=Sp(g.resolveType,s)??wp[g.name];u.push({name:g.name,title:g.title,description:g.description??"",schema:kp(bp(g.resolveType,e),m),example:m})}return u}function jo(t,e){const s={};for(const n of Bi(t,e)){const a=$n(n.resolveType);a in s||(s[a]=n.resolveType)}return s}function Np(t,e,s={}){const n=[];for(const a of t){const i=e[a.type];if(!i)continue;const r=Pp(a.props,a.productIds??[],s[a.type]);n.push({__resolveType:i,...r})}return n}const Tp=["product","products"];function Ep(t){const e=Ee(t);return e?Tp.find(s=>s in e)??null:null}function Pp(t,e,s){const n=e.filter(Boolean),a=Ep(s);if(n.length===0||!a)return t;const i=s[a];return{...t,[a]:Cu(i,n)}}const So=80;function Hi(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,So)}function Bh(t){return t.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+/,"").slice(0,So)}function aa(t,e){const s=So-e.length-1;return`${t.slice(0,s).replace(/-+$/,"")}-${e}`}function Yi(t,e,s){const n=Hi(t)||`${s}-${Ls(6)}`,a=new Set(e);if(!a.has(n))return n;for(let i=2;i<100;i++){const r=aa(n,String(i));if(!a.has(r))return r}return aa(n,Ls(4))}function Wi(t,e){return Yi(t,e,"post")}function Ap(t,e){return Yi(t,e,"category")}function _p({draft:t,resolveTypes:e,productShapes:s,categories:n,authors:a,planning:i,takenSlugs:r,now:c}){const l=new Set(t.categorySlugs),d=new Set(t.authorEmails),u={title:t.title,slug:Wi(t.title,r),date:c.toISOString().slice(0,10),excerpt:t.excerpt,image:t.cover.url,alt:t.cover.alt,authors:a.filter(g=>d.has(g.email)),categories:n.filter(g=>l.has(g.slug)),seo:{title:t.seo.title,description:t.seo.description,image:t.cover.url},sections:Np(t.sections,e,s),planning:i??{}};return xn(u,"awaiting_review",c)}function kn(t){const e=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${t.getFullYear()}-${e}-${s}`}const qi=/^(\d{4})-(\d{2})-(\d{2})$/;function wn(t){const e=t.trim();if(!e)return null;const s=qi.exec(e);if(s){const a=Number(s[1]),i=Number(s[2])-1,r=Number(s[3]),c=new Date(a,i,r);return c.getMonth()===i&&c.getDate()===r?c:null}const n=new Date(e);return Number.isNaN(n.getTime())?null:Oc(n)}function Bp(t,{legacyContent:e=!1}={}){const s=new Date(t.getFullYear(),t.getMonth(),t.getDate(),wi);return{...Ai("posts",{legacyContent:e}),status:"scheduled",scheduledDatetime:s.toISOString(),date:kn(t)}}function Dp(t){if(typeof t!="string")return null;const e=t.trim();if(!e)return null;if(qi.test(e))return wn(e);const s=new Date(e);return Number.isNaN(s.getTime())?null:s}function Rp(t,e){const s=Dp(t.scheduledDatetime);if(!s)return null;const n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()),a={...t,scheduledDatetime:n.toISOString()};return(typeof t.date=="string"?t.date:"")===kn(s)&&(a.date=kn(n)),a}function $p(t){return wn(t.scheduledDatetime)??wn(t.date)}function Dh(t){const e=new Map,s=[];for(const a of t){const i={post:a,scheduled:wn(a.scheduledDatetime)!==null},r=$p(a);if(!r){s.push(i);continue}const c=kn(r),l=e.get(c);l?l.push(i):e.set(c,[i])}const n=(a,i)=>Number(i.scheduled)-Number(a.scheduled)||a.post.title.localeCompare(i.post.title);for(const a of e.values())a.sort(n);return s.sort(n),{byDay:e,undated:s}}const jn={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 Op({orgSlug:t,virtualMcpId:e,branch:s,decofile:n,onMoved:a}){const i=Pe(),r=Lc({orgSlug:t,virtualMcpId:e,branch:s}),[c,l]=K.useState(new Set),d=f=>vs(n[f],"posts"),u=(f,p,y=d(f))=>p==="generating"?{kind:"not-a-target"}:c.has(Xs(f))?{kind:"in-flight"}:$u(y,p)?{kind:"incomplete"}:null,g=f=>{switch(f.kind){case"incomplete":return i("sandbox.postBoard.moveBlocked");case"in-flight":return i("sandbox.postBoard.moveInFlight");case"not-a-target":return i("sandbox.postBoard.moveNotATarget");default:return String(f)}};return{apply:async(f,p,y,j)=>{const T=y??d(f);if(Is(T)===p)return null;const v=u(f,p,T);if(v)return v.kind!=="in-flight"&&ve.error(g(v)),null;const k=Xs(f);l(w=>new Set(w).add(k));const C=zu({key:f,payload:T},p,new Date),x=Object.keys(C.writes)[0]??f;x!==f&&a?.(f,x);try{return await r.move(C,{shown:j}),x}catch(w){return x!==f&&a?.(x,f),w instanceof dr||ve.error(w instanceof Error?w.message:i("sandbox.postBoard.moveFailed")),null}finally{l(w=>{const P=new Set(w);return P.delete(k),P})}},refuse:u,reasonText:g,isMoving:f=>c.has(Xs(f))}}function Xi(){return ro("hide_default_blog_blocks")}function Lp(t){const e=ce.c(15),{value:s,onChange:n,placeholder:a,className:i,onFocus:r,onBlur:c,onKeyDown:l,spellCheck:d,readOnly:u,inputRef:g}=t,m=d===void 0?!0:d;let f;e[0]!==n?(f=j=>n(j.target.value),e[0]=n,e[1]=f):f=e[1];let p;e[2]!==i?(p=we("w-full resize-none border-0 bg-transparent p-0 outline-none [field-sizing:content] placeholder:text-muted-foreground/50 focus:ring-0",i),e[2]=i,e[3]=p):p=e[3];let y;return e[4]!==g||e[5]!==c||e[6]!==r||e[7]!==l||e[8]!==a||e[9]!==u||e[10]!==m||e[11]!==f||e[12]!==p||e[13]!==s?(y=o.jsx("textarea",{ref:g,value:s,onChange:f,onInput:Ip,onFocus:r,onBlur:c,onKeyDown:l,placeholder:a,spellCheck:m,readOnly:u,rows:1,className:p}),e[4]=g,e[5]=c,e[6]=r,e[7]=l,e[8]=a,e[9]=u,e[10]=m,e[11]=f,e[12]=p,e[13]=s,e[14]=y):y=e[14],y}function Ip(t){const e=t.currentTarget;e.style.height="auto",e.style.height=`${e.scrollHeight}px`}function pt(t){return typeof t=="string"?t:""}function Rh(t){const e=ce.c(11);let s,n;e[0]!==t?({className:s,...n}=t,e[0]=t,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let a;e[3]!==s?(a=we(s,"pr-9"),e[3]=s,e[4]=a):a=e[4];let i;e[5]!==n||e[6]!==a?(i=o.jsx(Lp,{...n,className:a}),e[5]=n,e[6]=a,e[7]=i):i=e[7];let r;e[8]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(hr,{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]=r):r=e[8];let c;return e[9]!==i?(c=o.jsxs("div",{className:"group/editable relative -mx-2 rounded-md px-2 transition-colors hover:bg-accent focus-within:bg-muted/50",children:[i,r]}),e[9]=i,e[10]=c):c=e[10],c}function $h(t){const e=ce.c(5),{label:s,onClick:n,disabled:a}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(En,{size:13}),e[0]=i):i=e[0];let r;return e[1]!==a||e[2]!==s||e[3]!==n?(r=o.jsxs("button",{type:"button",onClick:n,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:[i,s]}),e[1]=a,e[2]=s,e[3]=n,e[4]=r):r=e[4],r}function Oh(t){const e=ce.c(4),{label:s,onClick:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(vo,{className:"size-3.25"}),e[0]=a):a=e[0];let i;return e[1]!==s||e[2]!==n?(i=o.jsx($e,{variant:"ghost-destructive",size:"icon-xs",type:"button","aria-label":s,onClick:n,className:"opacity-0 transition-opacity group-hover/item:opacity-100",children:a}),e[1]=s,e[2]=n,e[3]=i):i=e[3],i}function Lh(t){const e=ce.c(2),{children:s}=t;let n;return e[0]!==s?(n=o.jsx("div",{className:"absolute -top-9 left-0 z-10 flex items-center gap-0.5 rounded-md bg-popover p-0.5 shadow-soft",children:s}),e[0]=s,e[1]=n):n=e[1],n}function Ih(t){if(Array.isArray(t))return t;if(typeof t!="string"||t.trim()==="")return[];try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}function ia(t){const e=ce.c(14),{options:s,value:n,emptyLabel:a,onChange:i}=t;let r;e[0]!==a||e[1]!==i||e[2]!==n?(r=a&&o.jsx(la,{active:!n,onClick:()=>i(""),children:a}),e[0]=a,e[1]=i,e[2]=n,e[3]=r):r=e[3];let c;if(e[4]!==i||e[5]!==s||e[6]!==n){let d;e[8]!==i||e[9]!==n?(d=u=>o.jsx(la,{active:u===n,onClick:()=>i(u),children:u},u),e[8]=i,e[9]=n,e[10]=d):d=e[10],c=s.filter(Boolean).map(d),e[4]=i,e[5]=s,e[6]=n,e[7]=c}else c=e[7];let l;return e[11]!==r||e[12]!==c?(l=o.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[r,c]}),e[11]=r,e[12]=c,e[13]=l):l=e[13],l}function la(t){const e=ce.c(7),{active:s,onClick:n,children:a}=t,i=s?"border-primary bg-primary text-primary-foreground":"bg-card hover:bg-accent";let r;e[0]!==i?(r=we("cursor-pointer rounded-md border 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]!==s||e[3]!==a||e[4]!==n||e[5]!==r?(c=o.jsx("button",{type:"button","aria-pressed":s,onClick:n,className:r,children:a}),e[2]=s,e[3]=a,e[4]=n,e[5]=r,e[6]=c):c=e[6],c}function Kh(t,e=[]){return typeof t=="string"?t:JSON.stringify(t??e)}const ln=[{id:"campaign",label:"sandbox.generatePost.stepCampaign"},{id:"format",label:"sandbox.generatePost.stepFormat"},{id:"extra",label:"sandbox.generatePost.stepExtra"}],Kp=[1,2,3],Fp={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 zp({open:t,onOpenChange:e,decofile:s,hasAi:n,onGenerate:a}){const i=Pe(),r=zc(),[c,l]=K.useState("campaign"),[d,u]=K.useState(""),[g,m]=K.useState(""),[f,p]=K.useState(""),[y,j]=K.useState(""),[T,v]=K.useState(1),{merged:k}=Ii(s),C=fp(k),x=rp(s).filter(_=>_.status!=="finished"),w=x.find(_=>_.key===d),P=s[zi],S=rt(it(P?.formats)),A=()=>{l("campaign"),u(""),m(""),p(""),j(""),v(1)},$=_=>{e(_),_||A()},D=ln.findIndex(_=>_.id===c),z=c==="campaign"?!!w:c==="format"?g.trim().length>0&&f.trim().length>0:!0,L=c==="extra",b=()=>{w&&(a({campaign:w,format:{name:g.trim(),value:f.trim()},extraInstructions:y.trim()||void 0,count:T,fileConfigId:Kl(r.data?.configs??[],null,typeof window<"u"?window.localStorage.getItem(Fl):null)??void 0}),$(!1))};return o.jsx(Os,{open:t,onOpenChange:$,children:o.jsxs($s,{className:"flex max-h-[85vh] flex-col sm:max-w-2xl",children:[o.jsxs(tn,{children:[o.jsx(Rs,{children:i("sandbox.generatePost.title")}),o.jsx(ao,{children:i("sandbox.generatePost.subtitle")})]}),C.length>0?o.jsx("p",{className:"text-sm text-muted-foreground",children:i("sandbox.generatePost.blockedBrand",{fields:C.map(_=>i(Fp[_])).join(", ")})}):o.jsxs(o.Fragment,{children:[o.jsx("ol",{className:"flex shrink-0 items-center gap-1.5 text-xs",children:ln.map((_,I)=>o.jsx("li",{className:we("rounded-md px-2 py-1",I===D?"bg-primary text-primary-foreground":I<D?"text-foreground":"text-muted-foreground"),children:i(_.label)},_.id))}),o.jsxs("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto py-1",children:[c==="campaign"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.campaignHint")}),x.length===0?o.jsx("p",{className:"rounded-lg border border-dashed px-3 py-6 text-center text-sm text-muted-foreground",children:i("sandbox.generatePost.noCampaigns")}):o.jsx(Mp,{campaigns:x,chosen:d,onChoose:u})]}),c==="format"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.formatHint")}),o.jsx(ia,{options:S.map(_=>_.name),value:g,onChange:_=>{m(_),p(S.find(I=>I.name===_)?.value??"")}}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xs,{htmlFor:"generate-format-name",children:i("sandbox.generatePost.formatNameLabel")}),o.jsx(ws,{id:"generate-format-name",value:g,onChange:_=>m(_.target.value),placeholder:i("sandbox.generatePost.formatNamePlaceholder")})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xs,{htmlFor:"generate-format-value",children:i("sandbox.generatePost.formatValueLabel")}),o.jsx(Mo,{id:"generate-format-value",value:f,onChange:_=>p(_.target.value),placeholder:i("sandbox.generatePost.formatValuePlaceholder"),rows:4})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.formatBlocksHint")})]}),c==="extra"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(xs,{htmlFor:"generate-extra",children:i("sandbox.generatePost.extraLabel")}),o.jsx(Mo,{id:"generate-extra",value:y,onChange:_=>j(_.target.value),placeholder:i("sandbox.generatePost.extraPlaceholder"),rows:4})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(xs,{children:i("sandbox.generatePost.countLabel")}),o.jsx(ia,{options:Kp.map(String),value:String(T),onChange:_=>v(Number(_)||1)}),o.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.countHint")})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.coverHint")})]})]}),o.jsxs(sn,{className:"shrink-0 sm:justify-between",children:[o.jsx($e,{type:"button",variant:"outline",disabled:D===0,onClick:()=>l(ln[D-1].id),children:i("sandbox.generatePost.back")}),L?o.jsxs($e,{type:"button",disabled:!n,onClick:b,children:[o.jsx(hn,{size:14}),i("sandbox.generatePost.generate",{count:String(T)})]}):o.jsx($e,{type:"button",disabled:!z,onClick:()=>l(ln[D+1].id),children:i("sandbox.generatePost.next")})]})]})]})})}function Mp(t){const e=ce.c(11),{campaigns:s,chosen:n,onChoose:a}=t,i=Pe();let r;if(e[0]!==s||e[1]!==n||e[2]!==a||e[3]!==i){let l;e[5]!==n||e[6]!==a||e[7]!==i?(l=d=>o.jsx("li",{children:o.jsxs("button",{type:"button",onClick:()=>a(d.key),className:we("w-full cursor-pointer rounded-lg border bg-card p-2.5 text-left transition-colors hover:border-primary/40",n===d.key&&"border-primary"),children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("p",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:d.name||i("sandbox.campaigns.untitled")}),o.jsx(An,{variant:"outline",size:"sm",className:"shrink-0",children:d.intent.products.length>0?i("sandbox.generatePost.campaignProducts",{count:String(d.intent.products.length)}):i("sandbox.generatePost.campaignNoProducts")})]}),d.trigger.note&&o.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:d.trigger.note})]})},d.key),e[5]=n,e[6]=a,e[7]=i,e[8]=l):l=e[8],r=s.map(l),e[0]=s,e[1]=n,e[2]=a,e[3]=i,e[4]=r}else r=e[4];let c;return e[9]!==r?(c=o.jsx("ul",{className:"space-y-1.5",children:r}),e[9]=r,e[10]=c):c=e[10],c}function Vp(t){const e=[];for(let s=0;e.length<Qo;s+=1){const n=e.length;for(const a of t){const i=a.images?.[s];if(i&&(e.push(i),e.length>=Qo))return e}if(e.length===n)break}return e}const Up={"no-store-data":"sandbox.generatePost.gapNoStoreData","sections-dropped":"sandbox.generatePost.gapSectionsDropped","no-bucket":"sandbox.generatePost.gapNoBucket","no-image-model":"sandbox.generatePost.gapNoImageModel","images-failed":"sandbox.generatePost.gapImagesFailed","drafts-failed":"sandbox.generatePost.gapDraftsFailed"};function Gp({orgSlug:t,virtualMcpId:e,branch:s,decofile:n,meta:a,onStarted:i}){const r=Pe(),c=xl(),l=Xi(),d=Nn({orgSlug:t,virtualMcpId:e,branch:s});return async u=>{const g={campaignKey:u.campaign.key,format:u.format,brief:u.campaign.trigger.note},m=xn(Ti({title:u.campaign.name,planning:g,now:new Date}),"generating",new Date),f=Array.from({length:u.count},()=>yn(eo())),{merged:p}=Ii(n),y=tp(p),j=ht(n,"categories").map(({payload:S})=>({name:pt(S.name),slug:pt(S.slug)})).filter(S=>S.slug),T=Bu(n),v=Cp(u.format,a,n,{hideDefaults:l}),k=Object.fromEntries(v.map(S=>[S.name,S.example])),C=async(S,A=f.length)=>{for(const $ of f.slice(S,A))try{await d.mutateAsync({blockKey:$,data:ks($,xn(m,"draft",new Date))})}catch(D){console.warn("[generatePost] could not reset a card",D)}},x=async(S,A)=>{if(!A.fileConfigId||S.length===0)return new Map;try{const $=await c.call("BLOG_POST_ILLUSTRATE",{requests:S.map((D,z)=>({id:String(z),prompt:D.cover.prompt,alt:D.cover.alt})),productImages:Vp(A.campaign.intent.products),companyName:y.companyName??"",fileConfigId:A.fileConfigId});return new Map($.images.map(D=>[D.id,D.url]))}catch($){return console.warn("[generatePost] illustrating failed",$),new Map}};let w=0;try{for(const S of f)await d.mutateAsync({blockKey:S,data:ks(S,m)}),w+=1}catch(S){await C(0,w),ve.error(S instanceof Error?S.message:r("sandbox.generatePost.failed"));return}i?.(f);let P=0;try{const S=await c.call("BLOG_SITE_GROUND",{virtualMcpId:e,purpose:"post",focus:`${u.campaign.name}: ${u.campaign.trigger.note}`,language:y.language}).catch(L=>{console.warn("[generatePost] grounding failed",L)}),A=await c.call("BLOG_POST_DRAFT",{virtualMcpId:e,grounding:S?{report:S.report,outcome:S.outcome}:void 0,brand:{companyName:y.companyName,description:y.description,language:y.language,storeUrl:y.storeUrl,targetAudience:y.targetAudience,tone:y.tone,dos:y.dos,avoid:y.avoid,vocabulary:y.vocabulary,voiceExamples:y.voiceExamples},campaign:{name:u.campaign.name,period:u.campaign.period,trigger:u.campaign.trigger,intent:{objective:u.campaign.intent.objective,targets:u.campaign.intent.targets,products:u.campaign.intent.products,keywords:u.campaign.intent.keywords},guardrails:u.campaign.guardrails},format:u.format,blocks:v,categories:j,authors:T.map(({name:L,email:b})=>({name:L,email:b})),extraInstructions:u.extraInstructions?.trim()||void 0,count:u.count}),$=await x(A.posts,u),D=jo(a,{hideDefaults:l}),z=ji(n).map(L=>L.slug);for(const[L,b]of A.posts.entries()){const _=f[L];if(!_)break;const I=_p({draft:{...b,cover:{...b.cover,url:$.get(String(L))??""}},resolveTypes:D,productShapes:k,categories:j,authors:T,planning:g,takenSlugs:z,now:new Date});z.push(pt(I.slug)),await d.mutateAsync({blockKey:_,data:ks(_,I)}),P=L+1}await C(P),A.posts.length>0&&ve.success(r("sandbox.generatePost.done",{count:String(A.posts.length)}));for(const L of A.gaps)ve.warning(r(Up[L.code],{count:L.count??0}))}catch(S){await C(P),ve.error(S instanceof Error?S.message:r("sandbox.generatePost.failed"))}}}const Hp=/<(h[1-6]|p|ul|ol|div|img|br|blockquote|section|article|figure)\b|<\/[a-z]/i;function Co(t){return Hp.test(t)}function Yp(t){const e=t.trim();return e?Co(e)?tf(e):nf(e):{title:"",sections:[]}}function No(t){return t.replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/�?39;|'/gi,"'").replace(/&/gi,"&")}function Hs(t){let e=t,s;do s=e,e=e.replace(/<[^>]+>/g,"");while(e!==s);return No(e).replace(/\s+/g," ").trim()}function Wp(t){let e=t,s;do s=e,e=e.replace(/<!--[\s\S]*?-->/g,"");while(e!==s);return e}function qp(t){let e=t,s;do s=e,e=e.replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/gi,"");while(e!==s);return e}function Ji(t){let e=t,s;do s=e,e=qp(Wp(e));while(e!==s);return e}const Xp=/^(a|b|strong|i|em|u|s|code|br|span|sub|sup)$/;function Sn(t){let e="";for(const s of t)s.charCodeAt(0)>31&&(e+=s);return e=e.trim(),!/^[a-z][a-z0-9+.-]*:/i.test(e)||/^(https?|mailto|tel):/i.test(e)}function Jp(t){return t.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}const Qp=/^<\/?([a-z][a-z0-9]*)\b([^>]*)>/i;function Zp(t,e,s){const n=e.toLowerCase();if(!Xp.test(n))return"";if(t.startsWith("</"))return`</${n}>`;if(n!=="a")return`<${n}>`;const a=No(s.match(/href\s*=\s*"([^"]*)"/i)?.[1]??"");return Sn(a)&&a?`<a href="${Jp(a)}">`:"<a>"}function Qi(t){const e=Ji(t);let s="",n=0;for(;n<e.length;){const a=e.indexOf("<",n);if(a===-1){s+=e.slice(n);break}s+=e.slice(n,a);const i=Qp.exec(e.slice(a));if(!i){s+="<",n=a+1;continue}s+=Zp(i[0],i[1]??"",i[2]??""),n=a+i[0].length}return s}function rn(t,e){const s=t.match(new RegExp(`${e}\\s*=\\s*"([^"]*)"`,"i"));return s?.[1]?No(s[1]):""}const ef=/<(h[1-6]|p|ul|ol|blockquote|figure)\b[^>]*>([\s\S]*?)<\/\1\s*>|<hr\b[^>]*\/?>|<img\b[^>]*>/gi;function tf(t){const e=Ji(t);let s="";const n=[];for(const a of e.matchAll(ef)){const i=a[1]?.toLowerCase(),r=a[2]??"",c=a[0];if(!i){if(/^<img/i.test(c)){const l=rn(c,"src");l&&Sn(l)&&n.push({kind:"image",url:l,alt:rn(c,"alt"),caption:""})}else n.push({kind:"divider"});continue}if(/^h[1-6]$/.test(i)){const l=Hs(r);if(!l)continue;if(i==="h1"&&!s){s=l;continue}n.push({kind:"heading",text:l,level:i.slice(1)})}else if(i==="p"){const l=Qi(r.trim());Hs(l)&&n.push({kind:"paragraph",html:l})}else if(i==="ul"||i==="ol"){const l=[...r.matchAll(/<li\b[^>]*>([\s\S]*?)<\/li\s*>/gi)].map(d=>Hs(d[1]??"")).filter(Boolean);l.length&&n.push({kind:"list",items:l,ordered:i==="ol"})}else if(i==="blockquote"){const l=Hs(r);l&&n.push({kind:"quote",text:l})}else if(i==="figure"){const l=r.match(/<img\b[^>]*>/i)?.[0],d=l?rn(l,"src"):"",u=Hs(r.match(/<figcaption\b[^>]*>([\s\S]*?)<\/figcaption\s*>/i)?.[1]??"");d&&Sn(d)&&n.push({kind:"image",url:d,alt:l?rn(l,"alt"):"",caption:u})}}return{title:s,sections:n}}function sf(t){return t.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 nf(t){const e=t.replace(/\r\n?/g,`
|
|
23
|
-
`).split(`
|
|
24
|
-
`);let s="";const n=[];let a=[],i=null,r=[];const c=()=>{a.length&&(n.push({kind:"paragraph",html:Qi(sf(a.join(" ")))}),a=[])},l=()=>{i&&(n.push({kind:"list",items:i.items,ordered:i.ordered}),i=null)},d=()=>{r.length&&(n.push({kind:"quote",text:r.join(" ")}),r=[])},u=()=>{c(),l(),d()};for(const g of e){const m=g.trimEnd(),f=m.match(/^(#{1,6})\s+(.*)$/),p=m.match(/^!\[([^\]]*)\]\(([^)\s]+)\)\s*$/),y=m.match(/^\s*(?:[-*+]|\d+\.)\s+(.*)$/),j=/^\s*\d+\./.test(m),T=m.match(/^>\s?(.*)$/);if(!m.trim())u();else if(f){u();const v=f[2]?.trim()??"",k=String(f[1]?.length??1);k==="1"&&!s?s=v:v&&n.push({kind:"heading",text:v,level:k})}else if(/^(-{3,}|\*{3,}|_{3,})$/.test(m.trim()))u(),n.push({kind:"divider"});else if(p){u();const v=p[2]??"";Sn(v)&&n.push({kind:"image",url:v,alt:p[1]??"",caption:""})}else y?(c(),d(),i||(i={items:[],ordered:j}),i.items.push(y[1]?.trim()??"")):T?(c(),l(),r.push(T[1]?.trim()??"")):(l(),d(),a.push(m.trim()))}return u(),{title:s,sections:n}}const of={heading:"Heading",paragraph:"Paragraph",list:"List",quote:"Quote",divider:"Divider",image:"BlockImage"};function af(t,e){const s=[];for(const n of t){const a=e[of[n.kind]];if(a)switch(n.kind){case"heading":s.push({__resolveType:a,text:n.text,level:n.level});break;case"paragraph":s.push({__resolveType:a,html:n.html});break;case"list":s.push({__resolveType:a,items:n.items.join(`
|
|
25
|
-
`),style:n.ordered?"ordered":"unordered"});break;case"quote":s.push({__resolveType:a,quote:n.text});break;case"divider":s.push({__resolveType:a});break;case"image":s.push({__resolveType:a,url:n.url,alt:n.alt,caption:n.caption,size:"normal"});break}}return s}function lf({title:t,body:e,takenSlugs:s,now:n}){const a=t.trim();return{title:a,slug:a?Wi(a,s):Hi(""),date:n.toISOString().slice(0,10),excerpt:"",image:"",alt:"",authors:[],categories:[],...e,status:"in_review"}}const rf=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,cf=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,df=Mc.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||Hc(t,"background-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",Gc(this.options.HTMLAttributes,t),0]},renderMarkdown:(t,e)=>`==${e.renderChildren(t)}==`,parseMarkdown:(t,e)=>e.applyMark("highlight",e.parseInline(t.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:t=>t.indexOf("=="),tokenize(t,e,s){const n=/^(==)([^=]+)(==)/.exec(t);if(n){const a=n[2].trim(),i=s.inlineTokens(a);return{type:"highlight",raw:n[0],text:a,tokens:i}}}},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Uc({find:rf,type:this.type})]},addPasteRules(){return[Vc({find:cf,type:this.type})]}});var uf=df;function pf(){return[Yc.configure({link:{openOnClick:!1,HTMLAttributes:{target:null,rel:null}},trailingNode:!1}),Ul.configure({types:["heading","paragraph","codeBlock","image","bulletList","orderedList","blockquote"]}),zl,Ml,Vl,Jc.configure({inline:!0,allowBase64:!1}),uf.configure({multicolor:!0}),Qc.configure({table:{resizable:!1}})]}function Fh(t){const e=Aa(t);return e.toLowerCase().startsWith("data:")?"":e}function ff(t){return t==="<p></p>"?"":t}function Zi(t){return t.text??(t.content??[]).map(Zi).join("")}function el(t){if(t.type==="image"){const s=Aa(String(t.attrs?.src??""));return s?{...t,attrs:{...t.attrs,src:s}}:null}if(!t.content?.length)return t;const e=t.content.map(el).filter(s=>s!==null);return e.length||t.type==="doc"?{...t,content:e}:null}function mf(t,e){return el(qc(t,e))??{type:"doc"}}function gf(t){const e=t.trim();if(!e)return{title:"",content:""};const s=Co(e)?e:Xc.parse(e,{async:!1}),n=pf(),a=mf(s,n),i=a.content??[],r=i.findIndex(d=>d.type==="heading"&&d.attrs?.level===1),c=r>=0?Zi(i[r]).trim():"",l=i.filter((d,u)=>u!==r);return l.length===0?{title:c,content:""}:{title:c,content:ff(Wc({...a,content:l},n))}}const ra="__all__",ca={"date-desc":"sandbox.postToolbar.sortNewestFirst","date-asc":"sandbox.postToolbar.sortOldestFirst",az:"sandbox.postToolbar.sortTitleAZ",za:"sandbox.postToolbar.sortTitleZA"},hf={"date-desc":"sandbox.postToolbar.sortNewest","date-asc":"sandbox.postToolbar.sortOldest",az:"sandbox.postToolbar.sortAZ",za:"sandbox.postToolbar.sortZA"},da="status:";function ua(t){if(!t.startsWith(da))return null;const e=t.slice(da.length);return wo.includes(e)?e:null}const pa=K.forwardRef(function(e,s){const n=ce.c(20);let a,i,r,c,l;n[0]!==e?({icon:a,active:i,value:l,className:r,...c}=e,n[0]=e,n[1]=a,n[2]=i,n[3]=r,n[4]=c,n[5]=l):(a=n[1],i=n[2],r=n[3],c=n[4],l=n[5]);const d=i?"text-foreground":"text-muted-foreground";let u;n[6]!==r||n[7]!==d?(u=we("gap-1 px-1.5 text-xs",d,r),n[6]=r,n[7]=d,n[8]=u):u=n[8];let g;n[9]!==a?(g=o.jsx(a,{size:14,className:"shrink-0"}),n[9]=a,n[10]=g):g=n[10];let m;n[11]!==l?(m=l&&o.jsx("span",{className:"min-w-0 flex-1 truncate",children:l}),n[11]=l,n[12]=m):m=n[12];let f;n[13]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx(Qs,{size:12,className:"shrink-0 opacity-60"}),n[13]=f):f=n[13];let p;return n[14]!==c||n[15]!==s||n[16]!==u||n[17]!==g||n[18]!==m?(p=o.jsxs($e,{ref:s,type:"button",variant:"ghost",size:"sm",className:u,...c,children:[g,m,f]}),n[14]=c,n[15]=s,n[16]=u,n[17]=g,n[18]=m,n[19]=p):p=n[19],p});function To(t){const e=ce.c(2),{count:s}=t;let n;return e[0]!==s?(n=o.jsx("span",{className:"ml-auto pl-3 text-xs text-muted-foreground tabular-nums",children:s}),e[0]=s,e[1]=n):n=e[1],n}function xf(t){const e=ce.c(19),{value:s,onChange:n}=t,a=Pe();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(mo,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[0]=i):i=e[0];let r;e[1]!==n?(r=m=>n(m.target.value),e[1]=n,e[2]=r):r=e[2];let c;e[3]!==a?(c=a("sandbox.postToolbar.searchPlaceholder"),e[3]=a,e[4]=c):c=e[4];let l;e[5]!==a?(l=a("sandbox.postToolbar.searchAriaLabel"),e[5]=a,e[6]=l):l=e[6];let d;e[7]!==r||e[8]!==c||e[9]!==l||e[10]!==s?(d=o.jsx("input",{type:"text",value:s,onChange:r,placeholder:c,"aria-label":l,className:"min-w-0 flex-1 bg-transparent py-0.5 text-sm outline-none placeholder:text-muted-foreground"}),e[7]=r,e[8]=c,e[9]=l,e[10]=s,e[11]=d):d=e[11];let u;e[12]!==n||e[13]!==a||e[14]!==s?(u=s&&o.jsx(tl,{label:a("sandbox.postToolbar.clearSearch"),onClick:()=>n("")}),e[12]=n,e[13]=a,e[14]=s,e[15]=u):u=e[15];let g;return e[16]!==d||e[17]!==u?(g=o.jsxs("div",{className:"flex items-center gap-2 border-b px-2.5 py-1.5",children:[i,d,u]}),e[16]=d,e[17]=u,e[18]=g):g=e[18],g}function yf(t){const e=ce.c(100),{categories:s,authors:n,statusCounts:a,categoryFilter:i,authorFilter:r,statusFilter:c,sort:l,onCategoryFilterChange:d,onAuthorFilterChange:u,onStatusFilterChange:g,onSortChange:m}=t,f=Pe();let p;if(e[0]!==s||e[1]!==i){let Z;e[3]!==i?(Z=N=>N.slug===i,e[3]=i,e[4]=Z):Z=e[4],p=s.find(Z),e[0]=s,e[1]=i,e[2]=p}else p=e[2];const y=p;let j;if(e[5]!==r||e[6]!==n){let Z;e[8]!==r?(Z=N=>N.email===r,e[8]=r,e[9]=Z):Z=e[9],j=n.find(Z),e[5]=r,e[6]=n,e[7]=j}else j=e[7];const T=j,v=!!(i||r||c);let k;e[10]!==T?.name||e[11]!==y?.name||e[12]!==c||e[13]!==f?(k=y?.name??T?.name??f(c?jn[c]:"sandbox.postToolbar.filterLabel"),e[10]=T?.name,e[11]=y?.name,e[12]=c,e[13]=f,e[14]=k):k=e[14];const C=k,x=i?`cat:${i}`:r?`author:${r}`:c?`status:${c}`:ra;let w;e[15]!==u||e[16]!==d||e[17]!==g?(w=()=>{d(null),u(null),g(null)},e[15]=u,e[16]=d,e[17]=g,e[18]=w):w=e[18];const P=w;let S;e[19]!==P||e[20]!==u||e[21]!==d||e[22]!==g?(S=Z=>{Z.startsWith("cat:")?(u(null),g(null),d(Z.slice(4))):Z.startsWith("author:")?(d(null),g(null),u(Z.slice(7))):ua(Z)?(d(null),u(null),g(ua(Z))):P()},e[19]=P,e[20]=u,e[21]=d,e[22]=g,e[23]=S):S=e[23];const A=S;let $;e[24]!==C||e[25]!==v?($=o.jsx(un,{asChild:!0,children:o.jsx(pa,{icon:xr,active:v,value:C,className:"min-w-0 shrink"})}),e[24]=C,e[25]=v,e[26]=$):$=e[26];let D;e[27]!==f?(D=f("sandbox.postToolbar.filterBy"),e[27]=f,e[28]=D):D=e[28];let z;e[29]!==D?(z=o.jsx(Ms,{children:D}),e[29]=D,e[30]=z):z=e[30];let L;e[31]!==f?(L=f("sandbox.postToolbar.allPosts"),e[31]=f,e[32]=L):L=e[32];let b;e[33]!==L?(b=o.jsx(Ws,{value:ra,children:L}),e[33]=L,e[34]=b):b=e[34];let _;e[35]!==f?(_=f("sandbox.postToolbar.statusLabel"),e[35]=f,e[36]=_):_=e[36];let I;e[37]!==_?(I=o.jsx(Ms,{className:"text-muted-foreground/70",children:_}),e[37]=_,e[38]=I):I=e[38];let M;e[39]!==a||e[40]!==f?(M=wo.map(Z=>o.jsxs(Ws,{value:`status:${Z}`,children:[o.jsx("span",{className:"min-w-0 flex-1 truncate",children:f(jn[Z])}),o.jsx(To,{count:a[Z]??0})]},`status:${Z}`)),e[39]=a,e[40]=f,e[41]=M):M=e[41];let X;e[42]!==s.length||e[43]!==f?(X=s.length>0&&o.jsx(Ms,{className:"text-muted-foreground/70",children:f("sandbox.postToolbar.categoryLabel")}),e[42]=s.length,e[43]=f,e[44]=X):X=e[44];let Q;e[45]!==s?(Q=s.map(vf),e[45]=s,e[46]=Q):Q=e[46];let J;e[47]!==n.length||e[48]!==f?(J=n.length>0&&o.jsx(Ms,{className:"text-muted-foreground/70",children:f("sandbox.postToolbar.authorLabel")}),e[47]=n.length,e[48]=f,e[49]=J):J=e[49];let H;e[50]!==n?(H=n.map(bf),e[50]=n,e[51]=H):H=e[51];let W;e[52]!==x||e[53]!==A||e[54]!==b||e[55]!==I||e[56]!==M||e[57]!==X||e[58]!==Q||e[59]!==J||e[60]!==H?(W=o.jsxs(Bo,{value:x,onValueChange:A,children:[b,I,M,X,Q,J,H]}),e[52]=x,e[53]=A,e[54]=b,e[55]=I,e[56]=M,e[57]=X,e[58]=Q,e[59]=J,e[60]=H,e[61]=W):W=e[61];let O;e[62]!==W||e[63]!==z?(O=o.jsxs(pn,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[z,W]}),e[62]=W,e[63]=z,e[64]=O):O=e[64];let E;e[65]!==O||e[66]!==$?(E=o.jsxs(fn,{children:[$,O]}),e[65]=O,e[66]=$,e[67]=E):E=e[67];let te;e[68]!==P||e[69]!==v||e[70]!==f?(te=v&&o.jsx(tl,{label:f("sandbox.postToolbar.clearFilter"),onClick:P}),e[68]=P,e[69]=v,e[70]=f,e[71]=te):te=e[71];const ue=hf[l];let B;e[72]!==f||e[73]!==ue?(B=f(ue),e[72]=f,e[73]=ue,e[74]=B):B=e[74];let G;e[75]!==B?(G=o.jsx(un,{asChild:!0,children:o.jsx(pa,{icon:yr,active:!0,value:B})}),e[75]=B,e[76]=G):G=e[76];let me;e[77]!==f?(me=f("sandbox.postToolbar.sortBy"),e[77]=f,e[78]=me):me=e[78];let pe;e[79]!==me?(pe=o.jsx(Ms,{children:me}),e[79]=me,e[80]=pe):pe=e[80];let xe;e[81]!==m?(xe=Z=>m(Z),e[81]=m,e[82]=xe):xe=e[82];let ge;e[83]===Symbol.for("react.memo_cache_sentinel")?(ge=Object.keys(ca),e[83]=ge):ge=e[83];let ne;e[84]!==f?(ne=ge.map(Z=>o.jsx(Ws,{value:Z,children:f(ca[Z])},Z)),e[84]=f,e[85]=ne):ne=e[85];let ye;e[86]!==l||e[87]!==xe||e[88]!==ne?(ye=o.jsx(Bo,{value:l,onValueChange:xe,children:ne}),e[86]=l,e[87]=xe,e[88]=ne,e[89]=ye):ye=e[89];let se;e[90]!==pe||e[91]!==ye?(se=o.jsxs(pn,{align:"end",className:"w-44",children:[pe,ye]}),e[90]=pe,e[91]=ye,e[92]=se):se=e[92];let re;e[93]!==G||e[94]!==se?(re=o.jsx("div",{className:"ml-auto shrink-0",children:o.jsxs(fn,{children:[G,se]})}),e[93]=G,e[94]=se,e[95]=re):re=e[95];let de;return e[96]!==E||e[97]!==te||e[98]!==re?(de=o.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[E,te,re]}),e[96]=E,e[97]=te,e[98]=re,e[99]=de):de=e[99],de}function bf(t){return o.jsxs(Ws,{value:`author:${t.email}`,children:[o.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),o.jsx(To,{count:t.count})]},`author:${t.email}`)}function vf(t){return o.jsxs(Ws,{value:`cat:${t.slug}`,children:[o.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),o.jsx(To,{count:t.count})]},`cat:${t.slug}`)}function tl(t){const e=ce.c(4),{label:s,onClick:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx(io,{size:12}),e[0]=a):a=e[0];let i;return e[1]!==s||e[2]!==n?(i=o.jsx("button",{type:"button","aria-label":s,onClick:n,className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:bg-accent hover:text-foreground cursor-pointer rounded-lg",children:a}),e[1]=s,e[2]=n,e[3]=i):i=e[3],i}function kf(t){const e=ce.c(18),{checked:s,disabled:n,onToggle:a}=t,i=Pe();let r;e[0]!==a?(r=()=>a(),e[0]=a,e[1]=r):r=e[1];let c;e[2]!==s||e[3]!==i?(c=i(s?"sandbox.postToolbar.deselectAllPosts":"sandbox.postToolbar.selectAllPosts"),e[2]=s,e[3]=i,e[4]=c):c=e[4];let l;e[5]!==s||e[6]!==n||e[7]!==r||e[8]!==c?(l=o.jsx(Tt,{asChild:!0,children:o.jsx("span",{className:"flex shrink-0 items-center px-1.5",onClick:wf,children:o.jsx(Pn,{checked:s,disabled:n,onCheckedChange:r,"aria-label":c})})}),e[5]=s,e[6]=n,e[7]=r,e[8]=c,e[9]=l):l=e[9];let d;e[10]!==s||e[11]!==i?(d=i(s?"sandbox.postToolbar.deselectAll":"sandbox.postToolbar.selectAll"),e[10]=s,e[11]=i,e[12]=d):d=e[12];let u;e[13]!==d?(u=o.jsx(Et,{side:"bottom",children:d}),e[13]=d,e[14]=u):u=e[14];let g;return e[15]!==l||e[16]!==u?(g=o.jsxs(Pt,{children:[l,u]}),e[15]=l,e[16]=u,e[17]=g):g=e[17],g}function wf(t){return t.stopPropagation()}function jf(t){const e=ce.c(42),{count:s,allSelected:n,onToggleSelectAll:a,onArchive:i,onExit:r}=t,c=Pe();let l;e[0]!==n||e[1]!==a?(l=o.jsx(kf,{checked:n,onToggle:a}),e[0]=n,e[1]=a,e[2]=l):l=e[2];let d;e[3]!==s||e[4]!==c?(d=c("sandbox.postToolbar.itemsSelected",{count:s}),e[3]=s,e[4]=c,e[5]=d):d=e[5];let u;e[6]!==d?(u=o.jsx("span",{className:"text-xs font-medium tabular-nums",children:d}),e[6]=d,e[7]=u):u=e[7];const g=s===0;let m;e[8]!==c?(m=c("sandbox.postToolbar.archiveSelectedPosts"),e[8]=c,e[9]=m):m=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx(yl,{size:14}),e[10]=f):f=e[10];let p;e[11]!==i||e[12]!==g||e[13]!==m?(p=o.jsx(Tt,{asChild:!0,children:o.jsx($e,{type:"button",variant:"ghost",size:"icon-sm",disabled:g,onClick:i,"aria-label":m,children:f})}),e[11]=i,e[12]=g,e[13]=m,e[14]=p):p=e[14];let y;e[15]!==c?(y=c("sandbox.postToolbar.archiveSelected"),e[15]=c,e[16]=y):y=e[16];let j;e[17]!==y?(j=o.jsx(Et,{side:"bottom",children:y}),e[17]=y,e[18]=j):j=e[18];let T;e[19]!==p||e[20]!==j?(T=o.jsxs(Pt,{children:[p,j]}),e[19]=p,e[20]=j,e[21]=T):T=e[21];let v;e[22]!==c?(v=c("sandbox.postToolbar.exitSelection"),e[22]=c,e[23]=v):v=e[23];let k;e[24]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(io,{size:14}),e[24]=k):k=e[24];let C;e[25]!==r||e[26]!==v?(C=o.jsx(Tt,{asChild:!0,children:o.jsx($e,{type:"button",variant:"ghost",size:"icon-sm",onClick:r,"aria-label":v,children:k})}),e[25]=r,e[26]=v,e[27]=C):C=e[27];let x;e[28]!==c?(x=c("sandbox.postToolbar.exitSelection"),e[28]=c,e[29]=x):x=e[29];let w;e[30]!==x?(w=o.jsx(Et,{side:"bottom",children:x}),e[30]=x,e[31]=w):w=e[31];let P;e[32]!==C||e[33]!==w?(P=o.jsxs(Pt,{children:[C,w]}),e[32]=C,e[33]=w,e[34]=P):P=e[34];let S;e[35]!==T||e[36]!==P?(S=o.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[T,P]}),e[35]=T,e[36]=P,e[37]=S):S=e[37];let A;return e[38]!==l||e[39]!==S||e[40]!==u?(A=o.jsxs("div",{className:"flex items-center gap-0.5 border-b bg-accent/40 px-2 py-1.5",children:[l,u,S]}),e[38]=l,e[39]=S,e[40]=u,e[41]=A):A=e[41],A}const Sf={draft:"outline",generating:"secondary",awaiting_review:"warning",scheduled:"secondary",published:"success",archived:"outline"},no="generating",Cf=[no,...wo.filter(t=>t!==no)],fa=t=>t.scheduledDatetime||t.date||"",Nf=(t,e)=>fa(e).localeCompare(fa(t)),Tf=t=>t==="scheduled"||t==="published",sl="application/x-post-key";function Ef(t){const e=ce.c(170),{orgSlug:s,virtualMcpId:n,branch:a,decofile:i,view:r,selectedKey:c,onViewChange:l,onOpen:d,onClose:u,move:g,meta:m,renderDetail:f}=t,p=Pe();let y;e[0]!==a||e[1]!==s||e[2]!==n?(y={orgSlug:s,virtualMcpId:n,branch:a},e[0]=a,e[1]=s,e[2]=n,e[3]=y):y=e[3];const j=Nn(y),T=Fc().length>0,v=ni(),k=Xi(),C=oi(n),x=v&&!C,[w,P]=K.useState(null),[S,A]=K.useState(!1),[$,D]=K.useState(!1),[z,L]=K.useState(!1),[b,_]=K.useState(""),I=K.useRef(null);let M;e[4]===Symbol.for("react.memo_cache_sentinel")?(M={},e[4]=M):M=e[4];const[X,Q]=K.useState(M);let J;e[5]!==X?(J=(Y,le)=>X[Y]??le,e[5]=X,e[6]=J):J=e[6];const H=J;let W;e[7]===Symbol.for("react.memo_cache_sentinel")?(W=(Y,le)=>Q(Oe=>({...Oe,[Y]:le})),e[7]=W):W=e[7];const O=W;let E;e[8]!==d?(E=Y=>{const le=Y[0];le&&d(le)},e[8]=d,e[9]=E):E=e[9];let te;e[10]!==a||e[11]!==i||e[12]!==m||e[13]!==s||e[14]!==E||e[15]!==n?(te={orgSlug:s,virtualMcpId:n,branch:a,decofile:i,meta:m,onStarted:E},e[10]=a,e[11]=i,e[12]=m,e[13]=s,e[14]=E,e[15]=n,e[16]=te):te=e[16];const ue=Gp(te),B=Fu(i);let G;e[17]!==i?(G=Y=>vs(i[Y],"posts"),e[17]=i,e[18]=G):G=e[18];const me=G,pe=c&&B.some(Y=>Y.key===c)?c:B[0]?.key??null;let xe;e[19]!==g||e[20]!==p?(xe=async Y=>{await g.apply(Y.key,"archived")&&ve.success(p("sandbox.postBoard.archived"))},e[19]=g,e[20]=p,e[21]=xe):xe=e[21];const ge=xe,[ne,ye]=K.useState(null),[se,re]=K.useState(null),[de,Z]=K.useState(null),[N,oe]=K.useState("date-desc"),[fe,je]=K.useState("");let Se;e[22]===Symbol.for("react.memo_cache_sentinel")?(Se=new Set,e[22]=Se):Se=e[22];const[Ce,Ae]=K.useState(Se),_e=B.reduce(Df,{}),q=Y=>{const le=new Map;for(const Oe of B)for(const Ct of Y(Oe))le.set(Ct,(le.get(Ct)??0)+1);return le},ie=q(Bf),ke=q(_f),he=ht(i,"categories").map(Y=>{const{payload:le}=Y;return{slug:pt(le.slug),name:pt(le.name)||pt(le.slug),count:ie.get(pt(le.slug))??0}}),Ke=ht(i,"authors").map(Y=>{const{payload:le}=Y;return{email:pt(le.email),name:pt(le.name)||pt(le.email),count:ke.get(pt(le.email))??0}}),Me=fe.trim().toLowerCase();let Ge;e[23]!==ne?(Ge=Y=>!ne||Y.categorySlugs.includes(ne),e[23]=ne,e[24]=Ge):Ge=e[24];let tt;e[25]!==se?(tt=Y=>!se||Y.authorEmails.includes(se),e[25]=se,e[26]=tt):tt=e[26];let We;e[27]!==de?(We=Y=>!de||Y.status===de,e[27]=de,e[28]=We):We=e[28];let qe;e[29]!==N?(qe=(Y,le)=>{if(N==="az")return Y.title.localeCompare(le.title);if(N==="za")return le.title.localeCompare(Y.title);const Oe=(Y.scheduledDatetime||Y.date).localeCompare(le.scheduledDatetime||le.date);return N==="date-asc"?Oe:-Oe},e[29]=N,e[30]=qe):qe=e[30];const Xe=B.filter(Ge).filter(tt).filter(We).filter(Y=>!Me||Y.title.toLowerCase().includes(Me)||Y.slug.toLowerCase().includes(Me)).sort(qe),Fe=Ce.size>0;let st;e[31]===Symbol.for("react.memo_cache_sentinel")?(st=Y=>Ae(le=>{const Oe=new Set(le);return Oe.delete(Y)||Oe.add(Y),Oe}),e[31]=st):st=e[31];const yt=st,Te=()=>Ae(Y=>Xe.every(le=>Y.has(le.key))?new Set:new Set(Xe.map(Af)));let V;e[32]!==g||e[33]!==Ce||e[34]!==p?(V=async()=>{let Y=0;for(const le of Ce)await g.apply(le,"archived")&&(Y=Y+1);Ae(new Set),Y>0&&ve.success(p("sandbox.postBoard.archived"))},e[32]=g,e[33]=Ce,e[34]=p,e[35]=V):V=e[35];const Be=V;let Ne;e[36]!==g?(Ne=(Y,le)=>{P(null),g.apply(le,Y)},e[36]=g,e[37]=Ne):Ne=e[37];const Re=Ne;let Ue;e[38]!==C||e[39]!==d||e[40]!==j?(Ue=()=>{const Y=yn(eo()),le=Ti({title:"",now:new Date,legacyContent:C});j.mutate({blockKey:Y,data:ks(Y,le)}),d(Y)},e[38]=C,e[39]=d,e[40]=j,e[41]=Ue):Ue=e[41];const dt=Ue;let bt;e[42]!==k||e[43]!==C||e[44]!==m?(bt=Y=>{if(C){const{title:Ct,content:Ie}=gf(Y);return Ie||Ct.trim()?{title:Ct,body:{content:Ie}}:null}const le=Yp(Y),Oe=af(le.sections,jo(m,{hideDefaults:k}));return Oe.length>0||le.title.trim()?{title:le.title,body:{sections:Oe}}:null},e[42]=k,e[43]=C,e[44]=m,e[45]=bt):bt=e[45];const In=bt,Ks=()=>{const Y=In(b);if(!Y){ve.error(p("sandbox.postBoard.importEmpty"));return}const le=yn(eo()),Oe=lf({...Y,takenSlugs:B.map(Pf).filter(Boolean),now:new Date});j.mutate({blockKey:le,data:ks(le,Oe)}),L(!1),_(""),ve.success(p("sandbox.postBoard.imported")),d(le)},Fs=r==="list";let vt;e[46]!==l?(vt=()=>l("list"),e[46]=l,e[47]=vt):vt=e[47];let Je;e[48]===Symbol.for("react.memo_cache_sentinel")?(Je=o.jsx(Cr,{size:14}),e[48]=Je):Je=e[48];let kt;e[49]!==p?(kt=p("sandbox.postBoard.viewList"),e[49]=p,e[50]=kt):kt=e[50];let Le;e[51]!==Fs||e[52]!==vt||e[53]!==kt?(Le=o.jsx(ma,{active:Fs,onClick:vt,icon:Je,label:kt}),e[51]=Fs,e[52]=vt,e[53]=kt,e[54]=Le):Le=e[54];const Qe=r==="board";let At;e[55]!==l?(At=()=>l("board"),e[55]=l,e[56]=At):At=e[56];let Ss;e[57]===Symbol.for("react.memo_cache_sentinel")?(Ss=o.jsx(br,{size:14}),e[57]=Ss):Ss=e[57];let _t;e[58]!==p?(_t=p("sandbox.postBoard.viewBoard"),e[58]=p,e[59]=_t):_t=e[59];let Bt;e[60]!==Qe||e[61]!==At||e[62]!==_t?(Bt=o.jsx(ma,{active:Qe,onClick:At,icon:Ss,label:_t}),e[60]=Qe,e[61]=At,e[62]=_t,e[63]=Bt):Bt=e[63];let cs;e[64]!==Le||e[65]!==Bt?(cs=o.jsx("div",{className:"flex items-center gap-3",children:o.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",children:[Le,Bt]})}),e[64]=Le,e[65]=Bt,e[66]=cs):cs=e[66];let Dt;e[67]===Symbol.for("react.memo_cache_sentinel")?(Dt=o.jsx(En,{size:14}),e[67]=Dt):Dt=e[67];let Rt;e[68]!==p?(Rt=p("sandbox.postBoard.newPost"),e[68]=p,e[69]=Rt):Rt=e[69];let ds;e[70]===Symbol.for("react.memo_cache_sentinel")?(ds=o.jsx(Qs,{size:14}),e[70]=ds):ds=e[70];let nt;e[71]!==Rt?(nt=o.jsx(un,{asChild:!0,children:o.jsxs($e,{type:"button",size:"sm",children:[Dt,Rt,ds]})}),e[71]=Rt,e[72]=nt):nt=e[72];let $t;e[73]!==x||e[74]!==p?($t=x&&o.jsxs(Ht,{onClick:()=>D(!0),children:[o.jsx(hn,{size:14}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{children:p("sandbox.postBoard.newPostGenerate")}),o.jsx("span",{className:"text-xs text-muted-foreground",children:p("sandbox.postBoard.newPostGenerateHint")})]})]}),e[73]=x,e[74]=p,e[75]=$t):$t=e[75];let Ot;e[76]===Symbol.for("react.memo_cache_sentinel")?(Ot=o.jsx(Sr,{size:14}),e[76]=Ot):Ot=e[76];let Xt;e[77]!==p?(Xt=p("sandbox.postBoard.newPostWrite"),e[77]=p,e[78]=Xt):Xt=e[78];let lt;e[79]!==Xt?(lt=o.jsx("span",{children:Xt}),e[79]=Xt,e[80]=lt):lt=e[80];let ot;e[81]!==p?(ot=p("sandbox.postBoard.newPostWriteHint"),e[81]=p,e[82]=ot):ot=e[82];let Lt;e[83]!==ot?(Lt=o.jsx("span",{className:"text-xs text-muted-foreground",children:ot}),e[83]=ot,e[84]=Lt):Lt=e[84];let Jt;e[85]!==lt||e[86]!==Lt?(Jt=o.jsxs("div",{className:"flex flex-col",children:[lt,Lt]}),e[85]=lt,e[86]=Lt,e[87]=Jt):Jt=e[87];let It;e[88]!==Jt||e[89]!==dt?(It=o.jsxs(Ht,{onClick:dt,children:[Ot,Jt]}),e[88]=Jt,e[89]=dt,e[90]=It):It=e[90];let Qt,Cs;e[91]===Symbol.for("react.memo_cache_sentinel")?(Qt=()=>L(!0),Cs=o.jsx(Vn,{size:14}),e[91]=Qt,e[92]=Cs):(Qt=e[91],Cs=e[92]);let Zt;e[93]!==p?(Zt=p("sandbox.postBoard.importContent"),e[93]=p,e[94]=Zt):Zt=e[94];let Kt;e[95]!==Zt?(Kt=o.jsx("span",{children:Zt}),e[95]=Zt,e[96]=Kt):Kt=e[96];let es;e[97]!==p?(es=p("sandbox.postBoard.importContentHint"),e[97]=p,e[98]=es):es=e[98];let ts;e[99]!==es?(ts=o.jsx("span",{className:"text-xs text-muted-foreground",children:es}),e[99]=es,e[100]=ts):ts=e[100];let Ve;e[101]!==Kt||e[102]!==ts?(Ve=o.jsxs(Ht,{onClick:Qt,children:[Cs,o.jsxs("div",{className:"flex flex-col",children:[Kt,ts]})]}),e[101]=Kt,e[102]=ts,e[103]=Ve):Ve=e[103];let Ft;e[104]!==$t||e[105]!==It||e[106]!==Ve?(Ft=o.jsxs(pn,{align:"end",className:"w-56",children:[$t,It,Ve]}),e[104]=$t,e[105]=It,e[106]=Ve,e[107]=Ft):Ft=e[107];let us;e[108]!==nt||e[109]!==Ft?(us=o.jsxs(fn,{children:[nt,Ft]}),e[108]=nt,e[109]=Ft,e[110]=us):us=e[110];let zt;e[111]!==x||e[112]!==i||e[113]!==$||e[114]!==ue||e[115]!==T?(zt=x&&o.jsx(zp,{open:$,onOpenChange:D,decofile:i,hasAi:T,onGenerate:Y=>{ue(Y)}}),e[111]=x,e[112]=i,e[113]=$,e[114]=ue,e[115]=T,e[116]=zt):zt=e[116];let Mt;e[117]!==p?(Mt=p("sandbox.postBoard.importTitle"),e[117]=p,e[118]=Mt):Mt=e[118];let He;e[119]!==Mt?(He=o.jsx(Rs,{children:Mt}),e[119]=Mt,e[120]=He):He=e[120];let wt;e[121]!==p?(wt=p("sandbox.postBoard.importDescription"),e[121]=p,e[122]=wt):wt=e[122];let ut;e[123]!==wt?(ut=o.jsx(ao,{children:wt}),e[123]=wt,e[124]=ut):ut=e[124];let Vt;e[125]!==He||e[126]!==ut?(Vt=o.jsxs(tn,{children:[He,ut]}),e[125]=He,e[126]=ut,e[127]=Vt):Vt=e[127];const jt=Co(b)?"html":"markdown";let Ns;e[128]===Symbol.for("react.memo_cache_sentinel")?(Ns=Y=>_(Y??""),e[128]=Ns):Ns=e[128];let St;e[129]!==b||e[130]!==jt?(St=o.jsx("div",{className:"h-72 overflow-hidden rounded-[var(--studio-control-radius,var(--radius-xl))] border bg-[var(--studio-input-background)]",children:o.jsx(si,{code:b,language:jt,height:"100%",autoFocus:!0,onChange:Ns})}),e[129]=b,e[130]=jt,e[131]=St):St=e[131];let ps;e[132]===Symbol.for("react.memo_cache_sentinel")?(ps=o.jsx("input",{ref:I,type:"file",accept:".html,.htm,.md,.markdown,.txt",className:"hidden",onChange:async Y=>{const le=Y.target.files?.[0];le&&_(await le.text()),Y.target.value=""}}),e[132]=ps):ps=e[132];let Ts,fs;e[133]===Symbol.for("react.memo_cache_sentinel")?(Ts=()=>I.current?.click(),fs=o.jsx(Vn,{size:14}),e[133]=Ts,e[134]=fs):(Ts=e[133],fs=e[134]);let ss;e[135]!==p?(ss=p("sandbox.postBoard.importUpload"),e[135]=p,e[136]=ss):ss=e[136];let ns;e[137]!==ss?(ns=o.jsxs($e,{type:"button",variant:"outline",size:"sm",onClick:Ts,children:[fs,ss]}),e[137]=ss,e[138]=ns):ns=e[138];let ms;e[139]!==St||e[140]!==ns?(ms=o.jsxs("div",{className:"space-y-3",children:[St,ps,ns]}),e[139]=St,e[140]=ns,e[141]=ms):ms=e[141];let gs;e[142]!==b?(gs=b.trim(),e[142]=b,e[143]=gs):gs=e[143];let hs;e[144]===Symbol.for("react.memo_cache_sentinel")?(hs=o.jsx(Vn,{size:14}),e[144]=hs):hs=e[144];let Es;e[145]!==p?(Es=p("sandbox.postBoard.importRun"),e[145]=p,e[146]=Es):Es=e[146];let Ps;e[147]!==S||e[148]!==u||e[149]!==f||e[150]!==c||e[151]!==r?(Ps=r==="board"&&c&&S&&f&&o.jsx("div",{className:"absolute inset-0 z-30 flex flex-col bg-background",children:f(c,{expanded:!0,onToggleExpand:()=>A(!1),onClose:()=>{A(!1),u?.()}})}),e[147]=S,e[148]=u,e[149]=f,e[150]=c,e[151]=r,e[152]=Ps):Ps=e[152];const zs=r==="board"&&!!c&&!S;let os;e[153]!==u?(os=Y=>{Y||(A(!1),u?.())},e[153]=u,e[154]=os):os=e[154];let as;e[155]!==p?(as=p("sandbox.collectionsSidebar.posts"),e[155]=p,e[156]=as):as=e[156];let is;e[157]!==as?(is=o.jsx(Rs,{className:"sr-only",children:as}),e[157]=as,e[158]=is):is=e[158];let Ut;e[159]!==u||e[160]!==f||e[161]!==c?(Ut=c&&f?o.jsx(K.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Jn,{size:20,className:"animate-spin text-muted-foreground"})}),children:f(c,{expanded:!1,onToggleExpand:()=>A(!0),onClose:()=>u?.()})}):null,e[159]=u,e[160]=f,e[161]=c,e[162]=Ut):Ut=e[162];let ls;e[163]!==is||e[164]!==Ut?(ls=o.jsxs($s,{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:[is,Ut]}),e[163]=is,e[164]=Ut,e[165]=ls):ls=e[165];let As;return e[166]!==zs||e[167]!==os||e[168]!==ls?(As=o.jsx(Os,{open:zs,onOpenChange:os,children:ls}),e[166]=zs,e[167]=os,e[168]=ls,e[169]=As):As=e[169],o.jsxs("div",{className:"relative flex h-full min-w-0 flex-col",children:[o.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b px-6 py-3",children:[cs,o.jsxs("div",{className:"flex items-center gap-2",children:[us,zt,o.jsx(Os,{open:z,onOpenChange:L,children:o.jsxs($s,{className:"max-h-[85vh] sm:max-w-2xl",children:[Vt,ms,o.jsx(sn,{children:o.jsxs($e,{type:"button",disabled:!gs,onClick:Ks,children:[hs,Es]})})]})})]})]}),B.length===0?o.jsx(Kc,{className:"flex-1",icon:o.jsx(hn,{size:22}),title:p("sandbox.postBoard.emptyTitle"),description:p("sandbox.postBoard.emptyDescription"),buttonProps:{children:p("sandbox.postBoard.newPost"),onClick:dt}}):r==="board"?o.jsx("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto p-4",children:Cf.map(Y=>{const le=p(jn[Y]),Oe=B.filter(Ie=>Ie.status===Y);Tf(Y)&&Oe.sort(Nf);const Ct=H(Y,Oe.length===0);return o.jsxs(K.Fragment,{children:[o.jsx("div",{onDragOver:Ie=>{Ie.preventDefault(),P(Y)},onDragLeave:()=>P(Ie=>Ie===Y?null:Ie),onDrop:Ie=>{Ie.preventDefault(),Re(Y,Ie.dataTransfer.getData(sl))},className:we("flex shrink-0 flex-col rounded-xl border bg-muted/30 transition-colors",Ct?"w-11":"w-72",w===Y&&"border-primary bg-primary/5"),children:Ct?o.jsxs("button",{type:"button",onClick:()=>O(Y,!1),"aria-label":p("sandbox.postBoard.expandLane",{lane:le}),"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:[o.jsx(mn,{size:14,className:"shrink-0"}),o.jsx("span",{className:"text-xs tabular-nums",children:Oe.length}),o.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:le})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",children:[o.jsxs("button",{type:"button",onClick:()=>O(Y,!0),"aria-label":p("sandbox.postBoard.collapseLane",{lane:le}),"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[o.jsx(Qs,{size:14,className:"shrink-0"}),o.jsx("span",{className:"truncate",children:le})]}),o.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:Oe.length})]}),o.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-2 pb-2",children:Oe.length===0?o.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:p("sandbox.postBoard.laneEmpty")}):Oe.map(Ie=>o.jsx(Of,{post:Ie,payload:me(Ie.key),moving:g.isMoving(Ie.key),onOpen:()=>d(Ie.key),onArchive:Ie.status==="archived"?void 0:()=>{ge(Ie)}},Ie.key))})]})}),Y===no&&o.jsx("div",{"aria-hidden":!0,className:"my-1 w-px shrink-0 self-stretch bg-border"})]},Y)})}):o.jsxs("div",{className:"flex min-h-0 flex-1",children:[o.jsxs("div",{className:"flex w-80 shrink-0 flex-col border-r",children:[o.jsx(xf,{value:fe,onChange:je}),Fe?o.jsx(jf,{count:Ce.size,allSelected:Xe.length>0&&Xe.every(Y=>Ce.has(Y.key)),onToggleSelectAll:Te,onArchive:()=>{Be()},onExit:()=>Ae(new Set)}):o.jsx(yf,{categories:he,authors:Ke,statusCounts:_e,categoryFilter:ne,authorFilter:se,statusFilter:de,sort:N,onCategoryFilterChange:ye,onAuthorFilterChange:re,onStatusFilterChange:Z,onSortChange:oe}),o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:o.jsx(Rf,{posts:Xe,selectedKey:pe,selectionActive:Fe,selectedKeys:Ce,onToggleSelect:yt,onOpen:d,isMoving:g.isMoving,onArchive:Y=>{ge(Y)}})})]}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:pe&&f?o.jsx(K.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Jn,{size:20,className:"animate-spin text-muted-foreground"})}),children:f(pe)}):o.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:p("sandbox.postBoard.selectPrompt")})})]}),Ps,As]})}function Pf(t){return t.slug}function Af(t){return t.key}function _f(t){return t.authorEmails}function Bf(t){return t.categorySlugs}function Df(t,e){return t[e.status]=(t[e.status]??0)+1,t}function ma(t){const e=ce.c(7),{active:s,onClick:n,icon:a,label:i}=t,r=s?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground";let c;e[0]!==r?(c=we("inline-flex cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",r),e[0]=r,e[1]=c):c=e[1];let l;return e[2]!==a||e[3]!==i||e[4]!==n||e[5]!==c?(l=o.jsxs("button",{type:"button",onClick:n,className:c,children:[a,i]}),e[2]=a,e[3]=i,e[4]=n,e[5]=c,e[6]=l):l=e[6],l}function Rf(t){const e=ce.c(23),{posts:s,selectedKey:n,selectionActive:a,selectedKeys:i,onToggleSelect:r,onOpen:c,isMoving:l,onArchive:d}=t,u=Pe();if(s.length===0){let f;e[0]!==u?(f=u("sandbox.postList.noMatches"),e[0]=u,e[1]=f):f=e[1];let p;return e[2]!==f?(p=o.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 g;if(e[4]!==l||e[5]!==d||e[6]!==c||e[7]!==r||e[8]!==s||e[9]!==n||e[10]!==i||e[11]!==a){let f;e[13]!==l||e[14]!==d||e[15]!==c||e[16]!==r||e[17]!==n||e[18]!==i||e[19]!==a?(f=p=>o.jsx($f,{post:p,selected:p.key===n,selectionActive:a,checked:i.has(p.key),onToggleSelect:()=>r(p.key),moving:l(p.key),onOpen:()=>c(p.key),onArchive:p.status==="archived"?void 0:()=>d(p)},p.key),e[13]=l,e[14]=d,e[15]=c,e[16]=r,e[17]=n,e[18]=i,e[19]=a,e[20]=f):f=e[20],g=s.map(f),e[4]=l,e[5]=d,e[6]=c,e[7]=r,e[8]=s,e[9]=n,e[10]=i,e[11]=a,e[12]=g}else g=e[12];let m;return e[21]!==g?(m=o.jsx("ul",{className:"divide-y",children:g}),e[21]=g,e[22]=m):m=e[22],m}function $f(t){const e=ce.c(60),{post:s,selected:n,selectionActive:a,checked:i,onToggleSelect:r,moving:c,onOpen:l,onArchive:d}=t,u=Pe(),g=s.status==="awaiting_review"&&s.missing.length>0,m=s.status==="scheduled"||s.status==="published",f=a||i?"opacity-100":"opacity-0 focus-within:opacity-100 group-hover/row:opacity-100";let p;e[0]!==f?(p=we("absolute left-3 top-3 z-10 transition-opacity",f),e[0]=f,e[1]=p):p=e[1];let y;e[2]!==r?(y=()=>r(),e[2]=r,e[3]=y):y=e[3];let j;e[4]!==s.title||e[5]!==u?(j=s.title||u("sandbox.postBoard.untitled"),e[4]=s.title,e[5]=u,e[6]=j):j=e[6];let T;e[7]!==i||e[8]!==y||e[9]!==j?(T=o.jsx(Pn,{checked:i,onCheckedChange:y,"aria-label":j}),e[7]=i,e[8]=y,e[9]=j,e[10]=T):T=e[10];let v;e[11]!==p||e[12]!==T?(v=o.jsx("span",{className:p,children:T}),e[11]=p,e[12]=T,e[13]=v):v=e[13];let k;e[14]!==c||e[15]!==d||e[16]!==a?(k=d&&!a&&o.jsx(nl,{onArchive:d,disabled:c,className:"top-2.5"}),e[14]=c,e[15]=d,e[16]=a,e[17]=k):k=e[17];let C;e[18]!==l||e[19]!==r||e[20]!==a?(C=()=>a?r():l(),e[18]=l,e[19]=r,e[20]=a,e[21]=C):C=e[21];const x=n?"bg-accent text-accent-foreground":"bg-card hover:bg-accent";let w;e[22]!==x?(w=we("flex w-full cursor-pointer flex-col gap-1.5 py-2.5 pl-10 pr-3 text-left text-sm transition-colors",x),e[22]=x,e[23]=w):w=e[23];let P;e[24]!==s.title||e[25]!==u?(P=s.title||u("sandbox.postBoard.untitled"),e[24]=s.title,e[25]=u,e[26]=P):P=e[26];let S;e[27]!==P?(S=o.jsx("span",{className:"min-w-0 truncate pr-6 font-medium",children:P}),e[27]=P,e[28]=S):S=e[28];const A=Sf[s.status],$=jn[s.status];let D;e[29]!==u||e[30]!==$?(D=u($),e[29]=u,e[30]=$,e[31]=D):D=e[31];let z;e[32]!==A||e[33]!==D?(z=o.jsx(An,{variant:A,className:"shrink-0",children:D}),e[32]=A,e[33]=D,e[34]=z):z=e[34];let L;e[35]!==g||e[36]!==s.missing?(L=g&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[o.jsx(Js,{size:12}),s.missing.length]}),e[35]=g,e[36]=s.missing,e[37]=L):L=e[37];let b;e[38]!==s.duplicateTitle||e[39]!==u?(b=s.duplicateTitle&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",title:u("sandbox.postBoard.duplicateTitle"),children:[o.jsx(fo,{size:12,"aria-hidden":!0}),o.jsx("span",{className:"sr-only",children:u("sandbox.postBoard.duplicateTitle")})]}),e[38]=s.duplicateTitle,e[39]=u,e[40]=b):b=e[40];let _;e[41]!==m||e[42]!==s.date||e[43]!==s.scheduledDatetime?(_=m&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[o.jsx(po,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[41]=m,e[42]=s.date,e[43]=s.scheduledDatetime,e[44]=_):_=e[44];let I;e[45]!==z||e[46]!==L||e[47]!==b||e[48]!==_?(I=o.jsxs("div",{className:"flex items-center gap-2",children:[z,L,b,_]}),e[45]=z,e[46]=L,e[47]=b,e[48]=_,e[49]=I):I=e[49];let M;e[50]!==n||e[51]!==w||e[52]!==S||e[53]!==I||e[54]!==C?(M=o.jsxs("button",{type:"button",onClick:C,"aria-current":n,className:w,children:[S,I]}),e[50]=n,e[51]=w,e[52]=S,e[53]=I,e[54]=C,e[55]=M):M=e[55];let X;return e[56]!==M||e[57]!==v||e[58]!==k?(X=o.jsxs("li",{className:"group/row relative",children:[v,k,M]}),e[56]=M,e[57]=v,e[58]=k,e[59]=X):X=e[59],X}function Of(t){const e=ce.c(50),{post:s,payload:n,moving:a,onOpen:i,onArchive:r}=t,c=Pe(),l=s.status!=="generating"&&!a;let d;e[0]!==n?(d=Iu(n),e[0]=n,e[1]=d):d=e[1];const u=d,g=!l&&"opacity-80";let m;e[2]!==g?(m=we("group/card relative rounded-lg bg-card shadow-edge transition-shadow hover:shadow-lift",g),e[2]=g,e[3]=m):m=e[3];let f;e[4]!==a||e[5]!==r?(f=r&&o.jsx(nl,{onArchive:r,disabled:a,className:"top-2"}),e[4]=a,e[5]=r,e[6]=f):f=e[6];let p;e[7]!==s.key?(p=D=>D.dataTransfer.setData(sl,s.key),e[7]=s.key,e[8]=p):p=e[8];const y=l?"cursor-grab active:cursor-grabbing":"cursor-pointer";let j;e[9]!==y?(j=we("block w-full p-3 text-left",y),e[9]=y,e[10]=j):j=e[10];let T;e[11]!==s.title||e[12]!==c?(T=s.title||c("sandbox.postBoard.untitled"),e[11]=s.title,e[12]=c,e[13]=T):T=e[13];let v;e[14]!==T?(v=o.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:T}),e[14]=T,e[15]=v):v=e[15];let k;e[16]!==u||e[17]!==s.status?(k=s.status==="draft"&&u.format?.name&&o.jsx(An,{variant:"outline",className:"max-w-full truncate",children:u.format.name}),e[16]=u,e[17]=s.status,e[18]=k):k=e[18];let C;e[19]!==s.status||e[20]!==c?(C=s.status==="generating"&&o.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[o.jsx(Jn,{size:12,className:"animate-spin"}),c("sandbox.postBoard.generatingLabel")]}),e[19]=s.status,e[20]=c,e[21]=C):C=e[21];let x;e[22]!==s.missing||e[23]!==s.status||e[24]!==c?(x=s.status==="awaiting_review"&&(s.missing.length>0?o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[o.jsx(Js,{size:12}),c("sandbox.postBoard.nIssues",{count:String(s.missing.length)})]}):o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:[o.jsx(Ic,{size:12}),c("sandbox.postBoard.readyToSchedule")]})),e[22]=s.missing,e[23]=s.status,e[24]=c,e[25]=x):x=e[25];let w;e[26]!==s.date||e[27]!==s.scheduledDatetime||e[28]!==s.status?(w=(s.status==="scheduled"||s.status==="published")&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[o.jsx(po,{size:12}),(s.scheduledDatetime||s.date||"").slice(0,10)]}),e[26]=s.date,e[27]=s.scheduledDatetime,e[28]=s.status,e[29]=w):w=e[29];let P;e[30]!==s.duplicateTitle||e[31]!==c?(P=s.duplicateTitle&&o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[o.jsx(fo,{size:12,"aria-hidden":!0}),c("sandbox.postBoard.duplicateTitle")]}),e[30]=s.duplicateTitle,e[31]=c,e[32]=P):P=e[32];let S;e[33]!==k||e[34]!==C||e[35]!==x||e[36]!==w||e[37]!==P?(S=o.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[k,C,x,w,P]}),e[33]=k,e[34]=C,e[35]=x,e[36]=w,e[37]=P,e[38]=S):S=e[38];let A;e[39]!==l||e[40]!==i||e[41]!==S||e[42]!==p||e[43]!==j||e[44]!==v?(A=o.jsxs("button",{type:"button",draggable:l,onDragStart:p,onClick:i,className:j,children:[v,S]}),e[39]=l,e[40]=i,e[41]=S,e[42]=p,e[43]=j,e[44]=v,e[45]=A):A=e[45];let $;return e[46]!==A||e[47]!==m||e[48]!==f?($=o.jsxs("div",{className:m,children:[f,A]}),e[46]=A,e[47]=m,e[48]=f,e[49]=$):$=e[49],$}function nl(t){const e=ce.c(13),{label:s,onArchive:n,disabled:a,className:i}=t,r=Pe();let c;e[0]!==s||e[1]!==r?(c=s??r("sandbox.postBoard.delete"),e[0]=s,e[1]=r,e[2]=c):c=e[2];const l=c;let d;e[3]!==n?(d=f=>{f.stopPropagation(),n()},e[3]=n,e[4]=d):d=e[4];let u;e[5]!==i?(u=we("absolute right-2 z-10 opacity-0 transition-opacity focus-visible:opacity-100 group-hover/card:opacity-100 group-hover/row:opacity-100",i),e[5]=i,e[6]=u):u=e[6];let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(vo,{className:"size-3.25"}),e[7]=g):g=e[7];let m;return e[8]!==a||e[9]!==d||e[10]!==u||e[11]!==l?(m=o.jsx($e,{variant:"ghost-destructive",size:"icon-xs",type:"button",disabled:a,"aria-label":l,title:l,onClick:d,className:u,children:g}),e[8]=a,e[9]=d,e[10]=u,e[11]=l,e[12]=m):m=e[12],m}function Nt(t){const e=ce.c(54),{icon:s,logoUrl:n,title:a,subtitle:i,active:r,accent:c,variantCount:l,trailing:d,selectable:u,selectionActive:g,selected:m,invalid:f,invalidReason:p,warning:y,warningReason:j,onToggleSelect:T,onClick:v,menu:k}=t,C=Pe(),x=c==="global";let w;e[0]!==s||e[1]!==r||e[2]!==x||e[3]!==n?(w=n?o.jsx("img",{src:n,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):o.jsx("span",{className:we("flex size-8 shrink-0 items-center justify-center rounded-lg",x?"bg-global-section/15":"bg-muted"),children:o.jsx(s,{size:16,className:we("shrink-0",!x&&(r?"text-accent-foreground":"text-muted-foreground")),style:x?{color:lo}:void 0})}),e[0]=s,e[1]=r,e[2]=x,e[3]=n,e[4]=w):w=e[4];const P=w,S=r?x?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":x?"hover:bg-global-section/10":"hover:bg-accent";let A;e[5]!==S?(A=we("group relative flex min-w-0 items-center rounded-md transition-colors",S),e[5]=S,e[6]=A):A=e[6];let $;e[7]!==T||e[8]!==u||e[9]!==m||e[10]!==g||e[11]!==C||e[12]!==a?($=u&&o.jsx("span",{className:we("flex shrink-0 items-center pl-2.5 transition-opacity",m||g?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Lf,children:o.jsx(Pn,{checked:m,onCheckedChange:()=>T?.(),"aria-label":C("sandbox.itemRow.selectItem",{title:a})})}),e[7]=T,e[8]=u,e[9]=m,e[10]=g,e[11]=C,e[12]=a,e[13]=$):$=e[13];const D=f&&!r&&"text-destructive";let z;e[14]!==D?(z=we("block truncate text-sm font-medium",D),e[14]=D,e[15]=z):z=e[15];let L;e[16]!==z||e[17]!==a?(L=o.jsx("span",{className:z,children:a}),e[16]=z,e[17]=a,e[18]=L):L=e[18];const b=r?"text-accent-foreground/70":"text-muted-foreground";let _;e[19]!==b?(_=we("block truncate text-xs",b),e[19]=b,e[20]=_):_=e[20];let I;e[21]!==i||e[22]!==_?(I=o.jsx("span",{className:_,children:i}),e[21]=i,e[22]=_,e[23]=I):I=e[23];let M;e[24]!==I||e[25]!==L?(M=o.jsxs("span",{className:"min-w-0 flex-1",children:[L,I]}),e[24]=I,e[25]=L,e[26]=M):M=e[26];let X;e[27]!==r||e[28]!==C||e[29]!==l?(X=l!==void 0&&l>1&&o.jsxs(Pt,{children:[o.jsx(Tt,{asChild:!0,children:o.jsxs("span",{className:we("flex shrink-0 items-center gap-1 text-xs font-medium",r?"text-accent-foreground/70":"text-muted-foreground"),children:[o.jsx(za,{size:14}),l]})}),o.jsx(Et,{side:"bottom",children:C("sandbox.itemRow.variantCount",{count:l})})]}),e[27]=r,e[28]=C,e[29]=l,e[30]=X):X=e[30];let Q;e[31]!==y||e[32]!==j?(Q=y&&o.jsxs(Pt,{children:[o.jsx(Tt,{asChild:!0,children:o.jsx("span",{className:"flex shrink-0 items-center text-warning",children:o.jsx(Js,{size:14})})}),j&&o.jsx(Et,{side:"bottom",children:j})]}),e[31]=y,e[32]=j,e[33]=Q):Q=e[33];let J;e[34]!==r||e[35]!==f||e[36]!==p?(J=f&&o.jsxs(Pt,{children:[o.jsx(Tt,{asChild:!0,children:o.jsx("span",{className:we("flex shrink-0 items-center",r?"text-accent-foreground":"text-destructive"),children:o.jsx(Js,{size:14})})}),p&&o.jsx(Et,{side:"bottom",children:p})]}),e[34]=r,e[35]=f,e[36]=p,e[37]=J):J=e[37];let H;e[38]!==v||e[39]!==P||e[40]!==M||e[41]!==X||e[42]!==Q||e[43]!==J||e[44]!==d?(H=o.jsxs("button",{type:"button",onClick:v,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[P,M,X,Q,J,d]}),e[38]=v,e[39]=P,e[40]=M,e[41]=X,e[42]=Q,e[43]=J,e[44]=d,e[45]=H):H=e[45];let W;e[46]!==r||e[47]!==k?(W=k&&o.jsx("div",{className:we("pr-1 opacity-0 transition-opacity group-hover:opacity-100",r&&"opacity-100"),children:k}),e[46]=r,e[47]=k,e[48]=W):W=e[48];let O;return e[49]!==H||e[50]!==W||e[51]!==A||e[52]!==$?(O=o.jsxs("div",{className:A,children:[$,H,W]}),e[49]=H,e[50]=W,e[51]=A,e[52]=$,e[53]=O):O=e[53],O}function Lf(t){return t.stopPropagation()}const If={loaders:Fa,actions:ti},Kf={analytics:wr,blog:ei,commerce:kr,site:vr,website:gn};function Ff(t,e){return e===0?Kf[t.toLowerCase()]??$o:$o}function Ys(t,e){return e===0?ql(t):t}function zf(t){const e=ce.c(125),{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:i,meta:r,decofile:c,kind:l,initialSavedKey:d,onBack:u}=t,g=Pe();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=[],e[0]=m):m=e[0];const[f,p]=K.useState(m);let y;e[1]!==d?(y=()=>d?{mode:"saved",key:d}:null,e[1]=d,e[2]=y):y=e[2];const[j,T]=K.useState(y),[v,k]=K.useState(""),[C,x]=K.useState(qf),[w,P]=K.useState(l);w!==l&&(P(l),p([]),T(null),k(""),x(new Set));let S;e[3]===Symbol.for("react.memo_cache_sentinel")?(S=xe=>{x(ge=>{const ne=new Set(ge);return ne.has(xe)?ne.delete(xe):ne.add(xe),ne})},e[3]=S):S=e[3];const A=S;let $;e[4]!==a||e[5]!==s||e[6]!==n?($={orgSlug:s,virtualMcpId:n,branch:a},e[4]=a,e[5]=s,e[6]=n,e[7]=$):$=e[7];const D=Nn($);let z;e[8]!==D?(z=xe=>D.mutate(xe),e[8]=D,e[9]=z):z=e[9];let L;e[10]!==c||e[11]!==D.v8||e[12]!==z?(L=_a(z,c,D.v8),e[10]=c,e[11]=D.v8,e[12]=z,e[13]=L):L=e[13];const b=L;let _;e[14]!==l?(_=Xl(l),e[14]=l,e[15]=_):_=e[15];const I=_,M=If[l],X=l==="loaders"?"sandbox.collectionsSidebar.loaders":"sandbox.collectionsSidebar.actions";let Q;e[16]!==g||e[17]!==X?(Q=g(X),e[16]=g,e[17]=X,e[18]=Q):Q=e[18];const J=Q;let H,W,O,E,te,ue,B;if(e[19]!==M||e[20]!==a||e[21]!==J||e[22]!==c||e[23]!==l||e[24]!==r||e[25]!==u||e[26]!==C||e[27]!==s||e[28]!==f||e[29]!==i||e[30]!==D||e[31]!==b||e[32]!==v||e[33]!==j||e[34]!==I||e[35]!==g||e[36]!==n){B=Symbol.for("react.early_return_sentinel");e:{const xe=[...Gl(r,c,l).map(Wf),...Hl(r,l).map(Yf)],ge=v.trim().toLowerCase(),ne=ge.length>0,ye=ne?xe.filter(V=>V.title.toLowerCase().includes(ge)||V.resolveType.toLowerCase().includes(ge)):[],se=new Map,re=[],de=new Map;if(!ne){for(const V of xe){const Be=V.folderPath;if(!(Be.length<f.length)&&f.every((Ne,Re)=>Be[Re]===Ne))if(Be.length===f.length)if(V.savedKey!==void 0){const Ne=de.get(V.resolveType);Ne?Ne.push(V):de.set(V.resolveType,[V])}else re.push(V);else{const Ne=Be[f.length],Re=se.get(Ne)??{count:0,savedCount:0};V.savedKey!==void 0?Re.savedCount=Re.savedCount+1:Re.count=Re.count+1,se.set(Ne,Re)}}re.sort(Hf);for(const V of de.values())V.sort(Gf)}const Z=[...de.entries()].filter(V=>{const[Be]=V;return!re.some(Ne=>Ne.resolveType===Be)}).flatMap(Uf).sort(Vf);let N;e[44]!==f.length?(N=(V,Be)=>Ys(V.name,f.length).localeCompare(Ys(Be.name,f.length)),e[44]=f.length,e[45]=N):N=e[45];const oe=[...se.entries()].map(Mf).sort(N);let fe;e[46]===Symbol.for("react.memo_cache_sentinel")?(fe=V=>{T(V.savedKey!==void 0?{mode:"saved",key:V.savedKey}:{mode:"available",resolveType:V.resolveType,title:V.title})},e[46]=fe):fe=e[46];const je=fe;let Se;e[47]!==D||e[48]!==I||e[49]!==g?(Se=async(V,Be)=>{const Ne=await D.mutateAsync({blockKey:V,data:Be,create:!0});at(Ne)||ve.success(g("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:I,blockId:V})),T({mode:"saved",key:V})},e[47]=D,e[48]=I,e[49]=g,e[50]=Se):Se=e[50];const Ce=Se;let Ae;e[51]!==c||e[52]!==j?(Ae=Xf(j,c),e[51]=c,e[52]=j,e[53]=Ae):Ae=e[53];const _e=Ae,q=f[f.length-1];let ie;e[54]!==J||e[55]!==q||e[56]!==f.length||e[57]!==ne?(ie=!ne&&q!==void 0?Ys(q,f.length-1):J,e[54]=J,e[55]=q,e[56]=f.length,e[57]=ne,e[58]=ie):ie=e[58];const ke=ie;if(_e){const V=`${_e.mode}:${_e.mode==="saved"?_e.blockKey:_e.resolveType}`,Be=_e.mode==="saved"&&_e.blockKey||"";let Ne;e[59]!==u?(Ne=u??(()=>T(null)),e[59]=u,e[60]=Ne):Ne=e[60];const Re=u?void 0:ke;let Ue;e[61]!==a||e[62]!==c||e[63]!==V||e[64]!==Ce||e[65]!==l||e[66]!==r||e[67]!==s||e[68]!==i||e[69]!==D.isPending||e[70]!==b||e[71]!==Ne||e[72]!==Re||e[73]!==_e.editorTarget||e[74]!==_e.initialValue||e[75]!==n?(Ue=o.jsx(Yl,{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:i,meta:r,decofile:c,kind:l,target:_e.editorTarget,initialValue:_e.initialValue,isCreating:D.isPending,onCreate:Ce,onSaveReferencedBlock:b,onBack:Ne,backLabel:Re},V),e[61]=a,e[62]=c,e[63]=V,e[64]=Ce,e[65]=l,e[66]=r,e[67]=s,e[68]=i,e[69]=D.isPending,e[70]=b,e[71]=Ne,e[72]=Re,e[73]=_e.editorTarget,e[74]=_e.initialValue,e[75]=n,e[76]=Ue):Ue=e[76];let dt;e[77]!==a||e[78]!==c||e[79]!==V||e[80]!==s||e[81]!==Be||e[82]!==Ue||e[83]!==n?(dt=o.jsx(Da,{listing:c,orgSlug:s,virtualMcpId:n,branch:a,blockKey:Be,present:void 0,children:Ue},V),e[77]=a,e[78]=c,e[79]=V,e[80]=s,e[81]=Be,e[82]=Ue,e[83]=n,e[84]=dt):dt=e[84],B=dt;break e}te="flex h-full w-full min-w-0 flex-col";let he;e[85]!==g?(he=g("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[85]=g,e[86]=he):he=e[86];let Ke;e[87]===Symbol.for("react.memo_cache_sentinel")?(Ke=()=>p([]),e[87]=Ke):Ke=e[87];const Me=f.length===0?"font-medium text-foreground":"text-muted-foreground";let Ge;e[88]!==Me?(Ge=we("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",Me),e[88]=Me,e[89]=Ge):Ge=e[89];let tt;e[90]!==J||e[91]!==Ge?(tt=o.jsx("button",{type:"button",onClick:Ke,className:Ge,children:J}),e[90]=J,e[91]=Ge,e[92]=tt):tt=e[92];let We;e[93]!==f?(We=f.map((V,Be)=>{const Ne=Be===f.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[o.jsx(mn,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>p(f.slice(0,Be+1)),className:we("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",Ne?"font-medium text-foreground":"text-muted-foreground"),children:Ys(V,Be)})]},`${V}-${Be}`)}),e[93]=f,e[94]=We):We=e[94];let qe;e[95]!==he||e[96]!==tt||e[97]!==We?(qe=o.jsxs("nav",{"aria-label":he,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[tt,We]}),e[95]=he,e[96]=tt,e[97]=We,e[98]=qe):qe=e[98];let Xe;e[99]===Symbol.for("react.memo_cache_sentinel")?(Xe=o.jsx(mo,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[99]=Xe):Xe=e[99];let Fe;e[100]===Symbol.for("react.memo_cache_sentinel")?(Fe=V=>k(V.target.value),e[100]=Fe):Fe=e[100];let st;e[101]!==l||e[102]!==g?(st=g("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:l}),e[101]=l,e[102]=g,e[103]=st):st=e[103];let yt;e[104]!==l||e[105]!==g?(yt=g("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:l}),e[104]=l,e[105]=g,e[106]=yt):yt=e[106];let Te;e[107]!==v||e[108]!==st||e[109]!==yt?(Te=o.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Xe,o.jsx("input",{type:"text",value:v,onChange:Fe,placeholder:st,"aria-label":yt,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[107]=v,e[108]=st,e[109]=yt,e[110]=Te):Te=e[110],e[111]!==qe||e[112]!==Te?(ue=o.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[qe,Te]}),e[111]=qe,e[112]=Te,e[113]=ue):ue=e[113],H=nn,E="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",W="mx-auto w-full max-w-4xl px-6 py-5",O=ne?ye.length===0?o.jsx(ft,{title:g("sandbox.runnableBlocksBrowser.noSearchResults",{kind:l,query:v.trim()}),description:g("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):o.jsx("div",{className:"flex flex-col gap-1",children:ye.map(V=>o.jsx(Nt,{icon:M,accent:V.savedKey!==void 0?"global":void 0,title:V.title,subtitle:V.resolveType,active:!1,onClick:()=>je(V)},V.savedKey??V.resolveType))}):oe.length===0&&re.length===0&&Z.length===0?o.jsx(ft,{title:g("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:l}),description:f.length===0?g("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):g("sandbox.runnableBlocksBrowser.emptyFolder")}):o.jsxs(o.Fragment,{children:[oe.length>0&&o.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:oe.map(V=>{const Be=Ff(V.name,f.length);return o.jsxs("button",{type:"button",onClick:()=>p([...f,V.name]),className:"flex items-center gap-2.5 rounded-lg border px-3 py-2.5 text-left transition-colors hover:bg-accent cursor-pointer",children:[o.jsx(Be,{size:18,className:"shrink-0 text-muted-foreground"}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-sm font-medium",children:Ys(V.name,f.length)}),o.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[V.count," ",V.count===1?I:l,V.savedCount>0&&o.jsxs(o.Fragment,{children:[" ","·"," ",g("sandbox.runnableBlocksBrowser.savedCountLabel",{count:V.savedCount})]})]})]})]},V.name)})}),(re.length>0||Z.length>0)&&o.jsxs("div",{className:we("flex flex-col gap-1",oe.length>0&&"mt-4"),children:[re.map(V=>{const Be=de.get(V.resolveType)??[],Ne=C.has(V.resolveType);return o.jsxs("div",{className:"flex flex-col",children:[o.jsx(Nt,{icon:M,title:V.title,subtitle:V.resolveType,active:!1,onClick:()=>je(V)}),Be.length>0&&o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",onClick:()=>A(V.resolveType),"aria-expanded":Ne,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:lo},children:[Ne?o.jsx(Qs,{size:12,className:"shrink-0"}):o.jsx(mn,{size:12,className:"shrink-0"}),g(Ne?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",Be.length,")"]}),Ne&&o.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:Be.map(Re=>o.jsx(Nt,{icon:M,accent:"global",title:Re.title,subtitle:Re.resolveType,active:!1,onClick:()=>je(Re)},Re.savedKey))})]})]},V.resolveType)}),Z.map(V=>o.jsx(Nt,{icon:M,accent:"global",title:V.title,subtitle:V.resolveType,active:!1,onClick:()=>je(V)},V.savedKey))]})]})}e[19]=M,e[20]=a,e[21]=J,e[22]=c,e[23]=l,e[24]=r,e[25]=u,e[26]=C,e[27]=s,e[28]=f,e[29]=i,e[30]=D,e[31]=b,e[32]=v,e[33]=j,e[34]=I,e[35]=g,e[36]=n,e[37]=H,e[38]=W,e[39]=O,e[40]=E,e[41]=te,e[42]=ue,e[43]=B}else H=e[37],W=e[38],O=e[39],E=e[40],te=e[41],ue=e[42],B=e[43];if(B!==Symbol.for("react.early_return_sentinel"))return B;let G;e[114]!==W||e[115]!==O?(G=o.jsx("div",{className:W,children:O}),e[114]=W,e[115]=O,e[116]=G):G=e[116];let me;e[117]!==H||e[118]!==E||e[119]!==G?(me=o.jsx(H,{className:E,children:G}),e[117]=H,e[118]=E,e[119]=G,e[120]=me):me=e[120];let pe;return e[121]!==te||e[122]!==ue||e[123]!==me?(pe=o.jsxs("div",{className:te,children:[ue,me]}),e[121]=te,e[122]=ue,e[123]=me,e[124]=pe):pe=e[124],pe}function Mf(t){const[e,s]=t;return{name:e,...s}}function Vf(t,e){return t.title.localeCompare(e.title)}function Uf(t){const[,e]=t;return e}function Gf(t,e){return t.title.localeCompare(e.title)}function Hf(t,e){return t.title.localeCompare(e.title)}function Yf(t){return{resolveType:t.resolveType,title:t.title,folderPath:Ba(t.resolveType)}}function Wf(t){return{resolveType:t.resolveType,title:t.title,folderPath:Ba(t.resolveType),savedKey:t.key}}function qf(){return new Set}function Xf(t,e){if(!t)return null;if(t.mode==="available")return{mode:"available",resolveType:t.resolveType,editorTarget:{mode:"available",resolveType:t.resolveType,title:t.title},initialValue:{}};const{resolveType:s,props:n,title:a}=Wl(e,t.key);return{mode:"saved",blockKey:t.key,resolveType:s,editorTarget:{mode:"saved",blockKey:t.key,resolveType:s,title:a},initialValue:n}}function Jf(t){const e=ce.c(106),{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:i,meta:r,decofile:c,resolveType:l,title:d,defaultBlockId:u,isCreating:g,onCreate:m,onSaveReferencedBlock:f}=t,p=Pe(),y=Tn(),j=y?.virtualMcpId,v=$a(j===n?n:null)?.metadata?.siteSlug??null;let k;e[0]===Symbol.for("react.memo_cache_sentinel")?(k={},e[0]=k):k=e[0];const[C,x]=K.useState(k);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w=[],e[1]=w):w=e[1];const[P,S]=K.useState(w),[A,$]=K.useState(0),[D,z]=K.useState(!1);let L;e[2]!==r||e[3]!==l?(L=qa(l,r),e[2]=r,e[3]=l,e[4]=L):L=e[4];const b=L;let _,I,M,X,Q,J,H,W;if(e[5]!==v||e[6]!==a||e[7]!==c||e[8]!==P||e[9]!==C||e[10]!==g||e[11]!==m||e[12]!==s||e[13]!==i||e[14]!==l||e[15]!==p||e[16]!==y?.taskId||e[17]!==d||e[18]!==n){const me=l.split("/").pop()?.replace(/\.tsx?$/,"")??l,pe=y?.taskId??null,xe=i??void 0;let ge;e[27]!==v||e[28]!==a||e[29]!==s||e[30]!==xe||e[31]!==pe||e[32]!==n?(ge={orgSlug:s,virtualMcpId:n,branch:a,threadId:pe,previewUrl:xe,siteSlug:v},e[27]=v,e[28]=a,e[29]=s,e[30]=xe,e[31]=pe,e[32]=n,e[33]=ge):ge=e[33],I=ge;let ne,ye,se,re;if(e[34]!==c||e[35]!==P||e[36]!==C||e[37]!==m||e[38]!==p||e[39]!==d){const Ae=[d,...P],_e=ie=>{S(P.slice(0,ie)),$(Qf)};let q;e[48]!==c||e[49]!==C||e[50]!==m?(q=async ie=>{const ke=Ql(ie,c);if(ke){ve.error(ke);return}await m(ie,C),z(!1)},e[48]=c,e[49]=C,e[50]=m,e[51]=q):q=e[51],_=q,W="flex h-full w-full min-w-0",H="flex min-w-0 flex-1 flex-col",Q="shrink-0 border-b px-3 py-2.5",re="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==p?(ne=p("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=p,e[53]=ne):ne=e[53],ye="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",se=Ae.map((ie,ke)=>{const he=ke===Ae.length-1,Ke=Jl(ie);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[ke>0&&o.jsx(mn,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>_e(ke),title:Ke,className:we("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",he?"font-medium text-foreground":"text-muted-foreground"),children:Ke})]},`${Ke}-${ke}`)}),e[34]=c,e[35]=P,e[36]=C,e[37]=m,e[38]=p,e[39]=d,e[40]=_,e[41]=ne,e[42]=ye,e[43]=se,e[44]=re,e[45]=Q,e[46]=H,e[47]=W}else _=e[40],ne=e[41],ye=e[42],se=e[43],re=e[44],Q=e[45],H=e[46],W=e[47];let de;e[54]!==ne||e[55]!==ye||e[56]!==se?(de=o.jsx("nav",{"aria-label":ne,className:ye,children:se}),e[54]=ne,e[55]=ye,e[56]=se,e[57]=de):de=e[57];let Z;e[58]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>z(!0),e[58]=Z):Z=e[58];let N;e[59]!==p?(N=p("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=p,e[60]=N):N=e[60];let oe;e[61]===Symbol.for("react.memo_cache_sentinel")?(oe=o.jsx(jr,{size:14}),e[61]=oe):oe=e[61];let fe;e[62]!==g||e[63]!==N?(fe=o.jsx(Tt,{asChild:!0,children:o.jsx($e,{size:"icon",className:"shrink-0",disabled:g,onClick:Z,"aria-label":N,children:oe})}),e[62]=g,e[63]=N,e[64]=fe):fe=e[64];let je;e[65]!==p?(je=p("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=p,e[66]=je):je=e[66];let Se;e[67]!==je?(Se=o.jsx(Et,{side:"bottom",children:je}),e[67]=je,e[68]=Se):Se=e[68];let Ce;e[69]!==fe||e[70]!==Se?(Ce=o.jsxs(Pt,{children:[fe,Se]}),e[69]=fe,e[70]=Se,e[71]=Ce):Ce=e[71],e[72]!==re||e[73]!==de||e[74]!==Ce?(J=o.jsxs("div",{className:re,children:[de,Ce]}),e[72]=re,e[73]=de,e[74]=Ce,e[75]=J):J=e[75],M="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",X=p("sandbox.availableSectionEditor.localEditsHint",{typeLabel:me}),e[5]=v,e[6]=a,e[7]=c,e[8]=P,e[9]=C,e[10]=g,e[11]=m,e[12]=s,e[13]=i,e[14]=l,e[15]=p,e[16]=y?.taskId,e[17]=d,e[18]=n,e[19]=_,e[20]=I,e[21]=M,e[22]=X,e[23]=Q,e[24]=J,e[25]=H,e[26]=W}else _=e[19],I=e[20],M=e[21],X=e[22],Q=e[23],J=e[24],H=e[25],W=e[26];let O;e[76]!==M||e[77]!==X?(O=o.jsx("p",{className:M,children:X}),e[76]=M,e[77]=X,e[78]=O):O=e[78];let E;e[79]!==O||e[80]!==Q||e[81]!==J?(E=o.jsxs("div",{className:Q,children:[J,O]}),e[79]=O,e[80]=Q,e[81]=J,e[82]=E):E=e[82];let te;e[83]!==c||e[84]!==P||e[85]!==A||e[86]!==C||e[87]!==r||e[88]!==f||e[89]!==I||e[90]!==b||e[91]!==p?(te=o.jsx(nn,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:o.jsx("div",{className:"mx-auto max-w-2xl",children:b?o.jsx(Ra,{schema:b,value:C,onChange:me=>x(me),basePath:"",breadcrumbPath:P,onBreadcrumbChange:S,meta:r,decofile:c,onSaveReferencedBlock:f,sandbox:I},A):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:p("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=c,e[84]=P,e[85]=A,e[86]=C,e[87]=r,e[88]=f,e[89]=I,e[90]=b,e[91]=p,e[92]=te):te=e[92];let ue;e[93]!==E||e[94]!==te||e[95]!==H?(ue=o.jsxs("div",{className:H,children:[E,te]}),e[93]=E,e[94]=te,e[95]=H,e[96]=ue):ue=e[96];let B;e[97]!==u||e[98]!==_||e[99]!==g||e[100]!==D?(B=o.jsx(Zl,{open:D,onOpenChange:z,defaultBlockId:u,isPending:g,onSubmit:_}),e[97]=u,e[98]=_,e[99]=g,e[100]=D,e[101]=B):B=e[101];let G;return e[102]!==ue||e[103]!==B||e[104]!==W?(G=o.jsxs("div",{className:W,children:[ue,B]}),e[102]=ue,e[103]=B,e[104]=W,e[105]=G):G=e[105],G}function Qf(t){return t+1}function Zf(t,e,s){const n={__resolveType:t},a=sr([n],e)[0];return a?vl(n,a,e,s):null}function em({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,meta:a,decofile:i,blockKey:r,onSaveReferencedBlock:c}){const l=Pe(),d=Tn(),u=d?.virtualMcpId,m=$a(u===e?e:null)?.metadata?.siteSlug??null,[f]=K.useState(()=>Zf(r,i,bl(a))),[p,y]=K.useState(f?.data??{}),[j,T]=K.useState([]),[v,k]=K.useState(0),[C,x]=K.useState(!1),[w,P]=K.useState(null),S=w!==null,{save:A,flush:$}=er({orgSlug:t,virtualMcpId:e,branch:s},{holdsCopy:!0}),D=f?.resolveType?qa(f.resolveType,a):null,z=xo(e,s),L=z.kind==="protocol"&&z.source==="github",b=i[r],_=b?Jr(r,b):r,I=d?.taskId??null,M={orgSlug:t,virtualMcpId:e,branch:s,threadId:I,previewUrl:n??void 0,siteSlug:m},X=O=>{y(O),A(r,O)},Q=()=>{S?(P(null),x(!1),k(O=>O+1)):P(JSON.stringify(p,null,2))},J=O=>{const E=O??"";try{const te=JSON.parse(E);if(te&&typeof te=="object"&&!Array.isArray(te)){x(!1),X(te);return}x(!0)}catch{x(!0)}},H=[_,...j],W=O=>{T(j.slice(0,O)),k(E=>E+1)};return o.jsx("div",{className:"flex h-full w-full min-w-0",children:o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[o.jsx(tr,{crumbs:H,onSelect:W}),o.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[o.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:lo},"aria-hidden":!0}),L?o.jsx("span",{className:"min-w-0 truncate text-sm font-medium","data-testid":"saved-section-title",children:_}):null,o.jsx("div",{className:"flex-1"}),o.jsxs(Pt,{children:[o.jsx(Tt,{asChild:!0,children:o.jsx($e,{variant:S?"default":"ghost",size:"icon",className:"shrink-0",onClick:Q,"aria-label":l(S?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":S,children:S?o.jsx(io,{size:14}):o.jsx(Ma,{size:14})})}),o.jsx(Et,{side:"bottom",children:l(S?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),o.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:l("sandbox.savedSectionEditor.globalSectionDescription")})]}),o.jsxs("div",{className:"relative min-h-0 flex-1",children:[o.jsx(nn,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:o.jsx("div",{className:"mx-auto max-w-2xl",children:D?o.jsx(Ra,{schema:D,value:p,onChange:O=>X(O),basePath:"",breadcrumbPath:j,onBreadcrumbChange:T,meta:a,decofile:i,onSaveReferencedBlock:c,sandbox:M},v):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l("sandbox.savedSectionEditor.noEditableFields")})})})}),w!==null&&o.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[C&&o.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:l("sandbox.savedSectionEditor.invalidJsonError")}),o.jsx("div",{className:"min-h-0 flex-1",children:o.jsx(si,{language:"json",height:"100%",code:w,onChange:J,onSave:O=>{J(O),$()}})})]})]})]})})}function tm(t){const e=ce.c(47),{selection:s,orgSlug:n,virtualMcpId:a,branch:i,previewUrl:r,meta:c,decofile:l,isCreating:d,onCreateAvailable:u,onSaveReferencedBlock:g}=t,m=Pe();if(!s){let v;e[0]!==m?(v=m("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=m,e[1]=v):v=e[1];let k;e[2]!==m?(k=m("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=m,e[3]=k):k=e[3];let C;return e[4]!==v||e[5]!==k?(C=o.jsx(ft,{title:v,description:k}),e[4]=v,e[5]=k,e[6]=C):C=e[6],C}if(s.collection==="available-section"){const v=`available:${s.resolveType}`,k=s.resolveType,C=s.title;let x;e[7]!==s.title?(x=nr(s.title),e[7]=s.title,e[8]=x):x=e[8];let w;e[9]!==u||e[10]!==s.resolveType?(w=(S,A)=>u(s.resolveType,S,A),e[9]=u,e[10]=s.resolveType,e[11]=w):w=e[11];let P;return e[12]!==i||e[13]!==l||e[14]!==d||e[15]!==c||e[16]!==g||e[17]!==n||e[18]!==r||e[19]!==s.resolveType||e[20]!==s.title||e[21]!==v||e[22]!==x||e[23]!==w||e[24]!==a?(P=o.jsx(Jf,{orgSlug:n,virtualMcpId:a,branch:i,previewUrl:r,meta:c,decofile:l,resolveType:k,title:C,defaultBlockId:x,isCreating:d,onCreate:w,onSaveReferencedBlock:g},v),e[12]=i,e[13]=l,e[14]=d,e[15]=c,e[16]=g,e[17]=n,e[18]=r,e[19]=s.resolveType,e[20]=s.title,e[21]=v,e[22]=x,e[23]=w,e[24]=a,e[25]=P):P=e[25],P}const f=`saved:${s.key}`,p=s.key;let y;e[26]!==l||e[27]!==s.key?(y=Object.hasOwn(l,s.key),e[26]=l,e[27]=s.key,e[28]=y):y=e[28];let j;e[29]!==i||e[30]!==l||e[31]!==c||e[32]!==g||e[33]!==n||e[34]!==r||e[35]!==s.key||e[36]!==a?(j=o.jsx(em,{orgSlug:n,virtualMcpId:a,branch:i,previewUrl:r,meta:c,decofile:l,blockKey:s.key,onSaveReferencedBlock:g}),e[29]=i,e[30]=l,e[31]=c,e[32]=g,e[33]=n,e[34]=r,e[35]=s.key,e[36]=a,e[37]=j):j=e[37];let T;return e[38]!==i||e[39]!==l||e[40]!==n||e[41]!==s.key||e[42]!==f||e[43]!==y||e[44]!==j||e[45]!==a?(T=o.jsx(Da,{listing:l,orgSlug:n,virtualMcpId:a,branch:i,blockKey:p,present:y,children:j},f),e[38]=i,e[39]=l,e[40]=n,e[41]=s.key,e[42]=f,e[43]=y,e[44]=j,e[45]=a,e[46]=T):T=e[46],T}function bs(t){const e=ce.c(34),{onDuplicate:s,onRename:n,onAddVariant:a,onEditSeo:i,onViewJson:r,onDelete:c}=t,l=Pe();let d;e[0]!==l?(d=l("sandbox.itemActions.moreActions"),e[0]=l,e[1]=d):d=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(kl,{size:14}),e[2]=u):u=e[2];let g;e[3]!==d?(g=o.jsx(un,{asChild:!0,children:o.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:sm,children:u})}),e[3]=d,e[4]=g):g=e[4];let m;e[5]!==n||e[6]!==l?(m=n&&o.jsxs(Ht,{onClick:n,children:[o.jsx(Zc,{size:14}),l("sandbox.itemActions.rename")]}),e[5]=n,e[6]=l,e[7]=m):m=e[7];let f;e[8]!==s||e[9]!==l?(f=s&&o.jsxs(Ht,{onClick:s,children:[o.jsx(fo,{size:14}),l("sandbox.itemActions.duplicate")]}),e[8]=s,e[9]=l,e[10]=f):f=e[10];let p;e[11]!==a||e[12]!==l?(p=a&&o.jsxs(o.Fragment,{children:[o.jsx(Fn,{}),o.jsxs(Ht,{onClick:a,className:"cursor-pointer text-success focus:text-success",children:[o.jsx(za,{size:14}),l("sandbox.itemActions.addVariant")]})]}),e[11]=a,e[12]=l,e[13]=p):p=e[13];let y;e[14]!==i||e[15]!==r||e[16]!==l?(y=(i||r)&&o.jsxs(o.Fragment,{children:[o.jsx(Fn,{}),i&&o.jsxs(Ht,{onClick:i,children:[o.jsx(Ka,{size:14}),l("sandbox.itemActions.editSeo")]}),r&&o.jsxs(Ht,{onClick:r,children:[o.jsx(Ma,{size:14}),l("sandbox.itemActions.viewJson")]})]}),e[14]=i,e[15]=r,e[16]=l,e[17]=y):y=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(Fn,{}),e[18]=j):j=e[18];let T;e[19]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx(vo,{size:14}),e[19]=T):T=e[19];let v;e[20]!==l?(v=l("sandbox.itemActions.delete"),e[20]=l,e[21]=v):v=e[21];let k;e[22]!==c||e[23]!==v?(k=o.jsxs(Ht,{onClick:c,className:"text-destructive focus:text-destructive",children:[T,v]}),e[22]=c,e[23]=v,e[24]=k):k=e[24];let C;e[25]!==k||e[26]!==m||e[27]!==f||e[28]!==p||e[29]!==y?(C=o.jsxs(pn,{align:"end",className:"w-44",children:[m,f,p,y,j,k]}),e[25]=k,e[26]=m,e[27]=f,e[28]=p,e[29]=y,e[30]=C):C=e[30];let x;return e[31]!==C||e[32]!==g?(x=o.jsxs(fn,{children:[g,C]}),e[31]=C,e[32]=g,e[33]=x):x=e[33],x}function sm(t){return t.stopPropagation()}function ga(t,e,{neverPublished:s=!1}={}){return e&&s?t==="post"?"sandbox.postEditor.deletePostConfirmBodyNeverPublished":"sandbox.contentBrowser.deleteDialog.descriptionNeverPublished":t==="section"?e?"sandbox.contentBrowser.deleteDialog.descriptionSectionDraft":"sandbox.contentBrowser.deleteDialog.descriptionSection":t==="post"?e?"sandbox.postEditor.deletePostConfirmBodyDraft":"sandbox.postEditor.deletePostConfirmBody":e?"sandbox.contentBrowser.deleteDialog.descriptionDraft":"sandbox.contentBrowser.deleteDialog.descriptionPermanent"}const ol=4;function On(t){const e=new Map;for(const s of t)s.slug&&!e.has(s.slug)&&e.set(s.slug,s);return e}function Ln(t,e){const s=t.parentSlug;if(!t.slug||!s||s===t.slug)return;const n=e.get(s);return n===t?void 0:n}function al(t,e){const s=On(e),n=[],a=new Set;let i=s.get(t);for(;i&&!a.has(i.slug??"")&&(a.add(i.slug??""),n.push(i),!(n.length>=ol));)i=Ln(i,s);return n.reverse()}function il(t,e){const s=new Map;for(const n of t){const a=Ln(n,e);if(!a?.slug)continue;const i=s.get(a);i?i.push(n):s.set(a,[n])}for(const n of s.values())n.sort((a,i)=>a.label.localeCompare(i.label));return s}function zh(t,e){const s=On(e),n=il(e,s),a=new Set([t]),i=s.get(t);let r=i?[i]:[];for(;r.length;){const c=[];for(const l of r)for(const d of n.get(l)??[])d.slug&&!a.has(d.slug)&&(a.add(d.slug),c.push(d));r=c}return a.delete(t),a}function Mh(t,e){if(!t)return[];const s=On(e),n=al(t,e),a=n[0];return!a||Ln(a,s)?[t]:n.map(i=>i.slug??"")}function nm(t){const e=On(t),s=il(t,e),n=new Set,a=[],i=(c,l)=>{if(!n.has(c)&&(n.add(c),a.push({entry:c,depth:l}),!(l+1>=ol)))for(const d of s.get(c)??[])i(d,l+1)},r=t.filter(c=>!Ln(c,e)).sort((c,l)=>c.label.localeCompare(l.label));for(const c of r)i(c,0);for(const c of t)i(c,0);return a}function om(t){return t.split("/").pop()?.replace(/\.tsx?$/,"")||t||"Section"}function am(t){const e=new Map;for(const s of t){const n=om(s.resolveType),a=e.get(n);a?a.push(s):e.set(n,[s])}return[...e.entries()].map(([s,n])=>({label:s,sections:n})).sort((s,n)=>s.label.localeCompare(n.label))}function ha(t){const e=ce.c(8),{icon:s,label:n,className:a}=t;let i;e[0]!==a?(i=we("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]=i):i=e[1];let r;e[2]!==s?(r=o.jsx(s,{size:13,className:"shrink-0"}),e[2]=s,e[3]=r):r=e[3];let c;return e[4]!==n||e[5]!==i||e[6]!==r?(c=o.jsxs("div",{className:i,children:[r,n]}),e[4]=n,e[5]=i,e[6]=r,e[7]=c):c=e[7],c}const qn=8,im={page:"Pages",redirect:"Redirects","cms-settings":"Settings"},lm=new Set(["pages","redirects","sections","loaders","matchers","content"]),ll=new Set(["lazy","multivariate","website/flags/multivariate.ts","website/flags/multivariate/section.ts"]),rm=8;function cm(t){return t?.manifest?.blocks??{}}function dm(t){const e=t?.aliases;return e&&typeof e=="object"?e:{}}function Cn(t,e){const s=dm(t)[e];return typeof s=="string"&&s?s:e}function Eo(t,e){for(const[s,n]of Object.entries(cm(t)))if(n&&Object.hasOwn(n,e))return{group:s,entry:n[e]??{}};return null}function xa(t,e){const s=Eo(t,Cn(t,e));return s?lm.has(s.group)?s.group:"other":null}function ya(t,e,s){let n=s;for(let a=0;a<rm;a++){const i=n.__resolveType;if(typeof i!="string"||!i)return null;const r=Cn(t,i);if(Eo(t,r)){if(!ll.has(r)||!t)return r;const l=ec(t,n);return l&&l!==i?Cn(t,l):r}const c=e[i];if(!c||typeof c!="object"||Array.isArray(c))return r;n=c}return null}function oo(t){const s=(t.split("/").filter(Boolean).pop()??t).replace(/\.(tsx?|jsx?|html?)$/,"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_\s]+/g," ").trim();return s?s.replace(/\b\w/g,n=>n.toUpperCase()):t}function um(t,e){const s=Eo(t,e)?.entry.$ref;if(typeof s!="string")return null;const n=s.split("/").pop()??"",i=t?.schema?.definitions?.[n]?.title;return typeof i=="string"&&i.trim()?i.trim():null}function ba(t,e){const s=Cn(t,e),n=im[s];if(n)return n;const a=um(t,s);return a&&a!==s&&!a.includes("/")?a:oo(s)}function va(t){return t?t.kind==="delete"?"deleted":t.baseVersion===null?"new":"changed":"published"}function pm(t){const e=new Map;for(const[s,n]of Object.entries(t??{}))e.set(Na(s),{name:s,change:n});return e}function Bs(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function fm(t){const{blocks:e,meta:s}=t,n=pm(t.changes),a=new Map,i=(x,w)=>{const P=a.get(x);P?P.push(w):a.set(x,[w])},r=new Set,c=new Map;for(const[x,w]of Object.entries(e)){if(!Bs(w))continue;const P=ya(s,e,w);if(!P)continue;const S=Na(x);r.add(S);const A=va(n.get(S)?.change);if(w.__resolveType===Xa){for(const[D,z]of Qr(x,w))i(P,{key:D,block:z,status:A});continue}const $={key:x,block:w,status:A};c.set(S,{type:P,entry:$}),i(P,$)}for(const[x,{name:w,change:P}]of n){if(P.kind!=="delete"||r.has(x))continue;const S=t.deleted?.[w];if(!Bs(S))continue;const A=ya(s,e,S);if(!A)continue;const $={key:w,block:S,status:"deleted"};c.set(x,{type:A,entry:$}),i(A,$)}const l=[];for(const[x,w]of a){if(Zr(x)||ll.has(x))continue;const P=xa(s,x)??"other";w.sort(mm(P)),l.push({id:x,group:P,title:ba(s,x),entries:w,changed:w.filter(S=>S.status!=="published").length})}l.sort((x,w)=>x.title.localeCompare(w.title));const d=l.find(x=>x.id===Ja)??null,u=d?l.filter(x=>x!==d):l,g=x=>u.filter(w=>w.group===x),m=g("pages")[0]??null,f=g("redirects")[0]??null,p=[m,f].filter(x=>!!x),y=u.filter(x=>!p.includes(x)&&x.entries.length===1),j=[...p,...u.filter(x=>!p.includes(x)&&x.entries.length>1).sort((x,w)=>w.entries.length-x.entries.length||x.title.localeCompare(w.title))],T=new Map(l.map(x=>[x.id,x])),v=new Map,k=x=>{const w=T.get(x)??v.get(x);if(w)return w;const P={id:x,group:x?xa(s,x)??"other":"other",title:x?ba(s,x):"",entries:[],changed:0};return v.set(x,P),P},C=[];for(const[x,{name:w,change:P}]of n){const S=c.get(x);if(S){C.push({type:k(S.type),entry:S.entry});continue}const A=e[w];C.push({type:k(""),entry:{key:w,block:Bs(A)?A:{},status:va(P),...Bs(A)?{}:{orphan:!0}}})}return C.sort((x,w)=>+!x.type.title-+!w.type.title||x.type.title.localeCompare(w.type.title)||gt(x.entry).localeCompare(gt(w.entry))),{pages:m,redirects:f,collections:j,singletons:y,all:u,settings:d,changed:C,statusKnown:!!t.changes}}function mm(t){const e=s=>s.status==="new"?0:s.status==="deleted"?3:t==="pages"&&qt(Ds(s))==="/"?1:2;return(s,n)=>e(s)-e(n)||gt(s).localeCompare(gt(n))}function gm(t,e,s){if(e||t.length<=qn)return{shown:t,hidden:0};const n=t.slice(0,qn),a=s?t.slice(qn).find(i=>i.id===s):void 0;return a&&n.push(a),{shown:n,hidden:t.length-n.length}}function hm(t){try{return decodeURIComponent(t)}catch{return t}}function gt(t){const e=t.block.redirect,s=[t.block.name,t.block.from,Bs(e)?e.from:void 0];for(const n of s)if(typeof n=="string"&&n.trim())return n.trim();return hm(t.key)}function Ds(t){return typeof t.block.path=="string"?t.block.path:""}function xm(t){return Qa({[t.key]:t.block},t.key,0).length}function ym(t,e){const s=qt(t).split("/").filter(Boolean),n=qt(e.split(/[?#]/)[0]??"").split("/").filter(Boolean);for(let a=0;a<s.length;a++){const i=s[a]??"";if(i==="*"||i.startsWith("*"))return!0;if(a>=n.length)return!1;if(!i.startsWith(":")&&i!==n[a])return!1}return s.length===n.length}function bm(t,e){if(!e.startsWith("/"))return null;const s=t.filter(i=>i.status!=="deleted"),n=s.find(i=>qt(Ds(i))===qt(e));if(n)return n;const a=s.filter(i=>ym(Ds(i),e));return a.find(i=>!Ds(i).includes("*"))??a[0]??null}function js(t){const e=tc(t.block);return{from:e.from,to:e.to,kind:e.type}}const vm=["title","headline","heading","label","subtitle","text","description","href","url"];function rl(t){const e=s=>t.entries.some(n=>{const a=n.block[s];return typeof a=="string"&&a.trim()!==""});return vm.filter(s=>s!=="name"&&e(s)).slice(0,2)}function cl(t,e){const s=t.block[e];return typeof s=="string"?s.replace(/\s+/g," ").trim():""}function dl(t,e,s=[]){const n=e.trim().toLowerCase();return n?[gt(t),t.key,Ds(t),...Bs(t.block.redirect)||typeof t.block.to=="string"?[js(t).from,js(t).to]:[],...s.map(i=>cl(t,i))].some(i=>i.toLowerCase().includes(n)):!0}function ul(t){return(js(t).from.split(/[?#]/)[0]??"").split("/").filter(Boolean)}function km(t){const e=new Map;for(const r of t){const c=ul(r);if(c.length<2)continue;const l=c[0]??"";e.set(l,(e.get(l)??0)+1)}const s=[...e].filter(([,r])=>r>1).map(([r,c])=>({segment:r,count:c})).sort((r,c)=>c.count-r.count||r.segment.localeCompare(c.segment)),n=s.reduce((r,c)=>r+c.count,0),a=t.length-n;return s.length+(a>0?1:0)<2?[]:a>0?[...s,{segment:"",count:a}]:s}function wm(t,e,s){const n=ul(t),a=n.length>=2?n[0]??"":"";return e?a===e:!s.some(i=>i.segment&&i.segment===a)}const jm=9,Sm=12;function Cm(t){const e=new Map;for(const c of t){if(c.status!=="published")continue;const l=js(c).to;e.set(l,(e.get(l)??0)+1)}let s="",n=0;for(const[c,l]of e)l>n&&(s=c,n=l);if(n<=Sm)return{shown:t,folded:0};const a=[];let i=0,r=0;for(const c of t){const l=c.status==="published"&&js(c).to===s;if(l&&i>=jm){r++;continue}l&&i++,a.push(c)}return{shown:a,folded:r}}const Nm={pages:"oklch(0.62 0.17 289)",redirects:"oklch(0.64 0.13 245)",singleton:"oklch(0.66 0.09 75)",content:"oklch(0.6 0.1 270)",seo:"oklch(0.65 0 0)"};function Po(){const t=ce.c(2),e=Pe();let s;return t[0]!==e?(s=n=>n.id==="page"?e("siteEditor.contentTypes.pages"):n.id==="redirect"?e("siteEditor.contentTypes.redirects"):n.id==="cms-settings"?e("siteEditor.contentTypes.settings"):n.title,t[0]=e,t[1]=s):s=t[1],s}function Tm(t){const e=ce.c(64),{tree:s,view:n,openTypeId:a,onSelect:i,onOpenEntry:r,settings:c}=t,l=Pe(),d=Po(),[u,g]=K.useState(""),[m,f]=K.useState(!1);let p,y,j,T,v,k,C;if(e[0]!==d||e[1]!==r||e[2]!==i||e[3]!==a||e[4]!==u||e[5]!==m||e[6]!==l||e[7]!==s.changed.length||e[8]!==s.collections||e[9]!==s.pages?.id||e[10]!==s.redirects?.id||e[11]!==s.singletons||e[12]!==n){const S=u.trim().toLowerCase(),A=E=>!S||d(E).toLowerCase().includes(S)||E.entries.some(te=>dl(te,S,rl(E))),$=a||(n.kind==="type"?n.id:null);let D;e[20]!==$?(D=E=>$===E.id,e[20]=$,e[21]=D):D=e[21];const z=D;let L;e[22]!==z||e[23]!==d||e[24]!==r||e[25]!==i?(L=(E,te,ue)=>{const B=ue===void 0?!1:ue;return o.jsx(wa,{label:d(E),dot:te,count:B?void 0:E.entries.length,changed:E.changed>0,active:z(E),onClick:()=>{const G=E.entries[0];B&&G&&G.status!=="deleted"?r(E,G):i({kind:"type",id:E.id})}},E.id)},e[22]=z,e[23]=d,e[24]=r,e[25]=i,e[26]=L):L=e[26];const b=L,_=s.collections.filter(A),I=S?{shown:_,hidden:0}:gm(_,m,$),M=s.singletons.filter(A),X=!S||l("siteEditor.contentTypes.seo").toLowerCase().includes(S);let Q;e[27]!==s.pages?.id||e[28]!==s.redirects?.id?(Q=E=>E.id===s.pages?.id?"pages":E.id===s.redirects?.id?"redirects":"content",e[27]=s.pages?.id,e[28]=s.redirects?.id,e[29]=Q):Q=e[29];const J=Q;e[30]!==l?(v=l("sandbox.collectionsSidebar.content"),e[30]=l,e[31]=v):v=e[31],k="w-[232px] shrink-0 border-r flex flex-col min-h-0";let H;e[32]===Symbol.for("react.memo_cache_sentinel")?(H=E=>g(E.target.value),e[32]=H):H=e[32];let W;e[33]!==l?(W=l("siteEditor.contentTypes.searchContent"),e[33]=l,e[34]=W):W=e[34];let O;e[35]!==l?(O=l("siteEditor.contentTypes.searchContent"),e[35]=l,e[36]=O):O=e[36],e[37]!==u||e[38]!==W||e[39]!==O?(C=o.jsx("div",{className:"px-2.5 pt-3 pb-1 shrink-0",children:o.jsx("input",{type:"search",value:u,onChange:H,placeholder:W,"aria-label":O,className:"w-full rounded-lg bg-muted/60 px-3 py-1.5 text-[13px] outline-none placeholder:text-muted-foreground"})}),e[37]=u,e[38]=W,e[39]=O,e[40]=C):C=e[40],p="flex-1 min-h-0 overflow-y-auto px-2.5 pb-4 flex flex-col gap-px",e[41]!==i||e[42]!==a||e[43]!==l||e[44]!==s.changed.length||e[45]!==n?(y=s.changed.length>0&&o.jsxs("button",{type:"button",onClick:()=>i({kind:"changes"}),className:we("mt-1.5 mb-0.5 flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-left text-sm font-medium cursor-pointer","bg-warning/10 text-warning hover:bg-warning/15",n.kind==="changes"&&!a&&"ring-1 ring-warning/40"),children:[o.jsx("span",{className:"size-2 shrink-0 rounded-full bg-warning"}),o.jsx("span",{className:"flex-1 truncate",children:l("siteEditor.contentTypes.changesInDraft")}),o.jsx("span",{className:"text-xs tabular-nums",children:s.changed.length})]}),e[41]=i,e[42]=a,e[43]=l,e[44]=s.changed.length,e[45]=n,e[46]=y):y=e[46],j=I.shown.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(ka,{label:l("siteEditor.contentTypes.group.collections")}),I.shown.map(E=>b(E,J(E))),!S&&(I.hidden>0||m)&&o.jsx("button",{type:"button",onClick:()=>f(Em),className:"px-2.5 py-1 text-left text-xs text-muted-foreground hover:text-foreground cursor-pointer",children:m?l("siteEditor.contentTypes.showFewer"):l("siteEditor.contentTypes.showAll",{count:s.collections.length})})]}),T=(X||M.length>0)&&o.jsxs(o.Fragment,{children:[o.jsx(ka,{label:l("siteEditor.contentTypes.group.singletons")}),X&&o.jsx(wa,{label:l("siteEditor.contentTypes.seo"),dot:"seo",active:n.kind==="seo"&&!a,onClick:()=>i({kind:"seo"})}),M.map(E=>b(E,"singleton",!0))]}),e[0]=d,e[1]=r,e[2]=i,e[3]=a,e[4]=u,e[5]=m,e[6]=l,e[7]=s.changed.length,e[8]=s.collections,e[9]=s.pages?.id,e[10]=s.redirects?.id,e[11]=s.singletons,e[12]=n,e[13]=p,e[14]=y,e[15]=j,e[16]=T,e[17]=v,e[18]=k,e[19]=C}else p=e[13],y=e[14],j=e[15],T=e[16],v=e[17],k=e[18],C=e[19];let x;e[47]!==p||e[48]!==y||e[49]!==j||e[50]!==T?(x=o.jsxs("div",{className:p,children:[y,j,T]}),e[47]=p,e[48]=y,e[49]=j,e[50]=T,e[51]=x):x=e[51];let w;e[52]!==i||e[53]!==a||e[54]!==c||e[55]!==l||e[56]!==n?(w=c&&o.jsx("div",{className:"shrink-0 border-t px-2.5 py-2","data-testid":"content-sidebar-settings",children:o.jsx(pl,{label:l("siteEditor.contentTypes.settings"),marker:o.jsx(Xn,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),changed:c.changed,active:n.kind==="settings"&&!a,onClick:()=>i({kind:"settings"})})}),e[52]=i,e[53]=a,e[54]=c,e[55]=l,e[56]=n,e[57]=w):w=e[57];let P;return e[58]!==v||e[59]!==k||e[60]!==C||e[61]!==x||e[62]!==w?(P=o.jsxs("nav",{"aria-label":v,className:k,children:[C,x,w]}),e[58]=v,e[59]=k,e[60]=C,e[61]=x,e[62]=w,e[63]=P):P=e[63],P}function Em(t){return!t}function ka(t){const e=ce.c(2),{label:s}=t;let n;return e[0]!==s?(n=o.jsx("div",{className:"px-2.5 pt-4 pb-1 text-xs text-muted-foreground/70",children:s}),e[0]=s,e[1]=n):n=e[1],n}function wa(t){const e=ce.c(8);let s,n;e[0]!==t?({dot:s,...n}=t,e[0]=t,e[1]=s,e[2]=n):(s=e[1],n=e[2]);const a=Nm[s];let i;e[3]!==a?(i=o.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:a}}),e[3]=a,e[4]=i):i=e[4];let r;return e[5]!==n||e[6]!==i?(r=o.jsx(pl,{...n,marker:i}),e[5]=n,e[6]=i,e[7]=r):r=e[7],r}function pl(t){const e=ce.c(17),{label:s,marker:n,count:a,changed:i,active:r,onClick:c}=t,l=Pe(),d=r?"page":void 0,u=r?"bg-accent text-accent-foreground font-medium":"text-foreground/80 hover:bg-accent hover:text-foreground";let g;e[0]!==u?(g=we("flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",u),e[0]=u,e[1]=g):g=e[1];let m;e[2]!==s?(m=o.jsx("span",{className:"flex-1 truncate",children:s}),e[2]=s,e[3]=m):m=e[3];let f;e[4]!==i||e[5]!==l?(f=i&&o.jsx("span",{title:l("siteEditor.contentTypes.status.changed"),className:"size-1.5 shrink-0 rounded-full bg-warning"}),e[4]=i,e[5]=l,e[6]=f):f=e[6];let p;e[7]!==a?(p=a!==void 0&&o.jsx("span",{className:"shrink-0 text-xs font-normal tabular-nums text-muted-foreground/70",children:a}),e[7]=a,e[8]=p):p=e[8];let y;return e[9]!==n||e[10]!==c||e[11]!==d||e[12]!==g||e[13]!==m||e[14]!==f||e[15]!==p?(y=o.jsxs("button",{type:"button",onClick:c,"aria-current":d,className:g,children:[n,m,f,p]}),e[9]=n,e[10]=c,e[11]=d,e[12]=g,e[13]=m,e[14]=f,e[15]=p,e[16]=y):y=e[16],y}const Pm={published:"success",changed:"warning",new:"info",deleted:"destructive"},Am={published:"siteEditor.contentTypes.status.published",changed:"siteEditor.contentTypes.status.changed",new:"siteEditor.contentTypes.status.new",deleted:"siteEditor.contentTypes.status.deleted"};function _m(t){const e=ce.c(82),{tree:s,type:n,onOpen:a,onRestore:i,restoring:r,createLabel:c,onCreate:l,rowMenu:d}=t,u=Pe(),g=Po(),[m,f]=K.useState(""),[p,y]=K.useState("all"),[j,T]=K.useState(!1),v=s.statusKnown;let k,C,x,w,P;if(e[0]!==c||e[1]!==p||e[2]!==v||e[3]!==g||e[4]!==l||e[5]!==a||e[6]!==i||e[7]!==m||e[8]!==r||e[9]!==d||e[10]!==u||e[11]!==s.changed||e[12]!==s.pages?.entries||e[13]!==s.singletons||e[14]!==n||e[15]!==j){const $=n?n.entries.map(q=>({type:n,entry:q})):s.changed,D=n?rl(n):[],z=$.filter(Im).length,L=n?.group==="redirects"?km(n.entries):[],b=p==="changed"&&v,_=p.startsWith("path:")?p.slice(5):null,I=$.filter(q=>(!b||q.entry.status!=="published")&&(_===null||wm(q.entry,_,L))&&dl(q.entry,m,n?D:[])),M=n?.group==="redirects"&&p==="all"&&!m.trim()&&!j?Cm(I.map(Lm)):null,X=M&&M.folded>0?new Set(M.shown):null,Q=X?I.filter(q=>X.has(q.entry)):I;let J;e[21]!==s.singletons?(J=new Set(s.singletons.map(Om)),e[21]=s.singletons,e[22]=J):J=e[22];const H=J;let W;e[23]!==g||e[24]!==H||e[25]!==u?(W=q=>{const{type:ie,entry:ke}=q;return ie.id===Ja?u("siteEditor.contentTypes.settings"):H.has(ie.id)&&typeof ke.block.name!="string"?g(ie):gt(ke)},e[23]=g,e[24]=H,e[25]=u,e[26]=W):W=e[26];const O=W,E=n?n.group==="pages"?"pages":n.group==="redirects"?"redirects":"other":"changes";let te;e[27]!==s.pages?.entries?(te=s.pages?.entries??[],e[27]=s.pages?.entries,e[28]=te):te=e[28];const ue=te;let B;if(e[29]!==E||e[30]!==g||e[31]!==u||e[32]!==n){const q=n?g(n):u("siteEditor.contentTypes.changesInDraft");B=E==="redirects"?u("siteEditor.contentTypes.searchRedirects"):u("siteEditor.contentTypes.search",{type:q.toLowerCase()}),e[29]=E,e[30]=g,e[31]=u,e[32]=n,e[33]=B}else B=e[33];const G=B,me=$m;let pe;e[34]===Symbol.for("react.memo_cache_sentinel")?(pe=q=>!me(q)&&!q.entry.orphan,e[34]=pe):pe=e[34];const xe=pe;let ge;e[35]===Symbol.for("react.memo_cache_sentinel")?(ge=(q,ie,ke)=>{const he=ke===void 0?!1:ke;return o.jsx("span",{className:we((he||me(q))&&"text-muted-foreground",me(q)&&"line-through"),children:ie})},e[35]=ge):ge=e[35];const ne=ge,ye=Rm,se=[];if(E==="redirects"){let q;e[36]===Symbol.for("react.memo_cache_sentinel")?(q=he=>ne(he,ye(he)?.from),e[36]=q):q=e[36];let ie;e[37]!==ue?(ie=he=>{const Ke=ye(he)?.to??"",Me=bm(ue,Ke);return o.jsxs("span",{className:"flex min-w-0 items-baseline gap-2",children:[Me&&ne(he,gt(Me)),ne(he,Ke,!0)]})},e[37]=ue,e[38]=ie):ie=e[38];let ke;e[39]!==u?(ke=he=>ye(he)?.kind==="permanent"?u("siteEditor.contentTypes.kind.permanent"):u("siteEditor.contentTypes.kind.temporary"),e[39]=u,e[40]=ke):ke=e[40],se.push({id:"from",header:u("siteEditor.contentTypes.column.from"),render:q},{id:"to",header:u("siteEditor.contentTypes.column.to"),render:ie},{id:"kind",header:u("siteEditor.contentTypes.column.kind"),render:ke})}else{let q;if(e[41]!==O?(q=ie=>ne(ie,O(ie)),e[41]=O,e[42]=q):q=e[42],se.push({id:"name",header:u("siteEditor.contentTypes.column.name"),render:q}),E==="pages"){let ie;e[43]===Symbol.for("react.memo_cache_sentinel")?(ie=ke=>ne(ke,Ds(ke.entry),!0),e[43]=ie):ie=e[43],se.push({id:"path",header:u("siteEditor.contentTypes.column.path"),render:ie},{id:"sections",header:u("siteEditor.contentTypes.column.sections"),render:Dm})}if(E==="changes"){let ie;e[44]!==g?(ie=ke=>ke.type.title?g(ke.type):"",e[44]=g,e[45]=ie):ie=e[45],se.push({id:"type",header:u("siteEditor.contentTypes.column.type"),render:ie})}if(E==="other")for(const ie of D)se.push({id:`field:${ie}`,header:oo(ie),render:ke=>ne(ke,cl(ke.entry,ie))})}let re;if(e[46]!==v||e[47]!==i||e[48]!==r||e[49]!==u?(re=q=>v?o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(An,{variant:Pm[q.entry.status],children:u(Am[q.entry.status])}),me(q)&&o.jsx(ja,{children:o.jsxs($e,{size:"xs",variant:"outline",disabled:r!==null,onClick:()=>i(q.entry),children:[r===q.entry.key&&o.jsx(mt,{className:"size-3"}),u("siteEditor.contentTypes.restore")]})})]}):o.jsx("span",{className:"text-muted-foreground",children:u("siteEditor.contentTypes.status.checking")}),e[46]=v,e[47]=i,e[48]=r,e[49]=u,e[50]=re):re=e[50],se.push({id:"status",header:u("siteEditor.contentTypes.column.status"),render:re}),d){let q;e[51]!==d?(q=ie=>me(ie)?null:o.jsx(ja,{children:d(ie.type,ie.entry)}),e[51]=d,e[52]=q):q=e[52],se.push({id:"actions",header:"",render:q,cellClassName:"w-12 shrink-0"})}const de=Bm;let Z;e[53]!==p||e[54]!==m||e[55]!==u||e[56]!==n?(Z=m.trim()?u("siteEditor.contentTypes.noMatch"):u(n?p==="changed"?"siteEditor.contentTypes.noChangedHere":"siteEditor.contentTypes.empty":"siteEditor.contentTypes.noChanges"),e[53]=p,e[54]=m,e[55]=u,e[56]=n,e[57]=Z):Z=e[57];const N=Z;w="flex h-full min-w-0 flex-col overflow-y-auto";let oe;e[58]===Symbol.for("react.memo_cache_sentinel")?(oe=we("flex shrink-0 flex-wrap items-center gap-2",pr),e[58]=oe):oe=e[58];let fe;e[59]===Symbol.for("react.memo_cache_sentinel")?(fe=q=>{q.key==="Escape"&&(f(""),q.currentTarget.blur())},e[59]=fe):fe=e[59];let je;e[60]!==m||e[61]!==G?(je=o.jsx("div",{ref:de,className:"w-full max-w-[280px]",children:o.jsx(ed,{value:m,onChange:f,placeholder:G,onKeyDown:fe})}),e[60]=m,e[61]=G,e[62]=je):je=e[62];const Se=n&&o.jsxs(td,{type:"single",variant:"segmented",size:"sm",value:p,onValueChange:q=>q&&y(q),"aria-label":u("siteEditor.contentTypes.filter"),children:[o.jsx(Un,{value:"all",children:u("siteEditor.contentTypes.filter.all",{count:$.length})}),v&&o.jsx(Un,{value:"changed",children:u("siteEditor.contentTypes.filter.changed",{count:z})}),L.map(q=>o.jsx(Un,{value:`path:${q.segment}`,children:q.segment?`${oo(q.segment)} ${q.count}`:u("siteEditor.contentTypes.filter.otherPaths",{count:q.count})},q.segment||"-"))]});let Ce;e[63]!==c||e[64]!==l?(Ce=l&&c&&o.jsxs($e,{size:"sm",className:"ml-auto",onClick:l,children:[o.jsx(En,{size:16}),c]}),e[63]=c,e[64]=l,e[65]=Ce):Ce=e[65],e[66]!==je||e[67]!==Se||e[68]!==Ce?(P=o.jsxs("div",{className:oe,children:[je,Se,Ce]}),e[66]=je,e[67]=Se,e[68]=Ce,e[69]=P):P=e[69],k="flex flex-1 flex-col px-4 pb-4";let Ae;e[70]!==a?(Ae=q=>a(q.type,q.entry),e[70]=a,e[71]=Ae):Ae=e[71];let _e;e[72]!==N?(_e=o.jsx(ft,{title:N}),e[72]=N,e[73]=_e):_e=e[73],C=o.jsx(sd,{columns:se,data:Q,onRowClick:Ae,isRowClickable:xe,emptyState:_e}),x=M&&M.folded>0&&o.jsx("div",{className:"py-2",children:o.jsx($e,{variant:"ghost",size:"sm",onClick:()=>T(!0),children:u("siteEditor.contentTypes.folded",{count:M.folded})})}),e[0]=c,e[1]=p,e[2]=v,e[3]=g,e[4]=l,e[5]=a,e[6]=i,e[7]=m,e[8]=r,e[9]=d,e[10]=u,e[11]=s.changed,e[12]=s.pages?.entries,e[13]=s.singletons,e[14]=n,e[15]=j,e[16]=k,e[17]=C,e[18]=x,e[19]=w,e[20]=P}else k=e[16],C=e[17],x=e[18],w=e[19],P=e[20];let S;e[74]!==k||e[75]!==C||e[76]!==x?(S=o.jsxs("div",{className:k,children:[C,x]}),e[74]=k,e[75]=C,e[76]=x,e[77]=S):S=e[77];let A;return e[78]!==w||e[79]!==P||e[80]!==S?(A=o.jsxs("div",{className:w,children:[P,S]}),e[78]=w,e[79]=P,e[80]=S,e[81]=A):A=e[81],A}function Bm(t){const e=t?.querySelector("input");if(!e)return;const s=n=>{if(n.key!=="/"||n.metaKey||n.ctrlKey)return;const a=n.target;a&&(a.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(a.tagName))||(n.preventDefault(),e.focus())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)}function Dm(t){return xm(t.entry)}function Rm(t){return t.type.group==="redirects"?js(t.entry):null}function $m(t){return t.entry.status==="deleted"}function Om(t){return t.id}function Lm(t){return t.entry}function Im(t){return t.entry.status!=="published"}function ja(t){const e=ce.c(2),{children:s}=t;let n;return e[0]!==s?(n=o.jsx("span",{className:"inline-flex",onClick:Fm,onKeyDown:Km,children:s}),e[0]=s,e[1]=n):n=e[1],n}function Km(t){return t.stopPropagation()}function Fm(t){return t.stopPropagation()}const Sa=K.lazy(()=>xt(()=>import("./app-editor-BSqFGCuO.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])).then(t=>({default:t.AppEditor}))),Ca=K.lazy(()=>xt(()=>import("./cms-settings-editor-Bl0s5YWk.js"),__vite__mapDeps([143,1,2,60,61,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,62,63,64,65,66,67,68,69,70,71,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,25,23,24,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,22,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,20,21,52,53,54,55,56,57,106,107,108,109,110,111,112,113,114,115,58,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,0,59,131,132,133,134,135,136,137,138,139,140,141,142])).then(t=>({default:t.CmsSettingsEditor}))),zm=K.lazy(()=>xt(()=>import("./post-editor-B-zzeLVe.js"),__vite__mapDeps([144,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,27,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,69,145,137,53,75,76,21,126,123,114,115,60,61,62,63,64,65,66,67,68,70,71,25,23,24,72,73,74,77,78,79,80,81,82,83,84,85,86,87,22,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,20,52,54,55,56,57,106,107,108,109,110,111,112,113,58,116,117,118,119,120,121,122,124,125,127,128,129,146,147,148,149,139,150,133,151,152,130,131,132,134,135,136,138,140,141,142])).then(t=>({default:t.PostEditor}))),Mm=K.lazy(()=>xt(()=>import("./record-editor-DtXYbHpV.js"),__vite__mapDeps([153,1,2,69,54,55,24,35,115,60,61,26,27,28,29,30,31,32,33,34,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,62,63,64,65,66,67,68,70,71,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,25,23,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,22,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,20,21,52,53,56,57,106,107,108,109,110,111,112,113,114,58,116,117,118,119,120,121,122,123,124,125,126,127,128,129,150,152,130,131,132,133,134,135,136,137,138,139,140,141,142])).then(t=>({default:t.RecordEditor}))),Vm=K.lazy(()=>xt(()=>import("./context-DkOsTTFI.js"),__vite__mapDeps([154,1,2,108,30,45,75,76,46,69,109,110,55,111,112,113,26,27,28,29,31,32,33,34,35,36,37,38,39,40,41,42,43,44,47,48,49,50,51,101,102,7,8,9,12,103,3,4,5,6,10,11,13,14,15,16,17,18,19,104,105,20,21,22,23,24,25,52,53,54,56,57,61,106,107,137,114,115,60,62,63,64,65,66,67,68,70,71,72,73,74,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,58,116,117,118,119,120,121,122,123,124,125,126,127,128,129,152,155,147,149,139,156,157,133,148,130,131,132,134,135,136,138,140,141,142])).then(t=>({default:t.BlogContext}))),Um=K.lazy(()=>xt(()=>import("./category-editor-BRFXJMj8.js"),__vite__mapDeps([158,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,27,31,26,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,69,54,55,24,150,60,61,62,63,64,65,66,67,68,70,71,25,23,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,22,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,20,21,52,53,56,57,106,107,108,109,110,111,112,113,114,115,58,116,117,118,119,120,121,122,123,124,125,126,127,128,129,146,147,148,149,139,136,151,152,130,131,132,133,134,135,137,138,140,141,142])).then(t=>({default:t.CategoryEditor}))),Gm=K.lazy(()=>xt(()=>import("./sections-editor-CyIATot1.js"),__vite__mapDeps([159,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,60,61,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,62,63,64,65,66,67,68,69,70,71,25,23,24,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,22,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,20,21,52,53,54,55,56,57,106,107,108,109,110,111,112,113,114,115,58,116,117,118,119,120,121,122,123,124,125,126,127,128,129,133,59,160,161,136,162])).then(t=>({default:t.SectionsEditor}))),Hm=K.lazy(()=>xt(()=>import("./seo-editor-C0rSQsv3.js").then(t=>t.s),__vite__mapDeps([160,1,2,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,58,55,60,61,62,63,64,65,66,67,68,69,70,71,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,25,23,24,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,22,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,20,21,52,53,54,56,57,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129])).then(t=>({default:t.SeoEditor}))),Ym=K.lazy(()=>xt(()=>import("./variant-calendar-WNfoLO6H.js"),__vite__mapDeps([163,1,2,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,69,58,55,114,23,24,122,123,135])).then(t=>({default:t.VariantCalendar}))),Wm=K.lazy(()=>xt(()=>import("./post-calendar-DEqb8d3G.js"),__vite__mapDeps([164,1,2,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,58,55,135,60,61,62,63,64,65,66,67,68,69,70,71,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,25,23,24,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,22,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,20,21,52,53,54,56,57,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,136,137,138,139,140,141,142])).then(t=>({default:t.PostCalendar}))),qm=K.lazy(()=>xt(()=>import("./redirect-editor-BGoLXzQs.js"),__vite__mapDeps([165,1,2,53,41,69,54,55,24,35,60,61,26,27,28,29,30,31,32,33,34,36,37,38,39,40,42,43,44,45,46,47,48,49,50,51,62,63,64,65,66,67,68,70,71,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,25,23,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,22,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,20,21,52,56,57,106,107,108,109,110,111,112,113,114,115,58,116,117,118,119,120,121,122,123,124,125,126,127,128,129,152])).then(t=>({default:t.RedirectEditor})));function Xm(t){return bi(t)!==null||t===Xa||t==="redirect"||uc.has(t)}function Jm(t,e,s=!1){return t==="context"&&!e?"posts":s&&t==="calendar"?"pages":t}function Qm(t,e){return t&&(ys(t)||e&&t==="sections")?t:null}function Zm(t){const e=ce.c(36),{deepLinkPage:s}=t,{currentBranch:n,virtualMcpId:a}=uo(),{org:i}=wl(),r=Ec(),c=Pc(),{runtime:l,previewServerUrl:d}=yo(a),u=l==="cms",g=xo(a,n);let m,f;e[0]!==g||e[1]!==u||e[2]!==c.previewState||e[3]!==r.lifecycle.phase?(m=Ya(g),f=Qd({fastPreviewActive:u||m,previewState:c.previewState,lifecyclePhase:r.lifecycle.phase}),e[0]=g,e[1]=u,e[2]=c.previewState,e[3]=r.lifecycle.phase,e[4]=m,e[5]=f):(m=e[4],f=e[5]);const p=f;if(p.kind==="sandbox-card"){const k=`/${i.slug}/settings/connections`;let C;return e[6]!==p.state||e[7]!==c.start||e[8]!==k||e[9]!==r.lifecycle||e[10]!==r.phase?(C=o.jsx(Xd,{state:p.state,claimPhase:r.phase,lifecycle:r.lifecycle,onStart:c.start,connectionsHref:k}),e[6]=p.state,e[7]=c.start,e[8]=k,e[9]=r.lifecycle,e[10]=r.phase,e[11]=C):C=e[11],C}if(!a||!n){let k;return e[12]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(ft,{title:"Waiting for sandbox context…"}),e[12]=k):k=e[12],k}if(sc(g)){let k;return e[13]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(ac,{}),e[13]=k):k=e[13],k}if(g.kind==="pending"){let k;return e[14]!==g?(k=o.jsx(ic,{backend:g}),e[14]=g,e[15]=k):k=e[15],k}let y;e[16]!==n||e[17]!==g||e[18]!==i.slug||e[19]!==a?(y=g.kind==="legacy"?void 0:JSON.stringify([i.slug,a,n,_r(g)]),e[16]=n,e[17]=g,e[18]=i.slug,e[19]=a,e[20]=y):y=e[20];const j=m?null:c.previewUrl;let T;e[21]!==g||e[22]!==u||e[23]!==c.previewUrl||e[24]!==d?(T=g.kind==="protocol"&&g.source==="local"?Br(g):u?d:c.previewUrl,e[21]=g,e[22]=u,e[23]=c.previewUrl,e[24]=d,e[25]=T):T=e[25];let v;return e[26]!==n||e[27]!==s||e[28]!==p.devServerReady||e[29]!==p.sandboxWarming||e[30]!==i.slug||e[31]!==y||e[32]!==j||e[33]!==T||e[34]!==a?(v=o.jsx(eg,{orgSlug:i.slug,virtualMcpId:a,branch:n,previewUrl:j,sitePreviewUrl:T,deepLinkPage:s,devServerReady:p.devServerReady,sandboxWarming:p.sandboxWarming},y),e[26]=n,e[27]=s,e[28]=p.devServerReady,e[29]=p.sandboxWarming,e[30]=i.slug,e[31]=y,e[32]=j,e[33]=T,e[34]=a,e[35]=v):v=e[35],v}function eg({orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,sitePreviewUrl:a,deepLinkPage:i,devServerReady:r,sandboxWarming:c}){const l=Pe(),d=Tn()?.taskId??null,u={orgSlug:t,virtualMcpId:e,branch:s,threadId:d,previewUrl:n},g=xo(e,s),m=g.kind!=="legacy",f=!Ya(g),p=g.kind==="protocol"&&g.source==="github";jl(p);const y=or({orgSlug:t,virtualMcpId:e,branch:s}),j=p,T=p&&g.kind==="protocol"?g:null,v=T?Dr({orgSlug:t,virtualMcpId:e,branch:s},T):null,k=Rr(T,v),C=$r(T,v,k.data),x=xc({orgSlug:t,virtualMcpId:e,branch:s,refresh:()=>k.refetch()}),w=Po(),[P,S]=K.useState(null),[A,$]=K.useState(null),[D,z]=K.useState(null),L=ar()===void 0,{data:b,isLoading:_}=Or(u,{fetchEnabled:r}),I={orgSlug:t,virtualMcpId:e,branch:s},M=Lr(p?I:null,Xm),X=Lo(p?I:null,M),Q=Ta({strict:!1}),[J,H]=K.useState(()=>Qm(Q.contentCollection,!f)??"pages"),W=ni(),O=oi(e),E=Jm(J,W,!f),{openPanel:te}=jc(),ue={open:(h,R)=>{h==="campaigns"?te("calendar"):te("experiments",{search:R?ee=>({...ee,test:R}):void 0})}},[B,G]=K.useState(()=>Q.contentItem&&(ys(E)||E==="sections")?{collection:E,key:Q.contentItem}:null),me=B&&"key"in B?B.key:null,pe=me??A?.key??null,xe=pe===null?[]:[Vs(pe,b??{})?.block??pe],ge=Lo(p?I:null,[...xe,...E==="context"?[Ri,$i,zi]:[]],{withRefs:!0}),ne={ready:X.ready&&ge.ready,failed:X.failed||ge.failed,retry:()=>{X.retry(),ge.retry()}},[ye,se]=K.useState(null),re=K.useRef(null),[de,Z]=K.useState(!1),{data:N,isLoading:oe}=nc(u,{fetchEnabled:r,refetchInterval:h=>{const R=h.state.data;let ee;if(E==="apps"&&B&&B.collection==="apps"){const be=b?.[B.key];ee=typeof be?.__resolveType=="string"?be.__resolveType:void 0}else if(E==="site"&&b){const be=R?Ko(b,R):null,De=b.site;ee=be?.resolveType??(typeof De?.__resolveType=="string"?De.__resolveType:void 0)}const F=id({resolveType:ee,meta:R,reads:h.state.dataUpdateCount+h.state.errorUpdateCount,window:re.current});re.current=F.window;const ae=F.interval!==!1;return Z(be=>be===ae?be:ae),F.interval}}),fe=!!(i?.pageId||i?.path||i?.pathTemplate),[je,Se]=K.useState(!1);if(fe&&!je&&B===null&&b&&!oe){Se(!0);const h=oc(Io(b,N),i??{});h&&(H("pages"),G({collection:"pages",key:h.key,path:h.path}))}const[Ce,Ae]=K.useState(""),[_e,q]=K.useState("list"),ie=h=>{G(h),se(null)},[ke,he]=K.useState(E);ke!==E&&(he(E),Ae(""));const{createTask:Ke}=uo(),Me=yo(e),Ge=Ud(e,N??void 0),tt=Ga(e).url,We=ro("site_apps_install_enabled"),qe=We&&Ge!==null&&!tt,Xe=N&&b?$d(Ge?ui(Ge):[],N,b):[],Fe=Vd({orgSlug:t,virtualMcpId:e,branch:s}),st=We?qe?Me.resolved?Me.runtime==="cms"?{reason:l("sandbox.appEditor.installNeedsCodingSession"),action:{label:l("chat.fastPreview.startCodingSession"),onClick:()=>Ke({runtime:"sandbox"})}}:null:{reason:l("sandbox.appInstallPanel.sessionLoading")}:{reason:l("sandbox.appInstallPanel.unavailable")}:{reason:l("sandbox.appInstallPanel.flagOff")},yt=h=>{if(Me.resolved&&!Fe.isPending){if(Me.runtime==="cms"){ve.error(l("sandbox.appEditor.installNeedsCodingSession"),{action:{label:l("chat.fastPreview.startCodingSession"),onClick:()=>Ke({runtime:"sandbox"})}});return}Fe.mutate({blockKey:h.id},{onSuccess:R=>ie({collection:"apps",key:R.key}),onError:R=>ve.error(R.message)})}},Te=Nn(u),V=Ir(u),Be=yc(u),Ne=Op({orgSlug:t,virtualMcpId:e,branch:s,decofile:b??{},onMoved:(h,R)=>G(ee=>ee?.collection==="posts"&&ee.key===h?{collection:"posts",key:R}:ee)}),[Re,Ue]=K.useState(null),[dt,bt]=K.useState(),[In,Ks]=K.useState(!1),[Fs,vt]=K.useState(),[Je,kt]=K.useState(null),[Le,Qe]=K.useState(null),At=(h,R)=>{if(!m){Qe({kind:"redirect",key:h,label:R});return}const ee=Vs(h,b??{}),F=ee?b?.[ee.block]:void 0;if(ee&&!Do(F)){ve.error(l("sectionsEditor.hosted.blockLoadFailed"));return}Qe({kind:"redirect",key:h,label:R,rule:ee&&Do(F)?{...ee,body:F}:null})},Ss=Le?.kind==="blog"?qs[Le.blogKind]:Le?.kind??"item",_t=Le?.kind==="section"?l(ga("section",p,{neverPublished:y(Le.key)}),{label:Le.label}):Le?l(ga("block",p,{neverPublished:y(Le.key)}),{label:Le.label}):null,Bt=l("sandbox.contentBrowser.deleteDialog.title",{noun:Ss}),cs=pu(_t===null?null:{title:Bt,description:_t},p),[Dt,Rt]=K.useState(null),ds=!b||!N;if(_||oe||L||ds&&c)return o.jsx("div",{className:"h-full w-full flex items-center justify-center",children:o.jsx(mt,{className:"size-5 text-muted-foreground"})});if(ds)return o.jsx(ft,{title:"Could not load site data."});if(Kr(N))return o.jsx(ir,{orgSlug:t,virtualMcpId:e,branch:s,decofile:b});const nt=Io(b,N).sort((h,R)=>h.name.localeCompare(R.name)),$t=lc(b).sort((h,R)=>h.from.localeCompare(R.from)),Ot=rc(b,N),Xt=E==="sections"?cc(N):[],lt=Ko(b,N),ot=vi(b),Lt=ko.some(h=>ot[h].length>0),Jt=ys(E)?ot[E]:[],It=Ro(N,"loaders"),Qt=Ro(N,"actions"),Cs=f?["settings"]:["calendar","apps",...lt?[]:["site"],...Qt===0?["actions"]:[],...zo(N)?[]:["settings"]];if(!dc(b,N)&&!Lt&&It===0&&Qt===0)return o.jsx(ft,{icon:Js,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const Zt={pages:nt.length,sections:Ot.length,apps:f?Xe.length:0,loaders:It,actions:Qt,redirects:$t.length,posts:ot.posts.length,authors:ot.authors.length,categories:ot.categories.length},Kt=new Set(nt.map(h=>qt(h.path))),es=new Set(nt.map(h=>h.name)),ts=new Set(Ot.map(h=>h.name)),Ve=j?fm({blocks:b,meta:N,changes:k.data?.changes,deleted:C.data}):null,Ft=Ve?.pages??Ve?.all[0]??null,us=Ft?{kind:"type",id:Ft.id}:{kind:"seo"},zt=h=>h?.kind==="type"?Ve?.all.find(R=>R.id===h.id)??null:null,Mt=zo(N),He=P&&(P.kind==="type"?zt(P):P.kind!=="settings"||Mt)?P:us,wt=zt(He);if(j&&B){const h=B.collection==="available-section"?"sections":B.collection==="available-app"?"apps":B.collection;J!==h&&H(h)}const ut=j&&(B!==null||A!==null&&(E==="loaders"||E==="settings")),Vt=A?A.from:He,jt=Vt&&Vt.kind==="type"&&!zt(Vt)?us:Vt,Ns=h=>{if(A?.key!==h)return;const R=Ve?.all.find(F=>F.id===A.typeId),ee=R?.entries.find(F=>F.key===h);if(!(!R||!ee||R.entries.length<2))return`${w(R)} · ${gt(ee)}`},St=()=>{$(null),G(null),se(null)},ps=(h,R,ee)=>{se(null),$({typeId:h.id,key:R.key,from:ee}),h.group==="pages"?G({collection:"pages",key:R.key,path:typeof R.block.path=="string"?R.block.path:"/"}):h.group==="redirects"?G({collection:"redirects",key:R.key}):h.group==="sections"?G({collection:"sections",key:R.key}):h.group==="loaders"?(G(null),H("loaders")):h.id==="cms-settings"?($(null),G(null),S({kind:"settings"})):G({collection:"apps",key:R.key})},Ts=async h=>{const R=k.data?.changes[h.key];if(!(!T||!R)){z(h.key);try{await x(T,[{name:h.key,version:R.version}],l("siteEditor.contentTypes.restored",{name:gt(h)}))}finally{z(null)}}},fs=h=>{if(!h)return null;if(h.group==="pages")return{label:l("siteEditor.contentTypes.new.page"),onCreate:ms};if(h.group==="redirects")return{label:l("siteEditor.contentTypes.new.redirect"),onCreate:Ut};if(h.group==="sections"){const R=w(h);return{label:l("siteEditor.contentTypes.new.other",{type:R.toLowerCase()}),onCreate:()=>G({collection:"available-section",resolveType:h.id,title:R})}}return null},ss=(h,R)=>{if(h.group==="pages"){const ee={key:R.key,name:gt(R),path:typeof R.block.path=="string"?R.block.path:""};return o.jsx(bs,{onDuplicate:()=>gs(ee),onRename:()=>hs(ee),onDelete:()=>Qe({kind:"page",key:ee.key,label:ee.name})})}return h.group==="redirects"?o.jsx(bs,{onDelete:()=>At(R.key,js(R).from||R.key)}):h.group==="sections"?o.jsx(bs,{onDelete:()=>Qe({kind:"section",key:R.key,label:gt(R)})}):null},ns=async h=>{const R=F=>{if(!F)return null;const ae=m?{...b,[h.key]:F}:b,be=Za(ae,h.key),De=Qa(ae,h.key,Math.max(0,be-1)),Ze=Sc(F.sections,De,N,!f);return Ze?{fullPageData:F,added:Ze}:null},ee=m?null:R(b[h.key]);try{const F=m?R(await V(b,h.key)):ee;if(!F)return;const{fullPageData:ae,added:be}=F,De=await Te.mutateAsync({blockKey:h.key,data:{...ae,sections:be.sections},...m?{base:{value:ae,fromCache:!0}}:{}});at(De)||ve.success(`Variant added to "${h.name}"`),G({collection:"pages",key:h.key,path:h.path})}catch(F){ve.error(F instanceof Error?F.message:"Could not add variant")}},ms=()=>{bt(void 0),Ue({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},gs=h=>{bt(void 0),Ue({mode:"duplicate",sourceKey:h.key,initialName:Xo(es,h.name),initialPath:Zd(Kt,h.path)})},hs=h=>{bt(void 0),Ue({mode:"rename",sourceKey:h.key,initialName:h.name,initialPath:h.path})},Es=async h=>{if(!Re)return;const{mode:R,sourceKey:ee}=Re;try{if(R==="create"){let F;if(h.templateKey){const De=await V(b,h.templateKey);if(!De)throw new Error("Selected template no longer exists.");F={...De,name:h.name,path:h.path}}else F=su(h.name,h.path,f?void 0:N);const ae=ou(b,h.name),be=await Te.mutateAsync({blockKey:ae,data:F,...m?{create:!0}:{}});at(be)||ve.success(`Created "${h.name}"`),G({collection:"pages",key:ae,path:h.path})}else if(R==="duplicate"&&ee){const F=await V(b,ee);if(!F)throw new Error("Source page not found");const{key:ae,data:be}=tu({source:F,pages:nt,newName:h.name,newPath:h.path}),De=await Te.mutateAsync({blockKey:ae,data:be,...m?{create:!0}:{}});at(De)||ve.success(`Duplicated as "${h.name}"`),G({collection:"pages",key:ae,path:h.path})}else if(R==="rename"&&ee){const F=await V(b,ee);if(!F)throw new Error("Page not found");const ae={...F,name:h.name,path:h.path},be=await Te.mutateAsync({blockKey:ee,data:ae,...m?{base:{value:F,fromCache:!0}}:{}});at(be)||ve.success("Page updated"),B?.collection==="pages"&&B.key===ee&&G({collection:"pages",key:ee,path:h.path})}Ue(null)}catch(F){bt(F instanceof Error?F.message:"Save failed")}},Ps=({path:h})=>{if(!Re)return null;const R=qt(h);return(Re.mode==="rename"?qt(Re.initialPath):null)!==R&&Kt.has(R)?`A page with path "${h}" already exists.`:null},zs=async(h,R,ee)=>{const F=await Te.mutateAsync({blockKey:R,data:{...ee,name:R,__resolveType:h},create:!0});at(F)||ve.success(l("sandbox.contentBrowser.createdSection",{name:R})),G({collection:"sections",key:R})},os=_a(h=>Te.mutate(h),b,Te.v8),as=async h=>{const R=F=>{if(!F)return ve.error(l("sandbox.contentBrowser.sectionNotFound")),null;const ae=eu(b,h.key),be=Xo(ts,h.name),De={...F,name:be};return{newKey:ae,data:De}},ee=m?null:R(b[h.key]);try{const F=m?R(await V(b,h.key)):ee;if(!F)return;const{newKey:ae,data:be}=F,De=await Te.mutateAsync({blockKey:ae,data:be,create:!0});at(De)||ve.success(l("sandbox.contentBrowser.duplicatedSection",{name:h.name})),G({collection:"sections",key:ae})}catch(F){ve.error(F instanceof Error?F.message:l("sandbox.contentBrowser.duplicateFailed"))}},is=async h=>{if(!Je)return;const R=m?void 0:b[Je];if(!m&&!R){ve.error(l("sandbox.contentBrowser.sectionNotFound"));return}try{const ee=m?await V(b,Je):R;if(!ee){ve.error(l("sandbox.contentBrowser.sectionNotFound"));return}const F=await Te.mutateAsync({blockKey:Je,data:{...ee,name:h},...m?{base:{value:ee,fromCache:!0}}:{}});at(F)||ve.success(l("sandbox.contentBrowser.sectionRenamed")),kt(null)}catch(ee){ve.error(ee instanceof Error?ee.message:l("sandbox.contentBrowser.renameFailed"))}},Ut=()=>{vt(void 0),Ks(!0)},ls=async h=>{const R=(F,ae)=>{const be=F===null?null:fc({...b,[F]:ae},F).length,De=F===null?mc(b,h.from):F,Ze=F===null?gc(h):hc(ae,h);return{key:De,data:Ze,rules:be,body:ae}},ee=m?null:R(null,void 0);try{let F=ee;if(m){const et=p?pc(b):null,rs=et===null?void 0:await V(b,et);if(et!==null&&b[et]!==void 0&&!rs)throw new Error(l("sectionsEditor.hosted.blockLoadFailed"));F=R(et,rs)}if(!F)return;const{key:ae,data:be,rules:De,body:Ze}=F,Gt=await Te.mutateAsync({blockKey:ae,data:be,...m?{base:{value:Ze,fromCache:!0}}:{},...m?{create:Ze===void 0}:{}});at(Gt)||ve.success("Created redirect"),Ks(!1),G({collection:"redirects",key:De===null?ae:`${ae}#${De}`})}catch(F){vt(F instanceof Error?F.message:"Could not create redirect")}},As=async h=>{const R=Wn(b,h),ee=_s(R,h,Ai(h,{legacyContent:O}));try{const F=await Te.mutateAsync({blockKey:R,data:ee,...m?{create:!0}:{}});at(F)||ve.success(`Created ${qs[h]}`),G({collection:h,key:R})}catch(F){ve.error(F instanceof Error?F.message:"Could not create")}},Y=async h=>{const R=Wn(b,"posts"),ee=_s(R,"posts",Bp(h,{legacyContent:O}));try{const F=await Te.mutateAsync({blockKey:R,data:ee,...m?{create:!0}:{}});at(F)||ve.success(l("sandbox.postCalendar.createdScheduledPost")),H("posts"),he("posts"),G({collection:"posts",key:R}),se(null)}catch(F){ve.error(F instanceof Error?F.message:l("sandbox.postCalendar.couldNotCreate"))}},le=async(h,R)=>{const ee=ae=>{const be=ae?Rp(vs(ae,"posts"),R):null;return be?{source:ae,payload:be}:(ve.error(l("sandbox.postCalendar.onlyScheduledCanMove")),null)},F=m?null:ee(b[h]);try{const ae=m?ee(await V(b,h)):F;if(!ae)return;const{source:be,payload:De}=ae;await Te.mutateAsync({blockKey:h,data:_s(h,"posts",De),...m?{base:{value:be,fromCache:!0}}:{}})}catch(ae){ve.error(ae instanceof Error?ae.message:l("sandbox.postCalendar.couldNotReschedule"))}},Oe=async h=>{const R=F=>{if(!F)return ve.error("Record not found."),null;const ae=Wn(b,h.kind),be=h.kind==="posts"?"title":"name",De={...structuredClone(vs(F,h.kind)),[be]:`${h.label} (copy)`};if(h.kind==="categories"){const Ze=ot.categories.map(Gt=>Gt.slug??"").filter(Boolean);De.slug=Ap(String(De.slug??""),Ze)}return{key:ae,payload:De}},ee=m?null:R(b[h.key]);try{const F=m?R(await V(b,h.key)):ee;if(!F)return;const{key:ae,payload:be}=F,De=await Te.mutateAsync({blockKey:ae,data:_s(ae,h.kind,be),...m?{create:!0}:{}});at(De)||ve.success(`Duplicated "${h.label}"`),G({collection:h.kind,key:ae})}catch(F){ve.error(F instanceof Error?F.message:"Duplicate failed")}},Ct=()=>{H("posts"),he("posts"),G(null),se(null),Ae("")},Ie=async()=>{if(!Le)return;let h;try{const{kind:R,key:ee,label:F}=Le;if(R==="blog"){const ae=m?await V(b,ee):Le.blogKind==="categories"?b[ee]:void 0;if(m&&!ae)throw new Error(l("sectionsEditor.hosted.blockLoadFailed"));if(Le.blogKind==="categories"){const be=vs(ae,"categories").slug,De=typeof be=="string"?be:"";if(De){const Ze=m?{...b}:b;if(m){const Gt=await Promise.all(M.map(async et=>[et,await V(b,et)]));for(const[et,rs]of Gt)rs?Ze[et]=rs:delete Ze[et]}for(const{key:Gt,payload:et}of Pi(Ze)){const rs=Vu(et,De);rs!==et&&await Te.mutateAsync({blockKey:Gt,data:Ku(Gt,Uu(rs)),...m?{base:{value:Ze[Gt],fromCache:!0}}:{}})}}}h=await Be.mutateAsync({blockKey:ee,...m?{base:{value:ae}}:{}})}else if(!m&&Vs(ee,b)){const ae=Vs(ee,b);h=await Te.mutateAsync({blockKey:ae.block,data:Fo(b[ae.block],ae.index)})}else{const ae=m&&Le.kind==="redirect"?Le.rule:null;if(ae){const be=ae.body;h=await Te.mutateAsync({blockKey:ae.block,data:Fo(be,ae.index),...m?{base:{value:be,fromCache:!0}}:{}})}else h=await Be.mutateAsync({blockKey:ee})}if(Qe(null),at(h))return;ve.success(`Deleted "${F}"`),B&&"key"in B&&B.key===ee&&G(null),Qe(null)}catch(R){ve.error(R instanceof Error?R.message:"Delete failed")}},Kn=me===null?null:Vs(me,b),Ao=ne.failed?o.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center gap-3 p-6 text-center",children:[o.jsx(ft,{title:l("sectionsEditor.hosted.blockLoadFailed"),description:l("sectionsEditor.hosted.blockLoadFailedHint")}),o.jsx($e,{variant:"outline",size:"sm",onClick:ne.retry,children:l("sectionsEditor.namedRules.tryAgain")})]}):ne.ready?o.jsx(o.Fragment,{children:E==="loaders"||E==="actions"?o.jsx(zf,{initialSavedKey:j?A?.key:void 0,onBack:j?St:void 0,orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,meta:N,decofile:b,kind:E},j?`types:${A?.key??""}`:void 0):o.jsx(K.Suspense,{fallback:o.jsx("div",{className:"h-full flex items-center justify-center",children:o.jsx(mt,{className:"size-5 text-muted-foreground"})}),children:E==="calendar"?o.jsx(Ym,{decofile:b}):E==="post-schedule"?o.jsx(Wm,{decofile:b,isCreating:Te.isPending,onCreate:h=>{Y(h)},onReschedule:(h,R)=>{le(h,R)},onSelect:h=>{H("posts"),he("posts"),G({collection:"posts",key:h}),se(null)}}):E==="site"?lt?o.jsx(Sa,{schemaWaiting:de,orgSlug:t,virtualMcpId:e,branch:s,blockKey:lt.key,block:b[lt.key],decofile:b,meta:N,title:"Site",excludeFields:["seo"],previewBaseUrl:n},`site:${lt.key}`):o.jsx(ft,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):E==="settings"?o.jsx(Ca,{orgSlug:t,virtualMcpId:e,branch:s,decofile:b,meta:N,persistDefaults:j?!1:void 0}):E==="context"?o.jsx(Vm,{orgSlug:t,virtualMcpId:e,branch:s,decofile:b,meta:N}):E==="seo"?o.jsx(Hm,{orgSlug:t,virtualMcpId:e,branch:s,decofile:b,meta:N,target:{kind:"site"},previewBaseUrl:a}):E==="sections"?o.jsx(tm,{selection:B?.collection==="sections"||B?.collection==="available-section"?B:null,orgSlug:t,virtualMcpId:e,branch:s,previewUrl:n,meta:N,decofile:b,isCreating:Te.isPending,onCreateAvailable:zs,onSaveReferencedBlock:os}):E==="posts"?o.jsx(Ef,{orgSlug:t,virtualMcpId:e,branch:s,decofile:b,view:_e,selectedKey:B?.collection==="posts"?B.key:null,onViewChange:h=>{q(h),G(null)},onClose:()=>G(null),onOpen:h=>{G({collection:"posts",key:h}),se(null)},move:Ne,meta:N,renderDetail:(h,R)=>o.jsx(zm,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:h,block:b[h],decofile:b,meta:N,previewBaseUrl:a,move:Ne,onClose:R?.onClose,expanded:R?.expanded,onToggleExpand:R?.onToggleExpand},`post:${Xs(h)}`)}):B?.collection==="available-app"?(()=>{const h=Xe.find(R=>R.id===B.id);return h?o.jsx(Ld,{entry:h,technology:Ge,blocked:Fe.isPending&&Fe.variables?.blockKey!==h.id?{reason:l("sandbox.appInstallPanel.oneAtATime")}:st,isInstalling:Fe.isPending&&Fe.variables?.blockKey===h.id,installError:Fe.isError&&Fe.variables?.blockKey===h.id?Fe.error.message:null,onInstall:()=>yt(h)},`available-app:${h.id}`):o.jsx(ft,{title:"App not found in this catalogue."})})():B&&B.collection!=="available-section"?B.collection==="apps"?o.jsx(Sa,{schemaWaiting:de,orgSlug:t,virtualMcpId:e,branch:s,blockKey:B.key,block:b[B.key],decofile:b,meta:N,previewBaseUrl:n,...j?{persistDefaults:!1,title:Ns(B.key)}:{}},`app:${B.key}`):B.collection==="categories"?o.jsx(Um,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:B.key,block:b[B.key],decofile:b,meta:N,onManagePosts:()=>Ct(),onOpenPost:h=>{H("posts"),he("posts"),G({collection:"posts",key:h}),se(null)},previewBaseUrl:a},`category:${B.key}`):B.collection==="authors"?o.jsx(Mm,{orgSlug:t,virtualMcpId:e,branch:s,kind:"authors",blockKey:B.key,block:b[B.key],meta:N,decofile:b},`authors:${B.key}`):B.collection==="redirects"?o.jsx(qm,{orgSlug:t,virtualMcpId:e,branch:s,blockKey:Kn?.block??B.key,rule:Kn?.index??null,block:b[Kn?.block??B.key]},`redirect:${B.key}`):o.jsx(ur,{value:ue,children:o.jsx(Gm,{orgSlug:t,virtualMcpId:e,branch:s,previewReady:!0,previewUrl:n??void 0,currentPath:B.collection==="pages"?B.path:"/",activePageBlockKey:B.collection==="pages"?B.key:null,activeGlobalBlockKey:B.collection==="sections"?B.key:null,initialEditSeo:B.collection==="pages"&&ye===B.key,onExitSeo:()=>se(null),onSelectRoot:()=>{G(null),se(null)}},B.collection==="pages"?`page:${B.key}`:`section:${B.key}`)}):o.jsx(ft,{title:`Select ${ys(E)?`a ${qs[E]}`:E==="pages"?"a page":E==="apps"?"an app":E==="redirects"?"a redirect":"a section"} to edit`,description:E==="apps"?"Browse all apps: select an installed one to edit its settings, or any other to install it.":'Pick an item from the list, or click "+" to create one.'})})}):o.jsx("div",{className:"h-full w-full flex items-center justify-center",children:o.jsx(mt,{className:"size-5 text-muted-foreground"})}),on=Be.isPending||Te.isPending;return o.jsx(lr,{value:!f,children:o.jsxs("div",{className:"flex h-full w-full",children:[Ve?o.jsx(Tm,{tree:Ve,view:He,openTypeId:ut?A?.typeId??null:null,onSelect:h=>{S(h),St(),h.kind==="seo"&&H("seo")},onOpenEntry:(h,R)=>ps(h,R,null),settings:Mt?{changed:(Ve.settings?.changed??0)>0}:null}):o.jsx(Wd,{active:E,counts:Zt,hidden:Cs,showBlog:Lt,showContext:W,onSelect:h=>{H(h),G(null),se(null)}}),!Ve&&E!=="seo"&&E!=="site"&&E!=="settings"&&E!=="context"&&E!=="calendar"&&E!=="post-schedule"&&E!=="posts"&&E!=="loaders"&&E!=="actions"&&o.jsx(tg,{activeCollection:E,pages:nt,redirects:$t,sections:Ot,availableSections:Xt,appCatalog:Xe,canInstallApps:qe,installingAppId:Fe.isPending?Fe.variables?.blockKey??null:null,blogEntries:Jt,decofile:b,searchQuery:Ce,onSearchChange:Ae,selection:B,onSelect:ie,onCreate:()=>{E==="pages"?ms():E==="redirects"?Ut():ys(E)&&As(E)},onDuplicatePage:gs,onRenamePage:hs,onAddPageVariant:ns,onDeletePage:h=>Qe({kind:"page",key:h.key,label:h.name}),onEditPageSeo:h=>{const R={collection:"pages",key:h.key,path:h.path};G(R),se(h.key)},onViewPageJson:h=>Rt(h.key),onDuplicateSection:as,onRenameSection:h=>kt(h.key),onDeleteSection:h=>Qe({kind:"section",key:h.key,label:h.name}),onDeleteRedirect:h=>At(h.key,h.from||h.key),onDuplicateBlog:Oe,onDeleteBlog:h=>Qe({kind:"blog",blogKind:h.kind,key:h.key,label:h.label})}),Ve&&He.kind==="settings"&&!ut?o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(K.Suspense,{fallback:o.jsx("div",{className:"h-full flex items-center justify-center",children:o.jsx(mt,{className:"size-5 text-muted-foreground"})}),children:o.jsx(Ca,{orgSlug:t,virtualMcpId:e,branch:s,decofile:b,meta:N,standalone:!0,persistDefaults:!1})})}):Ve&&He.kind!=="seo"&&!ut?o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(_m,{tree:Ve,type:wt,onOpen:(h,R)=>ps(h,R,He),onRestore:h=>{Ts(h)},restoring:D,createLabel:fs(wt)?.label,onCreate:fs(wt)?.onCreate,rowMenu:ss},He.kind==="type"?He.id:"changes")}):ut&&jt?o.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[o.jsx(fr,{back:{label:l("siteEditor.contentTypes.back",{type:jt.kind==="seo"?l("siteEditor.contentTypes.seo"):jt.kind==="settings"?l("siteEditor.contentTypes.settings"):jt.kind==="changes"?l("siteEditor.contentTypes.changesInDraft"):w(zt(jt)??{id:"",title:""})}),onClick:()=>{S(jt),St()}}}),o.jsx("div",{className:"flex-1 min-h-0",children:Ao})]}):o.jsx("div",{className:"flex-1 min-w-0",children:Ao}),Re&&o.jsx(ru,{open:!!Re,mode:Re.mode,initialName:Re.initialName,initialPath:Re.initialPath,isPending:Te.isPending,error:dt,templates:nt,validate:Ps,onSubmit:Es,onOpenChange:h=>{h||(Ue(null),bt(void 0))}}),o.jsx(du,{open:In,isPending:Te.isPending,error:Fs,onSubmit:ls,onOpenChange:h=>{h||(Ks(!1),vt(void 0))}}),Je&&o.jsx(uu,{open:!!Je,blockKey:Je,initialName:Ot.find(h=>h.key===Je)?.name??Je,isPending:Te.isPending,onSubmit:is,onOpenChange:h=>{h||kt(null)}}),Dt&&o.jsx(rr,{listing:b,scope:u,names:[Dt],children:o.jsx(bc,{open:!!Dt,onOpenChange:h=>{h||Rt(null)},pageKey:Dt,decofile:b,params:u})}),o.jsx(Sl,{open:!!Le,onOpenChange:h=>{!h&&!on&&Qe(null)},children:o.jsxs(Cl,{children:[o.jsxs(Nl,{children:[o.jsx(Tl,{children:cs?.title??Bt}),o.jsx(El,{children:cs?.description??null})]}),o.jsxs(Pl,{children:[o.jsx(Al,{disabled:on,children:l("sandbox.contentBrowser.deleteDialog.cancel")}),o.jsx(_l,{onClick:h=>{h.preventDefault(),Ie()},disabled:on,className:we(Bl({variant:"destructive"})),children:on?o.jsxs(o.Fragment,{children:[o.jsx(mt,{className:"size-3.5"}),l("sandbox.contentBrowser.deleteDialog.deleting")]}):l("sandbox.contentBrowser.deleteDialog.delete")})]})]})})]})})}function tg(t){const e=ce.c(59),{activeCollection:s,pages:n,redirects:a,sections:i,availableSections:r,appCatalog:c,canInstallApps:l,installingAppId:d,blogEntries:u,decofile:g,searchQuery:m,onSearchChange:f,selection:p,onSelect:y,onCreate:j,onDuplicatePage:T,onRenamePage:v,onAddPageVariant:k,onDeletePage:C,onEditPageSeo:x,onViewPageJson:w,onDuplicateSection:P,onRenameSection:S,onDeleteSection:A,onDeleteRedirect:$,onDuplicateBlog:D,onDeleteBlog:z}=t,L=Pe();let b,_,I,M,X,Q;if(e[0]!==s||e[1]!==c||e[2]!==r||e[3]!==u||e[4]!==l||e[5]!==g||e[6]!==d||e[7]!==k||e[8]!==j||e[9]!==z||e[10]!==C||e[11]!==$||e[12]!==A||e[13]!==D||e[14]!==T||e[15]!==P||e[16]!==x||e[17]!==v||e[18]!==S||e[19]!==f||e[20]!==y||e[21]!==w||e[22]!==n||e[23]!==a||e[24]!==m||e[25]!==i||e[26]!==p||e[27]!==L){const O=m.toLowerCase(),E=n.filter(N=>!O||N.name.toLowerCase().includes(O)||N.path.toLowerCase().includes(O)),te=a.filter(N=>!O||N.from.toLowerCase().includes(O)||N.to.toLowerCase().includes(O)),ue=i.filter(N=>!O||N.name.toLowerCase().includes(O)||N.key.toLowerCase().includes(O)||N.resolveType.toLowerCase().includes(O)),B=r.filter(N=>!O||N.title.toLowerCase().includes(O)||N.resolveType.toLowerCase().includes(O)||(N.description?.toLowerCase().includes(O)??!1)),G=am(ue),me=c.filter(N=>!O||N.title.toLowerCase().includes(O)||N.app.toLowerCase().includes(O)||N.vendor.toLowerCase().includes(O)||N.category.toLowerCase().includes(O)),pe=u.filter(N=>!O||N.label.toLowerCase().includes(O)||N.subtitle.toLowerCase().includes(O)),xe=s==="categories"&&!O?nm(pe):pe.map(ng),ge=`Search ${s}…`,ne=ys(s)?`Create new ${qs[s]}`:s==="redirects"?"Create new redirect":"Create new page",ye=s!=="apps"&&s!=="sections";X="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let se;e[34]===Symbol.for("react.memo_cache_sentinel")?(se=o.jsx(mo,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[34]=se):se=e[34];let re;e[35]!==f?(re=N=>f(N.target.value),e[35]=f,e[36]=re):re=e[36];let de;e[37]!==ge||e[38]!==m||e[39]!==re?(de=o.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[se,o.jsx("input",{type:"text",value:m,onChange:re,placeholder:ge,"aria-label":ge,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[37]=ge,e[38]=m,e[39]=re,e[40]=de):de=e[40];let Z;e[41]!==ne||e[42]!==j||e[43]!==ye?(Z=ye&&o.jsxs(Pt,{children:[o.jsx(Tt,{asChild:!0,children:o.jsx($e,{variant:"ghost",size:"icon",onClick:j,"aria-label":ne,children:o.jsx(En,{size:14})})}),o.jsx(Et,{side:"bottom",children:ne})]}),e[41]=ne,e[42]=j,e[43]=ye,e[44]=Z):Z=e[44],e[45]!==de||e[46]!==Z?(Q=o.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[de,Z]}),e[45]=de,e[46]=Z,e[47]=Q):Q=e[47],b=nn,M="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",_="flex flex-col gap-1 p-1.5",I=s==="pages"?E.length===0?o.jsx(Us,{hasItems:n.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):E.map(N=>{const oe=p?.collection==="pages"&&p.key===N.key,fe=Za(g,N.key);return o.jsx(Nt,{icon:Va,title:N.name,subtitle:N.path,active:oe,variantCount:fe,onClick:()=>y({collection:"pages",key:N.key,path:N.path}),menu:o.jsx(bs,{onDuplicate:()=>T(N),onRename:()=>v(N),onAddVariant:()=>k(N),onEditSeo:()=>x(N),onViewJson:()=>w(N),onDelete:()=>C(N)})},N.key)}):s==="sections"?ue.length===0&&B.length===0?o.jsx(Us,{hasItems:i.length>0||r.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):o.jsxs(o.Fragment,{children:[G.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(ha,{icon:gn,label:"Saved sections"}),G.map(N=>o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-2xs font-medium text-muted-foreground/60",children:N.label}),N.sections.map(oe=>{const fe=p?.collection==="sections"&&p.key===oe.key;return o.jsx(Nt,{icon:gn,accent:"global",title:oe.name,subtitle:N.label,active:fe,onClick:()=>y({collection:"sections",key:oe.key}),menu:o.jsx(bs,{onDuplicate:()=>P(oe),onRename:()=>S(oe),onDelete:()=>A(oe)})},oe.key)})]},N.label))]}),B.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(ha,{icon:Oo,label:"Available sections",className:we(G.length>0&&"mt-3")}),B.map(N=>{const oe=p?.collection==="available-section"&&p.resolveType===N.resolveType,fe=N.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return o.jsx(Nt,{icon:Oo,title:N.title,subtitle:fe??N.resolveType,active:oe,onClick:()=>y({collection:"available-section",resolveType:N.resolveType,title:N.title})},N.resolveType)})]})]}):s==="apps"?me.length===0?o.jsx(Us,{hasItems:c.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):me.map(N=>{const oe=p?.collection==="apps"&&N.blockKey!==null&&p.key===N.blockKey||p?.collection==="available-app"&&p.id===N.id,fe=d===N.id;return o.jsx(Nt,{icon:go,logoUrl:N.logo,title:N.title,subtitle:N.category,active:oe,trailing:N.installed?o.jsx("span",{className:"shrink-0 rounded-full bg-success/15 px-1.5 py-0.5 text-2xs font-medium text-success",children:"Installed"}):fe?o.jsx(mt,{className:"size-3.5 shrink-0 text-muted-foreground"}):N.installable&&l?o.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground",children:"Install"}):void 0,onClick:()=>y(N.installed&&N.blockKey?{collection:"apps",key:N.blockKey}:{collection:"available-app",id:N.id})},N.id)}):s==="redirects"?te.length===0?o.jsx(Us,{hasItems:a.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):te.map(N=>o.jsx(Nt,{icon:Oa,title:N.from||"(no source)",subtitle:`→ ${N.to||"(no target)"}`,active:p?.collection==="redirects"&&p.key===N.key,trailing:o.jsx(fu,{redirect:N}),onClick:()=>y({collection:"redirects",key:N.key}),menu:o.jsx(bs,{onDelete:()=>$(N)})},N.key)):pe.length===0?o.jsx(Us,{hasItems:u.length>0,emptyLabel:`No ${s} yet.`,emptyHint:`Click "+" to create your first ${ys(s)?qs[s]:"item"}.`}):xe.map(N=>{const{entry:oe,depth:fe}=N,je=p?.collection===oe.kind&&p.key===oe.key;return o.jsx("div",{style:{paddingLeft:fe*16},children:o.jsx(Nt,{icon:oe.kind==="posts"?La:oe.kind==="authors"?Ua:Ia,title:oe.label,invalid:oe.missing.length>0,invalidReason:oe.missing.length>0?L("sandbox.itemRow.missingFields",{fields:Ru(oe.missing,L)}):void 0,warning:oe.duplicateName,warningReason:L("sandbox.itemRow.duplicateName"),subtitle:fe>0?al(oe.slug??"",pe).map(sg).join(" / "):oe.subtitle,active:je,onClick:()=>y({collection:oe.kind,key:oe.key}),menu:o.jsx(bs,{onDuplicate:()=>D(oe),onDelete:()=>z(oe)})})},oe.key)}),e[0]=s,e[1]=c,e[2]=r,e[3]=u,e[4]=l,e[5]=g,e[6]=d,e[7]=k,e[8]=j,e[9]=z,e[10]=C,e[11]=$,e[12]=A,e[13]=D,e[14]=T,e[15]=P,e[16]=x,e[17]=v,e[18]=S,e[19]=f,e[20]=y,e[21]=w,e[22]=n,e[23]=a,e[24]=m,e[25]=i,e[26]=p,e[27]=L,e[28]=b,e[29]=_,e[30]=I,e[31]=M,e[32]=X,e[33]=Q}else b=e[28],_=e[29],I=e[30],M=e[31],X=e[32],Q=e[33];let J;e[48]!==_||e[49]!==I?(J=o.jsx("div",{className:_,children:I}),e[48]=_,e[49]=I,e[50]=J):J=e[50];let H;e[51]!==b||e[52]!==M||e[53]!==J?(H=o.jsx(b,{className:M,children:J}),e[51]=b,e[52]=M,e[53]=J,e[54]=H):H=e[54];let W;return e[55]!==X||e[56]!==Q||e[57]!==H?(W=o.jsxs("div",{className:X,children:[Q,H]}),e[55]=X,e[56]=Q,e[57]=H,e[58]=W):W=e[58],W}function sg(t){return t.slug}function ng(t){return{entry:t,depth:0}}function Vh(t){const e=ce.c(25),{virtualMcpId:s}=t,n=Pe(),[a,i]=K.useState(!1),r=co(s),{connection:c}=Fr(s),{activeTask:l}=uo();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},e[0]=d):d=e[0];const u=Ta(d);if(!(Vo(r?.metadata)||Vo(l?.metadata))&&!c){let f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:o.jsx(Uo,{className:"size-7 text-foreground"})}),e[1]=f):f=e[1];let p;e[2]!==n?(p=n("mainPanelTabs.contentTab.noContentToEdit"),e[2]=n,e[3]=p):p=e[3];let y;e[4]!==n?(y=n("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=n,e[5]=y):y=e[5];let j,T;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=()=>i(!0),T=o.jsx(Uo,{className:"size-4"}),e[6]=j,e[7]=T):(j=e[6],T=e[7]);let v;e[8]!==n?(v=n("mainPanelTabs.previewTab.connectGithub"),e[8]=n,e[9]=v):v=e[9];let k;e[10]!==v?(k=o.jsxs($e,{onClick:j,children:[T,v]}),e[10]=v,e[11]=k):k=e[11];let C;e[12]!==p||e[13]!==y||e[14]!==k?(C=o.jsx(nd,{className:"h-full",image:f,title:p,description:y,actions:k}),e[12]=p,e[13]=y,e[14]=k,e[15]=C):C=e[15];let x;e[16]!==a?(x=o.jsx(od,{open:a,onOpenChange:i,mode:"agent"}),e[16]=a,e[17]=x):x=e[17];let w;return e[18]!==x||e[19]!==C?(w=o.jsxs(o.Fragment,{children:[C,x]}),e[18]=x,e[19]=C,e[20]=w):w=e[20],w}let m;return e[21]!==u.contentPageId||e[22]!==u.contentPath||e[23]!==u.contentPathTemplate?(m=o.jsx(cr,{children:o.jsx(Zm,{deepLinkPage:{pageId:u.contentPageId,path:u.contentPath,pathTemplate:u.contentPathTemplate}})}),e[21]=u.contentPageId,e[22]=u.contentPath,e[23]=u.contentPathTemplate,e[24]=m):m=e[24],m}export{lp as $,$h as A,Qu as B,Vh as C,Ii as D,Rh as E,Lh as F,Ih as G,dh as H,Lp as I,Cu as J,Wu as K,Xu as L,gh as M,Kh as N,Xi as O,wo as P,Bi as Q,Oh as R,yi as S,_s as T,Ch as U,rp as V,Dn as W,tp as X,Nh as Y,jh as Z,ap as _,ff as a,mu as a0,gu as a1,hu as a2,ia as a3,xu as a4,it as a5,yu as a6,kh as a7,vh as a8,wh as a9,Ap as aA,Pi as aB,fh as aC,mh as aD,Dh as aE,kn as aF,Sh as aa,Ri as ab,$i as ac,zi as ad,hh as ae,dp as af,jo as ag,bh as ah,Oi as ai,Li as aj,rt as ak,Eh as al,xh as am,bn as an,yh as ao,Th as ap,Zs as aq,to as ar,vn as as,Ph as at,Ah as au,Fu as av,zh as aw,nm as ax,ol as ay,Mu as az,$n as b,pf as c,Fh as d,oi as e,Ku as f,vs as g,_h as h,pt as i,ph as j,Ru as k,ji as l,Rn as m,eu as n,ga as o,Is as p,ht as q,uh as r,Uu as s,Hi as t,ni as u,Wi as v,Bh as w,jn as x,vi as y,Mh as z};
|