decocms 4.584.12 → 4.584.13
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-BuSYYXoB.js → AlertCircle-DA6gE5vw.js} +1 -1
- package/dist/client/assets/{AreaChart-B7QJFNyd.js → AreaChart-Y5-RpSOt.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CjBgi68F.js → ArrowLeft-B8D7i2xh.js} +1 -1
- package/dist/client/assets/{ArrowRight-BSOOXYJl.js → ArrowRight-C1EmTlL-.js} +1 -1
- package/dist/client/assets/{ArrowUp-DsFRA_-F.js → ArrowUp-DyF0Rx2O.js} +1 -1
- package/dist/client/assets/{BookOpen01-Bg7SPIQl.js → BookOpen01-UxGmri2e.js} +1 -1
- package/dist/client/assets/{CartesianChart-CTbh6Hly.js → CartesianChart-Dv3UTRbp.js} +1 -1
- package/dist/client/assets/{CategoricalChart-Bk-NltJE.js → CategoricalChart-oGRIPAq4.js} +1 -1
- package/dist/client/assets/{CheckCircle-CwkAQPvk.js → CheckCircle-Bh1gNJET.js} +1 -1
- package/dist/client/assets/{ChevronDown-Dq3-i4Ph.js → ChevronDown-uPv2ScPr.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-Ce-S0bwE.js → ChevronSelectorVertical-CiFyE2Pu.js} +1 -1
- package/dist/client/assets/{ChevronUp-CsGl40rv.js → ChevronUp-BkmRXggG.js} +1 -1
- package/dist/client/assets/{CreditCard01-DyQlc3BQ.js → CreditCard01-C-H9qti1.js} +1 -1
- package/dist/client/assets/{Eye-DgggGLP1.js → Eye-DL5oRAI4.js} +1 -1
- package/dist/client/assets/{File02-B-McavGu.js → File02-DEjt2PPW.js} +1 -1
- package/dist/client/assets/{Globe04-DByxWswA.js → Globe04-DD86hrsf.js} +1 -1
- package/dist/client/assets/{Image01-C-12Ic3A.js → Image01-BCiDUkCm.js} +1 -1
- package/dist/client/assets/{Key01-O_7ZqdlA.js → Key01-CgRwsDr3.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CAJfUJ1M.js → LayoutLeft-DHg_jNr0.js} +1 -1
- package/dist/client/assets/{LinkBroken01-DlxIHBPg.js → LinkBroken01-Ic71rSEU.js} +1 -1
- package/dist/client/assets/{MessageCircle01-DboGgDYl.js → MessageCircle01-CQjeMfQj.js} +1 -1
- package/dist/client/assets/{Minus-C8qbEmNR.js → Minus-BM2zRSMr.js} +1 -1
- package/dist/client/assets/{Monitor01-ByiCXP90.js → Monitor01-C4OHhcX6.js} +1 -1
- package/dist/client/assets/{Play-B1OcqbdZ.js → Play-l838EjWq.js} +1 -1
- package/dist/client/assets/{Plus-DgAT_TKu.js → Plus-BzpqhVU8.js} +1 -1
- package/dist/client/assets/{ReferenceLine-BsFgkAaF.js → ReferenceLine-DmbAcSH6.js} +1 -1
- package/dist/client/assets/{SearchMd-CAmRp0LP.js → SearchMd-BhCfkG_O.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-qRoCf3xL.js → ShoppingBag01-KIefHp9K.js} +1 -1
- package/dist/client/assets/{Sun-DMx5ulRn.js → Sun-CoJn-J4w.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DRQUyYXI.js → SwitchHorizontal01-BU8z7oT_.js} +1 -1
- package/dist/client/assets/{Tool01-CIG9g9AW.js → Tool01-ymE-fOFX.js} +1 -1
- package/dist/client/assets/{Tooltip-Co9f8gJx.js → Tooltip-D86_gjwu.js} +1 -1
- package/dist/client/assets/{Trash01-BXZnDQzc.js → Trash01-aSl--BGd.js} +1 -1
- package/dist/client/assets/{TrendUp01-BXVcz0CP.js → TrendUp01-Cr4FP2fV.js} +1 -1
- package/dist/client/assets/{Upload01-DkM_CW6J.js → Upload01-DozMUWEF.js} +1 -1
- package/dist/client/assets/{UserCheck01-Dd1TarPv.js → UserCheck01-3D5hYz4C.js} +1 -1
- package/dist/client/assets/{UserSquare-Dx7SMn8a.js → UserSquare-aJjYmjOR.js} +1 -1
- package/dist/client/assets/{Users01-CrAD5jfs.js → Users01-Cximoi8v.js} +1 -1
- package/dist/client/assets/{XClose-ChZfCB0S.js → XClose-Dq0BGBMq.js} +1 -1
- package/dist/client/assets/{Zap-DzFzGOQ3.js → Zap-NAfA60T9.js} +1 -1
- package/dist/client/assets/{access-gate-C2FMXB7E.js → access-gate-Cnf06l1a.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-CzeB9jwm.js → add-connection-dialog-D1_0-J8t.js} +1 -1
- package/dist/client/assets/agent-app-B4NG-g7u.js +1 -0
- package/dist/client/assets/{agent-assets-9HrQTQv3.js → agent-assets-DHnb5L5s.js} +1 -1
- package/dist/client/assets/{agent-automation-DzRF919j.js → agent-automation-DBCjX475.js} +1 -1
- package/dist/client/assets/{agent-automations-B7gnwLG-.js → agent-automations-BPqk0cma.js} +1 -1
- package/dist/client/assets/{agent-blog-C5kBZHf-.js → agent-blog-C6OhwET5.js} +2 -2
- package/dist/client/assets/{agent-blog-post-Bw3h59FR.js → agent-blog-post-BPTTHi05.js} +2 -2
- package/dist/client/assets/{agent-calendar-Barh2tCG.js → agent-calendar-n7d8kxeC.js} +1 -1
- package/dist/client/assets/{agent-capabilities-pZr4u-WY.js → agent-capabilities-MDN7TVuK.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-B13VfK46.js → agent-connect-sources-BLX7S3Bt.js} +1 -1
- package/dist/client/assets/agent-deck-DbvnjqCy.js +1 -0
- package/dist/client/assets/{agent-e2e-BZsczrS6.js → agent-e2e-C67cHNzK.js} +1 -1
- package/dist/client/assets/agent-experiments-D0KHYwLz.js +1 -0
- package/dist/client/assets/agent-file-DJr9f7Uu.js +1 -0
- package/dist/client/assets/{agent-hosting-C_4Ag01X.js → agent-hosting-DennpVxk.js} +1 -1
- package/dist/client/assets/{agent-icon-CmYgsdkA.js → agent-icon-B9nZhdi2.js} +1 -1
- package/dist/client/assets/agent-library-Q1o2w1EA.js +1 -0
- package/dist/client/assets/agent-library-file-DeAgo7Oz.js +1 -0
- package/dist/client/assets/agent-overview-BzbDDcHv.js +1 -0
- package/dist/client/assets/{agent-releases-DotOCii8.js → agent-releases-DaI8RCLw.js} +1 -1
- package/dist/client/assets/agent-settings-CmbLkbQ3.js +1 -0
- package/dist/client/assets/{agent-site-editor-U2R7cRzL.js → agent-site-editor-BH7NFZLQ.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-mWem5GG6.js +2 -0
- package/dist/client/assets/agent-site-editor-content-Cxhwi79L.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-BTUTVJ5a.js +1 -0
- package/dist/client/assets/agent-view-ZyP4-VSz.js +1 -0
- package/dist/client/assets/{agent-view-guard-BFv6g1Ko.js → agent-view-guard-DEo6nzlH.js} +1 -1
- package/dist/client/assets/{ai-providers-BuBmxWDQ.js → ai-providers-x5-E0mng.js} +1 -1
- package/dist/client/assets/{alert-DuHwFyfE.js → alert-N4205I9V.js} +1 -1
- package/dist/client/assets/{analytics-sections-CwBZ5Ted.js → analytics-sections-Bp_cD3eQ.js} +1 -1
- package/dist/client/assets/api-keys-DYGRMzXM.js +1 -0
- package/dist/client/assets/{api-keys-DrP5YQ4I.js → api-keys-F6uIkepe.js} +1 -1
- package/dist/client/assets/{app-editor-BsVJdNx8.js → app-editor-BPz6mU_a.js} +1 -1
- package/dist/client/assets/{asset-utils-QVjWQLHR.js → asset-utils-Lxwn3jp5.js} +1 -1
- package/dist/client/assets/{auth-D_64eYdt.js → auth-D0WiD-6X.js} +1 -1
- package/dist/client/assets/{auth-catchall-ILxf5wbm.js → auth-catchall-BtM_92ON.js} +1 -1
- package/dist/client/assets/{auth-entry-BCQtAQ2U.js → auth-entry-DGg6_6PX.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BJtbEMwI.js → auth-split-layout-BdlGf3S0.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DLO3ZGCC.js → authenticate-and-persist-oauth-CjsXQJBc.js} +1 -1
- package/dist/client/assets/{automation-list-row-D0MQGuMj.js → automation-list-row-Bh6TsYyw.js} +1 -1
- package/dist/client/assets/{automation-runs-CLRJ9cBM.js → automation-runs-F5hXkFSl.js} +1 -1
- package/dist/client/assets/{automations-BZt_2MgL.js → automations-x3uj3Ydy.js} +1 -1
- package/dist/client/assets/{badge-CT_Bowl_.js → badge-BUkSpOXa.js} +1 -1
- package/dist/client/assets/{block-document-BJjPR7oq.js → block-document-Bkfi8LNG.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-DjXDZ6rd.js → blocks-preview-workspace-context-CwXYQcg5.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-D3HNXQiV.js → blocks-tab-states-_faw29v2.js} +1 -1
- package/dist/client/assets/{blog-preview-url-Dy7Dv8w3.js → blog-preview-url-Bk8Ya8Ff.js} +1 -1
- package/dist/client/assets/{blog-schema-XG0-2F17.js → blog-schema-D0iLRFhx.js} +1 -1
- package/dist/client/assets/{blog-source-gate-BNfT_-Se.js → blog-source-gate-CHqmG0fU.js} +1 -1
- package/dist/client/assets/{blog-view-gate-6XQCA5te.js → blog-view-gate-CBYiW3a_.js} +1 -1
- package/dist/client/assets/{buckets-CFkCJ9AR.js → buckets-PPqMjJPU.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-CdIUjiPi.js → build-improve-prompt-doc-CQr1jYEn.js} +1 -1
- package/dist/client/assets/{calendar-5YPFZKxL.js → calendar-ByOFe-ir.js} +1 -1
- package/dist/client/assets/{capability-load-error-BuCmA5o8.js → capability-load-error-DCMluNzB.js} +1 -1
- package/dist/client/assets/{category-editor-Zr7r4C9b.js → category-editor-FMFHmdJ9.js} +1 -1
- package/dist/client/assets/{category-tree-C5NWwRUY.js → category-tree-DO91V9PE.js} +1 -1
- package/dist/client/assets/{chart-NHpn8rhZ.js → chart-B0F_JJb6.js} +1 -1
- package/dist/client/assets/{chat-context-oV4F8WQc.js → chat-context-BhwgXdxZ.js} +1 -1
- package/dist/client/assets/{chat-draft-a_gkkGrw.js → chat-draft-CG09JkEF.js} +1 -1
- package/dist/client/assets/{checkbox-D_sNmJye.js → checkbox-BwlyfOui.js} +1 -1
- package/dist/client/assets/{choose-editor-MNNOPLUU.js → choose-editor-DMmUjki_.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CXQ8jWXU.js → cli-auth-success-ChZ4KETS.js} +1 -1
- package/dist/client/assets/{cms-settings-editor-BbFLb9ZS.js → cms-settings-editor-CIzKeqbY.js} +1 -1
- package/dist/client/assets/{cms-store-drafts-DxbgkQ0A.js → cms-store-drafts-C3WBV5HM.js} +1 -1
- package/dist/client/assets/{collapsible-BG95WVUo.js → collapsible-BILoWprp.js} +1 -1
- package/dist/client/assets/{collection-detail-kw3HL7Zg.js → collection-detail-D6kEPWTW.js} +1 -1
- package/dist/client/assets/{collection-display-button-C9XgzERd.js → collection-display-button-BlEDYqVQ.js} +1 -1
- package/dist/client/assets/{collection-search-Blzi887q.js → collection-search-Dj3oO1qn.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-0fJW8NBx.js → collection-table-wrapper-C8_o4YW1.js} +1 -1
- package/dist/client/assets/{collection-tabs-BfGk19Xn.js → collection-tabs-Wktk7Bil.js} +1 -1
- package/dist/client/assets/{combobox-BugfSYhh.js → combobox-7VjvZkXU.js} +1 -1
- package/dist/client/assets/{command-2E07YrgQ.js → command-BcxQrgUK.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-CSuVoTfi.js → companion-mcps-section-DQ1lC2cH.js} +1 -1
- package/dist/client/assets/{config-R6R9Ongh.js → config-Bn4oMb7y.js} +1 -1
- package/dist/client/assets/{connect-key-Cojwbl7P.js → connect-key-BqwNSl8t.js} +1 -1
- package/dist/client/assets/{connect-layout-Bx9T6hqz.js → connect-layout-DqtlIJwT.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-mX-5t-Zc.js → connect-source-dialog-HVNAw6m0.js} +1 -1
- package/dist/client/assets/{connect-M7tiJDQi.js → connect-uQ-qw1JW.js} +1 -1
- package/dist/client/assets/{connection-DjW2F0Sw.js → connection-CELF9xGk.js} +1 -1
- package/dist/client/assets/{connection-card-D0xB4Qjx.js → connection-card-DqAevMOq.js} +1 -1
- package/dist/client/assets/{connection-detail-CRthnQCY.js → connection-detail-MGfXYK35.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DFjr7AwA.js → connection-form-helpers-egiEwtYz.js} +1 -1
- package/dist/client/assets/{connection-slug-BY-obzjO.js → connection-slug-Dz7hwoVN.js} +1 -1
- package/dist/client/assets/{connections-BnoTkXmg.js → connections-D2NvIFXC.js} +1 -1
- package/dist/client/assets/{content-tab-BzfOLSKV.js → content-tab-BvT7P5lX.js} +3 -3
- package/dist/client/assets/{context-DVDLM_Ic.js → context-CggBlD0z.js} +1 -1
- package/dist/client/assets/{context-menu-CA2Qt-d2.js → context-menu-CXequwNl.js} +1 -1
- package/dist/client/assets/{context-shell-DabLWz4l.js → context-shell-Bqoi0m2O.js} +3 -3
- package/dist/client/assets/{create-organization-dialog-D92lLoa4.js → create-organization-dialog-BOcGysWt.js} +1 -1
- package/dist/client/assets/{daily-pulse-Ds3sxReN.js → daily-pulse-BA0ikU80.js} +1 -1
- package/dist/client/assets/{delete-copy-3IZwE-9t.js → delete-copy-CzwVZl8P.js} +1 -1
- package/dist/client/assets/{device-hint-_LCtjil4.js → device-hint-CUh7MxFw.js} +1 -1
- package/dist/client/assets/{discover-5fE1YFIy.js → discover-Bt0PjesU.js} +1 -1
- package/dist/client/assets/{domain-settings-C3fyHcP5.js → domain-settings-BamU0icI.js} +1 -1
- package/dist/client/assets/{drawer-XYh0Y76X.js → drawer-EGIO8vW1.js} +1 -1
- package/dist/client/assets/{editor-um5vPMjZ.js → editor-B_YvqDEq.js} +1 -1
- package/dist/client/assets/{editor-classes-BatboZCB.js → editor-classes-D2vt4K2z.js} +1 -1
- package/dist/client/assets/{empty-message-B27EvPA5.js → empty-message-BR97lu1R.js} +1 -1
- package/dist/client/assets/{empty-state-DUI1uMab.js → empty-state-D--R_kh-.js} +1 -1
- package/dist/client/assets/{empty-state-CD43HEkx.js → empty-state-DxGz72GL.js} +1 -1
- package/dist/client/assets/{experiments-tab-choice-BWnh1BzP.js → experiments-tab-choice-zR5-VX5L.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BhyRah4W.js → extract-connection-data-DeUSUVIy.js} +1 -1
- package/dist/client/assets/{feature-gate-Dg0v4va6.js → feature-gate-DK9IZjbG.js} +1 -1
- package/dist/client/assets/{feature-paywall-TG7L-qMr.js → feature-paywall-BQdFbBKY.js} +1 -1
- package/dist/client/assets/{file-explorer-DSgGqDRY.js → file-explorer-6XHpEO9J.js} +1 -1
- package/dist/client/assets/{file-preview-CIfFSMEa.js → file-preview-CXliAtvL.js} +1 -1
- package/dist/client/assets/{file-share-button-mrsJYdan.js → file-share-button-BUHoICkf.js} +1 -1
- package/dist/client/assets/{file-type-icon-MJit4Xxk.js → file-type-icon-Bhy3vcyl.js} +1 -1
- package/dist/client/assets/{folder-icon-CIbEuHFJ.js → folder-icon-BD8Yju3a.js} +1 -1
- package/dist/client/assets/{form-CTAz1vX9.js → form-Cb5OHNc9.js} +1 -1
- package/dist/client/assets/{frame-navigation-BBEhmW78.js → frame-navigation-D5yMy5Mm.js} +1 -1
- package/dist/client/assets/{gateway-client-BKm00588.js → gateway-client-t5s1Cm0x.js} +1 -1
- package/dist/client/assets/{general-CYA6Zf6p.js → general-DfARJPaG.js} +1 -1
- package/dist/client/assets/{github-icon-llpq0MNv.js → github-icon-BoZrKkV3.js} +1 -1
- package/dist/client/assets/{held-block-view-DVOSfe5P.js → held-block-view-Bm4hn8SE.js} +1 -1
- package/dist/client/assets/{home-HOYD9Ses.js → home-COKBWHzA.js} +1 -1
- package/dist/client/assets/{home-overview-BwE_ga8l.js → home-overview-C0oKtq4c.js} +1 -1
- package/dist/client/assets/{hosted-reconcile-CwdLagF7.js → hosted-reconcile-mSp200Ck.js} +1 -1
- package/dist/client/assets/{icon-button-D7LkPwOF.js → icon-button-CpBLMSxk.js} +1 -1
- package/dist/client/assets/{index-weqOv2y6.js → index-0AidFUUh.js} +1 -1
- package/dist/client/assets/{index-coAeu4pU.js → index-A2_7RKep.js} +1 -1
- package/dist/client/assets/{index-SF6h0OMA.js → index-BED_VE7w.js} +1 -1
- package/dist/client/assets/{index-CYgHpTZe.js → index-BQrnEOJ9.js} +1 -1
- package/dist/client/assets/{index-eNu6nx1W.js → index-BTT5sL01.js} +1 -1
- package/dist/client/assets/{index-DY2XXBge.js → index-Bi2fLJMb.js} +1 -1
- package/dist/client/assets/{index-Biams685.js → index-BsAwgxIf.js} +3 -3
- package/dist/client/assets/{index-DoatmtZ6.js → index-CGQejmXu.js} +1 -1
- package/dist/client/assets/{index-BPGM2v94.js → index-CM0d89Yv.js} +1 -1
- package/dist/client/assets/{index-BAqfesXo.js → index-CT5cpmuw.js} +1 -1
- package/dist/client/assets/{index-BldUavnl.js → index-D1alBOdU.js} +1 -1
- package/dist/client/assets/{index-DudhPIvY.js → index-DEh8AOfP.js} +1 -1
- package/dist/client/assets/{index-BWYImI42.js → index-DKlpvKuq.js} +1 -1
- package/dist/client/assets/index-DQWJotH-.js +1 -0
- package/dist/client/assets/{index-D4_P19LT.js → index-KBC7Pj7l.js} +1 -1
- package/dist/client/assets/{index-B_wXIpW7.js → index-KFEtz5HA.js} +1 -1
- package/dist/client/assets/{index-DcEkCGAP.js → index-Oc-4w-Ob.js} +1 -1
- package/dist/client/assets/{index-redirect-ZSm9yQL-.js → index-redirect-DWwBvPoP.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DviOrlp9.js → infiniteQueryObserver-CnD94meO.js} +1 -1
- package/dist/client/assets/{infra-billing-IBBLIWxF.js → infra-billing-C7MnSX69.js} +1 -1
- package/dist/client/assets/{input-B76M4kKw.js → input--kphUWpn.js} +1 -1
- package/dist/client/assets/{input-CeB8s6SZ.js → input-Cy8KNDYA.js} +3 -3
- package/dist/client/assets/{integration-icon-C76s6rje.js → integration-icon-DbiCbrD7.js} +1 -1
- package/dist/client/assets/{item-actions-CZZ--PmH.js → item-actions-BR3Rk3pU.js} +1 -1
- package/dist/client/assets/{jira-icon-XEH4IQk9.js → jira-icon-BJDzOHlp.js} +1 -1
- package/dist/client/assets/{label-B5koT7GN.js → label-D8u4gNcM.js} +1 -1
- package/dist/client/assets/{layout-CxyUazai.js → layout-Djcel6JN.js} +1 -1
- package/dist/client/assets/{legacy-admin-welcome-dialog-D0q0NbRI.js → legacy-admin-welcome-dialog-C4yFyjEg.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-C2DNyxqu.js → legacy-agents-deep-BhezYC1Y.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-WtSatDH5.js → legacy-main-redirect-B2LMkN9B.js} +1 -1
- package/dist/client/assets/library-i7u4D0nv.js +1 -0
- package/dist/client/assets/{library-tab-2qBenxku.js → library-tab-B6AGBITt.js} +1 -1
- package/dist/client/assets/{login-c4mGU54U.js → login-D-FcOLf-.js} +1 -1
- package/dist/client/assets/{markdown-QFsCz8HO.js → markdown-SwM1Ir6g.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BQn1YwZp.js → mcp-app-renderer-Jzrzu2q5.js} +1 -1
- package/dist/client/assets/{mcp-oauth-o7ej4_IN.js → mcp-oauth-DXUgkWSg.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BjLyRnBa.js → mcp-oauth-nZa_TONF.js} +1 -1
- package/dist/client/assets/{members-D8PhbHd1.js → members-pMC1bfqu.js} +1 -1
- package/dist/client/assets/{memory-BtY-1LoU.js → memory-msRY8EWU.js} +1 -1
- package/dist/client/assets/{mock-board-BtI43PTx.js → mock-board-4Dfd4bxV.js} +3 -3
- package/dist/client/assets/{monaco-editor-D9Tg3MLA.js → monaco-editor-Dj-bs0sb.js} +1 -1
- package/dist/client/assets/{monitoring-CtQcY_Yw.js → monitoring-Db6Y9X_T.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-HbK1wloz.js → monitoring-stats-row-9YaCFmpo.js} +1 -1
- package/dist/client/assets/{multi-select-B-3mGzW5.js → multi-select-Cp5gIPzv.js} +1 -1
- package/dist/client/assets/{mustache-BLA1CrAV.js → mustache-CyusQksc.js} +1 -1
- package/dist/client/assets/{named-rule-step-8144d_yV.js → named-rule-step-DbDjzYJn.js} +1 -1
- package/dist/client/assets/{named-rule-view-DPkhmptL.js → named-rule-view-Dh3pa8Ix.js} +1 -1
- package/dist/client/assets/{new-project-dialog-CZtNDQaD.js → new-project-dialog-CrDlez-N.js} +1 -1
- package/dist/client/assets/{new-project-store-DNJn4Jmh.js → new-project-store-DleT4y6U.js} +1 -1
- package/dist/client/assets/{oauth-callback-6T3u1_5o.js → oauth-callback-D-LN8o-r.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-B-x9qcVx.js → oauth-callback-ai-provider-BKOttmuU.js} +1 -1
- package/dist/client/assets/{oauth-consent-DVlsNNXL.js → oauth-consent-C0LB3lfZ.js} +1 -1
- package/dist/client/assets/{onboarding-Cb57pCFu.js → onboarding-DRXH9Y7t.js} +1 -1
- package/dist/client/assets/{openai-conversation-DcmrMDzM.js → openai-conversation-BDQFSE01.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-BRMs4i73.js → optimistic-project-sidebar-views-DpB-Kj9e.js} +1 -1
- package/dist/client/assets/{order-monitor-day-DfXP58WW.js → order-monitor-day-7qmkUUGV.js} +1 -1
- package/dist/client/assets/{organization-choice-CUWW63qG.js → organization-choice-Bs6uDF8C.js} +1 -1
- package/dist/client/assets/{orgs-BZlWgF_x.js → orgs-CwaDyfCI.js} +1 -1
- package/dist/client/assets/{own-accounts-section-DxCHg0ny.js → own-accounts-section-wo48sm2j.js} +1 -1
- package/dist/client/assets/{pair-CgVGpWTx.js → pair-4JIJkNK2.js} +1 -1
- package/dist/client/assets/{parse-sections-DUGfLIWJ.js → parse-sections-3dpMP28-.js} +2 -2
- package/dist/client/assets/{plan-DnwLIGzd.js → plan-CgB_LoKO.js} +1 -1
- package/dist/client/assets/{plan-ladder-Bu6W70aQ.js → plan-ladder-DAHXnxDP.js} +1 -1
- package/dist/client/assets/{plan-usage-card-C57l8FIL.js → plan-usage-card-DKC1nkf_.js} +1 -1
- package/dist/client/assets/{popover-DmvVZ360.js → popover-DogMO3pk.js} +1 -1
- package/dist/client/assets/{post-calendar-DznCDSLK.js → post-calendar-CwmTBZkp.js} +1 -1
- package/dist/client/assets/{post-editor-wEb9hjKG.js → post-editor-CDKF4zje.js} +1 -1
- package/dist/client/assets/{preview-content-CviEl4FA.js → preview-content-D6MLtumX.js} +1 -1
- package/dist/client/assets/{preview-dialog-BjWX-MRB.js → preview-dialog-Bc3kRUrq.js} +1 -1
- package/dist/client/assets/{preview-panel-SI4Ib1Aj.js → preview-panel-BkNp3-My.js} +1 -1
- package/dist/client/assets/{preview-tab-Dk62lBXe.js → preview-tab-BLd_YM6q.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-BnZa5p8U.js → product-picker-dialog-BEHWsHij.js} +1 -1
- package/dist/client/assets/{profile-27iQlhcJ.js → profile-CxcB48LV.js} +1 -1
- package/dist/client/assets/{project-app-view-BwR2AERO.js → project-app-view-DThAV1rl.js} +1 -1
- package/dist/client/assets/{project-apps-rpgmmv_y.js → project-apps-B94DpdMu.js} +1 -1
- package/dist/client/assets/{project-icon-VgM1tY99.js → project-icon-BHcF2TIr.js} +1 -1
- package/dist/client/assets/{project-index-CDh44wXq.js → project-index-Be1RuOJ6.js} +1 -1
- package/dist/client/assets/project-reports-K8JRKUu4.js +1 -0
- package/dist/client/assets/project-tasks-CA5yJnAe.js +1 -0
- package/dist/client/assets/{projects-OCdIg2Gi.js → projects-C1GSJkUl.js} +1 -1
- package/dist/client/assets/{projects-empty-state-i0nk7emw.js → projects-empty-state-DlLdfDdd.js} +1 -1
- package/dist/client/assets/{prompts-DNMt0A82.js → prompts-5zeVOrro.js} +1 -1
- package/dist/client/assets/record-editor-DayZB6HD.js +1 -0
- package/dist/client/assets/{redirect-editor-YrpaR7IQ.js → redirect-editor-CEVbDPNz.js} +1 -1
- package/dist/client/assets/{reports-CHlbCaSO.js → reports-S46_cn_C.js} +1 -1
- package/dist/client/assets/{reports-onboarding-BU0_JYSd.js → reports-onboarding-Bgx5Wbga.js} +1 -1
- package/dist/client/assets/{reports-tab-BXwRh5Je.js → reports-tab-CajwSXZt.js} +2 -2
- package/dist/client/assets/reports-vF-XIQTi.js +1 -0
- package/dist/client/assets/{repositories-D5ePo5qD.js → repositories-B1gkEk-T.js} +1 -1
- package/dist/client/assets/repositories-CMSsRRv6.js +1 -0
- package/dist/client/assets/{repository-binding-CWTr70tX.js → repository-binding-BS9v5Fe_.js} +1 -1
- package/dist/client/assets/{repository-picker-CAtWKBbx.js → repository-picker-CXtPhUQx.js} +1 -1
- package/dist/client/assets/{require-capability-BEpAmIG-.js → require-capability-Db5kMZvY.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CgZqM250.js → required-auth-layout-C_8jBLMB.js} +1 -1
- package/dist/client/assets/{reset-password-bO2BtcrT.js → reset-password-DIVuqYKV.js} +1 -1
- package/dist/client/assets/{resizable-CFK0TmIM.js → resizable-97tyuWCT.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-qGMCDrsW.js → resolve-tab-icon-CgO8Qihl.js} +1 -1
- package/dist/client/assets/{review-settings-3GBzR4Yt.js → review-settings-CLgbnmq-.js} +1 -1
- package/dist/client/assets/{role-color-Bdj8ikki.js → role-color-gTG8o13c.js} +1 -1
- package/dist/client/assets/{roles-BOeP1ebp.js → roles-zI-Hk6fY.js} +1 -1
- package/dist/client/assets/{route-j_qO2dDr.js → route-BVVvTINP.js} +1 -1
- package/dist/client/assets/route-DGTGR39c.js +1 -0
- package/dist/client/assets/{route-CYW15Jx-.js → route-JrcnSNgm.js} +1 -1
- package/dist/client/assets/{route-page-header-kK3KuiFw.js → route-page-header-DFLx6qIf.js} +1 -1
- package/dist/client/assets/{sandbox-git-api-BTtQPEAs.js → sandbox-git-api-CbcKlTqF.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-Cq9tokKr.js → sandbox-lifecycle-context-Ckk9fyCX.js} +1 -1
- package/dist/client/assets/{save-status-D6ZCuvIw.js → save-status-DIv_w4LK.js} +1 -1
- package/dist/client/assets/{schema-D-rmQGG7.js → schema-CggWCz-G.js} +1 -1
- package/dist/client/assets/{schema-5sguLDZR.js → schema-CsWev9Lq.js} +1 -1
- package/dist/client/assets/{scroll-area--F5PSuIY.js → scroll-area-KLc2042F.js} +1 -1
- package/dist/client/assets/{search-input-DSB0t8kj.js → search-input-D6gGXIf1.js} +1 -1
- package/dist/client/assets/{search-toggle-qYosTs_8.js → search-toggle-CMDWFPiy.js} +1 -1
- package/dist/client/assets/{secret-picker-0-8hMF-u.js → secret-picker-IFIVFm7w.js} +1 -1
- package/dist/client/assets/{secrets-DXxd7p_6.js → secrets-jBAw0ULO.js} +1 -1
- package/dist/client/assets/{section-array-field-bEeF0FCV.js → section-array-field-fkRL6dJN.js} +1 -1
- package/dist/client/assets/{sections-V-F7INF6.js → sections-DH2lycfv.js} +1 -1
- package/dist/client/assets/{sections-editor-zU--ttbg.js → sections-editor-BWiwMgid.js} +1 -1
- package/dist/client/assets/{select-ewWPkQXd.js → select-DPXDtN3F.js} +1 -1
- package/dist/client/assets/{select-model-lB0XjZQu.js → select-model-DL2dvL4e.js} +1 -1
- package/dist/client/assets/{seo-editor-C4YIyat5.js → seo-editor-Qsv4nJ3u.js} +1 -1
- package/dist/client/assets/{separator-C0S3W_GK.js → separator-CL-QJFBL.js} +1 -1
- package/dist/client/assets/{session-runtime-OZnQWVyx.js → session-runtime-BtkBTCEv.js} +1 -1
- package/dist/client/assets/settings-tab-9VStd703.js +1 -0
- package/dist/client/assets/{sheet-DYP4kWtX.js → sheet-DKmzxIAF.js} +1 -1
- package/dist/client/assets/{shell-layout-Dd3ZOJl-.js → shell-layout-DwJrXedk.js} +1 -1
- package/dist/client/assets/{site-draft-actions-B_UnkEm1.js → site-draft-actions-CKH_63G-.js} +1 -1
- package/dist/client/assets/{site-draft-view-B1FDjL56.js → site-draft-view-Cr2tGRpR.js} +1 -1
- package/dist/client/assets/site-editor-CVnLWuGP.js +1 -0
- package/dist/client/assets/{site-editor-toast-DrqWp80X.js → site-editor-toast-BRXEnjic.js} +1 -1
- package/dist/client/assets/{skills-Bzk9DhOS.js → skills-DJZ4NcoQ.js} +1 -1
- package/dist/client/assets/{slider-BcolzkZg.js → slider-tajZdOy1.js} +1 -1
- package/dist/client/assets/{sortable.esm-BeN2A75n.js → sortable.esm-xHKM0aSe.js} +1 -1
- package/dist/client/assets/{sso-DO6R7GAe.js → sso-CdgaAIgO.js} +1 -1
- package/dist/client/assets/{suggestion-BW469wQ_.js → suggestion-BapLR6AM.js} +1 -1
- package/dist/client/assets/{super-agent-icon-fbJctyE7.js → super-agent-icon-DD9h5HSQ.js} +1 -1
- package/dist/client/assets/{switch-Dmoe_p0M.js → switch-DEje7fmz.js} +1 -1
- package/dist/client/assets/{synced-repos-C2KamLS5.js → synced-repos-p7TfojtZ.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-BpWNgKYN.js → tab-icon-glyph-DlkpXRLw.js} +1 -1
- package/dist/client/assets/{table-DearQIjo.js → table-Cie3FI8M.js} +1 -1
- package/dist/client/assets/{tabs-BqUC_RhT.js → tabs-BMObVAFs.js} +1 -1
- package/dist/client/assets/{task-board-DfE7ACDs.js → task-board-CZuAKwkd.js} +1 -1
- package/dist/client/assets/{task-key-D5Xi8Zpv.js → task-key-Binbqohp.js} +1 -1
- package/dist/client/assets/{task-route-YrsLsrlf.js → task-route-IxeWFQf4.js} +1 -1
- package/dist/client/assets/{task-status-Gh6OxLHy.js → task-status-24VN3LnD.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-DwPeXP0G.js → taskboard-analytics-TIghTMhL.js} +1 -1
- package/dist/client/assets/{tasks-JQNDYPkv.js → tasks-DnDVdrmF.js} +1 -1
- package/dist/client/assets/tasks-UA8LFybk.js +1 -0
- package/dist/client/assets/{textarea-DDxBLXs2.js → textarea-3iEFQij9.js} +1 -1
- package/dist/client/assets/{thread-analytics-D-buV8-Z.js → thread-analytics-DvdOTcnX.js} +1 -1
- package/dist/client/assets/{thread-button-Swmr63Yb.js → thread-button-ChRjFza7.js} +1 -1
- package/dist/client/assets/{thread-intent-B4ztyrl0.js → thread-intent-BNoxio0t.js} +1 -1
- package/dist/client/assets/{thread-route-6XiMNHA9.js → thread-route-DEzPmkpC.js} +1 -1
- package/dist/client/assets/{thread-route-DmAvNVfz.js → thread-route-sNjMl6Ie.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-DZFMrcN3.js → thread-sheet-body-JBqWWQDi.js} +1 -1
- package/dist/client/assets/{time-range-picker-iaayu7xs.js → time-range-picker-DDjkoMQs.js} +1 -1
- package/dist/client/assets/{toggle-group-CVXqq62l.js → toggle-group-N0qYYn6W.js} +1 -1
- package/dist/client/assets/{tool-set-selector-DEUJAQky.js → tool-set-selector-BE0R1AUj.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CrkoLL-g.js → toolbar-icon-button-BSXImY57.js} +1 -1
- package/dist/client/assets/{tooltip-CqtvIcRI.js → tooltip-r0LfLYi3.js} +1 -1
- package/dist/client/assets/{tooltipContext-BIVvJQGQ.js → tooltipContext-DRtEpNZN.js} +1 -1
- package/dist/client/assets/{track-jnZwcvQW.js → track-Ciq_Ag4i.js} +1 -1
- package/dist/client/assets/{types-CqLgXd5K.js → types-BhUJ3bOA.js} +1 -1
- package/dist/client/assets/{url-slug-BMcANwuf.js → url-slug-CR2COLQn.js} +1 -1
- package/dist/client/assets/{usage-stats-LbQgUlFb.js → usage-stats-BH8jlFhP.js} +1 -1
- package/dist/client/assets/{use-ai-providers-D-W7KWam.js → use-ai-providers-CFArCH41.js} +1 -1
- package/dist/client/assets/{use-api-keys-BZkdV8_9.js → use-api-keys-lPXg3MPh.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-Du3q600g.js → use-apply-named-rule-C4A8N8Up.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-DxfAfFUt.js +1 -0
- package/dist/client/assets/{use-automations-CDdcaseZ.js → use-automations-DcCuqnYq.js} +1 -1
- package/dist/client/assets/{use-autosave-B7jzEDxJ.js → use-autosave-Cpi6qZoh.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-uH3tLJJX.js +1 -0
- package/dist/client/assets/use-blog-view-B-p1Bott.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-3j9yfEqK.js → use-chat-layout-state-DjHcwQYx.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-DO2ageGn.js → use-cms-publish-actions-BbXykL5B.js} +1 -1
- package/dist/client/assets/{use-connect-companion-BC1E9YXV.js → use-connect-companion-CNj3wQey.js} +1 -1
- package/dist/client/assets/{use-connection-D2uhV2tM.js → use-connection-DpuSfyHb.js} +1 -1
- package/dist/client/assets/{use-content-sync-CoY-_8zJ.js → use-content-sync-C9laqqVB.js} +1 -1
- package/dist/client/assets/{use-copy-D38lTrG-.js → use-copy-BFUDxfVH.js} +1 -1
- package/dist/client/assets/{use-current-view-DJKRVR3b.js → use-current-view-C1-z4fIk.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BoNBckFl.js → use-date-fns-locale-D6T1OHTy.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CTSPCSDa.js → use-debounced-autosave-C5QlmVn0.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Bih1VwpO.js → use-debounced-value-BkJoL4uj.js} +1 -1
- package/dist/client/assets/{use-deco-credits-C7-mSVdn.js → use-deco-credits-zD_A42hI.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DZT948GO.js → use-decopilot-events-CZR337Lj.js} +1 -1
- package/dist/client/assets/{use-delete-block-CcKC_Ygp.js → use-delete-block-BYw_7GRP.js} +1 -1
- package/dist/client/assets/{use-delete-connection-3J4cAqjZ.js → use-delete-connection-B0ASWh3-.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-IWWegkPe.js → use-deployment-admin-DGQGQZ6E.js} +1 -1
- package/dist/client/assets/{use-entitlements-DczHLBrX.js → use-entitlements-BRKIl3Rz.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-DQQlKJc9.js → use-fast-preview-draft-url-BTGBRNHr.js} +1 -1
- package/dist/client/assets/{use-file-configs-CRoKvN6g.js → use-file-configs-CMTQcHfJ.js} +1 -1
- package/dist/client/assets/{use-id-selection-Bb7QXS3G.js → use-id-selection-Bn7c-vY3.js} +1 -1
- package/dist/client/assets/{use-in-settings-N8ExD21K.js → use-in-settings-BT3nEhsO.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-Bcqc3dOm.js → use-inbox-feed-DGj1Phk9.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BGpcvUym.js → use-infinite-scroll-Dv1yBngZ.js} +1 -1
- package/dist/client/assets/{use-join-requests-B56l6qYX.js → use-join-requests-DMRpQYlE.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-C6f1cnZR.js → use-main-panel-tabs-C0GJ35ov.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CmK1_0eP.js → use-mcp-auth-status-D9OBaQkq.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DwG9qZWg.js → use-mcp-client-DXpTlXlJ.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-D7T45oWG.js → use-mcp-prompts-B_BU9Jdl.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DKzBuG5m.js → use-mcp-tools-B0m5-RR6.js} +1 -1
- package/dist/client/assets/{use-mobile-0AteUciZ.js → use-mobile-BwxeIsTr.js} +1 -1
- package/dist/client/assets/{use-move-blocks-CgGynxG8.js → use-move-blocks-D-OheBD-.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C6-ZqKGw.js → use-navigate-to-agent-DjeX7xEq.js} +1 -1
- package/dist/client/assets/{use-never-published-RVkCjO67.js → use-never-published-CP8Hs4DE.js} +1 -1
- package/dist/client/assets/{use-org-fs-ZPuN9WFa.js → use-org-fs-D2bsNlGU.js} +1 -1
- package/dist/client/assets/{use-org-notice-pbZd-uTd.js → use-org-notice-BLcA1Iw0.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-BrQetXCm.js → use-org-repo-syncs-Dfmuqlr1.js} +1 -1
- package/dist/client/assets/{use-org-sso-D48jSMd3.js → use-org-sso-DhdCpzK5.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BV6bWoGw.js → use-organization-settings-BilLeNy9.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-Du4Vt0nC.js → use-panel-navigate-DpEZACCY.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-zLdmW5cR.js → use-project-native-view-presence-D4zm5hDa.js} +1 -1
- package/dist/client/assets/{use-project-scope-V_yAQHXr.js → use-project-scope-C815BKEh.js} +1 -1
- package/dist/client/assets/{use-recent-apps-Bb8uZJJ7.js → use-recent-apps-Cr_xiDfS.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-Cd_5Wnxu.js → use-reports-diagnostic-Djz2mp7k.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-D1U-YJTq.js → use-sandbox-events-aK2a02aF.js} +1 -1
- package/dist/client/assets/{use-secrets-CZuFBjjc.js → use-secrets-CJ3hXlfU.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BCev-1VC.js → use-section-preview-base-Ve5g9dlJ.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-Chi-pzOH.js → use-sidebar-collapsed-CSFUmB9m.js} +1 -1
- package/dist/client/assets/{use-tags-KY-h_MnI.js → use-tags-ZV0RDof-.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-CUhloUfr.js → use-task-board-analytics-4kD6ppwm.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-DNGaq5jj.js → use-task-board-item-prs-Cwh80HEy.js} +1 -1
- package/dist/client/assets/{use-task-board-items-B59GLlEu.js → use-task-board-items-DX_SyoB4.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-C1giWqqF.js → use-task-board-prompts-Cf3d-x7e.js} +1 -1
- package/dist/client/assets/{use-task-metadata-BRvJ0j3n.js → use-task-metadata-L7Sk1FlH.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-Bkey3xVy.js → use-thread-outputs-HnCGzIoZ.js} +1 -1
- package/dist/client/assets/{use-view-draft-kind-B_9utcmK.js → use-view-draft-kind-1niLZJ6g.js} +1 -1
- package/dist/client/assets/{use-voice-input-DlzypJCY.js → use-voice-input-DYwW5R3c.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-C5Fx0PfA.js +1 -0
- package/dist/client/assets/{useQueries-Cviw5w4f.js → useQueries-BNC8S8pQ.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-kmW-ybmd.js +1 -0
- package/dist/client/assets/{users-BA4T3itE.js → users-DeIRsAGC.js} +1 -1
- package/dist/client/assets/{utils-Cj5LhXnA.js → utils-DII4rh9V.js} +1 -1
- package/dist/client/assets/{variant-calendar-DGQ-mjKB.js → variant-calendar-ChRlrtIQ.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-ChpI3nIf.js → variant-matcher-override-DQIPA96S.js} +1 -1
- package/dist/client/assets/{view-header-LXBXxSn6.js → view-header-CDV0Xu_P.js} +1 -1
- package/dist/client/assets/{virtual-mcp-DLUwjTux.js → virtual-mcp-DrcP-MsH.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-Ds--pRle.js → watch-sse-pool-Bw3-M9_N.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +3 -3
- package/package.json +1 -1
- package/dist/client/assets/agent-app-B1jAr8QK.js +0 -1
- package/dist/client/assets/agent-deck-BVwGHwBR.js +0 -1
- package/dist/client/assets/agent-experiments-COyu5Rcl.js +0 -1
- package/dist/client/assets/agent-file-DPDrxE_7.js +0 -1
- package/dist/client/assets/agent-library-file-CU1eOkzE.js +0 -1
- package/dist/client/assets/agent-library-q8_LANcn.js +0 -1
- package/dist/client/assets/agent-overview-BRnB7iWT.js +0 -1
- package/dist/client/assets/agent-settings-Cgvnel34.js +0 -1
- package/dist/client/assets/agent-site-editor-code-BqSvfO76.js +0 -2
- package/dist/client/assets/agent-site-editor-content-_-tYyjOD.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-jH-WOsrh.js +0 -1
- package/dist/client/assets/agent-view-MbD56jPl.js +0 -1
- package/dist/client/assets/api-keys-3eW-YyQD.js +0 -1
- package/dist/client/assets/index-Ddy7VxaQ.js +0 -1
- package/dist/client/assets/library-BJvDSCmL.js +0 -1
- package/dist/client/assets/project-reports-COvDIlvF.js +0 -1
- package/dist/client/assets/project-tasks-CwFPqddm.js +0 -1
- package/dist/client/assets/record-editor-CDN43J2z.js +0 -1
- package/dist/client/assets/reports-Dz649Ru_.js +0 -1
- package/dist/client/assets/repositories-C5371f0z.js +0 -1
- package/dist/client/assets/route-BWi6FubP.js +0 -1
- package/dist/client/assets/settings-tab-zo16wZrm.js +0 -1
- package/dist/client/assets/site-editor-CDmLmfhI.js +0 -1
- package/dist/client/assets/tasks-D4yf2jWh.js +0 -1
- package/dist/client/assets/use-ask-in-chat-ChyvfgT2.js +0 -1
- package/dist/client/assets/use-blocks-v8-project-DcqGx_ow.js +0 -1
- package/dist/client/assets/use-blog-view-D_eJjHyi.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CSP4ZKWe.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BuFOWpb6.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aF as Dt,aG as q,bn as je,bv as _n,dy as Oe,dw as xn,et as we,c as A,i as F,eu as Rn,ev as Tn,q as Z,r as L,ew as Pn,K as g,ex as Y,ey as X,bA as $n,a as Nn,at as De,a4 as jn,bw as It,ez as An,eA as _t,ar as Mn,br as B,ec as xt,eB as Ln,eC as Qn,eD as Un,t as te,j as z}from"./index-Biams685.js";import{C as j,E as T,i as Ae,e as Bn,u as Fn,P as Cn,f as Vn,g as Me,h as Rt,j as Tt}from"./use-sandbox-events-D1U-YJTq.js";import{b as Le}from"./repository-binding-CWTr70tX.js";import{e as Pt}from"./backoff-CrEUbyZT.js";import{b as pe}from"./sandbox-url-D3mC8qhT.js";import{u as Hn}from"./chat-context-oV4F8WQc.js";import{u as Qe}from"./use-blocks-v8-project-DcqGx_ow.js";import{u as $t}from"./use-voice-input-DlzypJCY.js";import{s as ot}from"./session-runtime-OZnQWVyx.js";import{s as Jn}from"./utils-Cj5LhXnA.js";import{a as Wn}from"./sandbox-git-api-BTtQPEAs.js";function Nt(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 ue(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 jt=Dt({endpoint:q().max(2048).refine(e=>Nt(e)&&new URL(e).pathname==="/rpc").transform(ue)});function gr(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=jt.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function At(e){const t=jt.safeParse(e);return t.success?t.data:null}const Mt="studio:deco-serve-last";function vr(e){try{localStorage.setItem(Mt,JSON.stringify(e))}catch{}}function br(){try{const e=localStorage.getItem(Mt);return e?At(JSON.parse(e)):null}catch{return null}}function wr(e){try{return new URL(ue(e)).host}catch{return e}}function Yn(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const Gn="http://localhost:4545/rpc";class Ue extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function zn(e){if(e instanceof Ue)return{reason:"not-deco-serve"};if(!(e instanceof j))return{reason:"not-answering"};switch(e.code){case T.Unauthorized:case T.MethodNotFound:return{reason:"outdated"};case T.Unsupported:return Ae(e)?{reason:"outdated"}:{reason:"version-mismatch"};case T.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 pr(e,t){if(e)return[ue(e.endpoint)];const n=[t?.endpoint,Gn].filter(o=>!!o).map(ue);return[...new Set(n)]}const Xn=Dt({blocks:Oe(q(),Oe(q(),xn()).refine(je)),versions:Oe(q(),q().min(1)),missing:_n(q())});function Zn(e,t){const n=Xn.parse(e),o=Object.keys(n.blocks),s=Object.keys(n.versions),r=[...o,...n.missing],i=new Set(t);if(s.length!==o.length||o.some(a=>!Object.hasOwn(n.versions,a))||r.length!==i.size||new Set(r).size!==r.length||r.some(a=>!i.has(a)))throw new Error("The CMS block response did not account for the requested names");return n}function ne(e,t){const n=e.index?.entries[t];return!!n&&je(e.blocks[t])&&e.versions[t]===n.version}function Kn(e,t,n){const o=new Map;let s=!1;for(const[r,i]of Object.entries(n.blocks)){const a=t.index?.entries[r];if(a){if(n.versions[r]!==a.version){s||=a.version===e.index?.entries[r]?.version;continue}t.blocks[r]!==e.blocks[r]||t.versions[r]!==e.versions[r]||o.set(r,i)}}return s||=n.missing.some(r=>!!t.index?.entries[r]),{blocks:o.size?{...t.blocks,...Object.fromEntries(o)}:t.blocks,versions:o.size?{...t.versions,...Object.fromEntries([...o.keys()].map(r=>[r,n.versions[r]]))}:t.versions,refreshIndex:s}}function qn(e,t,n){return!!e.index&&t.every(o=>e.index?.entries[o]?ne(e,o)&&(!n||n[o]===e.blocks[o]):!n||n[o]===void 0)}const st=50,rt=10;function eo(e,t=n=>fetch(n)){let n=1;return{async batch(o){const s=o.map(()=>n++),r=await t(new Request(e,{method:"POST",headers:{"content-type":"application/json"},credentials:"include",signal:we(),body:JSON.stringify(o.map((l,c)=>({jsonrpc:"2.0",id:s[c],method:l.method,params:l.params??{}})))}));if(!r.ok)throw new j(T.Unavailable,`the hosted CMS answered ${r.status}`);const i=await r.json(),a=new Map((Array.isArray(i)?i:[]).map(l=>[l.id,l]));return s.map(l=>{const c=a.get(l);return c?c.error?{ok:!1,error:j.from(c.error)}:{ok:!0,result:c.result}:{ok:!1,error:new j(T.InternalError,"no response for this call")}})}}}function to(e,t){if(!e)return t??{};const n={};for(const[o,s]of Object.entries(e.entries)){if(t&&Object.hasOwn(t,o)){n[o]=t[o];continue}n[o]={[Tn]:!0,...s.meta?.type?{__resolveType:s.meta.type}:{},...s.meta?.path!==void 0?{path:s.meta.path}:{},...s.meta?.refs?.length?{[Rn]:s.meta.refs}:{}}}for(const[o,s]of Object.entries(t??{}))Object.hasOwn(n,o)||(n[o]=s);return n}function no(e,t){return e?.entries[t]?.meta?.refs??[]}function oo(e,t){return Object.hasOwn(e.draft,t)?e.draft[t]?.version??null:null}function Be(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Ie(e,t){if(Array.isArray(e)){for(const n of e)Ie(n,t);return}if(Be(e))for(const[n,o]of Object.entries(e))n==="__resolveType"&&typeof o=="string"?t.add(o):Ie(o,t)}function Lt(e,t){if(!Be(e))return;const n={};typeof e.__resolveType=="string"&&(n.type=e.__resolveType),typeof e.path=="string"&&(n.path=e.path);const o=new Set;Ie(e,o);const s=[...o].filter(r=>t.has(r)).sort();return s.length>0&&(n.refs=s),Object.keys(n).length>0?n:void 0}function Qt(e,t,n,o){Y(e),e.setQueryData(g.contentIndex(t),s=>{if(!s)return s;const r={...s.entries},i={...s.draft},a=new Set([...Object.keys(r),...Object.keys(o)]);for(const[l,c]of Object.entries(n)){const f=i[l]?.editor??null;if(c===null||c===X){delete r[l],i[l]={operation:"delete",version:X,editor:f};continue}const h=Lt(o[l],a);r[l]={version:c,...h?{meta:h}:{}},i[l]={operation:"set",version:c,editor:f}}return{...s,entries:r,draft:i}})}function so(e,t,n,o){e.setQueryData(g.contentIndex(t),s=>{if(!s)return s;const r={...s.draft},i={...s.entries};if(o===null)delete r[n];else if(r[n]={operation:o.block===null?"delete":"set",version:o.version,editor:r[n]?.editor??null},o.block===null)delete i[n];else{const a=new Set([...Object.keys(i),n]),l=Lt(o.block,a);i[n]={version:o.version,...l?{meta:l}:{}}}return{...s,entries:i,draft:r}})}const it=new WeakMap;async function Fe(e,t,n,o,s=new Set){const r=e.getQueryData(g.contentIndex(n));if(!r)throw new j(T.Unavailable,"The CMS index is not loaded yet");let i=it.get(e);i||(i=new Map,it.set(e,i));const a=e.getQueryData(g.decofile(n))??{},l=e.getQueryData(g.contentVersions(n))??{},c=[],f=[];for(const u of new Set(o)){const d=r.entries[u];if(!d||s.has(u)||je(a[u])&&l[u]===d.version)continue;const v=i.get(`${n}\0${u}`);v?c.push(v):f.push(u)}if(f.length>0){const u=io(e,t,n,f);for(const d of f){const v=`${n}\0${d}`;i.set(v,u),u.catch(()=>{}).finally(()=>{i.get(v)===u&&i.delete(v)})}c.push(u)}await Promise.all(c);const h=fe(e,n);if(o.some(u=>h.index?.entries[u]&&!s.has(u)&&!ne(h,u)))throw new j(T.Unavailable,"A CMS block changed while loading; try again")}async function ro(e,t,n,o,s){if(!t){const i=o?.[s];return Be(i)&&!$n(i)?i:void 0}await Fe(e,t,n,[s]);const r=fe(e,n);return r.index?.entries[s]&&ne(r,s)?r.blocks[s]:void 0}function fe(e,t){return{index:e.getQueryData(g.contentIndex(t)),blocks:e.getQueryData(g.decofile(t))??{},versions:e.getQueryData(g.contentVersions(t))??{}}}async function io(e,t,n,o){const s=fe(e,n),r=[];for(let i=0;i<o.length;i+=st)r.push(o.slice(i,i+st));for(let i=0;i<r.length;i+=rt){const a=r.slice(i,i+rt),l=await t.batch(a.map(c=>({method:"cms.blocks",params:{names:c}})));if(l.length!==a.length)throw new j(T.InternalError,"Incomplete CMS batch response");for(const[c,f]of l.entries()){if(!f.ok)throw f.error;const h=Zn(f.result,a[c]),u=fe(e,n),d=Kn(s,u,h);if(Y(e),d.blocks!==u.blocks&&e.setQueryData(g.decofile(n),d.blocks),d.versions!==u.versions&&e.setQueryData(g.contentVersions(n),d.versions),d.refreshIndex)throw e.invalidateQueries({queryKey:g.decofile(n),exact:!0},{cancelRefetch:!1}),new j(T.Unavailable,"The CMS index changed while loading blocks; try again")}}}function Ce(e){const t=A.c(4);let n;t[0]!==e?(n=g.contentIndex(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:ao,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:s}=F(o);return s}async function ao(){throw new Error("the content index is set by the poll")}function at(e,t){const n=A.c(8);let o;n[0]!==t?(o=Pn(t),n[0]=t,n[1]=o):o=n[1];const s=o;let r;n[2]!==e||n[3]!==s?(r=a=>e.getQueryCache().subscribe(l=>{l.query.queryHash===s&&a()}),n[2]=e,n[3]=s,n[4]=r):r=n[4];let i;return n[5]!==e||n[6]!==t?(i=()=>e.getQueryData(t),n[5]=e,n[6]=t,n[7]=i):i=n[7],L.useSyncExternalStore(r,i)}const ct=3e4;function co(e){if(!(e instanceof j))return;const t=e.data?.retryAfterMs;return typeof t=="number"&&t>0?t:void 0}function lo(e,t,n,o){const s=A.c(15),r=Z(),i=Ce(t);let a;s[0]!==t?(a=g.decofile(t),s[0]=t,s[1]=a):a=s[1];const l=at(r,a);let c;s[2]!==t?(c=g.contentVersions(t),s[2]=t,s[3]=c):c=s[3];const f=at(r,c),h=o?.withRefs??!1,u=new Set(n);if(h)for(const p of n)for(const k of no(i,p))u.add(k);const d=[...u].filter(p=>!!i?.entries[p]).sort(),v={index:i,blocks:l??{},versions:f??{}},b=d.some(p=>!ne(v,p)),w=JSON.stringify(d.map(p=>[p,i?.entries[p]?.version,ne(v,p)])),[_,S]=L.useState(null),[$,E]=L.useState(0),D=_?.key===w?_:null;L.useEffect(()=>{if(!e||!w)return;let p=!0;const k=JSON.parse(w).map(ho);return Fe(r,e,t,k).then(()=>{p&&S(P=>P?.key===w?null:P)},P=>{p&&S(Q=>({key:w,count:(Q?.key===w?Q.count:0)+1,retryAfterMs:co(P)}))}),()=>{p=!1}},[e,r,t,w,$]);let I;s[4]!==D||s[5]!==E?(I=()=>{if(!D)return;const p=Math.min(ct,D.retryAfterMs??Pt(ct,1e3,D.count-1,2,.5)),k=setTimeout(()=>E(fo),p);return()=>clearTimeout(k)},s[4]=D,s[5]=E,s[6]=I):I=s[6];let m;s[7]!==D?(m=[D],s[7]=D,s[8]=m):m=s[8],L.useEffect(I,m);const y=!e||qn(v,[...u],o?.listing),O=!!e&&b&&D!==null;let x;s[9]!==E?(x=()=>E(uo),s[9]=E,s[10]=x):x=s[10];let N;return s[11]!==y||s[12]!==O||s[13]!==x?(N={ready:y,failed:O,retry:x},s[11]=y,s[12]=O,s[13]=x,s[14]=N):N=s[14],N}function uo(e){return e+1}function fo(e){return e+1}function ho(e){const[t]=e;return t}const Ut=L.createContext(null);function go(e){const t=A.c(24),n=L.useContext(Ut),o=Qe(n?null:e),{data:s}=Nn.useSession(),r=s?.user?.id??"",i=!!e&&!!r;let a;t[0]!==i||t[1]!==r||t[2]!==e?(a=i?De.decoServeConnection(r,e):null,t[0]=i,t[1]=r,t[2]=e,t[3]=a):a=t[3];const[l,c]=ut(a);let f;t[4]!==i||t[5]!==r||t[6]!==e?(f=i?De.decoServeEndpoint(r,e):null,t[4]=i,t[5]=r,t[6]=e,t[7]=f):f=t[7];const[h,u]=ut(f);if(n)return n;let d;t[8]!==l||t[9]!==i||t[10]!==o?(d=i&&o?At(l):null,t[8]=l,t[9]=i,t[10]=o,t[11]=d):d=t[11];const v=d,b=i&&o&&typeof h=="string"?h:null;let w;t[12]!==u||t[13]!==c||t[14]!==i?(w=$=>{i&&(c($),u($.endpoint))},t[12]=u,t[13]=c,t[14]=i,t[15]=w):w=t[15];let _;t[16]!==c||t[17]!==i?(_=()=>{i&&c(null)},t[16]=c,t[17]=i,t[18]=_):_=t[18];let S;return t[19]!==v||t[20]!==b||t[21]!==w||t[22]!==_?(S={connection:v,lastEndpoint:b,set:w,clear:_},t[19]=v,t[20]=b,t[21]=w,t[22]=_,t[23]=S):S=t[23],S}function lt(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function ut(e){const t=A.c(17),n=Z(),o=e??"";let s;t[0]!==o?(s=["localStorage",o],t[0]=o,t[1]=s):s=t[1];const r=s;let i,a;t[2]!==e?(i=()=>e?lt(e):null,a=()=>e?lt(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const l=!!e;let c;t[5]!==r||t[6]!==i||t[7]!==a||t[8]!==l?(c={queryKey:r,queryFn:i,initialData:a,enabled:l,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=r,t[6]=i,t[7]=a,t[8]=l,t[9]=c):c=t[9];const{data:f}=F(c);let h;t[10]!==e||t[11]!==n||t[12]!==r?(h=b=>{if(e){try{b===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(b))}catch{}n.setQueryData(r,b)}},t[10]=e,t[11]=n,t[12]=r,t[13]=h):h=t[13];const u=h,d=e?f??null:null;let v;return t[14]!==u||t[15]!==d?(v=[d,u],t[14]=u,t[15]=d,t[16]=v):v=t[16],v}function Bt(e,t=""){return{source:e,cacheKeySuffix:e==="github"?"":e==="sandbox"?":sandbox":`:serve:${t}`}}function vo(e){return JSON.stringify([e.kind==="legacy"?"legacy":"protocol",e.source,e.cacheKeySuffix])}function mr(e){return e.kind==="protocol"||e.kind==="unavailable"}function Sr(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n===null||n==="legacy"?t:!0}function yr(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 kr(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&Nt(t)?t:null}function Or(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function Ft(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function bo(e){if(!e.hasProject)return"legacy";const t=Ft(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 wo(e){return{github:e.v8&&e.mode==="github",sandbox:e.v8&&e.mode==="sandbox"&&e.workingTreeReady}}function ft(e){return e.isError||e.errorUpdateCount>0}function po(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const s of n)Object.hasOwn(t,s)?o[s]=t[s]:delete o[s];return o}function mo(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 Ct="__noSchema";function Vt(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[Ct]:!0}}function Er(e){return!!e&&e[Ct]===!0}function Ve(e){if(!e.ok)return e.error.code===T.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function So(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const yo=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function Dr(e){const t=new Map;for(const[n,o]of Object.entries(e)){const s=o&&typeof o=="object"&&!Array.isArray(o)?o:{},r=typeof s.__resolveType=="string"?s.__resolveType:null,i=t.get(r)??[];i.push({key:n,label:So(n,s)}),t.set(r,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(yo)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:dt(n.resolveType).localeCompare(dt(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function dt(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function ht(e,t,n){if(t.length===0)return n;const[o,...s]=t;if(Array.isArray(e)&&typeof o=="number"){const r=e.slice();return r[o]=ht(e[o],s,n),r}if(e&&typeof e=="object"&&typeof o=="string"){const r=e,i={};for(const a of Object.keys(r))i[a]=a===o?ht(r[a],s,n):r[a];return i}return e}function Ir(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class gt extends Error{}const He="site-not-owned";async function ko(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function Oo(e,t=n=>fetch(n)){const n=Me({endpoint:e,fetch:async o=>{const s=await t(new Request(o,{signal:we(o.signal)}));if(await ko(s))throw new gt;return s}});try{return await We(n)}catch(o){if(o instanceof gt)return He;throw o}}async function Eo(e,t,n){await t();const o=await Oo(e,n);return o===He?o:{...o,hosted:eo(e,n)}}const Je=5e3;function Do(e){if(!e.site)throw new Error("this project names no site");return An(e.site,e.branch)}function Io(e){return new URL(pe(e,"rpc"),window.location.origin).href}async function We(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!==Cn)throw new Ue;const s=Vn(t.result);if(!n)throw new Error("no schema.get");if(Ve(n))return{client:e,describe:s,hasSchema:!1};if(n.ok)return{client:e,describe:s,hasSchema:!0};throw n.error}function _o(e,t=n=>fetch(n)){return We(Me({endpoint:e,fetch:n=>t(new Request(n,{signal:we(n.signal)}))}))}function se(e,t){const n=A.c(40),{org:o}=jn(),{connection:s}=go(e),{runtime:r}=$t(e),i=L.useContext(Ut),a=Qe(e),l=It(Le(e)?.metadata),c=Ft({hasServeConnection:!!s,runtime:r}),f=Bt(c,s?.endpoint??""),h=Hn()?.taskId??null,u=Bn(Fn().lifecycle.phase),d=Z(),v=wo({mode:c,v8:a,workingTreeReady:u}),b=v.github&&!!o.slug&&!!e&&!!t,w=F({queryKey:g.contentBackend(o.slug,e??"",t??"","github"),queryFn:()=>Eo(Do({orgSlug:o.slug,site:l,branch:t}),()=>_t(l,t)),enabled:b,staleTime:Number.POSITIVE_INFINITY,...vt}),_=v.sandbox&&!!o.slug&&!!e&&!!t;let S;n[0]!==t||n[1]!==o.slug||n[2]!==h||n[3]!==e?(S=()=>_o(Io({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:h})),n[0]=t,n[1]=o.slug,n[2]=h,n[3]=e,n[4]=S):S=n[4];const $=F({queryKey:g.contentBackend(o.slug,e??"",t??"","sandbox",h??""),queryFn:S,enabled:_,staleTime:Number.POSITIVE_INFINITY,...vt}),E=!!s;let D;n[5]!==s?.endpoint||n[6]!==o.slug||n[7]!==e?(D=g.contentBackend(o.slug,e??"","local",s?.endpoint??""),n[5]=s?.endpoint,n[6]=o.slug,n[7]=e,n[8]=D):D=n[8];let I;n[9]!==s?(I=()=>jo(s.endpoint),n[9]=s,n[10]=I):I=n[10];let m;n[11]!==E||n[12]!==D||n[13]!==I?(m={queryKey:D,queryFn:I,enabled:E,staleTime:Number.POSITIVE_INFINITY,retry:To,retryDelay:Ro,refetchInterval:xo},n[11]=E,n[12]=D,n[13]=I,n[14]=m):m=n[14];const y=F(m);let O;n[15]!==s?.endpoint||n[16]!==o.slug||n[17]!==e?(O=g.contentBackend(o.slug,e??"","local",s?.endpoint??""),n[15]=s?.endpoint,n[16]=o.slug,n[17]=e,n[18]=O):O=n[18];const x=O;let N;n[19]!==s?.endpoint||n[20]!==o.slug||n[21]!==e?(N=g.contentBackend(o.slug,e??"","local-describe",s?.endpoint??""),n[19]=s?.endpoint,n[20]=o.slug,n[21]=e,n[22]=N):N=n[22];let p;n[23]!==y.data||n[24]!==x||n[25]!==d?(p=async()=>{try{return await y.data.client.describe()}catch(K){const In=K;throw d.invalidateQueries({queryKey:x,exact:!0},{cancelRefetch:!1}),In}},n[23]=y.data,n[24]=x,n[25]=d,n[26]=p):p=n[26];const k=!!y.data&&!i;let P;n[27]!==N||n[28]!==p||n[29]!==k?(P={queryKey:N,queryFn:p,enabled:k,refetchInterval:Je,retry:!1},n[27]=N,n[28]=p,n[29]=k,n[30]=P):P=n[30];const M=F(P).data??y.data?.describe,U=bo({hasProject:!!e,hasServeConnection:!!s,runtime:r,v8:a,githubSite:w.data===He?"not-owned":w.data?"ready":ft(w)?"error":"loading",sandboxSite:Po({data:$.data,isError:ft($),workingTreeReady:u})});if(U==="pending")return{kind:"pending",...f};if(U==="retrying-sandbox")return{kind:"pending",retrying:"sandbox",...f};if(U==="legacy")return{kind:"legacy"};if(U==="protocol-github")return{..._e(f,w.data),site:l};if(U==="site-not-owned-github")return{kind:"unavailable",...f,siteNotOwned:!0};if(U==="protocol-sandbox")return _e(f,$.data);if(U==="unavailable-github"){let K;return n[31]!==f?(K={kind:"unavailable",...f},n[31]=f,n[32]=K):K=n[32],K}const R=y.error??y.failureReason,H=s?.endpoint??"";let J;return n[33]!==M||n[34]!==y.data||n[35]!==y.failureCount||n[36]!==y.isError||n[37]!==H||n[38]!==R?(J=No({probed:y.data,isError:y.isError,failureCount:y.failureCount,failure:R,describe:M,endpoint:H}),n[33]=M,n[34]=y.data,n[35]=y.failureCount,n[36]=y.isError,n[37]=H,n[38]=R,n[39]=J):J=n[39],J}function xo(e){return e.state.status==="error"||e.state.data?.hasSchema===!1?Je:!1}function Ro(e){return Yn(e+1)}function To(e,t){return!(t instanceof j)&&!(t instanceof Ue)}function Po(e){return e.data!==void 0?"ready":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const $o=3;function No(e){const t=Bt("local",e.endpoint),n=e.probed?_e(t,{...e.probed,describe:e.describe??e.probed.describe}):null;return e.isError||e.failureCount>0?n?.kind==="protocol"&&!e.isError&&e.failureCount<$o?n:{kind:"unavailable",...t,problem:zn(e.failure)}:n??{kind:"pending",...t}}const vt={retry:2,refetchInterval:e=>e.state.status==="error"?Je:!1};function _e(e,t){return{kind:"protocol",...e,client:t.client,describe:t.describe,hasSchema:t.hasSchema,...t.hosted?{hosted:t.hosted}:{}}}function jo(e,t){return We(Me({endpoint:e,fetch:n=>fetch(n,{signal:we(t?AbortSignal.any([t,n.signal]):n.signal)})}))}function xe(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function Ao(e,t){return xe({...e,protocolSuffix:t.cacheKeySuffix})}function Mo(e,t,n){return e?t==="pending"?{ready:!1,failed:!1}:t==="unavailable"?{ready:!1,failed:!0}:n:{ready:!0,failed:!1}}function Lo(e,t){return JSON.stringify([e?.orgSlug,e?.virtualMcpId,e?.branch,vo(t)])}function Qo(e,t,n){const o=A.c(21),s=Z(),r=se(e?.virtualMcpId,e?.branch),i=e&&r.kind==="protocol"&&r.hosted?r:null;let a;o[0]!==i||o[1]!==e?(a=i&&e?Ao(e,i):"",o[0]=i,o[1]=e,o[2]=a):a=o[2];const l=lo(i?.hosted,a,t,n),c=e!==null;let f;o[3]!==r.kind||o[4]!==l||o[5]!==c?(f=Mo(c,r.kind,l),o[3]=r.kind,o[4]=l,o[5]=c,o[6]=f):f=o[6];const h=f,u=r.kind!=="legacy";let d;o[7]!==r||o[8]!==e?(d=Lo(e,r),o[7]=r,o[8]=e,o[9]=d):d=o[9];let v;o[10]!==r.kind||o[11]!==r.source||o[12]!==l||o[13]!==s||o[14]!==e?(v=()=>{if(l.retry(),!e||r.kind!=="unavailable")return;const w=r.source;s.resetQueries({queryKey:g.contentBackend(e.orgSlug,e.virtualMcpId,...w==="local"?["local"]:[e.branch,w])})},o[10]=r.kind,o[11]=r.source,o[12]=l,o[13]=s,o[14]=e,o[15]=v):v=o[15];let b;return o[16]!==h||o[17]!==u||o[18]!==d||o[19]!==v?(b={...h,v8:u,scopeKey:d,retry:v},o[16]=h,o[17]=u,o[18]=d,o[19]=v,o[20]=b):b=o[20],b}function Ht(e){const t=A.c(12);let n;t[0]!==e?(n=De.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[s,r]=Mn(o,null),i=Qe(e);let a;t[2]!==s||t[3]!==e?(a=e?ot(s):null,t[2]=s,t[3]=e,t[4]=a):a=t[4];const c=i?null:a;let f,h;t[5]!==r?(f=d=>r(ot(d)),h=()=>r(null),t[5]=r,t[6]=f,t[7]=h):(f=t[6],h=t[7]);let u;return t[8]!==c||t[9]!==f||t[10]!==h?(u={url:c,setUrl:f,clear:h},t[8]=c,t[9]=f,t[10]=h,t[11]=u):u=t[11],u}const bt=6e4,Uo=2147483647;function Bo(e,t){if(e===null||e.trim()==="")return bt;const n=e.trim(),o=/^\d+(?:\.\d+)?$/.test(n)?Number(n)*1e3:/^[A-Za-z]{3}, /.test(n)?Math.max(0,Date.parse(n)-t):Number.NaN;return Number.isFinite(o)&&o>=0&&o<=Uo?o:bt}class Jt extends Error{constructor(t,n,o,s=Date.now()){super(t),this.status=n,this.name="ContentResponseError",this.retryAt=n===429?s+Bo(o,s):null}status;retryAt}function Fo(e,t,n=Date.now()){const o=Pt(5e3,1e3,e,2,0);return t instanceof Jt&&t.retryAt!==null?Math.max(o,t.retryAt-n):o}async function Ye(e,t){const n=await e.json().catch(()=>null),o=n!==null&&typeof n=="object"&&"error"in n&&typeof n.error=="string"?n.error:`${t} failed (${e.status})`;throw new Jt(o,e.status,e.headers.get("retry-after"))}function Co(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function wt(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}function me(e,t,n){return["decofile-write",e,t,n]}function Vo(e,t,n){return{id:me(e,t,n).join(":")}}class Ge extends Error{constructor(t,n,o=[],s=!1){super(n),this.blocks=t,this.fields=o,this.carriedStored=s,this.name="BlockConflictError"}blocks;fields;carriedStored}function ze(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function Xe(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function Ho(e,t){return Ye(e,t)}function Jo(e,t,n){e.setQueryData(g.decofileDraft(ze(t)),n)}function Wo(e,t){return e.getQueryData(g.decofileDraft(ze(t)))??null}async function Yo(e,t){return(await fetch(Xe(e),{cache:"no-store",headers:{"if-none-match":`"${t}"`}}).catch(()=>null))?.status===200}function _r(e){const t=A.c(4);let n;t[0]!==e?(n=g.decofileDraft(e?ze(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Go,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:s}=F(o);return s??null}async function Go(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function zo(e,t){const n=await fetch(Xe(t),{cache:"no-store"});if(!n.ok)return Ye(n,"Read decofile");const o=await n.json();return o.token&&Jo(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function xr(e,t){const n=await fetch(Xe(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const s=await n.json().catch(()=>({}));throw s.code==="block-conflict"?new Ge(s.blocks??[],s.error??"Block changed"):new Error(s.error??`Save failed (${n.status})`)}if(!n.ok)return Ho(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const Wt=3e3,Xo=15e3,Zo=2*6e4,Yt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function Ko(e){return e<Zo?Wt:Xo}function qo(e,t=Yt){const n=t.now();let o=!1,s=!1,r=null;const i=()=>{o||(r=t.setTimeout(a,Ko(t.now()-n)))},a=()=>{if(r=null,o)return;const{read:l,skip:c}=e();if(s||t.hidden()||c?.()){i();return}s=!0;let f;try{f=l()}catch{f=void 0}Promise.resolve(f).catch(()=>{}).finally(()=>{s=!1}),i()};return i(),()=>{o=!0,r!==null&&t.clearTimeout(r)}}const pt=()=>0;function es(e,t,n=Yt){const o=L.useRef(t);o.current=t;const[s]=L.useState(()=>({polling:()=>qo(()=>o.current,n),idle:()=>()=>{}}));L.useSyncExternalStore(e?s.polling:s.idle,pt,pt)}function Gt(e,t){return pe(e,t)}function ts(e,t){return pe(e,"preview-fetch",{path:t})}function Rr(e){return Gt(e,"preview-invoke")}function Tr(e){return Gt(e,"catalog-invoke")}function zt(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 ns(){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&&zt(n))return n}return null}function os(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??ns();return n&&zt(n)?new URL(t,n).toString():ts(e,t)}function ss(e){return os(e,"/.decofile")}function rs(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function mt(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function is(e,t){const n=pe(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),s=rs(o.status);if(s==="absent")return{kind:"absent"};if(s==="unavailable")return{kind:"unavailable"};if(s==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const r=await o.json();return typeof r.content!="string"?{kind:"unavailable"}:{kind:"data",data:Jn(r.content)}}async function as(e,t){const n=await is(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function Pr(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)return Ye(n,"Read committed meta");try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function cs(e){return Le(e)?.metadata?.runtime?.path??null}function Re(e,t,n,o){const s=B(e),r=Object.keys(n?.changes??{}).find(a=>B(a)===s);if(r!==void 0&&n)return n.changes[r].baseVersion;const i=Object.keys(t?.draft??{}).some(a=>B(a)===s);if(t&&!i){const a=Object.keys(t.entries).find(l=>B(l)===s);return a===void 0?null:t.entries[a].version}return o?.[e]??null}class Xt extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function $r(e){return e instanceof j&&e.code===T.Conflict}function Zt(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 Ke extends Error{constructor(){super("The blocks kept changing while the change was saved"),this.name="HostedKeptChangingError"}}function Nr(e,t){return(t instanceof Ze||t instanceof Ke)&&(t.message=Kt(e,t,"github")),t}function Kt(e,t,n){if(t instanceof Ze)return e("siteEditor.save.draftUnread");if(t instanceof Ke)return e("siteEditor.save.keptChanging");if(t instanceof Ge)return t.message;if(n==="local")return us(e,t);if(t instanceof j)switch(t.code){case T.Conflict:return e("siteEditor.save.conflict");case T.ReadOnly:return e("siteEditor.save.readOnly");case T.InvalidBlock:case T.InvalidParams:return e("siteEditor.save.invalid");case T.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function ls(e,t){if(t==="local"||e instanceof Ge||e instanceof Ze||e instanceof Ke)return null;if(e instanceof j){const n=e.code===T.InvalidBlock||e.code===T.InvalidParams?Zt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function us(e,t){if(t instanceof Xt)return e("decoServe.save.serverGone");if(t instanceof j)switch(t.code){case T.Conflict:return e("decoServe.save.conflict");case T.ReadOnly:return e("decoServe.save.readOnly");case T.InvalidBlock:case T.InvalidParams:return e("decoServe.save.invalid",{detail:Zt(t)});case T.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function fs(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function ds(e,t){const[n,o]=L.useState(e),s=L.useRef(null);return e&&!n&&o(!0),L.useEffect(()=>{if(e){s.current??=Date.now();return}if(!n)return;const r=()=>{s.current=null,o(!1)},i=fs(s.current,Date.now(),t);if(i===0){r();return}const a=setTimeout(r,i);return()=>clearTimeout(a)},[e,n,t]),n}const hs="decocms:content-writes",Te=new Set;let G;function qt(){if(G!==void 0)return G;G=null;try{typeof BroadcastChannel=="function"&&(G=new BroadcastChannel(hs),G.addEventListener("message",e=>{const t=e.data?.cacheKey;if(typeof t=="string")for(const n of[...Te])n(t)}))}catch{G=null}return G}function gs(e){try{qt()?.postMessage({cacheKey:e})}catch{}}function vs(e){return qt(),Te.add(e),()=>{Te.delete(e)}}const en="__at=",tn="__test=",bs=/^[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 ws(e){return e.at!==void 0||Object.keys(e.tests??{}).length>0}function ee(e){return typeof e=="string"&&bs.test(e)}function St(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function ps(e){const t=e.tests??{};return[...e.at!==void 0?[en+St(e.at)]:[],...Object.keys(t).map(n=>tn+St(`${n}=${t[n]?"on":"off"}`))]}function yt(e,t){const o=[...e.split("&").filter(s=>s&&!s.startsWith(en)&&!s.startsWith(tn)),...t];return o.length>0?`?${o.join("&")}`:""}function de(e,t){const n=ps(t),o=e.indexOf("?"),s=o===-1?e:e.slice(0,o);if(ee(s))return s+yt(o===-1?"":e.slice(o+1),n);const r=e.lastIndexOf("@");if(r<=0)return e;const i=e.slice(0,r),a=i.indexOf("?"),l=a===-1?i:i.slice(0,a),c=a===-1?"":i.slice(a+1);return`${l}${yt(c,n)}${e.slice(r)}`}function jr(e,t,n){if(!ws(t))return e;try{const o=new URL(e),s=o.searchParams.get("__draft");return s&&s!=="off"?(o.searchParams.set("__draft",de(s,t)),o.toString()):ee(n)?(o.searchParams.set("__draft",de(n,t)),o.toString()):e}catch{return e}}function Ar(e,t,n="/"){if(!e||!ee(t))return null;try{const o=new URL(n,e);return o.searchParams.set("__draft",t),o.toString()}catch{return null}}function nn(e){return btoa(encodeURIComponent(e))}function Mr(e,t,n){const o=ms(e,t,n);return o.searchParams.set("__cb",crypto.randomUUID()),o.toString()}function ms(e,t,n){const o=new URL(e).origin,s=new URL(`/live/previews/${encodeURIComponent(t)}`,o);return s.searchParams.set("path","/"),s.searchParams.set("pathTemplate","/"),s.searchParams.set("props",nn(JSON.stringify({path:"/",sections:[{__resolveType:n}]}))),s}const Ss="__draft";function Lr(e){return`${`${e.apiHost}/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}?token=${e.token}`}@${e.version}`}const ys="off";function ks(e,t){if(!t)return e;const n=new URL(e);return n.searchParams.set(Ss,t),n.toString()}function Qr(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:s,...r}=e.pageBlock,i=JSON.stringify({__props:r,__decofile:e.decofile});return{src:o.toString(),body:i}}function Ur(e,t,n,o){const s=new URL(e).origin,r=new URL(`/live/previews/${encodeURIComponent(t)}`,s);r.searchParams.set("__d","");const i=[{__resolveType:"preview",block:n}];return o&&i.push(o),r.searchParams.set("props",nn(JSON.stringify({sections:i}))),r.toString()}function Br(e){return e.fastPreviewActive&&e.previewServerUrl?e.previewServerUrl:e.sandboxUrl??null}const kt="__variant=";function on(e,t,n){return`${e}@${t}=${n}`}function Fr(e,t){return!e||!t.multivariate||t.variants.length<=1?[]:t.index<0||t.index>=t.variants.length?[]:[on(e,"sections",t.index)]}function Cr(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[on(e.pageKey,o,e.selectedVariantIndex)]}function Vr(e,t){return[...t,...e]}function Os(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function qe(e,t){const n=e.lastIndexOf("@");if(n<=0)return e;const o=e.slice(0,n),s=o.indexOf("?"),r=s===-1?o:o.slice(0,s),a=[...s===-1?[]:o.slice(s+1).split("&").filter(c=>c&&!c.startsWith(kt)),...t.map(c=>kt+Os(c))],l=a.length>0?`?${a.join("&")}`:"";return`${r}${l}${e.slice(n)}`}function Hr(e,t,n=!1){if(t.length===0&&!n)return null;try{const o=new URL(e),s=o.hostname==="[::1]"?`localhost${o.port?`:${o.port}`:""}`:o.host;return qe(`${s}${o.pathname}@local`,t)}catch{return null}}function Jr(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",qe(o,t)),n.toString())}catch{return e}}function Es(e){const{pointer:t}=e;if(!t||t===ys)return null;const n=t.indexOf("?");return ee(n===-1?t:t.slice(0,n))||t.lastIndexOf("@")<=0?null:ee(e.heldRevision)&&e.forcedVariants.length===0?de(e.heldRevision,e.previewOptions):de(qe(t,e.forcedVariants),e.previewOptions)}function Ds(e,t){if(!e||!t)return null;try{return ks(e,t)}catch{return null}}function Wr(e,t,n){if(!e||!n)return null;try{return Ds(new URL(t,e).toString(),n)}catch{return null}}const he={forcedVariants:[],previewOptions:{}},ie=new Map,ae=new Map,Pe=new Map;function sn(e){for(const t of Pe.get(e)??[])t()}function rn(e,t){const n=ee(t)?t:null;(ae.get(e)??null)!==n&&(n?ae.set(e,n):ae.delete(e),sn(e))}function Is(e){return ae.get(e)??null}function _s(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Yr(e,t){const n=ie.get(e)??he,o=t??he;_s(n,o)||(t?ie.set(e,o):ie.delete(e),sn(e))}function xs(e){return ie.get(e)??he}function an(e,t){let n=Pe.get(e);return n||(n=new Set,Pe.set(e,n)),n.add(t),()=>{n.delete(t)}}function Rs(e){const t=A.c(3);let n,o;return t[0]!==e?(n=s=>an(e,s),o=()=>xs(e),t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,Ts)}function Ts(){return he}function Ps(e){const t=A.c(3);let n,o;return t[0]!==e?(n=s=>e?an(e,s):Ns,o=()=>e?Is(e):null,t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,$s)}function $s(){return null}function Ns(){}function Gr(e,t){const n=A.c(4),o=Rs(e),s=Ps(e);let r;return n[0]!==o||n[1]!==s||n[2]!==t?(r=Es({pointer:t,heldRevision:s,...o}),n[0]=o,n[1]=s,n[2]=t,n[3]=r):r=n[3],r}const cn={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},js=15e3,ge=new Map;function W(e,t){return`${e}/${t}`}function V(e){let t=ge.get(e);return t||(t={state:cn,listeners:new Set,previews:0,timer:null,discardListeners:new Set},ge.set(e,t)),t}function C(e,t){const n=V(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 ve(e){return ge.get(e)?.state??cn}function As(e,t){const n=V(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function zr(e){const t=V(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(Se(t),C(e,{phase:"idle"}))}}function Xr(e){const t=ge.get(e);!t||t.state.phase!=="reloading"||(Se(t),C(e,{phase:"idle"}))}function ln(e){const t=V(e);Se(t),C(e,{phase:"saving",inFlight:t.state.inFlight+1})}function ce(e,t){const n=V(e),o=Math.max(0,n.state.inFlight-1);if(o>0){C(e,{inFlight:o});return}if(!t.ok||n.previews===0){C(e,{phase:"idle",inFlight:o});return}un(e,t.navigates,o)}function un(e,t,n=0){const o=V(e);Se(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&C(e,{phase:"idle"})},js),C(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function Ms(e){return e?.kind==="protocol"&&e.source==="github"}async function le(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:s,branch:r,backend:i,cacheKey:a}=e,l=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:g.hostedReleases(o,s)}):null;if(i?.kind!=="protocol"){const v=a&&t.reread?n.invalidateQueries({queryKey:g.decofile(a)}):null;if(await Promise.all([l,v]),v&&t.kind!=="edit"){const b=W(o,s);C(b,{epoch:ve(b).epoch+1})}return{navigates:!1}}const c=r?g.protocolDraftRead(o,s,r):null,f=c?JSON.stringify(n.getQueryData(c)??null):null,h=l?[l]:[];if(a&&t.reread&&h.push(n.invalidateQueries({queryKey:g.decofile(a)})),a&&!t.adopted&&h.push(n.invalidateQueries({queryKey:g.contentChanges(a)})),r&&i.source==="sandbox"&&h.push(n.invalidateQueries({queryKey:Wn(o,s,r)})),Ms(i)&&c&&!t.adopted&&h.push(n.invalidateQueries({queryKey:c})),await Promise.all(h),t.kind!=="edit"){const v=W(o,s);C(v,{epoch:ve(v).epoch+1})}const u=c?JSON.stringify(n.getQueryData(c)??null):null,d=f!==u;return d&&await new Promise(v=>xt.schedule(v)),{navigates:d}}async function Ls(e,t){return ln(W(e.orgSlug,e.virtualMcpId)),fn(e,t)}function Ot(e){return e.branch?JSON.stringify(e.queryClient.getQueryData(g.protocolDraftRead(e.orgSlug,e.virtualMcpId,e.branch))??null):null}async function fn(e,t){const n=W(e.orgSlug,e.virtualMcpId),o=t.adopted?Ot(e):null;let s;try{s=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&&gs(e.cacheKey),rn(n,t.shownRevision?.(s)??null),t.adopted){const i=Ot(e)!==o;return i&&await new Promise(a=>xt.schedule(a)),ce(n,{ok:!0,navigates:i}),t.reread&&le(e,t).catch(()=>{}),s}let r=!1;try{({navigates:r}=await le(e,t))}catch{}finally{ce(n,{ok:!0,navigates:r})}return s}function Zr(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:s,branch:r}=e,i=W(o,s),a=new Set(t.blockKeys);for(const f of[...V(i).discardListeners])f(a);ln(i);let l=!1;const c=()=>(l=!0,fn(e,{kind:"discard",reread:!0,write:t.write}));return r?n.getMutationCache().build(n,{mutationKey:me(o,s,r),scope:Vo(o,s,r),mutationFn:c}).execute(void 0).catch(f=>{throw l||ce(i,{ok:!1,navigates:!1}),f}):c()}function Kr(e,t,n){const o=A.c(8);let s;o[0]!==e||o[1]!==t?(s=W(e,t),o[0]=e,o[1]=t,o[2]=s):s=o[2];const r=s;let i;o[3]!==n||o[4]!==r?(i=()=>{const l=V(r).discardListeners;return l.add(n),()=>{l.delete(n)}},o[3]=n,o[4]=r,o[5]=i):i=o[5];let a;o[6]!==r?(a=[r],o[6]=r,o[7]=a):a=o[7],L.useEffect(i,a)}function dn(e){const t=W(e.orgSlug,e.virtualMcpId);ve(t).inFlight>0||(rn(t,null),le(e,{kind:"external"}).then(({navigates:n})=>{const o=V(t);o.previews>0&&o.state.inFlight===0&&un(t,n)}).catch(()=>{}))}function Qs(e,t){const n=A.c(7);let o;n[0]!==e||n[1]!==t?(o=W(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const s=o;let r;n[3]!==s?(r=c=>As(s,c),n[3]=s,n[4]=r):r=n[4];const i=r;let a;n[5]!==s?(a=()=>ve(s),n[5]=s,n[6]=a):a=n[6];const l=a;return L.useSyncExternalStore(i,l,l)}const Us=500;function qr(e,t){const{phase:n}=Qs(e,t);return ds(n!=="idle",Us)}function Bs(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function hn(e,t){return g.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function ei(e,t,n,o){if(o?.source==="github"){const i=e.getQueryData(g.contentIndex(t));return i?oo(i,n):Fs(e,t,n)}const s=e.getQueryData(g.contentVersions(t));if(!s)return;if(Object.hasOwn(s,n))return s[n];const r=e.getQueryData(g.decofile(t));return r&&Object.hasOwn(r,n)?void 0:null}function gn(e,t){if(Object.hasOwn(e.changes,t))return e.changes[t];const n=B(t),o=Object.keys(e.changes).find(s=>B(s)===n);return o===void 0?void 0:e.changes[o]}function Fs(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(o)return vn(o,ye(e,t),n)}function vn(e,t,n){const o=gn(e,n);return o?.kind==="delete"?o.version??X:o?o.version:t.has(B(n))?X:null}function ti(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(!o)return!1;const s=gn(o,n);return s?s.kind==="set"&&s.baseVersion===null:ye(e,t).has(B(n))}function ni(e,t){const n=e.getQueryData(g.decofile(t)),o=e.getQueryData(g.contentChanges(t));if(!n||!o)return null;const s=ye(e,t);return{blocks:n,versionOf:r=>vn(o,s,r)}}function ye(e,t){return new Set(e.getQueryData(g.contentDraftTombstones(t)))}function be(e,t,n,o){const s=B(n),r=ye(e,t);r.has(s)!==o&&(o?r.add(s):r.delete(s),Y(e),e.setQueryData(g.contentDraftTombstones(t),[...r]))}function bn(e,t,n,o){const s=o.revision,r=e.getQueryData(g.contentVersions(n)),i=Object.entries(o.versions??{}).map(([u,d])=>[u,d===X?null:d]),a=e.getQueryData(g.contentChanges(n)),l=e.getQueryData(g.contentIndex(n)),c=new Set(i.flatMap(([u])=>Re(u,l,a,r)===null?[u]:[])),f=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[v,b]of i){const w=Re(v,l,u,r);b!==null?d[v]={kind:"set",version:b,baseVersion:w}:w!==null?d[v]={kind:"delete",version:null,baseVersion:w}:delete d[v]}return{...u,changes:d,edited:!0}});for(const[u,d]of i)d!==null?be(e,n,u,!1):!f.has(B(u))&&c.has(u)&&be(e,n,u,!0);const h=o.revision;return h&&h!=="none"&&e.setQueryData(g.protocolDraftRead(t.orgSlug,t.virtualMcpId,t.branch),u=>u&&{...u,version:h}),s}function ke(e,t,n){Y(e),e.setQueryData(g.contentVersions(t),o=>{const s={...o};for(const[r,i]of Object.entries(n))i===null?delete s[r]:s[r]=i;return s})}function wn(e,t){const n=e.getMutationCache().findAll({mutationKey:me(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>mo(o.state.variables)))}function $e(e,t){e.resetQueries({queryKey:g.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function oe(e,t,n,o){try{return await o()}catch(s){const r=!(s instanceof j);throw t.source==="local"&&r?($e(e,n),new Xt(s)):(t.source==="local"&&Ae(s)&&$e(e,n),s)}}const Et=new WeakMap;function et(e){let t=Et.get(e);return t||(t={inFlight:new Map,rereading:new Set},Et.set(e,t)),t}function pn(e,t,n,o){const{inFlight:s}=et(e),r=s.get(o);if(r)return r;const i=tt(e,t,n,o,!0);return s.set(o,i),i.finally(()=>{s.get(o)===i&&s.delete(o)})}function Cs(e,t,n){const o=A.c(8),s=Z(),r=t?.orgSlug,i=t?.virtualMcpId,a=t?.branch;let l,c;o[0]!==e||o[1]!==a||o[2]!==n||o[3]!==r||o[4]!==s||o[5]!==i?(l=()=>{if(!e||!r||!i||!a)return;const f={orgSlug:r,virtualMcpId:i,branch:a},{rereading:h}=et(s);return vs(u=>{u===n&&(h.has(n)||(h.add(n),Hs(s,e,f,n).catch(Vs).finally(()=>h.delete(n))))})},c=[s,e,r,i,a,n],o[0]=e,o[1]=a,o[2]=n,o[3]=r,o[4]=s,o[5]=i,o[6]=l,o[7]=c):(l=o[6],c=o[7]),L.useEffect(l,c)}function Vs(){}async function Hs(e,t,n,o){const s=et(e).inFlight.get(o);return s&&await s.catch(()=>{}),pn(e,t,n,o)}async function tt(e,t,n,o,s){Y(e);const r=g.decofile(o),i=hn(n,t),a=g.contentRevision(o),l=g.contentVersions(o),c=e.getQueryData(r),f=e.getQueryData(l),u=e.getQueryData(i),d=e.getQueryData(a)??void 0,v=s&&c&&f?d?.revision:void 0,b=s&&u?d?.schemaVersion:void 0,w=g.contentChanges(o),_=e.getQueryData(w);if(t.source==="github"&&t.hosted)return Js(e,t,t.hosted,n,o,{conditional:s,seen:d,currentMeta:u,schemaIfNoneMatch:b,seenChanges:_});const[S,$,E]=await oe(e,t,n,()=>t.client.batch([{method:"blocks.list",params:v?{ifNoneMatch:v}:{}},{method:"schema.get",params:b?{ifNoneMatch:b}:{}},{method:"changes.list",params:Rt(_)}])),D=e.getQueryData(a)?.revision,I=D!==void 0&&D!==d?.revision;if(E?.ok){const k=I?null:Tt(_,E.result);k&&e.setQueryData(w,k)}else E&&t.source==="local"&&Ae(E.error)&&$e(e,n);if(!S?.ok)throw S?.error??new Error("no blocks.list");if(!$)throw new Error("no schema.get");const m=S.result,y=Ve($),O=$.ok&&!y?$.result:null;if(m.notModified&&(!c||!f)||O?.notModified&&!u)return tt(e,t,n,o,!1);const x=m.notModified?new Set:wn(e,n),N=m.notModified?c:po(m.blocks,c,x),p=y?Vt():O?O.notModified?u:O.schema:$.error;if(e.setQueryData(a,{revision:I?D:m.notModified?d?.revision:m.revision,schemaVersion:O?O.notModified?d?.schemaVersion:O.version??void 0:void 0}),e.setQueryData(r,N),!m.notModified){const k=e.getQueryData(l),P={...m.versions};for(const Q of x){const M=k?.[Q];M!==void 0?P[Q]=M:delete P[Q]}e.setQueryData(l,P)}return p instanceof j||e.setQueryData(i,p),!I&&!m.notModified&&c&&d?.revision&&m.revision!==d.revision&&dn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:N,meta:p}}async function Js(e,t,n,o,s,r){const i=g.decofile(s),a=g.contentIndex(s),l=g.contentRevision(s),c=g.contentVersions(s),f=hn(o,t),h=g.contentChanges(s),u=e.getQueryData(a),d=r.conditional&&u?r.seen?.revision:void 0,[v,b,w]=await oe(e,t,o,()=>n.batch([{method:"cms.index",params:d?{ifNoneMatch:d}:{}},{method:"schema.get",params:r.schemaIfNoneMatch?{ifNoneMatch:r.schemaIfNoneMatch}:{}},{method:"changes.list",params:Rt(r.seenChanges)}])),_=e.getQueryData(a)??u,S=e.getQueryData(l)?.revision,$=S!==void 0&&S!==r.seen?.revision;if(w?.ok&&!$){const R=Tt(r.seenChanges,w.result);R&&e.setQueryData(h,R)}if(!v?.ok)throw v?.error??new Error("no cms.index");if(!b)throw new Error("no schema.get");const E=v.result,D=Ve(b),I=b.ok&&!D?b.result:null;if(E.notModified&&!u||I?.notModified&&!r.currentMeta)return tt(e,t,o,s,!1);const m=D?Vt():I?I.notModified?r.currentMeta:I.schema:b.error;m instanceof j||e.setQueryData(f,m);const y=I?I.notModified?r.seen?.schemaVersion:I.version??void 0:void 0,O=e.getQueryData(i)??{};if(E.notModified||$)return e.setQueryData(l,{revision:$?S:r.seen?.revision,schemaVersion:y}),e.setQueryData(i,O),{blocks:O,meta:m};const x={revision:E.revision,resolvedRef:E.resolvedRef,sequence:E.sequence,entries:E.entries,draft:E.draft};e.setQueryData(a,x);const N=!!r.seen?.revision&&x.revision!==r.seen.revision&&(!r.seen.revision.startsWith("s-")||!!u&&mn(u.draft,x.draft));N&&e.setQueryData(g.protocolDraftRead(o.orgSlug,o.virtualMcpId,o.branch),R=>R&&{...R,version:x.revision}),e.setQueryData(l,{revision:x.revision,schemaVersion:y});const p=wn(e,o),k=e.getQueryData(c)??{},P={},Q={},M=[];for(const[R,H]of Object.entries(O)){const J=x.entries[R];!J&&!p.has(R)||(P[R]=H,k[R]!==void 0&&(Q[R]=k[R]),J&&!p.has(R)&&k[R]!==J.version&&M.push(R))}return e.setQueryData(i,P),e.setQueryData(c,Q),M.length>0&&await Fe(e,n,s,M,p),_&&N&&Ws(_,x)&&dn({queryClient:e,orgSlug:o.orgSlug,virtualMcpId:o.virtualMcpId,branch:o.branch,backend:t,cacheKey:s}),{blocks:e.getQueryData(i)??P,meta:m}}function Ws(e,t){if(mn(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 mn(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 Ys(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 Ee(e){if(!(e instanceof j)||e.code!==T.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"))}async function Gs(e,t){if(!(e instanceof j)||e.code!==T.Conflict)return;const n=e.data?.entries;if(!n||typeof n!="object")return;const o=Object.entries(n);if(o.length===0)return;const s=t.set??{},r=new Set(t.delete??[]),i={};for(const[a,l]of o){const c=l?.actual;if(typeof c!="string"||(Object.hasOwn(s,a)?await Un(s[a]):r.has(a)?X:void 0)!==c)return;i[a]=c}return i}function zs(e,t){const n=Object.fromEntries(Object.entries(e.set??{}).filter(([s])=>!Object.hasOwn(t,s))),o=(e.delete??[]).filter(s=>!Object.hasOwn(t,s));return{...Object.keys(n).length>0?{set:n}:{},...o.length>0?{delete:o}:{}}}function re(e,t,n,o,s){Y(e),bn(e,t,n,{revision:e.getQueryData(g.contentRevision(n))?.revision??"",versions:s}),ke(e,n,Object.fromEntries(Object.entries(s).map(([r,i])=>[r,i===X?null:i]))),Qt(e,n,s,o.set??{})}async function oi(e,t,n,o,s,r){if(t.source==="github"){const a=[...Object.keys(s.set??{}),...s.delete??[]].filter(c=>!r||!Object.hasOwn(r,c));if(a.length>0)throw new Error(`A hosted save needs a precondition for every block it touches (missing: ${a.join(", ")})`);const l=Ln(s.set);if(l.length>0)throw new Error(`A hosted save can't write a block that isn't loaded (${l.join(", ")})`)}return Ls({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,h=r)=>oe(e,t,n,()=>t.client.blocksApply({set:f.set,delete:f.delete,...h?{ifMatch:Ys(h,f)}:{}}));let a;try{a=await i(s)}catch(f){const h=t.source==="github"?Ee(f):void 0;if(!h)throw f;const u=zs(s,h);Object.keys(h).length>0&&re(e,n,o,s,h);let d;try{d=await i(u)}catch(v){const b=Ee(v);b&&Object.keys(b).length>0&&re(e,n,o,u,b);const w=await Gs(v,u);if(!w)throw v;re(e,n,o,u,w);try{d=await i(u,{...r,...w})}catch(_){const S=Ee(_);throw S&&Object.keys(S).length>0&&re(e,n,o,u,S),_}}a={...d,versions:{...h,...d.versions}}}Y(e);const l=t.source==="github"?bn(e,n,o,a):a.revision;t.source==="github"&&Qt(e,o,a.versions??{},s.set??{}),e.setQueryData(g.contentRevision(o),f=>({...f,revision:l}));const c=a.versions??{};return ke(e,o,c),{revision:l,versions:c}}})}function Sn(e,t){if(!(e instanceof j))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 yn(e,t,n){if(!(n instanceof j))return;const o=n.data?.draft;if(!(!o||typeof o!="object"))for(const[s,r]of Object.entries(o))r===null&&be(e,t,s,!1)}function kn(e,t,n,o){Y(e),Qn(e,n,o);const s=o.block===null,r=e.getQueryData(g.contentVersions(t)),i=e.getQueryData(g.contentChanges(t)),a=Re(n,e.getQueryData(g.contentIndex(t)),i,r);if(i){const l=B(n),c=Object.fromEntries(Object.entries(i.changes).filter(([f])=>B(f)!==l));s?a!==null&&(c[n]={kind:"delete",version:null,baseVersion:a}):c[n]={kind:"set",version:o.version,baseVersion:a},e.setQueryData(g.contentChanges(t),{...i,changes:c,edited:!0})}be(e,t,n,s&&a===null),e.setQueryData(g.decofile(t),l=>{const c={...l};return s?delete c[n]:c[n]=o.block,c}),ke(e,t,{[n]:s?null:o.version}),so(e,t,n,o)}function si(e,t,n,o){if(t.source!=="github"||!(o instanceof j))return!1;yn(e,n,o);const s=o.data?.draft;if(!s||typeof s!="object")return!1;const r=Object.keys(s),i=r.map(a=>Sn(o,a));return r.length===0||i.some(a=>a===void 0)?!1:(e.cancelQueries({queryKey:g.decofile(n)}),r.forEach((a,l)=>{kn(e,n,a,i[l])}),!0)}async function ri(e,t,n,o,s,r){t.source==="github"&&yn(e,o,r);const i=t.source==="github"?Sn(r,s):void 0;if(i)return e.cancelQueries({queryKey:g.decofile(o)}),kn(e,o,s,i),!0;await e.invalidateQueries({queryKey:g.decofile(o)});let a;try{const c=(await oe(e,t,n,()=>t.client.changesGet({names:[s]}))).entries[s];if(c&&c.after===null&&c.version!==null)return!1;a={value:c?.after??null,version:c?.version??null},t.source==="github"&&e.setQueryData(g.contentChanges(o),f=>{if(!f)return f;const h={...f.changes};return c?.kind?h[s]={kind:c.kind,version:c.version,baseVersion:c.baseVersion}:delete h[s],{...f,changes:h,edited:!0}})}catch{const l=await oe(e,t,n,()=>t.client.blocksList({}));if(l.notModified)return!1;a={value:l.blocks[s]??null,version:l.versions[s]??null}}return e.setQueryData(g.decofile(o),l=>{const c={...l};return a.value===null?delete c[s]:c[s]=a.value,c}),ke(e,o,{[s]:a.version}),!1}function Xs(e){const t=A.c(17),n=Le(e?.virtualMcpId)?.metadata;let o;t[0]!==n?(o=It(n),t[0]=n,t[1]=o):o=t[1];const s=o;let r;t[2]!==e?.branch||t[3]!==e?.orgSlug||t[4]!==e?.virtualMcpId?(r=g.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[2]=e?.branch,t[3]=e?.orgSlug,t[4]=e?.virtualMcpId,t[5]=r):r=t[5];let i;t[6]!==e||t[7]!==s?(i=async()=>{const b=await _t(s,e.branch),w=b.pointer?.lastIndexOf("@")??-1;return{draft:b.pointer&&w>0?b.pointer.slice(0,w):null,version:b.pointer&&w>0?b.pointer.slice(w+1):b.etag}},t[6]=e,t[7]=s,t[8]=i):i=t[8];const a=!!e&&!!s;let l;t[9]!==r||t[10]!==i||t[11]!==a?(l={queryKey:r,queryFn:i,enabled:a,staleTime:Number.POSITIVE_INFINITY},t[9]=r,t[10]=i,t[11]=a,t[12]=l):l=t[12];const{data:c,isPending:f,isError:h}=F(l),u=!!e&&!!s&&f&&!h;if(!e||!c?.draft||!c.version){let b;return t[13]!==u?(b={pointer:null,pending:u},t[13]=u,t[14]=b):b=t[14],b}const d=`${c.draft}@${c.version}`;let v;return t[15]!==d?(v={pointer:d,pending:!1},t[15]=d,t[16]=v):v=t[16],v}function ii(e){return Xs(e).pointer}function ai(e){const t=A.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:Zs,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:s}=F(o);return s?.revision}async function Zs(){throw new Error("content revisions are set by reads and writes")}function nt(e,t){const n=A.c(6),{url:o}=Ht(e?.virtualMcpId),s=se(e?.virtualMcpId,e?.branch);if(!e)return"";let r;return n[0]!==s.cacheKeySuffix||n[1]!==s.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(r=s.kind!=="legacy"&&s.cacheKeySuffix!==void 0?xe({...e,protocolSuffix:s.cacheKeySuffix}):xe({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=s.cacheKeySuffix,n[1]=s.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=r):r=n[5],r}function ci(e,t){const n=A.c(46),{url:o}=Ht(e?.virtualMcpId),s=!!o,r=se(e?.virtualMcpId,e?.branch),i=r.kind==="protocol"?r:null,a=nt(e),l=t?.fetchEnabled??!0,c=cs(e?.virtualMcpId),f=$t(e?.virtualMcpId).runtime==="cms",h=Z();let u;n[0]!==a?(u=g.decofile(a),n[0]=a,n[1]=u):u=n[1];const d=u;Cs(i,i&&e?e:null,a);let v;n[2]!==e||n[3]!==h||n[4]!==d?(v=()=>{if(!e||h.isMutating({mutationKey:me(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const k=h.getQueryState(d);return k?.fetchStatus==="fetching"||Date.now()-(k?.dataUpdatedAt??0)<Wt/2},n[2]=e,n[3]=h,n[4]=d,n[5]=v):v=n[5];let b;n[6]!==f||n[7]!==s||n[8]!==e||n[9]!==i||n[10]!==h||n[11]!==d?(b=async()=>{if(e){if(!i&&f&&!s){const k=Wo(h,e)?.version;if(k&&!await Yo(e,k))return}await h.refetchQueries({queryKey:d,exact:!0},{cancelRefetch:!1})}},n[6]=f,n[7]=s,n[8]=e,n[9]=i,n[10]=h,n[11]=d,n[12]=b):b=n[12];let w;n[13]!==v||n[14]!==b?(w={skip:v,read:b},n[13]=v,n[14]=b,n[15]=w):w=n[15],es(!!t?.pollWhile&&!!e,w);const _=Ce(i?.hosted?a:"");let S;n[16]!==r.kind||n[17]!==f||n[18]!==l||n[19]!==a||n[20]!==s||n[21]!==o||n[22]!==c||n[23]!==e||n[24]!==i||n[25]!==h?(S=async()=>{if(i)return(await pn(h,i,e,a)).blocks;if(r.kind==="unavailable")throw Bs("decofile");if(s){const M=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(qs),U=M?.ok?wt(await M.text()):null;if(U)return U;const R=new Error("decofile unavailable (local tunnel unreachable)");throw R.status=502,R}if(f)return zo(h,e);const k=()=>as(e,Co(c,".deco/blocks.gen.json"));if(l){const M=await fetch(ss(e),{cache:"no-store"}).catch(Ks);if(M?.ok){const H=wt(await M.text());if(H)return H}const U=await k();if(U.kind==="data")return U.data;const R=new Error(`Failed to fetch decofile: ${M?.status??"network error"}`);throw R.status=mt({liveOk:!!M?.ok,liveStatus:M?.status,committedAbsent:U.kind==="absent"}),R}const P=await k();if(P.kind==="data")return P.data;const Q=new Error("decofile unavailable (preview down, no committed snapshot)");throw Q.status=mt({liveOk:!1,committedAbsent:P.kind==="absent"}),Q},n[16]=r.kind,n[17]=f,n[18]=l,n[19]=a,n[20]=s,n[21]=o,n[22]=c,n[23]=e,n[24]=i,n[25]=h,n[26]=S):S=n[26];const $=!!e&&r.kind!=="pending",E=i?0:3e4,D=i?.describe.pollIntervalMs,I=i?"always":void 0;let m;n[27]!==f||n[28]!==s||n[29]!==i?(m=(k,P)=>{if(i||f||s)return k<3;const Q=P.status;return Q!==502&&Q!==404&&k<2},n[27]=f,n[28]=s,n[29]=i,n[30]=m):m=n[30];let y;n[31]!==d||n[32]!==S||n[33]!==$||n[34]!==E||n[35]!==D||n[36]!==I||n[37]!==m?(y={queryKey:d,queryFn:S,enabled:$,staleTime:E,refetchInterval:D,refetchIntervalInBackground:!1,refetchOnWindowFocus:I,retry:m,retryDelay:Fo},n[31]=d,n[32]=S,n[33]=$,n[34]=E,n[35]=D,n[36]=I,n[37]=m,n[38]=y):y=n[38];const O=F(y);let x;n[39]!==_||n[40]!==O?(x=_&&O.data?to(_,O.data):void 0,n[39]=_,n[40]=O,n[41]=x):x=n[41];const N=x;let p;return n[42]!==N||n[43]!==i?.hosted||n[44]!==O?(p=i?.hosted&&N?{...O,data:N}:O,n[42]=N,n[43]=i?.hosted,n[44]=O,n[45]=p):p=n[45],p}function Ks(){return null}function qs(){return null}function li(e,t,n){return Qo(e,t,n)}function ui(e){const t=A.c(4),n=Z(),o=se(e?.virtualMcpId,e?.branch),s=nt(e),r=o.kind==="protocol"?o.hosted:void 0;let i;return t[0]!==s||t[1]!==n||t[2]!==r?(i=(a,l)=>ro(n,r,s,a,l),t[0]=s,t[1]=n,t[2]=r,t[3]=i):i=t[3],i}function fi(e,t){const n=A.c(3),o=se(e?.virtualMcpId,e?.branch),s=nt(e),r=Ce(o.kind==="protocol"&&o.hosted?s:"");let i;return n[0]!==r?.entries||n[1]!==t?(i=Object.entries(r?.entries??{}).filter(a=>{const[,l]=a;return t(l.meta?.type??"")}).map(er),n[0]=r?.entries,n[1]=t,n[2]=i):i=n[2],i}function er(e){const[t]=e;return t}const tr="site-editor-save",On={id:tr,description:void 0,action:void 0,cancel:void 0},di="site-editor-undo",Ne="site-editor-publish";function nr(e){const t=A.c(7),{label:n,detail:o}=e;let s;t[0]!==n?(s=z.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=s):s=t[1];let r;t[2]!==o?(r=z.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=r):r=t[3];let i;return t[4]!==s||t[5]!==r?(i=z.jsxs("details",{className:"mt-1 text-xs",children:[s,r]}),t[4]=s,t[5]=r,t[6]=i):i=t[6],i}function En(e,t){return t?z.jsx(nr,{label:e("siteEditor.details"),detail:t}):void 0}function hi(e,t,n){te.error(Kt(e,t,n),{...On,description:En(e,ls(t,n))})}function gi(e,t,n=!1){te.info(e(t?"sectionsEditor.reconcile.leftDeleted":"sectionsEditor.reconcile.keptTheirs"),{...On,description:e(t?n?"sectionsEditor.reconcile.leftDeletedNeverPublishedHint":"sectionsEditor.reconcile.leftDeletedHint":"sectionsEditor.reconcile.keptTheirsHint")})}const Dn={action:void 0,duration:void 0};function vi(e,t){te.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...Dn,id:Ne,description:void 0})}function bi(e,{headline:t,body:n,detail:o,retry:s,pending:r,tone:i="error"}){const a=En(e,o??null);te[i](t,{id:Ne,description:n&&a?z.jsxs(z.Fragment,{children:[z.jsx("p",{children:n}),a]}):n??a,action:s?{label:e("siteEditor.tryAgain"),onClick:l=>{l.preventDefault(),te.loading(r??e("thread.publishPopover.publishing"),{...Dn,id:Ne,description:void 0}),s()}}:void 0,duration:s?Number.POSITIVE_INFINITY:void 0})}function wi(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Ho as $,Ds as A,ws as B,as as C,Ft as D,Br as E,yr as F,Xs as G,W as H,Ps as I,Yr as J,Hr as K,de as L,ys as M,ks as N,jr as O,Jr as P,Mr as Q,Xr as R,zr as S,Ut as T,Qs as U,ai as V,Qr as W,Vo as X,me as Y,Ls as Z,is as _,pr as a,vo as a0,Ao as a1,Dr as a2,dt as a3,ht as a4,Ir as a5,Sr as a6,Or as a7,Gn as a8,En as a9,ei as aA,Jo as aB,xr as aC,Kr as aD,ni as aE,Ke as aF,_r as aG,ii as aH,Lr as aI,si as aJ,ee as aK,Ar as aL,bi as aM,di as aN,On as aO,Fe as aP,wn as aQ,to as aR,Ur as aS,Tr as aT,Fr as aU,Cr as aV,Vr as aW,wi as aa,ms as ab,hn as ac,nr as ad,Gr as ae,Wr as af,Qo as ag,os as ah,pn as ai,Bs as aj,Fo as ak,Pr as al,Ne as am,Dn as an,vi as ao,Zr as ap,gi as aq,ti as ar,Nr as as,Ge as at,$r as au,Hs as av,Ze as aw,oi as ax,ri as ay,hi as az,go as b,Ht as c,ui as d,wr as e,fi as f,qr as g,kr as h,mr as i,ci as j,li as k,Yn as l,zn as m,Nt as n,jo as o,gr as p,Rr as q,br as r,vr as s,ts as t,se as u,nt as v,Er as w,cs as x,Co as y,Es as z};
|
|
1
|
+
import{aF as Dt,aG as q,bn as je,bv as _n,dy as Oe,dw as xn,et as we,c as A,i as F,eu as Rn,ev as Tn,q as Z,r as L,ew as Pn,K as g,ex as Y,ey as X,bA as $n,a as Nn,at as De,a4 as jn,bw as It,ez as An,eA as _t,ar as Mn,br as B,ec as xt,eB as Ln,eC as Qn,eD as Un,t as te,j as z}from"./index-BsAwgxIf.js";import{C as j,E as T,i as Ae,e as Bn,u as Fn,P as Cn,f as Vn,g as Me,h as Rt,j as Tt}from"./use-sandbox-events-aK2a02aF.js";import{b as Le}from"./repository-binding-BS9v5Fe_.js";import{e as Pt}from"./backoff-CrEUbyZT.js";import{b as pe}from"./sandbox-url-D3mC8qhT.js";import{u as Hn}from"./chat-context-BhwgXdxZ.js";import{u as Qe}from"./use-blocks-v8-project-uH3tLJJX.js";import{u as $t}from"./use-voice-input-DYwW5R3c.js";import{s as ot}from"./session-runtime-BtkBTCEv.js";import{s as Jn}from"./utils-DII4rh9V.js";import{a as Wn}from"./sandbox-git-api-CbcKlTqF.js";function Nt(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 ue(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 jt=Dt({endpoint:q().max(2048).refine(e=>Nt(e)&&new URL(e).pathname==="/rpc").transform(ue)});function gr(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=jt.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function At(e){const t=jt.safeParse(e);return t.success?t.data:null}const Mt="studio:deco-serve-last";function vr(e){try{localStorage.setItem(Mt,JSON.stringify(e))}catch{}}function br(){try{const e=localStorage.getItem(Mt);return e?At(JSON.parse(e)):null}catch{return null}}function wr(e){try{return new URL(ue(e)).host}catch{return e}}function Yn(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const Gn="http://localhost:4545/rpc";class Ue extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function zn(e){if(e instanceof Ue)return{reason:"not-deco-serve"};if(!(e instanceof j))return{reason:"not-answering"};switch(e.code){case T.Unauthorized:case T.MethodNotFound:return{reason:"outdated"};case T.Unsupported:return Ae(e)?{reason:"outdated"}:{reason:"version-mismatch"};case T.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 pr(e,t){if(e)return[ue(e.endpoint)];const n=[t?.endpoint,Gn].filter(o=>!!o).map(ue);return[...new Set(n)]}const Xn=Dt({blocks:Oe(q(),Oe(q(),xn()).refine(je)),versions:Oe(q(),q().min(1)),missing:_n(q())});function Zn(e,t){const n=Xn.parse(e),o=Object.keys(n.blocks),s=Object.keys(n.versions),r=[...o,...n.missing],i=new Set(t);if(s.length!==o.length||o.some(a=>!Object.hasOwn(n.versions,a))||r.length!==i.size||new Set(r).size!==r.length||r.some(a=>!i.has(a)))throw new Error("The CMS block response did not account for the requested names");return n}function ne(e,t){const n=e.index?.entries[t];return!!n&&je(e.blocks[t])&&e.versions[t]===n.version}function Kn(e,t,n){const o=new Map;let s=!1;for(const[r,i]of Object.entries(n.blocks)){const a=t.index?.entries[r];if(a){if(n.versions[r]!==a.version){s||=a.version===e.index?.entries[r]?.version;continue}t.blocks[r]!==e.blocks[r]||t.versions[r]!==e.versions[r]||o.set(r,i)}}return s||=n.missing.some(r=>!!t.index?.entries[r]),{blocks:o.size?{...t.blocks,...Object.fromEntries(o)}:t.blocks,versions:o.size?{...t.versions,...Object.fromEntries([...o.keys()].map(r=>[r,n.versions[r]]))}:t.versions,refreshIndex:s}}function qn(e,t,n){return!!e.index&&t.every(o=>e.index?.entries[o]?ne(e,o)&&(!n||n[o]===e.blocks[o]):!n||n[o]===void 0)}const st=50,rt=10;function eo(e,t=n=>fetch(n)){let n=1;return{async batch(o){const s=o.map(()=>n++),r=await t(new Request(e,{method:"POST",headers:{"content-type":"application/json"},credentials:"include",signal:we(),body:JSON.stringify(o.map((l,c)=>({jsonrpc:"2.0",id:s[c],method:l.method,params:l.params??{}})))}));if(!r.ok)throw new j(T.Unavailable,`the hosted CMS answered ${r.status}`);const i=await r.json(),a=new Map((Array.isArray(i)?i:[]).map(l=>[l.id,l]));return s.map(l=>{const c=a.get(l);return c?c.error?{ok:!1,error:j.from(c.error)}:{ok:!0,result:c.result}:{ok:!1,error:new j(T.InternalError,"no response for this call")}})}}}function to(e,t){if(!e)return t??{};const n={};for(const[o,s]of Object.entries(e.entries)){if(t&&Object.hasOwn(t,o)){n[o]=t[o];continue}n[o]={[Tn]:!0,...s.meta?.type?{__resolveType:s.meta.type}:{},...s.meta?.path!==void 0?{path:s.meta.path}:{},...s.meta?.refs?.length?{[Rn]:s.meta.refs}:{}}}for(const[o,s]of Object.entries(t??{}))Object.hasOwn(n,o)||(n[o]=s);return n}function no(e,t){return e?.entries[t]?.meta?.refs??[]}function oo(e,t){return Object.hasOwn(e.draft,t)?e.draft[t]?.version??null:null}function Be(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Ie(e,t){if(Array.isArray(e)){for(const n of e)Ie(n,t);return}if(Be(e))for(const[n,o]of Object.entries(e))n==="__resolveType"&&typeof o=="string"?t.add(o):Ie(o,t)}function Lt(e,t){if(!Be(e))return;const n={};typeof e.__resolveType=="string"&&(n.type=e.__resolveType),typeof e.path=="string"&&(n.path=e.path);const o=new Set;Ie(e,o);const s=[...o].filter(r=>t.has(r)).sort();return s.length>0&&(n.refs=s),Object.keys(n).length>0?n:void 0}function Qt(e,t,n,o){Y(e),e.setQueryData(g.contentIndex(t),s=>{if(!s)return s;const r={...s.entries},i={...s.draft},a=new Set([...Object.keys(r),...Object.keys(o)]);for(const[l,c]of Object.entries(n)){const f=i[l]?.editor??null;if(c===null||c===X){delete r[l],i[l]={operation:"delete",version:X,editor:f};continue}const h=Lt(o[l],a);r[l]={version:c,...h?{meta:h}:{}},i[l]={operation:"set",version:c,editor:f}}return{...s,entries:r,draft:i}})}function so(e,t,n,o){e.setQueryData(g.contentIndex(t),s=>{if(!s)return s;const r={...s.draft},i={...s.entries};if(o===null)delete r[n];else if(r[n]={operation:o.block===null?"delete":"set",version:o.version,editor:r[n]?.editor??null},o.block===null)delete i[n];else{const a=new Set([...Object.keys(i),n]),l=Lt(o.block,a);i[n]={version:o.version,...l?{meta:l}:{}}}return{...s,entries:i,draft:r}})}const it=new WeakMap;async function Fe(e,t,n,o,s=new Set){const r=e.getQueryData(g.contentIndex(n));if(!r)throw new j(T.Unavailable,"The CMS index is not loaded yet");let i=it.get(e);i||(i=new Map,it.set(e,i));const a=e.getQueryData(g.decofile(n))??{},l=e.getQueryData(g.contentVersions(n))??{},c=[],f=[];for(const u of new Set(o)){const d=r.entries[u];if(!d||s.has(u)||je(a[u])&&l[u]===d.version)continue;const v=i.get(`${n}\0${u}`);v?c.push(v):f.push(u)}if(f.length>0){const u=io(e,t,n,f);for(const d of f){const v=`${n}\0${d}`;i.set(v,u),u.catch(()=>{}).finally(()=>{i.get(v)===u&&i.delete(v)})}c.push(u)}await Promise.all(c);const h=fe(e,n);if(o.some(u=>h.index?.entries[u]&&!s.has(u)&&!ne(h,u)))throw new j(T.Unavailable,"A CMS block changed while loading; try again")}async function ro(e,t,n,o,s){if(!t){const i=o?.[s];return Be(i)&&!$n(i)?i:void 0}await Fe(e,t,n,[s]);const r=fe(e,n);return r.index?.entries[s]&&ne(r,s)?r.blocks[s]:void 0}function fe(e,t){return{index:e.getQueryData(g.contentIndex(t)),blocks:e.getQueryData(g.decofile(t))??{},versions:e.getQueryData(g.contentVersions(t))??{}}}async function io(e,t,n,o){const s=fe(e,n),r=[];for(let i=0;i<o.length;i+=st)r.push(o.slice(i,i+st));for(let i=0;i<r.length;i+=rt){const a=r.slice(i,i+rt),l=await t.batch(a.map(c=>({method:"cms.blocks",params:{names:c}})));if(l.length!==a.length)throw new j(T.InternalError,"Incomplete CMS batch response");for(const[c,f]of l.entries()){if(!f.ok)throw f.error;const h=Zn(f.result,a[c]),u=fe(e,n),d=Kn(s,u,h);if(Y(e),d.blocks!==u.blocks&&e.setQueryData(g.decofile(n),d.blocks),d.versions!==u.versions&&e.setQueryData(g.contentVersions(n),d.versions),d.refreshIndex)throw e.invalidateQueries({queryKey:g.decofile(n),exact:!0},{cancelRefetch:!1}),new j(T.Unavailable,"The CMS index changed while loading blocks; try again")}}}function Ce(e){const t=A.c(4);let n;t[0]!==e?(n=g.contentIndex(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:ao,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:s}=F(o);return s}async function ao(){throw new Error("the content index is set by the poll")}function at(e,t){const n=A.c(8);let o;n[0]!==t?(o=Pn(t),n[0]=t,n[1]=o):o=n[1];const s=o;let r;n[2]!==e||n[3]!==s?(r=a=>e.getQueryCache().subscribe(l=>{l.query.queryHash===s&&a()}),n[2]=e,n[3]=s,n[4]=r):r=n[4];let i;return n[5]!==e||n[6]!==t?(i=()=>e.getQueryData(t),n[5]=e,n[6]=t,n[7]=i):i=n[7],L.useSyncExternalStore(r,i)}const ct=3e4;function co(e){if(!(e instanceof j))return;const t=e.data?.retryAfterMs;return typeof t=="number"&&t>0?t:void 0}function lo(e,t,n,o){const s=A.c(15),r=Z(),i=Ce(t);let a;s[0]!==t?(a=g.decofile(t),s[0]=t,s[1]=a):a=s[1];const l=at(r,a);let c;s[2]!==t?(c=g.contentVersions(t),s[2]=t,s[3]=c):c=s[3];const f=at(r,c),h=o?.withRefs??!1,u=new Set(n);if(h)for(const p of n)for(const k of no(i,p))u.add(k);const d=[...u].filter(p=>!!i?.entries[p]).sort(),v={index:i,blocks:l??{},versions:f??{}},b=d.some(p=>!ne(v,p)),w=JSON.stringify(d.map(p=>[p,i?.entries[p]?.version,ne(v,p)])),[_,S]=L.useState(null),[$,E]=L.useState(0),D=_?.key===w?_:null;L.useEffect(()=>{if(!e||!w)return;let p=!0;const k=JSON.parse(w).map(ho);return Fe(r,e,t,k).then(()=>{p&&S(P=>P?.key===w?null:P)},P=>{p&&S(Q=>({key:w,count:(Q?.key===w?Q.count:0)+1,retryAfterMs:co(P)}))}),()=>{p=!1}},[e,r,t,w,$]);let I;s[4]!==D||s[5]!==E?(I=()=>{if(!D)return;const p=Math.min(ct,D.retryAfterMs??Pt(ct,1e3,D.count-1,2,.5)),k=setTimeout(()=>E(fo),p);return()=>clearTimeout(k)},s[4]=D,s[5]=E,s[6]=I):I=s[6];let m;s[7]!==D?(m=[D],s[7]=D,s[8]=m):m=s[8],L.useEffect(I,m);const y=!e||qn(v,[...u],o?.listing),O=!!e&&b&&D!==null;let x;s[9]!==E?(x=()=>E(uo),s[9]=E,s[10]=x):x=s[10];let N;return s[11]!==y||s[12]!==O||s[13]!==x?(N={ready:y,failed:O,retry:x},s[11]=y,s[12]=O,s[13]=x,s[14]=N):N=s[14],N}function uo(e){return e+1}function fo(e){return e+1}function ho(e){const[t]=e;return t}const Ut=L.createContext(null);function go(e){const t=A.c(24),n=L.useContext(Ut),o=Qe(n?null:e),{data:s}=Nn.useSession(),r=s?.user?.id??"",i=!!e&&!!r;let a;t[0]!==i||t[1]!==r||t[2]!==e?(a=i?De.decoServeConnection(r,e):null,t[0]=i,t[1]=r,t[2]=e,t[3]=a):a=t[3];const[l,c]=ut(a);let f;t[4]!==i||t[5]!==r||t[6]!==e?(f=i?De.decoServeEndpoint(r,e):null,t[4]=i,t[5]=r,t[6]=e,t[7]=f):f=t[7];const[h,u]=ut(f);if(n)return n;let d;t[8]!==l||t[9]!==i||t[10]!==o?(d=i&&o?At(l):null,t[8]=l,t[9]=i,t[10]=o,t[11]=d):d=t[11];const v=d,b=i&&o&&typeof h=="string"?h:null;let w;t[12]!==u||t[13]!==c||t[14]!==i?(w=$=>{i&&(c($),u($.endpoint))},t[12]=u,t[13]=c,t[14]=i,t[15]=w):w=t[15];let _;t[16]!==c||t[17]!==i?(_=()=>{i&&c(null)},t[16]=c,t[17]=i,t[18]=_):_=t[18];let S;return t[19]!==v||t[20]!==b||t[21]!==w||t[22]!==_?(S={connection:v,lastEndpoint:b,set:w,clear:_},t[19]=v,t[20]=b,t[21]=w,t[22]=_,t[23]=S):S=t[23],S}function lt(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function ut(e){const t=A.c(17),n=Z(),o=e??"";let s;t[0]!==o?(s=["localStorage",o],t[0]=o,t[1]=s):s=t[1];const r=s;let i,a;t[2]!==e?(i=()=>e?lt(e):null,a=()=>e?lt(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const l=!!e;let c;t[5]!==r||t[6]!==i||t[7]!==a||t[8]!==l?(c={queryKey:r,queryFn:i,initialData:a,enabled:l,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=r,t[6]=i,t[7]=a,t[8]=l,t[9]=c):c=t[9];const{data:f}=F(c);let h;t[10]!==e||t[11]!==n||t[12]!==r?(h=b=>{if(e){try{b===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(b))}catch{}n.setQueryData(r,b)}},t[10]=e,t[11]=n,t[12]=r,t[13]=h):h=t[13];const u=h,d=e?f??null:null;let v;return t[14]!==u||t[15]!==d?(v=[d,u],t[14]=u,t[15]=d,t[16]=v):v=t[16],v}function Bt(e,t=""){return{source:e,cacheKeySuffix:e==="github"?"":e==="sandbox"?":sandbox":`:serve:${t}`}}function vo(e){return JSON.stringify([e.kind==="legacy"?"legacy":"protocol",e.source,e.cacheKeySuffix])}function mr(e){return e.kind==="protocol"||e.kind==="unavailable"}function Sr(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n===null||n==="legacy"?t:!0}function yr(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 kr(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&Nt(t)?t:null}function Or(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function Ft(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function bo(e){if(!e.hasProject)return"legacy";const t=Ft(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 wo(e){return{github:e.v8&&e.mode==="github",sandbox:e.v8&&e.mode==="sandbox"&&e.workingTreeReady}}function ft(e){return e.isError||e.errorUpdateCount>0}function po(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const s of n)Object.hasOwn(t,s)?o[s]=t[s]:delete o[s];return o}function mo(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 Ct="__noSchema";function Vt(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[Ct]:!0}}function Er(e){return!!e&&e[Ct]===!0}function Ve(e){if(!e.ok)return e.error.code===T.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function So(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const yo=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function Dr(e){const t=new Map;for(const[n,o]of Object.entries(e)){const s=o&&typeof o=="object"&&!Array.isArray(o)?o:{},r=typeof s.__resolveType=="string"?s.__resolveType:null,i=t.get(r)??[];i.push({key:n,label:So(n,s)}),t.set(r,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(yo)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:dt(n.resolveType).localeCompare(dt(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function dt(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function ht(e,t,n){if(t.length===0)return n;const[o,...s]=t;if(Array.isArray(e)&&typeof o=="number"){const r=e.slice();return r[o]=ht(e[o],s,n),r}if(e&&typeof e=="object"&&typeof o=="string"){const r=e,i={};for(const a of Object.keys(r))i[a]=a===o?ht(r[a],s,n):r[a];return i}return e}function Ir(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class gt extends Error{}const He="site-not-owned";async function ko(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function Oo(e,t=n=>fetch(n)){const n=Me({endpoint:e,fetch:async o=>{const s=await t(new Request(o,{signal:we(o.signal)}));if(await ko(s))throw new gt;return s}});try{return await We(n)}catch(o){if(o instanceof gt)return He;throw o}}async function Eo(e,t,n){await t();const o=await Oo(e,n);return o===He?o:{...o,hosted:eo(e,n)}}const Je=5e3;function Do(e){if(!e.site)throw new Error("this project names no site");return An(e.site,e.branch)}function Io(e){return new URL(pe(e,"rpc"),window.location.origin).href}async function We(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!==Cn)throw new Ue;const s=Vn(t.result);if(!n)throw new Error("no schema.get");if(Ve(n))return{client:e,describe:s,hasSchema:!1};if(n.ok)return{client:e,describe:s,hasSchema:!0};throw n.error}function _o(e,t=n=>fetch(n)){return We(Me({endpoint:e,fetch:n=>t(new Request(n,{signal:we(n.signal)}))}))}function se(e,t){const n=A.c(40),{org:o}=jn(),{connection:s}=go(e),{runtime:r}=$t(e),i=L.useContext(Ut),a=Qe(e),l=It(Le(e)?.metadata),c=Ft({hasServeConnection:!!s,runtime:r}),f=Bt(c,s?.endpoint??""),h=Hn()?.taskId??null,u=Bn(Fn().lifecycle.phase),d=Z(),v=wo({mode:c,v8:a,workingTreeReady:u}),b=v.github&&!!o.slug&&!!e&&!!t,w=F({queryKey:g.contentBackend(o.slug,e??"",t??"","github"),queryFn:()=>Eo(Do({orgSlug:o.slug,site:l,branch:t}),()=>_t(l,t)),enabled:b,staleTime:Number.POSITIVE_INFINITY,...vt}),_=v.sandbox&&!!o.slug&&!!e&&!!t;let S;n[0]!==t||n[1]!==o.slug||n[2]!==h||n[3]!==e?(S=()=>_o(Io({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:h})),n[0]=t,n[1]=o.slug,n[2]=h,n[3]=e,n[4]=S):S=n[4];const $=F({queryKey:g.contentBackend(o.slug,e??"",t??"","sandbox",h??""),queryFn:S,enabled:_,staleTime:Number.POSITIVE_INFINITY,...vt}),E=!!s;let D;n[5]!==s?.endpoint||n[6]!==o.slug||n[7]!==e?(D=g.contentBackend(o.slug,e??"","local",s?.endpoint??""),n[5]=s?.endpoint,n[6]=o.slug,n[7]=e,n[8]=D):D=n[8];let I;n[9]!==s?(I=()=>jo(s.endpoint),n[9]=s,n[10]=I):I=n[10];let m;n[11]!==E||n[12]!==D||n[13]!==I?(m={queryKey:D,queryFn:I,enabled:E,staleTime:Number.POSITIVE_INFINITY,retry:To,retryDelay:Ro,refetchInterval:xo},n[11]=E,n[12]=D,n[13]=I,n[14]=m):m=n[14];const y=F(m);let O;n[15]!==s?.endpoint||n[16]!==o.slug||n[17]!==e?(O=g.contentBackend(o.slug,e??"","local",s?.endpoint??""),n[15]=s?.endpoint,n[16]=o.slug,n[17]=e,n[18]=O):O=n[18];const x=O;let N;n[19]!==s?.endpoint||n[20]!==o.slug||n[21]!==e?(N=g.contentBackend(o.slug,e??"","local-describe",s?.endpoint??""),n[19]=s?.endpoint,n[20]=o.slug,n[21]=e,n[22]=N):N=n[22];let p;n[23]!==y.data||n[24]!==x||n[25]!==d?(p=async()=>{try{return await y.data.client.describe()}catch(K){const In=K;throw d.invalidateQueries({queryKey:x,exact:!0},{cancelRefetch:!1}),In}},n[23]=y.data,n[24]=x,n[25]=d,n[26]=p):p=n[26];const k=!!y.data&&!i;let P;n[27]!==N||n[28]!==p||n[29]!==k?(P={queryKey:N,queryFn:p,enabled:k,refetchInterval:Je,retry:!1},n[27]=N,n[28]=p,n[29]=k,n[30]=P):P=n[30];const M=F(P).data??y.data?.describe,U=bo({hasProject:!!e,hasServeConnection:!!s,runtime:r,v8:a,githubSite:w.data===He?"not-owned":w.data?"ready":ft(w)?"error":"loading",sandboxSite:Po({data:$.data,isError:ft($),workingTreeReady:u})});if(U==="pending")return{kind:"pending",...f};if(U==="retrying-sandbox")return{kind:"pending",retrying:"sandbox",...f};if(U==="legacy")return{kind:"legacy"};if(U==="protocol-github")return{..._e(f,w.data),site:l};if(U==="site-not-owned-github")return{kind:"unavailable",...f,siteNotOwned:!0};if(U==="protocol-sandbox")return _e(f,$.data);if(U==="unavailable-github"){let K;return n[31]!==f?(K={kind:"unavailable",...f},n[31]=f,n[32]=K):K=n[32],K}const R=y.error??y.failureReason,H=s?.endpoint??"";let J;return n[33]!==M||n[34]!==y.data||n[35]!==y.failureCount||n[36]!==y.isError||n[37]!==H||n[38]!==R?(J=No({probed:y.data,isError:y.isError,failureCount:y.failureCount,failure:R,describe:M,endpoint:H}),n[33]=M,n[34]=y.data,n[35]=y.failureCount,n[36]=y.isError,n[37]=H,n[38]=R,n[39]=J):J=n[39],J}function xo(e){return e.state.status==="error"||e.state.data?.hasSchema===!1?Je:!1}function Ro(e){return Yn(e+1)}function To(e,t){return!(t instanceof j)&&!(t instanceof Ue)}function Po(e){return e.data!==void 0?"ready":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const $o=3;function No(e){const t=Bt("local",e.endpoint),n=e.probed?_e(t,{...e.probed,describe:e.describe??e.probed.describe}):null;return e.isError||e.failureCount>0?n?.kind==="protocol"&&!e.isError&&e.failureCount<$o?n:{kind:"unavailable",...t,problem:zn(e.failure)}:n??{kind:"pending",...t}}const vt={retry:2,refetchInterval:e=>e.state.status==="error"?Je:!1};function _e(e,t){return{kind:"protocol",...e,client:t.client,describe:t.describe,hasSchema:t.hasSchema,...t.hosted?{hosted:t.hosted}:{}}}function jo(e,t){return We(Me({endpoint:e,fetch:n=>fetch(n,{signal:we(t?AbortSignal.any([t,n.signal]):n.signal)})}))}function xe(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function Ao(e,t){return xe({...e,protocolSuffix:t.cacheKeySuffix})}function Mo(e,t,n){return e?t==="pending"?{ready:!1,failed:!1}:t==="unavailable"?{ready:!1,failed:!0}:n:{ready:!0,failed:!1}}function Lo(e,t){return JSON.stringify([e?.orgSlug,e?.virtualMcpId,e?.branch,vo(t)])}function Qo(e,t,n){const o=A.c(21),s=Z(),r=se(e?.virtualMcpId,e?.branch),i=e&&r.kind==="protocol"&&r.hosted?r:null;let a;o[0]!==i||o[1]!==e?(a=i&&e?Ao(e,i):"",o[0]=i,o[1]=e,o[2]=a):a=o[2];const l=lo(i?.hosted,a,t,n),c=e!==null;let f;o[3]!==r.kind||o[4]!==l||o[5]!==c?(f=Mo(c,r.kind,l),o[3]=r.kind,o[4]=l,o[5]=c,o[6]=f):f=o[6];const h=f,u=r.kind!=="legacy";let d;o[7]!==r||o[8]!==e?(d=Lo(e,r),o[7]=r,o[8]=e,o[9]=d):d=o[9];let v;o[10]!==r.kind||o[11]!==r.source||o[12]!==l||o[13]!==s||o[14]!==e?(v=()=>{if(l.retry(),!e||r.kind!=="unavailable")return;const w=r.source;s.resetQueries({queryKey:g.contentBackend(e.orgSlug,e.virtualMcpId,...w==="local"?["local"]:[e.branch,w])})},o[10]=r.kind,o[11]=r.source,o[12]=l,o[13]=s,o[14]=e,o[15]=v):v=o[15];let b;return o[16]!==h||o[17]!==u||o[18]!==d||o[19]!==v?(b={...h,v8:u,scopeKey:d,retry:v},o[16]=h,o[17]=u,o[18]=d,o[19]=v,o[20]=b):b=o[20],b}function Ht(e){const t=A.c(12);let n;t[0]!==e?(n=De.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[s,r]=Mn(o,null),i=Qe(e);let a;t[2]!==s||t[3]!==e?(a=e?ot(s):null,t[2]=s,t[3]=e,t[4]=a):a=t[4];const c=i?null:a;let f,h;t[5]!==r?(f=d=>r(ot(d)),h=()=>r(null),t[5]=r,t[6]=f,t[7]=h):(f=t[6],h=t[7]);let u;return t[8]!==c||t[9]!==f||t[10]!==h?(u={url:c,setUrl:f,clear:h},t[8]=c,t[9]=f,t[10]=h,t[11]=u):u=t[11],u}const bt=6e4,Uo=2147483647;function Bo(e,t){if(e===null||e.trim()==="")return bt;const n=e.trim(),o=/^\d+(?:\.\d+)?$/.test(n)?Number(n)*1e3:/^[A-Za-z]{3}, /.test(n)?Math.max(0,Date.parse(n)-t):Number.NaN;return Number.isFinite(o)&&o>=0&&o<=Uo?o:bt}class Jt extends Error{constructor(t,n,o,s=Date.now()){super(t),this.status=n,this.name="ContentResponseError",this.retryAt=n===429?s+Bo(o,s):null}status;retryAt}function Fo(e,t,n=Date.now()){const o=Pt(5e3,1e3,e,2,0);return t instanceof Jt&&t.retryAt!==null?Math.max(o,t.retryAt-n):o}async function Ye(e,t){const n=await e.json().catch(()=>null),o=n!==null&&typeof n=="object"&&"error"in n&&typeof n.error=="string"?n.error:`${t} failed (${e.status})`;throw new Jt(o,e.status,e.headers.get("retry-after"))}function Co(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function wt(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}function me(e,t,n){return["decofile-write",e,t,n]}function Vo(e,t,n){return{id:me(e,t,n).join(":")}}class Ge extends Error{constructor(t,n,o=[],s=!1){super(n),this.blocks=t,this.fields=o,this.carriedStored=s,this.name="BlockConflictError"}blocks;fields;carriedStored}function ze(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function Xe(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function Ho(e,t){return Ye(e,t)}function Jo(e,t,n){e.setQueryData(g.decofileDraft(ze(t)),n)}function Wo(e,t){return e.getQueryData(g.decofileDraft(ze(t)))??null}async function Yo(e,t){return(await fetch(Xe(e),{cache:"no-store",headers:{"if-none-match":`"${t}"`}}).catch(()=>null))?.status===200}function _r(e){const t=A.c(4);let n;t[0]!==e?(n=g.decofileDraft(e?ze(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Go,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:s}=F(o);return s??null}async function Go(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function zo(e,t){const n=await fetch(Xe(t),{cache:"no-store"});if(!n.ok)return Ye(n,"Read decofile");const o=await n.json();return o.token&&Jo(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function xr(e,t){const n=await fetch(Xe(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const s=await n.json().catch(()=>({}));throw s.code==="block-conflict"?new Ge(s.blocks??[],s.error??"Block changed"):new Error(s.error??`Save failed (${n.status})`)}if(!n.ok)return Ho(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const Wt=3e3,Xo=15e3,Zo=2*6e4,Yt={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function Ko(e){return e<Zo?Wt:Xo}function qo(e,t=Yt){const n=t.now();let o=!1,s=!1,r=null;const i=()=>{o||(r=t.setTimeout(a,Ko(t.now()-n)))},a=()=>{if(r=null,o)return;const{read:l,skip:c}=e();if(s||t.hidden()||c?.()){i();return}s=!0;let f;try{f=l()}catch{f=void 0}Promise.resolve(f).catch(()=>{}).finally(()=>{s=!1}),i()};return i(),()=>{o=!0,r!==null&&t.clearTimeout(r)}}const pt=()=>0;function es(e,t,n=Yt){const o=L.useRef(t);o.current=t;const[s]=L.useState(()=>({polling:()=>qo(()=>o.current,n),idle:()=>()=>{}}));L.useSyncExternalStore(e?s.polling:s.idle,pt,pt)}function Gt(e,t){return pe(e,t)}function ts(e,t){return pe(e,"preview-fetch",{path:t})}function Rr(e){return Gt(e,"preview-invoke")}function Tr(e){return Gt(e,"catalog-invoke")}function zt(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 ns(){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&&zt(n))return n}return null}function os(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??ns();return n&&zt(n)?new URL(t,n).toString():ts(e,t)}function ss(e){return os(e,"/.decofile")}function rs(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function mt(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function is(e,t){const n=pe(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),s=rs(o.status);if(s==="absent")return{kind:"absent"};if(s==="unavailable")return{kind:"unavailable"};if(s==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const r=await o.json();return typeof r.content!="string"?{kind:"unavailable"}:{kind:"data",data:Jn(r.content)}}async function as(e,t){const n=await is(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function Pr(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)return Ye(n,"Read committed meta");try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function cs(e){return Le(e)?.metadata?.runtime?.path??null}function Re(e,t,n,o){const s=B(e),r=Object.keys(n?.changes??{}).find(a=>B(a)===s);if(r!==void 0&&n)return n.changes[r].baseVersion;const i=Object.keys(t?.draft??{}).some(a=>B(a)===s);if(t&&!i){const a=Object.keys(t.entries).find(l=>B(l)===s);return a===void 0?null:t.entries[a].version}return o?.[e]??null}class Xt extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function $r(e){return e instanceof j&&e.code===T.Conflict}function Zt(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 Ke extends Error{constructor(){super("The blocks kept changing while the change was saved"),this.name="HostedKeptChangingError"}}function Nr(e,t){return(t instanceof Ze||t instanceof Ke)&&(t.message=Kt(e,t,"github")),t}function Kt(e,t,n){if(t instanceof Ze)return e("siteEditor.save.draftUnread");if(t instanceof Ke)return e("siteEditor.save.keptChanging");if(t instanceof Ge)return t.message;if(n==="local")return us(e,t);if(t instanceof j)switch(t.code){case T.Conflict:return e("siteEditor.save.conflict");case T.ReadOnly:return e("siteEditor.save.readOnly");case T.InvalidBlock:case T.InvalidParams:return e("siteEditor.save.invalid");case T.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function ls(e,t){if(t==="local"||e instanceof Ge||e instanceof Ze||e instanceof Ke)return null;if(e instanceof j){const n=e.code===T.InvalidBlock||e.code===T.InvalidParams?Zt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function us(e,t){if(t instanceof Xt)return e("decoServe.save.serverGone");if(t instanceof j)switch(t.code){case T.Conflict:return e("decoServe.save.conflict");case T.ReadOnly:return e("decoServe.save.readOnly");case T.InvalidBlock:case T.InvalidParams:return e("decoServe.save.invalid",{detail:Zt(t)});case T.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function fs(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function ds(e,t){const[n,o]=L.useState(e),s=L.useRef(null);return e&&!n&&o(!0),L.useEffect(()=>{if(e){s.current??=Date.now();return}if(!n)return;const r=()=>{s.current=null,o(!1)},i=fs(s.current,Date.now(),t);if(i===0){r();return}const a=setTimeout(r,i);return()=>clearTimeout(a)},[e,n,t]),n}const hs="decocms:content-writes",Te=new Set;let G;function qt(){if(G!==void 0)return G;G=null;try{typeof BroadcastChannel=="function"&&(G=new BroadcastChannel(hs),G.addEventListener("message",e=>{const t=e.data?.cacheKey;if(typeof t=="string")for(const n of[...Te])n(t)}))}catch{G=null}return G}function gs(e){try{qt()?.postMessage({cacheKey:e})}catch{}}function vs(e){return qt(),Te.add(e),()=>{Te.delete(e)}}const en="__at=",tn="__test=",bs=/^[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 ws(e){return e.at!==void 0||Object.keys(e.tests??{}).length>0}function ee(e){return typeof e=="string"&&bs.test(e)}function St(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function ps(e){const t=e.tests??{};return[...e.at!==void 0?[en+St(e.at)]:[],...Object.keys(t).map(n=>tn+St(`${n}=${t[n]?"on":"off"}`))]}function yt(e,t){const o=[...e.split("&").filter(s=>s&&!s.startsWith(en)&&!s.startsWith(tn)),...t];return o.length>0?`?${o.join("&")}`:""}function de(e,t){const n=ps(t),o=e.indexOf("?"),s=o===-1?e:e.slice(0,o);if(ee(s))return s+yt(o===-1?"":e.slice(o+1),n);const r=e.lastIndexOf("@");if(r<=0)return e;const i=e.slice(0,r),a=i.indexOf("?"),l=a===-1?i:i.slice(0,a),c=a===-1?"":i.slice(a+1);return`${l}${yt(c,n)}${e.slice(r)}`}function jr(e,t,n){if(!ws(t))return e;try{const o=new URL(e),s=o.searchParams.get("__draft");return s&&s!=="off"?(o.searchParams.set("__draft",de(s,t)),o.toString()):ee(n)?(o.searchParams.set("__draft",de(n,t)),o.toString()):e}catch{return e}}function Ar(e,t,n="/"){if(!e||!ee(t))return null;try{const o=new URL(n,e);return o.searchParams.set("__draft",t),o.toString()}catch{return null}}function nn(e){return btoa(encodeURIComponent(e))}function Mr(e,t,n){const o=ms(e,t,n);return o.searchParams.set("__cb",crypto.randomUUID()),o.toString()}function ms(e,t,n){const o=new URL(e).origin,s=new URL(`/live/previews/${encodeURIComponent(t)}`,o);return s.searchParams.set("path","/"),s.searchParams.set("pathTemplate","/"),s.searchParams.set("props",nn(JSON.stringify({path:"/",sections:[{__resolveType:n}]}))),s}const Ss="__draft";function Lr(e){return`${`${e.apiHost}/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}?token=${e.token}`}@${e.version}`}const ys="off";function ks(e,t){if(!t)return e;const n=new URL(e);return n.searchParams.set(Ss,t),n.toString()}function Qr(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:s,...r}=e.pageBlock,i=JSON.stringify({__props:r,__decofile:e.decofile});return{src:o.toString(),body:i}}function Ur(e,t,n,o){const s=new URL(e).origin,r=new URL(`/live/previews/${encodeURIComponent(t)}`,s);r.searchParams.set("__d","");const i=[{__resolveType:"preview",block:n}];return o&&i.push(o),r.searchParams.set("props",nn(JSON.stringify({sections:i}))),r.toString()}function Br(e){return e.fastPreviewActive&&e.previewServerUrl?e.previewServerUrl:e.sandboxUrl??null}const kt="__variant=";function on(e,t,n){return`${e}@${t}=${n}`}function Fr(e,t){return!e||!t.multivariate||t.variants.length<=1?[]:t.index<0||t.index>=t.variants.length?[]:[on(e,"sections",t.index)]}function Cr(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[on(e.pageKey,o,e.selectedVariantIndex)]}function Vr(e,t){return[...t,...e]}function Os(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function qe(e,t){const n=e.lastIndexOf("@");if(n<=0)return e;const o=e.slice(0,n),s=o.indexOf("?"),r=s===-1?o:o.slice(0,s),a=[...s===-1?[]:o.slice(s+1).split("&").filter(c=>c&&!c.startsWith(kt)),...t.map(c=>kt+Os(c))],l=a.length>0?`?${a.join("&")}`:"";return`${r}${l}${e.slice(n)}`}function Hr(e,t,n=!1){if(t.length===0&&!n)return null;try{const o=new URL(e),s=o.hostname==="[::1]"?`localhost${o.port?`:${o.port}`:""}`:o.host;return qe(`${s}${o.pathname}@local`,t)}catch{return null}}function Jr(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",qe(o,t)),n.toString())}catch{return e}}function Es(e){const{pointer:t}=e;if(!t||t===ys)return null;const n=t.indexOf("?");return ee(n===-1?t:t.slice(0,n))||t.lastIndexOf("@")<=0?null:ee(e.heldRevision)&&e.forcedVariants.length===0?de(e.heldRevision,e.previewOptions):de(qe(t,e.forcedVariants),e.previewOptions)}function Ds(e,t){if(!e||!t)return null;try{return ks(e,t)}catch{return null}}function Wr(e,t,n){if(!e||!n)return null;try{return Ds(new URL(t,e).toString(),n)}catch{return null}}const he={forcedVariants:[],previewOptions:{}},ie=new Map,ae=new Map,Pe=new Map;function sn(e){for(const t of Pe.get(e)??[])t()}function rn(e,t){const n=ee(t)?t:null;(ae.get(e)??null)!==n&&(n?ae.set(e,n):ae.delete(e),sn(e))}function Is(e){return ae.get(e)??null}function _s(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Yr(e,t){const n=ie.get(e)??he,o=t??he;_s(n,o)||(t?ie.set(e,o):ie.delete(e),sn(e))}function xs(e){return ie.get(e)??he}function an(e,t){let n=Pe.get(e);return n||(n=new Set,Pe.set(e,n)),n.add(t),()=>{n.delete(t)}}function Rs(e){const t=A.c(3);let n,o;return t[0]!==e?(n=s=>an(e,s),o=()=>xs(e),t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,Ts)}function Ts(){return he}function Ps(e){const t=A.c(3);let n,o;return t[0]!==e?(n=s=>e?an(e,s):Ns,o=()=>e?Is(e):null,t[0]=e,t[1]=n,t[2]=o):(n=t[1],o=t[2]),L.useSyncExternalStore(n,o,$s)}function $s(){return null}function Ns(){}function Gr(e,t){const n=A.c(4),o=Rs(e),s=Ps(e);let r;return n[0]!==o||n[1]!==s||n[2]!==t?(r=Es({pointer:t,heldRevision:s,...o}),n[0]=o,n[1]=s,n[2]=t,n[3]=r):r=n[3],r}const cn={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},js=15e3,ge=new Map;function W(e,t){return`${e}/${t}`}function V(e){let t=ge.get(e);return t||(t={state:cn,listeners:new Set,previews:0,timer:null,discardListeners:new Set},ge.set(e,t)),t}function C(e,t){const n=V(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 ve(e){return ge.get(e)?.state??cn}function As(e,t){const n=V(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function zr(e){const t=V(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(Se(t),C(e,{phase:"idle"}))}}function Xr(e){const t=ge.get(e);!t||t.state.phase!=="reloading"||(Se(t),C(e,{phase:"idle"}))}function ln(e){const t=V(e);Se(t),C(e,{phase:"saving",inFlight:t.state.inFlight+1})}function ce(e,t){const n=V(e),o=Math.max(0,n.state.inFlight-1);if(o>0){C(e,{inFlight:o});return}if(!t.ok||n.previews===0){C(e,{phase:"idle",inFlight:o});return}un(e,t.navigates,o)}function un(e,t,n=0){const o=V(e);Se(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&C(e,{phase:"idle"})},js),C(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function Ms(e){return e?.kind==="protocol"&&e.source==="github"}async function le(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:s,branch:r,backend:i,cacheKey:a}=e,l=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:g.hostedReleases(o,s)}):null;if(i?.kind!=="protocol"){const v=a&&t.reread?n.invalidateQueries({queryKey:g.decofile(a)}):null;if(await Promise.all([l,v]),v&&t.kind!=="edit"){const b=W(o,s);C(b,{epoch:ve(b).epoch+1})}return{navigates:!1}}const c=r?g.protocolDraftRead(o,s,r):null,f=c?JSON.stringify(n.getQueryData(c)??null):null,h=l?[l]:[];if(a&&t.reread&&h.push(n.invalidateQueries({queryKey:g.decofile(a)})),a&&!t.adopted&&h.push(n.invalidateQueries({queryKey:g.contentChanges(a)})),r&&i.source==="sandbox"&&h.push(n.invalidateQueries({queryKey:Wn(o,s,r)})),Ms(i)&&c&&!t.adopted&&h.push(n.invalidateQueries({queryKey:c})),await Promise.all(h),t.kind!=="edit"){const v=W(o,s);C(v,{epoch:ve(v).epoch+1})}const u=c?JSON.stringify(n.getQueryData(c)??null):null,d=f!==u;return d&&await new Promise(v=>xt.schedule(v)),{navigates:d}}async function Ls(e,t){return ln(W(e.orgSlug,e.virtualMcpId)),fn(e,t)}function Ot(e){return e.branch?JSON.stringify(e.queryClient.getQueryData(g.protocolDraftRead(e.orgSlug,e.virtualMcpId,e.branch))??null):null}async function fn(e,t){const n=W(e.orgSlug,e.virtualMcpId),o=t.adopted?Ot(e):null;let s;try{s=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&&gs(e.cacheKey),rn(n,t.shownRevision?.(s)??null),t.adopted){const i=Ot(e)!==o;return i&&await new Promise(a=>xt.schedule(a)),ce(n,{ok:!0,navigates:i}),t.reread&&le(e,t).catch(()=>{}),s}let r=!1;try{({navigates:r}=await le(e,t))}catch{}finally{ce(n,{ok:!0,navigates:r})}return s}function Zr(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:s,branch:r}=e,i=W(o,s),a=new Set(t.blockKeys);for(const f of[...V(i).discardListeners])f(a);ln(i);let l=!1;const c=()=>(l=!0,fn(e,{kind:"discard",reread:!0,write:t.write}));return r?n.getMutationCache().build(n,{mutationKey:me(o,s,r),scope:Vo(o,s,r),mutationFn:c}).execute(void 0).catch(f=>{throw l||ce(i,{ok:!1,navigates:!1}),f}):c()}function Kr(e,t,n){const o=A.c(8);let s;o[0]!==e||o[1]!==t?(s=W(e,t),o[0]=e,o[1]=t,o[2]=s):s=o[2];const r=s;let i;o[3]!==n||o[4]!==r?(i=()=>{const l=V(r).discardListeners;return l.add(n),()=>{l.delete(n)}},o[3]=n,o[4]=r,o[5]=i):i=o[5];let a;o[6]!==r?(a=[r],o[6]=r,o[7]=a):a=o[7],L.useEffect(i,a)}function dn(e){const t=W(e.orgSlug,e.virtualMcpId);ve(t).inFlight>0||(rn(t,null),le(e,{kind:"external"}).then(({navigates:n})=>{const o=V(t);o.previews>0&&o.state.inFlight===0&&un(t,n)}).catch(()=>{}))}function Qs(e,t){const n=A.c(7);let o;n[0]!==e||n[1]!==t?(o=W(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const s=o;let r;n[3]!==s?(r=c=>As(s,c),n[3]=s,n[4]=r):r=n[4];const i=r;let a;n[5]!==s?(a=()=>ve(s),n[5]=s,n[6]=a):a=n[6];const l=a;return L.useSyncExternalStore(i,l,l)}const Us=500;function qr(e,t){const{phase:n}=Qs(e,t);return ds(n!=="idle",Us)}function Bs(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function hn(e,t){return g.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function ei(e,t,n,o){if(o?.source==="github"){const i=e.getQueryData(g.contentIndex(t));return i?oo(i,n):Fs(e,t,n)}const s=e.getQueryData(g.contentVersions(t));if(!s)return;if(Object.hasOwn(s,n))return s[n];const r=e.getQueryData(g.decofile(t));return r&&Object.hasOwn(r,n)?void 0:null}function gn(e,t){if(Object.hasOwn(e.changes,t))return e.changes[t];const n=B(t),o=Object.keys(e.changes).find(s=>B(s)===n);return o===void 0?void 0:e.changes[o]}function Fs(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(o)return vn(o,ye(e,t),n)}function vn(e,t,n){const o=gn(e,n);return o?.kind==="delete"?o.version??X:o?o.version:t.has(B(n))?X:null}function ti(e,t,n){const o=e.getQueryData(g.contentChanges(t));if(!o)return!1;const s=gn(o,n);return s?s.kind==="set"&&s.baseVersion===null:ye(e,t).has(B(n))}function ni(e,t){const n=e.getQueryData(g.decofile(t)),o=e.getQueryData(g.contentChanges(t));if(!n||!o)return null;const s=ye(e,t);return{blocks:n,versionOf:r=>vn(o,s,r)}}function ye(e,t){return new Set(e.getQueryData(g.contentDraftTombstones(t)))}function be(e,t,n,o){const s=B(n),r=ye(e,t);r.has(s)!==o&&(o?r.add(s):r.delete(s),Y(e),e.setQueryData(g.contentDraftTombstones(t),[...r]))}function bn(e,t,n,o){const s=o.revision,r=e.getQueryData(g.contentVersions(n)),i=Object.entries(o.versions??{}).map(([u,d])=>[u,d===X?null:d]),a=e.getQueryData(g.contentChanges(n)),l=e.getQueryData(g.contentIndex(n)),c=new Set(i.flatMap(([u])=>Re(u,l,a,r)===null?[u]:[])),f=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[v,b]of i){const w=Re(v,l,u,r);b!==null?d[v]={kind:"set",version:b,baseVersion:w}:w!==null?d[v]={kind:"delete",version:null,baseVersion:w}:delete d[v]}return{...u,changes:d,edited:!0}});for(const[u,d]of i)d!==null?be(e,n,u,!1):!f.has(B(u))&&c.has(u)&&be(e,n,u,!0);const h=o.revision;return h&&h!=="none"&&e.setQueryData(g.protocolDraftRead(t.orgSlug,t.virtualMcpId,t.branch),u=>u&&{...u,version:h}),s}function ke(e,t,n){Y(e),e.setQueryData(g.contentVersions(t),o=>{const s={...o};for(const[r,i]of Object.entries(n))i===null?delete s[r]:s[r]=i;return s})}function wn(e,t){const n=e.getMutationCache().findAll({mutationKey:me(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>mo(o.state.variables)))}function $e(e,t){e.resetQueries({queryKey:g.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function oe(e,t,n,o){try{return await o()}catch(s){const r=!(s instanceof j);throw t.source==="local"&&r?($e(e,n),new Xt(s)):(t.source==="local"&&Ae(s)&&$e(e,n),s)}}const Et=new WeakMap;function et(e){let t=Et.get(e);return t||(t={inFlight:new Map,rereading:new Set},Et.set(e,t)),t}function pn(e,t,n,o){const{inFlight:s}=et(e),r=s.get(o);if(r)return r;const i=tt(e,t,n,o,!0);return s.set(o,i),i.finally(()=>{s.get(o)===i&&s.delete(o)})}function Cs(e,t,n){const o=A.c(8),s=Z(),r=t?.orgSlug,i=t?.virtualMcpId,a=t?.branch;let l,c;o[0]!==e||o[1]!==a||o[2]!==n||o[3]!==r||o[4]!==s||o[5]!==i?(l=()=>{if(!e||!r||!i||!a)return;const f={orgSlug:r,virtualMcpId:i,branch:a},{rereading:h}=et(s);return vs(u=>{u===n&&(h.has(n)||(h.add(n),Hs(s,e,f,n).catch(Vs).finally(()=>h.delete(n))))})},c=[s,e,r,i,a,n],o[0]=e,o[1]=a,o[2]=n,o[3]=r,o[4]=s,o[5]=i,o[6]=l,o[7]=c):(l=o[6],c=o[7]),L.useEffect(l,c)}function Vs(){}async function Hs(e,t,n,o){const s=et(e).inFlight.get(o);return s&&await s.catch(()=>{}),pn(e,t,n,o)}async function tt(e,t,n,o,s){Y(e);const r=g.decofile(o),i=hn(n,t),a=g.contentRevision(o),l=g.contentVersions(o),c=e.getQueryData(r),f=e.getQueryData(l),u=e.getQueryData(i),d=e.getQueryData(a)??void 0,v=s&&c&&f?d?.revision:void 0,b=s&&u?d?.schemaVersion:void 0,w=g.contentChanges(o),_=e.getQueryData(w);if(t.source==="github"&&t.hosted)return Js(e,t,t.hosted,n,o,{conditional:s,seen:d,currentMeta:u,schemaIfNoneMatch:b,seenChanges:_});const[S,$,E]=await oe(e,t,n,()=>t.client.batch([{method:"blocks.list",params:v?{ifNoneMatch:v}:{}},{method:"schema.get",params:b?{ifNoneMatch:b}:{}},{method:"changes.list",params:Rt(_)}])),D=e.getQueryData(a)?.revision,I=D!==void 0&&D!==d?.revision;if(E?.ok){const k=I?null:Tt(_,E.result);k&&e.setQueryData(w,k)}else E&&t.source==="local"&&Ae(E.error)&&$e(e,n);if(!S?.ok)throw S?.error??new Error("no blocks.list");if(!$)throw new Error("no schema.get");const m=S.result,y=Ve($),O=$.ok&&!y?$.result:null;if(m.notModified&&(!c||!f)||O?.notModified&&!u)return tt(e,t,n,o,!1);const x=m.notModified?new Set:wn(e,n),N=m.notModified?c:po(m.blocks,c,x),p=y?Vt():O?O.notModified?u:O.schema:$.error;if(e.setQueryData(a,{revision:I?D:m.notModified?d?.revision:m.revision,schemaVersion:O?O.notModified?d?.schemaVersion:O.version??void 0:void 0}),e.setQueryData(r,N),!m.notModified){const k=e.getQueryData(l),P={...m.versions};for(const Q of x){const M=k?.[Q];M!==void 0?P[Q]=M:delete P[Q]}e.setQueryData(l,P)}return p instanceof j||e.setQueryData(i,p),!I&&!m.notModified&&c&&d?.revision&&m.revision!==d.revision&&dn({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:N,meta:p}}async function Js(e,t,n,o,s,r){const i=g.decofile(s),a=g.contentIndex(s),l=g.contentRevision(s),c=g.contentVersions(s),f=hn(o,t),h=g.contentChanges(s),u=e.getQueryData(a),d=r.conditional&&u?r.seen?.revision:void 0,[v,b,w]=await oe(e,t,o,()=>n.batch([{method:"cms.index",params:d?{ifNoneMatch:d}:{}},{method:"schema.get",params:r.schemaIfNoneMatch?{ifNoneMatch:r.schemaIfNoneMatch}:{}},{method:"changes.list",params:Rt(r.seenChanges)}])),_=e.getQueryData(a)??u,S=e.getQueryData(l)?.revision,$=S!==void 0&&S!==r.seen?.revision;if(w?.ok&&!$){const R=Tt(r.seenChanges,w.result);R&&e.setQueryData(h,R)}if(!v?.ok)throw v?.error??new Error("no cms.index");if(!b)throw new Error("no schema.get");const E=v.result,D=Ve(b),I=b.ok&&!D?b.result:null;if(E.notModified&&!u||I?.notModified&&!r.currentMeta)return tt(e,t,o,s,!1);const m=D?Vt():I?I.notModified?r.currentMeta:I.schema:b.error;m instanceof j||e.setQueryData(f,m);const y=I?I.notModified?r.seen?.schemaVersion:I.version??void 0:void 0,O=e.getQueryData(i)??{};if(E.notModified||$)return e.setQueryData(l,{revision:$?S:r.seen?.revision,schemaVersion:y}),e.setQueryData(i,O),{blocks:O,meta:m};const x={revision:E.revision,resolvedRef:E.resolvedRef,sequence:E.sequence,entries:E.entries,draft:E.draft};e.setQueryData(a,x);const N=!!r.seen?.revision&&x.revision!==r.seen.revision&&(!r.seen.revision.startsWith("s-")||!!u&&mn(u.draft,x.draft));N&&e.setQueryData(g.protocolDraftRead(o.orgSlug,o.virtualMcpId,o.branch),R=>R&&{...R,version:x.revision}),e.setQueryData(l,{revision:x.revision,schemaVersion:y});const p=wn(e,o),k=e.getQueryData(c)??{},P={},Q={},M=[];for(const[R,H]of Object.entries(O)){const J=x.entries[R];!J&&!p.has(R)||(P[R]=H,k[R]!==void 0&&(Q[R]=k[R]),J&&!p.has(R)&&k[R]!==J.version&&M.push(R))}return e.setQueryData(i,P),e.setQueryData(c,Q),M.length>0&&await Fe(e,n,s,M,p),_&&N&&Ws(_,x)&&dn({queryClient:e,orgSlug:o.orgSlug,virtualMcpId:o.virtualMcpId,branch:o.branch,backend:t,cacheKey:s}),{blocks:e.getQueryData(i)??P,meta:m}}function Ws(e,t){if(mn(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 mn(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 Ys(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 Ee(e){if(!(e instanceof j)||e.code!==T.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"))}async function Gs(e,t){if(!(e instanceof j)||e.code!==T.Conflict)return;const n=e.data?.entries;if(!n||typeof n!="object")return;const o=Object.entries(n);if(o.length===0)return;const s=t.set??{},r=new Set(t.delete??[]),i={};for(const[a,l]of o){const c=l?.actual;if(typeof c!="string"||(Object.hasOwn(s,a)?await Un(s[a]):r.has(a)?X:void 0)!==c)return;i[a]=c}return i}function zs(e,t){const n=Object.fromEntries(Object.entries(e.set??{}).filter(([s])=>!Object.hasOwn(t,s))),o=(e.delete??[]).filter(s=>!Object.hasOwn(t,s));return{...Object.keys(n).length>0?{set:n}:{},...o.length>0?{delete:o}:{}}}function re(e,t,n,o,s){Y(e),bn(e,t,n,{revision:e.getQueryData(g.contentRevision(n))?.revision??"",versions:s}),ke(e,n,Object.fromEntries(Object.entries(s).map(([r,i])=>[r,i===X?null:i]))),Qt(e,n,s,o.set??{})}async function oi(e,t,n,o,s,r){if(t.source==="github"){const a=[...Object.keys(s.set??{}),...s.delete??[]].filter(c=>!r||!Object.hasOwn(r,c));if(a.length>0)throw new Error(`A hosted save needs a precondition for every block it touches (missing: ${a.join(", ")})`);const l=Ln(s.set);if(l.length>0)throw new Error(`A hosted save can't write a block that isn't loaded (${l.join(", ")})`)}return Ls({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,h=r)=>oe(e,t,n,()=>t.client.blocksApply({set:f.set,delete:f.delete,...h?{ifMatch:Ys(h,f)}:{}}));let a;try{a=await i(s)}catch(f){const h=t.source==="github"?Ee(f):void 0;if(!h)throw f;const u=zs(s,h);Object.keys(h).length>0&&re(e,n,o,s,h);let d;try{d=await i(u)}catch(v){const b=Ee(v);b&&Object.keys(b).length>0&&re(e,n,o,u,b);const w=await Gs(v,u);if(!w)throw v;re(e,n,o,u,w);try{d=await i(u,{...r,...w})}catch(_){const S=Ee(_);throw S&&Object.keys(S).length>0&&re(e,n,o,u,S),_}}a={...d,versions:{...h,...d.versions}}}Y(e);const l=t.source==="github"?bn(e,n,o,a):a.revision;t.source==="github"&&Qt(e,o,a.versions??{},s.set??{}),e.setQueryData(g.contentRevision(o),f=>({...f,revision:l}));const c=a.versions??{};return ke(e,o,c),{revision:l,versions:c}}})}function Sn(e,t){if(!(e instanceof j))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 yn(e,t,n){if(!(n instanceof j))return;const o=n.data?.draft;if(!(!o||typeof o!="object"))for(const[s,r]of Object.entries(o))r===null&&be(e,t,s,!1)}function kn(e,t,n,o){Y(e),Qn(e,n,o);const s=o.block===null,r=e.getQueryData(g.contentVersions(t)),i=e.getQueryData(g.contentChanges(t)),a=Re(n,e.getQueryData(g.contentIndex(t)),i,r);if(i){const l=B(n),c=Object.fromEntries(Object.entries(i.changes).filter(([f])=>B(f)!==l));s?a!==null&&(c[n]={kind:"delete",version:null,baseVersion:a}):c[n]={kind:"set",version:o.version,baseVersion:a},e.setQueryData(g.contentChanges(t),{...i,changes:c,edited:!0})}be(e,t,n,s&&a===null),e.setQueryData(g.decofile(t),l=>{const c={...l};return s?delete c[n]:c[n]=o.block,c}),ke(e,t,{[n]:s?null:o.version}),so(e,t,n,o)}function si(e,t,n,o){if(t.source!=="github"||!(o instanceof j))return!1;yn(e,n,o);const s=o.data?.draft;if(!s||typeof s!="object")return!1;const r=Object.keys(s),i=r.map(a=>Sn(o,a));return r.length===0||i.some(a=>a===void 0)?!1:(e.cancelQueries({queryKey:g.decofile(n)}),r.forEach((a,l)=>{kn(e,n,a,i[l])}),!0)}async function ri(e,t,n,o,s,r){t.source==="github"&&yn(e,o,r);const i=t.source==="github"?Sn(r,s):void 0;if(i)return e.cancelQueries({queryKey:g.decofile(o)}),kn(e,o,s,i),!0;await e.invalidateQueries({queryKey:g.decofile(o)});let a;try{const c=(await oe(e,t,n,()=>t.client.changesGet({names:[s]}))).entries[s];if(c&&c.after===null&&c.version!==null)return!1;a={value:c?.after??null,version:c?.version??null},t.source==="github"&&e.setQueryData(g.contentChanges(o),f=>{if(!f)return f;const h={...f.changes};return c?.kind?h[s]={kind:c.kind,version:c.version,baseVersion:c.baseVersion}:delete h[s],{...f,changes:h,edited:!0}})}catch{const l=await oe(e,t,n,()=>t.client.blocksList({}));if(l.notModified)return!1;a={value:l.blocks[s]??null,version:l.versions[s]??null}}return e.setQueryData(g.decofile(o),l=>{const c={...l};return a.value===null?delete c[s]:c[s]=a.value,c}),ke(e,o,{[s]:a.version}),!1}function Xs(e){const t=A.c(17),n=Le(e?.virtualMcpId)?.metadata;let o;t[0]!==n?(o=It(n),t[0]=n,t[1]=o):o=t[1];const s=o;let r;t[2]!==e?.branch||t[3]!==e?.orgSlug||t[4]!==e?.virtualMcpId?(r=g.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[2]=e?.branch,t[3]=e?.orgSlug,t[4]=e?.virtualMcpId,t[5]=r):r=t[5];let i;t[6]!==e||t[7]!==s?(i=async()=>{const b=await _t(s,e.branch),w=b.pointer?.lastIndexOf("@")??-1;return{draft:b.pointer&&w>0?b.pointer.slice(0,w):null,version:b.pointer&&w>0?b.pointer.slice(w+1):b.etag}},t[6]=e,t[7]=s,t[8]=i):i=t[8];const a=!!e&&!!s;let l;t[9]!==r||t[10]!==i||t[11]!==a?(l={queryKey:r,queryFn:i,enabled:a,staleTime:Number.POSITIVE_INFINITY},t[9]=r,t[10]=i,t[11]=a,t[12]=l):l=t[12];const{data:c,isPending:f,isError:h}=F(l),u=!!e&&!!s&&f&&!h;if(!e||!c?.draft||!c.version){let b;return t[13]!==u?(b={pointer:null,pending:u},t[13]=u,t[14]=b):b=t[14],b}const d=`${c.draft}@${c.version}`;let v;return t[15]!==d?(v={pointer:d,pending:!1},t[15]=d,t[16]=v):v=t[16],v}function ii(e){return Xs(e).pointer}function ai(e){const t=A.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:Zs,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:s}=F(o);return s?.revision}async function Zs(){throw new Error("content revisions are set by reads and writes")}function nt(e,t){const n=A.c(6),{url:o}=Ht(e?.virtualMcpId),s=se(e?.virtualMcpId,e?.branch);if(!e)return"";let r;return n[0]!==s.cacheKeySuffix||n[1]!==s.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(r=s.kind!=="legacy"&&s.cacheKeySuffix!==void 0?xe({...e,protocolSuffix:s.cacheKeySuffix}):xe({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=s.cacheKeySuffix,n[1]=s.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=r):r=n[5],r}function ci(e,t){const n=A.c(46),{url:o}=Ht(e?.virtualMcpId),s=!!o,r=se(e?.virtualMcpId,e?.branch),i=r.kind==="protocol"?r:null,a=nt(e),l=t?.fetchEnabled??!0,c=cs(e?.virtualMcpId),f=$t(e?.virtualMcpId).runtime==="cms",h=Z();let u;n[0]!==a?(u=g.decofile(a),n[0]=a,n[1]=u):u=n[1];const d=u;Cs(i,i&&e?e:null,a);let v;n[2]!==e||n[3]!==h||n[4]!==d?(v=()=>{if(!e||h.isMutating({mutationKey:me(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const k=h.getQueryState(d);return k?.fetchStatus==="fetching"||Date.now()-(k?.dataUpdatedAt??0)<Wt/2},n[2]=e,n[3]=h,n[4]=d,n[5]=v):v=n[5];let b;n[6]!==f||n[7]!==s||n[8]!==e||n[9]!==i||n[10]!==h||n[11]!==d?(b=async()=>{if(e){if(!i&&f&&!s){const k=Wo(h,e)?.version;if(k&&!await Yo(e,k))return}await h.refetchQueries({queryKey:d,exact:!0},{cancelRefetch:!1})}},n[6]=f,n[7]=s,n[8]=e,n[9]=i,n[10]=h,n[11]=d,n[12]=b):b=n[12];let w;n[13]!==v||n[14]!==b?(w={skip:v,read:b},n[13]=v,n[14]=b,n[15]=w):w=n[15],es(!!t?.pollWhile&&!!e,w);const _=Ce(i?.hosted?a:"");let S;n[16]!==r.kind||n[17]!==f||n[18]!==l||n[19]!==a||n[20]!==s||n[21]!==o||n[22]!==c||n[23]!==e||n[24]!==i||n[25]!==h?(S=async()=>{if(i)return(await pn(h,i,e,a)).blocks;if(r.kind==="unavailable")throw Bs("decofile");if(s){const M=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(qs),U=M?.ok?wt(await M.text()):null;if(U)return U;const R=new Error("decofile unavailable (local tunnel unreachable)");throw R.status=502,R}if(f)return zo(h,e);const k=()=>as(e,Co(c,".deco/blocks.gen.json"));if(l){const M=await fetch(ss(e),{cache:"no-store"}).catch(Ks);if(M?.ok){const H=wt(await M.text());if(H)return H}const U=await k();if(U.kind==="data")return U.data;const R=new Error(`Failed to fetch decofile: ${M?.status??"network error"}`);throw R.status=mt({liveOk:!!M?.ok,liveStatus:M?.status,committedAbsent:U.kind==="absent"}),R}const P=await k();if(P.kind==="data")return P.data;const Q=new Error("decofile unavailable (preview down, no committed snapshot)");throw Q.status=mt({liveOk:!1,committedAbsent:P.kind==="absent"}),Q},n[16]=r.kind,n[17]=f,n[18]=l,n[19]=a,n[20]=s,n[21]=o,n[22]=c,n[23]=e,n[24]=i,n[25]=h,n[26]=S):S=n[26];const $=!!e&&r.kind!=="pending",E=i?0:3e4,D=i?.describe.pollIntervalMs,I=i?"always":void 0;let m;n[27]!==f||n[28]!==s||n[29]!==i?(m=(k,P)=>{if(i||f||s)return k<3;const Q=P.status;return Q!==502&&Q!==404&&k<2},n[27]=f,n[28]=s,n[29]=i,n[30]=m):m=n[30];let y;n[31]!==d||n[32]!==S||n[33]!==$||n[34]!==E||n[35]!==D||n[36]!==I||n[37]!==m?(y={queryKey:d,queryFn:S,enabled:$,staleTime:E,refetchInterval:D,refetchIntervalInBackground:!1,refetchOnWindowFocus:I,retry:m,retryDelay:Fo},n[31]=d,n[32]=S,n[33]=$,n[34]=E,n[35]=D,n[36]=I,n[37]=m,n[38]=y):y=n[38];const O=F(y);let x;n[39]!==_||n[40]!==O?(x=_&&O.data?to(_,O.data):void 0,n[39]=_,n[40]=O,n[41]=x):x=n[41];const N=x;let p;return n[42]!==N||n[43]!==i?.hosted||n[44]!==O?(p=i?.hosted&&N?{...O,data:N}:O,n[42]=N,n[43]=i?.hosted,n[44]=O,n[45]=p):p=n[45],p}function Ks(){return null}function qs(){return null}function li(e,t,n){return Qo(e,t,n)}function ui(e){const t=A.c(4),n=Z(),o=se(e?.virtualMcpId,e?.branch),s=nt(e),r=o.kind==="protocol"?o.hosted:void 0;let i;return t[0]!==s||t[1]!==n||t[2]!==r?(i=(a,l)=>ro(n,r,s,a,l),t[0]=s,t[1]=n,t[2]=r,t[3]=i):i=t[3],i}function fi(e,t){const n=A.c(3),o=se(e?.virtualMcpId,e?.branch),s=nt(e),r=Ce(o.kind==="protocol"&&o.hosted?s:"");let i;return n[0]!==r?.entries||n[1]!==t?(i=Object.entries(r?.entries??{}).filter(a=>{const[,l]=a;return t(l.meta?.type??"")}).map(er),n[0]=r?.entries,n[1]=t,n[2]=i):i=n[2],i}function er(e){const[t]=e;return t}const tr="site-editor-save",On={id:tr,description:void 0,action:void 0,cancel:void 0},di="site-editor-undo",Ne="site-editor-publish";function nr(e){const t=A.c(7),{label:n,detail:o}=e;let s;t[0]!==n?(s=z.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=s):s=t[1];let r;t[2]!==o?(r=z.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=r):r=t[3];let i;return t[4]!==s||t[5]!==r?(i=z.jsxs("details",{className:"mt-1 text-xs",children:[s,r]}),t[4]=s,t[5]=r,t[6]=i):i=t[6],i}function En(e,t){return t?z.jsx(nr,{label:e("siteEditor.details"),detail:t}):void 0}function hi(e,t,n){te.error(Kt(e,t,n),{...On,description:En(e,ls(t,n))})}function gi(e,t,n=!1){te.info(e(t?"sectionsEditor.reconcile.leftDeleted":"sectionsEditor.reconcile.keptTheirs"),{...On,description:e(t?n?"sectionsEditor.reconcile.leftDeletedNeverPublishedHint":"sectionsEditor.reconcile.leftDeletedHint":"sectionsEditor.reconcile.keptTheirsHint")})}const Dn={action:void 0,duration:void 0};function vi(e,t){te.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...Dn,id:Ne,description:void 0})}function bi(e,{headline:t,body:n,detail:o,retry:s,pending:r,tone:i="error"}){const a=En(e,o??null);te[i](t,{id:Ne,description:n&&a?z.jsxs(z.Fragment,{children:[z.jsx("p",{children:n}),a]}):n??a,action:s?{label:e("siteEditor.tryAgain"),onClick:l=>{l.preventDefault(),te.loading(r??e("thread.publishPopover.publishing"),{...Dn,id:Ne,description:void 0}),s()}}:void 0,duration:s?Number.POSITIVE_INFINITY:void 0})}function wi(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Ho as $,Ds as A,ws as B,as as C,Ft as D,Br as E,yr as F,Xs as G,W as H,Ps as I,Yr as J,Hr as K,de as L,ys as M,ks as N,jr as O,Jr as P,Mr as Q,Xr as R,zr as S,Ut as T,Qs as U,ai as V,Qr as W,Vo as X,me as Y,Ls as Z,is as _,pr as a,vo as a0,Ao as a1,Dr as a2,dt as a3,ht as a4,Ir as a5,Sr as a6,Or as a7,Gn as a8,En as a9,ei as aA,Jo as aB,xr as aC,Kr as aD,ni as aE,Ke as aF,_r as aG,ii as aH,Lr as aI,si as aJ,ee as aK,Ar as aL,bi as aM,di as aN,On as aO,Fe as aP,wn as aQ,to as aR,Ur as aS,Tr as aT,Fr as aU,Cr as aV,Vr as aW,wi as aa,ms as ab,hn as ac,nr as ad,Gr as ae,Wr as af,Qo as ag,os as ah,pn as ai,Bs as aj,Fo as ak,Pr as al,Ne as am,Dn as an,vi as ao,Zr as ap,gi as aq,ti as ar,Nr as as,Ge as at,$r as au,Hs as av,Ze as aw,oi as ax,ri as ay,hi as az,go as b,Ht as c,ui as d,wr as e,fi as f,qr as g,kr as h,mr as i,ci as j,li as k,Yn as l,zn as m,Nt as n,jo as o,gr as p,Rr as q,br as r,vr as s,ts as t,se as u,nt as v,Er as w,cs as x,Co as y,Es as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as ee,a4 as te,q as ne,r as E,j as t,B as Q,n as F,d_ as ae,a5 as ce,aN as me,aM as pe,aJ as de,aH as ue,aI as ge,aL as fe,aK as he,b7 as xe,t as C,dM as je,c as se,m as ke,_ as ve,X as ye,Z as Se,Y as be,K as H,gE as Ce}from"./index-Biams685.js";import{a as De}from"./SwitchHorizontal01-DRQUyYXI.js";import{D as we}from"./agent-icon-CmYgsdkA.js";import{s as Ne}from"./Trash01-BXZnDQzc.js";import{i as Pe}from"./Upload01-DkM_CW6J.js";import{i as ie}from"./Zap-DzFzGOQ3.js";import{S as Ae}from"./search-toggle-qYosTs_8.js";import{E as Y}from"./empty-state-CD43HEkx.js";import{C as Ee}from"./collection-tabs-BfGk19Xn.js";import{S as Me,F as Oe}from"./folder-icon-CIbEuHFJ.js";import{j as Te,k as Ie,n as Re}from"./use-org-fs-ZPuN9WFa.js";import{a7 as ze,R as Z,Z as _e}from"./chat-context-oV4F8WQc.js";import{c as $e}from"./context-shell-DabLWz4l.js";import"./AlertCircle-BuSYYXoB.js";import"./UserCheck01-Dd1TarPv.js";import"./Tool01-CIG9g9AW.js";import"./ArrowUp-DsFRA_-F.js";import"./ArrowLeft-CjBgi68F.js";import"./ArrowRight-BSOOXYJl.js";import"./BookOpen01-Bg7SPIQl.js";import"./Globe04-DByxWswA.js";import"./CheckCircle-CwkAQPvk.js";import"./TrendUp01-BXVcz0CP.js";import"./ChevronDown-Dq3-i4Ph.js";import"./ChevronSelectorVertical-Ce-S0bwE.js";import"./ChevronUp-CsGl40rv.js";import"./UserSquare-Dx7SMn8a.js";import"./LinkBroken01-DlxIHBPg.js";import"./CreditCard01-DyQlc3BQ.js";import"./File02-B-McavGu.js";import"./MessageCircle01-DboGgDYl.js";import"./Eye-DgggGLP1.js";import"./Image01-C-12Ic3A.js";import"./Key01-O_7ZqdlA.js";import"./LayoutLeft-CAJfUJ1M.js";import"./Minus-C8qbEmNR.js";import"./Monitor01-ByiCXP90.js";import"./Sun-DMx5ulRn.js";import"./Play-B1OcqbdZ.js";import"./Plus-DgAT_TKu.js";import"./SearchMd-CAmRp0LP.js";import"./ShoppingBag01-qRoCf3xL.js";import"./Users01-CrAD5jfs.js";import"./XClose-ChZfCB0S.js";import"./icon-button-D7LkPwOF.js";import"./tooltip-CqtvIcRI.js";import"./index-D4_P19LT.js";import"./badge-CT_Bowl_.js";import"./markdown-QFsCz8HO.js";import"./use-copy-D38lTrG-.js";import"./use-mobile-0AteUciZ.js";import"./use-panel-navigate-Du4Vt0nC.js";import"./thread-route-DmAvNVfz.js";import"./use-project-scope-V_yAQHXr.js";import"./repository-binding-CWTr70tX.js";import"./use-mcp-client-DwG9qZWg.js";import"./auth-D_64eYdt.js";import"./task-board-DfE7ACDs.js";import"./schema-D-rmQGG7.js";import"./file-preview-CIfFSMEa.js";import"./utils-Cj5LhXnA.js";import"./editor-um5vPMjZ.js";import"./file-type-icon-MJit4Xxk.js";import"./useInfiniteQuery-CSP4ZKWe.js";import"./infiniteQueryObserver-DviOrlp9.js";import"./use-view-draft-kind-B_9utcmK.js";import"./use-blog-view-D_eJjHyi.js";import"./use-organization-settings-BV6bWoGw.js";import"./thread-intent-B4ztyrl0.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-Ds--pRle.js";import"./session-runtime-OZnQWVyx.js";import"./use-entitlements-DczHLBrX.js";import"./use-ai-providers-D-W7KWam.js";import"./use-current-view-DJKRVR3b.js";import"./use-in-settings-N8ExD21K.js";import"./use-decopilot-events-DZT948GO.js";import"./require-capability-BEpAmIG-.js";import"./access-gate-C2FMXB7E.js";import"./capability-load-error-BuCmA5o8.js";import"./sections-V-F7INF6.js";import"./textarea-DDxBLXs2.js";import"./use-ask-in-chat-ChyvfgT2.js";import"./shell-layout-Dd3ZOJl-.js";import"./use-deployment-admin-IWWegkPe.js";import"./admin-fetch-BhTJlAsX.js";import"./use-org-notice-pbZd-uTd.js";import"./command-2E07YrgQ.js";import"./index-DY2XXBge.js";import"./integration-icon-C76s6rje.js";import"./project-icon-VgM1tY99.js";import"./use-navigate-to-agent-C6-ZqKGw.js";import"./use-debounced-value-Bih1VwpO.js";import"./new-project-dialog-CZtNDQaD.js";import"./label-B5koT7GN.js";import"./repository-picker-CAtWKBbx.js";import"./github-icon-llpq0MNv.js";import"./collection-search-Blzi887q.js";import"./new-project-store-DNJn4Jmh.js";import"./legacy-admin-welcome-dialog-D0q0NbRI.js";import"./drawer-XYh0Y76X.js";import"./required-auth-layout-CgZqM250.js";import"./use-org-sso-D48jSMd3.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 M;e[0]!==i.source||e[1]!==g.name?(M=re(i.source,g.name),e[0]=i.source,e[1]=g.name,e[2]=M):M=e[2];const{label:O,glyph:I}=M;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 Ks(){const s=ee(),{org:e}=te(),i=Te(),{remove:o,upload:c}=Ie("home"),a=ne(),n=E.useRef(null),[g,M]=E.useState(""),[O,I]=E.useState(L),[D,R]=E.useState(!1),[w,f]=E.useState(null),[m,N]=E.useState(null),[z,h]=E.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:M,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(Ee,{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(Me,{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{Ks as default};
|
|
1
|
+
import{b as ee,a4 as te,q as ne,r as E,j as t,B as Q,n as F,d_ as ae,a5 as ce,aN as me,aM as pe,aJ as de,aH as ue,aI as ge,aL as fe,aK as he,b7 as xe,t as C,dM as je,c as se,m as ke,_ as ve,X as ye,Z as Se,Y as be,K as H,gE as Ce}from"./index-BsAwgxIf.js";import{a as De}from"./SwitchHorizontal01-BU8z7oT_.js";import{D as we}from"./agent-icon-B9nZhdi2.js";import{s as Ne}from"./Trash01-aSl--BGd.js";import{i as Pe}from"./Upload01-DozMUWEF.js";import{i as ie}from"./Zap-NAfA60T9.js";import{S as Ae}from"./search-toggle-CMDWFPiy.js";import{E as Y}from"./empty-state-DxGz72GL.js";import{C as Ee}from"./collection-tabs-Wktk7Bil.js";import{S as Me,F as Oe}from"./folder-icon-BD8Yju3a.js";import{j as Te,k as Ie,n as Re}from"./use-org-fs-D2bsNlGU.js";import{a7 as ze,R as Z,Z as _e}from"./chat-context-BhwgXdxZ.js";import{c as $e}from"./context-shell-Bqoi0m2O.js";import"./AlertCircle-DA6gE5vw.js";import"./UserCheck01-3D5hYz4C.js";import"./Tool01-ymE-fOFX.js";import"./ArrowUp-DyF0Rx2O.js";import"./ArrowLeft-B8D7i2xh.js";import"./ArrowRight-C1EmTlL-.js";import"./BookOpen01-UxGmri2e.js";import"./Globe04-DD86hrsf.js";import"./CheckCircle-Bh1gNJET.js";import"./TrendUp01-Cr4FP2fV.js";import"./ChevronDown-uPv2ScPr.js";import"./ChevronSelectorVertical-CiFyE2Pu.js";import"./ChevronUp-BkmRXggG.js";import"./UserSquare-aJjYmjOR.js";import"./LinkBroken01-Ic71rSEU.js";import"./CreditCard01-C-H9qti1.js";import"./File02-DEjt2PPW.js";import"./MessageCircle01-CQjeMfQj.js";import"./Eye-DL5oRAI4.js";import"./Image01-BCiDUkCm.js";import"./Key01-CgRwsDr3.js";import"./LayoutLeft-DHg_jNr0.js";import"./Minus-BM2zRSMr.js";import"./Monitor01-C4OHhcX6.js";import"./Sun-CoJn-J4w.js";import"./Play-l838EjWq.js";import"./Plus-BzpqhVU8.js";import"./SearchMd-BhCfkG_O.js";import"./ShoppingBag01-KIefHp9K.js";import"./Users01-Cximoi8v.js";import"./XClose-Dq0BGBMq.js";import"./icon-button-CpBLMSxk.js";import"./tooltip-r0LfLYi3.js";import"./index-KBC7Pj7l.js";import"./badge-BUkSpOXa.js";import"./markdown-SwM1Ir6g.js";import"./use-copy-BFUDxfVH.js";import"./use-mobile-BwxeIsTr.js";import"./use-panel-navigate-DpEZACCY.js";import"./thread-route-sNjMl6Ie.js";import"./use-project-scope-C815BKEh.js";import"./repository-binding-BS9v5Fe_.js";import"./use-mcp-client-DXpTlXlJ.js";import"./auth-D0WiD-6X.js";import"./task-board-CZuAKwkd.js";import"./schema-CggWCz-G.js";import"./file-preview-CXliAtvL.js";import"./utils-DII4rh9V.js";import"./editor-B_YvqDEq.js";import"./file-type-icon-Bhy3vcyl.js";import"./useInfiniteQuery-C5Fx0PfA.js";import"./infiniteQueryObserver-CnD94meO.js";import"./use-view-draft-kind-1niLZJ6g.js";import"./use-blog-view-B-p1Bott.js";import"./use-organization-settings-BilLeNy9.js";import"./thread-intent-BNoxio0t.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-Bw3-M9_N.js";import"./session-runtime-BtkBTCEv.js";import"./use-entitlements-BRKIl3Rz.js";import"./use-ai-providers-CFArCH41.js";import"./use-current-view-C1-z4fIk.js";import"./use-in-settings-BT3nEhsO.js";import"./use-decopilot-events-CZR337Lj.js";import"./require-capability-Db5kMZvY.js";import"./access-gate-Cnf06l1a.js";import"./capability-load-error-DCMluNzB.js";import"./sections-DH2lycfv.js";import"./textarea-3iEFQij9.js";import"./use-ask-in-chat-DxfAfFUt.js";import"./shell-layout-DwJrXedk.js";import"./use-deployment-admin-DGQGQZ6E.js";import"./admin-fetch-BhTJlAsX.js";import"./use-org-notice-BLcA1Iw0.js";import"./command-BcxQrgUK.js";import"./index-Bi2fLJMb.js";import"./integration-icon-DbiCbrD7.js";import"./project-icon-BHcF2TIr.js";import"./use-navigate-to-agent-DjeX7xEq.js";import"./use-debounced-value-BkJoL4uj.js";import"./new-project-dialog-CrDlez-N.js";import"./label-D8u4gNcM.js";import"./repository-picker-CXtPhUQx.js";import"./github-icon-BoZrKkV3.js";import"./collection-search-Dj3oO1qn.js";import"./new-project-store-DleT4y6U.js";import"./legacy-admin-welcome-dialog-C4yFyjEg.js";import"./drawer-EGIO8vW1.js";import"./required-auth-layout-C_8jBLMB.js";import"./use-org-sso-DhdCpzK5.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 M;e[0]!==i.source||e[1]!==g.name?(M=re(i.source,g.name),e[0]=i.source,e[1]=g.name,e[2]=M):M=e[2];const{label:O,glyph:I}=M;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 Ks(){const s=ee(),{org:e}=te(),i=Te(),{remove:o,upload:c}=Ie("home"),a=ne(),n=E.useRef(null),[g,M]=E.useState(""),[O,I]=E.useState(L),[D,R]=E.useState(!1),[w,f]=E.useState(null),[m,N]=E.useState(null),[z,h]=E.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:M,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(Ee,{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(Me,{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{Ks as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _,m as N,j}from"./index-
|
|
1
|
+
import{c as _,m as N,j}from"./index-BsAwgxIf.js";import{T as k,R as z,a as D,b as S}from"./index-KFEtz5HA.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,eR as G}from"./index-
|
|
1
|
+
import{r as v,eR as G}from"./index-BsAwgxIf.js";import{b as de,d as fe,e as U,f as ge,g as pe,h as be,i as ve,C as Y,j as he,K as R,k as me,l as xe,m as Ie,s as Re}from"./task-key-Binbqohp.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 ye(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},Pe=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=G.createContext({activeIndex:-1,containerId:H,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:B,disabled:{draggable:!1,droppable:!1}});function Xe(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]),y=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&&y&&i(g)},[x,g,y,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:ye(g,f),strategy:s}),[C,l,b.draggable,b.droppable,m,g,h,f,d,s]);return G.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 _e(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:y,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:K}=ge({id:o,data:D,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...f}}),{active:T,activatorEvent:Z,activeNodeRect:ee,attributes:te,setNodeRef:P,listeners:re,isDragging:M,over:ne,setActivatorNodeRef:se,transform:oe}=pe({id:o,data:D,attributes:{...Ne,...n},disabled:m.draggable}),ae=be(K,P),S=!!T,X=S&&!y&&O(d)&&O(h),_=!w&&M,j=_&&X?oe:null,ie=X?j??(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,F=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:!F,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:K,setDraggableNodeRef:P,transform:$??ie,transition:le()};function le(){if($||ce&&p.current.newIndex===b)return Ee;if(!(_&&!ve(Z)||!u)&&(S||F))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=[R.Down,R.Right,R.Up,R.Left],je=(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 R.Down:r.top<d.top&&f.push(l);break;case R.Up:r.top>d.top&&f.push(l);break;case R.Left:r.left>d.left&&f.push(l);break;case R.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,y=d?.node.current;if(y&&g&&l&&d){const h=Ie(y).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:Re(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{Xe as S,q as a,B as r,je as s,_e as u,Pe as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as A,a4 as B,r as v,j as e,n as x,hq as k,gT as b,gf as y,gg as a,i7 as D,B as m,I as g,aN as z,aM as T,aJ as O,aH as R,aL as q,aK as F,b7 as M,E as C,t as c,c as U}from"./index-
|
|
1
|
+
import{b as A,a4 as B,r as v,j as e,n as x,hq as k,gT as b,gf as y,gg as a,i7 as D,B as m,I as g,aN as z,aM as T,aJ as O,aH as R,aL as q,aK as F,b7 as M,E as C,t as c,c as U}from"./index-BsAwgxIf.js";import{D as H}from"./domain-settings-BamU0icI.js";import{S as $}from"./switch-DEje7fmz.js";import{a as J,b as K,c as G,d as Q}from"./use-org-sso-DhdCpzK5.js";import{s as V}from"./Trash01-aSl--BGd.js";import{R as W}from"./require-capability-Db5kMZvY.js";import"./badge-BUkSpOXa.js";import"./select-DPXDtN3F.js";import"./index-BdQq_4o_.js";import"./index-KBC7Pj7l.js";import"./ChevronDown-uPv2ScPr.js";import"./ChevronUp-BkmRXggG.js";import"./access-gate-Cnf06l1a.js";import"./capability-load-error-DCMluNzB.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(q,{children:[e.jsx(F,{disabled:S.isPending,children:s("settings.orgSso.cancelButton")}),e.jsx(M,{onClick:w,disabled:S.isPending,variant:"destructive",children:s("settings.orgSso.removeButton")})]})]})})]})}function ue(){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{ue as default};
|