decocms 4.524.3 → 4.526.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ActiveShapeUtils-CZUL4aQf.js → ActiveShapeUtils-DC_uFkfj.js} +1 -1
- package/dist/client/assets/{AlertCircle-CHPvy_VM.js → AlertCircle-BD_uk8jv.js} +1 -1
- package/dist/client/assets/{AreaChart-DXZAxruT.js → AreaChart-T5mjvoB9.js} +1 -1
- package/dist/client/assets/{ArrowLeft-D_5CBumM.js → ArrowLeft-BW4hi-fE.js} +1 -1
- package/dist/client/assets/{ArrowUp-DhHGL7HY.js → ArrowUp-D7In3NHD.js} +1 -1
- package/dist/client/assets/{BarChart-D1RHjiDU.js → BarChart-D0_iZiOj.js} +1 -1
- package/dist/client/assets/{Building02-Cs-fRF4C.js → Building02-Dw5n9775.js} +1 -1
- package/dist/client/assets/{CartesianChart-B6XqwP69.js → CartesianChart-NHrVliZJ.js} +1 -1
- package/dist/client/assets/{CategoricalChart-CiyWbCkx.js → CategoricalChart-Dup_V6G1.js} +1 -1
- package/dist/client/assets/{CheckCircle-DFdmK-T2.js → CheckCircle-BnPGwhwQ.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-B7yaofOD.js → ChevronSelectorVertical-Bc1L64FX.js} +1 -1
- package/dist/client/assets/{ChevronUp-PedQ2gd6.js → ChevronUp-B_2ftJO2.js} +1 -1
- package/dist/client/assets/{Copy01-B6cJ_ygs.js → Copy01-sA0-K7LG.js} +1 -1
- package/dist/client/assets/{CreditCard01-bH_MgXhH.js → CreditCard01-lyKg_Ohv.js} +1 -1
- package/dist/client/assets/{DotsVertical-B50qkKfK.js → DotsVertical-BK4Fy8Nl.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-D3MOF1QH.js → ErrorBarContext-BZpAcgpU.js} +1 -1
- package/dist/client/assets/{Globe04-BvSQLcQH.js → Globe04-BAEL3SMQ.js} +1 -1
- package/dist/client/assets/{Image01-D6z5fxVv.js → Image01-DDkvI5Nm.js} +1 -1
- package/dist/client/assets/{Key01-DIVY2Gpo.js → Key01-BX6BY9_T.js} +1 -1
- package/dist/client/assets/{Link01-D806UI0V.js → Link01-xEj9KoHs.js} +1 -1
- package/dist/client/assets/{LinkBroken01-Be879sLY.js → LinkBroken01-DQGhuKN9.js} +1 -1
- package/dist/client/assets/{Minus-DVOE0qZc.js → Minus-Czq0iKR1.js} +1 -1
- package/dist/client/assets/{Monitor01-CP0zz7rW.js → Monitor01-D31PU3Iy.js} +1 -1
- package/dist/client/assets/{Play-DG-gbp_U.js → Play-AHwZFZb2.js} +1 -1
- package/dist/client/assets/{Plus-feGO5xhL.js → Plus-Dl2sBaoj.js} +1 -1
- package/dist/client/assets/{ReferenceLine-oNnV1mWS.js → ReferenceLine-DbFJQbfX.js} +1 -1
- package/dist/client/assets/{SearchMd-OqihyBBE.js → SearchMd-CPTG-cGa.js} +1 -1
- package/dist/client/assets/{Sector-BH34m5G1.js → Sector-DoDCEu0-.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-ZgB-qLs9.js → ShoppingBag01-Bnl1luer.js} +1 -1
- package/dist/client/assets/{Sun-DQ0xzUJx.js → Sun-DaQ4UYay.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Dsf5zpNu.js → SwitchHorizontal01-DDdcI_Kz.js} +1 -1
- package/dist/client/assets/{Tool01-PlDxztWD.js → Tool01-lXzjYHgk.js} +1 -1
- package/dist/client/assets/{Trash01-BqnutNRJ.js → Trash01-DuRmK_Vz.js} +1 -1
- package/dist/client/assets/{Upload01-CyyevXMg.js → Upload01-C0iYEe1U.js} +1 -1
- package/dist/client/assets/{UserSquare-Csbu2VpZ.js → UserSquare-CVuHc6NN.js} +1 -1
- package/dist/client/assets/{Users01-BSztUOd5.js → Users01-BZCA5rox.js} +1 -1
- package/dist/client/assets/{XClose-CGLyFs-P.js → XClose-D_c5VtJ7.js} +1 -1
- package/dist/client/assets/{ZoomOut-DTBYck8o.js → ZoomOut-6mAbwFTL.js} +1 -1
- package/dist/client/assets/{access-gate-CQo9WEtv.js → access-gate-emovLjaE.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BXhPQM8W.js → add-connection-dialog-BlF-9HgF.js} +1 -1
- package/dist/client/assets/agent-analytics-eg0FLES8.js +1 -0
- package/dist/client/assets/agent-app-C2u1s2rV.js +1 -0
- package/dist/client/assets/{agent-assets-DPXKGmqE.js → agent-assets-BAd1z_dv.js} +1 -1
- package/dist/client/assets/{agent-automation-68EhX00q.js → agent-automation-D0aT1OFy.js} +3 -3
- package/dist/client/assets/{agent-automations-XvbfNN1P.js → agent-automations-BlwkZbIc.js} +1 -1
- package/dist/client/assets/agent-calendar-C8huSLtG.js +1 -0
- package/dist/client/assets/{agent-connect-sources-D3zK6Sae.js → agent-connect-sources-B67Xzkom.js} +1 -1
- package/dist/client/assets/agent-deck-CsY1IJMK.js +1 -0
- package/dist/client/assets/{agent-e2e-DQcmFy3H.js → agent-e2e-R48p6SJ6.js} +1 -1
- package/dist/client/assets/agent-experiments-d1mGB0I-.js +1 -0
- package/dist/client/assets/{agent-file-JtT0MyWr.js → agent-file-C6-oAsv5.js} +1 -1
- package/dist/client/assets/{agent-hosting-BxPrxIfg.js → agent-hosting-J3iEXzR-.js} +1 -1
- package/dist/client/assets/{agent-icon-CTGtlw1z.js → agent-icon-DMtM72Tt.js} +1 -1
- package/dist/client/assets/agent-library-Co6OcioD.js +1 -0
- package/dist/client/assets/agent-library-file-s3V9TMH_.js +1 -0
- package/dist/client/assets/agent-monitor-DR59rgyn.js +1 -0
- package/dist/client/assets/{agent-overview-B9lC95oC.js → agent-overview-BwLxQOC8.js} +1 -1
- package/dist/client/assets/{agent-releases-OHw-HILT.js → agent-releases-Bv_Fj-fG.js} +1 -1
- package/dist/client/assets/agent-settings-DN6t98hS.js +1 -0
- package/dist/client/assets/{agent-site-editor-DL4MgFcw.js → agent-site-editor-DUzu_bGf.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-BizWsdC8.js +2 -0
- package/dist/client/assets/agent-site-editor-content-bHNeasNi.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-CTJyzsCD.js +1 -0
- package/dist/client/assets/agent-view-CwVHf1dh.js +1 -0
- package/dist/client/assets/{agent-view-guard-BrroWBJx.js → agent-view-guard-C33ioBBA.js} +1 -1
- package/dist/client/assets/{agents-list-DIpYtUlJ.js → agents-list-B_dpoV9N.js} +1 -1
- package/dist/client/assets/{ai-providers-DJSUQnD1.js → ai-providers-Bge9epIB.js} +1 -1
- package/dist/client/assets/{alert-GbAkes7m.js → alert-BagxECyU.js} +1 -1
- package/dist/client/assets/{analytics-sections-Bb2X2x1n.js → analytics-sections-D-M6iYAs.js} +1 -1
- package/dist/client/assets/analytics-tab-B1VZR-c0.js +2 -0
- package/dist/client/assets/api-keys-DRagwPnq.js +1 -0
- package/dist/client/assets/{api-keys-CUAWVknr.js → api-keys-mLcadUeH.js} +1 -1
- package/dist/client/assets/{app-editor-CyjHGv_R.js → app-editor-B39dLTjO.js} +1 -1
- package/dist/client/assets/{asset-utils-cXz86Lc9.js → asset-utils-Qf3MBvDM.js} +1 -1
- package/dist/client/assets/{auth-Dfomi5JO.js → auth-CODe_IGw.js} +1 -1
- package/dist/client/assets/{auth-catchall-CQPN8xxO.js → auth-catchall-Bq6t3RQb.js} +1 -1
- package/dist/client/assets/{auth-entry-CopJeOJe.js → auth-entry-CWQ1DjR2.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DlqDAzsj.js → auth-split-layout-N_F8g5or.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CIjqyOtu.js → authenticate-and-persist-oauth-miETlukP.js} +1 -1
- package/dist/client/assets/{automation-list-row-DjtEQ2qE.js → automation-list-row-D5XF29Op.js} +1 -1
- package/dist/client/assets/{automation-runs-Fh82uxKP.js → automation-runs-DJ07XO-E.js} +1 -1
- package/dist/client/assets/{automations-v0vsa1w4.js → automations-B1NIl2V1.js} +1 -1
- package/dist/client/assets/{autosend-1kVbs2RQ.js → autosend-3uc8bTVc.js} +1 -1
- package/dist/client/assets/{badge-Cd6N93gT.js → badge-DlHCn1A-.js} +1 -1
- package/dist/client/assets/{block-document-Eqc7jC1E.js → block-document-CU0om3ul.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-DmNovEJ2.js → blocks-preview-workspace-context-Bs9hknsf.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-EZ53-FeU.js → blocks-tab-states-CgmkhE5b.js} +1 -1
- package/dist/client/assets/{blog-schema-BIlyKinw.js → blog-schema-Cf2Q45ow.js} +1 -1
- package/dist/client/assets/{buckets-DeThgb1z.js → buckets-C8wYCyB4.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-BhOi567C.js → build-improve-prompt-doc-CieiO0m9.js} +1 -1
- package/dist/client/assets/{calendar-CZnHQIdE.js → calendar-Bkrc3Tn3.js} +1 -1
- package/dist/client/assets/{capability-load-error-BoUVRT1s.js → capability-load-error-ByfliPkI.js} +1 -1
- package/dist/client/assets/{category-editor-CRQwImqd.js → category-editor-BnfSIHWl.js} +1 -1
- package/dist/client/assets/{cdn-tab-DGJOOmwS.js → cdn-tab-Bia8Lu-O.js} +1 -1
- package/dist/client/assets/{chart-DIxDpRCA.js → chart-CgNZZhP9.js} +1 -1
- package/dist/client/assets/{chat-context-2letHrEJ.js → chat-context-BvGd3d4B.js} +1 -1
- package/dist/client/assets/{chat-draft-BamZUeXG.js → chat-draft-CxBIV5gW.js} +1 -1
- package/dist/client/assets/{checkbox-vkygLbK1.js → checkbox-DYPRxtdw.js} +1 -1
- package/dist/client/assets/{choose-editor-CvBlgOf7.js → choose-editor-lzUALJ0J.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DbYRVqF9.js → cli-auth-success-DCEv0dGc.js} +1 -1
- package/dist/client/assets/{client-icons-Byj2LmW_.js → client-icons-BGlfNbZa.js} +1 -1
- package/dist/client/assets/cms-settings-editor-Dq-4a_kO.js +1 -0
- package/dist/client/assets/{collapsible-DsyQMORE.js → collapsible-CQW9roHO.js} +1 -1
- package/dist/client/assets/{collection-detail-DWStyXoZ.js → collection-detail-BuEzbz9Y.js} +1 -1
- package/dist/client/assets/{collection-display-button-DxqDuoDs.js → collection-display-button-DWql8bbv.js} +1 -1
- package/dist/client/assets/{collection-search-BT_p6pKF.js → collection-search-C4Wx-QCL.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Bu9UKC3v.js → collection-table-wrapper-C78BbtoQ.js} +1 -1
- package/dist/client/assets/{collection-tabs-D6nWmqmK.js → collection-tabs--jJp2ESY.js} +1 -1
- package/dist/client/assets/{column-rules-1_e0Bdla.js → column-rules-CVWJNCag.js} +1 -1
- package/dist/client/assets/{combobox-C05HI-BC.js → combobox-CQVbSSH0.js} +1 -1
- package/dist/client/assets/{command-CPzIRDl7.js → command-BCnC3TbE.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-8bJuflHh.js → companion-mcps-section-BvoDqJGx.js} +1 -1
- package/dist/client/assets/{config-g4_iXJef.js → config-DA0hECT3.js} +1 -1
- package/dist/client/assets/{connect-layout-B0kvJrgY.js → connect-layout-DRegpYUF.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-Drua8oaC.js → connect-source-dialog-CgwCkNcq.js} +1 -1
- package/dist/client/assets/{connect-uOeiI1CS.js → connect-symmmDTG.js} +1 -1
- package/dist/client/assets/{connection-BHsOzStk.js → connection-D9ij5W2w.js} +1 -1
- package/dist/client/assets/{connection-card-CYaVyCqL.js → connection-card-Ds4cDjLL.js} +1 -1
- package/dist/client/assets/{connection-detail-C6xJbNuX.js → connection-detail-DrlA1Ahp.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-D-t8mb0f.js → connection-form-helpers-BPCfMFZi.js} +1 -1
- package/dist/client/assets/{connections-D-CMEpMd.js → connections-B9flO4yA.js} +1 -1
- package/dist/client/assets/content-tab-BVTaK5gN.js +22 -0
- package/dist/client/assets/{context-TIPHj43k.js → context-CTNoGJP0.js} +1 -1
- package/dist/client/assets/{context-menu-7c-Y-PHB.js → context-menu-DVvUVMuo.js} +1 -1
- package/dist/client/assets/{context-shell-n8IEtxwr.js → context-shell-B6eX4miz.js} +3 -3
- package/dist/client/assets/{core.esm-Bp5Q1Stg.js → core.esm-7J0R8lPd.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-mPrO9oSa.js → create-organization-dialog-Clkjs9zG.js} +1 -1
- package/dist/client/assets/{daily-pulse-C7I4Uxdj.js → daily-pulse-DTX6fglY.js} +1 -1
- package/dist/client/assets/{discover-7t1pJX8W.js → discover-BMP5MmHd.js} +1 -1
- package/dist/client/assets/{domain-settings-CXb5s0he.js → domain-settings-CA0QhXOB.js} +1 -1
- package/dist/client/assets/{drawer-CtTfZzW7.js → drawer-D2Rnb_2A.js} +1 -1
- package/dist/client/assets/{editor-BDmCsl05.js → editor-CFcE0Q6O.js} +1 -1
- package/dist/client/assets/{editor-classes-BJAtiMt8.js → editor-classes-C8l2uWj9.js} +1 -1
- package/dist/client/assets/{empty-state-BFtVVtPz.js → empty-state-B7gwb6En.js} +1 -1
- package/dist/client/assets/{empty-state-BpneGtoe.js → empty-state-BWR7Jy-d.js} +1 -1
- package/dist/client/assets/experiments-tab-BEtrD30X.js +1 -0
- package/dist/client/assets/{experiments-tab-choice-vFGVi3bn.js → experiments-tab-choice-BPWZ6-EI.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CF7y2wEt.js → extract-connection-data-TNmbX43n.js} +1 -1
- package/dist/client/assets/{feature-gate-CM-Nk9xN.js → feature-gate-DvDHZ9Mm.js} +1 -1
- package/dist/client/assets/{feature-paywall-CjqBZ6L8.js → feature-paywall-CF5xE385.js} +1 -1
- package/dist/client/assets/{file-explorer-BboVEb8_.js → file-explorer-CS8ncEOg.js} +2 -2
- package/dist/client/assets/{file-preview-Bvo7zdtc.js → file-preview-Duo4jala.js} +1 -1
- package/dist/client/assets/{file-share-button-CXYkYNE_.js → file-share-button-T0wDAb3T.js} +1 -1
- package/dist/client/assets/{file-type-icon-CjiJpbk5.js → file-type-icon-C3nhEJVa.js} +1 -1
- package/dist/client/assets/{folder-icon-BZUD34gC.js → folder-icon-nOlxOX5D.js} +1 -1
- package/dist/client/assets/{form-DrzlJwQH.js → form-DiOJGRXq.js} +1 -1
- package/dist/client/assets/{general-Cd6mSkL_.js → general-CfuztBKa.js} +1 -1
- package/dist/client/assets/{held-block-view-R3GhxO1l.js → held-block-view-BX5kI9L6.js} +3 -3
- package/dist/client/assets/{home-CrEXzaHC.js → home-CIp4mcn9.js} +1 -1
- package/dist/client/assets/{icon-button-j3Ikexya.js → icon-button-DBRjX149.js} +1 -1
- package/dist/client/assets/{index-BZXHvOuQ.js → index-8m5i8k8L.js} +1 -1
- package/dist/client/assets/{index-CPP16Pqo.js → index-BKbYYz_9.js} +1 -1
- package/dist/client/assets/{index-BjON6Ore.js → index-BwcojXtb.js} +1 -1
- package/dist/client/assets/{index-6M_m-_Us.js → index-C4TQ1HxV.js} +1 -1
- package/dist/client/assets/{index-BJ9m9LNK.js → index-C5hxtG-B.js} +48 -48
- package/dist/client/assets/{index-DyS4s94t.js → index-CEQNEhri.js} +1 -1
- package/dist/client/assets/{index-Da5shA_7.js → index-CKIGEOaR.js} +1 -1
- package/dist/client/assets/{index-Cs2qsEhb.js → index-CSFBWEpH.js} +1 -1
- package/dist/client/assets/{index-DT3sLrgG.js → index-CjgyzS_N.js} +1 -1
- package/dist/client/assets/{index-BhEe0I5z.js → index-CtP2SeqS.js} +1 -1
- package/dist/client/assets/index-DfpwvZQG.css +1 -0
- package/dist/client/assets/{index-B7a1uePd.js → index-S0DELbp3.js} +1 -1
- package/dist/client/assets/{index-Dj2ac1Ct.js → index-WbBBGlvR.js} +1 -1
- package/dist/client/assets/{index-DEhrG7UG.js → index-h0OzTGt5.js} +1 -1
- package/dist/client/assets/{index-redirect-Ch_11yeO.js → index-redirect-CVRDzXhR.js} +1 -1
- package/dist/client/assets/{index-DO1wPTie.js → index-rpRRVwY4.js} +1 -1
- package/dist/client/assets/{index-Zaz397OF.js → index-xUcGx-v6.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CM3ITLPo.js → infiniteQueryObserver-cbOSzSkb.js} +1 -1
- package/dist/client/assets/{infra-billing-D_W3RIFV.js → infra-billing-XSCNwrQM.js} +1 -1
- package/dist/client/assets/{input-DipMvobq.js → input-D2PyfPad.js} +1 -1
- package/dist/client/assets/{input-DTDcy6hY.js → input-Dt5Q4j50.js} +4 -4
- package/dist/client/assets/{integration-icon-gBiw8y2C.js → integration-icon-tGNPaW9N.js} +1 -1
- package/dist/client/assets/{jira-icon-Cus3NRDL.js → jira-icon-CFz7Llru.js} +1 -1
- package/dist/client/assets/{label-BWO7BDzN.js → label-BOjT8VGh.js} +1 -1
- package/dist/client/assets/{layout-C4eU6U_z.js → layout-DhRsFafF.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CDxdVAmP.js → legacy-agents-deep-B49sqXaq.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BTqRcXg6.js → legacy-main-redirect-COxrUPZf.js} +1 -1
- package/dist/client/assets/library-SvGtiu-I.js +1 -0
- package/dist/client/assets/{login-UOHS7fQN.js → login-CoLmyN-v.js} +1 -1
- package/dist/client/assets/{markdown-BG06zpZJ.js → markdown-B-00ZOm1.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CxONPSoj.js → mcp-app-renderer-CCB0FZaP.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C_vXn_zS.js → mcp-oauth-DVsOtQR9.js} +1 -1
- package/dist/client/assets/{mcp-oauth-hbfUsWSk.js → mcp-oauth-KanvJCH4.js} +1 -1
- package/dist/client/assets/{members-DiPd0w69.js → members-DHTdA9CE.js} +1 -1
- package/dist/client/assets/{memory-D7_gYCf3.js → memory-BYBvW9AV.js} +1 -1
- package/dist/client/assets/{mini-report-page-DudoCNBc.js → mini-report-page-NW8WIoT5.js} +1 -1
- package/dist/client/assets/{mock-board-COFBA38P.js → mock-board-CIopg7St.js} +3 -3
- package/dist/client/assets/{monaco-editor-Bp87HTy0.js → monaco-editor-zjNnLgmQ.js} +1 -1
- package/dist/client/assets/monitoring-cAdHMyPk.js +1 -0
- package/dist/client/assets/{monitoring-stats-row-DZiWF0MT.js → monitoring-stats-row-1Q8Z2Hv-.js} +1 -1
- package/dist/client/assets/{multi-select-ClUvymCl.js → multi-select-CdYbSc0c.js} +1 -1
- package/dist/client/assets/{mustache-SEzsgR-s.js → mustache-Kyny1r3W.js} +1 -1
- package/dist/client/assets/{named-rule-uses-DBpP8kZW.js → named-rule-uses-Bf97NaES.js} +1 -1
- package/dist/client/assets/{new-project-dialog-BIxGYry7.js → new-project-dialog-CLihIY3l.js} +1 -1
- package/dist/client/assets/{oauth-callback-CgnzMW_h.js → oauth-callback-Bxa5qlpI.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CrNuoNuA.js → oauth-callback-ai-provider-DO2-ZScF.js} +1 -1
- package/dist/client/assets/{onboarding-CPcIJ7Kl.js → onboarding-2ZGmpM3l.js} +1 -1
- package/dist/client/assets/{openai-conversation-BVVfXB0S.js → openai-conversation-Dq-_t63g.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-CGrVGbzf.js → optimistic-project-sidebar-views-BWPyOzxV.js} +1 -1
- package/dist/client/assets/{order-monitor-day-_COSpI9X.js → order-monitor-day-B6I3Kbql.js} +1 -1
- package/dist/client/assets/{organization-choice-DM-i-ste.js → organization-choice-Dfm2FKp6.js} +1 -1
- package/dist/client/assets/{orgs-DBGdo2ep.js → orgs-DTG6JzmV.js} +1 -1
- package/dist/client/assets/{page-seo-form-B-bTZXwI.js → page-seo-form-DiHazFky.js} +1 -1
- package/dist/client/assets/{pair-CeWIXyL1.js → pair-BkPRQRG3.js} +1 -1
- package/dist/client/assets/{parse-sections-CzJo2WgK.js → parse-sections-BDlriD2E.js} +1 -1
- package/dist/client/assets/{plan-6sf6fzbJ.js → plan-DcVKW3BC.js} +1 -1
- package/dist/client/assets/{plan-ladder-Co29049V.js → plan-ladder-Bk5SqgcV.js} +1 -1
- package/dist/client/assets/{popover-C5Dt3qOY.js → popover-C4qbExP3.js} +1 -1
- package/dist/client/assets/{post-calendar-DOKKScLr.js → post-calendar-DJZU4OZ1.js} +1 -1
- package/dist/client/assets/{post-editor-L6XkKTbk.js → post-editor-DQF_MOM6.js} +1 -1
- package/dist/client/assets/{preview-content-CY8QtGeB.js → preview-content-rF8fTTNl.js} +1 -1
- package/dist/client/assets/{preview-dialog-SFPfuPhe.js → preview-dialog-BfrEK7on.js} +1 -1
- package/dist/client/assets/{preview-panel-DG1XweCF.js → preview-panel-BrzMCTys.js} +1 -1
- package/dist/client/assets/{preview-tab-CppK1K1V.js → preview-tab-C3RlH6Tl.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-B-qJRXdq.js → product-picker-dialog-B5P5BBv6.js} +1 -1
- package/dist/client/assets/{profile-CogKW0ml.js → profile-DdZmTj-x.js} +1 -1
- package/dist/client/assets/{project-app-view-Bg0IXTwt.js → project-app-view-C3Wvj6A2.js} +1 -1
- package/dist/client/assets/project-apps-DHXOO_qz.js +1 -0
- package/dist/client/assets/{project-feed-BbnYaqgF.js → project-feed-BSHbWBLq.js} +1 -1
- package/dist/client/assets/{project-icon-OmAeiXOI.js → project-icon-CWNjOgyc.js} +1 -1
- package/dist/client/assets/project-reports-CgrGrcrP.js +1 -0
- package/dist/client/assets/project-tasks-boHD8FJZ.js +1 -0
- package/dist/client/assets/{projects-ScLrP0Sq.js → projects-BI8XIBgz.js} +1 -1
- package/dist/client/assets/{projects-empty-state-DySkSTbO.js → projects-empty-state-DFF28xbv.js} +1 -1
- package/dist/client/assets/{prompts-fqxplS8t.js → prompts-CQX3vudX.js} +1 -1
- package/dist/client/assets/record-editor-D49e-me9.js +1 -0
- package/dist/client/assets/{redirect-editor-CiqrxPXo.js → redirect-editor-D8btign0.js} +1 -1
- package/dist/client/assets/{releases-api-CughGviB.js → releases-api-BP4D_7BV.js} +1 -1
- package/dist/client/assets/reports-DDAjO-Mz.js +1 -0
- package/dist/client/assets/{reports-onboarding-CvtUysYm.js → reports-onboarding-BdX-I6in.js} +1 -1
- package/dist/client/assets/{reports-tab-DGGd_cJc.js → reports-tab-Ct6jl3M_.js} +2 -2
- package/dist/client/assets/{reports-DoXSUp0p.js → reports-yM866Rl-.js} +1 -1
- package/dist/client/assets/repositories-D4SUyeOs.js +1 -0
- package/dist/client/assets/{repositories-DiF_6MDk.js → repositories-DBqhhKXX.js} +1 -1
- package/dist/client/assets/{repository-binding-5kMOX4dj.js → repository-binding-WDk-SmGV.js} +1 -1
- package/dist/client/assets/{repository-import-picker-Cf-mDDmo.js → repository-import-picker-xZyEfZFE.js} +1 -1
- package/dist/client/assets/{repository-picker-BN84wENn.js → repository-picker-JSRbKdl_.js} +1 -1
- package/dist/client/assets/{require-capability-d9R-dYdO.js → require-capability-B54JdYhJ.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DojZ1KGX.js → required-auth-layout-CgpSpm9w.js} +1 -1
- package/dist/client/assets/{reset-password-DSQJZEJs.js → reset-password-BRnZ_BQL.js} +1 -1
- package/dist/client/assets/{resizable-DaKs1eh5.js → resizable-RRgAphZx.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-E0pJTGSy.js → resolve-tab-icon-C-lgKCi8.js} +1 -1
- package/dist/client/assets/{review-settings-B7m9uNKt.js → review-settings-1RLKDmF4.js} +1 -1
- package/dist/client/assets/{roles-sT7X7xzB.js → roles-Cu5BcmE_.js} +1 -1
- package/dist/client/assets/{route-BiPjYs2Q.js → route-CEjLqtoe.js} +1 -1
- package/dist/client/assets/route-CUdHqqnN.js +1 -0
- package/dist/client/assets/route-DPvDU9AN.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-BdO8UXfQ.js → sandbox-lifecycle-context-BCrUk0wr.js} +1 -1
- package/dist/client/assets/{schema-HyTKqr-p.js → schema-BXNU8wK3.js} +1 -1
- package/dist/client/assets/{schema-Bp5lazAd.js → schema-Br-RkdlQ.js} +1 -1
- package/dist/client/assets/{scroll-area-ButOmQch.js → scroll-area-EUJaQXLw.js} +1 -1
- package/dist/client/assets/{search-input-N6CaOC_1.js → search-input-VUL2ibQB.js} +1 -1
- package/dist/client/assets/{search-toggle-hVjf6-kQ.js → search-toggle-zvtLuz6H.js} +1 -1
- package/dist/client/assets/{secret-picker-DbQaPqx6.js → secret-picker-BUFFs_xD.js} +1 -1
- package/dist/client/assets/{secrets-CkR4uy6Z.js → secrets-CoXvVOZp.js} +1 -1
- package/dist/client/assets/{section-array-field-Lr-feKpQ.js → section-array-field-WuEC2hxv.js} +1 -1
- package/dist/client/assets/{sections-BM3hOdfC.js → sections-DiD18Znn.js} +1 -1
- package/dist/client/assets/sections-editor-Dn-HxEPO.js +1 -0
- package/dist/client/assets/{select-BwZ3fxwy.js → select-B8yvCqU-.js} +1 -1
- package/dist/client/assets/{select-model-B5VqF5aQ.js → select-model-Cjv3FBhJ.js} +1 -1
- package/dist/client/assets/{seo-editor-Bpy9Dzdq.js → seo-editor-DbEirwnW.js} +1 -1
- package/dist/client/assets/{separator-BJ59N-4S.js → separator-DRkT8HMb.js} +1 -1
- package/dist/client/assets/settings-tab-CAfdMYa9.js +1 -0
- package/dist/client/assets/{sheet-CFaQrFou.js → sheet-DDwhHigu.js} +1 -1
- package/dist/client/assets/{shell-layout-BmOtysoG.js → shell-layout-B7qkgzXU.js} +1 -1
- package/dist/client/assets/{site-draft-actions-DQSFILpp.js → site-draft-actions--anq5Oyn.js} +6 -6
- package/dist/client/assets/site-draft-view-BPqN3aH-.js +2 -0
- package/dist/client/assets/site-editor-DW0aLxmo.js +1 -0
- package/dist/client/assets/{site-editor-toast-Drt9__vU.js → site-editor-toast-Cyc0S6jd.js} +1 -1
- package/dist/client/assets/{skills-CuAtdce2.js → skills-D4BOyICd.js} +1 -1
- package/dist/client/assets/{slider-9xLURN_x.js → slider-DM-iwDAN.js} +1 -1
- package/dist/client/assets/{sortable.esm-DKvN4I2-.js → sortable.esm-CgWx-74N.js} +1 -1
- package/dist/client/assets/{sso-Bt0VIDB0.js → sso-CSG6lIvj.js} +1 -1
- package/dist/client/assets/{suggestion-B65JiyPM.js → suggestion-DtPrQaPS.js} +1 -1
- package/dist/client/assets/{switch-DAskixZA.js → switch-BI5z5Ju7.js} +1 -1
- package/dist/client/assets/{symbol-DHBzZbeR.js → symbol-COdkYi-n.js} +1 -1
- package/dist/client/assets/{synced-repos-CE8wN2_N.js → synced-repos-B1IVjrrq.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-CpaZMvdV.js → tab-icon-glyph-CIKU8YGE.js} +1 -1
- package/dist/client/assets/{table-gy7RNGr-.js → table-CjjNOaN4.js} +1 -1
- package/dist/client/assets/{tabs-BIh8PZDT.js → tabs-ZzbSttVx.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-T0yhZapD.js → task-assignee-avatar-C-hr4u9B.js} +1 -1
- package/dist/client/assets/{task-board-DDJJrv54.js → task-board-J8Vo2lzV.js} +1 -1
- package/dist/client/assets/{task-route-BuxqCGZd.js → task-route-t4uPoiKF.js} +1 -1
- package/dist/client/assets/{task-status-B-hiqAeK.js → task-status-OIhRo9y9.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-CACHd6vk.js → taskboard-analytics-D0rm1hjK.js} +1 -1
- package/dist/client/assets/{tasks-CPyoTCOO.js → tasks-BEWx2mVo.js} +1 -1
- package/dist/client/assets/tasks-DBLzQm7P.js +1 -0
- package/dist/client/assets/{textarea-B-cDk_e9.js → textarea-BLncutjk.js} +1 -1
- package/dist/client/assets/{thread-analytics-DKFvK1DN.js → thread-analytics-CK_sghas.js} +1 -1
- package/dist/client/assets/{thread-intent-DXpv35UG.js → thread-intent-DigI0g4t.js} +1 -1
- package/dist/client/assets/{thread-route-BZKbOQYe.js → thread-route-CYFdAsxP.js} +1 -1
- package/dist/client/assets/{thread-route-Dp-aglxM.js → thread-route-Dq4msobR.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-CRJRoIwG.js → thread-sheet-body-Di4oWDCC.js} +1 -1
- package/dist/client/assets/{time-range-picker-B1ueoxPR.js → time-range-picker-B6ilVQdd.js} +1 -1
- package/dist/client/assets/{toggle-group-B4WOnAP4.js → toggle-group-DJHavtFz.js} +1 -1
- package/dist/client/assets/{tool-namespace-BDVFYO2h.js → tool-namespace-Db1FE8-P.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CsFCKDkl.js → toolbar-icon-button-w6OpN7Jk.js} +1 -1
- package/dist/client/assets/{tooltip-BP50pkvP.js → tooltip-C9PLptTv.js} +1 -1
- package/dist/client/assets/{tooltipContext-C8XbU8o0.js → tooltipContext-DT0TA2xa.js} +1 -1
- package/dist/client/assets/{track-CDPTw9ZB.js → track-AB-V11dT.js} +1 -1
- package/dist/client/assets/{types-G5N7kkmB.js → types-DfI6bP71.js} +1 -1
- package/dist/client/assets/{url-slug-D6AdbSqw.js → url-slug-bePBUEDA.js} +1 -1
- package/dist/client/assets/{usage-stats-n069Pf6u.js → usage-stats-CgVbjgnU.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BCXdfWt4.js → use-ai-providers-Bc7K6JyD.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-2pgSelD5.js → use-apply-named-rule-BrUBMfGy.js} +1 -1
- package/dist/client/assets/{use-automations-Ch5lNT3Y.js → use-automations-DEVyZ6g0.js} +1 -1
- package/dist/client/assets/{use-autosave-DnUFhq5-.js → use-autosave-BvC5wGjm.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-Boq7M7MG.js → use-chat-layout-state-D10wfd91.js} +1 -1
- package/dist/client/assets/{use-clock-tick-C7RLnGnY.js → use-clock-tick-DtkR8iHs.js} +1 -1
- package/dist/client/assets/{use-connect-companion-w3O3zQJZ.js → use-connect-companion-BBA1nWqg.js} +1 -1
- package/dist/client/assets/{use-connection-SBf1IMNR.js → use-connection--nQEudkr.js} +1 -1
- package/dist/client/assets/{use-content-sync-BL9rGIyO.js → use-content-sync-BpAr_qkU.js} +1 -1
- package/dist/client/assets/{use-copy-Dgppamoo.js → use-copy-BYfqkrcX.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DE2rukKQ.js → use-create-virtual-mcp-kVxi7rbb.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-MUGqYczL.js → use-date-fns-locale-Qd9ZKJ-f.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-C_xNyGJY.js → use-debounced-autosave-_WnUD2A1.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Cf0I7A9v.js → use-debounced-value-o8_kTKtk.js} +1 -1
- package/dist/client/assets/{use-deco-credits-Dna90E4X.js → use-deco-credits-ChCk-7Ic.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-8w_hmlMJ.js → use-decopilot-events-DuiNHzOc.js} +1 -1
- package/dist/client/assets/{use-delete-connection-ClNsS7Ho.js → use-delete-connection-2dBbm2UZ.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-4YEWaFep.js → use-deployment-admin-DK09uyUD.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-Bc3gs7gV.js → use-fast-preview-draft-url-DUx_v0ir.js} +1 -1
- package/dist/client/assets/{use-file-configs-B-wH52y_.js → use-file-configs-emNeeY81.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-Ci3vPrJA.js → use-inbox-feed-gQNczY0E.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BIzBYJCu.js → use-infinite-scroll-tiBiQUrG.js} +1 -1
- package/dist/client/assets/{use-join-requests-DP8Apzuq.js → use-join-requests-DEdRn9mT.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-CYcYIai-.js → use-main-panel-tabs-zguLtTFu.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CNLX3LBK.js → use-mcp-auth-status-CzBbJJxr.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Do4_ndrI.js → use-mcp-client-Dehh-QD8.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BtZywK26.js → use-mcp-prompts-6zv9IXeR.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-D588moK7.js → use-mcp-tools-RlvKHjUU.js} +1 -1
- package/dist/client/assets/{use-mobile-CMu6UtqS.js → use-mobile-Bht8wONL.js} +1 -1
- package/dist/client/assets/{use-move-blocks-0Xns2gtz.js → use-move-blocks-DEI5xTJ9.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BhR34hZR.js → use-navigate-to-agent-R2geNLzm.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-C2ZKl_OJ.js → use-open-billing-url-BhHBrwI4.js} +1 -1
- package/dist/client/assets/{use-org-fs-Bmjx4Cik.js → use-org-fs-CPqLHgiA.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-BSAcLSvr.js → use-org-repo-syncs-B-jZVfS_.js} +1 -1
- package/dist/client/assets/{use-org-sso-C2CyZRUp.js → use-org-sso-COqujkwo.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DSCc1iIP.js → use-organization-roles-CAeTGvi6.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DMgbBKf8.js → use-organization-settings-c2KJ-rhg.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-o6edpcRi.js → use-panel-navigate-DlKiU4ru.js} +1 -1
- package/dist/client/assets/use-project-native-view-presence-CifUjYF7.js +1 -0
- package/dist/client/assets/{use-project-scope-2Tdoer5a.js → use-project-scope-Lvryvv_x.js} +1 -1
- package/dist/client/assets/{use-recent-apps-D4vko3CW.js → use-recent-apps-C9vG5TR3.js} +1 -1
- package/dist/client/assets/{use-releases-CZIw49MO.js → use-releases-CzZzLiYc.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-D1hUsQ-k.js → use-reports-diagnostic-Bf-lUYQW.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-BGso5ik2.js → use-sandbox-events-PM3dvDwL.js} +1 -1
- package/dist/client/assets/{use-secrets-B4A-mk96.js → use-secrets-A7DHlNXm.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-7CyzrhDh.js → use-section-preview-base-LBz28XAj.js} +1 -1
- package/dist/client/assets/{use-session-runtime-CbMaO8p7.js → use-session-runtime-Dlgl4ufa.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-CI6KBWLr.js → use-sidebar-collapsed-VHTBmB5o.js} +1 -1
- package/dist/client/assets/{use-tags-lzJX123E.js → use-tags-CUQEvOLk.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BzMGYkMt.js → use-task-board-analytics-DVyt-Yqg.js} +1 -1
- package/dist/client/assets/{use-task-board-events-DoQeMblf.js → use-task-board-events-Cjw4-qyi.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-C1DrMHVS.js → use-task-board-item-prs-B5KO5oDj.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DKj0uikU.js → use-task-metadata-WYOfWDrq.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-C147IXlL.js → use-thread-analytics-CpHE9wpn.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-sdt1CHHh.js → use-thread-outputs-uAgeAbTT.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-wSSEyg4B.js +1 -0
- package/dist/client/assets/{useQueries-B2KTxxDE.js → useQueries-gBucEmF_.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Bj1LgSIL.js +1 -0
- package/dist/client/assets/{users-B-OmSt3n.js → users-AQXsmt0e.js} +1 -1
- package/dist/client/assets/{utils-muk7Isuo.js → utils-B8OWeF28.js} +1 -1
- package/dist/client/assets/{variant-calendar-DE-GxRhT.js → variant-calendar-BVmrQa_2.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-CDXRGILn.js → variant-matcher-override-CdLkXK72.js} +1 -1
- package/dist/client/assets/{virtual-mcp-C5K9GZ-3.js → virtual-mcp-CtaYyY8_.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-BzTIkVFy.js → watch-sse-pool-CTyhEpc6.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server.js +81 -81
- package/package.json +1 -1
- package/dist/client/assets/agent-analytics-C4isBTY7.js +0 -1
- package/dist/client/assets/agent-app-BakS5Mpg.js +0 -1
- package/dist/client/assets/agent-calendar-rlwx6fiZ.js +0 -1
- package/dist/client/assets/agent-deck-uq6T-H5n.js +0 -1
- package/dist/client/assets/agent-experiments-D3cQ-WP1.js +0 -1
- package/dist/client/assets/agent-library-C3l8PEn-.js +0 -1
- package/dist/client/assets/agent-library-file-CjRMeR9i.js +0 -1
- package/dist/client/assets/agent-monitor-BfPm0PfR.js +0 -1
- package/dist/client/assets/agent-settings-C3PrzQdK.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CrwcPx-x.js +0 -2
- package/dist/client/assets/agent-site-editor-content-DOS83K5A.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-Cuy-72sw.js +0 -1
- package/dist/client/assets/agent-view-DIoRN3S4.js +0 -1
- package/dist/client/assets/analytics-tab-BmRbRV7j.js +0 -2
- package/dist/client/assets/api-keys-CYNApwkv.js +0 -1
- package/dist/client/assets/campaigns-view-keHuDNLa.js +0 -1
- package/dist/client/assets/cms-settings-editor-2-st_NGk.js +0 -1
- package/dist/client/assets/content-tab-BplT8Wwk.js +0 -22
- package/dist/client/assets/experiments-tab-CLMcteix.js +0 -1
- package/dist/client/assets/index-BQfNeaI1.css +0 -1
- package/dist/client/assets/library-CRTbwohf.js +0 -1
- package/dist/client/assets/monitoring-KjkBz5Hy.js +0 -1
- package/dist/client/assets/named-rule-view-CIxMNPIR.js +0 -1
- package/dist/client/assets/project-apps-BWyBTcjU.js +0 -1
- package/dist/client/assets/project-reports-C4fNYK5h.js +0 -1
- package/dist/client/assets/project-tasks-CiUIlBvj.js +0 -1
- package/dist/client/assets/record-editor-Cd5kCJv3.js +0 -1
- package/dist/client/assets/reports-D4nL6cfo.js +0 -1
- package/dist/client/assets/repositories-CX881Zmd.js +0 -1
- package/dist/client/assets/route-CO4TvlsY.js +0 -1
- package/dist/client/assets/route-qbvcUo1A.js +0 -1
- package/dist/client/assets/sections-editor-DLgM9lBb.js +0 -1
- package/dist/client/assets/settings-tab-CA-W7UU2.js +0 -1
- package/dist/client/assets/site-draft-view-FIwQQWqm.js +0 -2
- package/dist/client/assets/site-editor-pGVB_SVm.js +0 -1
- package/dist/client/assets/tasks-CyRF0ujk.js +0 -1
- package/dist/client/assets/use-project-native-view-presence-CiNgXr_r.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Cq3QQD7o.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-jjzI6K-a.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-site-editor-DUzu_bGf.js","assets/index-C5hxtG-B.js","assets/index-DfpwvZQG.css","assets/chat-context-BvGd3d4B.js","assets/use-panel-navigate-DlKiU4ru.js","assets/thread-route-Dq4msobR.js","assets/use-project-scope-Lvryvv_x.js","assets/repository-binding-WDk-SmGV.js","assets/use-mcp-client-Dehh-QD8.js","assets/auth-CODe_IGw.js","assets/autosend-3uc8bTVc.js","assets/thread-intent-DigI0g4t.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-CTyhEpc6.js","assets/task-board-J8Vo2lzV.js","assets/schema-Br-RkdlQ.js","assets/slugify-CEUa2lfQ.js","assets/use-decopilot-events-DuiNHzOc.js","assets/use-ai-providers-Bc7K6JyD.js","assets/location-V0VwTJTt.js","assets/use-organization-settings-c2KJ-rhg.js","assets/site-draft-actions--anq5Oyn.js","assets/separator-DRkT8HMb.js","assets/site-editor-toast-Cyc0S6jd.js","assets/use-session-runtime-Dlgl4ufa.js","assets/experiments-tab-choice-BPWZ6-EI.js","assets/sandbox-url-D3mC8qhT.js","assets/utils-B8OWeF28.js","assets/ZoomOut-6mAbwFTL.js","assets/Image01-DDkvI5Nm.js","assets/use-sandbox-events-PM3dvDwL.js","assets/sandbox-git-api-CH_-QFpD.js","assets/shell-layout-B7qkgzXU.js","assets/Building02-Dw5n9775.js","assets/UserSquare-CVuHc6NN.js","assets/agent-icon-DMtM72Tt.js","assets/AlertCircle-BD_uk8jv.js","assets/Tool01-lXzjYHgk.js","assets/ArrowUp-D7In3NHD.js","assets/ArrowLeft-BW4hi-fE.js","assets/LinkBroken01-DQGhuKN9.js","assets/ShoppingBag01-Bnl1luer.js","assets/CheckCircle-BnPGwhwQ.js","assets/ChevronUp-B_2ftJO2.js","assets/ChevronSelectorVertical-Bc1L64FX.js","assets/Copy01-sA0-K7LG.js","assets/CreditCard01-lyKg_Ohv.js","assets/DotsVertical-BK4Fy8Nl.js","assets/Globe04-BAEL3SMQ.js","assets/SwitchHorizontal01-DDdcI_Kz.js","assets/Key01-BX6BY9_T.js","assets/Link01-xEj9KoHs.js","assets/Minus-Czq0iKR1.js","assets/Monitor01-D31PU3Iy.js","assets/Sun-DaQ4UYay.js","assets/Play-AHwZFZb2.js","assets/Plus-Dl2sBaoj.js","assets/SearchMd-CPTG-cGa.js","assets/Trash01-DuRmK_Vz.js","assets/Upload01-C0iYEe1U.js","assets/Users01-BZCA5rox.js","assets/XClose-D_c5VtJ7.js","assets/use-clock-tick-DtkR8iHs.js","assets/command-BCnC3TbE.js","assets/index-BKbYYz_9.js","assets/integration-icon-tGNPaW9N.js","assets/project-icon-CWNjOgyc.js","assets/new-project-dialog-CLihIY3l.js","assets/label-BOjT8VGh.js","assets/repository-import-picker-xZyEfZFE.js","assets/use-navigate-to-agent-R2geNLzm.js","assets/repository-picker-JSRbKdl_.js","assets/tooltip-C9PLptTv.js","assets/index-xUcGx-v6.js","assets/useInfiniteQuery-wSSEyg4B.js","assets/infiniteQueryObserver-cbOSzSkb.js","assets/collection-search-C4Wx-QCL.js","assets/use-debounced-value-o8_kTKtk.js","assets/required-auth-layout-CgpSpm9w.js","assets/use-org-sso-COqujkwo.js","assets/shell-layout-CE2Eihra.css","assets/toolbar-icon-button-w6OpN7Jk.js","assets/popover-C4qbExP3.js","assets/tabs-ZzbSttVx.js","assets/active-indicator-CCMhAsc_.js","assets/use-releases-CzZzLiYc.js","assets/serial-task-queue-CGOeQgpr.js","assets/virtual-mcp-CtaYyY8_.js","assets/url-slug-bePBUEDA.js","assets/use-fast-preview-draft-url-DUx_v0ir.js","assets/section-preview-url-7zfngvgW.js","assets/preview-link-C762yHOt.js","assets/variant-draft-pointer-BeAKcq_c.js","assets/parse-sections-BDlriD2E.js","assets/index-CEQNEhri.js","assets/tool-namespace-Db1FE8-P.js","assets/drawer-D2Rnb_2A.js","assets/use-mobile-Bht8wONL.js","assets/use-mcp-prompts-6zv9IXeR.js","assets/usage-stats-CgVbjgnU.js","assets/form-DiOJGRXq.js","assets/utils-CVEq3hMx.js","assets/markdown-B-00ZOm1.js","assets/use-copy-BYfqkrcX.js","assets/input-Dt5Q4j50.js","assets/icon-button-DBRjX149.js","assets/file-type-icon-C3nhEJVa.js","assets/chat-draft-CxBIV5gW.js","assets/select-B8yvCqU-.js","assets/index-BdQq_4o_.js","assets/use-deco-credits-ChCk-7Ic.js","assets/toggle-group-DJHavtFz.js","assets/use-open-billing-url-BhHBrwI4.js","assets/index-BwcojXtb.js","assets/checkbox-DYPRxtdw.js","assets/ai-providers-logos-DD3qZ33J.js","assets/input-D2PyfPad.js","assets/suggestion-DtPrQaPS.js","assets/use-org-fs-CPqLHgiA.js","assets/question-004-sINsf4GQ.js","assets/feature-paywall-CF5xE385.js","assets/plan-ladder-Bk5SqgcV.js","assets/add-connection-dialog-BlF-9HgF.js","assets/extract-connection-data-TNmbX43n.js","assets/metadata-D72DunRR.js","assets/connection-D9ij5W2w.js","assets/connection-card-Ds4cDjLL.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-BLncutjk.js","assets/use-connection--nQEudkr.js","assets/schema-BXNU8wK3.js","assets/connection-form-helpers-BPCfMFZi.js","assets/authenticate-and-persist-oauth-miETlukP.js","assets/mcp-oauth-KanvJCH4.js","assets/mcp-oauth-DVsOtQR9.js","assets/collection-tabs--jJp2ESY.js","assets/badge-DlHCn1A-.js","assets/use-infinite-scroll-tiBiQUrG.js","assets/useSuspenseInfiniteQuery-Bj1LgSIL.js","assets/use-task-board-events-Cjw4-qyi.js","assets/use-chat-layout-state-D10wfd91.js","assets/input-Bwd_JSM8.css","assets/pair-BkPRQRG3.js","assets/collapsible-CQW9roHO.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-CCB0FZaP.js","assets/types-DfI6bP71.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/sheet-DDwhHigu.js","assets/use-thread-outputs-uAgeAbTT.js","assets/releases-api-BP4D_7BV.js","assets/use-content-sync-BpAr_qkU.js","assets/named-rule-uses-Bf97NaES.js","assets/device-hint-SeLRi17j.js","assets/editor-CFcE0Q6O.js","assets/section-array-field-WuEC2hxv.js","assets/alert-BagxECyU.js","assets/save-changes-debug-nBi-n9eV.js","assets/sandbox-lifecycle-context-BCrUk0wr.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/index-CSFBWEpH.js","assets/use-sidebar-collapsed-VHTBmB5o.js","assets/resizable-RRgAphZx.js","assets/agent-site-editor-DDGTF8rc.css","assets/agent-site-editor-content-bHNeasNi.js","assets/agent-view-guard-C33ioBBA.js","assets/use-main-panel-tabs-zguLtTFu.js","assets/use-mcp-tools-RlvKHjUU.js","assets/resolve-tab-icon-C-lgKCi8.js","assets/use-task-metadata-WYOfWDrq.js","assets/preview-source-BsRLGWUP.js","assets/use-project-native-view-presence-CifUjYF7.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/use-file-configs-emNeeY81.js","assets/site-slug-DebpOoQq.js","assets/feature-gate-DvDHZ9Mm.js","assets/content-tab-BVTaK5gN.js","assets/blocks-tab-states-CgmkhE5b.js","assets/slider-DM-iwDAN.js","assets/index-S0DELbp3.js","assets/tooltipContext-DT0TA2xa.js","assets/CategoricalChart-Dup_V6G1.js","assets/index-rpRRVwY4.js","assets/ActiveShapeUtils-DC_uFkfj.js","assets/Sector-DoDCEu0-.js","assets/symbol-COdkYi-n.js","assets/empty-state-BWR7Jy-d.js","assets/held-block-view-BX5kI9L6.js","assets/switch-BI5z5Ju7.js","assets/scroll-area-EUJaQXLw.js","assets/monaco-editor-zjNnLgmQ.js","assets/calendar-Bkrc3Tn3.js","assets/editor-classes-C8l2uWj9.js","assets/core.esm-7J0R8lPd.js","assets/sortable.esm-CgWx-74N.js","assets/combobox-CQVbSSH0.js","assets/search-input-VUL2ibQB.js","assets/asset-utils-Qf3MBvDM.js","assets/mustache-Kyny1r3W.js","assets/date-utils-CrvIKg-s.js","assets/use-move-blocks-DEI5xTJ9.js","assets/empty-state-B7gwb6En.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as j,j as m,B as L,b as E,l as ie,E as oe,r as M,t as F,x as re,I as G,v as ce,D as de,be as J,a4 as me,bj as ue,n as A}from"./index-C5hxtG-B.js";import{i as fe}from"./ArrowLeft-BW4hi-fE.js";import{B as K}from"./badge-DlHCn1A-.js";import{L as pe}from"./label-BOjT8VGh.js";import{s as xe}from"./Trash01-DuRmK_Vz.js";import{a as he,n as ge,c as ve,d as Re,e as be,f as Ne,g as X,h as je}from"./named-rule-uses-Bf97NaES.js";import{ag as C,ai as Q,al as ee,ar as ye,d as Ce,as as we,at as Ee,au as ke}from"./parse-sections-BDlriD2E.js";import{K as te,aw as Se,ax as V,u as se,D as Ue,ak as De,ah as Oe,l as Te}from"./site-editor-toast-Cyc0S6jd.js";import{y as ne,L as ae,p as He,i as Ie,u as _e,S as Be}from"./blocks-tab-states-CgmkhE5b.js";import{b as Fe}from"./ZoomOut-6mAbwFTL.js";import{a as Pe}from"./UserSquare-CVuHc6NN.js";import{u as $e}from"./use-apply-named-rule-BrUBMfGy.js";import{E as Me}from"./empty-state-B7gwb6En.js";import{u as Ke}from"./chat-context-BvGd3d4B.js";import{a as Ve}from"./use-panel-navigate-DlKiU4ru.js";const jt="p-4";function yt(s){const e=j.c(14),{intro:t,back:n,actions:a}=s;let i;e[0]!==a?(i=a?m.jsx("div",{className:"flex shrink-0 items-center gap-2","data-slot":"view-actions",children:a}):null,e[0]=a,e[1]=i):i=e[1];const r=i;if(n){let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx(fe,{size:16}),e[2]=c):c=e[2];let d;e[3]!==n.label||e[4]!==n.onClick?(d=m.jsxs(L,{variant:"ghost",size:"sm",onClick:n.onClick,children:[c,n.label]}),e[3]=n.label,e[4]=n.onClick,e[5]=d):d=e[5];let u;return e[6]!==r||e[7]!==d?(u=m.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between gap-2 border-b px-4","data-testid":"site-draft-view-header",children:[d,r]}),e[6]=r,e[7]=d,e[8]=u):u=e[8],u}let o;e[9]!==t?(o=m.jsx("p",{className:"min-w-0 flex-1 text-sm text-muted-foreground",children:t}),e[9]=t,e[10]=o):o=e[10];let l;return e[11]!==r||e[12]!==o?(l=m.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-x-4 gap-y-2 px-4 pt-4","data-testid":"site-draft-view-header",children:[o,r]}),e[11]=r,e[12]=o,e[13]=l):l=e[13],l}function Le(s,e,t,n){const a=C(s,e);return a.kind==="conflict"?null:{writes:{[Q(e).blockKey]:ee(a.block,e,t,n)}}}function Ae(s,e,t,n){const a=C(s,e);if(a.kind==="conflict")return{problem:"conflict"};const i=ne(t,Object.keys(a.values));return i?{problem:i}:{change:Le(s,e,t.trim(),n)}}function ze(s,e,t){const n=C(s,e);return n.kind!=="saved"||!Object.hasOwn(n.block,t)?null:{writes:{[Q(e).blockKey]:ye(n.block,t)}}}function We(s,e,t,n){if(n===void 0)return null;const a=C(s,e);return a.kind==="conflict"||Object.hasOwn(a.block,t)?null:{writes:{[Q(e).blockKey]:ee(a.block,e,t,n)}}}function qe(s,e,t,n){if(!s)return null;const a=C(s,e);return a.kind!=="saved"||!Object.hasOwn(a.values,t)?"new":Je(a.values[t],n)?"published":"changed"}function Qe(s,e,t){if(!s)return;const n=C(s,e);if(n.kind==="saved")return n.values[t]}function Ge(s,e,t){if(!e)return[];const n=C(e,t);if(n.kind!=="saved")return[];const a=C(s,t),i=a.kind==="conflict"?{}:a.values;return Object.keys(n.values).filter(r=>!Object.hasOwn(i,r))}function Je(s,e){return typeof s=="number"||typeof e=="number"?s===e:Y(s.start,e.start)&&Y(s.end,e.end)}function Y(s,e){return s===void 0||e===void 0?s===e:s===e||new Date(s).getTime()===new Date(e).getTime()}function Ct(s){const e=j.c(21),{kind:t,rows:n,wholeRows:a,loading:i,marked:r,onOpen:o}=s,l=E(),c=t==="experiments";let d;e[0]!==l?(d=l("sectionsEditor.namedRuleUses.title"),e[0]=l,e[1]=d):d=e[1];let u;e[2]!==d?(u=m.jsx("h3",{className:"text-sm font-medium",children:d}),e[2]=d,e[3]=u):u=e[3];let f;e[4]!==i||e[5]!==r||e[6]!==o||e[7]!==n||e[8]!==l||e[9]!==c?(f=i?m.jsx("p",{className:"text-sm text-muted-foreground",children:l("sectionsEditor.namedRuleUses.loading")}):n.length===0?m.jsx("p",{className:"text-sm text-muted-foreground",children:l(c?"sectionsEditor.namedRuleUses.emptyTests":"sectionsEditor.namedRuleUses.emptyCampaigns")}):m.jsx(W,{rows:n,marked:r,onOpen:o}),e[4]=i,e[5]=r,e[6]=o,e[7]=n,e[8]=l,e[9]=c,e[10]=f):f=e[10];let x;e[11]!==r||e[12]!==o||e[13]!==l||e[14]!==c||e[15]!==a?(x=a.length>0&&m.jsxs("div",{className:"mt-3 flex flex-col gap-1",children:[m.jsx("h4",{className:"text-xs font-medium text-muted-foreground",children:l(c?"sectionsEditor.namedRuleUses.wholeTests":"sectionsEditor.namedRuleUses.wholeCampaigns")}),m.jsx("p",{className:"text-xs text-muted-foreground",children:l(c?"sectionsEditor.namedRuleUses.wholeTestsHint":"sectionsEditor.namedRuleUses.wholeCampaignsHint")}),m.jsx(W,{rows:a,marked:r,onOpen:o})]}),e[11]=r,e[12]=o,e[13]=l,e[14]=c,e[15]=a,e[16]=x):x=e[16];let h;return e[17]!==u||e[18]!==f||e[19]!==x?(h=m.jsxs("section",{className:"flex flex-col gap-2","data-testid":"named-rule-used-by",children:[u,f,x]}),e[17]=u,e[18]=f,e[19]=x,e[20]=h):h=e[20],h}function W(s){const e=j.c(11),{rows:t,marked:n,onOpen:a}=s,i=E();let r;if(e[0]!==n||e[1]!==a||e[2]!==t||e[3]!==i){let l;e[5]!==n||e[6]!==a||e[7]!==i?(l=c=>{const d=c.blockKind==="page"?Pe:Fe,u=c.state==="removed-in-draft";return m.jsxs("li",{className:"flex items-center gap-3 px-3 py-2","data-use-state":c.state,children:[m.jsx(d,{size:14,className:"shrink-0 text-muted-foreground"}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("p",{className:ie("truncate text-sm",u&&"text-muted-foreground line-through"),children:c.title}),m.jsx("p",{className:"truncate text-xs text-muted-foreground",children:[c.path,c.section,c.variant?i("sectionsEditor.namedRuleUses.variant",{index:String(c.variant)}):null].filter(Boolean).join(" · ")})]}),n&&c.state==="draft-only"&&m.jsx(K,{variant:"muted",children:i("sectionsEditor.namedRuleUses.draftOnly")}),n&&u&&m.jsx(K,{variant:"muted",children:i("sectionsEditor.namedRuleUses.removed")}),a&&!u&&m.jsxs(L,{type:"button",variant:"ghost",size:"sm",onClick:()=>a(c),children:[i("sectionsEditor.namedRuleUses.open"),m.jsx(oe,{size:14})]})]},he(c))},e[5]=n,e[6]=a,e[7]=i,e[8]=l):l=e[8],r=t.map(l),e[0]=n,e[1]=a,e[2]=t,e[3]=i,e[4]=r}else r=e[4];let o;return e[9]!==r?(o=m.jsx("ul",{className:"divide-y divide-border/60 rounded-md border border-border/60",children:r}),e[9]=r,e[10]=o):o=e[10],o}function Xe(s){const e=j.c(12),{kind:t,rows:n,names:a,onOpen:i}=s,r=E();if(n.length===0)return null;let o;e[0]!==t||e[1]!==a||e[2]!==r?(o=r(t==="experiments"?a===1?"sectionsEditor.namedRuleUses.missingTestOne":"sectionsEditor.namedRuleUses.missingTests":a===1?"sectionsEditor.namedRuleUses.missingCampaignOne":"sectionsEditor.namedRuleUses.missingCampaigns"),e[0]=t,e[1]=a,e[2]=r,e[3]=o):o=e[3];let l;e[4]!==o?(l=m.jsx("p",{className:"text-sm text-muted-foreground",children:o}),e[4]=o,e[5]=l):l=e[5];let c;e[6]!==i||e[7]!==n?(c=m.jsx(W,{rows:n,marked:!1,onOpen:i}),e[6]=i,e[7]=n,e[8]=c):c=e[8];let d;return e[9]!==l||e[10]!==c?(d=m.jsxs("section",{className:"flex flex-col gap-2","data-testid":"named-rule-missing-uses",children:[l,c]}),e[9]=l,e[10]=c,e[11]=d):d=e[11],d}function Ye({kind:s,name:e,meta:t,pending:n,apply:a,reread:i,onDeleted:r,onUndo:o}){const l=E(),c=s==="experiments",[d,u]=M.useState(!1),f=async()=>{const p=await i();return p||F.info(l("sectionsEditor.namedRules.unavailable"),{...V,description:l("sectionsEditor.namedRules.unavailableHint")}),p},x=async p=>{const R=await f();if(!R)return;const g=We(R,s,e,p);if(g){o(g);return}const b=C(R,s).kind==="conflict";F.info(l(b?"sectionsEditor.namedRules.changedMeanwhile":"sectionsEditor.namedRules.alreadyBack"),{...V,description:l(b?"sectionsEditor.namedRules.changedMeanwhileHint":"sectionsEditor.namedRules.alreadyBackHint")})},h=async()=>{u(!0);let p;try{p=await f()}finally{u(!1)}if(!p)return;const R=ze(p,s,e);if(!R)return;const g=C(p,s),b=g.kind==="saved"?g.block[e]:void 0,v=ge(l,ve(p,t,s,e)),y=await a(R);if(y.ok){if(y.keptTheirs){te(l,!1);return}r(),F.success(c?l("experiments.v8.deleted",{name:e}):l("sandbox.dateCampaigns.deleted",{name:e}),{id:Se,description:v?.one?l("sectionsEditor.namedRuleDelete.stillUsedOne",{places:v.places}):v?l("sectionsEditor.namedRuleDelete.stillUsed",{places:v.places}):l(c?"experiments.v8.deletedHint":"sandbox.dateCampaigns.deletedHint"),action:{label:l("sectionsEditor.namedRules.undo"),onClick:()=>{x(b)}}})}};return m.jsxs(L,{type:"button",variant:"ghost",size:"sm",disabled:n||d,onClick:()=>{h()},children:[m.jsx(xe,{size:16}),l(c?"experiments.v8.delete":"sandbox.dateCampaigns.delete")]})}function Ze(s){const e=j.c(11);let t;e[0]!==s.branch||e[1]!==s.orgSlug||e[2]!==s.virtualMcpId?(t={orgSlug:s.orgSlug,virtualMcpId:s.virtualMcpId,branch:s.branch},e[0]=s.branch,e[1]=s.orgSlug,e[2]=s.virtualMcpId,e[3]=t):t=e[3];const n=t,a=se(s.virtualMcpId,s.branch),i=Ue(n),r=De(a,i||null),o=Oe(a,i||null,r.data);if(!s.decofile)return null;let l;e[4]!==r.data?(l=r.data?Object.keys(r.data.changes).length:void 0,e[4]=r.data,e[5]=l):l=e[5];const c=o.data?.entries;let d;return e[6]!==s.decofile||e[7]!==s.meta||e[8]!==l||e[9]!==c?(d=Re({decofile:s.decofile,meta:s.meta,changeCount:l,sides:c}),e[6]=s.decofile,e[7]=s.meta,e[8]=l,e[9]=c,e[10]=d):d=e[10],d}function T(s,e){return e==="experiments"?{new:s("experiments.v8.new"),usedBy:t=>s("experiments.v8.usedBy",{count:String(t)}),notUsed:s("experiments.v8.notUsed"),stateNew:s("experiments.v8.state.new"),stateChanged:s("experiments.v8.state.changed"),removedTitle:s("experiments.v8.removedTitle"),removedHint:s("experiments.v8.removedHint"),created:t=>s("sectionsEditor.namedRulePicker.createdTest",{name:t}),renamed:t=>s("experiments.v8.renamed",{name:t}),renameHint:s("experiments.v8.renameHint"),renameWholeHint:s("experiments.v8.renameWholeHint")}:{new:s("sandbox.dateCampaigns.new"),usedBy:t=>s("sandbox.dateCampaigns.usedBy",{count:String(t)}),notUsed:s("sandbox.dateCampaigns.notUsed"),stateNew:s("sandbox.dateCampaigns.state.new"),stateChanged:s("sandbox.dateCampaigns.state.changed"),removedTitle:s("sandbox.dateCampaigns.removedTitle"),removedHint:s("sandbox.dateCampaigns.removedHint"),created:t=>s("sectionsEditor.namedRulePicker.createdCampaign",{name:t}),renamed:t=>s("sandbox.dateCampaigns.renamed",{name:t}),renameHint:s("sandbox.dateCampaigns.renameHint"),renameWholeHint:s("sandbox.dateCampaigns.renameWholeHint")}}function et(s,e,t){const n=Ce(e,t);return n!=="available"?n:C(s,t).kind==="conflict"?"conflict":null}function wt(s,e){const t=j.c(49),n=E(),{orgSlug:a,virtualMcpId:i,branch:r,decofile:o,meta:l}=e;let c;t[0]!==r||t[1]!==o||t[2]!==l||t[3]!==a||t[4]!==i?(c={orgSlug:a,virtualMcpId:i,branch:r,decofile:o,meta:l},t[0]=r,t[1]=o,t[2]=l,t[3]=a,t[4]=i,t[5]=c):c=t[5];const d=Ze(c);let u;t[6]!==r||t[7]!==a||t[8]!==i?(u={orgSlug:a,virtualMcpId:i,branch:r},t[6]=r,t[7]=a,t[8]=i,t[9]=u):u=t[9];const{apply:f,reread:x,planStored:h,isPending:p,holdsCopy:R}=$e(u),[g,b]=M.useState(null),[v,y]=M.useState(!1);let D;t[10]!==f||t[11]!==n?(D=async(w,$)=>{const B=$===void 0?n("sectionsEditor.namedRules.saved"):$;if(!w)return!1;const O=await f(w);return O.ok&&O.keptTheirs?te(n,!1):O.ok&&F.success(B,{...V,description:n("sectionsEditor.namedRules.savedHint")}),O.ok},t[10]=f,t[11]=n,t[12]=D):D=t[12];const N=D;let k;t[13]!==o||t[14]!==s||t[15]!==N||t[16]!==n?(k=w=>{if(w.kind!==s||!w.create)return;const $=w.kind==="experiments"?w.create.share:w.create.window,B=Ae(o,s,w.name,$);if(!("change"in B)){F.info(B.problem==="conflict"?n("sectionsEditor.namedRules.changedMeanwhile"):ae(n,B.problem),V);return}const O=w.name.trim();N(B.change,T(n,s).created(O)).then(le=>{le&&(y(!1),b(O))})},t[13]=o,t[14]=s,t[15]=N,t[16]=n,t[17]=k):k=t[17];const U=k;let S;t[18]!==o||t[19]!==s||t[20]!==l?(S=et(o,l,s),t[18]=o,t[19]=s,t[20]=l,t[21]=S):S=t[21];let H;t[22]!==o||t[23]!==s||t[24]!==l||t[25]!==d?(H=d?be(d,s,o,l):[],t[22]=o,t[23]=s,t[24]=l,t[25]=d,t[26]=H):H=t[26];let I;t[27]!==o||t[28]!==s||t[29]!==l||t[30]!==d?(I=d?Ne(d,s,o,l):0,t[27]=o,t[28]=s,t[29]=l,t[30]=d,t[31]=I):I=t[31];let _;t[32]!==N?(_=w=>{N(w)},t[32]=N,t[33]=_):_=t[33];let P;return t[34]!==f||t[35]!==U||t[36]!==v||t[37]!==R||t[38]!==p||t[39]!==g||t[40]!==h||t[41]!==x||t[42]!==N||t[43]!==S||t[44]!==H||t[45]!==I||t[46]!==_||t[47]!==d?(P={uses:d,apply:f,reread:x,planStored:h,isPending:p,holdsCopy:R,openName:g,setOpenName:b,creating:v,setCreating:y,blocked:S,missing:H,missingNames:I,save:N,create:U,undo:_},t[34]=f,t[35]=U,t[36]=v,t[37]=R,t[38]=p,t[39]=g,t[40]=h,t[41]=x,t[42]=N,t[43]=S,t[44]=H,t[45]=I,t[46]=_,t[47]=d,t[48]=P):P=t[48],P}function Et(s){const e=j.c(23),{kind:t,open:n,onOpenChange:a,existingNames:i,pending:r,onCreate:o}=s,l=E();let c;e[0]!==t||e[1]!==l?(c=T(l,t),e[0]=t,e[1]=l,e[2]=c):c=e[2];let d;e[3]!==c.new?(d=m.jsx(re,{className:"sr-only",children:c.new}),e[3]=c.new,e[4]=d):d=e[4];let u;e[5]!==l?(u=l("sectionsEditor.namedRules.create"),e[5]=l,e[6]=u):u=e[6];let f;e[7]!==a?(f=()=>a(!1),e[7]=a,e[8]=f):f=e[8];let x;e[9]!==i||e[10]!==t||e[11]!==o||e[12]!==r||e[13]!==u||e[14]!==f?(x=m.jsx(He,{kind:t,initialName:"",existingNames:i,pending:r,submitLabel:u,dismiss:"cancel",standalone:!0,onBack:f,onSubmit:o}),e[9]=i,e[10]=t,e[11]=o,e[12]=r,e[13]=u,e[14]=f,e[15]=x):x=e[15];let h;e[16]!==d||e[17]!==x?(h=m.jsxs(ce,{className:"p-0 sm:max-w-md",children:[d,x]}),e[16]=d,e[17]=x,e[18]=h):h=e[18];let p;return e[19]!==a||e[20]!==n||e[21]!==h?(p=m.jsx(de,{open:n,onOpenChange:a,children:h}),e[19]=a,e[20]=n,e[21]=h,e[22]=p):p=e[22],p}function kt(s){const e=j.c(14),{kind:t,missing:n,missingNames:a,removed:i,onOpenUse:r}=s,o=E();let l;e[0]!==t||e[1]!==o?(l=T(o,t),e[0]=t,e[1]=o,e[2]=l):l=e[2];const c=l;let d;e[3]!==t||e[4]!==n||e[5]!==a||e[6]!==r?(d=m.jsx(Xe,{kind:t,rows:n,names:a,onOpen:r}),e[3]=t,e[4]=n,e[5]=a,e[6]=r,e[7]=d):d=e[7];let u;e[8]!==c||e[9]!==i?(u=i.length>0&&m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsx("h3",{className:"text-sm font-medium",children:c.removedTitle}),m.jsx("p",{className:"text-xs text-muted-foreground",children:c.removedHint}),m.jsx("ul",{className:"text-sm text-muted-foreground",children:i.map(tt)})]}),e[8]=c,e[9]=i,e[10]=u):u=e[10];let f;return e[11]!==d||e[12]!==u?(f=m.jsxs(m.Fragment,{children:[d,u]}),e[11]=d,e[12]=u,e[13]=f):f=e[13],f}function tt(s){return m.jsx("li",{className:"line-through",children:s},s)}function St(s,e,t){const n=T(s,e);return t>0?n.usedBy(t):n.notUsed}function st(s){const e=j.c(7),{kind:t,state:n,changed:a}=s,i=a===void 0?!0:a,r=E();let o;e[0]!==t||e[1]!==r?(o=T(r,t),e[0]=t,e[1]=r,e[2]=o):o=e[2];const l=o;if(n==="new"){let c;return e[3]!==l.stateNew?(c=m.jsx(K,{variant:"muted",children:l.stateNew}),e[3]=l.stateNew,e[4]=c):c=e[4],c}if(n==="changed"&&i){let c;return e[5]!==l.stateChanged?(c=m.jsx(K,{variant:"muted",children:l.stateChanged}),e[5]=l.stateChanged,e[6]=c):c=e[6],c}return null}function Ut(s){const e=j.c(9),{kind:t,name:n,status:a,entryState:i}=s;let r;e[0]!==n?(r=m.jsx("h2",{className:"text-lg font-semibold",children:n}),e[0]=n,e[1]=r):r=e[1];let o;e[2]!==i||e[3]!==t?(o=m.jsx(st,{kind:t,state:i,changed:!1}),e[2]=i,e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==a||e[6]!==r||e[7]!==o?(l=m.jsxs("div",{className:"flex items-center gap-3",children:[r,a,o]}),e[5]=a,e[6]=r,e[7]=o,e[8]=l):l=e[8],l}function Dt(s){const e=j.c(9),{kind:t,detail:n}=s;let a;return e[0]!==n.apply||e[1]!==n.meta||e[2]!==n.onDeleted||e[3]!==n.onUndo||e[4]!==n.pending||e[5]!==n.reread||e[6]!==n.row.name||e[7]!==t?(a=m.jsx(Ye,{kind:t,name:n.row.name,meta:n.meta,pending:n.pending,apply:n.apply,reread:n.reread,onDeleted:n.onDeleted,onUndo:n.onUndo}),e[0]=n.apply,e[1]=n.meta,e[2]=n.onDeleted,e[3]=n.onUndo,e[4]=n.pending,e[5]=n.reread,e[6]=n.row.name,e[7]=t,e[8]=a):a=e[8],a}function Ot(s,e,t){return{row:e,decofile:t.decofile,meta:t.meta,uses:s.uses,pending:s.isPending,holdsCopy:s.holdsCopy,onBack:()=>s.setOpenName(null),onOpenUse:t.onOpenUse,onSave:s.save,onRenamed:s.setOpenName,apply:s.apply,reread:s.reread,planStored:s.planStored,onDeleted:()=>s.setOpenName(null),onUndo:s.undo}}function Tt(s,e,t,n,a){return{useRows:t?X(t,s,e,n,a):[],wholeRows:t?X(t,s,null,n,a):[]}}function Ht(s,e){const t=j.c(23),n=E(),a=e.row.name,[i,r]=M.useState(a);let o;t[0]!==i?(o=i.trim(),t[0]=i,t[1]=o):o=t[1];const l=o===a;let c,d,u,f,x,h;if(t[2]!==a||t[3]!==s||t[4]!==i||t[5]!==e||t[6]!==n||t[7]!==l){let g;t[14]!==a?(g=v=>v!==a,t[14]=a,t[15]=g):g=t[15];const b=we(C(e.decofile,s)).filter(g);c=l?null:ne(i,b),d=async()=>{const v=i.trim();if(c||v===a)return;const y=await e.planStored(D=>Ee(D,s,a,v,e.meta));y&&await e.onSave(y,T(n,s).renamed(v))&&e.onRenamed(v)},u=a,f=i,x=r,h=c?ae(n,c):null,t[2]=a,t[3]=s,t[4]=i,t[5]=e,t[6]=n,t[7]=l,t[8]=c,t[9]=d,t[10]=u,t[11]=f,t[12]=x,t[13]=h}else c=t[8],d=t[9],u=t[10],f=t[11],x=t[12],h=t[13];const p=!!c||l;let R;return t[16]!==d||t[17]!==u||t[18]!==f||t[19]!==x||t[20]!==h||t[21]!==p?(R={savedName:u,name:f,setName:x,message:h,blocked:p,rename:d},t[16]=d,t[17]=u,t[18]=f,t[19]=x,t[20]=h,t[21]=p,t[22]=R):R=t[22],R}function It(s){const e=j.c(19),{kind:t,id:n,rename:a,pending:i,wholeUses:r,locked:o}=s,l=E();let c;e[0]!==t||e[1]!==l?(c=T(l,t),e[0]=t,e[1]=l,e[2]=c):c=e[2];const d=c;let u;e[3]!==l?(u=l("sectionsEditor.namedRules.nameLabel"),e[3]=l,e[4]=u):u=e[4];let f;e[5]!==n||e[6]!==u?(f=m.jsx(pe,{htmlFor:n,children:u}),e[5]=n,e[6]=u,e[7]=f):f=e[7];let x;e[8]!==d||e[9]!==n||e[10]!==o||e[11]!==i||e[12]!==a||e[13]!==l||e[14]!==r?(x=o?m.jsxs(m.Fragment,{children:[m.jsx(G,{id:n,className:"max-w-xs",value:a.savedName,readOnly:!0,disabled:!0}),o]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(G,{id:n,className:"max-w-xs",value:a.name,onChange:p=>a.setName(p.target.value)}),m.jsx(L,{size:"sm",variant:"outline",disabled:i||a.blocked,onClick:()=>{a.rename()},children:l("sectionsEditor.namedRules.rename")})]}),a.message&&m.jsx("p",{className:"text-xs text-destructive",children:a.message}),m.jsx("p",{className:"text-xs text-muted-foreground",children:d.renameHint}),r>0&&m.jsx("p",{className:"text-xs text-muted-foreground",children:d.renameWholeHint})]}),e[8]=d,e[9]=n,e[10]=o,e[11]=i,e[12]=a,e[13]=l,e[14]=r,e[15]=x):x=e[15];let h;return e[16]!==f||e[17]!==x?(h=m.jsxs("section",{className:"flex flex-col gap-2",children:[f,x]}),e[16]=f,e[17]=x,e[18]=h):h=e[18],h}const Z={running:0,everyone:1,off:2};function _t(s,e){const t=C(s,"experiments");if(t.kind==="conflict")return[];const n=e?.published??null;return Object.entries(t.values).map(([i,r],o)=>{const l=qe(n,"experiments",i,r),c=l==="changed"?Qe(n,"experiments",i):void 0;return{order:o,row:{name:i,share:r,status:ke(r),uses:e?je(e,"experiments",i):0,entryState:l,...c!==void 0?{publishedShare:c}:{}}}}).sort((i,r)=>Z[i.row.status]-Z[r.row.status]||i.order-r.order).map(i=>i.row)}function Bt(s,e){return Ge(s,e?.published??null,"experiments")}function Ft(s){const e={contentPageVariant:s.focus?.pageVariant,contentSection:s.focus?.section,contentVariant:s.focus?.variant};return s.blockKind==="page"?{contentPageId:s.blockKey,contentCollection:void 0,contentItem:void 0,...e}:{contentPageId:void 0,contentCollection:"sections",contentItem:s.blockKey,...e}}let z=null;function nt(){return z??=Promise.all([J(()=>import("./agent-site-editor-DUzu_bGf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164])),J(()=>import("./agent-site-editor-content-bHNeasNi.js"),__vite__mapDeps([165,1,2,166,167,141,5,4,6,7,8,9,11,12,13,14,15,16,17,36,37,38,39,40,41,42,29,34,43,44,45,35,46,47,48,30,49,50,51,52,53,54,55,56,57,58,59,60,61,62,130,168,147,102,26,95,3,10,18,19,20,21,96,73,74,97,77,98,99,100,101,69,103,104,105,106,107,108,25,109,110,84,85,111,112,113,114,115,116,83,117,118,119,75,76,120,121,122,123,124,125,126,89,127,128,66,129,131,132,133,134,135,136,137,138,139,140,142,143,144,63,145,146,148,33,64,65,67,68,70,71,72,78,79,80,81,149,150,31,27,169,170,171,172,173,174,175,88,176,177,178,179,180,181,182,183,184,185,186,94,24,28,32,187,188,160,156,157,189,190,191,155,192,193,194,195,196,197,198,199,152,159,200,201,202]))]).catch(s=>{throw z=null,s}),z}function at(s){return e=>{if(!e)return;const t=()=>{s().catch(()=>{})};if(typeof requestIdleCallback=="function"){const a=requestIdleCallback(t,{timeout:2e3});return()=>cancelIdleCallback(a)}const n=setTimeout(t,200);return()=>clearTimeout(n)}}const lt=at(nt);function q(s){const e=j.c(7),{icon:t,title:n,description:a,action:i}=s;let r;e[0]!==i?(r=i?{children:i.label,onClick:i.onClick}:void 0,e[0]=i,e[1]=r):r=e[1];let o;return e[2]!==a||e[3]!==t||e[4]!==r||e[5]!==n?(o=m.jsx(A,{children:m.jsx(A.Content,{children:m.jsx(A.Container,{children:m.jsx(Me,{icon:t,title:n,description:a,buttonProps:r})})})}),e[2]=a,e[3]=t,e[4]=r,e[5]=n,e[6]=o):o=e[6],o}function Pt(s){const e=j.c(28),{virtualMcpId:t,icon:n,copy:a,skeleton:i,children:r}=s,o=E(),{org:l}=me(),c=Ke(),d=c?.currentBranch??null,u=se(t,d);ue(u.kind==="protocol"&&u.source==="github");const{openPanel:f}=Ve();if(!d){const p=a.noDraftTitle,R=a.noDraftDesc;let g;e[0]!==o?(g=o("sectionsEditor.namedRules.openEditor"),e[0]=o,e[1]=g):g=e[1];let b;e[2]!==f?(b=()=>f("content"),e[2]=f,e[3]=b):b=e[3];let v;e[4]!==g||e[5]!==b?(v={label:g,onClick:b},e[4]=g,e[5]=b,e[6]=v):v=e[6];let y;return e[7]!==a.noDraftDesc||e[8]!==a.noDraftTitle||e[9]!==n||e[10]!==v?(y=m.jsx(q,{icon:n,title:p,description:R,action:v}),e[7]=a.noDraftDesc,e[8]=a.noDraftTitle,e[9]=n,e[10]=v,e[11]=y):y=e[11],y}if(Ie(u)){let p;return e[12]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(Be,{}),e[12]=p):p=e[12],p}if(u.kind==="pending"){let p;return e[13]!==i?(p=m.jsx(m.Fragment,{children:i}),e[13]=i,e[14]=p):p=e[14],p}if(u.kind!=="protocol"){let p;return e[15]!==a.loadFailed||e[16]!==a.loadFailedHint||e[17]!==n?(p=m.jsx(q,{icon:n,title:a.loadFailed,description:a.loadFailedHint}),e[15]=a.loadFailed,e[16]=a.loadFailedHint,e[17]=n,e[18]=p):p=e[18],p}const x=c?.taskId??null;let h;return e[19]!==d||e[20]!==r||e[21]!==a||e[22]!==n||e[23]!==l.slug||e[24]!==i||e[25]!==x||e[26]!==t?(h=m.jsx(it,{orgSlug:l.slug,virtualMcpId:t,branch:d,threadId:x,icon:n,copy:a,skeleton:i,children:r},d),e[19]=d,e[20]=r,e[21]=a,e[22]=n,e[23]=l.slug,e[24]=i,e[25]=x,e[26]=t,e[27]=h):h=e[27],h}function it(s){const e=j.c(30),{orgSlug:t,virtualMcpId:n,branch:a,threadId:i,icon:r,copy:o,skeleton:l,children:c}=s,d=E();let u;e[0]!==a||e[1]!==t||e[2]!==i||e[3]!==n?(u={orgSlug:t,virtualMcpId:n,branch:a,threadId:i,previewUrl:null},e[0]=a,e[1]=t,e[2]=i,e[3]=n,e[4]=u):u=e[4];const f=u,x=Te(f),h=_e(f),p=x.data,R=h.data;if(!p||!R){if(x.isError||h.isError){const y=o.loadFailed,D=o.loadFailedHint;let N;e[5]!==d?(N=d("sectionsEditor.namedRules.tryAgain"),e[5]=d,e[6]=N):N=e[6];let k;e[7]!==x||e[8]!==h?(k=()=>{x.refetch(),h.refetch()},e[7]=x,e[8]=h,e[9]=k):k=e[9];let U;e[10]!==N||e[11]!==k?(U={label:N,onClick:k},e[10]=N,e[11]=k,e[12]=U):U=e[12];let S;return e[13]!==o.loadFailed||e[14]!==o.loadFailedHint||e[15]!==r||e[16]!==U?(S=m.jsx(q,{icon:r,title:y,description:D,action:U}),e[13]=o.loadFailed,e[14]=o.loadFailedHint,e[15]=r,e[16]=U,e[17]=S):S=e[17],S}let v;return e[18]!==l?(v=m.jsx(m.Fragment,{children:l}),e[18]=l,e[19]=v):v=e[19],v}let g;e[20]!==a||e[21]!==c||e[22]!==p||e[23]!==R||e[24]!==t||e[25]!==i||e[26]!==n?(g=c({orgSlug:t,virtualMcpId:n,branch:a,threadId:i,decofile:p,meta:R}),e[20]=a,e[21]=c,e[22]=p,e[23]=R,e[24]=t,e[25]=i,e[26]=n,e[27]=g):g=e[27];let b;return e[28]!==g?(b=m.jsx("div",{className:"contents",ref:lt,children:g}),e[28]=g,e[29]=b):b=e[29],b}export{kt as N,jt as S,Pt as a,St as b,st as c,Ht as d,_t as e,Tt as f,Ut as g,It as h,Ft as i,yt as j,Et as k,Dt as l,Ct as m,Ot as n,q as o,Le as p,qe as q,Bt as r,Qe as s,Ge as t,wt as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as u,r as g,j as n,H as F,$ as G,a0 as H,a as E,k as P,b as O,n as y,L as M}from"./index-C5hxtG-B.js";import{C as V}from"./chat-context-BvGd3d4B.js";import{C as x}from"./index-CSFBWEpH.js";import{L}from"./index-h0OzTGt5.js";import{B as K}from"./blocks-preview-workspace-context-Bs9hknsf.js";import{e as T,p as W,s as J,a as U,r as z,T as $,u as R,b as q}from"./site-editor-toast-Cyc0S6jd.js";import{u as Q,L as B,P as X,S as Y}from"./preview-tab-C3RlH6Tl.js";import{C as Z}from"./content-tab-BVTaK5gN.js";import{T as tt}from"./tab-icon-glyph-CIKU8YGE.js";import{r as et}from"./resolve-tab-icon-C-lgKCi8.js";import ot from"./agent-site-editor-DUzu_bGf.js";import"./use-panel-navigate-DlKiU4ru.js";import"./thread-route-Dq4msobR.js";import"./use-project-scope-Lvryvv_x.js";import"./repository-binding-WDk-SmGV.js";import"./use-mcp-client-Dehh-QD8.js";import"./auth-CODe_IGw.js";import"./autosend-3uc8bTVc.js";import"./thread-intent-DigI0g4t.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-CTyhEpc6.js";import"./task-board-J8Vo2lzV.js";import"./schema-Br-RkdlQ.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-DuiNHzOc.js";import"./use-ai-providers-Bc7K6JyD.js";import"./location-V0VwTJTt.js";import"./use-organization-settings-c2KJ-rhg.js";import"./use-mobile-Bht8wONL.js";import"./use-sidebar-collapsed-VHTBmB5o.js";import"./use-chat-layout-state-D10wfd91.js";import"./agent-icon-DMtM72Tt.js";import"./AlertCircle-BD_uk8jv.js";import"./Tool01-lXzjYHgk.js";import"./ArrowUp-D7In3NHD.js";import"./ArrowLeft-BW4hi-fE.js";import"./LinkBroken01-DQGhuKN9.js";import"./ShoppingBag01-Bnl1luer.js";import"./ZoomOut-6mAbwFTL.js";import"./Building02-Dw5n9775.js";import"./CheckCircle-BnPGwhwQ.js";import"./ChevronUp-B_2ftJO2.js";import"./ChevronSelectorVertical-Bc1L64FX.js";import"./UserSquare-CVuHc6NN.js";import"./Copy01-sA0-K7LG.js";import"./CreditCard01-lyKg_Ohv.js";import"./DotsVertical-BK4Fy8Nl.js";import"./Image01-DDkvI5Nm.js";import"./Globe04-BAEL3SMQ.js";import"./SwitchHorizontal01-DDdcI_Kz.js";import"./Key01-BX6BY9_T.js";import"./Link01-xEj9KoHs.js";import"./Minus-Czq0iKR1.js";import"./Monitor01-D31PU3Iy.js";import"./Sun-DaQ4UYay.js";import"./Play-AHwZFZb2.js";import"./Plus-Dl2sBaoj.js";import"./SearchMd-CPTG-cGa.js";import"./Trash01-DuRmK_Vz.js";import"./Upload01-C0iYEe1U.js";import"./Users01-BZCA5rox.js";import"./XClose-D_c5VtJ7.js";import"./tooltip-C9PLptTv.js";import"./index-xUcGx-v6.js";import"./toolbar-icon-button-w6OpN7Jk.js";import"./shell-layout-B7qkgzXU.js";import"./use-clock-tick-DtkR8iHs.js";import"./command-BCnC3TbE.js";import"./index-BKbYYz_9.js";import"./integration-icon-tGNPaW9N.js";import"./project-icon-CWNjOgyc.js";import"./new-project-dialog-CLihIY3l.js";import"./label-BOjT8VGh.js";import"./repository-import-picker-xZyEfZFE.js";import"./use-navigate-to-agent-R2geNLzm.js";import"./repository-picker-JSRbKdl_.js";import"./useInfiniteQuery-wSSEyg4B.js";import"./infiniteQueryObserver-cbOSzSkb.js";import"./collection-search-C4Wx-QCL.js";import"./use-debounced-value-o8_kTKtk.js";import"./required-auth-layout-CgpSpm9w.js";import"./use-org-sso-COqujkwo.js";import"./sheet-DDwhHigu.js";import"./resizable-RRgAphZx.js";import"./core.esm-7J0R8lPd.js";import"./sortable.esm-CgWx-74N.js";import"./context-menu-DVvUVMuo.js";import"./create-organization-dialog-Clkjs9zG.js";import"./form-DiOJGRXq.js";import"./project-apps-DHXOO_qz.js";import"./use-recent-apps-C9vG5TR3.js";import"./use-session-runtime-Dlgl4ufa.js";import"./experiments-tab-choice-BPWZ6-EI.js";import"./sandbox-url-D3mC8qhT.js";import"./utils-B8OWeF28.js";import"./use-sandbox-events-PM3dvDwL.js";import"./sandbox-git-api-CH_-QFpD.js";import"./held-block-view-BX5kI9L6.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-BkPRQRG3.js";import"./collapsible-CQW9roHO.js";import"./use-copy-BYfqkrcX.js";import"./usage-stats-CgVbjgnU.js";import"./tool-namespace-Db1FE8-P.js";import"./utils-CVEq3hMx.js";import"./markdown-B-00ZOm1.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CCB0FZaP.js";import"./types-DfI6bP71.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./use-connection--nQEudkr.js";import"./use-mcp-prompts-6zv9IXeR.js";import"./use-thread-outputs-uAgeAbTT.js";import"./file-type-icon-C3nhEJVa.js";import"./section-array-field-WuEC2hxv.js";import"./alert-BagxECyU.js";import"./parse-sections-BDlriD2E.js";import"./blocks-tab-states-CgmkhE5b.js";import"./slider-DM-iwDAN.js";import"./index-S0DELbp3.js";import"./index-BdQq_4o_.js";import"./tooltipContext-DT0TA2xa.js";import"./CategoricalChart-Dup_V6G1.js";import"./index-rpRRVwY4.js";import"./ActiveShapeUtils-DC_uFkfj.js";import"./Sector-DoDCEu0-.js";import"./symbol-COdkYi-n.js";import"./empty-state-BWR7Jy-d.js";import"./switch-BI5z5Ju7.js";import"./textarea-BLncutjk.js";import"./popover-C4qbExP3.js";import"./scroll-area-EUJaQXLw.js";import"./monaco-editor-zjNnLgmQ.js";import"./editor-CFcE0Q6O.js";import"./calendar-Bkrc3Tn3.js";import"./select-B8yvCqU-.js";import"./editor-classes-C8l2uWj9.js";import"./toggle-group-DJHavtFz.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-CQVbSSH0.js";import"./search-input-VUL2ibQB.js";import"./tabs-ZzbSttVx.js";import"./use-file-configs-emNeeY81.js";import"./asset-utils-Qf3MBvDM.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./sandbox-lifecycle-context-BCrUk0wr.js";import"./variant-matcher-override-CdLkXK72.js";import"./variant-draft-pointer-BeAKcq_c.js";import"./section-preview-url-7zfngvgW.js";import"./use-fast-preview-draft-url-DUx_v0ir.js";import"./preview-link-C762yHOt.js";import"./useQueries-gBucEmF_.js";import"./device-hint-SeLRi17j.js";import"./virtual-mcp-CtaYyY8_.js";import"./url-slug-bePBUEDA.js";import"./app-preview-url-9Od4s8Sz.js";import"./preview-source-BsRLGWUP.js";import"./use-task-metadata-WYOfWDrq.js";import"./mustache-Kyny1r3W.js";import"./use-content-sync-BpAr_qkU.js";import"./checkbox-DYPRxtdw.js";import"./date-utils-CrvIKg-s.js";import"./use-move-blocks-DEI5xTJ9.js";import"./badge-DlHCn1A-.js";import"./empty-state-B7gwb6En.js";import"./site-draft-actions--anq5Oyn.js";import"./separator-DRkT8HMb.js";import"./use-releases-CzZzLiYc.js";import"./serial-task-queue-CGOeQgpr.js";import"./index-CEQNEhri.js";import"./drawer-D2Rnb_2A.js";import"./input-Dt5Q4j50.js";import"./icon-button-DBRjX149.js";import"./chat-draft-CxBIV5gW.js";import"./use-deco-credits-ChCk-7Ic.js";import"./use-open-billing-url-BhHBrwI4.js";import"./index-BwcojXtb.js";import"./ai-providers-logos-DD3qZ33J.js";import"./input-D2PyfPad.js";import"./suggestion-DtPrQaPS.js";import"./use-org-fs-CPqLHgiA.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-CF5xE385.js";import"./plan-ladder-Bk5SqgcV.js";import"./add-connection-dialog-BlF-9HgF.js";import"./extract-connection-data-TNmbX43n.js";import"./metadata-D72DunRR.js";import"./connection-D9ij5W2w.js";import"./connection-card-Ds4cDjLL.js";import"./connection-slug-CITJ0kGN.js";import"./schema-BXNU8wK3.js";import"./connection-form-helpers-BPCfMFZi.js";import"./authenticate-and-persist-oauth-miETlukP.js";import"./mcp-oauth-KanvJCH4.js";import"./mcp-oauth-DVsOtQR9.js";import"./collection-tabs--jJp2ESY.js";import"./use-infinite-scroll-tiBiQUrG.js";import"./useSuspenseInfiniteQuery-Bj1LgSIL.js";import"./use-task-board-events-Cjw4-qyi.js";import"./releases-api-BP4D_7BV.js";import"./named-rule-uses-Bf97NaES.js";import"./save-changes-debug-nBi-n9eV.js";function I(e){return e.kind==="unavailable"&&e.source==="local"&&(e.problem?.reason??"not-answering")==="not-answering"}const it=e=>e;function rt(e){const t=u.c(10),{candidates:o,invalidLink:c,shell:m,editor:i}=e,r=c===void 0?!1:c,s=m===void 0?it:m,[p,l]=g.useState(null);if(p){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),t[0]=f):f=t[0];let h;return t[1]!==p||t[2]!==i?(h=i(p,f),t[1]=p,t[2]=i,t[3]=h):h=t[3],h}let a;t[4]!==o||t[5]!==r?(a=n.jsx(nt,{candidates:o,invalidLink:r,onConnect:l}),t[4]=o,t[5]=r,t[6]=a):a=t[6];let d;return t[7]!==s||t[8]!==a?(d=s(a),t[7]=s,t[8]=a,t[9]=d):d=t[9],d}function nt(e){const t=u.c(17),{candidates:o,invalidLink:c,onConnect:m}=e,i=c===void 0?!1:c,[r]=F(),{language:s}=r;let p;t[0]!==m?(p=D=>m({endpoint:D}),t[0]=m,t[1]=p):p=t[1];let l;t[2]!==o||t[3]!==p?(l={candidates:o,onFound:p},t[2]=o,t[3]=p,t[4]=l):l=t[4];const a=Q(l),{state:d,access:f,needsGesture:h}=a;let k;t[5]!==o||t[6]!==s?(k=new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(o.map(T)),t[5]=o,t[6]=s,t[7]=k):k=t[7];const C=k;let j;t[8]!==f||t[9]!==a.start||t[10]!==h||t[11]!==d?(j=f==="denied"?{kind:"denied"}:h?{kind:"needs-gesture",onStart:a.start}:d.problem?{kind:"problem",problem:d.problem,host:T(d.problem.endpoint)}:{kind:"looking",paused:d.status==="paused"},t[8]=f,t[9]=a.start,t[10]=h,t[11]=d,t[12]=j):j=t[12];const _=j;let S;return t[13]!==C||t[14]!==i||t[15]!==_?(S=n.jsx(B,{wait:_,hosts:C,invalidLink:i}),t[13]=C,t[14]=i,t[15]=_,t[16]=S):S=t[16],S}const v="deco-serve",w="working-tree",st={id:"",slug:"",name:"",logo:null},mt={id:v,slug:v},pt={virtualMcpId:v,taskId:null,openTask:()=>{},createTask:()=>"",createTaskWithMessage:()=>{},activeTask:null,isThreadLocked:!1,lockedHarness:null,lockedBranch:null,currentBranch:w,setCurrentTaskBranch:()=>{}};function at(){const e=window.location.hash,t=new URLSearchParams(e.replace(/^#/,"")).has("endpoint"),o=t?W(e):null;return t&&window.history.replaceState(null,"",window.location.pathname+window.location.search),o&&J(o),{candidates:U(o,z()),invalidLink:t&&!o}}const ct=[{id:"site-editor",to:"/site-editor",label:"preview"},{id:"content",to:"/site-editor/content",label:"content"}];function lt(){const e=u.c(6),t=O();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:dt},e[0]=o):o=e[0];const c=P(o);let m;e[1]!==t||e[2]!==c?(m=ct.map(r=>n.jsx(y.Tab,{asChild:!0,active:c==="content"==(r.id==="content"),children:n.jsxs(M,{to:r.to,activeOptions:{exact:!0},children:[n.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(tt,{icon:et({tabId:r.id,kind:"system",connections:[]})})}),t(`common.mainPanelTabs.${r.label}`)]})},r.id)),e[1]=t,e[2]=c,e[3]=m):m=e[3];let i;return e[4]!==m?(i=n.jsx(y.Tabs,{children:m}),e[4]=m,e[5]=i):i=e[5],i}function dt(e){return e.matches.at(-1)?.staticData.siteEditorView}function N(e){const t=u.c(14),{children:o}=e,c=O(),{connection:m}=q(v),i=R(v,w);let r,s;if(t[0]!==i||t[1]!==o||t[2]!==m||t[3]!==c){s=Symbol.for("react.early_return_sentinel");t:{if(r=m?T(m.endpoint):"",i.kind==="protocol"){s=o;break t}if(i.kind!=="unavailable"||I(i)){s=n.jsx(Y,{headingLevel:2,waiting:!0,title:c("decoServe.connect.reaching",{host:r})});break t}}t[0]=i,t[1]=o,t[2]=m,t[3]=c,t[4]=r,t[5]=s}else r=t[4],s=t[5];if(s!==Symbol.for("react.early_return_sentinel"))return s;let p;t[6]!==i.problem?(p=i.problem??{reason:"not-answering"},t[6]=i.problem,t[7]=p):p=t[7];let l;t[8]!==r||t[9]!==p?(l={kind:"problem",problem:p,host:r},t[8]=r,t[9]=p,t[10]=l):l=t[10];let a;return t[11]!==r||t[12]!==l?(a=n.jsx(B,{wait:l,hosts:r}),t[11]=r,t[12]=l,t[13]=a):a=t[13],a}function ut(e){const t=u.c(6),{onLost:o}=e,c=R(v,w);let m;t[0]!==c?(m=I(c),t[0]=c,t[1]=m):m=t[1];const i=m;let r,s;return t[2]!==i||t[3]!==o?(r=()=>{i&&o()},s=[i,o],t[2]=i,t[3]=o,t[4]=r,t[5]=s):(r=t[4],s=t[5]),g.useEffect(r,s),null}const A={threadOpen:!1,contentOpen:!0,threadVisibilityExplicit:!1,toggleThread:()=>{},toggleContent:()=>{}};function ft(){const e=u.c(11),{data:t}=E.useSession();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:ht},e[0]=o):o=e[0];const c=P(o),m=!!t?.user;let i;e[1]!==m?(i={rail:m},e[1]=m,e[2]=i):i=e[2];const r=c??"preview";let s,p,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(lt,{}),p=n.jsx(x.Thread,{children:null}),l=n.jsx(ot,{}),e[3]=s,e[4]=p,e[5]=l):(s=e[3],p=e[4],l=e[5]);let a;e[6]!==r?(a=n.jsx(L.Content,{children:n.jsxs(x,{...A,threadless:!0,contentKey:r,contentNavigation:s,children:[p,l]})}),e[6]=r,e[7]=a):a=e[7];let d;return e[8]!==i||e[9]!==a?(d=n.jsx(L,{outsideOrg:i,children:a}),e[8]=i,e[9]=a,e[10]=d):d=e[10],d}function ht(e){return e.matches.at(-1)?.staticData.siteEditorView}function vt(e){const t=u.c(8),{children:o}=e,{data:c}=E.useSession(),m=!!c?.user;let i;t[0]!==m?(i={rail:m},t[0]=m,t[1]=i):i=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(x.Thread,{children:null}),t[2]=r):r=t[2];let s;t[3]!==o?(s=n.jsx(L.Content,{children:n.jsxs(x,{...A,threadless:!0,contentKey:"guide",children:[r,n.jsx(x.Content,{children:o})]})}),t[3]=o,t[4]=s):s=t[4];let p;return t[5]!==i||t[6]!==s?(p=n.jsx(L,{outsideOrg:i,children:s}),t[5]=i,t[6]=s,t[7]=p):p=t[7],p}const b=()=>{},xt={connection:null,set:b,clear:b};function pr(){const e=u.c(3),[t]=g.useState(at);let o;return e[0]!==t.candidates||e[1]!==t.invalidLink?(o=n.jsx(G,{value:!0,children:n.jsx(H,{org:st,project:mt,children:n.jsx(rt,{candidates:t.candidates,invalidLink:t.invalidLink,shell:jt,editor:kt})})}),e[0]=t.candidates,e[1]=t.invalidLink,e[2]=o):o=e[2],o}function kt(e,t){return n.jsxs($.Provider,{value:{connection:e,set:b,clear:b},children:[n.jsx(ut,{onLost:t}),n.jsx(V,{value:pt,children:n.jsx(K,{children:n.jsx(ft,{})})})]})}function jt(e){return n.jsx($.Provider,{value:xt,children:n.jsx(vt,{children:e})})}function ar(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(X,{virtualMcpId:v})}),e[0]=t):t=e[0],t}function cr(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(Z,{virtualMcpId:v})}),e[0]=t):t=e[0],t}export{cr as SiteEditorContent,ar as SiteEditorPreview,pr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as P,q as z,m as M,K as h,eP as ct,aK as zt,aL as Xt,r as j,a as Zt,az as pe,a4 as qt,eQ as lt,eR as Ce,bh as be,eS as ue,eT as _e,eU as Ne,ax as Kt,bq as ut,eV as F,eW as ee,eX as we,eY as He,eZ as en,t as q,j as G}from"./index-BJ9m9LNK.js";import{u as dt}from"./use-session-runtime-CbMaO8p7.js";import{s as Ge}from"./thread-intent-DXpv35UG.js";import{u as Re,b as tn}from"./experiments-tab-choice-vFGVi3bn.js";import{b as de}from"./sandbox-url-D3mC8qhT.js";import{s as nn}from"./utils-muk7Isuo.js";import{a as on}from"./repository-binding-5kMOX4dj.js";import{u as rn}from"./chat-context-2letHrEJ.js";import{i as sn,u as an}from"./use-sandbox-events-BGso5ik2.js";import{a as cn}from"./sandbox-git-api-CH_-QFpD.js";import{e as ln}from"./backoff-CrEUbyZT.js";const S={MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,NotFound:-32001,Conflict:-32002,InvalidBlock:-32003,ReadOnly:-32005,Unsupported:-32006,LimitExceeded:-32007,Unavailable:-32008,Unauthorized:-32010};class D extends Error{code;data;constructor(t,n,o){super(n),this.name="ContentProtocolError",this.code=t,this.data=o}toJSON(){return this.data===void 0?{code:this.code,message:this.message}:{code:this.code,message:this.message,data:this.data}}static from(t){return new D(t.code,t.message,t.data)}}const Z="deco-content",Se={major:1},ft=1;async function un(e){let t=new Uint8Array(await e.arrayBuffer());if(t[0]===31&&t[1]===139){const n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));t=new Uint8Array(await new Response(n).arrayBuffer())}return JSON.parse(new TextDecoder().decode(t))}const ye={major:Se.major,minor:ft},ht=`the endpoint speaks an older ${Z} than this client needs (${ye.major}.${ye.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function ne(e,t,n){const o={reason:t,required:{...ye}};if(n){o.actual={protocol:n.protocol,major:n.version?.major,minor:n.version?.minor};const r=n.server;typeof r?.name=="string"&&typeof r.version=="string"&&(o.server={name:r.name,version:r.version})}return new D(S.Unsupported,e,o)}function gt(e){const t=e??{},{protocol:n,version:o}=t;if(n!==Z)throw ne(`the endpoint speaks ${JSON.stringify(n)}, not ${Z}`,"protocol",t);if(o?.major!==Se.major)throw ne(`the endpoint speaks ${Z} ${String(o?.major)}.x; this client speaks ${Se.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<ft)throw ne(ht,"outdated",t);return e}function Je(e,t){return t.code===S.MethodNotFound&&e.startsWith("changes.")?ne(ht,"outdated"):D.from(t)}function xe(e){const t=e.fetch??(s=>fetch(s));let n=1;async function o(s){const i={"content-type":"application/json",accept:"application/json",...e.headers},a=await t(new Request(e.endpoint,{method:"POST",headers:i,body:JSON.stringify(s)}));let l;try{l=await un(a)}catch{throw new D(S.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(l)&&l?.id===null){const c=l?.error;throw c?D.from(c):new D(S.Unavailable,`the endpoint answered HTTP ${a.status}`)}return l}const r=async(s,i)=>{const a=n++,l=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(l.error)throw Je(s,l.error);return l.result};return{call:r,describe:async()=>gt(await r("describe")),schemaGet:s=>r("schema.get",s),blocksList:s=>r("blocks.list",s),blocksApply:s=>r("blocks.apply",s),changesList:s=>r("changes.list",s),changesGet:s=>r("changes.get",s),changesDiscard:s=>r("changes.discard",s),async batch(s){const i=s.map(()=>n++),a=await o(s.map((c,u)=>({jsonrpc:"2.0",id:i[u],method:c.method,params:c.params??{}}))),l=new Map(a.map(c=>[c.id,c]));return i.map((c,u)=>{const d=l.get(c);return d?d.error?{ok:!1,error:Je(s[u].method,d.error)}:{ok:!0,result:d.result}:{ok:!1,error:new D(S.InternalError,"no response for this call")}})}}}function vt(e){return e&&!e.edited?{ifNoneMatch:e.revision}:{}}const We=20,Ye=5,ze=500;function Pe(e){return e instanceof D?e.code===S.MethodNotFound?!0:e.code===S.Unsupported&&e.data?.reason==="outdated":!1}function Ee(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function dn(e,t,n){const o=h.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(vt(r)),i=Ee(r,s);if(i)return i;const a=await t.changesList({});return Ee(void 0,a)}async function fn(e,t){const n=[];for(let s=0;s<t.length;s+=We)n.push(t.slice(s,s+We));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=Ye){const i=await e.batch(n.slice(s,s+Ye).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const l=a.result;Object.assign(o,l.entries),r.push(...l.diagnostics)}}return{entries:o,diagnostics:r}}async function Jo(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=ze){const r=t.slice(o,o+ze),s=await e.changesDiscard({names:r.map(i=>i.name),ifMatch:Object.fromEntries(r.map(i=>[i.name,i.version]))});n={revision:s.revision,versions:{...n.versions,...s.versions}}}return n}function Wo(e){return e instanceof D&&e.code===S.Conflict}function mt(e){return e?.kind==="protocol"?e:null}function Yo(e,t,n){const o=P.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=z();let a;o[2]!==e?(a=mt(e),o[2]=e,o[3]=a):a=o[3];const l=a,c=!!l&&!!t&&s.enabled!==!1;let u;o[4]!==t?(u=h.contentChanges(t??""),o[4]=t,o[5]=u):u=o[5];let d;o[6]!==t||o[7]!==c||o[8]!==l||o[9]!==i?(d=c?()=>dn(i,l.client,t):ct,o[6]=t,o[7]=c,o[8]=l,o[9]=i,o[10]=d):d=o[10];let g;return o[11]!==u||o[12]!==d?(g={queryKey:u,queryFn:d,staleTime:0},o[11]=u,o[12]=d,o[13]=g):g=o[13],M(g)}function zo(e,t,n){const o=P.c(14);let r;o[0]!==e?(r=mt(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i;o[2]!==n?(i=n?Object.keys(n.changes):[],o[2]=n,o[3]=i):i=o[3];const a=i,l=!!s&&!!t&&!!n&&a.length>0;let c;o[4]!==t||o[5]!==n?.revision?(c=h.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=c):c=o[6];let u;o[7]!==l||o[8]!==a||o[9]!==s?(u=l?()=>fn(s.client,a):ct,o[7]=l,o[8]=a,o[9]=s,o[10]=u):u=o[10];let d;return o[11]!==c||o[12]!==u?(d={queryKey:c,queryFn:u,staleTime:Number.POSITIVE_INFINITY},o[11]=c,o[12]=u,o[13]=d):d=o[13],M(d)}function pt(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 ie(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 bt=zt({endpoint:Xt().max(2048).refine(e=>pt(e)&&new URL(e).pathname==="/rpc").transform(ie)});function Xo(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=bt.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function wt(e){const t=bt.safeParse(e);return t.success?t.data:null}const St="studio:deco-serve-last";function Zo(e){try{localStorage.setItem(St,JSON.stringify(e))}catch{}}function qo(){try{const e=localStorage.getItem(St);return e?wt(JSON.parse(e)):null}catch{return null}}function Ko(e){try{return new URL(ie(e)).host}catch{return e}}function hn(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const gn="http://localhost:4545/rpc",er="npx @decocms/blocks serve",tr="npx @decocms/blocks schema";class $e extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function vn(e){if(e instanceof $e)return{reason:"not-deco-serve"};if(!(e instanceof D))return{reason:"not-answering"};switch(e.code){case S.Unauthorized:case S.MethodNotFound:return{reason:"outdated"};case S.Unsupported:return Pe(e)?{reason:"outdated"}:{reason:"version-mismatch"};case S.Unavailable:return/^the endpoint answered HTTP/.test(e.message)?{reason:"not-deco-serve"}:{reason:"error",detail:e.message};default:return{reason:"error",detail:e.message}}}function nr(e,t){if(e)return[ie(e.endpoint)];const n=[t?.endpoint,gn].filter(o=>!!o).map(ie);return[...new Set(n)]}const yt=j.createContext(null);function mn(e){const t=P.c(27),n=j.useContext(yt),o=Re(n?null:e),{data:r}=Zt.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?pe.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[l,c]=Ze(a);let u;t[4]!==i||t[5]!==s||t[6]!==e?(u=i?pe.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=u):u=t[7];const[d,g]=Ze(u);if(n)return n;let f;t[8]!==l||t[9]!==i?(f=i?wt(l):null,t[8]=l,t[9]=i,t[10]=f):f=t[10];const v=f,b=!!v;let w;t[11]!==o||t[12]!==b?(w=pn(o,b),t[11]=o,t[12]=b,t[13]=w):w=t[13];const{applies:I,undecided:T}=w,x=I?v:null,_=i&&o==="v8"&&typeof d=="string"?d:null;let C;t[14]!==g||t[15]!==c||t[16]!==i?(C=N=>{i&&(c(N),g(N.endpoint))},t[14]=g,t[15]=c,t[16]=i,t[17]=C):C=t[17];let E;t[18]!==c||t[19]!==i?(E=()=>{i&&c(null)},t[18]=c,t[19]=i,t[20]=E):E=t[20];let k;return t[21]!==x||t[22]!==_||t[23]!==C||t[24]!==E||t[25]!==T?(k={connection:x,undecided:T,lastEndpoint:_,set:C,clear:E},t[21]=x,t[22]=_,t[23]=C,t[24]=E,t[25]=T,t[26]=k):k=t[26],k}function pn(e,t){return t?e==="loading"?{applies:!1,undecided:!0}:{applies:e==="v8"||e==="error",undecided:!1}:{applies:!1,undecided:!1}}function Xe(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function Ze(e){const t=P.c(17),n=z(),o=e??"";let r;t[0]!==o?(r=["localStorage",o],t[0]=o,t[1]=r):r=t[1];const s=r;let i,a;t[2]!==e?(i=()=>e?Xe(e):null,a=()=>e?Xe(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const l=!!e;let c;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==l?(c={queryKey:s,queryFn:i,initialData:a,enabled:l,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=l,t[9]=c):c=t[9];const{data:u}=M(c);let d;t[10]!==e||t[11]!==n||t[12]!==s?(d=b=>{if(e){try{b===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(b))}catch{}n.setQueryData(s,b)}},t[10]=e,t[11]=n,t[12]=s,t[13]=d):d=t[13];const g=d,f=e?u??null:null;let v;return t[14]!==g||t[15]!==f?(v=[f,g],t[14]=g,t[15]=f,t[16]=v):v=t[16],v}function or(e){return e.kind==="protocol"||e.kind==="unavailable"}function rr(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n==="protocol"||n==="unavailable"?!0:n==="pending"?t===!0?!0:void 0:t}function sr(e,t,n){return t!=="github"||n!=="v8"?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function ir(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&pt(t)?t:null}function ar(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function Et(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function bn(e){if(!e.hasProject)return"legacy";const t=Et(e);if(t==="local")return"protocol-local";if(e.serveConnectionUndecided)return"pending";if(t==="sandbox"){const o=e.sandboxSite;return o==="v8"?"protocol-sandbox":o==="v7"?"legacy":o==="error"?e.markedV8?"retrying-sandbox":"legacy":"pending"}if(e.mainSchema==="loading")return"pending";if(e.mainSchema==="error")return"retrying-github";if(e.mainSchema==="v7")return"legacy";const n=e.githubSite;return n==="v8"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":n==="v7"?"legacy":"pending"}function wn(e){return{github:e.mode==="github"&&e.mainSchema==="v8",sandbox:e.mode==="sandbox"&&e.workingTreeReady}}function qe(e){return e.isError||e.errorUpdateCount>0}function Sn(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const r of n)Object.hasOwn(t,r)?o[r]=t[r]:delete o[r];return o}function yn(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 kt="__noSchema";function En(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[kt]:!0}}function cr(e){return!!e&&e[kt]===!0}function Ot(e){if(!e.ok)return e.error.code===S.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function kn(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const On=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function lr(e){const t=new Map;for(const[n,o]of Object.entries(e)){const r=o&&typeof o=="object"&&!Array.isArray(o)?o:{},s=typeof r.__resolveType=="string"?r.__resolveType:null,i=t.get(s)??[];i.push({key:n,label:kn(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(On)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:Ke(n.resolveType).localeCompare(Ke(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function Ke(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function et(e,t,n){if(t.length===0)return n;const[o,...r]=t;if(Array.isArray(e)&&typeof o=="number"){const s=e.slice();return s[o]=et(e[o],r,n),s}if(e&&typeof e=="object"&&typeof o=="string"){const s=e,i={};for(const a of Object.keys(s))i[a]=a===o?et(s[a],r,n):s[a];return i}return e}function ur(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class tt extends Error{}class nt extends Error{}const Dt="site-not-owned";async function Dn(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function Tn(e,t=r=>fetch(r),n,o){const r=xe({endpoint:e,fetch:async s=>{const i=new Request(s);for(const[l,c]of Object.entries(ue("v8")))i.headers.set(l,c);const a=await t(i);if(await Dn(a))throw new nt;if(await _e(a))throw n?.(),new Ne;return a}});try{const s=await Le(r,be(o)?{schema:o}:void 0);return s.v8Schema?s:null}catch(s){if(s instanceof nt)return Dt;throw s}}const Ae=5e3;function In(e){return new URL(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/rpc`,window.location.origin).href}function Cn(e){return new URL(de(e,"rpc"),window.location.origin).href}async function Le(e,t){const[n,o]=await e.batch(t?[{method:"describe"}]:[{method:"describe"},{method:"schema.get"}]);if(!n?.ok)throw n?.error??new Error("no describe");if(n.result?.protocol!==Z)throw new $e;const s=gt(n.result);if(t)return{client:e,describe:s,hasSchema:t.schema!=null,v8Schema:be(t.schema)};if(!o)throw new Error("no schema.get");if(Ot(o))return{client:e,describe:s,hasSchema:!1,v8Schema:!1};if(o.ok){const i=o.result;return{client:e,describe:s,hasSchema:!0,v8Schema:be(i?.schema)}}throw o.error}async function _n(e,t=n=>fetch(n)){const n=xe({endpoint:e,fetch:async o=>{const r=await t(o);if(r.status===404)throw new tt;return r}});try{const o=await Le(n);return o.v8Schema?o:null}catch(o){if(o instanceof tt)return null;throw o}}function Tt(e,t){const n=P.c(53),{org:o}=qt(),{connection:r,undecided:s}=mn(e),{runtime:i}=dt(e),a=j.useContext(yt),l=Re(a?null:e),c=tn(e),u=Et({hasServeConnection:!!r,runtime:i}),d=rn()?.taskId??null,g=sn(an().lifecycle.phase),f=z(),v=wn({mode:u,mainSchema:l,workingTreeReady:g}),b=v.github&&!!o.slug&&!!e&&!!t;let w;n[0]!==t||n[1]!==o.slug||n[2]!==f||n[3]!==e?(w=()=>Tn(In({orgSlug:o.slug,virtualMcpId:e,branch:t}),void 0,()=>Ce(f,o.slug,e),lt(f,o.slug,e)?.schema),n[0]=t,n[1]=o.slug,n[2]=f,n[3]=e,n[4]=w):w=n[4];const I=M({queryKey:h.contentBackend(o.slug,e??"",t??"","github"),queryFn:w,enabled:b,staleTime:Number.POSITIVE_INFINITY,...ot}),T=v.sandbox&&!!o.slug&&!!e&&!!t;let x;n[5]!==t||n[6]!==o.slug||n[7]!==d||n[8]!==e?(x=async()=>_n(Cn({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:d})),n[5]=t,n[6]=o.slug,n[7]=d,n[8]=e,n[9]=x):x=n[9];const _=M({queryKey:h.contentBackend(o.slug,e??"",t??"","sandbox",d??""),queryFn:x,enabled:T,staleTime:Number.POSITIVE_INFINITY,...ot}),C=!!r;let E;n[10]!==r?.endpoint||n[11]!==o.slug||n[12]!==e?(E=h.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[10]=r?.endpoint,n[11]=o.slug,n[12]=e,n[13]=E):E=n[13];let k;n[14]!==r?(k=()=>Le(xe({endpoint:r.endpoint})),n[14]=r,n[15]=k):k=n[15];let N;n[16]!==C||n[17]!==E||n[18]!==k?(N={queryKey:E,queryFn:k,enabled:C,staleTime:Number.POSITIVE_INFINITY,retry:xn,retryDelay:Rn,refetchInterval:Nn},n[16]=C,n[17]=E,n[18]=k,n[19]=N):N=n[19];const p=M(N);let O;n[20]!==r?.endpoint||n[21]!==o.slug||n[22]!==e?(O=h.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[20]=r?.endpoint,n[21]=o.slug,n[22]=e,n[23]=O):O=n[23];const $=O;let y;n[24]!==r?.endpoint||n[25]!==o.slug||n[26]!==e?(y=h.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[24]=r?.endpoint,n[25]=o.slug,n[26]=e,n[27]=y):y=n[27];let R;n[28]!==p.data||n[29]!==$||n[30]!==f?(R=async()=>{try{return await p.data.client.describe()}catch(m){const Y=m;throw f.invalidateQueries({queryKey:$,exact:!0},{cancelRefetch:!1}),Y}},n[28]=p.data,n[29]=$,n[30]=f,n[31]=R):R=n[31];const A=!!p.data&&!a;let U;n[32]!==y||n[33]!==R||n[34]!==A?(U={queryKey:y,queryFn:R,enabled:A,refetchInterval:Ae,retry:!1},n[32]=y,n[33]=R,n[34]=A,n[35]=U):U=n[35];const V=M(U).data??p.data?.describe,L=bn({hasProject:!!e,hasServeConnection:!!r,serveConnectionUndecided:s,runtime:i,mainSchema:l,githubSite:I.data===Dt?"not-owned":I.data?"v8":I.data===null?"v7":qe(I)?"error":"loading",sandboxSite:Pn({data:_.data,isError:qe(_),workingTreeReady:g}),markedV8:c});if(L==="pending"){let m;return n[36]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending"},n[36]=m):m=n[36],m}if(L==="retrying-github"){let m;return n[37]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending",retrying:"github"},n[37]=m):m=n[37],m}if(L==="retrying-sandbox"){let m;return n[38]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending",retrying:"sandbox"},n[38]=m):m=n[38],m}if(L==="legacy"){let m;return n[39]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"legacy"},n[39]=m):m=n[39],m}if(L==="protocol-github"){const m=I.data;let Y;return n[40]!==m?(Y=ke("github",m,""),n[40]=m,n[41]=Y):Y=n[41],Y}if(L==="site-not-owned-github"){let m;return n[42]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github",siteNotOwned:!0},n[42]=m):m=n[42],m}if(L==="protocol-sandbox"){let m;return n[43]!==_.data?(m=ke("sandbox",_.data,":sandbox"),n[43]=_.data,n[44]=m):m=n[44],m}if(L==="unavailable-github"){let m;return n[45]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github"},n[45]=m):m=n[45],m}const W=p.error??p.failureReason,ve=r?.endpoint??"";let te;return n[46]!==V||n[47]!==p.data||n[48]!==p.failureCount||n[49]!==p.isError||n[50]!==W||n[51]!==ve?(te=An({probed:p.data,isError:p.isError,failureCount:p.failureCount,failure:W,describe:V,endpoint:ve}),n[46]=V,n[47]=p.data,n[48]=p.failureCount,n[49]=p.isError,n[50]=W,n[51]=ve,n[52]=te):te=n[52],te}function Nn(e){return e.state.status==="error"||e.state.data?.v8Schema===!1?Ae:!1}function Rn(e){return hn(e+1)}function xn(e,t){return!(t instanceof D)&&!(t instanceof $e)}function Pn(e){return e.data!==void 0?e.data?"v8":"v7":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const $n=3;function An(e){if(e.probed?.hasSchema&&!e.probed.v8Schema)return{kind:"unavailable",source:"local",problem:{reason:"not-v8"}};const t=e.probed?ke("local",{...e.probed,describe:e.describe??e.probed.describe},`:serve:${e.endpoint}`):null;return e.isError||e.failureCount>0?t?.kind==="protocol"&&!e.isError&&e.failureCount<$n?t:{kind:"unavailable",source:"local",problem:vn(e.failure)}:t??{kind:"pending"}}const ot={retry:2,refetchInterval:e=>e.state.status==="error"?Ae:!1};function ke(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema}}function It(e){const t=P.c(13);let n;t[0]!==e?(n=pe.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=Kt(o,null),i=Re(e);let a;if(t[2]!==i||t[3]!==r||t[4]!==e){const g=e?Ge(r):null;a=Ln({saved:g,main:i}),t[2]=i,t[3]=r,t[4]=e,t[5]=a}else a=t[5];const l=a;let c,u;t[6]!==s?(c=g=>s(Ge(g)),u=()=>s(null),t[6]=s,t[7]=c,t[8]=u):(c=t[7],u=t[8]);let d;return t[9]!==l||t[10]!==c||t[11]!==u?(d={...l,setUrl:c,clear:u},t[9]=l,t[10]=c,t[11]=u,t[12]=d):d=t[12],d}function Ln(e){return e.saved?e.main==="v7"?{url:e.saved,undecided:!1}:e.main==="v8"?{url:null,undecided:!1}:{url:null,undecided:!0}:{url:null,undecided:!1}}function jn(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function rt(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}class je extends Error{constructor(t,n,o=[],r=!1){super(n),this.blocks=t,this.fields=o,this.carriedStored=r,this.name="BlockConflictError"}blocks;fields;carriedStored}function Ue(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function fe(e,t,n){return["decofile-write",e,t,n]}function Un(e,t,n){return{id:fe(e,t,n).join(":")}}function Me(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function Mn(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function Fn(e,t,n){e.setQueryData(h.decofileDraft(Ue(t)),n)}function Qn(e,t){return e.getQueryData(h.decofileDraft(Ue(t)))??null}async function Bn(e,t){const n=await fetch(Me(e),{cache:"no-store",headers:{...ue("v7"),"if-none-match":`"${t}"`}}).catch(()=>null);return n?.status===200||n?.status===409}function dr(e){const t=P.c(4);let n;t[0]!==e?(n=h.decofileDraft(e?Ue(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Vn,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=M(o);return r??null}async function Vn(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function Hn(e,t){const n=await fetch(Me(t),{cache:"no-store",headers:ue("v7")});if(await _e(n))throw Ce(e,t.orgSlug,t.virtualMcpId),new Ne;if(!n.ok){const r=new Error(`Failed to fetch decofile: ${n.status}`);throw r.status=n.status,r}const o=await n.json();return o.token&&Fn(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function fr(e,t){const n=await fetch(Me(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const r=await n.json().catch(()=>({}));throw r.code==="block-conflict"?new je(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return Mn(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const Ct=3e3,Gn=15e3,Jn=2*6e4,_t={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function Wn(e){return e<Jn?Ct:Gn}function Yn(e,t=_t){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,Wn(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:l,skip:c}=e();if(r||t.hidden()||c?.()){i();return}r=!0;let u;try{u=l()}catch{u=void 0}Promise.resolve(u).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const st=()=>0;function zn(e,t,n=_t){const o=j.useRef(t);o.current=t;const[r]=j.useState(()=>({polling:()=>Yn(()=>o.current,n),idle:()=>()=>{}}));j.useSyncExternalStore(e?r.polling:r.idle,st,st)}function Nt(e,t){return de(e,t)}function Xn(e,t){return de(e,"preview-fetch",{path:t})}function hr(e){return Nt(e,"preview-invoke")}function gr(e){return Nt(e,"catalog-invoke")}function Rt(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 Zn(){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&&Rt(n))return n}return null}function qn(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??Zn();return n&&Rt(n)?new URL(t,n).toString():Xn(e,t)}function Kn(e){return qn(e,"/.decofile")}function eo(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function it(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function to(e,t){const n=de(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=eo(o.status);if(r==="absent")return{kind:"absent"};if(r==="unavailable")return{kind:"unavailable"};if(r==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const s=await o.json();return typeof s.content!="string"?{kind:"unavailable"}:{kind:"data",data:nn(s.content)}}async function no(e,t){const n=await to(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function vr(e){const t=`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/meta`,n=await fetch(t,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const o=new Error(`Failed to read committed meta: ${n.status}`);throw o.status=n.status,o}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function oo(e){return on(e)?.metadata?.runtime?.path??null}class xt extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function mr(e){return e instanceof D&&e.code===S.Conflict}function Pt(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 Fe extends Error{constructor(){super("The draft's changes couldn't be read"),this.name="HostedDraftUnreadError"}}class Qe extends Error{constructor(){super("The blocks kept changing while the change was saved"),this.name="HostedKeptChangingError"}}function pr(e,t){return(t instanceof Fe||t instanceof Qe)&&(t.message=$t(e,t,"github")),t}function $t(e,t,n){if(t instanceof Fe)return e("siteEditor.save.draftUnread");if(t instanceof Qe)return e("siteEditor.save.keptChanging");if(t instanceof je)return t.message;if(n==="local")return so(e,t);if(t instanceof D)switch(t.code){case S.Conflict:return e("siteEditor.save.conflict");case S.ReadOnly:return e("siteEditor.save.readOnly");case S.InvalidBlock:case S.InvalidParams:return e("siteEditor.save.invalid");case S.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function ro(e,t){if(t==="local"||e instanceof je||e instanceof Fe||e instanceof Qe)return null;if(e instanceof D){const n=e.code===S.InvalidBlock||e.code===S.InvalidParams?Pt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function so(e,t){if(t instanceof xt)return e("decoServe.save.serverGone");if(t instanceof D)switch(t.code){case S.Conflict:return e("decoServe.save.conflict");case S.ReadOnly:return e("decoServe.save.readOnly");case S.InvalidBlock:case S.InvalidParams:return e("decoServe.save.invalid",{detail:Pt(t)});case S.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function io(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function ao(e,t){const[n,o]=j.useState(e),r=j.useRef(null);return e&&!n&&o(!0),j.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=io(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const co="decocms:content-writes",Oe=new Set;let H;function At(){if(H!==void 0)return H;H=null;try{typeof BroadcastChannel=="function"&&(H=new BroadcastChannel(co),H.addEventListener("message",e=>{const t=e.data?.cacheKey;if(typeof t=="string")for(const n of[...Oe])n(t)}))}catch{H=null}return H}function lo(e){try{At()?.postMessage({cacheKey:e})}catch{}}function uo(e){return At(),Oe.add(e),()=>{Oe.delete(e)}}const Lt={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},fo=15e3,ae=new Map;function J(e,t){return`${e}/${t}`}function Q(e){let t=ae.get(e);return t||(t={state:Lt,listeners:new Set,previews:0,timer:null,discardListeners:new Set},ae.set(e,t)),t}function B(e,t){const n=Q(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function he(e){e.timer&&clearTimeout(e.timer),e.timer=null}function Be(e){return ae.get(e)?.state??Lt}function ho(e,t){const n=Q(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function br(e){const t=Q(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(he(t),B(e,{phase:"idle"}))}}function wr(e){const t=ae.get(e);!t||t.state.phase!=="reloading"||(he(t),B(e,{phase:"idle"}))}function jt(e){const t=Q(e);he(t),B(e,{phase:"saving",inFlight:t.state.inFlight+1})}function oe(e,t){const n=Q(e),o=Math.max(0,n.state.inFlight-1);if(o>0){B(e,{inFlight:o});return}if(!t.ok||n.previews===0){B(e,{phase:"idle",inFlight:o});return}Ut(e,t.navigates,o)}function Ut(e,t,n=0){const o=Q(e);he(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&B(e,{phase:"idle"})},fo),B(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function go(e){return e?.kind==="protocol"&&e.source==="github"}async function re(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,l=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:h.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await l,{navigates:!1};const c=s?h.protocolDraftRead(o,r,s):null,u=c?JSON.stringify(n.getQueryData(c)??null):null,d=l?[l]:[];if(a&&t.reread&&d.push(n.invalidateQueries({queryKey:h.decofile(a)})),a&&!t.adopted&&d.push(n.invalidateQueries({queryKey:h.contentChanges(a)})),s&&i.source==="sandbox"&&d.push(n.invalidateQueries({queryKey:cn(o,r,s)})),go(i)&&c&&!t.adopted&&d.push(n.invalidateQueries({queryKey:c})),await Promise.all(d),t.kind!=="edit"){const v=J(o,r);B(v,{epoch:Be(v).epoch+1})}const g=c?JSON.stringify(n.getQueryData(c)??null):null,f=u!==g;return f&&await new Promise(v=>ut.schedule(v)),{navigates:f}}async function vo(e,t){return jt(J(e.orgSlug,e.virtualMcpId)),Mt(e,t)}function at(e){return e.branch?JSON.stringify(e.queryClient.getQueryData(h.protocolDraftRead(e.orgSlug,e.virtualMcpId,e.branch))??null):null}async function Mt(e,t){const n=J(e.orgSlug,e.virtualMcpId),o=t.adopted?at(e):null;let r;try{r=await t.write()}catch(i){throw oe(n,{ok:!1,navigates:!1}),t.refreshOnError&&re(e,{kind:t.kind,reread:!0}).catch(()=>{}),i}if(e.backend?.kind==="protocol"&&e.cacheKey&&lo(e.cacheKey),t.adopted){const i=at(e)!==o;return i&&await new Promise(a=>ut.schedule(a)),oe(n,{ok:!0,navigates:i}),t.reread&&re(e,t).catch(()=>{}),r}let s=!1;try{({navigates:s}=await re(e,t))}catch{}finally{oe(n,{ok:!0,navigates:s})}return r}function Sr(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=J(o,r),a=new Set(t.blockKeys);for(const u of[...Q(i).discardListeners])u(a);jt(i);let l=!1;const c=()=>(l=!0,Mt(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:fe(o,r,s),scope:Un(o,r,s),mutationFn:c}).execute(void 0).catch(u=>{throw l||oe(i,{ok:!1,navigates:!1}),u}):c()}function yr(e,t,n){const o=P.c(8);let r;o[0]!==e||o[1]!==t?(r=J(e,t),o[0]=e,o[1]=t,o[2]=r):r=o[2];const s=r;let i;o[3]!==n||o[4]!==s?(i=()=>{const l=Q(s).discardListeners;return l.add(n),()=>{l.delete(n)}},o[3]=n,o[4]=s,o[5]=i):i=o[5];let a;o[6]!==s?(a=[s],o[6]=s,o[7]=a):a=o[7],j.useEffect(i,a)}function mo(e){const t=J(e.orgSlug,e.virtualMcpId);Be(t).inFlight>0||re(e,{kind:"external"}).then(({navigates:n})=>{const o=Q(t);o.previews>0&&o.state.inFlight===0&&Ut(t,n)}).catch(()=>{})}function po(e,t){const n=P.c(7);let o;n[0]!==e||n[1]!==t?(o=J(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=c=>ho(r,c),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>Be(r),n[5]=r,n[6]=a):a=n[6];const l=a;return j.useSyncExternalStore(i,l,l)}const bo=500;function Er(e,t){const{phase:n}=po(e,t);return ao(n!=="idle",bo)}function wo(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function So(e,t){return h.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function kr(e,t,n,o){if(o?.source==="github")return yo(e,t,n);const r=e.getQueryData(h.contentVersions(t));if(!r)return;if(Object.hasOwn(r,n))return r[n];const s=e.getQueryData(h.decofile(t));return s&&Object.hasOwn(s,n)?void 0:null}function K(e,t){if(Object.hasOwn(e.changes,t))return e.changes[t];const n=F(t),o=Object.keys(e.changes).find(r=>F(r)===n);return o===void 0?void 0:e.changes[o]}function yo(e,t,n){const o=e.getQueryData(h.contentChanges(t));if(o)return Ft(o,ge(e,t),n)}function Ft(e,t,n){const o=K(e,n);return o?.kind==="delete"?o.version??we:o?o.version:t.has(F(n))?we:null}function Or(e,t,n){const o=e.getQueryData(h.contentChanges(t));if(!o)return!1;const r=K(o,n);return r?r.kind==="set"&&r.baseVersion===null:ge(e,t).has(F(n))}function Dr(e,t){const n=e.getQueryData(h.decofile(t)),o=e.getQueryData(h.contentChanges(t));if(!n||!o)return null;const r=ge(e,t);return{blocks:n,versionOf:s=>Ft(o,r,s)}}function ge(e,t){return new Set(e.getQueryData(h.contentDraftTombstones(t)))}function ce(e,t,n,o){const r=F(n),s=ge(e,t);s.has(r)!==o&&(o?s.add(r):s.delete(r),ee(e),e.setQueryData(h.contentDraftTombstones(t),[...s]))}function Eo(e,t,n,o){const r=He(o.revision),s=e.getQueryData(h.contentRevision(n))?.revision,i=s?He(s):null,a=r&&!r.main&&i?en(i.main,r.draft):o.revision,l=e.getQueryData(h.contentVersions(n)),c=Object.entries(o.versions??{}).map(([f,v])=>[f,v===we?null:v]),u=e.getQueryData(h.contentChanges(n)),d=new Set(c.flatMap(([f])=>{const v=u?K(u,f):void 0;return(v?v.baseVersion:l?.[f]??null)===null?[f]:[]})),g=new Set(c.flatMap(([f,v])=>v===null?[]:[F(f)]));e.setQueryData(h.contentChanges(n),f=>{if(!f)return f;const v={...f.changes};for(const[b,w]of c){const I=K(f,b),T=I?I.baseVersion:l?.[b]??null;w!==null?v[b]={kind:"set",version:w,baseVersion:T}:T!==null?v[b]={kind:"delete",version:null,baseVersion:T}:delete v[b]}return{...f,changes:v,edited:!0}});for(const[f,v]of c)v!==null?ce(e,n,f,!1):!g.has(F(f))&&d.has(f)&&ce(e,n,f,!0);return r&&r.draft!=="none"&&e.setQueryData(h.protocolDraftRead(t.orgSlug,t.virtualMcpId,t.branch),f=>f&&{...f,version:r.draft}),a}function Ve(e,t,n){ee(e),e.setQueryData(h.contentVersions(t),o=>{const r={...o};for(const[s,i]of Object.entries(n))i===null?delete r[s]:r[s]=i;return r})}function ko(e,t){const n=e.getMutationCache().findAll({mutationKey:fe(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>yn(o.state.variables)))}function De(e,t){e.resetQueries({queryKey:h.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function le(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof D);throw t.source==="local"&&s?(De(e,n),new xt(r)):(t.source==="local"&&Pe(r)&&De(e,n),r)}}const se=new Map;function Qt(e,t,n,o){const r=se.get(o);if(r)return r;const s=Bt(e,t,n,o,!0);return se.set(o,s),s.finally(()=>se.delete(o))}const me=new Set;function Oo(e,t,n){const o=P.c(8),r=z(),s=t?.orgSlug,i=t?.virtualMcpId,a=t?.branch;let l,c;o[0]!==e||o[1]!==a||o[2]!==n||o[3]!==s||o[4]!==r||o[5]!==i?(l=()=>{if(!e||!s||!i||!a)return;const u={orgSlug:s,virtualMcpId:i,branch:a};return uo(d=>{d===n&&(me.has(n)||(me.add(n),To(r,e,u,n).catch(Do).finally(()=>me.delete(n))))})},c=[r,e,s,i,a,n],o[0]=e,o[1]=a,o[2]=n,o[3]=s,o[4]=r,o[5]=i,o[6]=l,o[7]=c):(l=o[6],c=o[7]),j.useEffect(l,c)}function Do(){}async function To(e,t,n,o){const r=se.get(o);return r&&await r.catch(()=>{}),Qt(e,t,n,o)}async function Bt(e,t,n,o,r){ee(e);const s=h.decofile(o),i=So(n,t),a=h.contentRevision(o),l=h.contentVersions(o),c=e.getQueryData(s),u=e.getQueryData(l),d=e.getQueryData(i),g=e.getQueryData(a)??void 0,f=t.source==="github"&&!d?lt(e,n.orgSlug,n.virtualMcpId):void 0,v=f?.isV8&&f.schema&&f.version?f:void 0,b=d??v?.schema,w=v?{...g,schemaVersion:v.version}:g,I=r&&c&&u?w?.revision:void 0,T=r&&b?w?.schemaVersion:void 0,x=h.contentChanges(o),_=e.getQueryData(x),[C,E,k]=await le(e,t,n,()=>t.client.batch([{method:"blocks.list",params:I?{ifNoneMatch:I}:{}},{method:"schema.get",params:T?{ifNoneMatch:T}:{}},{method:"changes.list",params:vt(_)}])),N=e.getQueryData(a)?.revision,p=N!==void 0&&N!==w?.revision;if(k?.ok){const X=p?null:Ee(_,k.result);X&&e.setQueryData(x,X)}else k&&t.source==="local"&&Pe(k.error)&&De(e,n);if(!C?.ok)throw C?.error??new Error("no blocks.list");if(!E)throw new Error("no schema.get");const O=C.result,$=Ot(E),y=E.ok&&!$?E.result:null;if(O.notModified&&(!c||!u)||y?.notModified&&!b)return Bt(e,t,n,o,!1);const R=O.notModified?new Set:ko(e,n),A=O.notModified?c:Sn(O.blocks,c,R),U=$?En():y?y.notModified?b:y.schema:E.error;if(e.setQueryData(a,{revision:p?N:O.notModified?w?.revision:O.revision,schemaVersion:y?y.notModified?w?.schemaVersion:y.version??void 0:void 0}),e.setQueryData(s,A),!O.notModified){const X=e.getQueryData(l),V={...O.versions};for(const L of R){const W=X?.[L];W!==void 0?V[L]=W:delete V[L]}e.setQueryData(l,V)}return U instanceof D||e.setQueryData(i,U),!p&&!O.notModified&&c&&w?.revision&&O.revision!==w.revision&&mo({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:A,meta:U}}async function Tr(e,t,n,o,r,s){if(t.source==="github"){const a=[...Object.keys(r.set??{}),...r.delete??[]].filter(l=>!s||!Object.hasOwn(s,l));if(a.length>0)throw new Error(`A hosted save needs a precondition for every block it touches (missing: ${a.join(", ")})`)}return vo({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=await le(e,t,n,()=>t.client.blocksApply({set:r.set,delete:r.delete,...s?{ifMatch:s}:{}}));ee(e);const a=t.source==="github"?Eo(e,n,o,i):i.revision;e.setQueryData(h.contentRevision(o),c=>({...c,revision:a}));const l=i.versions??{};return Ve(e,o,l),{revision:a,versions:l}}})}function Vt(e,t){if(!(e instanceof D))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 Ht(e,t,n){if(!(n instanceof D))return;const o=n.data?.draft;if(!(!o||typeof o!="object"))for(const[r,s]of Object.entries(o))s===null&&ce(e,t,r,!1)}function Gt(e,t,n,o){ee(e);const r=o.block===null,s=e.getQueryData(h.contentVersions(t)),i=e.getQueryData(h.contentChanges(t)),a=i?K(i,n):void 0,l=a?a.baseVersion:s?.[n]??null;if(i){const c=F(n),u=Object.fromEntries(Object.entries(i.changes).filter(([d])=>F(d)!==c));r?l!==null&&(u[n]={kind:"delete",version:null,baseVersion:l}):u[n]={kind:"set",version:o.version,baseVersion:l},e.setQueryData(h.contentChanges(t),{...i,changes:u,edited:!0})}ce(e,t,n,r&&l===null),e.setQueryData(h.decofile(t),c=>{const u={...c};return r?delete u[n]:u[n]=o.block,u}),Ve(e,t,{[n]:r?null:o.version})}function Ir(e,t,n,o){if(t.source!=="github"||!(o instanceof D))return!1;Ht(e,n,o);const r=o.data?.draft;if(!r||typeof r!="object")return!1;const s=Object.keys(r),i=s.map(a=>Vt(o,a));return s.length===0||i.some(a=>a===void 0)?!1:(e.cancelQueries({queryKey:h.decofile(n)}),s.forEach((a,l)=>{Gt(e,n,a,i[l])}),!0)}async function Cr(e,t,n,o,r,s){t.source==="github"&&Ht(e,o,s);const i=t.source==="github"?Vt(s,r):void 0;if(i)return e.cancelQueries({queryKey:h.decofile(o)}),Gt(e,o,r,i),!0;await e.invalidateQueries({queryKey:h.decofile(o)});let a;try{const c=(await le(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(c&&c.after===null&&c.version!==null)return!1;a={value:c?.after??null,version:c?.version??null},t.source==="github"&&e.setQueryData(h.contentChanges(o),u=>{if(!u)return u;const d={...u.changes};return c?.kind?d[r]={kind:c.kind,version:c.version,baseVersion:c.baseVersion}:delete d[r],{...u,changes:d,edited:!0}})}catch{const l=await le(e,t,n,()=>t.client.blocksList({}));if(l.notModified)return!1;a={value:l.blocks[r]??null,version:l.versions[r]??null}}return e.setQueryData(h.decofile(o),l=>{const c={...l};return a.value===null?delete c[r]:c[r]=a.value,c}),Ve(e,o,{[r]:a.version}),!1}function Io(e){const t=P.c(15),n=z();let o;t[0]!==e?.branch||t[1]!==e?.orgSlug||t[2]!==e?.virtualMcpId?(o=h.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[0]=e?.branch,t[1]=e?.orgSlug,t[2]=e?.virtualMcpId,t[3]=o):o=t[3];let r;t[4]!==e||t[5]!==n?(r=async()=>{const f=await fetch(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`,{cache:"no-store",headers:ue("v8")});if(await _e(f))throw Ce(n,e.orgSlug,e.virtualMcpId),new Ne;if(!f.ok)throw new Error(`draft pointer read failed: ${f.status}`);return await f.json()},t[4]=e,t[5]=n,t[6]=r):r=t[6];const s=!!e;let i;t[7]!==o||t[8]!==r||t[9]!==s?(i={queryKey:o,queryFn:r,enabled:s,staleTime:Number.POSITIVE_INFINITY},t[7]=o,t[8]=r,t[9]=s,t[10]=i):i=t[10];const{data:a,isPending:l,isError:c}=M(i),u=!!e&&l&&!c;if(!e||!a?.draft||!a.version){let f;return t[11]!==u?(f={pointer:null,pending:u},t[11]=u,t[12]=f):f=t[12],f}const d=`${a.draft}@${a.version}`;let g;return t[13]!==d?(g={pointer:d,pending:!1},t[13]=d,t[14]=g):g=t[14],g}function _r(e){return Io(e).pointer}function Nr(e){const t=P.c(4);let n;t[0]!==e?(n=h.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Co,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=M(o);return r?.revision}async function Co(){throw new Error("content revisions are set by reads and writes")}function Te(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function Rr(e,t){return Te({...e,protocolSuffix:t.cacheKeySuffix})}function _o(e,t){const n=P.c(6),{url:o}=It(e?.virtualMcpId),r=Tt(e?.virtualMcpId,e?.branch);if(!e)return"";let s;return n[0]!==r.cacheKeySuffix||n[1]!==r.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(s=r.kind==="protocol"?Te({...e,protocolSuffix:r.cacheKeySuffix}):Te({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=r.cacheKeySuffix,n[1]=r.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=s):s=n[5],s}function xr(e,t){const n=P.c(39),{url:o,undecided:r}=It(e?.virtualMcpId),s=!!o,i=Tt(e?.virtualMcpId,e?.branch),a=i.kind==="protocol"?i:null,l=_o(e),c=t?.fetchEnabled??!0,u=oo(e?.virtualMcpId),d=dt(e?.virtualMcpId).runtime==="cms",g=z();let f;n[0]!==l?(f=h.decofile(l),n[0]=l,n[1]=f):f=n[1];const v=f;Oo(a,a&&e?e:null,l);let b;n[2]!==e||n[3]!==g||n[4]!==v?(b=()=>{if(!e||g.isMutating({mutationKey:fe(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const p=g.getQueryState(v);return p?.fetchStatus==="fetching"||Date.now()-(p?.dataUpdatedAt??0)<Ct/2},n[2]=e,n[3]=g,n[4]=v,n[5]=b):b=n[5];let w;n[6]!==d||n[7]!==s||n[8]!==e||n[9]!==a||n[10]!==g||n[11]!==v?(w=async()=>{if(e){if(!a&&d&&!s){const p=Qn(g,e)?.version;if(p&&!await Bn(e,p))return}await g.refetchQueries({queryKey:v,exact:!0},{cancelRefetch:!1})}},n[6]=d,n[7]=s,n[8]=e,n[9]=a,n[10]=g,n[11]=v,n[12]=w):w=n[12];let I;n[13]!==b||n[14]!==w?(I={skip:b,read:w},n[13]=b,n[14]=w,n[15]=I):I=n[15],zn(!!t?.pollWhile&&!!e,I);let T;n[16]!==i.kind||n[17]!==d||n[18]!==c||n[19]!==l||n[20]!==s||n[21]!==o||n[22]!==u||n[23]!==e||n[24]!==a||n[25]!==g?(T=async()=>{if(a)return(await Qt(g,a,e,l)).blocks;if(i.kind==="unavailable")throw wo("decofile");if(s){const y=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(xo),R=y?.ok?rt(await y.text()):null;if(R)return R;const A=new Error("decofile unavailable (local tunnel unreachable)");throw A.status=502,A}if(d)return Hn(g,e);const p=()=>no(e,jn(u,".deco/blocks.gen.json"));if(c){const y=await fetch(Kn(e),{cache:"no-store"}).catch(Ro);if(y?.ok){const U=rt(await y.text());if(U)return U}const R=await p();if(R.kind==="data")return R.data;const A=new Error(`Failed to fetch decofile: ${y?.status??"network error"}`);throw A.status=it({liveOk:!!y?.ok,liveStatus:y?.status,committedAbsent:R.kind==="absent"}),A}const O=await p();if(O.kind==="data")return O.data;const $=new Error("decofile unavailable (preview down, no committed snapshot)");throw $.status=it({liveOk:!1,committedAbsent:O.kind==="absent"}),$},n[16]=i.kind,n[17]=d,n[18]=c,n[19]=l,n[20]=s,n[21]=o,n[22]=u,n[23]=e,n[24]=a,n[25]=g,n[26]=T):T=n[26];const x=!!e&&i.kind!=="pending"&&!r,_=a?0:3e4,C=a?.describe.pollIntervalMs,E=a?"always":void 0;let k;n[27]!==d||n[28]!==s||n[29]!==a?(k=(p,O)=>{if(a||d||s)return p<3;const $=O.status;return $!==502&&$!==404&&p<2},n[27]=d,n[28]=s,n[29]=a,n[30]=k):k=n[30];let N;return n[31]!==v||n[32]!==T||n[33]!==x||n[34]!==_||n[35]!==C||n[36]!==E||n[37]!==k?(N={queryKey:v,queryFn:T,enabled:x,staleTime:_,refetchInterval:C,refetchIntervalInBackground:!1,refetchOnWindowFocus:E,retry:k,retryDelay:No},n[31]=v,n[32]=T,n[33]=x,n[34]=_,n[35]=C,n[36]=E,n[37]=k,n[38]=N):N=n[38],M(N)}function No(e){return ln(5e3,1e3,e,2,0)}function Ro(){return null}function xo(){return null}const Po="site-editor-save",Jt={id:Po,description:void 0,action:void 0,cancel:void 0},Pr="site-editor-undo",Ie="site-editor-publish";function $o(e){const t=P.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=G.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1];let s;t[2]!==o?(s=G.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=G.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function Wt(e,t){return t?G.jsx($o,{label:e("siteEditor.details"),detail:t}):void 0}function $r(e,t,n){q.error($t(e,t,n),{...Jt,description:Wt(e,ro(t,n))})}function Ar(e,t,n=!1){q.info(e(t?"sectionsEditor.reconcile.leftDeleted":"sectionsEditor.reconcile.keptTheirs"),{...Jt,description:e(t?n?"sectionsEditor.reconcile.leftDeletedNeverPublishedHint":"sectionsEditor.reconcile.leftDeletedHint":"sectionsEditor.reconcile.keptTheirsHint")})}const Yt={action:void 0,duration:void 0};function Lr(e,t){q.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...Yt,id:Ie,description:void 0})}function jr(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=Wt(e,o??null);q[i](t,{id:Ie,description:n&&a?G.jsxs(G.Fragment,{children:[G.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:l=>{l.preventDefault(),q.loading(s??e("thread.publishPopover.publishing"),{...Yt,id:Ie,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function Ur(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Dr as $,br as A,po as B,wr as C,_o as D,Nr as E,Un as F,fe as G,vo as H,to as I,Mn as J,Ar as K,Or as L,pr as M,je as N,mr as O,To as P,Fe as Q,Tr as R,er as S,yt as T,Cr as U,$r as V,kr as W,So as X,Fn as Y,fr as Z,yr as _,nr as a,rr as a0,lr as a1,Ke as a2,et as a3,ur as a4,tr as a5,qn as a6,ar as a7,Rr as a8,gn as a9,S as aA,gr as aB,Wt as aa,Ur as ab,Lr as ac,Sr as ad,Jo as ae,Wo as af,Pe as ag,zo as ah,dn as ai,$o as aj,Yo as ak,Qt as al,wo as am,vr as an,no as ao,Qe as ap,Ir as aq,dr as ar,_r as as,jr as at,Ie as au,Yt as av,Pr as aw,Jt as ax,ko as ay,D as az,mn as b,It as c,hn as d,Ko as e,vn as f,Le as g,xe as h,pt as i,hr as j,Xn as k,xr as l,or as m,cr as n,oo as o,Xo as p,jn as q,qo as r,Zo as s,Et as t,Tt as u,ir as v,Er as w,sr as x,Io as y,J as z};
|
|
1
|
+
import{c as P,q as z,m as M,K as h,eP as ct,aK as zt,aL as Xt,r as j,a as Zt,az as pe,a4 as qt,eQ as lt,eR as Ce,bh as be,eS as ue,eT as _e,eU as Ne,ax as Kt,bq as ut,eV as F,eW as ee,eX as we,eY as He,eZ as en,t as q,j as G}from"./index-C5hxtG-B.js";import{u as dt}from"./use-session-runtime-Dlgl4ufa.js";import{s as Ge}from"./thread-intent-DigI0g4t.js";import{u as Re,b as tn}from"./experiments-tab-choice-BPWZ6-EI.js";import{b as de}from"./sandbox-url-D3mC8qhT.js";import{s as nn}from"./utils-B8OWeF28.js";import{a as on}from"./repository-binding-WDk-SmGV.js";import{u as rn}from"./chat-context-BvGd3d4B.js";import{i as sn,u as an}from"./use-sandbox-events-PM3dvDwL.js";import{a as cn}from"./sandbox-git-api-CH_-QFpD.js";import{e as ln}from"./backoff-CrEUbyZT.js";const S={MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,NotFound:-32001,Conflict:-32002,InvalidBlock:-32003,ReadOnly:-32005,Unsupported:-32006,LimitExceeded:-32007,Unavailable:-32008,Unauthorized:-32010};class D extends Error{code;data;constructor(t,n,o){super(n),this.name="ContentProtocolError",this.code=t,this.data=o}toJSON(){return this.data===void 0?{code:this.code,message:this.message}:{code:this.code,message:this.message,data:this.data}}static from(t){return new D(t.code,t.message,t.data)}}const Z="deco-content",Se={major:1},ft=1;async function un(e){let t=new Uint8Array(await e.arrayBuffer());if(t[0]===31&&t[1]===139){const n=new Blob([t]).stream().pipeThrough(new DecompressionStream("gzip"));t=new Uint8Array(await new Response(n).arrayBuffer())}return JSON.parse(new TextDecoder().decode(t))}const ye={major:Se.major,minor:ft},ht=`the endpoint speaks an older ${Z} than this client needs (${ye.major}.${ye.minor} or newer): update @decocms/blocks in the site (8.2.0 or newer) and start deco serve again`;function ne(e,t,n){const o={reason:t,required:{...ye}};if(n){o.actual={protocol:n.protocol,major:n.version?.major,minor:n.version?.minor};const r=n.server;typeof r?.name=="string"&&typeof r.version=="string"&&(o.server={name:r.name,version:r.version})}return new D(S.Unsupported,e,o)}function gt(e){const t=e??{},{protocol:n,version:o}=t;if(n!==Z)throw ne(`the endpoint speaks ${JSON.stringify(n)}, not ${Z}`,"protocol",t);if(o?.major!==Se.major)throw ne(`the endpoint speaks ${Z} ${String(o?.major)}.x; this client speaks ${Se.major}.x`,"major",t);if(typeof o.minor!="number"||o.minor<ft)throw ne(ht,"outdated",t);return e}function Je(e,t){return t.code===S.MethodNotFound&&e.startsWith("changes.")?ne(ht,"outdated"):D.from(t)}function xe(e){const t=e.fetch??(s=>fetch(s));let n=1;async function o(s){const i={"content-type":"application/json",accept:"application/json",...e.headers},a=await t(new Request(e.endpoint,{method:"POST",headers:i,body:JSON.stringify(s)}));let l;try{l=await un(a)}catch{throw new D(S.Unavailable,`the endpoint answered HTTP ${a.status} without a JSON-RPC body`)}if(!a.ok||!Array.isArray(l)&&l?.id===null){const c=l?.error;throw c?D.from(c):new D(S.Unavailable,`the endpoint answered HTTP ${a.status}`)}return l}const r=async(s,i)=>{const a=n++,l=await o({jsonrpc:"2.0",id:a,method:s,params:i??{}});if(l.error)throw Je(s,l.error);return l.result};return{call:r,describe:async()=>gt(await r("describe")),schemaGet:s=>r("schema.get",s),blocksList:s=>r("blocks.list",s),blocksApply:s=>r("blocks.apply",s),changesList:s=>r("changes.list",s),changesGet:s=>r("changes.get",s),changesDiscard:s=>r("changes.discard",s),async batch(s){const i=s.map(()=>n++),a=await o(s.map((c,u)=>({jsonrpc:"2.0",id:i[u],method:c.method,params:c.params??{}}))),l=new Map(a.map(c=>[c.id,c]));return i.map((c,u)=>{const d=l.get(c);return d?d.error?{ok:!1,error:Je(s[u].method,d.error)}:{ok:!0,result:d.result}:{ok:!1,error:new D(S.InternalError,"no response for this call")}})}}}function vt(e){return e&&!e.edited?{ifNoneMatch:e.revision}:{}}const We=20,Ye=5,ze=500;function Pe(e){return e instanceof D?e.code===S.MethodNotFound?!0:e.code===S.Unsupported&&e.data?.reason==="outdated":!1}function Ee(e,t){return t.notModified?e?{...e,base:t.base}:null:{revision:t.revision,base:t.base,changes:t.changes}}async function dn(e,t,n){const o=h.contentChanges(n),r=e.getQueryData(o),s=await t.changesList(vt(r)),i=Ee(r,s);if(i)return i;const a=await t.changesList({});return Ee(void 0,a)}async function fn(e,t){const n=[];for(let s=0;s<t.length;s+=We)n.push(t.slice(s,s+We));const o=Object.create(null),r=[];for(let s=0;s<n.length;s+=Ye){const i=await e.batch(n.slice(s,s+Ye).map(a=>({method:"changes.get",params:{names:a}})));for(const a of i){if(!a.ok)throw a.error;const l=a.result;Object.assign(o,l.entries),r.push(...l.diagnostics)}}return{entries:o,diagnostics:r}}async function Jo(e,t){let n={revision:"",versions:{}};for(let o=0;o<t.length;o+=ze){const r=t.slice(o,o+ze),s=await e.changesDiscard({names:r.map(i=>i.name),ifMatch:Object.fromEntries(r.map(i=>[i.name,i.version]))});n={revision:s.revision,versions:{...n.versions,...s.versions}}}return n}function Wo(e){return e instanceof D&&e.code===S.Conflict}function mt(e){return e?.kind==="protocol"?e:null}function Yo(e,t,n){const o=P.c(14);let r;o[0]!==n?(r={},o[0]=n,o[1]=r):r=o[1];const s=r,i=z();let a;o[2]!==e?(a=mt(e),o[2]=e,o[3]=a):a=o[3];const l=a,c=!!l&&!!t&&s.enabled!==!1;let u;o[4]!==t?(u=h.contentChanges(t??""),o[4]=t,o[5]=u):u=o[5];let d;o[6]!==t||o[7]!==c||o[8]!==l||o[9]!==i?(d=c?()=>dn(i,l.client,t):ct,o[6]=t,o[7]=c,o[8]=l,o[9]=i,o[10]=d):d=o[10];let g;return o[11]!==u||o[12]!==d?(g={queryKey:u,queryFn:d,staleTime:0},o[11]=u,o[12]=d,o[13]=g):g=o[13],M(g)}function zo(e,t,n){const o=P.c(14);let r;o[0]!==e?(r=mt(e),o[0]=e,o[1]=r):r=o[1];const s=r;let i;o[2]!==n?(i=n?Object.keys(n.changes):[],o[2]=n,o[3]=i):i=o[3];const a=i,l=!!s&&!!t&&!!n&&a.length>0;let c;o[4]!==t||o[5]!==n?.revision?(c=h.contentChangeSides(t??"",n?.revision??""),o[4]=t,o[5]=n?.revision,o[6]=c):c=o[6];let u;o[7]!==l||o[8]!==a||o[9]!==s?(u=l?()=>fn(s.client,a):ct,o[7]=l,o[8]=a,o[9]=s,o[10]=u):u=o[10];let d;return o[11]!==c||o[12]!==u?(d={queryKey:c,queryFn:u,staleTime:Number.POSITIVE_INFINITY},o[11]=c,o[12]=u,o[13]=d):d=o[13],M(d)}function pt(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 ie(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 bt=zt({endpoint:Xt().max(2048).refine(e=>pt(e)&&new URL(e).pathname==="/rpc").transform(ie)});function Xo(e){const t=new URLSearchParams(e.replace(/^#/,"")),n=bt.safeParse({endpoint:t.get("endpoint")??""});return n.success?n.data:null}function wt(e){const t=bt.safeParse(e);return t.success?t.data:null}const St="studio:deco-serve-last";function Zo(e){try{localStorage.setItem(St,JSON.stringify(e))}catch{}}function qo(){try{const e=localStorage.getItem(St);return e?wt(JSON.parse(e)):null}catch{return null}}function Ko(e){try{return new URL(ie(e)).host}catch{return e}}function hn(e,t=1e4){return Math.min(1e3*2**Math.max(0,e-1),t)}const gn="http://localhost:4545/rpc",er="npx @decocms/blocks serve",tr="npx @decocms/blocks schema";class $e extends Error{constructor(t="the endpoint isn't deco serve"){super(t),this.name="NotDecoServeError"}}function vn(e){if(e instanceof $e)return{reason:"not-deco-serve"};if(!(e instanceof D))return{reason:"not-answering"};switch(e.code){case S.Unauthorized:case S.MethodNotFound:return{reason:"outdated"};case S.Unsupported:return Pe(e)?{reason:"outdated"}:{reason:"version-mismatch"};case S.Unavailable:return/^the endpoint answered HTTP/.test(e.message)?{reason:"not-deco-serve"}:{reason:"error",detail:e.message};default:return{reason:"error",detail:e.message}}}function nr(e,t){if(e)return[ie(e.endpoint)];const n=[t?.endpoint,gn].filter(o=>!!o).map(ie);return[...new Set(n)]}const yt=j.createContext(null);function mn(e){const t=P.c(27),n=j.useContext(yt),o=Re(n?null:e),{data:r}=Zt.useSession(),s=r?.user?.id??"",i=!!e&&!!s;let a;t[0]!==i||t[1]!==s||t[2]!==e?(a=i?pe.decoServeConnection(s,e):null,t[0]=i,t[1]=s,t[2]=e,t[3]=a):a=t[3];const[l,c]=Ze(a);let u;t[4]!==i||t[5]!==s||t[6]!==e?(u=i?pe.decoServeEndpoint(s,e):null,t[4]=i,t[5]=s,t[6]=e,t[7]=u):u=t[7];const[d,g]=Ze(u);if(n)return n;let f;t[8]!==l||t[9]!==i?(f=i?wt(l):null,t[8]=l,t[9]=i,t[10]=f):f=t[10];const v=f,b=!!v;let w;t[11]!==o||t[12]!==b?(w=pn(o,b),t[11]=o,t[12]=b,t[13]=w):w=t[13];const{applies:I,undecided:T}=w,x=I?v:null,_=i&&o==="v8"&&typeof d=="string"?d:null;let C;t[14]!==g||t[15]!==c||t[16]!==i?(C=N=>{i&&(c(N),g(N.endpoint))},t[14]=g,t[15]=c,t[16]=i,t[17]=C):C=t[17];let E;t[18]!==c||t[19]!==i?(E=()=>{i&&c(null)},t[18]=c,t[19]=i,t[20]=E):E=t[20];let k;return t[21]!==x||t[22]!==_||t[23]!==C||t[24]!==E||t[25]!==T?(k={connection:x,undecided:T,lastEndpoint:_,set:C,clear:E},t[21]=x,t[22]=_,t[23]=C,t[24]=E,t[25]=T,t[26]=k):k=t[26],k}function pn(e,t){return t?e==="loading"?{applies:!1,undecided:!0}:{applies:e==="v8"||e==="error",undecided:!1}:{applies:!1,undecided:!1}}function Xe(e){try{const t=localStorage.getItem(e);return t===null?null:JSON.parse(t)}catch{return null}}function Ze(e){const t=P.c(17),n=z(),o=e??"";let r;t[0]!==o?(r=["localStorage",o],t[0]=o,t[1]=r):r=t[1];const s=r;let i,a;t[2]!==e?(i=()=>e?Xe(e):null,a=()=>e?Xe(e):null,t[2]=e,t[3]=i,t[4]=a):(i=t[3],a=t[4]);const l=!!e;let c;t[5]!==s||t[6]!==i||t[7]!==a||t[8]!==l?(c={queryKey:s,queryFn:i,initialData:a,enabled:l,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[5]=s,t[6]=i,t[7]=a,t[8]=l,t[9]=c):c=t[9];const{data:u}=M(c);let d;t[10]!==e||t[11]!==n||t[12]!==s?(d=b=>{if(e){try{b===null?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(b))}catch{}n.setQueryData(s,b)}},t[10]=e,t[11]=n,t[12]=s,t[13]=d):d=t[13];const g=d,f=e?u??null:null;let v;return t[14]!==g||t[15]!==f?(v=[f,g],t[14]=g,t[15]=f,t[16]=v):v=t[16],v}function or(e){return e.kind==="protocol"||e.kind==="unavailable"}function rr(e){const t=e.hasOrg?e.orgFlag:!1,{backend:n}=e;return n==="protocol"||n==="unavailable"?!0:n==="pending"?t===!0?!0:void 0:t}function sr(e,t,n){return t!=="github"||n!=="v8"?!1:e.kind==="pending"?!0:e.kind==="unavailable"&&e.siteNotOwned?!1:(e.kind==="protocol"||e.kind==="unavailable")&&e.source==="github"}function ir(e){if(e.kind!=="protocol"||e.source!=="local")return null;const t=e.describe.preview?.url;return t&&pt(t)?t:null}function ar(e,t){return e.kind!=="protocol"||e.source!=="local"||!e.describe.assets||!t?null:new URL(t.endpoint).origin}function Et(e){return e.hasServeConnection?"local":e.runtime==="sandbox"?"sandbox":"github"}function bn(e){if(!e.hasProject)return"legacy";const t=Et(e);if(t==="local")return"protocol-local";if(e.serveConnectionUndecided)return"pending";if(t==="sandbox"){const o=e.sandboxSite;return o==="v8"?"protocol-sandbox":o==="v7"?"legacy":o==="error"?e.markedV8?"retrying-sandbox":"legacy":"pending"}if(e.mainSchema==="loading")return"pending";if(e.mainSchema==="error")return"retrying-github";if(e.mainSchema==="v7")return"legacy";const n=e.githubSite;return n==="v8"?"protocol-github":n==="not-owned"?"site-not-owned-github":n==="error"?"unavailable-github":n==="v7"?"legacy":"pending"}function wn(e){return{github:e.mode==="github"&&e.mainSchema==="v8",sandbox:e.mode==="sandbox"&&e.workingTreeReady}}function qe(e){return e.isError||e.errorUpdateCount>0}function Sn(e,t,n){if(!t||n.size===0)return e;const o={...e};for(const r of n)Object.hasOwn(t,r)?o[r]=t[r]:delete o[r];return o}function yn(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 kt="__noSchema";function En(){return{manifest:{blocks:{}},schema:{definitions:{},root:{}},[kt]:!0}}function cr(e){return!!e&&e[kt]===!0}function Ot(e){if(!e.ok)return e.error.code===S.NotFound;const t=e.result;return t.notModified===!1&&t.schema===null}function kn(e,t){return(typeof t.name=="string"?t.name.trim():"")||e}const On=(e,t)=>e.label.localeCompare(t.label)||e.key.localeCompare(t.key);function lr(e){const t=new Map;for(const[n,o]of Object.entries(e)){const r=o&&typeof o=="object"&&!Array.isArray(o)?o:{},s=typeof r.__resolveType=="string"?r.__resolveType:null,i=t.get(s)??[];i.push({key:n,label:kn(n,r)}),t.set(s,i)}return[...t.entries()].map(([n,o])=>({resolveType:n,blocks:o.sort(On)})).sort((n,o)=>n.resolveType===null?1:o.resolveType===null?-1:Ke(n.resolveType).localeCompare(Ke(o.resolveType))||n.resolveType.localeCompare(o.resolveType))}function Ke(e){return(e.split("/").filter(Boolean).at(-1)??e).replace(/\.(tsx?|jsx?)$/,"")||e}function et(e,t,n){if(t.length===0)return n;const[o,...r]=t;if(Array.isArray(e)&&typeof o=="number"){const s=e.slice();return s[o]=et(e[o],r,n),s}if(e&&typeof e=="object"&&typeof o=="string"){const s=e,i={};for(const a of Object.keys(s))i[a]=a===o?et(s[a],r,n):s[a];return i}return e}function ur(e){if(e.trim()==="")return null;const t=Number(e);return Number.isFinite(t)?t:null}class tt extends Error{}class nt extends Error{}const Dt="site-not-owned";async function Dn(e){return e.status!==409?!1:(await e.clone().json().catch(()=>null))?.code==="site_not_owned"}async function Tn(e,t=r=>fetch(r),n,o){const r=xe({endpoint:e,fetch:async s=>{const i=new Request(s);for(const[l,c]of Object.entries(ue("v8")))i.headers.set(l,c);const a=await t(i);if(await Dn(a))throw new nt;if(await _e(a))throw n?.(),new Ne;return a}});try{const s=await Le(r,be(o)?{schema:o}:void 0);return s.v8Schema?s:null}catch(s){if(s instanceof nt)return Dt;throw s}}const Ae=5e3;function In(e){return new URL(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/rpc`,window.location.origin).href}function Cn(e){return new URL(de(e,"rpc"),window.location.origin).href}async function Le(e,t){const[n,o]=await e.batch(t?[{method:"describe"}]:[{method:"describe"},{method:"schema.get"}]);if(!n?.ok)throw n?.error??new Error("no describe");if(n.result?.protocol!==Z)throw new $e;const s=gt(n.result);if(t)return{client:e,describe:s,hasSchema:t.schema!=null,v8Schema:be(t.schema)};if(!o)throw new Error("no schema.get");if(Ot(o))return{client:e,describe:s,hasSchema:!1,v8Schema:!1};if(o.ok){const i=o.result;return{client:e,describe:s,hasSchema:!0,v8Schema:be(i?.schema)}}throw o.error}async function _n(e,t=n=>fetch(n)){const n=xe({endpoint:e,fetch:async o=>{const r=await t(o);if(r.status===404)throw new tt;return r}});try{const o=await Le(n);return o.v8Schema?o:null}catch(o){if(o instanceof tt)return null;throw o}}function Tt(e,t){const n=P.c(53),{org:o}=qt(),{connection:r,undecided:s}=mn(e),{runtime:i}=dt(e),a=j.useContext(yt),l=Re(a?null:e),c=tn(e),u=Et({hasServeConnection:!!r,runtime:i}),d=rn()?.taskId??null,g=sn(an().lifecycle.phase),f=z(),v=wn({mode:u,mainSchema:l,workingTreeReady:g}),b=v.github&&!!o.slug&&!!e&&!!t;let w;n[0]!==t||n[1]!==o.slug||n[2]!==f||n[3]!==e?(w=()=>Tn(In({orgSlug:o.slug,virtualMcpId:e,branch:t}),void 0,()=>Ce(f,o.slug,e),lt(f,o.slug,e)?.schema),n[0]=t,n[1]=o.slug,n[2]=f,n[3]=e,n[4]=w):w=n[4];const I=M({queryKey:h.contentBackend(o.slug,e??"",t??"","github"),queryFn:w,enabled:b,staleTime:Number.POSITIVE_INFINITY,...ot}),T=v.sandbox&&!!o.slug&&!!e&&!!t;let x;n[5]!==t||n[6]!==o.slug||n[7]!==d||n[8]!==e?(x=async()=>_n(Cn({orgSlug:o.slug,virtualMcpId:e,branch:t,threadId:d})),n[5]=t,n[6]=o.slug,n[7]=d,n[8]=e,n[9]=x):x=n[9];const _=M({queryKey:h.contentBackend(o.slug,e??"",t??"","sandbox",d??""),queryFn:x,enabled:T,staleTime:Number.POSITIVE_INFINITY,...ot}),C=!!r;let E;n[10]!==r?.endpoint||n[11]!==o.slug||n[12]!==e?(E=h.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[10]=r?.endpoint,n[11]=o.slug,n[12]=e,n[13]=E):E=n[13];let k;n[14]!==r?(k=()=>Le(xe({endpoint:r.endpoint})),n[14]=r,n[15]=k):k=n[15];let N;n[16]!==C||n[17]!==E||n[18]!==k?(N={queryKey:E,queryFn:k,enabled:C,staleTime:Number.POSITIVE_INFINITY,retry:xn,retryDelay:Rn,refetchInterval:Nn},n[16]=C,n[17]=E,n[18]=k,n[19]=N):N=n[19];const p=M(N);let O;n[20]!==r?.endpoint||n[21]!==o.slug||n[22]!==e?(O=h.contentBackend(o.slug,e??"","local",r?.endpoint??""),n[20]=r?.endpoint,n[21]=o.slug,n[22]=e,n[23]=O):O=n[23];const $=O;let y;n[24]!==r?.endpoint||n[25]!==o.slug||n[26]!==e?(y=h.contentBackend(o.slug,e??"","local-describe",r?.endpoint??""),n[24]=r?.endpoint,n[25]=o.slug,n[26]=e,n[27]=y):y=n[27];let R;n[28]!==p.data||n[29]!==$||n[30]!==f?(R=async()=>{try{return await p.data.client.describe()}catch(m){const Y=m;throw f.invalidateQueries({queryKey:$,exact:!0},{cancelRefetch:!1}),Y}},n[28]=p.data,n[29]=$,n[30]=f,n[31]=R):R=n[31];const A=!!p.data&&!a;let U;n[32]!==y||n[33]!==R||n[34]!==A?(U={queryKey:y,queryFn:R,enabled:A,refetchInterval:Ae,retry:!1},n[32]=y,n[33]=R,n[34]=A,n[35]=U):U=n[35];const V=M(U).data??p.data?.describe,L=bn({hasProject:!!e,hasServeConnection:!!r,serveConnectionUndecided:s,runtime:i,mainSchema:l,githubSite:I.data===Dt?"not-owned":I.data?"v8":I.data===null?"v7":qe(I)?"error":"loading",sandboxSite:Pn({data:_.data,isError:qe(_),workingTreeReady:g}),markedV8:c});if(L==="pending"){let m;return n[36]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending"},n[36]=m):m=n[36],m}if(L==="retrying-github"){let m;return n[37]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending",retrying:"github"},n[37]=m):m=n[37],m}if(L==="retrying-sandbox"){let m;return n[38]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"pending",retrying:"sandbox"},n[38]=m):m=n[38],m}if(L==="legacy"){let m;return n[39]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"legacy"},n[39]=m):m=n[39],m}if(L==="protocol-github"){const m=I.data;let Y;return n[40]!==m?(Y=ke("github",m,""),n[40]=m,n[41]=Y):Y=n[41],Y}if(L==="site-not-owned-github"){let m;return n[42]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github",siteNotOwned:!0},n[42]=m):m=n[42],m}if(L==="protocol-sandbox"){let m;return n[43]!==_.data?(m=ke("sandbox",_.data,":sandbox"),n[43]=_.data,n[44]=m):m=n[44],m}if(L==="unavailable-github"){let m;return n[45]===Symbol.for("react.memo_cache_sentinel")?(m={kind:"unavailable",source:"github"},n[45]=m):m=n[45],m}const W=p.error??p.failureReason,ve=r?.endpoint??"";let te;return n[46]!==V||n[47]!==p.data||n[48]!==p.failureCount||n[49]!==p.isError||n[50]!==W||n[51]!==ve?(te=An({probed:p.data,isError:p.isError,failureCount:p.failureCount,failure:W,describe:V,endpoint:ve}),n[46]=V,n[47]=p.data,n[48]=p.failureCount,n[49]=p.isError,n[50]=W,n[51]=ve,n[52]=te):te=n[52],te}function Nn(e){return e.state.status==="error"||e.state.data?.v8Schema===!1?Ae:!1}function Rn(e){return hn(e+1)}function xn(e,t){return!(t instanceof D)&&!(t instanceof $e)}function Pn(e){return e.data!==void 0?e.data?"v8":"v7":e.workingTreeReady?e.isError?"error":"loading":"unavailable"}const $n=3;function An(e){if(e.probed?.hasSchema&&!e.probed.v8Schema)return{kind:"unavailable",source:"local",problem:{reason:"not-v8"}};const t=e.probed?ke("local",{...e.probed,describe:e.describe??e.probed.describe},`:serve:${e.endpoint}`):null;return e.isError||e.failureCount>0?t?.kind==="protocol"&&!e.isError&&e.failureCount<$n?t:{kind:"unavailable",source:"local",problem:vn(e.failure)}:t??{kind:"pending"}}const ot={retry:2,refetchInterval:e=>e.state.status==="error"?Ae:!1};function ke(e,t,n){return{kind:"protocol",source:e,client:t.client,describe:t.describe,cacheKeySuffix:n,hasSchema:t.hasSchema}}function It(e){const t=P.c(13);let n;t[0]!==e?(n=pe.localPreviewUrl(e??""),t[0]=e,t[1]=n):n=t[1];const o=n,[r,s]=Kt(o,null),i=Re(e);let a;if(t[2]!==i||t[3]!==r||t[4]!==e){const g=e?Ge(r):null;a=Ln({saved:g,main:i}),t[2]=i,t[3]=r,t[4]=e,t[5]=a}else a=t[5];const l=a;let c,u;t[6]!==s?(c=g=>s(Ge(g)),u=()=>s(null),t[6]=s,t[7]=c,t[8]=u):(c=t[7],u=t[8]);let d;return t[9]!==l||t[10]!==c||t[11]!==u?(d={...l,setUrl:c,clear:u},t[9]=l,t[10]=c,t[11]=u,t[12]=d):d=t[12],d}function Ln(e){return e.saved?e.main==="v7"?{url:e.saved,undecided:!1}:e.main==="v8"?{url:null,undecided:!1}:{url:null,undecided:!0}:{url:null,undecided:!1}}function jn(e,t){const n=(e??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${t}`:t}function rt(e){let t;try{t=JSON.parse(e)}catch{return null}return typeof t!="object"||t===null||Array.isArray(t)?null:t}class je extends Error{constructor(t,n,o=[],r=!1){super(n),this.blocks=t,this.fields=o,this.carriedStored=r,this.name="BlockConflictError"}blocks;fields;carriedStored}function Ue(e){return`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`}function fe(e,t,n){return["decofile-write",e,t,n]}function Un(e,t,n){return{id:fe(e,t,n).join(":")}}function Me(e){return`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`}async function Mn(e,t){const n=await e.json().catch(()=>({}));throw new Error(n.error??`${t} failed (${e.status})`)}function Fn(e,t,n){e.setQueryData(h.decofileDraft(Ue(t)),n)}function Qn(e,t){return e.getQueryData(h.decofileDraft(Ue(t)))??null}async function Bn(e,t){const n=await fetch(Me(e),{cache:"no-store",headers:{...ue("v7"),"if-none-match":`"${t}"`}}).catch(()=>null);return n?.status===200||n?.status===409}function dr(e){const t=P.c(4);let n;t[0]!==e?(n=h.decofileDraft(e?Ue(e):""),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Vn,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=M(o);return r??null}async function Vn(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function Hn(e,t){const n=await fetch(Me(t),{cache:"no-store",headers:ue("v7")});if(await _e(n))throw Ce(e,t.orgSlug,t.virtualMcpId),new Ne;if(!n.ok){const r=new Error(`Failed to fetch decofile: ${n.status}`);throw r.status=n.status,r}const o=await n.json();return o.token&&Fn(e,t,{version:o.version,token:o.token,apiHost:o.apiHost??window.location.host}),o.decofile}async function fr(e,t){const n=await fetch(Me(e),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(n.status===409){const r=await n.json().catch(()=>({}));throw r.code==="block-conflict"?new je(r.blocks??[],r.error??"Block changed"):new Error(r.error??`Save failed (${n.status})`)}if(!n.ok)return Mn(n,"Save");const o=await n.json();return{...o,apiHost:o.apiHost??window.location.host}}const Ct=3e3,Gn=15e3,Jn=2*6e4,_t={now:()=>Date.now(),setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),hidden:()=>typeof document<"u"&&document.visibilityState==="hidden"};function Wn(e){return e<Jn?Ct:Gn}function Yn(e,t=_t){const n=t.now();let o=!1,r=!1,s=null;const i=()=>{o||(s=t.setTimeout(a,Wn(t.now()-n)))},a=()=>{if(s=null,o)return;const{read:l,skip:c}=e();if(r||t.hidden()||c?.()){i();return}r=!0;let u;try{u=l()}catch{u=void 0}Promise.resolve(u).catch(()=>{}).finally(()=>{r=!1}),i()};return i(),()=>{o=!0,s!==null&&t.clearTimeout(s)}}const st=()=>0;function zn(e,t,n=_t){const o=j.useRef(t);o.current=t;const[r]=j.useState(()=>({polling:()=>Yn(()=>o.current,n),idle:()=>()=>{}}));j.useSyncExternalStore(e?r.polling:r.idle,st,st)}function Nt(e,t){return de(e,t)}function Xn(e,t){return de(e,"preview-fetch",{path:t})}function hr(e){return Nt(e,"preview-invoke")}function gr(e){return Nt(e,"catalog-invoke")}function Rt(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 Zn(){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&&Rt(n))return n}return null}function qn(e,t){const n=e.previewUrl??e.getFallbackPreviewUrl?.()??Zn();return n&&Rt(n)?new URL(t,n).toString():Xn(e,t)}function Kn(e){return qn(e,"/.decofile")}function eo(e){return e===400?"absent":e===404?"unavailable":e>=200&&e<300?"ok":"error"}function it(e){return e.liveOk||e.committedAbsent?404:e.liveStatus??502}async function to(e,t){const n=de(e,"read"),o=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:t,full:!0})}),r=eo(o.status);if(r==="absent")return{kind:"absent"};if(r==="unavailable")return{kind:"unavailable"};if(r==="error"){const i=new Error(`Failed to read ${t}: ${o.status}`);throw i.status=o.status,i}const s=await o.json();return typeof s.content!="string"?{kind:"unavailable"}:{kind:"data",data:nn(s.content)}}async function no(e,t){const n=await to(e,t);if(n.kind!=="data")return n;try{return{kind:"data",data:JSON.parse(n.data)}}catch{return{kind:"unavailable"}}}async function vr(e){const t=`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}/meta`,n=await fetch(t,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const o=new Error(`Failed to read committed meta: ${n.status}`);throw o.status=n.status,o}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function oo(e){return on(e)?.metadata?.runtime?.path??null}class xt extends Error{constructor(t){super(t instanceof Error?t.message:String(t),{cause:t}),this.name="ServeLostError"}}function mr(e){return e instanceof D&&e.code===S.Conflict}function Pt(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 Fe extends Error{constructor(){super("The draft's changes couldn't be read"),this.name="HostedDraftUnreadError"}}class Qe extends Error{constructor(){super("The blocks kept changing while the change was saved"),this.name="HostedKeptChangingError"}}function pr(e,t){return(t instanceof Fe||t instanceof Qe)&&(t.message=$t(e,t,"github")),t}function $t(e,t,n){if(t instanceof Fe)return e("siteEditor.save.draftUnread");if(t instanceof Qe)return e("siteEditor.save.keptChanging");if(t instanceof je)return t.message;if(n==="local")return so(e,t);if(t instanceof D)switch(t.code){case S.Conflict:return e("siteEditor.save.conflict");case S.ReadOnly:return e("siteEditor.save.readOnly");case S.InvalidBlock:case S.InvalidParams:return e("siteEditor.save.invalid");case S.LimitExceeded:return e("siteEditor.save.tooLarge")}return e("siteEditor.save.failed")}function ro(e,t){if(t==="local"||e instanceof je||e instanceof Fe||e instanceof Qe)return null;if(e instanceof D){const n=e.code===S.InvalidBlock||e.code===S.InvalidParams?Pt(e):e.message;return n?`${e.code}: ${n}`:null}return e.message||null}function so(e,t){if(t instanceof xt)return e("decoServe.save.serverGone");if(t instanceof D)switch(t.code){case S.Conflict:return e("decoServe.save.conflict");case S.ReadOnly:return e("decoServe.save.readOnly");case S.InvalidBlock:case S.InvalidParams:return e("decoServe.save.invalid",{detail:Pt(t)});case S.LimitExceeded:return e("decoServe.save.tooLarge")}return e("sectionsEditor.sectionsEditor.saveFailed",{error:t.message})}function io(e,t,n){return e===null?0:Math.max(0,n-Math.max(0,t-e))}function ao(e,t){const[n,o]=j.useState(e),r=j.useRef(null);return e&&!n&&o(!0),j.useEffect(()=>{if(e){r.current??=Date.now();return}if(!n)return;const s=()=>{r.current=null,o(!1)},i=io(r.current,Date.now(),t);if(i===0){s();return}const a=setTimeout(s,i);return()=>clearTimeout(a)},[e,n,t]),n}const co="decocms:content-writes",Oe=new Set;let H;function At(){if(H!==void 0)return H;H=null;try{typeof BroadcastChannel=="function"&&(H=new BroadcastChannel(co),H.addEventListener("message",e=>{const t=e.data?.cacheKey;if(typeof t=="string")for(const n of[...Oe])n(t)}))}catch{H=null}return H}function lo(e){try{At()?.postMessage({cacheKey:e})}catch{}}function uo(e){return At(),Oe.add(e),()=>{Oe.delete(e)}}const Lt={phase:"idle",inFlight:0,reload:{seq:0,navigates:!1},epoch:0},fo=15e3,ae=new Map;function J(e,t){return`${e}/${t}`}function Q(e){let t=ae.get(e);return t||(t={state:Lt,listeners:new Set,previews:0,timer:null,discardListeners:new Set},ae.set(e,t)),t}function B(e,t){const n=Q(e);n.state={...n.state,...t};for(const o of n.listeners)o()}function he(e){e.timer&&clearTimeout(e.timer),e.timer=null}function Be(e){return ae.get(e)?.state??Lt}function ho(e,t){const n=Q(e);return n.listeners.add(t),()=>{n.listeners.delete(t)}}function br(e){const t=Q(e);return t.previews++,()=>{t.previews--,t.previews===0&&t.state.phase==="reloading"&&(he(t),B(e,{phase:"idle"}))}}function wr(e){const t=ae.get(e);!t||t.state.phase!=="reloading"||(he(t),B(e,{phase:"idle"}))}function jt(e){const t=Q(e);he(t),B(e,{phase:"saving",inFlight:t.state.inFlight+1})}function oe(e,t){const n=Q(e),o=Math.max(0,n.state.inFlight-1);if(o>0){B(e,{inFlight:o});return}if(!t.ok||n.previews===0){B(e,{phase:"idle",inFlight:o});return}Ut(e,t.navigates,o)}function Ut(e,t,n=0){const o=Q(e);he(o),o.timer=setTimeout(()=>{o.timer=null,o.state.phase==="reloading"&&B(e,{phase:"idle"})},fo),B(e,{phase:"reloading",inFlight:n,reload:{seq:o.state.reload.seq+1,navigates:t}})}function go(e){return e?.kind==="protocol"&&e.source==="github"}async function re(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s,backend:i,cacheKey:a}=e,l=t.kind==="publish"||t.kind==="reapply"?n.invalidateQueries({queryKey:h.hostedReleases(o,r)}):null;if(i?.kind!=="protocol")return await l,{navigates:!1};const c=s?h.protocolDraftRead(o,r,s):null,u=c?JSON.stringify(n.getQueryData(c)??null):null,d=l?[l]:[];if(a&&t.reread&&d.push(n.invalidateQueries({queryKey:h.decofile(a)})),a&&!t.adopted&&d.push(n.invalidateQueries({queryKey:h.contentChanges(a)})),s&&i.source==="sandbox"&&d.push(n.invalidateQueries({queryKey:cn(o,r,s)})),go(i)&&c&&!t.adopted&&d.push(n.invalidateQueries({queryKey:c})),await Promise.all(d),t.kind!=="edit"){const v=J(o,r);B(v,{epoch:Be(v).epoch+1})}const g=c?JSON.stringify(n.getQueryData(c)??null):null,f=u!==g;return f&&await new Promise(v=>ut.schedule(v)),{navigates:f}}async function vo(e,t){return jt(J(e.orgSlug,e.virtualMcpId)),Mt(e,t)}function at(e){return e.branch?JSON.stringify(e.queryClient.getQueryData(h.protocolDraftRead(e.orgSlug,e.virtualMcpId,e.branch))??null):null}async function Mt(e,t){const n=J(e.orgSlug,e.virtualMcpId),o=t.adopted?at(e):null;let r;try{r=await t.write()}catch(i){throw oe(n,{ok:!1,navigates:!1}),t.refreshOnError&&re(e,{kind:t.kind,reread:!0}).catch(()=>{}),i}if(e.backend?.kind==="protocol"&&e.cacheKey&&lo(e.cacheKey),t.adopted){const i=at(e)!==o;return i&&await new Promise(a=>ut.schedule(a)),oe(n,{ok:!0,navigates:i}),t.reread&&re(e,t).catch(()=>{}),r}let s=!1;try{({navigates:s}=await re(e,t))}catch{}finally{oe(n,{ok:!0,navigates:s})}return r}function Sr(e,t){const{queryClient:n,orgSlug:o,virtualMcpId:r,branch:s}=e,i=J(o,r),a=new Set(t.blockKeys);for(const u of[...Q(i).discardListeners])u(a);jt(i);let l=!1;const c=()=>(l=!0,Mt(e,{kind:"discard",reread:!0,write:t.write}));return s?n.getMutationCache().build(n,{mutationKey:fe(o,r,s),scope:Un(o,r,s),mutationFn:c}).execute(void 0).catch(u=>{throw l||oe(i,{ok:!1,navigates:!1}),u}):c()}function yr(e,t,n){const o=P.c(8);let r;o[0]!==e||o[1]!==t?(r=J(e,t),o[0]=e,o[1]=t,o[2]=r):r=o[2];const s=r;let i;o[3]!==n||o[4]!==s?(i=()=>{const l=Q(s).discardListeners;return l.add(n),()=>{l.delete(n)}},o[3]=n,o[4]=s,o[5]=i):i=o[5];let a;o[6]!==s?(a=[s],o[6]=s,o[7]=a):a=o[7],j.useEffect(i,a)}function mo(e){const t=J(e.orgSlug,e.virtualMcpId);Be(t).inFlight>0||re(e,{kind:"external"}).then(({navigates:n})=>{const o=Q(t);o.previews>0&&o.state.inFlight===0&&Ut(t,n)}).catch(()=>{})}function po(e,t){const n=P.c(7);let o;n[0]!==e||n[1]!==t?(o=J(e,t),n[0]=e,n[1]=t,n[2]=o):o=n[2];const r=o;let s;n[3]!==r?(s=c=>ho(r,c),n[3]=r,n[4]=s):s=n[4];const i=s;let a;n[5]!==r?(a=()=>Be(r),n[5]=r,n[6]=a):a=n[6];const l=a;return j.useSyncExternalStore(i,l,l)}const bo=500;function Er(e,t){const{phase:n}=po(e,t);return ao(n!=="idle",bo)}function wo(e){const t=new Error(`${e} unavailable (content server unreachable)`);return t.status=502,t}function So(e,t){return h.liveMeta(e.orgSlug,e.virtualMcpId,e.branch,`protocol${t.cacheKeySuffix}`,"")}function kr(e,t,n,o){if(o?.source==="github")return yo(e,t,n);const r=e.getQueryData(h.contentVersions(t));if(!r)return;if(Object.hasOwn(r,n))return r[n];const s=e.getQueryData(h.decofile(t));return s&&Object.hasOwn(s,n)?void 0:null}function K(e,t){if(Object.hasOwn(e.changes,t))return e.changes[t];const n=F(t),o=Object.keys(e.changes).find(r=>F(r)===n);return o===void 0?void 0:e.changes[o]}function yo(e,t,n){const o=e.getQueryData(h.contentChanges(t));if(o)return Ft(o,ge(e,t),n)}function Ft(e,t,n){const o=K(e,n);return o?.kind==="delete"?o.version??we:o?o.version:t.has(F(n))?we:null}function Or(e,t,n){const o=e.getQueryData(h.contentChanges(t));if(!o)return!1;const r=K(o,n);return r?r.kind==="set"&&r.baseVersion===null:ge(e,t).has(F(n))}function Dr(e,t){const n=e.getQueryData(h.decofile(t)),o=e.getQueryData(h.contentChanges(t));if(!n||!o)return null;const r=ge(e,t);return{blocks:n,versionOf:s=>Ft(o,r,s)}}function ge(e,t){return new Set(e.getQueryData(h.contentDraftTombstones(t)))}function ce(e,t,n,o){const r=F(n),s=ge(e,t);s.has(r)!==o&&(o?s.add(r):s.delete(r),ee(e),e.setQueryData(h.contentDraftTombstones(t),[...s]))}function Eo(e,t,n,o){const r=He(o.revision),s=e.getQueryData(h.contentRevision(n))?.revision,i=s?He(s):null,a=r&&!r.main&&i?en(i.main,r.draft):o.revision,l=e.getQueryData(h.contentVersions(n)),c=Object.entries(o.versions??{}).map(([f,v])=>[f,v===we?null:v]),u=e.getQueryData(h.contentChanges(n)),d=new Set(c.flatMap(([f])=>{const v=u?K(u,f):void 0;return(v?v.baseVersion:l?.[f]??null)===null?[f]:[]})),g=new Set(c.flatMap(([f,v])=>v===null?[]:[F(f)]));e.setQueryData(h.contentChanges(n),f=>{if(!f)return f;const v={...f.changes};for(const[b,w]of c){const I=K(f,b),T=I?I.baseVersion:l?.[b]??null;w!==null?v[b]={kind:"set",version:w,baseVersion:T}:T!==null?v[b]={kind:"delete",version:null,baseVersion:T}:delete v[b]}return{...f,changes:v,edited:!0}});for(const[f,v]of c)v!==null?ce(e,n,f,!1):!g.has(F(f))&&d.has(f)&&ce(e,n,f,!0);return r&&r.draft!=="none"&&e.setQueryData(h.protocolDraftRead(t.orgSlug,t.virtualMcpId,t.branch),f=>f&&{...f,version:r.draft}),a}function Ve(e,t,n){ee(e),e.setQueryData(h.contentVersions(t),o=>{const r={...o};for(const[s,i]of Object.entries(n))i===null?delete r[s]:r[s]=i;return r})}function ko(e,t){const n=e.getMutationCache().findAll({mutationKey:fe(t.orgSlug,t.virtualMcpId,t.branch),status:"pending"});return new Set(n.flatMap(o=>yn(o.state.variables)))}function De(e,t){e.resetQueries({queryKey:h.contentBackend(t.orgSlug,t.virtualMcpId,"local")})}async function le(e,t,n,o){try{return await o()}catch(r){const s=!(r instanceof D);throw t.source==="local"&&s?(De(e,n),new xt(r)):(t.source==="local"&&Pe(r)&&De(e,n),r)}}const se=new Map;function Qt(e,t,n,o){const r=se.get(o);if(r)return r;const s=Bt(e,t,n,o,!0);return se.set(o,s),s.finally(()=>se.delete(o))}const me=new Set;function Oo(e,t,n){const o=P.c(8),r=z(),s=t?.orgSlug,i=t?.virtualMcpId,a=t?.branch;let l,c;o[0]!==e||o[1]!==a||o[2]!==n||o[3]!==s||o[4]!==r||o[5]!==i?(l=()=>{if(!e||!s||!i||!a)return;const u={orgSlug:s,virtualMcpId:i,branch:a};return uo(d=>{d===n&&(me.has(n)||(me.add(n),To(r,e,u,n).catch(Do).finally(()=>me.delete(n))))})},c=[r,e,s,i,a,n],o[0]=e,o[1]=a,o[2]=n,o[3]=s,o[4]=r,o[5]=i,o[6]=l,o[7]=c):(l=o[6],c=o[7]),j.useEffect(l,c)}function Do(){}async function To(e,t,n,o){const r=se.get(o);return r&&await r.catch(()=>{}),Qt(e,t,n,o)}async function Bt(e,t,n,o,r){ee(e);const s=h.decofile(o),i=So(n,t),a=h.contentRevision(o),l=h.contentVersions(o),c=e.getQueryData(s),u=e.getQueryData(l),d=e.getQueryData(i),g=e.getQueryData(a)??void 0,f=t.source==="github"&&!d?lt(e,n.orgSlug,n.virtualMcpId):void 0,v=f?.isV8&&f.schema&&f.version?f:void 0,b=d??v?.schema,w=v?{...g,schemaVersion:v.version}:g,I=r&&c&&u?w?.revision:void 0,T=r&&b?w?.schemaVersion:void 0,x=h.contentChanges(o),_=e.getQueryData(x),[C,E,k]=await le(e,t,n,()=>t.client.batch([{method:"blocks.list",params:I?{ifNoneMatch:I}:{}},{method:"schema.get",params:T?{ifNoneMatch:T}:{}},{method:"changes.list",params:vt(_)}])),N=e.getQueryData(a)?.revision,p=N!==void 0&&N!==w?.revision;if(k?.ok){const X=p?null:Ee(_,k.result);X&&e.setQueryData(x,X)}else k&&t.source==="local"&&Pe(k.error)&&De(e,n);if(!C?.ok)throw C?.error??new Error("no blocks.list");if(!E)throw new Error("no schema.get");const O=C.result,$=Ot(E),y=E.ok&&!$?E.result:null;if(O.notModified&&(!c||!u)||y?.notModified&&!b)return Bt(e,t,n,o,!1);const R=O.notModified?new Set:ko(e,n),A=O.notModified?c:Sn(O.blocks,c,R),U=$?En():y?y.notModified?b:y.schema:E.error;if(e.setQueryData(a,{revision:p?N:O.notModified?w?.revision:O.revision,schemaVersion:y?y.notModified?w?.schemaVersion:y.version??void 0:void 0}),e.setQueryData(s,A),!O.notModified){const X=e.getQueryData(l),V={...O.versions};for(const L of R){const W=X?.[L];W!==void 0?V[L]=W:delete V[L]}e.setQueryData(l,V)}return U instanceof D||e.setQueryData(i,U),!p&&!O.notModified&&c&&w?.revision&&O.revision!==w.revision&&mo({queryClient:e,orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,backend:t,cacheKey:o}),{blocks:A,meta:U}}async function Tr(e,t,n,o,r,s){if(t.source==="github"){const a=[...Object.keys(r.set??{}),...r.delete??[]].filter(l=>!s||!Object.hasOwn(s,l));if(a.length>0)throw new Error(`A hosted save needs a precondition for every block it touches (missing: ${a.join(", ")})`)}return vo({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=await le(e,t,n,()=>t.client.blocksApply({set:r.set,delete:r.delete,...s?{ifMatch:s}:{}}));ee(e);const a=t.source==="github"?Eo(e,n,o,i):i.revision;e.setQueryData(h.contentRevision(o),c=>({...c,revision:a}));const l=i.versions??{};return Ve(e,o,l),{revision:a,versions:l}}})}function Vt(e,t){if(!(e instanceof D))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 Ht(e,t,n){if(!(n instanceof D))return;const o=n.data?.draft;if(!(!o||typeof o!="object"))for(const[r,s]of Object.entries(o))s===null&&ce(e,t,r,!1)}function Gt(e,t,n,o){ee(e);const r=o.block===null,s=e.getQueryData(h.contentVersions(t)),i=e.getQueryData(h.contentChanges(t)),a=i?K(i,n):void 0,l=a?a.baseVersion:s?.[n]??null;if(i){const c=F(n),u=Object.fromEntries(Object.entries(i.changes).filter(([d])=>F(d)!==c));r?l!==null&&(u[n]={kind:"delete",version:null,baseVersion:l}):u[n]={kind:"set",version:o.version,baseVersion:l},e.setQueryData(h.contentChanges(t),{...i,changes:u,edited:!0})}ce(e,t,n,r&&l===null),e.setQueryData(h.decofile(t),c=>{const u={...c};return r?delete u[n]:u[n]=o.block,u}),Ve(e,t,{[n]:r?null:o.version})}function Ir(e,t,n,o){if(t.source!=="github"||!(o instanceof D))return!1;Ht(e,n,o);const r=o.data?.draft;if(!r||typeof r!="object")return!1;const s=Object.keys(r),i=s.map(a=>Vt(o,a));return s.length===0||i.some(a=>a===void 0)?!1:(e.cancelQueries({queryKey:h.decofile(n)}),s.forEach((a,l)=>{Gt(e,n,a,i[l])}),!0)}async function Cr(e,t,n,o,r,s){t.source==="github"&&Ht(e,o,s);const i=t.source==="github"?Vt(s,r):void 0;if(i)return e.cancelQueries({queryKey:h.decofile(o)}),Gt(e,o,r,i),!0;await e.invalidateQueries({queryKey:h.decofile(o)});let a;try{const c=(await le(e,t,n,()=>t.client.changesGet({names:[r]}))).entries[r];if(c&&c.after===null&&c.version!==null)return!1;a={value:c?.after??null,version:c?.version??null},t.source==="github"&&e.setQueryData(h.contentChanges(o),u=>{if(!u)return u;const d={...u.changes};return c?.kind?d[r]={kind:c.kind,version:c.version,baseVersion:c.baseVersion}:delete d[r],{...u,changes:d,edited:!0}})}catch{const l=await le(e,t,n,()=>t.client.blocksList({}));if(l.notModified)return!1;a={value:l.blocks[r]??null,version:l.versions[r]??null}}return e.setQueryData(h.decofile(o),l=>{const c={...l};return a.value===null?delete c[r]:c[r]=a.value,c}),Ve(e,o,{[r]:a.version}),!1}function Io(e){const t=P.c(15),n=z();let o;t[0]!==e?.branch||t[1]!==e?.orgSlug||t[2]!==e?.virtualMcpId?(o=h.protocolDraftRead(e?.orgSlug??"",e?.virtualMcpId??"",e?.branch??""),t[0]=e?.branch,t[1]=e?.orgSlug,t[2]=e?.virtualMcpId,t[3]=o):o=t[3];let r;t[4]!==e||t[5]!==n?(r=async()=>{const f=await fetch(`/api/${e.orgSlug}/decofile/${encodeURIComponent(e.virtualMcpId)}/${encodeURIComponent(e.branch)}`,{cache:"no-store",headers:ue("v8")});if(await _e(f))throw Ce(n,e.orgSlug,e.virtualMcpId),new Ne;if(!f.ok)throw new Error(`draft pointer read failed: ${f.status}`);return await f.json()},t[4]=e,t[5]=n,t[6]=r):r=t[6];const s=!!e;let i;t[7]!==o||t[8]!==r||t[9]!==s?(i={queryKey:o,queryFn:r,enabled:s,staleTime:Number.POSITIVE_INFINITY},t[7]=o,t[8]=r,t[9]=s,t[10]=i):i=t[10];const{data:a,isPending:l,isError:c}=M(i),u=!!e&&l&&!c;if(!e||!a?.draft||!a.version){let f;return t[11]!==u?(f={pointer:null,pending:u},t[11]=u,t[12]=f):f=t[12],f}const d=`${a.draft}@${a.version}`;let g;return t[13]!==d?(g={pointer:d,pending:!1},t[13]=d,t[14]=g):g=t[14],g}function _r(e){return Io(e).pointer}function Nr(e){const t=P.c(4);let n;t[0]!==e?(n=h.contentRevision(e),t[0]=e,t[1]=n):n=t[1];let o;t[2]!==n?(o={queryKey:n,enabled:!1,queryFn:Co,staleTime:Number.POSITIVE_INFINITY},t[2]=n,t[3]=o):o=t[3];const{data:r}=M(o);return r?.revision}async function Co(){throw new Error("content revisions are set by reads and writes")}function Te(e){const t=`${e.orgSlug}/${e.virtualMcpId}/${e.branch}`;return e.protocolSuffix?`${t}${e.protocolSuffix}`:e.localPreviewUrl?`${t}:local:${e.localPreviewUrl}`:t}function Rr(e,t){return Te({...e,protocolSuffix:t.cacheKeySuffix})}function _o(e,t){const n=P.c(6),{url:o}=It(e?.virtualMcpId),r=Tt(e?.virtualMcpId,e?.branch);if(!e)return"";let s;return n[0]!==r.cacheKeySuffix||n[1]!==r.kind||n[2]!==o||n[3]!==t?.tunnel||n[4]!==e?(s=r.kind==="protocol"?Te({...e,protocolSuffix:r.cacheKeySuffix}):Te({...e,localPreviewUrl:t?.tunnel===!1?null:o}),n[0]=r.cacheKeySuffix,n[1]=r.kind,n[2]=o,n[3]=t?.tunnel,n[4]=e,n[5]=s):s=n[5],s}function xr(e,t){const n=P.c(39),{url:o,undecided:r}=It(e?.virtualMcpId),s=!!o,i=Tt(e?.virtualMcpId,e?.branch),a=i.kind==="protocol"?i:null,l=_o(e),c=t?.fetchEnabled??!0,u=oo(e?.virtualMcpId),d=dt(e?.virtualMcpId).runtime==="cms",g=z();let f;n[0]!==l?(f=h.decofile(l),n[0]=l,n[1]=f):f=n[1];const v=f;Oo(a,a&&e?e:null,l);let b;n[2]!==e||n[3]!==g||n[4]!==v?(b=()=>{if(!e||g.isMutating({mutationKey:fe(e.orgSlug,e.virtualMcpId,e.branch)})>0)return!0;const p=g.getQueryState(v);return p?.fetchStatus==="fetching"||Date.now()-(p?.dataUpdatedAt??0)<Ct/2},n[2]=e,n[3]=g,n[4]=v,n[5]=b):b=n[5];let w;n[6]!==d||n[7]!==s||n[8]!==e||n[9]!==a||n[10]!==g||n[11]!==v?(w=async()=>{if(e){if(!a&&d&&!s){const p=Qn(g,e)?.version;if(p&&!await Bn(e,p))return}await g.refetchQueries({queryKey:v,exact:!0},{cancelRefetch:!1})}},n[6]=d,n[7]=s,n[8]=e,n[9]=a,n[10]=g,n[11]=v,n[12]=w):w=n[12];let I;n[13]!==b||n[14]!==w?(I={skip:b,read:w},n[13]=b,n[14]=w,n[15]=I):I=n[15],zn(!!t?.pollWhile&&!!e,I);let T;n[16]!==i.kind||n[17]!==d||n[18]!==c||n[19]!==l||n[20]!==s||n[21]!==o||n[22]!==u||n[23]!==e||n[24]!==a||n[25]!==g?(T=async()=>{if(a)return(await Qt(g,a,e,l)).blocks;if(i.kind==="unavailable")throw wo("decofile");if(s){const y=await fetch(new URL("/.decofile",o).toString(),{cache:"no-store"}).catch(xo),R=y?.ok?rt(await y.text()):null;if(R)return R;const A=new Error("decofile unavailable (local tunnel unreachable)");throw A.status=502,A}if(d)return Hn(g,e);const p=()=>no(e,jn(u,".deco/blocks.gen.json"));if(c){const y=await fetch(Kn(e),{cache:"no-store"}).catch(Ro);if(y?.ok){const U=rt(await y.text());if(U)return U}const R=await p();if(R.kind==="data")return R.data;const A=new Error(`Failed to fetch decofile: ${y?.status??"network error"}`);throw A.status=it({liveOk:!!y?.ok,liveStatus:y?.status,committedAbsent:R.kind==="absent"}),A}const O=await p();if(O.kind==="data")return O.data;const $=new Error("decofile unavailable (preview down, no committed snapshot)");throw $.status=it({liveOk:!1,committedAbsent:O.kind==="absent"}),$},n[16]=i.kind,n[17]=d,n[18]=c,n[19]=l,n[20]=s,n[21]=o,n[22]=u,n[23]=e,n[24]=a,n[25]=g,n[26]=T):T=n[26];const x=!!e&&i.kind!=="pending"&&!r,_=a?0:3e4,C=a?.describe.pollIntervalMs,E=a?"always":void 0;let k;n[27]!==d||n[28]!==s||n[29]!==a?(k=(p,O)=>{if(a||d||s)return p<3;const $=O.status;return $!==502&&$!==404&&p<2},n[27]=d,n[28]=s,n[29]=a,n[30]=k):k=n[30];let N;return n[31]!==v||n[32]!==T||n[33]!==x||n[34]!==_||n[35]!==C||n[36]!==E||n[37]!==k?(N={queryKey:v,queryFn:T,enabled:x,staleTime:_,refetchInterval:C,refetchIntervalInBackground:!1,refetchOnWindowFocus:E,retry:k,retryDelay:No},n[31]=v,n[32]=T,n[33]=x,n[34]=_,n[35]=C,n[36]=E,n[37]=k,n[38]=N):N=n[38],M(N)}function No(e){return ln(5e3,1e3,e,2,0)}function Ro(){return null}function xo(){return null}const Po="site-editor-save",Jt={id:Po,description:void 0,action:void 0,cancel:void 0},Pr="site-editor-undo",Ie="site-editor-publish";function $o(e){const t=P.c(7),{label:n,detail:o}=e;let r;t[0]!==n?(r=G.jsx("summary",{className:"cursor-pointer select-none text-muted-foreground",children:n}),t[0]=n,t[1]=r):r=t[1];let s;t[2]!==o?(s=G.jsx("p",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-muted-foreground",children:o}),t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=G.jsxs("details",{className:"mt-1 text-xs",children:[r,s]}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function Wt(e,t){return t?G.jsx($o,{label:e("siteEditor.details"),detail:t}):void 0}function $r(e,t,n){q.error($t(e,t,n),{...Jt,description:Wt(e,ro(t,n))})}function Ar(e,t,n=!1){q.info(e(t?"sectionsEditor.reconcile.leftDeleted":"sectionsEditor.reconcile.keptTheirs"),{...Jt,description:e(t?n?"sectionsEditor.reconcile.leftDeletedNeverPublishedHint":"sectionsEditor.reconcile.leftDeletedHint":"sectionsEditor.reconcile.keptTheirsHint")})}const Yt={action:void 0,duration:void 0};function Lr(e,t){q.success(t?e("siteEditor.publish.publishedOn",{host:t}):e("siteEditor.publish.published"),{...Yt,id:Ie,description:void 0})}function jr(e,{headline:t,body:n,detail:o,retry:r,pending:s,tone:i="error"}){const a=Wt(e,o??null);q[i](t,{id:Ie,description:n&&a?G.jsxs(G.Fragment,{children:[G.jsx("p",{children:n}),a]}):n??a,action:r?{label:e("siteEditor.tryAgain"),onClick:l=>{l.preventDefault(),q.loading(s??e("thread.publishPopover.publishing"),{...Yt,id:Ie,description:void 0}),r()}}:void 0,duration:r?Number.POSITIVE_INFINITY:void 0})}function Ur(e){return e instanceof Error?e.message||null:e==null?null:String(e)}export{Dr as $,br as A,po as B,wr as C,_o as D,Nr as E,Un as F,fe as G,vo as H,to as I,Mn as J,Ar as K,Or as L,pr as M,je as N,mr as O,To as P,Fe as Q,Tr as R,er as S,yt as T,Cr as U,$r as V,kr as W,So as X,Fn as Y,fr as Z,yr as _,nr as a,rr as a0,lr as a1,Ke as a2,et as a3,ur as a4,tr as a5,qn as a6,ar as a7,Rr as a8,gn as a9,S as aA,gr as aB,Wt as aa,Ur as ab,Lr as ac,Sr as ad,Jo as ae,Wo as af,Pe as ag,zo as ah,dn as ai,$o as aj,Yo as ak,Qt as al,wo as am,vr as an,no as ao,Qe as ap,Ir as aq,dr as ar,_r as as,jr as at,Ie as au,Yt as av,Pr as aw,Jt as ax,ko as ay,D as az,mn as b,It as c,hn as d,Ko as e,vn as f,Le as g,xe as h,pt as i,hr as j,Xn as k,xr as l,or as m,cr as n,oo as o,Xo as p,jn as q,qo as r,Zo as s,Et as t,Tt as u,ir as v,Er as w,sr as x,Io as y,J as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as te,a4 as se,q as ae,r as M,ad as ce,j as t,B as H,n as $,bA as de,a5 as me,aS as ue,aR as pe,aO as ge,aM as fe,aN as he,aQ as xe,aP as je,bl as ke,t as D,aD as ve,c as ie,l as ye,Z as Se,V as be,Y as we,X as Ce,K as q,gn as De}from"./index-BJ9m9LNK.js";import{i as Ne}from"./DotsVertical-B50qkKfK.js";import{i as le,a as Pe}from"./ZoomOut-DTBYck8o.js";import{s as Ae}from"./Trash01-BqnutNRJ.js";import{i as Ee}from"./Upload01-CyyevXMg.js";import{S as Me}from"./search-input-N6CaOC_1.js";import{S as Te}from"./search-toggle-hVjf6-kQ.js";import{E as V}from"./empty-state-BpneGtoe.js";import{C as Oe}from"./collection-tabs-D6nWmqmK.js";import{p as Ie,S as Re,F as ze}from"./folder-icon-BZUD34gC.js";import{h as Fe,i as $e,r as _e}from"./use-org-fs-Bmjx4Cik.js";import{S as Le,H as Z,f as Be}from"./location-V0VwTJTt.js";import"./SearchMd-OqihyBBE.js";import"./icon-button-j3Ikexya.js";import"./tooltip-BP50pkvP.js";import"./index-Zaz397OF.js";import"./badge-Cd6N93gT.js";import"./markdown-BG06zpZJ.js";import"./use-copy-Dgppamoo.js";import"./Copy01-B6cJ_ygs.js";import"./use-mobile-CMu6UtqS.js";import"./use-panel-navigate-o6edpcRi.js";import"./thread-route-Dp-aglxM.js";import"./use-project-scope-2Tdoer5a.js";import"./repository-binding-5kMOX4dj.js";import"./use-mcp-client-Do4_ndrI.js";import"./auth-Dfomi5JO.js";import"./file-preview-Bvo7zdtc.js";import"./utils-muk7Isuo.js";import"./Image01-D6z5fxVv.js";import"./editor-BDmCsl05.js";import"./file-type-icon-CjiJpbk5.js";import"./useInfiniteQuery-Cq3QQD7o.js";import"./infiniteQueryObserver-CM3ITLPo.js";const J=200,Ke=new Set(["node_modules","__pycache__"]);function G(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function Qe(s){return G(s).split("/").every(e=>!e.startsWith(".")&&!Ke.has(e))}function qe(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function He(s,e){const l=new Map;for(const r of s){const c=G(r).split("/");c.pop();const a=["skills",e,...c].join("/");l.set(a,[...l.get(a)??[],r])}return l}async function Ge(s,e){const r=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(r)throw r.reason}function Ue(s,e){const l=Ie(e),r=`skills/${s}`;return{id:`home/${r}`,name:l.name??s,description:l.description,disableModelInvocation:l.disableModelInvocation,source:"home",volume:Z,path:r,sandboxPath:`${Le}/${Z}/${r}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const l=s.indexOf(":");return l===-1?{label:e,glyph:le}:{label:s.slice(l+1),glyph:s.startsWith("repo:")?ve:Pe}}function Xe(s){const e=ie.c(48),{entry:l,pending:r,onOpen:c,onDelete:a}=s,o=te(),{org:m}=se();let S;e[0]!==l.source||e[1]!==m.name?(S=re(l.source,m.name),e[0]=l.source,e[1]=m.name,e[2]=S):S=e[2];const{label:T,glyph:O}=S;let I;e[3]!==l?(I=B(l),e[3]=l,e[4]=I):I=e[4];const z=I,R=r?"opacity-60":"hover:bg-accent";let u;e[5]!==R?(u=ye("relative transition-colors group overflow-hidden flex flex-col h-full",R),e[5]=R,e[6]=u):u=e[6];let f;e[7]!==l.name||e[8]!==c||e[9]!==r?(f=!r&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":l.name}),e[7]=l.name,e[8]=c,e[9]=r,e[10]=f):f=e[10];const b=z?"default":"system",N=!z;let w;e[11]!==O||e[12]!==b||e[13]!==N?(w=t.jsx(ze,{glyph:O,tone:b,readOnly:N,className:"size-8 shrink-0"}),e[11]=O,e[12]=b,e[13]=N,e[14]=w):w=e[14];let h;e[15]!==a||e[16]!==o?(h=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(Se,{children:[t.jsx(be,{asChild:!0,children:t.jsx(H,{variant:"ghost",size:"icon",children:t.jsx(Ne,{size:16})})}),t.jsx(we,{align:"end",children:t.jsxs(Ce,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(Ae,{size:16}),o("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=o,e[17]=h):h=e[17];let x;e[18]!==w||e[19]!==h?(x=t.jsxs("div",{className:"flex items-start justify-between",children:[w,h]}),e[18]=w,e[19]=h,e[20]=x):x=e[20];let j;e[21]!==l.name?(j=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:l.name}),e[21]=l.name,e[22]=j):j=e[22];let C;e[23]!==l.description||e[24]!==o?(C=l.description||o("settings.skills.noDescription"),e[23]=l.description,e[24]=o,e[25]=C):C=e[25];let k;e[26]!==C?(k=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:C}),e[26]=C,e[27]=k):k=e[27];let d;e[28]!==j||e[29]!==k?(d=t.jsxs("div",{className:"flex flex-col gap-1",children:[j,k]}),e[28]=j,e[29]=k,e[30]=d):d=e[30];let v;e[31]!==x||e[32]!==d?(v=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[x,d]}),e[31]=x,e[32]=d,e[33]=v):v=e[33];let p;e[34]!==T||e[35]!==r||e[36]!==o?(p=r?o("settings.skills.importing"):T,e[34]=T,e[35]=r,e[36]=o,e[37]=p):p=e[37];let y;e[38]!==p?(y=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:p})})}),e[38]=p,e[39]=y):y=e[39];let g;e[40]!==v||e[41]!==y?(g=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[v,y]}),e[40]=v,e[41]=y,e[42]=g):g=e[42];let P;return e[43]!==r||e[44]!==g||e[45]!==u||e[46]!==f?(P=t.jsxs(De,{size:"flush","aria-busy":r,className:u,children:[f,g]}),e[43]=r,e[44]=g,e[45]=u,e[46]=f,e[47]=P):P=e[47],P}function ee(s){const e=ie.c(2),{children:l}=s;let r;return e[0]!==l?(r=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:l}),e[0]=l,e[1]=r):r=e[1],r}function At(){const s=te(),{org:e}=se(),l=Fe(),{remove:r,upload:c}=$e("home"),a=ae(),o=M.useRef(null),[m,S]=M.useState(""),T=ce(),[O,I]=M.useState(L),[z,R]=M.useState(!1),[u,f]=M.useState(null),[b,N]=M.useState(null),[w,h]=M.useState(null),x=()=>{a.invalidateQueries({queryKey:q.slashSkills(e.id)}),a.invalidateQueries({queryKey:q.orgFsSkills(e.id)})},j=i=>a.setQueryData(q.slashSkills(e.id),n=>i(n??[]));async function C(i){const n=[...i??[]];if(o.current&&(o.current.value=""),n.length===0)return;const A=n[0]?.webkitRelativePath??"";if(!A){D.error(s("settings.skills.importNeedsFolder"));return}const Q=A.split("/")[0]??"",_=n.filter(Qe),X=_.find(E=>G(E)==="SKILL.md");if(!X){D.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>J){D.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(J)}));return}const F=qe(Q),W=`skills/${F}`;let Y=!1;R(!0);try{if(await _e(e.slug,"home",W)){D.error(s("settings.skills.importSlugTaken",{slug:F}));return}Y=!0;const E=Ue(F,await X.text());j(oe=>[E,...oe]),h(E.id),await Ge(He(_,F),c.mutateAsync),D.success(s("settings.skills.importSuccess",{name:F}))}catch(E){Y&&await r.mutateAsync(W).catch(()=>{}),D.error(E instanceof Error?E.message:s("settings.skills.importError"))}finally{h(null),x(),R(!1)}}const k=m.toLowerCase(),d=(l.data??[]).filter(i=>i.name.toLowerCase().includes(k)||(i.description??"").toLowerCase().includes(k)).sort((i,n)=>Number(B(n))-Number(B(i))||i.name.localeCompare(n.name)),v=new Set((l.data??[]).map(i=>i.source)),p=new Map;for(const i of d)p.set(i.source,(p.get(i.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:d.length},...[...v].map(i=>({id:i,label:re(i,e.name).label,count:p.get(i)??0}))],g=v.has(O)?O:L,P=g===L?d:d.filter(i=>i.source===g),K=i=>f(Be(i.volume,i.path)),ne=async()=>{if(!b)return;const{id:i,path:n}=b;N(null),j(A=>A.filter(Q=>Q.id!==i));try{await r.mutateAsync(n),D.success(s("settings.skills.deleteSuccess"))}catch(A){D.error(A instanceof Error?A.message:s("settings.skills.deleteError"))}finally{x()}},U=t.jsxs(H,{size:"sm",disabled:z,onClick:()=>o.current?.click(),children:[t.jsx(Ee,{size:14}),s(z?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs($,{children:[t.jsx($.Content,{children:t.jsx($.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[T?t.jsx($.Actions,{secondary:t.jsx(Te,{value:m,onChange:S,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:U}):t.jsx($.Title,{actions:U,children:s("settings.skills.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 empty:hidden",children:!T&&t.jsx(Me,{value:m,onChange:S,placeholder:s("settings.skills.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(S(""),i.target.blur())}})}),t.jsx("input",{ref:o,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:i=>{C(i.target.files)}}),y.length>2&&t.jsx(Oe,{placement:"page",tabs:y,activeTab:g,onTabChange:I}),l.isPending?t.jsx("div",{className:"@container",children:t.jsx(ee,{children:Array.from({length:8},(i,n)=>t.jsx(de,{className:"h-[168px] rounded-xl"},n))})}):l.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(V,{image:t.jsx(me,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:l.error instanceof Error?l.error.message:s("settings.skills.errorDescription"),actions:t.jsx(H,{size:"sm",variant:"outline",onClick:()=>{l.refetch()},children:s("settings.skills.retry")})})}):P.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(V,{image:t.jsx(le,{size:48,className:"text-muted-foreground"}),title:s(m?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:m?s("settings.skills.noResultsDescription",{search:m}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(ee,{children:P.map(i=>{const n=i.id===w;return t.jsx(Xe,{entry:i,pending:n,onOpen:()=>K(i),onDelete:B(i)&&!n?()=>N(i):void 0},i.id)})})})]})})}),u&&t.jsx(Re,{skillPath:u,onClose:()=>f(null)},u),t.jsx(ue,{open:b!==null,onOpenChange:i=>!i&&N(null),children:t.jsxs(pe,{children:[t.jsxs(ge,{children:[t.jsx(fe,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(he,{children:s("settings.skills.deleteDialogDescription",{name:b?.name??""})})]}),t.jsxs(xe,{children:[t.jsx(je,{children:s("settings.skills.cancel")}),t.jsx(ke,{onClick:ne,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{At as default};
|
|
1
|
+
import{b as te,a4 as se,q as ae,r as M,ad as ce,j as t,B as H,n as $,bA as de,a5 as me,aS as ue,aR as pe,aO as ge,aM as fe,aN as he,aQ as xe,aP as je,bl as ke,t as D,aD as ve,c as ie,l as ye,Z as Se,V as be,Y as we,X as Ce,K as q,gn as De}from"./index-C5hxtG-B.js";import{i as Ne}from"./DotsVertical-BK4Fy8Nl.js";import{i as le,a as Pe}from"./ZoomOut-6mAbwFTL.js";import{s as Ae}from"./Trash01-DuRmK_Vz.js";import{i as Ee}from"./Upload01-C0iYEe1U.js";import{S as Me}from"./search-input-VUL2ibQB.js";import{S as Te}from"./search-toggle-zvtLuz6H.js";import{E as V}from"./empty-state-BWR7Jy-d.js";import{C as Oe}from"./collection-tabs--jJp2ESY.js";import{p as Ie,S as Re,F as ze}from"./folder-icon-nOlxOX5D.js";import{h as Fe,i as $e,r as _e}from"./use-org-fs-CPqLHgiA.js";import{S as Le,H as Z,f as Be}from"./location-V0VwTJTt.js";import"./SearchMd-CPTG-cGa.js";import"./icon-button-DBRjX149.js";import"./tooltip-C9PLptTv.js";import"./index-xUcGx-v6.js";import"./badge-DlHCn1A-.js";import"./markdown-B-00ZOm1.js";import"./use-copy-BYfqkrcX.js";import"./Copy01-sA0-K7LG.js";import"./use-mobile-Bht8wONL.js";import"./use-panel-navigate-DlKiU4ru.js";import"./thread-route-Dq4msobR.js";import"./use-project-scope-Lvryvv_x.js";import"./repository-binding-WDk-SmGV.js";import"./use-mcp-client-Dehh-QD8.js";import"./auth-CODe_IGw.js";import"./file-preview-Duo4jala.js";import"./utils-B8OWeF28.js";import"./Image01-DDkvI5Nm.js";import"./editor-CFcE0Q6O.js";import"./file-type-icon-C3nhEJVa.js";import"./useInfiniteQuery-wSSEyg4B.js";import"./infiniteQueryObserver-cbOSzSkb.js";const J=200,Ke=new Set(["node_modules","__pycache__"]);function G(s){const[,...e]=s.webkitRelativePath.split("/");return e.length>0?e.join("/"):s.name}function Qe(s){return G(s).split("/").every(e=>!e.startsWith(".")&&!Ke.has(e))}function qe(s){return s.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"skill"}function He(s,e){const l=new Map;for(const r of s){const c=G(r).split("/");c.pop();const a=["skills",e,...c].join("/");l.set(a,[...l.get(a)??[],r])}return l}async function Ge(s,e){const r=(await Promise.allSettled([...s].map(([c,a])=>e({dir:c,files:a})))).find(c=>c.status==="rejected");if(r)throw r.reason}function Ue(s,e){const l=Ie(e),r=`skills/${s}`;return{id:`home/${r}`,name:l.name??s,description:l.description,disableModelInvocation:l.disableModelInvocation,source:"home",volume:Z,path:r,sandboxPath:`${Le}/${Z}/${r}`}}const L="*";function B(s){return s.volume==="home"}function re(s,e){const l=s.indexOf(":");return l===-1?{label:e,glyph:le}:{label:s.slice(l+1),glyph:s.startsWith("repo:")?ve:Pe}}function Xe(s){const e=ie.c(48),{entry:l,pending:r,onOpen:c,onDelete:a}=s,o=te(),{org:m}=se();let S;e[0]!==l.source||e[1]!==m.name?(S=re(l.source,m.name),e[0]=l.source,e[1]=m.name,e[2]=S):S=e[2];const{label:T,glyph:O}=S;let I;e[3]!==l?(I=B(l),e[3]=l,e[4]=I):I=e[4];const z=I,R=r?"opacity-60":"hover:bg-accent";let u;e[5]!==R?(u=ye("relative transition-colors group overflow-hidden flex flex-col h-full",R),e[5]=R,e[6]=u):u=e[6];let f;e[7]!==l.name||e[8]!==c||e[9]!==r?(f=!r&&t.jsx("button",{type:"button",onClick:c,className:"absolute inset-0 z-0","aria-label":l.name}),e[7]=l.name,e[8]=c,e[9]=r,e[10]=f):f=e[10];const b=z?"default":"system",N=!z;let w;e[11]!==O||e[12]!==b||e[13]!==N?(w=t.jsx(ze,{glyph:O,tone:b,readOnly:N,className:"size-8 shrink-0"}),e[11]=O,e[12]=b,e[13]=N,e[14]=w):w=e[14];let h;e[15]!==a||e[16]!==o?(h=a&&t.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:t.jsxs(Se,{children:[t.jsx(be,{asChild:!0,children:t.jsx(H,{variant:"ghost",size:"icon",children:t.jsx(Ne,{size:16})})}),t.jsx(we,{align:"end",children:t.jsxs(Ce,{variant:"destructive",onClick:K=>{K.stopPropagation(),a()},children:[t.jsx(Ae,{size:16}),o("settings.skills.deleteButton")]})})]})}),e[15]=a,e[16]=o,e[17]=h):h=e[17];let x;e[18]!==w||e[19]!==h?(x=t.jsxs("div",{className:"flex items-start justify-between",children:[w,h]}),e[18]=w,e[19]=h,e[20]=x):x=e[20];let j;e[21]!==l.name?(j=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:l.name}),e[21]=l.name,e[22]=j):j=e[22];let C;e[23]!==l.description||e[24]!==o?(C=l.description||o("settings.skills.noDescription"),e[23]=l.description,e[24]=o,e[25]=C):C=e[25];let k;e[26]!==C?(k=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:C}),e[26]=C,e[27]=k):k=e[27];let d;e[28]!==j||e[29]!==k?(d=t.jsxs("div",{className:"flex flex-col gap-1",children:[j,k]}),e[28]=j,e[29]=k,e[30]=d):d=e[30];let v;e[31]!==x||e[32]!==d?(v=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[x,d]}),e[31]=x,e[32]=d,e[33]=v):v=e[33];let p;e[34]!==T||e[35]!==r||e[36]!==o?(p=r?o("settings.skills.importing"):T,e[34]=T,e[35]=r,e[36]=o,e[37]=p):p=e[37];let y;e[38]!==p?(y=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:p})})}),e[38]=p,e[39]=y):y=e[39];let g;e[40]!==v||e[41]!==y?(g=t.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[v,y]}),e[40]=v,e[41]=y,e[42]=g):g=e[42];let P;return e[43]!==r||e[44]!==g||e[45]!==u||e[46]!==f?(P=t.jsxs(De,{size:"flush","aria-busy":r,className:u,children:[f,g]}),e[43]=r,e[44]=g,e[45]=u,e[46]=f,e[47]=P):P=e[47],P}function ee(s){const e=ie.c(2),{children:l}=s;let r;return e[0]!==l?(r=t.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:l}),e[0]=l,e[1]=r):r=e[1],r}function At(){const s=te(),{org:e}=se(),l=Fe(),{remove:r,upload:c}=$e("home"),a=ae(),o=M.useRef(null),[m,S]=M.useState(""),T=ce(),[O,I]=M.useState(L),[z,R]=M.useState(!1),[u,f]=M.useState(null),[b,N]=M.useState(null),[w,h]=M.useState(null),x=()=>{a.invalidateQueries({queryKey:q.slashSkills(e.id)}),a.invalidateQueries({queryKey:q.orgFsSkills(e.id)})},j=i=>a.setQueryData(q.slashSkills(e.id),n=>i(n??[]));async function C(i){const n=[...i??[]];if(o.current&&(o.current.value=""),n.length===0)return;const A=n[0]?.webkitRelativePath??"";if(!A){D.error(s("settings.skills.importNeedsFolder"));return}const Q=A.split("/")[0]??"",_=n.filter(Qe),X=_.find(E=>G(E)==="SKILL.md");if(!X){D.error(s("settings.skills.importMissingSkillMd"));return}if(_.length>J){D.error(s("settings.skills.importTooManyFiles",{count:String(_.length),max:String(J)}));return}const F=qe(Q),W=`skills/${F}`;let Y=!1;R(!0);try{if(await _e(e.slug,"home",W)){D.error(s("settings.skills.importSlugTaken",{slug:F}));return}Y=!0;const E=Ue(F,await X.text());j(oe=>[E,...oe]),h(E.id),await Ge(He(_,F),c.mutateAsync),D.success(s("settings.skills.importSuccess",{name:F}))}catch(E){Y&&await r.mutateAsync(W).catch(()=>{}),D.error(E instanceof Error?E.message:s("settings.skills.importError"))}finally{h(null),x(),R(!1)}}const k=m.toLowerCase(),d=(l.data??[]).filter(i=>i.name.toLowerCase().includes(k)||(i.description??"").toLowerCase().includes(k)).sort((i,n)=>Number(B(n))-Number(B(i))||i.name.localeCompare(n.name)),v=new Set((l.data??[]).map(i=>i.source)),p=new Map;for(const i of d)p.set(i.source,(p.get(i.source)??0)+1);const y=[{id:L,label:s("settings.skills.filterAll"),count:d.length},...[...v].map(i=>({id:i,label:re(i,e.name).label,count:p.get(i)??0}))],g=v.has(O)?O:L,P=g===L?d:d.filter(i=>i.source===g),K=i=>f(Be(i.volume,i.path)),ne=async()=>{if(!b)return;const{id:i,path:n}=b;N(null),j(A=>A.filter(Q=>Q.id!==i));try{await r.mutateAsync(n),D.success(s("settings.skills.deleteSuccess"))}catch(A){D.error(A instanceof Error?A.message:s("settings.skills.deleteError"))}finally{x()}},U=t.jsxs(H,{size:"sm",disabled:z,onClick:()=>o.current?.click(),children:[t.jsx(Ee,{size:14}),s(z?"settings.skills.importing":"settings.skills.importButton")]});return t.jsxs($,{children:[t.jsx($.Content,{children:t.jsx($.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[T?t.jsx($.Actions,{secondary:t.jsx(Te,{value:m,onChange:S,label:s("library.context.search"),placeholder:s("settings.skills.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),children:U}):t.jsx($.Title,{actions:U,children:s("settings.skills.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 empty:hidden",children:!T&&t.jsx(Me,{value:m,onChange:S,placeholder:s("settings.skills.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(S(""),i.target.blur())}})}),t.jsx("input",{ref:o,type:"file",multiple:!0,webkitdirectory:"",className:"hidden",onChange:i=>{C(i.target.files)}}),y.length>2&&t.jsx(Oe,{placement:"page",tabs:y,activeTab:g,onTabChange:I}),l.isPending?t.jsx("div",{className:"@container",children:t.jsx(ee,{children:Array.from({length:8},(i,n)=>t.jsx(de,{className:"h-[168px] rounded-xl"},n))})}):l.isError?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(V,{image:t.jsx(me,{size:48,className:"text-muted-foreground"}),title:s("settings.skills.errorTitle"),description:l.error instanceof Error?l.error.message:s("settings.skills.errorDescription"),actions:t.jsx(H,{size:"sm",variant:"outline",onClick:()=>{l.refetch()},children:s("settings.skills.retry")})})}):P.length===0?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(V,{image:t.jsx(le,{size:48,className:"text-muted-foreground"}),title:s(m?"settings.skills.noResultsTitle":"settings.skills.emptyTitle"),description:m?s("settings.skills.noResultsDescription",{search:m}):s("settings.skills.emptyDescription"),actions:!1})}):t.jsx("div",{className:"@container",children:t.jsx(ee,{children:P.map(i=>{const n=i.id===w;return t.jsx(Xe,{entry:i,pending:n,onOpen:()=>K(i),onDelete:B(i)&&!n?()=>N(i):void 0},i.id)})})})]})})}),u&&t.jsx(Re,{skillPath:u,onClose:()=>f(null)},u),t.jsx(ue,{open:b!==null,onOpenChange:i=>!i&&N(null),children:t.jsxs(pe,{children:[t.jsxs(ge,{children:[t.jsx(fe,{children:s("settings.skills.deleteDialogTitle")}),t.jsx(he,{children:s("settings.skills.deleteDialogDescription",{name:b?.name??""})})]}),t.jsxs(xe,{children:[t.jsx(je,{children:s("settings.skills.cancel")}),t.jsx(ke,{onClick:ne,variant:"destructive",children:s("settings.skills.deleteButton")})]})]})})]})}export{At as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _,l as N,j}from"./index-
|
|
1
|
+
import{c as _,l as N,j}from"./index-C5hxtG-B.js";import{T as k,R as z,a as D,b as S}from"./index-S0DELbp3.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,fd as K}from"./index-
|
|
1
|
+
import{r as v,fd as K}from"./index-C5hxtG-B.js";import{d as de,e as fe,f as U,g as ge,h as pe,i as be,j as ve,C as Y,k as he,l as y,m as me,n as xe,o as Ie,s as ye}from"./core.esm-7J0R8lPd.js";function q(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Re(e,t){return e.reduce((n,r,s)=>{const a=t.get(r);return a&&(n[s]=a),n},Array(e.length))}function O(e){return e!==null&&e>=0}function Ce(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function we(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const B=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const a=q(t,r,n),o=t[s],c=a[s];return!c||!o?null:{x:c.left-o.left,y:c.top-o.top,scaleX:c.width/o.width,scaleY:c.height/o.height}},L={scaleX:1,scaleY:1},Xe=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:a,overIndex:o}=e;const c=(t=a[n])!=null?t:r;if(!c)return null;if(s===n){const u=a[o];return u?{x:0,y:n<o?u.top+u.height-(c.top+c.height):u.top-c.top,...L}:null}const f=De(a,s,n);return s>n&&s<=o?{x:0,y:-c.height-f,...L}:s<n&&s>=o?{x:0,y:c.height+f,...L}:{x:0,y:0,...L}};function De(e,t,n){const r=e[t],s=e[t-1],a=e[t+1];return r?n<t?s?r.top-(s.top+s.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const H="Sortable",V=K.createContext({activeIndex:-1,containerId:H,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:B,disabled:{draggable:!1,droppable:!1}});function _e(e){let{children:t,id:n,items:r,strategy:s=B,disabled:a=!1}=e;const{active:o,dragOverlay:c,droppableRects:f,over:u,measureDroppableContainers:i}=de(),l=fe(H,n),d=c.rect!==null,g=v.useMemo(()=>r.map(I=>typeof I=="object"&&"id"in I?I.id:I),[r]),R=o!=null,C=o?g.indexOf(o.id):-1,h=u?g.indexOf(u.id):-1,w=v.useRef(g),x=!Ce(g,w.current),m=h!==-1&&C===-1||x,b=we(a);U(()=>{x&&R&&i(g)},[x,g,R,i]),v.useEffect(()=>{w.current=g},[g]);const D=v.useMemo(()=>({activeIndex:C,containerId:l,disabled:b,disableTransforms:m,items:g,overIndex:h,useDragOverlay:d,sortedRects:Re(g,f),strategy:s}),[C,l,b.draggable,b.droppable,m,g,h,f,d,s]);return K.createElement(V.Provider,{value:D},t)}const Se=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return q(n,r,s).indexOf(t)},Ae=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:a,newIndex:o,previousItems:c,previousContainerId:f,transition:u}=e;return!u||!r||c!==a&&s===o?!1:n?!0:o!==s&&t===f},Te={duration:200,easing:"ease"},J="transform",Ee=Y.Transition.toString({property:J,duration:0,easing:"linear"}),Ne={roleDescription:"sortable"};function Oe(e){let{disabled:t,index:n,node:r,rect:s}=e;const[a,o]=v.useState(null),c=v.useRef(n);return U(()=>{if(!t&&n!==c.current&&r.current){const f=s.current;if(f){const u=he(r.current,{ignoreTransform:!0}),i={x:f.left-u.left,y:f.top-u.top,scaleX:f.width/u.width,scaleY:f.height/u.height};(i.x||i.y)&&o(i)}}n!==c.current&&(c.current=n)},[t,n,r,s]),v.useEffect(()=>{a&&o(null)},[a]),a}function je(e){let{animateLayoutChanges:t=Ae,attributes:n,disabled:r,data:s,getNewIndex:a=Se,id:o,strategy:c,resizeObserverConfig:f,transition:u=Te}=e;const{items:i,containerId:l,activeIndex:d,disabled:g,disableTransforms:R,sortedRects:C,overIndex:h,useDragOverlay:w,strategy:x}=v.useContext(V),m=Le(r,g),b=i.indexOf(o),D=v.useMemo(()=>({sortable:{containerId:l,index:b,items:i},...s}),[l,s,b,i]),I=v.useMemo(()=>i.slice(i.indexOf(o)),[i,o]),{rect:N,node:z,isOver:W,setNodeRef:P}=ge({id:o,data:D,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...f}}),{active:T,activatorEvent:Z,activeNodeRect:ee,attributes:te,setNodeRef:X,listeners:re,isDragging:M,over:ne,setActivatorNodeRef:se,transform:oe}=pe({id:o,data:D,attributes:{...Ne,...n},disabled:m.draggable}),ae=be(P,X),S=!!T,_=S&&!R&&O(d)&&O(h),j=!w&&M,F=j&&_?oe:null,ie=_?F??(c??x)({rects:C,activeNodeRect:ee,activeIndex:d,overIndex:h,index:b}):null,E=O(d)&&O(h)?a({id:o,items:i,activeIndex:d,overIndex:h}):b,A=T?.id,p=v.useRef({activeId:A,items:i,newIndex:E,containerId:l}),ce=i!==p.current.items,G=t({active:T,containerId:l,isDragging:M,isSorting:S,id:o,index:b,items:i,newIndex:p.current.newIndex,previousItems:p.current.items,previousContainerId:p.current.containerId,transition:u,wasDragging:p.current.activeId!=null}),$=Oe({disabled:!G,index:b,node:z,rect:N});return v.useEffect(()=>{S&&p.current.newIndex!==E&&(p.current.newIndex=E),l!==p.current.containerId&&(p.current.containerId=l),i!==p.current.items&&(p.current.items=i)},[S,E,l,i]),v.useEffect(()=>{if(A===p.current.activeId)return;if(A!=null&&p.current.activeId==null){p.current.activeId=A;return}const ue=setTimeout(()=>{p.current.activeId=A},50);return()=>clearTimeout(ue)},[A]),{active:T,activeIndex:d,attributes:te,data:D,rect:N,index:b,newIndex:E,items:i,isOver:W,isSorting:S,isDragging:M,listeners:re,node:z,overIndex:h,over:ne,setNodeRef:ae,setActivatorNodeRef:se,setDroppableNodeRef:P,setDraggableNodeRef:X,transform:$??ie,transition:le()};function le(){if($||ce&&p.current.newIndex===b)return Ee;if(!(j&&!ve(Z)||!u)&&(S||G))return Y.Transition.toString({...u,property:J})}}function Le(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function k(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const ke=[y.Down,y.Right,y.Up,y.Left],Fe=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:a,over:o,scrollableAncestors:c}}=t;if(ke.includes(e.code)){if(e.preventDefault(),!n||!r)return;const f=[];a.getEnabled().forEach(l=>{if(!l||l!=null&&l.disabled)return;const d=s.get(l.id);if(d)switch(e.code){case y.Down:r.top<d.top&&f.push(l);break;case y.Up:r.top>d.top&&f.push(l);break;case y.Left:r.left>d.left&&f.push(l);break;case y.Right:r.left<d.left&&f.push(l);break}});const u=me({collisionRect:r,droppableRects:s,droppableContainers:f});let i=xe(u,"id");if(i===o?.id&&u.length>1&&(i=u[1].id),i!=null){const l=a.get(n.id),d=a.get(i),g=d?s.get(d.id):null,R=d?.node.current;if(R&&g&&l&&d){const h=Ie(R).some((I,N)=>c[N]!==I),w=Q(l,d),x=Me(l,d),m=h||!w?{x:0,y:0}:{x:x?r.width-g.width:0,y:x?r.height-g.height:0},b={x:g.left,y:g.top};return m.x&&m.y?b:ye(b,m)}}}};function Q(e,t){return!k(e)||!k(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Me(e,t){return!k(e)||!k(t)||!Q(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}export{_e as S,q as a,B as r,Fe as s,je as u,Xe as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as A,a4 as B,r as v,j as e,n as x,hd as k,fT as E,fU as y,fV as a,hL as D,B as m,I as d,aS as z,aR as T,aO as O,aM as R,aQ as F,aP as M,bl as U,C,t as c,c as q}from"./index-
|
|
1
|
+
import{b as A,a4 as B,r as v,j as e,n as x,hd as k,fT as E,fU as y,fV as a,hL as D,B as m,I as d,aS as z,aR as T,aO as O,aM as R,aQ as F,aP as M,bl as U,C,t as c,c as q}from"./index-C5hxtG-B.js";import{D as $}from"./domain-settings-CA0QhXOB.js";import{S as H}from"./switch-BI5z5Ju7.js";import{a as Q,b as V,c as G,d as J}from"./use-org-sso-COqujkwo.js";import{s as K}from"./Trash01-DuRmK_Vz.js";import{R as W}from"./require-capability-B54JdYhJ.js";import"./badge-DlHCn1A-.js";import"./select-B8yvCqU-.js";import"./index-BdQq_4o_.js";import"./index-xUcGx-v6.js";import"./ChevronUp-B_2ftJO2.js";import"./access-gate-emovLjaE.js";import"./capability-load-error-ByfliPkI.js";function X(){const s=A(),{org:o}=B(),{data:h,isLoading:P}=Q(o.id,o.slug),f=V(o.id,o.slug),S=G(o.id,o.slug),b=J(o.id,o.slug),[i,l]=v.useState({issuer:"",clientId:"",clientSecret:"",discoveryEndpoint:"",domain:"",scopes:"openid email profile"}),[g,p]=v.useState(!1),[I,j]=v.useState(!1),u=h?.configured&&h.config,n=h?.config,_=()=>{n&&l({issuer:n.issuer,clientId:n.clientId,clientSecret:"",discoveryEndpoint:n.discoveryEndpoint??"",domain:n.domain,scopes:n.scopes.join(" ")}),p(!0)},w=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"))}},L=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"))}},N=async t=>{try{await b.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($,{}),P?e.jsx("div",{className:"text-sm text-muted-foreground",children:s("settings.orgSso.loading")}):e.jsxs(e.Fragment,{children:[u&&!g&&e.jsx(E,{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(H,{checked:n.enforced,onCheckedChange:N,disabled:b.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(K,{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:_,children:s("settings.orgSso.editConfigButton")})]})]})}),(!u||g)&&e.jsx(E,{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(d,{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(d,{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:g&&u?s("settings.orgSso.clientSecretEditDescription"):void 0,action:e.jsx(d,{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(d,{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(d,{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(d,{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:[g&&e.jsx(m,{variant:"outline",size:"sm",onClick:()=>p(!1),children:s("settings.orgSso.cancelButton")}),e.jsx(m,{onClick:w,disabled:f.isPending,size:"sm",children:f.isPending?s("settings.orgSso.savingButton"):s(g?"settings.orgSso.updateButton":"settings.orgSso.configureSsoButton")})]})]})})]})]})})}),e.jsx(z,{open:I,onOpenChange:j,children:e.jsxs(T,{children:[e.jsx(O,{children:e.jsx(R,{children:s("settings.orgSso.removeConfirmation")})}),e.jsxs(F,{children:[e.jsx(M,{disabled:S.isPending,children:s("settings.orgSso.cancelButton")}),e.jsx(U,{onClick:L,disabled:S.isPending,variant:"destructive",children:s("settings.orgSso.removeButton")})]})]})})]})}function ge(){const s=q.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{ge as default};
|