decocms 4.515.1 → 4.517.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-CHmxGMIj.js → ActiveShapeUtils-BB436TvV.js} +1 -1
- package/dist/client/assets/{AlertCircle-CUAx3A4b.js → AlertCircle-Cch634f7.js} +1 -1
- package/dist/client/assets/{AreaChart-CW0Iiw9b.js → AreaChart-CpsihjcZ.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BWCsylYe.js → ArrowLeft-CohopnCT.js} +1 -1
- package/dist/client/assets/{ArrowUp-EL0FBv9C.js → ArrowUp-DLUdomd9.js} +1 -1
- package/dist/client/assets/{BarChart-7G_lP-bc.js → BarChart-DC5-aC-9.js} +1 -1
- package/dist/client/assets/{Building02-PifDTlhb.js → Building02-BHJQSDUK.js} +1 -1
- package/dist/client/assets/{CartesianChart-CQlacwEw.js → CartesianChart-dMOiAgfo.js} +1 -1
- package/dist/client/assets/{CategoricalChart-QwBn7EzX.js → CategoricalChart-BCAB1JR1.js} +3 -3
- package/dist/client/assets/{CheckCircle-CMGqXocs.js → CheckCircle-Cs8i9zYt.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BSRBjpBn.js → ChevronSelectorVertical-C5d75KyY.js} +1 -1
- package/dist/client/assets/{ChevronUp-x46FJEcD.js → ChevronUp-BT7eMKPK.js} +1 -1
- package/dist/client/assets/{Copy01-OBSYmimV.js → Copy01-B341DqLV.js} +1 -1
- package/dist/client/assets/{CreditCard01-DWsSThAm.js → CreditCard01-4Fwr0tNh.js} +1 -1
- package/dist/client/assets/{DotsVertical-jkvtcdek.js → DotsVertical-DbrlDgFh.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-MNRbBKZp.js → ErrorBarContext-t45nElJh.js} +1 -1
- package/dist/client/assets/{Globe04-blkS_Kfg.js → Globe04-BE6c1UDj.js} +1 -1
- package/dist/client/assets/{Image01-BCnLFq1D.js → Image01-hTzc15CE.js} +1 -1
- package/dist/client/assets/{Key01-CG7Kua6O.js → Key01-kTu6t6u_.js} +1 -1
- package/dist/client/assets/{Link01-8aKNfNRw.js → Link01-hfA48cFL.js} +1 -1
- package/dist/client/assets/{LinkBroken01-DcsqjBuj.js → LinkBroken01-Dioz3u9i.js} +1 -1
- package/dist/client/assets/{Minus-B38cW2ZC.js → Minus-DqDPTtRG.js} +1 -1
- package/dist/client/assets/{Monitor01-DQEkUL3d.js → Monitor01-Bz6QaUO4.js} +1 -1
- package/dist/client/assets/{Play-Ns9aRVTY.js → Play-CByslM3d.js} +1 -1
- package/dist/client/assets/{Plus-vkM1FxVr.js → Plus-Dewm72je.js} +1 -1
- package/dist/client/assets/ReferenceLine-DV9hYxt_.js +1 -0
- package/dist/client/assets/{SearchMd-Cp6J-1Iu.js → SearchMd-7Jo0ZofC.js} +1 -1
- package/dist/client/assets/{Sector-BeXkYaJv.js → Sector-D64VY8hG.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-aJuRSlBz.js → ShoppingBag01-BStpgW0a.js} +1 -1
- package/dist/client/assets/{Sun-k4hypx5Q.js → Sun-C37Hpdko.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-B5WFt7_0.js → SwitchHorizontal01-CrC4ThKg.js} +1 -1
- package/dist/client/assets/{Tool01-BsK9c3-e.js → Tool01-2gJDR0Ho.js} +1 -1
- package/dist/client/assets/{Trash01-Z1ezoy3S.js → Trash01-DjE7Raat.js} +1 -1
- package/dist/client/assets/{Upload01-B3-nlnKa.js → Upload01-CYfTR3aZ.js} +1 -1
- package/dist/client/assets/{User01-C2Sw39bs.js → User01-X6IeKYZH.js} +1 -1
- package/dist/client/assets/{UserSquare-BBEl_BxL.js → UserSquare-pmxb5ZdZ.js} +1 -1
- package/dist/client/assets/{Users01-DMFeioyM.js → Users01-uKJoVSle.js} +1 -1
- package/dist/client/assets/{XClose-BdwIxxCT.js → XClose-BVxVAZ6V.js} +1 -1
- package/dist/client/assets/{ZoomOut-DytgoG2i.js → ZoomOut-DixQygt2.js} +1 -1
- package/dist/client/assets/{access-gate-BUnHIPK_.js → access-gate-BpfEc6VH.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-F6QQAEZv.js → add-connection-dialog-BZwLO1Ja.js} +1 -1
- package/dist/client/assets/agent-analytics-Cb2tda3-.js +1 -0
- package/dist/client/assets/agent-app-HX00w6TV.js +1 -0
- package/dist/client/assets/agent-assets-e6Gk5J-Q.js +1 -0
- package/dist/client/assets/{agent-automation-CKRFKK95.js → agent-automation-jGwXvC8f.js} +1 -1
- package/dist/client/assets/{agent-automations-CoXmwt9k.js → agent-automations-DzW1crP1.js} +1 -1
- package/dist/client/assets/agent-calendar-DCHNIRTc.js +1 -0
- package/dist/client/assets/{agent-connect-sources-B_bS144d.js → agent-connect-sources-6bCKMOK5.js} +1 -1
- package/dist/client/assets/agent-deck-BV-5B8og.js +1 -0
- package/dist/client/assets/{agent-e2e-DC8ADnZZ.js → agent-e2e-DwASXEee.js} +1 -1
- package/dist/client/assets/agent-experiments-DetDutY3.js +1 -0
- package/dist/client/assets/agent-file-BvfhZ3mT.js +1 -0
- package/dist/client/assets/{agent-hosting-Tr8uV5DY.js → agent-hosting-BVT3wdCc.js} +1 -1
- package/dist/client/assets/{agent-icon--EtIPqub.js → agent-icon-CiKTiUdq.js} +1 -1
- package/dist/client/assets/agent-library-DSuyqe6T.js +1 -0
- package/dist/client/assets/agent-library-file-B1l2ZLvA.js +1 -0
- package/dist/client/assets/agent-monitor-C_MtaF0x.js +1 -0
- package/dist/client/assets/agent-overview-BaJQVLzH.js +1 -0
- package/dist/client/assets/agent-releases-rSbadgkl.js +2 -0
- package/dist/client/assets/agent-settings-DCjo4ZYC.js +1 -0
- package/dist/client/assets/{agent-site-editor-BML41A1E.js → agent-site-editor-DGIssniL.js} +2 -2
- package/dist/client/assets/agent-site-editor-code-BVwfCzHc.js +2 -0
- package/dist/client/assets/agent-site-editor-content-BU-vFmu-.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-Coo-Ni4u.js +1 -0
- package/dist/client/assets/agent-view-CftHb5tC.js +1 -0
- package/dist/client/assets/{agent-view-guard-BuPewEB-.js → agent-view-guard-Cz_9FSeB.js} +1 -1
- package/dist/client/assets/{agents-list-BxOpJ6GX.js → agents-list-BehVRlw8.js} +1 -1
- package/dist/client/assets/{ai-providers-BgJW78yt.js → ai-providers-Cfzh0dop.js} +1 -1
- package/dist/client/assets/{alert-BDbwlXZm.js → alert-DlpN1nbO.js} +1 -1
- package/dist/client/assets/{alert-dialog-C-DaggA1.js → alert-dialog-BdWXpnme.js} +1 -1
- package/dist/client/assets/{analytics-sections-i9-JccxC.js → analytics-sections-CBRurMfi.js} +1 -1
- package/dist/client/assets/analytics-tab-Bu3yOSFE.js +2 -0
- package/dist/client/assets/{api-keys-CsGvnzMj.js → api-keys-SwcfBYZn.js} +1 -1
- package/dist/client/assets/api-keys-jGYtI-cW.js +1 -0
- package/dist/client/assets/app-editor-BzaLO82-.js +1 -0
- package/dist/client/assets/{asset-utils-Cb8p2lKk.js → asset-utils-CYj7sEud.js} +1 -1
- package/dist/client/assets/{auth-C_nDagDA.js → auth-DVebpHI3.js} +1 -1
- package/dist/client/assets/{auth-catchall-DLKOtnms.js → auth-catchall-CM988zgH.js} +1 -1
- package/dist/client/assets/{auth-entry-CGuqEb3C.js → auth-entry-BM6bA3ji.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CA_lMCib.js → auth-split-layout-BnlVBIeL.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CpcQdSQ-.js → authenticate-and-persist-oauth-qcbNyaRp.js} +1 -1
- package/dist/client/assets/{automation-list-row-B0U8Omed.js → automation-list-row-BIlvc0v-.js} +1 -1
- package/dist/client/assets/{automation-runs-CHS-S7AU.js → automation-runs-jRApvuta.js} +1 -1
- package/dist/client/assets/{automations-BMiuIrti.js → automations-DMHgje9o.js} +1 -1
- package/dist/client/assets/{autosend-xoWUmECR.js → autosend-BTx7-p6a.js} +1 -1
- package/dist/client/assets/{avatar-DHKJiyOX.js → avatar-DjIkOwsx.js} +1 -1
- package/dist/client/assets/{badge-ux-RK1YK.js → badge-BfMggcm8.js} +1 -1
- package/dist/client/assets/{block-document-C53UA67Y.js → block-document-DKju3Lsl.js} +3 -3
- package/dist/client/assets/{blocks-preview-workspace-context-CCLLqfhM.js → blocks-preview-workspace-context-AokvrTWO.js} +1 -1
- package/dist/client/assets/blocks-tab-states-5tpSikld.js +1 -0
- package/dist/client/assets/{blog-schema-CUXWCb3x.js → blog-schema-B8hGgOKc.js} +1 -1
- package/dist/client/assets/{buckets-KXy-OHx-.js → buckets-DzW1ArnB.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-7EW1ZAui.js → build-improve-prompt-doc-BGKe2ED3.js} +1 -1
- package/dist/client/assets/{calendar-qN6CeKGa.js → calendar-kdikRXDO.js} +1 -1
- package/dist/client/assets/campaigns-view-CXUV2H04.js +1 -0
- package/dist/client/assets/{capability-load-error-CoMXa4ni.js → capability-load-error-BuC7MxXm.js} +1 -1
- package/dist/client/assets/category-editor-jRguVRoH.js +1 -0
- package/dist/client/assets/{chart-86pPxb3F.js → chart-aHPEwhl0.js} +1 -1
- package/dist/client/assets/{chat-context-DXm8btNS.js → chat-context-BEyCIAaN.js} +2 -2
- package/dist/client/assets/{chat-draft-WGnppXw7.js → chat-draft-Dql_zG1A.js} +1 -1
- package/dist/client/assets/{checkbox-vFQy8MvV.js → checkbox-R6Pm_B33.js} +1 -1
- package/dist/client/assets/{choose-editor-Bry8-aop.js → choose-editor-C1zV1Fp9.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BM0cUkz3.js → cli-auth-success-Dw0y5N0L.js} +1 -1
- package/dist/client/assets/{client-icons-M2pakr5u.js → client-icons-C_WiAP0u.js} +1 -1
- package/dist/client/assets/cms-settings-editor-BAGntXvx.js +1 -0
- package/dist/client/assets/{collapsible-CnlVGt-G.js → collapsible-BcZaehP2.js} +1 -1
- package/dist/client/assets/{collection-detail-B_r2Oxl1.js → collection-detail-AO17C_8B.js} +1 -1
- package/dist/client/assets/{collection-display-button-ALXFDy_R.js → collection-display-button-C0cYhq66.js} +1 -1
- package/dist/client/assets/{collection-search--9d0M5sc.js → collection-search-7sBPioRN.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DyQ4WIpY.js → collection-table-wrapper-BzgZq6u7.js} +1 -1
- package/dist/client/assets/{collection-tabs-BfpnVdlQ.js → collection-tabs-DMsbicTn.js} +1 -1
- package/dist/client/assets/{column-rules-DgVqSNU2.js → column-rules-CBkHBJjn.js} +1 -1
- package/dist/client/assets/{combobox-BMxhMbUn.js → combobox-CEzxugDA.js} +1 -1
- package/dist/client/assets/{command-BlBQgQPI.js → command-KmLWWmqo.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-B3EkkVtL.js → companion-mcps-section-vJ3FRpYP.js} +1 -1
- package/dist/client/assets/{config-CE3I8pu5.js → config-0t8v4_10.js} +1 -1
- package/dist/client/assets/{connect-C4NhmEFJ.js → connect-Ceo_a42v.js} +1 -1
- package/dist/client/assets/{connect-layout-DZGJCEON.js → connect-layout-DXn91Bwy.js} +1 -1
- package/dist/client/assets/connect-source-dialog-DCA13Vr9.js +1 -0
- package/dist/client/assets/{connection-Bo3v2rj5.js → connection-BXCm7RUN.js} +1 -1
- package/dist/client/assets/{connection-card-DMfcnulT.js → connection-card-DudSxk_f.js} +1 -1
- package/dist/client/assets/{connection-detail-DxSeFIwH.js → connection-detail-Bzj7ZAYC.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-A3QfJozi.js → connection-form-helpers-BCgvOrMH.js} +1 -1
- package/dist/client/assets/{connections-DzbvhEpV.js → connections-DZsQ6PqI.js} +1 -1
- package/dist/client/assets/{content-tab-CaoAhPSw.js → content-tab-B8CAyeYn.js} +8 -8
- package/dist/client/assets/context-Dxx9Nppi.js +1 -0
- package/dist/client/assets/{context-menu-BD833dh0.js → context-menu-Bup14w-O.js} +1 -1
- package/dist/client/assets/{context-shell-D1uT0vY1.js → context-shell-YuMc6M7u.js} +3 -3
- package/dist/client/assets/{core.esm-DJ5llHMe.js → core.esm-BmE_KURk.js} +2 -2
- package/dist/client/assets/{create-organization-dialog-nhhaUNZK.js → create-organization-dialog-oYjru5bh.js} +1 -1
- package/dist/client/assets/{daily-pulse-Cry9rVi8.js → daily-pulse-Cj6zflmn.js} +1 -1
- package/dist/client/assets/{discover-C4Up8V0-.js → discover-BsfuhgQD.js} +1 -1
- package/dist/client/assets/{domain-settings-Bec9kB9d.js → domain-settings-BCFlmNLU.js} +1 -1
- package/dist/client/assets/{drawer-0sYDH2mt.js → drawer-Bi1-udV5.js} +1 -1
- package/dist/client/assets/{editor-BctLuJLS.js → editor-DAekV0he.js} +1 -1
- package/dist/client/assets/{editor-classes-BnPaf--r.js → editor-classes-BaBC2QPU.js} +1 -1
- package/dist/client/assets/{empty-state-D6RWdvUz.js → empty-state-B4dSQMeM.js} +1 -1
- package/dist/client/assets/{empty-state-DeArX05X.js → empty-state-wXIjf_EN.js} +1 -1
- package/dist/client/assets/experiments-tab-PntzDOfu.js +1 -0
- package/dist/client/assets/{experiments-tab-choice-CMHPX5ZC.js → experiments-tab-choice-CQ5EsK8h.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CBAyhzk-.js → extract-connection-data-Bg9K46Rs.js} +1 -1
- package/dist/client/assets/{feature-gate-DQ0ZaDj1.js → feature-gate-4u7sb4lR.js} +1 -1
- package/dist/client/assets/{feature-paywall-hsFyGLR_.js → feature-paywall-BsVH1P4Z.js} +1 -1
- package/dist/client/assets/{file-explorer-GrzeifA-.js → file-explorer-CsBngoR2.js} +1 -1
- package/dist/client/assets/{file-preview-Bcawxb03.js → file-preview-CVVpAx14.js} +1 -1
- package/dist/client/assets/{file-share-button-LmGmSS33.js → file-share-button-Dh2OblA7.js} +1 -1
- package/dist/client/assets/{file-type-icon-DHFVwXjA.js → file-type-icon-DYeFNgMs.js} +1 -1
- package/dist/client/assets/{folder-icon-BwmfzM1C.js → folder-icon-CMfbCZZj.js} +1 -1
- package/dist/client/assets/{form-D4PspedZ.js → form-BGI3x6he.js} +1 -1
- package/dist/client/assets/{general-CXfgWejD.js → general-AgdwRV2K.js} +1 -1
- package/dist/client/assets/home-B3JLIiqG.js +1 -0
- package/dist/client/assets/hosted-publish-api-Cg6A3e6a.js +1 -0
- package/dist/client/assets/hosted-publish-feedback-R86hK4rw.js +1 -0
- package/dist/client/assets/{icon-button-HZwQKD3a.js → icon-button-Du_O8eku.js} +1 -1
- package/dist/client/assets/{index-Bxkd37dZ.js → index-BEaGR-Ng.js} +1 -1
- package/dist/client/assets/{index-XzZeDzj0.js → index-BWEksKOa.js} +1 -1
- package/dist/client/assets/{index-CgVQmSg0.js → index-BXwVgYyP.js} +1 -1
- package/dist/client/assets/{index-ifZGovK1.js → index-BeWb3VLq.js} +52 -52
- package/dist/client/assets/{index-D_6gfRTQ.js → index-BflgjdLH.js} +1 -1
- package/dist/client/assets/{index-BCHFFeZZ.js → index-BliYmmPu.js} +1 -1
- package/dist/client/assets/{index-B32YFtAw.js → index-BnbMIYQC.js} +1 -1
- package/dist/client/assets/index-CEnumkKh.js +1 -0
- package/dist/client/assets/{index-BeV3dEoK.js → index-CcDpskhn.js} +2 -2
- package/dist/client/assets/{index-DNa7Epd0.js → index-CdhgpKbn.js} +1 -1
- package/dist/client/assets/{index-CafY8AgN.js → index-CkwxAoM4.js} +1 -1
- package/dist/client/assets/{index-DgfcOEet.js → index-CqX2WR0x.js} +1 -1
- package/dist/client/assets/{index-BjrJaWD9.js → index-CqllmV-p.js} +1 -1
- package/dist/client/assets/{index-gqp4B5qj.js → index-DVxNOEMj.js} +1 -1
- package/dist/client/assets/index-DjdMnw7p.css +1 -0
- package/dist/client/assets/{index-CvMuyNgv.js → index-Dw3D39xs.js} +1 -1
- package/dist/client/assets/{index-redirect-BKvfBlvA.js → index-redirect-BpERt5XK.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DvmMaiCa.js → infiniteQueryObserver-BOCgDRcQ.js} +1 -1
- package/dist/client/assets/{infra-billing-WLIR9CQb.js → infra-billing-443Q4BKf.js} +1 -1
- package/dist/client/assets/input-D1nDj3Gx.js +17 -0
- package/dist/client/assets/{input-BeDIlaby.js → input-D9vH1igB.js} +1 -1
- package/dist/client/assets/{integration-icon-D1aQLe0v.js → integration-icon-VoZokpOe.js} +1 -1
- package/dist/client/assets/{jira-icon-Bs7EGbwb.js → jira-icon-BOD4UX3O.js} +1 -1
- package/dist/client/assets/{label-Dhoh3DcI.js → label-TKhfC6jr.js} +1 -1
- package/dist/client/assets/{layout-dz9-bhT2.js → layout-OvvfNrHJ.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DO-8kywe.js → legacy-agents-deep-Bj2cFPCz.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BMyuR4az.js → legacy-main-redirect-Y-IABTgs.js} +1 -1
- package/dist/client/assets/library-CEpc5ko6.js +1 -0
- package/dist/client/assets/{login-DwOQDvQC.js → login-d1G00P7v.js} +1 -1
- package/dist/client/assets/{markdown-prFeEkT4.js → markdown-D_Bab0vD.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-fHjuxWIZ.js → mcp-app-renderer-C5DYTOzS.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CTJ5Iw4i.js → mcp-oauth-Bv0ymH6e.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CNKUkWMd.js → mcp-oauth-gJmjFND6.js} +1 -1
- package/dist/client/assets/{members-B9Wn7yAF.js → members-CGCmgk2j.js} +1 -1
- package/dist/client/assets/{memory-BDb7_tyh.js → memory-DjHNNPOW.js} +1 -1
- package/dist/client/assets/{mini-report-page-Bsjfan82.js → mini-report-page-BSYlfSmZ.js} +1 -1
- package/dist/client/assets/{mock-board-BWfjyR2S.js → mock-board-BCQJ9AHq.js} +3 -3
- package/dist/client/assets/{monaco-editor-Wx_2qGOP.js → monaco-editor-CVRVgXSh.js} +1 -1
- package/dist/client/assets/monitor-v8-CHgzPfyd.js +1 -0
- package/dist/client/assets/monitoring-mogv5pNr.js +1 -0
- package/dist/client/assets/{monitoring-stats-row-THiAXYTp.js → monitoring-stats-row-BEpenrU2.js} +1 -1
- package/dist/client/assets/{multi-select-DOxlfIKk.js → multi-select-ZwwArowo.js} +1 -1
- package/dist/client/assets/{mustache-BzHjgnm5.js → mustache-B20fDMb8.js} +1 -1
- package/dist/client/assets/named-rule-uses-Bxr3PCeC.js +1 -0
- package/dist/client/assets/named-rule-view-pF5yBmDb.js +1 -0
- package/dist/client/assets/{new-project-dialog-DFsG79bb.js → new-project-dialog-DfI138Mw.js} +1 -1
- package/dist/client/assets/{oauth-callback-BekJkoCF.js → oauth-callback-C0l4AVA-.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-FtcHAH0j.js → oauth-callback-ai-provider-DlpJWGZf.js} +1 -1
- package/dist/client/assets/{onboarding-DNskGrdg.js → onboarding-DMkG4-4M.js} +1 -1
- package/dist/client/assets/openai-conversation-BcQvnIOU.js +3 -0
- package/dist/client/assets/{optimistic-project-sidebar-views-CrYamEqL.js → optimistic-project-sidebar-views-CBzXyVUz.js} +1 -1
- package/dist/client/assets/order-monitor-day-raWLiT1v.js +1 -0
- package/dist/client/assets/{organization-choice-zGI39_sg.js → organization-choice-CSBUJWem.js} +1 -1
- package/dist/client/assets/{orgs-BjIQy8J3.js → orgs-DYr5Iir2.js} +1 -1
- package/dist/client/assets/{page-seo-form-CrgZFHtq.js → page-seo-form-C0_Mzxj0.js} +1 -1
- package/dist/client/assets/{pair-Ck7rgrik.js → pair-v8_ULhan.js} +7 -7
- package/dist/client/assets/parse-sections-CigeyiXV.js +1 -0
- package/dist/client/assets/plan-BYiUi2-G.js +1 -0
- package/dist/client/assets/{plan-ladder-BKLU8eo8.js → plan-ladder-CtR99jrd.js} +1 -1
- package/dist/client/assets/{popover-DaReiQzV.js → popover-s88DXvPL.js} +1 -1
- package/dist/client/assets/post-calendar-DbUDJn5r.js +1 -0
- package/dist/client/assets/{post-editor-CRy0VAcT.js → post-editor-CdhtoksR.js} +2 -2
- package/dist/client/assets/{preview-content-DJOuEciL.js → preview-content-BNZ95rhM.js} +1 -1
- package/dist/client/assets/{preview-dialog-CnlKftcv.js → preview-dialog-BZcvH5f1.js} +1 -1
- package/dist/client/assets/{preview-panel-C2Athpf5.js → preview-panel-CjWzxG-O.js} +1 -1
- package/dist/client/assets/{preview-tab-CzS9kIxI.js → preview-tab-ztwq5J9Z.js} +4 -4
- package/dist/client/assets/product-picker-dialog-CecFCJox.js +1 -0
- package/dist/client/assets/{profile-DAF3l5cg.js → profile-Bo384oXV.js} +1 -1
- package/dist/client/assets/project-app-view-C-JC6Lnp.js +1 -0
- package/dist/client/assets/{project-apps-CG2eY1ZZ.js → project-apps-BQ30Q_BX.js} +1 -1
- package/dist/client/assets/{project-feed-K24c6-Xx.js → project-feed--d7Txdh1.js} +1 -1
- package/dist/client/assets/{project-icon-ZadU5ZjL.js → project-icon-Ds8VtVRG.js} +1 -1
- package/dist/client/assets/project-reports-BRMk8sbv.js +1 -0
- package/dist/client/assets/project-tasks-DPFfk-Co.js +1 -0
- package/dist/client/assets/{projects-BWrIdbSy.js → projects-BN_UNvg1.js} +1 -1
- package/dist/client/assets/{projects-empty-state-BWAilN1f.js → projects-empty-state-CmS_yrG7.js} +1 -1
- package/dist/client/assets/{prompts-DKnoRB34.js → prompts-g_Bby1s0.js} +1 -1
- package/dist/client/assets/record-editor-CmI7uwKH.js +1 -0
- package/dist/client/assets/redirect-editor-CBEbRvVY.js +1 -0
- package/dist/client/assets/releases-api-DbKlRR9w.js +1 -0
- package/dist/client/assets/reports-BKtNuFy0.js +1 -0
- package/dist/client/assets/{reports-Bg1fi6kR.js → reports-Bgmc-lqT.js} +1 -1
- package/dist/client/assets/{reports-onboarding-acV5ZZpQ.js → reports-onboarding-D6-A2sL7.js} +1 -1
- package/dist/client/assets/reports-tab-B_Sk2TLl.js +2 -0
- package/dist/client/assets/repositories-C2vwcNjc.js +1 -0
- package/dist/client/assets/repositories-CszhODTX.js +1 -0
- package/dist/client/assets/{repository-binding-DtIeSvDY.js → repository-binding-Cf_thK-b.js} +1 -1
- package/dist/client/assets/{repository-import-picker-C2sQ94O1.js → repository-import-picker-BOku3VrR.js} +1 -1
- package/dist/client/assets/repository-picker-CeCsQGv8.js +1 -0
- package/dist/client/assets/{require-capability-DAfCGgHW.js → require-capability-DC_q9Xad.js} +1 -1
- package/dist/client/assets/{required-auth-layout-4jyUcmCy.js → required-auth-layout-DhxdstQv.js} +1 -1
- package/dist/client/assets/{reset-password-BGjvzv1z.js → reset-password-BCS7WVZ6.js} +1 -1
- package/dist/client/assets/{resizable-CQyxQjcn.js → resizable-BySAwPSW.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-56O81FJc.js → resolve-tab-icon-B7CsMGsC.js} +1 -1
- package/dist/client/assets/{review-settings-CWih3HF4.js → review-settings-DtZi6zHg.js} +1 -1
- package/dist/client/assets/{roles-BRkp9ar3.js → roles-CGYNn4dv.js} +1 -1
- package/dist/client/assets/route-ChD1cXkH.js +1 -0
- package/dist/client/assets/route-ChLLCXC9.js +1 -0
- package/dist/client/assets/route-_su_B2um.js +1 -0
- package/dist/client/assets/{runnable-block-editor-CqYgijVY.js → runnable-block-editor-Bod17qTV.js} +7 -7
- package/dist/client/assets/sandbox-lifecycle-context-CCjKxqdS.js +1 -0
- package/dist/client/assets/{schema-Dvc5tPTN.js → schema-ClGCzPdy.js} +1 -1
- package/dist/client/assets/{schema-Cn4x5iT-.js → schema-b5uziS6S.js} +1 -1
- package/dist/client/assets/{scroll-area-9wUBmncr.js → scroll-area-BVZXqx5M.js} +1 -1
- package/dist/client/assets/{search-input-1DLvCYgl.js → search-input-BL6XGlmm.js} +1 -1
- package/dist/client/assets/{search-toggle-BnK2KHqJ.js → search-toggle-IRNGzCzn.js} +1 -1
- package/dist/client/assets/secret-ciphertext-CKG2rzpX.js +1 -0
- package/dist/client/assets/{secret-picker-B4zI9e3W.js → secret-picker-NNIqKwTx.js} +1 -1
- package/dist/client/assets/{secrets-C2PS9_a9.js → secrets-BLs8g0Qc.js} +1 -1
- package/dist/client/assets/{sections-DX6pY_bs.js → sections-Dw8sSpTv.js} +1 -1
- package/dist/client/assets/sections-editor-IbsR8YsO.js +4 -0
- package/dist/client/assets/{select-DUEGSJco.js → select-H4FJk0rp.js} +1 -1
- package/dist/client/assets/{select-model-mFyCcf-O.js → select-model-VSltfcKe.js} +1 -1
- package/dist/client/assets/seo-editor-DJxK0wxd.js +1 -0
- package/dist/client/assets/{separator-Bk_a4cod.js → separator-l8ktDBQ-.js} +1 -1
- package/dist/client/assets/settings-tab-D08h17sS.js +1 -0
- package/dist/client/assets/{sheet-Dhe0uPV2.js → sheet-DdrzSnyB.js} +1 -1
- package/dist/client/assets/{shell-layout-U7D4A6nk.js → shell-layout-Dpds4_um.js} +1 -1
- package/dist/client/assets/{site-draft-actions-Dpnw67Ug.js → site-draft-actions-B1VIigls.js} +6 -6
- package/dist/client/assets/site-draft-view-BvQXujRd.js +2 -0
- package/dist/client/assets/site-editor-B8qpeTpl.js +1 -0
- package/dist/client/assets/site-editor-toast-C48kJZ8y.js +1 -0
- package/dist/client/assets/{skills-DghKPwKw.js → skills-F7XSMMWV.js} +1 -1
- package/dist/client/assets/{slider-CLUaEqdg.js → slider-tSRa1HDF.js} +1 -1
- package/dist/client/assets/{sortable.esm-CkqHW6-y.js → sortable.esm-CE2eXOQU.js} +1 -1
- package/dist/client/assets/{sso-DGFWPeza.js → sso-B_KsCvoW.js} +1 -1
- package/dist/client/assets/{suggestion-BNEVVm5c.js → suggestion-Bu3BweEe.js} +1 -1
- package/dist/client/assets/{switch-ByCU93P4.js → switch-BI2l0q9a.js} +1 -1
- package/dist/client/assets/{symbol-BQLM2_V8.js → symbol-CW0bfPL3.js} +1 -1
- package/dist/client/assets/{synced-repos-CjPrTUpI.js → synced-repos-BXQtYjtL.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-Cz_BoFAU.js → tab-icon-glyph-B_hAV_wB.js} +1 -1
- package/dist/client/assets/{table-Tw2gCVXe.js → table-BI-3H0Nx.js} +1 -1
- package/dist/client/assets/{tabs-C7f3nqQx.js → tabs-Cw5epDK7.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-BiPanmNM.js → task-assignee-avatar-B4jYRjC8.js} +1 -1
- package/dist/client/assets/{task-board-BrTYr-oE.js → task-board-ByNQwZsl.js} +1 -1
- package/dist/client/assets/{task-route-BLP-DBaS.js → task-route-B8oSJFnj.js} +1 -1
- package/dist/client/assets/{task-status-CVpsP3bD.js → task-status-GAY2L2Vz.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-CQMw4wzL.js → taskboard-analytics-MtxZahkF.js} +1 -1
- package/dist/client/assets/{tasks-CtPgnGlW.js → tasks-CaRFrr2H.js} +1 -1
- package/dist/client/assets/tasks-Zus8qgLK.js +1 -0
- package/dist/client/assets/{textarea-Bbbnnl4r.js → textarea-7I-DLD6x.js} +1 -1
- package/dist/client/assets/{thread-analytics-CtQHMk9N.js → thread-analytics-BhyMnytl.js} +1 -1
- package/dist/client/assets/{thread-intent-7GmQH5mt.js → thread-intent-CoB1rbzj.js} +2 -2
- package/dist/client/assets/{thread-route-C7RSGMhP.js → thread-route-BPSSuk8V.js} +1 -1
- package/dist/client/assets/{thread-route-DpLeB4i0.js → thread-route-Bjcqwe4C.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-dWggSd-b.js → thread-sheet-body-DyDxpawL.js} +1 -1
- package/dist/client/assets/{time-range-picker-BVXe-Owx.js → time-range-picker-DJ-TaM2M.js} +1 -1
- package/dist/client/assets/{toggle-group-CXUKmPFr.js → toggle-group-BngkTNsG.js} +1 -1
- package/dist/client/assets/{tool-namespace-DIE_8J9o.js → tool-namespace-DePiqr-m.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DzJeqLa2.js → toolbar-icon-button-DKjsnGdZ.js} +1 -1
- package/dist/client/assets/{tooltip-gMeEuHtO.js → tooltip-4vv5k-uR.js} +1 -1
- package/dist/client/assets/{tooltipContext-BQS7kWxi.js → tooltipContext-B3bWUtmi.js} +1 -1
- package/dist/client/assets/{track-DdeuRUoM.js → track-C0wfSYRO.js} +1 -1
- package/dist/client/assets/{types-CHFSNT7a.js → types-CNU-uWw-.js} +1 -1
- package/dist/client/assets/{url-slug-D37s8EDd.js → url-slug-DU3tFMUC.js} +1 -1
- package/dist/client/assets/{usage-stats-BecGIkLk.js → usage-stats-CKpL0uWf.js} +2 -2
- package/dist/client/assets/{use-ai-providers-CAt_9H4n.js → use-ai-providers-Ct47MIru.js} +1 -1
- package/dist/client/assets/use-apply-named-rule-R20A_NaL.js +1 -0
- package/dist/client/assets/{use-automations-C6LbyvJD.js → use-automations-Ho0ayZT_.js} +1 -1
- package/dist/client/assets/{use-autosave-e9CI9oFB.js → use-autosave-DzNsVsl3.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-24wCHq_-.js → use-chat-layout-state-CWI-mwQI.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DflKMAWl.js → use-clock-tick-DE4s8Okz.js} +1 -1
- package/dist/client/assets/{use-connect-companion-3OWtftC8.js → use-connect-companion-Dmdscsai.js} +1 -1
- package/dist/client/assets/{use-connection-CBKH8IwL.js → use-connection-HenJjVMr.js} +1 -1
- package/dist/client/assets/use-content-sync-C0CqYtRD.js +1 -0
- package/dist/client/assets/{use-copy-Cn8Org7G.js → use-copy-C4LbXPXl.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-jW1iVRi_.js → use-create-virtual-mcp-dBeQ8KM_.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-DTRxIyi4.js → use-date-fns-locale-DBqQ9Xwt.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DDaoW-uw.js → use-debounced-autosave-B_kpX8YN.js} +1 -1
- package/dist/client/assets/{use-debounced-value-c5JdkW89.js → use-debounced-value-Br6JzfN-.js} +1 -1
- package/dist/client/assets/{use-deco-credits-D8w-JIDW.js → use-deco-credits-DhL8Ql0T.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Cp8NaBPU.js → use-decopilot-events-CuBncVze.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BJIObh7l.js → use-delete-connection-DuErB0IF.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-D7XKR1Dx.js → use-deployment-admin-BOXhbvir.js} +1 -1
- package/dist/client/assets/use-fast-preview-draft-url-BPrZ2XMf.js +1 -0
- package/dist/client/assets/{use-file-configs-DW0hmZjE.js → use-file-configs-B_k4AoEo.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-DOpe-XBh.js → use-inbox-feed-D96kN3Ph.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Cuyf7850.js → use-infinite-scroll-Ba0Xf9MO.js} +1 -1
- package/dist/client/assets/{use-join-requests-CBahVlKF.js → use-join-requests-DNpCy_xv.js} +1 -1
- package/dist/client/assets/use-main-panel-tabs-BndsHuRH.js +1 -0
- package/dist/client/assets/{use-mcp-auth-status-Cs8ZHHaN.js → use-mcp-auth-status-BOQ5PtOH.js} +1 -1
- package/dist/client/assets/{use-mcp-client-D1kFCZ4v.js → use-mcp-client-2WkK0AxE.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-wKDmQlGB.js → use-mcp-prompts-BY0itm-N.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-I-kpM305.js → use-mcp-tools-Wkfd46Rr.js} +1 -1
- package/dist/client/assets/{use-members-0ZBHc0S5.js → use-members-Cl1_-fx1.js} +1 -1
- package/dist/client/assets/{use-mobile-CKoO3XSk.js → use-mobile-BAnIvR27.js} +1 -1
- package/dist/client/assets/use-move-blocks-lN8kagdi.js +1 -0
- package/dist/client/assets/{use-navigate-to-agent-DLX1nkvn.js → use-navigate-to-agent-C2NQ-36B.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-C5lEsbaH.js → use-open-billing-url-Bewtr0D-.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-t4l-TKT1.js → use-org-auth-client-vWdVrvgR.js} +1 -1
- package/dist/client/assets/{use-org-fs-49a1bhbu.js → use-org-fs-CxjQMzFd.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-BunA5GFg.js → use-org-repo-syncs-dRJpc7Ti.js} +1 -1
- package/dist/client/assets/{use-org-sso-B_zXOLDA.js → use-org-sso-BnFa9r-G.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Bc45ILhm.js → use-organization-roles-D9hV-WPT.js} +1 -1
- package/dist/client/assets/{use-organization-settings-laAOR3Cm.js → use-organization-settings-CE5BJyh9.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-Bghh8kV3.js → use-panel-navigate-CXkMPISv.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-C3Vtd78t.js → use-project-native-view-presence-D4-BL2Rg.js} +1 -1
- package/dist/client/assets/{use-project-scope-DH5nL_oD.js → use-project-scope-BOj2O9A_.js} +1 -1
- package/dist/client/assets/{use-recent-apps-D6yVH6-8.js → use-recent-apps-Cj-iBJUa.js} +1 -1
- package/dist/client/assets/{use-releases-G0pirYfu.js → use-releases-2-Z6BMdW.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-BKJYEIJX.js → use-reports-diagnostic-D--oIp45.js} +1 -1
- package/dist/client/assets/use-sandbox-events-BVhJrX2Z.js +2 -0
- package/dist/client/assets/{use-secrets-DszBqpzD.js → use-secrets-CQ9dfY46.js} +1 -1
- package/dist/client/assets/use-section-preview-base-CrcAXE9z.js +1 -0
- package/dist/client/assets/use-session-runtime-CqJF6neP.js +1 -0
- package/dist/client/assets/{use-sidebar-collapsed-CuPY8XXm.js → use-sidebar-collapsed-NZNztmvG.js} +1 -1
- package/dist/client/assets/{use-tags-BsXvHuTC.js → use-tags-BG7cxCCb.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BtNGPBbp.js → use-task-board-analytics-BhvhSxL9.js} +1 -1
- package/dist/client/assets/{use-task-board-events-BARWSwfj.js → use-task-board-events-CtQgceab.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-BhAhDKGd.js → use-task-board-item-prs-Dp099nXL.js} +1 -1
- package/dist/client/assets/{use-task-metadata-Dd-9Qkoq.js → use-task-metadata-BBoC1uvX.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-B9Rm3t_E.js → use-thread-analytics-g0_FCkSl.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-CoFWg3_v.js → use-thread-outputs-C38yfNsJ.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CxzyY6DS.js +1 -0
- package/dist/client/assets/{useQueries-_Urb_S-y.js → useQueries-DSs3oNbf.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CWvS_hOW.js +1 -0
- package/dist/client/assets/{users-BXTFPRVd.js → users-BAyRTNUi.js} +1 -1
- package/dist/client/assets/{utils-CduIoZ0d.js → utils-t1gjPfET.js} +1 -1
- package/dist/client/assets/{variant-calendar-D0iLcmjF.js → variant-calendar-BYITnHO8.js} +1 -1
- package/dist/client/assets/{variant-draft-pointer-HWAlFj6Z.js → variant-draft-pointer-Cjn_TXkR.js} +1 -1
- package/dist/client/assets/{virtual-mcp-Xd6PvE5_.js → virtual-mcp-cTWrWR4Y.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-BoG6Bqps.js → watch-sse-pool-C9NPGTmI.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/migrate.js +214 -209
- package/dist/server/server.js +633 -633
- package/package.json +1 -1
- package/dist/client/assets/ReferenceLine-CJq91vhq.js +0 -1
- package/dist/client/assets/agent-analytics-2BuaXhJ4.js +0 -2
- package/dist/client/assets/agent-app-DW_869sy.js +0 -1
- package/dist/client/assets/agent-assets-CPVwuId5.js +0 -1
- package/dist/client/assets/agent-calendar-CV9Ef0wP.js +0 -1
- package/dist/client/assets/agent-deck-OUciFfON.js +0 -1
- package/dist/client/assets/agent-experiments-BwjYQ0V4.js +0 -1
- package/dist/client/assets/agent-file-CStNgNPQ.js +0 -1
- package/dist/client/assets/agent-library-Bf2YaEvb.js +0 -1
- package/dist/client/assets/agent-library-file-DAttgEac.js +0 -1
- package/dist/client/assets/agent-monitor-DIe6BVqe.js +0 -1
- package/dist/client/assets/agent-overview-popLuSBk.js +0 -1
- package/dist/client/assets/agent-releases-CZVpd2dN.js +0 -2
- package/dist/client/assets/agent-settings-C6L22aS3.js +0 -1
- package/dist/client/assets/agent-site-editor-code-Dnn-bhoB.js +0 -2
- package/dist/client/assets/agent-site-editor-content-Bt6vrV5b.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-q3wCu8-N.js +0 -1
- package/dist/client/assets/agent-view-B1o861lr.js +0 -1
- package/dist/client/assets/api-keys-DfU9uedt.js +0 -1
- package/dist/client/assets/app-editor-Cq-B0QFL.js +0 -1
- package/dist/client/assets/blocks-tab-states-Chq5j0oT.js +0 -1
- package/dist/client/assets/campaigns-view-CwEmfYeP.js +0 -1
- package/dist/client/assets/category-editor-C-13e8GC.js +0 -1
- package/dist/client/assets/cms-settings-editor-CHoKFct5.js +0 -1
- package/dist/client/assets/coming-soon-page-6F4aAL8E.js +0 -1
- package/dist/client/assets/context-0XuHSild.js +0 -1
- package/dist/client/assets/home-DkYJf0RN.js +0 -1
- package/dist/client/assets/hosted-publish-api-CK3ZnEoi.js +0 -1
- package/dist/client/assets/hosted-publish-feedback-BG4t8HgW.js +0 -1
- package/dist/client/assets/index-EoMx4WDO.css +0 -1
- package/dist/client/assets/index-j4NUsiRT.js +0 -2
- package/dist/client/assets/input-DIcILgWd.js +0 -17
- package/dist/client/assets/library-BQ9URfiH.js +0 -1
- package/dist/client/assets/monitoring-BmpcQtwP.js +0 -1
- package/dist/client/assets/named-rule-uses-Mu_Msc9v.js +0 -1
- package/dist/client/assets/named-rule-view-CN2yeHp5.js +0 -1
- package/dist/client/assets/openai-conversation-_LIGb37e.js +0 -3
- package/dist/client/assets/order-monitor-day-DLFR-weA.js +0 -1
- package/dist/client/assets/parse-sections-YhOUxu7l.js +0 -1
- package/dist/client/assets/plan-Iixr6Ywe.js +0 -1
- package/dist/client/assets/post-calendar--v0MjZPE.js +0 -1
- package/dist/client/assets/product-picker-dialog-oD9OPZfl.js +0 -1
- package/dist/client/assets/project-app-view-CZXBsQ0a.js +0 -1
- package/dist/client/assets/project-reports-Crv9B-vM.js +0 -1
- package/dist/client/assets/project-tasks-Cz-57jQh.js +0 -1
- package/dist/client/assets/record-editor-d52mwz1n.js +0 -1
- package/dist/client/assets/redirect-editor-C-WKtN9s.js +0 -1
- package/dist/client/assets/releases-api-q3AffL1J.js +0 -1
- package/dist/client/assets/reports-B3miutne.js +0 -1
- package/dist/client/assets/reports-tab-Clf7FxSU.js +0 -2
- package/dist/client/assets/repositories-CxdgYwWQ.js +0 -1
- package/dist/client/assets/repositories-D42Ai47E.js +0 -1
- package/dist/client/assets/repository-picker-BXaWFfDW.js +0 -1
- package/dist/client/assets/route-4SgoFvu0.js +0 -1
- package/dist/client/assets/route-BEESJELS.js +0 -1
- package/dist/client/assets/route-D6eBZFy3.js +0 -1
- package/dist/client/assets/sandbox-lifecycle-context-DdMgF1Lv.js +0 -1
- package/dist/client/assets/sections-editor-DD9uWqQ8.js +0 -4
- package/dist/client/assets/seo-editor-Bf-sfYSP.js +0 -1
- package/dist/client/assets/settings-tab-DpQMA4J6.js +0 -1
- package/dist/client/assets/site-draft-view-Cho80MC6.js +0 -2
- package/dist/client/assets/site-editor-34XlqmyW.js +0 -1
- package/dist/client/assets/tasks-C_346UtB.js +0 -1
- package/dist/client/assets/use-apply-named-rule-B_CXDUdG.js +0 -1
- package/dist/client/assets/use-content-sync-D_qyLHCv.js +0 -1
- package/dist/client/assets/use-fast-preview-draft-url-CSz1rYUo.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-CVsgtXg7.js +0 -1
- package/dist/client/assets/use-move-blocks-Dm4etxGk.js +0 -1
- package/dist/client/assets/use-section-preview-base-BASvFHv_.js +0 -1
- package/dist/client/assets/useInfiniteQuery-wCORGPw3.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-JvpRoEFG.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as w,a2 as ie,l as U,j as s,B as Me,a3 as Xs,y as le,b as D,a as ze,d as qe,a4 as Zs,F as Gt,r as ee,t as Qt,a5 as Yt,a6 as en,a7 as tn,x as xt,a8 as Jt,a9 as sn,aa as Ce,L as et,ab as Be,Y as oe,ac as V,ad as tt,m as Ve,K as Ee,ae as nn,E as on,af as Re,T as st,U as fe,ag as Xt,V as nt,X as it,ah as mt,ai as ln,aj as rn,ak as an,al as cn,am as Zt,an as ot,ao as dn,o as kt,ap as mn,e as un,aq as St,D as es,q as ts,v as ss,s as ns,ar as fn,as as pn,at as xn,I as gn,w as hn,au as bn,av as is,aw as jn,ax as vn,ay as kn,az as Sn,aA as yn,aB as Nn,f as _n,k as wn,aC as $n,H as Cn,u as In,O as Pn}from"./index-ifZGovK1.js";import{I as os,O as ls,w as Tn,u as zn,L as ut}from"./index-DgfcOEet.js";import{u as An,L as ce,i as rs}from"./shell-layout-U7D4A6nk.js";import{u as Ie,a as De}from"./use-project-scope-DH5nL_oD.js";import{u as Fn}from"./thread-route-C7RSGMhP.js";import{S as we,u as je,a as re,b as be,c as as,d as gt,e as ht,f as On,g as Dn,h as cs}from"./use-sidebar-collapsed-CuPY8XXm.js";import{P as yt,a as lt,b as Nt}from"./popover-DaReiQzV.js";import{D as ds,a as ms,b as us,c as Mn}from"./drawer-0sYDH2mt.js";import{A as Ye}from"./avatar-DHKJiyOX.js";import{T as _t,a as wt,b as En,c as $t}from"./tooltip-gMeEuHtO.js";import{u as fs}from"./use-mobile-CKoO3XSk.js";import{a as Rn}from"./Copy01-OBSYmimV.js";import{t as Ln,i as bt,a as qn,b as Bn,c as Vn,d as Un,e as Hn,f as ps,s as Ct,g as xs,h as Kn,n as It,j as Wn,k as Pt,l as Gn,A as Qn,m as gs,o as Yn,p as hs,q as Jn,r as Xn,u as Zn,v as ei,w as ti,x as si,y as bs,z as ni,B as ii,C as oi}from"./agent-icon--EtIPqub.js";import{i as js}from"./Monitor01-DQEkUL3d.js";import{n as li,a as ri}from"./Sun-k4hypx5Q.js";import{a as rt,i as ai,t as ci}from"./Tool01-BsK9c3-e.js";import{u as di}from"./use-deployment-admin-D7XKR1Dx.js";import{I as mi,u as ui}from"./use-join-requests-CBahVlKF.js";import{u as fi}from"./use-deco-credits-D8w-JIDW.js";import{u as pi,a as vs,b as xi}from"./use-decopilot-events-Cp8NaBPU.js";import{u as gi,P as hi}from"./plan-ladder-BKLU8eo8.js";import{u as bi}from"./use-organization-settings-laAOR3Cm.js";import{S as ji}from"./scroll-area-9wUBmncr.js";import{u as ks}from"./use-inbox-feed-DOpe-XBh.js";import{t as Ss}from"./task-key-BCHdFiOO.js";import{S as vi,t as ys,a as ki}from"./daily-pulse-Cry9rVi8.js";import{a as Si}from"./format-time-Cq80KKvY.js";import{B as yi}from"./badge-ux-RK1YK.js";import{i as Ni}from"./ArrowLeft-BWCsylYe.js";import{I as _i,T as Ns}from"./toolbar-icon-button-DzJeqLa2.js";import{i as _s}from"./ChevronSelectorVertical-BSRBjpBn.js";import{s as Le}from"./Plus-vkM1FxVr.js";import{C as Ot,a as Ge,b as Je,c as wi,d as $i,e as Ci}from"./command-BlBQgQPI.js";import{P as Ae}from"./project-icon-ZadU5ZjL.js";import{C as Ii}from"./create-organization-dialog-nhhaUNZK.js";import{u as Pi}from"./repository-binding-DtIeSvDY.js";import{u as Ue,a as Ti}from"./use-navigate-to-agent-DLX1nkvn.js";import{u as zi}from"./use-thread-analytics-B9Rm3t_E.js";import{a as ws}from"./experiments-tab-choice-CMHPX5ZC.js";import{w as Ai}from"./project-profile-Cc4MG3QN.js";import{e as Fi,r as $s,u as Oi,s as Di,o as Mi,p as Ei,P as Ri}from"./use-project-native-view-presence-C3Vtd78t.js";import{u as Cs}from"./optimistic-project-sidebar-views-CrYamEqL.js";import{a as Li}from"./Image01-BCnLFq1D.js";import{P as qi}from"./project-apps-CG2eY1ZZ.js";import{u as Bi}from"./use-panel-navigate-Bghh8kV3.js";import{k as Vi,p as Ui}from"./use-recent-apps-D6yVH6-8.js";import{r as Hi}from"./resolve-tab-icon-56O81FJc.js";import{T as Ki}from"./tab-icon-glyph-Cz_BoFAU.js";import{R as Wi}from"./repository-import-picker-C2sQ94O1.js";import{i as Gi,a as Qi}from"./config-CE3I8pu5.js";import{b as Is,p as Yi,t as Ji,a as Xi}from"./task-route-BLP-DBaS.js";import{t as Ps}from"./ChevronUp-x46FJEcD.js";import{C as he,a as Zi,b as eo,c as to,d as ft,e as so,f as no,g as io}from"./context-menu-BD833dh0.js";import{o as Ts}from"./new-project-dialog-DFsG79bb.js";import{E as oo,p as lo,P as ro}from"./watch-sse-pool-BoG6Bqps.js";import{C as ao}from"./checkbox-vFQy8MvV.js";import{I as jt}from"./icon-button-HZwQKD3a.js";import{S as co}from"./switch-ByCU93P4.js";import{t as mo}from"./Building02-PifDTlhb.js";import{i as uo}from"./CreditCard01-DWsSThAm.js";import{i as fo}from"./Key01-CG7Kua6O.js";import{s as po}from"./User01-C2Sw39bs.js";import{i as xo}from"./ZoomOut-DytgoG2i.js";import{p as go,q as ho}from"./question-004-sINsf4GQ.js";import"./sheet-Dhe0uPV2.js";import"./core.esm-DJ5llHMe.js";import"./sortable.esm-CkqHW6-y.js";import"./XClose-BdwIxxCT.js";import"./UserSquare-BBEl_BxL.js";import"./use-debounced-value-c5JdkW89.js";import"./CheckCircle-CMGqXocs.js";import"./use-clock-tick-DflKMAWl.js";import"./integration-icon-D1aQLe0v.js";import"./LinkBroken01-DcsqjBuj.js";import"./use-mcp-client-D1kFCZ4v.js";import"./auth-C_nDagDA.js";import"./thread-intent-7GmQH5mt.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./slugify-CEUa2lfQ.js";import"./required-auth-layout-4jyUcmCy.js";import"./autosend-xoWUmECR.js";import"./use-org-sso-B_zXOLDA.js";import"./use-chat-layout-state-24wCHq_-.js";import"./index-DNa7Epd0.js";import"./AlertCircle-CUAx3A4b.js";import"./ArrowUp-EL0FBv9C.js";import"./ShoppingBag01-aJuRSlBz.js";import"./DotsVertical-jkvtcdek.js";import"./Globe04-blkS_Kfg.js";import"./SwitchHorizontal01-B5WFt7_0.js";import"./Link01-8aKNfNRw.js";import"./Minus-B38cW2ZC.js";import"./Play-Ns9aRVTY.js";import"./SearchMd-Cp6J-1Iu.js";import"./Trash01-Z1ezoy3S.js";import"./Upload01-B3-nlnKa.js";import"./Users01-DMFeioyM.js";import"./form-D4PspedZ.js";import"./label-Dhoh3DcI.js";import"./select-DUEGSJco.js";import"./index-BdQq_4o_.js";import"./textarea-Bbbnnl4r.js";import"./use-org-auth-client-t4l-TKT1.js";import"./use-organization-roles-Bc45ILhm.js";import"./use-ai-providers-CAt_9H4n.js";import"./schema-Cn4x5iT-.js";import"./task-board-BrTYr-oE.js";import"./useInfiniteQuery-wCORGPw3.js";import"./infiniteQueryObserver-DvmMaiCa.js";import"./use-task-board-events-BARWSwfj.js";import"./differenceInSeconds-C3x8sHUj.js";import"./index-BCHFFeZZ.js";import"./alert-dialog-C-DaggA1.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-file-configs-DW0hmZjE.js";import"./site-slug-DebpOoQq.js";import"./repository-picker-BXaWFfDW.js";import"./collection-search--9d0M5sc.js";function bo(){const t=w.c(19),{org:e}=ie(),{data:n}=An(e.slug);if(!n)return null;const i=n.severity==="block",l=i?"border-destructive/25 bg-destructive/5 text-destructive":"border-warning/40 bg-warning/10 text-foreground";let o;t[0]!==l?(o=U("flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b px-4 py-2 text-sm",l),t[0]=l,t[1]=o):o=t[1];const r=i?void 0:"text-warning";let a;t[2]!==r?(a=U("size-4 shrink-0",r),t[2]=r,t[3]=a):a=t[3];let c;t[4]!==a?(c=s.jsx(Xs,{className:a}),t[4]=a,t[5]=c):c=t[5];let d;t[6]!==n.title?(d=s.jsx("span",{className:"font-medium",children:n.title}),t[6]=n.title,t[7]=d):d=t[7];let m;t[8]!==n.message?(m=s.jsx("span",{className:"min-w-0 flex-1 text-muted-foreground",children:n.message}),t[8]=n.message,t[9]=m):m=t[9];let u;t[10]!==n.ctaLabel||t[11]!==n.ctaUrl?(u=n.ctaUrl&&n.ctaLabel?s.jsx(Me,{size:"sm",variant:"outline",asChild:!0,children:s.jsx("a",{href:n.ctaUrl,target:"_blank",rel:"noreferrer noopener",children:n.ctaLabel})}):null,t[10]=n.ctaLabel,t[11]=n.ctaUrl,t[12]=u):u=t[12];let p;return t[13]!==o||t[14]!==c||t[15]!==d||t[16]!==m||t[17]!==u?(p=s.jsxs("div",{role:"alert",className:o,children:[c,d,m,u]}),t[13]=o,t[14]=c,t[15]=d,t[16]=m,t[17]=u,t[18]=p):p=t[18],p}function zs(){const t=w.c(3),{setScope:e}=Ie(),n=Fn();let i;return t[0]!==n||t[1]!==e?(i=()=>{const l=n!==void 0?"route_resolves_scope":null;le("scope_cleared",{relocated:l!==null,reason:l}),e(null)},t[0]=n,t[1]=e,t[2]=i):i=t[2],i}const Xe="size-4 shrink-0";function at(t){const e=w.c(5),{children:n,className:i}=t;let l;e[0]!==i?(l=U("flex w-4 shrink-0 items-center justify-center",i),e[0]=i,e[1]=l):l=e[1];let o;return e[2]!==n||e[3]!==l?(o=s.jsx("span",{className:l,children:n}),e[2]=n,e[3]=l,e[4]=o):o=e[4],o}function Oe(t){const e=w.c(26),{item:n,onClose:i}=t;let l;e[0]!==n.className?(l=U("flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",n.className),e[0]=n.className,e[1]=l):l=e[1];const o=l;if(n.href){const m=n.external?"_blank":void 0,u=n.external?"noopener noreferrer":void 0;let p;e[2]!==n.icon?(p=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[2]=n.icon,e[3]=p):p=e[3];let f;e[4]!==n.label?(f=s.jsx("span",{className:"flex-1",children:n.label}),e[4]=n.label,e[5]=f):f=e[5];let x;return e[6]!==o||e[7]!==n.href||e[8]!==i||e[9]!==m||e[10]!==u||e[11]!==p||e[12]!==f?(x=s.jsxs("a",{href:n.href,target:m,rel:u,className:o,onClick:i,children:[p,f]}),e[6]=o,e[7]=n.href,e[8]=i,e[9]=m,e[10]=u,e[11]=p,e[12]=f,e[13]=x):x=e[13],x}let r;e[14]!==n||e[15]!==i?(r=()=>{n.onClick?.(),i()},e[14]=n,e[15]=i,e[16]=r):r=e[16];let a;e[17]!==n.icon?(a=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[17]=n.icon,e[18]=a):a=e[18];let c;e[19]!==n.label?(c=s.jsx("span",{className:"flex-1",children:n.label}),e[19]=n.label,e[20]=c):c=e[20];let d;return e[21]!==o||e[22]!==r||e[23]!==a||e[24]!==c?(d=s.jsxs("button",{type:"button",onClick:r,className:o,children:[a,c]}),e[21]=o,e[22]=r,e[23]=a,e[24]=c,e[25]=d):d=e[25],d}function jo(){const t=w.c(4),e=D();let n;t[0]!==e?(n=e("common.accountPopover.impersonating"),t[0]=e,t[1]=n):n=t[1];let i;return t[2]!==n?(i=s.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-warning/10 px-2 py-0.5 text-2xs font-medium text-warning",children:n}),t[2]=n,t[3]=i):i=t[3],i}function Dt(t){const e=w.c(38),{user:n,userImage:i,isImpersonating:l,isMobile:o}=t,r=D(),a=o?"py-4 border-b border-border":"py-3 mx-1 mt-1";let c;e[0]!==a?(c=U("flex items-center gap-3 px-4",a),e[0]=a,e[1]=c):c=e[1];const d=n?.name??"U";let m;e[2]!==d||e[3]!==i?(m=s.jsx(Ye,{url:i,fallback:d,shape:"circle",size:"sm",className:"shrink-0"}),e[2]=d,e[3]=i,e[4]=m):m=e[4];let u;e[5]!==r||e[6]!==n?.name?(u=n?.name??r("common.accountPopover.defaultUserName"),e[5]=r,e[6]=n?.name,e[7]=u):u=e[7];let p;e[8]!==u?(p=s.jsx("p",{className:"text-sm font-medium truncate",children:u}),e[8]=u,e[9]=p):p=e[9];let f;e[10]!==l?(f=l&&s.jsx(jo,{}),e[10]=l,e[11]=f):f=e[11];let x;e[12]!==p||e[13]!==f?(x=s.jsxs("div",{className:"flex items-center gap-2",children:[p,f]}),e[12]=p,e[13]=f,e[14]=x):x=e[14];const h=n?.email;let g;e[15]!==h?(g=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:h}),e[15]=h,e[16]=g):g=e[16];let b;e[17]!==g||e[18]!==x?(b=s.jsxs("div",{className:"flex-1 min-w-0",children:[x,g]}),e[17]=g,e[18]=x,e[19]=b):b=e[19];let v;e[20]!==r||e[21]!==n?(v=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(()=>{Qt.success(r("common.accountPopover.userIdCopied"))})},e[20]=r,e[21]=n,e[22]=v):v=e[22];let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Rn,{size:14}),e[23]=j):j=e[23];let k;e[24]!==v?(k=s.jsx(_t,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:v,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:j})}),e[24]=v,e[25]=k):k=e[25];let S;e[26]!==r?(S=r("common.accountPopover.copyUserId"),e[26]=r,e[27]=S):S=e[27];let N;e[28]!==S?(N=s.jsx(wt,{side:"right",children:s.jsx("p",{className:"text-xs",children:S})}),e[28]=S,e[29]=N):N=e[29];let _;e[30]!==k||e[31]!==N?(_=s.jsx(En,{delayDuration:300,children:s.jsxs($t,{children:[k,N]})}),e[30]=k,e[31]=N,e[32]=_):_=e[32];let C;return e[33]!==b||e[34]!==_||e[35]!==c||e[36]!==m?(C=s.jsxs("div",{className:c,children:[m,b,_]}),e[33]=b,e[34]=_,e[35]=c,e[36]=m,e[37]=C):C=e[37],C}function Mt(t){const e=w.c(35),{themeOptions:n,preferences:i,setPreferences:l,isMobile:o}=t,r=D(),a=o?"size-8":"size-7",c=o?"px-3 py-3":"px-2 py-1.5";let d;e[0]!==c?(d=U("flex items-center justify-between border-t border-border/50",c),e[0]=c,e[1]=d):d=e[1];let m;if(e[2]!==a||e[3]!==i.theme||e[4]!==l||e[5]!==n){let S;e[7]!==a||e[8]!==i.theme||e[9]!==l?(S=N=>{const{value:_,icon:C,label:y}=N;return s.jsx("button",{type:"button","aria-label":y,onClick:()=>l($=>({...$,theme:_})),className:U(a,"rounded-lg flex items-center justify-center transition-colors",i.theme===_?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent hover:text-foreground"),children:C},_)},e[7]=a,e[8]=i.theme,e[9]=l,e[10]=S):S=e[10],m=n.map(S),e[2]=a,e[3]=i.theme,e[4]=l,e[5]=n,e[6]=m}else m=e[6];let u;e[11]!==m?(u=s.jsx("div",{className:"flex items-center gap-0.5",children:m}),e[11]=m,e[12]=u):u=e[12];let p;e[13]!==i.enableSounds||e[14]!==r?(p=i.enableSounds?r("common.accountPopover.disableSounds"):r("common.accountPopover.enableSounds"),e[13]=i.enableSounds,e[14]=r,e[15]=p):p=e[15];let f;e[16]!==l?(f=()=>l(vo),e[16]=l,e[17]=f):f=e[17];const x=i.enableSounds?"text-foreground hover:bg-sidebar-accent":"text-muted-foreground hover:bg-sidebar-accent hover:text-foreground";let h;e[18]!==a||e[19]!==x?(h=U(a,"rounded-lg flex items-center justify-center transition-colors",x),e[18]=a,e[19]=x,e[20]=h):h=e[20];let g;e[21]!==i.enableSounds?(g=i.enableSounds?s.jsx(Vn,{size:14}):s.jsx(Un,{size:14}),e[21]=i.enableSounds,e[22]=g):g=e[22];let b;e[23]!==p||e[24]!==f||e[25]!==h||e[26]!==g?(b=s.jsx("button",{type:"button","aria-label":p,onClick:f,className:h,children:g}),e[23]=p,e[24]=f,e[25]=h,e[26]=g,e[27]=b):b=e[27];let v;e[28]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.515.1"]}),e[28]=v):v=e[28];let j;e[29]!==b?(j=s.jsxs("div",{className:"flex items-center gap-2",children:[b,v]}),e[29]=b,e[30]=j):j=e[30];let k;return e[31]!==j||e[32]!==d||e[33]!==u?(k=s.jsxs("div",{className:d,children:[u,j]}),e[31]=j,e[32]=d,e[33]=u,e[34]=k):k=e[34],k}function vo(t){return{...t,enableSounds:!t.enableSounds}}function Et(t){const e=w.c(54),{user:n,userImage:i,menuItems:l,signOutItem:o,stopImpersonatingItem:r,isImpersonating:a,themeOptions:c,preferences:d,setPreferences:m,close:u,isMobile:p}=t;if(p){let k;e[0]!==a||e[1]!==n||e[2]!==i?(k=s.jsx(Dt,{user:n,userImage:i,isImpersonating:a,isMobile:!0}),e[0]=a,e[1]=n,e[2]=i,e[3]=k):k=e[3];let S;if(e[4]!==u||e[5]!==l){let I;e[7]!==u?(I=z=>s.jsx(Oe,{item:z,onClose:u},z.key),e[7]=u,e[8]=I):I=e[8],S=l.map(I),e[4]=u,e[5]=l,e[6]=S}else S=e[6];let N;e[9]!==u||e[10]!==r?(N=r&&s.jsx(Oe,{item:r,onClose:u}),e[9]=u,e[10]=r,e[11]=N):N=e[11];let _;e[12]!==u||e[13]!==o?(_=s.jsx(Oe,{item:o,onClose:u}),e[12]=u,e[13]=o,e[14]=_):_=e[14];let C;e[15]!==S||e[16]!==N||e[17]!==_?(C=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[S,N,_]})}),e[15]=S,e[16]=N,e[17]=_,e[18]=C):C=e[18];let y;e[19]!==d||e[20]!==m||e[21]!==c?(y=s.jsx(Mt,{themeOptions:c,preferences:d,setPreferences:m,isMobile:!0}),e[19]=d,e[20]=m,e[21]=c,e[22]=y):y=e[22];let $;return e[23]!==k||e[24]!==C||e[25]!==y?($=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[k,C,y]}),e[23]=k,e[24]=C,e[25]=y,e[26]=$):$=e[26],$}let f;e[27]!==a||e[28]!==n||e[29]!==i?(f=s.jsx(Dt,{user:n,userImage:i,isImpersonating:a,isMobile:!1}),e[27]=a,e[28]=n,e[29]=i,e[30]=f):f=e[30];let x;if(e[31]!==u||e[32]!==l){let k;e[34]!==u?(k=S=>s.jsx(Oe,{item:S,onClose:u},S.key),e[34]=u,e[35]=k):k=e[35],x=l.map(k),e[31]=u,e[32]=l,e[33]=x}else x=e[33];let h;e[36]!==u||e[37]!==r?(h=r&&s.jsx(Oe,{item:r,onClose:u}),e[36]=u,e[37]=r,e[38]=h):h=e[38];let g;e[39]!==u||e[40]!==o?(g=s.jsx(Oe,{item:o,onClose:u}),e[39]=u,e[40]=o,e[41]=g):g=e[41];let b;e[42]!==x||e[43]!==h||e[44]!==g?(b=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[x,h,g]}),e[42]=x,e[43]=h,e[44]=g,e[45]=b):b=e[45];let v;e[46]!==d||e[47]!==m||e[48]!==c?(v=s.jsx(Mt,{themeOptions:c,preferences:d,setPreferences:m,isMobile:!1}),e[46]=d,e[47]=m,e[48]=c,e[49]=v):v=e[49];let j;return e[50]!==f||e[51]!==b||e[52]!==v?(j=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[f,b,v]})}),e[50]=f,e[51]=b,e[52]=v,e[53]=j):j=e[53],j}function vt(){const t=w.c(98),e=D(),{data:n}=ze.useSession(),{org:i}=ie(),l=qe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const a=Zs(o)?.params.org,[c,d]=Gt(),m=fs(),{isAdmin:u}=di(),[p,f]=ee.useState(!1),x=n?.user,h=x?.image,g=!!n?.session?.impersonatedBy;let b;t[1]===Symbol.for("react.memo_cache_sentinel")?(b=()=>f(!1),t[1]=b):b=t[1];const v=b;let j;t[2]!==e?(j=e("common.accountPopover.preferences"),t[2]=e,t[3]=j):j=t[3];let k;t[4]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(rt,{size:16}),t[4]=k):k=t[4];let S;t[5]!==l||t[6]!==a?(S=()=>{l({to:"/$org/settings/profile",params:{org:a??""}})},t[5]=l,t[6]=a,t[7]=S):S=t[7];let N;t[8]!==j||t[9]!==S?(N={key:"preferences",label:j,icon:k,onClick:S},t[8]=j,t[9]=S,t[10]=N):N=t[10];let _;t[11]!==i||t[12]!==l?(_=i?[{key:"connect-clients",label:"Connect to Agents",icon:s.jsx(Yt,{size:16}),onClick:()=>{l({to:"/$org/settings/connect",params:{org:i.slug}})}}]:[],t[11]=i,t[12]=l,t[13]=_):_=t[13];let C;t[14]!==e?(C=e("common.accountPopover.termsOfUse"),t[14]=e,t[15]=C):C=t[15];let y;t[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(qn,{size:16}),t[16]=y):y=t[16];let $;t[17]!==C?($={key:"terms",label:C,icon:y,href:"https://www.decocms.com/terms-of-use",external:!0},t[17]=C,t[18]=$):$=t[18];let I;t[19]!==e?(I=e("common.accountPopover.privacyPolicy"),t[19]=e,t[20]=I):I=t[20];let z;t[21]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(en,{size:16}),t[21]=z):z=t[21];let R;t[22]!==I?(R={key:"privacy",label:I,icon:z,href:"https://www.decocms.com/privacy-policy",external:!0},t[22]=I,t[23]=R):R=t[23];let E;t[24]!==e?(E=e("common.accountPopover.repository"),t[24]=e,t[25]=E):E=t[25];let F;t[26]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(tn,{className:"w-4 h-4"}),t[26]=F):F=t[26];let K;t[27]!==E?(K={key:"github",label:E,icon:F,href:"https://github.com/decocms/studio",external:!0},t[27]=E,t[28]=K):K=t[28];let q;t[29]!==e?(q=e("common.accountPopover.community"),t[29]=e,t[30]=q):q=t[30];let J;t[31]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx(xt,{size:16}),t[31]=J):J=t[31];let X;t[32]!==q?(X={key:"community",label:q,icon:J,href:"https://decocms.com/discord",external:!0},t[32]=q,t[33]=X):X=t[33];let B;t[34]!==e?(B=e("common.accountPopover.homepage"),t[34]=e,t[35]=B):B=t[35];let te;t[36]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(Bn,{size:16}),t[36]=te):te=t[36];let W;t[37]!==B?(W={key:"homepage",label:B,icon:te,href:"https://decocms.com",external:!0},t[37]=B,t[38]=W):W=t[38];let Y;t[39]!==u||t[40]!==l||t[41]!==e?(Y=u?[{key:"admin-dashboard",label:e("common.accountPopover.adminDashboard"),icon:s.jsx(Ln,{size:16}),onClick:()=>l({to:"/_admin"}),className:"text-warning"}]:[],t[39]=u,t[40]=l,t[41]=e,t[42]=Y):Y=t[42];let ne;t[43]!==R||t[44]!==K||t[45]!==X||t[46]!==W||t[47]!==Y||t[48]!==N||t[49]!==_||t[50]!==$?(ne=[N,..._,$,R,K,X,W,...Y],t[43]=R,t[44]=K,t[45]=X,t[46]=W,t[47]=Y,t[48]=N,t[49]=_,t[50]=$,t[51]=ne):ne=t[51];const A=ne;let G;t[52]!==e?(G=e("common.accountPopover.signOut"),t[52]=e,t[53]=G):G=t[53];let P;t[54]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(bt,{size:16}),t[54]=P):P=t[54];let M;t[55]!==G?(M={key:"logout",label:G,icon:P,onClick:So},t[55]=G,t[56]=M):M=t[56];const L=M;let se;t[57]!==g||t[58]!==e?(se=g?{key:"stop-impersonating",label:e("common.accountPopover.stopImpersonation"),icon:s.jsx(bt,{size:16}),onClick:async()=>{const{error:Pe}=await ze.admin.stopImpersonating();if(Pe){Qt.error(Pe.message||e("common.accountPopover.failedToStopImpersonation"));return}window.location.href="/"},className:"text-warning"}:null,t[57]=g,t[58]=e,t[59]=se):se=t[59];const me=se;let ae;t[60]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx(li,{size:14}),t[60]=ae):ae=t[60];let T;t[61]!==e?(T=e("common.accountPopover.lightTheme"),t[61]=e,t[62]=T):T=t[62];let Z;t[63]!==T?(Z={value:"light",icon:ae,label:T},t[63]=T,t[64]=Z):Z=t[64];let ve;t[65]===Symbol.for("react.memo_cache_sentinel")?(ve=s.jsx(ri,{size:14}),t[65]=ve):ve=t[65];let Q;t[66]!==e?(Q=e("common.accountPopover.darkTheme"),t[66]=e,t[67]=Q):Q=t[67];let de;t[68]!==Q?(de={value:"dark",icon:ve,label:Q},t[68]=Q,t[69]=de):de=t[69];let ke;t[70]===Symbol.for("react.memo_cache_sentinel")?(ke=s.jsx(js,{size:14}),t[70]=ke):ke=t[70];let xe;t[71]!==e?(xe=e("common.accountPopover.systemTheme"),t[71]=e,t[72]=xe):xe=t[72];let ge;t[73]!==xe?(ge={value:"system",icon:ke,label:xe},t[73]=xe,t[74]=ge):ge=t[74];let Se;t[75]!==Z||t[76]!==de||t[77]!==ge?(Se=[Z,de,ge],t[75]=Z,t[76]=de,t[77]=ge,t[78]=Se):Se=t[78];const $e=Se;let ye;t[79]!==g||t[80]!==m||t[81]!==A||t[82]!==c||t[83]!==d||t[84]!==L||t[85]!==me||t[86]!==$e||t[87]!==x||t[88]!==h?(ye={user:x,userImage:h,menuItems:A,signOutItem:L,stopImpersonatingItem:me,isImpersonating:g,themeOptions:$e,preferences:c,setPreferences:d,close:v,isMobile:m},t[79]=g,t[80]=m,t[81]=A,t[82]=c,t[83]=d,t[84]=L,t[85]=me,t[86]=$e,t[87]=x,t[88]=h,t[89]=ye):ye=t[89];const Ne=ye;let _e;return t[90]!==g||t[91]!==m||t[92]!==p||t[93]!==Ne||t[94]!==e||t[95]!==x?.name||t[96]!==h?(_e=m?s.jsxs(ds,{open:p,onOpenChange:f,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>f(!0),className:U("flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",g&&"border-2 border-dashed border-warning"),children:[s.jsx(Ye,{url:h,fallback:x?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:x?.name??e("common.accountPopover.defaultAccountLabel")})]}),s.jsxs(ms,{className:"h-[80dvh] p-0",children:[s.jsx(us,{className:"sr-only",children:e("common.accountPopover.account")}),s.jsx(Et,{...Ne})]})]}):s.jsxs(yt,{open:p,onOpenChange:f,children:[s.jsx(lt,{asChild:!0,children:s.jsxs(we,{"data-tour":ce.account,tooltip:x?.name??e("common.accountPopover.defaultAccountLabel"),className:U(g&&"border-2 border-dashed border-warning"),children:[s.jsx(at,{children:s.jsx(Ye,{url:h,fallback:x?.name??"U",shape:"circle",size:"2xs",className:"size-[18px] shrink-0"})}),s.jsx("span",{className:"truncate",children:x?.name??e("common.accountPopover.defaultAccountLabel")})]})}),s.jsx(Nt,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:ko,children:s.jsx(Et,{...Ne})})]}),t[90]=g,t[91]=m,t[92]=p,t[93]=Ne,t[94]=e,t[95]=x?.name,t[96]=h,t[97]=_e):_e=t[97],_e}function ko(t){return t.preventDefault()}function So(){le("signed_out",{source:"account_popover"}),Jt(),ze.signOut()}class yo extends ee.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function No(t){return t<=1?"text-destructive":t<=5?"text-warning":"text-foreground/70"}function _o(){const t=w.c(17),e=qe(),{org:n}=ie(),{hasDecoKey:i,balanceDollars:l}=fi();if(!i)return null;let o;t[0]!==l?(o=l!=null?`Credits: $${l.toFixed(2)}`:"Credits",t[0]=l,t[1]=o):o=t[1];let r;t[2]!==l?(r=U(l!=null&&No(l)),t[2]=l,t[3]=r):r=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Hn,{}),t[7]=c):c=t[7];let d;t[8]!==l?(d=l!=null?`$${l.toFixed(2)}`:"Credits",t[8]=l,t[9]=d):d=t[9];let m;t[10]!==d?(m=s.jsx("span",{children:d}),t[10]=d,t[11]=m):m=t[11];let u;return t[12]!==o||t[13]!==r||t[14]!==a||t[15]!==m?(u=s.jsx(re,{children:s.jsx(be,{children:s.jsxs(we,{tooltip:o,className:r,onClick:a,children:[c,m]})})}),t[12]=o,t[13]=r,t[14]=a,t[15]=m,t[16]=u):u=t[16],u}const wo={ok:"stroke-brand-purple",warn:"stroke-warning",exhausted:"stroke-destructive"},$o={ok:"bg-brand-purple",warn:"bg-warning",exhausted:"bg-destructive"};function Co(){const t=w.c(40),e=D(),n=je(),i=qe(),{org:l}=ie(),{data:o}=vs();if(!o?.usage||!o.features.chat)return null;let r,a;if(t[0]!==o.usage.percent?(r=Math.round(o.usage.percent*100),a=Number.isFinite(r),t[0]=o.usage.percent,t[1]=r,t[2]=a):(r=t[1],a=t[2]),!a)return null;const c=Math.min(100,Math.max(0,r)),d=o.plan.name;let m;t[3]!==e?(m=e("settings.planUsage.aiUsage"),t[3]=e,t[4]=m):m=t[4];const u=`${d} · ${m} ${c}%`;let p;t[5]!==i||t[6]!==l.slug?(p=()=>i({to:"/$org/settings/ai-providers",params:{org:l.slug}}),t[5]=i,t[6]=l.slug,t[7]=p):p=t[7];const f=!n&&"-ml-px";let x;t[8]!==f?(x=U(f),t[8]=f,t[9]=x):x=t[9];let h;t[10]!==o.plan.id||t[11]!==o.usage.state||t[12]!==n||t[13]!==c?(h=n?s.jsx(Po,{percent:c,state:o.usage.state}):s.jsx(Io,{planId:o.plan.id}),t[10]=o.plan.id,t[11]=o.usage.state,t[12]=n,t[13]=c,t[14]=h):h=t[14];let g;t[15]!==x||t[16]!==h?(g=s.jsx(at,{className:x,children:h}),t[15]=x,t[16]=h,t[17]=g):g=t[17];let b;t[18]!==o.plan.name?(b=s.jsx("span",{className:"truncate font-medium",children:o.plan.name}),t[18]=o.plan.name,t[19]=b):b=t[19];let v;t[20]!==c?(v=s.jsxs("span",{className:"tabular-nums text-xs text-muted-foreground",children:[c,"%"]}),t[20]=c,t[21]=v):v=t[21];let j;t[22]!==v||t[23]!==b?(j=s.jsxs("span",{className:"flex items-baseline justify-between gap-2",children:[b,v]}),t[22]=v,t[23]=b,t[24]=j):j=t[24];const k=$o[o.usage.state];let S;t[25]!==k?(S=U("block h-full rounded-full",k),t[25]=k,t[26]=S):S=t[26];const N=`${c}%`;let _;t[27]!==N?(_={width:N},t[27]=N,t[28]=_):_=t[28];let C;t[29]!==S||t[30]!==_?(C=s.jsx("span",{className:"block h-1 overflow-hidden rounded-full bg-muted",children:s.jsx("span",{className:S,style:_})}),t[29]=S,t[30]=_,t[31]=C):C=t[31];let y;t[32]!==j||t[33]!==C?(y=s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[j,C]}),t[32]=j,t[33]=C,t[34]=y):y=t[34];let $;return t[35]!==y||t[36]!==u||t[37]!==p||t[38]!==g?($=s.jsx(re,{children:s.jsx(be,{children:s.jsxs(we,{tooltip:u,className:"h-auto! rounded-lg border border-border bg-card px-2 py-2 [&_svg]:opacity-100!",onClick:p,children:[g,y]})})}),t[35]=y,t[36]=u,t[37]=p,t[38]=g,t[39]=$):$=t[39],$}function Io(t){const e=w.c(6),{planId:n}=t,{data:i}=gi();let l;e[0]!==n||e[1]!==i?(l=i?.findIndex(a=>a.id===n)??-1,e[0]=n,e[1]=i,e[2]=l):l=e[2];const o=l;if(o<0){let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ps,{className:Xe}),e[3]=a):a=e[3],a}let r;return e[4]!==o?(r=s.jsx(hi,{index:o,className:Xe}),e[4]=o,e[5]=r):r=e[5],r}function Po(t){const e=w.c(5),{percent:n,state:i}=t,l=2*Math.PI*8;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=U("-rotate-90",Xe),e[0]=o):o=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("circle",{cx:"10",cy:"10",r:8,fill:"none",strokeWidth:"3",className:"stroke-muted"}),e[1]=r):r=e[1];const a=wo[i],c=`${l*n/100} ${l}`;let d;return e[2]!==a||e[3]!==c?(d=s.jsxs("svg",{viewBox:"0 0 20 20",className:o,"aria-hidden":"true",children:[r,s.jsx("circle",{cx:"10",cy:"10",r:8,fill:"none",strokeWidth:"3",strokeLinecap:"round",className:a,strokeDasharray:c})]}),e[2]=a,e[3]=c,e[4]=d):d=e[4],d}function To(){return pi()?s.jsx(Co,{}):s.jsx(_o,{})}function Rt(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(yo,{children:s.jsx(ee.Suspense,{fallback:null,children:s.jsx(To,{})})}),t[0]=e):e=t[0],e}function zo(t){switch(t){case"mentioned":case"review_requested":return"font-medium text-foreground";case"merge_failed":case"review_changes_requested":case"order_incident":return"font-medium text-destructive";case"review_approved":return"font-medium text-success";default:return""}}function Ao(t,e){switch(t.action){case"commented":return e("sidebar.inbox.actionCommented");case"mentioned":return e("sidebar.inbox.actionMentioned");case"created":return e("sidebar.inbox.actionCreated");case"status_changed":return e("sidebar.inbox.actionStatusChanged");case"assignee_changed":return e("sidebar.inbox.actionAssigneeChanged");case"review_requested":return e("sidebar.inbox.actionReviewRequested");case"review_approved":return e("sidebar.inbox.actionReviewApproved");case"review_changes_requested":return e("sidebar.inbox.actionReviewChangesRequested");case"merge_failed":return e("sidebar.inbox.actionMergeFailed");case"order_incident":return e("sidebar.inbox.actionOrderIncident");default:{const n=t.action;return String(n)}}}function Fo(t){const e=w.c(36),{update:n,orgSlug:i,onSelect:l}=t,o=D();let r;e[0]!==i||e[1]!==n.taskKeySeq?(r=Ss(i,n.taskKeySeq),e[0]=i,e[1]=n.taskKeySeq,e[2]=r):r=e[2];const a=r,c=!n.actorName;let d;e[3]!==c||e[4]!==n.actorImage||e[5]!==n.actorName?(d=s.jsx("span",{className:"mt-0.5 shrink-0",children:c?s.jsx(vi,{size:24}):s.jsx(Ye,{url:n.actorImage??void 0,fallback:n.actorName??"?",shape:"circle",size:"xs"})}),e[3]=c,e[4]=n.actorImage,e[5]=n.actorName,e[6]=d):d=e[6];let m;e[7]!==n.taskTitle?(m=s.jsx("p",{className:"min-w-0 flex-1 line-clamp-2 break-words text-sm font-medium text-foreground",children:n.taskTitle}),e[7]=n.taskTitle,e[8]=m):m=e[8];let u;e[9]!==n.occurredAt?(u=Si(new Date(n.occurredAt)),e[9]=n.occurredAt,e[10]=u):u=e[10];let p;e[11]!==u?(p=s.jsx("span",{className:"shrink-0 text-xs text-muted-foreground/70",children:u}),e[11]=u,e[12]=p):p=e[12];let f;e[13]!==m||e[14]!==p?(f=s.jsxs("div",{className:"flex items-baseline gap-2",children:[m,p]}),e[13]=m,e[14]=p,e[15]=f):f=e[15];let x;e[16]!==a?(x=a&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"font-medium",children:a})," · "]}),e[16]=a,e[17]=x):x=e[17];let h;e[18]!==n.action?(h=U(zo(n.action)),e[18]=n.action,e[19]=h):h=e[19];let g;e[20]!==o||e[21]!==n?(g=Ao(n,o),e[20]=o,e[21]=n,e[22]=g):g=e[22];let b;e[23]!==h||e[24]!==g?(b=s.jsx("span",{className:h,children:g}),e[23]=h,e[24]=g,e[25]=b):b=e[25];let v;e[26]!==b||e[27]!==x?(v=s.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[x,b]}),e[26]=b,e[27]=x,e[28]=v):v=e[28];let j;e[29]!==v||e[30]!==f?(j=s.jsxs("div",{className:"min-w-0 flex-1",children:[f,v]}),e[29]=v,e[30]=f,e[31]=j):j=e[31];let k;return e[32]!==l||e[33]!==j||e[34]!==d?(k=s.jsxs("button",{type:"button",onClick:l,className:"flex w-full items-start gap-3 border-b border-border px-4 py-3 text-left transition-colors last:border-0 hover:bg-accent",children:[d,j]}),e[32]=l,e[33]=j,e[34]=d,e[35]=k):k=e[35],k}function ct(){const t=ee.useContext(sn),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(l=>l.status==="pending"&&new Date(l.expiresAt)>new Date),refetch:()=>n?.()}}function Oo(t){const e=w.c(2),{onReach:n}=t;let i;return e[0]!==n?(i=s.jsx("div",{className:"h-8 shrink-0",ref:l=>{if(!l)return;const o=new IntersectionObserver(r=>{r.some(Do)&&n()});return o.observe(l),()=>o.disconnect()}}),e[0]=n,e[1]=i):i=e[1],i}function Do(t){return t.isIntersecting}function Mo(t){const e=w.c(31),{onClose:n}=t,i=D(),l=qe(),{org:o}=ie(),{updates:r,markAllRead:a,markRead:c,hasMore:d,fetchMore:m}=ks(),u=Ce(),p=ct();let f;e[0]!==p.invitations||e[1]!==u?(f=u?p.invitations:[],e[0]=p.invitations,e[1]=u,e[2]=f):f=e[2];const x=f,h=p.refetch;let g;e[3]!==i?(g=i("sidebar.inbox.title"),e[3]=i,e[4]=g):g=e[4];let b;e[5]!==g?(b=s.jsx("h3",{className:"text-sm font-medium",children:g}),e[5]=g,e[6]=b):b=e[6];let v;e[7]!==a||e[8]!==i||e[9]!==r.length?(v=r.length>0&&s.jsx(Me,{size:"sm",variant:"ghost",className:"text-muted-foreground",onClick:a,children:i("sidebar.inbox.markAllRead")}),e[7]=a,e[8]=i,e[9]=r.length,e[10]=v):v=e[10];let j;e[11]!==b||e[12]!==v?(j=s.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-4 py-3",children:[b,v]}),e[11]=b,e[12]=v,e[13]=j):j=e[13];let k;e[14]!==x||e[15]!==h?(k=x.length>0&&s.jsx("div",{className:"shrink-0 border-border border-b p-2",children:x.map(_=>s.jsx(os,{invitation:_,onChanged:h},_.id))}),e[14]=x,e[15]=h,e[16]=k):k=e[16];let S;e[17]!==m||e[18]!==d||e[19]!==x.length||e[20]!==c||e[21]!==l||e[22]!==n||e[23]!==o||e[24]!==i||e[25]!==r?(S=r.length===0&&x.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 py-10 text-center",children:[s.jsx(Ct,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:i("sidebar.inbox.emptyTitle")}),s.jsx("p",{className:"text-xs text-muted-foreground",children:i("sidebar.inbox.emptyBody")})]}):s.jsxs(ji,{className:"min-h-0 flex-1",children:[r.map(_=>{const C=Ss(o.slug,_.taskKeySeq);return s.jsx(Fo,{update:_,orgSlug:o.slug,onSelect:()=>{c(_.id),n(),C&&l({to:"/$org/tasks/{-$taskKey}",params:{org:o.slug,taskKey:C}})}},_.id)}),d&&s.jsx(Oo,{onReach:m})]}),e[17]=m,e[18]=d,e[19]=x.length,e[20]=c,e[21]=l,e[22]=n,e[23]=o,e[24]=i,e[25]=r,e[26]=S):S=e[26];let N;return e[27]!==j||e[28]!==k||e[29]!==S?(N=s.jsxs(s.Fragment,{children:[j,k,S]}),e[27]=j,e[28]=k,e[29]=S,e[30]=N):N=e[30],N}function As(){const t=w.c(1),{redDotCount:e}=ks(),{invitations:n}=ct();if(e===0&&n.length===0)return null;let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"pointer-events-none absolute top-1 right-1 size-2 rounded-full bg-destructive"}),t[0]=i):i=t[0],i}function Fs(t){const e=w.c(10),{open:n,onOpenChange:i,children:l}=t;let o;e[0]!==i||e[1]!==n?(o=n&&s.jsx(Mo,{onClose:()=>i(!1)}),e[0]=i,e[1]=n,e[2]=o):o=e[2];let r;e[3]!==o?(r=s.jsx(Nt,{side:"right",align:"end",sideOffset:12,collisionPadding:16,className:"flex max-h-[min(650px,calc(100dvh-4rem))] w-[min(460px,calc(100vw-2rem))] flex-col p-0",children:o}),e[3]=o,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==i||e[7]!==n||e[8]!==r?(a=s.jsxs(yt,{open:n,onOpenChange:i,children:[l,r]}),e[5]=l,e[6]=i,e[7]=n,e[8]=r,e[9]=a):a=e[9],a}function Os(){const t=w.c(9),e=D(),[n,i]=ee.useState(!1);let l;t[0]!==e?(l=e("sidebar.inbox.title"),t[0]=e,t[1]=l):l=t[1];let o,r;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ct,{size:15}),r=s.jsx(As,{}),t[2]=o,t[3]=r):(o=t[2],r=t[3]);let a;t[4]!==l?(a=s.jsx(lt,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":l,className:"relative flex size-7 shrink-0 items-center justify-center rounded-lg text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[o,r]})}),t[4]=l,t[5]=a):a=t[5];let c;return t[6]!==n||t[7]!==a?(c=s.jsx(Fs,{open:n,onOpenChange:i,children:a}),t[6]=n,t[7]=a,t[8]=c):c=t[8],c}function Eo(){const t=w.c(15),e=D(),[n,i]=ee.useState(!1),l=je();let o;t[0]!==l||t[1]!==e?(o=l?e("sidebar.inbox.title"):void 0,t[0]=l,t[1]=e,t[2]=o):o=t[2];let r,a;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ct,{}),a=s.jsx(As,{}),t[3]=r,t[4]=a):(r=t[3],a=t[4]);let c;t[5]!==e?(c=e("sidebar.inbox.title"),t[5]=e,t[6]=c):c=t[6];let d;t[7]!==c?(d=s.jsx("span",{className:"truncate",children:c}),t[7]=c,t[8]=d):d=t[8];let m;t[9]!==o||t[10]!==d?(m=s.jsx(lt,{asChild:!0,children:s.jsxs(we,{tooltip:o,className:"relative",children:[r,a,d]})}),t[9]=o,t[10]=d,t[11]=m):m=t[11];let u;return t[12]!==n||t[13]!==m?(u=s.jsx(Fs,{open:n,onOpenChange:i,children:m}),t[12]=n,t[13]=m,t[14]=u):u=t[14],u}function pe(t){const e=w.c(35),{icon:n,label:i,isActive:l,link:o,onSelect:r,ariaLabel:a,className:c,dataTour:d,children:m,trailing:u,contextId:p}=t,f=l===void 0?!1:l,x=je(),h=a??i,g=x?h:void 0;let b;e[0]!==c||e[1]!==d||e[2]!==f||e[3]!==g?(b={isActive:f,tooltip:g,className:c,"data-tour":d},e[0]=c,e[1]=d,e[2]=f,e[3]=g,e[4]=b):b=e[4];const v=b;let j;e[5]!==u?(j=u&&s.jsx("span",{className:"order-last ml-auto flex shrink-0 items-center group-data-[state=collapsed]/sidebar:hidden",children:u}),e[5]=u,e[6]=j):j=e[6];let k;e[7]!==i?(k=s.jsx("span",{className:"truncate",children:i}),e[7]=i,e[8]=k):k=e[8];let S;e[9]!==n||e[10]!==j||e[11]!==k?(S=s.jsxs(s.Fragment,{children:[n,j,k]}),e[9]=n,e[10]=j,e[11]=k,e[12]=S):S=e[12];const N=S;if(o){const y=f?"page":void 0;let $;e[13]!==N||e[14]!==o||e[15]!==h||e[16]!==r||e[17]!==y?($=s.jsx(et,{...o,"aria-label":h,"aria-current":y,onClick:r,children:N}),e[13]=N,e[14]=o,e[15]=h,e[16]=r,e[17]=y,e[18]=$):$=e[18];let I;e[19]!==v||e[20]!==$?(I=s.jsx(we,{asChild:!0,...v,children:$}),e[19]=v,e[20]=$,e[21]=I):I=e[21];let z;return e[22]!==m||e[23]!==p||e[24]!==I?(z=s.jsxs(be,{"data-context-id":p,children:[I,m]}),e[22]=m,e[23]=p,e[24]=I,e[25]=z):z=e[25],z}let _;e[26]!==N||e[27]!==h||e[28]!==r||e[29]!==v?(_=s.jsx(we,{...v,"aria-label":h,onClick:r,children:N}),e[26]=N,e[27]=h,e[28]=r,e[29]=v,e[30]=_):_=e[30];let C;return e[31]!==m||e[32]!==p||e[33]!==_?(C=s.jsxs(be,{"data-context-id":p,children:[_,m]}),e[31]=m,e[32]=p,e[33]=_,e[34]=C):C=e[34],C}function Ds(t){const e=w.c(5),{label:n,link:i,onSelect:l}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ni,{size:16}),e[0]=o):o=e[0];let r;return e[1]!==n||e[2]!==i||e[3]!==l?(r=s.jsx("div",{className:"contents",children:s.jsx(re,{className:"shrink-0",children:s.jsx(pe,{icon:o,label:n,className:"text-sidebar-foreground/70",link:i,onSelect:l})})}),e[1]=n,e[2]=i,e[3]=l,e[4]=r):r=e[4],r}function Ro(t){return t==="board"?"kanban":t==="cdn"?"monitoring":rs(t)?"cms":null}function Tt(){const t=w.c(2),{data:e}=vs();let n;return t[0]!==e?(n=i=>{const l=Ro(i);return!l||!e?!1:e.features[l]!==!0},t[0]=e,t[1]=n):n=t[1],n}const Ms="settings",Lo=["overview","files","plan","tasks","monitor"];function qo(){const t=w.c(10),e=D(),{org:n}=ie(),i=Be(),l=De();let o;if(t[0]!==i||t[1]!==n.slug||t[2]!==l||t[3]!==e){let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(xs,{size:16}),t[5]=r):r=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Kn,{size:16}),t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(It,{size:16}),t[7]=c):c=t[7];let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Wn,{size:16}),t[8]=d):d=t[8];let m;t[9]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Pt,{size:16}),t[9]=m):m=t[9];const u={overview:{key:"overview",label:e("sidebar.navDestinations.overview"),icon:r,isActive:l?i===oe.root||i===`${oe.root}/`:i===V.home||i===V.orgIndex,trackAs:"overview",link:l?{to:oe.root,params:{org:n.slug,agentId:l}}:{to:V.home,params:{org:n.slug}}},plan:{key:"plan",label:e("sidebar.navDestinations.plan"),icon:a,isActive:i===V.plan||i===oe.plan,trackAs:"plan",soon:!0,link:l?{to:oe.plan,params:{org:n.slug,agentId:l}}:{to:V.plan,params:{org:n.slug}}},tasks:{key:"tasks",label:e("sidebar.navDestinations.spineTasks"),icon:c,isActive:i===V.tasks||i===oe.tasks,trackAs:"board",link:l?{to:oe.tasks,params:{org:n.slug,agentId:l,taskKey:void 0}}:{to:V.tasks,params:{org:n.slug,taskKey:void 0}}},monitor:{key:"monitor",label:e("sidebar.navDestinations.monitor"),icon:d,isActive:i===V.monitoring||i===oe.monitoring,trackAs:"monitor",soon:!0,link:l?{to:oe.monitoring,params:{org:n.slug,agentId:l}}:{to:V.monitoring,params:{org:n.slug}}},files:{key:"files",label:e("sidebar.navDestinations.context"),icon:m,isActive:i===V.library||i===oe.library,trackAs:"files",link:l?{to:oe.library,params:{org:n.slug,agentId:l}}:{to:V.library,params:{org:n.slug}}}};o=Lo.map(p=>u[p]),t[0]=i,t[1]=n.slug,t[2]=l,t[3]=e,t[4]=o}else o=t[4];return o}function Bo(t){const e=w.c(11),{onNavigate:n}=t,i=D(),l=qo(),o=Tt();let r;if(e[0]!==l||e[1]!==o||e[2]!==n||e[3]!==i){let c;e[5]!==o||e[6]!==n||e[7]!==i?(c=d=>s.jsx(pe,{icon:d.icon,label:d.label,isActive:d.isActive,link:d.link,trailing:d.soon?s.jsx(yi,{variant:"muted",children:i("common.soon")}):o(d.key)?s.jsx(tt,{size:14,className:"text-muted-foreground"}):void 0,onSelect:()=>{le("nav_destination_clicked",{destination:d.trackAs}),n?.()}},d.key),e[5]=o,e[6]=n,e[7]=i,e[8]=c):c=e[8],r=l.map(c),e[0]=l,e[1]=o,e[2]=n,e[3]=i,e[4]=r}else r=e[4];let a;return e[9]!==r?(a=s.jsx(re,{className:"gap-1",children:r}),e[9]=r,e[10]=a):a=e[10],a}function Es(){const t=w.c(7),{org:e}=ie(),{setOpenMobile:n}=as();let i;t[0]!==e.slug?(i={org:e.slug},t[0]=e.slug,t[1]=i):i=t[1];let l;t[2]!==n?(l=()=>{le("nav_destination_clicked",{destination:Ms,target:"org"}),n(!1)},t[2]=n,t[3]=l):l=t[3];let o;return t[4]!==i||t[5]!==l?(o={to:"/$org/settings",params:i,onClick:l},t[4]=i,t[5]=l,t[6]=o):o=t[6],o}function Rs(){const t=w.c(6),e=D(),n=Es();let i;t[0]!==e?(i=e("sidebar.navDestinations.settings"),t[0]=e,t[1]=i):i=t[1];const l=i;let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(rt,{size:15}),t[2]=o):o=t[2];let r;return t[3]!==l||t[4]!==n?(r=s.jsx(et,{...n,"aria-label":l,title:l,className:"relative flex size-7 shrink-0 items-center justify-center rounded-lg text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground","data-tour":ce.settings,children:o}),t[3]=l,t[4]=n,t[5]=r):r=t[5],r}function Vo(){const t=w.c(12),e=D(),n=je(),i=Es();let l;t[0]!==e?(l=e("sidebar.navDestinations.settings"),t[0]=e,t[1]=l):l=t[1];const o=l,r=n?o:void 0;let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(at,{children:s.jsx(rt,{size:16})}),t[2]=a):a=t[2];let c;t[3]!==o?(c=s.jsx("span",{children:o}),t[3]=o,t[4]=c):c=t[4];let d;t[5]!==o||t[6]!==i||t[7]!==c?(d=s.jsxs(et,{...i,"aria-label":o,children:[a,c]}),t[5]=o,t[6]=i,t[7]=c,t[8]=d):d=t[8];let m;return t[9]!==r||t[10]!==d?(m=s.jsx(we,{asChild:!0,tooltip:r,"data-tour":ce.settings,children:d}),t[9]=r,t[10]=d,t[11]=m):m=t[11],m}function Lt(){const t=w.c(10),e=D();let n;t[0]!==e?(n=e("sidebar.sidebarFooter.inviteMembers"),t[0]=e,t[1]=n):n=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(at,{children:s.jsx(Gn,{className:Xe})}),t[2]=i):i=t[2];let l;t[3]!==e?(l=e("sidebar.sidebarFooter.inviteMembers"),t[3]=e,t[4]=l):l=t[4];let o;t[5]!==l?(o=s.jsx("span",{children:l}),t[5]=l,t[6]=o):o=t[6];let r;return t[7]!==n||t[8]!==o?(r=s.jsx(re,{className:"gap-0.5",children:s.jsx(be,{children:s.jsx(mi,{trigger:s.jsxs(we,{tooltip:n,children:[i,o]})})})}),t[7]=n,t[8]=o,t[9]=r):r=t[9],r}function Uo(){const t=w.c(24),e=je(),i=!bi(),l=Ce();if(e){let p;t[0]!==i?(p=i&&s.jsx(Rt,{}),t[0]=i,t[1]=p):p=t[1];let f;t[2]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Lt,{}),t[2]=f):f=t[2];let x;t[3]!==l?(x=l&&s.jsx(be,{children:s.jsx(Vo,{})}),t[3]=l,t[4]=x):x=t[4];let h;t[5]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(be,{children:s.jsx(Eo,{})}),t[5]=h):h=t[5];let g;t[6]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(be,{children:s.jsx(vt,{})}),t[6]=g):g=t[6];let b;t[7]!==x?(b=s.jsxs(re,{children:[x,h,g]}),t[7]=x,t[8]=b):b=t[8];let v;return t[9]!==p||t[10]!==b?(v=s.jsxs(gt,{className:"px-2 pb-3 gap-1",children:[p,f,b]}),t[9]=p,t[10]=b,t[11]=v):v=t[11],v}let o;t[12]!==i?(o=i&&s.jsx(Rt,{}),t[12]=i,t[13]=o):o=t[13];let r;t[14]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Lt,{}),t[14]=r):r=t[14];let a;t[15]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(vt,{})}),t[15]=a):a=t[15];let c;t[16]!==l?(c=l&&s.jsx(Rs,{}),t[16]=l,t[17]=c):c=t[17];let d;t[18]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Os,{}),t[18]=d):d=t[18];let m;t[19]!==c?(m=s.jsx(re,{className:"gap-0.5",children:s.jsx(be,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[a,c,d]})})}),t[19]=c,t[20]=m):m=t[20];let u;return t[21]!==o||t[22]!==m?(u=s.jsxs(gt,{className:"px-2 pb-3 gap-0.5",children:[o,r,m]}),t[21]=o,t[22]=m,t[23]=u):u=t[23],u}function Ho(){const t=w.c(6),e=Ce();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(re,{children:s.jsx(be,{children:s.jsx(vt,{})})})}),t[0]=n):n=t[0];let i;t[1]!==e?(i=e&&s.jsx(Rs,{}),t[1]=e,t[2]=i):i=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Os,{}),t[3]=l):l=t[3];let o;return t[4]!==i?(o=s.jsx(gt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[n,i,l]})}),t[4]=i,t[5]=o):o=t[5],o}function Ko(t){const e=w.c(13),n=t.trim(),{data:i}=ze.useSession(),l=i?.user?.id??"",o=n.length>0&&!!l,r=Ee.projectSearch(l,n);let a;e[0]!==n?(a=async b=>{const{signal:v}=b,j=await fetch(`/api/_me/projects/search?q=${encodeURIComponent(n)}`,{signal:v});if(!j.ok)throw new Error(`Project search failed: ${j.status}`);return await j.json()},e[0]=n,e[1]=a):a=e[1];let c;e[2]!==o||e[3]!==r||e[4]!==a?(c={queryKey:r,queryFn:a,enabled:o,placeholderData:nn,staleTime:3e4,retry:!1},e[2]=o,e[3]=r,e[4]=a,e[5]=c):c=e[5];const{data:d,isFetching:m,isPlaceholderData:u,isError:p}=Ve(c);let f;e[6]!==d?.items?(f=d?.items??[],e[6]=d?.items,e[7]=f):f=e[7];const x=o&&m,h=o&&u;let g;return e[8]!==p||e[9]!==f||e[10]!==x||e[11]!==h?(g={hits:f,isSearching:x,isStale:h,isError:p},e[8]=p,e[9]=f,e[10]=x,e[11]=h,e[12]=g):g=e[12],g}function qt(t){const e=w.c(15),{id:n,label:i,createLabel:l,onCreate:o}=t;let r;e[0]!==n||e[1]!==i?(r=s.jsx("span",{id:n,className:"truncate",children:i}),e[0]=n,e[1]=i,e[2]=r):r=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Le,{size:14}),e[3]=a):a=e[3];let c;e[4]!==l||e[5]!==o?(c=s.jsx(_t,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":l,className:"-my-1 shrink-0 cursor-pointer rounded-lg p-1 text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground focus-ring",onClick:o,children:a})}),e[4]=l,e[5]=o,e[6]=c):c=e[6];let d;e[7]!==l?(d=s.jsx(wt,{side:"right",children:l}),e[7]=l,e[8]=d):d=e[8];let m;e[9]!==c||e[10]!==d?(m=s.jsxs($t,{children:[c,d]}),e[9]=c,e[10]=d,e[11]=m):m=e[11];let u;return e[12]!==r||e[13]!==m?(u=s.jsxs("div",{className:"flex w-full items-center justify-between gap-2 px-2 py-1.5 text-xs font-medium text-muted-foreground",children:[r,m]}),e[12]=r,e[13]=m,e[14]=u):u=e[14],u}const Ze="min-h-9 items-center",Te={allProjects:"scope:__all__",project:t=>`scope:${t}`,org:t=>`org:${t}`,foreignProject:(t,e)=>`travel:${t}:${e}`};function Wo(t){const e=w.c(9),{active:n,rows:i}=t,l=D();let o,r,a;if(e[0]!==n||e[1]!==i||e[2]!==l){a=Symbol.for("react.early_return_sentinel");e:{const d=i.get(n);if(d?.kind!=="travel"){a=null;break e}o="border-t border-border px-3 py-2 text-xs text-warning",r=l("sidebar.picker.verbTravel",{name:d.label})}e[0]=n,e[1]=i,e[2]=l,e[3]=o,e[4]=r,e[5]=a}else o=e[3],r=e[4],a=e[5];if(a!==Symbol.for("react.early_return_sentinel"))return a;let c;return e[6]!==o||e[7]!==r?(c=s.jsx("div",{className:o,children:r}),e[6]=o,e[7]=r,e[8]=c):c=e[8],c}function Go(t){const e=w.c(25),{onClose:n,onCreateOrg:i,className:l}=t,o=D(),r=ee.useId(),a=ee.useId(),c=qe(),{org:d}=ie(),{scopeId:m,projects:u,setScope:p}=Ie(),{hasMore:f}=Pi(),[x,h]=ee.useState(""),[g,b]=ee.useState(Te.allProjects),v=ee.useDeferredValue(x);let j;e[0]!==v?(j=v.trim(),e[0]=v,e[1]=j):j=e[1];const k=j,S=k.length>0,{data:N}=on(),{invitations:_,refetch:C}=ct();let y;e[2]!==d.slug?(y=(T,Z)=>T.slug===d.slug?-1:Z.slug===d.slug?1:0,e[2]=d.slug,e[3]=y):y=e[3];const $=Tn(N??[],d).sort(y),{hits:I,isSearching:z,isStale:R,isError:E}=Ko(S?k:""),F=zn(S?k:""),K=F.hits,q=Be();let J;e[4]!==q?(J=q.startsWith("/$org/settings"),e[4]=q,e[5]=J):J=e[5];const X=J,B=new Map;let te;e[6]!==X||e[7]!==n||e[8]!==p?(te=T=>{le("scope_set",{scoped:T!==null,fromSettings:X}),p(T),n()},e[6]=X,e[7]=n,e[8]=p,e[9]=te):te=e[9];const W=te;let Y;e[10]!==c||e[11]!==n?(Y=(T,Z)=>{le("org_project_travel",{scoped:!!Z}),c(Z?{to:"/$org/projects/$agentId",params:{org:T,agentId:Z}}:{to:"/$org/home",params:{org:T}}),n()},e[10]=c,e[11]=n,e[12]=Y):Y=e[12];const ne=Y;let A;e[13]!==c||e[14]!==n||e[15]!==d.slug?(A=()=>{le("picker_new_project"),c({to:"/$org/home",params:{org:d.slug}}),n()},e[13]=c,e[14]=n,e[15]=d.slug,e[16]=A):A=e[16];const G=A;B.set(Te.allProjects,{kind:"scope",label:o("sidebar.scope.allProjects")});let P;e[17]!==o?(P=o("sidebar.picker.searchPlaceholder"),e[17]=o,e[18]=P):P=e[18];let M;e[19]!==x||e[20]!==P?(M=s.jsx(Ci,{value:x,onValueChange:h,placeholder:P}),e[19]=x,e[20]=P,e[21]=M):M=e[21];const L=wi,se="max-h-none min-h-0 flex-1",me=S?s.jsxs(s.Fragment,{children:[(E||F.isError)&&s.jsx(Ot,{children:o("sidebar.picker.searchFailed")}),!E&&!F.isError&&!z&&!F.isSearching&&I.length===0&&K.length===0&&s.jsx(Ot,{children:o("sidebar.picker.noMatches",{query:k})}),!E&&I.length>0&&s.jsx(Ge,{heading:o("sidebar.picker.projectsHeading"),className:U(R&&"opacity-50"),children:I.map(T=>s.jsx(Qo,{hit:T,currentOrgSlug:d.slug,scopeId:m,rows:B,onScope:W,onTravel:ne},`${T.orgSlug}:${T.id}`))}),K.length>0&&s.jsx(Ge,{heading:o("sidebar.picker.orgsHeading"),className:U(F.isStale&&"opacity-50"),children:K.map(T=>s.jsx(Bt,{candidate:T,currentOrgSlug:d.slug,rows:B,onTravel:ne,onClose:n},T.id))})]}):s.jsxs(s.Fragment,{children:[s.jsx(qt,{id:r,label:o("sidebar.picker.projectsHeading"),createLabel:o("sidebar.picker.newProject"),onCreate:G}),s.jsxs(Ge,{"aria-labelledby":r,children:[s.jsxs(Je,{value:Te.allProjects,className:Ze,onSelect:()=>W(null),children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:o("sidebar.scope.allProjects")}),m===null&&s.jsx(Re,{size:14})]}),u.map(T=>{const Z=Te.project(T.id);return B.set(Z,{kind:"scope",label:T.title}),s.jsxs(Je,{value:Z,className:Ze,onSelect:()=>W(T.id),children:[s.jsx(Ae,{icon:T.icon,name:T.title}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:T.title}),m===T.id&&s.jsx(Re,{size:14})]},T.id)}),f&&s.jsx("p",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:o("sidebar.picker.moreExist")})]}),s.jsx(qt,{id:a,label:o("sidebar.picker.orgsHeading"),createLabel:o("sidebar.picker.newOrganization"),onCreate:i}),s.jsxs(Ge,{"aria-labelledby":a,children:[_.map(T=>s.jsx(os,{invitation:T,onChanged:C},T.id)),$.map(T=>s.jsx(Bt,{candidate:T,currentOrgSlug:d.slug,rows:B,onTravel:ne,onClose:n},T.id))]})]});let ae;return e[22]!==L||e[23]!==me?(ae=s.jsx(L,{className:se,children:me}),e[22]=L,e[23]=me,e[24]=ae):ae=e[24],s.jsxs($i,{shouldFilter:!1,value:g,onValueChange:b,className:l,children:[M,ae,s.jsx(Wo,{active:g,rows:B})]})}function Bt(t){const e=w.c(22),{candidate:n,currentOrgSlug:i,rows:l,onTravel:o,onClose:r}=t,a=n.slug===i;let c;e[0]!==n.name||e[1]!==n.slug||e[2]!==a||e[3]!==l?(c=Te.org(n.slug),l.set(c,{kind:a?"scope":"travel",label:n.name}),e[0]=n.name,e[1]=n.slug,e[2]=a,e[3]=l,e[4]=c):c=e[4];let d;e[5]!==n.slug||e[6]!==a||e[7]!==r||e[8]!==o?(d=()=>a?r():o(n.slug),e[5]=n.slug,e[6]=a,e[7]=r,e[8]=o,e[9]=d):d=e[9];let m;e[10]!==n?(m=s.jsx(ls,{org:n,size:"xs"}),e[10]=n,e[11]=m):m=e[11];let u;e[12]!==n.name?(u=s.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.name}),e[12]=n.name,e[13]=u):u=e[13];let p;e[14]!==a?(p=a&&s.jsx(Re,{size:14}),e[14]=a,e[15]=p):p=e[15];let f;return e[16]!==d||e[17]!==m||e[18]!==u||e[19]!==p||e[20]!==c?(f=s.jsxs(Je,{value:c,className:Ze,onSelect:d,children:[m,u,p]}),e[16]=d,e[17]=m,e[18]=u,e[19]=p,e[20]=c,e[21]=f):f=e[21],f}function Qo(t){const e=w.c(30),{hit:n,currentOrgSlug:i,scopeId:l,rows:o,onScope:r,onTravel:a}=t,c=n.orgSlug===i;let d;e[0]!==n.id||e[1]!==n.orgSlug||e[2]!==n.title||e[3]!==c||e[4]!==o?(d=c?Te.project(n.id):Te.foreignProject(n.orgSlug,n.id),o.set(d,{kind:c?"scope":"travel",label:n.title}),e[0]=n.id,e[1]=n.orgSlug,e[2]=n.title,e[3]=c,e[4]=o,e[5]=d):d=e[5];let m;e[6]!==n.id||e[7]!==n.orgSlug||e[8]!==c||e[9]!==r||e[10]!==a?(m=()=>c?r(n.id):a(n.orgSlug,n.id),e[6]=n.id,e[7]=n.orgSlug,e[8]=c,e[9]=r,e[10]=a,e[11]=m):m=e[11];let u;e[12]!==n.icon||e[13]!==n.title?(u=s.jsx(Ae,{icon:n.icon,name:n.title}),e[12]=n.icon,e[13]=n.title,e[14]=u):u=e[14];let p;e[15]!==n.title?(p=s.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.title}),e[15]=n.title,e[16]=p):p=e[16];let f;e[17]!==n.orgName?(f=s.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:n.orgName}),e[17]=n.orgName,e[18]=f):f=e[18];let x;e[19]!==n.id||e[20]!==c||e[21]!==l?(x=c&&l===n.id&&s.jsx(Re,{size:14}),e[19]=n.id,e[20]=c,e[21]=l,e[22]=x):x=e[22];let h;return e[23]!==m||e[24]!==u||e[25]!==p||e[26]!==f||e[27]!==x||e[28]!==d?(h=s.jsxs(Je,{value:d,className:Ze,onSelect:m,children:[u,p,f,x]}),e[23]=m,e[24]=u,e[25]=p,e[26]=f,e[27]=x,e[28]=d,e[29]=h):h=e[29],h}function Ls(t){const e=w.c(32),{collapsed:n,onNavigate:i}=t,l=n===void 0?!1:n,o=D(),{org:r}=ie(),{project:a}=Ie(),{invitations:c}=ct(),[d,m]=ee.useState(!1),[u,p]=ee.useState(!1),f=fs();let x;if(e[0]!==l||e[1]!==c.length||e[2]!==r||e[3]!==a||e[4]!==o){const C=a?o("sidebar.picker.projectInOrg",{project:a.title,org:r.name}):r.name;let y;e[6]!==r||e[7]!==a?(y=a?s.jsx(Qn,{icon:a.icon,name:a.title,size:"xs",className:"shrink-0"}):s.jsx(ls,{org:r,size:"sm"}),e[6]=r,e[7]=a,e[8]=y):y=e[8];let $;e[9]!==c.length?($=c.length>0&&s.jsx("span",{className:"absolute -right-1 -top-1 size-2.5 rounded-full bg-destructive ring-2 ring-background"}),e[9]=c.length,e[10]=$):$=e[10];let I;e[11]!==y||e[12]!==$?(I=s.jsxs("div",{className:"relative inline-flex shrink-0",children:[y,$]}),e[11]=y,e[12]=$,e[13]=I):I=e[13];const z=I;x=l?s.jsx(we,{tooltip:C,"data-tour":ce.switcher,children:z}):s.jsxs("button",{type:"button","data-tour":ce.switcher,"aria-label":o("sidebar.picker.ariaLabel",{name:C}),className:U("flex min-w-0 flex-1 items-center gap-2 rounded-lg py-1.5 pl-1 pr-1.5 text-left md:h-[34px] md:py-0","[transition:background-color_180ms_ease] hover:bg-sidebar-accent",_i),children:[z,s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:a?a.title:r.name}),s.jsx(_s,{size:14,className:"shrink-0 text-muted-foreground"})]}),e[0]=l,e[1]=c.length,e[2]=r,e[3]=a,e[4]=o,e[5]=x}else x=e[5];const h=x,g=f?"min-h-0 flex-1":"max-h-[min(560px,70dvh,var(--radix-popover-content-available-height,70dvh))]";let b;e[14]!==i?(b=()=>{m(!1),i?.()},e[14]=i,e[15]=b):b=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{m(!1),p(!0)},e[16]=v):v=e[16];let j;e[17]!==g||e[18]!==b?(j=s.jsx(Go,{onClose:b,onCreateOrg:v,className:g}),e[17]=g,e[18]=b,e[19]=j):j=e[19];const k=j;let S;e[20]!==l||e[21]!==k||e[22]!==f||e[23]!==d||e[24]!==o||e[25]!==h?(S=f?s.jsxs(ds,{open:d,onOpenChange:m,direction:"bottom",children:[s.jsx(Mn,{asChild:!0,children:h}),s.jsxs(ms,{className:"flex max-h-[85dvh] flex-col p-0",children:[s.jsx(us,{className:"sr-only",children:o("sidebar.picker.title")}),k]})]}):s.jsxs(yt,{open:d,onOpenChange:m,children:[s.jsx(lt,{asChild:!0,children:h}),s.jsx(Nt,{side:l?"right":"bottom",align:"start",className:"w-[min(340px,calc(100vw-2rem))] p-0",children:k})]}),e[20]=l,e[21]=k,e[22]=f,e[23]=d,e[24]=o,e[25]=h,e[26]=S):S=e[26];let N;e[27]!==u?(N=s.jsx(Ii,{open:u,onOpenChange:p}),e[27]=u,e[28]=N):N=e[28];let _;return e[29]!==S||e[30]!==N?(_=s.jsxs(s.Fragment,{children:[S,N]}),e[29]=S,e[30]=N,e[31]=_):_=e[31],_}function Yo(t){const e=w.c(7),{collapsed:n}=t,i=n===void 0?!1:n,{org:l}=ie();if(i){let r;e[0]!==l.name?(r=s.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground text-sm",children:l.name}),e[0]=l.name,e[1]=r):r=e[1];let a;return e[2]!==l.name||e[3]!==r?(a=s.jsx("div",{className:"flex items-center justify-center",title:l.name,"data-tour":ce.switcher,children:r}),e[2]=l.name,e[3]=r,e[4]=a):a=e[4],a}let o;return e[5]!==l.name?(o=s.jsx("div",{className:"flex min-w-0 flex-1 items-center py-1.5 pr-1.5 pl-2 md:h-[34px] md:py-0","data-tour":ce.switcher,children:s.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground text-sm",children:l.name})}),e[5]=l.name,e[6]=o):o=e[6],o}function qs(t){const e=w.c(36),{collapsed:n,onNavigate:i}=t,l=n===void 0?!1:n,o=D(),{project:r,projects:a}=Ie(),c=Ue(),d=zs();if(!r){let k;return e[0]!==l?(k=s.jsx(Yo,{collapsed:l}),e[0]=l,e[1]=k):k=e[1],k}let m;e[2]!==r.icon||e[3]!==r.title?(m=s.jsx(Ae,{icon:r.icon,name:r.title}),e[2]=r.icon,e[3]=r.title,e[4]=m):m=e[4];let u;e[5]!==l||e[6]!==r.title?(u=!l&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground text-sm",children:r.title}),s.jsx(_s,{size:14,className:"shrink-0 text-muted-foreground"})]}),e[5]=l,e[6]=r.title,e[7]=u):u=e[7];let p;e[8]!==r.title||e[9]!==m||e[10]!==u?(p=s.jsx(st,{asChild:!0,children:s.jsxs("button",{type:"button",title:r.title,className:"flex min-w-0 flex-1 items-center gap-2 rounded-lg py-1.5 pr-1.5 pl-2 text-left transition-colors hover:bg-sidebar-accent md:h-[34px] md:py-0",children:[m,u]})}),e[8]=r.title,e[9]=m,e[10]=u,e[11]=p):p=e[11];let f;if(e[12]!==c||e[13]!==i||e[14]!==r.id||e[15]!==a){let k;e[17]!==c||e[18]!==i||e[19]!==r.id?(k=S=>s.jsxs(fe,{className:"gap-2",onSelect:()=>{c(S.id),i?.()},children:[s.jsx(Ae,{icon:S.icon,name:S.title}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:S.title}),S.id===r.id&&s.jsx(Re,{size:14,className:"shrink-0 text-muted-foreground"})]},S.id),e[17]=c,e[18]=i,e[19]=r.id,e[20]=k):k=e[20],f=a.map(k),e[12]=c,e[13]=i,e[14]=r.id,e[15]=a,e[16]=f}else f=e[16];let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Xt,{}),e[21]=x):x=e[21];let h;e[22]!==d||e[23]!==i?(h=()=>{d(),i?.()},e[22]=d,e[23]=i,e[24]=h):h=e[24];let g;e[25]!==o?(g=o("sidebar.scope.allProjects"),e[25]=o,e[26]=g):g=e[26];let b;e[27]!==h||e[28]!==g?(b=s.jsx(fe,{onSelect:h,children:g}),e[27]=h,e[28]=g,e[29]=b):b=e[29];let v;e[30]!==f||e[31]!==b?(v=s.jsxs(nt,{align:"start",className:"max-h-96 w-64 overflow-y-auto",children:[f,x,b]}),e[30]=f,e[31]=b,e[32]=v):v=e[32];let j;return e[33]!==v||e[34]!==p?(j=s.jsxs(it,{children:[p,v]}),e[33]=v,e[34]=p,e[35]=j):j=e[35],j}const Bs=16;function Jo(){const t=w.c(12),e=je();if(Ce()){let a;t[0]!==e?(a=s.jsx(qs,{collapsed:e}),t[0]=e,t[1]=a):a=t[1];let c,d;t[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Vt,{}),d=s.jsx(ht,{}),t[2]=c,t[3]=d):(c=t[2],d=t[3]);let m;return t[4]!==a?(m=s.jsxs(s.Fragment,{children:[a,c,d]}),t[4]=a,t[5]=m):m=t[5],m}let i;t[6]!==e?(i=s.jsx(Ls,{collapsed:e}),t[6]=e,t[7]=i):i=t[7];let l,o;t[8]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Vt,{}),o=s.jsx(ht,{}),t[8]=l,t[9]=o):(l=t[8],o=t[9]);let r;return t[10]!==i?(r=s.jsxs(s.Fragment,{children:[i,l,o]}),t[10]=i,t[11]=r):r=t[11],r}function Xo(t){const e=w.c(13),{onClose:n}=t,i=D(),l=Ce();let o;e[0]!==n||e[1]!==l?(o=l?s.jsx(qs,{onNavigate:n}):s.jsxs(s.Fragment,{children:[s.jsx(Ls,{onNavigate:n}),s.jsx("div",{className:"flex-1"})]}),e[0]=n,e[1]=l,e[2]=o):o=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ht,{}),e[3]=r):r=e[3];let a;e[4]!==i?(a=i("sidebar.header.closeSidebar"),e[4]=i,e[5]=a):a=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(gs,{size:Bs}),e[6]=c):c=e[6];let d;e[7]!==n||e[8]!==a?(d=s.jsx(Ns,{onClick:n,"aria-label":a,children:c}),e[7]=n,e[8]=a,e[9]=d):d=e[9];let m;return e[10]!==o||e[11]!==d?(m=s.jsxs(s.Fragment,{children:[o,r,d]}),e[10]=o,e[11]=d,e[12]=m):m=e[12],m}function Vt(){const t=w.c(13),e=D(),n=je(),{toggleSidebar:i}=as(),l=n?"page.expandSidebar":"page.collapseSidebar";let o;t[0]!==e||t[1]!==l?(o=e(l),t[0]=e,t[1]=l,t[2]=o):o=t[2];const r=o;let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(gs,{size:Bs}),t[3]=a):a=t[3];let c;t[4]!==r||t[5]!==i?(c=s.jsx(_t,{asChild:!0,children:s.jsx(Ns,{"aria-label":r,onClick:i,className:"shrink-0 group-data-[state=collapsed]/sidebar:mx-auto size-7 group-data-[state=collapsed]/sidebar:size-8",children:a})}),t[4]=r,t[5]=i,t[6]=c):c=t[6];const d=!n;let m;t[7]!==r||t[8]!==d?(m=s.jsx(wt,{side:"right",hidden:d,children:r}),t[7]=r,t[8]=d,t[9]=m):m=t[9];let u;return t[10]!==c||t[11]!==m?(u=s.jsxs($t,{children:[c,m]}),t[10]=c,t[11]=m,t[12]=u):u=t[12],u}const Zo=["overview","reports","board","files","threadAnalytics"];function el(t,e){return!t||!e||Ai(e)?!1:!ws(e.metadata)}function tl(t,e,n,i){if(!t||!e)return!0;const l=i!==void 0;return Fi(l?i:$s(e.metadata),l?1:e.metadata?.sidebarViewsVersion).includes(n)}function sl(){const t=w.c(17),e=D(),{org:n}=ie(),i=Be(),l=De(),{project:o,repo:r}=Ie(),a=Cs(o?.id),c=zi().data?.isAdmin===!0;let d;t[0]!==o||t[1]!==l?(d=el(l,o),t[0]=o,t[1]=l,t[2]=d):d=t[2];const m=d;let u;t[3]!==a||t[4]!==o||t[5]!==l?(u=x=>tl(l,o,x,a),t[3]=a,t[4]=o,t[5]=l,t[6]=u):u=t[6];const p=u;let f;if(t[7]!==p||t[8]!==c||t[9]!==m||t[10]!==i||t[11]!==n||t[12]!==o?.id||t[13]!==r||t[14]!==l||t[15]!==e){const x={overview:m||!p("overview")?null:{key:"overview",label:e("sidebar.navDestinations.home"),icon:s.jsx(xs,{size:16}),isActive:i===V.home||i===V.orgIndex||i===oe.root||i===`${oe.root}/`,trackAs:"overview",link:l?{to:oe.root,params:{org:n.slug,agentId:l}}:{to:V.home,params:{org:n.slug}}},reports:mt(V.reports,l)&&!m&&p("reports")?{key:"reports",label:e("sidebar.navDestinations.reports"),icon:s.jsx(hs,{size:16}),isActive:i===V.reports||i===oe.reports,trackAs:"reports",link:l?{to:oe.reports,params:{org:n.slug,agentId:l}}:{to:V.reports,params:{org:n.slug}}}:null,board:m||!p("board")?null:{key:"board",label:e("sidebar.navDestinations.tasks"),icon:s.jsx(It,{size:16}),isActive:i===V.tasks||i===oe.tasks,trackAs:"board",dataTour:ce.tasks,link:{to:l?oe.tasks:V.tasks,params:{org:n.slug,agentId:l??void 0,taskKey:void 0},search:h=>{const g=r??o?.id;return g?{...h,repo:g}:h}}},files:mt(V.library,l)?{key:"files",label:e("sidebar.navDestinations.library"),icon:s.jsx(Pt,{size:16}),isActive:i===V.library,trackAs:"files",link:{to:V.library,params:{org:n.slug}}}:null,threadAnalytics:c&&mt(V.threadAnalytics,l)?{key:"threadAnalytics",label:e("sidebar.navDestinations.threadAnalytics"),icon:s.jsx(Yn,{size:16}),isActive:i===V.threadAnalytics,trackAs:"thread_analytics",link:{to:V.threadAnalytics,params:{org:n.slug}}}:null};f=Zo.map(h=>x[h]).filter(nl),t[7]=p,t[8]=c,t[9]=m,t[10]=i,t[11]=n,t[12]=o?.id,t[13]=r,t[14]=l,t[15]=e,t[16]=f}else f=t[16];return f}function nl(t){return t!==null}function il(t){const e=w.c(9),{onNavigate:n}=t,i=sl(),l=Tt();let o;if(e[0]!==i||e[1]!==l||e[2]!==n){let a;e[4]!==l||e[5]!==n?(a=c=>s.jsx(pe,{icon:c.icon,label:c.label,dataTour:c.dataTour,isActive:c.isActive,link:c.link,trailing:l(c.key)?s.jsx(tt,{size:14,className:"text-muted-foreground"}):void 0,onSelect:()=>{le("nav_destination_clicked",{destination:c.trackAs}),n?.()}},c.key),e[4]=l,e[5]=n,e[6]=a):a=e[6],o=i.map(a),e[0]=i,e[1]=l,e[2]=n,e[3]=o}else o=e[3];let r;return e[7]!==o?(r=s.jsx(re,{className:"gap-1",children:o}),e[7]=o,e[8]=r):r=e[8],r}function ol(t){const e=w.c(18),{onNavigate:n}=t,i=D(),{org:l}=ie(),o=De(),r=Ue(),a=Be(),c=ln();let d;e[0]!==c||e[1]!==a?(d=a.startsWith("/$org/settings")||a.startsWith(V.projects)&&c==="settings",e[0]=c,e[1]=a,e[2]=d):d=e[2];const m=d;let u;e[3]!==i?(u=i("sidebar.navDestinations.settings"),e[3]=i,e[4]=u):u=e[4];const p=u;let f;e[5]!==l||e[6]!==o?(f=o?void 0:{to:"/$org/settings",params:{org:l.slug}},e[5]=l,e[6]=o,e[7]=f):f=e[7];const x=f;let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(rt,{size:16}),e[8]=h):h=e[8];let g;e[9]!==r||e[10]!==n||e[11]!==o?(g=()=>{le("nav_destination_clicked",{destination:Ms,target:o?"project":"org"}),o&&r(o,{panel:"settings"}),n?.()},e[9]=r,e[10]=n,e[11]=o,e[12]=g):g=e[12];let b;return e[13]!==m||e[14]!==p||e[15]!==x||e[16]!==g?(b=s.jsx(re,{className:"gap-1",children:s.jsx(pe,{dataTour:ce.settings,icon:h,label:p,isActive:m,link:x,onSelect:g})}),e[13]=m,e[14]=p,e[15]=x,e[16]=g,e[17]=b):b=e[17],b}function Ut(t){const e=w.c(26),{onNavigate:n,heading:i}=t,l=D(),{project:o}=Ie(),r=Ue(),a=Be(),c=Bi(),d=Oi(o),m=Tt(),u=Cs(o?.id);if(!o)return null;let p;if(e[0]!==d.presence||e[1]!==u||e[2]!==o.metadata){const N=ws(o.metadata),_=u??$s(o.metadata);p=new Set(Di(_,Ei(N,d.presence),u!==void 0?1:o.metadata.sidebarViewsVersion,u!==void 0?[]:Mi(o.metadata.sidebarViewsSeen,d.presence.calendar))),e[0]=d.presence,e[1]=u,e[2]=o.metadata,e[3]=p}else p=e[3];const f=p;let x,h,g,b;if(e[4]!==c||e[5]!==i||e[6]!==m||e[7]!==a||e[8]!==r||e[9]!==n||e[10]!==o||e[11]!==f||e[12]!==l){b=[],f.has("site-editor")&&b.push({key:"site-editor",label:l("sidebar.projectNav.siteEditor"),icon:s.jsx(js,{size:16}),panel:"site-editor",isActive:al,dataTour:ce.siteEditor});const N={assets:{label:l("common.mainPanelTabs.assets"),icon:s.jsx(Li,{size:16})},releases:{label:l("common.mainPanelTabs.releases"),icon:s.jsx(si,{size:16})},hosting:{label:l("common.mainPanelTabs.hosting"),icon:s.jsx(an,{size:16})},e2e:{label:l("common.mainPanelTabs.e2e"),icon:s.jsx(ti,{size:16})},analytics:{label:l("common.mainPanelTabs.analytics"),icon:s.jsx(hs,{size:16})},cdn:{label:l("common.mainPanelTabs.cdn"),icon:s.jsx(ei,{size:16})},experiments:{label:l("experiments.title"),icon:s.jsx(Zn,{size:16})},calendar:{label:l("common.mainPanelTabs.calendar"),icon:s.jsx(Xn,{size:16})}};for(const y of Ri){if(!f.has(y))continue;const $=N[y];b.push({key:y,label:$.label,icon:$.icon,panel:y,isActive:I=>I===y})}for(const y of Vi(Ui(o),(o.connections??[]).map(rl))){if(y.toolName==="fetch_assets")continue;const $=rn(y.connectionId,y.toolName),I=Hi({tabId:$,kind:"expanded",iconUrl:y.icon,connections:[]}),z=y.label||y.toolName,{IconComp:R}=Jn(z);b.push({key:`pinned:${y.connectionId}:${y.toolName}`,label:z,icon:I.kind==="fallback"?s.jsx(R,{size:16}):s.jsx(Ki,{icon:I}),panel:$,isActive:E=>E===$})}f.has("automations")&&b.push({key:"automations",label:l("sidebar.projectNav.automations"),icon:s.jsx(ps,{size:16}),panel:"automations",isActive:ll,dataTour:ce.automations});const _=a.startsWith(V.projects),C=y=>{if(!i)return y.icon;const $=qi[y.panel];return s.jsx("span",{className:U("flex size-5 shrink-0 items-center justify-center rounded-md [&_svg]:size-3",$?$.tone:"bg-muted text-muted-foreground"),children:$?s.jsx($.Icon,{size:12,className:"text-current"}):y.icon})};x=re,h="gap-1",g=b.map(y=>s.jsx(pe,{icon:C(y),label:y.label,dataTour:y.dataTour,isActive:_&&y.isActive(c),trailing:m(y.panel)?s.jsx(tt,{size:14,className:"text-muted-foreground"}):void 0,onSelect:()=>{le("project_nav_clicked",{surface:y.key}),r(o.id,{panel:y.panel}),n?.()}},y.key)),e[4]=c,e[5]=i,e[6]=m,e[7]=a,e[8]=r,e[9]=n,e[10]=o,e[11]=f,e[12]=l,e[13]=x,e[14]=h,e[15]=g,e[16]=b}else x=e[13],h=e[14],g=e[15],b=e[16];let v;e[17]!==x||e[18]!==h||e[19]!==g?(v=s.jsx(x,{className:h,children:g}),e[17]=x,e[18]=h,e[19]=g,e[20]=v):v=e[20];const j=v;if(!i)return j;if(b.length===0)return null;let k;e[21]!==i?(k=s.jsx("div",{className:"flex h-6 items-center px-2 group-data-[state=collapsed]/sidebar:hidden",children:s.jsx("span",{className:"truncate font-medium text-xs text-muted-foreground",children:i})}),e[21]=i,e[22]=k):k=e[22];let S;return e[23]!==j||e[24]!==k?(S=s.jsxs("div",{className:"flex flex-col gap-1",children:[k,j]}),e[23]=j,e[24]=k,e[25]=S):S=e[25],S}function ll(t){return t==="automations"||cn(t)!==null}function rl(t){return t.connection_id}function al(t){return!!t&&rs(t)}const cl=3;function dl(t,e){return t.status==="archived"||t.status==="done"?!1:e&&t.assigneeId===e?!0:Gi(t)||Qi(t)}function ml(t,e,n){const i=new Map;for(const o of e){if(!dl(o,n))continue;const r=Yi(o,t);for(const a of r){const c=i.get(a.id)??[];c.push({task:o,only:r.length===1}),i.set(a.id,c)}}const l=new Map;for(const[o,r]of i)r.sort((a,c)=>Number(c.only)-Number(a.only)||(c.task.updatedAt??"").localeCompare(a.task.updatedAt??"")),l.set(o,r.slice(0,cl).map(a=>a.task));return l}function ul(t){const e=w.c(21),{task:n,orgSlug:i,isLast:l,onNavigate:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("span",{"aria-hidden":"true",className:"absolute top-0 left-4 h-1/2 w-3 rounded-bl-lg border-b border-l border-sidebar-border"}),e[0]=r):r=e[0];let a;e[1]!==l?(a=!l&&s.jsx("span",{"aria-hidden":"true",className:"absolute top-1/2 bottom-0 left-4 border-l border-sidebar-border"}),e[1]=l,e[2]=a):a=e[2];let c;e[3]!==i||e[4]!==n?(c=Ji(i,n),e[3]=i,e[4]=n,e[5]=c):c=e[5];let d;e[6]!==i||e[7]!==c?(d={org:i,taskKey:c},e[6]=i,e[7]=c,e[8]=d):d=e[8];let m;e[9]!==o||e[10]!==n.status?(m=()=>{le("sidebar_attention_task_clicked",{status:n.status}),o?.()},e[9]=o,e[10]=n.status,e[11]=m):m=e[11];let u;e[12]!==n.title?(u=s.jsx("span",{className:"truncate",children:n.title}),e[12]=n.title,e[13]=u):u=e[13];let p;e[14]!==d||e[15]!==m||e[16]!==u?(p=s.jsx(et,{to:"/$org/tasks/{-$taskKey}",params:d,onClick:m,className:"flex h-8 items-center rounded-lg pr-2 pl-9 text-sm text-sidebar-foreground/70 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",children:u}),e[14]=d,e[15]=m,e[16]=u,e[17]=p):p=e[17];let f;return e[18]!==a||e[19]!==p?(f=s.jsxs("li",{className:"relative",children:[r,a,p]}),e[18]=a,e[19]=p,e[20]=f):f=e[20],f}function fl(t){const e=w.c(42),{onNavigate:n}=t,i=D(),l=je(),[o,r]=ee.useState(!1),{granted:a}=Zt("agents:manage"),{org:c,locator:d}=ie(),m=ot(),{projects:u}=Ie(),p=De(),f=Ue(),x=Ti(),{data:h}=ze.useSession();let g;e[0]!==d||e[1]!==m?(g=ys(d,m),e[0]=d,e[1]=m,e[2]=g):g=e[2];const b=!l&&!p;let v;e[3]!==g||e[4]!==b?(v={...g,enabled:b},e[3]=g,e[4]=b,e[5]=v):v=e[5];const{data:j}=Ve(v);if(p||u.length===0&&!a)return null;let k,S,N,_,C,y;if(e[6]!==x||e[7]!==l||e[8]!==j?.items||e[9]!==n||e[10]!==c||e[11]!==u||e[12]!==p||e[13]!==h?.user?.id||e[14]!==i){const E=ml(Is(u),j?.items??[],h?.user?.id);_="flex flex-col gap-2",C=ce.projects,e[21]!==l||e[22]!==i?(y=!l&&s.jsx("p",{className:"px-2 text-xs font-medium text-muted-foreground",children:i("sidebar.projects.heading")}),e[21]=l,e[22]=i,e[23]=y):y=e[23],k=re,S="gap-1",N=u.map(F=>{const K=E.get(F.id)??[];return s.jsx(pe,{icon:s.jsx(Ae,{icon:F.icon,name:F.title}),label:F.title,isActive:F.id===p,link:x(F.id,dn(F.metadata?.ui?.layout)),onSelect:()=>{le("sidebar_project_clicked"),n?.()},children:!l&&K.length>0&&s.jsx("ul",{className:"flex flex-col",children:K.map((q,J)=>s.jsx(ul,{task:q,orgSlug:c.slug,isLast:J===K.length-1,onNavigate:n},q.id))})},F.id)}),e[6]=x,e[7]=l,e[8]=j?.items,e[9]=n,e[10]=c,e[11]=u,e[12]=p,e[13]=h?.user?.id,e[14]=i,e[15]=k,e[16]=S,e[17]=N,e[18]=_,e[19]=C,e[20]=y}else k=e[15],S=e[16],N=e[17],_=e[18],C=e[19],y=e[20];let $;e[24]!==a||e[25]!==i?($=a&&s.jsx(pe,{icon:s.jsx(Le,{size:16}),label:i("sidebar.projects.addProject"),onSelect:()=>r(!0)}),e[24]=a,e[25]=i,e[26]=$):$=e[26];let I;e[27]!==k||e[28]!==S||e[29]!==N||e[30]!==$?(I=s.jsxs(k,{className:S,children:[N,$]}),e[27]=k,e[28]=S,e[29]=N,e[30]=$,e[31]=I):I=e[31];let z;e[32]!==o||e[33]!==f||e[34]!==n?(z=o&&s.jsx(ee.Suspense,{fallback:null,children:s.jsx(Wi,{open:!0,onOpenChange:r,onImportComplete:E=>{const{virtualMcpId:F}=E;F&&f(F),n?.()}})}),e[32]=o,e[33]=f,e[34]=n,e[35]=z):z=e[35];let R;return e[36]!==I||e[37]!==z||e[38]!==_||e[39]!==C||e[40]!==y?(R=s.jsxs("div",{className:_,"data-tour":C,children:[y,I,z]}),e[36]=I,e[37]=z,e[38]=_,e[39]=C,e[40]=y,e[41]=R):R=e[41],R}const Qe={folders:[],preferences:oo,joinedAt:null};function pl(){const t=w.c(11),{org:e}=ie(),n=kt();let i;t[0]!==e.id?(i=Ee.projectSidebar(e.id),t[0]=e.id,t[1]=i):i=t[1];const l=i;let o;t[2]!==e.slug||t[3]!==n||t[4]!==l?(o=d=>lo.subscribe(e.slug,()=>{n.invalidateQueries({queryKey:l}),d()},()=>n.invalidateQueries({queryKey:l})),t[2]=e.slug,t[3]=n,t[4]=l,t[5]=o):o=t[5],ee.useSyncExternalStore(o,gl,xl);let r;t[6]!==e.slug?(r=async()=>await mn(e.slug,"SIDEBAR_GET",{}),t[6]=e.slug,t[7]=r):r=t[7];let a;t[8]!==l||t[9]!==r?(a={queryKey:l,queryFn:r,staleTime:6e4},t[8]=l,t[9]=r,t[10]=a):a=t[10];const{data:c}=Ve(a);return c??Qe}function xl(){return 0}function gl(){return 0}function Vs(t,e,n){const i=w.c(25),{org:l}=ie(),o=kt();let r,a,c,d;i[0]!==l.id||i[1]!==o?(r=Ee.projectSidebar(l.id),a=()=>o.getQueryData(r)??Qe,d=un,c=[...r,"write"],i[0]=l.id,i[1]=o,i[2]=r,i[3]=a,i[4]=c,i[5]=d):(r=i[2],a=i[3],c=i[4],d=i[5]);let m;i[6]!==t||i[7]!==a||i[8]!==n?(m=async h=>n(t(a())),i[6]=t,i[7]=a,i[8]=n,i[9]=m):m=i[9];let u;i[10]!==r||i[11]!==t||i[12]!==e||i[13]!==o?(u=h=>{const g=o.getQueryData(r),b=g??Qe;return o.setQueryData(r,e(b,h(t(b)))),{prev:g}},i[10]=r,i[11]=t,i[12]=e,i[13]=o,i[14]=u):u=i[14];let p,f;i[15]!==r||i[16]!==o?(p=(h,g,b)=>{o.setQueryData(r,b?.prev??Qe)},f=()=>{o.isMutating({mutationKey:[...r,"write"]})===1&&o.invalidateQueries({queryKey:r})},i[15]=r,i[16]=o,i[17]=p,i[18]=f):(p=i[17],f=i[18]);let x;return i[19]!==c||i[20]!==m||i[21]!==u||i[22]!==p||i[23]!==f?(x={mutationKey:c,mutationFn:m,onMutate:u,onError:p,onSettled:f},i[19]=c,i[20]=m,i[21]=u,i[22]=p,i[23]=f,i[24]=x):x=i[24],d(x)}function hl(){const t=w.c(2),e=ot();let n;return t[0]!==e?(n=async i=>await e.call("SIDEBAR_PREFERENCES_SET",i),t[0]=e,t[1]=n):n=t[1],Vs(jl,bl,n)}function bl(t,e){return{...t,preferences:e}}function jl(t){return t.preferences}function vl(){const t=w.c(2),e=ot();let n;return t[0]!==e?(n=async i=>(await e.call("PROJECT_FOLDERS_SET",{folders:i})).folders,t[0]=e,t[1]=n):n=t[1],Vs(Sl,kl,n)}function kl(t,e){return{...t,folders:e}}function Sl(t){return t.folders}function yl({projects:t,folders:e,preferences:n}){const i=new Map(t.map(f=>[f.id,f])),l=new Set(n.pinned),o=new Set(n.hidden),r=new Set(n.hiddenFolders),a=new Map;for(const f of e)for(const x of f.projectIds)a.set(x,f.id);const c=f=>f.map(x=>i.get(x)).filter(x=>!!x),d=c(n.pinned),m=f=>!l.has(f.id)&&!o.has(f.id),u=[],p=[];for(const f of e){const x=c(f.projectIds).filter(m);(r.has(f.id)?p:u).push({folder:f,projects:x})}return{pinned:d,folders:u,loose:t.filter(f=>!a.has(f.id)&&m(f)),hiddenFolders:p,hidden:t.filter(f=>o.has(f.id)&&!l.has(f.id))}}function Ht(t,e,n){const i=o=>o.filter(r=>r!==e),l={...t,pinned:i(t.pinned),hidden:i(t.hidden),dismissed:i(t.dismissed)};return n&&(l[n]=[...l[n],e]),l}function Nl(t,e,n){const i=t.hiddenFolders.filter(l=>l!==e);return{...t,hiddenFolders:n?[...i,e]:i}}function _l(t,e,n){return[...t,{id:e,name:n,projectIds:[]}]}function wl(t,e,n){return t.map(i=>i.id===e?{...i,name:n}:i)}function pt(t,e){return t.filter(n=>n.id!==e)}function Kt(t,e,n){return t.map(i=>{const l=i.projectIds.filter(o=>o!==e);return{...i,projectIds:i.id===n?[...l,e]:l}})}function $l(t){const e=w.c(97),{open:n,onOpenChange:i,projects:l,folders:o,preferences:r,canManage:a,onPin:c,onHide:d,onHideFolder:m,onMove:u,onRequestFolderName:p,onDeleteFolder:f}=t,x=D();let h,g,b,v,j,k,S,N,_,C;if(e[0]!==a||e[1]!==o||e[2]!==f||e[3]!==d||e[4]!==m||e[5]!==u||e[6]!==i||e[7]!==c||e[8]!==p||e[9]!==n||e[10]!==r.hidden||e[11]!==r.hiddenFolders||e[12]!==r.pinned||e[13]!==l||e[14]!==x){const z=new Map(l.map(Tl));let R;e[25]!==o?(R=new Set(o.flatMap(Pl)),e[25]=o,e[26]=R):R=e[26];const E=R;let F;e[27]!==r.pinned?(F=new Set(r.pinned),e[27]=r.pinned,e[28]=F):F=e[28];const K=F;let q;e[29]!==r.hidden?(q=new Set(r.hidden),e[29]=r.hidden,e[30]=q):q=e[30];const J=q;let X;e[31]!==r.hiddenFolders?(X=new Set(r.hiddenFolders),e[31]=r.hiddenFolders,e[32]=X):X=e[32];const B=X;let te;e[33]!==a||e[34]!==o||e[35]!==J||e[36]!==B||e[37]!==d||e[38]!==u||e[39]!==c||e[40]!==p||e[41]!==K||e[42]!==x?(te=(A,G)=>{const P=K.has(A.id),M=G!==null&&B.has(G.id)&&!P,L=!J.has(A.id)&&!M;return s.jsxs("li",{className:"group/row flex h-11 items-center gap-3 px-3 transition-colors hover:bg-accent",children:[s.jsx("span",{className:U("flex size-4 shrink-0 items-center justify-center",!L&&"opacity-50"),children:s.jsx(Ae,{icon:A.icon,name:A.title})}),s.jsx("span",{className:U("min-w-0 flex-1 truncate text-sm",L?"text-foreground":"text-muted-foreground"),children:A.title}),a&&s.jsx("span",{className:"opacity-0 transition-opacity group-hover/row:opacity-100 has-[[data-state=open]]:opacity-100",children:s.jsx(zl,{project:A,folder:G,folders:o,onMove:u,onRequestFolderName:p})}),s.jsx("span",{className:U("transition-opacity",!P&&"opacity-0 group-hover/row:opacity-100"),children:s.jsx(jt,{label:x(P?"sidebar.projects.unpin":"sidebar.projects.pin"),variant:P?"secondary":"ghost","aria-pressed":P,onClick:()=>c(A.id,!P),children:P?s.jsx(Al,{}):s.jsx(bs,{size:14})})}),s.jsx(ao,{checked:L,disabled:M,"aria-label":`${x("sidebar.customize.showInSidebar")}: ${A.title}`,title:M?x("sidebar.customize.stateWithFolder"):void 0,onCheckedChange:se=>d(A.id,se!==!0)})]},A.id)},e[33]=a,e[34]=o,e[35]=J,e[36]=B,e[37]=d,e[38]=u,e[39]=c,e[40]=p,e[41]=K,e[42]=x,e[43]=te):te=e[43];const W=te;let Y;e[44]!==a||e[45]!==B||e[46]!==f||e[47]!==m||e[48]!==p||e[49]!==W||e[50]!==x?(Y=(A,G,P,M)=>{const L=P!==null&&B.has(P.id);return s.jsxs("section",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex h-7 items-center gap-2",children:[s.jsx("h3",{className:U("min-w-0 flex-1 truncate text-sm font-medium",L?"text-muted-foreground":"text-foreground"),children:G}),P&&s.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[x("sidebar.customize.showFolder"),s.jsx(co,{checked:!L,onCheckedChange:se=>m(P.id,!se)})]}),P&&a&&s.jsxs(it,{children:[s.jsx(st,{asChild:!0,children:s.jsx(jt,{label:x("sidebar.customize.folderOptions"),children:s.jsx(St,{size:14})})}),s.jsxs(nt,{align:"end",children:[s.jsx(fe,{onSelect:()=>p({kind:"rename",folderId:P.id,name:P.name}),children:x("sidebar.projects.renameFolder")}),s.jsx(fe,{variant:"destructive",onSelect:()=>f(P.id),children:x("sidebar.projects.deleteFolder")})]})]})]}),s.jsx("ul",{className:"flex flex-col divide-y divide-border overflow-hidden surface",children:M.length===0?s.jsx("li",{className:"flex h-11 items-center px-3 text-sm text-muted-foreground",children:x("sidebar.customize.empty")}):M.map(se=>W(se,P))})]},A)},e[44]=a,e[45]=B,e[46]=f,e[47]=m,e[48]=p,e[49]=W,e[50]=x,e[51]=Y):Y=e[51];const ne=Y;if(e[52]!==a||e[53]!==ne||e[54]!==i||e[55]!==p||e[56]!==n||e[57]!==E||e[58]!==l||e[59]!==x){let A;e[69]!==E?(A=se=>!E.has(se.id),e[69]=E,e[70]=A):A=e[70];const G=l.filter(A);g=es,_=n,C=i,h=ts,k="flex max-h-[85vh] flex-col gap-5 sm:max-w-2xl",S=Il;let P;e[71]!==x?(P=x("sidebar.projects.customize"),e[71]=x,e[72]=P):P=e[72];let M;e[73]!==P?(M=s.jsx(ss,{children:P}),e[73]=P,e[74]=M):M=e[74];let L;e[75]!==a||e[76]!==p||e[77]!==x?(L=a&&s.jsxs(Me,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>p({kind:"create"}),children:[s.jsx(Le,{size:14}),x("sidebar.projects.newFolder")]}),e[75]=a,e[76]=p,e[77]=x,e[78]=L):L=e[78],e[79]!==M||e[80]!==L?(N=s.jsxs(ns,{className:"flex-row items-center justify-between gap-4 pr-8",children:[M,L]}),e[79]=M,e[80]=L,e[81]=N):N=e[81],b="-mx-6 flex min-h-0 flex-col gap-6 overflow-y-auto px-6 pb-1",v=ne("loose",x("sidebar.projects.heading"),null,G),e[52]=a,e[53]=ne,e[54]=i,e[55]=p,e[56]=n,e[57]=E,e[58]=l,e[59]=x,e[60]=h,e[61]=g,e[62]=b,e[63]=v,e[64]=k,e[65]=S,e[66]=N,e[67]=_,e[68]=C}else h=e[60],g=e[61],b=e[62],v=e[63],k=e[64],S=e[65],N=e[66],_=e[67],C=e[68];j=o.map(A=>ne(A.id,A.name,A,A.projectIds.map(G=>z.get(G)).filter(Cl))),e[0]=a,e[1]=o,e[2]=f,e[3]=d,e[4]=m,e[5]=u,e[6]=i,e[7]=c,e[8]=p,e[9]=n,e[10]=r.hidden,e[11]=r.hiddenFolders,e[12]=r.pinned,e[13]=l,e[14]=x,e[15]=h,e[16]=g,e[17]=b,e[18]=v,e[19]=j,e[20]=k,e[21]=S,e[22]=N,e[23]=_,e[24]=C}else h=e[15],g=e[16],b=e[17],v=e[18],j=e[19],k=e[20],S=e[21],N=e[22],_=e[23],C=e[24];let y;e[82]!==b||e[83]!==v||e[84]!==j?(y=s.jsxs("div",{className:b,children:[v,j]}),e[82]=b,e[83]=v,e[84]=j,e[85]=y):y=e[85];let $;e[86]!==h||e[87]!==k||e[88]!==S||e[89]!==N||e[90]!==y?($=s.jsxs(h,{className:k,onOpenAutoFocus:S,children:[N,y]}),e[86]=h,e[87]=k,e[88]=S,e[89]=N,e[90]=y,e[91]=$):$=e[91];let I;return e[92]!==g||e[93]!==$||e[94]!==_||e[95]!==C?(I=s.jsx(g,{open:_,onOpenChange:C,children:$}),e[92]=g,e[93]=$,e[94]=_,e[95]=C,e[96]=I):I=e[96],I}function Cl(t){return!!t}function Il(t){return t.preventDefault()}function Pl(t){return t.projectIds}function Tl(t){return[t.id,t]}function zl(t){const e=w.c(41),{project:n,folder:i,folders:l,onMove:o,onRequestFolderName:r}=t,a=D();let c;e[0]!==a?(c=a("sidebar.customize.projectOptions"),e[0]=a,e[1]=c):c=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(St,{size:14}),e[2]=d):d=e[2];let m;e[3]!==c?(m=s.jsx(st,{asChild:!0,children:s.jsx(jt,{label:c,children:d})}),e[3]=c,e[4]=m):m=e[4];let u;e[5]!==a?(u=a("sidebar.projects.moveTo"),e[5]=a,e[6]=u):u=e[6];let p;e[7]!==u?(p=s.jsx(fn,{children:u}),e[7]=u,e[8]=p):p=e[8];let f;if(e[9]!==i?.id||e[10]!==l||e[11]!==o||e[12]!==n.id){let S;e[14]!==i?.id||e[15]!==o||e[16]!==n.id?(S=N=>s.jsx(fe,{disabled:N.id===i?.id,onSelect:()=>o(n.id,N.id),children:N.name},N.id),e[14]=i?.id,e[15]=o,e[16]=n.id,e[17]=S):S=e[17],f=l.map(S),e[9]=i?.id,e[10]=l,e[11]=o,e[12]=n.id,e[13]=f}else f=e[13];let x;e[18]!==i||e[19]!==o||e[20]!==n.id||e[21]!==a?(x=i&&s.jsx(fe,{onSelect:()=>o(n.id,null),children:a("sidebar.projects.noFolder")}),e[18]=i,e[19]=o,e[20]=n.id,e[21]=a,e[22]=x):x=e[22];let h;e[23]!==r||e[24]!==n.id?(h=()=>r({kind:"create",projectId:n.id}),e[23]=r,e[24]=n.id,e[25]=h):h=e[25];let g;e[26]!==a?(g=a("sidebar.projects.newFolder"),e[26]=a,e[27]=g):g=e[27];let b;e[28]!==h||e[29]!==g?(b=s.jsx(fe,{onSelect:h,children:g}),e[28]=h,e[29]=g,e[30]=b):b=e[30];let v;e[31]!==b||e[32]!==f||e[33]!==x?(v=s.jsxs(pn,{children:[f,x,b]}),e[31]=b,e[32]=f,e[33]=x,e[34]=v):v=e[34];let j;e[35]!==v||e[36]!==p?(j=s.jsx(nt,{align:"end",children:s.jsxs(xn,{children:[p,v]})}),e[35]=v,e[36]=p,e[37]=j):j=e[37];let k;return e[38]!==j||e[39]!==m?(k=s.jsxs(it,{children:[m,j]}),e[38]=j,e[39]=m,e[40]=k):k=e[40],k}function Al(){const t=w.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(bs,{size:14}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("span",{className:"relative flex size-3.5",children:[e,s.jsx("svg",{viewBox:"0 0 14 14",className:"absolute inset-0 size-3.5","aria-hidden":"true",children:s.jsx("line",{x1:"1.5",y1:"1.5",x2:"12.5",y2:"12.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})]}),t[1]=n):n=t[1],n}function Fl(t){const e=w.c(10),{request:n,onClose:i,onSave:l}=t,o=n!==null;let r;e[0]!==i?(r=d=>!d&&i(),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==i||e[3]!==l||e[4]!==n?(a=n&&s.jsx(Ol,{request:n,onClose:i,onSave:l},n.kind==="rename"?n.folderId:"create"),e[2]=i,e[3]=l,e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==o||e[7]!==r||e[8]!==a?(c=s.jsx(es,{open:o,onOpenChange:r,children:a}),e[6]=o,e[7]=r,e[8]=a,e[9]=c):c=e[9],c}function Ol(t){const e=w.c(39),{request:n,onClose:i,onSave:l}=t,o=D(),[r,a]=ee.useState(n.kind==="rename"?n.name:"");let c;e[0]!==r?(c=r.trim(),e[0]=r,e[1]=c):c=e[1];const d=c;let m;e[2]!==i||e[3]!==l||e[4]!==n||e[5]!==d?(m=y=>{y.preventDefault(),d&&(l(n,d),i())},e[2]=i,e[3]=l,e[4]=n,e[5]=d,e[6]=m):m=e[6];const u=n.kind==="rename"?"sidebar.projects.renameFolder":"sidebar.projects.newFolder";let p;e[7]!==o||e[8]!==u?(p=o(u),e[7]=o,e[8]=u,e[9]=p):p=e[9];let f;e[10]!==p?(f=s.jsx(ns,{children:s.jsx(ss,{children:p})}),e[10]=p,e[11]=f):f=e[11];let x;e[12]!==o?(x=o("sidebar.projects.folderName"),e[12]=o,e[13]=x):x=e[13];let h;e[14]!==o?(h=o("sidebar.projects.folderName"),e[14]=o,e[15]=h):h=e[15];let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=y=>a(y.target.value),e[16]=g):g=e[16];let b;e[17]!==r||e[18]!==x||e[19]!==h?(b=s.jsx(gn,{autoFocus:!0,value:r,maxLength:ro,placeholder:x,"aria-label":h,onChange:g}),e[17]=r,e[18]=x,e[19]=h,e[20]=b):b=e[20];let v;e[21]!==o?(v=o("sidebar.projects.folderCancel"),e[21]=o,e[22]=v):v=e[22];let j;e[23]!==i||e[24]!==v?(j=s.jsx(Me,{type:"button",variant:"ghost",onClick:i,children:v}),e[23]=i,e[24]=v,e[25]=j):j=e[25];const k=!d;let S;e[26]!==o?(S=o("sidebar.projects.folderSave"),e[26]=o,e[27]=S):S=e[27];let N;e[28]!==k||e[29]!==S?(N=s.jsx(Me,{type:"submit",disabled:k,children:S}),e[28]=k,e[29]=S,e[30]=N):N=e[30];let _;e[31]!==j||e[32]!==N?(_=s.jsxs(hn,{children:[j,N]}),e[31]=j,e[32]=N,e[33]=_):_=e[33];let C;return e[34]!==_||e[35]!==m||e[36]!==f||e[37]!==b?(C=s.jsx(ts,{className:"sm:max-w-sm",children:s.jsxs("form",{className:"flex flex-col gap-4",onSubmit:m,children:[f,b,_]})}),e[34]=_,e[35]=m,e[36]=f,e[37]=b,e[38]=C):C=e[38],C}function Dl(t){const e=t.target.closest("[data-context-id]")?.getAttribute("data-context-id");return e?.startsWith("project:")?{kind:"project",id:e.slice(8)}:e?.startsWith("folder:")?{kind:"folder",id:e.slice(7)}:{kind:"none"}}function Ml(t){const e=w.c(8),{locator:n}=ie(),i=ot(),{data:l}=ze.useSession();let o;e[0]!==n||e[1]!==i?(o=ys(n,i),e[0]=n,e[1]=i,e[2]=o):o=e[2];const{data:r}=Ve(o);let a,c;if(e[3]!==r||e[4]!==t||e[5]!==l?.user?.id){c=Symbol.for("react.early_return_sentinel");e:{if(a=new Map,!r){c=a;break e}const d=Is(t);for(const m of ki(r.items,l?.user?.id)){const u=Xi(m,d);u&&a.set(u.id,(a.get(u.id)??0)+1)}}e[3]=r,e[4]=t,e[5]=l?.user?.id,e[6]=a,e[7]=c}else a=e[6],c=e[7];return c!==Symbol.for("react.early_return_sentinel")?c:a}function El(t){const e=w.c(5),{label:n,action:i}=t;let l;e[0]!==n?(l=s.jsx("p",{className:"font-medium text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=l):l=e[1];let o;return e[2]!==i||e[3]!==l?(o=s.jsxs("div",{className:"flex h-6 items-center justify-between gap-2 px-2",children:[l,i]}),e[2]=i,e[3]=l,e[4]=o):o=e[4],o}function Us(t){const e=w.c(24),{project:n,onNavigate:i,waiting:l,trailing:o,children:r}=t,a=l===void 0?0:l,c=D(),d=Ue();let m;e[0]!==c||e[1]!==a?(m=a>0?c("sidebar.projects.waiting",{count:a}):null,e[0]=c,e[1]=a,e[2]=m):m=e[2];const u=m;let p;e[3]!==n.icon||e[4]!==n.title?(p=s.jsx(Ae,{icon:n.icon,name:n.title}),e[3]=n.icon,e[4]=n.title,e[5]=p):p=e[5];const f=n.title,x=`project:${n.id}`;let h;e[6]!==o||e[7]!==u?(h=u?s.jsx("span",{title:u,className:"mr-1 size-2 rounded-full bg-warning group-hover/menu-item:invisible"}):o,e[6]=o,e[7]=u,e[8]=h):h=e[8];const g=u&&"font-semibold";let b;e[9]!==g?(b=U(g),e[9]=g,e[10]=b):b=e[10];const v=u?`${n.title}, ${u}`:void 0;let j;e[11]!==d||e[12]!==i||e[13]!==n.id?(j=()=>{le("sidebar_project_clicked"),d(n.id),i?.()},e[11]=d,e[12]=i,e[13]=n.id,e[14]=j):j=e[14];let k;return e[15]!==r||e[16]!==n.title||e[17]!==j||e[18]!==p||e[19]!==x||e[20]!==h||e[21]!==b||e[22]!==v?(k=s.jsx(pe,{icon:p,label:f,contextId:x,trailing:h,className:b,ariaLabel:v,onSelect:j,children:r}),e[15]=r,e[16]=n.title,e[17]=j,e[18]=p,e[19]=x,e[20]=h,e[21]=b,e[22]=v,e[23]=k):k=e[23],k}function Wt(t){const e=w.c(26),{label:n,contextId:i,folderId:l,projects:o,onNavigate:r,actions:a,waitingByProject:c}=t,{locator:d}=ie();let m;e[0]!==l||e[1]!==d?(m=jn.sidebarSectionOpen(d,l??"loose"),e[0]=l,e[1]=d,e[2]=m):m=e[2];const[u,p]=bn(m,!0),f=u?Ps:is;let x;e[3]!==p?(x=()=>p(Rl),e[3]=p,e[4]=x):x=e[4];let h;e[5]!==n?(h=s.jsx("span",{className:"truncate font-medium text-xs text-muted-foreground transition-colors group-hover/folder:text-sidebar-foreground",children:n}),e[5]=n,e[6]=h):h=e[6];let g;e[7]!==f?(g=s.jsx(f,{size:12,className:"shrink-0 text-muted-foreground"}),e[7]=f,e[8]=g):g=e[8];let b;e[9]!==u||e[10]!==x||e[11]!==h||e[12]!==g?(b=s.jsxs("button",{type:"button","aria-expanded":u,onClick:x,className:"group/folder flex min-w-0 items-center gap-1 rounded-md text-left",children:[h,g]}),e[9]=u,e[10]=x,e[11]=h,e[12]=g,e[13]=b):b=e[13];let v;e[14]!==a||e[15]!==b?(v=s.jsxs("div",{className:"flex h-6 items-center justify-between gap-2 px-2",children:[b,a]}),e[14]=a,e[15]=b,e[16]=v):v=e[16];let j;e[17]!==r||e[18]!==u||e[19]!==o||e[20]!==c?(j=u&&o.length>0&&s.jsx(re,{className:"gap-1",children:o.map(S=>s.jsx(Us,{project:S,onNavigate:r,waiting:c.get(S.id)},S.id))}),e[17]=r,e[18]=u,e[19]=o,e[20]=c,e[21]=j):j=e[21];let k;return e[22]!==i||e[23]!==v||e[24]!==j?(k=s.jsxs("div",{className:"flex flex-col gap-1","data-context-id":i,children:[v,j]}),e[22]=i,e[23]=v,e[24]=j,e[25]=k):k=e[25],k}function Rl(t){return!t}function Ll(t){const e=w.c(141),{onNavigate:n}=t,i=D(),l=je(),{granted:o}=Zt("agents:manage"),{projects:r}=Ie(),a=De(),c=pl(),d=Ml(r),m=hl(),u=vl();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={kind:"none"},e[0]=p):p=e[0];const[f,x]=ee.useState(p),[h,g]=ee.useState(null),[b,v]=ee.useState(!1);if(a||r.length===0&&!o)return null;let j,k,S,N,_,C,y,$,I,z,R,E,F,K,q,J,X,B,te,W;if(e[1]!==o||e[2]!==l||e[3]!==n||e[4]!==r||e[5]!==c.folders||e[6]!==c.preferences||e[7]!==i||e[8]!==f.id||e[9]!==f.kind||e[10]!==u||e[11]!==m||e[12]!==d){const Q=yl({projects:r,folders:c.folders,preferences:c.preferences});_=Q.hidden.length+Q.hiddenFolders.reduce(Vl,0);let de;e[33]!==m?(de=(O,H)=>{le(H?"sidebar_project_pinned":"sidebar_project_unpinned"),m.mutate(ue=>Ht(ue,O,H?"pinned":null))},e[33]=m,e[34]=de):de=e[34],z=de;let ke;e[35]!==m?(ke=(O,H)=>{le(H?"sidebar_project_hidden":"sidebar_project_shown"),m.mutate(ue=>Ht(ue,O,H?"hidden":null))},e[35]=m,e[36]=ke):ke=e[36],y=ke;let xe;e[37]!==m?(xe=(O,H)=>m.mutate(ue=>Nl(ue,O,H)),e[37]=m,e[38]=xe):xe=e[38],$=xe;let ge;e[39]!==u?(ge=(O,H)=>u.mutate(ue=>Kt(ue,O,H)),e[39]=u,e[40]=ge):ge=e[40],I=ge;let Se;e[41]!==u?(Se=(O,H)=>{if(O.kind==="rename"){u.mutate(dt=>wl(dt,O.folderId,H));return}const ue=crypto.randomUUID();le("sidebar_folder_created"),u.mutate(dt=>{const Ft=_l(dt,ue,H);return O.projectId?Kt(Ft,O.projectId,ue):Ft})},e[41]=u,e[42]=Se):Se=e[42],E=Se;let $e;e[43]!==c.preferences.pinned?($e=new Set(c.preferences.pinned),e[43]=c.preferences.pinned,e[44]=$e):$e=e[44],R=$e;let ye;e[45]!==c.preferences.hidden?(ye=new Set(c.preferences.hidden),e[45]=c.preferences.hidden,e[46]=ye):ye=e[46],C=ye;let Ne;e[47]!==c.folders||e[48]!==f.id||e[49]!==f.kind?(Ne=f.kind==="project"?c.folders.find(O=>O.projectIds.includes(f.id))?.id:void 0,e[47]=c.folders,e[48]=f.id,e[49]=f.kind,e[50]=Ne):Ne=e[50],N=Ne;let _e;e[51]!==c.folders||e[52]!==f.id||e[53]!==f.kind?(_e=f.kind==="folder"?c.folders.find(O=>O.id===f.id):void 0,e[51]=c.folders,e[52]=f.id,e[53]=f.kind,e[54]=_e):_e=e[54],W=_e;let Pe;e[55]===Symbol.for("react.memo_cache_sentinel")?(Pe=()=>v(!0),e[55]=Pe):Pe=e[55];let Fe;e[56]!==i?(Fe=i("sidebar.projects.customize"),e[56]=i,e[57]=Fe):Fe=e[57];let He;e[58]!==Fe?(He=s.jsx(he,{onSelect:Pe,children:Fe}),e[58]=Fe,e[59]=He):He=e[59],S=He;let Ke;e[60]!==o||e[61]!==$||e[62]!==I||e[63]!==i||e[64]!==u?(Ke=O=>s.jsxs("span",{className:"-mr-1 flex shrink-0 items-center gap-0.5",children:[s.jsxs(it,{children:[s.jsx(st,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":i(O?"sidebar.customize.folderOptions":"sidebar.projects.more"),title:i(O?"sidebar.customize.folderOptions":"sidebar.projects.more"),className:"flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",children:s.jsx(St,{size:14})})}),s.jsxs(nt,{align:"start",children:[O&&s.jsx(fe,{onSelect:()=>$(O.id,!0),children:i("sidebar.projects.hideFolder")}),O&&o&&s.jsxs(s.Fragment,{children:[s.jsx(fe,{onSelect:()=>g({kind:"rename",folderId:O.id,name:O.name}),children:i("sidebar.projects.renameFolder")}),s.jsx(fe,{variant:"destructive",onSelect:()=>u.mutate(H=>pt(H,O.id)),children:i("sidebar.projects.deleteFolder")})]}),O&&s.jsx(Xt,{}),o&&s.jsx(fe,{onSelect:()=>g({kind:"create"}),children:i("sidebar.projects.newFolder")}),s.jsx(fe,{onSelect:()=>v(!0),children:i("sidebar.projects.customize")})]})]}),o&&s.jsx("button",{type:"button","aria-label":i("projects.home.newProject"),title:i("projects.home.newProject"),onClick:()=>Ts("sidebar",O?{onCreated:H=>I(H,O.id)}:void 0),className:"flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",children:s.jsx(Le,{size:14})})]}),e[60]=o,e[61]=$,e[62]=I,e[63]=i,e[64]=u,e[65]=Ke):Ke=e[65];const zt=Ke;let We;e[66]!==n||e[67]!==d?(We=O=>O.map(H=>s.jsx(Us,{project:H,onNavigate:n,waiting:d.get(H.id)},H.id)),e[66]=n,e[67]=d,e[68]=We):We=e[68];const At=We;k=so,j=no,te=!0,F="flex flex-col gap-4",K=ce.projects,e[69]===Symbol.for("react.memo_cache_sentinel")?(q=O=>x(Dl(O)),e[69]=q):q=e[69],J=Q.pinned.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[!l&&s.jsx(El,{label:i("sidebar.projects.pinned")}),s.jsx(re,{className:"gap-1",children:At(Q.pinned)})]}),X=l?s.jsxs(re,{className:"gap-1",children:[At([...Q.folders.flatMap(Bl),...Q.loose]),o&&s.jsx(pe,{icon:s.jsx(Le,{size:16}),label:i("projects.home.newProject"),onSelect:ql})]}):s.jsx(Wt,{label:i("sidebar.projects.heading"),projects:Q.loose,onNavigate:n,waitingByProject:d,actions:zt(null)}),B=!l&&Q.folders.map(O=>{const{folder:H,projects:ue}=O;return s.jsx(Wt,{label:H.name,contextId:`folder:${H.id}`,folderId:H.id,projects:ue,onNavigate:n,waitingByProject:d,actions:zt(H)},H.id)}),e[1]=o,e[2]=l,e[3]=n,e[4]=r,e[5]=c.folders,e[6]=c.preferences,e[7]=i,e[8]=f.id,e[9]=f.kind,e[10]=u,e[11]=m,e[12]=d,e[13]=j,e[14]=k,e[15]=S,e[16]=N,e[17]=_,e[18]=C,e[19]=y,e[20]=$,e[21]=I,e[22]=z,e[23]=R,e[24]=E,e[25]=F,e[26]=K,e[27]=q,e[28]=J,e[29]=X,e[30]=B,e[31]=te,e[32]=W}else j=e[13],k=e[14],S=e[15],N=e[16],_=e[17],C=e[18],y=e[19],$=e[20],I=e[21],z=e[22],R=e[23],E=e[24],F=e[25],K=e[26],q=e[27],J=e[28],X=e[29],B=e[30],te=e[31],W=e[32];let Y;e[70]!==l||e[71]!==_||e[72]!==i?(Y=_>0&&!l&&s.jsx(re,{children:s.jsx(pe,{icon:s.jsx(ai,{size:16}),label:i("sidebar.projects.hiddenCount",{count:_}),className:"text-muted-foreground",onSelect:()=>v(!0)})}),e[70]=l,e[71]=_,e[72]=i,e[73]=Y):Y=e[73];let ne;e[74]!==F||e[75]!==K||e[76]!==q||e[77]!==J||e[78]!==X||e[79]!==B||e[80]!==Y?(ne=s.jsxs("div",{className:F,"data-tour":K,onContextMenu:q,children:[J,X,B,Y]}),e[74]=F,e[75]=K,e[76]=q,e[77]=J,e[78]=X,e[79]=B,e[80]=Y,e[81]=ne):ne=e[81];let A;e[82]!==j||e[83]!==ne||e[84]!==te?(A=s.jsx(j,{asChild:te,children:ne}),e[82]=j,e[83]=ne,e[84]=te,e[85]=A):A=e[85];let G;e[86]!==o||e[87]!==S||e[88]!==N||e[89]!==C||e[90]!==y||e[91]!==I||e[92]!==z||e[93]!==R||e[94]!==c.folders||e[95]!==i||e[96]!==f.id||e[97]!==f.kind?(G=f.kind==="project"&&s.jsxs(s.Fragment,{children:[s.jsx(he,{onSelect:()=>z(f.id,!R.has(f.id)),children:i(R.has(f.id)?"sidebar.projects.unpin":"sidebar.projects.pin")}),s.jsx(he,{onSelect:()=>y(f.id,!C.has(f.id)),children:i(C.has(f.id)?"sidebar.projects.show":"sidebar.projects.hide")}),o&&s.jsxs(Zi,{children:[s.jsx(eo,{children:i("sidebar.projects.moveTo")}),s.jsxs(to,{className:"w-48",children:[c.folders.map(Q=>s.jsx(he,{disabled:Q.id===N,onSelect:()=>I(f.id,Q.id),children:Q.name},Q.id)),N&&s.jsx(he,{onSelect:()=>I(f.id,null),children:i("sidebar.projects.noFolder")}),c.folders.length>0&&s.jsx(ft,{}),s.jsx(he,{onSelect:()=>g({kind:"create",projectId:f.id}),children:i("sidebar.projects.newFolder")})]})]}),s.jsx(ft,{}),S]}),e[86]=o,e[87]=S,e[88]=N,e[89]=C,e[90]=y,e[91]=I,e[92]=z,e[93]=R,e[94]=c.folders,e[95]=i,e[96]=f.id,e[97]=f.kind,e[98]=G):G=e[98];let P;e[99]!==o||e[100]!==S||e[101]!==$||e[102]!==i||e[103]!==f.kind||e[104]!==W||e[105]!==u?(P=f.kind==="folder"&&W&&s.jsxs(s.Fragment,{children:[s.jsx(he,{onSelect:()=>$(W.id,!0),children:i("sidebar.projects.hideFolder")}),o&&s.jsxs(s.Fragment,{children:[s.jsx(he,{onSelect:()=>g({kind:"rename",folderId:W.id,name:W.name}),children:i("sidebar.projects.renameFolder")}),s.jsx(he,{variant:"destructive",onSelect:()=>u.mutate(Q=>pt(Q,W.id)),children:i("sidebar.projects.deleteFolder")})]}),s.jsx(ft,{}),o&&s.jsx(he,{onSelect:()=>g({kind:"create"}),children:i("sidebar.projects.newFolder")}),S]}),e[99]=o,e[100]=S,e[101]=$,e[102]=i,e[103]=f.kind,e[104]=W,e[105]=u,e[106]=P):P=e[106];let M;e[107]!==o||e[108]!==S||e[109]!==i||e[110]!==f.kind?(M=f.kind==="none"&&s.jsxs(s.Fragment,{children:[o&&s.jsx(he,{onSelect:()=>g({kind:"create"}),children:i("sidebar.projects.newFolder")}),S]}),e[107]=o,e[108]=S,e[109]=i,e[110]=f.kind,e[111]=M):M=e[111];let L;e[112]!==G||e[113]!==P||e[114]!==M?(L=s.jsxs(io,{className:"w-52",children:[G,P,M]}),e[112]=G,e[113]=P,e[114]=M,e[115]=L):L=e[115];let se;e[116]!==k||e[117]!==A||e[118]!==L?(se=s.jsxs(k,{children:[A,L]}),e[116]=k,e[117]=A,e[118]=L,e[119]=se):se=e[119];let me;e[120]===Symbol.for("react.memo_cache_sentinel")?(me=()=>g(null),e[120]=me):me=e[120];let ae;e[121]!==h||e[122]!==E?(ae=s.jsx(Fl,{request:h,onClose:me,onSave:E}),e[121]=h,e[122]=E,e[123]=ae):ae=e[123];let T;e[124]!==u?(T=Q=>u.mutate(de=>pt(de,Q)),e[124]=u,e[125]=T):T=e[125];let Z;e[126]!==o||e[127]!==b||e[128]!==y||e[129]!==$||e[130]!==I||e[131]!==z||e[132]!==r||e[133]!==c.folders||e[134]!==c.preferences||e[135]!==T?(Z=s.jsx($l,{open:b,onOpenChange:v,projects:r,folders:c.folders,preferences:c.preferences,canManage:o,onPin:z,onHide:y,onHideFolder:$,onMove:I,onRequestFolderName:g,onDeleteFolder:T}),e[126]=o,e[127]=b,e[128]=y,e[129]=$,e[130]=I,e[131]=z,e[132]=r,e[133]=c.folders,e[134]=c.preferences,e[135]=T,e[136]=Z):Z=e[136];let ve;return e[137]!==se||e[138]!==ae||e[139]!==Z?(ve=s.jsxs(s.Fragment,{children:[se,ae,Z]}),e[137]=se,e[138]=ae,e[139]=Z,e[140]=ve):ve=e[140],ve}function ql(){return Ts("sidebar")}function Bl(t){return t.projects}function Vl(t,e){return t+e.projects.length}const Ul=new Set(["repositories","connections","skills","memory"]);function Hl(){const t=w.c(9),e=D(),{capabilities:n,isPrivileged:i,loading:l,error:o}=vn(),r=ui().length,a=kn(),c=Ce();let d;return t[0]!==n||t[1]!==o||t[2]!==i||t[3]!==r||t[4]!==l||t[5]!==c||t[6]!==e||t[7]!==a?(d=[{key:"account",label:"",items:[{key:"profile",label:e("settings.nav.profile"),icon:s.jsx(po,{size:14}),to:"/$org/settings/profile"}]},{key:"organization",label:e("settings.nav.organization"),items:[{key:"general",label:e("settings.nav.general"),icon:s.jsx(mo,{size:14}),to:"/$org/settings/general"},{key:"billing",label:e("settings.nav.billing"),icon:s.jsx(uo,{size:14}),to:"/$org/settings/ai-providers",group:"billing"},{key:"connect",label:e("settings.nav.connect"),icon:s.jsx(Yt,{size:14}),to:"/$org/settings/connect",group:"connect"},{key:"tasks",label:e("settings.nav.tasks"),icon:s.jsx(It,{size:14}),to:"/$org/settings/task-board",requires:"org:manage"}]},{key:"build",label:e("settings.nav.build"),items:[{key:"repositories",label:e("settings.nav.repositories"),icon:s.jsx(Sn,{size:14}),to:"/$org/settings/repositories",requires:"file-configs:manage"},{key:"connections",label:e("settings.nav.connections"),icon:s.jsx(ni,{size:14}),to:"/$org/settings/connections"},c?{key:"projects",label:e("projects.settings.title"),icon:s.jsx(Pt,{size:14}),to:"/$org/settings/projects"}:{key:"agents",label:e("settings.nav.agents"),icon:s.jsx(xt,{size:14}),to:"/$org/settings/agents"},{key:"automations",label:e("settings.nav.automations"),icon:s.jsx(xo,{size:14}),to:"/$org/settings/automations",requires:"automations:manage"},{key:"skills",label:e("settings.nav.skills"),icon:s.jsx(ci,{size:14}),to:"/$org/settings/skills"},{key:"memory",label:e("settings.nav.memory"),icon:s.jsx(ii,{size:14}),to:"/$org/settings/memory"}]},{key:"manage",label:e("settings.nav.manage"),items:[{key:"monitor",label:e("settings.nav.monitor"),icon:s.jsx(oi,{size:14}),to:"/$org/settings/monitor",requires:"monitoring:view"},{key:"members",label:e("settings.nav.members"),icon:s.jsx(xt,{size:14}),to:"/$org/settings/members",group:"members",badge:r}]},{key:"advanced",label:e("settings.nav.advanced"),collapsible:!0,items:[{key:"secrets",label:e("settings.nav.secrets"),icon:s.jsx(fo,{size:14}),to:"/$org/settings/secrets",requires:"secrets:manage"},{key:"storage",label:e("settings.nav.storage"),icon:s.jsx(yn,{size:14}),to:"/$org/settings/buckets",group:"storage"},{key:"sso",label:e("settings.nav.security"),icon:s.jsx(tt,{size:14}),to:"/$org/settings/sso",requires:"org:manage"}]}].map(u=>({...u,items:u.items.flatMap(p=>{if(c&&Ul.has(p.key))return[];if(p.group){const[f]=a[p.group];return f?[{...p,to:f.to}]:Nn(p.group)?[]:[p]}return l||o?[p]:p.privilegedOnly?i?[p]:[]:p.requires?i||n[p.requires]?[p]:[]:[p]})})).filter(Kl),t[0]=n,t[1]=o,t[2]=i,t[3]=r,t[4]=l,t[5]=c,t[6]=e,t[7]=a,t[8]=d):d=t[8],d}function Kl(t){return t.items.length>0}function Hs(){const t=w.c(8);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org"},t[0]=e):e=t[0];const{org:n}=_n(e);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={select:Wl},t[1]=i):i=t[1];const l=wn(i);let o;if(t[2]!==n||t[3]!==l){const c=d=>{const m=d.replace("$org",n);return l===m||l.startsWith(`${m}/`)};o=d=>[d.to,...d.group?$n(d.group):[]].some(c),t[2]=n,t[3]=l,t[4]=o}else o=t[4];const r=o;let a;return t[5]!==r||t[6]!==n?(a={org:n,isActive:r},t[5]=r,t[6]=n,t[7]=a):a=t[7],a}function Wl(t){return t.location.pathname}function Gl(){const t=w.c(9),{isActive:e}=Hs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={},t[0]=n):n=t[0];const[i,l]=ee.useState(n);let o;t[1]!==e||t[2]!==i?(o=m=>i[m.key]??(!m.collapsible||m.items.some(e)),t[1]=e,t[2]=i,t[3]=o):o=t[3];const r=o;let a;t[4]!==r?(a=m=>l(u=>({...u,[m.key]:!r(m)})),t[4]=r,t[5]=a):a=t[5];const c=a;let d;return t[6]!==r||t[7]!==c?(d={isOpen:r,toggle:c},t[6]=r,t[7]=c,t[8]=d):d=t[8],d}function Ql(t){const e=w.c(21),{group:n,open:i,onToggle:l,className:o}=t;let r,a,c,d,m;if(e[0]!==o||e[1]!==n.collapsible||e[2]!==n.label||e[3]!==l||e[4]!==i){m=Symbol.for("react.early_return_sentinel");e:{const x=U("text-xs font-medium text-muted-foreground/60 truncate",o);if(!n.collapsible){m=s.jsx("p",{className:x,children:n.label});break e}r="button",a=l,c=i,d=U("flex w-full items-center gap-1 rounded-lg hover:text-muted-foreground",x)}e[0]=o,e[1]=n.collapsible,e[2]=n.label,e[3]=l,e[4]=i,e[5]=r,e[6]=a,e[7]=c,e[8]=d,e[9]=m}else r=e[5],a=e[6],c=e[7],d=e[8],m=e[9];if(m!==Symbol.for("react.early_return_sentinel"))return m;let u;e[10]!==i?(u=i?s.jsx(Ps,{size:12}):s.jsx(is,{size:12}),e[10]=i,e[11]=u):u=e[11];let p;e[12]!==n.label?(p=s.jsx("span",{className:"truncate",children:n.label}),e[12]=n.label,e[13]=p):p=e[13];let f;return e[14]!==r||e[15]!==a||e[16]!==c||e[17]!==d||e[18]!==u||e[19]!==p?(f=s.jsxs("button",{type:r,onClick:a,"aria-expanded":c,className:d,children:[u,p]}),e[14]=r,e[15]=a,e[16]=c,e[17]=d,e[18]=u,e[19]=p,e[20]=f):f=e[20],f}function Yl(t){const e=w.c(5),{icon:n,badge:i}=t;let l;e[0]!==i?(l=i?s.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-destructive pointer-events-none"}):null,e[0]=i,e[1]=l):l=e[1];let o;return e[2]!==n||e[3]!==l?(o=s.jsxs("span",{className:"relative shrink-0",children:[n,l]}),e[2]=n,e[3]=l,e[4]=o):o=e[4],o}function Ks(t){const e=w.c(24),{onNavigate:n}=t,i=je(),l=D(),o=Hl(),{org:r,isActive:a}=Hs(),{isOpen:c,toggle:d}=Gl();let m;if(e[0]!==i||e[1]!==o||e[2]!==a||e[3]!==c||e[4]!==n||e[5]!==r||e[6]!==d){let g;e[8]!==i||e[9]!==a||e[10]!==c||e[11]!==n||e[12]!==r||e[13]!==d?(g=(b,v)=>s.jsxs("div",{className:"flex flex-col",children:[b.label&&!i&&s.jsx(Ql,{group:b,open:c(b),onToggle:()=>d(b),className:U("px-2 pt-1.5 pb-0.5",v>0&&"mt-3")}),(i||c(b))&&s.jsx(re,{className:"gap-0.5",children:b.items.map(j=>s.jsx(pe,{icon:s.jsx(Yl,{icon:j.icon,badge:j.badge}),label:j.label,isActive:a(j),link:{to:j.to,params:{org:r}},className:"gap-2.5",onSelect:()=>{le("settings_nav_clicked",{section_key:j.key,group_key:b.key}),n?.()}},j.key))})]},b.key),e[8]=i,e[9]=a,e[10]=c,e[11]=n,e[12]=r,e[13]=d,e[14]=g):g=e[14],m=o.map(g),e[0]=i,e[1]=o,e[2]=a,e[3]=c,e[4]=n,e[5]=r,e[6]=d,e[7]=m}else m=e[7];let u;e[15]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"mx-2 my-2 border-t border-border/50 hidden"}),e[15]=u):u=e[15];let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("span",{className:"shrink-0",children:s.jsx(bt,{size:14})}),e[16]=p):p=e[16];let f;e[17]!==l?(f=l("settings.nav.signOut"),e[17]=l,e[18]=f):f=e[18];let x;e[19]!==f?(x=s.jsxs("div",{className:"mt-auto flex flex-col pt-4",children:[u,s.jsx(re,{className:"gap-0.5",children:s.jsx(pe,{icon:p,label:f,className:"gap-2.5",onSelect:Jl})})]}),e[19]=f,e[20]=x):x=e[20];let h;return e[21]!==m||e[22]!==x?(h=s.jsxs(s.Fragment,{children:[m,x]}),e[21]=m,e[22]=x,e[23]=h):h=e[23],h}function Jl(){le("signed_out",{source:"settings_sidebar"}),Jt(),ze.signOut()}function Ws(t){const e=w.c(8),{onNavigate:n}=t,i=D(),{org:l}=ie();let o;e[0]!==i?(o=i("settings.nav.backToHome"),e[0]=i,e[1]=o):o=e[1];let r;e[2]!==l.slug?(r={to:"/$org/home",params:{org:l.slug}},e[2]=l.slug,e[3]=r):r=e[3];let a;return e[4]!==n||e[5]!==o||e[6]!==r?(a=s.jsx(Ds,{label:o,link:r,onSelect:n}),e[4]=n,e[5]=o,e[6]=r,e[7]=a):a=e[7],a}function Gs(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"px-4 pb-1 group-data-[state=collapsed]/sidebar:hidden",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","4.515.1"]})}),t[0]=e):e=t[0],e}const Xl="pt-1.5";function Qs(t){const e=w.c(18),{header:n,back:i,body:l,footer:o,sheet:r}=t;let a;e[0]!==n?(a=n&&s.jsx("div",{"data-slot":"sidebar-picker-header",className:"flex h-12 shrink-0 flex-row items-center gap-1 px-2 group-data-[state=collapsed]/sidebar:h-auto group-data-[state=collapsed]/sidebar:flex-col group-data-[state=collapsed]/sidebar:gap-2 group-data-[state=collapsed]/sidebar:py-2",children:n}),e[0]=n,e[1]=a):a=e[1];let c;e[2]!==n?(c=n&&s.jsx("div",{className:"hidden mt-1.5 h-px shrink-0 bg-sidebar-border"}),e[2]=n,e[3]=c):c=e[3];let d;e[4]!==i?(d=i&&s.jsx("div",{className:"sticky top-0 z-10 hidden shrink-0 bg-sidebar pb-2 not-empty:block",children:i}),e[4]=i,e[5]=d):d=e[5];let m;e[6]!==l||e[7]!==d?(m=s.jsxs(On,{className:"gap-0 overflow-y-auto px-2 pt-3 pb-2 group-data-[state=collapsed]/sidebar:[scrollbar-width:none] group-data-[state=collapsed]/sidebar:[&::-webkit-scrollbar]:hidden",children:[d,l]}),e[6]=l,e[7]=d,e[8]=m):m=e[8];let u;e[9]!==o||e[10]!==a||e[11]!==c||e[12]!==m?(u=s.jsxs(s.Fragment,{children:[a,c,m,o]}),e[9]=o,e[10]=a,e[11]=c,e[12]=m,e[13]=u):u=e[13];const p=u;if(r){let x;return e[14]!==p?(x=s.jsx("div",{className:"group/sidebar flex h-full w-full flex-col bg-sidebar text-sidebar-foreground","data-sidebar":"sidebar","data-state":"expanded","data-tour":ce.nav,children:p}),e[14]=p,e[15]=x):x=e[15],x}let f;return e[16]!==p?(f=s.jsx(Dn,{className:Xl,"data-tour":ce.nav,children:p}),e[16]=p,e[17]=f):f=e[17],f}function Ys(t){const e=w.c(8),{onNavigate:n}=t,i=D(),l=De(),o=zs(),r=Ce();if(!l||r)return null;let a;e[0]!==i?(a=i("sidebar.scope.allProjects"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==o||e[3]!==n?(c=()=>{o(),n?.()},e[2]=o,e[3]=n,e[4]=c):c=e[4];let d;return e[5]!==a||e[6]!==c?(d=s.jsx(Ds,{label:a,onSelect:c}),e[5]=a,e[6]=c,e[7]=d):d=e[7],d}function Js(t){const e=w.c(22),{onNavigate:n}=t,i=D(),l=Ce();let o,r;e[0]!==n||e[1]!==l?(o=l?s.jsx(Bo,{onNavigate:n}):s.jsx(il,{onNavigate:n}),r=!l&&s.jsx(Ut,{onNavigate:n}),e[0]=n,e[1]=l,e[2]=o,e[3]=r):(o=e[2],r=e[3]);let a;e[4]!==n||e[5]!==l?(a=!l&&s.jsx(ol,{onNavigate:n}),e[4]=n,e[5]=l,e[6]=a):a=e[6];let c;e[7]!==o||e[8]!==r||e[9]!==a?(c=s.jsxs("div",{className:"flex flex-col gap-1",children:[o,r,a]}),e[7]=o,e[8]=r,e[9]=a,e[10]=c):c=e[10];let d;e[11]!==n||e[12]!==l||e[13]!==i?(d=l&&s.jsx(Ut,{onNavigate:n,heading:i("sidebar.projectNav.apps")}),e[11]=n,e[12]=l,e[13]=i,e[14]=d):d=e[14];let m;e[15]!==n||e[16]!==l?(m=l?s.jsx(Ll,{onNavigate:n}):s.jsx(fl,{onNavigate:n}),e[15]=n,e[16]=l,e[17]=m):m=e[17];let u;return e[18]!==c||e[19]!==d||e[20]!==m?(u=s.jsx(Cn,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[c,d,m]})}),e[18]=c,e[19]=d,e[20]=m,e[21]=u):u=e[21],u}function Zl(){const t=w.c(3),e=cs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Jo,{}),t[0]=n):n=t[0];let i;return t[1]!==e?(i=s.jsx(Qs,{header:n,back:e?s.jsx(Ws,{}):s.jsx(Ys,{}),body:e?s.jsx(Ks,{}):s.jsx(Js,{}),footer:e?s.jsx(Gs,{}):s.jsx(Uo,{})}),t[1]=e,t[2]=i):i=t[2],i}function er(t){const e=w.c(13),{onClose:n}=t,i=cs();let l;e[0]!==n?(l=s.jsx(Xo,{onClose:n}),e[0]=n,e[1]=l):l=e[1];let o,r;e[2]!==i||e[3]!==n?(o=i?s.jsx(Ws,{onNavigate:n}):s.jsx(Ys,{onNavigate:n}),r=i?s.jsx(Ks,{onNavigate:n}):s.jsx(Js,{onNavigate:n}),e[2]=i,e[3]=n,e[4]=o,e[5]=r):(o=e[4],r=e[5]);let a;e[6]!==i?(a=i?s.jsx(Gs,{}):s.jsx(Ho,{}),e[6]=i,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==a?(c=s.jsx(Qs,{sheet:!0,header:l,back:o,body:r,footer:a}),e[8]=l,e[9]=o,e[10]=r,e[11]=a,e[12]=c):c=e[12],c}const tr=new Set(["completed","failed","requires_action"]);function sr(t){const e=w.c(5),[n]=Gt();let i;e[0]!==n?(i=o=>{n.enableSounds&&tr.has(o.data.status)&&go(ho.dataUri).catch(nr)},e[0]=n,e[1]=i):i=e[1];let l;e[2]!==t||e[3]!==i?(l={orgSlug:t,onTaskStatus:i},e[2]=t,e[3]=i,e[4]=l):l=e[4],xi(l)}function nr(t){console.warn("[status-sounds] playback failed:",t)}const ir=2e3,or=4e4;function lr(t){return t==="success"||t==="updated"}function rr(t){const e=w.c(15);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const i=In(n),l=kt();let o;e[1]!==i.checkout?(o=lr(i.checkout),e[1]=i.checkout,e[2]=o):o=e[2];const r=o,[a]=ee.useState(ar);let c;e[3]!==t?(c=Ee.checkoutReturnPoll(t),e[3]=t,e[4]=c):c=e[4];let d;e[5]!==a?(d=()=>Date.now()<a?ir:!1,e[5]=a,e[6]=d):d=e[6];let m;e[7]!==t||e[8]!==l?(m=async()=>(await l.invalidateQueries({queryKey:Ee.aiPlanEntitlements(t)}),Date.now()),e[7]=t,e[8]=l,e[9]=m):m=e[9];let u;e[10]!==r||e[11]!==c||e[12]!==d||e[13]!==m?(u={queryKey:c,enabled:r,gcTime:0,staleTime:0,refetchInterval:d,queryFn:m},e[10]=r,e[11]=c,e[12]=d,e[13]=m,e[14]=u):u=e[14],Ve(u)}function ar(){return Date.now()+or}function kc(){const t=w.c(3),{org:e}=ie();sr(e.slug),rr(e.id);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(bo,{}),t[0]=n):n=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ut.Sidebar,{renderMobile:cr,children:s.jsx(Zl,{})}),t[1]=i):i=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(ut,{notice:n,children:[i,s.jsx(ut.Content,{children:s.jsx(Pn,{})})]}),t[2]=l):l=t[2],l}function cr(t){const{onClose:e}=t;return s.jsx(er,{onClose:e})}export{kc as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as P,r as i,dI as ie,dG as ce,c as le,e as de,db as j,a2 as fe,J as Se,j as me}from"./index-ifZGovK1.js";import{u as pe}from"./use-mcp-client-D1kFCZ4v.js";import{a as ye}from"./input-DIcILgWd.js";import{c as Ee,u as he}from"./chat-context-DXm8btNS.js";import{u as Re}from"./thread-intent-7GmQH5mt.js";import{e as xe}from"./backoff-CrEUbyZT.js";import{u as we}from"./index-j4NUsiRT.js";import{d as Ae}from"./sandbox-start-errors-BK_aDCyt.js";function Te(e,t){const n=P(t);return Pe({filters:{...e,status:"pending"}},n).length}function X(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function Pe(e={},t){const n=P(t).getMutationCache(),r=i.useRef(e),s=i.useRef(null);return s.current===null&&(s.current=X(n,e)),i.useEffect(()=>{r.current=e}),i.useSyncExternalStore(i.useCallback(u=>n.subscribe(()=>{const a=ie(s.current,X(n,r.current));s.current!==a&&(s.current=a,ce.schedule(u))}),[n]),()=>s.current,()=>s.current)}async function Ce(e,t,n){const r=await e.callTool({name:t,arguments:n});if(r.isError){const s=r.content?.[0]?.text??`Tool ${t} failed without a message`;throw new Error(s)}return r}const q=["SANDBOX_START"],w=new Map,be=e=>`${e.virtualMcpId}::${e.branch??""}`,ke=e=>e.message.includes("retry shortly"),U=new Set,g={mark:(e,t)=>U.add(`${e}::${t}`),clear:(e,t)=>U.delete(`${e}::${t}`),isStopped:(e,t)=>U.has(`${e}::${t}`)};function _e(e,t){const n=P();return de({mutationKey:q,retry:(r,s)=>ke(s)&&r<6,retryDelay:r=>xe(5e3,500,r,2,0),mutationFn:async r=>{r.branch&&g.clear(r.virtualMcpId,r.branch);const s=be(r),u=w.get(s);if(u)return u;const a=(async()=>(await Ce(e,"SANDBOX_START",r)).structuredContent)();w.set(s,a);try{return await a}finally{w.get(s)===a&&w.delete(s)}},onSuccess:()=>{j(n),t?.onStarted?.()}})}function Ge(e,t){const n=le.c(3);let r;return n[0]!==t||n[1]!==e?(r={mutationKey:q,predicate:u=>{if(!e)return!1;const a=u.state.variables;return!a||a.virtualMcpId!==e?!1:(a.branch??"")===(t??"")}},n[0]=t,n[1]=e,n[2]=r):r=n[2],Te(r)>0}function Ue(e){return e.appPaused||e.userStopped?{kind:"suspended"}:e.startError&&!e.previewUrl?{kind:"errored",error:e.startError}:e.previewUrl?{kind:"iframe",previewUrl:e.previewUrl}:{kind:"starting"}}function ge(e){return e.executionEnabled&&e.sessionRuntime==="sandbox"&&e.hasActiveRepository&&!!e.userId&&!!e.branch&&!e.vmEntry&&!e.userStopped&&!e.isPending&&!e.attempted}function Me(e){return e.threadLoaded&&e.isOwner&&e.hasActiveRepository&&!e.branch&&!e.attempted}function De(e){return e.executionEnabled&&e.notFound&&!!e.deadVmId&&!e.isPending&&!e.userStopped&&e.deadVmId!==e.lastDeadVmId}function We(e){const{agentSandboxMap:t,threadSandboxMap:n,userId:r,branch:s}=e,u=e.ownerId??r;if(!r||!u||!s)return t;const a=n?.[u]?.[s];return a?{...t??{},[r]:{...t?.[r]??{},[s]:a}}:t}function A(e,t,n){const r={virtualMcpId:e};return t&&(r.branch=t),n&&(r.threadId=n),r}const Y=2,Le=new Set(["scheduling-timeout","reconciler-error","claim-never-created","unknown"]);function J(e){return Le.has(e)}function Oe(e){return e.executionEnabled&&e.failedReason!==null&&J(e.failedReason)&&e.attempts<Y&&!e.isPending&&!e.userStopped&&!e.alreadyHandled}const $e={branch:null,count:0,handled:!1};function Be(e,t){return e.branch===t?e:{branch:t,count:0,handled:!1}}function Ve(e){return e.mutationError?e.mutationError:e.phase?.kind==="failed"&&!e.startPending&&e.claimRetryExhausted?{code:null,message:e.phase.message}:null}function Fe(e){switch(e.kind){case"suspended":return"suspended";case"iframe":return"running";case"starting":return"starting";case"errored":return"errored"}}function Q(e,t){return`${e??""}::${t??""}`}function ve(e){const t=e.vmEntry?.previewUrl??null;return t||(e.seeded?.key===e.key?e.seeded.url:null)}function T(e){const{data:t,virtualMcpId:n,branch:r}=e;t?.branch&&!r&&e.setCurrentTaskBranch(t.branch),t?.previewUrl&&e.setSeededPreviewUrl({key:Q(n,t.branch??r),url:t.previewUrl})}const Ie={branch:null,previewState:{kind:"starting"},status:"idle",vmEntry:null,previewUrl:null,userStopped:!1,start:()=>{},stop:async()=>{},restart:async()=>{},retry:()=>{},resume:()=>{}},G=i.createContext(Ie);function ze(){return i.use(G)}function Ze({executionEnabled:e,virtualMcpId:t,branch:n,userId:r,hasActiveRepository:s,vmEntry:u,threadId:a,children:D}){const{org:L}=fe(),{setCurrentTaskBranch:l}=Ee(),M=Re(),p=we(),W=P(),O=ye(t),z=O.resolved?O.runtime:null,d=he()?.taskId??null,$=pe({connectionId:Se,orgId:L.id,orgSlug:L.slug}),c=_e($,{onStarted:()=>{a&&M?.refreshThreadMetadata(a)}}),{mutate:f,reset:Z}=c,[ee,S]=i.useState(null),C=i.useRef(new Set),b=i.useRef(null),[B,R]=i.useState($e),E=Be(B,n);E!==B&&R(E);const y=p.phase?.kind==="failed"?p.phase:null,V=ve({vmEntry:u,seeded:y?null:ee,key:Q(t,n)}),h=!!t&&!!n&&g.isStopped(t,n),te=p.status.state==="paused",ne=!y||!J(y.reason)||E.count>=Y,re=Ve({mutationError:c.isError&&c.error?Ae(c.error.message):null,phase:p.phase,startPending:c.isPending,claimRetryExhausted:ne}),F=Ue({previewUrl:V,appPaused:te,userStopped:h,startError:re}),se=Fe(F),k=n??"",oe=C.current.has(k),v=ge({executionEnabled:e,hasActiveRepository:s,userId:r,branch:n,vmEntry:u,userStopped:h,isPending:c.isPending,attempted:oe,sessionRuntime:z});i.useEffect(()=>{if(!v||!t)return;C.current.add(k);const m=A(t,n,d);f(m,{onSuccess:o=>{T({data:o,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:o=>{console.error("[sandbox-lifecycle] auto-start failed:",o)}})},[v,k,n,t,d,f,l,S]);const x=p.notFound?u?.sandboxHandle??null:null,I=De({executionEnabled:e,notFound:p.notFound,deadVmId:x,lastDeadVmId:b.current,isPending:c.isPending,userStopped:h});i.useEffect(()=>{if(!I||!x||!t)return;b.current=x;const m=A(t,n,d);f(m,{onSuccess:o=>{T({data:o,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:o=>{console.error("[sandbox-lifecycle] self-heal failed:",o)}})},[I,x,t,n,d,f,l,S]);const N=Oe({executionEnabled:e,failedReason:y?.reason??null,attempts:E.count,isPending:c.isPending,userStopped:h,alreadyHandled:E.handled});i.useEffect(()=>{if(!y){R(o=>o.handled?{...o,handled:!1}:o);return}if(!N||!t)return;R(o=>({...o,handled:!0,count:o.count+1}));const m=A(t,n,d);f(m,{onSuccess:o=>{T({data:o,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:o=>{console.error("[sandbox-lifecycle] claim auto-retry failed:",o)}})},[y,N,t,n,d,f,l,S]);const _=()=>{if(!e||!t)return;const m=A(t,n,d);f(m,{onSuccess:o=>{T({data:o,virtualMcpId:t,branch:n,setCurrentTaskBranch:l,setSeededPreviewUrl:S})},onError:o=>{console.error("[sandbox-lifecycle] user start failed:",o)}})},K=async()=>{if(!(!e||!t||!n)&&u){g.mark(t,n);try{await $.callTool({name:"SANDBOX_DELETE",arguments:{virtualMcpId:t,branch:n}})}catch{}j(W)}},ae=async()=>{await K(),_()},H=()=>{C.current=new Set,b.current=null,R({branch:n,count:0,handled:!1}),Z(),_()},ue={branch:n,previewState:F,status:se,vmEntry:u,previewUrl:V,userStopped:h,start:_,stop:K,restart:ae,retry:H,resume:H};return me.jsx(G,{value:ue,children:D})}export{Ze as S,ze as a,_e as b,We as o,Me as s,Ge as u};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{c as ct,b as Lt,r as R,l as me,j as o,b2 as la,B as Et,U as ln,ag as ca,X as ua,V as da,a as Ko,F as fa,K as Io,m as ma,o as pa,h as ha,t as ie}from"./index-ifZGovK1.js";import{u as ga}from"./chat-context-DXm8btNS.js";import{$ as va,H as Zn,a0 as ya,a1 as xa,a2 as ba,a3 as Sa,a4 as _a,a5 as wa,a6 as Xr,a7 as ja,a8 as ka,y as kt,a9 as Le,aa as Ea,z as Gn,w as Un,d as Ra,u as Aa,ab as Zr,i as Ca,ac as Na,k as Ta,h as Va,ad as Fo,ae as Pa,af as Ma,t as eo,ag as Da,ah as Ka,ai as Wn,aj as to,ak as no,al as so,am as vs,an as Ia,C as Fa,ao as Ba,x as Oa,ap as ro,aq as La,ar as oo,as as io,at as ao,M as $a,au as lo,a as za,av as cn,aw as Ha,ax as Wa,ay as jn,az as ys}from"./runnable-block-editor-CqYgijVY.js";import{c as qa}from"./repository-binding-DtIeSvDY.js";import{n as Ga,t as Ua}from"./ChevronUp-x46FJEcD.js";import{aa as Bo,b as Qn,ap as Ya,H as Ja,a4 as co,a0 as uo}from"./agent-icon--EtIPqub.js";import{S as un}from"./scroll-area-9wUBmncr.js";import{c as At,T as Ct,a as Nt}from"./tooltip-gMeEuHtO.js";import{an as Qa,a3 as fo,l as Xa,u as Za,m as el,C as tl,R as nl,A as sl,a1 as It,a2 as Ft,as as mo,K as rl,au as ol}from"./use-content-sync-D_qyLHCv.js";import{f as il,u as al,G as ll,t as xs,H as po,s as cl,m as ul,I as dl}from"./blocks-tab-states-Chq5j0oT.js";import{m as fl,u as ml,P as pl}from"./mustache-BzHjgnm5.js";import{bb as hl,b as Ks,bd as Oo,G as gl,be as ot,bf as Es,bg as Lo,au as Qt,af as Rs,bh as As,av as Ot,ag as dn,g as vl,k as yl,E as xl,t as qn,p as En,aI as bl,as as Jt,ai as bs,ar as St,aq as kn,bi as Sl,M as _l,aw as ho,ax as go,at as wl,bj as jl,bk as Bt,bl as kl,bm as El,bn as Rl,ap as vo,bo as Ss,bp as Al,bq as Cl,br as Nl,an as Tl,aY as Vl,a_ as Pl,aS as Ml,bs as Dl,bt as Kl,bu as Il,ah as yo,bv as Fl,am as Bl,bw as Ol}from"./parse-sections-YhOUxu7l.js";import{a as Ll}from"./Copy01-OBSYmimV.js";import{a as Cs,e as $o}from"./UserSquare-BBEl_BxL.js";import{i as xo}from"./Tool01-BsK9c3-e.js";import{s as bo}from"./Image01-BCnLFq1D.js";import{s as $l}from"./Plus-vkM1FxVr.js";import{s as zl}from"./Trash01-Z1ezoy3S.js";import{i as Ns}from"./ZoomOut-DytgoG2i.js";import{u as Hl,a as So,K as Wl,P as ql,b as Gl,C as Ul,D as Yl,c as Jl}from"./core.esm-DJ5llHMe.js";import{u as Ql,s as Xl,a as Yn,S as Zl,v as ec}from"./sortable.esm-CkqHW6-y.js";import{s as tc,g as nc,u as sc,A as rc}from"./use-section-preview-base-BASvFHv_.js";import{i as oc}from"./thread-intent-7GmQH5mt.js";import{A as _s}from"./avatar-DHKJiyOX.js";import{e as ic,d as _o,b as ac,A as lc,a as cc,f as uc}from"./alert-dialog-C-DaggA1.js";import{b as dc}from"./format-time-Cq80KKvY.js";import{d as fc}from"./shell-layout-U7D4A6nk.js";import{u as mc}from"./use-members-0ZBHc0S5.js";import{a as pc,P as wo,w as hc,b as gc}from"./page-seo-form-CrgZFHtq.js";import{u as vc}from"./use-apply-named-rule-B_CXDUdG.js";import{c as jo,d as ko,e as yc,f as xc,g as bc}from"./variant-draft-pointer-HWAlFj6Z.js";import"./use-panel-navigate-Bghh8kV3.js";import"./thread-route-C7RSGMhP.js";import"./use-project-scope-DH5nL_oD.js";import"./autosend-xoWUmECR.js";import"./use-mcp-client-D1kFCZ4v.js";import"./auth-C_nDagDA.js";import"./use-decopilot-events-Cp8NaBPU.js";import"./watch-sse-pool-BoG6Bqps.js";import"./task-board-BrTYr-oE.js";import"./schema-Cn4x5iT-.js";import"./backoff-CrEUbyZT.js";import"./use-ai-providers-CAt_9H4n.js";import"./location-V0VwTJTt.js";import"./use-organization-settings-laAOR3Cm.js";import"./utils-CduIoZ0d.js";import"./Play-Ns9aRVTY.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-Ck7rgrik.js";import"./LinkBroken01-DcsqjBuj.js";import"./collapsible-CnlVGt-G.js";import"./use-copy-Cn8Org7G.js";import"./usage-stats-BecGIkLk.js";import"./tool-namespace-DIE_8J9o.js";import"./form-D4PspedZ.js";import"./label-Dhoh3DcI.js";import"./utils-CVEq3hMx.js";import"./markdown-prFeEkT4.js";import"./use-mobile-CKoO3XSk.js";import"./use-clock-tick-DflKMAWl.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-fHjuxWIZ.js";import"./types-CHFSNT7a.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./AlertCircle-CUAx3A4b.js";import"./XClose-BdwIxxCT.js";import"./ShoppingBag01-aJuRSlBz.js";import"./SearchMd-Cp6J-1Iu.js";import"./sheet-Dhe0uPV2.js";import"./integration-icon-D1aQLe0v.js";import"./use-connection-CBKH8IwL.js";import"./use-navigate-to-agent-DLX1nkvn.js";import"./Link01-8aKNfNRw.js";import"./use-mcp-prompts-wKDmQlGB.js";import"./Monitor01-DQEkUL3d.js";import"./use-thread-outputs-CoFWg3_v.js";import"./file-type-icon-DHFVwXjA.js";import"./switch-ByCU93P4.js";import"./textarea-Bbbnnl4r.js";import"./ChevronSelectorVertical-BSRBjpBn.js";import"./command-BlBQgQPI.js";import"./index-BCHFFeZZ.js";import"./popover-DaReiQzV.js";import"./monaco-editor-Wx_2qGOP.js";import"./editor-BctLuJLS.js";import"./delay-CnY5UFtP.js";import"./calendar-qN6CeKGa.js";import"./SwitchHorizontal01-B5WFt7_0.js";import"./Minus-B38cW2ZC.js";import"./select-DUEGSJco.js";import"./index-BdQq_4o_.js";import"./index-DNa7Epd0.js";import"./editor-classes-BnPaf--r.js";import"./toggle-group-CXUKmPFr.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-BMxhMbUn.js";import"./Upload01-B3-nlnKa.js";import"./DotsVertical-jkvtcdek.js";import"./search-input-1DLvCYgl.js";import"./tabs-C7f3nqQx.js";import"./use-debounced-value-c5JdkW89.js";import"./use-file-configs-DW0hmZjE.js";import"./asset-utils-Cb8p2lKk.js";import"./useInfiniteQuery-wCORGPw3.js";import"./infiniteQueryObserver-DvmMaiCa.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./input-DIcILgWd.js";import"./icon-button-HZwQKD3a.js";import"./chat-draft-WGnppXw7.js";import"./ArrowUp-EL0FBv9C.js";import"./ArrowLeft-BWCsylYe.js";import"./use-deco-credits-D8w-JIDW.js";import"./use-open-billing-url-C5lEsbaH.js";import"./index-B32YFtAw.js";import"./checkbox-vFQy8MvV.js";import"./Key01-CG7Kua6O.js";import"./ai-providers-logos-DD3qZ33J.js";import"./drawer-0sYDH2mt.js";import"./input-BeDIlaby.js";import"./suggestion-BNEVVm5c.js";import"./use-org-fs-49a1bhbu.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-hsFyGLR_.js";import"./plan-ladder-BKLU8eo8.js";import"./add-connection-dialog-F6QQAEZv.js";import"./collection-search--9d0M5sc.js";import"./extract-connection-data-CBAyhzk-.js";import"./metadata-D72DunRR.js";import"./connection-Bo3v2rj5.js";import"./url-slug-D37s8EDd.js";import"./connection-card-DMfcnulT.js";import"./connection-slug-CITJ0kGN.js";import"./slugify-CEUa2lfQ.js";import"./schema-Dvc5tPTN.js";import"./connection-form-helpers-A3QfJozi.js";import"./authenticate-and-persist-oauth-CpcQdSQ-.js";import"./mcp-oauth-CNKUkWMd.js";import"./mcp-oauth-CTJ5Iw4i.js";import"./collection-tabs-BfpnVdlQ.js";import"./badge-ux-RK1YK.js";import"./use-infinite-scroll-Cuyf7850.js";import"./useSuspenseInfiniteQuery-JvpRoEFG.js";import"./use-task-board-events-BARWSwfj.js";import"./use-chat-layout-state-24wCHq_-.js";import"./sandbox-git-api-CH_-QFpD.js";import"./sandbox-url-D3mC8qhT.js";import"./Building02-PifDTlhb.js";import"./CheckCircle-CMGqXocs.js";import"./CreditCard01-DWsSThAm.js";import"./Globe04-blkS_Kfg.js";import"./Sun-k4hypx5Q.js";import"./User01-C2Sw39bs.js";import"./Users01-DMFeioyM.js";import"./index-j4NUsiRT.js";import"./experiments-tab-choice-CMHPX5ZC.js";import"./slider-CLUaEqdg.js";import"./index-Bxkd37dZ.js";import"./tooltipContext-BQS7kWxi.js";import"./CategoricalChart-QwBn7EzX.js";import"./index-gqp4B5qj.js";import"./ActiveShapeUtils-CHmxGMIj.js";import"./Sector-BeXkYaJv.js";import"./symbol-BQLM2_V8.js";import"./empty-state-D6RWdvUz.js";import"./alert-BDbwlXZm.js";import"./section-preview-url-7zfngvgW.js";import"./differenceInSeconds-C3x8sHUj.js";import"./project-icon-ZadU5ZjL.js";import"./new-project-dialog-DFsG79bb.js";import"./repository-import-picker-C2sQ94O1.js";import"./repository-picker-BXaWFfDW.js";import"./required-auth-layout-4jyUcmCy.js";import"./use-org-sso-B_zXOLDA.js";import"./use-org-auth-client-t4l-TKT1.js";import"./use-move-blocks-Dm4etxGk.js";const Sc={escape:va};function _c(n,e){for(const r of tc(n,e)){const i=typeof r.title=="string"?r.title:void 0;if(i?.includes("{{"))return i}}function wc(n,e){if(!e)return;const r=hl(n,oc(e));if(r)try{const i=_c(r.resolveType,e);return i&&fl.render(i,r.data,{},Sc).trim()||void 0}catch{return}}function jc(n){const e=ct.c(13),{icon:r,label:i,className:l}=n;let u;e[0]!==l?(u=me("size-3.5",l),e[0]=l,e[1]=u):u=e[1];let y;e[2]!==r||e[3]!==u?(y=o.jsx(r,{className:u}),e[2]=r,e[3]=u,e[4]=y):y=e[4];let m;e[5]!==i||e[6]!==y?(m=o.jsx(Ct,{asChild:!0,children:o.jsx("span",{role:"img","aria-label":i,className:"shrink-0 cursor-help",children:y})}),e[5]=i,e[6]=y,e[7]=m):m=e[7];let b;e[8]!==i?(b=o.jsx(Nt,{className:"max-w-56",children:i}),e[8]=i,e[9]=b):b=e[9];let h;return e[10]!==m||e[11]!==b?(h=o.jsxs(At,{children:[m,b]}),e[10]=m,e[11]=b,e[12]=h):h=e[12],h}const kc="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Eo(n){return Array.from({length:n},(e,r)=>({id:crypto.randomUUID(),index:r}))}function zo(n){return n.map((e,r)=>({...e,index:r}))}function Ec(n,e){if(e===n.length)return n;if(e<n.length)return zo(n.slice(0,e));const r=Array.from({length:e-n.length},(i,l)=>({id:crypto.randomUUID(),index:n.length+l}));return[...n,...r]}function Ho(n){const e=ct.c(44),{section:r,raw:i,meta:l,decofile:u}=n,y=Lt(),m=Zn(),b=r.isSavedBlock===!0,h=r.isMultivariate===!0;let k;e[0]!==l||e[1]!==i?(k=i&&l?nc(i,l):void 0,e[0]=l,e[1]=i,e[2]=k):k=e[2];const N=k;let L;e[3]!==l||e[4]!==h||e[5]!==i||e[6]!==b?(L=i&&l&&!b&&!h?wc(i,l):void 0,e[3]=l,e[4]=h,e[5]=i,e[6]=b,e[7]=L):L=e[7];const z=L;let H;e[8]!==u||e[9]!==l||e[10]!==i||e[11]!==r?(H=wa(i,r,u,l),e[8]=u,e[9]=l,e[10]=i,e[11]=r,e[12]=H):H=e[12];const B=H;let w;e[13]!==h||e[14]!==i?.__resolveType?(w=!h&&Ks(i?.__resolveType??""),e[13]=h,e[14]=i?.__resolveType,e[15]=w):w=e[15];const p=w,te=b?Qn:h?Bo:$o;let E;e[16]!==h||e[17]!==b?(E=b?{color:gl}:h?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=h,e[17]=b,e[18]=E):E=e[18];const W=E;let V;e[19]!==te||e[20]!==m?(V=m?o.jsxs("span",{className:"relative size-4 shrink-0",children:[o.jsx(te,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),o.jsx(ka,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):o.jsx(Ya,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=te,e[20]=m,e[21]=V):V=e[21];let J;e[22]!==N?(J=N&&o.jsx("img",{src:N,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=N,e[23]=J):J=e[23];let g;e[24]!==m||e[25]!==W?(g=!m&&o.jsx(Cs,{className:"h-4 w-4 shrink-0",style:W}),e[24]=m,e[25]=W,e[26]=g):g=e[26];const Q=m?"shrink":"flex-1",x=r.isHidden&&"line-through opacity-50";let Z;e[27]!==x||e[28]!==Q?(Z=me("min-w-0 truncate text-sm font-medium",Q,x),e[27]=x,e[28]=Q,e[29]=Z):Z=e[29];const q=z??r.label;let pe;e[30]!==Z||e[31]!==q?(pe=o.jsx("span",{className:Z,children:q}),e[30]=Z,e[31]=q,e[32]=pe):pe=e[32];let ye;e[33]!==p||e[34]!==m||e[35]!==B||e[36]!==y?(ye=m?o.jsxs(o.Fragment,{children:[p&&o.jsx(jc,{icon:Ns,label:y("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),B&&o.jsx(Xr,{}),o.jsx("span",{className:"min-w-0 flex-1"})]}):B&&o.jsx(Xr,{className:"absolute -right-0.5 -top-0.5"}),e[33]=p,e[34]=m,e[35]=B,e[36]=y,e[37]=ye):ye=e[37];let ue;return e[38]!==pe||e[39]!==ye||e[40]!==V||e[41]!==J||e[42]!==g?(ue=o.jsxs(o.Fragment,{children:[V,J,g,pe,ye]}),e[38]=pe,e[39]=ye,e[40]=V,e[41]=J,e[42]=g,e[43]=ue):ue=e[43],ue}const Rc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Ac="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]";function Wo(n,e,r){if(r)return ja({selected:e});const i=n.isSavedBlock===!0,l=n.isMultivariate===!0;return me("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":i?Rc:l?Ac:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function ws(n,e){return me("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":n?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function Cc(n){const e=ct.c(90),{section:r,raw:i,meta:l,decofile:u,sortableId:y,selected:m,onSelect:b,onDelete:h,onDuplicate:k,onMakeReusable:N,onToggleHidden:L,onToggleLazy:z,onAddVariant:H,onDetach:B}=n,w=Lt(),p=Zn(),te=i?Ks(i.__resolveType??""):!1,E=r.isHidden===!0,W=te||E;let V;e[0]!==r?(V=Oo(r),e[0]=r,e[1]=V):V=e[1];const J=V,g=!!z&&!r.isMultivariate;let Q;e[2]!==y?(Q={id:y,animateLayoutChanges:Vc},e[2]=y,e[3]=Q):Q=e[3];const{attributes:x,listeners:Z,setNodeRef:q,transform:pe,isDragging:ye}=Ql(Q);let ue;e[4]!==pe?(ue=Ul.Transform.toString(pe?{...pe,x:0}:null),e[4]=pe,e[5]=ue):ue=e[5];const fe=ye?0:void 0;let Re;e[6]!==ue||e[7]!==fe?(Re={transform:ue,opacity:fe},e[6]=ue,e[7]=fe,e[8]=Re):Re=e[8];const j=Re;let re;e[9]!==r?(re=xa(r),e[9]=r,e[10]=re):re=e[10];const Ae=re,Ce="button",S=0;let K;e[11]!==b?(K=I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),b())},e[11]=b,e[12]=K):K=e[12];const he=ye?"cursor-grabbing":"cursor-pointer";let M;e[13]!==p||e[14]!==r||e[15]!==m||e[16]!==he?(M=me("touch-none transition-colors",he,Wo(r,m,p)),e[13]=p,e[14]=r,e[15]=m,e[16]=he,e[17]=M):M=e[17];let xe;e[18]!==u||e[19]!==l||e[20]!==i||e[21]!==r?(xe=o.jsx(Ho,{section:r,raw:i,meta:l,decofile:u}),e[18]=u,e[19]=l,e[20]=i,e[21]=r,e[22]=xe):xe=e[22];const O=!p&&g&&o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"ghost",size:"icon","aria-label":w(te?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:me(ws(W,te)),onClick:I=>{I.stopPropagation(),z?.()},onPointerDown:Tc,children:o.jsx(Ns,{className:me("h-3.5 w-3.5",te&&"text-warning")})})}),o.jsx(Nt,{side:"bottom",children:w(te?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),oe=p?o.jsx(ba,{label:w(E?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:E,onToggle:L,children:E?o.jsx(xo,{className:"h-3.5 w-3.5"}):o.jsx(bo,{className:"h-3.5 w-3.5"})}):o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"ghost",size:"icon","aria-label":w(E?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:me(ws(W,E)),onClick:I=>{I.stopPropagation(),L()},onPointerDown:Nc,children:E?o.jsx(xo,{className:"h-3.5 w-3.5"}):o.jsx(bo,{className:"h-3.5 w-3.5"})})}),o.jsx(Nt,{side:"bottom",children:w(E?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),G=ua,Ke=Sa;let ke;e[23]!==w?(ke=w("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=w,e[24]=ke):ke=e[24];const ut=me(ws(W,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let Ze;e[25]!==Ke||e[26]!==ke||e[27]!==ut?(Ze=o.jsx(Ke,{label:ke,classicClassName:ut}),e[25]=Ke,e[26]=ke,e[27]=ut,e[28]=Ze):Ze=e[28];let $e;e[29]!==p||e[30]!==g||e[31]!==te||e[32]!==z||e[33]!==w?($e=p&&g&&o.jsxs(o.Fragment,{children:[o.jsxs(ln,{onClick:I=>{I.stopPropagation(),z?.()},children:[o.jsx(Ns,{className:"h-4 w-4"}),w(te?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),o.jsx(ca,{})]}),e[29]=p,e[30]=g,e[31]=te,e[32]=z,e[33]=w,e[34]=$e):$e=e[34];let qe;e[35]!==k?(qe=I=>{I.stopPropagation(),k()},e[35]=k,e[36]=qe):qe=e[36];let it;e[37]===Symbol.for("react.memo_cache_sentinel")?(it=o.jsx(Ll,{className:"h-4 w-4"}),e[37]=it):it=e[37];let Ge;e[38]!==w?(Ge=w("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=w,e[39]=Ge):Ge=e[39];let Ue;e[40]!==qe||e[41]!==Ge?(Ue=o.jsxs(ln,{onClick:qe,children:[it,Ge]}),e[40]=qe,e[41]=Ge,e[42]=Ue):Ue=e[42];let Ye;e[43]!==p||e[44]!==J||e[45]!==H||e[46]!==w?(Ye=J&&o.jsxs(ln,{className:me(!p&&_a),onClick:I=>{I.stopPropagation(),H()},children:[o.jsx(Bo,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=p,e[44]=J,e[45]=H,e[46]=w,e[47]=Ye):Ye=e[47];let de;e[48]!==p||e[49]!==Ae||e[50]!==N||e[51]!==w?(de=Ae&&o.jsxs(ln,{className:me(!p&&kc),onClick:I=>{I.stopPropagation(),N()},children:[p?o.jsx(Qn,{className:"h-4 w-4"}):o.jsx(Cs,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=p,e[49]=Ae,e[50]=N,e[51]=w,e[52]=de):de=e[52];let ge;e[53]!==p||e[54]!==B||e[55]!==r.isMultivariate||e[56]!==r.isSavedBlock||e[57]!==w?(ge=r.isSavedBlock===!0&&!r.isMultivariate&&o.jsxs(ln,{onClick:I=>{I.stopPropagation(),B()},children:[p?o.jsx($o,{className:"h-4 w-4"}):o.jsx(Cs,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=p,e[54]=B,e[55]=r.isMultivariate,e[56]=r.isSavedBlock,e[57]=w,e[58]=ge):ge=e[58];let be;e[59]!==h?(be=I=>{I.stopPropagation(),h()},e[59]=h,e[60]=be):be=e[60];let ee;e[61]===Symbol.for("react.memo_cache_sentinel")?(ee=o.jsx(zl,{className:"h-4 w-4"}),e[61]=ee):ee=e[61];let F;e[62]!==w?(F=w("sectionsEditor.sectionList.deleteMenuItem"),e[62]=w,e[63]=F):F=e[63];let De;e[64]!==be||e[65]!==F?(De=o.jsxs(ln,{variant:"destructive",onClick:be,children:[ee,F]}),e[64]=be,e[65]=F,e[66]=De):De=e[66];let et;e[67]!==$e||e[68]!==Ue||e[69]!==Ye||e[70]!==de||e[71]!==ge||e[72]!==De?(et=o.jsxs(da,{align:"end",className:"w-44",children:[$e,Ue,Ye,de,ge,De]}),e[67]=$e,e[68]=Ue,e[69]=Ye,e[70]=de,e[71]=ge,e[72]=De,e[73]=et):et=e[73];let tt;e[74]!==G||e[75]!==Ze||e[76]!==et?(tt=o.jsxs(G,{children:[Ze,et]}),e[74]=G,e[75]=Ze,e[76]=et,e[77]=tt):tt=e[77];let st;return e[78]!==x||e[79]!==Z||e[80]!==b||e[81]!==q||e[82]!==j||e[83]!==M||e[84]!==xe||e[85]!==O||e[86]!==oe||e[87]!==tt||e[88]!==K?(st=o.jsxs("div",{ref:q,style:j,...x,...Z,role:Ce,tabIndex:S,onClick:b,onKeyDown:K,className:M,children:[xe,O,oe,tt]}),e[78]=x,e[79]=Z,e[80]=b,e[81]=q,e[82]=j,e[83]=M,e[84]=xe,e[85]=O,e[86]=oe,e[87]=tt,e[88]=K,e[89]=st):st=e[89],st}function Nc(n){return n.stopPropagation()}function Tc(n){return n.stopPropagation()}function Vc(){return!1}function Ts(n){const e=ct.c(11),{canAddSection:r,onAddSection:i,className:l,size:u}=n,y=Lt();let m;e[0]!==l?(m=me("w-full",l),e[0]=l,e[1]=m):m=e[1];const b=!r;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx($l,{size:14}),e[2]=h):h=e[2];let k;e[3]!==y?(k=y("sectionsEditor.sectionList.addSectionButton"),e[3]=y,e[4]=k):k=e[4];let N;return e[5]!==i||e[6]!==u||e[7]!==m||e[8]!==b||e[9]!==k?(N=o.jsxs(Et,{type:"button",variant:"outline",size:u,className:m,disabled:b,onClick:i,children:[h,k]}),e[5]=i,e[6]=u,e[7]=m,e[8]=b,e[9]=k,e[10]=N):N=e[10],N}function Pc(n){const e=ct.c(101),{listKey:r,rawSections:i,sections:l,meta:u,decofile:y,selectedIndex:m,onSelect:b,onReorder:h,onDelete:k,onDuplicate:N,onMakeReusable:L,onToggleHidden:z,onToggleLazy:H,onAddVariant:B,onDetach:w,onAddSection:p,canAddSection:te}=n,E=te===void 0?!0:te,W=Lt(),V=Zn();let J;e[0]!==l.length?(J=()=>Eo(l.length),e[0]=l.length,e[1]=J):J=e[1];const[g,Q]=R.useState(J),[x,Z]=R.useState(null),[q,pe]=R.useState(r),[ye,ue]=R.useState(l.length),fe=R.useRef(!1);q!==r?(pe(r),ue(l.length),Q(Eo(l.length))):ye!==l.length&&(ue(l.length),Q(Je=>Ec(Je,l.length)));let Re;e[2]===Symbol.for("react.memo_cache_sentinel")?(Re={activationConstraint:{distance:8}},e[2]=Re):Re=e[2];let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j={coordinateGetter:Xl},e[3]=j):j=e[3];const re=Hl(So(ql,Re),So(Wl,j));let Ae;e[4]!==g?(Ae=g.map(Mc),e[4]=g,e[5]=Ae):Ae=e[5];const Ce=Ae;let S;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=Je=>{Z(String(Je.active.id))},e[6]=S):S=e[6];const K=S;let he;e[7]!==Ce||e[8]!==h?(he=Je=>{Z(null);const{active:ae,over:Ne}=Je;if(!Ne||ae.id===Ne.id)return;const ze=Ce.indexOf(String(ae.id)),rt=Ce.indexOf(String(Ne.id));ze===-1||rt===-1||(Q(at=>zo(Yn([...at],ze,rt))),fe.current=!0,requestAnimationFrame(()=>{fe.current=!1}),h?.(ze,rt))},e[7]=Ce,e[8]=h,e[9]=he):he=e[9];const M=he;let xe;e[10]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>{Z(null)},e[10]=xe):xe=e[10];const O=xe;let oe,G,Ke,ke,ut,Ze,$e,qe,it,Ge,Ue,Ye,de,ge,be;if(e[11]!==x||e[12]!==E||e[13]!==V||e[14]!==y||e[15]!==g||e[16]!==Ce||e[17]!==M||e[18]!==u||e[19]!==p||e[20]!==B||e[21]!==k||e[22]!==w||e[23]!==N||e[24]!==L||e[25]!==b||e[26]!==z||e[27]!==H||e[28]!==i||e[29]!==l||e[30]!==m||e[31]!==re||e[32]!==W){ge=Symbol.for("react.early_return_sentinel");e:{const Je=ae=>{fe.current||b(ae)};if(e[48]!==x||e[49]!==E||e[50]!==V||e[51]!==g||e[52]!==p||e[53]!==i||e[54]!==l||e[55]!==W){const ae=x?g.find(Ne=>Ne.id===x):null;if(ke=ae!=null?l[ae.index]:null,Ke=ae!=null?i[ae.index]:void 0,g.length===0){let Ne;e[59]!==W?(Ne=W("sectionsEditor.sectionList.noSections"),e[59]=W,e[60]=Ne):Ne=e[60];let ze;e[61]!==Ne?(ze=o.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Ne}),e[61]=Ne,e[62]=ze):ze=e[62];const rt=ze;let at;e[63]!==E||e[64]!==V||e[65]!==rt||e[66]!==p?(at=V?rt:o.jsxs("div",{className:"space-y-2",children:[rt,o.jsx(Ts,{canAddSection:E,onAddSection:p,size:"sm"})]}),e[63]=E,e[64]=V,e[65]=rt,e[66]=p,e[67]=at):at=e[67],ge=at;break e}de=me(ae&&"cursor-grabbing"),e[48]=x,e[49]=E,e[50]=V,e[51]=g,e[52]=p,e[53]=i,e[54]=l,e[55]=W,e[56]=Ke,e[57]=ke,e[58]=de}else Ke=e[56],ke=e[57],de=e[58];G=Yl,qe=re,it=Jl,Ge=K,Ue=M,Ye=O,oe=Zl,Ze=Ce,$e=ec,be="space-y-1",ut=g.map(ae=>{const Ne=l[ae.index];return Ne?o.jsx(Cc,{sortableId:ae.id,section:Ne,raw:i[ae.index],meta:u,decofile:y,selected:m===ae.index,onSelect:()=>Je(ae.index),onDelete:()=>k(ae.index),onDuplicate:()=>N(ae.index),onMakeReusable:()=>L(ae.index),onToggleHidden:()=>z(ae.index),onToggleLazy:H?()=>H(ae.index):void 0,onAddVariant:()=>B(ae.index),onDetach:()=>w(ae.index)},ae.id):null})}e[11]=x,e[12]=E,e[13]=V,e[14]=y,e[15]=g,e[16]=Ce,e[17]=M,e[18]=u,e[19]=p,e[20]=B,e[21]=k,e[22]=w,e[23]=N,e[24]=L,e[25]=b,e[26]=z,e[27]=H,e[28]=i,e[29]=l,e[30]=m,e[31]=re,e[32]=W,e[33]=oe,e[34]=G,e[35]=Ke,e[36]=ke,e[37]=ut,e[38]=Ze,e[39]=$e,e[40]=qe,e[41]=it,e[42]=Ge,e[43]=Ue,e[44]=Ye,e[45]=de,e[46]=ge,e[47]=be}else oe=e[33],G=e[34],Ke=e[35],ke=e[36],ut=e[37],Ze=e[38],$e=e[39],qe=e[40],it=e[41],Ge=e[42],Ue=e[43],Ye=e[44],de=e[45],ge=e[46],be=e[47];if(ge!==Symbol.for("react.early_return_sentinel"))return ge;let ee;e[68]!==ut||e[69]!==be?(ee=o.jsx("div",{className:be,children:ut}),e[68]=ut,e[69]=be,e[70]=ee):ee=e[70];let F;e[71]!==oe||e[72]!==Ze||e[73]!==$e||e[74]!==ee?(F=o.jsx(oe,{items:Ze,strategy:$e,children:ee}),e[71]=oe,e[72]=Ze,e[73]=$e,e[74]=ee,e[75]=F):F=e[75];let De;e[76]!==Ke||e[77]!==ke||e[78]!==V||e[79]!==y||e[80]!==u?(De=ke?o.jsx("div",{className:me("cursor-grabbing shadow-lift",Wo(ke,!1,V)),children:o.jsx(Ho,{section:ke,raw:Ke,meta:u,decofile:y})}):null,e[76]=Ke,e[77]=ke,e[78]=V,e[79]=y,e[80]=u,e[81]=De):De=e[81];let et;e[82]!==De?(et=la.createPortal(o.jsx(Gl,{dropAnimation:ya,children:De}),document.body),e[82]=De,e[83]=et):et=e[83];let tt;e[84]!==G||e[85]!==qe||e[86]!==it||e[87]!==Ge||e[88]!==Ue||e[89]!==Ye||e[90]!==F||e[91]!==et?(tt=o.jsxs(G,{sensors:qe,collisionDetection:it,onDragStart:Ge,onDragEnd:Ue,onDragCancel:Ye,children:[F,et]}),e[84]=G,e[85]=qe,e[86]=it,e[87]=Ge,e[88]=Ue,e[89]=Ye,e[90]=F,e[91]=et,e[92]=tt):tt=e[92];let st;e[93]!==E||e[94]!==V||e[95]!==p?(st=!V&&o.jsx(Ts,{canAddSection:E,onAddSection:p,size:"sm",className:"mt-2"}),e[93]=E,e[94]=V,e[95]=p,e[96]=st):st=e[96];let I;return e[97]!==de||e[98]!==tt||e[99]!==st?(I=o.jsxs("div",{className:de,children:[tt,st]}),e[97]=de,e[98]=tt,e[99]=st,e[100]=I):I=e[100],I}function Mc(n){return n.id}function js(n,e,r,i,l){if(!n||!e)return null;if(!e.isMultivariate)return kt(n,e,i,l)?.data??null;const u=ot(n,e),y=u?Es(u,il)[r]:void 0;return y?Lo(y.value,i)?.data??null:null}const Dc=50;function Kc(n,e){n.own.push(Le(e)),n.own.length>Dc&&n.own.shift()}function Ro(n,e){return n.own.includes(Le(e))}function Ic(n,e){const{sectionIndex:r,variantIndex:i,shown:l,next:u,sectionCount:y}=e;return n&&n.sectionIndex===r&&n.variantIndex===i&&n.emitted===l?(n.emitted=u,n):l?{sectionIndex:r,variantIndex:i,base:l,emitted:u,sectionCount:y,own:[Le(l)]}:null}function qo(n,e){return e!==null&&Le(n)!==Le(e)}function Go(n,e){return n.__resolveType!==e.__resolveType}function Fc(n,e,r,i){if(e.length===i)return"here";const l=Le(n),u=e.flatMap((y,m)=>m!==r&&y!==null&&Le(y)===l?[m]:[]);return u.length===1?u[0]:"unknown"}function Ao({formBase:n,rebased:e,versionOf:r}){let i=null;return{ifMatch:l=>{i=l,n&&(n.version===void 0||e)&&(n.version=r(l));const u=n?n.version:r(l);return u===void 0?void 0:{[l]:u}},onApplied:l=>{n&&i!==null&&Object.hasOwn(l,i)&&(n.version=l[i])},reloadOnConflict:!0}}function Bc({merged:n,tracked:e,current:r,saved:i}){return!!n&&!!e&&r===e&&e.emitted===i}function Co(n,e){return!!n&&!!e&&n.contains(e)}function Vs(n){const e=[],r=Ps("",n.ancestor,n.mine,n.theirs,e);return{...n,merged:r,pointers:e}}function Ps(n,e,r,i,l){const u=(y,m)=>Le(y)===Le(m);if(u(r,i)||u(e,i))return r;if(u(e,r))return i;if(ks(r)&&ks(i)){const y=ks(e)?e:{},m={},b=[...Object.keys(r),...Object.keys(i).filter(h=>!(h in r))];for(const h of b){const k=Ps(`${n}/${h.replaceAll("~","~0").replaceAll("/","~1")}`,y[h],r[h],i[h],l);k!==void 0&&(m[h]=k)}return m}return Array.isArray(e)&&Array.isArray(r)&&Array.isArray(i)&&r.length===e.length&&i.length===e.length?e.map((y,m)=>Ps(`${n}/${m}`,y,r[m],i[m],l)):(l.push(n),i)}function ks(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function Oc(n,e){let r=n.merged;for(const i of n.pointers)e[i]==="mine"&&(r=Hc(r,i,Xt(n.mine,i)));return r}function Lc(n,e){return Object.fromEntries(n.pointers.map(r=>[r,e]))}function Uo(n){return Lc(n,"mine")}function Ms(n,e,r){const i=Uo(r);for(const l of r.pointers){const u=e[l];if(!u||!n.pointers.includes(l))continue;["mine","theirs"].every(m=>Le(Xt(n[m],l))===Le(Xt(r[m],l)))&&(i[l]=u)}return i}function Yo(n,e,r={}){const i=e.pointers.filter(l=>!n.pointers.includes(l)||Le(Xt(n.theirs,l))!==Le(Xt(e.theirs,l)));return i.length===0?r:{...r,...Object.fromEntries(i.map(l=>[l,(r[l]??0)+1]))}}function $c(n,e,r){if(!e||Go(n.plan.ancestor,e)||!qo(n.plan.theirs,e)||r(e))return null;const i=Vs({...n.plan,theirs:e});return i.pointers.length===0?null:{plan:i,choices:Ms(n.plan,n.choices,i),fresh:Yo(n.plan,i,n.fresh)}}function zc(n,e){return n.pointers.map(r=>({pointer:r,label:Ea(r,e),mine:Xt(n.mine,r),theirs:Xt(n.theirs,r),schema:Wc(e??null,r)}))}function Is(n){return n.split("/").slice(1).map(e=>e.replaceAll("~1","/").replaceAll("~0","~"))}function Xt(n,e){let r=n;for(const i of Is(e))if(Array.isArray(r))r=r[Number(i)];else if(r&&typeof r=="object")r=r[i];else return;return r}function Hc(n,e,r){const i=Is(e),l=(u,y)=>{if(y===i.length)return r;const m=i[y];if(Array.isArray(u)){const k=[...u];return k[Number(m)]=l(u[Number(m)],y+1),k}const b=u&&typeof u=="object"?{...u}:{},h=l(b[m],y+1);return h===void 0?delete b[m]:b[m]=h,b};return l(n,0)}function Wc(n,e){let r=n;for(const i of Is(e)){if(!r)return null;r=/^\d+$/.test(i)&&!r.properties?.[i]?r.items:r.properties?.[i]}return r??null}const qc=/\.(png|jpe?g|gif|webp|avif|svg)(\?.*)?$/i,No=60,Gc=3;function Jo(n,e){return e?.format==="image-uri"?!0:n.startsWith("data:image/")||/^(https?:)?\/\//.test(n)&&qc.test(n)}function Ds(n,e){if(!(e?.format==="rich-text"||e?.format==="rich-text-inline"||e?.format==="html"||/<\/?[a-z][^>]*>/i.test(n)))return n;const i=n.replace(/<br\s*\/?>/gi,`
|
|
2
|
-
`).replace(/<\/(p|div|li|h[1-6])>/gi,`
|
|
3
|
-
`);return Yc(i).replace(/\u00a0/g," ").replace(/\n{2,}/g,`
|
|
4
|
-
`).trim()}const Uc={" ":" ","&":"&","<":"<",">":">",""":'"',"'":"'"};function Yc(n){if(typeof DOMParser<"u")return new DOMParser().parseFromString(n,"text/html").body.textContent??"";let e=n;for(let r="";r!==e;)r=e,e=e.replace(/<[^<>]*>/g,"");return e.replace(/<|>/g,"").replace(/&(nbsp|amp|lt|gt|quot|#39);/g,r=>Uc[r]??r)}function Jn(n){const e=n.replace(/\s+/g," ").trim();return e.length>No?`${e.slice(0,No-1)}…`:e}function Jc(n){if(n.startsWith("data:"))return"image";const e=n.split(/[?#]/)[0]??n;return decodeURIComponent(e.split("/").pop()||n)}function Xn(n,e){if(n==null||n==="")return{kind:"empty"};if(typeof n=="string")return Jo(n,e)?{kind:"image",src:n}:{kind:"text",text:Ds(n,e)};if(typeof n=="number"||typeof n=="bigint")return{kind:"text",text:String(n)};if(typeof n=="boolean")return{kind:"yesNo",value:n};if(Array.isArray(n)){const r=e?.items??null;return{kind:"list",count:n.length,items:n.slice(0,Gc).map(i=>Qc(i,r)??"")}}if(typeof n=="object"){const r=n;if("value"in r&&Object.keys(r).length<=2)return Xn(r.value,e?.properties?.value??e);const i=Object.entries(r).filter(([l,u])=>!l.startsWith("__")&&u!==void 0).flatMap(([l,u])=>{const y=e?.properties?.[l]??null,m=Xn(u,y);if(m.kind==="empty")return[];const b=m.kind==="text"?Jn(m.text):m.kind==="image"?Jc(m.src):m.kind==="yesNo"?m.value?"✓":"✗":m.kind==="list"?`${m.count}`:"…";return[{label:y?.title?.trim()||l,text:b}]}).slice(0,4);return i.length>0?{kind:"fields",entries:i}:{kind:"empty"}}return{kind:"text",text:String(n)}}function Qc(n,e){if(typeof n=="string")return Jn(Ds(n,e));if(!n||typeof n!="object"||Array.isArray(n))return null;const r=n,i=e?.titleBy,l=i?r[i]:void 0;if(typeof l=="string"&&l.trim())return Jn(l);for(const[u,y]of Object.entries(r))if(!(u.startsWith("__")||typeof y!="string"||!y.trim())&&!Jo(y,e?.properties?.[u]??null))return Jn(Ds(y,null));return null}const To=1500;function Xc(n,e){const r=n.split(/(\s+)/).filter(k=>k!==""),i=e.split(/(\s+)/).filter(k=>k!=="");if(r.length>To||i.length>To)return{mine:[{text:n,kind:"changed"}],theirs:[{text:e,kind:"changed"}]};const l=Array.from({length:r.length+1},()=>new Array(i.length+1).fill(0));for(let k=r.length-1;k>=0;k--)for(let N=i.length-1;N>=0;N--){const L=l[k];L[N]=r[k]===i[N]?l[k+1][N+1]+1:Math.max(l[k+1][N],L[N+1])}const u=[],y=[],m=(k,N,L)=>{const z=k.at(-1);z&&(z.kind===L||L==="same"&&!N.trim())?z.text+=N:k.push({text:N,kind:L})};let b=0,h=0;for(;b<r.length&&h<i.length;)r[b]===i[h]?(m(u,r[b],"same"),m(y,i[h],"same"),b++,h++):l[b+1][h]>=l[b][h+1]?(m(u,r[b],"changed"),b++):(m(y,i[h],"changed"),h++);for(;b<r.length;b++)m(u,r[b],"changed");for(;h<i.length;h++)m(y,i[h],"changed");return{mine:u,theirs:y}}function Zc(n){const e=ct.c(10);let r,i;e[0]!==n?({open:r,...i}=n,e[0]=n,e[1]=r,e[2]=i):(r=e[1],i=e[2]);const{data:l}=Ko.useSession();let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=me("max-h-[85vh] grid-rows-[auto_minmax(0,1fr)_auto] sm:max-w-lg"),e[3]=u):u=e[3];const y=l?.user??null;let m;e[4]!==i||e[5]!==y?(m=o.jsx(ic,{className:u,"data-testid":"form-conflict-dialog",onEscapeKeyDown:tu,children:o.jsx(au,{...i,viewer:y,heading:eu})}),e[4]=i,e[5]=y,e[6]=m):m=e[6];let b;return e[7]!==r||e[8]!==m?(b=o.jsx(uc,{open:r,children:m}),e[7]=r,e[8]=m,e[9]=b):b=e[9],b}function eu(n,e){return o.jsxs(ac,{className:"text-left",children:[o.jsx(lc,{children:n}),o.jsx(cc,{children:e})]})}function tu(n){return n.preventDefault()}const nu={},su=(n,e)=>o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"text-lg font-semibold",children:n}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e})]});function ru(n,e,r=0,i={},l=null){const u=e[Math.min(r,e.length-1)],y=l?.you?void 0:l?.name?.split(/\s+/)[0],m={field:u?iu(u.label):"",label:u?.label??"",name:y??""},b=(h,k,N)=>n(l?.you?N:y?k:h,m);return e.length<=1?{title:b("sectionsEditor.formConflict.titleOne","sectionsEditor.formConflict.titleOneNamed","sectionsEditor.formConflict.titleOneYou"),description:n("sectionsEditor.formConflict.descriptionOne")}:{title:b("sectionsEditor.formConflict.titleStep","sectionsEditor.formConflict.titleStepNamed","sectionsEditor.formConflict.titleStepYou"),description:r>=e.length-1?o.jsx(ou,{t:n,fields:e,choices:i,name:y}):n("sectionsEditor.formConflict.descriptionStep")}}function ou(n){const e=ct.c(11),{t:r,fields:i,choices:l,name:u}=n;let y;if(e[0]!==l||e[1]!==i||e[2]!==u||e[3]!==r){let b;e[5]!==l||e[6]!==u||e[7]!==r?(b=(h,k)=>o.jsxs(R.Fragment,{children:[k>0&&" · ",`${h.label}: `,o.jsx("span",{className:"font-medium text-foreground",children:r((l[h.pointer]??"mine")==="mine"?"sectionsEditor.formConflict.summaryYours":u?"sectionsEditor.formConflict.summaryTheirsNamed":"sectionsEditor.formConflict.summaryTheirs",{name:u??""})})]},h.pointer),e[5]=l,e[6]=u,e[7]=r,e[8]=b):b=e[8],y=i.map(b),e[0]=l,e[1]=i,e[2]=u,e[3]=r,e[4]=y}else y=e[4];let m;return e[9]!==y?(m=o.jsx("span",{"data-testid":"form-conflict-summary",children:y}),e[9]=y,e[10]=m):m=e[10],m}function iu(n){return/^[A-Z][a-z]/.test(n)&&!n.includes("›")?n.charAt(0).toLowerCase()+n.slice(1):n}function au(n){const e=ct.c(68),r=Lt(),{fields:i,choices:l,changedAgain:u,fresh:y,heading:m}=n,b=u===void 0?!1:u,h=y===void 0?nu:y,k=m===void 0?su:m,N=i.length>1,[L,z]=R.useState(0),[H,B]=R.useState(lu);let w;e[0]===Symbol.for("react.memo_cache_sentinel")?(w={},e[0]=w):w=e[0];const[p,te]=R.useState(w),E=Math.max(0,Math.min(L,i.length-1)),W=i[E],V=E===i.length-1;let J;e[1]!==E||e[2]!==i||e[3]!==h?(J=xe=>{const O=i[E],oe=i[xe];!O||!oe||xe===E||(B(G=>new Set(G).add(O.pointer)),te(G=>({...G,[O.pointer]:h[O.pointer]??0,[oe.pointer]:h[oe.pointer]??0})),z(xe))},e[1]=E,e[2]=i,e[3]=h,e[4]=J):J=e[4];const g=J;let Q;e[5]!==E||e[6]!==g?(Q=xe=>{if(!xe)return;const O=oe=>{const G={ArrowLeft:-1,ArrowRight:1}[oe.key];!G||oe.defaultPrevented||oe.altKey||oe.ctrlKey||oe.metaKey||oe.shiftKey||fc(oe.target)||(oe.preventDefault(),g(E+G))};return xe.ownerDocument.addEventListener("keydown",O),()=>xe.ownerDocument.removeEventListener("keydown",O)},e[5]=E,e[6]=g,e[7]=Q):Q=e[7];const x=Q;if(!W)return null;let Z,q,pe,ye,ue;if(e[8]!==H||e[9]!==E||e[10]!==l||e[11]!==i||e[12]!==h||e[13]!==g||e[14]!==k||e[15]!==x||e[16]!==N||e[17]!==n||e[18]!==p||e[19]!==r){const{title:xe,description:O}=ru(r,i,E,l,n.author??null);let oe;e[25]!==n?(oe=G=>{G.detail>1||n.onApply()},e[25]=n,e[26]=oe):oe=e[26],Z=oe,q=N?x:void 0,pe="flex min-w-0 flex-col gap-3",e[27]!==H||e[28]!==E||e[29]!==i||e[30]!==h||e[31]!==g||e[32]!==N||e[33]!==p||e[34]!==r?(ye=N&&o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx("div",{role:"group","aria-label":r("sectionsEditor.formConflict.steps"),className:"-m-1 flex flex-wrap items-center",children:i.map((G,Ke)=>{const ke=Ke!==E&&(h[G.pointer]??0)>(p[G.pointer]??0);return o.jsx("button",{type:"button","aria-label":ke?r("sectionsEditor.formConflict.stepChangedAgain",{label:G.label}):G.label,"aria-current":Ke===E?"step":void 0,"data-answered":Ke!==E&&H.has(G.pointer)?"":void 0,"data-changed-again":ke?"":void 0,onClick:()=>g(Ke),className:"group cursor-pointer rounded-full p-1 focus-ring",children:o.jsx("span",{className:me("block h-2 w-2 rounded-full bg-border transition-[width,background-color,box-shadow] motion-reduce:transition-none","group-hover:bg-muted-foreground/60","group-data-[answered]:bg-foreground/45","group-aria-[current=step]:w-5 group-aria-[current=step]:bg-foreground","group-data-[changed-again]:ring-2 group-data-[changed-again]:ring-warning group-data-[changed-again]:ring-offset-1 group-data-[changed-again]:ring-offset-background")})},G.pointer)})}),o.jsx("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:r("sectionsEditor.formConflict.stepCount",{step:String(E+1),count:String(i.length)})})]}),e[27]=H,e[28]=E,e[29]=i,e[30]=h,e[31]=g,e[32]=N,e[33]=p,e[34]=r,e[35]=ye):ye=e[35],ue=k(xe,O),e[8]=H,e[9]=E,e[10]=l,e[11]=i,e[12]=h,e[13]=g,e[14]=k,e[15]=x,e[16]=N,e[17]=n,e[18]=p,e[19]=r,e[20]=Z,e[21]=q,e[22]=pe,e[23]=ye,e[24]=ue}else Z=e[20],q=e[21],pe=e[22],ye=e[23],ue=e[24];let fe;e[36]!==q||e[37]!==pe||e[38]!==ye||e[39]!==ue?(fe=o.jsxs("div",{ref:q,className:pe,children:[ye,ue]}),e[36]=q,e[37]=pe,e[38]=ye,e[39]=ue,e[40]=fe):fe=e[40];const Re=!b&&"sr-only";let j;e[41]!==Re?(j=me("text-sm text-muted-foreground",Re),e[41]=Re,e[42]=j):j=e[42];let re;e[43]!==b||e[44]!==N||e[45]!==r?(re=b?r(N?"sectionsEditor.formConflict.changedAgainSteps":"sectionsEditor.formConflict.changedAgain"):"",e[43]=b,e[44]=N,e[45]=r,e[46]=re):re=e[46];let Ae;e[47]!==j||e[48]!==re?(Ae=o.jsx("p",{role:"status",className:j,children:re}),e[47]=j,e[48]=re,e[49]=Ae):Ae=e[49];const Ce=N?"vertical":"all";let S;e[50]!==W||e[51]!==n||e[52]!==Ce?(S=o.jsx(fu,{field:W,...n,arrows:Ce}),e[50]=W,e[51]=n,e[52]=Ce,e[53]=S):S=e[53];let K;e[54]!==Ae||e[55]!==S?(K=o.jsxs("div",{className:"-mx-2 flex min-h-0 flex-col gap-3 overflow-y-auto px-2 py-1",children:[Ae,S]}),e[54]=Ae,e[55]=S,e[56]=K):K=e[56];let he;e[57]!==Z||e[58]!==E||e[59]!==g||e[60]!==V||e[61]!==N||e[62]!==r?(he=N?o.jsxs(_o,{className:"flex-row flex-wrap items-center justify-between gap-2 sm:justify-between",children:[o.jsx(Et,{type:"button",variant:"outline","aria-disabled":E===0,onClick:()=>g(E-1),className:"aria-disabled:cursor-default aria-disabled:opacity-45",children:r("sectionsEditor.formConflict.back")}),o.jsx(Et,{type:"button","data-testid":"form-conflict-primary",onClick:V?Z:()=>g(E+1),children:r(V?"sectionsEditor.formConflict.ok":"sectionsEditor.formConflict.next")})]}):o.jsx(_o,{className:"items-center gap-2",children:o.jsx(Et,{type:"button","data-testid":"form-conflict-primary",onClick:Z,children:r("sectionsEditor.formConflict.ok")})}),e[57]=Z,e[58]=E,e[59]=g,e[60]=V,e[61]=N,e[62]=r,e[63]=he):he=e[63];let M;return e[64]!==fe||e[65]!==K||e[66]!==he?(M=o.jsxs(o.Fragment,{children:[fe,K,he]}),e[64]=fe,e[65]=K,e[66]=he,e[67]=M):M=e[67],M}function lu(){return new Set}function cu(n){const e=Xn(n.mine,n.schema),r=Xn(n.theirs,n.schema),i=e.kind==="text"&&r.kind==="text"?Xc(e.text,r.text):null;return l=>i?o.jsx(pu,{parts:i[l]}):o.jsx(gu,{preview:l==="mine"?e:r})}const uu={all:{ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1},vertical:{ArrowDown:1,ArrowUp:-1}};function du(n,e){const r=uu[e][n.key];if(!r)return;const i=[...n.currentTarget.querySelectorAll('[role="radio"]')],l=i.indexOf(document.activeElement);if(l<0)return;n.preventDefault();const u=i[(l+r+i.length)%i.length];u?.focus(),u?.click()}function fu(n){const e=ct.c(65),{field:r,choices:i,viewer:l,author:u,onChoose:y,arrows:m}=n,b=u===void 0?null:u,h=Lt(),[k]=fa(),{language:N}=k;let L,z,H,B,w,p,te,E,W,V,J,g,Q,x;if(e[0]!==m||e[1]!==b||e[2]!==i||e[3]!==r||e[4]!==N||e[5]!==y||e[6]!==h||e[7]!==l?.image||e[8]!==l?.name){const pe=cu(r),ye=i[r.pointer]??"mine",ue=l?.image??void 0;let fe;e[23]!==h||e[24]!==l?.name?(fe=l?.name?.trim()||h("sectionsEditor.formConflict.you"),e[23]=h,e[24]=l?.name,e[25]=fe):fe=e[25];let Re;e[26]!==ue||e[27]!==fe?(Re=o.jsx(_s,{url:ue,fallback:fe,shape:"circle",size:"sm",className:"text-xs"}),e[26]=ue,e[27]=fe,e[28]=Re):Re=e[28];const j=Re;let re;e[29]!==b||e[30]!==j?(re=b?.you?j:b?.name?o.jsx(_s,{url:b.avatarUrl,fallback:b.name,shape:"circle",size:"sm",className:"text-xs"}):o.jsx(_s,{url:"icon://user",fallback:"",muted:!0,shape:"circle",size:"sm"}),e[29]=b,e[30]=j,e[31]=re):re=e[31];const Ae=re,Ce=b?new Date(b.at):null;H="radiogroup",B=r.label,w="flex flex-col gap-2",e[32]!==m?(p=M=>du(M,m),e[32]=m,e[33]=p):p=e[33];let S;e[34]!==r.pointer||e[35]!==y?(S=()=>y(r.pointer,"mine"),e[34]=r.pointer,e[35]=y,e[36]=S):S=e[36];let K;e[37]!==h?(K=h("sectionsEditor.formConflict.you"),e[37]=h,e[38]=K):K=e[38];let he;e[39]!==h?(he=h("sectionsEditor.formConflict.yourVersionNotSaved"),e[39]=h,e[40]=he):he=e[40],te=o.jsx(Vo,{side:"mine",checked:ye==="mine",onChoose:S,avatar:j,who:K,meta:he,children:pe("mine")}),L=Vo,E="theirs",W=ye==="theirs",e[41]!==r.pointer||e[42]!==y?(V=()=>y(r.pointer,"theirs"),e[41]=r.pointer,e[42]=y,e[43]=V):V=e[43],J=Ae,e[44]!==b?.name||e[45]!==b?.you||e[46]!==h?(g=b?.you?h("sectionsEditor.formConflict.youElsewhere"):b?.name||h("sectionsEditor.formConflict.someoneElse"),e[44]=b?.name,e[45]=b?.you,e[46]=h,e[47]=g):g=e[47],Q=Ce?h("sectionsEditor.formConflict.savedAt",{when:dc(Ce,N)}):h("sectionsEditor.formConflict.theirVersionSaved"),x=Ce?mu(Ce,N):void 0,z=pe("theirs"),e[0]=m,e[1]=b,e[2]=i,e[3]=r,e[4]=N,e[5]=y,e[6]=h,e[7]=l?.image,e[8]=l?.name,e[9]=L,e[10]=z,e[11]=H,e[12]=B,e[13]=w,e[14]=p,e[15]=te,e[16]=E,e[17]=W,e[18]=V,e[19]=J,e[20]=g,e[21]=Q,e[22]=x}else L=e[9],z=e[10],H=e[11],B=e[12],w=e[13],p=e[14],te=e[15],E=e[16],W=e[17],V=e[18],J=e[19],g=e[20],Q=e[21],x=e[22];let Z;e[48]!==L||e[49]!==z||e[50]!==E||e[51]!==W||e[52]!==V||e[53]!==J||e[54]!==g||e[55]!==Q||e[56]!==x?(Z=o.jsx(L,{side:E,checked:W,onChoose:V,avatar:J,who:g,meta:Q,metaTitle:x,children:z}),e[48]=L,e[49]=z,e[50]=E,e[51]=W,e[52]=V,e[53]=J,e[54]=g,e[55]=Q,e[56]=x,e[57]=Z):Z=e[57];let q;return e[58]!==H||e[59]!==B||e[60]!==w||e[61]!==p||e[62]!==te||e[63]!==Z?(q=o.jsxs("div",{role:H,"aria-label":B,className:w,onKeyDown:p,children:[te,Z]}),e[58]=H,e[59]=B,e[60]=w,e[61]=p,e[62]=te,e[63]=Z,e[64]=q):q=e[64],q}const mu=(n,e)=>n.toLocaleString(e,{dateStyle:"medium",timeStyle:"short"});function Vo(n){const e=ct.c(28),{side:r,checked:i,onChoose:l,avatar:u,who:y,meta:m,metaTitle:b,children:h}=n,k=R.useId(),N=`${k}-who`,L=`${k}-meta ${k}-value`,z=i?0:-1,H=i?"border-primary bg-primary/5 ring-1 ring-primary":"hover:bg-accent";let B;e[0]!==H?(B=me("grid w-full cursor-pointer grid-cols-[auto_minmax(0,1fr)] items-start gap-3 rounded-xl border bg-background p-3 text-left transition-[border-color,box-shadow,background-color] focus-ring",H),e[0]=H,e[1]=B):B=e[1];const w=`${k}-who`;let p;e[2]!==w||e[3]!==y?(p=o.jsx("span",{id:w,className:"text-sm font-medium text-foreground",children:y}),e[2]=w,e[3]=y,e[4]=p):p=e[4];const te=`${k}-meta`;let E;e[5]!==m||e[6]!==b||e[7]!==te?(E=o.jsx("span",{id:te,title:b,children:m}),e[5]=m,e[6]=b,e[7]=te,e[8]=E):E=e[8];let W;e[9]!==p||e[10]!==E?(W=o.jsxs("span",{className:"flex flex-wrap items-baseline gap-x-1.5 text-xs text-muted-foreground",children:[p,E]}),e[9]=p,e[10]=E,e[11]=W):W=e[11];const V=`${k}-value`,J=`conflict-${r}`;let g;e[12]!==h||e[13]!==V||e[14]!==J?(g=o.jsx("span",{id:V,"data-testid":J,className:"min-w-0 text-sm",children:h}),e[12]=h,e[13]=V,e[14]=J,e[15]=g):g=e[15];let Q;e[16]!==W||e[17]!==g?(Q=o.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[W,g]}),e[16]=W,e[17]=g,e[18]=Q):Q=e[18];let x;return e[19]!==u||e[20]!==i||e[21]!==l||e[22]!==N||e[23]!==Q||e[24]!==L||e[25]!==z||e[26]!==B?(x=o.jsxs("button",{type:"button",role:"radio","aria-checked":i,"aria-labelledby":N,"aria-describedby":L,tabIndex:z,onClick:l,className:B,children:[u,Q]}),e[19]=u,e[20]=i,e[21]=l,e[22]=N,e[23]=Q,e[24]=L,e[25]=z,e[26]=B,e[27]=x):x=e[27],x}function pu(n){const e=ct.c(4),{parts:r}=n;let i;e[0]!==r?(i=r.map(hu),e[0]=r,e[1]=i):i=e[1];let l;return e[2]!==i?(l=o.jsx("span",{className:"whitespace-pre-wrap break-words",children:i}),e[2]=i,e[3]=l):l=e[3],l}function hu(n,e){return n.kind==="changed"?o.jsx("mark",{className:"rounded-sm bg-warning/20 px-0.5 text-foreground",children:n.text},e):o.jsx("span",{children:n.text},e)}function gu(n){const e=ct.c(29),{preview:r}=n,i=Lt();switch(r.kind){case"empty":{let l;e[0]!==i?(l=i("sectionsEditor.formConflict.empty"),e[0]=i,e[1]=l):l=e[1];let u;return e[2]!==l?(u=o.jsx("span",{className:"italic text-muted-foreground",children:l}),e[2]=l,e[3]=u):u=e[3],u}case"text":{let l;return e[4]!==r.text?(l=o.jsx("span",{className:"whitespace-pre-wrap break-words",children:r.text}),e[4]=r.text,e[5]=l):l=e[5],l}case"image":{let l;return e[6]!==r.src?(l=o.jsx("img",{src:r.src,alt:"",className:"max-h-24 max-w-full rounded border object-contain"}),e[6]=r.src,e[7]=l):l=e[7],l}case"yesNo":{const l=r.value?"sectionsEditor.formConflict.yes":"sectionsEditor.formConflict.no";let u;e[8]!==i||e[9]!==l?(u=i(l),e[8]=i,e[9]=l,e[10]=u):u=e[10];let y;return e[11]!==u?(y=o.jsx("span",{children:u}),e[11]=u,e[12]=y):y=e[12],y}case"list":{const l=r.count===1?"sectionsEditor.formConflict.oneItem":"sectionsEditor.formConflict.items",u=String(r.count);let y;e[13]!==i||e[14]!==l||e[15]!==u?(y=i(l,{count:u}),e[13]=i,e[14]=l,e[15]=u,e[16]=y):y=e[16];let m;e[17]!==y?(m=o.jsx("span",{className:"text-muted-foreground",children:y}),e[17]=y,e[18]=m):m=e[18];let b;e[19]!==r.count||e[20]!==r.items?(b=r.items.some(Boolean)&&o.jsxs("span",{className:"flex flex-col",children:[r.items.map(yu),r.count>r.items.length&&o.jsx("span",{children:"…"})]}),e[19]=r.count,e[20]=r.items,e[21]=b):b=e[21];let h;return e[22]!==m||e[23]!==b?(h=o.jsxs("span",{className:"flex flex-col gap-1",children:[m,b]}),e[22]=m,e[23]=b,e[24]=h):h=e[24],h}case"fields":{let l;e[25]!==r.entries?(l=r.entries.map(vu),e[25]=r.entries,e[26]=l):l=e[26];let u;return e[27]!==l?(u=o.jsx("dl",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-0.5",children:l}),e[27]=l,e[28]=u):u=e[28],u}}}function vu(n){return o.jsxs("div",{className:"contents",children:[o.jsx("dt",{className:"text-muted-foreground",children:n.label}),o.jsx("dd",{className:"truncate",children:n.text})]},n.label)}function yu(n,e){return o.jsx("span",{className:"truncate",children:`${e+1}. ${n||"…"}`},e)}function xu(n,e){return n.kind==="protocol"&&n.source==="github"?e:null}function bu(n,e){if(Object.hasOwn(n,e))return n[e]??null;const r=fo(e),i=Object.keys(n).find(l=>fo(l)===r);return i===void 0?null:n[i]??null}async function Su(n,e){try{const r=await fetch(`/api/${n.orgSlug}/decofile/${encodeURIComponent(n.virtualMcpId)}/${encodeURIComponent(n.branch)}`,{cache:"no-store",headers:Qa("v8")});if(!r.ok)return null;const i=await r.json().catch(()=>({})),l=bu(i.changedBy??{},e);return l&&typeof l.userId=="string"&&Number.isFinite(Date.parse(l.at))?l:null}catch{return null}}function _u(n,e,r){const i=e.find(y=>y.userId===n.userId),l=i?.user?.name?.trim(),u=i?.user?.image??void 0;return{...l?{name:l}:{},...u?{avatarUrl:u}:{},at:n.at,you:!!r&&n.userId===r}}function wu(n){let e=2166136261,r=0;for(let i=0;i<n.length;i++){const l=n.charCodeAt(i);e=Math.imul(e^l,16777619),r=Math.imul(r,31)+l|0}return`${(e>>>0).toString(36)}${(r>>>0).toString(36)}:${n.length}`}function ju(n,e,r){const i=ct.c(19),l=!!n&&!!e&&r!==null;let u;i[0]!==e||i[1]!==n||i[2]!==r?(u=Io.conflictAuthor(n?`${n.orgSlug}/${n.virtualMcpId}/${n.branch}`:"",e??"",r??""),i[0]=e,i[1]=n,i[2]=r,i[3]=u):u=i[3];let y;i[4]!==e||i[5]!==n?(y=()=>Su(n,e),i[4]=e,i[5]=n,i[6]=y):y=i[6];let m;i[7]!==l||i[8]!==u||i[9]!==y?(m={queryKey:u,queryFn:y,enabled:l,staleTime:Number.POSITIVE_INFINITY,gcTime:6e5,retry:!1,refetchOnWindowFocus:!1},i[7]=l,i[8]=u,i[9]=y,i[10]=m):m=i[10];const{data:b}=ma(m),h=l?b??null:null,k=!!h;let N;i[11]!==k?(N={enabled:k},i[11]=k,i[12]=N):N=i[12];const{data:L}=mc(N);let z;i[13]!==L?(z=L?.data?.members??[],i[13]=L,i[14]=z):z=i[14];const H=z,{data:B}=Ko.useSession();if(!h)return null;const w=B?.user?.id??null;let p;return i[15]!==h||i[16]!==H||i[17]!==w?(p=_u(h,H,w),i[15]=h,i[16]=H,i[17]=w,i[18]=p):p=i[18],p}function ku(n,e,r,i){if(!n||typeof n!="object")return{kind:"error",reason:"no-matcher-rule"};const l=e.trim();if(!l)return Qt(n,r,i)?{kind:"inline",blockKey:n.__resolveType??"",inlinedRule:Rs(n,r,i)}:{kind:"noop"};const u=As(n,r,i);if(!u)return{kind:"error",reason:"unreadable-rule"};if(u.blockKey)return{kind:"updateBlock",blockKey:u.blockKey,blockData:Ot(u.resolveType,u.data,l)};const y=Gn(l),m=Un(y,r);return m?{kind:"error",reason:"invalid-block-id",message:m}:{kind:"createBlock",blockId:y,blockData:Ot(u.resolveType,u.data,l),reference:dn(y)}}const Po="section-form-stale-save",Eu=3,Ru=1e3;function Mo(n,e,r){const i=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Fo(e.pageKey?n[e.pageKey]?.sections:void 0,n,r),l=Math.max(0,Math.min(e.pageVariantIndex,i.length-1)),u=i[l]?.sections??[];return{pageVariants:i,variantIndex:l,rawSections:u,parsedSections:En(u,n,r)}}const Do=new WeakMap;let Au=0;function Cu(n){let e=Do.get(n);return e===void 0&&(e=++Au,Do.set(n,e)),e}function Gm({orgSlug:n,virtualMcpId:e,branch:r,previewReady:i=!0,previewUrl:l,currentPath:u,activePageBlockKey:y=null,activeGlobalBlockKey:m=null,externalSelection:b,onSaved:h,initialEditSeo:k=!1,onExitSeo:N,onSelectRoot:L,onViewJsonFile:z,onFocusedBlockChange:H,onVariantPreviewOverride:B,focusVariant:w}){const p=Lt(),te=ga(),E=te?.taskId??null,W=i?{orgSlug:n,virtualMcpId:e,branch:r,threadId:E,previewUrl:l}:null,[V,J]=R.useState([]),{data:g,isLoading:Q}=Xa(W,{pollWhile:V.length>0}),{data:x,isLoading:Z}=al(W),q=Zn(),pe=te?.virtualMcpId,ue=qa(pe===e?e:null)?.metadata?.siteSlug??null,fe=sc({virtualMcpId:e,branch:r,sandboxUrl:l}),Re=Za(e,r),j=el(Re),re=ul(j),Ae=!j,Ce=!!fe||j,[S,K]=R.useState(null),[he,M]=R.useState(null),[xe,O]=R.useState(null),[oe,G]=R.useState(0),[Ke,ke]=R.useState(void 0),[ut,Ze]=R.useState(null),[$e,qe]=R.useState(null);w&&w.seq!==ut&&(Ze(w.seq),qe(w));const[it,Ge]=R.useState(null),Ue={index:it,remember:Ge},[Ye,de]=R.useState(null),[ge,be]=R.useState(null),[ee,F]=R.useState([]),De=R.useRef(null),[et,tt]=R.useState(ee.length);et!==ee.length&&(tt(ee.length),requestAnimationFrame(()=>{De.current&&(De.current.scrollTop=0)}));const[st,I]=R.useState(0),[Je,ae]=R.useState(null),[Ne,ze]=R.useState(null),[rt,at]=R.useState(null),[Qo,Zt]=R.useState(!1),[Fs,es]=R.useState(!1),Rn=R.useRef(null),[An,Xo]=R.useState(!0),[en,Cn]=R.useState(!1),[$t,Nn]=R.useState(!1),[He,fn]=R.useState(k),[Bs,Os]=R.useState(k);k&&!Bs&&(Os(!0),fn(!0),K(null),M(null),O(null),F([])),!k&&Bs&&Os(!1);const[Zo,mn]=R.useState(null),[Ls,Tn]=R.useState(void 0),[$s,zt]=R.useState([]),[zs,tn]=R.useState(0),[Qe,dt]=R.useState(0),[ei,Xe]=R.useState(null),[nn,nt]=R.useState(null),[Hs,Ws]=R.useState(null),qs=pa(),Gs=tl({orgSlug:n,virtualMcpId:e,branch:r},{tunnel:!1}),pn=Ra({orgSlug:n,virtualMcpId:e,branch:r}),[ti,ni]=R.useState(u),[si,ri]=R.useState(y),[oi,ii]=R.useState(m);(ti!==u||si!==y||oi!==m)&&(queueMicrotask(()=>pn.flush()),ni(u),ri(y),ii(m),K(null),M(null),O(null),G(0),de(null),be(null),dt(0),Xe(null),nt(null),F([]),I(t=>t+1),fn(!1),mn(null),Tn(void 0),zt([]),tn(t=>t+1));const X=Aa({orgSlug:n,virtualMcpId:e,branch:r}),hn=za((t,s)=>{X.mutate({blockKey:t,data:s},{onSuccess:()=>h?.(),onError:X.reportError})}),Vn=ml({orgSlug:n,virtualMcpId:e,branch:r}),Us=vc({orgSlug:n,virtualMcpId:e,branch:r}),[sn,rn]=R.useState(!1),$=R.useRef(null),Tt=R.useRef(null),ht=R.useRef(null),gt=R.useRef(null),Pn=R.useRef({}),Ht=R.useRef(null),gn=R.useRef(!1),vn=R.useRef(!1),Ie=R.useRef(new Map),on=R.useRef(!1),_t=R.useRef([]),ts=R.useRef(new WeakSet);nl(n,e,t=>{const{activePageKey:s,rawSections:a,parsedSections:c,selectedSectionIndex:d}=Se.current,v=new Set;s&&v.add(s);for(const f of[Tt.current?.sectionIndex,d]){const _=f==null?void 0:a[f],D=f==null?void 0:c[f],A=_&&D?.isSavedBlock?ys(_,D):null;A&&v.add(A)}if([...v].some(f=>t.has(f))){for(const f of[$,ht,gt])f.current&&clearTimeout(f.current),f.current=null;Tt.current=null,Ie.current.clear(),s&&t.has(s)&&(Pn.current={})}});const Se=R.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Ys,Js]=R.useState(0),[ai,li]=R.useState(0),ci=ju(xu(Re,{orgSlug:n,virtualMcpId:e,branch:r}),V[0]?.blockKey??null,V[0]?wu(Le(V[0].plan.theirs)):null),[ui,di]=R.useState(null),ns=sl(n,e).epoch,[fi,mi]=R.useState(ns);if(!i||Q||Z)return o.jsx("div",{className:"h-full w-full flex items-center justify-center",children:o.jsx(ha,{className:"size-5 text-muted-foreground"})});if(!g||!x)return o.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:p("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const pi=vl(g,x),ne=!!m,_e=ne?null:yl(pi,u,y),C=ne?m:_e?.key??null,Mn=ne&&m?g[m]:void 0,Qs=ne&&m&&Mn?xl(m,Mn):ne&&m?m:"",Wt=!ne&&C&&g[C]?g[C]:null,ss=He&&g&&x&&C&&_e?Zr(g,{kind:"page",pageKey:C,pageName:String(_e.name??""),path:String(_e.path??"")},x):null,hi=He?Wt?.seo:void 0,Dn=Ls!==void 0?Ls:hi,gi=He?Ca(Dn):void 0,Xs=ss?.seoTypeOptions??[],Zs=He&&x?Na(x):"",rs=Zo??gi??{},Kn=He&&ss?pc(rs,ss):null,er=He&&Kn&&Ta(Dn)?qn(Kn,x):null,tr=He?Va(g,x)?.seoData:void 0,Te=ne?[{label:"Default",sections:[{__resolveType:m}]}]:Fo(Wt?.sections,g??{},j),vt=Te.length>1,ve=Math.min(oe,Te.length-1),Fe=Te[ve],U=Fe?.sections??[],Ve=En(U,g,j),In=!ne&&bl(Wt?.sections,j);if(ne&&m&&Hs!==m){Ws(m);const t=U[0],s=Ve[0];if(t&&s){K(0),dt(0),F([]);const a=kt(t,s,g,j);a&&(M(a.data),O(a.resolveType),nt(null),Xe(null))}}!ne&&Hs!==null&&Ws(null),Se.current={rawSections:U,parsedSections:Ve,decofile:g??{},activePageKey:C,pageVariants:Te,variantIndex:ve,sectionVariantIndex:Qe,selectedSectionIndex:S};const vi=()=>({multivariate:In,index:ve,variants:Te.map(t=>({rule:t.rule})),lazyValues:j&&In&&Ml(Wt?.sections?.variants?.[ve]?.value)}),os=(t,s)=>{if(!B)return;if(!C||!In||t.length<=1){B(null);return}const a={multivariate:!0,index:s,variants:t},c=j?jo(C,a):ko(C,a,g,x);B(c.length>0?c:null)},is=B&&C&&In&&vt&&!Q&&!Z?C:null;if(is!==ui&&(di(is),is)){const t=Te.map(a=>({rule:a.rule})),s=ve;queueMicrotask(()=>os(t,s))}const qt=(t,s,a)=>{if(!B)return;if(!C){B(null);return}const c=vi(),d=j?jo(C,c):ko(C,c,g,x);if(!t||s<0){B(d.length>0?d:null);return}const v={pageKey:C,page:c,sectionIndex:s,sectionLazy:Ve[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a},f=j?yc(v):xc({...v,decofile:g,meta:x}),_=j?bc(d,f):[...d,...f];B(_.length>0?_:null)},wt=(t,s,a,c=S??-1,d=!1)=>{const v=ot(t,s);if(!v){M(null),O(null),nt(null),Xe(null),d&&qt(null,c,a);return}const _=Es(v,re)[a];if(!_){M(null),O(null),nt(null),Xe(null),d&&qt(null,c,a);return}const D=Lo(_.value,g);M(D?.data??null),O(D?.resolveType??null);const{resolveType:A,formValue:T}=Jt(_.rule,g,x??void 0);nt(A),Xe(T),d&&qt(v,c,a)},yn=t=>{ze(null),G(t),K(null),M(null),O(null),F([]);const s=Te[t]?.rule,{resolveType:a,formValue:c}=Jt(s,g??{},x??void 0);be(a),de(c),os(Te.map(d=>({rule:d.rule})),t)},nr=(t,s)=>{const a=U[t],c=Ve[t];if(!a||!c)return!1;const d=c.isMultivariate?ot(a,c)?.variants?.length??0:0,v=s<d?s:0;if(K(t),dt(v),F([]),I(f=>f+1),c.isMultivariate)wt(a,c,v,t);else{const f=kt(a,c,g,j);f?(M(f.data),O(f.resolveType)):(M(null),O(null)),nt(null),Xe(null)}return!0},sr=b?.index;if(b!==void 0&&(b?.seq??null)!==Ke&&(ke(b?.seq??null),typeof sr=="number"&&nr(sr,0)),$e&&(ne?Mn:Wt)){const t=$e.pageVariant,s=!ne&&t!==void 0&&t<Te.length;if(s&&t!==ve)yn(t);else{qe(null);const{section:a,variant:c}=$e;if(ne)c!==void 0&&(Ge(c),F([]),I(d=>d+1));else if(a!==void 0&&nr(a,c??0)){const d=U[a],v=Ve[a],f=v.isMultivariate?ot(d,v):null;f&&c!==void 0&&queueMicrotask(()=>qt(f,a,c))}else s&&yn(t)}}if(ns!==fi){mi(ns);const t=$.current!==null||Ie.current.size>0||gt.current!==null||ht.current!==null||X.isPending||pn.isPending||V.length>0,s=S!==null&&Co(De.current,document.activeElement);if(!t&&s&&(on.current=!0),!t&&!s&&S!==null){const a=U[S],c=Ve[S];if(F([]),I(d=>d+1),!a||!c)K(null),M(null),O(null);else if(c.isMultivariate)wt(a,c,Qe,S);else{const d=kt(a,c,g,j);M(d?.data??null),O(d?.resolveType??null)}}!t&&He&&(mn(null),Tn(void 0),tn(a=>a+1))}if(Ys!==ai){li(Ys);const t=S!==null?U[S]:null,s=S!==null?Ve[S]:null;if(t&&s&&S!==null)if(F([]),I(a=>a+1),s.isMultivariate)wt(t,s,Qe,S);else{const a=kt(t,s,g,j);M(a?.data??null),O(a?.resolveType??null)}}const ft=V[0];if(ft){const{formBase:t,target:s}=ft,a=Mo(g,s,j),c=t.sectionIndex,d=a.rawSections.length===t.sectionCount?js(a.rawSections[c],a.parsedSections[c],s.sectionVariantIndex,g,j):null,v=$c(ft,d,f=>Ro(t,f));if(v){const _=[{...ft,...v,changedAgain:!0},...V.slice(1)];_t.current=_,J(_)}}const xn={orgSlug:n,virtualMcpId:e,branch:r,threadId:E,previewUrl:j?void 0:l??void 0,siteSlug:ue},Fn=xe&&x?qn(xe,x):null,mt=(t,s)=>{if(!C)return;$.current&&(clearTimeout($.current),$.current=null),Ie.current.clear(),gt.current&&(clearTimeout(gt.current),gt.current=null),ht.current&&(clearTimeout(ht.current),ht.current=null);const a=cn(g,C,t,ve,Te);X.mutate({blockKey:C,data:a},{onSuccess:()=>s?.onSuccess?.()??h?.(),onError:c=>{s?.onError?.(),X.reportError(c)}})},Gt=()=>{H?.(null),K(null),Nn(!1),M(null),O(null),dt(0),Xe(null),nt(null),F([]),I(t=>t+1)},rr=()=>Co(De.current,document.activeElement),as=(t=p("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if($.current&&(clearTimeout($.current),$.current=null),Ie.current.clear(),Tt.current=null,ie.error(t,{id:Po}),rr()){on.current=!0;return}Js(s=>s+1)},or=()=>{!on.current||rr()||_t.current.length>0||$.current!==null||gn.current||vn.current||Ie.current.size>0||(on.current=!1,Js(t=>t+1))},ir=()=>{on.current&&setTimeout(or,0)},ar=t=>ol(qs,Gs,t),lr=t=>{Ie.current.size!==0&&setTimeout(()=>{if(gn.current||vn.current)return;const s=[...Ie.current.values()];Ie.current.clear();for(const a of s)a()},t)},yi=t=>{const{activePageKey:s,variantIndex:a,sectionVariantIndex:c}=Se.current,d=Ht.current;return{formBase:d?.sectionIndex===t&&d.variantIndex===c?d:null,pageKey:s,global:ne,pageVariantIndex:a,sectionVariantIndex:c,schema:Fn}},bn=t=>{_t.current=t,J(t)},xi=t=>{const s=_t.current,a=s.findIndex(v=>v.formBase===t.formBase),c=a>=0?s[a]:void 0,d=c?s.with(a,{...t,choices:Ms(c.plan,c.choices,t.plan),fresh:Yo(c.plan,t.plan,c.fresh),changedAgain:c.changedAgain||Le(c.plan.theirs)!==Le(t.plan.theirs)}):[...s,{...t,changedAgain:ts.current.has(t.formBase)}];bn(d)},cr=(t,s)=>{const a=_t.current,c=a.findIndex(f=>f.formBase===t),d=a[c];if(!d)return!1;if(Le(d.plan.mine)===Le(s))return!0;const v=Vs({...d.plan,mine:s});if(v.pointers.length===0){const f=a.filter(_=>_!==d);return bn(f),!1}return bn(a.with(c,{...d,plan:v,choices:Ms(d.plan,d.choices,v)})),!0},bi=t=>{const s=Se.current;return s.selectedSectionIndex===t.formBase.sectionIndex&&s.activePageKey===t.target.pageKey&&s.variantIndex===t.target.pageVariantIndex&&s.sectionVariantIndex===t.target.sectionVariantIndex},Si=()=>{const t=_t.current[0];if(!t)return null;const{formBase:s,target:a}=t;$.current&&Tt.current?.sectionIndex===s.sectionIndex&&Tt.current.sectionVariantIndex===a.sectionVariantIndex&&(clearTimeout($.current),$.current=null,Tt.current=null),Ie.current.delete(`${a.pageKey}:${s.sectionIndex}:${a.sectionVariantIndex}`);const c=s.emitted;return c&&typeof c=="object"&&!cr(s,c)&&Sn(c,s.sectionIndex,0,a),_t.current[0]??null},_i=()=>{const t=_t.current[0],s=Si();if(!s||!t||s.formBase!==t.formBase||s.plan.pointers.some(v=>!t.plan.pointers.includes(v)))return;const a=Oc(s.plan,s.choices);bn(_t.current.slice(1));const{formBase:c,target:d}=s;c.base=s.plan.theirs,c.version=void 0,c.emitted=a,ts.current.add(c),(Ht.current===c||bi(s))&&(Ht.current=c,M(a),I(v=>v+1)),Sn(a,c.sectionIndex,0,d)},wi=t=>{const[s,...a]=_t.current;s&&bn([{...s,choices:t},...a])},Sn=(t,s,a=0,c)=>{const d=c??yi(s),v=d.sectionVariantIndex,f=d.formBase,_=Tt.current;$.current&&(clearTimeout($.current),$.current=null,_&&(_.sectionIndex!==s||_.sectionVariantIndex!==v)&&_.write());const D=`${d.pageKey}:${s}:${v}`,A=()=>{if(gn.current||vn.current){Ie.current.set(D,A);return}const T=typeof t=="function"?t():t;if(f&&cr(f,T))return;const P=Se.current.decofile,{rawSections:se,parsedSections:le,pageVariants:Be,variantIndex:we}=Mo(P,d,j),Pe=d.pageKey,Y=se[s];if(!Y)return;const ce=le[s];if(!ce)return;const Me=f?.base,We=js(Y,ce,v,P,j),xt=!!Me&&!!We&&qo(Me,We)&&!(f&&Ro(f,We));if(xt&&Me&&We){if(Go(Me,We)){as(p("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const je=ce.isSavedBlock?"here":Fc(Me,se.map((Ee,Kt)=>js(Ee,le[Kt],v,P,j)),s,f?.sectionCount??se.length);if(je==="unknown"){as(p("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof je=="number"&&f){f.sectionCount=se.length,f.sectionIndex=je,Ht.current===f&&K(je),Sn(T,je,a,d);return}}const lt=xt&&Me&&We?Vs({ancestor:Me,mine:T,theirs:We}):null;if(lt&<.pointers.length>0&&f){f.sectionCount=se.length,xi({plan:lt,formBase:f,target:d,sectionIndex:s,choices:Uo(lt),changedAgain:!1,blockKey:ce.isSavedBlock?ys(Y,ce):Pe,fresh:{}});return}const bt=lt?lt.merged:null,Dt=bt??T,Yr=Bc({merged:!!bt,tracked:f,current:Ht.current,saved:T});bt&&ie.info(p("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:Po}),Yr&&f&&(f.emitted=bt,M(bt));const gs=Yr||!bt?Dt:T;f&&(f.base=gs,f.sectionCount=se.length,Kc(f,gs));const Jr={onSuccess:()=>{f&&ts.current.delete(f),h?.()},onError:je=>{if(f?.base===gs&&Me&&(f.base=Me),je instanceof rl){f&&(f.version=void 0),a<Eu?(Ie.current.delete(D),vn.current=!0,setTimeout(()=>{vn.current=!1,Sn(()=>{const Ee=f?.emitted;return Ee&&typeof Ee=="object"?Ee:T},s,a+1,d),Ie.current.delete(D),lr(jn)},Ru*2**a)):as();return}X.reportError(je)}},Qr=je=>{gn.current=!0;let Ee=!1;X.mutateAsync(je).then(()=>Jr.onSuccess(),Kt=>{Ee=!0,Jr.onError(Kt)}).finally(()=>{gn.current=!1,lr(Ee?jn:0),or()})};if(ce.isSavedBlock){const je=ys(Y,ce);if(!je)return;Qr({blockKey:je,data:Dt,...Me?{base:{value:bt?We:Me}}:{},rebaseOnConflict:!1,guard:Ao({formBase:f,rebased:!!bt,versionOf:ar})});return}if(!Pe)return;const Hn={...P[Pe]},Yt=[...se];if(ce.isMultivariate){const je=ot(Y,ce);if(!je||!Pe)return;const Ee=Il(je,v,Dt);Yt[s]=Bt(Y,ce,Ee)}else if(ce.isHidden){const je=Ks(Y.__resolveType),Ee=je?{...Y.section}:{...Y},Kt=Array.isArray(Ee.variants)?[...Ee.variants]:[];Kt[0]&&(Kt[0]=yo(Ee.__resolveType,Kt[0],Dt)),Ee.variants=Kt,je?Yt[s]={...Y,section:Ee}:Yt[s]=Ee}else ce.isLazy?Yt[s]={...Y,section:Dt}:Yt[s]=Dt;if(Be.length>1){const je=Hn.sections,Ee=[...je?.variants??[]];Ee[we]&&(Ee[we]=yo(je?.__resolveType,Ee[we],Yt)),Hn.sections={...je,variants:Ee}}else Hn.sections=Yt;Qr({blockKey:Pe,data:Hn,rebaseOnConflict:!1,guard:Ao({formBase:null,rebased:!1,versionOf:ar})})};Tt.current={sectionIndex:s,sectionVariantIndex:v,write:A},$.current=setTimeout(()=>{$.current=null,A()},jn)},ji=t=>{on.current=!1,K(t),dt(0),F([]),I(d=>d+1);const s=U[t],a=Ve[t];if(H?.(a?.isSavedBlock?a.resolveType??null:null),!s||!a)return;if(a.isMultivariate){wt(s,a,0,t);return}const c=kt(s,a,g,j);if(!c){M(null),O(null),nt(null),Xe(null),qt(null,t,0);return}M(c.data),O(c.resolveType),nt(null),Xe(null),qt(null,t,0)},ur=t=>{const s=t;S!==null&&(Ht.current=Ic(Ht.current,{sectionIndex:S,variantIndex:Se.current.sectionVariantIndex,shown:he,next:s,sectionCount:Se.current.rawSections.length})),M(s),S!==null&&Sn(s,S)},ls=t=>{if(!C||!g||!x||!_e)return;const s={kind:"page",pageKey:C,pageName:String(_e.name??""),path:String(_e.path??"")},a=Zr(g,s,x);a&&pn.save(C,()=>{const c=qs.getQueryData(Io.decofile(Gs))?.[C];if(!c||typeof c!="object"||c===null||Array.isArray(c))return null;const d={...c,...Pn.current};return Pn.current={},t?.raw!==void 0?hc(d,t.raw,x):t?.inner!==void 0?gc(s,a,d,t.inner):d})},dr=(t,s)=>{C&&(Pn.current[t]=s,ls())},ki=(t,s)=>{if(!C)return;const a=Yn([...U],t,s);S!==null&&(S===t?K(s):t<S&&s>=S?K(S-1):t>S&&s<=S&&K(S+1)),mt(a)},Ei=t=>{if(!C)return;const s=U.filter((a,c)=>c!==t);S===t?Gt():S!==null&&S>t&&K(S-1),mt(s)},Ri=t=>{if(!C)return;const s=U[t];if(!s)return;const a=[...U];a.splice(t+1,0,Ha(s)),S!==null&&S>t&&K(S+1),mt(a)},Ai=t=>{if(!C)return;const s=U[t],a=Ve[t];if(!s||!a)return;const c=a.isHidden?Cl(s,j):Nl(s,x);if(!c)return;const d=[...U];d[t]=c,S===t&&Gt(),mt(d)},Ci=t=>{if(!C)return;const s=U[t],a=Ve[t];if(!s||!a||a.isMultivariate)return;const c=Al(s);if(!c)return;const d=[...U];d[t]=c,S===t&&Gt(),mt(d)},Ni=t=>{if(!C)return;const s=U[t],a=Ve[t];if(!s||!a?.isSavedBlock)return;const c=kt(s,a,g,j);if(!c?.data)return;const{name:d,...v}=c.data,f=[...U];a.isLazy?f[t]={...s,section:v}:f[t]=v,S===t&&Gt(),mt(f)},Ti=t=>{if(!C)return;const s=[...U,{__resolveType:t.resolveType}],a=s.length-1;mt(s,{onError:()=>{Se.current.selectedSectionIndex===a&&Gt()}}),Zt(!1),K(a),dt(0),F([]),I(f=>f+1);const c=s[a],d=En(s,g,j)[a];if(!c||!d)return;if(d.isMultivariate){wt(c,d,0);return}const v=kt(c,d,g,j);if(!v){M(null),O(null),nt(null),Xe(null);return}M(v.data),O(v.resolveType),nt(null),Xe(null)},fr=t=>{Rn.current=t.append,Zt(!0)},Vi=t=>{const s=Rn.current;if(!s){Ti(t);return}s({__resolveType:t.resolveType}),Zt(!1),Rn.current=null},mr=t=>{if(S===null)return;const s=U[S],a=Ve[S];!s||!a?.isMultivariate||(dt(t),F([]),I(c=>c+1),wt(s,a,t,S,!0))},Pi=t=>{if(S===null||!C)return;const s=U[S],a=Ve[S];if(!s||!a?.isMultivariate)return;const c=ot(s,a);if(!c)return;const d=El(c,t);if(!d){ie.error(p("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const v=[...U];v[S]=Bt(s,a,d);const f=d.variants;let _=Qe;t===Qe?_=Math.min(t,f.length-1):t<Qe&&(_=Qe-1),dt(_),F([]),I(D=>D+1),wt(v[S],a,_),mt(v)},Mi=t=>{if(S===null||!C)return;const s=U[S],a=Ve[S];if(!s||!a?.isMultivariate)return;const c=ot(s,a);if(!c)return;const d=Rl(c,t,j),v=[...U];v[S]=Bt(s,a,d);const f=vo(c.variants??[],t,j);dt(f),F([]),I(_=>_+1),wt(v[S],a,f,S,j),mt(v)},Di=(t,s)=>{if(S===null||!C||t===s)return;const a=U[S],c=Ve[S];if(!a||!c?.isMultivariate)return;const d=ot(a,c);if(!d)return;const v=jl(d,t,s),f=[...U];f[S]=Bt(a,c,v);let _=Qe;Qe===t?_=s:t<Qe&&s>=Qe?_=Qe-1:t>Qe&&s<=Qe&&(_=Qe+1),dt(_),wt(f[S],c,_,S,j),mt(f)},_n=t=>{const s=t??S;if(s===null||!C)return;const a=U[s],c=Ve[s];if(!a||!c)return;const d=Sl(a,c,void 0,x,j);if(!d){ie.error(p("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const v=[...U];v[s]=d.section;const f=En(v,g,j)[s];if(!f?.isMultivariate){ie.error(p("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}K(s),dt(d.newVariantIndex),F([]),I(_=>_+1),wt(d.section,f,d.newVariantIndex,s,j),mt(v)},pr=()=>{if(S===null||!C)return;const t=U[S],s=Ve[S];if(!t||!s?.isMultivariate)return;const a=ot(t,s);if(!a)return;const c=kl(t,s,a);if(!c){ie.error(p("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const d=[...U];d[S]=c;const v=En(d,g,j)[S];if(!v)return;dt(0),nt(null),Xe(null),F([]),I(_=>_+1);const f=kt(c,v,g,j);f?(M(f.data),O(f.resolveType)):(M(null),O(null)),qt(null,S,0),mt(d)},Ki=async t=>{if(Je===null||!C)return;const s=Un(t,g,x);if(s){ie.error(s);return}const a=U[Je],c=Ve[Je];if(!a||!c)return;const d=kt(a,c,g,j);if(!d){ie.error(p("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const v={...d.data,name:t};try{await X.mutateAsync({blockKey:t,data:v});const f=[...U];f[Je]={__resolveType:t},await X.mutateAsync({blockKey:C,data:cn(g,C,f,ve,Te)}),S===Je&&Gt(),ae(null),ie.success(p("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),h?.()}catch(f){ie.error(p("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:It(p,Ft(f))})}},hr=Fe?.rule;if(vt&&S===null&&ge===null&&hr){const{resolveType:t,formValue:s}=Jt(hr,g??{},x??void 0);be(t),de(s)}const an=x?Pa(x):[],cs=x&&g?Ma(x,g):[],Ut=j&&x&&g?ll(x,g):[],us=(t,s)=>{if(Ut.length===0)return;const a=wl(t);return{kinds:Ut,selected:a,campaignPrefill:cl(t),onPick:s}},gr=!ne&&!!(Ce&&x&&g),vr=ge&&x?qn(ge,x):null,yt=()=>{ht.current&&(clearTimeout(ht.current),ht.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null)},jt=async(t,s)=>{if(!(Kl(s,t,x)>0))try{await Vn.mutateAsync({blockKey:t})}catch(a){ie.error(p("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:It(p,Ft(a))})}},yr=t=>{ht.current&&clearTimeout(ht.current),ht.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:c}=Se.current;if(!s)return;const d={...a[s]},v={...d.sections},f=[...v.variants??[]],_=f[c],D=_?.rule;if(Qt(D,a,x)){const A=D?.__resolveType??"",T=a[A],P=typeof T?.name=="string"?T.name:A,{__resolveType:se,...le}=t;X.mutate({blockKey:A,data:Ot(se??"",le,P)},{onSuccess:()=>h?.(),onError:X.reportError});return}_&&(f[c]={..._,rule:t}),d.sections={...v,variants:f},X.mutate({blockKey:s,data:d},{onSuccess:()=>h?.(),onError:X.reportError})},jn)},xr=t=>{be(t);const s=t?ho(t,x):{__resolveType:go(x)};de(t?s:{}),yr(s)},br=t=>{const s=t;de(s);const a=ge?{__resolveType:ge,...s}:{...s};yr(a)},Bn=async(t,s,a)=>{const c=dl(s,t);if(!c.ok)return c.reason==="conflict"&&ie.info(t.kind==="experiments"?p("sectionsEditor.namedRulePicker.conflictTests"):p("sectionsEditor.namedRulePicker.conflictCampaigns"),mo),null;const d={};if(a){const v=a(c.rule);if(!v)return null;d[v.blockKey]=v.data}return c.blockWrite&&(d[c.blockWrite.blockKey]=c.blockWrite.block),Object.keys(d).length>0&&!(await Us.apply({writes:d})).ok?null:(c.blockWrite&&ie.success(t.kind==="experiments"?p("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):p("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...mo,description:p("sectionsEditor.namedRulePicker.createdHint")}),{rule:c.rule,projected:{...s,...d}})},Sr=Ut.length>0?{kinds:Ut,prepare:async t=>(await Bn(t,Se.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const s=Vl(Se.current.decofile,t);return s.kind==="saved"?!0:s.kind==="conflict"?!1:(await Us.apply({writes:{[Pl(t).blockKey]:s.block}})).ok}}:null,_r=async t=>{yt();const{activePageKey:s,decofile:a,variantIndex:c}=Se.current;if(!s)return;let d=null;const v=await Bn(t,a,D=>{const A=a[s],T=A?.sections;if(!T||typeof T!="object"||Array.isArray(T))return null;const P=T;if(!Array.isArray(P.variants))return null;const se=[...P.variants],le=se[c];return le?(d=St(le.rule,a,x),se[c]={...le,rule:D},{blockKey:s,data:{...A,sections:{...P,variants:se}}}):null});if(!v)return;const{resolveType:f,formValue:_}=Jt(v.rule,v.projected,x??void 0);be(f),de(_),d&&await jt(d,v.projected),h?.()},wr=async t=>{yt();const{activePageKey:s,decofile:a,variantIndex:c}=Se.current;if(!s)return;const d=a[s],v=d?.sections;if(!v||typeof v!="object"||Array.isArray(v))return;const f=v;if(!Array.isArray(f.variants))return;const _=[...f.variants],D=_[c];if(!D)return;const A=St(D.rule,a,x),T=dn(t);_[c]={...D,rule:T};const P={...a,[s]:{...d,sections:{...f,variants:_}}},{resolveType:se,formValue:le}=Jt(T,P,x??void 0);be(se),de(le);try{await X.mutateAsync({blockKey:s,data:P[s]}),A&&A!==t&&await jt(A,P),h?.()}catch(Be){ie.error(p("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:It(p,Ft(Be))})}},jr=t=>{gt.current&&clearTimeout(gt.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=Se.current;s!==null&&(gt.current=setTimeout(()=>{const{rawSections:c,parsedSections:d,decofile:v,activePageKey:f,pageVariants:_,variantIndex:D}=Se.current;if(!f)return;const A=c[s],T=d[s];if(!A||!T?.isMultivariate)return;const P=ot(A,T);if(!P)return;const le=(P.variants??[])[a]?.rule;if(Qt(le,v,x)){const Y=le?.__resolveType??"",ce=v[Y],Me=typeof ce?.name=="string"?ce.name:Y,{__resolveType:We,...xt}=t;X.mutate({blockKey:Y,data:Ot(We??"",xt,Me)},{onSuccess:()=>h?.(),onError:X.reportError});return}const Be=Ss(P,a,t),we=[...c];we[s]=Bt(A,T,Be);const Pe=cn(v,f,we,D,_);X.mutate({blockKey:f,data:Pe},{onSuccess:()=>h?.(),onError:X.reportError})},jn))},Ii=t=>{nt(t);const s=t?ho(t,x):{__resolveType:go(x)};Xe(t?s:{}),jr(s)},Fi=t=>{const s=t;Xe(s);const a=nn?{__resolveType:nn,...s}:{...s};jr(a)},Bi=async t=>{yt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:c,parsedSections:d,decofile:v,activePageKey:f,pageVariants:_,variantIndex:D}=Se.current;if(s===null||!f)return;let A=null;const T=await Bn(t,v,le=>{const Be=c[s],we=d[s];if(!Be||!we?.isMultivariate)return null;const Pe=ot(Be,we);if(!Pe)return null;const Y=Pe.variants??[];A=St(Y[a]?.rule,v,x);const ce=[...c];return ce[s]=Bt(Be,we,Ss(Pe,a,le)),{blockKey:f,data:cn(v,f,ce,D,_)}});if(!T)return;const{resolveType:P,formValue:se}=Jt(T.rule,T.projected,x??void 0);nt(P),Xe(se),A&&await jt(A,T.projected),h?.()},Oi=async t=>{yt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:c,parsedSections:d,decofile:v,activePageKey:f,pageVariants:_,variantIndex:D}=Se.current;if(s===null||!f)return;const A=c[s],T=d[s];if(!A||!T?.isMultivariate)return;const P=ot(A,T);if(!P)return;const se=P.variants??[],le=St(se[a]?.rule,v,x),Be=dn(t),we=Ss(P,a,Be),Pe=[...c];Pe[s]=Bt(A,T,we);const Y=cn(v,f,Pe,D,_),ce={...v,[f]:Y},{resolveType:Me,formValue:We}=Jt(Be,ce,x??void 0);nt(Me),Xe(We);try{await X.mutateAsync({blockKey:f,data:Y}),le&&le!==t&&await jt(le,ce),h?.()}catch(xt){ie.error(p("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:It(p,Ft(xt))})}};if(!ne&&!_e)return o.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:p("sectionsEditor.sectionsEditor.noPageFound",{currentPath:u})});if(ne&&!Mn)return o.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:p("sectionsEditor.sectionsEditor.globalBlockNotFound")});const Oe=S!==null?Ve[S]??null:null,kr=S!==null?U[S]:null,Er=kr&&Oe?.isMultivariate?ot(kr,Oe):null,Vt=Er?Es(Er,re):[],On=Math.min(Qe,Math.max(Vt.length-1,0)),Rt=Vt[On]??null,Pt=Oe?.isMultivariate===!0,ds=S!==null&&Oe!==null,Mt=ds&&(Pt||!!(Fn&&he)),Li=Mt&&!ne&&Oe?.isSavedBlock===!0,pt=ne||Li,Rr=ne?Qs:Oe?.label??"",$i=nn&&x?qn(nn,x):null,Ar=(t,s)=>s&&q?`${t} · ${s}`:t,Cr=Oe?Oe.variantOf??Oe.label:"",zi=(()=>{const t=Pt&&Rt?Rt.label:null;return t?q?[Ar(Cr,t)]:[Oe.label,t]:[Oe?.label??""]})(),fs=Ar(_e?.name??"",vt?Fe?.label:null),Ln=Mt&&(!ne||ee.length>0)?ne?[Qs,...ee]:[fs,...zi,...ee]:[],Nr=He&&_e?[_e.name,"SEO",...$s]:[],Tr=p("sectionsEditor.pageVariantTabs.variantsLabel"),Vr=en&&_e?[_e.name,Tr]:$t&&_e&&Oe?[fs,Cr,Tr]:[],$n=Vr.length>0?Vr:Nr.length>0?Nr:pt?Ln.length>0?Ln:[Rr]:Ln.length>0?Ln:[fs],Pr=ds&&!Pt&&!Oe?.isHidden&&!!C,Hi=pt||!ne&&vt&&!!Fe||Pr,Wi=ds&&!Pt&&!ne&&ee.length===0&&!!Oe&&Oo(Oe)&&!!C,qi=q&&Mt&&!$t&&Pt&&ee.length===0&&!!Rt,Mr=q&&ee.length>0?eo(ee[ee.length-1]):null,Gi=ee.length>1?eo(ee[ee.length-2]):null,Dr=pt?Rr:Mt?Oe?.label??"":_e?.name??"",Ui=en||$t?p("sectionsEditor.pageVariantTabs.variantsLabel"):He?p("sectionsEditor.panelSections.seo"):Mr??Dr,Kr=$t?Oe?.variantOf??Oe?.label??"":en||He?_e?.name??"":Mr?Gi??Dr:pt?p("sectionsEditor.sectionsEditor.globalSectionSubtitle"):Mt?_e?.name??"":_e?.path??"",ms=!en&&!$t&&!He&&!Mt&&!pt,Yi=!q&&!He&&!ne&&Pt&&ee.length===0,wn=()=>{if(!C)return;yt(),$.current&&(clearTimeout($.current),$.current=null),Ie.current.clear();const t=g[C],s=_l(t.sections,U,x,j);if(!s)return;const{sections:a,newVariantIndex:c}=s;X.mutate({blockKey:C,data:{...t,sections:a}},{onSuccess:()=>{G(c),K(null),M(null),O(null),F([]),de(null),be(null)},onError:X.reportError})},zn=(t,s,a)=>{if(!C)return;yt(),$.current&&(clearTimeout($.current),$.current=null),Ie.current.clear();const c=g[C],d=c.sections;if(!d||typeof d!="object"||Array.isArray(d))return;const v=d;if(!Array.isArray(v.variants))return;const f=t([...v.variants]);if(!f)return;const _=Dl(v,f),D={...g,[C]:{...c,sections:_}};X.mutate({blockKey:C,data:D[C]},{onSuccess:()=>{s?.();const A=typeof a=="string"?[a]:a??[];(async()=>{for(const T of A)await jt(T,D)})()},onError:X.reportError})},Ir=(t,s)=>{if(t===s)return;let a=ve;ve===t?a=s:t<ve&&s>=ve?a=ve-1:t>ve&&s<=ve&&(a=ve+1),G(a);const c=Yn(Te.map(d=>({rule:d.rule})),t,s);os(c,a),zn(d=>Yn(d,t,s))},Fr=t=>{const s=Te[t]?.rule,a=St(s,g??{},x??void 0);zn(c=>c.length<=1?null:(c.splice(t,1),c),()=>{Te.length-1===1?G(0):t<ve?G(ve-1):t===ve&&G(Math.max(0,t-1)),K(null),M(null),O(null),F([]),de(null),be(null)},a)},Ji=()=>{const t=Te.map((s,a)=>({variant:s,index:a})).filter(({variant:s})=>!Tl(s.rule)).map(({variant:s})=>St(s.rule,g??{},x??void 0)).filter(s=>!!s);zn(s=>{const a=Fl({variants:s}),c=s[a];return c?[{...c,rule:Bl(x)}]:null},()=>{G(0),K(null),M(null),O(null),F([]),de(null),be(null),Cn(!1)},t)},Br=t=>{let s=t+1;zn(a=>(s=vo(a,t,j),Ol(a,t,j)),()=>{G(s),K(null),M(null),O(null),F([]),de(null),be(null)})},Qi=async(t,s)=>{yt(),$.current&&(clearTimeout($.current),$.current=null),Ie.current.clear();const a=Se.current.activePageKey,c=Se.current.decofile;if(!a)return;const d=c[a],v=d.sections;if(!v||typeof v!="object"||Array.isArray(v))return;const f=v;if(!Array.isArray(f.variants))return;const _=[...f.variants],D=_[t];if(!D?.rule||typeof D.rule!="object"){ie.error(p("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const A=D.rule,T=s.trim();rn(!0);try{if(!T){if(!Qt(A,c,x)){ze(null);return}const Pe=A.__resolveType??"";_[t]={...D,rule:Rs(A,c,x)};const Y={...c,[a]:{...d,sections:{...f,variants:_}}};await X.mutateAsync({blockKey:a,data:Y[a]}),await jt(Pe,Y),ze(null),h?.();return}const P=As(A,c,x);if(!P){ie.error(p("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(P.blockKey){await X.mutateAsync({blockKey:P.blockKey,data:Ot(P.resolveType,P.data,T)}),ze(null),h?.();return}const se=Gn(T),le=Un(se,c,x);if(le){ie.error(le);return}const Be=Ot(P.resolveType,P.data,T);let we=null;try{await X.mutateAsync({blockKey:se,data:Be}),we=se,_[t]={...D,rule:dn(se)},await X.mutateAsync({blockKey:a,data:{...d,sections:{...f,variants:_}}}),we=null}catch(Pe){throw we&&await Vn.mutateAsync({blockKey:we}).catch(()=>{}),Pe}ze(null),ie.success(p("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:T})),h?.()}catch(P){ie.error(p("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:It(p,Ft(P))})}finally{rn(!1)}},Xi=async(t,s)=>{yt(),$.current&&(clearTimeout($.current),$.current=null),Ie.current.clear();const{selectedSectionIndex:a,rawSections:c,parsedSections:d,decofile:v,activePageKey:f,pageVariants:_,variantIndex:D}=Se.current;if(a===null||!f)return;const A=c[a],T=d[a];if(!A||!T?.isMultivariate)return;const P=ot(A,T);if(!P)return;const se=P.variants??[],le=se[t];if(!le?.rule||typeof le.rule!="object"){ie.error(p("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Be=le.rule,we=s.trim();rn(!0);const Pe=async Y=>{const ce={...P,variants:Y},Me=[...c];Me[a]=Bt(A,T,ce);const We=cn(v,f,Me,D,_);return await X.mutateAsync({blockKey:f,data:We}),{...v,[f]:We}};try{if(!we){if(!Qt(Be,v,x)){at(null);return}const lt=Be.__resolveType??"",bt=[...se];bt[t]={...le,rule:Rs(Be,v,x)};const Dt=await Pe(bt);await jt(lt,Dt),at(null),h?.();return}const Y=As(Be,v,x);if(!Y){ie.error(p("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Y.blockKey){await X.mutateAsync({blockKey:Y.blockKey,data:Ot(Y.resolveType,Y.data,we)}),at(null),h?.();return}const ce=Gn(we),Me=Un(ce,v,x);if(Me){ie.error(Me);return}const We=Ot(Y.resolveType,Y.data,we);let xt=null;try{await X.mutateAsync({blockKey:ce,data:We}),xt=ce;const lt=[...se];lt[t]={...le,rule:dn(ce)},await Pe(lt),xt=null}catch(lt){throw xt&&await Vn.mutateAsync({blockKey:xt}).catch(()=>{}),lt}at(null),ie.success(p("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:we})),h?.()}catch(Y){ie.error(p("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:It(p,Ft(Y))})}finally{rn(!1)}},Or=async(t,s,a)=>{M(a);try{await X.mutateAsync({blockKey:t,data:a})}catch(c){throw M(d=>d===a?s:d),c}},Zi={rename:async(t,s,a)=>{yt(),$.current&&(clearTimeout($.current),$.current=null),Ie.current.clear();const{activePageKey:c,decofile:d}=Se.current;if(!c)return;const v=Array.isArray(t.variants)?[...t.variants]:[],f=v[s],_=f?.rule&&typeof f.rule=="object"?f.rule:void 0,D=async T=>{const P={...t,variants:T};return await Or(c,t,P),{...d,[c]:P}},A=ku(_,a,d,x);if(A.kind!=="noop"){if(A.kind==="error"){ie.error(A.reason==="no-matcher-rule"?p("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):A.reason==="unreadable-rule"?p("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):A.message??p("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}rn(!0);try{if(A.kind==="inline"){const P=[...v];P[s]={...f,rule:A.inlinedRule};const se=await D(P);await jt(A.blockKey,se),h?.();return}if(A.kind==="updateBlock"){await X.mutateAsync({blockKey:A.blockKey,data:A.blockData}),h?.();return}let T=null;try{await X.mutateAsync({blockKey:A.blockId,data:A.blockData}),T=A.blockId;const P=[...v];P[s]={...f,rule:A.reference},await D(P),T=null}catch(P){throw T&&await Vn.mutateAsync({blockKey:T}).catch(()=>{}),P}ie.success(p("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:a.trim()})),h?.()}catch(T){ie.error(p("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:It(p,Ft(T))})}finally{rn(!1)}}},selectGlobal:async(t,s,a)=>{yt(),$.current&&(clearTimeout($.current),$.current=null),Ie.current.clear();const{activePageKey:c,decofile:d}=Se.current;if(!c)return;const v=Array.isArray(t.variants)?[...t.variants]:[],f=v[s];if(!f)return;const _=St(f.rule,d,x);v[s]={...f,rule:dn(a)};const D={...t,variants:v},A={...d,[c]:D};try{await Or(c,t,D),_&&_!==a&&await jt(_,A),h?.()}catch(T){ie.error(p("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:It(p,Ft(T))})}},selectNamedRule:async(t,s,a)=>{yt(),$.current&&(clearTimeout($.current),$.current=null),Ie.current.clear();const{activePageKey:c,decofile:d}=Se.current;if(!c)return;let v=null,f=null;const _=await Bn(a,d,D=>{const A=Array.isArray(t.variants)?[...t.variants]:[],T=A[s];return T?(v=St(T.rule,d,x),A[s]={...T,rule:D},f={...t,variants:A},{blockKey:c,data:f}):null});!_||!f||(M(f),v&&await jt(v,_.projected),h?.())}},Lr=()=>{Gt()},$r=t=>{mn(t),ls({inner:t})},zr=t=>{Tn(t),ls({raw:t})},Hr=()=>{mn(null),zt([])},Wr=()=>tn(t=>t+1),qr=()=>{pn.flush(),fn(!1),mn(null),Tn(void 0),zt([]),tn(t=>t+1),N?.()},ea=()=>{Cn(!1),Nn(!1),K(null),fn(!0)},ta=()=>{He&&qr(),K(null),Cn(!0)},na=()=>Nn(!0),ps=t=>{if(en&&t===0){Cn(!1);return}if($t&&t<2){Nn(!1),t===0&&K(null);return}if(He){if(t===0){qr();return}if(t===1){zt([]),tn(a=>a+1);return}zt($s.slice(0,t-1)),tn(a=>a+1);return}if(ne){F(ee.slice(0,t)),I(a=>a+1);return}if(t===0){Lr();return}if(t===1){F([]),I(a=>a+1);return}const s=!q&&Pt&&Rt?1:0;if(s===1&&t===2){F([]),I(a=>a+1);return}F(ee.slice(0,t-1-s))},hs=$n.length>1?o.jsx("button",{type:"button",onClick:()=>ps(Wa($n.length,{isMultivariateSectionTop:Yi})),title:p("sectionsEditor.sectionsEditor.back"),"aria-label":p("sectionsEditor.sectionsEditor.back"),className:me("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",pt?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:o.jsx(Ja,{className:"size-4"})}):null,sa=pt||Mt||He?Hi&&o.jsxs("div",{className:me("border-b px-3 py-2.5",pt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!ne&&vt&&Fe&&o.jsxs("button",{type:"button",onClick:Lr,title:p("sectionsEditor.sectionsEditor.editingInVariant",{variant:Fe.label}),className:me("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",Ka),children:[o.jsx(Da,{rule:bs(Fe.rule,g??{},x??void 0),matchers:an}),o.jsx("span",{className:"max-w-[160px] truncate",children:Fe.label})]}),o.jsx("div",{className:"flex-1"}),pt&&o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("span",{className:"shrink-0 cursor-help",children:o.jsx(Qn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),o.jsx(Nt,{side:"bottom",className:"max-w-[260px]",children:p("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Pr&&o.jsx(Wn,{onClick:()=>_n()})]}),pt&&o.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:p("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):o.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(to,{pageKey:C,initialName:_e.name,initialPath:_e.path,onFieldChange:dr,variant:"header"})}),o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"ghost",size:"icon-sm","aria-label":p("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>fn(!0),children:o.jsx(co,{size:14})})}),o.jsx(Nt,{side:"bottom",children:p("sectionsEditor.sectionsEditor.editSeo")})]}),o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"ghost",size:"icon-sm","aria-label":p("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>z&&C?z():es(!0),children:o.jsx(uo,{size:14})})}),o.jsx(Nt,{side:"bottom",children:p("sectionsEditor.sectionsEditor.viewJson")})]}),o.jsx(Wn,{onClick:wn})]}),ra=o.jsxs(o.Fragment,{children:[vt&&C&&o.jsx(no,{listKey:C,variants:Te,activeIndex:ve,decofile:g??{},meta:x,matchers:an,onSelect:yn,onReorder:Ir,onRename:ze,onDuplicate:Br,onDelete:Fr,onAdd:wn}),vt&&ge!==null&&o.jsx(so,{className:"mt-3",children:o.jsx("div",{className:me("space-y-3",sn&&"pointer-events-none opacity-50"),children:o.jsx(vs,{currentRt:ge,currentLabel:kn(Fe?.rule,g??{},re,x??void 0),currentGlobalKey:St(Fe?.rule,g??{},x??void 0)??void 0,matchers:an,globals:cs,onSelect:xr,onSelectGlobal:wr,named:us(Fe?.rule,_r),namedRow:xs(Fe?.rule,Ut),rule:Fe?.rule,schema:vr,formValue:Ye,onChange:br,formKey:`${ve}:${ge??""}`,formWrapperClassName:"space-y-3",meta:x??void 0,decofile:g,onSaveReferencedBlock:hn,sandbox:xn})})})]}),Gr=o.jsxs(o.Fragment,{children:[o.jsx(Ia,{listKey:`${C??""}:${S??""}`,variants:Vt.map((t,s)=>({index:s,label:t.label})),selectedIndex:On,onSelect:mr,onRename:at,onDuplicate:Mi,onDelete:Pi,onRemoveAll:pr,onReorder:Di,onAdd:()=>_n()}),o.jsx(so,{children:o.jsx(vs,{currentRt:nn??"",currentLabel:kn(Rt?.rule,g??{},re,x??void 0),currentGlobalKey:St(Rt?.rule,g??{},x??void 0)??void 0,matchers:an,globals:cs,onSelect:Ii,onSelectGlobal:Oi,named:us(Rt?.rule,Bi),namedRow:xs(Rt?.rule,Ut),rule:Rt?.rule,schema:$i,formValue:ei,onChange:Fi,formKey:`${S??"none"}:${On}:${nn??""}`,formWrapperClassName:"pt-1",meta:x??void 0,decofile:g,onSaveReferencedBlock:hn,sandbox:xn})})]}),Ur=o.jsx("div",{className:me(q?"px-2":"p-2 pt-3"),children:o.jsx(Pc,{listKey:`${C??""}-${ve}`,rawSections:U,sections:Ve,meta:x,decofile:g,selectedIndex:S,onSelect:ji,onReorder:ki,onDelete:Ei,onDuplicate:Ri,onMakeReusable:ae,onToggleHidden:Ai,onToggleLazy:Ae?Ci:void 0,onAddVariant:_n,onDetach:Ni,onAddSection:()=>Zt(!0),canAddSection:gr})}),oa=o.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[C&&_e&&o.jsx(to,{pageKey:C,initialName:_e.name,initialPath:_e.path,onFieldChange:dr}),Wt&&C?o.jsx(wo,{rawSeo:Dn,innerSeo:rs,defaultResolveType:Zs,seoTypesLoading:j&&!x,seoSchema:er,activeResolveType:Kn,seoTypeOptions:Xs,formResetKey:zs,siteDefaultSeo:tr,onBreadcrumbChange:zt,onPersistRaw:zr,onInnerChange:$r,onClearForm:Hr,onBumpFormKey:Wr,asyncRenderAvailable:Ae}):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:p("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),ia=o.jsx(un,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:o.jsx("div",{className:"mx-auto max-w-2xl",children:Wt&&C?o.jsx(wo,{rawSeo:Dn,innerSeo:rs,defaultResolveType:Zs,seoTypesLoading:j&&!x,seoSchema:er,activeResolveType:Kn,seoTypeOptions:Xs,formResetKey:zs,siteDefaultSeo:tr,onBreadcrumbChange:zt,onPersistRaw:zr,onInnerChange:$r,onClearForm:Hr,onBumpFormKey:Wr,asyncRenderAvailable:Ae}):o.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:p("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),aa=o.jsxs(un,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[vt&&C&&o.jsx(no,{listKey:C,variants:Te,activeIndex:ve,decofile:g??{},meta:x,matchers:an,onSelect:yn,onReorder:Ir,onRename:ze,onDuplicate:Br,onDelete:Fr,onAdd:wn}),vt&&ge!==null&&o.jsxs("div",{className:me("px-3 border-b",An?"pt-3 pb-5 space-y-3":"py-2"),children:[o.jsxs("button",{type:"button",onClick:()=>Xo(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-accent","aria-expanded":An,children:[o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:p("sectionsEditor.sectionsEditor.variantRule")}),An?o.jsx(Ga,{className:"size-3.5 shrink-0 text-muted-foreground"}):o.jsx(Ua,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),An&&o.jsx("div",{className:me("space-y-3",sn&&"pointer-events-none opacity-50"),children:o.jsx(vs,{currentRt:ge,currentLabel:kn(Fe?.rule,g??{},re,x??void 0),currentGlobalKey:St(Fe?.rule,g??{},x??void 0)??void 0,matchers:an,globals:cs,onSelect:xr,onSelectGlobal:wr,named:us(Fe?.rule,_r),namedRow:xs(Fe?.rule,Ut),rule:Fe?.rule,schema:vr,formValue:Ye,onChange:br,formKey:`${ve}:${ge??""}`,formWrapperClassName:"space-y-3",meta:x??void 0,decofile:g,onSaveReferencedBlock:hn,sandbox:xn})})]}),Ur]},"editor-section-list");return o.jsx(Fa,{value:j,children:o.jsx(Ba,{children:o.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!q&&hs&&o.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:hs}),(q||$n.length>1)&&o.jsx(Oa,{crumbs:$n,onSelect:ps,onSelectRoot:()=>{pn.flush(),L?L():ps(0)}}),o.jsx("div",{className:"shrink-0",children:q?o.jsxs("div",{className:me("flex items-center gap-2 border-b px-3 py-2.5",pt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[q&&hs,pt&&o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("span",{className:"shrink-0 cursor-help",children:o.jsx(Qn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),o.jsx(Nt,{side:"bottom",className:"max-w-[260px]",children:p("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[o.jsx("span",{className:"truncate text-sm font-semibold",children:Ui}),Kr&&o.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Kr})]}),ms&&vt&&Fe&&o.jsx(ro,{variants:Te,activeIndex:ve,onSelect:yn,onManage:ta,onRemoveAll:Ji}),qi&&o.jsx(ro,{variants:Vt,activeIndex:On,onSelect:mr,onManage:na,onRemoveAll:pr}),ms&&!vt&&o.jsx(Wn,{onClick:wn}),Wi&&o.jsx(Wn,{onClick:()=>_n()}),o.jsx(La,{}),ms&&o.jsxs(o.Fragment,{children:[o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"outline",size:"icon-sm","aria-label":p("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:ea,children:o.jsx(co,{size:14})})}),o.jsx(Nt,{side:"bottom",children:p("sectionsEditor.sectionsEditor.editSeo")})]}),!z&&o.jsxs(At,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Et,{type:"button",variant:"outline",size:"icon-sm","aria-label":p("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>es(!0),children:o.jsx(uo,{size:14})})}),o.jsx(Nt,{side:"bottom",children:p("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):sa}),ft&&o.jsx(Zc,{open:!0,fields:zc(ft.plan,ft.target.schema),choices:ft.choices,changedAgain:ft.changedAgain,author:ci,fresh:ft.fresh,onChoose:(t,s)=>wi({...ft.choices,[t]:s}),onApply:_i},Cu(ft.formBase)),$t?o.jsx(oo,{onAdd:()=>_n(),children:Gr},"editor-section-variants"):Mt?o.jsxs(un,{viewportRef:De,onBlur:ir,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!q&&Pt&&Vt.length>0&&ee.length===0&&Gr,o.jsx(po,{value:Sr,children:o.jsx(io,{value:ne&&j?Ue:null,children:o.jsx(ao,{activeSchema:Fn,formValue:he,formResetKey:st,onFormChange:ur,onBreadcrumbChange:F,breadcrumbPath:ee,emptyMessage:p("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:x,decofile:g,onSaveReferencedBlock:hn,sandbox:xn,previewBaseUrl:fe,onRequestAddSection:fr,onVariantMatcherOp:ne?Zi:void 0})})})]},"editor-section-form"):ne?o.jsx(un,{viewportRef:De,onBlur:ir,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx(po,{value:Sr,children:o.jsx(io,{value:ne&&j?Ue:null,children:o.jsx(ao,{activeSchema:Fn,formValue:he,formResetKey:st,onFormChange:ur,onBreadcrumbChange:F,breadcrumbPath:ee,emptyMessage:p("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:x,decofile:g,onSaveReferencedBlock:hn,sandbox:xn,previewBaseUrl:fe,onRequestAddSection:fr})})})},"editor-global-block"):He?q?o.jsx(un,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"p-3",children:oa})},"editor-seo"):ia:en?o.jsx(oo,{onAdd:wn,children:ra},"editor-variants"):q?o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[o.jsx(un,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"py-2",children:Ur})}),o.jsx("div",{className:"shrink-0 border-t p-2",children:o.jsx(Ts,{canAddSection:gr,onAddSection:()=>Zt(!0)})})]},"editor-section-list"):aa,o.jsx($a,{open:Je!==null,onOpenChange:t=>{t||ae(null)},defaultBlockId:Je!==null?Gn(Ve[Je]?.label??""):"",isPending:X.isPending,onSubmit:Ki}),Ce&&o.jsx(rc,{open:Qo,onOpenChange:t=>{Zt(t),t||(Rn.current=null)},meta:x,decofile:g,previewBaseUrl:fe,onSelect:Vi}),Fs&&C&&g&&o.jsx(pl,{open:Fs,onOpenChange:es,pageKey:C,decofile:g}),Ne!==null&&o.jsx(lo,{open:!0,initialName:Qt(Te[Ne]?.rule,g??{},x??void 0)?kn(Te[Ne]?.rule,g??{},re,x??void 0):"",autoLabel:re(bs(Te[Ne]?.rule,g??{},x??void 0)),isPending:sn,onSubmit:async t=>{await Qi(Ne,t)},onOpenChange:t=>{!t&&!sn&&ze(null)}}),rt!==null&&o.jsx(lo,{open:!0,initialName:Qt(Vt[rt]?.rule,g??{},x??void 0)?kn(Vt[rt]?.rule,g??{},re,x??void 0):"",autoLabel:re(bs(Vt[rt]?.rule,g??{},x??void 0)),isPending:sn,onSubmit:async t=>{await Xi(rt,t)},onOpenChange:t=>{!t&&!sn&&at(null)}})]})})})}export{Gm as SectionsEditor};
|