decocms 4.363.1 → 4.364.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CgERhdh6.js → AlertCircle-EniJtD8E.js} +1 -1
- package/dist/client/assets/{AreaChart-kU4sTinA.js → AreaChart-DZpAPo6a.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BVx6AQzq.js → ArrowLeft-Clu1mSdY.js} +1 -1
- package/dist/client/assets/{ArrowRight-DZQert3q.js → ArrowRight-Cu8UuHNR.js} +1 -1
- package/dist/client/assets/{ArrowUp-lpfNBlP2.js → ArrowUp-C0eratGp.js} +1 -1
- package/dist/client/assets/{Check-DClZtAIP.js → Check-BWpBE9uf.js} +1 -1
- package/dist/client/assets/{CheckCircle-BGqFZ8sM.js → CheckCircle-cinYKmPU.js} +1 -1
- package/dist/client/assets/{ChevronRight-BNfU55ld.js → ChevronRight-DzRB-rdO.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-ilm76_0p.js → ChevronSelectorVertical-BiIbFU31.js} +1 -1
- package/dist/client/assets/{ChevronUp-CbF1Gmeo.js → ChevronUp-DGrguvGW.js} +1 -1
- package/dist/client/assets/{Copy01-DiITYBuR.js → Copy01-DayLu0dF.js} +1 -1
- package/dist/client/assets/{CreditCard01-Zpy-4Wu9.js → CreditCard01-4OsjIT5f.js} +1 -1
- package/dist/client/assets/{Database01-zcGUPFsG.js → Database01-2gG_9E30.js} +1 -1
- package/dist/client/assets/{DotsVertical-LmkOTjL4.js → DotsVertical-CucJCL9y.js} +1 -1
- package/dist/client/assets/{Download01-C4blLpML.js → Download01-BC2rKbuh.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-KbkdtIBU.js → ErrorBarContext-CRh7XbJc.js} +1 -1
- package/dist/client/assets/{Eye-Cd7v-liN.js → Eye-dnrP5DkM.js} +1 -1
- package/dist/client/assets/{File02-CceuR6rF.js → File02-BhckHV8N.js} +1 -1
- package/dist/client/assets/{GitBranch01-Dil6c2wv.js → GitBranch01-BBn4dN5f.js} +1 -1
- package/dist/client/assets/{Globe01-BVji6jXS.js → Globe01-SLAc63wC.js} +1 -1
- package/dist/client/assets/{HardDrive-B4UY5qYp.js → HardDrive-FlnOYA_8.js} +1 -1
- package/dist/client/assets/{Image01-CpXdMb8x.js → Image01-BrHSH-Vi.js} +1 -1
- package/dist/client/assets/{Key01-BsAAVoJx.js → Key01-CKcg8G1v.js} +1 -1
- package/dist/client/assets/{Link01-OqB-2yPE.js → Link01-3t9JrUgl.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DobnLseV.js → LinkExternal01-Cp7uxK1i.js} +1 -1
- package/dist/client/assets/{Monitor01-BTqHf-K4.js → Monitor01-BUruMK2r.js} +1 -1
- package/dist/client/assets/{Package-CCkk0w5h.js → Package-CdfyZYxN.js} +1 -1
- package/dist/client/assets/{Palette-BBWt8owf.js → Palette-CglyAOTg.js} +1 -1
- package/dist/client/assets/{Play-CPeIBqH_.js → Play-rnw1eV52.js} +1 -1
- package/dist/client/assets/{Plus-DaErdsG1.js → Plus-Bxp02MWl.js} +1 -1
- package/dist/client/assets/{Printer-BG6NfeSZ.js → Printer-fz_zwxfT.js} +1 -1
- package/dist/client/assets/{SearchLg-DxQfk550.js → SearchLg-FC9suxna.js} +1 -1
- package/dist/client/assets/{SearchMd-BNXjQ2BV.js → SearchMd-DRRptSJN.js} +1 -1
- package/dist/client/assets/{Sector-D2wxgDkd.js → Sector-CJIPfQ5Z.js} +1 -1
- package/dist/client/assets/{Settings02-DL8f5fN1.js → Settings02-D2oiGU4q.js} +1 -1
- package/dist/client/assets/{Share07-D1Sv14jA.js → Share07-D_kiq5Fr.js} +1 -1
- package/dist/client/assets/{Shield01-BsobIEfQ.js → Shield01-CjyLhqlS.js} +1 -1
- package/dist/client/assets/{Stars01-f37Q7vDf.js → Stars01-COChWymR.js} +1 -1
- package/dist/client/assets/{Sun-DjKz3VjB.js → Sun-nKOZMh9n.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BIyO34Jw.js → SwitchHorizontal01-CxlKjkIX.js} +1 -1
- package/dist/client/assets/{Tool01-D6HOM_aJ.js → Tool01-BnKd95Y1.js} +1 -1
- package/dist/client/assets/{Tool02-BrfQeZRx.js → Tool02-C_xRWqQk.js} +1 -1
- package/dist/client/assets/{Trash01-DQjprOwc.js → Trash01-DqUm2RRh.js} +1 -1
- package/dist/client/assets/{TrendUp01-DIz6JZwT.js → TrendUp01-PFzYDizC.js} +1 -1
- package/dist/client/assets/{Upload01-BDeLrRhf.js → Upload01-CqWnAR1-.js} +1 -1
- package/dist/client/assets/{User01-B8a5ssx2.js → User01-BJoNdkjl.js} +1 -1
- package/dist/client/assets/{UserSquare-yIpHwPSn.js → UserSquare-CCDsU001.js} +1 -1
- package/dist/client/assets/{Users01-BCRhQsCX.js → Users01-DSQPwtP5.js} +1 -1
- package/dist/client/assets/{Users03-DWh3D2_T.js → Users03-CRtXqa1Q.js} +1 -1
- package/dist/client/assets/{XCircle-DudPVYQR.js → XCircle-9Cb0khfg.js} +1 -1
- package/dist/client/assets/{XClose-DpDcHm9Y.js → XClose-Cw4b4Uag.js} +1 -1
- package/dist/client/assets/{Zap-C5eiFR0N.js → Zap-ChVc0p76.js} +1 -1
- package/dist/client/assets/{ZoomOut-DdupjPFF.js → ZoomOut-BXPGwF_O.js} +1 -1
- package/dist/client/assets/{access-gate-Dnh0JyKy.js → access-gate-BZbNb1lq.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BSihy3_s.js → add-connection-dialog-s1GRGQ63.js} +1 -1
- package/dist/client/assets/{agent-analytics-C1OAYjbt.js → agent-analytics-C4aHsqYV.js} +1 -1
- package/dist/client/assets/agent-app-CzbKRw1_.js +1 -0
- package/dist/client/assets/{agent-assets-vYQq8qui.js → agent-assets-B6lPIA_2.js} +1 -1
- package/dist/client/assets/{agent-automation-BPNX454_.js → agent-automation-Bmdy2mNK.js} +1 -1
- package/dist/client/assets/{agent-automations-BLOXID0N.js → agent-automations-5exIOZ--.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-BzEccd4r.js → agent-connect-sources-ozaEzrP4.js} +1 -1
- package/dist/client/assets/agent-deck-D5-mvZ5i.js +1 -0
- package/dist/client/assets/{agent-e2e-DM8adI3E.js → agent-e2e-s-Nk1F2Y.js} +1 -1
- package/dist/client/assets/agent-file-DkGApBvp.js +1 -0
- package/dist/client/assets/{agent-git-DarQSTRH.js → agent-git-Bu3r6tWp.js} +1 -1
- package/dist/client/assets/{agent-hosting-Dnr2S-TT.js → agent-hosting-CdYzW_dA.js} +1 -1
- package/dist/client/assets/{agent-icon-vDfwuZu4.js → agent-icon-DrlilhFJ.js} +1 -1
- package/dist/client/assets/agent-library-file-CK85m8fH.js +1 -0
- package/dist/client/assets/{agent-monitor-DpaaBIhL.js → agent-monitor-DEQ-34KF.js} +1 -1
- package/dist/client/assets/{agent-overview-D9IrP622.js → agent-overview-BQIF-rwN.js} +1 -1
- package/dist/client/assets/agent-settings-gb3smN_4.js +1 -0
- package/dist/client/assets/{agent-site-editor-DTFbZmEY.js → agent-site-editor-DtPpWjDD.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-DkcL_YVi.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-BE26aik7.js → agent-site-editor-content-6zQLGSyR.js} +2 -2
- package/dist/client/assets/{agent-site-editor-preview-ki_D8wtP.js → agent-site-editor-preview-D8mxBZIU.js} +3 -3
- package/dist/client/assets/agent-view-D9WzU94g.js +1 -0
- package/dist/client/assets/{agent-view-guard-DomQyuot.js → agent-view-guard-nj1TYVsk.js} +1 -1
- package/dist/client/assets/{agents-list-B0vnsITA.js → agents-list-hiZ_XS0O.js} +1 -1
- package/dist/client/assets/{ai-providers-CxaMjUP7.js → ai-providers-oY9ilqJZ.js} +1 -1
- package/dist/client/assets/{alert-DcFgIKLk.js → alert-D-emvPaG.js} +1 -1
- package/dist/client/assets/{alert-dialog-CiKfgw9r.js → alert-dialog-BE9ltHtr.js} +1 -1
- package/dist/client/assets/{api-keys-CEPWE1iS.js → api-keys-4NMR09V3.js} +1 -1
- package/dist/client/assets/api-keys-BQayHq-8.js +1 -0
- package/dist/client/assets/app-editor-DeI0TeES.js +1 -0
- package/dist/client/assets/{asset-utils-DJXdpjr9.js → asset-utils-CR65HphV.js} +1 -1
- package/dist/client/assets/{auth-ksbj4Esa.js → auth-RjDDTUUT.js} +1 -1
- package/dist/client/assets/{auth-catchall-DV5KEwZ2.js → auth-catchall-qxwSZGuB.js} +1 -1
- package/dist/client/assets/{auth-entry-Fe8qT_kq.js → auth-entry-ddblLMjc.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CFJK_BXW.js → auth-split-layout-oGs_kK_4.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DMvGjBUE.js → authenticate-and-persist-oauth-DXlrPDSv.js} +1 -1
- package/dist/client/assets/{automation-list-row-CkrObNhq.js → automation-list-row-XibuWgpW.js} +1 -1
- package/dist/client/assets/{automation-runs-C-5kRp10.js → automation-runs-nZP284NC.js} +1 -1
- package/dist/client/assets/automations-CDxxuCym.js +1 -0
- package/dist/client/assets/{autosend-BzUVLyEq.js → autosend-HdosN86x.js} +1 -1
- package/dist/client/assets/{avatar-CW4PxBuN.js → avatar-DcDvs8Zz.js} +1 -1
- package/dist/client/assets/{badge-C5Ilvf_J.js → badge-DJpaBl8u.js} +1 -1
- package/dist/client/assets/{block-document-Zfk-C1Kp.js → block-document-LCYQj9PJ.js} +1 -1
- package/dist/client/assets/{breadcrumb-BajFgW5V.js → breadcrumb-BOAVRiAa.js} +1 -1
- package/dist/client/assets/{buckets-CyNocIPE.js → buckets-Ze5fok7v.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-BrRLOIlw.js → build-improve-prompt-doc-Dn9xs_5X.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-e217-dmm.js → bulk-category-panel-D-Hh71MB.js} +1 -1
- package/dist/client/assets/{calendar-DGiOuDgZ.js → calendar-DTnssie4.js} +1 -1
- package/dist/client/assets/{capability-load-error-DFv8gs5U.js → capability-load-error-CJ3e1sqb.js} +1 -1
- package/dist/client/assets/{cards-XHNjVWeh.js → cards-DTFINi5r.js} +1 -1
- package/dist/client/assets/category-editor-4KcN0JRt.js +1 -0
- package/dist/client/assets/{chart-C7CmtzOp.js → chart-Jb0gHMLD.js} +1 -1
- package/dist/client/assets/{chat-context-HB_KOUNM.js → chat-context-CXknhaDs.js} +1 -1
- package/dist/client/assets/{checkbox-Dg_GkeBT.js → checkbox-D8Ab2Vb-.js} +1 -1
- package/dist/client/assets/{choose-editor-DO1mGCL1.js → choose-editor-Chy2VB_F.js} +1 -1
- package/dist/client/assets/{cli-auth-success-e-RADpiN.js → cli-auth-success-B27gos5d.js} +1 -1
- package/dist/client/assets/{client-icons-tt6oaVA2.js → client-icons-CoIMqlIz.js} +1 -1
- package/dist/client/assets/{collapsible-CycyYnXe.js → collapsible-DH_CZdwE.js} +1 -1
- package/dist/client/assets/{collection-detail-DhtfN_Wl.js → collection-detail-D8Sq0PzS.js} +1 -1
- package/dist/client/assets/{collection-display-button-BRbx9UhH.js → collection-display-button-P_aK73Om.js} +1 -1
- package/dist/client/assets/{collection-search-j4HjYlys.js → collection-search-CzGq8Uso.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-0LZ9BKlr.js → collection-table-wrapper-ChqJqpKo.js} +1 -1
- package/dist/client/assets/{collection-tabs-Bc9QOlJ8.js → collection-tabs-BLgGMB42.js} +1 -1
- package/dist/client/assets/{command-BpjWfGyr.js → command-B6LMVdkQ.js} +1 -1
- package/dist/client/assets/{command-palette-store-D19nXDNm.js → command-palette-store-BwHku_Zt.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-CdG4FfWS.js → commerce-onboarding-EmIMFBqV.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-CVcicsr9.js → companion-mcps-section-BszDkkOp.js} +1 -1
- package/dist/client/assets/{connect-COU6F3Do.js → connect-CM-97gwN.js} +1 -1
- package/dist/client/assets/{connect-layout-Bl-ol5HH.js → connect-layout-C_MQVbrT.js} +1 -1
- package/dist/client/assets/{connection-By77bjvj.js → connection-OmoYXqZk.js} +1 -1
- package/dist/client/assets/{connection-card-Br8jDKgZ.js → connection-card-Cy-GdKQl.js} +1 -1
- package/dist/client/assets/{connection-detail-vVdPGlxv.js → connection-detail-CuBiFvjK.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CFXh6BoJ.js → connection-form-helpers-D3hdN_Pk.js} +1 -1
- package/dist/client/assets/{connections-BBNFmXEe.js → connections-BnO49Vti.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CRl8hry2.js → create-organization-dialog--p2RMsV5.js} +1 -1
- package/dist/client/assets/{decode-html-entities-Cf7wUEql.js → decode-html-entities-DDqE27I4.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-D2Qtyl-A.js → decopilot-sse-pool-CfYFArSW.js} +1 -1
- package/dist/client/assets/{dialog-DJBpjJnY.js → dialog-otnvxVN0.js} +1 -1
- package/dist/client/assets/{discover-y7BsppSE.js → discover-BZKxvY_j.js} +1 -1
- package/dist/client/assets/{domain-settings-B_cuGCF0.js → domain-settings-QORwmdcG.js} +1 -1
- package/dist/client/assets/{download-app-dialog-DYhv8XsJ.js → download-app-dialog-BqNRF4Sn.js} +1 -1
- package/dist/client/assets/{drawer-B5NRhNfW.js → drawer-s7gtDrb4.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DzwCPltk.js → dropdown-menu-BxKUbUkE.js} +1 -1
- package/dist/client/assets/{editor-BHnwprUT.js → editor-DCxsAs7o.js} +1 -1
- package/dist/client/assets/{empty-state-CJ95hR0w.js → empty-state-CL4F2BS4.js} +1 -1
- package/dist/client/assets/{empty-state-CXolWOTn.js → empty-state-Cz1DkYZE.js} +1 -1
- package/dist/client/assets/{extract-connection-data-B1nPGa4h.js → extract-connection-data-CqGCTPdZ.js} +1 -1
- package/dist/client/assets/{file-explorer-Dj1zqDxa.js → file-explorer-Uvp7ogK8.js} +1 -1
- package/dist/client/assets/{file-preview-kRDXQYfi.js → file-preview-18IJQMnU.js} +1 -1
- package/dist/client/assets/{file-share-button-P5GnoZYM.js → file-share-button-Cef5f1VZ.js} +1 -1
- package/dist/client/assets/{file-type-icon-Cg81au_Z.js → file-type-icon-DGllFDOf.js} +1 -1
- package/dist/client/assets/{folder-icon-Bey_C_xd.js → folder-icon-p8jB76CU.js} +1 -1
- package/dist/client/assets/{form-EGCuUtdG.js → form-KjPevg0A.js} +1 -1
- package/dist/client/assets/{general-BJ_Ksgnn.js → general-t-IB2WC3.js} +1 -1
- package/dist/client/assets/{github-icon-CiNkodR8.js → github-icon-D51q_6S8.js} +1 -1
- package/dist/client/assets/{home-Cmddezu3.js → home-Bhl8U_ph.js} +1 -1
- package/dist/client/assets/{hooks-Bb9SArul.js → hooks-BhviOOpn.js} +1 -1
- package/dist/client/assets/{hooks-BSkeWBV7.js → hooks-k1OxvonE.js} +1 -1
- package/dist/client/assets/{index-6GXqHE0w.js → index-B3yBTWEk.js} +4 -4
- package/dist/client/assets/{index-BVRQ9yUZ.js → index-Bwc7J041.js} +1 -1
- package/dist/client/assets/{index-CY40-aHW.js → index-C1N-CFMR.js} +1 -1
- package/dist/client/assets/{index-BaItIL-_.js → index-C7WIaN4y.js} +1 -1
- package/dist/client/assets/{index-DCQ3taiG.js → index-CRCvoACn.js} +1 -1
- package/dist/client/assets/{index-B9bOVdMd.js → index-D4YJGrDI.js} +3 -3
- package/dist/client/assets/{index-hC6VOnUm.js → index-DD-r2o4M.js} +1 -1
- package/dist/client/assets/{index-CUa7fAjf.js → index-DOk05MCp.js} +1 -1
- package/dist/client/assets/{index-B7ENeoW4.js → index-DlQKfvnq.js} +1 -1
- package/dist/client/assets/{index-Cu77hgR2.js → index-DqX9hbqM.js} +1 -1
- package/dist/client/assets/{index-Dg14Zpi9.js → index-fTs6ROSj.js} +1 -1
- package/dist/client/assets/{index-qEipD_7S.js → index-m01im2kT.js} +1 -1
- package/dist/client/assets/{index-redirect-BRL1uQPT.js → index-redirect-e7Kr1hOd.js} +1 -1
- package/dist/client/assets/{index-cEqwHhEg.js → index-w1d_dmEj.js} +1 -1
- package/dist/client/assets/{index-9FQARZdh.js → index-xVQnUsdi.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-C7FrFXuf.js → infiniteQueryObserver-DgAoAIrN.js} +1 -1
- package/dist/client/assets/{infra-billing-B0e93_qz.js → infra-billing-B2HwpfSN.js} +1 -1
- package/dist/client/assets/{input-D8xrvlz-.js → input-BnbYz5_9.js} +1 -1
- package/dist/client/assets/{input-BRqLi1TH.js → input-DxAgQLPa.js} +1 -1
- package/dist/client/assets/{input-TvernbmY.js → input-HFOrJf5B.js} +1 -1
- package/dist/client/assets/{integration-icon-B6H5J7sl.js → integration-icon-BPwWRlNG.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-CsolElt3.js → invite-member-dialog-vPcEYe6v.js} +1 -1
- package/dist/client/assets/{label-aWEsDmHM.js → label-CqlSWrLn.js} +1 -1
- package/dist/client/assets/{layout-CAwe_kK2.js → layout-aU1eoqDA.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DJ_t0QLc.js → legacy-agents-deep-CpKjJlPs.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-CySqEohs.js → legacy-main-redirect-ZPChWdtD.js} +1 -1
- package/dist/client/assets/{library-DRmbr8Ht.js → library-uYIcEGdr.js} +1 -1
- package/dist/client/assets/{login-DQDbHhI7.js → login-CfxNz6kc.js} +1 -1
- package/dist/client/assets/{markdown-CBvmi8AF.js → markdown-B1038zFJ.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BQ7hPzlx.js → mcp-app-renderer-Cb8Ud-E7.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DhRKpyTH.js → mcp-oauth-D6isOO_s.js} +1 -1
- package/dist/client/assets/{members-NHaXKGgP.js → members-DHLsomPg.js} +1 -1
- package/dist/client/assets/{mini-report-page-BcG9QHwQ.js → mini-report-page-iTjakIrU.js} +1 -1
- package/dist/client/assets/{monaco-editor-C5zvkMO4.js → monaco-editor-WNMTPDp9.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CWqusnLf.js → monitoring-stats-row-B_mR1zw-.js} +1 -1
- package/dist/client/assets/{multi-select-CvACpZbb.js → multi-select-D54pM3d4.js} +1 -1
- package/dist/client/assets/{mustache-DQXz9E52.js → mustache-r9snVmI4.js} +1 -1
- package/dist/client/assets/{oauth-callback-BHJTnNxG.js → oauth-callback-GAK1H0Is.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-wF0_7wc5.js → oauth-callback-ai-provider-sdaHeEFx.js} +1 -1
- package/dist/client/assets/{onboarding-20FUHLvO.js → onboarding-BKPW4du6.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-DKtRXqQ0.js → optimistic-project-sidebar-views-yrtk59Mo.js} +1 -1
- package/dist/client/assets/{org-layout-DRrVivAL.js → org-layout-BNIg984j.js} +1 -1
- package/dist/client/assets/{organization-choice-BmSYuBSE.js → organization-choice-DvXG7tgx.js} +1 -1
- package/dist/client/assets/{orgs-1ZlqeM-y.js → orgs-NTyzCYi-.js} +1 -1
- package/dist/client/assets/{page-seo-form-Cpi2Oike.js → page-seo-form-DAkbVQPg.js} +1 -1
- package/dist/client/assets/{pair-CD8Vxcvs.js → pair-C08OPQNP.js} +1 -1
- package/dist/client/assets/{popover-Ci-k968-.js → popover-DIqZ2IKF.js} +1 -1
- package/dist/client/assets/{post-calendar-CgTLYrrU.js → post-calendar-DuH_hA9y.js} +1 -1
- package/dist/client/assets/{post-editor-DyayPm7u.js → post-editor-BAf6FqSQ.js} +1 -1
- package/dist/client/assets/{preview-content-DhEgigNG.js → preview-content-B5xB74fu.js} +1 -1
- package/dist/client/assets/{preview-dialog-CKWnRekk.js → preview-dialog-b2QyOGzU.js} +1 -1
- package/dist/client/assets/{primitives-1lR28duD.js → primitives-4_D03rJK.js} +1 -1
- package/dist/client/assets/{profile-DixSbE4L.js → profile-COT-hKKD.js} +1 -1
- package/dist/client/assets/{project-app-view-DBHiU3Rg.js → project-app-view-DJ_q7UHg.js} +1 -1
- package/dist/client/assets/{project-feed-boKgu_TR.js → project-feed-DJ_jJM3E.js} +1 -1
- package/dist/client/assets/{project-icon-DIXBuD-A.js → project-icon-Bl3bXnhv.js} +1 -1
- package/dist/client/assets/project-reports-q4w3pT5T.js +1 -0
- package/dist/client/assets/project-tasks-DqlAyIfE.js +1 -0
- package/dist/client/assets/{prompts-BROxvafI.js → prompts-CI44HEcf.js} +1 -1
- package/dist/client/assets/record-editor-n0M7yiQw.js +1 -0
- package/dist/client/assets/redirect-editor-CK3YSOdb.js +1 -0
- package/dist/client/assets/registry-DkzCUqTc.js +2 -0
- package/dist/client/assets/{registry-layout-BUEF9YqP.js → registry-layout-CvRfdld3.js} +1 -1
- package/dist/client/assets/{reports-B1C9NU2m.js → reports-C-eaYxW3.js} +1 -1
- package/dist/client/assets/reports-C2LVTrmJ.js +1 -0
- package/dist/client/assets/{reports-tab-uLMivl2p.js → reports-tab-qffeKlGd.js} +2 -2
- package/dist/client/assets/repositories-ao250fUH.js +1 -0
- package/dist/client/assets/{repository-import-picker-DVnadPZ8.js → repository-import-picker-Bg_h8YsG.js} +1 -1
- package/dist/client/assets/repository-picker-BDWGy2xY.js +1 -0
- package/dist/client/assets/{require-capability-DSFKKTc-.js → require-capability-CmR_46yt.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DMNBbcf3.js → required-auth-layout-BEc3NUsQ.js} +1 -1
- package/dist/client/assets/{reset-password-GCDcBOjo.js → reset-password-BlF157J6.js} +1 -1
- package/dist/client/assets/{review-settings-VwYzzjCc.js → review-settings-BBciVvfB.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-C6A8Q9Jd.js → rich-text-link-control-CrwbAR31.js} +1 -1
- package/dist/client/assets/{roles-PgEO9KN-.js → roles-CuHUTdKb.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-Db2XbJYi.js → runnable-block-editor-2CMWc-S3.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-DxbfUbxP.js → sandbox-lifecycle-context-CXd9Um8u.js} +1 -1
- package/dist/client/assets/{schema-Cnskrzk1.js → schema-BQbhQoxs.js} +1 -1
- package/dist/client/assets/{scroll-area-CaE3a4_T.js → scroll-area-BgZjjLM3.js} +1 -1
- package/dist/client/assets/{search-input-lFP9sD3O.js → search-input-uXtJ6IU8.js} +1 -1
- package/dist/client/assets/{secrets-BU_daRxy.js → secrets-C1mCKV1g.js} +1 -1
- package/dist/client/assets/{sections-editor-D-W8vM7g.js → sections-editor-Bv2odcBq.js} +1 -1
- package/dist/client/assets/{select-Ce9NznPv.js → select-Bc5UZb4n.js} +1 -1
- package/dist/client/assets/{select-model-CjTijsS7.js → select-model-BDGEzt-Y.js} +1 -1
- package/dist/client/assets/{seo-editor-O94He1NF.js → seo-editor-DJw3ydvJ.js} +1 -1
- package/dist/client/assets/settings-layout-DlH0gQXK.js +1 -0
- package/dist/client/assets/{settings-sidebar-BcAe-WS4.js → settings-sidebar-DswZBMwm.js} +1 -1
- package/dist/client/assets/{settings-tab-Cg5CqTki.js → settings-tab-Ru2atFmZ.js} +1 -1
- package/dist/client/assets/{shell-controls-gkZZS07l.js → shell-controls-DkLEUvEw.js} +1 -1
- package/dist/client/assets/{shell-layout-C3IRibnI.js → shell-layout-1dFmVwYI.js} +1 -1
- package/dist/client/assets/{skill-preview-MIddvDZe.js → skill-preview-CGe8kUoa.js} +1 -1
- package/dist/client/assets/{skills-hRnVKZ5K.js → skills-BGdKR-aF.js} +1 -1
- package/dist/client/assets/{sso-BePH_NId.js → sso-M-OsbEtw.js} +1 -1
- package/dist/client/assets/{store-CqeIEwHN.js → store-BY4ZRY7y.js} +1 -1
- package/dist/client/assets/store-registry-DQHLJpOA.js +2 -0
- package/dist/client/assets/{switch-D5GcuD9Z.js → switch-CJ5Ir2Zx.js} +1 -1
- package/dist/client/assets/{synced-repos-Cnp4m7yg.js → synced-repos-9D-CfhL7.js} +1 -1
- package/dist/client/assets/{table-O0SpY8ZO.js → table-Di_WRNkb.js} +1 -1
- package/dist/client/assets/{tabs-DQoXHeZr.js → tabs-DV8akPGb.js} +1 -1
- package/dist/client/assets/{task-board-DyZE7mH1.js → task-board-CXsHf2Zn.js} +1 -1
- package/dist/client/assets/{task-route-CayeX6cv.js → task-route-D79aS9d_.js} +1 -1
- package/dist/client/assets/{task-status-CyTozLxL.js → task-status-DIr_2V94.js} +1 -1
- package/dist/client/assets/tasks-C6DyE2q-.js +1 -0
- package/dist/client/assets/{tasks-Da-h-zLm.js → tasks-CiIHA5f1.js} +1 -1
- package/dist/client/assets/{textarea-BpFOmm9_.js → textarea-CneoU2lJ.js} +1 -1
- package/dist/client/assets/{thread-intent-AJKohiRy.js → thread-intent-DVKldCEq.js} +1 -1
- package/dist/client/assets/{thread-route-CEvVLI2K.js → thread-route-CKY-dKC0.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-Bs4b4fMK.js → thread-sheet-body-CcUGPZXB.js} +1 -1
- package/dist/client/assets/{toggle-group-Cs1yIHkK.js → toggle-group-9HQCpj-q.js} +1 -1
- package/dist/client/assets/{tool-namespace-ySa3S1AM.js → tool-namespace-BVMQcKlk.js} +1 -1
- package/dist/client/assets/{toolbar-DOOz2W24.js → toolbar-D0oe2g2b.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Dp-AbzNZ.js → toolbar-icon-button-EOE8J-Ai.js} +1 -1
- package/dist/client/assets/{track-Dns1NpdC.js → track-BzMi8kcZ.js} +1 -1
- package/dist/client/assets/{types-C1gRrnQe.js → types-Csu6Ims7.js} +1 -1
- package/dist/client/assets/{usage-stats-D5mXC24B.js → usage-stats-BNse37Wk.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Bg_y9f3x.js → use-ai-providers-qnkcjapR.js} +1 -1
- package/dist/client/assets/{use-automations-BI_yIok-.js → use-automations-CYOC_eS5.js} +1 -1
- package/dist/client/assets/{use-autosave-BB0U2eiK.js → use-autosave-CCprSQ13.js} +1 -1
- package/dist/client/assets/{use-commerce-diagnostic-DqKipeip.js → use-commerce-diagnostic-mdvL2BW-.js} +1 -1
- package/dist/client/assets/{use-connect-companion-Mci4Y6hu.js → use-connect-companion-2fL060lG.js} +1 -1
- package/dist/client/assets/{use-connection-DCUpGmsb.js → use-connection-DCLPda2h.js} +1 -1
- package/dist/client/assets/{use-copy-GVBAvo9n.js → use-copy-14DzRp8J.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CizXpVyQ.js → use-create-virtual-mcp-DoCSQs95.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-CcPpBz8y.js → use-date-fns-locale-DYzMvrWB.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-wCEzYUZh.js → use-debounced-autosave-BRAVEUZc.js} +1 -1
- package/dist/client/assets/{use-debounced-value-D0SYNQsR.js → use-debounced-value-Cud3o3Fq.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DjxZxHMq.js → use-deco-credits-rwNQ1gMg.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-zpeu2MCG.js → use-decopilot-events-DYRVevWg.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B-DNpbCU.js → use-delete-connection-ueGIYWMK.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Dpkh4HgH.js → use-deployment-admin-D6IzoXV0.js} +1 -1
- package/dist/client/assets/{use-file-configs-B1FdrMZJ.js → use-file-configs-BwD1CaWo.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BXOEU8Y7.js → use-infinite-scroll-DkLPxlOu.js} +1 -1
- package/dist/client/assets/{use-join-requests-1Ow065Yq.js → use-join-requests-DTGTfD21.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-CeyJWpQP.js → use-main-panel-tabs-EW6rbxam.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CSQiZCDG.js → use-mcp-auth-status-CPh3Lmzs.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Bq-mjhw3.js → use-mcp-client-DsJzBus3.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CWmeNLXn.js → use-mcp-prompts-i0LZ2nQA.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DGdyHn8U.js → use-mcp-tools-Dc3F6Krl.js} +1 -1
- package/dist/client/assets/{use-members-Dnee1tF2.js → use-members-C0MdJrYz.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Drdqs1cr.js → use-navigate-to-agent-Bbq0oQ0Y.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-Cju1isPI.js → use-open-billing-url-DvTk9GH0.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CVFBkaiI.js → use-org-auth-client-4o0wRx2Q.js} +1 -1
- package/dist/client/assets/{use-org-fs-DG1oJieK.js → use-org-fs-BEoPvlnI.js} +1 -1
- package/dist/client/assets/{use-org-notice-PUfO84YR.js → use-org-notice-CXYMfMUq.js} +1 -1
- package/dist/client/assets/{use-org-sso-uleG21Aq.js → use-org-sso-CdSz0xa8.js} +1 -1
- package/dist/client/assets/{use-organization-roles-yO3kgQbK.js → use-organization-roles-DzWM9Nv-.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DrJN-E78.js → use-organization-settings-BAVHurZk.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-CCqZdv2O.js → use-panel-navigate-Byvx0cbx.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-01L5j4lu.js → use-project-native-view-presence-D-AyEulW.js} +1 -1
- package/dist/client/assets/{use-project-scope-DZ9tacAx.js → use-project-scope-B2cuvtTy.js} +1 -1
- package/dist/client/assets/{use-registry-connections-cro5WL6A.js → use-registry-connections-DikbDR8w.js} +1 -1
- package/dist/client/assets/{use-secrets-w6G8jtp4.js → use-secrets-D-c1ciPZ.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-lro_p1nx.js → use-section-preview-base-CwIWGkgy.js} +1 -1
- package/dist/client/assets/{use-session-runtime-TS34dEJv.js → use-session-runtime-BHahDP0E.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DQ2pMmh0.js → use-status-sounds-CnCb1h48.js} +1 -1
- package/dist/client/assets/{use-tags-B6zE47mm.js → use-tags-C2LhenRb.js} +1 -1
- package/dist/client/assets/{use-task-metadata-C4MfiHBQ.js → use-task-metadata-CB3EJ29f.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-CpCqTMOi.js → use-thread-outputs-9oZhiYbB.js} +1 -1
- package/dist/client/assets/{use-view-mode-B9wUn2ad.js → use-view-mode-BvOL5I4W.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CMlCV8Oj.js → use-virtual-mcp-Bk09OpEg.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-GKCP1c_7.js +1 -0
- package/dist/client/assets/{useQueries-C6OAJOs7.js → useQueries-qr8TAkZc.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DmEiIBI4.js +1 -0
- package/dist/client/assets/{users-CYflDdFv.js → users-C1ExMDuM.js} +1 -1
- package/dist/client/assets/{utils-B-5U5Z26.js → utils-B14U8IKK.js} +1 -1
- package/dist/client/assets/{variant-calendar-BsFwTl3D.js → variant-calendar-urd0wE-3.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-CRlEf4IL.js → variant-matcher-override-DvY-JiuY.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-kY4gR8CN.js → view-mode-toggle-swSorpD7.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CKi1xJsO.js → virtual-mcp-DGQbDtgM.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +678 -668
- package/dist/server/migrate.js +171 -161
- package/dist/server/server.js +418 -418
- package/package.json +1 -1
- package/dist/client/assets/agent-app-62cavSHy.js +0 -1
- package/dist/client/assets/agent-deck-DVW32bsA.js +0 -1
- package/dist/client/assets/agent-file-C7nywZCe.js +0 -1
- package/dist/client/assets/agent-library-file-D4p-8dXS.js +0 -1
- package/dist/client/assets/agent-settings-CxGAsqqN.js +0 -1
- package/dist/client/assets/agent-site-editor-code-Dcgjtfwk.js +0 -2
- package/dist/client/assets/agent-view-DYYYDEW_.js +0 -1
- package/dist/client/assets/api-keys-DoGNEUpY.js +0 -1
- package/dist/client/assets/app-editor-CRjlYU-M.js +0 -1
- package/dist/client/assets/automations-CKhgbURI.js +0 -1
- package/dist/client/assets/category-editor-zLRtagcy.js +0 -1
- package/dist/client/assets/project-reports-ChLta7_v.js +0 -1
- package/dist/client/assets/project-tasks-nUWazd1g.js +0 -1
- package/dist/client/assets/record-editor-FqHaN2k4.js +0 -1
- package/dist/client/assets/redirect-editor-CWYZom_C.js +0 -1
- package/dist/client/assets/registry-C3_EEMj-.js +0 -2
- package/dist/client/assets/reports-BY7Ca1Ey.js +0 -1
- package/dist/client/assets/repositories-BgD13VwL.js +0 -1
- package/dist/client/assets/repository-picker-BGpoa_g_.js +0 -1
- package/dist/client/assets/settings-layout-CWQI71Tg.js +0 -1
- package/dist/client/assets/store-registry-BCokMLik.js +0 -2
- package/dist/client/assets/tasks-DGTMeQBa.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CM35R0yt.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DWyGwvh9.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _,a0 as Pe,a1 as ze,o as E,b as A,a as ce,I as F,d as Re,a2 as gt,v as jt,R as vt,r as D,j as n,t as Xe,l as O,a3 as re,a4 as yt,a5 as Nt,a6 as St,a7 as kt,a8 as _t,a9 as Pt,aa as z,ab as M,ac as Ze,n as wt,e as It,K as Ct,B as At,ad as Me,ae as $,C as R,af as $t,ag as Le,ah as Tt,m as Ot,ai as zt,L as Mt,E as Dt}from"./index-6GXqHE0w.js";import{u as we,a as Ie,b as et}from"./use-project-scope-DZ9tacAx.js";import{u as Rt}from"./thread-route-CEvVLI2K.js";import{u as Ee,S as Ce,a as Et,b as Ft,c as tt,d as Vt,e as Bt,f as Kt,g as Lt,h as qt}from"./settings-sidebar-BcAe-WS4.js";import{L as le}from"./anchors-yqDzZN4K.js";import{P as st,a as Fe,b as nt}from"./popover-Ci-k968-.js";import{D as Ut,a as Qt,b as Ht}from"./drawer-B5NRhNfW.js";import{A as _e}from"./avatar-CW4PxBuN.js";import{a as Wt}from"./Copy01-DiITYBuR.js";import{n as Jt}from"./Download01-C4blLpML.js";import{i as Yt}from"./Printer-BG6NfeSZ.js";import{i as Gt}from"./Globe01-BVji6jXS.js";import{n as Xt}from"./LinkExternal01-DobnLseV.js";import{g as qe,e as Zt}from"./TrendUp01-DIz6JZwT.js";import{i as ot}from"./Monitor01-BTqHf-K4.js";import{n as es,a as ts}from"./Sun-DjKz3VjB.js";import{a as it}from"./Settings02-DL8f5fN1.js";import{i as ss}from"./Shield01-BsobIEfQ.js";import{t as ns,a as os,i as is,b as as,s as Ve,c as at,d as rs,n as ls,e as rt,f as cs,g as ds,h as ms,j as us}from"./agent-icon-vDfwuZu4.js";import{b as fs}from"./Users03-DWh3D2_T.js";import{u as ps}from"./use-deployment-admin-Dpkh4HgH.js";import{u as xs}from"./use-is-desktop-app-BNujXJc_.js";import{i as bs,a as Ue,D as hs}from"./download-app-dialog-DYhv8XsJ.js";import{I as lt}from"./invite-member-dialog-CsolElt3.js";import{A as gs}from"./add-connection-dialog-BSihy3_s.js";import{u as js}from"./use-deco-credits-DjxZxHMq.js";import{a as vs}from"./use-organization-settings-DrJN-E78.js";import{S as ys}from"./scroll-area-CaE3a4_T.js";import{u as Ns}from"./useInfiniteQuery-CM35R0yt.js";import{n as Ss}from"./decopilot-sse-pool-D2Qtyl-A.js";import{t as ct,S as ks,b as _s,p as Ps,a as ws,i as Is,c as Cs,d as As}from"./task-route-CayeX6cv.js";import{g as $s}from"./get-initials-D-f_fDFw.js";import{a as Ts}from"./format-time-BtXRrtv4.js";import{i as Os}from"./Share07-D1Sv14jA.js";import{e as zs,r as dt,u as Ms,s as Ds,p as Rs,P as Es}from"./use-project-native-view-presence-01L5j4lu.js";import{u as mt}from"./optimistic-project-sidebar-views-DKtRXqQ0.js";import{u as Be}from"./use-navigate-to-agent-Drdqs1cr.js";import{c as Fs}from"./SwitchHorizontal01-BIyO34Jw.js";import{a as Vs}from"./Image01-CpXdMb8x.js";import{u as Bs}from"./use-panel-navigate-CCqZdv2O.js";import{i as Ks}from"./source-system-tabs-CnEGUb4r.js";import{P as Ls}from"./project-icon-DIXBuD-A.js";function qs(){const t=_.c(4),{setScope:e}=we(),s=Rt(),i=Pe();let o;return t[0]!==i||t[1]!==s||t[2]!==e?(o=()=>{const a=s!==void 0?"route_resolves_scope":ze(i,null)?null:"route_needs_scope";E("scope_cleared",{relocated:a!==null,reason:a}),e(null)},t[0]=i,t[1]=s,t[2]=e,t[3]=o):o=t[3],o}function ae(t){const e=_.c(26),{item:s,onClose:i}=t;let o;e[0]!==s.className?(o=O("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",s.className),e[0]=s.className,e[1]=o):o=e[1];const a=o;if(s.href){const u=s.external?"_blank":void 0,d=s.external?"noopener noreferrer":void 0;let f;e[2]!==s.icon?(f=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:s.icon}),e[2]=s.icon,e[3]=f):f=e[3];let x;e[4]!==s.label?(x=n.jsx("span",{className:"flex-1",children:s.label}),e[4]=s.label,e[5]=x):x=e[5];let b;return e[6]!==a||e[7]!==s.href||e[8]!==i||e[9]!==u||e[10]!==d||e[11]!==f||e[12]!==x?(b=n.jsxs("a",{href:s.href,target:u,rel:d,className:a,onClick:i,children:[f,x]}),e[6]=a,e[7]=s.href,e[8]=i,e[9]=u,e[10]=d,e[11]=f,e[12]=x,e[13]=b):b=e[13],b}let r;e[14]!==s||e[15]!==i?(r=()=>{s.onClick?.(),i()},e[14]=s,e[15]=i,e[16]=r):r=e[16];let l;e[17]!==s.icon?(l=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:s.icon}),e[17]=s.icon,e[18]=l):l=e[18];let c;e[19]!==s.label?(c=n.jsx("span",{className:"flex-1",children:s.label}),e[19]=s.label,e[20]=c):c=e[20];let m;return e[21]!==a||e[22]!==r||e[23]!==l||e[24]!==c?(m=n.jsxs("button",{type:"button",onClick:r,className:a,children:[l,c]}),e[21]=a,e[22]=r,e[23]=l,e[24]=c,e[25]=m):m=e[25],m}function Us(){const t=_.c(4),e=A();let s;t[0]!==e?(s=e("common.accountPopover.impersonating"),t[0]=e,t[1]=s):s=t[1];let i;return t[2]!==s?(i=n.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-warning/10 px-2 py-0.5 text-[10px] font-medium text-warning",children:s}),t[2]=s,t[3]=i):i=t[3],i}function Qe(t){const e=_.c(38),{user:s,userImage:i,isImpersonating:o,isMobile:a}=t,r=A(),l=a?"py-4 border-b border-border":"py-3 mx-1 mt-1";let c;e[0]!==l?(c=O("flex items-center gap-3 px-4",l),e[0]=l,e[1]=c):c=e[1];const m=s?.name??"U";let u;e[2]!==m||e[3]!==i?(u=n.jsx(_e,{url:i,fallback:m,shape:"circle",size:"sm",className:"shrink-0"}),e[2]=m,e[3]=i,e[4]=u):u=e[4];let d;e[5]!==r||e[6]!==s?.name?(d=s?.name??r("common.accountPopover.defaultUserName"),e[5]=r,e[6]=s?.name,e[7]=d):d=e[7];let f;e[8]!==d?(f=n.jsx("p",{className:"text-sm font-medium truncate",children:d}),e[8]=d,e[9]=f):f=e[9];let x;e[10]!==o?(x=o&&n.jsx(Us,{}),e[10]=o,e[11]=x):x=e[11];let b;e[12]!==f||e[13]!==x?(b=n.jsxs("div",{className:"flex items-center gap-2",children:[f,x]}),e[12]=f,e[13]=x,e[14]=b):b=e[14];const g=s?.email;let p;e[15]!==g?(p=n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:g}),e[15]=g,e[16]=p):p=e[16];let h;e[17]!==p||e[18]!==b?(h=n.jsxs("div",{className:"flex-1 min-w-0",children:[b,p]}),e[17]=p,e[18]=b,e[19]=h):h=e[19];let j;e[20]!==r||e[21]!==s?(j=()=>{s?.id&&navigator.clipboard.writeText(s.id).then(()=>{Xe.success(r("common.accountPopover.userIdCopied"))})},e[20]=r,e[21]=s,e[22]=j):j=e[22];let v;e[23]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Wt,{size:14}),e[23]=v):v=e[23];let y;e[24]!==j?(y=n.jsx(St,{asChild:!0,children:n.jsx("button",{type:"button",tabIndex:-1,onClick:j,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:v})}),e[24]=j,e[25]=y):y=e[25];let N;e[26]!==r?(N=r("common.accountPopover.copyUserId"),e[26]=r,e[27]=N):N=e[27];let S;e[28]!==N?(S=n.jsx(kt,{side:"right",children:n.jsx("p",{className:"text-xs",children:N})}),e[28]=N,e[29]=S):S=e[29];let k;e[30]!==y||e[31]!==S?(k=n.jsx(_t,{delayDuration:300,children:n.jsxs(Pt,{children:[y,S]})}),e[30]=y,e[31]=S,e[32]=k):k=e[32];let P;return e[33]!==h||e[34]!==k||e[35]!==c||e[36]!==u?(P=n.jsxs("div",{className:c,children:[u,h,k]}),e[33]=h,e[34]=k,e[35]=c,e[36]=u,e[37]=P):P=e[37],P}function He(t){const e=_.c(35),{themeOptions:s,preferences:i,setPreferences:o,isMobile:a}=t,r=A(),l=a?"size-8":"size-7",c=a?"px-3 py-3":"px-2 py-1.5";let m;e[0]!==c?(m=O("flex items-center justify-between border-t border-border/50",c),e[0]=c,e[1]=m):m=e[1];let u;if(e[2]!==l||e[3]!==i.theme||e[4]!==o||e[5]!==s){let N;e[7]!==l||e[8]!==i.theme||e[9]!==o?(N=S=>{const{value:k,icon:P,label:w}=S;return n.jsx("button",{type:"button","aria-label":w,onClick:()=>o(I=>({...I,theme:k})),className:O(l,"rounded-md flex items-center justify-center transition-colors",i.theme===k?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:P},k)},e[7]=l,e[8]=i.theme,e[9]=o,e[10]=N):N=e[10],u=s.map(N),e[2]=l,e[3]=i.theme,e[4]=o,e[5]=s,e[6]=u}else u=e[6];let d;e[11]!==u?(d=n.jsx("div",{className:"flex items-center gap-0.5",children:u}),e[11]=u,e[12]=d):d=e[12];let f;e[13]!==i.enableSounds||e[14]!==r?(f=i.enableSounds?r("common.accountPopover.disableSounds"):r("common.accountPopover.enableSounds"),e[13]=i.enableSounds,e[14]=r,e[15]=f):f=e[15];let x;e[16]!==o?(x=()=>o(Qs),e[16]=o,e[17]=x):x=e[17];const b=i.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let g;e[18]!==l||e[19]!==b?(g=O(l,"rounded-md flex items-center justify-center transition-colors",b),e[18]=l,e[19]=b,e[20]=g):g=e[20];let p;e[21]!==i.enableSounds?(p=i.enableSounds?n.jsx(os,{size:14}):n.jsx(is,{size:14}),e[21]=i.enableSounds,e[22]=p):p=e[22];let h;e[23]!==f||e[24]!==x||e[25]!==g||e[26]!==p?(h=n.jsx("button",{type:"button","aria-label":f,onClick:x,className:g,children:p}),e[23]=f,e[24]=x,e[25]=g,e[26]=p,e[27]=h):h=e[27];let j;e[28]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.363.1"]}),e[28]=j):j=e[28];let v;e[29]!==h?(v=n.jsxs("div",{className:"flex items-center gap-2",children:[h,j]}),e[29]=h,e[30]=v):v=e[30];let y;return e[31]!==v||e[32]!==m||e[33]!==d?(y=n.jsxs("div",{className:m,children:[d,v]}),e[31]=v,e[32]=m,e[33]=d,e[34]=y):y=e[34],y}function Qs(t){return{...t,enableSounds:!t.enableSounds}}function We(t){const e=_.c(54),{user:s,userImage:i,menuItems:o,signOutItem:a,stopImpersonatingItem:r,isImpersonating:l,themeOptions:c,preferences:m,setPreferences:u,close:d,isMobile:f}=t;if(f){let y;e[0]!==l||e[1]!==s||e[2]!==i?(y=n.jsx(Qe,{user:s,userImage:i,isImpersonating:l,isMobile:!0}),e[0]=l,e[1]=s,e[2]=i,e[3]=y):y=e[3];let N;if(e[4]!==d||e[5]!==o){let C;e[7]!==d?(C=T=>n.jsx(ae,{item:T,onClose:d},T.key),e[7]=d,e[8]=C):C=e[8],N=o.map(C),e[4]=d,e[5]=o,e[6]=N}else N=e[6];let S;e[9]!==d||e[10]!==r?(S=r&&n.jsx(ae,{item:r,onClose:d}),e[9]=d,e[10]=r,e[11]=S):S=e[11];let k;e[12]!==d||e[13]!==a?(k=n.jsx(ae,{item:a,onClose:d}),e[12]=d,e[13]=a,e[14]=k):k=e[14];let P;e[15]!==N||e[16]!==S||e[17]!==k?(P=n.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:n.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[N,S,k]})}),e[15]=N,e[16]=S,e[17]=k,e[18]=P):P=e[18];let w;e[19]!==m||e[20]!==u||e[21]!==c?(w=n.jsx(He,{themeOptions:c,preferences:m,setPreferences:u,isMobile:!0}),e[19]=m,e[20]=u,e[21]=c,e[22]=w):w=e[22];let I;return e[23]!==y||e[24]!==P||e[25]!==w?(I=n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[y,P,w]}),e[23]=y,e[24]=P,e[25]=w,e[26]=I):I=e[26],I}let x;e[27]!==l||e[28]!==s||e[29]!==i?(x=n.jsx(Qe,{user:s,userImage:i,isImpersonating:l,isMobile:!1}),e[27]=l,e[28]=s,e[29]=i,e[30]=x):x=e[30];let b;if(e[31]!==d||e[32]!==o){let y;e[34]!==d?(y=N=>n.jsx(ae,{item:N,onClose:d},N.key),e[34]=d,e[35]=y):y=e[35],b=o.map(y),e[31]=d,e[32]=o,e[33]=b}else b=e[33];let g;e[36]!==d||e[37]!==r?(g=r&&n.jsx(ae,{item:r,onClose:d}),e[36]=d,e[37]=r,e[38]=g):g=e[38];let p;e[39]!==d||e[40]!==a?(p=n.jsx(ae,{item:a,onClose:d}),e[39]=d,e[40]=a,e[41]=p):p=e[41];let h;e[42]!==b||e[43]!==g||e[44]!==p?(h=n.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[b,g,p]}),e[42]=b,e[43]=g,e[44]=p,e[45]=h):h=e[45];let j;e[46]!==m||e[47]!==u||e[48]!==c?(j=n.jsx(He,{themeOptions:c,preferences:m,setPreferences:u,isMobile:!1}),e[46]=m,e[47]=u,e[48]=c,e[49]=j):j=e[49];let v;return e[50]!==x||e[51]!==h||e[52]!==j?(v=n.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:n.jsxs("div",{className:"flex flex-col",children:[x,h,j]})}),e[50]=x,e[51]=h,e[52]=j,e[53]=v):v=e[53],v}function De(){const t=_.c(107),e=A(),{data:s}=ce.useSession(),{org:i}=F(),o=Re();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org",shouldThrow:!1},t[0]=a):a=t[0];const l=gt(a)?.params.org,[c,m]=jt(),u=vt(),{isAdmin:d}=ps(),f=xs(),[x,b]=D.useState(!1),[g,p]=D.useState(!1),h=s?.user,j=h?.image,v=!!s?.session?.impersonatedBy;let y;t[1]===Symbol.for("react.memo_cache_sentinel")?(y=()=>b(!1),t[1]=y):y=t[1];const N=y;let S;t[2]!==e?(S=e("common.accountPopover.preferences"),t[2]=e,t[3]=S):S=t[3];let k;t[4]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(it,{size:16}),t[4]=k):k=t[4];let P;t[5]!==o||t[6]!==l?(P=()=>{o({to:"/$org/settings/profile",params:{org:l??""}})},t[5]=o,t[6]=l,t[7]=P):P=t[7];let w;t[8]!==S||t[9]!==P?(w={key:"preferences",label:S,icon:k,onClick:P},t[8]=S,t[9]=P,t[10]=w):w=t[10];let I;t[11]!==i||t[12]!==o?(I=i?[{key:"connect-clients",label:"Connect to Agents",icon:n.jsx(Xt,{size:16}),onClick:()=>{o({to:"/$org/settings/connect",params:{org:i.slug}})}}]:[],t[11]=i,t[12]=o,t[13]=I):I=t[13];let C;t[14]!==f||t[15]!==e?(C=(bs()||Ue())&&!f?[{key:"install-desktop-app",label:Ue()?e("downloadApp.installOnLinux"):e("downloadApp.installOnMac"),icon:n.jsx(Jt,{size:16}),onClick:()=>p(!0)}]:[],t[14]=f,t[15]=e,t[16]=C):C=t[16];let T;t[17]!==e?(T=e("common.accountPopover.termsOfUse"),t[17]=e,t[18]=T):T=t[18];let V;t[19]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(Yt,{size:16}),t[19]=V):V=t[19];let B;t[20]!==T?(B={key:"terms",label:T,icon:V,href:"https://www.decocms.com/terms-of-use",external:!0},t[20]=T,t[21]=B):B=t[21];let K;t[22]!==e?(K=e("common.accountPopover.privacyPolicy"),t[22]=e,t[23]=K):K=t[23];let de;t[24]===Symbol.for("react.memo_cache_sentinel")?(de=n.jsx(ss,{size:16}),t[24]=de):de=t[24];let L;t[25]!==K?(L={key:"privacy",label:K,icon:de,href:"https://www.decocms.com/privacy-policy",external:!0},t[25]=K,t[26]=L):L=t[26];let q;t[27]!==e?(q=e("common.accountPopover.githubRepo"),t[27]=e,t[28]=q):q=t[28];let me;t[29]===Symbol.for("react.memo_cache_sentinel")?(me=n.jsx(yt,{className:"w-4 h-4"}),t[29]=me):me=t[29];let U;t[30]!==q?(U={key:"github",label:q,icon:me,href:"https://github.com/decocms/studio",external:!0},t[30]=q,t[31]=U):U=t[31];let Q;t[32]!==e?(Q=e("common.accountPopover.community"),t[32]=e,t[33]=Q):Q=t[33];let ue;t[34]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(fs,{size:16}),t[34]=ue):ue=t[34];let H;t[35]!==Q?(H={key:"community",label:Q,icon:ue,href:"https://decocms.com/discord",external:!0},t[35]=Q,t[36]=H):H=t[36];let W;t[37]!==e?(W=e("common.accountPopover.homepage"),t[37]=e,t[38]=W):W=t[38];let fe;t[39]===Symbol.for("react.memo_cache_sentinel")?(fe=n.jsx(Gt,{size:16}),t[39]=fe):fe=t[39];let J;t[40]!==W?(J={key:"homepage",label:W,icon:fe,href:"https://decocms.com",external:!0},t[40]=W,t[41]=J):J=t[41];let Y;t[42]!==d||t[43]!==o||t[44]!==e?(Y=d?[{key:"admin-dashboard",label:e("common.accountPopover.adminDashboard"),icon:n.jsx(ns,{size:16}),onClick:()=>o({to:"/_admin"}),className:"text-warning"}]:[],t[42]=d,t[43]=o,t[44]=e,t[45]=Y):Y=t[45];let pe;t[46]!==B||t[47]!==L||t[48]!==U||t[49]!==H||t[50]!==J||t[51]!==Y||t[52]!==w||t[53]!==I||t[54]!==C?(pe=[w,...I,...C,B,L,U,H,J,...Y],t[46]=B,t[47]=L,t[48]=U,t[49]=H,t[50]=J,t[51]=Y,t[52]=w,t[53]=I,t[54]=C,t[55]=pe):pe=t[55];const Ae=pe;let G;t[56]!==e?(G=e("common.accountPopover.signOut"),t[56]=e,t[57]=G):G=t[57];let xe;t[58]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx(qe,{size:16}),t[58]=xe):xe=t[58];let be;t[59]!==G?(be={key:"logout",label:G,icon:xe,onClick:Ws},t[59]=G,t[60]=be):be=t[60];const $e=be;let he;t[61]!==v||t[62]!==e?(he=v?{key:"stop-impersonating",label:e("common.accountPopover.stopImpersonation"),icon:n.jsx(qe,{size:16}),onClick:async()=>{const{error:Ke}=await ce.admin.stopImpersonating();if(Ke){Xe.error(Ke.message||e("common.accountPopover.failedToStopImpersonation"));return}window.location.href="/"},className:"text-warning"}:null,t[61]=v,t[62]=e,t[63]=he):he=t[63];const Te=he;let ge;t[64]===Symbol.for("react.memo_cache_sentinel")?(ge=n.jsx(es,{size:14}),t[64]=ge):ge=t[64];let X;t[65]!==e?(X=e("common.accountPopover.lightTheme"),t[65]=e,t[66]=X):X=t[66];let Z;t[67]!==X?(Z={value:"light",icon:ge,label:X},t[67]=X,t[68]=Z):Z=t[68];let je;t[69]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(ts,{size:14}),t[69]=je):je=t[69];let ee;t[70]!==e?(ee=e("common.accountPopover.darkTheme"),t[70]=e,t[71]=ee):ee=t[71];let te;t[72]!==ee?(te={value:"dark",icon:je,label:ee},t[72]=ee,t[73]=te):te=t[73];let ve;t[74]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(ot,{size:14}),t[74]=ve):ve=t[74];let se;t[75]!==e?(se=e("common.accountPopover.systemTheme"),t[75]=e,t[76]=se):se=t[76];let ne;t[77]!==se?(ne={value:"system",icon:ve,label:se},t[77]=se,t[78]=ne):ne=t[78];let ye;t[79]!==Z||t[80]!==te||t[81]!==ne?(ye=[Z,te,ne],t[79]=Z,t[80]=te,t[81]=ne,t[82]=ye):ye=t[82];const Oe=ye;let Ne;t[83]!==v||t[84]!==u||t[85]!==Ae||t[86]!==c||t[87]!==m||t[88]!==$e||t[89]!==Te||t[90]!==Oe||t[91]!==h||t[92]!==j?(Ne={user:h,userImage:j,menuItems:Ae,signOutItem:$e,stopImpersonatingItem:Te,isImpersonating:v,themeOptions:Oe,preferences:c,setPreferences:m,close:N,isMobile:u},t[83]=v,t[84]=u,t[85]=Ae,t[86]=c,t[87]=m,t[88]=$e,t[89]=Te,t[90]=Oe,t[91]=h,t[92]=j,t[93]=Ne):Ne=t[93];const Se=Ne;let oe;t[94]!==v||t[95]!==u||t[96]!==x||t[97]!==Se||t[98]!==e||t[99]!==h?.name||t[100]!==j?(oe=u?n.jsxs(Ut,{open:x,onOpenChange:b,direction:"bottom",children:[n.jsxs("button",{type:"button",onClick:()=>b(!0),className:O("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",v&&"border-2 border-dashed border-warning"),children:[n.jsx(_e,{url:j,fallback:h?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),n.jsx("span",{className:"truncate",children:h?.name??e("common.accountPopover.defaultAccountLabel")})]}),n.jsxs(Qt,{className:"h-[80dvh] p-0",children:[n.jsx(Ht,{className:"sr-only",children:e("common.accountPopover.account")}),n.jsx(We,{...Se})]})]}):n.jsxs(st,{open:x,onOpenChange:b,children:[n.jsx(Fe,{asChild:!0,children:n.jsxs(re,{"data-tour":le.account,tooltip:h?.name??e("common.accountPopover.defaultAccountLabel"),className:O("rounded-md",v&&"border-2 border-dashed border-warning"),children:[n.jsx(_e,{url:j,fallback:h?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),n.jsx("span",{className:"truncate",children:h?.name??e("common.accountPopover.defaultAccountLabel")})]})}),n.jsx(nt,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Hs,children:n.jsx(We,{...Se})})]}),t[94]=v,t[95]=u,t[96]=x,t[97]=Se,t[98]=e,t[99]=h?.name,t[100]=j,t[101]=oe):oe=t[101];let ie;t[102]!==g?(ie=n.jsx(hs,{open:g,onOpenChange:p}),t[102]=g,t[103]=ie):ie=t[103];let ke;return t[104]!==oe||t[105]!==ie?(ke=n.jsxs(n.Fragment,{children:[oe,ie]}),t[104]=oe,t[105]=ie,t[106]=ke):ke=t[106],ke}function Hs(t){return t.preventDefault()}function Ws(){E("signed_out",{source:"account_popover"}),Nt(),ce.signOut()}class Js extends D.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,s){}render(){return this.state.hasError?null:this.props.children}}function Ys(t){return t<=1?"text-destructive":t<=5?"text-warning":"text-foreground/70"}function Gs(){const t=_.c(17),e=Re(),{org:s}=F(),{hasDecoKey:i,balanceDollars:o}=js();if(!i)return null;let a;t[0]!==o?(a=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=a):a=t[1];let r;t[2]!==o?(r=O(o!=null&&Ys(o)),t[2]=o,t[3]=r):r=t[3];let l;t[4]!==e||t[5]!==s.slug?(l=()=>e({to:"/$org/settings/ai-providers",params:{org:s.slug}}),t[4]=e,t[5]=s.slug,t[6]=l):l=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(as,{}),t[7]=c):c=t[7];let m;t[8]!==o?(m=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,t[9]=m):m=t[9];let u;t[10]!==m?(u=n.jsx("span",{children:m}),t[10]=m,t[11]=u):u=t[11];let d;return t[12]!==a||t[13]!==r||t[14]!==l||t[15]!==u?(d=n.jsx(z,{children:n.jsx(M,{children:n.jsxs(re,{tooltip:a,className:r,onClick:l,children:[c,u]})})}),t[12]=a,t[13]=r,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function Je(){const t=_.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Js,{children:n.jsx(D.Suspense,{fallback:null,children:n.jsx(Gs,{})})}),t[0]=e):e=t[0],e}const Xs=6e4;function Zs(t,e){return t.call("NOTIFICATION_LIST",e?{cursor:e}:{})}function en(t,e){if(!t)return t;const s=e?new Set(e):null;let i=0;const o=t.pages.map(r=>{const l=r.notifications.filter(c=>s&&!s.has(c.id)?!0:(i++,!1));return{...r,notifications:l}}),a=s?Math.max(0,(t.pages[0]?.unreadCount??0)-i):0;return{...t,pages:o.map(r=>({...r,unreadCount:a}))}}function tn(t,e){const s=_.c(4),{data:i}=ce.useSession(),o=i?.user?.id;let a;s[0]!==e||s[1]!==t||s[2]!==o?(a=r=>!t||!o?on:Ss.subscribe(t,c=>{try{if(JSON.parse(c.data).subject!==o)return}catch{return}e(),r()},e),s[0]=e,s[1]=t,s[2]=o,s[3]=a):a=s[3],D.useSyncExternalStore(a,nn,sn)}function sn(){return 0}function nn(){return 0}function on(){}function ut(){const t=_.c(37),{locator:e,org:s}=F(),i=Ze(),o=wt();let a;t[0]!==e?(a=Ct.notifications(e),t[0]=e,t[1]=a):a=t[1];const r=a;let l;t[2]!==i?(l=P=>{const{pageParam:w}=P;return Zs(i,w)},t[2]=i,t[3]=l):l=t[3];let c;t[4]!==r||t[5]!==l?(c={queryKey:r,queryFn:l,initialPageParam:void 0,getNextPageParam:ln,refetchInterval:Xs},t[4]=r,t[5]=l,t[6]=c):c=t[6];const m=Ns(c);let u;t[7]!==o||t[8]!==r?(u=()=>o.invalidateQueries({queryKey:r,refetchType:"active"}),t[7]=o,t[8]=r,t[9]=u):u=t[9],tn(s.slug,u);let d;t[10]!==i?(d=P=>i.call("NOTIFICATION_MARK_READ",P?{ids:P}:{}),t[10]=i,t[11]=d):d=t[11];let f,x;t[12]!==o||t[13]!==r?(f=async P=>{await o.cancelQueries({queryKey:r}),o.setQueryData(r,w=>en(w,P))},x=()=>o.invalidateQueries({queryKey:r}),t[12]=o,t[13]=r,t[14]=f,t[15]=x):(f=t[14],x=t[15]);let b;t[16]!==d||t[17]!==f||t[18]!==x?(b={mutationFn:d,onMutate:f,onSettled:x},t[16]=d,t[17]=f,t[18]=x,t[19]=b):b=t[19];const g=It(b);let p;t[20]!==m.data?.pages?(p=m.data?.pages??[],t[20]=m.data?.pages,t[21]=p):p=t[21];const h=p;let j;t[22]!==h?(j=h.flatMap(an),t[22]=h,t[23]=j):j=t[23];const v=h[0]?.unreadCount??0;let y;t[24]!==m?(y=()=>{m.hasNextPage&&!m.isFetchingNextPage&&m.fetchNextPage()},t[24]=m,t[25]=y):y=t[25];let N,S;t[26]!==g?(N=()=>g.mutate(null),S=P=>g.mutate([P]),t[26]=g,t[27]=N,t[28]=S):(N=t[27],S=t[28]);let k;return t[29]!==m.hasNextPage||t[30]!==m.isFetchingNextPage||t[31]!==v||t[32]!==y||t[33]!==N||t[34]!==S||t[35]!==j?(k={updates:j,redDotCount:v,hasMore:m.hasNextPage,isFetchingMore:m.isFetchingNextPage,fetchMore:y,markAllRead:N,markRead:S},t[29]=m.hasNextPage,t[30]=m.isFetchingNextPage,t[31]=v,t[32]=y,t[33]=N,t[34]=S,t[35]=j,t[36]=k):k=t[36],k}function an(t){return t.notifications.map(rn)}function rn(t){return{id:t.id,taskBoardItemId:t.taskBoardItemId,taskTitle:t.taskTitle,taskKeySeq:t.taskKeySeq,action:t.type,actorName:t.actorName,actorImage:t.actorImage,occurredAt:t.createdAt}}function ln(t){return t.nextCursor??void 0}function cn(t){switch(t){case"mentioned":case"review_requested":return"font-medium text-foreground";case"merge_failed":case"review_changes_requested":return"font-medium text-destructive";case"review_approved":return"font-medium text-success";default:return""}}function dn(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");default:{const s=t.action;return String(s)}}}function mn(t){const e=_.c(36),{update:s,orgSlug:i,onSelect:o}=t,a=A();let r;e[0]!==i||e[1]!==s.taskKeySeq?(r=ct(i,s.taskKeySeq),e[0]=i,e[1]=s.taskKeySeq,e[2]=r):r=e[2];const l=r,c=!s.actorName;let m;e[3]!==c||e[4]!==s.actorImage||e[5]!==s.actorName?(m=n.jsx("span",{className:"mt-0.5 shrink-0",children:c?n.jsx(ks,{size:24}):n.jsx(_e,{url:s.actorImage??void 0,fallback:$s(s.actorName??void 0),shape:"circle",size:"xs"})}),e[3]=c,e[4]=s.actorImage,e[5]=s.actorName,e[6]=m):m=e[6];let u;e[7]!==s.taskTitle?(u=n.jsx("p",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:s.taskTitle}),e[7]=s.taskTitle,e[8]=u):u=e[8];let d;e[9]!==s.occurredAt?(d=Ts(new Date(s.occurredAt)),e[9]=s.occurredAt,e[10]=d):d=e[10];let f;e[11]!==d?(f=n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground/70",children:d}),e[11]=d,e[12]=f):f=e[12];let x;e[13]!==u||e[14]!==f?(x=n.jsxs("div",{className:"flex items-baseline gap-2",children:[u,f]}),e[13]=u,e[14]=f,e[15]=x):x=e[15];let b;e[16]!==l?(b=l&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"font-medium",children:l})," · "]}),e[16]=l,e[17]=b):b=e[17];let g;e[18]!==s.action?(g=O(cn(s.action)),e[18]=s.action,e[19]=g):g=e[19];let p;e[20]!==a||e[21]!==s?(p=dn(s,a),e[20]=a,e[21]=s,e[22]=p):p=e[22];let h;e[23]!==g||e[24]!==p?(h=n.jsx("span",{className:g,children:p}),e[23]=g,e[24]=p,e[25]=h):h=e[25];let j;e[26]!==h||e[27]!==b?(j=n.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[b,h]}),e[26]=h,e[27]=b,e[28]=j):j=e[28];let v;e[29]!==j||e[30]!==x?(v=n.jsxs("div",{className:"min-w-0 flex-1",children:[x,j]}),e[29]=j,e[30]=x,e[31]=v):v=e[31];let y;return e[32]!==o||e[33]!==v||e[34]!==m?(y=n.jsxs("button",{type:"button",onClick:o,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-muted/25",children:[m,v]}),e[32]=o,e[33]=v,e[34]=m,e[35]=y):y=e[35],y}function un(t){const e=_.c(2),{onReach:s}=t;let i;return e[0]!==s?(i=n.jsx("div",{className:"h-8 shrink-0",ref:o=>{if(!o)return;const a=new IntersectionObserver(r=>{r.some(fn)&&s()});return a.observe(o),()=>a.disconnect()}}),e[0]=s,e[1]=i):i=e[1],i}function fn(t){return t.isIntersecting}function pn(t){const e=_.c(23),{onClose:s}=t,i=A(),o=Re(),{org:a}=F(),{updates:r,markAllRead:l,markRead:c,hasMore:m,fetchMore:u}=ut();let d;e[0]!==i?(d=i("sidebar.inbox.title"),e[0]=i,e[1]=d):d=e[1];let f;e[2]!==d?(f=n.jsx("h3",{className:"text-sm font-medium",children:d}),e[2]=d,e[3]=f):f=e[3];let x;e[4]!==l||e[5]!==i||e[6]!==r.length?(x=r.length>0&&n.jsx(At,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs text-muted-foreground",onClick:l,children:i("sidebar.inbox.markAllRead")}),e[4]=l,e[5]=i,e[6]=r.length,e[7]=x):x=e[7];let b;e[8]!==f||e[9]!==x?(b=n.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-4 py-3",children:[f,x]}),e[8]=f,e[9]=x,e[10]=b):b=e[10];let g;e[11]!==u||e[12]!==m||e[13]!==c||e[14]!==o||e[15]!==s||e[16]!==a||e[17]!==i||e[18]!==r?(g=r.length===0?n.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 py-10 text-center",children:[n.jsx(Ve,{size:24,className:"text-muted-foreground/50"}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:i("sidebar.inbox.emptyTitle")}),n.jsx("p",{className:"text-xs text-muted-foreground",children:i("sidebar.inbox.emptyBody")})]}):n.jsxs(ys,{className:"min-h-0 flex-1",children:[r.map(h=>{const j=ct(a.slug,h.taskKeySeq);return n.jsx(mn,{update:h,orgSlug:a.slug,onSelect:()=>{c(h.id),s(),j&&o({to:"/$org/tasks/{-$taskKey}",params:{org:a.slug,taskKey:j}})}},h.id)}),m&&n.jsx(un,{onReach:u})]}),e[11]=u,e[12]=m,e[13]=c,e[14]=o,e[15]=s,e[16]=a,e[17]=i,e[18]=r,e[19]=g):g=e[19];let p;return e[20]!==b||e[21]!==g?(p=n.jsxs(n.Fragment,{children:[b,g]}),e[20]=b,e[21]=g,e[22]=p):p=e[22],p}function ft(){const t=_.c(1),{redDotCount:e}=ut();if(e===0)return null;let s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("span",{className:"pointer-events-none absolute top-1 right-1 size-2 rounded-full bg-destructive"}),t[0]=s):s=t[0],s}function pt(t){const e=_.c(10),{open:s,onOpenChange:i,children:o}=t;let a;e[0]!==i||e[1]!==s?(a=s&&n.jsx(pn,{onClose:()=>i(!1)}),e[0]=i,e[1]=s,e[2]=a):a=e[2];let r;e[3]!==a?(r=n.jsx(nt,{side:"right",align:"end",sideOffset:12,collisionPadding:16,className:"flex max-h-[min(650px,calc(100dvh-4rem))] w-[min(400px,calc(100vw-2rem))] flex-col p-0",children:a}),e[3]=a,e[4]=r):r=e[4];let l;return e[5]!==o||e[6]!==i||e[7]!==s||e[8]!==r?(l=n.jsxs(st,{open:s,onOpenChange:i,children:[o,r]}),e[5]=o,e[6]=i,e[7]=s,e[8]=r,e[9]=l):l=e[9],l}function xt(){const t=_.c(9),e=A(),[s,i]=D.useState(!1);let o;t[0]!==e?(o=e("sidebar.inbox.title"),t[0]=e,t[1]=o):o=t[1];let a,r;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ve,{size:15}),r=n.jsx(ft,{}),t[2]=a,t[3]=r):(a=t[2],r=t[3]);let l;t[4]!==o?(l=n.jsx(Fe,{asChild:!0,children:n.jsxs("button",{type:"button","aria-label":o,className:"relative flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[a,r]})}),t[4]=o,t[5]=l):l=t[5];let c;return t[6]!==s||t[7]!==l?(c=n.jsx(pt,{open:s,onOpenChange:i,children:l}),t[6]=s,t[7]=l,t[8]=c):c=t[8],c}function xn(){const t=_.c(15),e=A(),[s,i]=D.useState(!1),o=Ee();let a;t[0]!==o||t[1]!==e?(a=o?e("sidebar.inbox.title"):void 0,t[0]=o,t[1]=e,t[2]=a):a=t[2];let r,l;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ve,{}),l=n.jsx(ft,{}),t[3]=r,t[4]=l):(r=t[3],l=t[4]);let c;t[5]!==e?(c=e("sidebar.inbox.title"),t[5]=e,t[6]=c):c=t[6];let m;t[7]!==c?(m=n.jsx("span",{className:"truncate",children:c}),t[7]=c,t[8]=m):m=t[8];let u;t[9]!==a||t[10]!==m?(u=n.jsx(Fe,{asChild:!0,children:n.jsxs(re,{tooltip:a,className:"relative",children:[r,l,m]})}),t[9]=a,t[10]=m,t[11]=u):u=t[11];let d;return t[12]!==s||t[13]!==u?(d=n.jsx(pt,{open:s,onOpenChange:i,children:u}),t[12]=s,t[13]=u,t[14]=d):d=t[14],d}function Ye(){const t=_.c(29),e=A(),[s,i]=D.useState(!1);let o;t[0]!==e?(o=e("sidebar.sidebarFooter.inviteMembers"),t[0]=e,t[1]=o):o=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(at,{}),t[2]=a):a=t[2];let r;t[3]!==e?(r=e("sidebar.sidebarFooter.inviteMembers"),t[3]=e,t[4]=r):r=t[4];let l;t[5]!==r?(l=n.jsx("span",{children:r}),t[5]=r,t[6]=l):l=t[6];let c;t[7]!==o||t[8]!==l?(c=n.jsx(M,{children:n.jsx(lt,{trigger:n.jsxs(re,{tooltip:o,children:[a,l]})})}),t[7]=o,t[8]=l,t[9]=c):c=t[9];let m;t[10]!==e?(m=e("sidebar.sidebarFooter.addConnection"),t[10]=e,t[11]=m):m=t[11];let u,d;t[12]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i(!0),d=n.jsx(rs,{}),t[12]=u,t[13]=d):(u=t[12],d=t[13]);let f;t[14]!==e?(f=e("sidebar.sidebarFooter.addConnection"),t[14]=e,t[15]=f):f=t[15];let x;t[16]!==f?(x=n.jsx("span",{children:f}),t[16]=f,t[17]=x):x=t[17];let b;t[18]!==m||t[19]!==x?(b=n.jsx(M,{children:n.jsxs(re,{tooltip:m,onClick:u,children:[d,x]})}),t[18]=m,t[19]=x,t[20]=b):b=t[20];let g;t[21]!==b||t[22]!==c?(g=n.jsxs(z,{className:"gap-0.5",children:[c,b]}),t[21]=b,t[22]=c,t[23]=g):g=t[23];let p;t[24]!==s?(p=s&&n.jsx(gs,{open:s,onOpenChange:i,mode:"browse"}),t[24]=s,t[25]=p):p=t[25];let h;return t[26]!==g||t[27]!==p?(h=n.jsxs(n.Fragment,{children:[g,p]}),t[26]=g,t[27]=p,t[28]=h):h=t[28],h}function Ge(){const t=_.c(10),e=A();let s;t[0]!==e?(s=e("sidebar.sidebarFooter.inviteMembers"),t[0]=e,t[1]=s):s=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(at,{}),t[2]=i):i=t[2];let o;t[3]!==e?(o=e("sidebar.sidebarFooter.inviteMembers"),t[3]=e,t[4]=o):o=t[4];let a;t[5]!==o?(a=n.jsx("span",{children:o}),t[5]=o,t[6]=a):a=t[6];let r;return t[7]!==s||t[8]!==a?(r=n.jsx(z,{className:"gap-0.5",children:n.jsx(M,{children:n.jsx(lt,{trigger:n.jsxs(re,{tooltip:s,children:[i,a]})})})}),t[7]=s,t[8]=a,t[9]=r):r=t[9],r}function bn(){const t=_.c(17),e=Ee(),s=vs(),i=!s;if(e){let c;t[0]!==i?(c=i&&n.jsx(Je,{}),t[0]=i,t[1]=c):c=t[1];let m;t[2]!==s?(m=s?n.jsx(Ge,{}):n.jsx(Ye,{}),t[2]=s,t[3]=m):m=t[3];let u;t[4]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(M,{children:n.jsx(xn,{})}),t[4]=u):u=t[4];let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsxs(z,{children:[u,n.jsx(M,{children:n.jsx(De,{})})]}),t[5]=d):d=t[5];let f;return t[6]!==c||t[7]!==m?(f=n.jsxs(Me,{className:"px-2 pb-3 gap-1",children:[c,m,d]}),t[6]=c,t[7]=m,t[8]=f):f=t[8],f}let o;t[9]!==i?(o=i&&n.jsx(Je,{}),t[9]=i,t[10]=o):o=t[10];let a;t[11]!==s?(a=s?n.jsx(Ge,{}):n.jsx(Ye,{}),t[11]=s,t[12]=a):a=t[12];let r;t[13]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(z,{className:"gap-0.5",children:n.jsx(M,{children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(De,{})}),n.jsx(xt,{})]})})}),t[13]=r):r=t[13];let l;return t[14]!==o||t[15]!==a?(l=n.jsxs(Me,{className:"px-2 pb-3 gap-0.5",children:[o,a,r]}),t[14]=o,t[15]=a,t[16]=l):l=t[16],l}function hn(){const t=_.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Me,{className:"px-2 pb-3",children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(z,{children:n.jsx(M,{children:n.jsx(De,{})})})}),n.jsx(xt,{})]})}),t[0]=e):e=t[0],e}const gn="settings",jn=["overview","reports","board","files"];function vn(t,e){return!t||!e?!1:!et(e.metadata)}function yn(t,e,s,i){if(!t||!e)return!0;const o=i!==void 0;return zs(o?i:dt(e.metadata),o?1:e.metadata?.sidebarViewsVersion).includes(s)}function Nn(){const t=_.c(16),e=A(),{org:s}=F(),i=Pe(),o=Ie(),{project:a,repo:r}=we(),l=mt(a?.id);let c;t[0]!==a||t[1]!==o?(c=vn(o,a),t[0]=a,t[1]=o,t[2]=c):c=t[2];const m=c;let u;t[3]!==l||t[4]!==a||t[5]!==o?(u=x=>yn(o,a,x,l),t[3]=l,t[4]=a,t[5]=o,t[6]=u):u=t[6];const d=u;let f;if(t[7]!==d||t[8]!==m||t[9]!==i||t[10]!==s||t[11]!==a?.id||t[12]!==r||t[13]!==o||t[14]!==e){const x={overview:m||!d("overview")?null:{key:"overview",label:e("sidebar.navDestinations.home"),icon:n.jsx(cs,{size:16}),isActive:i===$.home||i===$.orgIndex||i===R.root||i===`${R.root}/`,trackAs:"overview",link:o?{to:R.root,params:{org:s.slug,agentId:o}}:{to:$.home,params:{org:s.slug}}},reports:ze($.reports,o)&&!m&&d("reports")?{key:"reports",label:e("sidebar.navDestinations.reports"),icon:n.jsx(rt,{size:16}),isActive:i===$.reports||i===R.reports,trackAs:"reports",link:o?{to:R.reports,params:{org:s.slug,agentId:o}}:{to:$.reports,params:{org:s.slug}}}:null,board:m||!d("board")?null:{key:"board",label:e("sidebar.navDestinations.tasks"),icon:n.jsx(ls,{size:16}),isActive:i===$.tasks||i===R.tasks,trackAs:"board",dataTour:le.tasks,link:{to:o?R.tasks:$.tasks,params:{org:s.slug,agentId:o??void 0,taskKey:void 0},search:b=>{const g=r??a?.id;return g?{...b,repo:g}:b}}},files:ze($.library,o)?{key:"files",label:e("sidebar.navDestinations.library"),icon:n.jsx(Os,{size:16}),isActive:i===$.library,trackAs:"files",link:{to:$.library,params:{org:s.slug}}}:null};f=jn.map(b=>x[b]).filter(Sn),t[7]=d,t[8]=m,t[9]=i,t[10]=s,t[11]=a?.id,t[12]=r,t[13]=o,t[14]=e,t[15]=f}else f=t[15];return f}function Sn(t){return t!==null}function kn(t){const e=_.c(7),{onNavigate:s}=t,i=Nn();let o;if(e[0]!==i||e[1]!==s){let r;e[3]!==s?(r=l=>n.jsx(Ce,{icon:l.icon,label:l.label,dataTour:l.dataTour,isActive:l.isActive,link:l.link,onSelect:()=>{E("nav_destination_clicked",{destination:l.trackAs}),s?.()}},l.key),e[3]=s,e[4]=r):r=e[4],o=i.map(r),e[0]=i,e[1]=s,e[2]=o}else o=e[2];let a;return e[5]!==o?(a=n.jsx(z,{className:"gap-1",children:o}),e[5]=o,e[6]=a):a=e[6],a}function _n(t){const e=_.c(18),{onNavigate:s}=t,i=A(),{org:o}=F(),a=Ie(),r=Be(),l=Pe(),c=$t();let m;e[0]!==c||e[1]!==l?(m=l.startsWith("/$org/settings")||l.startsWith($.projects)&&c==="settings",e[0]=c,e[1]=l,e[2]=m):m=e[2];const u=m;let d;e[3]!==i?(d=i("sidebar.navDestinations.settings"),e[3]=i,e[4]=d):d=e[4];const f=d;let x;e[5]!==o||e[6]!==a?(x=a?void 0:{to:"/$org/settings",params:{org:o.slug}},e[5]=o,e[6]=a,e[7]=x):x=e[7];const b=x;let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(it,{size:16}),e[8]=g):g=e[8];let p;e[9]!==r||e[10]!==s||e[11]!==a?(p=()=>{E("nav_destination_clicked",{destination:gn,target:a?"project":"org"}),a&&r(a,{panel:"settings"}),s?.()},e[9]=r,e[10]=s,e[11]=a,e[12]=p):p=e[12];let h;return e[13]!==u||e[14]!==f||e[15]!==b||e[16]!==p?(h=n.jsx(z,{className:"gap-1",children:n.jsx(Ce,{dataTour:le.settings,icon:g,label:f,isActive:u,link:b,onSelect:p})}),e[13]=u,e[14]=f,e[15]=b,e[16]=p,e[17]=h):h=e[17],h}function Pn(t,e){const s=new Set(e);return s.size===0?t:t.filter(i=>s.has(i.connectionId))}function wn(t){const e=t.metadata?.ui;return Array.isArray(e?.pinnedViews)?e.pinnedViews.filter(s=>!!s&&typeof s=="object"&&typeof s.connectionId=="string"&&typeof s.toolName=="string"):[]}function In(t){const e=_.c(12),{onNavigate:s}=t,i=A(),{project:o}=we(),a=Be(),r=Pe(),l=Bs(),c=Ms(o),m=mt(o?.id);if(!o)return null;let u;if(e[0]!==c.presence||e[1]!==m||e[2]!==o.metadata){const x=et(o.metadata),b=m??dt(o.metadata);u=new Set(Ds(b,Rs(x,c.presence),m!==void 0?1:o.metadata.sidebarViewsVersion)),e[0]=c.presence,e[1]=m,e[2]=o.metadata,e[3]=u}else u=e[3];const d=u;let f;if(e[4]!==l||e[5]!==r||e[6]!==a||e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==i){const x=[];d.has("site-editor")&&x.push({key:"site-editor",label:i("sidebar.projectNav.siteEditor"),icon:n.jsx(ot,{size:16}),panel:"site-editor",isActive:$n,dataTour:le.siteEditor});const b={assets:{label:i("common.mainPanelTabs.assets"),icon:n.jsx(Vs,{size:16})},hosting:{label:i("common.mainPanelTabs.hosting"),icon:n.jsx(us,{size:16})},e2e:{label:i("common.mainPanelTabs.e2e"),icon:n.jsx(Zt,{size:16})},analytics:{label:i("common.mainPanelTabs.analytics"),icon:n.jsx(rt,{size:16})},cdn:{label:i("common.mainPanelTabs.cdn"),icon:n.jsx(ms,{size:16})}};for(const p of Es){if(!d.has(p))continue;const h=b[p];x.push({key:p,label:h.label,icon:h.icon,panel:p,isActive:j=>j===p})}for(const p of Pn(wn(o),(o.connections??[]).map(An)))p.toolName!=="fetch_assets"&&x.push({key:`pinned:${p.connectionId}:${p.toolName}`,label:p.label||p.toolName,icon:p.icon?n.jsx("img",{src:p.icon,alt:"",className:"size-4 rounded-[3px]"}):n.jsx(Fs,{size:16}),panel:Le(p.connectionId,p.toolName),isActive:h=>h===Le(p.connectionId,p.toolName)});d.has("automations")&&x.push({key:"automations",label:i("sidebar.projectNav.automations"),icon:n.jsx(ds,{size:16}),panel:"automations",isActive:Cn,dataTour:le.automations});const g=r.startsWith($.projects);f=n.jsx(z,{className:"gap-1",children:x.map(p=>n.jsx(Ce,{icon:p.icon,label:p.label,dataTour:p.dataTour,isActive:g&&p.isActive(l),onSelect:()=>{E("project_nav_clicked",{surface:p.key}),a(o.id,{panel:p.panel}),s?.()}},p.key))}),e[4]=l,e[5]=r,e[6]=a,e[7]=s,e[8]=o,e[9]=d,e[10]=i,e[11]=f}else f=e[11];return f}function Cn(t){return t==="automations"||Tt(t)!==null}function An(t){return t.connection_id}function $n(t){return!!t&&Ks(t)}const Tn=3;function On(t,e){return t.status==="archived"||t.status==="done"?!1:e&&t.assigneeId===e?!0:Is(t)||Cs(t)}function zn(t,e,s){const i=new Map;for(const a of e){if(!On(a,s))continue;const r=Ps(a,t);for(const l of r){const c=i.get(l.id)??[];c.push({task:a,only:r.length===1}),i.set(l.id,c)}}const o=new Map;for(const[a,r]of i)r.sort((l,c)=>Number(c.only)-Number(l.only)||(c.task.updatedAt??"").localeCompare(l.task.updatedAt??"")),o.set(a,r.slice(0,Tn).map(l=>l.task));return o}function Mn(t){const e=_.c(21),{task:s,orgSlug:i,isLast:o,onNavigate:a}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.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 l;e[1]!==o?(l=!o&&n.jsx("span",{"aria-hidden":"true",className:"absolute top-1/2 bottom-0 left-4 border-l border-sidebar-border"}),e[1]=o,e[2]=l):l=e[2];let c;e[3]!==i||e[4]!==s?(c=ws(i,s),e[3]=i,e[4]=s,e[5]=c):c=e[5];let m;e[6]!==i||e[7]!==c?(m={org:i,taskKey:c},e[6]=i,e[7]=c,e[8]=m):m=e[8];let u;e[9]!==a||e[10]!==s.status?(u=()=>{E("sidebar_attention_task_clicked",{status:s.status}),a?.()},e[9]=a,e[10]=s.status,e[11]=u):u=e[11];let d;e[12]!==s.title?(d=n.jsx("span",{className:"truncate",children:s.title}),e[12]=s.title,e[13]=d):d=e[13];let f;e[14]!==m||e[15]!==u||e[16]!==d?(f=n.jsx(Mt,{to:"/$org/tasks/{-$taskKey}",params:m,onClick:u,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:d}),e[14]=m,e[15]=u,e[16]=d,e[17]=f):f=e[17];let x;return e[18]!==l||e[19]!==f?(x=n.jsxs("li",{className:"relative",children:[r,l,f]}),e[18]=l,e[19]=f,e[20]=x):x=e[20],x}function Dn(t){const e=_.c(35),{onNavigate:s}=t,i=A(),o=Ee(),{org:a,locator:r}=F(),l=Ze(),{projects:c}=we(),m=Ie(),u=Be(),{data:d}=ce.useSession();let f;e[0]!==r||e[1]!==l?(f=As(r,l),e[0]=r,e[1]=l,e[2]=f):f=e[2];const x=!o&&!m;let b;e[3]!==f||e[4]!==x?(b={...f,enabled:x},e[3]=f,e[4]=x,e[5]=b):b=e[5];const{data:g}=Ot(b);if(m||c.length===0)return null;let p,h,j,v,y,N;if(e[6]!==o||e[7]!==g?.items||e[8]!==u||e[9]!==s||e[10]!==a||e[11]!==c||e[12]!==m||e[13]!==d?.user?.id||e[14]!==i){const P=zn(_s(c),g?.items??[],d?.user?.id),w=o&&"pt-3";e[21]!==w?(v=O("flex flex-col gap-1",w),e[21]=w,e[22]=v):v=e[22],y=le.projects,e[23]!==o||e[24]!==i?(N=!o&&n.jsx("p",{className:"px-2 pt-5 pb-0.5 text-xs font-medium text-muted-foreground/60",children:i("sidebar.projects.heading")}),e[23]=o,e[24]=i,e[25]=N):N=e[25],p=z,h="gap-1",j=c.map(I=>{const C=P.get(I.id)??[];return n.jsx(Ce,{icon:n.jsx(Ls,{icon:I.icon,name:I.title}),label:I.title,isActive:I.id===m,onSelect:()=>{E("sidebar_project_clicked"),u(I.id,{panel:zt(I.metadata?.ui?.layout)}),s?.()},children:!o&&C.length>0&&n.jsx("ul",{className:"flex flex-col",children:C.map((T,V)=>n.jsx(Mn,{task:T,orgSlug:a.slug,isLast:V===C.length-1,onNavigate:s},T.id))})},I.id)}),e[6]=o,e[7]=g?.items,e[8]=u,e[9]=s,e[10]=a,e[11]=c,e[12]=m,e[13]=d?.user?.id,e[14]=i,e[15]=p,e[16]=h,e[17]=j,e[18]=v,e[19]=y,e[20]=N}else p=e[15],h=e[16],j=e[17],v=e[18],y=e[19],N=e[20];let S;e[26]!==p||e[27]!==h||e[28]!==j?(S=n.jsx(p,{className:h,children:j}),e[26]=p,e[27]=h,e[28]=j,e[29]=S):S=e[29];let k;return e[30]!==v||e[31]!==y||e[32]!==N||e[33]!==S?(k=n.jsxs("div",{className:v,"data-tour":y,children:[N,S]}),e[30]=v,e[31]=y,e[32]=N,e[33]=S,e[34]=k):k=e[34],k}function bt(t){const e=_.c(8),{onNavigate:s}=t,i=A(),o=Ie(),a=qs();if(!o)return null;let r;e[0]!==i?(r=i("sidebar.scope.allProjects"),e[0]=i,e[1]=r):r=e[1];let l;e[2]!==a||e[3]!==s?(l=()=>{a(),s?.()},e[2]=a,e[3]=s,e[4]=l):l=e[4];let c;return e[5]!==r||e[6]!==l?(c=n.jsx(qt,{label:r,onSelect:l}),e[5]=r,e[6]=l,e[7]=c):c=e[7],c}function ht(t){const e=_.c(2),{onNavigate:s}=t;let i;return e[0]!==s?(i=n.jsx(Dt,{children:n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(kn,{onNavigate:s}),n.jsx(In,{onNavigate:s}),n.jsx(_n,{onNavigate:s}),n.jsx(Dn,{onNavigate:s})]})}),e[0]=s,e[1]=i):i=e[1],i}function Po(){const t=_.c(3),e=Et();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Ft,{}),t[0]=s):s=t[0];let i;return t[1]!==e?(i=n.jsx(tt,{header:s,back:e?n.jsx(Kt,{}):n.jsx(bt,{}),body:e?n.jsx(Bt,{}):n.jsx(ht,{}),footer:e?n.jsx(Vt,{}):n.jsx(bn,{})}),t[1]=e,t[2]=i):i=t[2],i}function wo(t){const e=_.c(9),{onClose:s}=t;let i,o,a;e[0]!==s?(i=n.jsx(Lt,{onClose:s}),o=n.jsx(bt,{onNavigate:s}),a=n.jsx(ht,{onNavigate:s}),e[0]=s,e[1]=i,e[2]=o,e[3]=a):(i=e[1],o=e[2],a=e[3]);let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(hn,{}),e[4]=r):r=e[4];let l;return e[5]!==i||e[6]!==o||e[7]!==a?(l=n.jsx(tt,{sheet:!0,header:i,back:o,body:a,footer:r}),e[5]=i,e[6]=o,e[7]=a,e[8]=l):l=e[8],l}export{Po as S,wo as a};
|
|
1
|
+
import{c as _,a0 as Pe,a1 as ze,o as E,b as A,a as ce,I as F,d as Re,a2 as gt,v as jt,R as vt,r as D,j as n,t as Xe,l as O,a3 as re,a4 as yt,a5 as Nt,a6 as St,a7 as kt,a8 as _t,a9 as Pt,aa as z,ab as M,ac as Ze,n as wt,e as It,K as Ct,B as At,ad as Me,ae as $,C as R,af as $t,ag as Le,ah as Tt,m as Ot,ai as zt,L as Mt,E as Dt}from"./index-B3yBTWEk.js";import{u as we,a as Ie,b as et}from"./use-project-scope-B2cuvtTy.js";import{u as Rt}from"./thread-route-CKY-dKC0.js";import{u as Ee,S as Ce,a as Et,b as Ft,c as tt,d as Vt,e as Bt,f as Kt,g as Lt,h as qt}from"./settings-sidebar-DswZBMwm.js";import{L as le}from"./anchors-yqDzZN4K.js";import{P as st,a as Fe,b as nt}from"./popover-DIqZ2IKF.js";import{D as Ut,a as Qt,b as Ht}from"./drawer-s7gtDrb4.js";import{A as _e}from"./avatar-DcDvs8Zz.js";import{a as Wt}from"./Copy01-DayLu0dF.js";import{n as Jt}from"./Download01-BC2rKbuh.js";import{i as Yt}from"./Printer-fz_zwxfT.js";import{i as Gt}from"./Globe01-SLAc63wC.js";import{n as Xt}from"./LinkExternal01-Cp7uxK1i.js";import{g as qe,e as Zt}from"./TrendUp01-PFzYDizC.js";import{i as ot}from"./Monitor01-BUruMK2r.js";import{n as es,a as ts}from"./Sun-nKOZMh9n.js";import{a as it}from"./Settings02-D2oiGU4q.js";import{i as ss}from"./Shield01-CjyLhqlS.js";import{t as ns,a as os,i as is,b as as,s as Ve,c as at,d as rs,n as ls,e as rt,f as cs,g as ds,h as ms,j as us}from"./agent-icon-DrlilhFJ.js";import{b as fs}from"./Users03-CRtXqa1Q.js";import{u as ps}from"./use-deployment-admin-D6IzoXV0.js";import{u as xs}from"./use-is-desktop-app-BNujXJc_.js";import{i as bs,a as Ue,D as hs}from"./download-app-dialog-BqNRF4Sn.js";import{I as lt}from"./invite-member-dialog-vPcEYe6v.js";import{A as gs}from"./add-connection-dialog-s1GRGQ63.js";import{u as js}from"./use-deco-credits-rwNQ1gMg.js";import{a as vs}from"./use-organization-settings-BAVHurZk.js";import{S as ys}from"./scroll-area-BgZjjLM3.js";import{u as Ns}from"./useInfiniteQuery-GKCP1c_7.js";import{n as Ss}from"./decopilot-sse-pool-CfYFArSW.js";import{t as ct,S as ks,b as _s,p as Ps,a as ws,i as Is,c as Cs,d as As}from"./task-route-D79aS9d_.js";import{g as $s}from"./get-initials-D-f_fDFw.js";import{a as Ts}from"./format-time-BtXRrtv4.js";import{i as Os}from"./Share07-D_kiq5Fr.js";import{e as zs,r as dt,u as Ms,s as Ds,p as Rs,P as Es}from"./use-project-native-view-presence-D-AyEulW.js";import{u as mt}from"./optimistic-project-sidebar-views-yrtk59Mo.js";import{u as Be}from"./use-navigate-to-agent-Bbq0oQ0Y.js";import{c as Fs}from"./SwitchHorizontal01-CxlKjkIX.js";import{a as Vs}from"./Image01-BrHSH-Vi.js";import{u as Bs}from"./use-panel-navigate-Byvx0cbx.js";import{i as Ks}from"./source-system-tabs-CnEGUb4r.js";import{P as Ls}from"./project-icon-Bl3bXnhv.js";function qs(){const t=_.c(4),{setScope:e}=we(),s=Rt(),i=Pe();let o;return t[0]!==i||t[1]!==s||t[2]!==e?(o=()=>{const a=s!==void 0?"route_resolves_scope":ze(i,null)?null:"route_needs_scope";E("scope_cleared",{relocated:a!==null,reason:a}),e(null)},t[0]=i,t[1]=s,t[2]=e,t[3]=o):o=t[3],o}function ae(t){const e=_.c(26),{item:s,onClose:i}=t;let o;e[0]!==s.className?(o=O("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",s.className),e[0]=s.className,e[1]=o):o=e[1];const a=o;if(s.href){const u=s.external?"_blank":void 0,d=s.external?"noopener noreferrer":void 0;let f;e[2]!==s.icon?(f=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:s.icon}),e[2]=s.icon,e[3]=f):f=e[3];let x;e[4]!==s.label?(x=n.jsx("span",{className:"flex-1",children:s.label}),e[4]=s.label,e[5]=x):x=e[5];let b;return e[6]!==a||e[7]!==s.href||e[8]!==i||e[9]!==u||e[10]!==d||e[11]!==f||e[12]!==x?(b=n.jsxs("a",{href:s.href,target:u,rel:d,className:a,onClick:i,children:[f,x]}),e[6]=a,e[7]=s.href,e[8]=i,e[9]=u,e[10]=d,e[11]=f,e[12]=x,e[13]=b):b=e[13],b}let r;e[14]!==s||e[15]!==i?(r=()=>{s.onClick?.(),i()},e[14]=s,e[15]=i,e[16]=r):r=e[16];let l;e[17]!==s.icon?(l=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:s.icon}),e[17]=s.icon,e[18]=l):l=e[18];let c;e[19]!==s.label?(c=n.jsx("span",{className:"flex-1",children:s.label}),e[19]=s.label,e[20]=c):c=e[20];let m;return e[21]!==a||e[22]!==r||e[23]!==l||e[24]!==c?(m=n.jsxs("button",{type:"button",onClick:r,className:a,children:[l,c]}),e[21]=a,e[22]=r,e[23]=l,e[24]=c,e[25]=m):m=e[25],m}function Us(){const t=_.c(4),e=A();let s;t[0]!==e?(s=e("common.accountPopover.impersonating"),t[0]=e,t[1]=s):s=t[1];let i;return t[2]!==s?(i=n.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-warning/10 px-2 py-0.5 text-[10px] font-medium text-warning",children:s}),t[2]=s,t[3]=i):i=t[3],i}function Qe(t){const e=_.c(38),{user:s,userImage:i,isImpersonating:o,isMobile:a}=t,r=A(),l=a?"py-4 border-b border-border":"py-3 mx-1 mt-1";let c;e[0]!==l?(c=O("flex items-center gap-3 px-4",l),e[0]=l,e[1]=c):c=e[1];const m=s?.name??"U";let u;e[2]!==m||e[3]!==i?(u=n.jsx(_e,{url:i,fallback:m,shape:"circle",size:"sm",className:"shrink-0"}),e[2]=m,e[3]=i,e[4]=u):u=e[4];let d;e[5]!==r||e[6]!==s?.name?(d=s?.name??r("common.accountPopover.defaultUserName"),e[5]=r,e[6]=s?.name,e[7]=d):d=e[7];let f;e[8]!==d?(f=n.jsx("p",{className:"text-sm font-medium truncate",children:d}),e[8]=d,e[9]=f):f=e[9];let x;e[10]!==o?(x=o&&n.jsx(Us,{}),e[10]=o,e[11]=x):x=e[11];let b;e[12]!==f||e[13]!==x?(b=n.jsxs("div",{className:"flex items-center gap-2",children:[f,x]}),e[12]=f,e[13]=x,e[14]=b):b=e[14];const g=s?.email;let p;e[15]!==g?(p=n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:g}),e[15]=g,e[16]=p):p=e[16];let h;e[17]!==p||e[18]!==b?(h=n.jsxs("div",{className:"flex-1 min-w-0",children:[b,p]}),e[17]=p,e[18]=b,e[19]=h):h=e[19];let j;e[20]!==r||e[21]!==s?(j=()=>{s?.id&&navigator.clipboard.writeText(s.id).then(()=>{Xe.success(r("common.accountPopover.userIdCopied"))})},e[20]=r,e[21]=s,e[22]=j):j=e[22];let v;e[23]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Wt,{size:14}),e[23]=v):v=e[23];let y;e[24]!==j?(y=n.jsx(St,{asChild:!0,children:n.jsx("button",{type:"button",tabIndex:-1,onClick:j,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:v})}),e[24]=j,e[25]=y):y=e[25];let N;e[26]!==r?(N=r("common.accountPopover.copyUserId"),e[26]=r,e[27]=N):N=e[27];let S;e[28]!==N?(S=n.jsx(kt,{side:"right",children:n.jsx("p",{className:"text-xs",children:N})}),e[28]=N,e[29]=S):S=e[29];let k;e[30]!==y||e[31]!==S?(k=n.jsx(_t,{delayDuration:300,children:n.jsxs(Pt,{children:[y,S]})}),e[30]=y,e[31]=S,e[32]=k):k=e[32];let P;return e[33]!==h||e[34]!==k||e[35]!==c||e[36]!==u?(P=n.jsxs("div",{className:c,children:[u,h,k]}),e[33]=h,e[34]=k,e[35]=c,e[36]=u,e[37]=P):P=e[37],P}function He(t){const e=_.c(35),{themeOptions:s,preferences:i,setPreferences:o,isMobile:a}=t,r=A(),l=a?"size-8":"size-7",c=a?"px-3 py-3":"px-2 py-1.5";let m;e[0]!==c?(m=O("flex items-center justify-between border-t border-border/50",c),e[0]=c,e[1]=m):m=e[1];let u;if(e[2]!==l||e[3]!==i.theme||e[4]!==o||e[5]!==s){let N;e[7]!==l||e[8]!==i.theme||e[9]!==o?(N=S=>{const{value:k,icon:P,label:w}=S;return n.jsx("button",{type:"button","aria-label":w,onClick:()=>o(I=>({...I,theme:k})),className:O(l,"rounded-md flex items-center justify-center transition-colors",i.theme===k?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:P},k)},e[7]=l,e[8]=i.theme,e[9]=o,e[10]=N):N=e[10],u=s.map(N),e[2]=l,e[3]=i.theme,e[4]=o,e[5]=s,e[6]=u}else u=e[6];let d;e[11]!==u?(d=n.jsx("div",{className:"flex items-center gap-0.5",children:u}),e[11]=u,e[12]=d):d=e[12];let f;e[13]!==i.enableSounds||e[14]!==r?(f=i.enableSounds?r("common.accountPopover.disableSounds"):r("common.accountPopover.enableSounds"),e[13]=i.enableSounds,e[14]=r,e[15]=f):f=e[15];let x;e[16]!==o?(x=()=>o(Qs),e[16]=o,e[17]=x):x=e[17];const b=i.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let g;e[18]!==l||e[19]!==b?(g=O(l,"rounded-md flex items-center justify-center transition-colors",b),e[18]=l,e[19]=b,e[20]=g):g=e[20];let p;e[21]!==i.enableSounds?(p=i.enableSounds?n.jsx(os,{size:14}):n.jsx(is,{size:14}),e[21]=i.enableSounds,e[22]=p):p=e[22];let h;e[23]!==f||e[24]!==x||e[25]!==g||e[26]!==p?(h=n.jsx("button",{type:"button","aria-label":f,onClick:x,className:g,children:p}),e[23]=f,e[24]=x,e[25]=g,e[26]=p,e[27]=h):h=e[27];let j;e[28]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.364.0"]}),e[28]=j):j=e[28];let v;e[29]!==h?(v=n.jsxs("div",{className:"flex items-center gap-2",children:[h,j]}),e[29]=h,e[30]=v):v=e[30];let y;return e[31]!==v||e[32]!==m||e[33]!==d?(y=n.jsxs("div",{className:m,children:[d,v]}),e[31]=v,e[32]=m,e[33]=d,e[34]=y):y=e[34],y}function Qs(t){return{...t,enableSounds:!t.enableSounds}}function We(t){const e=_.c(54),{user:s,userImage:i,menuItems:o,signOutItem:a,stopImpersonatingItem:r,isImpersonating:l,themeOptions:c,preferences:m,setPreferences:u,close:d,isMobile:f}=t;if(f){let y;e[0]!==l||e[1]!==s||e[2]!==i?(y=n.jsx(Qe,{user:s,userImage:i,isImpersonating:l,isMobile:!0}),e[0]=l,e[1]=s,e[2]=i,e[3]=y):y=e[3];let N;if(e[4]!==d||e[5]!==o){let C;e[7]!==d?(C=T=>n.jsx(ae,{item:T,onClose:d},T.key),e[7]=d,e[8]=C):C=e[8],N=o.map(C),e[4]=d,e[5]=o,e[6]=N}else N=e[6];let S;e[9]!==d||e[10]!==r?(S=r&&n.jsx(ae,{item:r,onClose:d}),e[9]=d,e[10]=r,e[11]=S):S=e[11];let k;e[12]!==d||e[13]!==a?(k=n.jsx(ae,{item:a,onClose:d}),e[12]=d,e[13]=a,e[14]=k):k=e[14];let P;e[15]!==N||e[16]!==S||e[17]!==k?(P=n.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:n.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[N,S,k]})}),e[15]=N,e[16]=S,e[17]=k,e[18]=P):P=e[18];let w;e[19]!==m||e[20]!==u||e[21]!==c?(w=n.jsx(He,{themeOptions:c,preferences:m,setPreferences:u,isMobile:!0}),e[19]=m,e[20]=u,e[21]=c,e[22]=w):w=e[22];let I;return e[23]!==y||e[24]!==P||e[25]!==w?(I=n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[y,P,w]}),e[23]=y,e[24]=P,e[25]=w,e[26]=I):I=e[26],I}let x;e[27]!==l||e[28]!==s||e[29]!==i?(x=n.jsx(Qe,{user:s,userImage:i,isImpersonating:l,isMobile:!1}),e[27]=l,e[28]=s,e[29]=i,e[30]=x):x=e[30];let b;if(e[31]!==d||e[32]!==o){let y;e[34]!==d?(y=N=>n.jsx(ae,{item:N,onClose:d},N.key),e[34]=d,e[35]=y):y=e[35],b=o.map(y),e[31]=d,e[32]=o,e[33]=b}else b=e[33];let g;e[36]!==d||e[37]!==r?(g=r&&n.jsx(ae,{item:r,onClose:d}),e[36]=d,e[37]=r,e[38]=g):g=e[38];let p;e[39]!==d||e[40]!==a?(p=n.jsx(ae,{item:a,onClose:d}),e[39]=d,e[40]=a,e[41]=p):p=e[41];let h;e[42]!==b||e[43]!==g||e[44]!==p?(h=n.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[b,g,p]}),e[42]=b,e[43]=g,e[44]=p,e[45]=h):h=e[45];let j;e[46]!==m||e[47]!==u||e[48]!==c?(j=n.jsx(He,{themeOptions:c,preferences:m,setPreferences:u,isMobile:!1}),e[46]=m,e[47]=u,e[48]=c,e[49]=j):j=e[49];let v;return e[50]!==x||e[51]!==h||e[52]!==j?(v=n.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:n.jsxs("div",{className:"flex flex-col",children:[x,h,j]})}),e[50]=x,e[51]=h,e[52]=j,e[53]=v):v=e[53],v}function De(){const t=_.c(107),e=A(),{data:s}=ce.useSession(),{org:i}=F(),o=Re();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org",shouldThrow:!1},t[0]=a):a=t[0];const l=gt(a)?.params.org,[c,m]=jt(),u=vt(),{isAdmin:d}=ps(),f=xs(),[x,b]=D.useState(!1),[g,p]=D.useState(!1),h=s?.user,j=h?.image,v=!!s?.session?.impersonatedBy;let y;t[1]===Symbol.for("react.memo_cache_sentinel")?(y=()=>b(!1),t[1]=y):y=t[1];const N=y;let S;t[2]!==e?(S=e("common.accountPopover.preferences"),t[2]=e,t[3]=S):S=t[3];let k;t[4]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(it,{size:16}),t[4]=k):k=t[4];let P;t[5]!==o||t[6]!==l?(P=()=>{o({to:"/$org/settings/profile",params:{org:l??""}})},t[5]=o,t[6]=l,t[7]=P):P=t[7];let w;t[8]!==S||t[9]!==P?(w={key:"preferences",label:S,icon:k,onClick:P},t[8]=S,t[9]=P,t[10]=w):w=t[10];let I;t[11]!==i||t[12]!==o?(I=i?[{key:"connect-clients",label:"Connect to Agents",icon:n.jsx(Xt,{size:16}),onClick:()=>{o({to:"/$org/settings/connect",params:{org:i.slug}})}}]:[],t[11]=i,t[12]=o,t[13]=I):I=t[13];let C;t[14]!==f||t[15]!==e?(C=(bs()||Ue())&&!f?[{key:"install-desktop-app",label:Ue()?e("downloadApp.installOnLinux"):e("downloadApp.installOnMac"),icon:n.jsx(Jt,{size:16}),onClick:()=>p(!0)}]:[],t[14]=f,t[15]=e,t[16]=C):C=t[16];let T;t[17]!==e?(T=e("common.accountPopover.termsOfUse"),t[17]=e,t[18]=T):T=t[18];let V;t[19]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(Yt,{size:16}),t[19]=V):V=t[19];let B;t[20]!==T?(B={key:"terms",label:T,icon:V,href:"https://www.decocms.com/terms-of-use",external:!0},t[20]=T,t[21]=B):B=t[21];let K;t[22]!==e?(K=e("common.accountPopover.privacyPolicy"),t[22]=e,t[23]=K):K=t[23];let de;t[24]===Symbol.for("react.memo_cache_sentinel")?(de=n.jsx(ss,{size:16}),t[24]=de):de=t[24];let L;t[25]!==K?(L={key:"privacy",label:K,icon:de,href:"https://www.decocms.com/privacy-policy",external:!0},t[25]=K,t[26]=L):L=t[26];let q;t[27]!==e?(q=e("common.accountPopover.githubRepo"),t[27]=e,t[28]=q):q=t[28];let me;t[29]===Symbol.for("react.memo_cache_sentinel")?(me=n.jsx(yt,{className:"w-4 h-4"}),t[29]=me):me=t[29];let U;t[30]!==q?(U={key:"github",label:q,icon:me,href:"https://github.com/decocms/studio",external:!0},t[30]=q,t[31]=U):U=t[31];let Q;t[32]!==e?(Q=e("common.accountPopover.community"),t[32]=e,t[33]=Q):Q=t[33];let ue;t[34]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(fs,{size:16}),t[34]=ue):ue=t[34];let H;t[35]!==Q?(H={key:"community",label:Q,icon:ue,href:"https://decocms.com/discord",external:!0},t[35]=Q,t[36]=H):H=t[36];let W;t[37]!==e?(W=e("common.accountPopover.homepage"),t[37]=e,t[38]=W):W=t[38];let fe;t[39]===Symbol.for("react.memo_cache_sentinel")?(fe=n.jsx(Gt,{size:16}),t[39]=fe):fe=t[39];let J;t[40]!==W?(J={key:"homepage",label:W,icon:fe,href:"https://decocms.com",external:!0},t[40]=W,t[41]=J):J=t[41];let Y;t[42]!==d||t[43]!==o||t[44]!==e?(Y=d?[{key:"admin-dashboard",label:e("common.accountPopover.adminDashboard"),icon:n.jsx(ns,{size:16}),onClick:()=>o({to:"/_admin"}),className:"text-warning"}]:[],t[42]=d,t[43]=o,t[44]=e,t[45]=Y):Y=t[45];let pe;t[46]!==B||t[47]!==L||t[48]!==U||t[49]!==H||t[50]!==J||t[51]!==Y||t[52]!==w||t[53]!==I||t[54]!==C?(pe=[w,...I,...C,B,L,U,H,J,...Y],t[46]=B,t[47]=L,t[48]=U,t[49]=H,t[50]=J,t[51]=Y,t[52]=w,t[53]=I,t[54]=C,t[55]=pe):pe=t[55];const Ae=pe;let G;t[56]!==e?(G=e("common.accountPopover.signOut"),t[56]=e,t[57]=G):G=t[57];let xe;t[58]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx(qe,{size:16}),t[58]=xe):xe=t[58];let be;t[59]!==G?(be={key:"logout",label:G,icon:xe,onClick:Ws},t[59]=G,t[60]=be):be=t[60];const $e=be;let he;t[61]!==v||t[62]!==e?(he=v?{key:"stop-impersonating",label:e("common.accountPopover.stopImpersonation"),icon:n.jsx(qe,{size:16}),onClick:async()=>{const{error:Ke}=await ce.admin.stopImpersonating();if(Ke){Xe.error(Ke.message||e("common.accountPopover.failedToStopImpersonation"));return}window.location.href="/"},className:"text-warning"}:null,t[61]=v,t[62]=e,t[63]=he):he=t[63];const Te=he;let ge;t[64]===Symbol.for("react.memo_cache_sentinel")?(ge=n.jsx(es,{size:14}),t[64]=ge):ge=t[64];let X;t[65]!==e?(X=e("common.accountPopover.lightTheme"),t[65]=e,t[66]=X):X=t[66];let Z;t[67]!==X?(Z={value:"light",icon:ge,label:X},t[67]=X,t[68]=Z):Z=t[68];let je;t[69]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(ts,{size:14}),t[69]=je):je=t[69];let ee;t[70]!==e?(ee=e("common.accountPopover.darkTheme"),t[70]=e,t[71]=ee):ee=t[71];let te;t[72]!==ee?(te={value:"dark",icon:je,label:ee},t[72]=ee,t[73]=te):te=t[73];let ve;t[74]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(ot,{size:14}),t[74]=ve):ve=t[74];let se;t[75]!==e?(se=e("common.accountPopover.systemTheme"),t[75]=e,t[76]=se):se=t[76];let ne;t[77]!==se?(ne={value:"system",icon:ve,label:se},t[77]=se,t[78]=ne):ne=t[78];let ye;t[79]!==Z||t[80]!==te||t[81]!==ne?(ye=[Z,te,ne],t[79]=Z,t[80]=te,t[81]=ne,t[82]=ye):ye=t[82];const Oe=ye;let Ne;t[83]!==v||t[84]!==u||t[85]!==Ae||t[86]!==c||t[87]!==m||t[88]!==$e||t[89]!==Te||t[90]!==Oe||t[91]!==h||t[92]!==j?(Ne={user:h,userImage:j,menuItems:Ae,signOutItem:$e,stopImpersonatingItem:Te,isImpersonating:v,themeOptions:Oe,preferences:c,setPreferences:m,close:N,isMobile:u},t[83]=v,t[84]=u,t[85]=Ae,t[86]=c,t[87]=m,t[88]=$e,t[89]=Te,t[90]=Oe,t[91]=h,t[92]=j,t[93]=Ne):Ne=t[93];const Se=Ne;let oe;t[94]!==v||t[95]!==u||t[96]!==x||t[97]!==Se||t[98]!==e||t[99]!==h?.name||t[100]!==j?(oe=u?n.jsxs(Ut,{open:x,onOpenChange:b,direction:"bottom",children:[n.jsxs("button",{type:"button",onClick:()=>b(!0),className:O("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",v&&"border-2 border-dashed border-warning"),children:[n.jsx(_e,{url:j,fallback:h?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),n.jsx("span",{className:"truncate",children:h?.name??e("common.accountPopover.defaultAccountLabel")})]}),n.jsxs(Qt,{className:"h-[80dvh] p-0",children:[n.jsx(Ht,{className:"sr-only",children:e("common.accountPopover.account")}),n.jsx(We,{...Se})]})]}):n.jsxs(st,{open:x,onOpenChange:b,children:[n.jsx(Fe,{asChild:!0,children:n.jsxs(re,{"data-tour":le.account,tooltip:h?.name??e("common.accountPopover.defaultAccountLabel"),className:O("rounded-md",v&&"border-2 border-dashed border-warning"),children:[n.jsx(_e,{url:j,fallback:h?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),n.jsx("span",{className:"truncate",children:h?.name??e("common.accountPopover.defaultAccountLabel")})]})}),n.jsx(nt,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Hs,children:n.jsx(We,{...Se})})]}),t[94]=v,t[95]=u,t[96]=x,t[97]=Se,t[98]=e,t[99]=h?.name,t[100]=j,t[101]=oe):oe=t[101];let ie;t[102]!==g?(ie=n.jsx(hs,{open:g,onOpenChange:p}),t[102]=g,t[103]=ie):ie=t[103];let ke;return t[104]!==oe||t[105]!==ie?(ke=n.jsxs(n.Fragment,{children:[oe,ie]}),t[104]=oe,t[105]=ie,t[106]=ke):ke=t[106],ke}function Hs(t){return t.preventDefault()}function Ws(){E("signed_out",{source:"account_popover"}),Nt(),ce.signOut()}class Js extends D.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,s){}render(){return this.state.hasError?null:this.props.children}}function Ys(t){return t<=1?"text-destructive":t<=5?"text-warning":"text-foreground/70"}function Gs(){const t=_.c(17),e=Re(),{org:s}=F(),{hasDecoKey:i,balanceDollars:o}=js();if(!i)return null;let a;t[0]!==o?(a=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=a):a=t[1];let r;t[2]!==o?(r=O(o!=null&&Ys(o)),t[2]=o,t[3]=r):r=t[3];let l;t[4]!==e||t[5]!==s.slug?(l=()=>e({to:"/$org/settings/ai-providers",params:{org:s.slug}}),t[4]=e,t[5]=s.slug,t[6]=l):l=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(as,{}),t[7]=c):c=t[7];let m;t[8]!==o?(m=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,t[9]=m):m=t[9];let u;t[10]!==m?(u=n.jsx("span",{children:m}),t[10]=m,t[11]=u):u=t[11];let d;return t[12]!==a||t[13]!==r||t[14]!==l||t[15]!==u?(d=n.jsx(z,{children:n.jsx(M,{children:n.jsxs(re,{tooltip:a,className:r,onClick:l,children:[c,u]})})}),t[12]=a,t[13]=r,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function Je(){const t=_.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Js,{children:n.jsx(D.Suspense,{fallback:null,children:n.jsx(Gs,{})})}),t[0]=e):e=t[0],e}const Xs=6e4;function Zs(t,e){return t.call("NOTIFICATION_LIST",e?{cursor:e}:{})}function en(t,e){if(!t)return t;const s=e?new Set(e):null;let i=0;const o=t.pages.map(r=>{const l=r.notifications.filter(c=>s&&!s.has(c.id)?!0:(i++,!1));return{...r,notifications:l}}),a=s?Math.max(0,(t.pages[0]?.unreadCount??0)-i):0;return{...t,pages:o.map(r=>({...r,unreadCount:a}))}}function tn(t,e){const s=_.c(4),{data:i}=ce.useSession(),o=i?.user?.id;let a;s[0]!==e||s[1]!==t||s[2]!==o?(a=r=>!t||!o?on:Ss.subscribe(t,c=>{try{if(JSON.parse(c.data).subject!==o)return}catch{return}e(),r()},e),s[0]=e,s[1]=t,s[2]=o,s[3]=a):a=s[3],D.useSyncExternalStore(a,nn,sn)}function sn(){return 0}function nn(){return 0}function on(){}function ut(){const t=_.c(37),{locator:e,org:s}=F(),i=Ze(),o=wt();let a;t[0]!==e?(a=Ct.notifications(e),t[0]=e,t[1]=a):a=t[1];const r=a;let l;t[2]!==i?(l=P=>{const{pageParam:w}=P;return Zs(i,w)},t[2]=i,t[3]=l):l=t[3];let c;t[4]!==r||t[5]!==l?(c={queryKey:r,queryFn:l,initialPageParam:void 0,getNextPageParam:ln,refetchInterval:Xs},t[4]=r,t[5]=l,t[6]=c):c=t[6];const m=Ns(c);let u;t[7]!==o||t[8]!==r?(u=()=>o.invalidateQueries({queryKey:r,refetchType:"active"}),t[7]=o,t[8]=r,t[9]=u):u=t[9],tn(s.slug,u);let d;t[10]!==i?(d=P=>i.call("NOTIFICATION_MARK_READ",P?{ids:P}:{}),t[10]=i,t[11]=d):d=t[11];let f,x;t[12]!==o||t[13]!==r?(f=async P=>{await o.cancelQueries({queryKey:r}),o.setQueryData(r,w=>en(w,P))},x=()=>o.invalidateQueries({queryKey:r}),t[12]=o,t[13]=r,t[14]=f,t[15]=x):(f=t[14],x=t[15]);let b;t[16]!==d||t[17]!==f||t[18]!==x?(b={mutationFn:d,onMutate:f,onSettled:x},t[16]=d,t[17]=f,t[18]=x,t[19]=b):b=t[19];const g=It(b);let p;t[20]!==m.data?.pages?(p=m.data?.pages??[],t[20]=m.data?.pages,t[21]=p):p=t[21];const h=p;let j;t[22]!==h?(j=h.flatMap(an),t[22]=h,t[23]=j):j=t[23];const v=h[0]?.unreadCount??0;let y;t[24]!==m?(y=()=>{m.hasNextPage&&!m.isFetchingNextPage&&m.fetchNextPage()},t[24]=m,t[25]=y):y=t[25];let N,S;t[26]!==g?(N=()=>g.mutate(null),S=P=>g.mutate([P]),t[26]=g,t[27]=N,t[28]=S):(N=t[27],S=t[28]);let k;return t[29]!==m.hasNextPage||t[30]!==m.isFetchingNextPage||t[31]!==v||t[32]!==y||t[33]!==N||t[34]!==S||t[35]!==j?(k={updates:j,redDotCount:v,hasMore:m.hasNextPage,isFetchingMore:m.isFetchingNextPage,fetchMore:y,markAllRead:N,markRead:S},t[29]=m.hasNextPage,t[30]=m.isFetchingNextPage,t[31]=v,t[32]=y,t[33]=N,t[34]=S,t[35]=j,t[36]=k):k=t[36],k}function an(t){return t.notifications.map(rn)}function rn(t){return{id:t.id,taskBoardItemId:t.taskBoardItemId,taskTitle:t.taskTitle,taskKeySeq:t.taskKeySeq,action:t.type,actorName:t.actorName,actorImage:t.actorImage,occurredAt:t.createdAt}}function ln(t){return t.nextCursor??void 0}function cn(t){switch(t){case"mentioned":case"review_requested":return"font-medium text-foreground";case"merge_failed":case"review_changes_requested":return"font-medium text-destructive";case"review_approved":return"font-medium text-success";default:return""}}function dn(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");default:{const s=t.action;return String(s)}}}function mn(t){const e=_.c(36),{update:s,orgSlug:i,onSelect:o}=t,a=A();let r;e[0]!==i||e[1]!==s.taskKeySeq?(r=ct(i,s.taskKeySeq),e[0]=i,e[1]=s.taskKeySeq,e[2]=r):r=e[2];const l=r,c=!s.actorName;let m;e[3]!==c||e[4]!==s.actorImage||e[5]!==s.actorName?(m=n.jsx("span",{className:"mt-0.5 shrink-0",children:c?n.jsx(ks,{size:24}):n.jsx(_e,{url:s.actorImage??void 0,fallback:$s(s.actorName??void 0),shape:"circle",size:"xs"})}),e[3]=c,e[4]=s.actorImage,e[5]=s.actorName,e[6]=m):m=e[6];let u;e[7]!==s.taskTitle?(u=n.jsx("p",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:s.taskTitle}),e[7]=s.taskTitle,e[8]=u):u=e[8];let d;e[9]!==s.occurredAt?(d=Ts(new Date(s.occurredAt)),e[9]=s.occurredAt,e[10]=d):d=e[10];let f;e[11]!==d?(f=n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground/70",children:d}),e[11]=d,e[12]=f):f=e[12];let x;e[13]!==u||e[14]!==f?(x=n.jsxs("div",{className:"flex items-baseline gap-2",children:[u,f]}),e[13]=u,e[14]=f,e[15]=x):x=e[15];let b;e[16]!==l?(b=l&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"font-medium",children:l})," · "]}),e[16]=l,e[17]=b):b=e[17];let g;e[18]!==s.action?(g=O(cn(s.action)),e[18]=s.action,e[19]=g):g=e[19];let p;e[20]!==a||e[21]!==s?(p=dn(s,a),e[20]=a,e[21]=s,e[22]=p):p=e[22];let h;e[23]!==g||e[24]!==p?(h=n.jsx("span",{className:g,children:p}),e[23]=g,e[24]=p,e[25]=h):h=e[25];let j;e[26]!==h||e[27]!==b?(j=n.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[b,h]}),e[26]=h,e[27]=b,e[28]=j):j=e[28];let v;e[29]!==j||e[30]!==x?(v=n.jsxs("div",{className:"min-w-0 flex-1",children:[x,j]}),e[29]=j,e[30]=x,e[31]=v):v=e[31];let y;return e[32]!==o||e[33]!==v||e[34]!==m?(y=n.jsxs("button",{type:"button",onClick:o,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-muted/25",children:[m,v]}),e[32]=o,e[33]=v,e[34]=m,e[35]=y):y=e[35],y}function un(t){const e=_.c(2),{onReach:s}=t;let i;return e[0]!==s?(i=n.jsx("div",{className:"h-8 shrink-0",ref:o=>{if(!o)return;const a=new IntersectionObserver(r=>{r.some(fn)&&s()});return a.observe(o),()=>a.disconnect()}}),e[0]=s,e[1]=i):i=e[1],i}function fn(t){return t.isIntersecting}function pn(t){const e=_.c(23),{onClose:s}=t,i=A(),o=Re(),{org:a}=F(),{updates:r,markAllRead:l,markRead:c,hasMore:m,fetchMore:u}=ut();let d;e[0]!==i?(d=i("sidebar.inbox.title"),e[0]=i,e[1]=d):d=e[1];let f;e[2]!==d?(f=n.jsx("h3",{className:"text-sm font-medium",children:d}),e[2]=d,e[3]=f):f=e[3];let x;e[4]!==l||e[5]!==i||e[6]!==r.length?(x=r.length>0&&n.jsx(At,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs text-muted-foreground",onClick:l,children:i("sidebar.inbox.markAllRead")}),e[4]=l,e[5]=i,e[6]=r.length,e[7]=x):x=e[7];let b;e[8]!==f||e[9]!==x?(b=n.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-4 py-3",children:[f,x]}),e[8]=f,e[9]=x,e[10]=b):b=e[10];let g;e[11]!==u||e[12]!==m||e[13]!==c||e[14]!==o||e[15]!==s||e[16]!==a||e[17]!==i||e[18]!==r?(g=r.length===0?n.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 py-10 text-center",children:[n.jsx(Ve,{size:24,className:"text-muted-foreground/50"}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:i("sidebar.inbox.emptyTitle")}),n.jsx("p",{className:"text-xs text-muted-foreground",children:i("sidebar.inbox.emptyBody")})]}):n.jsxs(ys,{className:"min-h-0 flex-1",children:[r.map(h=>{const j=ct(a.slug,h.taskKeySeq);return n.jsx(mn,{update:h,orgSlug:a.slug,onSelect:()=>{c(h.id),s(),j&&o({to:"/$org/tasks/{-$taskKey}",params:{org:a.slug,taskKey:j}})}},h.id)}),m&&n.jsx(un,{onReach:u})]}),e[11]=u,e[12]=m,e[13]=c,e[14]=o,e[15]=s,e[16]=a,e[17]=i,e[18]=r,e[19]=g):g=e[19];let p;return e[20]!==b||e[21]!==g?(p=n.jsxs(n.Fragment,{children:[b,g]}),e[20]=b,e[21]=g,e[22]=p):p=e[22],p}function ft(){const t=_.c(1),{redDotCount:e}=ut();if(e===0)return null;let s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("span",{className:"pointer-events-none absolute top-1 right-1 size-2 rounded-full bg-destructive"}),t[0]=s):s=t[0],s}function pt(t){const e=_.c(10),{open:s,onOpenChange:i,children:o}=t;let a;e[0]!==i||e[1]!==s?(a=s&&n.jsx(pn,{onClose:()=>i(!1)}),e[0]=i,e[1]=s,e[2]=a):a=e[2];let r;e[3]!==a?(r=n.jsx(nt,{side:"right",align:"end",sideOffset:12,collisionPadding:16,className:"flex max-h-[min(650px,calc(100dvh-4rem))] w-[min(400px,calc(100vw-2rem))] flex-col p-0",children:a}),e[3]=a,e[4]=r):r=e[4];let l;return e[5]!==o||e[6]!==i||e[7]!==s||e[8]!==r?(l=n.jsxs(st,{open:s,onOpenChange:i,children:[o,r]}),e[5]=o,e[6]=i,e[7]=s,e[8]=r,e[9]=l):l=e[9],l}function xt(){const t=_.c(9),e=A(),[s,i]=D.useState(!1);let o;t[0]!==e?(o=e("sidebar.inbox.title"),t[0]=e,t[1]=o):o=t[1];let a,r;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ve,{size:15}),r=n.jsx(ft,{}),t[2]=a,t[3]=r):(a=t[2],r=t[3]);let l;t[4]!==o?(l=n.jsx(Fe,{asChild:!0,children:n.jsxs("button",{type:"button","aria-label":o,className:"relative flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[a,r]})}),t[4]=o,t[5]=l):l=t[5];let c;return t[6]!==s||t[7]!==l?(c=n.jsx(pt,{open:s,onOpenChange:i,children:l}),t[6]=s,t[7]=l,t[8]=c):c=t[8],c}function xn(){const t=_.c(15),e=A(),[s,i]=D.useState(!1),o=Ee();let a;t[0]!==o||t[1]!==e?(a=o?e("sidebar.inbox.title"):void 0,t[0]=o,t[1]=e,t[2]=a):a=t[2];let r,l;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ve,{}),l=n.jsx(ft,{}),t[3]=r,t[4]=l):(r=t[3],l=t[4]);let c;t[5]!==e?(c=e("sidebar.inbox.title"),t[5]=e,t[6]=c):c=t[6];let m;t[7]!==c?(m=n.jsx("span",{className:"truncate",children:c}),t[7]=c,t[8]=m):m=t[8];let u;t[9]!==a||t[10]!==m?(u=n.jsx(Fe,{asChild:!0,children:n.jsxs(re,{tooltip:a,className:"relative",children:[r,l,m]})}),t[9]=a,t[10]=m,t[11]=u):u=t[11];let d;return t[12]!==s||t[13]!==u?(d=n.jsx(pt,{open:s,onOpenChange:i,children:u}),t[12]=s,t[13]=u,t[14]=d):d=t[14],d}function Ye(){const t=_.c(29),e=A(),[s,i]=D.useState(!1);let o;t[0]!==e?(o=e("sidebar.sidebarFooter.inviteMembers"),t[0]=e,t[1]=o):o=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(at,{}),t[2]=a):a=t[2];let r;t[3]!==e?(r=e("sidebar.sidebarFooter.inviteMembers"),t[3]=e,t[4]=r):r=t[4];let l;t[5]!==r?(l=n.jsx("span",{children:r}),t[5]=r,t[6]=l):l=t[6];let c;t[7]!==o||t[8]!==l?(c=n.jsx(M,{children:n.jsx(lt,{trigger:n.jsxs(re,{tooltip:o,children:[a,l]})})}),t[7]=o,t[8]=l,t[9]=c):c=t[9];let m;t[10]!==e?(m=e("sidebar.sidebarFooter.addConnection"),t[10]=e,t[11]=m):m=t[11];let u,d;t[12]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i(!0),d=n.jsx(rs,{}),t[12]=u,t[13]=d):(u=t[12],d=t[13]);let f;t[14]!==e?(f=e("sidebar.sidebarFooter.addConnection"),t[14]=e,t[15]=f):f=t[15];let x;t[16]!==f?(x=n.jsx("span",{children:f}),t[16]=f,t[17]=x):x=t[17];let b;t[18]!==m||t[19]!==x?(b=n.jsx(M,{children:n.jsxs(re,{tooltip:m,onClick:u,children:[d,x]})}),t[18]=m,t[19]=x,t[20]=b):b=t[20];let g;t[21]!==b||t[22]!==c?(g=n.jsxs(z,{className:"gap-0.5",children:[c,b]}),t[21]=b,t[22]=c,t[23]=g):g=t[23];let p;t[24]!==s?(p=s&&n.jsx(gs,{open:s,onOpenChange:i,mode:"browse"}),t[24]=s,t[25]=p):p=t[25];let h;return t[26]!==g||t[27]!==p?(h=n.jsxs(n.Fragment,{children:[g,p]}),t[26]=g,t[27]=p,t[28]=h):h=t[28],h}function Ge(){const t=_.c(10),e=A();let s;t[0]!==e?(s=e("sidebar.sidebarFooter.inviteMembers"),t[0]=e,t[1]=s):s=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(at,{}),t[2]=i):i=t[2];let o;t[3]!==e?(o=e("sidebar.sidebarFooter.inviteMembers"),t[3]=e,t[4]=o):o=t[4];let a;t[5]!==o?(a=n.jsx("span",{children:o}),t[5]=o,t[6]=a):a=t[6];let r;return t[7]!==s||t[8]!==a?(r=n.jsx(z,{className:"gap-0.5",children:n.jsx(M,{children:n.jsx(lt,{trigger:n.jsxs(re,{tooltip:s,children:[i,a]})})})}),t[7]=s,t[8]=a,t[9]=r):r=t[9],r}function bn(){const t=_.c(17),e=Ee(),s=vs(),i=!s;if(e){let c;t[0]!==i?(c=i&&n.jsx(Je,{}),t[0]=i,t[1]=c):c=t[1];let m;t[2]!==s?(m=s?n.jsx(Ge,{}):n.jsx(Ye,{}),t[2]=s,t[3]=m):m=t[3];let u;t[4]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(M,{children:n.jsx(xn,{})}),t[4]=u):u=t[4];let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsxs(z,{children:[u,n.jsx(M,{children:n.jsx(De,{})})]}),t[5]=d):d=t[5];let f;return t[6]!==c||t[7]!==m?(f=n.jsxs(Me,{className:"px-2 pb-3 gap-1",children:[c,m,d]}),t[6]=c,t[7]=m,t[8]=f):f=t[8],f}let o;t[9]!==i?(o=i&&n.jsx(Je,{}),t[9]=i,t[10]=o):o=t[10];let a;t[11]!==s?(a=s?n.jsx(Ge,{}):n.jsx(Ye,{}),t[11]=s,t[12]=a):a=t[12];let r;t[13]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(z,{className:"gap-0.5",children:n.jsx(M,{children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(De,{})}),n.jsx(xt,{})]})})}),t[13]=r):r=t[13];let l;return t[14]!==o||t[15]!==a?(l=n.jsxs(Me,{className:"px-2 pb-3 gap-0.5",children:[o,a,r]}),t[14]=o,t[15]=a,t[16]=l):l=t[16],l}function hn(){const t=_.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Me,{className:"px-2 pb-3",children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(z,{children:n.jsx(M,{children:n.jsx(De,{})})})}),n.jsx(xt,{})]})}),t[0]=e):e=t[0],e}const gn="settings",jn=["overview","reports","board","files"];function vn(t,e){return!t||!e?!1:!et(e.metadata)}function yn(t,e,s,i){if(!t||!e)return!0;const o=i!==void 0;return zs(o?i:dt(e.metadata),o?1:e.metadata?.sidebarViewsVersion).includes(s)}function Nn(){const t=_.c(16),e=A(),{org:s}=F(),i=Pe(),o=Ie(),{project:a,repo:r}=we(),l=mt(a?.id);let c;t[0]!==a||t[1]!==o?(c=vn(o,a),t[0]=a,t[1]=o,t[2]=c):c=t[2];const m=c;let u;t[3]!==l||t[4]!==a||t[5]!==o?(u=x=>yn(o,a,x,l),t[3]=l,t[4]=a,t[5]=o,t[6]=u):u=t[6];const d=u;let f;if(t[7]!==d||t[8]!==m||t[9]!==i||t[10]!==s||t[11]!==a?.id||t[12]!==r||t[13]!==o||t[14]!==e){const x={overview:m||!d("overview")?null:{key:"overview",label:e("sidebar.navDestinations.home"),icon:n.jsx(cs,{size:16}),isActive:i===$.home||i===$.orgIndex||i===R.root||i===`${R.root}/`,trackAs:"overview",link:o?{to:R.root,params:{org:s.slug,agentId:o}}:{to:$.home,params:{org:s.slug}}},reports:ze($.reports,o)&&!m&&d("reports")?{key:"reports",label:e("sidebar.navDestinations.reports"),icon:n.jsx(rt,{size:16}),isActive:i===$.reports||i===R.reports,trackAs:"reports",link:o?{to:R.reports,params:{org:s.slug,agentId:o}}:{to:$.reports,params:{org:s.slug}}}:null,board:m||!d("board")?null:{key:"board",label:e("sidebar.navDestinations.tasks"),icon:n.jsx(ls,{size:16}),isActive:i===$.tasks||i===R.tasks,trackAs:"board",dataTour:le.tasks,link:{to:o?R.tasks:$.tasks,params:{org:s.slug,agentId:o??void 0,taskKey:void 0},search:b=>{const g=r??a?.id;return g?{...b,repo:g}:b}}},files:ze($.library,o)?{key:"files",label:e("sidebar.navDestinations.library"),icon:n.jsx(Os,{size:16}),isActive:i===$.library,trackAs:"files",link:{to:$.library,params:{org:s.slug}}}:null};f=jn.map(b=>x[b]).filter(Sn),t[7]=d,t[8]=m,t[9]=i,t[10]=s,t[11]=a?.id,t[12]=r,t[13]=o,t[14]=e,t[15]=f}else f=t[15];return f}function Sn(t){return t!==null}function kn(t){const e=_.c(7),{onNavigate:s}=t,i=Nn();let o;if(e[0]!==i||e[1]!==s){let r;e[3]!==s?(r=l=>n.jsx(Ce,{icon:l.icon,label:l.label,dataTour:l.dataTour,isActive:l.isActive,link:l.link,onSelect:()=>{E("nav_destination_clicked",{destination:l.trackAs}),s?.()}},l.key),e[3]=s,e[4]=r):r=e[4],o=i.map(r),e[0]=i,e[1]=s,e[2]=o}else o=e[2];let a;return e[5]!==o?(a=n.jsx(z,{className:"gap-1",children:o}),e[5]=o,e[6]=a):a=e[6],a}function _n(t){const e=_.c(18),{onNavigate:s}=t,i=A(),{org:o}=F(),a=Ie(),r=Be(),l=Pe(),c=$t();let m;e[0]!==c||e[1]!==l?(m=l.startsWith("/$org/settings")||l.startsWith($.projects)&&c==="settings",e[0]=c,e[1]=l,e[2]=m):m=e[2];const u=m;let d;e[3]!==i?(d=i("sidebar.navDestinations.settings"),e[3]=i,e[4]=d):d=e[4];const f=d;let x;e[5]!==o||e[6]!==a?(x=a?void 0:{to:"/$org/settings",params:{org:o.slug}},e[5]=o,e[6]=a,e[7]=x):x=e[7];const b=x;let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(it,{size:16}),e[8]=g):g=e[8];let p;e[9]!==r||e[10]!==s||e[11]!==a?(p=()=>{E("nav_destination_clicked",{destination:gn,target:a?"project":"org"}),a&&r(a,{panel:"settings"}),s?.()},e[9]=r,e[10]=s,e[11]=a,e[12]=p):p=e[12];let h;return e[13]!==u||e[14]!==f||e[15]!==b||e[16]!==p?(h=n.jsx(z,{className:"gap-1",children:n.jsx(Ce,{dataTour:le.settings,icon:g,label:f,isActive:u,link:b,onSelect:p})}),e[13]=u,e[14]=f,e[15]=b,e[16]=p,e[17]=h):h=e[17],h}function Pn(t,e){const s=new Set(e);return s.size===0?t:t.filter(i=>s.has(i.connectionId))}function wn(t){const e=t.metadata?.ui;return Array.isArray(e?.pinnedViews)?e.pinnedViews.filter(s=>!!s&&typeof s=="object"&&typeof s.connectionId=="string"&&typeof s.toolName=="string"):[]}function In(t){const e=_.c(12),{onNavigate:s}=t,i=A(),{project:o}=we(),a=Be(),r=Pe(),l=Bs(),c=Ms(o),m=mt(o?.id);if(!o)return null;let u;if(e[0]!==c.presence||e[1]!==m||e[2]!==o.metadata){const x=et(o.metadata),b=m??dt(o.metadata);u=new Set(Ds(b,Rs(x,c.presence),m!==void 0?1:o.metadata.sidebarViewsVersion)),e[0]=c.presence,e[1]=m,e[2]=o.metadata,e[3]=u}else u=e[3];const d=u;let f;if(e[4]!==l||e[5]!==r||e[6]!==a||e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==i){const x=[];d.has("site-editor")&&x.push({key:"site-editor",label:i("sidebar.projectNav.siteEditor"),icon:n.jsx(ot,{size:16}),panel:"site-editor",isActive:$n,dataTour:le.siteEditor});const b={assets:{label:i("common.mainPanelTabs.assets"),icon:n.jsx(Vs,{size:16})},hosting:{label:i("common.mainPanelTabs.hosting"),icon:n.jsx(us,{size:16})},e2e:{label:i("common.mainPanelTabs.e2e"),icon:n.jsx(Zt,{size:16})},analytics:{label:i("common.mainPanelTabs.analytics"),icon:n.jsx(rt,{size:16})},cdn:{label:i("common.mainPanelTabs.cdn"),icon:n.jsx(ms,{size:16})}};for(const p of Es){if(!d.has(p))continue;const h=b[p];x.push({key:p,label:h.label,icon:h.icon,panel:p,isActive:j=>j===p})}for(const p of Pn(wn(o),(o.connections??[]).map(An)))p.toolName!=="fetch_assets"&&x.push({key:`pinned:${p.connectionId}:${p.toolName}`,label:p.label||p.toolName,icon:p.icon?n.jsx("img",{src:p.icon,alt:"",className:"size-4 rounded-[3px]"}):n.jsx(Fs,{size:16}),panel:Le(p.connectionId,p.toolName),isActive:h=>h===Le(p.connectionId,p.toolName)});d.has("automations")&&x.push({key:"automations",label:i("sidebar.projectNav.automations"),icon:n.jsx(ds,{size:16}),panel:"automations",isActive:Cn,dataTour:le.automations});const g=r.startsWith($.projects);f=n.jsx(z,{className:"gap-1",children:x.map(p=>n.jsx(Ce,{icon:p.icon,label:p.label,dataTour:p.dataTour,isActive:g&&p.isActive(l),onSelect:()=>{E("project_nav_clicked",{surface:p.key}),a(o.id,{panel:p.panel}),s?.()}},p.key))}),e[4]=l,e[5]=r,e[6]=a,e[7]=s,e[8]=o,e[9]=d,e[10]=i,e[11]=f}else f=e[11];return f}function Cn(t){return t==="automations"||Tt(t)!==null}function An(t){return t.connection_id}function $n(t){return!!t&&Ks(t)}const Tn=3;function On(t,e){return t.status==="archived"||t.status==="done"?!1:e&&t.assigneeId===e?!0:Is(t)||Cs(t)}function zn(t,e,s){const i=new Map;for(const a of e){if(!On(a,s))continue;const r=Ps(a,t);for(const l of r){const c=i.get(l.id)??[];c.push({task:a,only:r.length===1}),i.set(l.id,c)}}const o=new Map;for(const[a,r]of i)r.sort((l,c)=>Number(c.only)-Number(l.only)||(c.task.updatedAt??"").localeCompare(l.task.updatedAt??"")),o.set(a,r.slice(0,Tn).map(l=>l.task));return o}function Mn(t){const e=_.c(21),{task:s,orgSlug:i,isLast:o,onNavigate:a}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.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 l;e[1]!==o?(l=!o&&n.jsx("span",{"aria-hidden":"true",className:"absolute top-1/2 bottom-0 left-4 border-l border-sidebar-border"}),e[1]=o,e[2]=l):l=e[2];let c;e[3]!==i||e[4]!==s?(c=ws(i,s),e[3]=i,e[4]=s,e[5]=c):c=e[5];let m;e[6]!==i||e[7]!==c?(m={org:i,taskKey:c},e[6]=i,e[7]=c,e[8]=m):m=e[8];let u;e[9]!==a||e[10]!==s.status?(u=()=>{E("sidebar_attention_task_clicked",{status:s.status}),a?.()},e[9]=a,e[10]=s.status,e[11]=u):u=e[11];let d;e[12]!==s.title?(d=n.jsx("span",{className:"truncate",children:s.title}),e[12]=s.title,e[13]=d):d=e[13];let f;e[14]!==m||e[15]!==u||e[16]!==d?(f=n.jsx(Mt,{to:"/$org/tasks/{-$taskKey}",params:m,onClick:u,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:d}),e[14]=m,e[15]=u,e[16]=d,e[17]=f):f=e[17];let x;return e[18]!==l||e[19]!==f?(x=n.jsxs("li",{className:"relative",children:[r,l,f]}),e[18]=l,e[19]=f,e[20]=x):x=e[20],x}function Dn(t){const e=_.c(35),{onNavigate:s}=t,i=A(),o=Ee(),{org:a,locator:r}=F(),l=Ze(),{projects:c}=we(),m=Ie(),u=Be(),{data:d}=ce.useSession();let f;e[0]!==r||e[1]!==l?(f=As(r,l),e[0]=r,e[1]=l,e[2]=f):f=e[2];const x=!o&&!m;let b;e[3]!==f||e[4]!==x?(b={...f,enabled:x},e[3]=f,e[4]=x,e[5]=b):b=e[5];const{data:g}=Ot(b);if(m||c.length===0)return null;let p,h,j,v,y,N;if(e[6]!==o||e[7]!==g?.items||e[8]!==u||e[9]!==s||e[10]!==a||e[11]!==c||e[12]!==m||e[13]!==d?.user?.id||e[14]!==i){const P=zn(_s(c),g?.items??[],d?.user?.id),w=o&&"pt-3";e[21]!==w?(v=O("flex flex-col gap-1",w),e[21]=w,e[22]=v):v=e[22],y=le.projects,e[23]!==o||e[24]!==i?(N=!o&&n.jsx("p",{className:"px-2 pt-5 pb-0.5 text-xs font-medium text-muted-foreground/60",children:i("sidebar.projects.heading")}),e[23]=o,e[24]=i,e[25]=N):N=e[25],p=z,h="gap-1",j=c.map(I=>{const C=P.get(I.id)??[];return n.jsx(Ce,{icon:n.jsx(Ls,{icon:I.icon,name:I.title}),label:I.title,isActive:I.id===m,onSelect:()=>{E("sidebar_project_clicked"),u(I.id,{panel:zt(I.metadata?.ui?.layout)}),s?.()},children:!o&&C.length>0&&n.jsx("ul",{className:"flex flex-col",children:C.map((T,V)=>n.jsx(Mn,{task:T,orgSlug:a.slug,isLast:V===C.length-1,onNavigate:s},T.id))})},I.id)}),e[6]=o,e[7]=g?.items,e[8]=u,e[9]=s,e[10]=a,e[11]=c,e[12]=m,e[13]=d?.user?.id,e[14]=i,e[15]=p,e[16]=h,e[17]=j,e[18]=v,e[19]=y,e[20]=N}else p=e[15],h=e[16],j=e[17],v=e[18],y=e[19],N=e[20];let S;e[26]!==p||e[27]!==h||e[28]!==j?(S=n.jsx(p,{className:h,children:j}),e[26]=p,e[27]=h,e[28]=j,e[29]=S):S=e[29];let k;return e[30]!==v||e[31]!==y||e[32]!==N||e[33]!==S?(k=n.jsxs("div",{className:v,"data-tour":y,children:[N,S]}),e[30]=v,e[31]=y,e[32]=N,e[33]=S,e[34]=k):k=e[34],k}function bt(t){const e=_.c(8),{onNavigate:s}=t,i=A(),o=Ie(),a=qs();if(!o)return null;let r;e[0]!==i?(r=i("sidebar.scope.allProjects"),e[0]=i,e[1]=r):r=e[1];let l;e[2]!==a||e[3]!==s?(l=()=>{a(),s?.()},e[2]=a,e[3]=s,e[4]=l):l=e[4];let c;return e[5]!==r||e[6]!==l?(c=n.jsx(qt,{label:r,onSelect:l}),e[5]=r,e[6]=l,e[7]=c):c=e[7],c}function ht(t){const e=_.c(2),{onNavigate:s}=t;let i;return e[0]!==s?(i=n.jsx(Dt,{children:n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(kn,{onNavigate:s}),n.jsx(In,{onNavigate:s}),n.jsx(_n,{onNavigate:s}),n.jsx(Dn,{onNavigate:s})]})}),e[0]=s,e[1]=i):i=e[1],i}function Po(){const t=_.c(3),e=Et();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Ft,{}),t[0]=s):s=t[0];let i;return t[1]!==e?(i=n.jsx(tt,{header:s,back:e?n.jsx(Kt,{}):n.jsx(bt,{}),body:e?n.jsx(Bt,{}):n.jsx(ht,{}),footer:e?n.jsx(Vt,{}):n.jsx(bn,{})}),t[1]=e,t[2]=i):i=t[2],i}function wo(t){const e=_.c(9),{onClose:s}=t;let i,o,a;e[0]!==s?(i=n.jsx(Lt,{onClose:s}),o=n.jsx(bt,{onNavigate:s}),a=n.jsx(ht,{onNavigate:s}),e[0]=s,e[1]=i,e[2]=o,e[3]=a):(i=e[1],o=e[2],a=e[3]);let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(hn,{}),e[4]=r):r=e[4];let l;return e[5]!==i||e[6]!==o||e[7]!==a?(l=n.jsx(tt,{sheet:!0,header:i,back:o,body:a,footer:r}),e[5]=i,e[6]=o,e[7]=a,e[8]=l):l=e[8],l}export{Po as S,wo as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as B,a0 as D,a1 as We,T as H,a2 as je,a3 as A,a4 as U,k as W,a5 as G,a6 as J,a7 as me,a8 as qe,a9 as we,aa as Xe,E as be,ab as Ye,ac as Ge,f as ve}from"./usage-stats-D5mXC24B.js";import{eW as ye,f0 as Ce,eV as Se,f1 as Re,f2 as Ee,f3 as Te,f4 as Oe,f5 as Ie,eX as Ae,aI as Me,r as C,ar as ze}from"./index-6GXqHE0w.js";let Z,Q;if(typeof WeakMap<"u"){let e=new WeakMap;Z=t=>e.get(t),Q=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;Z=o=>{for(let i=0;i<e.length;i+=2)if(e[i]==o)return e[i+1]},Q=(o,i)=>(n==10&&(n=0),e[n++]=o,e[n++]=i)}var v=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,i=t/this.width|0;let s=o+1,l=i+1;for(let r=1;s<this.width&&this.map[t+r]==n;r++)s++;for(let r=1;l<this.height&&this.map[t+this.width*r]==n;r++)l++;return{left:o,top:i,right:s,bottom:l}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:i,top:s,bottom:l}=this.findCell(e);return t=="horiz"?(n<0?o==0:i==this.width)?null:this.map[s*this.width+(n<0?o-1:i)]:(n<0?s==0:l==this.height)?null:this.map[o+this.width*(n<0?s-1:l)]}rectBetween(e,t){const{left:n,right:o,top:i,bottom:s}=this.findCell(e),{left:l,right:r,top:a,bottom:c}=this.findCell(t);return{left:Math.min(n,l),top:Math.min(i,a),right:Math.max(o,r),bottom:Math.max(s,c)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let i=e.left;i<e.right;i++){const s=o*this.width+i,l=this.map[s];n[l]||(n[l]=!0,!(i==e.left&&i&&this.map[s-1]==l||o==e.top&&o&&this.map[s-this.width]==l)&&t.push(l))}return t}positionAt(e,t,n){for(let o=0,i=0;;o++){const s=i+n.child(o).nodeSize;if(o==e){let l=t+e*this.width;const r=(e+1)*this.width;for(;l<r&&this.map[l]<i;)l++;return l==r?s-1:this.map[l]}i=s}}static get(e){return Z(e)||Q(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ze(e),n=e.childCount,o=[];let i=0,s=null;const l=[];for(let c=0,u=t*n;c<u;c++)o[c]=0;for(let c=0,u=0;c<n;c++){const d=e.child(c);u++;for(let p=0;;p++){for(;i<o.length&&o[i]!=0;)i++;if(p==d.childCount)break;const g=d.child(p),{colspan:m,rowspan:w,colwidth:R}=g.attrs;for(let y=0;y<w;y++){if(y+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:w-y});break}const T=i+y*t;for(let O=0;O<m;O++){o[T+O]==0?o[T+O]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:m-O});const L=R&&R[O];if(L){const $=(T+O)%t*2,q=l[$];q==null||q!=L&&l[$+1]==1?(l[$]=L,l[$+1]=1):q==L&&l[$+1]++}}}i+=m,u+=g.nodeSize}const h=(c+1)*t;let f=0;for(;i<h;)o[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:c,n:f}),u++}(t===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const r=new v(t,n,o,s);let a=!1;for(let c=0;!a&&c<l.length;c+=2)l[c]!=null&&l[c+1]<n&&(a=!0);return a&&Qe(r,l,e),r}function Ze(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const i=e.child(o);let s=0;if(n)for(let l=0;l<o;l++){const r=e.child(l);for(let a=0;a<r.childCount;a++){const c=r.child(a);l+c.attrs.rowspan>o&&(s+=c.attrs.colspan)}}for(let l=0;l<i.childCount;l++){const r=i.child(l);s+=r.attrs.colspan,r.attrs.rowspan>1&&(n=!0)}t==-1?t=s:t!=s&&(t=Math.max(t,s))}return t}function Qe(e,t,n){e.problems||(e.problems=[]);const o={};for(let i=0;i<e.map.length;i++){const s=e.map[i];if(o[s])continue;o[s]=!0;const l=n.nodeAt(s);if(!l)throw new RangeError(`No cell with offset ${s} found`);let r=null;const a=l.attrs;for(let c=0;c<a.colspan;c++){const u=t[(i+c)%e.width*2];u!=null&&(!a.colwidth||a.colwidth[c]!=u)&&((r||(r=et(a)))[c]=u)}r&&e.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:r})}}function et(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function S(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],i=o.spec.tableRole;i&&(t[i]=o)}}return t}const x=new B("selectingCells");function N(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function tt(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function I(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function j(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=N(t.$head)||nt(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function nt(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ee(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function ot(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function De(e,t,n){const o=e.node(-1),i=v.get(o),s=e.start(-1),l=i.nextCell(e.pos-s,t,n);return l==null?null:e.node(0).resolve(s+l)}function P(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(i=>i>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let i=0;i<n;i++)o.colwidth.splice(t,0,0)}return o}function it(e,t,n){const o=S(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=o)return!1;return!0}var b=class z extends D{constructor(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.rectBetween(t.pos-s,n.pos-s),r=t.node(0),a=i.cellsInRect(l).filter(u=>u!=n.pos-s);a.unshift(n.pos-s);const c=a.map(u=>{const d=o.nodeAt(u);if(!d)throw new RangeError(`No cell with offset ${u} found`);const h=s+u+1;return new je(r.resolve(h),r.resolve(h+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(ee(o)&&ee(i)&&ie(o,i)){const s=this.$anchorCell.node(-1)!=o.node(-1);return s&&this.isRowSelection()?z.rowSelection(o,i):s&&this.isColSelection()?z.colSelection(o,i):new z(o,i)}return H.between(o,i)}content(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),s={},l=[];for(let a=i.top;a<i.bottom;a++){const c=[];for(let u=a*n.width+i.left,d=i.left;d<i.right;d++,u++){const h=n.map[u];if(s[h])continue;s[h]=!0;const f=n.findCell(h);let p=t.nodeAt(h);if(!p)throw new RangeError(`No cell with offset ${h} found`);const g=i.left-f.left,m=f.right-i.right;if(g>0||m>0){let w=p.attrs;if(g>0&&(w=P(w,0,g)),m>0&&(w=P(w,w.colspan-m,m)),f.left<i.left){if(p=p.type.createAndFill(w),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else p=p.type.create(w,p.content)}if(f.top<i.top||f.bottom>i.bottom){const w={...p.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?p=p.type.createAndFill(w):p=p.type.create(w,p.content)}c.push(p)}l.push(t.child(a).copy(A.from(c)))}const r=this.isColSelection()&&this.isRowSelection()?t:l;return new U(A.from(r),1,1)}replace(t,n=U.empty){const o=t.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){const{$from:r,$to:a}=i[l],c=t.mapping.slice(o);t.replace(c.map(r.pos),c.map(a.pos),l?U.empty:n)}const s=D.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);s&&t.setSelection(s)}replaceWith(t,n){this.replace(t,new U(A.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=v.get(n),i=this.$anchorCell.start(-1),s=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let l=0;l<s.length;l++)t(n.nodeAt(s[l]),i+s[l])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.top<=r.top?(l.top>0&&(t=a.resolve(s+i.map[l.left])),r.bottom<i.height&&(n=a.resolve(s+i.map[i.width*(i.height-1)+r.right-1]))):(r.top>0&&(n=a.resolve(s+i.map[r.left])),l.bottom<i.height&&(t=a.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))),new z(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-o),s=n.colCount(this.$headCell.pos-o);if(Math.min(i,s)>0)return!1;const l=i+this.$anchorCell.nodeAfter.attrs.colspan,r=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(l,r)==n.width}eq(t){return t instanceof z&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.left<=r.left?(l.left>0&&(t=a.resolve(s+i.map[l.top*i.width])),r.right<i.width&&(n=a.resolve(s+i.map[i.width*(r.top+1)-1]))):(r.left>0&&(n=a.resolve(s+i.map[r.top*i.width])),l.right<i.width&&(t=a.resolve(s+i.map[i.width*(l.top+1)-1]))),new z(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new z(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new z(t.resolve(n),t.resolve(o))}getBookmark(){return new st(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;D.jsonID("cell",b);var st=class Ue{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Ue(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):D.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(J.node(o,o+n.nodeSize,{class:"selectedCell"}))}),G.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let s=t.depth;s>=0&&!(t.before(s+1)>t.start(s));s--,o--);return n==o&&/row|table/.test(e.node(i).type.spec.tableRole)}function at({$from:e,$to:t}){let n,o;for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){o=s;break}}return n!==o&&t.parentOffset===0}function ct(e,t,n){const o=(t||e).selection,i=(t||e).doc;let s,l;if(o instanceof me&&(l=o.node.type.spec.tableRole)){if(l=="cell"||l=="header_cell")s=b.create(i,o.from);else if(l=="row"){const r=i.resolve(o.from+1);s=b.rowSelection(r,r)}else if(!n){const r=v.get(o.node),a=o.from+1,c=a+r.map[r.width*r.height-1];s=b.create(i,a+1,c)}}else o instanceof H&&rt(o)?s=H.create(i,o.from):o instanceof H&&at(o)&&(s=H.create(i,o.$from.start(),o.$from.end()));return s&&(t||(t=e.tr)).setSelection(s),t}const dt=new B("fix-tables");function He(e,t,n,o){const i=e.childCount,s=t.childCount;e:for(let l=0,r=0;l<s;l++){const a=t.child(l);for(let c=r,u=Math.min(i,l+3);c<u;c++)if(e.child(c)==a){r=c+1,n+=a.nodeSize;continue e}o(a,n),r<i&&e.child(r).sameMarkup(a)?He(e.child(r),a,n+1,o):a.nodesBetween(0,a.content.size,o,n+1),n+=a.nodeSize}}function ut(e,t){let n;const o=(i,s)=>{i.type.spec.tableRole=="table"&&(n=ht(e,i,s,n))};return t?t.doc!=e.doc&&He(t.doc,e.doc,0,o):e.doc.descendants(o),n}function ht(e,t,n,o){const i=v.get(t);if(!i.problems)return o;o||(o=e.tr);const s=[];for(let a=0;a<i.height;a++)s.push(0);for(let a=0;a<i.problems.length;a++){const c=i.problems[a];if(c.type=="collision"){const u=t.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let h=0;h<d.rowspan;h++)s[c.row+h]+=c.n;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,P(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=o.mapping.map(n);o.delete(u,u+t.nodeSize)}}let l,r;for(let a=0;a<s.length;a++)s[a]&&(l==null&&(l=a),r=a);for(let a=0,c=n+1;a<i.height;a++){const u=t.child(a),d=c+u.nodeSize,h=s[a];if(h>0){let f="cell";u.firstChild&&(f=u.firstChild.type.spec.tableRole);const p=[];for(let m=0;m<h;m++){const w=S(e.schema)[f].createAndFill();w&&p.push(w)}const g=(a==0||l==a-1)&&r==a?c+1:d-1;o.insert(o.mapping.map(g),p)}c=d}return o.setMeta(dt,{fixTables:!0})}function M(e){const t=e.selection,n=j(e),o=n.node(-1),i=n.start(-1),s=v.get(o);return{...t instanceof b?s.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:o}}function Ne(e,{map:t,tableStart:n,table:o},i){let s=i>0?-1:0;it(t,o,i+s)&&(s=i==0||i==t.width?null:0);for(let l=0;l<t.height;l++){const r=l*t.width+i;if(i>0&&i<t.width&&t.map[r-1]==t.map[r]){const a=t.map[r],c=o.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,xe(c.attrs,i-t.colCount(a))),l+=c.attrs.rowspan-1}else{const a=s==null?S(o.type.schema).cell:o.nodeAt(t.map[r+s]).type,c=t.positionAt(l,i,o);e.insert(e.mapping.map(n+c),a.createAndFill())}}return e}function an(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.left))}return!0}function cn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},i){const s=e.mapping.maps.length;for(let l=0;l<t.height;){const r=l*t.width+i,a=t.map[r],c=n.nodeAt(a),u=c.attrs;if(i>0&&t.map[r-1]==a||i<t.width-1&&t.map[r+1]==a)e.setNodeMarkup(e.mapping.slice(s).map(o+a),null,P(u,i-t.colCount(a)));else{const d=e.mapping.slice(s).map(o+a);e.delete(d,d+c.nodeSize)}l+=u.rowspan}}function dn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;ft(o,n,i),i!=n.left;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(s)}t(o)}return!0}function pt(e,t,n){var o;const i=S(t.type.schema).header_cell;for(let s=0;s<e.width;s++)if(((o=t.nodeAt(e.map[s+n*e.width]))===null||o===void 0?void 0:o.type)!=i)return!1;return!0}function Pe(e,{map:t,tableStart:n,table:o},i){let s=n;for(let c=0;c<i;c++)s+=o.child(c).nodeSize;const l=[];let r=i>0?-1:0;pt(t,o,i+r)&&(r=i==0||i==t.height?null:0);for(let c=0,u=t.width*i;c<t.width;c++,u++)if(i>0&&i<t.height&&t.map[u]==t.map[u-t.width]){const d=t.map[u],h=o.nodeAt(d).attrs;e.setNodeMarkup(n+d,null,{...h,rowspan:h.rowspan+1}),c+=h.colspan-1}else{var a;const d=r==null?S(o.type.schema).cell:(a=o.nodeAt(t.map[u+r*t.width]))===null||a===void 0?void 0:a.type,h=d?.createAndFill();h&&l.push(h)}return e.insert(s,S(o.type.schema).row.create(null,l)),e}function un(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.top))}return!0}function hn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.bottom))}return!0}function gt(e,{map:t,table:n,tableStart:o},i){let s=0;for(let c=0;c<i;c++)s+=n.child(c).nodeSize;const l=s+n.child(i).nodeSize,r=e.mapping.maps.length;e.delete(s+o,l+o);const a=new Set;for(let c=0,u=i*t.width;c<t.width;c++,u++){const d=t.map[u];if(!a.has(d)){if(a.add(d),i>0&&d==t.map[u-t.width]){const h=n.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h,rowspan:h.rowspan-1}),c+=h.colspan-1}else if(i<t.height&&d==t.map[u+t.width]){const h=n.nodeAt(d),f=h.attrs,p=h.type.create({...f,rowspan:h.attrs.rowspan-1},h.content),g=t.positionAt(i+1,c,n);e.insert(e.mapping.slice(r).map(o+g),p),c+=f.colspan-1}}}}function fn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;gt(o,n,i),i!=n.top;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(n.table)}t(o)}return!0}function le(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function mt({width:e,height:t,map:n},o){let i=o.top*e+o.left,s=i,l=(o.bottom-1)*e+o.left,r=i+(o.right-o.left-1);for(let a=o.top;a<o.bottom;a++){if(o.left>0&&n[s]==n[s-1]||o.right<e&&n[r]==n[r+1])return!0;s+=e,r+=e}for(let a=o.left;a<o.right;a++){if(o.top>0&&n[i]==n[i-e]||o.bottom<t&&n[l]==n[l+e])return!0;i++,l++}return!1}function pn(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=M(e),{map:i}=o;if(mt(i,o))return!1;if(t){const s=e.tr,l={};let r=A.empty,a,c;for(let u=o.top;u<o.bottom;u++)for(let d=o.left;d<o.right;d++){const h=i.map[u*i.width+d],f=o.table.nodeAt(h);if(!(l[h]||!f))if(l[h]=!0,a==null)a=h,c=f;else{le(f)||(r=r.append(f.content));const p=s.mapping.map(h+o.tableStart);s.delete(p,p+f.nodeSize)}}if(a==null||c==null)return!0;if(s.setNodeMarkup(a+o.tableStart,null,{...xe(c.attrs,c.attrs.colspan,o.right-o.left-c.attrs.colspan),rowspan:o.bottom-o.top}),r.size>0){const u=a+1+c.content.size,d=le(c)?a+1:u;s.replaceWith(d+o.tableStart,u+o.tableStart,r)}s.setSelection(new b(s.doc.resolve(a+o.tableStart))),t(s)}return!0}function gn(e,t){const n=S(e.schema);return wt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function wt(e){return(t,n)=>{const o=t.selection;let i,s;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{var l;if(i=tt(o.$from),!i)return!1;s=(l=N(o.$from))===null||l===void 0?void 0:l.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let r=i.attrs;const a=[],c=r.colwidth;r.rowspan>1&&(r={...r,rowspan:1}),r.colspan>1&&(r={...r,colspan:1});const u=M(t),d=t.tr;for(let f=0;f<u.right-u.left;f++)a.push(c?{...r,colwidth:c&&c[f]?[c[f]]:null}:r);let h;for(let f=u.top;f<u.bottom;f++){let p=u.map.positionAt(f,u.left,u.table);f==u.top&&(p+=i.nodeSize);for(let g=u.left,m=0;g<u.right;g++,m++)g==u.left&&f==u.top||d.insert(h=d.mapping.map(p+u.tableStart,1),e({node:i,row:f,col:g}).createAndFill(a[m]))}d.setNodeMarkup(s,e({node:i,row:u.top,col:u.left}),a[0]),o instanceof b&&d.setSelection(new b(d.doc.resolve(o.$anchorCell.pos),h?d.doc.resolve(h):void 0)),n(d)}return!0}}function mn(e,t){return function(n,o){if(!I(n))return!1;const i=j(n);if(i.nodeAfter.attrs[e]===t)return!1;if(o){const s=n.tr;n.selection instanceof b?n.selection.forEachCell((l,r)=>{l.attrs[e]!==t&&s.setNodeMarkup(r,null,{...l.attrs,[e]:t})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),o(s)}return!0}}function bt(e){return function(t,n){if(!I(t))return!1;if(n){const o=S(t.schema),i=M(t),s=t.tr,l=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),r=l.map(a=>i.table.nodeAt(a));for(let a=0;a<l.length;a++)r[a].type==o.header_cell&&s.setNodeMarkup(i.tableStart+l[a],o.cell,r[a].attrs);if(s.steps.length===0)for(let a=0;a<l.length;a++)s.setNodeMarkup(i.tableStart+l[a],o.header_cell,r[a].attrs);n(s)}return!0}}function re(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let i=0;i<o.length;i++){const s=t.table.nodeAt(o[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function se(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?bt(e):function(n,o){if(!I(n))return!1;if(o){const i=S(n.schema),s=M(n),l=n.tr,r=re("row",s,i),a=re("column",s,i),c=(e==="column"?r:e==="row"&&a)?1:0,u=e=="column"?{left:0,top:c,right:1,bottom:s.map.height}:e=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=e=="column"?a?i.cell:i.header_cell:e=="row"?r?i.cell:i.header_cell:i.cell;s.map.cellsInRect(u).forEach(h=>{const f=h+s.tableStart,p=l.doc.nodeAt(f);p&&l.setNodeMarkup(f,d,p.attrs)}),o(l)}return!0}}se("row",{useDeprecatedLogic:!0});se("column",{useDeprecatedLogic:!0});const wn=se("cell",{useDeprecatedLogic:!0});function vt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,i=e.before();o>=0;o--){const s=e.node(-1).child(o),l=s.lastChild;if(l)return i-1-l.nodeSize;i-=s.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),i=e.after();o<n.childCount;o++){const s=n.child(o);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function bn(e){return function(t,n){if(!I(t))return!1;const o=vt(j(t),e);if(o==null)return!1;if(n){const i=t.doc.resolve(o);n(t.tr.setSelection(H.between(i,ot(i))).scrollIntoView())}return!0}}function vn(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function V(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,i=S(e.schema).cell.createAndFill().content;n.forEachCell((s,l)=>{s.content.eq(i)||o.replace(o.mapping.map(l+1),o.mapping.map(l+s.nodeSize-1),new U(i,0,0))}),o.docChanged&&t(o)}return!0}function yt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const i=t.child(0),s=i.type.spec.tableRole,l=i.type.schema,r=[];if(s=="row")for(let a=0;a<t.childCount;a++){let c=t.child(a).content;const u=a?0:Math.max(0,n-1),d=a<t.childCount-1?0:Math.max(0,o-1);(u||d)&&(c=te(S(l).row,new U(c,u,d)).content),r.push(c)}else if(s=="cell"||s=="header_cell")r.push(n||o?te(S(l).row,new U(t,n,o)).content:t);else return null;return Ct(l,r)}function Ct(e,t){const n=[];for(let i=0;i<t.length;i++){const s=t[i];for(let l=s.childCount-1;l>=0;l--){const{rowspan:r,colspan:a}=s.child(l).attrs;for(let c=i;c<i+r;c++)n[c]=(n[c]||0)+a}}let o=0;for(let i=0;i<n.length;i++)o=Math.max(o,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(A.empty),n[i]<o){const s=S(e).cell.createAndFill(),l=[];for(let r=n[i];r<o;r++)l.push(s);t[i]=t[i].append(A.from(l))}return{height:t.length,width:o,rows:t}}function te(e,t){const n=e.createAndFill();return new qe(n).replace(0,n.content.size,t).doc}function St({width:e,height:t,rows:n},o,i){if(e!=o){const s=[],l=[];for(let r=0;r<n.length;r++){const a=n[r],c=[];for(let u=s[r]||0,d=0;u<o;d++){let h=a.child(d%a.childCount);u+h.attrs.colspan>o&&(h=h.type.createChecked(P(h.attrs,h.attrs.colspan,u+h.attrs.colspan-o),h.content)),c.push(h),u+=h.attrs.colspan;for(let f=1;f<h.attrs.rowspan;f++)s[r+f]=(s[r+f]||0)+h.attrs.colspan}l.push(A.from(c))}n=l,e=o}if(t!=i){const s=[];for(let l=0,r=0;l<i;l++,r++){const a=[],c=n[r%t];for(let u=0;u<c.childCount;u++){let d=c.child(u);l+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),a.push(d)}s.push(A.from(a))}n=s,t=i}return{width:e,height:t,rows:n}}function Rt(e,t,n,o,i,s,l){const r=e.doc.type.schema,a=S(r);let c,u;if(i>t.width)for(let d=0,h=0;d<t.height;d++){const f=n.child(d);h+=f.nodeSize;const p=[];let g;f.lastChild==null||f.lastChild.type==a.cell?g=c||(c=a.cell.createAndFill()):g=u||(u=a.header_cell.createAndFill());for(let m=t.width;m<i;m++)p.push(g);e.insert(e.mapping.slice(l).map(h-1+o),p)}if(s>t.height){const d=[];for(let p=0,g=(t.height-1)*t.width;p<Math.max(t.width,i);p++){const m=p>=t.width?!1:n.nodeAt(t.map[g+p]).type==a.header_cell;d.push(m?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const h=a.row.create(null,A.from(d)),f=[];for(let p=t.height;p<s;p++)f.push(h);e.insert(e.mapping.slice(l).map(o+n.nodeSize-2),f)}return!!(c||u)}function ae(e,t,n,o,i,s,l,r){if(l==0||l==t.height)return!1;let a=!1;for(let c=i;c<s;c++){const u=l*t.width+c,d=t.map[u];if(t.map[u-t.width]==d){a=!0;const h=n.nodeAt(d),{top:f,left:p}=t.findCell(d);e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h.attrs,rowspan:l-f}),e.insert(e.mapping.slice(r).map(t.positionAt(l,p,n)),h.type.createAndFill({...h.attrs,rowspan:f+h.attrs.rowspan-l})),c+=h.attrs.colspan-1}}return a}function ce(e,t,n,o,i,s,l,r){if(l==0||l==t.width)return!1;let a=!1;for(let c=i;c<s;c++){const u=c*t.width+l,d=t.map[u];if(t.map[u-1]==d){a=!0;const h=n.nodeAt(d),f=t.colCount(d),p=e.mapping.slice(r).map(d+o);e.setNodeMarkup(p,null,P(h.attrs,l-f,h.attrs.colspan-(l-f))),e.insert(p+h.nodeSize,h.type.createAndFill(P(h.attrs,0,l-f))),c+=h.attrs.rowspan-1}}return a}function de(e,t,n,o,i){let s=n?e.doc.nodeAt(n-1):e.doc;if(!s)throw new Error("No table found");let l=v.get(s);const{top:r,left:a}=o,c=a+i.width,u=r+i.height,d=e.tr;let h=0;function f(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");l=v.get(s),h=d.mapping.maps.length}Rt(d,l,s,n,c,u,h)&&f(),ae(d,l,s,n,a,c,r,h)&&f(),ae(d,l,s,n,a,c,u,h)&&f(),ce(d,l,s,n,r,u,a,h)&&f(),ce(d,l,s,n,r,u,c,h)&&f();for(let p=r;p<u;p++){const g=l.positionAt(p,a,s),m=l.positionAt(p,c,s);d.replace(d.mapping.slice(h).map(g+n),d.mapping.slice(h).map(m+n),new U(i.rows[p-r],0,0))}f(),d.setSelection(new b(d.doc.resolve(n+l.positionAt(r,a,s)),d.doc.resolve(n+l.positionAt(u-1,c-1,s)))),t(d)}const Et=We({ArrowLeft:K("horiz",-1),ArrowRight:K("horiz",1),ArrowUp:K("vert",-1),ArrowDown:K("vert",1),"Shift-ArrowLeft":k("horiz",-1),"Shift-ArrowRight":k("horiz",1),"Shift-ArrowUp":k("vert",-1),"Shift-ArrowDown":k("vert",1),Backspace:V,"Mod-Backspace":V,Delete:V,"Mod-Delete":V});function _(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function K(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof b)return _(n,o,D.near(s.$headCell,t));if(e!="horiz"&&!s.empty)return!1;const l=Le(i,e,t);if(l==null)return!1;if(e=="horiz")return _(n,o,D.near(n.doc.resolve(s.head+t),t));{const r=n.doc.resolve(l),a=De(r,e,t);let c;return a?c=D.near(a,1):t<0?c=D.near(n.doc.resolve(r.before(-1)),-1):c=D.near(n.doc.resolve(r.after(-1)),1),_(n,o,c)}}}function k(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;let l;if(s instanceof b)l=s;else{const a=Le(i,e,t);if(a==null)return!1;l=new b(n.doc.resolve(a))}const r=De(l.$headCell,e,t);return r?_(n,o,new b(l.$anchorCell,r)):!1}}function Tt(e,t){const n=e.state.doc,o=N(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function Ot(e,t,n){if(!I(e.state))return!1;let o=yt(n);const i=e.state.selection;if(i instanceof b){o||(o={width:1,height:1,rows:[A.from(te(S(e.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),l=i.$anchorCell.start(-1),r=v.get(s).rectBetween(i.$anchorCell.pos-l,i.$headCell.pos-l);return o=St(o,r.right-r.left,r.bottom-r.top),de(e.state,e.dispatch,l,r,o),!0}else if(o){const s=j(e.state),l=s.start(-1);return de(e.state,e.dispatch,l,v.get(s.node(-1)).findCell(s.pos-l),o),!0}else return!1}function It(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ue(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof b)s(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(i=N(e.state.selection.$anchor))!=null&&((n=X(e,t))===null||n===void 0?void 0:n.pos)!=i.pos)s(i,t),t.preventDefault();else if(!o)return;function s(a,c){let u=X(e,c);const d=x.getState(e.state)==null;if(!u||!ie(a,u))if(d)u=a;else return;const h=new b(a,u);if(d||!e.state.selection.eq(h)){const f=e.state.tr.setSelection(h);d&&f.setMeta(x,a.pos),e.dispatch(f)}}function l(){e.root.removeEventListener("mouseup",l),e.root.removeEventListener("dragstart",l),e.root.removeEventListener("mousemove",r),x.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(x,-1))}function r(a){const c=a,u=x.getState(e.state);let d;if(u!=null)d=e.state.doc.resolve(u);else if(ue(e,c.target)!=o&&(d=X(e,t),!d))return l();d&&s(d,c)}e.root.addEventListener("mouseup",l),e.root.addEventListener("dragstart",l),e.root.addEventListener("mousemove",r)}function Le(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let i=o.depth-1;i>=0;i--){const s=o.node(i);if((n<0?o.index(i):o.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=o.before(i),r=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(r)?l:null}}return null}function ue(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function X(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:i}=n;return o>=0&&N(e.state.doc.resolve(o))||N(e.state.doc.resolve(i))}var At=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ne(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,ne(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function ne(e,t,n,o,i,s){let l=0,r=!0,a=t.firstChild;const c=e.firstChild;if(c){for(let d=0,h=0;d<c.childCount;d++){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let g=0;g<f;g++,h++){const m=i==h?s:p&&p[g],w=m?m+"px":"";if(l+=m||o,m||(r=!1),a)a.style.width!=w&&(a.style.width=w),a=a.nextSibling;else{const R=document.createElement("col");R.style.width=w,t.appendChild(R)}}}for(;a;){var u;const d=a.nextSibling;(u=a.parentNode)===null||u===void 0||u.removeChild(a),a=d}r?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}const E=new B("tableColumnResizing");function yn({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=At,lastColumnResizable:i=!0}={}){const s=new W({key:E,state:{init(l,r){var a;const c=(a=s.spec)===null||a===void 0||(a=a.props)===null||a===void 0?void 0:a.nodeViews,u=S(r.schema).table.name;return o&&c&&(c[u]=(d,h)=>new o(d,n,h)),new Mt(-1,!1)},apply(l,r){return r.apply(l)}},props:{attributes:l=>{const r=E.getState(l);return r&&r.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(l,r)=>{zt(l,r,e,i)},mouseleave:l=>{Dt(l)},mousedown:(l,r)=>{xt(l,r,t,n)}},decorations:l=>{const r=E.getState(l);if(r&&r.activeHandle>-1)return Lt(l,r.activeHandle)},nodeViews:{}}});return s}var Mt=class F{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(E);if(o&&o.setHandle!=null)return new F(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new F(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return ee(t.doc.resolve(i))||(i=-1),new F(i,n.dragging)}return n}};function zt(e,t,n,o){if(!e.editable)return;const i=E.getState(e.state);if(i&&!i.dragging){const s=Ht(t.target);let l=-1;if(s){const{left:r,right:a}=s.getBoundingClientRect();t.clientX-r<=n?l=he(e,t,"left",n):a-t.clientX<=n&&(l=he(e,t,"right",n))}if(l!=i.activeHandle){if(!o&&l!==-1){const r=e.state.doc.resolve(l),a=r.node(-1),c=v.get(a),u=r.start(-1);if(c.colCount(r.pos-u)+r.nodeAfter.attrs.colspan-1==c.width-1)return}Be(e,l)}}}function Dt(e){if(!e.editable)return;const t=E.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&Be(e,-1)}function xt(e,t,n,o){var i;if(!e.editable)return!1;const s=(i=e.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,l=E.getState(e.state);if(!l||l.activeHandle==-1||l.dragging)return!1;const r=e.state.doc.nodeAt(l.activeHandle),a=Ut(e,l.activeHandle,r.attrs);e.dispatch(e.state.tr.setMeta(E,{setDragging:{startX:t.clientX,startWidth:a}}));function c(d){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",u);const h=E.getState(e.state);h?.dragging&&(Nt(e,h.activeHandle,fe(h.dragging,d,n)),e.dispatch(e.state.tr.setMeta(E,{setDragging:null})))}function u(d){if(!d.which)return c(d);const h=E.getState(e.state);if(h&&h.dragging){const f=fe(h.dragging,d,n);pe(e,h.activeHandle,f,o)}}return pe(e,l.activeHandle,a,o),s.addEventListener("mouseup",c),s.addEventListener("mousemove",u),t.preventDefault(),!0}function Ut(e,t,{colspan:n,colwidth:o}){const i=o&&o[o.length-1];if(i)return i;const s=e.domAtPos(t);let l=s.node.childNodes[s.offset].offsetWidth,r=n;if(o)for(let a=0;a<n;a++)o[a]&&(l-=o[a],r--);return l/r}function Ht(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function he(e,t,n,o){const i=n=="right"?-o:o,s=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!s)return-1;const{pos:l}=s,r=N(e.state.doc.resolve(l));if(!r)return-1;if(n=="right")return r.pos;const a=v.get(r.node(-1)),c=r.start(-1),u=a.map.indexOf(r.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function fe(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function Be(e,t){e.dispatch(e.state.tr.setMeta(E,{setHandle:t}))}function Nt(e,t,n){const o=e.state.doc.resolve(t),i=o.node(-1),s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+r;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],h=i.nodeAt(d).attrs,f=h.colspan==1?0:r-s.colCount(d);if(h.colwidth&&h.colwidth[f]==n)continue;const p=h.colwidth?h.colwidth.slice():Pt(h.colspan);p[f]=n,a.setNodeMarkup(l+d,null,{...h,colwidth:p})}a.docChanged&&e.dispatch(a)}function pe(e,t,n,o){const i=e.state.doc.resolve(t),s=i.node(-1),l=i.start(-1),r=v.get(s).colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;let a=e.domAtPos(i.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&ne(s,a.firstChild,a,o,r,n)}function Pt(e){return Array(e).fill(0)}function Lt(e,t){const n=[],o=e.doc.resolve(t),i=o.node(-1);if(!i)return G.empty;const s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=r+c*s.width;if((r==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){var a;const d=s.map[u],h=l+d+i.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",!((a=E.getState(e))===null||a===void 0)&&a.dragging&&n.push(J.node(l+d,l+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(J.widget(h,f))}}return G.create(e.doc,n)}function Cn({allowTableNodeSelection:e=!1}={}){return new W({key:x,state:{init(){return null},apply(t,n){const o=t.getMeta(x);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:i,pos:s}=t.mapping.mapResult(n);return i?null:s}},props:{decorations:lt,handleDOMEvents:{mousedown:It},createSelectionBetween(t){return x.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Tt,handleKeyDown:Et,handlePaste:Ot},appendTransaction(t,n,o){return ct(o,ut(o,n),e)}})}function Bt(e,t){const n=Math.min(e.top,t.top),o=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),s=Math.max(e.right,t.right)-i,l=o-n;return new DOMRect(i,n,s,l)}var $t=class{get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,t;const{selection:n}=this.editor.state,o=(e=this.getReferencedVirtualElement)===null||e===void 0?void 0:e.call(this);if(o)return o;if(!(!((t=this.view)===null||t===void 0||(t=t.dom)===null||t===void 0)&&t.parentNode))return;const i=we(this.view,n.from,n.to);let s={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(n instanceof me){let l=this.view.nodeDOM(n.from);const r=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");r&&(l=r),l&&(s={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(n instanceof b){const{$anchorCell:l,$headCell:r}=n,a=l?l.pos:r.pos,c=r?r.pos:l.pos,u=this.view.nodeDOM(a),d=this.view.nodeDOM(c);if(!u||!d)return;const h=u===d?u.getBoundingClientRect():Bt(u.getBoundingClientRect(),d.getBoundingClientRect());s={getBoundingClientRect:()=>h,getClientRects:()=>[h]}}return s}constructor({editor:e,element:t,view:n,pluginKey:o="bubbleMenu",updateDelay:i=250,resizeDelay:s=60,shouldShow:l,appendTo:r,getReferencedVirtualElement:a,options:c}){var u;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:d,state:h,from:f,to:p})=>{const{doc:g,selection:m}=h,{empty:w}=m,R=!g.textBetween(f,p).length&&Xe(h.selection),y=this.element.contains(document.activeElement);return!(!(d.hasFocus()||y)||w||R||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:d})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}d?.relatedTarget&&(!((h=this.element.parentNode)===null||h===void 0)&&h.contains(d.relatedTarget))||d?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(d,h)=>{const f=!h?.selection.eq(d.state.selection),p=!h?.doc.eq(d.state.doc);!f&&!p||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(d,f,p,h)},this.updateDelay))},this.updateHandler=(d,h,f,p)=>{const{composing:g}=d;if(!(g||!h&&!f)){if(!this.getShouldShow(p)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:d})=>{const h=d.getMeta(this.pluginKey);h==="updatePosition"?this.updatePosition():h&&typeof h=="object"&&h.type==="updateOptions"?this.updateOptions(h.options):h==="hide"?this.hide():h==="show"&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(u=c?.scrollTarget)!==null&&u!==void 0?u:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,l&&(this.shouldShow=l),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;const e=this.virtualElement;e&&Ae(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:t,y:n,strategy:o,middlewareData:i})=>{var s,l;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(!((s=i.hide)===null||s===void 0)&&s.referenceHidden||!((l=i.hide)===null||l===void 0)&&l.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=o,this.element.style.left=`${t}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){const{state:n}=e,o=n.selection.from!==n.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,t);return}const i=!t?.selection.eq(e.state.selection),s=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,s,t)}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return((t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:s,to:l}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const $e=e=>new W({key:typeof e.pluginKey=="string"?new B(e.pluginKey):e.pluginKey,view:t=>new $t({view:t,...e})});be.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[$e({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var Vt=class{getTextContent(e){return Ye(e,{textSerializers:Ge(this.editor.schema)})}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}constructor({editor:e,element:t,view:n,pluginKey:o="floatingMenu",updateDelay:i=250,resizeDelay:s=60,options:l,appendTo:r,shouldShow:a}){var c;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:d})=>{const{selection:h}=d,{$anchor:f,empty:p}=h,g=f.depth===1,m=f.parent.isTextblock&&!f.parent.type.spec.code&&!f.parent.textContent&&f.parent.childCount===0&&!this.getTextContent(f.parent);return!(!u.hasFocus()||!p||!g||!m||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(u,d,h,f)=>{const{composing:p}=u;if(!(p||!d&&!h)){if(!this.getShouldShow(f)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var d;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&(!((d=this.element.parentNode)===null||d===void 0)&&d.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const d=u.getMeta(this.pluginKey);d==="updatePosition"?this.updatePosition():d&&typeof d=="object"&&d.type==="updateOptions"?this.updateOptions(d.options):d==="hide"?this.hide():d==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(c=l?.scrollTarget)!==null&&c!==void 0?c:window,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return(t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:s,to:l})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!(!((e=this.view)===null||e===void 0||(e=e.dom)===null||e===void 0)&&e.parentNode))return;const{selection:t}=this.editor.state,n=we(this.view,t.from,t.to);Ae({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:o,y:i,strategy:s,middlewareData:l})=>{var r,a;if(!((r=l.hide)===null||r===void 0)&&r.referenceHidden||!((a=l.hide)===null||a===void 0)&&a.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${o}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){const n=!t?.selection.eq(e.state.selection),o=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,o,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const Ve=e=>new W({key:typeof e.pluginKey=="string"?new B(e.pluginKey):e.pluginKey,view:t=>new Vt({view:t,...e})});be.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[Ve({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function Ke(e,t){return e??new B(t)}const Kt=typeof window<"u"?C.useLayoutEffect:C.useEffect,ke=new Set(["left","opacity","position","top","visibility","width"]),kt=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),_t=new Set(["children","className","style"]),Ft=new Set(["tabIndex"]),Wt=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),jt={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function oe(e,t){return/^on[A-Z]/.test(e)&&typeof t=="function"}function qt(e){return e.startsWith("aria-")||e.startsWith("data-"),e}function Xt(e){return e.startsWith("aria-")||e.startsWith("data-")||Wt.has(e)}function _e(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Yt(e){var t;const n=e.endsWith("Capture"),o=(n?e.slice(0,-7):e).slice(2);return{eventName:(t=jt[o])!==null&&t!==void 0?t:o.toLowerCase(),options:n?{capture:!0}:void 0}}function Gt(e,t){let n=t.defaultPrevented,o=!1;const i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>o},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{o=!0,t.stopPropagation()}}}),i}function Y(e){return Ft.has(e)}function ge(e,t,n){if(t==="tabIndex"){e.tabIndex=Number(n);return}e[t]=n}function Jt(e,t){if(t==="tabIndex"){e.removeAttribute("tabindex");return}const n=e[t];if(typeof n=="boolean"){e[t]=!1;return}if(typeof n=="number"){e[t]=0;return}e[t]=""}function Zt(e,t){return typeof t!="number"||t===0||e.startsWith("--")||kt.has(e)?String(t):`${t}px`}function Qt(e,t){ke.has(t)||e.style.removeProperty(_e(t))}function en(e,t,n){ke.has(t)||e.style.setProperty(_e(t),Zt(t,n))}function tn(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(o=>{if(_t.has(o)||!Xt(o)||oe(o,t[o])||oe(o,n[o]))return;const i=t[o],s=n[o];if(i===s)return;const l=qt(o);if(s==null||s===!1){Y(o)&&Jt(e,o),e.removeAttribute(l);return}if(s===!0){Y(o)&&ge(e,o,!0),e.setAttribute(l,"");return}if(Y(o)){ge(e,o,s);return}e.setAttribute(l,String(s))})}function nn(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute("class")}}function on(e,t,n){const o=t??{},i=n??{};new Set([...Object.keys(o),...Object.keys(i)]).forEach(s=>{const l=o[s],r=i[s];if(l!==r){if(r==null){Qt(e,s);return}en(e,s,r)}})}function sn(e,t,n){t.forEach(({eventName:i,listener:s,options:l})=>{e.removeEventListener(i,s,l)});const o=[];return Object.entries(n).forEach(([i,s])=>{if(!oe(i,s))return;const{eventName:l,options:r}=Yt(i),a=c=>{s(Gt(e,c))};e.addEventListener(l,a,r),o.push({eventName:l,listener:a,options:r})}),o}function Fe(e,t){const n=C.useRef({}),o=C.useRef([]);Kt(()=>{const i=n.current;return nn(e,i.className,t.className),on(e,i.style,t.style),tn(e,i,t),o.current=sn(e,o.current,t),n.current=t,()=>{o.current.forEach(({eventName:s,listener:l,options:r})=>{e.removeEventListener(s,l,r)}),o.current=[]}},[e,t])}const Sn=Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:l,options:r,children:a,...c},u)=>{const d=C.useRef(document.createElement("div")),h=C.useRef(Ke(e,"bubbleMenu")).current;Fe(d.current,c),typeof u=="function"?u(d.current):u&&(u.current=d.current);const{editor:f}=ve(),p=t||f,g={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:h,shouldShow:s,getReferencedVirtualElement:l,options:r},m=C.useRef(g);m.current=g;const[w,R]=C.useState(!1),y=C.useRef(!0);return C.useEffect(()=>{if(p?.isDestroyed)return;if(!p){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const T=d.current;T.style.visibility="hidden",T.style.position="absolute";const O=$e({...m.current,editor:p,element:T});p.registerPlugin(O);const L=m.current.pluginKey;return y.current=!0,R(!0),()=>{R(!1),p.unregisterPlugin(L),window.requestAnimationFrame(()=>{T.parentNode&&T.parentNode.removeChild(T)})}},[p]),C.useEffect(()=>{if(!(!w||!p||p.isDestroyed)){if(y.current){y.current=!1;return}p.view.dispatch(p.state.tr.setMeta(h,{type:"updateOptions",options:m.current}))}},[w,p,n,o,s,r,i,l,h]),ze.createPortal(a,d.current)});Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,options:l,children:r,...a},c)=>{const u=C.useRef(document.createElement("div")),d=C.useRef(Ke(e,"floatingMenu")).current;Fe(u.current,a),typeof c=="function"?c(u.current):c&&(c.current=u.current);const{editor:h}=ve(),f=t||h,p={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:d,shouldShow:s,options:l},g=C.useRef(p);g.current=p;const[m,w]=C.useState(!1),R=C.useRef(!0);return C.useEffect(()=>{if(f?.isDestroyed)return;if(!f){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const y=u.current;y.style.visibility="hidden",y.style.position="absolute";const T=Ve({...g.current,editor:f,element:y});f.registerPlugin(T);const O=g.current.pluginKey;return R.current=!0,w(!0),()=>{w(!1),f.unregisterPlugin(O),window.requestAnimationFrame(()=>{y.parentNode&&y.parentNode.removeChild(y)})}},[f]),C.useEffect(()=>{if(!(!m||!f||f.isDestroyed)){if(R.current){R.current=!1;return}f.view.dispatch(f.state.tr.setMeta(d,{type:"updateOptions",options:g.current}))}},[m,f,n,o,s,l,i,d]),ze.createPortal(r,u.current)});export{Sn as B,b as C,gn as a,wn as b,yn as c,se as d,vn as e,ut as f,bn as g,fn as h,hn as i,un as j,dn as k,cn as l,pn as m,an as n,mn as s,Cn as t};
|
|
1
|
+
import{j as B,a0 as D,a1 as We,T as H,a2 as je,a3 as A,a4 as U,k as W,a5 as G,a6 as J,a7 as me,a8 as qe,a9 as we,aa as Xe,E as be,ab as Ye,ac as Ge,f as ve}from"./usage-stats-BNse37Wk.js";import{eW as ye,f0 as Ce,eV as Se,f1 as Re,f2 as Ee,f3 as Te,f4 as Oe,f5 as Ie,eX as Ae,aI as Me,r as C,ar as ze}from"./index-B3yBTWEk.js";let Z,Q;if(typeof WeakMap<"u"){let e=new WeakMap;Z=t=>e.get(t),Q=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;Z=o=>{for(let i=0;i<e.length;i+=2)if(e[i]==o)return e[i+1]},Q=(o,i)=>(n==10&&(n=0),e[n++]=o,e[n++]=i)}var v=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,i=t/this.width|0;let s=o+1,l=i+1;for(let r=1;s<this.width&&this.map[t+r]==n;r++)s++;for(let r=1;l<this.height&&this.map[t+this.width*r]==n;r++)l++;return{left:o,top:i,right:s,bottom:l}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:i,top:s,bottom:l}=this.findCell(e);return t=="horiz"?(n<0?o==0:i==this.width)?null:this.map[s*this.width+(n<0?o-1:i)]:(n<0?s==0:l==this.height)?null:this.map[o+this.width*(n<0?s-1:l)]}rectBetween(e,t){const{left:n,right:o,top:i,bottom:s}=this.findCell(e),{left:l,right:r,top:a,bottom:c}=this.findCell(t);return{left:Math.min(n,l),top:Math.min(i,a),right:Math.max(o,r),bottom:Math.max(s,c)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let i=e.left;i<e.right;i++){const s=o*this.width+i,l=this.map[s];n[l]||(n[l]=!0,!(i==e.left&&i&&this.map[s-1]==l||o==e.top&&o&&this.map[s-this.width]==l)&&t.push(l))}return t}positionAt(e,t,n){for(let o=0,i=0;;o++){const s=i+n.child(o).nodeSize;if(o==e){let l=t+e*this.width;const r=(e+1)*this.width;for(;l<r&&this.map[l]<i;)l++;return l==r?s-1:this.map[l]}i=s}}static get(e){return Z(e)||Q(e,Je(e))}};function Je(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Ze(e),n=e.childCount,o=[];let i=0,s=null;const l=[];for(let c=0,u=t*n;c<u;c++)o[c]=0;for(let c=0,u=0;c<n;c++){const d=e.child(c);u++;for(let p=0;;p++){for(;i<o.length&&o[i]!=0;)i++;if(p==d.childCount)break;const g=d.child(p),{colspan:m,rowspan:w,colwidth:R}=g.attrs;for(let y=0;y<w;y++){if(y+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:w-y});break}const T=i+y*t;for(let O=0;O<m;O++){o[T+O]==0?o[T+O]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:m-O});const L=R&&R[O];if(L){const $=(T+O)%t*2,q=l[$];q==null||q!=L&&l[$+1]==1?(l[$]=L,l[$+1]=1):q==L&&l[$+1]++}}}i+=m,u+=g.nodeSize}const h=(c+1)*t;let f=0;for(;i<h;)o[i++]==0&&f++;f&&(s||(s=[])).push({type:"missing",row:c,n:f}),u++}(t===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const r=new v(t,n,o,s);let a=!1;for(let c=0;!a&&c<l.length;c+=2)l[c]!=null&&l[c+1]<n&&(a=!0);return a&&Qe(r,l,e),r}function Ze(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const i=e.child(o);let s=0;if(n)for(let l=0;l<o;l++){const r=e.child(l);for(let a=0;a<r.childCount;a++){const c=r.child(a);l+c.attrs.rowspan>o&&(s+=c.attrs.colspan)}}for(let l=0;l<i.childCount;l++){const r=i.child(l);s+=r.attrs.colspan,r.attrs.rowspan>1&&(n=!0)}t==-1?t=s:t!=s&&(t=Math.max(t,s))}return t}function Qe(e,t,n){e.problems||(e.problems=[]);const o={};for(let i=0;i<e.map.length;i++){const s=e.map[i];if(o[s])continue;o[s]=!0;const l=n.nodeAt(s);if(!l)throw new RangeError(`No cell with offset ${s} found`);let r=null;const a=l.attrs;for(let c=0;c<a.colspan;c++){const u=t[(i+c)%e.width*2];u!=null&&(!a.colwidth||a.colwidth[c]!=u)&&((r||(r=et(a)))[c]=u)}r&&e.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:r})}}function et(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function S(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],i=o.spec.tableRole;i&&(t[i]=o)}}return t}const x=new B("selectingCells");function N(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function tt(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function I(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function j(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=N(t.$head)||nt(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function nt(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function ee(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function ot(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ie(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function De(e,t,n){const o=e.node(-1),i=v.get(o),s=e.start(-1),l=i.nextCell(e.pos-s,t,n);return l==null?null:e.node(0).resolve(s+l)}function P(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(i=>i>0)||(o.colwidth=null)),o}function xe(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let i=0;i<n;i++)o.colwidth.splice(t,0,0)}return o}function it(e,t,n){const o=S(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=o)return!1;return!0}var b=class z extends D{constructor(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.rectBetween(t.pos-s,n.pos-s),r=t.node(0),a=i.cellsInRect(l).filter(u=>u!=n.pos-s);a.unshift(n.pos-s);const c=a.map(u=>{const d=o.nodeAt(u);if(!d)throw new RangeError(`No cell with offset ${u} found`);const h=s+u+1;return new je(r.resolve(h),r.resolve(h+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const o=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(ee(o)&&ee(i)&&ie(o,i)){const s=this.$anchorCell.node(-1)!=o.node(-1);return s&&this.isRowSelection()?z.rowSelection(o,i):s&&this.isColSelection()?z.colSelection(o,i):new z(o,i)}return H.between(o,i)}content(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),s={},l=[];for(let a=i.top;a<i.bottom;a++){const c=[];for(let u=a*n.width+i.left,d=i.left;d<i.right;d++,u++){const h=n.map[u];if(s[h])continue;s[h]=!0;const f=n.findCell(h);let p=t.nodeAt(h);if(!p)throw new RangeError(`No cell with offset ${h} found`);const g=i.left-f.left,m=f.right-i.right;if(g>0||m>0){let w=p.attrs;if(g>0&&(w=P(w,0,g)),m>0&&(w=P(w,w.colspan-m,m)),f.left<i.left){if(p=p.type.createAndFill(w),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(w)}`)}else p=p.type.create(w,p.content)}if(f.top<i.top||f.bottom>i.bottom){const w={...p.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?p=p.type.createAndFill(w):p=p.type.create(w,p.content)}c.push(p)}l.push(t.child(a).copy(A.from(c)))}const r=this.isColSelection()&&this.isRowSelection()?t:l;return new U(A.from(r),1,1)}replace(t,n=U.empty){const o=t.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){const{$from:r,$to:a}=i[l],c=t.mapping.slice(o);t.replace(c.map(r.pos),c.map(a.pos),l?U.empty:n)}const s=D.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);s&&t.setSelection(s)}replaceWith(t,n){this.replace(t,new U(A.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),o=v.get(n),i=this.$anchorCell.start(-1),s=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let l=0;l<s.length;l++)t(n.nodeAt(s[l]),i+s[l])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const o=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.top<=r.top?(l.top>0&&(t=a.resolve(s+i.map[l.left])),r.bottom<i.height&&(n=a.resolve(s+i.map[i.width*(i.height-1)+r.right-1]))):(r.top>0&&(n=a.resolve(s+i.map[r.left])),l.bottom<i.height&&(t=a.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))),new z(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=v.get(t),o=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-o),s=n.colCount(this.$headCell.pos-o);if(Math.min(i,s)>0)return!1;const l=i+this.$anchorCell.nodeAfter.attrs.colspan,r=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(l,r)==n.width}eq(t){return t instanceof z&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const o=t.node(-1),i=v.get(o),s=t.start(-1),l=i.findCell(t.pos-s),r=i.findCell(n.pos-s),a=t.node(0);return l.left<=r.left?(l.left>0&&(t=a.resolve(s+i.map[l.top*i.width])),r.right<i.width&&(n=a.resolve(s+i.map[i.width*(r.top+1)-1]))):(r.left>0&&(n=a.resolve(s+i.map[r.top*i.width])),l.right<i.width&&(t=a.resolve(s+i.map[i.width*(l.top+1)-1]))),new z(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new z(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new z(t.resolve(n),t.resolve(o))}getBookmark(){return new st(this.$anchorCell.pos,this.$headCell.pos)}};b.prototype.visible=!1;D.jsonID("cell",b);var st=class Ue{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Ue(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&ie(n,o)?new b(n,o):D.near(o,1)}};function lt(e){if(!(e.selection instanceof b))return null;const t=[];return e.selection.forEachCell((n,o)=>{t.push(J.node(o,o+n.nodeSize,{class:"selectedCell"}))}),G.create(e.doc,t)}function rt({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let s=t.depth;s>=0&&!(t.before(s+1)>t.start(s));s--,o--);return n==o&&/row|table/.test(e.node(i).type.spec.tableRole)}function at({$from:e,$to:t}){let n,o;for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){o=s;break}}return n!==o&&t.parentOffset===0}function ct(e,t,n){const o=(t||e).selection,i=(t||e).doc;let s,l;if(o instanceof me&&(l=o.node.type.spec.tableRole)){if(l=="cell"||l=="header_cell")s=b.create(i,o.from);else if(l=="row"){const r=i.resolve(o.from+1);s=b.rowSelection(r,r)}else if(!n){const r=v.get(o.node),a=o.from+1,c=a+r.map[r.width*r.height-1];s=b.create(i,a+1,c)}}else o instanceof H&&rt(o)?s=H.create(i,o.from):o instanceof H&&at(o)&&(s=H.create(i,o.$from.start(),o.$from.end()));return s&&(t||(t=e.tr)).setSelection(s),t}const dt=new B("fix-tables");function He(e,t,n,o){const i=e.childCount,s=t.childCount;e:for(let l=0,r=0;l<s;l++){const a=t.child(l);for(let c=r,u=Math.min(i,l+3);c<u;c++)if(e.child(c)==a){r=c+1,n+=a.nodeSize;continue e}o(a,n),r<i&&e.child(r).sameMarkup(a)?He(e.child(r),a,n+1,o):a.nodesBetween(0,a.content.size,o,n+1),n+=a.nodeSize}}function ut(e,t){let n;const o=(i,s)=>{i.type.spec.tableRole=="table"&&(n=ht(e,i,s,n))};return t?t.doc!=e.doc&&He(t.doc,e.doc,0,o):e.doc.descendants(o),n}function ht(e,t,n,o){const i=v.get(t);if(!i.problems)return o;o||(o=e.tr);const s=[];for(let a=0;a<i.height;a++)s.push(0);for(let a=0;a<i.problems.length;a++){const c=i.problems[a];if(c.type=="collision"){const u=t.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let h=0;h<d.rowspan;h++)s[c.row+h]+=c.n;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,P(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=t.nodeAt(c.pos);if(!u)continue;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=o.mapping.map(n);o.delete(u,u+t.nodeSize)}}let l,r;for(let a=0;a<s.length;a++)s[a]&&(l==null&&(l=a),r=a);for(let a=0,c=n+1;a<i.height;a++){const u=t.child(a),d=c+u.nodeSize,h=s[a];if(h>0){let f="cell";u.firstChild&&(f=u.firstChild.type.spec.tableRole);const p=[];for(let m=0;m<h;m++){const w=S(e.schema)[f].createAndFill();w&&p.push(w)}const g=(a==0||l==a-1)&&r==a?c+1:d-1;o.insert(o.mapping.map(g),p)}c=d}return o.setMeta(dt,{fixTables:!0})}function M(e){const t=e.selection,n=j(e),o=n.node(-1),i=n.start(-1),s=v.get(o);return{...t instanceof b?s.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:o}}function Ne(e,{map:t,tableStart:n,table:o},i){let s=i>0?-1:0;it(t,o,i+s)&&(s=i==0||i==t.width?null:0);for(let l=0;l<t.height;l++){const r=l*t.width+i;if(i>0&&i<t.width&&t.map[r-1]==t.map[r]){const a=t.map[r],c=o.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,xe(c.attrs,i-t.colCount(a))),l+=c.attrs.rowspan-1}else{const a=s==null?S(o.type.schema).cell:o.nodeAt(t.map[r+s]).type,c=t.positionAt(l,i,o);e.insert(e.mapping.map(n+c),a.createAndFill())}}return e}function an(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.left))}return!0}function cn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.right))}return!0}function ft(e,{map:t,table:n,tableStart:o},i){const s=e.mapping.maps.length;for(let l=0;l<t.height;){const r=l*t.width+i,a=t.map[r],c=n.nodeAt(a),u=c.attrs;if(i>0&&t.map[r-1]==a||i<t.width-1&&t.map[r+1]==a)e.setNodeMarkup(e.mapping.slice(s).map(o+a),null,P(u,i-t.colCount(a)));else{const d=e.mapping.slice(s).map(o+a);e.delete(d,d+c.nodeSize)}l+=u.rowspan}}function dn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;ft(o,n,i),i!=n.left;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(s)}t(o)}return!0}function pt(e,t,n){var o;const i=S(t.type.schema).header_cell;for(let s=0;s<e.width;s++)if(((o=t.nodeAt(e.map[s+n*e.width]))===null||o===void 0?void 0:o.type)!=i)return!1;return!0}function Pe(e,{map:t,tableStart:n,table:o},i){let s=n;for(let c=0;c<i;c++)s+=o.child(c).nodeSize;const l=[];let r=i>0?-1:0;pt(t,o,i+r)&&(r=i==0||i==t.height?null:0);for(let c=0,u=t.width*i;c<t.width;c++,u++)if(i>0&&i<t.height&&t.map[u]==t.map[u-t.width]){const d=t.map[u],h=o.nodeAt(d).attrs;e.setNodeMarkup(n+d,null,{...h,rowspan:h.rowspan+1}),c+=h.colspan-1}else{var a;const d=r==null?S(o.type.schema).cell:(a=o.nodeAt(t.map[u+r*t.width]))===null||a===void 0?void 0:a.type,h=d?.createAndFill();h&&l.push(h)}return e.insert(s,S(o.type.schema).row.create(null,l)),e}function un(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.top))}return!0}function hn(e,t){if(!I(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.bottom))}return!0}function gt(e,{map:t,table:n,tableStart:o},i){let s=0;for(let c=0;c<i;c++)s+=n.child(c).nodeSize;const l=s+n.child(i).nodeSize,r=e.mapping.maps.length;e.delete(s+o,l+o);const a=new Set;for(let c=0,u=i*t.width;c<t.width;c++,u++){const d=t.map[u];if(!a.has(d)){if(a.add(d),i>0&&d==t.map[u-t.width]){const h=n.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h,rowspan:h.rowspan-1}),c+=h.colspan-1}else if(i<t.height&&d==t.map[u+t.width]){const h=n.nodeAt(d),f=h.attrs,p=h.type.create({...f,rowspan:h.attrs.rowspan-1},h.content),g=t.positionAt(i+1,c,n);e.insert(e.mapping.slice(r).map(o+g),p),c+=f.colspan-1}}}}function fn(e,t){if(!I(e))return!1;if(t){const n=M(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;gt(o,n,i),i!=n.top;i--){const s=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!s)throw new RangeError("No table found");n.table=s,n.map=v.get(n.table)}t(o)}return!0}function le(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function mt({width:e,height:t,map:n},o){let i=o.top*e+o.left,s=i,l=(o.bottom-1)*e+o.left,r=i+(o.right-o.left-1);for(let a=o.top;a<o.bottom;a++){if(o.left>0&&n[s]==n[s-1]||o.right<e&&n[r]==n[r+1])return!0;s+=e,r+=e}for(let a=o.left;a<o.right;a++){if(o.top>0&&n[i]==n[i-e]||o.bottom<t&&n[l]==n[l+e])return!0;i++,l++}return!1}function pn(e,t){const n=e.selection;if(!(n instanceof b)||n.$anchorCell.pos==n.$headCell.pos)return!1;const o=M(e),{map:i}=o;if(mt(i,o))return!1;if(t){const s=e.tr,l={};let r=A.empty,a,c;for(let u=o.top;u<o.bottom;u++)for(let d=o.left;d<o.right;d++){const h=i.map[u*i.width+d],f=o.table.nodeAt(h);if(!(l[h]||!f))if(l[h]=!0,a==null)a=h,c=f;else{le(f)||(r=r.append(f.content));const p=s.mapping.map(h+o.tableStart);s.delete(p,p+f.nodeSize)}}if(a==null||c==null)return!0;if(s.setNodeMarkup(a+o.tableStart,null,{...xe(c.attrs,c.attrs.colspan,o.right-o.left-c.attrs.colspan),rowspan:o.bottom-o.top}),r.size>0){const u=a+1+c.content.size,d=le(c)?a+1:u;s.replaceWith(d+o.tableStart,u+o.tableStart,r)}s.setSelection(new b(s.doc.resolve(a+o.tableStart))),t(s)}return!0}function gn(e,t){const n=S(e.schema);return wt(({node:o})=>n[o.type.spec.tableRole])(e,t)}function wt(e){return(t,n)=>{const o=t.selection;let i,s;if(o instanceof b){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{var l;if(i=tt(o.$from),!i)return!1;s=(l=N(o.$from))===null||l===void 0?void 0:l.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let r=i.attrs;const a=[],c=r.colwidth;r.rowspan>1&&(r={...r,rowspan:1}),r.colspan>1&&(r={...r,colspan:1});const u=M(t),d=t.tr;for(let f=0;f<u.right-u.left;f++)a.push(c?{...r,colwidth:c&&c[f]?[c[f]]:null}:r);let h;for(let f=u.top;f<u.bottom;f++){let p=u.map.positionAt(f,u.left,u.table);f==u.top&&(p+=i.nodeSize);for(let g=u.left,m=0;g<u.right;g++,m++)g==u.left&&f==u.top||d.insert(h=d.mapping.map(p+u.tableStart,1),e({node:i,row:f,col:g}).createAndFill(a[m]))}d.setNodeMarkup(s,e({node:i,row:u.top,col:u.left}),a[0]),o instanceof b&&d.setSelection(new b(d.doc.resolve(o.$anchorCell.pos),h?d.doc.resolve(h):void 0)),n(d)}return!0}}function mn(e,t){return function(n,o){if(!I(n))return!1;const i=j(n);if(i.nodeAfter.attrs[e]===t)return!1;if(o){const s=n.tr;n.selection instanceof b?n.selection.forEachCell((l,r)=>{l.attrs[e]!==t&&s.setNodeMarkup(r,null,{...l.attrs,[e]:t})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),o(s)}return!0}}function bt(e){return function(t,n){if(!I(t))return!1;if(n){const o=S(t.schema),i=M(t),s=t.tr,l=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),r=l.map(a=>i.table.nodeAt(a));for(let a=0;a<l.length;a++)r[a].type==o.header_cell&&s.setNodeMarkup(i.tableStart+l[a],o.cell,r[a].attrs);if(s.steps.length===0)for(let a=0;a<l.length;a++)s.setNodeMarkup(i.tableStart+l[a],o.header_cell,r[a].attrs);n(s)}return!0}}function re(e,t,n){const o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let i=0;i<o.length;i++){const s=t.table.nodeAt(o[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function se(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?bt(e):function(n,o){if(!I(n))return!1;if(o){const i=S(n.schema),s=M(n),l=n.tr,r=re("row",s,i),a=re("column",s,i),c=(e==="column"?r:e==="row"&&a)?1:0,u=e=="column"?{left:0,top:c,right:1,bottom:s.map.height}:e=="row"?{left:c,top:0,right:s.map.width,bottom:1}:s,d=e=="column"?a?i.cell:i.header_cell:e=="row"?r?i.cell:i.header_cell:i.cell;s.map.cellsInRect(u).forEach(h=>{const f=h+s.tableStart,p=l.doc.nodeAt(f);p&&l.setNodeMarkup(f,d,p.attrs)}),o(l)}return!0}}se("row",{useDeprecatedLogic:!0});se("column",{useDeprecatedLogic:!0});const wn=se("cell",{useDeprecatedLogic:!0});function vt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,i=e.before();o>=0;o--){const s=e.node(-1).child(o),l=s.lastChild;if(l)return i-1-l.nodeSize;i-=s.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let o=e.indexAfter(-1),i=e.after();o<n.childCount;o++){const s=n.child(o);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function bn(e){return function(t,n){if(!I(t))return!1;const o=vt(j(t),e);if(o==null)return!1;if(n){const i=t.doc.resolve(o);n(t.tr.setSelection(H.between(i,ot(i))).scrollIntoView())}return!0}}function vn(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function V(e,t){const n=e.selection;if(!(n instanceof b))return!1;if(t){const o=e.tr,i=S(e.schema).cell.createAndFill().content;n.forEachCell((s,l)=>{s.content.eq(i)||o.replace(o.mapping.map(l+1),o.mapping.map(l+s.nodeSize-1),new U(i,0,0))}),o.docChanged&&t(o)}return!0}function yt(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;const i=t.child(0),s=i.type.spec.tableRole,l=i.type.schema,r=[];if(s=="row")for(let a=0;a<t.childCount;a++){let c=t.child(a).content;const u=a?0:Math.max(0,n-1),d=a<t.childCount-1?0:Math.max(0,o-1);(u||d)&&(c=te(S(l).row,new U(c,u,d)).content),r.push(c)}else if(s=="cell"||s=="header_cell")r.push(n||o?te(S(l).row,new U(t,n,o)).content:t);else return null;return Ct(l,r)}function Ct(e,t){const n=[];for(let i=0;i<t.length;i++){const s=t[i];for(let l=s.childCount-1;l>=0;l--){const{rowspan:r,colspan:a}=s.child(l).attrs;for(let c=i;c<i+r;c++)n[c]=(n[c]||0)+a}}let o=0;for(let i=0;i<n.length;i++)o=Math.max(o,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(A.empty),n[i]<o){const s=S(e).cell.createAndFill(),l=[];for(let r=n[i];r<o;r++)l.push(s);t[i]=t[i].append(A.from(l))}return{height:t.length,width:o,rows:t}}function te(e,t){const n=e.createAndFill();return new qe(n).replace(0,n.content.size,t).doc}function St({width:e,height:t,rows:n},o,i){if(e!=o){const s=[],l=[];for(let r=0;r<n.length;r++){const a=n[r],c=[];for(let u=s[r]||0,d=0;u<o;d++){let h=a.child(d%a.childCount);u+h.attrs.colspan>o&&(h=h.type.createChecked(P(h.attrs,h.attrs.colspan,u+h.attrs.colspan-o),h.content)),c.push(h),u+=h.attrs.colspan;for(let f=1;f<h.attrs.rowspan;f++)s[r+f]=(s[r+f]||0)+h.attrs.colspan}l.push(A.from(c))}n=l,e=o}if(t!=i){const s=[];for(let l=0,r=0;l<i;l++,r++){const a=[],c=n[r%t];for(let u=0;u<c.childCount;u++){let d=c.child(u);l+d.attrs.rowspan>i&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),a.push(d)}s.push(A.from(a))}n=s,t=i}return{width:e,height:t,rows:n}}function Rt(e,t,n,o,i,s,l){const r=e.doc.type.schema,a=S(r);let c,u;if(i>t.width)for(let d=0,h=0;d<t.height;d++){const f=n.child(d);h+=f.nodeSize;const p=[];let g;f.lastChild==null||f.lastChild.type==a.cell?g=c||(c=a.cell.createAndFill()):g=u||(u=a.header_cell.createAndFill());for(let m=t.width;m<i;m++)p.push(g);e.insert(e.mapping.slice(l).map(h-1+o),p)}if(s>t.height){const d=[];for(let p=0,g=(t.height-1)*t.width;p<Math.max(t.width,i);p++){const m=p>=t.width?!1:n.nodeAt(t.map[g+p]).type==a.header_cell;d.push(m?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const h=a.row.create(null,A.from(d)),f=[];for(let p=t.height;p<s;p++)f.push(h);e.insert(e.mapping.slice(l).map(o+n.nodeSize-2),f)}return!!(c||u)}function ae(e,t,n,o,i,s,l,r){if(l==0||l==t.height)return!1;let a=!1;for(let c=i;c<s;c++){const u=l*t.width+c,d=t.map[u];if(t.map[u-t.width]==d){a=!0;const h=n.nodeAt(d),{top:f,left:p}=t.findCell(d);e.setNodeMarkup(e.mapping.slice(r).map(d+o),null,{...h.attrs,rowspan:l-f}),e.insert(e.mapping.slice(r).map(t.positionAt(l,p,n)),h.type.createAndFill({...h.attrs,rowspan:f+h.attrs.rowspan-l})),c+=h.attrs.colspan-1}}return a}function ce(e,t,n,o,i,s,l,r){if(l==0||l==t.width)return!1;let a=!1;for(let c=i;c<s;c++){const u=c*t.width+l,d=t.map[u];if(t.map[u-1]==d){a=!0;const h=n.nodeAt(d),f=t.colCount(d),p=e.mapping.slice(r).map(d+o);e.setNodeMarkup(p,null,P(h.attrs,l-f,h.attrs.colspan-(l-f))),e.insert(p+h.nodeSize,h.type.createAndFill(P(h.attrs,0,l-f))),c+=h.attrs.rowspan-1}}return a}function de(e,t,n,o,i){let s=n?e.doc.nodeAt(n-1):e.doc;if(!s)throw new Error("No table found");let l=v.get(s);const{top:r,left:a}=o,c=a+i.width,u=r+i.height,d=e.tr;let h=0;function f(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");l=v.get(s),h=d.mapping.maps.length}Rt(d,l,s,n,c,u,h)&&f(),ae(d,l,s,n,a,c,r,h)&&f(),ae(d,l,s,n,a,c,u,h)&&f(),ce(d,l,s,n,r,u,a,h)&&f(),ce(d,l,s,n,r,u,c,h)&&f();for(let p=r;p<u;p++){const g=l.positionAt(p,a,s),m=l.positionAt(p,c,s);d.replace(d.mapping.slice(h).map(g+n),d.mapping.slice(h).map(m+n),new U(i.rows[p-r],0,0))}f(),d.setSelection(new b(d.doc.resolve(n+l.positionAt(r,a,s)),d.doc.resolve(n+l.positionAt(u-1,c-1,s)))),t(d)}const Et=We({ArrowLeft:K("horiz",-1),ArrowRight:K("horiz",1),ArrowUp:K("vert",-1),ArrowDown:K("vert",1),"Shift-ArrowLeft":k("horiz",-1),"Shift-ArrowRight":k("horiz",1),"Shift-ArrowUp":k("vert",-1),"Shift-ArrowDown":k("vert",1),Backspace:V,"Mod-Backspace":V,Delete:V,"Mod-Delete":V});function _(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function K(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof b)return _(n,o,D.near(s.$headCell,t));if(e!="horiz"&&!s.empty)return!1;const l=Le(i,e,t);if(l==null)return!1;if(e=="horiz")return _(n,o,D.near(n.doc.resolve(s.head+t),t));{const r=n.doc.resolve(l),a=De(r,e,t);let c;return a?c=D.near(a,1):t<0?c=D.near(n.doc.resolve(r.before(-1)),-1):c=D.near(n.doc.resolve(r.after(-1)),1),_(n,o,c)}}}function k(e,t){return(n,o,i)=>{if(!i)return!1;const s=n.selection;let l;if(s instanceof b)l=s;else{const a=Le(i,e,t);if(a==null)return!1;l=new b(n.doc.resolve(a))}const r=De(l.$headCell,e,t);return r?_(n,o,new b(l.$anchorCell,r)):!1}}function Tt(e,t){const n=e.state.doc,o=N(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new b(o))),!0):!1}function Ot(e,t,n){if(!I(e.state))return!1;let o=yt(n);const i=e.state.selection;if(i instanceof b){o||(o={width:1,height:1,rows:[A.from(te(S(e.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),l=i.$anchorCell.start(-1),r=v.get(s).rectBetween(i.$anchorCell.pos-l,i.$headCell.pos-l);return o=St(o,r.right-r.left,r.bottom-r.top),de(e.state,e.dispatch,l,r,o),!0}else if(o){const s=j(e.state),l=s.start(-1);return de(e.state,e.dispatch,l,v.get(s.node(-1)).findCell(s.pos-l),o),!0}else return!1}function It(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const o=ue(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof b)s(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(i=N(e.state.selection.$anchor))!=null&&((n=X(e,t))===null||n===void 0?void 0:n.pos)!=i.pos)s(i,t),t.preventDefault();else if(!o)return;function s(a,c){let u=X(e,c);const d=x.getState(e.state)==null;if(!u||!ie(a,u))if(d)u=a;else return;const h=new b(a,u);if(d||!e.state.selection.eq(h)){const f=e.state.tr.setSelection(h);d&&f.setMeta(x,a.pos),e.dispatch(f)}}function l(){e.root.removeEventListener("mouseup",l),e.root.removeEventListener("dragstart",l),e.root.removeEventListener("mousemove",r),x.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(x,-1))}function r(a){const c=a,u=x.getState(e.state);let d;if(u!=null)d=e.state.doc.resolve(u);else if(ue(e,c.target)!=o&&(d=X(e,t),!d))return l();d&&s(d,c)}e.root.addEventListener("mouseup",l),e.root.addEventListener("dragstart",l),e.root.addEventListener("mousemove",r)}function Le(e,t,n){if(!(e.state.selection instanceof H))return null;const{$head:o}=e.state.selection;for(let i=o.depth-1;i>=0;i--){const s=o.node(i);if((n<0?o.index(i):o.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=o.before(i),r=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(r)?l:null}}return null}function ue(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function X(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:i}=n;return o>=0&&N(e.state.doc.resolve(o))||N(e.state.doc.resolve(i))}var At=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ne(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,ne(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function ne(e,t,n,o,i,s){let l=0,r=!0,a=t.firstChild;const c=e.firstChild;if(c){for(let d=0,h=0;d<c.childCount;d++){const{colspan:f,colwidth:p}=c.child(d).attrs;for(let g=0;g<f;g++,h++){const m=i==h?s:p&&p[g],w=m?m+"px":"";if(l+=m||o,m||(r=!1),a)a.style.width!=w&&(a.style.width=w),a=a.nextSibling;else{const R=document.createElement("col");R.style.width=w,t.appendChild(R)}}}for(;a;){var u;const d=a.nextSibling;(u=a.parentNode)===null||u===void 0||u.removeChild(a),a=d}r?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}const E=new B("tableColumnResizing");function yn({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=At,lastColumnResizable:i=!0}={}){const s=new W({key:E,state:{init(l,r){var a;const c=(a=s.spec)===null||a===void 0||(a=a.props)===null||a===void 0?void 0:a.nodeViews,u=S(r.schema).table.name;return o&&c&&(c[u]=(d,h)=>new o(d,n,h)),new Mt(-1,!1)},apply(l,r){return r.apply(l)}},props:{attributes:l=>{const r=E.getState(l);return r&&r.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(l,r)=>{zt(l,r,e,i)},mouseleave:l=>{Dt(l)},mousedown:(l,r)=>{xt(l,r,t,n)}},decorations:l=>{const r=E.getState(l);if(r&&r.activeHandle>-1)return Lt(l,r.activeHandle)},nodeViews:{}}});return s}var Mt=class F{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,o=t.getMeta(E);if(o&&o.setHandle!=null)return new F(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new F(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return ee(t.doc.resolve(i))||(i=-1),new F(i,n.dragging)}return n}};function zt(e,t,n,o){if(!e.editable)return;const i=E.getState(e.state);if(i&&!i.dragging){const s=Ht(t.target);let l=-1;if(s){const{left:r,right:a}=s.getBoundingClientRect();t.clientX-r<=n?l=he(e,t,"left",n):a-t.clientX<=n&&(l=he(e,t,"right",n))}if(l!=i.activeHandle){if(!o&&l!==-1){const r=e.state.doc.resolve(l),a=r.node(-1),c=v.get(a),u=r.start(-1);if(c.colCount(r.pos-u)+r.nodeAfter.attrs.colspan-1==c.width-1)return}Be(e,l)}}}function Dt(e){if(!e.editable)return;const t=E.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&Be(e,-1)}function xt(e,t,n,o){var i;if(!e.editable)return!1;const s=(i=e.dom.ownerDocument.defaultView)!==null&&i!==void 0?i:window,l=E.getState(e.state);if(!l||l.activeHandle==-1||l.dragging)return!1;const r=e.state.doc.nodeAt(l.activeHandle),a=Ut(e,l.activeHandle,r.attrs);e.dispatch(e.state.tr.setMeta(E,{setDragging:{startX:t.clientX,startWidth:a}}));function c(d){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",u);const h=E.getState(e.state);h?.dragging&&(Nt(e,h.activeHandle,fe(h.dragging,d,n)),e.dispatch(e.state.tr.setMeta(E,{setDragging:null})))}function u(d){if(!d.which)return c(d);const h=E.getState(e.state);if(h&&h.dragging){const f=fe(h.dragging,d,n);pe(e,h.activeHandle,f,o)}}return pe(e,l.activeHandle,a,o),s.addEventListener("mouseup",c),s.addEventListener("mousemove",u),t.preventDefault(),!0}function Ut(e,t,{colspan:n,colwidth:o}){const i=o&&o[o.length-1];if(i)return i;const s=e.domAtPos(t);let l=s.node.childNodes[s.offset].offsetWidth,r=n;if(o)for(let a=0;a<n;a++)o[a]&&(l-=o[a],r--);return l/r}function Ht(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function he(e,t,n,o){const i=n=="right"?-o:o,s=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!s)return-1;const{pos:l}=s,r=N(e.state.doc.resolve(l));if(!r)return-1;if(n=="right")return r.pos;const a=v.get(r.node(-1)),c=r.start(-1),u=a.map.indexOf(r.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function fe(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function Be(e,t){e.dispatch(e.state.tr.setMeta(E,{setHandle:t}))}function Nt(e,t,n){const o=e.state.doc.resolve(t),i=o.node(-1),s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+r;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],h=i.nodeAt(d).attrs,f=h.colspan==1?0:r-s.colCount(d);if(h.colwidth&&h.colwidth[f]==n)continue;const p=h.colwidth?h.colwidth.slice():Pt(h.colspan);p[f]=n,a.setNodeMarkup(l+d,null,{...h,colwidth:p})}a.docChanged&&e.dispatch(a)}function pe(e,t,n,o){const i=e.state.doc.resolve(t),s=i.node(-1),l=i.start(-1),r=v.get(s).colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;let a=e.domAtPos(i.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&ne(s,a.firstChild,a,o,r,n)}function Pt(e){return Array(e).fill(0)}function Lt(e,t){const n=[],o=e.doc.resolve(t),i=o.node(-1);if(!i)return G.empty;const s=v.get(i),l=o.start(-1),r=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=r+c*s.width;if((r==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){var a;const d=s.map[u],h=l+d+i.nodeAt(d).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",!((a=E.getState(e))===null||a===void 0)&&a.dragging&&n.push(J.node(l+d,l+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(J.widget(h,f))}}return G.create(e.doc,n)}function Cn({allowTableNodeSelection:e=!1}={}){return new W({key:x,state:{init(){return null},apply(t,n){const o=t.getMeta(x);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;const{deleted:i,pos:s}=t.mapping.mapResult(n);return i?null:s}},props:{decorations:lt,handleDOMEvents:{mousedown:It},createSelectionBetween(t){return x.getState(t.state)!=null?t.state.selection:null},handleTripleClick:Tt,handleKeyDown:Et,handlePaste:Ot},appendTransaction(t,n,o){return ct(o,ut(o,n),e)}})}function Bt(e,t){const n=Math.min(e.top,t.top),o=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),s=Math.max(e.right,t.right)-i,l=o-n;return new DOMRect(i,n,s,l)}var $t=class{get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,t;const{selection:n}=this.editor.state,o=(e=this.getReferencedVirtualElement)===null||e===void 0?void 0:e.call(this);if(o)return o;if(!(!((t=this.view)===null||t===void 0||(t=t.dom)===null||t===void 0)&&t.parentNode))return;const i=we(this.view,n.from,n.to);let s={getBoundingClientRect:()=>i,getClientRects:()=>[i]};if(n instanceof me){let l=this.view.nodeDOM(n.from);const r=l.dataset.nodeViewWrapper?l:l.querySelector("[data-node-view-wrapper]");r&&(l=r),l&&(s={getBoundingClientRect:()=>l.getBoundingClientRect(),getClientRects:()=>[l.getBoundingClientRect()]})}if(n instanceof b){const{$anchorCell:l,$headCell:r}=n,a=l?l.pos:r.pos,c=r?r.pos:l.pos,u=this.view.nodeDOM(a),d=this.view.nodeDOM(c);if(!u||!d)return;const h=u===d?u.getBoundingClientRect():Bt(u.getBoundingClientRect(),d.getBoundingClientRect());s={getBoundingClientRect:()=>h,getClientRects:()=>[h]}}return s}constructor({editor:e,element:t,view:n,pluginKey:o="bubbleMenu",updateDelay:i=250,resizeDelay:s=60,shouldShow:l,appendTo:r,getReferencedVirtualElement:a,options:c}){var u;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:d,state:h,from:f,to:p})=>{const{doc:g,selection:m}=h,{empty:w}=m,R=!g.textBetween(f,p).length&&Xe(h.selection),y=this.element.contains(document.activeElement);return!(!(d.hasFocus()||y)||w||R||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:d})=>{var h;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}d?.relatedTarget&&(!((h=this.element.parentNode)===null||h===void 0)&&h.contains(d.relatedTarget))||d?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(d,h)=>{const f=!h?.selection.eq(d.state.selection),p=!h?.doc.eq(d.state.doc);!f&&!p||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(d,f,p,h)},this.updateDelay))},this.updateHandler=(d,h,f,p)=>{const{composing:g}=d;if(!(g||!h&&!f)){if(!this.getShouldShow(p)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:d})=>{const h=d.getMeta(this.pluginKey);h==="updatePosition"?this.updatePosition():h&&typeof h=="object"&&h.type==="updateOptions"?this.updateOptions(h.options):h==="hide"?this.hide():h==="show"&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(u=c?.scrollTarget)!==null&&u!==void 0?u:window,this.getReferencedVirtualElement=a,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,l&&(this.shouldShow=l),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;const e=this.virtualElement;e&&Ae(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:t,y:n,strategy:o,middlewareData:i})=>{var s,l;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(!((s=i.hide)===null||s===void 0)&&s.referenceHidden||!((l=i.hide)===null||l===void 0)&&l.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=o,this.element.style.left=`${t}px`,this.element.style.top=`${n}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){const{state:n}=e,o=n.selection.from!==n.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,t);return}const i=!t?.selection.eq(e.state.selection),s=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,s,t)}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return((t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:s,to:l}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const $e=e=>new W({key:typeof e.pluginKey=="string"?new B(e.pluginKey):e.pluginKey,view:t=>new $t({view:t,...e})});be.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[$e({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var Vt=class{getTextContent(e){return Ye(e,{textSerializers:Ge(this.editor.schema)})}get middlewares(){const e=[];return this.floatingUIOptions.flip&&e.push(ye(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push(Ce(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push(Se(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push(Re(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ee(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push(Te(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push(Oe(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push(Ie(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),e}constructor({editor:e,element:t,view:n,pluginKey:o="floatingMenu",updateDelay:i=250,resizeDelay:s=60,options:l,appendTo:r,shouldShow:a}){var c;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:u,state:d})=>{const{selection:h}=d,{$anchor:f,empty:p}=h,g=f.depth===1,m=f.parent.isTextblock&&!f.parent.type.spec.code&&!f.parent.textContent&&f.parent.childCount===0&&!this.getTextContent(f.parent);return!(!u.hasFocus()||!p||!g||!m||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(u,d,h,f)=>{const{composing:p}=u;if(!(p||!d&&!h)){if(!this.getShouldShow(f)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var d;if(this.preventHide){this.preventHide=!1;return}u?.relatedTarget&&(!((d=this.element.parentNode)===null||d===void 0)&&d.contains(u.relatedTarget))||u?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:u})=>{const d=u.getMeta(this.pluginKey);d==="updatePosition"?this.updatePosition():d&&typeof d=="object"&&d.type==="updateOptions"?this.updateOptions(d.options):d==="hide"?this.hide():d==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=o,this.updateDelay=i,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=(c=l?.scrollTarget)!==null&&c!==void 0?c:window,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(e){var t;const{state:n}=this.view,{selection:o}=n,{ranges:i}=o,s=Math.min(...i.map(r=>r.$from.pos)),l=Math.max(...i.map(r=>r.$to.pos));return(t=this.shouldShow)===null||t===void 0?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:s,to:l})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){var t;const n=(t=e.options.scrollTarget)!==null&&t!==void 0?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!(!((e=this.view)===null||e===void 0||(e=e.dom)===null||e===void 0)&&e.parentNode))return;const{selection:t}=this.editor.state,n=we(this.view,t.from,t.to);Ae({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:o,y:i,strategy:s,middlewareData:l})=>{var r,a;if(!((r=l.hide)===null||r===void 0)&&r.referenceHidden||!((a=l.hide)===null||a===void 0)&&a.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=s,this.element.style.left=`${o}px`,this.element.style.top=`${i}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){const n=!t?.selection.eq(e.state.selection),o=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,o,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const t=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(e=t??this.view.dom.parentElement)===null||e===void 0||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};const Ve=e=>new W({key:typeof e.pluginKey=="string"?new B(e.pluginKey):e.pluginKey,view:t=>new Vt({view:t,...e})});be.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[Ve({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function Ke(e,t){return e??new B(t)}const Kt=typeof window<"u"?C.useLayoutEffect:C.useEffect,ke=new Set(["left","opacity","position","top","visibility","width"]),kt=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),_t=new Set(["children","className","style"]),Ft=new Set(["tabIndex"]),Wt=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),jt={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function oe(e,t){return/^on[A-Z]/.test(e)&&typeof t=="function"}function qt(e){return e.startsWith("aria-")||e.startsWith("data-"),e}function Xt(e){return e.startsWith("aria-")||e.startsWith("data-")||Wt.has(e)}function _e(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Yt(e){var t;const n=e.endsWith("Capture"),o=(n?e.slice(0,-7):e).slice(2);return{eventName:(t=jt[o])!==null&&t!==void 0?t:o.toLowerCase(),options:n?{capture:!0}:void 0}}function Gt(e,t){let n=t.defaultPrevented,o=!1;const i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>o},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{o=!0,t.stopPropagation()}}}),i}function Y(e){return Ft.has(e)}function ge(e,t,n){if(t==="tabIndex"){e.tabIndex=Number(n);return}e[t]=n}function Jt(e,t){if(t==="tabIndex"){e.removeAttribute("tabindex");return}const n=e[t];if(typeof n=="boolean"){e[t]=!1;return}if(typeof n=="number"){e[t]=0;return}e[t]=""}function Zt(e,t){return typeof t!="number"||t===0||e.startsWith("--")||kt.has(e)?String(t):`${t}px`}function Qt(e,t){ke.has(t)||e.style.removeProperty(_e(t))}function en(e,t,n){ke.has(t)||e.style.setProperty(_e(t),Zt(t,n))}function tn(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(o=>{if(_t.has(o)||!Xt(o)||oe(o,t[o])||oe(o,n[o]))return;const i=t[o],s=n[o];if(i===s)return;const l=qt(o);if(s==null||s===!1){Y(o)&&Jt(e,o),e.removeAttribute(l);return}if(s===!0){Y(o)&&ge(e,o,!0),e.setAttribute(l,"");return}if(Y(o)){ge(e,o,s);return}e.setAttribute(l,String(s))})}function nn(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute("class")}}function on(e,t,n){const o=t??{},i=n??{};new Set([...Object.keys(o),...Object.keys(i)]).forEach(s=>{const l=o[s],r=i[s];if(l!==r){if(r==null){Qt(e,s);return}en(e,s,r)}})}function sn(e,t,n){t.forEach(({eventName:i,listener:s,options:l})=>{e.removeEventListener(i,s,l)});const o=[];return Object.entries(n).forEach(([i,s])=>{if(!oe(i,s))return;const{eventName:l,options:r}=Yt(i),a=c=>{s(Gt(e,c))};e.addEventListener(l,a,r),o.push({eventName:l,listener:a,options:r})}),o}function Fe(e,t){const n=C.useRef({}),o=C.useRef([]);Kt(()=>{const i=n.current;return nn(e,i.className,t.className),on(e,i.style,t.style),tn(e,i,t),o.current=sn(e,o.current,t),n.current=t,()=>{o.current.forEach(({eventName:s,listener:l,options:r})=>{e.removeEventListener(s,l,r)}),o.current=[]}},[e,t])}const Sn=Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,getReferencedVirtualElement:l,options:r,children:a,...c},u)=>{const d=C.useRef(document.createElement("div")),h=C.useRef(Ke(e,"bubbleMenu")).current;Fe(d.current,c),typeof u=="function"?u(d.current):u&&(u.current=d.current);const{editor:f}=ve(),p=t||f,g={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:h,shouldShow:s,getReferencedVirtualElement:l,options:r},m=C.useRef(g);m.current=g;const[w,R]=C.useState(!1),y=C.useRef(!0);return C.useEffect(()=>{if(p?.isDestroyed)return;if(!p){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const T=d.current;T.style.visibility="hidden",T.style.position="absolute";const O=$e({...m.current,editor:p,element:T});p.registerPlugin(O);const L=m.current.pluginKey;return y.current=!0,R(!0),()=>{R(!1),p.unregisterPlugin(L),window.requestAnimationFrame(()=>{T.parentNode&&T.parentNode.removeChild(T)})}},[p]),C.useEffect(()=>{if(!(!w||!p||p.isDestroyed)){if(y.current){y.current=!1;return}p.view.dispatch(p.state.tr.setMeta(h,{type:"updateOptions",options:m.current}))}},[w,p,n,o,s,r,i,l,h]),ze.createPortal(a,d.current)});Me.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:o,appendTo:i,shouldShow:s=null,options:l,children:r,...a},c)=>{const u=C.useRef(document.createElement("div")),d=C.useRef(Ke(e,"floatingMenu")).current;Fe(u.current,a),typeof c=="function"?c(u.current):c&&(c.current=u.current);const{editor:h}=ve(),f=t||h,p={updateDelay:n,resizeDelay:o,appendTo:i,pluginKey:d,shouldShow:s,options:l},g=C.useRef(p);g.current=p;const[m,w]=C.useState(!1),R=C.useRef(!0);return C.useEffect(()=>{if(f?.isDestroyed)return;if(!f){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const y=u.current;y.style.visibility="hidden",y.style.position="absolute";const T=Ve({...g.current,editor:f,element:y});f.registerPlugin(T);const O=g.current.pluginKey;return R.current=!0,w(!0),()=>{w(!1),f.unregisterPlugin(O),window.requestAnimationFrame(()=>{y.parentNode&&y.parentNode.removeChild(y)})}},[f]),C.useEffect(()=>{if(!(!m||!f||f.isDestroyed)){if(R.current){R.current=!1;return}f.view.dispatch(f.state.tr.setMeta(d,{type:"updateOptions",options:g.current}))}},[m,f,n,o,s,l,i,d]),ze.createPortal(r,u.current)});export{Sn as B,b as C,gn as a,wn as b,yn as c,se as d,vn as e,ut as f,bn as g,fn as h,hn as i,un as j,dn as k,cn as l,pn as m,an as n,mn as s,Cn as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as E,d as U,I as N,b as w,U as k,W as R,j as e,B as T,r as y,E as P,_ as z,x as F,z as L,K as A,e as O,o as S,R as B,u as H,$ as K,O as Y}from"./index-6GXqHE0w.js";import{s as V,n as W}from"./site-url-en5df9c-.js";import{f as $,d as G,D as Q,g as q}from"./dialog-DJBpjJnY.js";import{c as J}from"./use-commerce-diagnostic-DqKipeip.js";import{u as X}from"./use-mcp-client-Bq-mjhw3.js";import{i as D}from"./ArrowRight-DZQert3q.js";import{u as Z}from"./use-organization-settings-DrJN-E78.js";import{C as tt,a as ot}from"./companion-mcps-section-CVcicsr9.js";import{C as et,a as rt}from"./connect-layout-Bl-ol5HH.js";import{p as j}from"./self-tool-result-8OxPN9Nm.js";import{a as it}from"./index-BVRQ9yUZ.js";import{C as nt}from"./chat-context-HB_KOUNM.js";import{T as at}from"./hooks-BSkeWBV7.js";import{T as _}from"./toolbar-DOOz2W24.js";import{S as st,M as mt}from"./shell-controls-gkZZS07l.js";import"./companions-core-CZwGf1b1.js";import"./github-D4UJ99TO.js";import"./github-repo-scope-C8GSbvaz.js";import"./metadata-dUsYcpuu.js";import"./auth-ksbj4Esa.js";import"./schema-Cnskrzk1.js";import"./task-board-DyZE7mH1.js";import"./use-connect-companion-Mci4Y6hu.js";import"./integration-icon-B6H5J7sl.js";import"./Tool02-BrfQeZRx.js";import"./agent-icon-vDfwuZu4.js";import"./AlertCircle-CgERhdh6.js";import"./Tool01-D6HOM_aJ.js";import"./ArrowUp-lpfNBlP2.js";import"./ArrowLeft-BVx6AQzq.js";import"./TrendUp01-DIz6JZwT.js";import"./ZoomOut-DdupjPFF.js";import"./Users03-DWh3D2_T.js";import"./CheckCircle-BGqFZ8sM.js";import"./Check-DClZtAIP.js";import"./ChevronUp-CbF1Gmeo.js";import"./ChevronRight-BNfU55ld.js";import"./ChevronSelectorVertical-ilm76_0p.js";import"./DotsVertical-LmkOTjL4.js";import"./UserSquare-yIpHwPSn.js";import"./Copy01-DiITYBuR.js";import"./CreditCard01-Zpy-4Wu9.js";import"./Database01-zcGUPFsG.js";import"./Download01-C4blLpML.js";import"./Printer-BG6NfeSZ.js";import"./Settings02-DL8f5fN1.js";import"./Eye-Cd7v-liN.js";import"./File02-CceuR6rF.js";import"./Share07-D1Sv14jA.js";import"./GitBranch01-Dil6c2wv.js";import"./Globe01-BVji6jXS.js";import"./SwitchHorizontal01-BIyO34Jw.js";import"./HardDrive-B4UY5qYp.js";import"./Image01-CpXdMb8x.js";import"./Key01-BsAAVoJx.js";import"./Link01-OqB-2yPE.js";import"./LinkExternal01-DobnLseV.js";import"./Monitor01-BTqHf-K4.js";import"./Sun-DjKz3VjB.js";import"./Package-CCkk0w5h.js";import"./Palette-BBWt8owf.js";import"./Play-CPeIBqH_.js";import"./Plus-DaErdsG1.js";import"./SearchLg-DxQfk550.js";import"./SearchMd-BNXjQ2BV.js";import"./Shield01-BsobIEfQ.js";import"./Stars01-f37Q7vDf.js";import"./Trash01-DQjprOwc.js";import"./Upload01-BDeLrRhf.js";import"./User01-B8a5ssx2.js";import"./Users01-BCRhQsCX.js";import"./XCircle-DudPVYQR.js";import"./XClose-DpDcHm9Y.js";import"./Zap-C5eiFR0N.js";import"./form-EGCuUtdG.js";import"./label-aWEsDmHM.js";import"./input-TvernbmY.js";import"./use-debounced-value-D0SYNQsR.js";import"./provision-repo-scoped-github-connection-B6zdkC6p.js";import"./extract-connection-data-B1nPGa4h.js";import"./connection-By77bjvj.js";import"./useQueries-C6OAJOs7.js";import"./authenticate-and-persist-oauth-DMvGjBUE.js";import"./mcp-oauth-DhRKpyTH.js";import"./track-Dns1NpdC.js";import"./use-project-scope-DZ9tacAx.js";import"./use-virtual-mcp-CMlCV8Oj.js";import"./github-repo-C0igpkr9.js";import"./thread-route-CEvVLI2K.js";import"./settings-sidebar-BcAe-WS4.js";import"./toolbar-icon-button-Dp-AbzNZ.js";import"./command-BpjWfGyr.js";import"./index-cEqwHhEg.js";import"./drawer-B5NRhNfW.js";import"./popover-Ci-k968-.js";import"./project-icon-DIXBuD-A.js";import"./create-organization-dialog-CRl8hry2.js";import"./alert-dialog-CiKfgw9r.js";import"./anchors-yqDzZN4K.js";import"./use-join-requests-1Ow065Yq.js";import"./avatar-CW4PxBuN.js";import"./use-deployment-admin-Dpkh4HgH.js";import"./use-is-desktop-app-BNujXJc_.js";import"./download-app-dialog-DYhv8XsJ.js";import"./invite-member-dialog-CsolElt3.js";import"./select-Ce9NznPv.js";import"./textarea-BpFOmm9_.js";import"./use-org-auth-client-CVFBkaiI.js";import"./use-organization-roles-yO3kgQbK.js";import"./add-connection-dialog-BSihy3_s.js";import"./collection-search-j4HjYlys.js";import"./connection-card-Br8jDKgZ.js";import"./use-registry-connections-cro5WL6A.js";import"./use-connection-DCUpGmsb.js";import"./useInfiniteQuery-CM35R0yt.js";import"./infiniteQueryObserver-C7FrFXuf.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./connection-slug-CITJ0kGN.js";import"./slugify-CEUa2lfQ.js";import"./connection-form-helpers-CFXh6BoJ.js";import"./collection-tabs-Bc9QOlJ8.js";import"./badge-C5Ilvf_J.js";import"./use-infinite-scroll-BXOEU8Y7.js";import"./useSuspenseInfiniteQuery-DWyGwvh9.js";import"./use-deco-credits-DjxZxHMq.js";import"./use-ai-providers-Bg_y9f3x.js";import"./scroll-area-CaE3a4_T.js";import"./decopilot-sse-pool-D2Qtyl-A.js";import"./task-route-CayeX6cv.js";import"./use-decopilot-events-zpeu2MCG.js";import"./dropdown-menu-DzwCPltk.js";import"./github-icon-CiNkodR8.js";import"./get-initials-D-f_fDFw.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-project-native-view-presence-01L5j4lu.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-file-configs-B1FdrMZJ.js";import"./site-slug-uya6Wp4-.js";import"./optimistic-project-sidebar-views-DKtRXqQ0.js";import"./use-navigate-to-agent-Drdqs1cr.js";import"./thread-intent-AJKohiRy.js";import"./use-panel-navigate-CCqZdv2O.js";import"./source-system-tabs-CnEGUb4r.js";import"./autosend-BzUVLyEq.js";import"./location-oTTXFrSF.js";function lt(o){const t=E.c(21),{siteUrl:c}=o,n=U(),{org:u}=N(),a=w();let h;t[0]!==n||t[1]!==u?(h=()=>{localStorage.setItem(k.sidebarOpen(),JSON.stringify(!1));const x=J(u,R.COMMERCE_DISCOVERY(u.id));n({...x,search:{...x.search,sidepanel:!1}})},t[0]=n,t[1]=u,t[2]=h):h=t[2];const p=h;let C;t[3]===Symbol.for("react.memo_cache_sentinel")?(C=e.jsx($,{className:"bg-black/15 backdrop-blur-sm"}),t[3]=C):C=t[3];let s;t[4]!==a?(s=a("routes.commerceOnboarding.connectModal.dialogTitle"),t[4]=a,t[5]=s):s=t[5];let r;t[6]!==s?(r=e.jsx(G,{className:"sr-only",children:s}),t[6]=s,t[7]=r):r=t[7];let m;t[8]!==p||t[9]!==a?(m=()=>e.jsxs("div",{className:"grid gap-4 p-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:a("routes.commerceOnboarding.connectModal.loadError")}),e.jsxs(T,{type:"button",size:"xl",className:"w-full",onClick:p,children:[a("routes.commerceOnboarding.connectModal.continueButton"),e.jsx(D,{size:18})]})]}),t[8]=p,t[9]=a,t[10]=m):m=t[10];let d;t[11]===Symbol.for("react.memo_cache_sentinel")?(d=e.jsx(tt,{}),t[11]=d):d=t[11];let i;t[12]!==p||t[13]!==c?(i=e.jsx(y.Suspense,{fallback:d,children:e.jsx(ut,{siteUrlFromUrl:c,onComplete:p})}),t[12]=p,t[13]=c,t[14]=i):i=t[14];let l;t[15]!==m||t[16]!==i?(l=e.jsx(P,{fallback:m,children:i}),t[15]=m,t[16]=i,t[17]=l):l=t[17];let b;return t[18]!==r||t[19]!==l?(b=e.jsx(Q,{open:!0,children:e.jsxs(q,{children:[C,e.jsxs(z,{"data-slot":"commerce-connect-modal",onEscapeKeyDown:dt,onPointerDownOutside:pt,onInteractOutside:ct,className:"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex h-[calc(100dvh-1rem)] w-full max-w-[calc(100%-1rem)] translate-x-[-50%] translate-y-[-50%] flex-col overflow-hidden rounded-2xl border p-0 shadow-md duration-200 sm:max-w-lg md:h-auto md:max-h-[calc(100dvh-2rem)] lg:max-h-[calc(100dvh-4rem)] lg:max-w-5xl",children:[r,l]})]})}),t[18]=r,t[19]=l,t[20]=b):b=t[20],b}function ct(o){return o.preventDefault()}function pt(o){return o.preventDefault()}function dt(o){return o.preventDefault()}function ut({siteUrlFromUrl:o,onComplete:t}){const c=w(),{org:n}=N(),u=R.COMMERCE_DISCOVERY(n.id),a=X({connectionId:F,orgId:n.id,orgSlug:n.slug}),p=L({queryKey:A.commerceDiscoveryConnection(n.id,u),queryFn:async()=>{const f=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:u}});return j(f)},retry:!1}).data.item,C=typeof p?.metadata?.siteUrl=="string"?p.metadata.siteUrl:void 0,s=o||C,r=V(s),[m,d]=y.useState(!0),[i,l]=y.useState(null),b=O({mutationFn:async f=>j(await a.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:f}})),retry:!1}),x=O({mutationFn:async f=>j(await a.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:f}})),retry:!1}),v=async()=>{l(null),S("commerce_onboarding_open_report_clicked",{domain:r??void 0,organization_id:n.id});const f=s?W(s):null;if(f?.ok)try{let g=await x.mutateAsync(f.value);if(g.triggered||(S("commerce_onboarding_run_reclaim",{domain:r??void 0,organization_id:n.id,reason:g.reason??"not_upgraded"}),await b.mutateAsync(f.value),g=await x.mutateAsync(f.value)),!g.triggered){S("commerce_onboarding_run_failed",{domain:r??void 0,organization_id:n.id,error:g.reason??"not_triggered"}),l(c("routes.commerceOnboarding.connectModal.couldNotGenerateReport"));return}}catch(g){S("commerce_onboarding_run_failed",{domain:r??void 0,organization_id:n.id,error:g instanceof Error?g.message:String(g)}),l(c("routes.commerceOnboarding.connectModal.somethingWentWrong"));return}t()},I=Z("demo_mode"),M=m||I;return e.jsx(et,{siteHost:r,footer:e.jsxs(e.Fragment,{children:[i?e.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:i}):null,e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(rt,{ready:M,pending:x.isPending,label:x.isPending?c("routes.commerceOnboarding.connectModal.openingReport"):c("routes.commerceOnboarding.connectModal.viewDiagnostic"),onClick:()=>{v()},children:e.jsx(D,{size:18})})}),M?null:e.jsx(T,{type:"button",variant:"secondary",size:"lg",className:"h-auto min-h-12 shrink-0 rounded-lg py-3 text-base font-medium leading-tight",disabled:x.isPending,onClick:()=>{v()},children:c("routes.commerceOnboarding.connectModal.skip")})]})]}),children:e.jsx(ot,{org:n,cdConnectionId:u,siteUrl:s,onReadinessChange:d})})}function er(){const o=E.c(14),t=B();let c;o[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},o[0]=c):c=o[0];const{connect:n,siteUrl:u}=H(c),a=n==="1",h=t;let p;o[1]===Symbol.for("react.memo_cache_sentinel")?(p=e.jsx(_.Header,{className:"grid-cols-1 px-1",children:e.jsxs("div",{className:"flex w-full min-w-0 items-center gap-1",children:[e.jsx(st,{}),e.jsx(_.TogglesSlot,{}),e.jsx(_.TabsSlot,{className:"shrink-0"}),e.jsx(_.CenterSlot,{}),e.jsx(_.RightSlot,{})]})}),o[1]=p):p=o[1];const s=h&&p;let r;o[2]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:e.jsx(K,{children:e.jsx(Y,{})})}),o[2]=r):r=o[2];let m;o[3]!==s?(m=e.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[s,r]}),o[3]=s,o[4]=m):m=o[4];let d;o[5]!==t?(d=t&&e.jsx(mt,{renderSidebar:ft}),o[5]=t,o[6]=d):d=o[6];let i;o[7]!==u||o[8]!==a?(i=a&&e.jsx(lt,{siteUrl:u}),o[7]=u,o[8]=a,o[9]=i):i=o[9];let l;return o[10]!==m||o[11]!==d||o[12]!==i?(l=e.jsx(at,{children:e.jsx(_.Provider,{children:e.jsxs(nt,{children:[m,d,i]})})}),o[10]=m,o[11]=d,o[12]=i,o[13]=l):l=o[13],l}function ft(o){const{onClose:t}=o;return e.jsx("div",{className:"flex h-full",children:e.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:e.jsx(it,{onClose:t})})})}export{er as default};
|
|
1
|
+
import{c as E,d as U,I as N,b as w,U as k,W as R,j as e,B as T,r as y,E as P,_ as z,x as F,z as L,K as A,e as O,o as S,R as B,u as H,$ as K,O as Y}from"./index-B3yBTWEk.js";import{s as V,n as W}from"./site-url-en5df9c-.js";import{f as $,d as G,D as Q,g as q}from"./dialog-otnvxVN0.js";import{c as J}from"./use-commerce-diagnostic-mdvL2BW-.js";import{u as X}from"./use-mcp-client-DsJzBus3.js";import{i as D}from"./ArrowRight-Cu8UuHNR.js";import{u as Z}from"./use-organization-settings-BAVHurZk.js";import{C as tt,a as ot}from"./companion-mcps-section-BszDkkOp.js";import{C as et,a as rt}from"./connect-layout-C_MQVbrT.js";import{p as j}from"./self-tool-result-8OxPN9Nm.js";import{a as it}from"./index-Bwc7J041.js";import{C as nt}from"./chat-context-CXknhaDs.js";import{T as at}from"./hooks-k1OxvonE.js";import{T as _}from"./toolbar-D0oe2g2b.js";import{S as st,M as mt}from"./shell-controls-DkLEUvEw.js";import"./companions-core-CZwGf1b1.js";import"./github-D4UJ99TO.js";import"./github-repo-scope-C8GSbvaz.js";import"./metadata-dUsYcpuu.js";import"./auth-RjDDTUUT.js";import"./schema-BQbhQoxs.js";import"./task-board-CXsHf2Zn.js";import"./use-connect-companion-2fL060lG.js";import"./integration-icon-BPwWRlNG.js";import"./Tool02-C_xRWqQk.js";import"./agent-icon-DrlilhFJ.js";import"./AlertCircle-EniJtD8E.js";import"./Tool01-BnKd95Y1.js";import"./ArrowUp-C0eratGp.js";import"./ArrowLeft-Clu1mSdY.js";import"./TrendUp01-PFzYDizC.js";import"./ZoomOut-BXPGwF_O.js";import"./Users03-CRtXqa1Q.js";import"./CheckCircle-cinYKmPU.js";import"./Check-BWpBE9uf.js";import"./ChevronUp-DGrguvGW.js";import"./ChevronRight-DzRB-rdO.js";import"./ChevronSelectorVertical-BiIbFU31.js";import"./DotsVertical-CucJCL9y.js";import"./UserSquare-CCDsU001.js";import"./Copy01-DayLu0dF.js";import"./CreditCard01-4OsjIT5f.js";import"./Database01-2gG_9E30.js";import"./Download01-BC2rKbuh.js";import"./Printer-fz_zwxfT.js";import"./Settings02-D2oiGU4q.js";import"./Eye-dnrP5DkM.js";import"./File02-BhckHV8N.js";import"./Share07-D_kiq5Fr.js";import"./GitBranch01-BBn4dN5f.js";import"./Globe01-SLAc63wC.js";import"./SwitchHorizontal01-CxlKjkIX.js";import"./HardDrive-FlnOYA_8.js";import"./Image01-BrHSH-Vi.js";import"./Key01-CKcg8G1v.js";import"./Link01-3t9JrUgl.js";import"./LinkExternal01-Cp7uxK1i.js";import"./Monitor01-BUruMK2r.js";import"./Sun-nKOZMh9n.js";import"./Package-CdfyZYxN.js";import"./Palette-CglyAOTg.js";import"./Play-rnw1eV52.js";import"./Plus-Bxp02MWl.js";import"./SearchLg-FC9suxna.js";import"./SearchMd-DRRptSJN.js";import"./Shield01-CjyLhqlS.js";import"./Stars01-COChWymR.js";import"./Trash01-DqUm2RRh.js";import"./Upload01-CqWnAR1-.js";import"./User01-BJoNdkjl.js";import"./Users01-DSQPwtP5.js";import"./XCircle-9Cb0khfg.js";import"./XClose-Cw4b4Uag.js";import"./Zap-ChVc0p76.js";import"./form-KjPevg0A.js";import"./label-CqlSWrLn.js";import"./input-HFOrJf5B.js";import"./use-debounced-value-Cud3o3Fq.js";import"./provision-repo-scoped-github-connection-B6zdkC6p.js";import"./extract-connection-data-CqGCTPdZ.js";import"./connection-OmoYXqZk.js";import"./useQueries-qr8TAkZc.js";import"./authenticate-and-persist-oauth-DXlrPDSv.js";import"./mcp-oauth-D6isOO_s.js";import"./track-BzMi8kcZ.js";import"./use-project-scope-B2cuvtTy.js";import"./use-virtual-mcp-Bk09OpEg.js";import"./github-repo-C0igpkr9.js";import"./thread-route-CKY-dKC0.js";import"./settings-sidebar-DswZBMwm.js";import"./toolbar-icon-button-EOE8J-Ai.js";import"./command-B6LMVdkQ.js";import"./index-w1d_dmEj.js";import"./drawer-s7gtDrb4.js";import"./popover-DIqZ2IKF.js";import"./project-icon-Bl3bXnhv.js";import"./create-organization-dialog--p2RMsV5.js";import"./alert-dialog-BE9ltHtr.js";import"./anchors-yqDzZN4K.js";import"./use-join-requests-DTGTfD21.js";import"./avatar-DcDvs8Zz.js";import"./use-deployment-admin-D6IzoXV0.js";import"./use-is-desktop-app-BNujXJc_.js";import"./download-app-dialog-BqNRF4Sn.js";import"./invite-member-dialog-vPcEYe6v.js";import"./select-Bc5UZb4n.js";import"./textarea-CneoU2lJ.js";import"./use-org-auth-client-4o0wRx2Q.js";import"./use-organization-roles-DzWM9Nv-.js";import"./add-connection-dialog-s1GRGQ63.js";import"./collection-search-CzGq8Uso.js";import"./connection-card-Cy-GdKQl.js";import"./use-registry-connections-DikbDR8w.js";import"./use-connection-DCLPda2h.js";import"./useInfiniteQuery-GKCP1c_7.js";import"./infiniteQueryObserver-DgAoAIrN.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./connection-slug-CITJ0kGN.js";import"./slugify-CEUa2lfQ.js";import"./connection-form-helpers-D3hdN_Pk.js";import"./collection-tabs-BLgGMB42.js";import"./badge-DJpaBl8u.js";import"./use-infinite-scroll-DkLPxlOu.js";import"./useSuspenseInfiniteQuery-DmEiIBI4.js";import"./use-deco-credits-rwNQ1gMg.js";import"./use-ai-providers-qnkcjapR.js";import"./scroll-area-BgZjjLM3.js";import"./decopilot-sse-pool-CfYFArSW.js";import"./task-route-D79aS9d_.js";import"./use-decopilot-events-DYRVevWg.js";import"./dropdown-menu-BxKUbUkE.js";import"./github-icon-D51q_6S8.js";import"./get-initials-D-f_fDFw.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-project-native-view-presence-D-AyEulW.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-file-configs-BwD1CaWo.js";import"./site-slug-uya6Wp4-.js";import"./optimistic-project-sidebar-views-yrtk59Mo.js";import"./use-navigate-to-agent-Bbq0oQ0Y.js";import"./thread-intent-DVKldCEq.js";import"./use-panel-navigate-Byvx0cbx.js";import"./source-system-tabs-CnEGUb4r.js";import"./autosend-HdosN86x.js";import"./location-oTTXFrSF.js";function lt(o){const t=E.c(21),{siteUrl:c}=o,n=U(),{org:u}=N(),a=w();let h;t[0]!==n||t[1]!==u?(h=()=>{localStorage.setItem(k.sidebarOpen(),JSON.stringify(!1));const x=J(u,R.COMMERCE_DISCOVERY(u.id));n({...x,search:{...x.search,sidepanel:!1}})},t[0]=n,t[1]=u,t[2]=h):h=t[2];const p=h;let C;t[3]===Symbol.for("react.memo_cache_sentinel")?(C=e.jsx($,{className:"bg-black/15 backdrop-blur-sm"}),t[3]=C):C=t[3];let s;t[4]!==a?(s=a("routes.commerceOnboarding.connectModal.dialogTitle"),t[4]=a,t[5]=s):s=t[5];let r;t[6]!==s?(r=e.jsx(G,{className:"sr-only",children:s}),t[6]=s,t[7]=r):r=t[7];let m;t[8]!==p||t[9]!==a?(m=()=>e.jsxs("div",{className:"grid gap-4 p-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:a("routes.commerceOnboarding.connectModal.loadError")}),e.jsxs(T,{type:"button",size:"xl",className:"w-full",onClick:p,children:[a("routes.commerceOnboarding.connectModal.continueButton"),e.jsx(D,{size:18})]})]}),t[8]=p,t[9]=a,t[10]=m):m=t[10];let d;t[11]===Symbol.for("react.memo_cache_sentinel")?(d=e.jsx(tt,{}),t[11]=d):d=t[11];let i;t[12]!==p||t[13]!==c?(i=e.jsx(y.Suspense,{fallback:d,children:e.jsx(ut,{siteUrlFromUrl:c,onComplete:p})}),t[12]=p,t[13]=c,t[14]=i):i=t[14];let l;t[15]!==m||t[16]!==i?(l=e.jsx(P,{fallback:m,children:i}),t[15]=m,t[16]=i,t[17]=l):l=t[17];let b;return t[18]!==r||t[19]!==l?(b=e.jsx(Q,{open:!0,children:e.jsxs(q,{children:[C,e.jsxs(z,{"data-slot":"commerce-connect-modal",onEscapeKeyDown:dt,onPointerDownOutside:pt,onInteractOutside:ct,className:"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex h-[calc(100dvh-1rem)] w-full max-w-[calc(100%-1rem)] translate-x-[-50%] translate-y-[-50%] flex-col overflow-hidden rounded-2xl border p-0 shadow-md duration-200 sm:max-w-lg md:h-auto md:max-h-[calc(100dvh-2rem)] lg:max-h-[calc(100dvh-4rem)] lg:max-w-5xl",children:[r,l]})]})}),t[18]=r,t[19]=l,t[20]=b):b=t[20],b}function ct(o){return o.preventDefault()}function pt(o){return o.preventDefault()}function dt(o){return o.preventDefault()}function ut({siteUrlFromUrl:o,onComplete:t}){const c=w(),{org:n}=N(),u=R.COMMERCE_DISCOVERY(n.id),a=X({connectionId:F,orgId:n.id,orgSlug:n.slug}),p=L({queryKey:A.commerceDiscoveryConnection(n.id,u),queryFn:async()=>{const f=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:u}});return j(f)},retry:!1}).data.item,C=typeof p?.metadata?.siteUrl=="string"?p.metadata.siteUrl:void 0,s=o||C,r=V(s),[m,d]=y.useState(!0),[i,l]=y.useState(null),b=O({mutationFn:async f=>j(await a.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:f}})),retry:!1}),x=O({mutationFn:async f=>j(await a.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:f}})),retry:!1}),v=async()=>{l(null),S("commerce_onboarding_open_report_clicked",{domain:r??void 0,organization_id:n.id});const f=s?W(s):null;if(f?.ok)try{let g=await x.mutateAsync(f.value);if(g.triggered||(S("commerce_onboarding_run_reclaim",{domain:r??void 0,organization_id:n.id,reason:g.reason??"not_upgraded"}),await b.mutateAsync(f.value),g=await x.mutateAsync(f.value)),!g.triggered){S("commerce_onboarding_run_failed",{domain:r??void 0,organization_id:n.id,error:g.reason??"not_triggered"}),l(c("routes.commerceOnboarding.connectModal.couldNotGenerateReport"));return}}catch(g){S("commerce_onboarding_run_failed",{domain:r??void 0,organization_id:n.id,error:g instanceof Error?g.message:String(g)}),l(c("routes.commerceOnboarding.connectModal.somethingWentWrong"));return}t()},I=Z("demo_mode"),M=m||I;return e.jsx(et,{siteHost:r,footer:e.jsxs(e.Fragment,{children:[i?e.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:i}):null,e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(rt,{ready:M,pending:x.isPending,label:x.isPending?c("routes.commerceOnboarding.connectModal.openingReport"):c("routes.commerceOnboarding.connectModal.viewDiagnostic"),onClick:()=>{v()},children:e.jsx(D,{size:18})})}),M?null:e.jsx(T,{type:"button",variant:"secondary",size:"lg",className:"h-auto min-h-12 shrink-0 rounded-lg py-3 text-base font-medium leading-tight",disabled:x.isPending,onClick:()=>{v()},children:c("routes.commerceOnboarding.connectModal.skip")})]})]}),children:e.jsx(ot,{org:n,cdConnectionId:u,siteUrl:s,onReadinessChange:d})})}function er(){const o=E.c(14),t=B();let c;o[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},o[0]=c):c=o[0];const{connect:n,siteUrl:u}=H(c),a=n==="1",h=t;let p;o[1]===Symbol.for("react.memo_cache_sentinel")?(p=e.jsx(_.Header,{className:"grid-cols-1 px-1",children:e.jsxs("div",{className:"flex w-full min-w-0 items-center gap-1",children:[e.jsx(st,{}),e.jsx(_.TogglesSlot,{}),e.jsx(_.TabsSlot,{className:"shrink-0"}),e.jsx(_.CenterSlot,{}),e.jsx(_.RightSlot,{})]})}),o[1]=p):p=o[1];const s=h&&p;let r;o[2]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:e.jsx(K,{children:e.jsx(Y,{})})}),o[2]=r):r=o[2];let m;o[3]!==s?(m=e.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[s,r]}),o[3]=s,o[4]=m):m=o[4];let d;o[5]!==t?(d=t&&e.jsx(mt,{renderSidebar:ft}),o[5]=t,o[6]=d):d=o[6];let i;o[7]!==u||o[8]!==a?(i=a&&e.jsx(lt,{siteUrl:u}),o[7]=u,o[8]=a,o[9]=i):i=o[9];let l;return o[10]!==m||o[11]!==d||o[12]!==i?(l=e.jsx(at,{children:e.jsx(_.Provider,{children:e.jsxs(nt,{children:[m,d,i]})})}),o[10]=m,o[11]=d,o[12]=i,o[13]=l):l=o[13],l}function ft(o){const{onClose:t}=o;return e.jsx("div",{className:"flex h-full",children:e.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:e.jsx(it,{onClose:t})})})}export{er as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,I as j,eo as v,j as p,N as f,ae as h,G as x}from"./index-
|
|
1
|
+
import{c as d,I as j,eo as v,j as p,N as f,ae as h,G as x}from"./index-B3yBTWEk.js";import{L as I}from"./legacy-main-redirect-ZPChWdtD.js";import"./thread-route-CKY-dKC0.js";const N=x("/shell/$org/org-shell/");function O(){const e=d.c(24),{org:r}=j(),a=N.useSearch(),{main:n,virtualmcpid:o}=a;if(n!==void 0){let t;e[0]!==n||e[1]!==r.slug||e[2]!==a||e[3]!==o?(t=v({org:r.slug,agentId:o,main:n,search:a}),e[0]=n,e[1]=r.slug,e[2]=a,e[3]=o,e[4]=t):t=e[4];const s=t;if(s?.kind==="canonical"){let l;return e[5]!==s?(l=p.jsx(I,{target:s}),e[5]=s,e[6]=l):l=e[6],l}}let u;e[7]!==o?(u=o?.trim()||null,e[7]=o,e[8]=u):u=e[8];const g=u;if(g){let t;e[9]!==r.slug||e[10]!==g?(t={org:r.slug,agentId:g},e[9]=r.slug,e[10]=g,e[11]=t):t=e[11];let s;e[12]!==a?(s={...a,virtualmcpid:void 0},e[12]=a,e[13]=s):s=e[13];let l;return e[14]!==t||e[15]!==s?(l=p.jsx(f,{to:h.projects,params:t,search:s,hash:!0,replace:!0}),e[14]=t,e[15]=s,e[16]=l):l=e[16],l}let i;e[17]!==r.slug?(i={org:r.slug},e[17]=r.slug,e[18]=i):i=e[18];let c;e[19]!==a?(c={...a,virtualmcpid:void 0},e[19]=a,e[20]=c):c=e[20];let m;return e[21]!==i||e[22]!==c?(m=p.jsx(f,{to:h.home,params:i,search:c,hash:!0,replace:!0}),e[21]=i,e[22]=c,e[23]=m):m=e[23],m}export{O as default};
|