decocms 4.563.1 → 4.564.0
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-CzNhPAKr.js → AlertCircle-CQ8p4KFs.js} +1 -1
- package/dist/client/assets/{AreaChart-jXN8ob1W.js → AreaChart-BG9b7IWq.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BZrvcUxe.js → ArrowLeft-jRoq4RpN.js} +1 -1
- package/dist/client/assets/{ArrowUp-BmvC0gDN.js → ArrowUp-WAaoRlHa.js} +1 -1
- package/dist/client/assets/{CartesianChart-Dr9bA6s0.js → CartesianChart-CGjmrhMJ.js} +1 -1
- package/dist/client/assets/{CategoricalChart-Db8BeNXp.js → CategoricalChart-hyHkOxr8.js} +1 -1
- package/dist/client/assets/{CheckCircle-BfgWRJx4.js → CheckCircle-Buet-eH6.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-Dk3Ic8_G.js → ChevronSelectorVertical-DCDJ0sdb.js} +1 -1
- package/dist/client/assets/{ChevronUp-CslLufEI.js → ChevronUp-BTGxI7Zs.js} +1 -1
- package/dist/client/assets/{CreditCard01-DKR27XQP.js → CreditCard01-CnLItLU2.js} +1 -1
- package/dist/client/assets/{Globe04-DD-_PtpP.js → Globe04-DMe5HSmJ.js} +1 -1
- package/dist/client/assets/{Key01-CNesFlbK.js → Key01-Dxtn8NGa.js} +1 -1
- package/dist/client/assets/{LinkBroken01-K7vV_sRk.js → LinkBroken01-CqkORUqT.js} +1 -1
- package/dist/client/assets/{Minus-DeqVl1Xe.js → Minus-D2T9DyMG.js} +1 -1
- package/dist/client/assets/{Monitor01-Bx36gCte.js → Monitor01-D-9i_0yJ.js} +1 -1
- package/dist/client/assets/{Play-CkRBFbju.js → Play-P7egrfAg.js} +1 -1
- package/dist/client/assets/{Plus-DtM4w8bA.js → Plus-DsyYMAU8.js} +1 -1
- package/dist/client/assets/{ReferenceLine-38pFjaQt.js → ReferenceLine-i4QcKbhg.js} +1 -1
- package/dist/client/assets/{SearchMd-Bbg1gFfR.js → SearchMd-CW5cmPaz.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DW9ACSlI.js → ShoppingBag01-CajIv2w8.js} +1 -1
- package/dist/client/assets/{Sun-DUSHragw.js → Sun-BZ5I37JT.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BCe-gFOc.js → SwitchHorizontal01-DqmEmDR5.js} +1 -1
- package/dist/client/assets/{Tool01-snML4pPn.js → Tool01-CSZn_Wh0.js} +1 -1
- package/dist/client/assets/{Tooltip-CNZGI5Tv.js → Tooltip-BueNEHzC.js} +1 -1
- package/dist/client/assets/{Trash01-DPGVoVI0.js → Trash01-DDMIP9jc.js} +1 -1
- package/dist/client/assets/{Upload01-B1K1jpRL.js → Upload01-DT2jBuxA.js} +1 -1
- package/dist/client/assets/{UserSquare-DgIYcYhA.js → UserSquare-DKikapRU.js} +1 -1
- package/dist/client/assets/{Users01-DeK6IcUy.js → Users01-NB4c6tGb.js} +1 -1
- package/dist/client/assets/{XClose-B40NOWtA.js → XClose-DpL893eV.js} +1 -1
- package/dist/client/assets/{Zap-PrQtyQ4u.js → Zap-DOqlsWJQ.js} +1 -1
- package/dist/client/assets/{access-gate-Czwg28Aa.js → access-gate-OrPI42qE.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-CvoK8CuD.js → add-connection-dialog-C4a3y2Tw.js} +1 -1
- package/dist/client/assets/agent-app-ClOnnzDV.js +1 -0
- package/dist/client/assets/{agent-assets-BJMuyqMN.js → agent-assets-B6JReGpa.js} +1 -1
- package/dist/client/assets/{agent-automation-CC8RZvdz.js → agent-automation-CUEwumhB.js} +1 -1
- package/dist/client/assets/{agent-automations-Cv89ZDoQ.js → agent-automations-CUEa-MdA.js} +1 -1
- package/dist/client/assets/{agent-calendar-DWLtrh5a.js → agent-calendar-B-kfsJeA.js} +1 -1
- package/dist/client/assets/{agent-capabilities-DYSIvwwC.js → agent-capabilities-CmoLwTEk.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-dcz4ghlO.js → agent-connect-sources-DCF_9i75.js} +1 -1
- package/dist/client/assets/agent-deck-V4MMZHZM.js +1 -0
- package/dist/client/assets/{agent-e2e-BecV8iK7.js → agent-e2e-Me1Y__d1.js} +1 -1
- package/dist/client/assets/agent-experiments-DH_tqVqH.js +1 -0
- package/dist/client/assets/{agent-file-CcRMmQIR.js → agent-file-C2urOOFa.js} +1 -1
- package/dist/client/assets/{agent-hosting-Bp7-sUtV.js → agent-hosting-bDpflwDy.js} +1 -1
- package/dist/client/assets/{agent-icon-_Y5eusMw.js → agent-icon-TjMVTO6h.js} +1 -1
- package/dist/client/assets/agent-library-Co57cOat.js +1 -0
- package/dist/client/assets/agent-library-file-C_ffGwfX.js +1 -0
- package/dist/client/assets/agent-overview-D_ilxAiM.js +1 -0
- package/dist/client/assets/{agent-releases-Kc5s36Dn.js → agent-releases-iFoEZYLj.js} +1 -1
- package/dist/client/assets/agent-settings-Fpuz9R9B.js +1 -0
- package/dist/client/assets/{agent-site-editor-DcjkqLR_.js → agent-site-editor-Bk0gdWbE.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-CZax6TM0.js +2 -0
- package/dist/client/assets/agent-site-editor-content-BaWyOpGo.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-BwBm5AOl.js +1 -0
- package/dist/client/assets/{agent-view-guard-coqrNjXy.js → agent-view-guard-CgD2SRHj.js} +1 -1
- package/dist/client/assets/agent-view-y52sDry1.js +1 -0
- package/dist/client/assets/{ai-providers-D_h0GcaP.js → ai-providers-DP_LPW_J.js} +1 -1
- package/dist/client/assets/{alert-h8V4X8Ql.js → alert-DOoQbEiz.js} +1 -1
- package/dist/client/assets/{analytics-sections-BBSHBKo9.js → analytics-sections-BnrB72yH.js} +1 -1
- package/dist/client/assets/{api-keys-BZ1sBCY5.js → api-keys-Cz-pcuKo.js} +1 -1
- package/dist/client/assets/api-keys-eCL0fGKt.js +1 -0
- package/dist/client/assets/{app-editor-CYkeSh8v.js → app-editor-BtQvbROq.js} +1 -1
- package/dist/client/assets/{asset-utils-0I7CXwnB.js → asset-utils-D0vrhEGW.js} +1 -1
- package/dist/client/assets/{auth-BFbUp7Gk.js → auth-Bo7mZ0XZ.js} +1 -1
- package/dist/client/assets/{auth-catchall-Ciz3QLIw.js → auth-catchall-DpoQiWR3.js} +1 -1
- package/dist/client/assets/{auth-entry-CIbESaRU.js → auth-entry-BjPguG1n.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DXGPO57q.js → auth-split-layout-DZpBIwlD.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CDOOyhvF.js → authenticate-and-persist-oauth-ntvNyemj.js} +1 -1
- package/dist/client/assets/{automation-list-row-cqG8j4NI.js → automation-list-row-BEFQKTX1.js} +1 -1
- package/dist/client/assets/{automation-runs-CJPBgcyt.js → automation-runs-DzWprxEK.js} +1 -1
- package/dist/client/assets/{automations-CUnI1LGP.js → automations-Bxf0CCXl.js} +1 -1
- package/dist/client/assets/{autosend-hIWj1gzu.js → autosend-U0ehaXsA.js} +1 -1
- package/dist/client/assets/{badge-DccxBHlR.js → badge-Dfaw3WBB.js} +1 -1
- package/dist/client/assets/{block-document-DQqooS8Z.js → block-document-6dm-00hY.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-DHaN_ngV.js → blocks-preview-workspace-context-B_sPksUi.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-CXVOpcLP.js → blocks-tab-states-eGTb5mvz.js} +1 -1
- package/dist/client/assets/{blog-schema-DZRuLzaf.js → blog-schema-Dsmv2ihg.js} +1 -1
- package/dist/client/assets/{buckets-CF13tBzF.js → buckets-C23i5gyQ.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-Csewa1WB.js → build-improve-prompt-doc-BCaQdWBF.js} +1 -1
- package/dist/client/assets/{calendar-CUq9MxZD.js → calendar-CmUvBlY1.js} +1 -1
- package/dist/client/assets/{capability-load-error-PMRTSYzm.js → capability-load-error-8rnJwJni.js} +1 -1
- package/dist/client/assets/{category-editor-f0PbIiVt.js → category-editor-Cf4WXU9v.js} +1 -1
- package/dist/client/assets/{chart-DHsiNcHK.js → chart-C0imxM4a.js} +1 -1
- package/dist/client/assets/{chat-context-zQ-qHQlQ.js → chat-context-BBpIuXC7.js} +1 -1
- package/dist/client/assets/{chat-draft-DnX_-WHk.js → chat-draft-CGuyKppk.js} +1 -1
- package/dist/client/assets/{checkbox-DNUaBZYX.js → checkbox-CTu0WRp7.js} +1 -1
- package/dist/client/assets/{choose-editor-Bre429IU.js → choose-editor-BG1SjT1d.js} +1 -1
- package/dist/client/assets/{cli-auth-success-xdbDz12_.js → cli-auth-success-C7trLL5C.js} +1 -1
- package/dist/client/assets/{client-icons-DbvjRooY.js → client-icons-DQougokE.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-B3_YVdwE.js → cms-settings-editor-B30HFRSW.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-BL8-fLzg.js → cms-store-drafts-BphiU1zo.js} +1 -1
- package/dist/client/assets/{collapsible-DEQoVVA9.js → collapsible-Ddfj_16s.js} +1 -1
- package/dist/client/assets/{collection-detail-Dl6n3nUb.js → collection-detail-Cm2aKNHg.js} +1 -1
- package/dist/client/assets/{collection-display-button-BgO5nlf5.js → collection-display-button-9rq6-Wdl.js} +1 -1
- package/dist/client/assets/{collection-search-BKCnDfDh.js → collection-search-BnR15-7O.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BiwEx8lf.js → collection-table-wrapper-yg2kkMXP.js} +1 -1
- package/dist/client/assets/{collection-tabs-CLJwpk3w.js → collection-tabs-BC3eX7CT.js} +1 -1
- package/dist/client/assets/{combobox-BLt_NngQ.js → combobox-BWpli-Xr.js} +1 -1
- package/dist/client/assets/{command-CnM6TkoO.js → command-DF3tcytL.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-DDgSYTAO.js → companion-mcps-section-C8SHo1sU.js} +1 -1
- package/dist/client/assets/{config-CTbwXMPm.js → config-CiEg0__n.js} +1 -1
- package/dist/client/assets/{connect-BzaGqaBY.js → connect-BGwBZ_Ka.js} +1 -1
- package/dist/client/assets/{connect-layout-BZ1xoFNF.js → connect-layout-DbCgCtqS.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-BPQ5BKOR.js → connect-source-dialog-qP8ktZhS.js} +1 -1
- package/dist/client/assets/{connection-BWV5QLFO.js → connection-Dqu9RsNH.js} +1 -1
- package/dist/client/assets/{connection-card-xMr1YFzW.js → connection-card-BwHX3nOo.js} +1 -1
- package/dist/client/assets/{connection-detail-CGUXC9hw.js → connection-detail-DKP8tp8_.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CaRBbMf9.js → connection-form-helpers-BGJcgEzh.js} +1 -1
- package/dist/client/assets/{connection-slug-Ygf3Xiz0.js → connection-slug-taekJBaK.js} +1 -1
- package/dist/client/assets/{connections-wIdj6C4c.js → connections-cWHNOk6t.js} +1 -1
- package/dist/client/assets/{content-tab-D6UWTBDG.js → content-tab-BLJmurLN.js} +3 -3
- package/dist/client/assets/{context-B_HaMwVa.js → context-XrwEqwYe.js} +1 -1
- package/dist/client/assets/{context-menu-BOlWz_az.js → context-menu-gp9FU1Mh.js} +1 -1
- package/dist/client/assets/{context-shell-Cdw9KYb9.js → context-shell-DlBNmZfR.js} +3 -3
- package/dist/client/assets/{core.esm-BbSbwofB.js → core.esm-CTO4JGte.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-Dzeh0MX0.js → create-organization-dialog-F-su-nyA.js} +1 -1
- package/dist/client/assets/{device-hint-D3M6OFi8.js → device-hint-tzTpy1A9.js} +1 -1
- package/dist/client/assets/{discover-DCcWfC01.js → discover-CkXTTHib.js} +1 -1
- package/dist/client/assets/{domain-settings-Ce2bhWej.js → domain-settings-Dfq6uTsb.js} +1 -1
- package/dist/client/assets/{drawer-D4DxFGqN.js → drawer-BgyRTjxD.js} +1 -1
- package/dist/client/assets/{editor-DKoVU6S3.js → editor-CyZCJa0L.js} +1 -1
- package/dist/client/assets/{editor-classes-DEInI3IT.js → editor-classes-D0UJsX59.js} +1 -1
- package/dist/client/assets/{empty-state-DMIzfRid.js → empty-state-Dx-vBzke.js} +1 -1
- package/dist/client/assets/{empty-state-CiXq08R1.js → empty-state-qO8fmVkF.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-DtHr55-O.js → experiments-tab-choice-BsONYetS.js} +1 -1
- package/dist/client/assets/{extract-connection-data-m9qRk70G.js → extract-connection-data-CI_UJ-ru.js} +1 -1
- package/dist/client/assets/{feature-gate-CbZSFCGe.js → feature-gate-0S4LDUGl.js} +1 -1
- package/dist/client/assets/{feature-paywall-BorE2qu6.js → feature-paywall-DbRigt-8.js} +1 -1
- package/dist/client/assets/{feedback-DM7ibKhA.js → feedback-DpZ51nw_.js} +1 -1
- package/dist/client/assets/{file-explorer-DgsYJwlc.js → file-explorer-Is8X98eh.js} +1 -1
- package/dist/client/assets/{file-preview-ClFQiMsH.js → file-preview-DA7tD6qn.js} +1 -1
- package/dist/client/assets/{file-share-button-oASYWaTp.js → file-share-button-DNqRplIB.js} +1 -1
- package/dist/client/assets/{file-type-icon-BgsOvG37.js → file-type-icon-DrIF_ach.js} +1 -1
- package/dist/client/assets/{folder-icon-CjXRQ1u4.js → folder-icon-CE9rKFgu.js} +1 -1
- package/dist/client/assets/{form-BV9LGfdZ.js → form-BmoTeXbP.js} +1 -1
- package/dist/client/assets/{general-BOq7h34V.js → general-Ds6mKAD-.js} +1 -1
- package/dist/client/assets/{github-icon-BoZFAAoR.js → github-icon-Cfkkw3me.js} +1 -1
- package/dist/client/assets/{home-Y-BAzROz.js → home-gn6ueFSP.js} +1 -1
- package/dist/client/assets/{home-overview-ztctpGGy.js → home-overview-Bk4OGXI-.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-DgpDwrI2.js → hosted-reconcile-liA8Ue5e.js} +1 -1
- package/dist/client/assets/{icon-button-DeiyuWHW.js → icon-button-Cpw9GkVM.js} +1 -1
- package/dist/client/assets/{index-2dSYni92.js → index-3pV4g77m.js} +1 -1
- package/dist/client/assets/{index-DFF-_wih.js → index-B5Rq0Q_b.js} +1 -1
- package/dist/client/assets/{index-DHdEN2_u.js → index-B7P1i0U8.js} +1 -1
- package/dist/client/assets/{index-DbAn_rcU.js → index-BFqtpAvr.js} +1 -1
- package/dist/client/assets/{index-CDlOTJSg.js → index-BhO2XRBo.js} +1 -1
- package/dist/client/assets/{index-DzoENFz8.js → index-C90BaQbH.js} +1 -1
- package/dist/client/assets/{index-Dh9YHhq0.js → index-CU6Pikl7.js} +1 -1
- package/dist/client/assets/{index-BFUInOpF.js → index-Ckdck5oP.js} +1 -1
- package/dist/client/assets/{index-CxYhsN0K.js → index-CpV2sqUd.js} +1 -1
- package/dist/client/assets/{index-5iKTkoGz.js → index-Cst8xARc.js} +1 -1
- package/dist/client/assets/{index-CK6jFdOD.js → index-CtB8Tw63.js} +1 -1
- package/dist/client/assets/{index-DYiWplV5.js → index-DId4rr-A.js} +1 -1
- package/dist/client/assets/{index-CKcY9sA2.js → index-DLDJ3DHb.js} +1 -1
- package/dist/client/assets/{index-BEm4jG3I.js → index-DUKj5t3l.js} +1 -1
- package/dist/client/assets/{index-DSp2YJxk.js → index-DtPyNOkW.js} +1 -1
- package/dist/client/assets/{index-DxGCPS5f.js → index-cgovyYsQ.js} +3 -3
- package/dist/client/assets/{index-redirect-rsQ177qk.js → index-redirect-pAjv5SXQ.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BRbF_8wg.js → infiniteQueryObserver-D_MIEAF-.js} +1 -1
- package/dist/client/assets/{infra-billing-CskAuVtU.js → infra-billing-DRZUvwh3.js} +1 -1
- package/dist/client/assets/{input-CYN8nGNA.js → input-Dm8Dm-Qz.js} +1 -1
- package/dist/client/assets/{input-BznJkJE1.js → input-DuP90nBH.js} +3 -3
- package/dist/client/assets/{integration-icon-CivNYrxB.js → integration-icon-bQl-nSH8.js} +1 -1
- package/dist/client/assets/{jira-icon-EhOwRLcu.js → jira-icon-DBFOj94A.js} +1 -1
- package/dist/client/assets/{label-Co3RnKjI.js → label-BJpZpGc0.js} +1 -1
- package/dist/client/assets/{layout-ChuRSl3A.js → layout-7S8BP6VQ.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-D0c9eotJ.js → legacy-agents-deep-DR8nRly5.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-B6HagH9j.js → legacy-main-redirect-Dth5bVh1.js} +1 -1
- package/dist/client/assets/library-DgHRYlXy.js +1 -0
- package/dist/client/assets/{library-tab-QNwTrF2z.js → library-tab-BL_lF-ft.js} +1 -1
- package/dist/client/assets/{login-G4MQMu-X.js → login-DjUNKygv.js} +1 -1
- package/dist/client/assets/{markdown-BkKuf5yA.js → markdown-mKHkB6FI.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-AZxi3AlX.js → mcp-app-renderer-DjL0niPw.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C-lvxcK7.js → mcp-oauth-BIp0LO3E.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C3sBEl47.js → mcp-oauth-C7DXVMTi.js} +1 -1
- package/dist/client/assets/{members-fyMprese.js → members-CtRzSe07.js} +1 -1
- package/dist/client/assets/{memory-0qhTiXOS.js → memory-CRxleuoc.js} +1 -1
- package/dist/client/assets/{mock-board-B5Lo4WRg.js → mock-board-DnsUfCSW.js} +3 -3
- package/dist/client/assets/{monaco-editor-03CuhEOx.js → monaco-editor-CuW8q0yx.js} +1 -1
- package/dist/client/assets/{monitoring-BWMV-UnG.js → monitoring-9MjXgbIo.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BHB7ML9p.js → monitoring-stats-row-BcsNTX2l.js} +1 -1
- package/dist/client/assets/{multi-select-BvRkhFxR.js → multi-select-D9xyRxxq.js} +1 -1
- package/dist/client/assets/{mustache-BRZEXzlS.js → mustache-8etVpD7L.js} +1 -1
- package/dist/client/assets/{named-rule-view-NWkI621l.js → named-rule-view-CTR1XvI8.js} +1 -1
- package/dist/client/assets/{new-project-dialog-B_Izhfc6.js → new-project-dialog-CG2L3MM-.js} +1 -1
- package/dist/client/assets/{oauth-callback-C3qf7NWs.js → oauth-callback-BbuovBw_.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BOCoomMC.js → oauth-callback-ai-provider-DHqdJcsI.js} +1 -1
- package/dist/client/assets/{oauth-consent-kRuFuPRq.js → oauth-consent-DweBwUQF.js} +1 -1
- package/dist/client/assets/{onboarding-C9TuarYv.js → onboarding-DrVndD7e.js} +1 -1
- package/dist/client/assets/{openai-conversation-C1V_CQca.js → openai-conversation-yopZy_vm.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-Ms5q90dF.js → optimistic-project-sidebar-views-DacJkxjX.js} +1 -1
- package/dist/client/assets/{order-monitor-day-B8IwQXNk.js → order-monitor-day-CKYfInMA.js} +1 -1
- package/dist/client/assets/{organization-choice-IdTamlIL.js → organization-choice-Fbcae3dn.js} +1 -1
- package/dist/client/assets/{orgs-D6Y9NZAy.js → orgs-DDZTEU_k.js} +1 -1
- package/dist/client/assets/{own-accounts-section-CX4xOba8.js → own-accounts-section-C1y0YP6A.js} +1 -1
- package/dist/client/assets/{pair-BzWauPYd.js → pair-C5AjfCSI.js} +1 -1
- package/dist/client/assets/{parse-sections-DE8GWmV_.js → parse-sections-Cu97Vu_M.js} +3 -3
- package/dist/client/assets/{plan-CANZ8MES.js → plan-BohW26kq.js} +1 -1
- package/dist/client/assets/{plan-ladder-CAL4h1RI.js → plan-ladder-BaPcuCG0.js} +1 -1
- package/dist/client/assets/{plan-usage-card-B0E1Mqx-.js → plan-usage-card-YdOsJ_ZX.js} +1 -1
- package/dist/client/assets/{popover-cnXo99rU.js → popover-ns8sHJq5.js} +1 -1
- package/dist/client/assets/{post-calendar-CR_baRyF.js → post-calendar-DXzGaukN.js} +1 -1
- package/dist/client/assets/{post-editor-DuGV7g7L.js → post-editor-DR58AVSj.js} +1 -1
- package/dist/client/assets/{preview-content-Cspo-rar.js → preview-content-VCoMFFk-.js} +1 -1
- package/dist/client/assets/{preview-dialog-sM6fzUlE.js → preview-dialog-Dhde6lFg.js} +1 -1
- package/dist/client/assets/{preview-panel-vDb65VC_.js → preview-panel-BL4zck9B.js} +1 -1
- package/dist/client/assets/{preview-tab-BjhtYZTR.js → preview-tab-Dw3ViDnI.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-DL4criSm.js → product-picker-dialog-DtlAip15.js} +1 -1
- package/dist/client/assets/{profile-D0f8KwpQ.js → profile-CX0TYtL2.js} +1 -1
- package/dist/client/assets/{project-app-view-BAfcj1IV.js → project-app-view-DbconS9D.js} +1 -1
- package/dist/client/assets/{project-apps-DoVt9kS_.js → project-apps-DCer9_HY.js} +1 -1
- package/dist/client/assets/{project-icon-BnHxv46u.js → project-icon-BTrwq8bi.js} +1 -1
- package/dist/client/assets/{project-index-WJ4tXHCM.js → project-index-DwUzdWkU.js} +1 -1
- package/dist/client/assets/project-reports-BDw7SW7K.js +1 -0
- package/dist/client/assets/{project-sidebar-views-CLVZ96mT.js → project-sidebar-views-vqZZbL1p.js} +1 -1
- package/dist/client/assets/project-tasks-BrIInxOE.js +1 -0
- package/dist/client/assets/{projects-LpPdlGF4.js → projects-DRZyZAme.js} +1 -1
- package/dist/client/assets/{projects-empty-state-iR6Zz5-N.js → projects-empty-state-TY4kUtt4.js} +1 -1
- package/dist/client/assets/{prompts-XgZrzKUE.js → prompts-kv226h0M.js} +1 -1
- package/dist/client/assets/record-editor-Cybz45vp.js +1 -0
- package/dist/client/assets/{redirect-editor-D2q-6Lz4.js → redirect-editor-B3601TC3.js} +1 -1
- package/dist/client/assets/reports-9BRnMytv.js +1 -0
- package/dist/client/assets/{reports-5E4FVu6v.js → reports-C7qj5Hfb.js} +1 -1
- package/dist/client/assets/{reports-onboarding-DC_5ahpO.js → reports-onboarding-DW_hGBmK.js} +1 -1
- package/dist/client/assets/{reports-tab-CJb3-7vP.js → reports-tab-fjcRNutW.js} +2 -2
- package/dist/client/assets/{repositories-7NE-Y-fP.js → repositories-C9ox4SEq.js} +1 -1
- package/dist/client/assets/repositories-CSX3h8Qf.js +1 -0
- package/dist/client/assets/{repository-binding-C4_xIShf.js → repository-binding-CoBbz5GR.js} +1 -1
- package/dist/client/assets/{repository-picker-CX0VOapR.js → repository-picker-_0XvcaQZ.js} +1 -1
- package/dist/client/assets/{require-capability-1AcS0xbn.js → require-capability-BEaEpCmo.js} +1 -1
- package/dist/client/assets/{required-auth-layout-lwAsP7t-.js → required-auth-layout-CtQpY9CE.js} +1 -1
- package/dist/client/assets/{reset-password-DRB8IWFN.js → reset-password-DMO2Wfnx.js} +1 -1
- package/dist/client/assets/{resizable-CZ6UntWr.js → resizable-D1KNHtt_.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-JlFD9Ttu.js → resolve-tab-icon-DnI4GUKU.js} +1 -1
- package/dist/client/assets/{review-settings-DpoAEk87.js → review-settings-qBiQynjA.js} +1 -1
- package/dist/client/assets/{role-color-CAgewKmr.js → role-color-m3ekTafX.js} +1 -1
- package/dist/client/assets/roles-Dlv8qi0F.js +1 -0
- package/dist/client/assets/{route-CAQmwL3B.js → route-BwO9p6WQ.js} +1 -1
- package/dist/client/assets/route-C9j-dl8S.js +1 -0
- package/dist/client/assets/{route-BM3UxPQb.js → route-DBjrARiw.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-ByyfF0kL.js → sandbox-lifecycle-context-6GAWc6Uh.js} +1 -1
- package/dist/client/assets/{schema-STdjEbAK.js → schema-BAc2zoda.js} +1 -1
- package/dist/client/assets/{schema-DyY5h7Rx.js → schema-D09C1K2b.js} +1 -1
- package/dist/client/assets/{scroll-area-DJvIk_1i.js → scroll-area-DhC9My5l.js} +1 -1
- package/dist/client/assets/{search-input-BRZEiJxt.js → search-input-CaK4kync.js} +1 -1
- package/dist/client/assets/{search-toggle-BW-nCNIt.js → search-toggle-DPRPz4f9.js} +1 -1
- package/dist/client/assets/{secret-picker-DvJbV8kU.js → secret-picker-KlL9XTXY.js} +1 -1
- package/dist/client/assets/{secrets-CQ4fmQqK.js → secrets-BRi5VdUF.js} +1 -1
- package/dist/client/assets/{section-array-field-CzG_jptj.js → section-array-field--v0XzXwk.js} +1 -1
- package/dist/client/assets/{sections-CHxeuMKy.js → sections-Dm0haO3S.js} +1 -1
- package/dist/client/assets/{sections-editor-B_kNIbOe.js → sections-editor-BpvyJAUh.js} +1 -1
- package/dist/client/assets/{select-C30nxii2.js → select-eZpStU_o.js} +1 -1
- package/dist/client/assets/{select-model-DRBYpCaL.js → select-model-BfBifSzm.js} +1 -1
- package/dist/client/assets/{seo-editor-DazAHwbK.js → seo-editor-PC4JhIxf.js} +1 -1
- package/dist/client/assets/{separator-vR8karC8.js → separator-DTEg-0rT.js} +1 -1
- package/dist/client/assets/settings-tab-BiP5If_9.js +1 -0
- package/dist/client/assets/{sheet-ClaqVLRv.js → sheet-DWPcPfVu.js} +1 -1
- package/dist/client/assets/{shell-layout-dHGD2tyJ.js → shell-layout-C_vTrOFi.js} +1 -1
- package/dist/client/assets/{site-draft-actions-BIA6lR1g.js → site-draft-actions-BHxYhtRx.js} +1 -1
- package/dist/client/assets/{site-draft-view-Ci2I7i9g.js → site-draft-view-B62lda-n.js} +1 -1
- package/dist/client/assets/site-editor-D-_GHa40.js +1 -0
- package/dist/client/assets/{site-editor-toast-CgoUJTSW.js → site-editor-toast-DtZvuCiL.js} +1 -1
- package/dist/client/assets/{skills-D1-DQBAA.js → skills-xTHKZ-fS.js} +1 -1
- package/dist/client/assets/{slider-B_ZUvu11.js → slider-Ciu4_ug0.js} +1 -1
- package/dist/client/assets/{sortable.esm-BqKBxgnm.js → sortable.esm-BpQuZ2Ss.js} +1 -1
- package/dist/client/assets/{sso-DFYqPjQF.js → sso-BBNnGqrM.js} +1 -1
- package/dist/client/assets/{suggestion-B-tT_3Ba.js → suggestion-C3ZKXBdN.js} +1 -1
- package/dist/client/assets/{switch-BhYC-gsU.js → switch-BMZWxSSe.js} +1 -1
- package/dist/client/assets/{synced-repos-CNpviR6w.js → synced-repos-CvcyOOTD.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-BrdbQUjH.js → tab-icon-glyph-C7CENxYE.js} +1 -1
- package/dist/client/assets/{table-Dioc_TQV.js → table-BXlZF1sj.js} +1 -1
- package/dist/client/assets/{tabs-t_453qON.js → tabs-CTACUnuC.js} +1 -1
- package/dist/client/assets/{task-board-T7oS4tjE.js → task-board-AmZMoSDj.js} +1 -1
- package/dist/client/assets/{task-route-BABnfdht.js → task-route-DZtDO9ed.js} +1 -1
- package/dist/client/assets/{task-status-B5yaN2e9.js → task-status-CHJ2KIGX.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-CEOCzjed.js → taskboard-analytics-oNMzSYdF.js} +1 -1
- package/dist/client/assets/{tasks-CPtiTkqv.js → tasks-CbVjJ3WE.js} +1 -1
- package/dist/client/assets/tasks-haJ5q1d6.js +1 -0
- package/dist/client/assets/{textarea-CHZQytvO.js → textarea-eeqMJnUq.js} +1 -1
- package/dist/client/assets/{thread-analytics-w3Kn_9QO.js → thread-analytics-D2UkVv7U.js} +1 -1
- package/dist/client/assets/{thread-intent-DckhqhKt.js → thread-intent-B59SA_sa.js} +1 -1
- package/dist/client/assets/{thread-route-CIVmQ-Bx.js → thread-route-DT3i-QGQ.js} +1 -1
- package/dist/client/assets/{thread-route-DyG_eSJM.js → thread-route-Dpw37tsP.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-C7OutFPd.js → thread-sheet-body-DfCWtsKP.js} +1 -1
- package/dist/client/assets/{time-range-picker-Dg1tvNlk.js → time-range-picker-Cd1A1wA5.js} +1 -1
- package/dist/client/assets/{toggle-group-CC2qDSue.js → toggle-group-C6Pg2YNy.js} +1 -1
- package/dist/client/assets/{tool-namespace-WdIPTHBa.js → tool-namespace-DbWzvuWO.js} +1 -1
- package/dist/client/assets/{tool-set-selector-By0-LDtv.js → tool-set-selector-CCOfv97s.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CjbxTTYr.js → toolbar-icon-button-Cy2z0B4C.js} +1 -1
- package/dist/client/assets/{tooltip-xj6ZnC0s.js → tooltip-Bg4P3YaG.js} +1 -1
- package/dist/client/assets/{tooltipContext-BPLu0XDW.js → tooltipContext-DNapU3M5.js} +1 -1
- package/dist/client/assets/{track-Ba7_Ntbn.js → track-BAapDq3b.js} +1 -1
- package/dist/client/assets/{types-B8snWcBI.js → types-BrSjQREm.js} +1 -1
- package/dist/client/assets/{url-slug-Dv3zxns9.js → url-slug-DyPxKD3g.js} +1 -1
- package/dist/client/assets/{usage-stats-hNAp_EX0.js → usage-stats-Di2DK9Gv.js} +1 -1
- package/dist/client/assets/{use-ai-providers-8QFj-dPT.js → use-ai-providers-Bz3SR-CO.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-BKcXT1e9.js → use-apply-named-rule-BXKIXuir.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-BF9v_lE6.js +1 -0
- package/dist/client/assets/{use-automations-CTbTqBX7.js → use-automations-BU5c4wvD.js} +1 -1
- package/dist/client/assets/{use-autosave-CiyRV4I8.js → use-autosave-CkIhfcE5.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-BSsXx46E.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-D-U8t0kV.js → use-chat-layout-state-DvftxykM.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-DmkL-hz5.js → use-cms-publish-actions-B3qNhOq8.js} +1 -1
- package/dist/client/assets/{use-connect-companion-Bwtrfh-M.js → use-connect-companion-3Wux1jMd.js} +1 -1
- package/dist/client/assets/{use-connection-B3EvPXuJ.js → use-connection-IiFidBLV.js} +1 -1
- package/dist/client/assets/{use-content-sync-C8Ux_RZ8.js → use-content-sync-BrMwpVNk.js} +1 -1
- package/dist/client/assets/{use-copy-O-MML7rC.js → use-copy-D49VwPhf.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-CP8lOmDn.js → use-date-fns-locale-DKLPMzYi.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BXwcTWeY.js → use-debounced-autosave-CcnJ6SAY.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DDir1rWd.js → use-debounced-value-nhqnKklo.js} +1 -1
- package/dist/client/assets/{use-deco-credits-Dy_Hg4i-.js → use-deco-credits-NgUo324z.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BAXWzGGN.js → use-decopilot-events-mew6sG2k.js} +1 -1
- package/dist/client/assets/{use-delete-connection-ZbJPfKIZ.js → use-delete-connection-D-oKvtiI.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DNwohGK9.js → use-deployment-admin-CHn3xyJc.js} +1 -1
- package/dist/client/assets/{use-entitlements-SlWYl1h3.js → use-entitlements-C6In-vfl.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-DB6fawwn.js → use-fast-preview-draft-url-CIz-3ef3.js} +1 -1
- package/dist/client/assets/{use-file-configs-BiPsjSp0.js → use-file-configs-CwAhp36j.js} +1 -1
- package/dist/client/assets/{use-id-selection-CQGXhZf9.js → use-id-selection-mULmZ-Hz.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-G78cFBlF.js → use-inbox-feed-CHAfyO1k.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CuJmRWs3.js → use-infinite-scroll-fmrdKwVH.js} +1 -1
- package/dist/client/assets/{use-join-requests-BtFDzITE.js → use-join-requests-D9VYGJJu.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-D_s_t2hY.js → use-main-panel-tabs-3c9VwMgJ.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-C4Vaxyeo.js → use-mcp-auth-status-CK0IBQOj.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BFuEikBh.js → use-mcp-client-B3mZDGvG.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-W7_z0mx2.js → use-mcp-prompts-DnVJp_BL.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Fkw183dy.js → use-mcp-tools-Dn8Dy7zb.js} +1 -1
- package/dist/client/assets/{use-mobile-COmq9TQM.js → use-mobile-dJL_Pm5y.js} +1 -1
- package/dist/client/assets/{use-move-blocks-DtAEvUrz.js → use-move-blocks-R4zS1l6g.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-RGucqDuO.js → use-navigate-to-agent-CYu1HJsb.js} +1 -1
- package/dist/client/assets/{use-org-fs-B1VEI_Er.js → use-org-fs-C83fBFK-.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DE87oI9s.js → use-org-repo-syncs-CVhh3XbC.js} +1 -1
- package/dist/client/assets/{use-org-sso-RIE_JSyT.js → use-org-sso-BVcty70n.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DqmiRW0D.js → use-organization-settings-D9LYxkkn.js} +1 -1
- package/dist/client/assets/{use-project-scope-CYZ0mCfQ.js → use-project-scope-Y6vAoZoW.js} +1 -1
- package/dist/client/assets/{use-recent-apps-D1NSRmBo.js → use-recent-apps-ZWyNF1BM.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-DGd4jOlT.js → use-reports-diagnostic-CGaxGYkR.js} +1 -1
- package/dist/client/assets/use-sandbox-events-BFiAvETH.js +2 -0
- package/dist/client/assets/{use-secrets-B3RSCdMi.js → use-secrets-DLxKCtNq.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CvJ34UxX.js → use-section-preview-base-CNXXBKYv.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-DXX9If3C.js → use-sidebar-collapsed-SAa7Vnq8.js} +1 -1
- package/dist/client/assets/{use-tags-BjaNX9ld.js → use-tags-Dns9fjGu.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics--QCcKCkA.js → use-task-board-analytics-D75AC0iX.js} +1 -1
- package/dist/client/assets/{use-task-board-events-p-Cj7F6A.js → use-task-board-events-Dv2JYyOG.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-DRcN9Nsr.js → use-task-board-item-prs-DoH7p5yB.js} +1 -1
- package/dist/client/assets/{use-task-board-items-tdp7palw.js → use-task-board-items-CqIbwb7-.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-CPvlYwGk.js → use-task-board-prompts-ptkIJi--.js} +1 -1
- package/dist/client/assets/{use-task-metadata-D1snlV6w.js → use-task-metadata-D4qj8QP6.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-bD7oL4Tg.js → use-thread-outputs-Btu23rT9.js} +1 -1
- package/dist/client/assets/{use-voice-input-CZ-OU5Nk.js → use-voice-input-Bo9Hi7-O.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BhHoWMFB.js +1 -0
- package/dist/client/assets/{useQueries-DSvnP38O.js → useQueries-Blq1gg86.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DJxixS4t.js +1 -0
- package/dist/client/assets/{users-Bqa3Dwe4.js → users-CXxP5GbR.js} +1 -1
- package/dist/client/assets/{utils-Dk3SKS5y.js → utils-D_vHWhJR.js} +1 -1
- package/dist/client/assets/{variant-calendar-CD4VQuq0.js → variant-calendar-B-mtMhAk.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-NriuY-7n.js → variant-matcher-override-hYkKBfSm.js} +1 -1
- package/dist/client/assets/{view-header-B6CnFcfB.js → view-header-DrakbT1r.js} +1 -1
- package/dist/client/assets/{virtual-mcp-D5NkkvKn.js → virtual-mcp-wPX8BO9V.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-BKRouklE.js → watch-sse-pool-0ZXuPLm-.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +85 -57
- package/dist/server/server.js +707 -707
- package/package.json +1 -1
- package/dist/client/assets/agent-app-CIdQoDEi.js +0 -1
- package/dist/client/assets/agent-deck-79ukGlaD.js +0 -1
- package/dist/client/assets/agent-experiments-0rDHUtoa.js +0 -1
- package/dist/client/assets/agent-library-CGgf7yTT.js +0 -1
- package/dist/client/assets/agent-library-file-A_6ZSStB.js +0 -1
- package/dist/client/assets/agent-overview-CcczGeFG.js +0 -1
- package/dist/client/assets/agent-settings-BrQ-Mnfr.js +0 -1
- package/dist/client/assets/agent-site-editor-code-C9Vac5kP.js +0 -2
- package/dist/client/assets/agent-site-editor-content-BK40eFw4.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-BmrJe1z-.js +0 -1
- package/dist/client/assets/agent-view-CwNNidpp.js +0 -1
- package/dist/client/assets/api-keys-Clz5-Ffr.js +0 -1
- package/dist/client/assets/library-P47bCY92.js +0 -1
- package/dist/client/assets/project-reports-DYL24PFI.js +0 -1
- package/dist/client/assets/project-tasks-C0N1MlNa.js +0 -1
- package/dist/client/assets/record-editor-B9sjj4Iw.js +0 -1
- package/dist/client/assets/reports-D1yzySzc.js +0 -1
- package/dist/client/assets/repositories-B2vK4Cqr.js +0 -1
- package/dist/client/assets/roles-D-1qXwgE.js +0 -1
- package/dist/client/assets/route-DVYYyJNN.js +0 -1
- package/dist/client/assets/settings-tab-Bvb5mnr2.js +0 -1
- package/dist/client/assets/site-editor-CmjAnts6.js +0 -1
- package/dist/client/assets/tasks-DmeEepcP.js +0 -1
- package/dist/client/assets/use-ask-in-chat-C5fM3Bv6.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-Oxne65-_.js +0 -1
- package/dist/client/assets/use-sandbox-events-nFpLHv9o.js +0 -2
- package/dist/client/assets/useInfiniteQuery-ByQLYXMe.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-ClUlWmLx.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as u,r as g,j as n,J as G,a0 as F,a as E,l as O,b as P,n as y,L as H}from"./index-cgovyYsQ.js";import{C as M}from"./chat-context-BBpIuXC7.js";import{C as x}from"./index-DId4rr-A.js";import{L}from"./index-B7P1i0U8.js";import{B as V}from"./blocks-preview-workspace-context-B_sPksUi.js";import{e as T,p as J,s as K,a as W,r as U,T as $,u as R,b as z}from"./site-editor-toast-DtZvuCiL.js";import{u as q,L as B,P as Q,S as X}from"./preview-tab-Dw3ViDnI.js";import{C as Y}from"./content-tab-BLJmurLN.js";import{T as Z}from"./tab-icon-glyph-C7CENxYE.js";import{r as tt}from"./resolve-tab-icon-DnI4GUKU.js";import et from"./agent-site-editor-Bk0gdWbE.js";import"./autosend-U0ehaXsA.js";import"./thread-route-DT3i-QGQ.js";import"./use-project-scope-Y6vAoZoW.js";import"./repository-binding-CoBbz5GR.js";import"./use-mcp-client-B3mZDGvG.js";import"./auth-Bo7mZ0XZ.js";import"./thread-intent-B59SA_sa.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-0ZXuPLm-.js";import"./task-board-AmZMoSDj.js";import"./schema-D09C1K2b.js";import"./use-entitlements-C6In-vfl.js";import"./use-ai-providers-Bz3SR-CO.js";import"./use-decopilot-events-mew6sG2k.js";import"./use-organization-settings-D9LYxkkn.js";import"./use-mobile-dJL_Pm5y.js";import"./use-sidebar-collapsed-SAa7Vnq8.js";import"./use-chat-layout-state-DvftxykM.js";import"./agent-icon-TjMVTO6h.js";import"./AlertCircle-CQ8p4KFs.js";import"./Tool01-CSZn_Wh0.js";import"./ArrowUp-WAaoRlHa.js";import"./ArrowLeft-jRoq4RpN.js";import"./LinkBroken01-CqkORUqT.js";import"./ShoppingBag01-CajIv2w8.js";import"./Globe04-DMe5HSmJ.js";import"./CheckCircle-Buet-eH6.js";import"./ChevronUp-BTGxI7Zs.js";import"./ChevronSelectorVertical-DCDJ0sdb.js";import"./UserSquare-DKikapRU.js";import"./CreditCard01-CnLItLU2.js";import"./SwitchHorizontal01-DqmEmDR5.js";import"./Key01-Dxtn8NGa.js";import"./Minus-D2T9DyMG.js";import"./Monitor01-D-9i_0yJ.js";import"./Sun-BZ5I37JT.js";import"./Play-P7egrfAg.js";import"./Plus-DsyYMAU8.js";import"./SearchMd-CW5cmPaz.js";import"./Trash01-DDMIP9jc.js";import"./Upload01-DT2jBuxA.js";import"./Users01-NB4c6tGb.js";import"./XClose-DpL893eV.js";import"./Zap-DOqlsWJQ.js";import"./tooltip-Bg4P3YaG.js";import"./index-B5Rq0Q_b.js";import"./toolbar-icon-button-Cy2z0B4C.js";import"./shell-layout-C_vTrOFi.js";import"./use-deployment-admin-CHn3xyJc.js";import"./admin-fetch-BhTJlAsX.js";import"./command-DF3tcytL.js";import"./index-BhO2XRBo.js";import"./integration-icon-bQl-nSH8.js";import"./project-icon-BTrwq8bi.js";import"./use-navigate-to-agent-CYu1HJsb.js";import"./new-project-dialog-CG2L3MM-.js";import"./label-BJpZpGc0.js";import"./repository-picker-_0XvcaQZ.js";import"./github-icon-Cfkkw3me.js";import"./useInfiniteQuery-BhHoWMFB.js";import"./infiniteQueryObserver-D_MIEAF-.js";import"./collection-search-BnR15-7O.js";import"./use-debounced-value-nhqnKklo.js";import"./required-auth-layout-CtQpY9CE.js";import"./use-org-sso-BVcty70n.js";import"./sheet-DWPcPfVu.js";import"./resizable-D1KNHtt_.js";import"./core.esm-CTO4JGte.js";import"./sortable.esm-BpQuZ2Ss.js";import"./context-menu-gp9FU1Mh.js";import"./create-organization-dialog-F-su-nyA.js";import"./form-BmoTeXbP.js";import"./project-apps-DCer9_HY.js";import"./use-recent-apps-ZWyNF1BM.js";import"./use-voice-input-Bo9Hi7-O.js";import"./popover-ns8sHJq5.js";import"./drawer-BgyRTjxD.js";import"./index-3pV4g77m.js";import"./checkbox-CTu0WRp7.js";import"./select-eZpStU_o.js";import"./index-BdQq_4o_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./use-blocks-v8-project-BSsXx46E.js";import"./sandbox-url-D3mC8qhT.js";import"./utils-D_vHWhJR.js";import"./use-sandbox-events-BFiAvETH.js";import"./sandbox-git-api-DcqI6XE4.js";import"./parse-sections-Cu97Vu_M.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-C5AjfCSI.js";import"./collapsible-Ddfj_16s.js";import"./use-copy-D49VwPhf.js";import"./usage-stats-Di2DK9Gv.js";import"./tool-namespace-DbWzvuWO.js";import"./utils-CVEq3hMx.js";import"./markdown-mKHkB6FI.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-DjL0niPw.js";import"./types-BrSjQREm.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./use-connection-IiFidBLV.js";import"./use-mcp-prompts-DnVJp_BL.js";import"./use-thread-outputs-Btu23rT9.js";import"./file-type-icon-DrIF_ach.js";import"./section-array-field--v0XzXwk.js";import"./blocks-tab-states-eGTb5mvz.js";import"./empty-state-qO8fmVkF.js";import"./hosted-reconcile-liA8Ue5e.js";import"./slider-Ciu4_ug0.js";import"./index-DUKj5t3l.js";import"./tooltipContext-DNapU3M5.js";import"./CategoricalChart-hyHkOxr8.js";import"./index-C90BaQbH.js";import"./switch-BMZWxSSe.js";import"./textarea-eeqMJnUq.js";import"./scroll-area-DhC9My5l.js";import"./monaco-editor-CuW8q0yx.js";import"./editor-CyZCJa0L.js";import"./calendar-CmUvBlY1.js";import"./editor-classes-D0UJsX59.js";import"./toggle-group-C6Pg2YNy.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-BWpli-Xr.js";import"./search-input-CaK4kync.js";import"./tabs-CTACUnuC.js";import"./use-file-configs-CwAhp36j.js";import"./asset-utils-D0vrhEGW.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./sandbox-lifecycle-context-6GAWc6Uh.js";import"./variant-matcher-override-hYkKBfSm.js";import"./use-fast-preview-draft-url-CIz-3ef3.js";import"./useQueries-Blq1gg86.js";import"./device-hint-tzTpy1A9.js";import"./alert-DOoQbEiz.js";import"./virtual-mcp-wPX8BO9V.js";import"./url-slug-DyPxKD3g.js";import"./app-preview-url-9Od4s8Sz.js";import"./agent-capabilities-CmoLwTEk.js";import"./preview-source-BsRLGWUP.js";import"./use-task-metadata-D4qj8QP6.js";import"./view-header-DrakbT1r.js";import"./use-cms-publish-actions-B3qNhOq8.js";import"./use-content-sync-BrMwpVNk.js";import"./mustache-8etVpD7L.js";import"./date-utils-CrvIKg-s.js";import"./use-move-blocks-R4zS1l6g.js";import"./badge-Dfaw3WBB.js";import"./empty-state-Dx-vBzke.js";import"./collection-table-wrapper-yg2kkMXP.js";import"./table-BXlZF1sj.js";import"./site-draft-actions-BHxYhtRx.js";import"./separator-DTEg-0rT.js";import"./cms-store-drafts-BphiU1zo.js";import"./serial-task-queue-CGOeQgpr.js";import"./index-DLDJ3DHb.js";import"./input-DuP90nBH.js";import"./icon-button-Cpw9GkVM.js";import"./chat-draft-CGuyKppk.js";import"./use-deco-credits-NgUo324z.js";import"./input-Dm8Dm-Qz.js";import"./suggestion-C3ZKXBdN.js";import"./use-org-fs-C83fBFK-.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-DbRigt-8.js";import"./plan-ladder-BaPcuCG0.js";import"./add-connection-dialog-C4a3y2Tw.js";import"./extract-connection-data-CI_UJ-ru.js";import"./metadata-D72DunRR.js";import"./connection-Dqu9RsNH.js";import"./connection-card-BwHX3nOo.js";import"./connection-slug-taekJBaK.js";import"./schema-BAc2zoda.js";import"./connection-form-helpers-BGJcgEzh.js";import"./authenticate-and-persist-oauth-ntvNyemj.js";import"./mcp-oauth-C7DXVMTi.js";import"./mcp-oauth-BIp0LO3E.js";import"./collection-tabs-BC3eX7CT.js";import"./use-infinite-scroll-fmrdKwVH.js";import"./useSuspenseInfiniteQuery-DJxixS4t.js";import"./use-task-board-events-Dv2JYyOG.js";import"./save-changes-debug-nBi-n9eV.js";import"./site-draft-view-B62lda-n.js";function I(e){return e.kind==="unavailable"&&e.source==="local"&&(e.problem?.reason??"not-answering")==="not-answering"}const ot=e=>e;function it(e){const t=u.c(10),{candidates:o,invalidLink:c,shell:m,editor:i}=e,r=c===void 0?!1:c,s=m===void 0?ot:m,[p,l]=g.useState(null);if(p){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),t[0]=f):f=t[0];let h;return t[1]!==p||t[2]!==i?(h=i(p,f),t[1]=p,t[2]=i,t[3]=h):h=t[3],h}let a;t[4]!==o||t[5]!==r?(a=n.jsx(rt,{candidates:o,invalidLink:r,onConnect:l}),t[4]=o,t[5]=r,t[6]=a):a=t[6];let d;return t[7]!==s||t[8]!==a?(d=s(a),t[7]=s,t[8]=a,t[9]=d):d=t[9],d}function rt(e){const t=u.c(17),{candidates:o,invalidLink:c,onConnect:m}=e,i=c===void 0?!1:c,[r]=G(),{language:s}=r;let p;t[0]!==m?(p=N=>m({endpoint:N}),t[0]=m,t[1]=p):p=t[1];let l;t[2]!==o||t[3]!==p?(l={candidates:o,onFound:p},t[2]=o,t[3]=p,t[4]=l):l=t[4];const a=q(l),{state:d,access:f,needsGesture:h}=a;let k;t[5]!==o||t[6]!==s?(k=new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(o.map(T)),t[5]=o,t[6]=s,t[7]=k):k=t[7];const C=k;let S;t[8]!==f||t[9]!==a.start||t[10]!==h||t[11]!==d?(S=f==="denied"?{kind:"denied"}:h?{kind:"needs-gesture",onStart:a.start}:d.problem?{kind:"problem",problem:d.problem,host:T(d.problem.endpoint)}:{kind:"looking",paused:d.status==="paused"},t[8]=f,t[9]=a.start,t[10]=h,t[11]=d,t[12]=S):S=t[12];const _=S;let j;return t[13]!==C||t[14]!==i||t[15]!==_?(j=n.jsx(B,{wait:_,hosts:C,invalidLink:i}),t[13]=C,t[14]=i,t[15]=_,t[16]=j):j=t[16],j}const v="deco-serve",w="working-tree",nt={id:"",slug:"",name:"",logo:null},st={id:v,slug:v},mt={virtualMcpId:v,taskId:null,openTask:()=>{},createTask:()=>"",createTaskWithMessage:()=>{},activeTask:null,isThreadLocked:!1,lockedHarness:null,lockedBranch:null,currentBranch:w,setCurrentTaskBranch:()=>{}};function pt(){const e=window.location.hash,t=new URLSearchParams(e.replace(/^#/,"")).has("endpoint"),o=t?J(e):null;return t&&window.history.replaceState(null,"",window.location.pathname+window.location.search),o&&K(o),{candidates:W(o,U()),invalidLink:t&&!o}}const at=[{id:"site-editor",to:"/site-editor",label:"preview"},{id:"content",to:"/site-editor/content",label:"content"}];function ct(){const e=u.c(6),t=P();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:lt},e[0]=o):o=e[0];const c=O(o);let m;e[1]!==t||e[2]!==c?(m=at.map(r=>n.jsx(y.Tab,{asChild:!0,active:c==="content"==(r.id==="content"),children:n.jsxs(H,{to:r.to,activeOptions:{exact:!0},children:[n.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(Z,{icon:tt({tabId:r.id,kind:"system",connections:[]})})}),t(`common.mainPanelTabs.${r.label}`)]})},r.id)),e[1]=t,e[2]=c,e[3]=m):m=e[3];let i;return e[4]!==m?(i=n.jsx(y.Tabs,{children:m}),e[4]=m,e[5]=i):i=e[5],i}function lt(e){return e.matches.at(-1)?.staticData.siteEditorView}function A(e){const t=u.c(14),{children:o}=e,c=P(),{connection:m}=z(v),i=R(v,w);let r,s;if(t[0]!==i||t[1]!==o||t[2]!==m||t[3]!==c){s=Symbol.for("react.early_return_sentinel");t:{if(r=m?T(m.endpoint):"",i.kind==="protocol"){s=o;break t}if(i.kind!=="unavailable"||I(i)){s=n.jsx(X,{headingLevel:2,waiting:!0,title:c("decoServe.connect.reaching",{host:r})});break t}}t[0]=i,t[1]=o,t[2]=m,t[3]=c,t[4]=r,t[5]=s}else r=t[4],s=t[5];if(s!==Symbol.for("react.early_return_sentinel"))return s;let p;t[6]!==i.problem?(p=i.problem??{reason:"not-answering"},t[6]=i.problem,t[7]=p):p=t[7];let l;t[8]!==r||t[9]!==p?(l={kind:"problem",problem:p,host:r},t[8]=r,t[9]=p,t[10]=l):l=t[10];let a;return t[11]!==r||t[12]!==l?(a=n.jsx(B,{wait:l,hosts:r}),t[11]=r,t[12]=l,t[13]=a):a=t[13],a}function dt(e){const t=u.c(6),{onLost:o}=e,c=R(v,w);let m;t[0]!==c?(m=I(c),t[0]=c,t[1]=m):m=t[1];const i=m;let r,s;return t[2]!==i||t[3]!==o?(r=()=>{i&&o()},s=[i,o],t[2]=i,t[3]=o,t[4]=r,t[5]=s):(r=t[4],s=t[5]),g.useEffect(r,s),null}const D={threadOpen:!1,contentOpen:!0,threadVisibilityExplicit:!1,toggleThread:()=>{},toggleContent:()=>{}};function ut(){const e=u.c(11),{data:t}=E.useSession();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:ft},e[0]=o):o=e[0];const c=O(o),m=!!t?.user;let i;e[1]!==m?(i={rail:m},e[1]=m,e[2]=i):i=e[2];const r=c??"preview";let s,p,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(ct,{}),p=n.jsx(x.Thread,{children:null}),l=n.jsx(et,{}),e[3]=s,e[4]=p,e[5]=l):(s=e[3],p=e[4],l=e[5]);let a;e[6]!==r?(a=n.jsx(L.Content,{children:n.jsxs(x,{...D,threadless:!0,contentKey:r,contentNavigation:s,children:[p,l]})}),e[6]=r,e[7]=a):a=e[7];let d;return e[8]!==i||e[9]!==a?(d=n.jsx(L,{outsideOrg:i,children:a}),e[8]=i,e[9]=a,e[10]=d):d=e[10],d}function ft(e){return e.matches.at(-1)?.staticData.siteEditorView}function ht(e){const t=u.c(8),{children:o}=e,{data:c}=E.useSession(),m=!!c?.user;let i;t[0]!==m?(i={rail:m},t[0]=m,t[1]=i):i=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(x.Thread,{children:null}),t[2]=r):r=t[2];let s;t[3]!==o?(s=n.jsx(L.Content,{children:n.jsxs(x,{...D,threadless:!0,contentKey:"guide",children:[r,n.jsx(x.Content,{children:o})]})}),t[3]=o,t[4]=s):s=t[4];let p;return t[5]!==i||t[6]!==s?(p=n.jsx(L,{outsideOrg:i,children:s}),t[5]=i,t[6]=s,t[7]=p):p=t[7],p}const b=()=>{},vt={connection:null,set:b,clear:b};function Yi(){const e=u.c(3),[t]=g.useState(pt);let o;return e[0]!==t.candidates||e[1]!==t.invalidLink?(o=n.jsx(F,{org:nt,project:st,children:n.jsx(it,{candidates:t.candidates,invalidLink:t.invalidLink,shell:kt,editor:xt})}),e[0]=t.candidates,e[1]=t.invalidLink,e[2]=o):o=e[2],o}function xt(e,t){return n.jsxs($.Provider,{value:{connection:e,set:b,clear:b},children:[n.jsx(dt,{onLost:t}),n.jsx(M,{value:mt,children:n.jsx(V,{children:n.jsx(ut,{})})})]})}function kt(e){return n.jsx($.Provider,{value:vt,children:n.jsx(ht,{children:e})})}function Zi(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(A,{children:n.jsx(Q,{virtualMcpId:v})}),e[0]=t):t=e[0],t}function tr(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(A,{children:n.jsx(Y,{virtualMcpId:v})}),e[0]=t):t=e[0],t}export{tr as SiteEditorContent,Zi as SiteEditorPreview,Yi as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{eP as P,eQ as S,c as R,q as Z,i as F,K as g,eR as je,aB as wn,aF as Sn,aG as yn,r as L,a as En,at as ke,a5 as On,by as yt,eS as Dn,eT as kn,eU as Et,ar as In,bo as Ot,bh as B,eV as _n,eW as Tn,eX as q,eY as Pn,eZ as Rn,e_ as fe,e$ as xn,f0 as Dt,f1 as kt,f2 as $n,f3 as Nn,a3 as jn,f4 as Cn,t as ee,j as Y}from"./index-DxGCPS5f.js";import{u as It}from"./use-voice-input-CZ-OU5Nk.js";import{s as et}from"./thread-intent-DckhqhKt.js";import{u as Ce}from"./use-blocks-v8-project-Oxne65-_.js";import{b as me}from"./sandbox-url-D3mC8qhT.js";import{s as An}from"./utils-Dk3SKS5y.js";import{u as Ae}from"./repository-binding-C4_xIShf.js";import{u as Un}from"./chat-context-zQ-qHQlQ.js";import{i as Mn,u as Ln}from"./use-sandbox-events-nFpLHv9o.js";import{a as Fn}from"./sandbox-git-api-DcqI6XE4.js";const K="deco-content",Ie={major:1},_t=1;async function Qn(e){let t=new Uint8Array(await e.arrayBuffer());if(t[0]===31&&t[1]===139){const n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));t=new Uint8Array(await new Response(n).arrayBuffer())}return JSON.parse(new TextDecoder().decode(t))}const _e={major:Ie.major,minor:_t},Tt=`the endpoint speaks an older ${K} than this client needs (${_e.major}.${_e.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function se(e,t,n){const o={reason:t,required:{..._e}};if(n){o.actual={protocol:n.protocol,major:n.version?.major,minor:n.version?.minor};const r=n.server;typeof r?.name=="string"&&typeof r.version=="string"&&(o.server={name:r.name,version:r.version})}return new P(S.Unsupported,e,o)}function Pt(e){const t=e??{},{protocol:n,version:o}=t;if(n!==K)throw se(`the endpoint speaks ${JSON.stringify(n)}, not ${K}`,"protocol",t);if(o?.major!==Ie.major)throw se(`the endpoint speaks ${K} ${String(o?.major)}.x; this client speaks ${Ie.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<_t)throw se(Tt,"outdated",t);return e}function tt(e,t){return t.code===S.MethodNotFound&&e.startsWith("changes.")?se(Tt,"outdated"):P.from(t)}function Ue(e){const t=e.fetch??(s=>fetch(s));let n=1;async function o(s){const i={"content-type":"application/json",accept:"application/json",...e.headers},a=await t(new Request(e.endpoint,{method:"POST",headers:i,body:JSON.stringify(s)}));let c;try{c=await Qn(a)}catch{throw new P(S.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(c)&&c?.id===null){const l=c?.error;throw l?P.from(l):new P(S.Unavailable,`the endpoint answered HTTP ${a.status}`)}return c}const r=async(s,i)=>{const a=n++,c=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(c.error)throw tt(s,c.error);return c.result};return{call:r,describe:async()=>Pt(await r("describe")),schemaGet:s=>r("schema.get",s),blocksList:s=>r("blocks.list",s),blocksApply:s=>r("blocks.apply",s),changesList:s=>r("changes.list",s),changesGet:s=>r("changes.get",s),changesDiscard:s=>r("changes.discard",s),async batch(s){const i=s.map(()=>n++),a=await o(s.map((l,f)=>({jsonrpc:"2.0",id:i[f],method:l.method,params:l.params??{}}))),c=new Map(a.map(l=>[l.id,l]));return i.map((l,f)=>{const u=c.get(l);return u?u.error?{ok:!1,error:tt(s[f].method,u.error)}:{ok:!0,result:u.result}:{ok:!1,error:new P(S.InternalError,"no response for this call")}})}}}function Me(e){return e&&!e.edited?{ifNoneMatch:e.revision}:{}}const nt=20,ot=5,rt=500;function Le(e){return e instanceof P?e.code===S.MethodNotFound?!0:e.code===S.Unsupported&&e.data?.reason==="outdated":!1}function de(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function Vn(e,t,n){const o=g.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(Me(r)),i=de(r,s);if(i)return i;const a=await t.changesList({});return de(void 0,a)}async function Rt(e,t){const n=[];for(let s=0;s<t.length;s+=nt)n.push(t.slice(s,s+nt));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=ot){const i=await e.batch(n.slice(s,s+ot).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const c=a.result;Object.assign(o,c.entries),r.push(...c.diagnostics)}}return{entries:o,diagnostics:r}}async function Vr(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=rt){const r=t.slice(o,o+rt),s=await e.changesDiscard({names:r.map(i=>i.name),ifMatch:Object.fromEntries(r.map(i=>[i.name,i.version]))});n={revision:s.revision,versions:{...n.versions,...s.versions}}}return n}function Br(e){return e instanceof P&&e.code===S.Conflict}function Fe(e){return e?.kind==="protocol"?e:null}function Hr(e,t,n){const o=R.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=Z();let a;o[2]!==e?(a=Fe(e),o[2]=e,o[3]=a):a=o[3];const c=a,l=!!c&&!!t&&s.enabled!==!1;let f;o[4]!==t?(f=g.contentChanges(t??""),o[4]=t,o[5]=f):f=o[5];let u;o[6]!==t||o[7]!==l||o[8]!==c||o[9]!==i?(u=l?()=>Vn(i,c.client,t):je,o[6]=t,o[7]=l,o[8]=c,o[9]=i,o[10]=u):u=o[10];let d;return o[11]!==f||o[12]!==u?(d={queryKey:f,queryFn:u,staleTime:0},o[11]=f,o[12]=u,o[13]=d):d=o[13],F(d)}function Jr(e,t,n){const o=R.c(14);let r;o[0]!==e?(r=Fe(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i;o[2]!==n?(i=n?Object.keys(n.changes):[],o[2]=n,o[3]=i):i=o[3];const a=i,c=!!s&&!!t&&!!n&&a.length>0;let l;o[4]!==t||o[5]!==n?.revision?(l=g.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=l):l=o[6];let f;o[7]!==c||o[8]!==a||o[9]!==s?(f=c?()=>Rt(s.client,a):je,o[7]=c,o[8]=a,o[9]=s,o[10]=f):f=o[10];let u;return o[11]!==l||o[12]!==f?(u={queryKey:l,queryFn:f,staleTime:Number.POSITIVE_INFINITY},o[11]=l,o[12]=f,o[13]=u):u=o[13],F(u)}function Wr(e,t,n){const o=R.c(16);let r;o[0]!==e?(r=Fe(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i,a,c,l;if(o[2]!==t||o[3]!==n?.changes||o[4]!==s){const d=Object.entries(n?.changes??{}).filter(Gn).map(Wn).sort(Jn);a=d.map(Hn);const h=JSON.stringify(d.map(Bn));i=!!s&&!!t&&a.length>0,l=F,c=g.contentDeletedCopies(t??"",h),o[2]=t,o[3]=n?.changes,o[4]=s,o[5]=i,o[6]=a,o[7]=c,o[8]=l}else i=o[5],a=o[6],c=o[7],l=o[8];let f;o[9]!==i||o[10]!==a||o[11]!==s?(f=i?async()=>{const d=await Rt(s.client,a),h=Object.create(null);for(const[b,v]of Object.entries(d.entries))h[b]=v.before&&typeof v.before=="object"?v.before:null;return h}:je,o[9]=i,o[10]=a,o[11]=s,o[12]=f):f=o[12];let u;return o[13]!==c||o[14]!==f?(u={queryKey:c,queryFn:f,staleTime:Number.POSITIVE_INFINITY,placeholderData:wn},o[13]=c,o[14]=f,o[15]=u):u=o[15],l(u)}function Bn(e){return[e.name,e.base]}function Hn(e){return e.name}function Jn(e,t){return e.name<t.name?-1:e.name>t.name?1:0}function Wn(e){const[t,n]=e;return{name:t,base:n.baseVersion??""}}function Gn(e){const[,t]=e;return t.kind==="delete"}function xt(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")return!1;const n=t.hostname.toLowerCase();return n==="127.0.0.1"||n==="[::1]"||n==="localhost"}catch{return!1}}function he(e){try{const t=new URL(e);return(t.hostname==="127.0.0.1"||t.hostname==="[::1]")&&(t.hostname="localhost"),t.href}catch{return e}}const $t=Sn({endpoint:yn().max(2048).refine(e=>xt(e)&&new URL(e).pathname==="/rpc").transform(he)});function Gr(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=$t.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function Nt(e){const t=$t.safeParse(e);return t.success?t.data:null}const jt="studio:deco-serve-last";function Yr(e){try{localStorage.setItem(jt,JSON.stringify(e))}catch{}}function zr(){try{const e=localStorage.getItem(jt);return e?Nt(JSON.parse(e)):null}catch{return null}}function Xr(e){try{return new URL(he(e)).host}catch{return e}}function Yn(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const zn="http://localhost:4545/rpc";class Qe extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function Xn(e){if(e instanceof Qe)return{reason:"not-deco-serve"};if(!(e instanceof P))return{reason:"not-answering"};switch(e.code){case S.Unauthorized:case S.MethodNotFound:return{reason:"outdated"};case S.Unsupported:return Le(e)?{reason:"outdated"}:{reason:"version-mismatch"};case S.Unavailable:return/^the endpoint answered HTTP/.test(e.message)?{reason:"not-deco-serve"}:{reason:"error",detail:e.message};default:return{reason:"error",detail:e.message}}}function Zr(e,t){if(e)return[he(e.endpoint)];const n=[t?.endpoint,zn].filter(o=>!!o).map(he);return[...new Set(n)]}const Ct=L.createContext(null);function Zn(e){const t=R.c(24),n=L.useContext(Ct),o=Ce(n?null:e),{data:r}=En.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?ke.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[c,l]=it(a);let f;t[4]!==i||t[5]!==s||t[6]!==e?(f=i?ke.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=f):f=t[7];const[u,d]=it(f);if(n)return n;let h;t[8]!==c||t[9]!==i||t[10]!==o?(h=i&&o?Nt(c):null,t[8]=c,t[9]=i,t[10]=o,t[11]=h):h=t[11];const b=h,v=i&&o&&typeof u=="string"?u:null;let w;t[12]!==d||t[13]!==l||t[14]!==i?(w=x=>{i&&(l(x),d(x.endpoint))},t[12]=d,t[13]=l,t[14]=i,t[15]=w):w=t[15];let I;t[16]!==l||t[17]!==i?(I=()=>{i&&l(null)},t[16]=l,t[17]=i,t[18]=I):I=t[18];let E;return t[19]!==b||t[20]!==v||t[21]!==w||t[22]!==I?(E={connection:b,lastEndpoint:v,set:w,clear:I},t[19]=b,t[20]=v,t[21]=w,t[22]=I,t[23]=E):E=t[23],E}function st(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function it(e){const t=R.c(17),n=Z(),o=e??"";let r;t[0]!==o?(r=["localStorage",o],t[0]=o,t[1]=r):r=t[1];const s=r;let i,a;t[2]!==e?(i=()=>e?st(e):null,a=()=>e?st(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const c=!!e;let l;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==c?(l={queryKey:s,queryFn:i,initialData:a,enabled:c,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=c,t[9]=l):l=t[9];const{data:f}=F(l);let u;t[10]!==e||t[11]!==n||t[12]!==s?(u=v=>{if(e){try{v===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(v))}catch{}n.setQueryData(s,v)}},t[10]=e,t[11]=n,t[12]=s,t[13]=u):u=t[13];const d=u,h=e?f??null:null;let b;return t[14]!==d||t[15]!==h?(b=[h,d],t[14]=d,t[15]=h,t[16]=b):b=t[16],b}function qr(e){return e.kind==="protocol"||e.kind==="unavailable"}function Kr(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n===null||n==="legacy"?t:!0}function es(e,t,n){return t!=="github"||!n?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function ts(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&xt(t)?t:null}function ns(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function At(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function qn(e){if(!e.hasProject)return"legacy";const t=At(e);if(t==="local")return"protocol-local";if(!e.v8)return"legacy";if(t==="sandbox"){const o=e.sandboxSite;return o==="ready"?"protocol-sandbox":o==="error"?"retrying-sandbox":"pending"}const n=e.githubSite;return n==="ready"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":"pending"}function Kn(e){return{github:e.v8&&e.mode==="github",sandbox:e.v8&&e.mode==="sandbox"&&e.workingTreeReady}}function at(e){return e.isError||e.errorUpdateCount>0}function eo(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const r of n)Object.hasOwn(t,r)?o[r]=t[r]:delete o[r];return o}function to(e){if(!e||typeof e!="object")return[];const t=e,n=[];return typeof t.blockKey=="string"&&n.push(t.blockKey),t.writes&&typeof t.writes=="object"&&n.push(...Object.keys(t.writes)),Array.isArray(t.deletes)&&n.push(...t.deletes.filter(o=>typeof o=="string")),n}const Ut="__noSchema";function Mt(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[Ut]:!0}}function os(e){return!!e&&e[Ut]===!0}function Ve(e){if(!e.ok)return e.error.code===S.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function no(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const oo=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function rs(e){const t=new Map;for(const[n,o]of Object.entries(e)){const r=o&&typeof o=="object"&&!Array.isArray(o)?o:{},s=typeof r.__resolveType=="string"?r.__resolveType:null,i=t.get(s)??[];i.push({key:n,label:no(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(oo)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:ct(n.resolveType).localeCompare(ct(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function ct(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function lt(e,t,n){if(t.length===0)return n;const[o,...r]=t;if(Array.isArray(e)&&typeof o=="number"){const s=e.slice();return s[o]=lt(e[o],r,n),s}if(e&&typeof e=="object"&&typeof o=="string"){const s=e,i={};for(const a of Object.keys(s))i[a]=a===o?lt(s[a],r,n):s[a];return i}return e}function ss(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class ut extends Error{}const Be="site-not-owned";async function ro(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function so(e,t=n=>fetch(n)){const n=Ue({endpoint:e,fetch:async o=>{const r=await t(o);if(await ro(r))throw new ut;return r}});try{return await Je(n)}catch(o){if(o instanceof ut)return Be;throw o}}async function io(e,t,n){await t();const o=await so(e,n);return o===Be?o:{...o,hosted:Dn(e,n)}}const He=5e3;function ao(e){if(!e.site)throw new Error("this project names no site");return kn(e.site,e.branch)}function co(e){return new URL(me(e,"rpc"),window.location.origin).href}async function Je(e){const[t,n]=await e.batch([{method:"describe"},{method:"schema.get"}]);if(!t?.ok)throw t?.error??new Error("no describe");if(t.result?.protocol!==K)throw new Qe;const r=Pt(t.result);if(!n)throw new Error("no schema.get");if(Ve(n))return{client:e,describe:r,hasSchema:!1};if(n.ok)return{client:e,describe:r,hasSchema:!0};throw n.error}function lo(e,t=n=>fetch(n)){return Je(Ue({endpoint:e,fetch:t}))}function oe(e,t){const n=R.c(50),{org:o}=On(),{connection:r}=Zn(e),{runtime:s}=It(e),i=L.useContext(Ct),a=Ce(e),c=yt(Ae(e)?.metadata),l=At({hasServeConnection:!!r,runtime:s}),f=Un()?.taskId??null,u=Mn(Ln().lifecycle.phase),d=Z(),h=Kn({mode:l,v8:a,workingTreeReady:u}),b=h.github&&!!o.slug&&!!e&&!!t,v=F({queryKey:g.contentBackend(o.slug,e??"",t??"","github"),queryFn:()=>io(ao({orgSlug:o.slug,site:c,branch:t}),()=>Et(c,t)),enabled:b,staleTime:Number.POSITIVE_INFINITY,...ft}),w=h.sandbox&&!!o.slug&&!!e&&!!t;let I;n[0]!==t||n[1]!==o.slug||n[2]!==f||n[3]!==e?(I=()=>lo(co({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:f})),n[0]=t,n[1]=o.slug,n[2]=f,n[3]=e,n[4]=I):I=n[4];const E=F({queryKey:g.contentBackend(o.slug,e??"",t??"","sandbox",f??""),queryFn:I,enabled:w,staleTime:Number.POSITIVE_INFINITY,...ft}),x=!!r;let _;n[5]!==r?.endpoint||n[6]!==o.slug||n[7]!==e?(_=g.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[5]=r?.endpoint,n[6]=o.slug,n[7]=e,n[8]=_):_=n[8];let N;n[9]!==r?(N=()=>Je(Ue({endpoint:r.endpoint})),n[9]=r,n[10]=N):N=n[10];let $;n[11]!==x||n[12]!==_||n[13]!==N?($={queryKey:_,queryFn:N,enabled:x,staleTime:Number.POSITIVE_INFINITY,retry:ho,retryDelay:fo,refetchInterval:uo},n[11]=x,n[12]=_,n[13]=N,n[14]=$):$=n[14];const p=F($);let U;n[15]!==r?.endpoint||n[16]!==o.slug||n[17]!==e?(U=g.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[15]=r?.endpoint,n[16]=o.slug,n[17]=e,n[18]=U):U=n[18];const D=U;let T;n[19]!==r?.endpoint||n[20]!==o.slug||n[21]!==e?(T=g.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[19]=r?.endpoint,n[20]=o.slug,n[21]=e,n[22]=T):T=n[22];let j;n[23]!==p.data||n[24]!==D||n[25]!==d?(j=async()=>{try{return await p.data.client.describe()}catch(m){const J=m;throw d.invalidateQueries({queryKey:D,exact:!0},{cancelRefetch:!1}),J}},n[23]=p.data,n[24]=D,n[25]=d,n[26]=j):j=n[26];const C=!!p.data&&!i;let O;n[27]!==T||n[28]!==j||n[29]!==C?(O={queryKey:T,queryFn:j,enabled:C,refetchInterval:He,retry:!1},n[27]=T,n[28]=j,n[29]=C,n[30]=O):O=n[30];const A=F(O).data??p.data?.describe,k=qn({hasProject:!!e,hasServeConnection:!!r,runtime:s,v8:a,githubSite:v.data===Be?"not-owned":v.data?"ready":at(v)?"error":"loading",sandboxSite:go({data:E.data,isError:at(E),workingTreeReady:u})});if(k==="pending"){let m;return n[31]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending"},n[31]=m):m=n[31],m}if(k==="retrying-sandbox"){let m;return n[32]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending",retrying:"sandbox"},n[32]=m):m=n[32],m}if(k==="legacy"){let m;return n[33]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"legacy"},n[33]=m):m=n[33],m}if(k==="protocol-github"){const m=v.data;let J;n[34]!==m?(J=Te("github",m,""),n[34]=m,n[35]=J):J=n[35];let re;return n[36]!==c||n[37]!==J?(re={...J,site:c},n[36]=c,n[37]=J,n[38]=re):re=n[38],re}if(k==="site-not-owned-github"){let m;return n[39]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github",siteNotOwned:!0},n[39]=m):m=n[39],m}if(k==="protocol-sandbox"){let m;return n[40]!==E.data?(m=Te("sandbox",E.data,":sandbox"),n[40]=E.data,n[41]=m):m=n[41],m}if(k==="unavailable-github"){let m;return n[42]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github"},n[42]=m):m=n[42],m}const Q=p.error??p.failureReason,y=r?.endpoint??"";let V;return n[43]!==A||n[44]!==p.data||n[45]!==p.failureCount||n[46]!==p.isError||n[47]!==y||n[48]!==Q?(V=bo({probed:p.data,isError:p.isError,failureCount:p.failureCount,failure:Q,describe:A,endpoint:y}),n[43]=A,n[44]=p.data,n[45]=p.failureCount,n[46]=p.isError,n[47]=y,n[48]=Q,n[49]=V):V=n[49],V}function uo(e){return e.state.status==="error"||e.state.data?.hasSchema===!1?He:!1}function fo(e){return Yn(e+1)}function ho(e,t){return!(t instanceof P)&&!(t instanceof Qe)}function go(e){return e.data!==void 0?"ready":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const vo=3;function bo(e){const t=e.probed?Te("local",{...e.probed,describe:e.describe??e.probed.describe},`:serve:${e.endpoint}`):null;return e.isError||e.failureCount>0?t?.kind==="protocol"&&!e.isError&&e.failureCount<vo?t:{kind:"unavailable",source:"local",problem:Xn(e.failure)}:t??{kind:"pending"}}const ft={retry:2,refetchInterval:e=>e.state.status==="error"?He:!1};function Te(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema,...t.hosted?{hosted:t.hosted}:{}}}function Lt(e){const t=R.c(12);let n;t[0]!==e?(n=ke.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=In(o,null),i=Ce(e);let a;t[2]!==r||t[3]!==e?(a=e?et(r):null,t[2]=r,t[3]=e,t[4]=a):a=t[4];const l=i?null:a;let f,u;t[5]!==s?(f=h=>s(et(h)),u=()=>s(null),t[5]=s,t[6]=f,t[7]=u):(f=t[6],u=t[7]);let d;return t[8]!==l||t[9]!==f||t[10]!==u?(d={url:l,setUrl:f,clear:u},t[8]=l,t[9]=f,t[10]=u,t[11]=d):d=t[11],d}function po(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function dt(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}function we(e,t,n){return["decofile-write",e,t,n]}function mo(e,t,n){return{id:we(e,t,n).join(":")}}class We extends Error{constructor(t,n,o=[],r=!1){super(n),this.blocks=t,this.fields=o,this.carriedStored=r,this.name="BlockConflictError"}blocks;fields;carriedStored}function Ge(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function Ye(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function wo(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function So(e,t,n){e.setQueryData(g.decofileDraft(Ge(t)),n)}function yo(e,t){return e.getQueryData(g.decofileDraft(Ge(t)))??null}async function Eo(e,t){return(await fetch(Ye(e),{cache:"no-store",headers:{"if-none-match":`"${t}"`}}).catch(()=>null))?.status===200}function is(e){const t=R.c(4);let n;t[0]!==e?(n=g.decofileDraft(e?Ge(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Oo,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r??null}async function Oo(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function Do(e,t){const n=await fetch(Ye(t),{cache:"no-store"});if(!n.ok){const r=new Error(`Failed to fetch decofile: ${n.status}`);throw r.status=n.status,r}const o=await n.json();return o.token&&So(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function as(e,t){const n=await fetch(Ye(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const r=await n.json().catch(()=>({}));throw r.code==="block-conflict"?new We(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return wo(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const Ft=3e3,ko=15e3,Io=2*6e4,Qt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function _o(e){return e<Io?Ft:ko}function To(e,t=Qt){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,_o(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:c,skip:l}=e();if(r||t.hidden()||l?.()){i();return}r=!0;let f;try{f=c()}catch{f=void 0}Promise.resolve(f).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const ht=()=>0;function Po(e,t,n=Qt){const o=L.useRef(t);o.current=t;const[r]=L.useState(()=>({polling:()=>To(()=>o.current,n),idle:()=>()=>{}}));L.useSyncExternalStore(e?r.polling:r.idle,ht,ht)}function Vt(e,t){return me(e,t)}function Ro(e,t){return me(e,"preview-fetch",{path:t})}function cs(e){return Vt(e,"preview-invoke")}function ls(e){return Vt(e,"catalog-invoke")}function Bt(e){try{const{hostname:t}=new URL(e);return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}function xo(){if(typeof document>"u")return null;const e=Array.from(document.querySelectorAll("iframe"));for(const t of e){const n=t.getAttribute("src");if(n&&Bt(n))return n}return null}function $o(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??xo();return n&&Bt(n)?new URL(t,n).toString():Ro(e,t)}function No(e){return $o(e,"/.decofile")}function jo(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function gt(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function Co(e,t){const n=me(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=jo(o.status);if(r==="absent")return{kind:"absent"};if(r==="unavailable")return{kind:"unavailable"};if(r==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const s=await o.json();return typeof s.content!="string"?{kind:"unavailable"}:{kind:"data",data:An(s.content)}}async function Ao(e,t){const n=await Co(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function us(e){const t=`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/meta`,n=await fetch(t,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const o=new Error(`Failed to read committed meta: ${n.status}`);throw o.status=n.status,o}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function Uo(e){return Ae(e)?.metadata?.runtime?.path??null}class Ht extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function fs(e){return e instanceof P&&e.code===S.Conflict}function Jt(e){const t=e.data?.violations;return!Array.isArray(t)||t.length===0?e.message:t.slice(0,3).map(n=>n.message).join("; ")}class ze extends Error{constructor(){super("The draft's changes couldn't be read"),this.name="HostedDraftUnreadError"}}class Xe extends Error{constructor(){super("The blocks kept changing while the change was saved"),this.name="HostedKeptChangingError"}}function ds(e,t){return(t instanceof ze||t instanceof Xe)&&(t.message=Wt(e,t,"github")),t}function Wt(e,t,n){if(t instanceof ze)return e("siteEditor.save.draftUnread");if(t instanceof Xe)return e("siteEditor.save.keptChanging");if(t instanceof We)return t.message;if(n==="local")return Lo(e,t);if(t instanceof P)switch(t.code){case S.Conflict:return e("siteEditor.save.conflict");case S.ReadOnly:return e("siteEditor.save.readOnly");case S.InvalidBlock:case S.InvalidParams:return e("siteEditor.save.invalid");case S.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function Mo(e,t){if(t==="local"||e instanceof We||e instanceof ze||e instanceof Xe)return null;if(e instanceof P){const n=e.code===S.InvalidBlock||e.code===S.InvalidParams?Jt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function Lo(e,t){if(t instanceof Ht)return e("decoServe.save.serverGone");if(t instanceof P)switch(t.code){case S.Conflict:return e("decoServe.save.conflict");case S.ReadOnly:return e("decoServe.save.readOnly");case S.InvalidBlock:case S.InvalidParams:return e("decoServe.save.invalid",{detail:Jt(t)});case S.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function Fo(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function Qo(e,t){const[n,o]=L.useState(e),r=L.useRef(null);return e&&!n&&o(!0),L.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=Fo(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const Vo="decocms:content-writes",Pe=new Set;let G;function Gt(){if(G!==void 0)return G;G=null;try{typeof BroadcastChannel=="function"&&(G=new BroadcastChannel(Vo),G.addEventListener("message",e=>{const t=e.data?.cacheKey;if(typeof t=="string")for(const n of[...Pe])n(t)}))}catch{G=null}return G}function Bo(e){try{Gt()?.postMessage({cacheKey:e})}catch{}}function Ho(e){return Gt(),Pe.add(e),()=>{Pe.delete(e)}}const Yt="__at=",zt="__test=",Jo=/^[0-9a-f]{12}-[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;function Wo(e){return e.at!==void 0||Object.keys(e.tests??{}).length>0}function X(e){return typeof e=="string"&&Jo.test(e)}function vt(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function Go(e){const t=e.tests??{};return[...e.at!==void 0?[Yt+vt(e.at)]:[],...Object.keys(t).map(n=>zt+vt(`${n}=${t[n]?"on":"off"}`))]}function bt(e,t){const o=[...e.split("&").filter(r=>r&&!r.startsWith(Yt)&&!r.startsWith(zt)),...t];return o.length>0?`?${o.join("&")}`:""}function ge(e,t){const n=Go(t),o=e.indexOf("?"),r=o===-1?e:e.slice(0,o);if(X(r))return r+bt(o===-1?"":e.slice(o+1),n);const s=e.lastIndexOf("@");if(s<=0)return e;const i=e.slice(0,s),a=i.indexOf("?"),c=a===-1?i:i.slice(0,a),l=a===-1?"":i.slice(a+1);return`${c}${bt(l,n)}${e.slice(s)}`}function hs(e,t,n){if(!Wo(t))return e;try{const o=new URL(e),r=o.searchParams.get("__draft");return r&&r!=="off"?(o.searchParams.set("__draft",ge(r,t)),o.toString()):X(n)?(o.searchParams.set("__draft",ge(n,t)),o.toString()):e}catch{return e}}function gs(e,t,n="/"){if(!e||!X(t))return null;try{const o=new URL(n,e);return o.searchParams.set("__draft",t),o.toString()}catch{return null}}function Xt(e){return btoa(encodeURIComponent(e))}function vs(e,t,n){const o=Yo(e,t,n);return o.searchParams.set("__cb",crypto.randomUUID()),o.toString()}function Yo(e,t,n){const o=new URL(e).origin,r=new URL(`/live/previews/${encodeURIComponent(t)}`,o);return r.searchParams.set("path","/"),r.searchParams.set("pathTemplate","/"),r.searchParams.set("props",Xt(JSON.stringify({path:"/",sections:[{__resolveType:n}]}))),r}const zo="__draft";function bs(e){return`${`${e.apiHost}/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}?token=${e.token}`}@${e.version}`}const Xo="off";function Zo(e,t){if(!t)return e;const n=new URL(e);return n.searchParams.set(zo,t),n.toString()}function ps(e){const t=e.pageBlock.__resolveType;if(typeof t!="string"||!t)return null;const n=new URL(e.previewBaseUrl).origin,o=new URL(`/live/previews/${encodeURIComponent(t)}`,n);o.searchParams.set("__decoFBT","0"),o.searchParams.set("__d",""),o.searchParams.set("path",e.path),o.searchParams.set("pathTemplate",e.pathTemplate);const{__resolveType:r,...s}=e.pageBlock,i=JSON.stringify({__props:s,__decofile:e.decofile});return{src:o.toString(),body:i}}function ms(e,t,n,o){const r=new URL(e).origin,s=new URL(`/live/previews/${encodeURIComponent(t)}`,r);s.searchParams.set("__d","");const i=[{__resolveType:"preview",block:n}];return o&&i.push(o),s.searchParams.set("props",Xt(JSON.stringify({sections:i}))),s.toString()}function ws(e){return e.fastPreviewActive&&e.previewServerUrl?e.previewServerUrl:e.sandboxUrl??null}const pt="__variant=";function Zt(e,t,n){return`${e}@${t}=${n}`}function Ss(e,t){return!e||!t.multivariate||t.variants.length<=1?[]:t.index<0||t.index>=t.variants.length?[]:[Zt(e,"sections",t.index)]}function ys(e){const t=Array.isArray(e.mvObj.variants)?e.mvObj.variants:[];if(!e.pageKey||e.sectionIndex<0)return[];if(e.selectedVariantIndex<0||e.selectedVariantIndex>=t.length)return[];const o=`${e.page.multivariate?`sections.variants.${e.page.index}.value${e.page.lazyValues?".value":""}`:"sections"}.${e.sectionIndex}${e.sectionLazy?".section":""}`;return[Zt(e.pageKey,o,e.selectedVariantIndex)]}function Es(e,t){return[...t,...e]}function qo(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function Ze(e,t){const n=e.lastIndexOf("@");if(n<=0)return e;const o=e.slice(0,n),r=o.indexOf("?"),s=r===-1?o:o.slice(0,r),a=[...r===-1?[]:o.slice(r+1).split("&").filter(l=>l&&!l.startsWith(pt)),...t.map(l=>pt+qo(l))],c=a.length>0?`?${a.join("&")}`:"";return`${s}${c}${e.slice(n)}`}function Os(e,t,n=!1){if(t.length===0&&!n)return null;try{const o=new URL(e),r=o.hostname==="[::1]"?`localhost${o.port?`:${o.port}`:""}`:o.host;return Ze(`${r}${o.pathname}@local`,t)}catch{return null}}function Ds(e,t){if(t.length===0)return e;try{const n=new URL(e),o=n.searchParams.get("__draft");return!o||o==="off"?e:(n.searchParams.set("__draft",Ze(o,t)),n.toString())}catch{return e}}function Ko(e){const{pointer:t}=e;if(!t||t===Xo)return null;const n=t.indexOf("?");return X(n===-1?t:t.slice(0,n))||t.lastIndexOf("@")<=0?null:X(e.heldRevision)&&e.forcedVariants.length===0?ge(e.heldRevision,e.previewOptions):ge(Ze(t,e.forcedVariants),e.previewOptions)}function er(e,t){if(!e||!t)return null;try{return Zo(e,t)}catch{return null}}function ks(e,t,n){if(!e||!n)return null;try{return er(new URL(t,e).toString(),n)}catch{return null}}const ve={forcedVariants:[],previewOptions:{}},ie=new Map,ae=new Map,Re=new Map;function qt(e){for(const t of Re.get(e)??[])t()}function Kt(e,t){const n=X(t)?t:null;(ae.get(e)??null)!==n&&(n?ae.set(e,n):ae.delete(e),qt(e))}function tr(e){return ae.get(e)??null}function nr(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Is(e,t){const n=ie.get(e)??ve,o=t??ve;nr(n,o)||(t?ie.set(e,o):ie.delete(e),qt(e))}function or(e){return ie.get(e)??ve}function en(e,t){let n=Re.get(e);return n||(n=new Set,Re.set(e,n)),n.add(t),()=>{n.delete(t)}}function rr(e){const t=R.c(3);let n,o;return t[0]!==e?(n=r=>en(e,r),o=()=>or(e),t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,sr)}function sr(){return ve}function ir(e){const t=R.c(3);let n,o;return t[0]!==e?(n=r=>e?en(e,r):cr,o=()=>e?tr(e):null,t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,ar)}function ar(){return null}function cr(){}function _s(e,t){const n=R.c(4),o=rr(e),r=ir(e);let s;return n[0]!==o||n[1]!==r||n[2]!==t?(s=Ko({pointer:t,heldRevision:r,...o}),n[0]=o,n[1]=r,n[2]=t,n[3]=s):s=n[3],s}const tn={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},lr=15e3,be=new Map;function z(e,t){return`${e}/${t}`}function H(e){let t=be.get(e);return t||(t={state:tn,listeners:new Set,previews:0,timer:null,discardListeners:new Set},be.set(e,t)),t}function W(e,t){const n=H(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function Se(e){e.timer&&clearTimeout(e.timer),e.timer=null}function qe(e){return be.get(e)?.state??tn}function ur(e,t){const n=H(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function Ts(e){const t=H(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(Se(t),W(e,{phase:"idle"}))}}function Ps(e){const t=be.get(e);!t||t.state.phase!=="reloading"||(Se(t),W(e,{phase:"idle"}))}function nn(e){const t=H(e);Se(t),W(e,{phase:"saving",inFlight:t.state.inFlight+1})}function ce(e,t){const n=H(e),o=Math.max(0,n.state.inFlight-1);if(o>0){W(e,{inFlight:o});return}if(!t.ok||n.previews===0){W(e,{phase:"idle",inFlight:o});return}on(e,t.navigates,o)}function on(e,t,n=0){const o=H(e);Se(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&W(e,{phase:"idle"})},lr),W(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function fr(e){return e?.kind==="protocol"&&e.source==="github"}async function le(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,c=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:g.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await c,{navigates:!1};const l=s?g.protocolDraftRead(o,r,s):null,f=l?JSON.stringify(n.getQueryData(l)??null):null,u=c?[c]:[];if(a&&t.reread&&u.push(n.invalidateQueries({queryKey:g.decofile(a)})),a&&!t.adopted&&u.push(n.invalidateQueries({queryKey:g.contentChanges(a)})),s&&i.source==="sandbox"&&u.push(n.invalidateQueries({queryKey:Fn(o,r,s)})),fr(i)&&l&&!t.adopted&&u.push(n.invalidateQueries({queryKey:l})),await Promise.all(u),t.kind!=="edit"){const b=z(o,r);W(b,{epoch:qe(b).epoch+1})}const d=l?JSON.stringify(n.getQueryData(l)??null):null,h=f!==d;return h&&await new Promise(b=>Ot.schedule(b)),{navigates:h}}async function dr(e,t){return nn(z(e.orgSlug,e.virtualMcpId)),rn(e,t)}function mt(e){return e.branch?JSON.stringify(e.queryClient.getQueryData(g.protocolDraftRead(e.orgSlug,e.virtualMcpId,e.branch))??null):null}async function rn(e,t){const n=z(e.orgSlug,e.virtualMcpId),o=t.adopted?mt(e):null;let r;try{r=await t.write()}catch(i){throw ce(n,{ok:!1,navigates:!1}),t.refreshOnError&&le(e,{kind:t.kind,reread:!0}).catch(()=>{}),i}if(e.backend?.kind==="protocol"&&e.cacheKey&&Bo(e.cacheKey),Kt(n,t.shownRevision?.(r)??null),t.adopted){const i=mt(e)!==o;return i&&await new Promise(a=>Ot.schedule(a)),ce(n,{ok:!0,navigates:i}),t.reread&&le(e,t).catch(()=>{}),r}let s=!1;try{({navigates:s}=await le(e,t))}catch{}finally{ce(n,{ok:!0,navigates:s})}return r}function Rs(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=z(o,r),a=new Set(t.blockKeys);for(const f of[...H(i).discardListeners])f(a);nn(i);let c=!1;const l=()=>(c=!0,rn(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:we(o,r,s),scope:mo(o,r,s),mutationFn:l}).execute(void 0).catch(f=>{throw c||ce(i,{ok:!1,navigates:!1}),f}):l()}function xs(e,t,n){const o=R.c(8);let r;o[0]!==e||o[1]!==t?(r=z(e,t),o[0]=e,o[1]=t,o[2]=r):r=o[2];const s=r;let i;o[3]!==n||o[4]!==s?(i=()=>{const c=H(s).discardListeners;return c.add(n),()=>{c.delete(n)}},o[3]=n,o[4]=s,o[5]=i):i=o[5];let a;o[6]!==s?(a=[s],o[6]=s,o[7]=a):a=o[7],L.useEffect(i,a)}function sn(e){const t=z(e.orgSlug,e.virtualMcpId);qe(t).inFlight>0||(Kt(t,null),le(e,{kind:"external"}).then(({navigates:n})=>{const o=H(t);o.previews>0&&o.state.inFlight===0&&on(t,n)}).catch(()=>{}))}function hr(e,t){const n=R.c(7);let o;n[0]!==e||n[1]!==t?(o=z(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=l=>ur(r,l),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>qe(r),n[5]=r,n[6]=a):a=n[6];const c=a;return L.useSyncExternalStore(i,c,c)}const gr=500;function $s(e,t){const{phase:n}=hr(e,t);return Qo(n!=="idle",gr)}function vr(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function an(e,t){return g.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function Ns(e,t,n,o){if(o?.source==="github"){const i=e.getQueryData(g.contentIndex(t));return i?Tn(i,n):br(e,t,n)}const r=e.getQueryData(g.contentVersions(t));if(!r)return;if(Object.hasOwn(r,n))return r[n];const s=e.getQueryData(g.decofile(t));return s&&Object.hasOwn(s,n)?void 0:null}function te(e,t){if(Object.hasOwn(e.changes,t))return e.changes[t];const n=B(t),o=Object.keys(e.changes).find(r=>B(r)===n);return o===void 0?void 0:e.changes[o]}function br(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(o)return cn(o,ye(e,t),n)}function cn(e,t,n){const o=te(e,n);return o?.kind==="delete"?o.version??fe:o?o.version:t.has(B(n))?fe:null}function js(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(!o)return!1;const r=te(o,n);return r?r.kind==="set"&&r.baseVersion===null:ye(e,t).has(B(n))}function Cs(e,t){const n=e.getQueryData(g.decofile(t)),o=e.getQueryData(g.contentChanges(t));if(!n||!o)return null;const r=ye(e,t);return{blocks:n,versionOf:s=>cn(o,r,s)}}function ye(e,t){return new Set(e.getQueryData(g.contentDraftTombstones(t)))}function pe(e,t,n,o){const r=B(n),s=ye(e,t);s.has(r)!==o&&(o?s.add(r):s.delete(r),q(e),e.setQueryData(g.contentDraftTombstones(t),[...s]))}function ln(e,t,n,o){const r=o.revision,s=e.getQueryData(g.contentVersions(n)),i=Object.entries(o.versions??{}).map(([u,d])=>[u,d===fe?null:d]),a=e.getQueryData(g.contentChanges(n)),c=new Set(i.flatMap(([u])=>{const d=a?te(a,u):void 0;return(d?d.baseVersion:s?.[u]??null)===null?[u]:[]})),l=new Set(i.flatMap(([u,d])=>d===null?[]:[B(u)]));e.setQueryData(g.contentChanges(n),u=>{if(!u)return u;const d={...u.changes};for(const[h,b]of i){const v=te(u,h),w=v?v.baseVersion:s?.[h]??null;b!==null?d[h]={kind:"set",version:b,baseVersion:w}:w!==null?d[h]={kind:"delete",version:null,baseVersion:w}:delete d[h]}return{...u,changes:d,edited:!0}});for(const[u,d]of i)d!==null?pe(e,n,u,!1):!l.has(B(u))&&c.has(u)&&pe(e,n,u,!0);const f=o.revision;return f&&f!=="none"&&e.setQueryData(g.protocolDraftRead(t.orgSlug,t.virtualMcpId,t.branch),u=>u&&{...u,version:f}),r}function Ee(e,t,n){q(e),e.setQueryData(g.contentVersions(t),o=>{const r={...o};for(const[s,i]of Object.entries(n))i===null?delete r[s]:r[s]=i;return r})}function un(e,t){const n=e.getMutationCache().findAll({mutationKey:we(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>to(o.state.variables)))}function xe(e,t){e.resetQueries({queryKey:g.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function ne(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof P);throw t.source==="local"&&s?(xe(e,n),new Ht(r)):(t.source==="local"&&Le(r)&&xe(e,n),r)}}const ue=new Map;function fn(e,t,n,o){const r=ue.get(o);if(r)return r;const s=Ke(e,t,n,o,!0);return ue.set(o,s),s.finally(()=>ue.delete(o))}const De=new Set;function pr(e,t,n){const o=R.c(8),r=Z(),s=t?.orgSlug,i=t?.virtualMcpId,a=t?.branch;let c,l;o[0]!==e||o[1]!==a||o[2]!==n||o[3]!==s||o[4]!==r||o[5]!==i?(c=()=>{if(!e||!s||!i||!a)return;const f={orgSlug:s,virtualMcpId:i,branch:a};return Ho(u=>{u===n&&(De.has(n)||(De.add(n),wr(r,e,f,n).catch(mr).finally(()=>De.delete(n))))})},l=[r,e,s,i,a,n],o[0]=e,o[1]=a,o[2]=n,o[3]=s,o[4]=r,o[5]=i,o[6]=c,o[7]=l):(c=o[6],l=o[7]),L.useEffect(c,l)}function mr(){}async function wr(e,t,n,o){const r=ue.get(o);return r&&await r.catch(()=>{}),fn(e,t,n,o)}async function Ke(e,t,n,o,r){q(e);const s=g.decofile(o),i=an(n,t),a=g.contentRevision(o),c=g.contentVersions(o),l=e.getQueryData(s),f=e.getQueryData(c),d=e.getQueryData(i),h=e.getQueryData(a)??void 0,b=r&&l&&f?h?.revision:void 0,v=r&&d?h?.schemaVersion:void 0,w=g.contentChanges(o),I=e.getQueryData(w);if(t.source==="github"&&t.hosted)return Sr(e,t,t.hosted,n,o,{conditional:r,seen:h,currentMeta:d,schemaIfNoneMatch:v,seenChanges:I});const[E,x,_]=await ne(e,t,n,()=>t.client.batch([{method:"blocks.list",params:b?{ifNoneMatch:b}:{}},{method:"schema.get",params:v?{ifNoneMatch:v}:{}},{method:"changes.list",params:Me(I)}])),N=e.getQueryData(a)?.revision,$=N!==void 0&&N!==h?.revision;if(_?.ok){const O=$?null:de(I,_.result);O&&e.setQueryData(w,O)}else _&&t.source==="local"&&Le(_.error)&&xe(e,n);if(!E?.ok)throw E?.error??new Error("no blocks.list");if(!x)throw new Error("no schema.get");const p=E.result,U=Ve(x),D=x.ok&&!U?x.result:null;if(p.notModified&&(!l||!f)||D?.notModified&&!d)return Ke(e,t,n,o,!1);const T=p.notModified?new Set:un(e,n),j=p.notModified?l:eo(p.blocks,l,T),C=U?Mt():D?D.notModified?d:D.schema:x.error;if(e.setQueryData(a,{revision:$?N:p.notModified?h?.revision:p.revision,schemaVersion:D?D.notModified?h?.schemaVersion:D.version??void 0:void 0}),e.setQueryData(s,j),!p.notModified){const O=e.getQueryData(c),M={...p.versions};for(const A of T){const k=O?.[A];k!==void 0?M[A]=k:delete M[A]}e.setQueryData(c,M)}return C instanceof P||e.setQueryData(i,C),!$&&!p.notModified&&l&&h?.revision&&p.revision!==h.revision&&sn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:j,meta:C}}async function Sr(e,t,n,o,r,s){const i=g.decofile(r),a=g.contentIndex(r),c=g.contentRevision(r),l=g.contentVersions(r),f=an(o,t),u=g.contentChanges(r),d=e.getQueryData(a),h=s.conditional&&d?s.seen?.revision:void 0,[b,v,w]=await ne(e,t,o,()=>n.batch([{method:"cms.index",params:h?{ifNoneMatch:h}:{}},{method:"schema.get",params:s.schemaIfNoneMatch?{ifNoneMatch:s.schemaIfNoneMatch}:{}},{method:"changes.list",params:Me(s.seenChanges)}])),I=e.getQueryData(a)??d,E=e.getQueryData(c)?.revision,x=E!==void 0&&E!==s.seen?.revision;if(w?.ok&&!x){const y=de(s.seenChanges,w.result);y&&e.setQueryData(u,y)}if(!b?.ok)throw b?.error??new Error("no cms.index");if(!v)throw new Error("no schema.get");const _=b.result,N=Ve(v),$=v.ok&&!N?v.result:null;if(_.notModified&&!d||$?.notModified&&!s.currentMeta)return Ke(e,t,o,r,!1);const p=N?Mt():$?$.notModified?s.currentMeta:$.schema:v.error;p instanceof P||e.setQueryData(f,p);const U=$?$.notModified?s.seen?.schemaVersion:$.version??void 0:void 0,D=e.getQueryData(i)??{};if(_.notModified||x)return e.setQueryData(c,{revision:x?E:s.seen?.revision,schemaVersion:U}),e.setQueryData(i,D),{blocks:D,meta:p};const T={revision:_.revision,resolvedRef:_.resolvedRef,sequence:_.sequence,entries:_.entries,draft:_.draft};e.setQueryData(a,T);const j=!!s.seen?.revision&&T.revision!==s.seen.revision&&(!s.seen.revision.startsWith("s-")||!!d&&dn(d.draft,T.draft));j&&e.setQueryData(g.protocolDraftRead(o.orgSlug,o.virtualMcpId,o.branch),y=>y&&{...y,version:T.revision}),e.setQueryData(c,{revision:T.revision,schemaVersion:U});const C=un(e,o),O=e.getQueryData(l)??{},M={},A={},k=[];for(const[y,V]of Object.entries(D)){const m=T.entries[y];!m&&!C.has(y)||(M[y]=V,O[y]!==void 0&&(A[y]=O[y]),m&&!C.has(y)&&O[y]!==m.version&&k.push(y))}return e.setQueryData(i,M),e.setQueryData(l,A),k.length>0&&await xn(e,n,r,k,C),I&&j&&yr(I,T)&&sn({queryClient:e,orgSlug:o.orgSlug,virtualMcpId:o.virtualMcpId,branch:o.branch,backend:t,cacheKey:r}),{blocks:e.getQueryData(i)??M,meta:p}}function yr(e,t){if(dn(e.draft,t.draft))return!0;const n=Object.keys(t.entries);return n.length!==Object.keys(e.entries).length?!0:n.some(o=>!Object.hasOwn(e.entries,o)||e.entries[o]?.version!==t.entries[o]?.version)}function dn(e,t){const n=Object.keys(t);return n.length!==Object.keys(e).length?!0:n.some(o=>!Object.hasOwn(e,o)||e[o]?.version!==t[o]?.version)}function Er(e,t){const n=[...Object.keys(t.set??{}),...t.delete??[]];return Object.fromEntries(n.filter(o=>Object.hasOwn(e,o)).map(o=>[o,e[o]]))}function wt(e){if(!(e instanceof P)||e.code!==S.Unavailable)return;const t=e.data?.landed;if(!(!t||typeof t!="object"||Array.isArray(t)))return Object.fromEntries(Object.entries(t).filter(n=>typeof n[1]=="string"))}function Or(e,t){const n=Object.fromEntries(Object.entries(e.set??{}).filter(([r])=>!Object.hasOwn(t,r))),o=(e.delete??[]).filter(r=>!Object.hasOwn(t,r));return{...Object.keys(n).length>0?{set:n}:{},...o.length>0?{delete:o}:{}}}function St(e,t,n,o,r){q(e),ln(e,t,n,{revision:e.getQueryData(g.contentRevision(n))?.revision??"",versions:r}),Ee(e,n,Object.fromEntries(Object.entries(r).map(([s,i])=>[s,i===fe?null:i]))),Dt(e,n,r,o.set??{})}async function As(e,t,n,o,r,s){if(t.source==="github"){const a=[...Object.keys(r.set??{}),...r.delete??[]].filter(l=>!s||!Object.hasOwn(s,l));if(a.length>0)throw new Error(`A hosted save needs a precondition for every block it touches (missing: ${a.join(", ")})`);const c=_n(r.set);if(c.length>0)throw new Error(`A hosted save can't write a block that isn't loaded (${c.join(", ")})`)}return dr({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o},{kind:"edit",adopted:t.source==="github",write:async()=>{const i=f=>ne(e,t,n,()=>t.client.blocksApply({set:f.set,delete:f.delete,...s?{ifMatch:Er(s,f)}:{}}));let a;try{a=await i(r)}catch(f){const u=t.source==="github"?wt(f):void 0;if(!u)throw f;const d=Or(r,u);Object.keys(u).length>0&&St(e,n,o,r,u);let h;try{h=await i(d)}catch(b){const v=wt(b);throw v&&Object.keys(v).length>0&&St(e,n,o,d,v),b}a={...h,versions:{...u,...h.versions}}}q(e);const c=t.source==="github"?ln(e,n,o,a):a.revision;t.source==="github"&&Dt(e,o,a.versions??{},r.set??{}),e.setQueryData(g.contentRevision(o),f=>({...f,revision:c}));const l=a.versions??{};return Ee(e,o,l),{revision:c,versions:l}}})}function hn(e,t){if(!(e instanceof P))return;const n=e.data?.draft;if(!n||typeof n!="object"||!Object.hasOwn(n,t))return;const o=n[t];return o&&typeof o.version=="string"?o:void 0}function gn(e,t,n){if(!(n instanceof P))return;const o=n.data?.draft;if(!(!o||typeof o!="object"))for(const[r,s]of Object.entries(o))s===null&&pe(e,t,r,!1)}function vn(e,t,n,o){q(e),Pn(e,n,o);const r=o.block===null,s=e.getQueryData(g.contentVersions(t)),i=e.getQueryData(g.contentChanges(t)),a=i?te(i,n):void 0,c=a?a.baseVersion:s?.[n]??null;if(i){const l=B(n),f=Object.fromEntries(Object.entries(i.changes).filter(([u])=>B(u)!==l));r?c!==null&&(f[n]={kind:"delete",version:null,baseVersion:c}):f[n]={kind:"set",version:o.version,baseVersion:c},e.setQueryData(g.contentChanges(t),{...i,changes:f,edited:!0})}pe(e,t,n,r&&c===null),e.setQueryData(g.decofile(t),l=>{const f={...l};return r?delete f[n]:f[n]=o.block,f}),Ee(e,t,{[n]:r?null:o.version}),Rn(e,t,n,o)}function Us(e,t,n,o){if(t.source!=="github"||!(o instanceof P))return!1;gn(e,n,o);const r=o.data?.draft;if(!r||typeof r!="object")return!1;const s=Object.keys(r),i=s.map(a=>hn(o,a));return s.length===0||i.some(a=>a===void 0)?!1:(e.cancelQueries({queryKey:g.decofile(n)}),s.forEach((a,c)=>{vn(e,n,a,i[c])}),!0)}async function Ms(e,t,n,o,r,s){t.source==="github"&&gn(e,o,s);const i=t.source==="github"?hn(s,r):void 0;if(i)return e.cancelQueries({queryKey:g.decofile(o)}),vn(e,o,r,i),!0;await e.invalidateQueries({queryKey:g.decofile(o)});let a;try{const l=(await ne(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(l&&l.after===null&&l.version!==null)return!1;a={value:l?.after??null,version:l?.version??null},t.source==="github"&&e.setQueryData(g.contentChanges(o),f=>{if(!f)return f;const u={...f.changes};return l?.kind?u[r]={kind:l.kind,version:l.version,baseVersion:l.baseVersion}:delete u[r],{...f,changes:u,edited:!0}})}catch{const c=await ne(e,t,n,()=>t.client.blocksList({}));if(c.notModified)return!1;a={value:c.blocks[r]??null,version:c.versions[r]??null}}return e.setQueryData(g.decofile(o),c=>{const l={...c};return a.value===null?delete l[r]:l[r]=a.value,l}),Ee(e,o,{[r]:a.version}),!1}function Dr(e){const t=R.c(17),n=Ae(e?.virtualMcpId)?.metadata;let o;t[0]!==n?(o=yt(n),t[0]=n,t[1]=o):o=t[1];const r=o;let s;t[2]!==e?.branch||t[3]!==e?.orgSlug||t[4]!==e?.virtualMcpId?(s=g.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[2]=e?.branch,t[3]=e?.orgSlug,t[4]=e?.virtualMcpId,t[5]=s):s=t[5];let i;t[6]!==e||t[7]!==r?(i=async()=>{const v=await Et(r,e.branch),w=v.pointer?.lastIndexOf("@")??-1;return{draft:v.pointer&&w>0?v.pointer.slice(0,w):null,version:v.pointer&&w>0?v.pointer.slice(w+1):v.etag}},t[6]=e,t[7]=r,t[8]=i):i=t[8];const a=!!e&&!!r;let c;t[9]!==s||t[10]!==i||t[11]!==a?(c={queryKey:s,queryFn:i,enabled:a,staleTime:Number.POSITIVE_INFINITY},t[9]=s,t[10]=i,t[11]=a,t[12]=c):c=t[12];const{data:l,isPending:f,isError:u}=F(c),d=!!e&&!!r&&f&&!u;if(!e||!l?.draft||!l.version){let v;return t[13]!==d?(v={pointer:null,pending:d},t[13]=d,t[14]=v):v=t[14],v}const h=`${l.draft}@${l.version}`;let b;return t[15]!==h?(b={pointer:h,pending:!1},t[15]=h,t[16]=b):b=t[16],b}function Ls(e){return Dr(e).pointer}function Fs(e){const t=R.c(4);let n;t[0]!==e?(n=g.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:kr,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r?.revision}async function kr(){throw new Error("content revisions are set by reads and writes")}function $e(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function Qs(e,t){return $e({...e,protocolSuffix:t.cacheKeySuffix})}function Oe(e,t){const n=R.c(6),{url:o}=Lt(e?.virtualMcpId),r=oe(e?.virtualMcpId,e?.branch);if(!e)return"";let s;return n[0]!==r.cacheKeySuffix||n[1]!==r.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(s=r.kind==="protocol"?$e({...e,protocolSuffix:r.cacheKeySuffix}):$e({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=r.cacheKeySuffix,n[1]=r.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=s):s=n[5],s}function Vs(e,t){const n=R.c(46),{url:o}=Lt(e?.virtualMcpId),r=!!o,s=oe(e?.virtualMcpId,e?.branch),i=s.kind==="protocol"?s:null,a=Oe(e),c=t?.fetchEnabled??!0,l=Uo(e?.virtualMcpId),f=It(e?.virtualMcpId).runtime==="cms",u=Z();let d;n[0]!==a?(d=g.decofile(a),n[0]=a,n[1]=d):d=n[1];const h=d;pr(i,i&&e?e:null,a);let b;n[2]!==e||n[3]!==u||n[4]!==h?(b=()=>{if(!e||u.isMutating({mutationKey:we(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const O=u.getQueryState(h);return O?.fetchStatus==="fetching"||Date.now()-(O?.dataUpdatedAt??0)<Ft/2},n[2]=e,n[3]=u,n[4]=h,n[5]=b):b=n[5];let v;n[6]!==f||n[7]!==r||n[8]!==e||n[9]!==i||n[10]!==u||n[11]!==h?(v=async()=>{if(e){if(!i&&f&&!r){const O=yo(u,e)?.version;if(O&&!await Eo(e,O))return}await u.refetchQueries({queryKey:h,exact:!0},{cancelRefetch:!1})}},n[6]=f,n[7]=r,n[8]=e,n[9]=i,n[10]=u,n[11]=h,n[12]=v):v=n[12];let w;n[13]!==b||n[14]!==v?(w={skip:b,read:v},n[13]=b,n[14]=v,n[15]=w):w=n[15],Po(!!t?.pollWhile&&!!e,w);const I=kt(i?.hosted?a:"");let E;n[16]!==s.kind||n[17]!==f||n[18]!==c||n[19]!==a||n[20]!==r||n[21]!==o||n[22]!==l||n[23]!==e||n[24]!==i||n[25]!==u?(E=async()=>{if(i)return(await fn(u,i,e,a)).blocks;if(s.kind==="unavailable")throw vr("decofile");if(r){const k=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(Tr),Q=k?.ok?dt(await k.text()):null;if(Q)return Q;const y=new Error("decofile unavailable (local tunnel unreachable)");throw y.status=502,y}if(f)return Do(u,e);const O=()=>Ao(e,po(l,".deco/blocks.gen.json"));if(c){const k=await fetch(No(e),{cache:"no-store"}).catch(_r);if(k?.ok){const V=dt(await k.text());if(V)return V}const Q=await O();if(Q.kind==="data")return Q.data;const y=new Error(`Failed to fetch decofile: ${k?.status??"network error"}`);throw y.status=gt({liveOk:!!k?.ok,liveStatus:k?.status,committedAbsent:Q.kind==="absent"}),y}const M=await O();if(M.kind==="data")return M.data;const A=new Error("decofile unavailable (preview down, no committed snapshot)");throw A.status=gt({liveOk:!1,committedAbsent:M.kind==="absent"}),A},n[16]=s.kind,n[17]=f,n[18]=c,n[19]=a,n[20]=r,n[21]=o,n[22]=l,n[23]=e,n[24]=i,n[25]=u,n[26]=E):E=n[26];const x=!!e&&s.kind!=="pending",_=i?0:3e4,N=i?.describe.pollIntervalMs,$=i?"always":void 0;let p;n[27]!==f||n[28]!==r||n[29]!==i?(p=(O,M)=>{if(i||f||r)return O<3;const A=M.status;return A!==502&&A!==404&&O<2},n[27]=f,n[28]=r,n[29]=i,n[30]=p):p=n[30];let U;n[31]!==h||n[32]!==E||n[33]!==x||n[34]!==_||n[35]!==N||n[36]!==$||n[37]!==p?(U={queryKey:h,queryFn:E,enabled:x,staleTime:_,refetchInterval:N,refetchIntervalInBackground:!1,refetchOnWindowFocus:$,retry:p,retryDelay:Ir},n[31]=h,n[32]=E,n[33]=x,n[34]=_,n[35]=N,n[36]=$,n[37]=p,n[38]=U):U=n[38];const D=F(U);let T;n[39]!==I||n[40]!==D?(T=I&&D.data?$n(I,D.data):void 0,n[39]=I,n[40]=D,n[41]=T):T=n[41];const j=T;let C;return n[42]!==j||n[43]!==i?.hosted||n[44]!==D?(C=i?.hosted&&j?{...D,data:j}:D,n[42]=j,n[43]=i?.hosted,n[44]=D,n[45]=C):C=n[45],C}function Ir(e){return jn(5e3,1e3,e,2,0)}function _r(){return null}function Tr(){return null}function Bs(e,t,n){const o=oe(e?.virtualMcpId,e?.branch),r=Oe(e),s=o.kind==="protocol"?o.hosted:void 0;return Nn(s,r,t,n)}function Hs(e){const t=R.c(4),n=Z(),o=oe(e?.virtualMcpId,e?.branch),r=Oe(e),s=o.kind==="protocol"?o.hosted:void 0;let i;return t[0]!==r||t[1]!==n||t[2]!==s?(i=(a,c)=>Cn(n,s,r,a,c),t[0]=r,t[1]=n,t[2]=s,t[3]=i):i=t[3],i}function Js(e,t){const n=R.c(3),o=oe(e?.virtualMcpId,e?.branch),r=Oe(e),s=kt(o.kind==="protocol"&&o.hosted?r:"");let i;return n[0]!==s?.entries||n[1]!==t?(i=Object.entries(s?.entries??{}).filter(a=>{const[,c]=a;return t(c.meta?.type??"")}).map(Pr),n[0]=s?.entries,n[1]=t,n[2]=i):i=n[2],i}function Pr(e){const[t]=e;return t}const Rr="site-editor-save",bn={id:Rr,description:void 0,action:void 0,cancel:void 0},Ws="site-editor-undo",Ne="site-editor-publish";function xr(e){const t=R.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=Y.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1];let s;t[2]!==o?(s=Y.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=Y.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function pn(e,t){return t?Y.jsx(xr,{label:e("siteEditor.details"),detail:t}):void 0}function Gs(e,t,n){ee.error(Wt(e,t,n),{...bn,description:pn(e,Mo(t,n))})}function Ys(e,t,n=!1){ee.info(e(t?"sectionsEditor.reconcile.leftDeleted":"sectionsEditor.reconcile.keptTheirs"),{...bn,description:e(t?n?"sectionsEditor.reconcile.leftDeletedNeverPublishedHint":"sectionsEditor.reconcile.leftDeletedHint":"sectionsEditor.reconcile.keptTheirsHint")})}const mn={action:void 0,duration:void 0};function zs(e,t){ee.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...mn,id:Ne,description:void 0})}function Xs(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=pn(e,o??null);ee[i](t,{id:Ne,description:n&&a?Y.jsxs(Y.Fragment,{children:[Y.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:c=>{c.preventDefault(),ee.loading(s??e("thread.publishPopover.publishing"),{...mn,id:Ne,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function Zs(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{wo as $,ws as A,Hs as B,$s as C,es as D,Dr as E,Bs as F,z as G,ir as H,Is as I,Os as J,ge as K,Xo as L,Zo as M,hs as N,Ds as O,vs as P,Ps as Q,Ts as R,hr as S,Ct as T,Oe as U,Fs as V,ps as W,mo as X,we as Y,dr as Z,Co as _,Zr as a,Qs as a0,Hr as a1,Wr as a2,Js as a3,Ys as a4,js as a5,ds as a6,We as a7,fs as a8,wr as a9,Xe as aA,Us as aB,fn as aC,vr as aD,us as aE,Ne as aF,mn as aG,zs as aH,Rs as aI,Vr as aJ,Br as aK,Le as aL,is as aM,Ls as aN,bs as aO,X as aP,gs as aQ,Xs as aR,Ws as aS,bn as aT,un as aU,ms as aV,ls as aW,Ss as aX,ys as aY,Es as aZ,ze as aa,As as ab,Ms as ac,Gs as ad,Ns as ae,an as af,So as ag,as as ah,xs as ai,Cs as aj,Kr as ak,rs as al,ct as am,lt as an,ss as ao,$o as ap,ns as aq,zn as ar,pn as as,Zs as at,Yo as au,Jr as av,Vn as aw,xr as ax,_s as ay,ks as az,Zn as b,Lt as c,Yn as d,Xr as e,Xn as f,Je as g,Ue as h,xt as i,cs as j,Ro as k,Vs as l,qr as m,os as n,Uo as o,Gr as p,po as q,zr as r,Yr as s,Ko as t,oe as u,er as v,Wo as w,Ao as x,At as y,ts as z};
|
|
1
|
+
import{eP as P,eQ as S,c as R,q as Z,i as F,K as g,eR as je,aB as wn,aF as Sn,aG as yn,r as L,a as En,at as ke,a5 as On,by as yt,eS as Dn,eT as kn,eU as Et,ar as In,bo as Ot,bh as B,eV as _n,eW as Tn,eX as q,eY as Pn,eZ as Rn,e_ as fe,e$ as xn,f0 as Dt,f1 as kt,f2 as $n,f3 as Nn,a3 as jn,f4 as Cn,t as ee,j as Y}from"./index-cgovyYsQ.js";import{u as It}from"./use-voice-input-Bo9Hi7-O.js";import{s as et}from"./thread-intent-B59SA_sa.js";import{u as Ce}from"./use-blocks-v8-project-BSsXx46E.js";import{b as me}from"./sandbox-url-D3mC8qhT.js";import{s as An}from"./utils-D_vHWhJR.js";import{u as Ae}from"./repository-binding-CoBbz5GR.js";import{u as Un}from"./chat-context-BBpIuXC7.js";import{i as Mn,u as Ln}from"./use-sandbox-events-BFiAvETH.js";import{a as Fn}from"./sandbox-git-api-DcqI6XE4.js";const K="deco-content",Ie={major:1},_t=1;async function Qn(e){let t=new Uint8Array(await e.arrayBuffer());if(t[0]===31&&t[1]===139){const n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));t=new Uint8Array(await new Response(n).arrayBuffer())}return JSON.parse(new TextDecoder().decode(t))}const _e={major:Ie.major,minor:_t},Tt=`the endpoint speaks an older ${K} than this client needs (${_e.major}.${_e.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function se(e,t,n){const o={reason:t,required:{..._e}};if(n){o.actual={protocol:n.protocol,major:n.version?.major,minor:n.version?.minor};const r=n.server;typeof r?.name=="string"&&typeof r.version=="string"&&(o.server={name:r.name,version:r.version})}return new P(S.Unsupported,e,o)}function Pt(e){const t=e??{},{protocol:n,version:o}=t;if(n!==K)throw se(`the endpoint speaks ${JSON.stringify(n)}, not ${K}`,"protocol",t);if(o?.major!==Ie.major)throw se(`the endpoint speaks ${K} ${String(o?.major)}.x; this client speaks ${Ie.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<_t)throw se(Tt,"outdated",t);return e}function tt(e,t){return t.code===S.MethodNotFound&&e.startsWith("changes.")?se(Tt,"outdated"):P.from(t)}function Ue(e){const t=e.fetch??(s=>fetch(s));let n=1;async function o(s){const i={"content-type":"application/json",accept:"application/json",...e.headers},a=await t(new Request(e.endpoint,{method:"POST",headers:i,body:JSON.stringify(s)}));let c;try{c=await Qn(a)}catch{throw new P(S.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(c)&&c?.id===null){const l=c?.error;throw l?P.from(l):new P(S.Unavailable,`the endpoint answered HTTP ${a.status}`)}return c}const r=async(s,i)=>{const a=n++,c=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(c.error)throw tt(s,c.error);return c.result};return{call:r,describe:async()=>Pt(await r("describe")),schemaGet:s=>r("schema.get",s),blocksList:s=>r("blocks.list",s),blocksApply:s=>r("blocks.apply",s),changesList:s=>r("changes.list",s),changesGet:s=>r("changes.get",s),changesDiscard:s=>r("changes.discard",s),async batch(s){const i=s.map(()=>n++),a=await o(s.map((l,f)=>({jsonrpc:"2.0",id:i[f],method:l.method,params:l.params??{}}))),c=new Map(a.map(l=>[l.id,l]));return i.map((l,f)=>{const u=c.get(l);return u?u.error?{ok:!1,error:tt(s[f].method,u.error)}:{ok:!0,result:u.result}:{ok:!1,error:new P(S.InternalError,"no response for this call")}})}}}function Me(e){return e&&!e.edited?{ifNoneMatch:e.revision}:{}}const nt=20,ot=5,rt=500;function Le(e){return e instanceof P?e.code===S.MethodNotFound?!0:e.code===S.Unsupported&&e.data?.reason==="outdated":!1}function de(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function Vn(e,t,n){const o=g.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(Me(r)),i=de(r,s);if(i)return i;const a=await t.changesList({});return de(void 0,a)}async function Rt(e,t){const n=[];for(let s=0;s<t.length;s+=nt)n.push(t.slice(s,s+nt));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=ot){const i=await e.batch(n.slice(s,s+ot).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const c=a.result;Object.assign(o,c.entries),r.push(...c.diagnostics)}}return{entries:o,diagnostics:r}}async function Vr(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=rt){const r=t.slice(o,o+rt),s=await e.changesDiscard({names:r.map(i=>i.name),ifMatch:Object.fromEntries(r.map(i=>[i.name,i.version]))});n={revision:s.revision,versions:{...n.versions,...s.versions}}}return n}function Br(e){return e instanceof P&&e.code===S.Conflict}function Fe(e){return e?.kind==="protocol"?e:null}function Hr(e,t,n){const o=R.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=Z();let a;o[2]!==e?(a=Fe(e),o[2]=e,o[3]=a):a=o[3];const c=a,l=!!c&&!!t&&s.enabled!==!1;let f;o[4]!==t?(f=g.contentChanges(t??""),o[4]=t,o[5]=f):f=o[5];let u;o[6]!==t||o[7]!==l||o[8]!==c||o[9]!==i?(u=l?()=>Vn(i,c.client,t):je,o[6]=t,o[7]=l,o[8]=c,o[9]=i,o[10]=u):u=o[10];let d;return o[11]!==f||o[12]!==u?(d={queryKey:f,queryFn:u,staleTime:0},o[11]=f,o[12]=u,o[13]=d):d=o[13],F(d)}function Jr(e,t,n){const o=R.c(14);let r;o[0]!==e?(r=Fe(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i;o[2]!==n?(i=n?Object.keys(n.changes):[],o[2]=n,o[3]=i):i=o[3];const a=i,c=!!s&&!!t&&!!n&&a.length>0;let l;o[4]!==t||o[5]!==n?.revision?(l=g.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=l):l=o[6];let f;o[7]!==c||o[8]!==a||o[9]!==s?(f=c?()=>Rt(s.client,a):je,o[7]=c,o[8]=a,o[9]=s,o[10]=f):f=o[10];let u;return o[11]!==l||o[12]!==f?(u={queryKey:l,queryFn:f,staleTime:Number.POSITIVE_INFINITY},o[11]=l,o[12]=f,o[13]=u):u=o[13],F(u)}function Wr(e,t,n){const o=R.c(16);let r;o[0]!==e?(r=Fe(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i,a,c,l;if(o[2]!==t||o[3]!==n?.changes||o[4]!==s){const d=Object.entries(n?.changes??{}).filter(Gn).map(Wn).sort(Jn);a=d.map(Hn);const h=JSON.stringify(d.map(Bn));i=!!s&&!!t&&a.length>0,l=F,c=g.contentDeletedCopies(t??"",h),o[2]=t,o[3]=n?.changes,o[4]=s,o[5]=i,o[6]=a,o[7]=c,o[8]=l}else i=o[5],a=o[6],c=o[7],l=o[8];let f;o[9]!==i||o[10]!==a||o[11]!==s?(f=i?async()=>{const d=await Rt(s.client,a),h=Object.create(null);for(const[b,v]of Object.entries(d.entries))h[b]=v.before&&typeof v.before=="object"?v.before:null;return h}:je,o[9]=i,o[10]=a,o[11]=s,o[12]=f):f=o[12];let u;return o[13]!==c||o[14]!==f?(u={queryKey:c,queryFn:f,staleTime:Number.POSITIVE_INFINITY,placeholderData:wn},o[13]=c,o[14]=f,o[15]=u):u=o[15],l(u)}function Bn(e){return[e.name,e.base]}function Hn(e){return e.name}function Jn(e,t){return e.name<t.name?-1:e.name>t.name?1:0}function Wn(e){const[t,n]=e;return{name:t,base:n.baseVersion??""}}function Gn(e){const[,t]=e;return t.kind==="delete"}function xt(e){try{const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")return!1;const n=t.hostname.toLowerCase();return n==="127.0.0.1"||n==="[::1]"||n==="localhost"}catch{return!1}}function he(e){try{const t=new URL(e);return(t.hostname==="127.0.0.1"||t.hostname==="[::1]")&&(t.hostname="localhost"),t.href}catch{return e}}const $t=Sn({endpoint:yn().max(2048).refine(e=>xt(e)&&new URL(e).pathname==="/rpc").transform(he)});function Gr(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=$t.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function Nt(e){const t=$t.safeParse(e);return t.success?t.data:null}const jt="studio:deco-serve-last";function Yr(e){try{localStorage.setItem(jt,JSON.stringify(e))}catch{}}function zr(){try{const e=localStorage.getItem(jt);return e?Nt(JSON.parse(e)):null}catch{return null}}function Xr(e){try{return new URL(he(e)).host}catch{return e}}function Yn(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const zn="http://localhost:4545/rpc";class Qe extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function Xn(e){if(e instanceof Qe)return{reason:"not-deco-serve"};if(!(e instanceof P))return{reason:"not-answering"};switch(e.code){case S.Unauthorized:case S.MethodNotFound:return{reason:"outdated"};case S.Unsupported:return Le(e)?{reason:"outdated"}:{reason:"version-mismatch"};case S.Unavailable:return/^the endpoint answered HTTP/.test(e.message)?{reason:"not-deco-serve"}:{reason:"error",detail:e.message};default:return{reason:"error",detail:e.message}}}function Zr(e,t){if(e)return[he(e.endpoint)];const n=[t?.endpoint,zn].filter(o=>!!o).map(he);return[...new Set(n)]}const Ct=L.createContext(null);function Zn(e){const t=R.c(24),n=L.useContext(Ct),o=Ce(n?null:e),{data:r}=En.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?ke.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[c,l]=it(a);let f;t[4]!==i||t[5]!==s||t[6]!==e?(f=i?ke.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=f):f=t[7];const[u,d]=it(f);if(n)return n;let h;t[8]!==c||t[9]!==i||t[10]!==o?(h=i&&o?Nt(c):null,t[8]=c,t[9]=i,t[10]=o,t[11]=h):h=t[11];const b=h,v=i&&o&&typeof u=="string"?u:null;let w;t[12]!==d||t[13]!==l||t[14]!==i?(w=x=>{i&&(l(x),d(x.endpoint))},t[12]=d,t[13]=l,t[14]=i,t[15]=w):w=t[15];let I;t[16]!==l||t[17]!==i?(I=()=>{i&&l(null)},t[16]=l,t[17]=i,t[18]=I):I=t[18];let E;return t[19]!==b||t[20]!==v||t[21]!==w||t[22]!==I?(E={connection:b,lastEndpoint:v,set:w,clear:I},t[19]=b,t[20]=v,t[21]=w,t[22]=I,t[23]=E):E=t[23],E}function st(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function it(e){const t=R.c(17),n=Z(),o=e??"";let r;t[0]!==o?(r=["localStorage",o],t[0]=o,t[1]=r):r=t[1];const s=r;let i,a;t[2]!==e?(i=()=>e?st(e):null,a=()=>e?st(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const c=!!e;let l;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==c?(l={queryKey:s,queryFn:i,initialData:a,enabled:c,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=c,t[9]=l):l=t[9];const{data:f}=F(l);let u;t[10]!==e||t[11]!==n||t[12]!==s?(u=v=>{if(e){try{v===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(v))}catch{}n.setQueryData(s,v)}},t[10]=e,t[11]=n,t[12]=s,t[13]=u):u=t[13];const d=u,h=e?f??null:null;let b;return t[14]!==d||t[15]!==h?(b=[h,d],t[14]=d,t[15]=h,t[16]=b):b=t[16],b}function qr(e){return e.kind==="protocol"||e.kind==="unavailable"}function Kr(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n===null||n==="legacy"?t:!0}function es(e,t,n){return t!=="github"||!n?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function ts(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&xt(t)?t:null}function ns(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function At(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function qn(e){if(!e.hasProject)return"legacy";const t=At(e);if(t==="local")return"protocol-local";if(!e.v8)return"legacy";if(t==="sandbox"){const o=e.sandboxSite;return o==="ready"?"protocol-sandbox":o==="error"?"retrying-sandbox":"pending"}const n=e.githubSite;return n==="ready"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":"pending"}function Kn(e){return{github:e.v8&&e.mode==="github",sandbox:e.v8&&e.mode==="sandbox"&&e.workingTreeReady}}function at(e){return e.isError||e.errorUpdateCount>0}function eo(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const r of n)Object.hasOwn(t,r)?o[r]=t[r]:delete o[r];return o}function to(e){if(!e||typeof e!="object")return[];const t=e,n=[];return typeof t.blockKey=="string"&&n.push(t.blockKey),t.writes&&typeof t.writes=="object"&&n.push(...Object.keys(t.writes)),Array.isArray(t.deletes)&&n.push(...t.deletes.filter(o=>typeof o=="string")),n}const Ut="__noSchema";function Mt(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[Ut]:!0}}function os(e){return!!e&&e[Ut]===!0}function Ve(e){if(!e.ok)return e.error.code===S.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function no(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const oo=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function rs(e){const t=new Map;for(const[n,o]of Object.entries(e)){const r=o&&typeof o=="object"&&!Array.isArray(o)?o:{},s=typeof r.__resolveType=="string"?r.__resolveType:null,i=t.get(s)??[];i.push({key:n,label:no(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(oo)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:ct(n.resolveType).localeCompare(ct(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function ct(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function lt(e,t,n){if(t.length===0)return n;const[o,...r]=t;if(Array.isArray(e)&&typeof o=="number"){const s=e.slice();return s[o]=lt(e[o],r,n),s}if(e&&typeof e=="object"&&typeof o=="string"){const s=e,i={};for(const a of Object.keys(s))i[a]=a===o?lt(s[a],r,n):s[a];return i}return e}function ss(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class ut extends Error{}const Be="site-not-owned";async function ro(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function so(e,t=n=>fetch(n)){const n=Ue({endpoint:e,fetch:async o=>{const r=await t(o);if(await ro(r))throw new ut;return r}});try{return await Je(n)}catch(o){if(o instanceof ut)return Be;throw o}}async function io(e,t,n){await t();const o=await so(e,n);return o===Be?o:{...o,hosted:Dn(e,n)}}const He=5e3;function ao(e){if(!e.site)throw new Error("this project names no site");return kn(e.site,e.branch)}function co(e){return new URL(me(e,"rpc"),window.location.origin).href}async function Je(e){const[t,n]=await e.batch([{method:"describe"},{method:"schema.get"}]);if(!t?.ok)throw t?.error??new Error("no describe");if(t.result?.protocol!==K)throw new Qe;const r=Pt(t.result);if(!n)throw new Error("no schema.get");if(Ve(n))return{client:e,describe:r,hasSchema:!1};if(n.ok)return{client:e,describe:r,hasSchema:!0};throw n.error}function lo(e,t=n=>fetch(n)){return Je(Ue({endpoint:e,fetch:t}))}function oe(e,t){const n=R.c(50),{org:o}=On(),{connection:r}=Zn(e),{runtime:s}=It(e),i=L.useContext(Ct),a=Ce(e),c=yt(Ae(e)?.metadata),l=At({hasServeConnection:!!r,runtime:s}),f=Un()?.taskId??null,u=Mn(Ln().lifecycle.phase),d=Z(),h=Kn({mode:l,v8:a,workingTreeReady:u}),b=h.github&&!!o.slug&&!!e&&!!t,v=F({queryKey:g.contentBackend(o.slug,e??"",t??"","github"),queryFn:()=>io(ao({orgSlug:o.slug,site:c,branch:t}),()=>Et(c,t)),enabled:b,staleTime:Number.POSITIVE_INFINITY,...ft}),w=h.sandbox&&!!o.slug&&!!e&&!!t;let I;n[0]!==t||n[1]!==o.slug||n[2]!==f||n[3]!==e?(I=()=>lo(co({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:f})),n[0]=t,n[1]=o.slug,n[2]=f,n[3]=e,n[4]=I):I=n[4];const E=F({queryKey:g.contentBackend(o.slug,e??"",t??"","sandbox",f??""),queryFn:I,enabled:w,staleTime:Number.POSITIVE_INFINITY,...ft}),x=!!r;let _;n[5]!==r?.endpoint||n[6]!==o.slug||n[7]!==e?(_=g.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[5]=r?.endpoint,n[6]=o.slug,n[7]=e,n[8]=_):_=n[8];let N;n[9]!==r?(N=()=>Je(Ue({endpoint:r.endpoint})),n[9]=r,n[10]=N):N=n[10];let $;n[11]!==x||n[12]!==_||n[13]!==N?($={queryKey:_,queryFn:N,enabled:x,staleTime:Number.POSITIVE_INFINITY,retry:ho,retryDelay:fo,refetchInterval:uo},n[11]=x,n[12]=_,n[13]=N,n[14]=$):$=n[14];const p=F($);let U;n[15]!==r?.endpoint||n[16]!==o.slug||n[17]!==e?(U=g.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[15]=r?.endpoint,n[16]=o.slug,n[17]=e,n[18]=U):U=n[18];const D=U;let T;n[19]!==r?.endpoint||n[20]!==o.slug||n[21]!==e?(T=g.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[19]=r?.endpoint,n[20]=o.slug,n[21]=e,n[22]=T):T=n[22];let j;n[23]!==p.data||n[24]!==D||n[25]!==d?(j=async()=>{try{return await p.data.client.describe()}catch(m){const J=m;throw d.invalidateQueries({queryKey:D,exact:!0},{cancelRefetch:!1}),J}},n[23]=p.data,n[24]=D,n[25]=d,n[26]=j):j=n[26];const C=!!p.data&&!i;let O;n[27]!==T||n[28]!==j||n[29]!==C?(O={queryKey:T,queryFn:j,enabled:C,refetchInterval:He,retry:!1},n[27]=T,n[28]=j,n[29]=C,n[30]=O):O=n[30];const A=F(O).data??p.data?.describe,k=qn({hasProject:!!e,hasServeConnection:!!r,runtime:s,v8:a,githubSite:v.data===Be?"not-owned":v.data?"ready":at(v)?"error":"loading",sandboxSite:go({data:E.data,isError:at(E),workingTreeReady:u})});if(k==="pending"){let m;return n[31]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending"},n[31]=m):m=n[31],m}if(k==="retrying-sandbox"){let m;return n[32]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending",retrying:"sandbox"},n[32]=m):m=n[32],m}if(k==="legacy"){let m;return n[33]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"legacy"},n[33]=m):m=n[33],m}if(k==="protocol-github"){const m=v.data;let J;n[34]!==m?(J=Te("github",m,""),n[34]=m,n[35]=J):J=n[35];let re;return n[36]!==c||n[37]!==J?(re={...J,site:c},n[36]=c,n[37]=J,n[38]=re):re=n[38],re}if(k==="site-not-owned-github"){let m;return n[39]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github",siteNotOwned:!0},n[39]=m):m=n[39],m}if(k==="protocol-sandbox"){let m;return n[40]!==E.data?(m=Te("sandbox",E.data,":sandbox"),n[40]=E.data,n[41]=m):m=n[41],m}if(k==="unavailable-github"){let m;return n[42]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github"},n[42]=m):m=n[42],m}const Q=p.error??p.failureReason,y=r?.endpoint??"";let V;return n[43]!==A||n[44]!==p.data||n[45]!==p.failureCount||n[46]!==p.isError||n[47]!==y||n[48]!==Q?(V=bo({probed:p.data,isError:p.isError,failureCount:p.failureCount,failure:Q,describe:A,endpoint:y}),n[43]=A,n[44]=p.data,n[45]=p.failureCount,n[46]=p.isError,n[47]=y,n[48]=Q,n[49]=V):V=n[49],V}function uo(e){return e.state.status==="error"||e.state.data?.hasSchema===!1?He:!1}function fo(e){return Yn(e+1)}function ho(e,t){return!(t instanceof P)&&!(t instanceof Qe)}function go(e){return e.data!==void 0?"ready":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const vo=3;function bo(e){const t=e.probed?Te("local",{...e.probed,describe:e.describe??e.probed.describe},`:serve:${e.endpoint}`):null;return e.isError||e.failureCount>0?t?.kind==="protocol"&&!e.isError&&e.failureCount<vo?t:{kind:"unavailable",source:"local",problem:Xn(e.failure)}:t??{kind:"pending"}}const ft={retry:2,refetchInterval:e=>e.state.status==="error"?He:!1};function Te(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema,...t.hosted?{hosted:t.hosted}:{}}}function Lt(e){const t=R.c(12);let n;t[0]!==e?(n=ke.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=In(o,null),i=Ce(e);let a;t[2]!==r||t[3]!==e?(a=e?et(r):null,t[2]=r,t[3]=e,t[4]=a):a=t[4];const l=i?null:a;let f,u;t[5]!==s?(f=h=>s(et(h)),u=()=>s(null),t[5]=s,t[6]=f,t[7]=u):(f=t[6],u=t[7]);let d;return t[8]!==l||t[9]!==f||t[10]!==u?(d={url:l,setUrl:f,clear:u},t[8]=l,t[9]=f,t[10]=u,t[11]=d):d=t[11],d}function po(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function dt(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}function we(e,t,n){return["decofile-write",e,t,n]}function mo(e,t,n){return{id:we(e,t,n).join(":")}}class We extends Error{constructor(t,n,o=[],r=!1){super(n),this.blocks=t,this.fields=o,this.carriedStored=r,this.name="BlockConflictError"}blocks;fields;carriedStored}function Ge(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function Ye(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function wo(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function So(e,t,n){e.setQueryData(g.decofileDraft(Ge(t)),n)}function yo(e,t){return e.getQueryData(g.decofileDraft(Ge(t)))??null}async function Eo(e,t){return(await fetch(Ye(e),{cache:"no-store",headers:{"if-none-match":`"${t}"`}}).catch(()=>null))?.status===200}function is(e){const t=R.c(4);let n;t[0]!==e?(n=g.decofileDraft(e?Ge(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Oo,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r??null}async function Oo(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function Do(e,t){const n=await fetch(Ye(t),{cache:"no-store"});if(!n.ok){const r=new Error(`Failed to fetch decofile: ${n.status}`);throw r.status=n.status,r}const o=await n.json();return o.token&&So(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function as(e,t){const n=await fetch(Ye(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const r=await n.json().catch(()=>({}));throw r.code==="block-conflict"?new We(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return wo(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const Ft=3e3,ko=15e3,Io=2*6e4,Qt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function _o(e){return e<Io?Ft:ko}function To(e,t=Qt){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,_o(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:c,skip:l}=e();if(r||t.hidden()||l?.()){i();return}r=!0;let f;try{f=c()}catch{f=void 0}Promise.resolve(f).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const ht=()=>0;function Po(e,t,n=Qt){const o=L.useRef(t);o.current=t;const[r]=L.useState(()=>({polling:()=>To(()=>o.current,n),idle:()=>()=>{}}));L.useSyncExternalStore(e?r.polling:r.idle,ht,ht)}function Vt(e,t){return me(e,t)}function Ro(e,t){return me(e,"preview-fetch",{path:t})}function cs(e){return Vt(e,"preview-invoke")}function ls(e){return Vt(e,"catalog-invoke")}function Bt(e){try{const{hostname:t}=new URL(e);return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}function xo(){if(typeof document>"u")return null;const e=Array.from(document.querySelectorAll("iframe"));for(const t of e){const n=t.getAttribute("src");if(n&&Bt(n))return n}return null}function $o(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??xo();return n&&Bt(n)?new URL(t,n).toString():Ro(e,t)}function No(e){return $o(e,"/.decofile")}function jo(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function gt(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function Co(e,t){const n=me(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=jo(o.status);if(r==="absent")return{kind:"absent"};if(r==="unavailable")return{kind:"unavailable"};if(r==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const s=await o.json();return typeof s.content!="string"?{kind:"unavailable"}:{kind:"data",data:An(s.content)}}async function Ao(e,t){const n=await Co(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function us(e){const t=`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/meta`,n=await fetch(t,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const o=new Error(`Failed to read committed meta: ${n.status}`);throw o.status=n.status,o}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function Uo(e){return Ae(e)?.metadata?.runtime?.path??null}class Ht extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function fs(e){return e instanceof P&&e.code===S.Conflict}function Jt(e){const t=e.data?.violations;return!Array.isArray(t)||t.length===0?e.message:t.slice(0,3).map(n=>n.message).join("; ")}class ze extends Error{constructor(){super("The draft's changes couldn't be read"),this.name="HostedDraftUnreadError"}}class Xe extends Error{constructor(){super("The blocks kept changing while the change was saved"),this.name="HostedKeptChangingError"}}function ds(e,t){return(t instanceof ze||t instanceof Xe)&&(t.message=Wt(e,t,"github")),t}function Wt(e,t,n){if(t instanceof ze)return e("siteEditor.save.draftUnread");if(t instanceof Xe)return e("siteEditor.save.keptChanging");if(t instanceof We)return t.message;if(n==="local")return Lo(e,t);if(t instanceof P)switch(t.code){case S.Conflict:return e("siteEditor.save.conflict");case S.ReadOnly:return e("siteEditor.save.readOnly");case S.InvalidBlock:case S.InvalidParams:return e("siteEditor.save.invalid");case S.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function Mo(e,t){if(t==="local"||e instanceof We||e instanceof ze||e instanceof Xe)return null;if(e instanceof P){const n=e.code===S.InvalidBlock||e.code===S.InvalidParams?Jt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function Lo(e,t){if(t instanceof Ht)return e("decoServe.save.serverGone");if(t instanceof P)switch(t.code){case S.Conflict:return e("decoServe.save.conflict");case S.ReadOnly:return e("decoServe.save.readOnly");case S.InvalidBlock:case S.InvalidParams:return e("decoServe.save.invalid",{detail:Jt(t)});case S.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function Fo(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function Qo(e,t){const[n,o]=L.useState(e),r=L.useRef(null);return e&&!n&&o(!0),L.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=Fo(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const Vo="decocms:content-writes",Pe=new Set;let G;function Gt(){if(G!==void 0)return G;G=null;try{typeof BroadcastChannel=="function"&&(G=new BroadcastChannel(Vo),G.addEventListener("message",e=>{const t=e.data?.cacheKey;if(typeof t=="string")for(const n of[...Pe])n(t)}))}catch{G=null}return G}function Bo(e){try{Gt()?.postMessage({cacheKey:e})}catch{}}function Ho(e){return Gt(),Pe.add(e),()=>{Pe.delete(e)}}const Yt="__at=",zt="__test=",Jo=/^[0-9a-f]{12}-[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;function Wo(e){return e.at!==void 0||Object.keys(e.tests??{}).length>0}function X(e){return typeof e=="string"&&Jo.test(e)}function vt(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function Go(e){const t=e.tests??{};return[...e.at!==void 0?[Yt+vt(e.at)]:[],...Object.keys(t).map(n=>zt+vt(`${n}=${t[n]?"on":"off"}`))]}function bt(e,t){const o=[...e.split("&").filter(r=>r&&!r.startsWith(Yt)&&!r.startsWith(zt)),...t];return o.length>0?`?${o.join("&")}`:""}function ge(e,t){const n=Go(t),o=e.indexOf("?"),r=o===-1?e:e.slice(0,o);if(X(r))return r+bt(o===-1?"":e.slice(o+1),n);const s=e.lastIndexOf("@");if(s<=0)return e;const i=e.slice(0,s),a=i.indexOf("?"),c=a===-1?i:i.slice(0,a),l=a===-1?"":i.slice(a+1);return`${c}${bt(l,n)}${e.slice(s)}`}function hs(e,t,n){if(!Wo(t))return e;try{const o=new URL(e),r=o.searchParams.get("__draft");return r&&r!=="off"?(o.searchParams.set("__draft",ge(r,t)),o.toString()):X(n)?(o.searchParams.set("__draft",ge(n,t)),o.toString()):e}catch{return e}}function gs(e,t,n="/"){if(!e||!X(t))return null;try{const o=new URL(n,e);return o.searchParams.set("__draft",t),o.toString()}catch{return null}}function Xt(e){return btoa(encodeURIComponent(e))}function vs(e,t,n){const o=Yo(e,t,n);return o.searchParams.set("__cb",crypto.randomUUID()),o.toString()}function Yo(e,t,n){const o=new URL(e).origin,r=new URL(`/live/previews/${encodeURIComponent(t)}`,o);return r.searchParams.set("path","/"),r.searchParams.set("pathTemplate","/"),r.searchParams.set("props",Xt(JSON.stringify({path:"/",sections:[{__resolveType:n}]}))),r}const zo="__draft";function bs(e){return`${`${e.apiHost}/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}?token=${e.token}`}@${e.version}`}const Xo="off";function Zo(e,t){if(!t)return e;const n=new URL(e);return n.searchParams.set(zo,t),n.toString()}function ps(e){const t=e.pageBlock.__resolveType;if(typeof t!="string"||!t)return null;const n=new URL(e.previewBaseUrl).origin,o=new URL(`/live/previews/${encodeURIComponent(t)}`,n);o.searchParams.set("__decoFBT","0"),o.searchParams.set("__d",""),o.searchParams.set("path",e.path),o.searchParams.set("pathTemplate",e.pathTemplate);const{__resolveType:r,...s}=e.pageBlock,i=JSON.stringify({__props:s,__decofile:e.decofile});return{src:o.toString(),body:i}}function ms(e,t,n,o){const r=new URL(e).origin,s=new URL(`/live/previews/${encodeURIComponent(t)}`,r);s.searchParams.set("__d","");const i=[{__resolveType:"preview",block:n}];return o&&i.push(o),s.searchParams.set("props",Xt(JSON.stringify({sections:i}))),s.toString()}function ws(e){return e.fastPreviewActive&&e.previewServerUrl?e.previewServerUrl:e.sandboxUrl??null}const pt="__variant=";function Zt(e,t,n){return`${e}@${t}=${n}`}function Ss(e,t){return!e||!t.multivariate||t.variants.length<=1?[]:t.index<0||t.index>=t.variants.length?[]:[Zt(e,"sections",t.index)]}function ys(e){const t=Array.isArray(e.mvObj.variants)?e.mvObj.variants:[];if(!e.pageKey||e.sectionIndex<0)return[];if(e.selectedVariantIndex<0||e.selectedVariantIndex>=t.length)return[];const o=`${e.page.multivariate?`sections.variants.${e.page.index}.value${e.page.lazyValues?".value":""}`:"sections"}.${e.sectionIndex}${e.sectionLazy?".section":""}`;return[Zt(e.pageKey,o,e.selectedVariantIndex)]}function Es(e,t){return[...t,...e]}function qo(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function Ze(e,t){const n=e.lastIndexOf("@");if(n<=0)return e;const o=e.slice(0,n),r=o.indexOf("?"),s=r===-1?o:o.slice(0,r),a=[...r===-1?[]:o.slice(r+1).split("&").filter(l=>l&&!l.startsWith(pt)),...t.map(l=>pt+qo(l))],c=a.length>0?`?${a.join("&")}`:"";return`${s}${c}${e.slice(n)}`}function Os(e,t,n=!1){if(t.length===0&&!n)return null;try{const o=new URL(e),r=o.hostname==="[::1]"?`localhost${o.port?`:${o.port}`:""}`:o.host;return Ze(`${r}${o.pathname}@local`,t)}catch{return null}}function Ds(e,t){if(t.length===0)return e;try{const n=new URL(e),o=n.searchParams.get("__draft");return!o||o==="off"?e:(n.searchParams.set("__draft",Ze(o,t)),n.toString())}catch{return e}}function Ko(e){const{pointer:t}=e;if(!t||t===Xo)return null;const n=t.indexOf("?");return X(n===-1?t:t.slice(0,n))||t.lastIndexOf("@")<=0?null:X(e.heldRevision)&&e.forcedVariants.length===0?ge(e.heldRevision,e.previewOptions):ge(Ze(t,e.forcedVariants),e.previewOptions)}function er(e,t){if(!e||!t)return null;try{return Zo(e,t)}catch{return null}}function ks(e,t,n){if(!e||!n)return null;try{return er(new URL(t,e).toString(),n)}catch{return null}}const ve={forcedVariants:[],previewOptions:{}},ie=new Map,ae=new Map,Re=new Map;function qt(e){for(const t of Re.get(e)??[])t()}function Kt(e,t){const n=X(t)?t:null;(ae.get(e)??null)!==n&&(n?ae.set(e,n):ae.delete(e),qt(e))}function tr(e){return ae.get(e)??null}function nr(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Is(e,t){const n=ie.get(e)??ve,o=t??ve;nr(n,o)||(t?ie.set(e,o):ie.delete(e),qt(e))}function or(e){return ie.get(e)??ve}function en(e,t){let n=Re.get(e);return n||(n=new Set,Re.set(e,n)),n.add(t),()=>{n.delete(t)}}function rr(e){const t=R.c(3);let n,o;return t[0]!==e?(n=r=>en(e,r),o=()=>or(e),t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,sr)}function sr(){return ve}function ir(e){const t=R.c(3);let n,o;return t[0]!==e?(n=r=>e?en(e,r):cr,o=()=>e?tr(e):null,t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,ar)}function ar(){return null}function cr(){}function _s(e,t){const n=R.c(4),o=rr(e),r=ir(e);let s;return n[0]!==o||n[1]!==r||n[2]!==t?(s=Ko({pointer:t,heldRevision:r,...o}),n[0]=o,n[1]=r,n[2]=t,n[3]=s):s=n[3],s}const tn={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},lr=15e3,be=new Map;function z(e,t){return`${e}/${t}`}function H(e){let t=be.get(e);return t||(t={state:tn,listeners:new Set,previews:0,timer:null,discardListeners:new Set},be.set(e,t)),t}function W(e,t){const n=H(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function Se(e){e.timer&&clearTimeout(e.timer),e.timer=null}function qe(e){return be.get(e)?.state??tn}function ur(e,t){const n=H(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function Ts(e){const t=H(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(Se(t),W(e,{phase:"idle"}))}}function Ps(e){const t=be.get(e);!t||t.state.phase!=="reloading"||(Se(t),W(e,{phase:"idle"}))}function nn(e){const t=H(e);Se(t),W(e,{phase:"saving",inFlight:t.state.inFlight+1})}function ce(e,t){const n=H(e),o=Math.max(0,n.state.inFlight-1);if(o>0){W(e,{inFlight:o});return}if(!t.ok||n.previews===0){W(e,{phase:"idle",inFlight:o});return}on(e,t.navigates,o)}function on(e,t,n=0){const o=H(e);Se(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&W(e,{phase:"idle"})},lr),W(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function fr(e){return e?.kind==="protocol"&&e.source==="github"}async function le(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,c=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:g.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await c,{navigates:!1};const l=s?g.protocolDraftRead(o,r,s):null,f=l?JSON.stringify(n.getQueryData(l)??null):null,u=c?[c]:[];if(a&&t.reread&&u.push(n.invalidateQueries({queryKey:g.decofile(a)})),a&&!t.adopted&&u.push(n.invalidateQueries({queryKey:g.contentChanges(a)})),s&&i.source==="sandbox"&&u.push(n.invalidateQueries({queryKey:Fn(o,r,s)})),fr(i)&&l&&!t.adopted&&u.push(n.invalidateQueries({queryKey:l})),await Promise.all(u),t.kind!=="edit"){const b=z(o,r);W(b,{epoch:qe(b).epoch+1})}const d=l?JSON.stringify(n.getQueryData(l)??null):null,h=f!==d;return h&&await new Promise(b=>Ot.schedule(b)),{navigates:h}}async function dr(e,t){return nn(z(e.orgSlug,e.virtualMcpId)),rn(e,t)}function mt(e){return e.branch?JSON.stringify(e.queryClient.getQueryData(g.protocolDraftRead(e.orgSlug,e.virtualMcpId,e.branch))??null):null}async function rn(e,t){const n=z(e.orgSlug,e.virtualMcpId),o=t.adopted?mt(e):null;let r;try{r=await t.write()}catch(i){throw ce(n,{ok:!1,navigates:!1}),t.refreshOnError&&le(e,{kind:t.kind,reread:!0}).catch(()=>{}),i}if(e.backend?.kind==="protocol"&&e.cacheKey&&Bo(e.cacheKey),Kt(n,t.shownRevision?.(r)??null),t.adopted){const i=mt(e)!==o;return i&&await new Promise(a=>Ot.schedule(a)),ce(n,{ok:!0,navigates:i}),t.reread&&le(e,t).catch(()=>{}),r}let s=!1;try{({navigates:s}=await le(e,t))}catch{}finally{ce(n,{ok:!0,navigates:s})}return r}function Rs(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=z(o,r),a=new Set(t.blockKeys);for(const f of[...H(i).discardListeners])f(a);nn(i);let c=!1;const l=()=>(c=!0,rn(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:we(o,r,s),scope:mo(o,r,s),mutationFn:l}).execute(void 0).catch(f=>{throw c||ce(i,{ok:!1,navigates:!1}),f}):l()}function xs(e,t,n){const o=R.c(8);let r;o[0]!==e||o[1]!==t?(r=z(e,t),o[0]=e,o[1]=t,o[2]=r):r=o[2];const s=r;let i;o[3]!==n||o[4]!==s?(i=()=>{const c=H(s).discardListeners;return c.add(n),()=>{c.delete(n)}},o[3]=n,o[4]=s,o[5]=i):i=o[5];let a;o[6]!==s?(a=[s],o[6]=s,o[7]=a):a=o[7],L.useEffect(i,a)}function sn(e){const t=z(e.orgSlug,e.virtualMcpId);qe(t).inFlight>0||(Kt(t,null),le(e,{kind:"external"}).then(({navigates:n})=>{const o=H(t);o.previews>0&&o.state.inFlight===0&&on(t,n)}).catch(()=>{}))}function hr(e,t){const n=R.c(7);let o;n[0]!==e||n[1]!==t?(o=z(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=l=>ur(r,l),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>qe(r),n[5]=r,n[6]=a):a=n[6];const c=a;return L.useSyncExternalStore(i,c,c)}const gr=500;function $s(e,t){const{phase:n}=hr(e,t);return Qo(n!=="idle",gr)}function vr(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function an(e,t){return g.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function Ns(e,t,n,o){if(o?.source==="github"){const i=e.getQueryData(g.contentIndex(t));return i?Tn(i,n):br(e,t,n)}const r=e.getQueryData(g.contentVersions(t));if(!r)return;if(Object.hasOwn(r,n))return r[n];const s=e.getQueryData(g.decofile(t));return s&&Object.hasOwn(s,n)?void 0:null}function te(e,t){if(Object.hasOwn(e.changes,t))return e.changes[t];const n=B(t),o=Object.keys(e.changes).find(r=>B(r)===n);return o===void 0?void 0:e.changes[o]}function br(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(o)return cn(o,ye(e,t),n)}function cn(e,t,n){const o=te(e,n);return o?.kind==="delete"?o.version??fe:o?o.version:t.has(B(n))?fe:null}function js(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(!o)return!1;const r=te(o,n);return r?r.kind==="set"&&r.baseVersion===null:ye(e,t).has(B(n))}function Cs(e,t){const n=e.getQueryData(g.decofile(t)),o=e.getQueryData(g.contentChanges(t));if(!n||!o)return null;const r=ye(e,t);return{blocks:n,versionOf:s=>cn(o,r,s)}}function ye(e,t){return new Set(e.getQueryData(g.contentDraftTombstones(t)))}function pe(e,t,n,o){const r=B(n),s=ye(e,t);s.has(r)!==o&&(o?s.add(r):s.delete(r),q(e),e.setQueryData(g.contentDraftTombstones(t),[...s]))}function ln(e,t,n,o){const r=o.revision,s=e.getQueryData(g.contentVersions(n)),i=Object.entries(o.versions??{}).map(([u,d])=>[u,d===fe?null:d]),a=e.getQueryData(g.contentChanges(n)),c=new Set(i.flatMap(([u])=>{const d=a?te(a,u):void 0;return(d?d.baseVersion:s?.[u]??null)===null?[u]:[]})),l=new Set(i.flatMap(([u,d])=>d===null?[]:[B(u)]));e.setQueryData(g.contentChanges(n),u=>{if(!u)return u;const d={...u.changes};for(const[h,b]of i){const v=te(u,h),w=v?v.baseVersion:s?.[h]??null;b!==null?d[h]={kind:"set",version:b,baseVersion:w}:w!==null?d[h]={kind:"delete",version:null,baseVersion:w}:delete d[h]}return{...u,changes:d,edited:!0}});for(const[u,d]of i)d!==null?pe(e,n,u,!1):!l.has(B(u))&&c.has(u)&&pe(e,n,u,!0);const f=o.revision;return f&&f!=="none"&&e.setQueryData(g.protocolDraftRead(t.orgSlug,t.virtualMcpId,t.branch),u=>u&&{...u,version:f}),r}function Ee(e,t,n){q(e),e.setQueryData(g.contentVersions(t),o=>{const r={...o};for(const[s,i]of Object.entries(n))i===null?delete r[s]:r[s]=i;return r})}function un(e,t){const n=e.getMutationCache().findAll({mutationKey:we(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>to(o.state.variables)))}function xe(e,t){e.resetQueries({queryKey:g.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function ne(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof P);throw t.source==="local"&&s?(xe(e,n),new Ht(r)):(t.source==="local"&&Le(r)&&xe(e,n),r)}}const ue=new Map;function fn(e,t,n,o){const r=ue.get(o);if(r)return r;const s=Ke(e,t,n,o,!0);return ue.set(o,s),s.finally(()=>ue.delete(o))}const De=new Set;function pr(e,t,n){const o=R.c(8),r=Z(),s=t?.orgSlug,i=t?.virtualMcpId,a=t?.branch;let c,l;o[0]!==e||o[1]!==a||o[2]!==n||o[3]!==s||o[4]!==r||o[5]!==i?(c=()=>{if(!e||!s||!i||!a)return;const f={orgSlug:s,virtualMcpId:i,branch:a};return Ho(u=>{u===n&&(De.has(n)||(De.add(n),wr(r,e,f,n).catch(mr).finally(()=>De.delete(n))))})},l=[r,e,s,i,a,n],o[0]=e,o[1]=a,o[2]=n,o[3]=s,o[4]=r,o[5]=i,o[6]=c,o[7]=l):(c=o[6],l=o[7]),L.useEffect(c,l)}function mr(){}async function wr(e,t,n,o){const r=ue.get(o);return r&&await r.catch(()=>{}),fn(e,t,n,o)}async function Ke(e,t,n,o,r){q(e);const s=g.decofile(o),i=an(n,t),a=g.contentRevision(o),c=g.contentVersions(o),l=e.getQueryData(s),f=e.getQueryData(c),d=e.getQueryData(i),h=e.getQueryData(a)??void 0,b=r&&l&&f?h?.revision:void 0,v=r&&d?h?.schemaVersion:void 0,w=g.contentChanges(o),I=e.getQueryData(w);if(t.source==="github"&&t.hosted)return Sr(e,t,t.hosted,n,o,{conditional:r,seen:h,currentMeta:d,schemaIfNoneMatch:v,seenChanges:I});const[E,x,_]=await ne(e,t,n,()=>t.client.batch([{method:"blocks.list",params:b?{ifNoneMatch:b}:{}},{method:"schema.get",params:v?{ifNoneMatch:v}:{}},{method:"changes.list",params:Me(I)}])),N=e.getQueryData(a)?.revision,$=N!==void 0&&N!==h?.revision;if(_?.ok){const O=$?null:de(I,_.result);O&&e.setQueryData(w,O)}else _&&t.source==="local"&&Le(_.error)&&xe(e,n);if(!E?.ok)throw E?.error??new Error("no blocks.list");if(!x)throw new Error("no schema.get");const p=E.result,U=Ve(x),D=x.ok&&!U?x.result:null;if(p.notModified&&(!l||!f)||D?.notModified&&!d)return Ke(e,t,n,o,!1);const T=p.notModified?new Set:un(e,n),j=p.notModified?l:eo(p.blocks,l,T),C=U?Mt():D?D.notModified?d:D.schema:x.error;if(e.setQueryData(a,{revision:$?N:p.notModified?h?.revision:p.revision,schemaVersion:D?D.notModified?h?.schemaVersion:D.version??void 0:void 0}),e.setQueryData(s,j),!p.notModified){const O=e.getQueryData(c),M={...p.versions};for(const A of T){const k=O?.[A];k!==void 0?M[A]=k:delete M[A]}e.setQueryData(c,M)}return C instanceof P||e.setQueryData(i,C),!$&&!p.notModified&&l&&h?.revision&&p.revision!==h.revision&&sn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:j,meta:C}}async function Sr(e,t,n,o,r,s){const i=g.decofile(r),a=g.contentIndex(r),c=g.contentRevision(r),l=g.contentVersions(r),f=an(o,t),u=g.contentChanges(r),d=e.getQueryData(a),h=s.conditional&&d?s.seen?.revision:void 0,[b,v,w]=await ne(e,t,o,()=>n.batch([{method:"cms.index",params:h?{ifNoneMatch:h}:{}},{method:"schema.get",params:s.schemaIfNoneMatch?{ifNoneMatch:s.schemaIfNoneMatch}:{}},{method:"changes.list",params:Me(s.seenChanges)}])),I=e.getQueryData(a)??d,E=e.getQueryData(c)?.revision,x=E!==void 0&&E!==s.seen?.revision;if(w?.ok&&!x){const y=de(s.seenChanges,w.result);y&&e.setQueryData(u,y)}if(!b?.ok)throw b?.error??new Error("no cms.index");if(!v)throw new Error("no schema.get");const _=b.result,N=Ve(v),$=v.ok&&!N?v.result:null;if(_.notModified&&!d||$?.notModified&&!s.currentMeta)return Ke(e,t,o,r,!1);const p=N?Mt():$?$.notModified?s.currentMeta:$.schema:v.error;p instanceof P||e.setQueryData(f,p);const U=$?$.notModified?s.seen?.schemaVersion:$.version??void 0:void 0,D=e.getQueryData(i)??{};if(_.notModified||x)return e.setQueryData(c,{revision:x?E:s.seen?.revision,schemaVersion:U}),e.setQueryData(i,D),{blocks:D,meta:p};const T={revision:_.revision,resolvedRef:_.resolvedRef,sequence:_.sequence,entries:_.entries,draft:_.draft};e.setQueryData(a,T);const j=!!s.seen?.revision&&T.revision!==s.seen.revision&&(!s.seen.revision.startsWith("s-")||!!d&&dn(d.draft,T.draft));j&&e.setQueryData(g.protocolDraftRead(o.orgSlug,o.virtualMcpId,o.branch),y=>y&&{...y,version:T.revision}),e.setQueryData(c,{revision:T.revision,schemaVersion:U});const C=un(e,o),O=e.getQueryData(l)??{},M={},A={},k=[];for(const[y,V]of Object.entries(D)){const m=T.entries[y];!m&&!C.has(y)||(M[y]=V,O[y]!==void 0&&(A[y]=O[y]),m&&!C.has(y)&&O[y]!==m.version&&k.push(y))}return e.setQueryData(i,M),e.setQueryData(l,A),k.length>0&&await xn(e,n,r,k,C),I&&j&&yr(I,T)&&sn({queryClient:e,orgSlug:o.orgSlug,virtualMcpId:o.virtualMcpId,branch:o.branch,backend:t,cacheKey:r}),{blocks:e.getQueryData(i)??M,meta:p}}function yr(e,t){if(dn(e.draft,t.draft))return!0;const n=Object.keys(t.entries);return n.length!==Object.keys(e.entries).length?!0:n.some(o=>!Object.hasOwn(e.entries,o)||e.entries[o]?.version!==t.entries[o]?.version)}function dn(e,t){const n=Object.keys(t);return n.length!==Object.keys(e).length?!0:n.some(o=>!Object.hasOwn(e,o)||e[o]?.version!==t[o]?.version)}function Er(e,t){const n=[...Object.keys(t.set??{}),...t.delete??[]];return Object.fromEntries(n.filter(o=>Object.hasOwn(e,o)).map(o=>[o,e[o]]))}function wt(e){if(!(e instanceof P)||e.code!==S.Unavailable)return;const t=e.data?.landed;if(!(!t||typeof t!="object"||Array.isArray(t)))return Object.fromEntries(Object.entries(t).filter(n=>typeof n[1]=="string"))}function Or(e,t){const n=Object.fromEntries(Object.entries(e.set??{}).filter(([r])=>!Object.hasOwn(t,r))),o=(e.delete??[]).filter(r=>!Object.hasOwn(t,r));return{...Object.keys(n).length>0?{set:n}:{},...o.length>0?{delete:o}:{}}}function St(e,t,n,o,r){q(e),ln(e,t,n,{revision:e.getQueryData(g.contentRevision(n))?.revision??"",versions:r}),Ee(e,n,Object.fromEntries(Object.entries(r).map(([s,i])=>[s,i===fe?null:i]))),Dt(e,n,r,o.set??{})}async function As(e,t,n,o,r,s){if(t.source==="github"){const a=[...Object.keys(r.set??{}),...r.delete??[]].filter(l=>!s||!Object.hasOwn(s,l));if(a.length>0)throw new Error(`A hosted save needs a precondition for every block it touches (missing: ${a.join(", ")})`);const c=_n(r.set);if(c.length>0)throw new Error(`A hosted save can't write a block that isn't loaded (${c.join(", ")})`)}return dr({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o},{kind:"edit",adopted:t.source==="github",write:async()=>{const i=f=>ne(e,t,n,()=>t.client.blocksApply({set:f.set,delete:f.delete,...s?{ifMatch:Er(s,f)}:{}}));let a;try{a=await i(r)}catch(f){const u=t.source==="github"?wt(f):void 0;if(!u)throw f;const d=Or(r,u);Object.keys(u).length>0&&St(e,n,o,r,u);let h;try{h=await i(d)}catch(b){const v=wt(b);throw v&&Object.keys(v).length>0&&St(e,n,o,d,v),b}a={...h,versions:{...u,...h.versions}}}q(e);const c=t.source==="github"?ln(e,n,o,a):a.revision;t.source==="github"&&Dt(e,o,a.versions??{},r.set??{}),e.setQueryData(g.contentRevision(o),f=>({...f,revision:c}));const l=a.versions??{};return Ee(e,o,l),{revision:c,versions:l}}})}function hn(e,t){if(!(e instanceof P))return;const n=e.data?.draft;if(!n||typeof n!="object"||!Object.hasOwn(n,t))return;const o=n[t];return o&&typeof o.version=="string"?o:void 0}function gn(e,t,n){if(!(n instanceof P))return;const o=n.data?.draft;if(!(!o||typeof o!="object"))for(const[r,s]of Object.entries(o))s===null&&pe(e,t,r,!1)}function vn(e,t,n,o){q(e),Pn(e,n,o);const r=o.block===null,s=e.getQueryData(g.contentVersions(t)),i=e.getQueryData(g.contentChanges(t)),a=i?te(i,n):void 0,c=a?a.baseVersion:s?.[n]??null;if(i){const l=B(n),f=Object.fromEntries(Object.entries(i.changes).filter(([u])=>B(u)!==l));r?c!==null&&(f[n]={kind:"delete",version:null,baseVersion:c}):f[n]={kind:"set",version:o.version,baseVersion:c},e.setQueryData(g.contentChanges(t),{...i,changes:f,edited:!0})}pe(e,t,n,r&&c===null),e.setQueryData(g.decofile(t),l=>{const f={...l};return r?delete f[n]:f[n]=o.block,f}),Ee(e,t,{[n]:r?null:o.version}),Rn(e,t,n,o)}function Us(e,t,n,o){if(t.source!=="github"||!(o instanceof P))return!1;gn(e,n,o);const r=o.data?.draft;if(!r||typeof r!="object")return!1;const s=Object.keys(r),i=s.map(a=>hn(o,a));return s.length===0||i.some(a=>a===void 0)?!1:(e.cancelQueries({queryKey:g.decofile(n)}),s.forEach((a,c)=>{vn(e,n,a,i[c])}),!0)}async function Ms(e,t,n,o,r,s){t.source==="github"&&gn(e,o,s);const i=t.source==="github"?hn(s,r):void 0;if(i)return e.cancelQueries({queryKey:g.decofile(o)}),vn(e,o,r,i),!0;await e.invalidateQueries({queryKey:g.decofile(o)});let a;try{const l=(await ne(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(l&&l.after===null&&l.version!==null)return!1;a={value:l?.after??null,version:l?.version??null},t.source==="github"&&e.setQueryData(g.contentChanges(o),f=>{if(!f)return f;const u={...f.changes};return l?.kind?u[r]={kind:l.kind,version:l.version,baseVersion:l.baseVersion}:delete u[r],{...f,changes:u,edited:!0}})}catch{const c=await ne(e,t,n,()=>t.client.blocksList({}));if(c.notModified)return!1;a={value:c.blocks[r]??null,version:c.versions[r]??null}}return e.setQueryData(g.decofile(o),c=>{const l={...c};return a.value===null?delete l[r]:l[r]=a.value,l}),Ee(e,o,{[r]:a.version}),!1}function Dr(e){const t=R.c(17),n=Ae(e?.virtualMcpId)?.metadata;let o;t[0]!==n?(o=yt(n),t[0]=n,t[1]=o):o=t[1];const r=o;let s;t[2]!==e?.branch||t[3]!==e?.orgSlug||t[4]!==e?.virtualMcpId?(s=g.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[2]=e?.branch,t[3]=e?.orgSlug,t[4]=e?.virtualMcpId,t[5]=s):s=t[5];let i;t[6]!==e||t[7]!==r?(i=async()=>{const v=await Et(r,e.branch),w=v.pointer?.lastIndexOf("@")??-1;return{draft:v.pointer&&w>0?v.pointer.slice(0,w):null,version:v.pointer&&w>0?v.pointer.slice(w+1):v.etag}},t[6]=e,t[7]=r,t[8]=i):i=t[8];const a=!!e&&!!r;let c;t[9]!==s||t[10]!==i||t[11]!==a?(c={queryKey:s,queryFn:i,enabled:a,staleTime:Number.POSITIVE_INFINITY},t[9]=s,t[10]=i,t[11]=a,t[12]=c):c=t[12];const{data:l,isPending:f,isError:u}=F(c),d=!!e&&!!r&&f&&!u;if(!e||!l?.draft||!l.version){let v;return t[13]!==d?(v={pointer:null,pending:d},t[13]=d,t[14]=v):v=t[14],v}const h=`${l.draft}@${l.version}`;let b;return t[15]!==h?(b={pointer:h,pending:!1},t[15]=h,t[16]=b):b=t[16],b}function Ls(e){return Dr(e).pointer}function Fs(e){const t=R.c(4);let n;t[0]!==e?(n=g.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:kr,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=F(o);return r?.revision}async function kr(){throw new Error("content revisions are set by reads and writes")}function $e(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function Qs(e,t){return $e({...e,protocolSuffix:t.cacheKeySuffix})}function Oe(e,t){const n=R.c(6),{url:o}=Lt(e?.virtualMcpId),r=oe(e?.virtualMcpId,e?.branch);if(!e)return"";let s;return n[0]!==r.cacheKeySuffix||n[1]!==r.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(s=r.kind==="protocol"?$e({...e,protocolSuffix:r.cacheKeySuffix}):$e({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=r.cacheKeySuffix,n[1]=r.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=s):s=n[5],s}function Vs(e,t){const n=R.c(46),{url:o}=Lt(e?.virtualMcpId),r=!!o,s=oe(e?.virtualMcpId,e?.branch),i=s.kind==="protocol"?s:null,a=Oe(e),c=t?.fetchEnabled??!0,l=Uo(e?.virtualMcpId),f=It(e?.virtualMcpId).runtime==="cms",u=Z();let d;n[0]!==a?(d=g.decofile(a),n[0]=a,n[1]=d):d=n[1];const h=d;pr(i,i&&e?e:null,a);let b;n[2]!==e||n[3]!==u||n[4]!==h?(b=()=>{if(!e||u.isMutating({mutationKey:we(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const O=u.getQueryState(h);return O?.fetchStatus==="fetching"||Date.now()-(O?.dataUpdatedAt??0)<Ft/2},n[2]=e,n[3]=u,n[4]=h,n[5]=b):b=n[5];let v;n[6]!==f||n[7]!==r||n[8]!==e||n[9]!==i||n[10]!==u||n[11]!==h?(v=async()=>{if(e){if(!i&&f&&!r){const O=yo(u,e)?.version;if(O&&!await Eo(e,O))return}await u.refetchQueries({queryKey:h,exact:!0},{cancelRefetch:!1})}},n[6]=f,n[7]=r,n[8]=e,n[9]=i,n[10]=u,n[11]=h,n[12]=v):v=n[12];let w;n[13]!==b||n[14]!==v?(w={skip:b,read:v},n[13]=b,n[14]=v,n[15]=w):w=n[15],Po(!!t?.pollWhile&&!!e,w);const I=kt(i?.hosted?a:"");let E;n[16]!==s.kind||n[17]!==f||n[18]!==c||n[19]!==a||n[20]!==r||n[21]!==o||n[22]!==l||n[23]!==e||n[24]!==i||n[25]!==u?(E=async()=>{if(i)return(await fn(u,i,e,a)).blocks;if(s.kind==="unavailable")throw vr("decofile");if(r){const k=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(Tr),Q=k?.ok?dt(await k.text()):null;if(Q)return Q;const y=new Error("decofile unavailable (local tunnel unreachable)");throw y.status=502,y}if(f)return Do(u,e);const O=()=>Ao(e,po(l,".deco/blocks.gen.json"));if(c){const k=await fetch(No(e),{cache:"no-store"}).catch(_r);if(k?.ok){const V=dt(await k.text());if(V)return V}const Q=await O();if(Q.kind==="data")return Q.data;const y=new Error(`Failed to fetch decofile: ${k?.status??"network error"}`);throw y.status=gt({liveOk:!!k?.ok,liveStatus:k?.status,committedAbsent:Q.kind==="absent"}),y}const M=await O();if(M.kind==="data")return M.data;const A=new Error("decofile unavailable (preview down, no committed snapshot)");throw A.status=gt({liveOk:!1,committedAbsent:M.kind==="absent"}),A},n[16]=s.kind,n[17]=f,n[18]=c,n[19]=a,n[20]=r,n[21]=o,n[22]=l,n[23]=e,n[24]=i,n[25]=u,n[26]=E):E=n[26];const x=!!e&&s.kind!=="pending",_=i?0:3e4,N=i?.describe.pollIntervalMs,$=i?"always":void 0;let p;n[27]!==f||n[28]!==r||n[29]!==i?(p=(O,M)=>{if(i||f||r)return O<3;const A=M.status;return A!==502&&A!==404&&O<2},n[27]=f,n[28]=r,n[29]=i,n[30]=p):p=n[30];let U;n[31]!==h||n[32]!==E||n[33]!==x||n[34]!==_||n[35]!==N||n[36]!==$||n[37]!==p?(U={queryKey:h,queryFn:E,enabled:x,staleTime:_,refetchInterval:N,refetchIntervalInBackground:!1,refetchOnWindowFocus:$,retry:p,retryDelay:Ir},n[31]=h,n[32]=E,n[33]=x,n[34]=_,n[35]=N,n[36]=$,n[37]=p,n[38]=U):U=n[38];const D=F(U);let T;n[39]!==I||n[40]!==D?(T=I&&D.data?$n(I,D.data):void 0,n[39]=I,n[40]=D,n[41]=T):T=n[41];const j=T;let C;return n[42]!==j||n[43]!==i?.hosted||n[44]!==D?(C=i?.hosted&&j?{...D,data:j}:D,n[42]=j,n[43]=i?.hosted,n[44]=D,n[45]=C):C=n[45],C}function Ir(e){return jn(5e3,1e3,e,2,0)}function _r(){return null}function Tr(){return null}function Bs(e,t,n){const o=oe(e?.virtualMcpId,e?.branch),r=Oe(e),s=o.kind==="protocol"?o.hosted:void 0;return Nn(s,r,t,n)}function Hs(e){const t=R.c(4),n=Z(),o=oe(e?.virtualMcpId,e?.branch),r=Oe(e),s=o.kind==="protocol"?o.hosted:void 0;let i;return t[0]!==r||t[1]!==n||t[2]!==s?(i=(a,c)=>Cn(n,s,r,a,c),t[0]=r,t[1]=n,t[2]=s,t[3]=i):i=t[3],i}function Js(e,t){const n=R.c(3),o=oe(e?.virtualMcpId,e?.branch),r=Oe(e),s=kt(o.kind==="protocol"&&o.hosted?r:"");let i;return n[0]!==s?.entries||n[1]!==t?(i=Object.entries(s?.entries??{}).filter(a=>{const[,c]=a;return t(c.meta?.type??"")}).map(Pr),n[0]=s?.entries,n[1]=t,n[2]=i):i=n[2],i}function Pr(e){const[t]=e;return t}const Rr="site-editor-save",bn={id:Rr,description:void 0,action:void 0,cancel:void 0},Ws="site-editor-undo",Ne="site-editor-publish";function xr(e){const t=R.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=Y.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1];let s;t[2]!==o?(s=Y.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=Y.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function pn(e,t){return t?Y.jsx(xr,{label:e("siteEditor.details"),detail:t}):void 0}function Gs(e,t,n){ee.error(Wt(e,t,n),{...bn,description:pn(e,Mo(t,n))})}function Ys(e,t,n=!1){ee.info(e(t?"sectionsEditor.reconcile.leftDeleted":"sectionsEditor.reconcile.keptTheirs"),{...bn,description:e(t?n?"sectionsEditor.reconcile.leftDeletedNeverPublishedHint":"sectionsEditor.reconcile.leftDeletedHint":"sectionsEditor.reconcile.keptTheirsHint")})}const mn={action:void 0,duration:void 0};function zs(e,t){ee.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...mn,id:Ne,description:void 0})}function Xs(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=pn(e,o??null);ee[i](t,{id:Ne,description:n&&a?Y.jsxs(Y.Fragment,{children:[Y.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:c=>{c.preventDefault(),ee.loading(s??e("thread.publishPopover.publishing"),{...mn,id:Ne,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function Zs(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{wo as $,ws as A,Hs as B,$s as C,es as D,Dr as E,Bs as F,z as G,ir as H,Is as I,Os as J,ge as K,Xo as L,Zo as M,hs as N,Ds as O,vs as P,Ps as Q,Ts as R,hr as S,Ct as T,Oe as U,Fs as V,ps as W,mo as X,we as Y,dr as Z,Co as _,Zr as a,Qs as a0,Hr as a1,Wr as a2,Js as a3,Ys as a4,js as a5,ds as a6,We as a7,fs as a8,wr as a9,Xe as aA,Us as aB,fn as aC,vr as aD,us as aE,Ne as aF,mn as aG,zs as aH,Rs as aI,Vr as aJ,Br as aK,Le as aL,is as aM,Ls as aN,bs as aO,X as aP,gs as aQ,Xs as aR,Ws as aS,bn as aT,un as aU,ms as aV,ls as aW,Ss as aX,ys as aY,Es as aZ,ze as aa,As as ab,Ms as ac,Gs as ad,Ns as ae,an as af,So as ag,as as ah,xs as ai,Cs as aj,Kr as ak,rs as al,ct as am,lt as an,ss as ao,$o as ap,ns as aq,zn as ar,pn as as,Zs as at,Yo as au,Jr as av,Vn as aw,xr as ax,_s as ay,ks as az,Zn as b,Lt as c,Yn as d,Xr as e,Xn as f,Je as g,Ue as h,xt as i,cs as j,Ro as k,Vs as l,qr as m,os as n,Uo as o,Gr as p,po as q,zr as r,Yr as s,Ko as t,oe as u,er as v,Wo as w,Ao as x,At as y,ts as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as ee,a5 as te,q as ne,r as M,j as t,B as Q,n as F,bB as ae,a6 as ce,aN as me,aM as pe,aJ as de,aH as ue,aI as ge,aL as fe,aK as he,bj as xe,t as C,c6 as je,c as se,m as ke,_ as ve,X as ye,Z as Se,Y as be,K as H,gx as Ce}from"./index-DxGCPS5f.js";import{a as De}from"./SwitchHorizontal01-BCe-gFOc.js";import{M as we}from"./agent-icon-_Y5eusMw.js";import{s as Ne}from"./Trash01-DPGVoVI0.js";import{i as Pe}from"./Upload01-B1K1jpRL.js";import{i as ie}from"./Zap-PrQtyQ4u.js";import{S as Ae}from"./search-toggle-BW-nCNIt.js";import{E as Y}from"./empty-state-CiXq08R1.js";import{C as Me}from"./collection-tabs-CLJwpk3w.js";import{S as Ee,F as Oe}from"./folder-icon-CjXRQ1u4.js";import{j as Te,k as Ie,n as Re}from"./use-org-fs-B1VEI_Er.js";import{a7 as ze,R as Z,Z as $e}from"./chat-context-zQ-qHQlQ.js";import{c as _e}from"./context-shell-Cdw9KYb9.js";import"./AlertCircle-CzNhPAKr.js";import"./Tool01-snML4pPn.js";import"./ArrowUp-BmvC0gDN.js";import"./ArrowLeft-BZrvcUxe.js";import"./LinkBroken01-K7vV_sRk.js";import"./ShoppingBag01-DW9ACSlI.js";import"./Globe04-DD-_PtpP.js";import"./CheckCircle-BfgWRJx4.js";import"./ChevronUp-CslLufEI.js";import"./ChevronSelectorVertical-Dk3Ic8_G.js";import"./UserSquare-DgIYcYhA.js";import"./CreditCard01-DKR27XQP.js";import"./Key01-CNesFlbK.js";import"./Minus-DeqVl1Xe.js";import"./Monitor01-Bx36gCte.js";import"./Sun-DUSHragw.js";import"./Play-CkRBFbju.js";import"./Plus-DtM4w8bA.js";import"./SearchMd-Bbg1gFfR.js";import"./Users01-DeK6IcUy.js";import"./XClose-B40NOWtA.js";import"./icon-button-DeiyuWHW.js";import"./tooltip-xj6ZnC0s.js";import"./index-DFF-_wih.js";import"./badge-DccxBHlR.js";import"./markdown-BkKuf5yA.js";import"./use-copy-O-MML7rC.js";import"./use-mobile-COmq9TQM.js";import"./autosend-hIWj1gzu.js";import"./thread-route-CIVmQ-Bx.js";import"./use-project-scope-CYZ0mCfQ.js";import"./repository-binding-C4_xIShf.js";import"./use-mcp-client-BFuEikBh.js";import"./auth-BFbUp7Gk.js";import"./task-board-T7oS4tjE.js";import"./schema-DyY5h7Rx.js";import"./file-preview-ClFQiMsH.js";import"./utils-Dk3SKS5y.js";import"./editor-DKoVU6S3.js";import"./file-type-icon-BgsOvG37.js";import"./useInfiniteQuery-ByQLYXMe.js";import"./infiniteQueryObserver-BRbF_8wg.js";import"./thread-intent-DckhqhKt.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-BKRouklE.js";import"./use-entitlements-SlWYl1h3.js";import"./use-ai-providers-8QFj-dPT.js";import"./use-decopilot-events-BAXWzGGN.js";import"./use-organization-settings-DqmiRW0D.js";import"./require-capability-1AcS0xbn.js";import"./access-gate-Czwg28Aa.js";import"./capability-load-error-PMRTSYzm.js";import"./sections-CHxeuMKy.js";import"./textarea-CHZQytvO.js";import"./use-ask-in-chat-C5fM3Bv6.js";import"./shell-layout-dHGD2tyJ.js";import"./use-deployment-admin-DNwohGK9.js";import"./admin-fetch-BhTJlAsX.js";import"./command-CnM6TkoO.js";import"./index-CDlOTJSg.js";import"./integration-icon-CivNYrxB.js";import"./project-icon-BnHxv46u.js";import"./use-navigate-to-agent-RGucqDuO.js";import"./new-project-dialog-B_Izhfc6.js";import"./label-Co3RnKjI.js";import"./repository-picker-CX0VOapR.js";import"./github-icon-BoZFAAoR.js";import"./collection-search-BKCnDfDh.js";import"./use-debounced-value-DDir1rWd.js";import"./required-auth-layout-lwAsP7t-.js";import"./use-org-sso-RIE_JSyT.js";const J=200,Fe=new Set(["node_modules","__pycache__"]);function G(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function Le(s){return G(s).split("/").every(e=>!e.startsWith(".")&&!Fe.has(e))}function Be(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function Ke(s,e){const i=new Map;for(const o of s){const c=G(o).split("/");c.pop();const a=["skills",e,...c].join("/");i.set(a,[...i.get(a)??[],o])}return i}async function qe(s,e){const o=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(o)throw o.reason}function He(s,e){const i=_e(e),o=`skills/${s}`;return{id:`home/${o}`,name:i.name??s,description:i.description,disableModelInvocation:i.disableModelInvocation,source:"home",volume:Z,path:o,sandboxPath:`${ze}/${Z}/${o}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const i=s.indexOf(":");return i===-1?{label:e,glyph:ie}:{label:s.slice(i+1),glyph:s.startsWith("repo:")?je:we}}function Qe(s){const e=se.c(48),{entry:i,pending:o,onOpen:c,onDelete:a}=s,n=ee(),{org:g}=te();let E;e[0]!==i.source||e[1]!==g.name?(E=re(i.source,g.name),e[0]=i.source,e[1]=g.name,e[2]=E):E=e[2];const{label:O,glyph:I}=E;let D;e[3]!==i?(D=B(i),e[3]=i,e[4]=D):D=e[4];const R=D,w=o?"opacity-60":"hover:bg-accent";let f;e[5]!==w?(f=ke("relative transition-colors group overflow-hidden flex flex-col h-full",w),e[5]=w,e[6]=f):f=e[6];let m;e[7]!==i.name||e[8]!==c||e[9]!==o?(m=!o&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":i.name}),e[7]=i.name,e[8]=c,e[9]=o,e[10]=m):m=e[10];const N=R?"default":"system",z=!R;let h;e[11]!==I||e[12]!==N||e[13]!==z?(h=t.jsx(Oe,{glyph:I,tone:N,readOnly:z,className:"size-8 shrink-0"}),e[11]=I,e[12]=N,e[13]=z,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==n?(x=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(ve,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(Q,{variant:"ghost",size:"icon",children:t.jsx(De,{size:16})})}),t.jsx(Se,{align:"end",children:t.jsxs(be,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(Ne,{size:16}),n("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=n,e[17]=x):x=e[17];let j;e[18]!==h||e[19]!==x?(j=t.jsxs("div",{className:"flex items-start justify-between",children:[h,x]}),e[18]=h,e[19]=x,e[20]=j):j=e[20];let b;e[21]!==i.name?(b=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.name}),e[21]=i.name,e[22]=b):b=e[22];let k;e[23]!==i.description||e[24]!==n?(k=i.description||n("settings.skills.noDescription"),e[23]=i.description,e[24]=n,e[25]=k):k=e[25];let p;e[26]!==k?(p=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:k}),e[26]=k,e[27]=p):p=e[27];let v;e[28]!==b||e[29]!==p?(v=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,p]}),e[28]=b,e[29]=p,e[30]=v):v=e[30];let d;e[31]!==j||e[32]!==v?(d=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[j,v]}),e[31]=j,e[32]=v,e[33]=d):d=e[33];let y;e[34]!==O||e[35]!==o||e[36]!==n?(y=o?n("settings.skills.importing"):O,e[34]=O,e[35]=o,e[36]=n,e[37]=y):y=e[37];let u;e[38]!==y?(u=t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:"h-10 flex items-center px-4.5",children:t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y})})}),e[38]=y,e[39]=u):u=e[39];let S;e[40]!==d||e[41]!==u?(S=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[d,u]}),e[40]=d,e[41]=u,e[42]=S):S=e[42];let T;return e[43]!==o||e[44]!==S||e[45]!==f||e[46]!==m?(T=t.jsxs(Ce,{size:"flush","aria-busy":o,className:f,children:[m,S]}),e[43]=o,e[44]=S,e[45]=f,e[46]=m,e[47]=T):T=e[47],T}function V(s){const e=se.c(2),{children:i}=s;let o;return e[0]!==i?(o=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:i}),e[0]=i,e[1]=o):o=e[1],o}function Ss(){const s=ee(),{org:e}=te(),i=Te(),{remove:o,upload:c}=Ie("home"),a=ne(),n=M.useRef(null),[g,E]=M.useState(""),[O,I]=M.useState(L),[D,R]=M.useState(!1),[w,f]=M.useState(null),[m,N]=M.useState(null),[z,h]=M.useState(null),x=()=>{a.invalidateQueries({queryKey:H.slashSkills(e.id)}),a.invalidateQueries({queryKey:H.orgFsSkills(e.id)})},j=r=>a.setQueryData(H.slashSkills(e.id),l=>r(l??[]));async function b(r){const l=[...r??[]];if(n.current&&(n.current.value=""),l.length===0)return;const P=l[0]?.webkitRelativePath??"";if(!P){C.error(s("settings.skills.importNeedsFolder"));return}const q=P.split("/")[0]??"",_=l.filter(Le),U=_.find(A=>G(A)==="SKILL.md");if(!U){C.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>J){C.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(J)}));return}const $=Be(q),X=`skills/${$}`;let W=!1;R(!0);try{if(await Re(e.slug,"home",X)){C.error(s("settings.skills.importSlugTaken",{slug:$}));return}W=!0;const A=He($,await U.text());j(le=>[A,...le]),h(A.id),await qe(Ke(_,$),c.mutateAsync),C.success(s("settings.skills.importSuccess",{name:$}))}catch(A){W&&await o.mutateAsync(X).catch(()=>{}),C.error(A instanceof Error?A.message:s("settings.skills.importError"))}finally{h(null),x(),R(!1)}}const k=g.toLowerCase(),p=(i.data??[]).filter(r=>r.name.toLowerCase().includes(k)||(r.description??"").toLowerCase().includes(k)).sort((r,l)=>Number(B(l))-Number(B(r))||r.name.localeCompare(l.name)),v=new Set((i.data??[]).map(r=>r.source)),d=new Map;for(const r of p)d.set(r.source,(d.get(r.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:p.length},...[...v].map(r=>({id:r,label:re(r,e.name).label,count:d.get(r)??0}))],u=v.has(O)?O:L,S=u===L?p:p.filter(r=>r.source===u),T=r=>f($e(r.volume,r.path)),K=async()=>{if(!m)return;const{id:r,path:l}=m;N(null),j(P=>P.filter(q=>q.id!==r));try{await o.mutateAsync(l),C.success(s("settings.skills.deleteSuccess"))}catch(P){C.error(P instanceof Error?P.message:s("settings.skills.deleteError"))}finally{x()}},oe=t.jsxs(Q,{size:"sm",disabled:D,onClick:()=>n.current?.click(),children:[t.jsx(Pe,{size:14}),s(D?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs(F,{children:[t.jsx(F.Content,{children:t.jsx(F.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(F.Actions,{secondary:t.jsx(Ae,{value:g,onChange:E,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:oe}),t.jsx("input",{ref:n,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:r=>{b(r.target.files)}}),y.length>2&&t.jsx(Me,{placement:"page",tabs:y,activeTab:u,onTabChange:I}),i.isPending?t.jsx("div",{className:"@container",children:t.jsx(V,{children:Array.from({length:8},(r,l)=>t.jsx(ae,{className:"h-[168px] rounded-xl"},l))})}):i.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ce,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:i.error instanceof Error?i.error.message:s("settings.skills.errorDescription"),actions:t.jsx(Q,{size:"sm",variant:"outline",onClick:()=>{i.refetch()},children:s("settings.skills.retry")})})}):S.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ie,{size:48,className:"text-muted-foreground"}),title:s(g?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:g?s("settings.skills.noResultsDescription",{search:g}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(V,{children:S.map(r=>{const l=r.id===z;return t.jsx(Qe,{entry:r,pending:l,onOpen:()=>T(r),onDelete:B(r)&&!l?()=>N(r):void 0},r.id)})})})]})})}),w&&t.jsx(Ee,{skillPath:w,onClose:()=>f(null)},w),t.jsx(me,{open:m!==null,onOpenChange:r=>!r&&N(null),children:t.jsxs(pe,{children:[t.jsxs(de,{children:[t.jsx(ue,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(ge,{children:s("settings.skills.deleteDialogDescription",{name:m?.name??""})})]}),t.jsxs(fe,{children:[t.jsx(he,{children:s("settings.skills.cancel")}),t.jsx(xe,{onClick:K,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{Ss as default};
|
|
1
|
+
import{b as ee,a5 as te,q as ne,r as M,j as t,B as Q,n as F,bB as ae,a6 as ce,aN as me,aM as pe,aJ as de,aH as ue,aI as ge,aL as fe,aK as he,bj as xe,t as C,c6 as je,c as se,m as ke,_ as ve,X as ye,Z as Se,Y as be,K as H,gx as Ce}from"./index-cgovyYsQ.js";import{a as De}from"./SwitchHorizontal01-DqmEmDR5.js";import{M as we}from"./agent-icon-TjMVTO6h.js";import{s as Ne}from"./Trash01-DDMIP9jc.js";import{i as Pe}from"./Upload01-DT2jBuxA.js";import{i as ie}from"./Zap-DOqlsWJQ.js";import{S as Ae}from"./search-toggle-DPRPz4f9.js";import{E as Y}from"./empty-state-qO8fmVkF.js";import{C as Me}from"./collection-tabs-BC3eX7CT.js";import{S as Ee,F as Oe}from"./folder-icon-CE9rKFgu.js";import{j as Te,k as Ie,n as Re}from"./use-org-fs-C83fBFK-.js";import{a7 as ze,R as Z,Z as $e}from"./chat-context-BBpIuXC7.js";import{c as _e}from"./context-shell-DlBNmZfR.js";import"./AlertCircle-CQ8p4KFs.js";import"./Tool01-CSZn_Wh0.js";import"./ArrowUp-WAaoRlHa.js";import"./ArrowLeft-jRoq4RpN.js";import"./LinkBroken01-CqkORUqT.js";import"./ShoppingBag01-CajIv2w8.js";import"./Globe04-DMe5HSmJ.js";import"./CheckCircle-Buet-eH6.js";import"./ChevronUp-BTGxI7Zs.js";import"./ChevronSelectorVertical-DCDJ0sdb.js";import"./UserSquare-DKikapRU.js";import"./CreditCard01-CnLItLU2.js";import"./Key01-Dxtn8NGa.js";import"./Minus-D2T9DyMG.js";import"./Monitor01-D-9i_0yJ.js";import"./Sun-BZ5I37JT.js";import"./Play-P7egrfAg.js";import"./Plus-DsyYMAU8.js";import"./SearchMd-CW5cmPaz.js";import"./Users01-NB4c6tGb.js";import"./XClose-DpL893eV.js";import"./icon-button-Cpw9GkVM.js";import"./tooltip-Bg4P3YaG.js";import"./index-B5Rq0Q_b.js";import"./badge-Dfaw3WBB.js";import"./markdown-mKHkB6FI.js";import"./use-copy-D49VwPhf.js";import"./use-mobile-dJL_Pm5y.js";import"./autosend-U0ehaXsA.js";import"./thread-route-DT3i-QGQ.js";import"./use-project-scope-Y6vAoZoW.js";import"./repository-binding-CoBbz5GR.js";import"./use-mcp-client-B3mZDGvG.js";import"./auth-Bo7mZ0XZ.js";import"./task-board-AmZMoSDj.js";import"./schema-D09C1K2b.js";import"./file-preview-DA7tD6qn.js";import"./utils-D_vHWhJR.js";import"./editor-CyZCJa0L.js";import"./file-type-icon-DrIF_ach.js";import"./useInfiniteQuery-BhHoWMFB.js";import"./infiniteQueryObserver-D_MIEAF-.js";import"./thread-intent-B59SA_sa.js";import"./delay-CnY5UFtP.js";import"./watch-sse-pool-0ZXuPLm-.js";import"./use-entitlements-C6In-vfl.js";import"./use-ai-providers-Bz3SR-CO.js";import"./use-decopilot-events-mew6sG2k.js";import"./use-organization-settings-D9LYxkkn.js";import"./require-capability-BEaEpCmo.js";import"./access-gate-OrPI42qE.js";import"./capability-load-error-8rnJwJni.js";import"./sections-Dm0haO3S.js";import"./textarea-eeqMJnUq.js";import"./use-ask-in-chat-BF9v_lE6.js";import"./shell-layout-C_vTrOFi.js";import"./use-deployment-admin-CHn3xyJc.js";import"./admin-fetch-BhTJlAsX.js";import"./command-DF3tcytL.js";import"./index-BhO2XRBo.js";import"./integration-icon-bQl-nSH8.js";import"./project-icon-BTrwq8bi.js";import"./use-navigate-to-agent-CYu1HJsb.js";import"./new-project-dialog-CG2L3MM-.js";import"./label-BJpZpGc0.js";import"./repository-picker-_0XvcaQZ.js";import"./github-icon-Cfkkw3me.js";import"./collection-search-BnR15-7O.js";import"./use-debounced-value-nhqnKklo.js";import"./required-auth-layout-CtQpY9CE.js";import"./use-org-sso-BVcty70n.js";const J=200,Fe=new Set(["node_modules","__pycache__"]);function G(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function Le(s){return G(s).split("/").every(e=>!e.startsWith(".")&&!Fe.has(e))}function Be(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function Ke(s,e){const i=new Map;for(const o of s){const c=G(o).split("/");c.pop();const a=["skills",e,...c].join("/");i.set(a,[...i.get(a)??[],o])}return i}async function qe(s,e){const o=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(o)throw o.reason}function He(s,e){const i=_e(e),o=`skills/${s}`;return{id:`home/${o}`,name:i.name??s,description:i.description,disableModelInvocation:i.disableModelInvocation,source:"home",volume:Z,path:o,sandboxPath:`${ze}/${Z}/${o}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const i=s.indexOf(":");return i===-1?{label:e,glyph:ie}:{label:s.slice(i+1),glyph:s.startsWith("repo:")?je:we}}function Qe(s){const e=se.c(48),{entry:i,pending:o,onOpen:c,onDelete:a}=s,n=ee(),{org:g}=te();let E;e[0]!==i.source||e[1]!==g.name?(E=re(i.source,g.name),e[0]=i.source,e[1]=g.name,e[2]=E):E=e[2];const{label:O,glyph:I}=E;let D;e[3]!==i?(D=B(i),e[3]=i,e[4]=D):D=e[4];const R=D,w=o?"opacity-60":"hover:bg-accent";let f;e[5]!==w?(f=ke("relative transition-colors group overflow-hidden flex flex-col h-full",w),e[5]=w,e[6]=f):f=e[6];let m;e[7]!==i.name||e[8]!==c||e[9]!==o?(m=!o&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":i.name}),e[7]=i.name,e[8]=c,e[9]=o,e[10]=m):m=e[10];const N=R?"default":"system",z=!R;let h;e[11]!==I||e[12]!==N||e[13]!==z?(h=t.jsx(Oe,{glyph:I,tone:N,readOnly:z,className:"size-8 shrink-0"}),e[11]=I,e[12]=N,e[13]=z,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==n?(x=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(ve,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(Q,{variant:"ghost",size:"icon",children:t.jsx(De,{size:16})})}),t.jsx(Se,{align:"end",children:t.jsxs(be,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(Ne,{size:16}),n("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=n,e[17]=x):x=e[17];let j;e[18]!==h||e[19]!==x?(j=t.jsxs("div",{className:"flex items-start justify-between",children:[h,x]}),e[18]=h,e[19]=x,e[20]=j):j=e[20];let b;e[21]!==i.name?(b=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.name}),e[21]=i.name,e[22]=b):b=e[22];let k;e[23]!==i.description||e[24]!==n?(k=i.description||n("settings.skills.noDescription"),e[23]=i.description,e[24]=n,e[25]=k):k=e[25];let p;e[26]!==k?(p=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:k}),e[26]=k,e[27]=p):p=e[27];let v;e[28]!==b||e[29]!==p?(v=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,p]}),e[28]=b,e[29]=p,e[30]=v):v=e[30];let d;e[31]!==j||e[32]!==v?(d=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[j,v]}),e[31]=j,e[32]=v,e[33]=d):d=e[33];let y;e[34]!==O||e[35]!==o||e[36]!==n?(y=o?n("settings.skills.importing"):O,e[34]=O,e[35]=o,e[36]=n,e[37]=y):y=e[37];let u;e[38]!==y?(u=t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:"h-10 flex items-center px-4.5",children:t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y})})}),e[38]=y,e[39]=u):u=e[39];let S;e[40]!==d||e[41]!==u?(S=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[d,u]}),e[40]=d,e[41]=u,e[42]=S):S=e[42];let T;return e[43]!==o||e[44]!==S||e[45]!==f||e[46]!==m?(T=t.jsxs(Ce,{size:"flush","aria-busy":o,className:f,children:[m,S]}),e[43]=o,e[44]=S,e[45]=f,e[46]=m,e[47]=T):T=e[47],T}function V(s){const e=se.c(2),{children:i}=s;let o;return e[0]!==i?(o=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:i}),e[0]=i,e[1]=o):o=e[1],o}function Ss(){const s=ee(),{org:e}=te(),i=Te(),{remove:o,upload:c}=Ie("home"),a=ne(),n=M.useRef(null),[g,E]=M.useState(""),[O,I]=M.useState(L),[D,R]=M.useState(!1),[w,f]=M.useState(null),[m,N]=M.useState(null),[z,h]=M.useState(null),x=()=>{a.invalidateQueries({queryKey:H.slashSkills(e.id)}),a.invalidateQueries({queryKey:H.orgFsSkills(e.id)})},j=r=>a.setQueryData(H.slashSkills(e.id),l=>r(l??[]));async function b(r){const l=[...r??[]];if(n.current&&(n.current.value=""),l.length===0)return;const P=l[0]?.webkitRelativePath??"";if(!P){C.error(s("settings.skills.importNeedsFolder"));return}const q=P.split("/")[0]??"",_=l.filter(Le),U=_.find(A=>G(A)==="SKILL.md");if(!U){C.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>J){C.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(J)}));return}const $=Be(q),X=`skills/${$}`;let W=!1;R(!0);try{if(await Re(e.slug,"home",X)){C.error(s("settings.skills.importSlugTaken",{slug:$}));return}W=!0;const A=He($,await U.text());j(le=>[A,...le]),h(A.id),await qe(Ke(_,$),c.mutateAsync),C.success(s("settings.skills.importSuccess",{name:$}))}catch(A){W&&await o.mutateAsync(X).catch(()=>{}),C.error(A instanceof Error?A.message:s("settings.skills.importError"))}finally{h(null),x(),R(!1)}}const k=g.toLowerCase(),p=(i.data??[]).filter(r=>r.name.toLowerCase().includes(k)||(r.description??"").toLowerCase().includes(k)).sort((r,l)=>Number(B(l))-Number(B(r))||r.name.localeCompare(l.name)),v=new Set((i.data??[]).map(r=>r.source)),d=new Map;for(const r of p)d.set(r.source,(d.get(r.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:p.length},...[...v].map(r=>({id:r,label:re(r,e.name).label,count:d.get(r)??0}))],u=v.has(O)?O:L,S=u===L?p:p.filter(r=>r.source===u),T=r=>f($e(r.volume,r.path)),K=async()=>{if(!m)return;const{id:r,path:l}=m;N(null),j(P=>P.filter(q=>q.id!==r));try{await o.mutateAsync(l),C.success(s("settings.skills.deleteSuccess"))}catch(P){C.error(P instanceof Error?P.message:s("settings.skills.deleteError"))}finally{x()}},oe=t.jsxs(Q,{size:"sm",disabled:D,onClick:()=>n.current?.click(),children:[t.jsx(Pe,{size:14}),s(D?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs(F,{children:[t.jsx(F.Content,{children:t.jsx(F.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(F.Actions,{secondary:t.jsx(Ae,{value:g,onChange:E,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:oe}),t.jsx("input",{ref:n,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:r=>{b(r.target.files)}}),y.length>2&&t.jsx(Me,{placement:"page",tabs:y,activeTab:u,onTabChange:I}),i.isPending?t.jsx("div",{className:"@container",children:t.jsx(V,{children:Array.from({length:8},(r,l)=>t.jsx(ae,{className:"h-[168px] rounded-xl"},l))})}):i.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ce,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:i.error instanceof Error?i.error.message:s("settings.skills.errorDescription"),actions:t.jsx(Q,{size:"sm",variant:"outline",onClick:()=>{i.refetch()},children:s("settings.skills.retry")})})}):S.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Y,{image:t.jsx(ie,{size:48,className:"text-muted-foreground"}),title:s(g?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:g?s("settings.skills.noResultsDescription",{search:g}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(V,{children:S.map(r=>{const l=r.id===z;return t.jsx(Qe,{entry:r,pending:l,onOpen:()=>T(r),onDelete:B(r)&&!l?()=>N(r):void 0},r.id)})})})]})})}),w&&t.jsx(Ee,{skillPath:w,onClose:()=>f(null)},w),t.jsx(me,{open:m!==null,onOpenChange:r=>!r&&N(null),children:t.jsxs(pe,{children:[t.jsxs(de,{children:[t.jsx(ue,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(ge,{children:s("settings.skills.deleteDialogDescription",{name:m?.name??""})})]}),t.jsxs(fe,{children:[t.jsx(he,{children:s("settings.skills.cancel")}),t.jsx(xe,{onClick:K,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{Ss as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _,m as N,j}from"./index-
|
|
1
|
+
import{c as _,m as N,j}from"./index-cgovyYsQ.js";import{T as k,R as z,a as D,b as S}from"./index-DUKj5t3l.js";function V(T){const e=_.c(41);let i,t,n,s,c,b,g,o,r,a;e[0]!==T?({className:i,defaultValue:t,value:a,min:b,max:g,onPointerDown:s,onKeyDown:n,thumbLabel:o,thumbValueText:r,...c}=T,e[0]=T,e[1]=i,e[2]=t,e[3]=n,e[4]=s,e[5]=c,e[6]=b,e[7]=g,e[8]=o,e[9]=r,e[10]=a):(i=e[1],t=e[2],n=e[3],s=e[4],c=e[5],b=e[6],g=e[7],o=e[8],r=e[9],a=e[10]);const d=b===void 0?0:b,u=g===void 0?100:g;let p;e[11]!==t||e[12]!==u||e[13]!==d||e[14]!==a?(p=Array.isArray(a)?a:Array.isArray(t)?t:[d,u],e[11]=t,e[12]=u,e[13]=d,e[14]=a,e[15]=p):p=e[15];const A=p;let f;e[16]!==i?(f=N("relative flex w-full touch-none items-center py-2 select-none data-[disabled]:opacity-50 data-[orientation=vertical]:px-2 data-[orientation=vertical]:py-0 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",i),e[16]=i,e[17]=f):f=e[17];let m;e[18]!==s?(m=l=>{l.currentTarget.dataset.pointer="",s?.(l)},e[18]=s,e[19]=m):m=e[19];let h;e[20]!==n?(h=l=>{delete l.currentTarget.dataset.pointer,n?.(l)},e[20]=n,e[21]=h):h=e[21];let x;e[22]===Symbol.for("react.memo_cache_sentinel")?(x=N("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1"),e[22]=x):x=e[22];let w;e[23]===Symbol.for("react.memo_cache_sentinel")?(w=j.jsx(k,{"data-slot":"slider-track",className:x,children:j.jsx(z,{"data-slot":"slider-range",className:N("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),e[23]=w):w=e[23];let v;if(e[24]!==A.length||e[25]!==o||e[26]!==r){let l;e[28]!==o||e[29]!==r?(l=(E,R)=>j.jsx(S,{"data-slot":"slider-thumb",...o!==void 0?{"aria-label":o}:{},...r!==void 0?{"aria-valuetext":r}:{},className:"relative block size-4 shrink-0 cursor-grab rounded-full bg-white shadow-edge transition-transform duration-150 after:absolute after:-inset-3 after:rounded-full after:content-[''] hover:scale-110 focus-ring in-data-pointer:outline-none! active:scale-110 active:cursor-grabbing disabled:pointer-events-none motion-reduce:transition-none"},R),e[28]=o,e[29]=r,e[30]=l):l=e[30],v=Array.from({length:A.length},l),e[24]=A.length,e[25]=o,e[26]=r,e[27]=v}else v=e[27];let y;return e[31]!==t||e[32]!==u||e[33]!==d||e[34]!==c||e[35]!==f||e[36]!==m||e[37]!==h||e[38]!==v||e[39]!==a?(y=j.jsxs(D,{"data-slot":"slider",defaultValue:t,value:a,min:d,max:u,className:f,...c,onPointerDown:m,onKeyDown:h,children:[w,v]}),e[31]=t,e[32]=u,e[33]=d,e[34]=c,e[35]=f,e[36]=m,e[37]=h,e[38]=v,e[39]=a,e[40]=y):y=e[40],y}export{V as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as v,fh as K}from"./index-
|
|
1
|
+
import{r as v,fh as K}from"./index-cgovyYsQ.js";import{d as de,e as fe,f as U,g as ge,h as pe,i as be,j as ve,C as Y,k as he,l as y,m as me,n as xe,o as Ie,s as ye}from"./core.esm-CTO4JGte.js";function q(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Re(e,t){return e.reduce((n,r,s)=>{const a=t.get(r);return a&&(n[s]=a),n},Array(e.length))}function O(e){return e!==null&&e>=0}function Ce(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function we(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const B=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const a=q(t,r,n),o=t[s],c=a[s];return!c||!o?null:{x:c.left-o.left,y:c.top-o.top,scaleX:c.width/o.width,scaleY:c.height/o.height}},L={scaleX:1,scaleY:1},Xe=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:a,overIndex:o}=e;const c=(t=a[n])!=null?t:r;if(!c)return null;if(s===n){const u=a[o];return u?{x:0,y:n<o?u.top+u.height-(c.top+c.height):u.top-c.top,...L}:null}const f=De(a,s,n);return s>n&&s<=o?{x:0,y:-c.height-f,...L}:s<n&&s>=o?{x:0,y:c.height+f,...L}:{x:0,y:0,...L}};function De(e,t,n){const r=e[t],s=e[t-1],a=e[t+1];return r?n<t?s?r.top-(s.top+s.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const H="Sortable",V=K.createContext({activeIndex:-1,containerId:H,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:B,disabled:{draggable:!1,droppable:!1}});function _e(e){let{children:t,id:n,items:r,strategy:s=B,disabled:a=!1}=e;const{active:o,dragOverlay:c,droppableRects:f,over:u,measureDroppableContainers:i}=de(),l=fe(H,n),d=c.rect!==null,g=v.useMemo(()=>r.map(I=>typeof I=="object"&&"id"in I?I.id:I),[r]),R=o!=null,C=o?g.indexOf(o.id):-1,h=u?g.indexOf(u.id):-1,w=v.useRef(g),x=!Ce(g,w.current),m=h!==-1&&C===-1||x,b=we(a);U(()=>{x&&R&&i(g)},[x,g,R,i]),v.useEffect(()=>{w.current=g},[g]);const D=v.useMemo(()=>({activeIndex:C,containerId:l,disabled:b,disableTransforms:m,items:g,overIndex:h,useDragOverlay:d,sortedRects:Re(g,f),strategy:s}),[C,l,b.draggable,b.droppable,m,g,h,f,d,s]);return K.createElement(V.Provider,{value:D},t)}const Se=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return q(n,r,s).indexOf(t)},Ae=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:a,newIndex:o,previousItems:c,previousContainerId:f,transition:u}=e;return!u||!r||c!==a&&s===o?!1:n?!0:o!==s&&t===f},Te={duration:200,easing:"ease"},J="transform",Ee=Y.Transition.toString({property:J,duration:0,easing:"linear"}),Ne={roleDescription:"sortable"};function Oe(e){let{disabled:t,index:n,node:r,rect:s}=e;const[a,o]=v.useState(null),c=v.useRef(n);return U(()=>{if(!t&&n!==c.current&&r.current){const f=s.current;if(f){const u=he(r.current,{ignoreTransform:!0}),i={x:f.left-u.left,y:f.top-u.top,scaleX:f.width/u.width,scaleY:f.height/u.height};(i.x||i.y)&&o(i)}}n!==c.current&&(c.current=n)},[t,n,r,s]),v.useEffect(()=>{a&&o(null)},[a]),a}function je(e){let{animateLayoutChanges:t=Ae,attributes:n,disabled:r,data:s,getNewIndex:a=Se,id:o,strategy:c,resizeObserverConfig:f,transition:u=Te}=e;const{items:i,containerId:l,activeIndex:d,disabled:g,disableTransforms:R,sortedRects:C,overIndex:h,useDragOverlay:w,strategy:x}=v.useContext(V),m=Le(r,g),b=i.indexOf(o),D=v.useMemo(()=>({sortable:{containerId:l,index:b,items:i},...s}),[l,s,b,i]),I=v.useMemo(()=>i.slice(i.indexOf(o)),[i,o]),{rect:N,node:z,isOver:W,setNodeRef:P}=ge({id:o,data:D,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...f}}),{active:T,activatorEvent:Z,activeNodeRect:ee,attributes:te,setNodeRef:X,listeners:re,isDragging:M,over:ne,setActivatorNodeRef:se,transform:oe}=pe({id:o,data:D,attributes:{...Ne,...n},disabled:m.draggable}),ae=be(P,X),S=!!T,_=S&&!R&&O(d)&&O(h),j=!w&&M,F=j&&_?oe:null,ie=_?F??(c??x)({rects:C,activeNodeRect:ee,activeIndex:d,overIndex:h,index:b}):null,E=O(d)&&O(h)?a({id:o,items:i,activeIndex:d,overIndex:h}):b,A=T?.id,p=v.useRef({activeId:A,items:i,newIndex:E,containerId:l}),ce=i!==p.current.items,G=t({active:T,containerId:l,isDragging:M,isSorting:S,id:o,index:b,items:i,newIndex:p.current.newIndex,previousItems:p.current.items,previousContainerId:p.current.containerId,transition:u,wasDragging:p.current.activeId!=null}),$=Oe({disabled:!G,index:b,node:z,rect:N});return v.useEffect(()=>{S&&p.current.newIndex!==E&&(p.current.newIndex=E),l!==p.current.containerId&&(p.current.containerId=l),i!==p.current.items&&(p.current.items=i)},[S,E,l,i]),v.useEffect(()=>{if(A===p.current.activeId)return;if(A!=null&&p.current.activeId==null){p.current.activeId=A;return}const ue=setTimeout(()=>{p.current.activeId=A},50);return()=>clearTimeout(ue)},[A]),{active:T,activeIndex:d,attributes:te,data:D,rect:N,index:b,newIndex:E,items:i,isOver:W,isSorting:S,isDragging:M,listeners:re,node:z,overIndex:h,over:ne,setNodeRef:ae,setActivatorNodeRef:se,setDroppableNodeRef:P,setDraggableNodeRef:X,transform:$??ie,transition:le()};function le(){if($||ce&&p.current.newIndex===b)return Ee;if(!(j&&!ve(Z)||!u)&&(S||G))return Y.Transition.toString({...u,property:J})}}function Le(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function k(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const ke=[y.Down,y.Right,y.Up,y.Left],Fe=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:a,over:o,scrollableAncestors:c}}=t;if(ke.includes(e.code)){if(e.preventDefault(),!n||!r)return;const f=[];a.getEnabled().forEach(l=>{if(!l||l!=null&&l.disabled)return;const d=s.get(l.id);if(d)switch(e.code){case y.Down:r.top<d.top&&f.push(l);break;case y.Up:r.top>d.top&&f.push(l);break;case y.Left:r.left>d.left&&f.push(l);break;case y.Right:r.left<d.left&&f.push(l);break}});const u=me({collisionRect:r,droppableRects:s,droppableContainers:f});let i=xe(u,"id");if(i===o?.id&&u.length>1&&(i=u[1].id),i!=null){const l=a.get(n.id),d=a.get(i),g=d?s.get(d.id):null,R=d?.node.current;if(R&&g&&l&&d){const h=Ie(R).some((I,N)=>c[N]!==I),w=Q(l,d),x=Me(l,d),m=h||!w?{x:0,y:0}:{x:x?r.width-g.width:0,y:x?r.height-g.height:0},b={x:g.left,y:g.top};return m.x&&m.y?b:ye(b,m)}}}};function Q(e,t){return!k(e)||!k(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Me(e,t){return!k(e)||!k(t)||!Q(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}export{_e as S,q as a,B as r,Fe as s,je as u,Xe as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as A,a5 as B,r as v,j as e,n as x,hk as k,gN as b,g2 as y,g3 as a,i1 as D,B as m,I as g,aN as z,aM as T,aJ as O,aH as R,aL as F,aK as M,bj as q,E as C,t as c,c as U}from"./index-
|
|
1
|
+
import{b as A,a5 as B,r as v,j as e,n as x,hk as k,gN as b,g2 as y,g3 as a,i1 as D,B as m,I as g,aN as z,aM as T,aJ as O,aH as R,aL as F,aK as M,bj as q,E as C,t as c,c as U}from"./index-cgovyYsQ.js";import{D as H}from"./domain-settings-Dfq6uTsb.js";import{S as $}from"./switch-BMZWxSSe.js";import{a as J,b as K,c as G,d as Q}from"./use-org-sso-BVcty70n.js";import{s as V}from"./Trash01-DDMIP9jc.js";import{R as W}from"./require-capability-BEaEpCmo.js";import"./badge-Dfaw3WBB.js";import"./select-eZpStU_o.js";import"./index-BdQq_4o_.js";import"./index-B5Rq0Q_b.js";import"./ChevronUp-BTGxI7Zs.js";import"./access-gate-OrPI42qE.js";import"./capability-load-error-8rnJwJni.js";function X(){const s=A(),{org:o}=B(),{data:h,isLoading:I}=J(o.id,o.slug),f=K(o.id,o.slug),S=G(o.id,o.slug),E=Q(o.id,o.slug),[i,l]=v.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[d,p]=v.useState(!1),[P,j]=v.useState(!1),u=h?.configured&&h.config,n=h?.config,N=()=>{n&&l({issuer:n.issuer,clientId:n.clientId,clientSecret:"",discoveryEndpoint:n.discoveryEndpoint??"",domain:n.domain,scopes:n.scopes.join(" ")}),p(!0)},_=async()=>{if(!i.issuer||!i.clientId||!i.domain){c.error(s("settings.orgSso.requiredFieldsError"));return}if(!u&&!i.clientSecret){c.error(s("settings.orgSso.clientSecretRequiredError"));return}try{await f.mutateAsync({issuer:i.issuer,clientId:i.clientId,clientSecret:i.clientSecret,discoveryEndpoint:i.discoveryEndpoint||void 0,scopes:i.scopes.split(/\s+/).filter(Boolean),domain:i.domain,enforced:n?.enforced??!1}),C(u?"sso_config_updated":"sso_configured",{organization_id:o.id,email_domain:i.domain}),c.success(s("settings.orgSso.configurationSavedSuccess")),p(!1)}catch(t){c.error(t instanceof Error?t.message:s("settings.orgSso.saveSsoConfigError"))}},w=async()=>{try{await S.mutateAsync(),C("sso_config_removed",{organization_id:o.id}),c.success(s("settings.orgSso.configurationRemovedSuccess")),p(!1),j(!1)}catch{c.error(s("settings.orgSso.removeSsoConfigError"))}},L=async t=>{try{await E.mutateAsync(t),C("sso_enforcement_toggled",{organization_id:o.id,enforced:t}),c.success(s(t?"settings.orgSso.enforcementEnabledSuccess":"settings.orgSso.enforcementDisabledSuccess"))}catch{c.error(s("settings.orgSso.toggleEnforcementError"))}};return e.jsxs(x,{children:[e.jsx(x.Content,{children:e.jsx(x.Container,{children:e.jsxs(k,{children:[e.jsx(x.Title,{children:s("settings.orgSso.securityTitle")}),e.jsx(H,{}),I?e.jsx("div",{className:"text-sm text-muted-foreground",children:s("settings.orgSso.loading")}):e.jsxs(e.Fragment,{children:[u&&!d&&e.jsx(b,{title:s("settings.orgSso.sectionTitle"),children:e.jsxs(y,{children:[e.jsx(a,{title:s("settings.orgSso.providerLabel"),action:e.jsx("span",{className:"font-medium",children:n.issuer})}),e.jsx(a,{title:s("settings.orgSso.clientIdLabel"),action:e.jsx("span",{className:"font-mono text-xs",children:n.clientId})}),e.jsx(a,{title:s("settings.orgSso.domainLabel"),action:e.jsx("span",{className:"font-medium",children:n.domain})}),e.jsx(a,{title:s("settings.orgSso.scopesLabel"),action:e.jsx("span",{className:"font-mono text-xs",children:n.scopes.join(" ")})}),e.jsx("div",{className:"h-px bg-border mx-5"}),e.jsx(a,{title:s("settings.orgSso.enforceSsoLabel"),description:s("settings.orgSso.enforceSsoDescription"),action:e.jsx($,{checked:n.enforced,onCheckedChange:L,disabled:E.isPending})}),e.jsxs(D,{children:[e.jsxs(m,{variant:"ghost",size:"sm",onClick:()=>j(!0),disabled:S.isPending,className:"text-destructive hover:text-destructive mr-auto",children:[e.jsx(V,{size:14}),s("settings.orgSso.removeButton")]}),e.jsx(m,{variant:"outline",size:"sm",onClick:()=>{window.open(`/api/${o.slug}/sso/authorize`,"_blank")},children:s("settings.orgSso.testSsoButton")}),e.jsx(m,{variant:"outline",size:"sm",onClick:N,children:s("settings.orgSso.editConfigButton")})]})]})}),(!u||d)&&e.jsx(b,{title:s("settings.orgSso.sectionTitle"),children:e.jsxs(y,{children:[e.jsx(a,{title:s("settings.orgSso.issuerUrlLabel"),description:s("settings.orgSso.issuerUrlDescription"),action:e.jsx(g,{id:"sso-issuer",placeholder:s("settings.orgSso.issuerUrlPlaceholder"),value:i.issuer,onChange:t=>l(r=>({...r,issuer:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.clientIdLabel"),action:e.jsx(g,{id:"sso-client-id",placeholder:s("settings.orgSso.clientIdPlaceholder"),value:i.clientId,onChange:t=>l(r=>({...r,clientId:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.clientSecretLabel"),description:d&&u?s("settings.orgSso.clientSecretEditDescription"):void 0,action:e.jsx(g,{id:"sso-client-secret",type:"password",placeholder:s("settings.orgSso.clientSecretPlaceholder"),value:i.clientSecret,onChange:t=>l(r=>({...r,clientSecret:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.emailDomainLabel"),description:s("settings.orgSso.emailDomainDescription"),action:e.jsx(g,{id:"sso-domain",placeholder:s("settings.orgSso.emailDomainPlaceholder"),value:i.domain,onChange:t=>l(r=>({...r,domain:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.scopesLabel"),action:e.jsx(g,{id:"sso-scopes",placeholder:s("settings.orgSso.scopesPlaceholder"),value:i.scopes,onChange:t=>l(r=>({...r,scopes:t.target.value})),className:"w-[280px]"})}),e.jsx(a,{title:s("settings.orgSso.discoveryEndpointLabel"),description:s("settings.orgSso.discoveryEndpointDescription"),action:e.jsx(g,{id:"sso-discovery",placeholder:s("settings.orgSso.discoveryEndpointPlaceholder"),value:i.discoveryEndpoint,onChange:t=>l(r=>({...r,discoveryEndpoint:t.target.value})),className:"w-[280px]"})}),e.jsxs(D,{children:[d&&e.jsx(m,{variant:"outline",size:"sm",onClick:()=>p(!1),children:s("settings.orgSso.cancelButton")}),e.jsx(m,{onClick:_,disabled:f.isPending,size:"sm",children:f.isPending?s("settings.orgSso.savingButton"):s(d?"settings.orgSso.updateButton":"settings.orgSso.configureSsoButton")})]})]})})]})]})})}),e.jsx(z,{open:P,onOpenChange:j,children:e.jsxs(T,{children:[e.jsx(O,{children:e.jsx(R,{children:s("settings.orgSso.removeConfirmation")})}),e.jsxs(F,{children:[e.jsx(M,{disabled:S.isPending,children:s("settings.orgSso.cancelButton")}),e.jsx(q,{onClick:w,disabled:S.isPending,variant:"destructive",children:s("settings.orgSso.removeButton")})]})]})})]})}function de(){const s=U.c(1);let o;return s[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(W,{capability:"org:manage",area:"security",children:e.jsx(X,{})}),s[0]=o):o=s[0],o}export{de as default};
|