decocms 4.518.0 → 4.518.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ActiveShapeUtils-DC4ySNWR.js → ActiveShapeUtils-EYkJV7tD.js} +1 -1
- package/dist/client/assets/{AlertCircle-DgnxHqxe.js → AlertCircle-CzTXJ0ax.js} +1 -1
- package/dist/client/assets/{AreaChart-Ccsbdjec.js → AreaChart-8lCOmLfE.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BJ1448l4.js → ArrowLeft-BQThfb60.js} +1 -1
- package/dist/client/assets/{ArrowUp-723TVuFG.js → ArrowUp-DUhCibLH.js} +1 -1
- package/dist/client/assets/{BarChart-BdOKvWnK.js → BarChart-2wCpTPJ2.js} +1 -1
- package/dist/client/assets/{Building02-DU823ZCw.js → Building02-BOLEL9nK.js} +1 -1
- package/dist/client/assets/{CartesianChart-3-g5kX2i.js → CartesianChart-CmRg3x8T.js} +1 -1
- package/dist/client/assets/{CategoricalChart-CinaMpxG.js → CategoricalChart-BtQQT8Ex.js} +1 -1
- package/dist/client/assets/{CheckCircle-C7csYE-y.js → CheckCircle-OCgBlAwW.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-B0Z7parR.js → ChevronSelectorVertical-DaDJpoIU.js} +1 -1
- package/dist/client/assets/{ChevronUp-DiTVmUiH.js → ChevronUp-DtSKb4be.js} +1 -1
- package/dist/client/assets/{Copy01-DRNuKy-h.js → Copy01-DVWv3lef.js} +1 -1
- package/dist/client/assets/{CreditCard01-C3f2i_qY.js → CreditCard01-Bw5uGiku.js} +1 -1
- package/dist/client/assets/{DotsVertical-eX97dPc6.js → DotsVertical-CEoX1VVK.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-CCb5UZ88.js → ErrorBarContext-i8geYMQV.js} +1 -1
- package/dist/client/assets/{Globe04-ByvV2bPX.js → Globe04-CMBPkECo.js} +1 -1
- package/dist/client/assets/{Image01-QuVxFosz.js → Image01-D_y3XkIW.js} +1 -1
- package/dist/client/assets/{Key01-C-QXsN23.js → Key01-p2EsnMlr.js} +1 -1
- package/dist/client/assets/{Link01-CbpFxbNY.js → Link01-D28gAr0F.js} +1 -1
- package/dist/client/assets/{LinkBroken01-DDgMbBWJ.js → LinkBroken01-Dz2vlPBe.js} +1 -1
- package/dist/client/assets/{Minus-DnJ8wbLv.js → Minus-DNpWuD14.js} +1 -1
- package/dist/client/assets/{Monitor01-DD5_JCl8.js → Monitor01-CYm-wjzD.js} +1 -1
- package/dist/client/assets/{Play-BgEaB30r.js → Play-cNq95jJS.js} +1 -1
- package/dist/client/assets/{Plus-BnqPSlPj.js → Plus-C4rGoU1F.js} +1 -1
- package/dist/client/assets/{ReferenceLine-PgVE-Dmr.js → ReferenceLine-BvmA07RC.js} +1 -1
- package/dist/client/assets/{SearchMd-GQAKwnQD.js → SearchMd-BYCOzBqa.js} +1 -1
- package/dist/client/assets/{Sector-DG1U_Qdd.js → Sector-23KRNcXn.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DVHnZchK.js → ShoppingBag01-DvN3FHxE.js} +1 -1
- package/dist/client/assets/{Sun-Ct5gftPt.js → Sun-DFIh8Vd-.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-_kdH1ete.js → SwitchHorizontal01-D6mwjnXs.js} +1 -1
- package/dist/client/assets/{Tool01-rTZNmFct.js → Tool01-_CVpzZpk.js} +1 -1
- package/dist/client/assets/{Trash01-TPK4gSsp.js → Trash01-CgNTH-jr.js} +1 -1
- package/dist/client/assets/{Upload01-D6tRQTgc.js → Upload01-CiTZ5ZQQ.js} +1 -1
- package/dist/client/assets/{User01-1q78INo2.js → User01-vLr2BfmM.js} +1 -1
- package/dist/client/assets/{UserSquare-B_yRFcN6.js → UserSquare-B7fe7FYj.js} +1 -1
- package/dist/client/assets/{Users01-D5MhP5r0.js → Users01-BgSWeeD_.js} +1 -1
- package/dist/client/assets/{XClose-DOXmYMF_.js → XClose-B_rQyiiY.js} +1 -1
- package/dist/client/assets/{ZoomOut-DLICjI1h.js → ZoomOut-DzrH576O.js} +1 -1
- package/dist/client/assets/{access-gate-p2OBWc28.js → access-gate-CjdHb0j3.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BluC5xOJ.js → add-connection-dialog-DyCA7E5B.js} +1 -1
- package/dist/client/assets/agent-analytics-C_1r2ktq.js +1 -0
- package/dist/client/assets/agent-app-DADhKCUS.js +1 -0
- package/dist/client/assets/{agent-assets-CsYWD2CR.js → agent-assets-AUU4xJcf.js} +1 -1
- package/dist/client/assets/{agent-automation-J7szToQ3.js → agent-automation-H4qJ1HOM.js} +1 -1
- package/dist/client/assets/{agent-automations-tGwSufFx.js → agent-automations-BCHMa4q1.js} +1 -1
- package/dist/client/assets/agent-calendar-BIC31eZQ.js +1 -0
- package/dist/client/assets/{agent-connect-sources-Bf7YpJtB.js → agent-connect-sources-DO6Zn3Mx.js} +1 -1
- package/dist/client/assets/agent-deck-DfcsXmVh.js +1 -0
- package/dist/client/assets/{agent-e2e-B01kqUsN.js → agent-e2e-BswlcjA7.js} +1 -1
- package/dist/client/assets/agent-experiments-DacDH6n9.js +1 -0
- package/dist/client/assets/agent-file-DvvjQBtI.js +1 -0
- package/dist/client/assets/{agent-hosting-8jYjdLhJ.js → agent-hosting-CgIJCVf2.js} +1 -1
- package/dist/client/assets/{agent-icon-g2PIrjzs.js → agent-icon-BVqmbz-P.js} +1 -1
- package/dist/client/assets/agent-library-D07m5-2P.js +1 -0
- package/dist/client/assets/agent-library-file-CKXkh_Ag.js +1 -0
- package/dist/client/assets/agent-monitor-T2Kisepj.js +1 -0
- package/dist/client/assets/{agent-overview-uVNzU6d3.js → agent-overview-BnCn329o.js} +1 -1
- package/dist/client/assets/{agent-releases-DVFEJ-Ad.js → agent-releases-PaWDRDlN.js} +1 -1
- package/dist/client/assets/agent-settings-CtpQVMq0.js +1 -0
- package/dist/client/assets/{agent-site-editor-DI9lfD7X.js → agent-site-editor-Dgv9OUYF.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-DEyTlk7z.js +2 -0
- package/dist/client/assets/agent-site-editor-content-CO78zdWN.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-C8DxePtH.js +1 -0
- package/dist/client/assets/{agent-view-guard-Bhzmxyux.js → agent-view-guard-CIz__L_S.js} +1 -1
- package/dist/client/assets/agent-view-zDoYJpqf.js +1 -0
- package/dist/client/assets/{agents-list-CbFcTa4A.js → agents-list-B9ydQIh8.js} +1 -1
- package/dist/client/assets/{ai-providers-Da7yjmwG.js → ai-providers-BvGFGpkW.js} +1 -1
- package/dist/client/assets/{alert-kpgdNVxk.js → alert-COKmPgNZ.js} +1 -1
- package/dist/client/assets/{alert-dialog-KKnJELoX.js → alert-dialog-Bbqu21pF.js} +1 -1
- package/dist/client/assets/{analytics-sections-DlComRmC.js → analytics-sections-CXA9Djw5.js} +1 -1
- package/dist/client/assets/{analytics-tab-B_HbOlqF.js → analytics-tab-CNbGVSyT.js} +2 -2
- package/dist/client/assets/api-keys-rvaVQMbg.js +1 -0
- package/dist/client/assets/{api-keys-DNrkQCkt.js → api-keys-zMWE0eW-.js} +1 -1
- package/dist/client/assets/{app-editor-CKdeak5r.js → app-editor-BnLt2HBc.js} +1 -1
- package/dist/client/assets/{asset-utils-CYyNDrFK.js → asset-utils-CQBKR3VN.js} +1 -1
- package/dist/client/assets/{auth-DHZfBLZ5.js → auth-BypL5L1O.js} +1 -1
- package/dist/client/assets/{auth-catchall-BS8FAipd.js → auth-catchall-BeibfVV0.js} +1 -1
- package/dist/client/assets/{auth-entry-34SQAdx9.js → auth-entry-DgsnWxp_.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DF-Z-sUB.js → auth-split-layout-Daxd6Ypw.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CbgraxNg.js → authenticate-and-persist-oauth-ClTAD7nN.js} +1 -1
- package/dist/client/assets/{automation-list-row-DtCSZcdc.js → automation-list-row-CvwYuhxk.js} +1 -1
- package/dist/client/assets/{automation-runs-Lelpmww0.js → automation-runs-CApbL_Sf.js} +1 -1
- package/dist/client/assets/{automations-CV4vMVkc.js → automations-Di1Er6hW.js} +1 -1
- package/dist/client/assets/{autosend-Cwww7_9j.js → autosend-B4f5gabb.js} +1 -1
- package/dist/client/assets/{avatar-BRRGslVN.js → avatar-CFO-sRGJ.js} +1 -1
- package/dist/client/assets/{badge-DmeqGssZ.js → badge-CYEiaJVw.js} +1 -1
- package/dist/client/assets/{block-document-DtA_3M8z.js → block-document-C4MOQYjr.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context--o78Y3yp.js → blocks-preview-workspace-context-Bq9hpUEB.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-Dps89GrH.js → blocks-tab-states-CwfYFgj9.js} +1 -1
- package/dist/client/assets/{blog-schema-CEYO8j-N.js → blog-schema-CgYPJyE9.js} +1 -1
- package/dist/client/assets/{buckets-CXMlDLcD.js → buckets-DoEfEinO.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-C7S9lWPM.js → build-improve-prompt-doc-BByi4O7Q.js} +1 -1
- package/dist/client/assets/{calendar-B6BpOXfC.js → calendar-AEesHfNc.js} +1 -1
- package/dist/client/assets/{campaigns-view-DtQvcOC6.js → campaigns-view-DTbZCmg6.js} +1 -1
- package/dist/client/assets/{capability-load-error-CDC4LjDf.js → capability-load-error-BfKRzvUM.js} +1 -1
- package/dist/client/assets/{category-editor-BvoAtPRs.js → category-editor-sR05FPNS.js} +1 -1
- package/dist/client/assets/cdn-tab-9RYVl35J.js +1 -0
- package/dist/client/assets/{chart-CTinHp-8.js → chart-D7lvPdFx.js} +1 -1
- package/dist/client/assets/{chat-context-DLezfYEa.js → chat-context-DqNUlJMY.js} +1 -1
- package/dist/client/assets/{chat-draft-BlRnwK9v.js → chat-draft-DeylAkNb.js} +1 -1
- package/dist/client/assets/{checkbox-BlB_jfat.js → checkbox-JO6XiJJq.js} +1 -1
- package/dist/client/assets/{choose-editor-DHZGPvHu.js → choose-editor-CQPIEsfr.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DFaLHvgO.js → cli-auth-success-DksDQz1c.js} +1 -1
- package/dist/client/assets/{client-icons-CpqRIiQr.js → client-icons-DbBtP136.js} +1 -1
- package/dist/client/assets/cms-settings-editor-CD6Fhdzj.js +1 -0
- package/dist/client/assets/{collapsible-DZTt-UAc.js → collapsible-CXUiqrZ3.js} +1 -1
- package/dist/client/assets/{collection-detail-BjUkXIkv.js → collection-detail-BXm00G6J.js} +1 -1
- package/dist/client/assets/{collection-display-button-Dmr1DpXh.js → collection-display-button-BYX1WGsT.js} +1 -1
- package/dist/client/assets/{collection-search-DcBOG84t.js → collection-search-CVvFJ5Bb.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CBLUEZ5z.js → collection-table-wrapper-_tytodYv.js} +1 -1
- package/dist/client/assets/{collection-tabs-D5lfCRgo.js → collection-tabs-8dvqqnDR.js} +1 -1
- package/dist/client/assets/{column-rules-B3eVnEiY.js → column-rules-iw7Orhw0.js} +1 -1
- package/dist/client/assets/{combobox-CVTULN6N.js → combobox-CS_HItwQ.js} +1 -1
- package/dist/client/assets/{command-R1e1yMQ9.js → command-C9iGFbUT.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-hGQWfzwk.js → companion-mcps-section-DuvDeify.js} +1 -1
- package/dist/client/assets/{config-BWrcU7H3.js → config-Ba5RPb40.js} +1 -1
- package/dist/client/assets/{connect-CNN0l2XT.js → connect-Q-Yb-tbQ.js} +1 -1
- package/dist/client/assets/{connect-layout-DiWD8YTg.js → connect-layout-BsURWVqR.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-xgaD8LgG.js → connect-source-dialog-Cugh2Kwq.js} +1 -1
- package/dist/client/assets/{connection-card-DnICQFn9.js → connection-card-C_97TUuR.js} +1 -1
- package/dist/client/assets/{connection-detail-C0OJOuef.js → connection-detail-B2pboQAc.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CBYCAzPl.js → connection-form-helpers-B61Y3llL.js} +1 -1
- package/dist/client/assets/{connection-WJRbuDz1.js → connection-y8T_LUE4.js} +1 -1
- package/dist/client/assets/{connections-DjwbhWNZ.js → connections-BtM211zd.js} +1 -1
- package/dist/client/assets/{content-tab-CAJ559-P.js → content-tab-6aM6SPfn.js} +3 -3
- package/dist/client/assets/{context-BkZJrbqd.js → context-Dhzbo3rE.js} +1 -1
- package/dist/client/assets/{context-menu-B7wqDsW2.js → context-menu-DvfYSbOF.js} +1 -1
- package/dist/client/assets/{context-shell-DkaK_BOn.js → context-shell-DQlTMTgZ.js} +3 -3
- package/dist/client/assets/{core.esm-DHAYYfZu.js → core.esm-Bnj1keGH.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-u0Ud2kaY.js → create-organization-dialog-BJw0GqGQ.js} +1 -1
- package/dist/client/assets/{daily-pulse-DRJB1hcS.js → daily-pulse-ambOqGdx.js} +1 -1
- package/dist/client/assets/{discover-gZu3Sfan.js → discover-BaCG_0h-.js} +1 -1
- package/dist/client/assets/{domain-settings-USbT8NUs.js → domain-settings-DvRELpY-.js} +1 -1
- package/dist/client/assets/{drawer-C9bfrQZ2.js → drawer-txFUQcqx.js} +1 -1
- package/dist/client/assets/{editor-4LyrkCqm.js → editor-DxbkHv3R.js} +1 -1
- package/dist/client/assets/{editor-classes-_dczAbCq.js → editor-classes-C__SrxMV.js} +1 -1
- package/dist/client/assets/{empty-state-4Hlytpdt.js → empty-state-BCgDvmX-.js} +1 -1
- package/dist/client/assets/{empty-state-_a1QMwjl.js → empty-state-bJzQYitF.js} +1 -1
- package/dist/client/assets/experiments-tab-DmhKoZxz.js +1 -0
- package/dist/client/assets/{experiments-tab-choice-C9wWsYd4.js → experiments-tab-choice-Ie5k_O6x.js} +1 -1
- package/dist/client/assets/{extract-connection-data-mbA-zNaE.js → extract-connection-data-DrQExIK1.js} +1 -1
- package/dist/client/assets/{feature-gate-iJnsMeBr.js → feature-gate-Q2dMtYpF.js} +1 -1
- package/dist/client/assets/{feature-paywall-DcguOiJA.js → feature-paywall-XpETcjbv.js} +1 -1
- package/dist/client/assets/{file-explorer-B_iKC9bp.js → file-explorer-CfVYwLoJ.js} +1 -1
- package/dist/client/assets/{file-preview-Dy07kmgf.js → file-preview-Dd06GGvy.js} +1 -1
- package/dist/client/assets/{file-share-button-DOM1SplI.js → file-share-button-BxZcqmJb.js} +1 -1
- package/dist/client/assets/{file-type-icon-CP6Bm0Pm.js → file-type-icon-CIdo5ojc.js} +1 -1
- package/dist/client/assets/{folder-icon-D_8O1LWU.js → folder-icon-EiO3M0UC.js} +1 -1
- package/dist/client/assets/{form-B2fhil9l.js → form-uqsH1s-y.js} +1 -1
- package/dist/client/assets/{general-BE0anzP1.js → general-Vd-hJfIm.js} +1 -1
- package/dist/client/assets/{home-Bb5YZQHS.js → home-HWe4c99-.js} +1 -1
- package/dist/client/assets/{icon-button-BQwa115u.js → icon-button-BUDG7R_U.js} +1 -1
- package/dist/client/assets/{index-Ccma-e_l.js → index-7jvcir73.js} +1 -1
- package/dist/client/assets/{index-DXMlJvYf.js → index-B4zmwgCj.js} +8 -8
- package/dist/client/assets/{index-CYHGIatu.js → index-B7PBSrog.js} +1 -1
- package/dist/client/assets/{index-Cs4qaYPX.js → index-BCGh3XTH.js} +1 -1
- package/dist/client/assets/{index-rKWXOhdZ.js → index-BP0spIbU.js} +1 -1
- package/dist/client/assets/{index-D2MFYEzD.js → index-BphI8pNH.js} +39 -39
- package/dist/client/assets/{index-B4yeJC5N.js → index-BtufcGJ5.js} +1 -1
- package/dist/client/assets/{index-CXWqnDP7.js → index-C5xgscqu.js} +1 -1
- package/dist/client/assets/{index-R_qB4INp.js → index-CW0mTKOH.js} +1 -1
- package/dist/client/assets/{index-DU8BFhZD.js → index-C_7vDyVA.js} +1 -1
- package/dist/client/assets/{index-CK40JGB6.js → index-Codsxxmu.js} +1 -1
- package/dist/client/assets/index-DDtLrgkt.js +1 -0
- package/dist/client/assets/index-MPdUOMBb.css +1 -0
- package/dist/client/assets/{index-CeLGzS5y.js → index-kjyiSPIZ.js} +1 -1
- package/dist/client/assets/{index-redirect-D2LQ3n9D.js → index-redirect-TlUNx3Dt.js} +1 -1
- package/dist/client/assets/{index-BWgOKGMR.js → index-unPBFo0y.js} +1 -1
- package/dist/client/assets/{index-DiVZA6vr.js → index-v9zzzqiT.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CaSjeDsE.js → infiniteQueryObserver-CD6zPv_B.js} +1 -1
- package/dist/client/assets/{infra-billing-_cCsUnUO.js → infra-billing-gJ1Pxkhj.js} +1 -1
- package/dist/client/assets/{input-D43D11gI.js → input-DeNGl9cT.js} +1 -1
- package/dist/client/assets/{input-D9iDAvwy.js → input-otZYQGEr.js} +3 -3
- package/dist/client/assets/{integration-icon-CqbOWyvX.js → integration-icon-C-_9oW7G.js} +1 -1
- package/dist/client/assets/{jira-icon-Y_2uACKb.js → jira-icon-7kZdJvHs.js} +1 -1
- package/dist/client/assets/{label-3hTmrxoy.js → label-BXumUTqC.js} +1 -1
- package/dist/client/assets/{layout-EYuYXIPk.js → layout-Ba0KZf90.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-Y0g29rl5.js → legacy-agents-deep-D4pxgM1l.js} +1 -1
- package/dist/client/assets/legacy-main-redirect-BQ_7LpiD.js +1 -0
- package/dist/client/assets/library-1V2C8s_K.js +1 -0
- package/dist/client/assets/{login-DTF43M9h.js → login-CtcB6JMd.js} +1 -1
- package/dist/client/assets/{markdown-BeKN4MPt.js → markdown-Bqq3R66p.js} +3 -3
- package/dist/client/assets/{mcp-app-renderer-DcbWj_cd.js → mcp-app-renderer-tCfKhIA1.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BVLnM3ir.js → mcp-oauth-CaTRnuQU.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DQ__DCEs.js → mcp-oauth-ZxlBJ_T6.js} +1 -1
- package/dist/client/assets/{members-DdYed_-G.js → members-Ds3beXMQ.js} +1 -1
- package/dist/client/assets/{memory-CbDGJpdj.js → memory-CgI9n1je.js} +1 -1
- package/dist/client/assets/{mini-report-page-I5w2A9ue.js → mini-report-page-C4CjzrcA.js} +1 -1
- package/dist/client/assets/{mock-board-D64wFJ9x.js → mock-board-x9OA1kIr.js} +3 -3
- package/dist/client/assets/{monaco-editor-DEU78sxw.js → monaco-editor-DZ2Rp_C7.js} +1 -1
- package/dist/client/assets/monitoring-BkpBpvIZ.js +1 -0
- package/dist/client/assets/{monitoring-stats-row-BLFmMtG4.js → monitoring-stats-row-tdOtylzh.js} +1 -1
- package/dist/client/assets/{multi-select-DxNv8sxt.js → multi-select-BnYAqN90.js} +1 -1
- package/dist/client/assets/{mustache-Cm6mC1mo.js → mustache-DuPMqXPT.js} +1 -1
- package/dist/client/assets/{named-rule-uses-BBN_5zyZ.js → named-rule-uses-BFHY2QY4.js} +1 -1
- package/dist/client/assets/{named-rule-view-Dgj56LCZ.js → named-rule-view-DHbEzjpv.js} +1 -1
- package/dist/client/assets/{new-project-dialog-qMTAvOP0.js → new-project-dialog-Cs8HMQlb.js} +1 -1
- package/dist/client/assets/{oauth-callback-DzKW1jLM.js → oauth-callback-DSM8XE33.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BhTg9J9_.js → oauth-callback-ai-provider-DgCpBfDW.js} +1 -1
- package/dist/client/assets/{onboarding-CcHHvf_v.js → onboarding-DeVuIfK9.js} +1 -1
- package/dist/client/assets/{openai-conversation-X6iReX5A.js → openai-conversation-CXYNFSGC.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-Wa4vMG32.js → optimistic-project-sidebar-views-VOTXYU3D.js} +1 -1
- package/dist/client/assets/{order-monitor-day-d8yh4cv8.js → order-monitor-day-Bxp4gXEu.js} +1 -1
- package/dist/client/assets/{organization-choice-DKOeafiU.js → organization-choice-BhCIGMjr.js} +1 -1
- package/dist/client/assets/{orgs-CReR2HvS.js → orgs-BPDKksL2.js} +1 -1
- package/dist/client/assets/{page-seo-form-BTZBPUqn.js → page-seo-form-WBlhJY38.js} +1 -1
- package/dist/client/assets/{pair-DSps2zoM.js → pair-DRaIXAj-.js} +1 -1
- package/dist/client/assets/{parse-sections-Bc_lvOtq.js → parse-sections-ClqXxi6i.js} +1 -1
- package/dist/client/assets/{plan-CxnMa3En.js → plan-DVQ6L_2j.js} +1 -1
- package/dist/client/assets/{plan-ladder-7wUcVwfI.js → plan-ladder-BJOn0tjJ.js} +1 -1
- package/dist/client/assets/{popover-Dm_x8CV9.js → popover-D-MLGIKG.js} +1 -1
- package/dist/client/assets/{post-calendar-BtFE-61n.js → post-calendar-Ywpfpf68.js} +1 -1
- package/dist/client/assets/{post-editor-QChnOq6Y.js → post-editor-tA48ONL1.js} +1 -1
- package/dist/client/assets/{preview-content-BUlAqj-X.js → preview-content-0nJULLLy.js} +1 -1
- package/dist/client/assets/{preview-dialog-39V6ZO2Y.js → preview-dialog-DweVJd_n.js} +1 -1
- package/dist/client/assets/{preview-panel-BvoYfTNF.js → preview-panel-BJ3KrhDy.js} +1 -1
- package/dist/client/assets/{preview-tab-jmFSMM-R.js → preview-tab-C3IiVwf1.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-iaXbdjia.js → product-picker-dialog-CCIg354O.js} +1 -1
- package/dist/client/assets/{profile-IgWNvITK.js → profile-ZCnKsIdj.js} +1 -1
- package/dist/client/assets/{project-app-view-Bc-wof7y.js → project-app-view-BLZBQKeL.js} +1 -1
- package/dist/client/assets/{project-apps-DVzn0z1g.js → project-apps-FJ0TrEc6.js} +1 -1
- package/dist/client/assets/{project-feed-BIwmxSQY.js → project-feed-CZ6ECbBu.js} +1 -1
- package/dist/client/assets/{project-icon-CJmvnLdz.js → project-icon-J_TfV9WN.js} +1 -1
- package/dist/client/assets/project-reports-IwgSFkuk.js +1 -0
- package/dist/client/assets/project-tasks-DIh-1w8l.js +1 -0
- package/dist/client/assets/{projects-D8Cbhxnj.js → projects-BGlrrPvQ.js} +1 -1
- package/dist/client/assets/{projects-empty-state-CmtOjsbv.js → projects-empty-state-B699jX9t.js} +1 -1
- package/dist/client/assets/{prompts-BFb-SeSC.js → prompts-CL3pb_We.js} +1 -1
- package/dist/client/assets/record-editor-v6loIaK5.js +1 -0
- package/dist/client/assets/{redirect-editor-XmMaGVJV.js → redirect-editor-DwpwMdsP.js} +1 -1
- package/dist/client/assets/{releases-api-AYZ93qlv.js → releases-api-DX2L3yOb.js} +1 -1
- package/dist/client/assets/reports-VklqwHN4.js +1 -0
- package/dist/client/assets/{reports-AyOb4hhI.js → reports-fz3ShzPV.js} +1 -1
- package/dist/client/assets/{reports-onboarding-BDPMVaDo.js → reports-onboarding-mTQFH_iA.js} +1 -1
- package/dist/client/assets/{reports-tab-D2iADtiN.js → reports-tab-Bon4oiNK.js} +2 -2
- package/dist/client/assets/repositories-DVBlDnPs.js +1 -0
- package/dist/client/assets/{repositories-BNDNB0vE.js → repositories-Pjwn0cqi.js} +1 -1
- package/dist/client/assets/{repository-binding-4nTgXz1S.js → repository-binding-CqjA7Tko.js} +1 -1
- package/dist/client/assets/{repository-import-picker-De4sf2Gs.js → repository-import-picker-DRcn5MCM.js} +1 -1
- package/dist/client/assets/{repository-picker-HOHNvmaE.js → repository-picker-BL6xlIly.js} +1 -1
- package/dist/client/assets/{require-capability-ChTCz2WH.js → require-capability-gPmNE28i.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BZllo6Io.js → required-auth-layout-BA3Gxw_5.js} +1 -1
- package/dist/client/assets/{reset-password-Ui3G6CJw.js → reset-password-qyVzV1QI.js} +1 -1
- package/dist/client/assets/{resizable-DAXTAODq.js → resizable-Bu3AyxKl.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-CAixh6_W.js → resolve-tab-icon-DXt8FU1X.js} +1 -1
- package/dist/client/assets/{review-settings-BDP4bMe5.js → review-settings-O8K_mvh6.js} +1 -1
- package/dist/client/assets/{roles-Clx4HYW_.js → roles-CCLRm2p0.js} +1 -1
- package/dist/client/assets/{route-B9jYymiu.js → route-DMrkbv9t.js} +1 -1
- package/dist/client/assets/{route-CaI6hSyT.js → route-DaeLPCnk.js} +1 -1
- package/dist/client/assets/route-jSSJr7H8.js +1 -0
- package/dist/client/assets/{runnable-block-editor-LQjhwiX1.js → runnable-block-editor-DXVt1mRj.js} +3 -3
- package/dist/client/assets/{sandbox-lifecycle-context-CJodiAqU.js → sandbox-lifecycle-context-CAD11jz7.js} +1 -1
- package/dist/client/assets/{schema-xPkTs0YZ.js → schema-BKLQwKnK.js} +1 -1
- package/dist/client/assets/{schema-DrNvzI26.js → schema-Ddw2ah-q.js} +1 -1
- package/dist/client/assets/{scroll-area-BBBDJLpH.js → scroll-area-GNWuujdQ.js} +1 -1
- package/dist/client/assets/{search-input-DSx8LWNe.js → search-input-i8DAXvnS.js} +1 -1
- package/dist/client/assets/{search-toggle-B9X5GBEJ.js → search-toggle-C2BWIs4O.js} +1 -1
- package/dist/client/assets/{secret-ciphertext-qv17emf3.js → secret-ciphertext-BA15G7qe.js} +1 -1
- package/dist/client/assets/{secret-picker-DBs-gr5P.js → secret-picker-CwZHe4Yx.js} +1 -1
- package/dist/client/assets/{secrets-5nLK_pSH.js → secrets-BWNDO0aL.js} +1 -1
- package/dist/client/assets/{sections-ALAbnAYY.js → sections-DhRieK41.js} +1 -1
- package/dist/client/assets/{sections-editor-DVqxZTWF.js → sections-editor-TqSLQIU8.js} +1 -1
- package/dist/client/assets/{select-C9_0SSgH.js → select-BAxIwkW7.js} +1 -1
- package/dist/client/assets/{select-model-BaxH4IRV.js → select-model-DKcSOpKv.js} +1 -1
- package/dist/client/assets/{seo-editor-Cd-ANp55.js → seo-editor-BhgypNCN.js} +1 -1
- package/dist/client/assets/{separator-DXuISWBW.js → separator-gKWGw3ec.js} +1 -1
- package/dist/client/assets/settings-tab-Cp66Lx0x.js +1 -0
- package/dist/client/assets/{sheet-BQCLSAhw.js → sheet-Dy9d78N0.js} +1 -1
- package/dist/client/assets/{shell-layout-CnXya3zZ.js → shell-layout-DPflSDI7.js} +1 -1
- package/dist/client/assets/{site-draft-actions-BG_Fzxj9.js → site-draft-actions-BjAr6xi6.js} +1 -1
- package/dist/client/assets/site-draft-view-Bpwq-4Im.js +2 -0
- package/dist/client/assets/site-editor-CP2FSMmX.js +1 -0
- package/dist/client/assets/{site-editor-toast-BKVRfpA8.js → site-editor-toast-n7tT-SpR.js} +1 -1
- package/dist/client/assets/{skills-mFhfnuy4.js → skills-C-lfUnzb.js} +1 -1
- package/dist/client/assets/{slider-DTKLr6aL.js → slider-DMzP4oef.js} +1 -1
- package/dist/client/assets/{sortable.esm-D2---7Ab.js → sortable.esm-BEpH5tbt.js} +1 -1
- package/dist/client/assets/{sso-DrhiuaNt.js → sso-Bdl8tzvn.js} +1 -1
- package/dist/client/assets/{suggestion-B0A7rwRG.js → suggestion-BfzPP8A_.js} +1 -1
- package/dist/client/assets/{switch-CESJ2RZK.js → switch-B0lPkF5_.js} +1 -1
- package/dist/client/assets/{symbol-CYXY7_SE.js → symbol-CcauWbN2.js} +1 -1
- package/dist/client/assets/{synced-repos--pWS_C_z.js → synced-repos-cKAzeg2x.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-Cjt9sANI.js → tab-icon-glyph-C2nHjzae.js} +1 -1
- package/dist/client/assets/{table-BkZK8rXZ.js → table-CeULXNQ2.js} +1 -1
- package/dist/client/assets/{tabs-B6EQUSl_.js → tabs-fkqYJpP8.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-Dodx9W4w.js → task-assignee-avatar-BuSQPIHq.js} +1 -1
- package/dist/client/assets/{task-board-6nf7vbPi.js → task-board-Cv7D_3uN.js} +1 -1
- package/dist/client/assets/{task-route-BvbHuTGP.js → task-route-dMm35uIv.js} +1 -1
- package/dist/client/assets/{task-status-GUWtXwyC.js → task-status-D3EaEAgF.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-BXSTC1m2.js → taskboard-analytics-C2Yib8gP.js} +1 -1
- package/dist/client/assets/tasks-5wUjot9O.js +1 -0
- package/dist/client/assets/{tasks-DEvPbHif.js → tasks-Cx6Zd4fY.js} +1 -1
- package/dist/client/assets/{textarea-DG3FcnmS.js → textarea-aGNI5bvN.js} +1 -1
- package/dist/client/assets/{thread-analytics-BUqostwA.js → thread-analytics-B9HcTgTh.js} +1 -1
- package/dist/client/assets/{thread-intent-Ds79TVrW.js → thread-intent-BQGp3MKl.js} +1 -1
- package/dist/client/assets/{thread-route-UuA5SD5X.js → thread-route-BEIPJEss.js} +1 -1
- package/dist/client/assets/{thread-route-Cf5GTfDW.js → thread-route-D147zL8e.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-p9veuPgz.js → thread-sheet-body-i2u8ULqW.js} +1 -1
- package/dist/client/assets/{time-range-picker-Bo0eqMw9.js → time-range-picker-0kVuNsQb.js} +1 -1
- package/dist/client/assets/{toggle-group-C7NFln-0.js → toggle-group-DaYieoyW.js} +1 -1
- package/dist/client/assets/{tool-namespace-CMW8ZB5L.js → tool-namespace-DqsoHKmd.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BiR5ntfC.js → toolbar-icon-button-3blDPoB6.js} +1 -1
- package/dist/client/assets/{tooltip-bQVm_Ope.js → tooltip-2YCPx1DM.js} +1 -1
- package/dist/client/assets/{tooltipContext-CMDZ9J9X.js → tooltipContext-CgeI21sB.js} +1 -1
- package/dist/client/assets/{track-COIlf0dl.js → track-DO9rvMbw.js} +1 -1
- package/dist/client/assets/{types-DLna4BAB.js → types-6BxgL_uJ.js} +1 -1
- package/dist/client/assets/{url-slug-BWq-dgp6.js → url-slug-DxJ8K4M_.js} +1 -1
- package/dist/client/assets/{usage-stats-CvT3PVJT.js → usage-stats-BHO2m1GZ.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CzmKfSB9.js → use-ai-providers-D11veeve.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-BLEqLp1R.js → use-apply-named-rule-B4OGys4b.js} +1 -1
- package/dist/client/assets/{use-automations-DHA5_uZh.js → use-automations-tbwaowTj.js} +1 -1
- package/dist/client/assets/{use-autosave-BlShc4A-.js → use-autosave-DfMGkaud.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-BV7ldzPe.js → use-chat-layout-state-CIyU-XxO.js} +1 -1
- package/dist/client/assets/{use-clock-tick-C61VlTs_.js → use-clock-tick-DRqivY5H.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DxCCqNf4.js → use-connect-companion-pRfQU03M.js} +1 -1
- package/dist/client/assets/{use-connection-DTSe3r1K.js → use-connection-hBtWetVy.js} +1 -1
- package/dist/client/assets/{use-content-sync-Dj6rb1LD.js → use-content-sync-DTts1O7D.js} +1 -1
- package/dist/client/assets/{use-copy-Bc8JMSws.js → use-copy-Ctyjo3u8.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Dpe8iA_9.js → use-create-virtual-mcp-BoVnWYo_.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BGkTB4Mm.js → use-date-fns-locale-BL151nA9.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BhCHbQGN.js → use-debounced-autosave-XfpamUxh.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Cm7nwcam.js → use-debounced-value-DppuiHxU.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BgLGkCcl.js → use-deco-credits-DAnq8bae.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-C_BQo06W.js → use-decopilot-events-CmWo-JmL.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BEv8pmzy.js → use-delete-connection-D4L5Nbwc.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Ck9xx8zz.js → use-deployment-admin-CqRFItVm.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-B7ECUHMP.js → use-fast-preview-draft-url-6n7ATrzr.js} +1 -1
- package/dist/client/assets/{use-file-configs-C7kUU5_U.js → use-file-configs-BukUB2a7.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-U2BOY_0m.js → use-inbox-feed-DWwwp0yB.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CpvqXWve.js → use-infinite-scroll-CAGEOw6T.js} +1 -1
- package/dist/client/assets/{use-join-requests-ldwvbhU3.js → use-join-requests-C5RVOca9.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-BvDesOKd.js → use-main-panel-tabs-C_SiePFc.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-D6FLEMEz.js → use-mcp-auth-status-CPaTWfZe.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Cby5XqT6.js → use-mcp-client-DsrOnW9o.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DpGHOlEI.js → use-mcp-prompts-B5RvuVy4.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-7EpnWJvB.js → use-mcp-tools-oOqD73aG.js} +1 -1
- package/dist/client/assets/{use-members-oF45MDF1.js → use-members-DQZYP7Cb.js} +1 -1
- package/dist/client/assets/{use-mobile-h4hHhZkm.js → use-mobile-DruvZ2zF.js} +1 -1
- package/dist/client/assets/{use-move-blocks-DFQHiQ1n.js → use-move-blocks-C7t8R0hh.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DwJfjSMG.js → use-navigate-to-agent-CfXi671z.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-CjWCFQM1.js → use-open-billing-url-0u6Rqj8b.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BFDehTsp.js → use-org-auth-client-CSFZu3Wj.js} +1 -1
- package/dist/client/assets/{use-org-fs-CyxFz8rw.js → use-org-fs-Bndw9m25.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-BsUWjWH7.js → use-org-repo-syncs-DgWzYW9F.js} +1 -1
- package/dist/client/assets/{use-org-sso-D5M4Sxwu.js → use-org-sso-B7o6rhq2.js} +1 -1
- package/dist/client/assets/{use-organization-roles-t12r77qZ.js → use-organization-roles-DPfq-0hG.js} +1 -1
- package/dist/client/assets/{use-organization-settings-NOur1Lvu.js → use-organization-settings-B2e749tN.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-DxGjTjIo.js → use-panel-navigate-C-ip5ing.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-USh7_bNt.js → use-project-native-view-presence-iEIqgCZR.js} +1 -1
- package/dist/client/assets/{use-project-scope-CBw0FSEz.js → use-project-scope-DN9qkINS.js} +1 -1
- package/dist/client/assets/{use-recent-apps-B2LVD6z4.js → use-recent-apps-Dieru2LM.js} +1 -1
- package/dist/client/assets/{use-releases-x9nrIfuE.js → use-releases-DJrTmfLZ.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-qSw4HttT.js → use-reports-diagnostic-BdDNwhZy.js} +1 -1
- package/dist/client/assets/{use-sandbox-events-D98uWMd_.js → use-sandbox-events-B-rKhgAE.js} +1 -1
- package/dist/client/assets/{use-secrets-CvBGDTuP.js → use-secrets-C3hSYvUx.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DmjOJ885.js → use-section-preview-base-NrYdhHI5.js} +1 -1
- package/dist/client/assets/{use-session-runtime-BrkTaSa6.js → use-session-runtime-RS_ZeJDS.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-Bijbdhqq.js → use-sidebar-collapsed-C9KH2wzy.js} +1 -1
- package/dist/client/assets/{use-tags-BMQZw2TW.js → use-tags-DBJgOg0Z.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-DdtvZ4ju.js → use-task-board-analytics-Bl-3jKgS.js} +1 -1
- package/dist/client/assets/{use-task-board-events-B5yNhg5i.js → use-task-board-events-CemAfTjA.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-D9gfgNig.js → use-task-board-item-prs-83sFKoAa.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DuF2rBuH.js → use-task-metadata-DYSGuNJN.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-B03W7aQi.js → use-thread-analytics-B-gfPcTz.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-D_k8NizM.js → use-thread-outputs-9KkInEd1.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Ctv8zOi3.js +1 -0
- package/dist/client/assets/{useQueries-BSehCBUp.js → useQueries-BRUig2bT.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DRLUIOlU.js +1 -0
- package/dist/client/assets/{users-Cej3U7P5.js → users-zGj6iqQJ.js} +1 -1
- package/dist/client/assets/{utils-CkwBhBMS.js → utils-DnxtSQ0E.js} +1 -1
- package/dist/client/assets/{variant-calendar-kJB8Qi3I.js → variant-calendar-DzngKeid.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-XY7K79P5.js → variant-matcher-override-BvLc7beb.js} +1 -1
- package/dist/client/assets/{virtual-mcp-BzmRbmfQ.js → virtual-mcp-CKcyAjRE.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-CmsmQLFo.js → watch-sse-pool-B6MhK1l7.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server.js +417 -417
- package/package.json +1 -1
- package/dist/client/assets/agent-analytics-D7PovqhV.js +0 -1
- package/dist/client/assets/agent-app-DEsjnzHy.js +0 -1
- package/dist/client/assets/agent-calendar-Co4HNR_x.js +0 -1
- package/dist/client/assets/agent-deck-Bra-oqcr.js +0 -1
- package/dist/client/assets/agent-experiments-W5vP2PHw.js +0 -1
- package/dist/client/assets/agent-file-_hkGq1Y2.js +0 -1
- package/dist/client/assets/agent-library-BTKjZMW2.js +0 -1
- package/dist/client/assets/agent-library-file-ClGbfS7a.js +0 -1
- package/dist/client/assets/agent-monitor-Dtdyok8Z.js +0 -1
- package/dist/client/assets/agent-settings-DQDpgZ05.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CiWALb3j.js +0 -2
- package/dist/client/assets/agent-site-editor-content-BrDlLQPy.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-Da7g0LlC.js +0 -1
- package/dist/client/assets/agent-view-l1LYqbmp.js +0 -1
- package/dist/client/assets/api-keys-kxUaur7Y.js +0 -1
- package/dist/client/assets/cms-settings-editor-Dh-qBReE.js +0 -1
- package/dist/client/assets/experiments-tab-DdHl8yk7.js +0 -1
- package/dist/client/assets/index-CO7uP6ut.js +0 -1
- package/dist/client/assets/index-DjdMnw7p.css +0 -1
- package/dist/client/assets/legacy-main-redirect-Pt1vRyf-.js +0 -1
- package/dist/client/assets/library-DJ51ehEw.js +0 -1
- package/dist/client/assets/monitor-v8-CHgzPfyd.js +0 -1
- package/dist/client/assets/monitoring-Bklr39Mh.js +0 -1
- package/dist/client/assets/project-reports-DnaQ9nW_.js +0 -1
- package/dist/client/assets/project-tasks-cwxXGcyN.js +0 -1
- package/dist/client/assets/record-editor-hWJJMGCG.js +0 -1
- package/dist/client/assets/reports-BQij5juA.js +0 -1
- package/dist/client/assets/repositories-BiNU-Xfn.js +0 -1
- package/dist/client/assets/route-BjK3qzB4.js +0 -1
- package/dist/client/assets/settings-tab-D_D1vl9t.js +0 -1
- package/dist/client/assets/site-draft-view-BYdCjysm.js +0 -2
- package/dist/client/assets/site-editor-B7kc0tIQ.js +0 -1
- package/dist/client/assets/tasks-Cd3DKWnU.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Dobhsojg.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CqyfVE9R.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as L,j as t,q as W,D as G,r as _,b1 as z,l as A,v as H,fN as K,B as I,aU as U}from"./index-
|
|
1
|
+
import{c as L,j as t,q as W,D as G,r as _,b1 as z,l as A,v as H,fN as K,B as I,aU as U}from"./index-BphI8pNH.js";import{i as R}from"./ZoomOut-DzrH576O.js";import{M as V}from"./markdown-Bqq3R66p.js";import{F as Z}from"./file-preview-Dd06GGvy.js";import{F as q}from"./file-type-icon-CIdo5ojc.js";import{j as J,g as Q,o as X}from"./use-org-fs-Bndw9m25.js";import{p as Y,b as $}from"./location-V0VwTJTt.js";import{s as ee}from"./Image01-D_y3XkIW.js";function te(o){const e={};for(const l of o.split(`
|
|
2
2
|
`)){const s=l.match(/^([A-Za-z][\w-]*):\s*(.*)$/);s?.[1]&&s[2]!==void 0&&(e[s[1].toLowerCase()]=s[2].trim())}return e}function O(o){for(const e of o.split(/\n\s*\n/)){const l=e.trim();if(!(!l||l.startsWith("#")))return l.replace(/\n/g," ")}return null}function se(o){const e=o.match(/^---\n([\s\S]*?)\n---\n?/);if(!e||e[1]===void 0)return{name:null,description:O(o),disableModelInvocation:!1,body:o};const l=te(e[1]),s=o.slice(e[0].length);return{name:l.name||null,description:l.description||O(s),disableModelInvocation:l["disable-model-invocation"]==="true",body:s}}function le(o){const e=L.c(18),{skillPath:l,onClose:s,variant:i}=o,n=Y(l),{volume:a,dirPath:v}=n,E=J(),r=E(a??"",`${v}/SKILL.md`),F=Q(r),D=X(a??"",v);let w;e[0]!==v?(w=$(v),e[0]=v,e[1]=w):w=e[1];const P=w;let h;e[2]!==F.data?(h=F.data?se(F.data):null,e[2]=F.data,e[3]=h):h=e[3];const x=h,C=re;let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=(m,M)=>C(m.path)?-1:C(M.path)?1:$(m.path).localeCompare($(M.path)),e[4]=p):p=e[4];const B=(D.data??[]).filter(oe).sort(p),[k,S]=_.useState(null),c=k===null?null:B.find(m=>m.path===k)??null,u=x?.name??P;let g;e[5]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(R,{size:18})}),e[5]=g):g=e[5];let d;e[6]!==u||e[7]!==i?(d=i==="dialog"?t.jsx(H,{className:"flex-1 truncate text-base font-medium text-foreground",children:u}):t.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:u}),e[6]=u,e[7]=i,e[8]=d):d=e[8];let f;e[9]!==s||e[10]!==i?(f=i==="dialog"?t.jsx(K,{asChild:!0,children:t.jsx(I,{variant:"ghost",size:"icon",className:"shrink-0",children:t.jsx(U,{size:16})})}):t.jsx(I,{variant:"ghost",size:"icon",className:"shrink-0",onClick:s,children:t.jsx(U,{size:16})}),e[9]=s,e[10]=i,e[11]=f):f=e[11];let j;e[12]!==d||e[13]!==f?(j=t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[g,d,f]}),e[12]=d,e[13]=f,e[14]=j):j=e[14];let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("p",{className:"px-2 py-1.5 text-sm font-medium text-foreground",children:"Files"}),e[15]=b):b=e[15];const T="relative flex min-w-0 flex-1 flex-col overflow-y-auto",y=c?t.jsx(Z,{file:{key:c.path,filename:$(c.path),size:c.size,downloadUrl:E(a??"",c.path)}}):F.isPending?t.jsxs("div",{className:"flex flex-col gap-2 p-6",children:[t.jsx(z,{className:"h-4 w-1/3"}),t.jsx(z,{className:"h-3 w-full"}),t.jsx(z,{className:"h-3 w-5/6"}),t.jsx(z,{className:"h-3 w-2/3"})]}):F.isError||!x?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This skill is no longer available."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-4 border-b border-border p-6",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Description"}),t.jsx("p",{className:"text-base text-muted-foreground",children:x.description??"Claude Code skill"})]}),t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-6",children:t.jsx(V,{id:`skill-preview-${l}`,text:x.body})})]});let N;return e[16]!==y?(N=t.jsx("div",{className:T,children:y}),e[16]=y,e[17]=N):N=e[17],t.jsxs(t.Fragment,{children:[j,t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("div",{className:"flex w-[220px] shrink-0 flex-col gap-1 overflow-y-auto border-r border-border bg-muted p-3",children:[b,D.isPending?t.jsx(z,{className:"mx-2 h-4 w-24"}):B.map(m=>{const M=C(m.path)?c===null:k===m.path;return t.jsxs("button",{type:"button",onClick:()=>S(C(m.path)?null:m.path),className:A("flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left",M?"bg-background shadow-edge":"hover:bg-accent"),children:[t.jsx(q,{filename:$(m.path),className:"h-6 w-5 shrink-0"}),t.jsx("span",{className:A("truncate text-sm",M?"text-foreground":"text-muted-foreground"),children:$(m.path)})]},m.path)})]}),N]})]})}function oe(o){return o.kind==="file"}function re(o){return $(o)==="SKILL.md"}function ge(o){const e=L.c(8),{skillPath:l,onClose:s}=o;let i;e[0]!==s?(i=v=>{v||s()},e[0]=s,e[1]=i):i=e[1];let n;e[2]!==s||e[3]!==l?(n=t.jsx(W,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",closeButtonClassName:"hidden",children:t.jsx(le,{skillPath:l,onClose:s,variant:"dialog"})}),e[2]=s,e[3]=l,e[4]=n):n=e[4];let a;return e[5]!==i||e[6]!==n?(a=t.jsx(G,{open:!0,onOpenChange:i,children:n}),e[5]=i,e[6]=n,e[7]=a):a=e[7],a}const ie={default:{backFrom:"#4D87DF",backTo:"#296FE8",frontFrom:"#72B6FA",frontTo:"#5BB1EF",stripe:"#84CDFB",glyph:"#014AC9"},system:{backFrom:"#8A94A6",backTo:"#6B7687",frontFrom:"#B6BEC9",frontTo:"#A3ADBA",stripe:"#D5DBE3",glyph:"#3D4757"}},ne=[-7,0,7];function je(o){const e=L.c(50);let l,s,i,n,a;e[0]!==o?({glyph:l,readOnly:i,tone:n,sheets:a,...s}=o,e[0]=o,e[1]=l,e[2]=s,e[3]=i,e[4]=n,e[5]=a):(l=e[1],s=e[2],i=e[3],n=e[4],a=e[5]);const v=n===void 0?"default":n,E=a===void 0?0:a,r=ie[v],F=_.useId(),D=`${F}-back`,w=`${F}-front`,P=`url(#${D})`;let h;e[6]!==P?(h=t.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:P}),e[6]=P,e[7]=h):h=e[7];let x;e[8]!==E?(x=ne.slice(0,Math.min(Math.max(E,0),3)).map(ae),e[8]=E,e[9]=x):x=e[9];const C=`url(#${w})`;let p;e[10]!==C?(p=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:C}),e[10]=C,e[11]=p):p=e[11];let B;e[12]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),e[12]=B):B=e[12];let k,S;e[13]!==r.stripe?(S=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:r.stripe}),k=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:r.stripe}),e[13]=r.stripe,e[14]=k,e[15]=S):(k=e[14],S=e[15]);let c;e[16]!==l||e[17]!==r.glyph?(c=l&&t.jsx(l,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:r.glyph,opacity:.55}}),e[16]=l,e[17]=r.glyph,e[18]=c):c=e[18];let u;e[19]!==i?(u=i&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),t.jsx(ee,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[19]=i,e[20]=u):u=e[20];let g;e[21]!==r.backFrom?(g=t.jsx("stop",{offset:"0.3",stopColor:r.backFrom}),e[21]=r.backFrom,e[22]=g):g=e[22];let d;e[23]!==r.backTo?(d=t.jsx("stop",{offset:"1",stopColor:r.backTo}),e[23]=r.backTo,e[24]=d):d=e[24];let f;e[25]!==D||e[26]!==g||e[27]!==d?(f=t.jsxs("linearGradient",{id:D,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[g,d]}),e[25]=D,e[26]=g,e[27]=d,e[28]=f):f=e[28];let j;e[29]!==r.frontFrom?(j=t.jsx("stop",{stopColor:r.frontFrom}),e[29]=r.frontFrom,e[30]=j):j=e[30];let b;e[31]!==r.frontTo?(b=t.jsx("stop",{offset:"1",stopColor:r.frontTo}),e[31]=r.frontTo,e[32]=b):b=e[32];let T;e[33]!==w||e[34]!==j||e[35]!==b?(T=t.jsxs("radialGradient",{id:w,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[j,b]}),e[33]=w,e[34]=j,e[35]=b,e[36]=T):T=e[36];let y;e[37]!==f||e[38]!==T?(y=t.jsxs("defs",{children:[f,T]}),e[37]=f,e[38]=T,e[39]=y):y=e[39];let N;return e[40]!==s||e[41]!==k||e[42]!==c||e[43]!==u||e[44]!==y||e[45]!==h||e[46]!==x||e[47]!==p||e[48]!==S?(N=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...s,children:[h,x,p,B,S,k,c,u,y]}),e[40]=s,e[41]=k,e[42]=c,e[43]=u,e[44]=y,e[45]=h,e[46]=x,e[47]=p,e[48]=S,e[49]=N):N=e[49],N}function ae(o){return t.jsx("rect",{x:"9",y:"3.4",width:"14",height:"12",rx:"1.2",fill:"#F4F6F9",stroke:"#C9D2DC",strokeWidth:"0.7",transform:`rotate(${o} 16 12)`},o)}export{je as F,ge as S,se as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dB as C,c as d,j as c,b5 as b,r as f,l as p,bu as j,dC as v,dD as h}from"./index-
|
|
1
|
+
import{dB as C,c as d,j as c,b5 as b,r as f,l as p,bu as j,dC as v,dD as h}from"./index-BphI8pNH.js";import{L as N}from"./label-BXumUTqC.js";const E=C,g=f.createContext({}),M=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(b,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(g),s=f.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=f.createContext({});function w(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=f.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(j,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,w as b,L as c,P as d,y as e,R as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as U,a2 as te,o as oe,aE as re,aD as le,e as ie,y as H,t as q,K as J,j as i,ew as ne,ex as se,ey as Q,b5 as ce,I as ae,aF as ge,aG as X,c as Y,r as W,an as de,aw as ee,bY as me,bZ as ue,G as fe,B as pe,am as xe,n as M,fM as he,aY as je}from"./index-D2MFYEzD.js";import{u as ze}from"./use-org-auth-client-BFDehTsp.js";import{u as Se}from"./use-debounced-autosave-BhCHbQGN.js";import{A as Oe}from"./avatar-BRRGslVN.js";import{C as ve,B as be,a as ye}from"./review-settings-BDP4bMe5.js";import{D as Ce}from"./domain-settings-USbT8NUs.js";import{A as _e,a as Fe,b as De,c as Ae,g as we,d as Ee,e as Te,f as Ne}from"./alert-dialog-KKnJELoX.js";import{C as Le}from"./capability-load-error-CDC4LjDf.js";import"./User01-1q78INo2.js";import"./switch-CESJ2RZK.js";import"./UserSquare-B_yRFcN6.js";import"./use-organization-settings-NOur1Lvu.js";import"./schema-DrNvzI26.js";import"./task-board-6nf7vbPi.js";import"./use-connection-DTSe3r1K.js";import"./use-mcp-client-Cby5XqT6.js";import"./auth-DHZfBLZ5.js";import"./badge-DmeqGssZ.js";import"./select-C9_0SSgH.js";import"./index-BdQq_4o_.js";import"./index-CXWqnDP7.js";import"./ChevronUp-DiTVmUiH.js";const Pe=e=>ge({name:X().min(1,e("settings.organizationForm.nameRequired")).max(255,e("settings.organizationForm.nameTooLong")),logo:X().optional()});function ke(e){const t=Y.c(17),{value:s,onChange:f,name:g,disabled:l}=e,c=U(),d=W.useRef(null);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>d.current?.click(),t[0]=r):r=t[0];const m=r;let n;t[1]!==f||t[2]!==c?(n=S=>{const z=S.target.files?.[0];if(!z)return;if(z.size>2097152){q.error(c("settings.organizationForm.imageTooLarge"));return}const p=new FileReader;p.onerror=()=>q.error(c("settings.organizationForm.failedToReadImage")),p.onloadend=()=>{p.result&&f(p.result),d.current&&(d.current.value="")},p.readAsDataURL(z)},t[1]=f,t[2]=c,t[3]=n):n=t[3];const a=n;let o;t[4]!==c?(o=c("settings.organizationForm.uploadLogoLabel"),t[4]=c,t[5]=o):o=t[5];let u;t[6]!==l||t[7]!==a?(u=i.jsx("input",{ref:d,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:l}),t[6]=l,t[7]=a,t[8]=u):u=t[8];const h=s||void 0,j=g??"?";let x;t[9]!==h||t[10]!==j?(x=i.jsx(Oe,{url:h,fallback:j,shape:"square",size:"base"}),t[9]=h,t[10]=j,t[11]=x):x=t[11];let v;return t[12]!==l||t[13]!==o||t[14]!==u||t[15]!==x?(v=i.jsxs("button",{type:"button",onClick:m,disabled:l,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":o,children:[u,x]}),t[12]=l,t[13]=o,t[14]=u,t[15]=x,t[16]=v):v=t[16],v}function Re(){const e=U(),{org:t}=te(),s=ze(),f=oe(),g=re({resolver:le(Pe(e)),values:{name:t.name??"",logo:t.logo??""}}),l=ie({mutationFn:async n=>{const a={name:n.name};n.logo&&(a.logo=n.logo);const o=await s.organization.update({data:a});if(o?.error)throw new Error(o.error.message||e("settings.organizationForm.failedToUpdateOrg"));return o},onSuccess:(n,a)=>{H("organization_settings_updated",{organization_id:t.id,fields:Object.keys(a)}),f.invalidateQueries({queryKey:J.organizations()}),f.invalidateQueries({queryKey:J.activeOrganization(t.slug)}),q.success(e("settings.organizationForm.updateSuccess"))},onError:(n,a)=>{H("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(a),error:n instanceof Error?n.message:String(n)}),q.error(n instanceof Error?n.message:e("settings.organizationForm.failedToUpdateOrg"))}}),{schedule:c,flush:d}=Se({save:async()=>{const n=g.control._formState.dirtyFields;if(Object.keys(n).length===0||!await g.trigger())return;const o=g.getValues(),u=g.control._defaultValues;g.reset(o,{keepValues:!0});try{await l.mutateAsync(o)}catch{g.reset(u,{keepValues:!0})}}}),r=g.formState.errors,m=typeof window<"u"?`${window.location.host}/`:"";return i.jsx(ne,{children:i.jsxs(se,{children:[i.jsx(Q,{title:e("settings.organizationForm.logoTitle"),description:e("settings.organizationForm.logoDescription"),action:i.jsx(ke,{value:g.watch("logo"),onChange:n=>{g.setValue("logo",n??"",{shouldDirty:!0}),d()},name:g.watch("name")})}),i.jsx(Q,{title:e("settings.organizationForm.nameTitle"),action:i.jsx(ce,{control:g.control,name:"name",render:({field:n})=>i.jsx(ae,{id:"org-name",...n,onChange:a=>{n.onChange(a),c()},onBlur:()=>{n.onBlur(),d()},placeholder:e("settings.organizationForm.namePlaceholder"),className:"w-[280px]"})})}),i.jsx(Q,{title:e("settings.organizationForm.urlTitle"),description:e("settings.organizationForm.urlDescription"),action:i.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-muted/40 overflow-hidden",children:[m&&i.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:m}),i.jsx("span",{className:"flex-1 min-w-0 px-2 py-1.5 text-sm text-foreground truncate",children:t.slug})]})}),(r.name||r.logo)&&i.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&i.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.logo&&i.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function Be(){const e=Y.c(83),t=U(),{org:s}=te(),[f,g]=W.useState(!1),[l,c]=W.useState(""),d=de();let r;e[0]!==s.id||e[1]!==d?(r=async()=>{await d.call("ORGANIZATION_DELETE",{id:s.id})},e[0]=s.id,e[1]=d,e[2]=r):r=e[2];let m;e[3]!==s.id||e[4]!==s.slug||e[5]!==t?(m=()=>{H("organization_deleted",{organization_id:s.id}),localStorage.getItem(ee.lastOrgSlug())===s.slug&&localStorage.removeItem(ee.lastOrgSlug()),me()?.org===s.slug&&ue(),fe(),q.success(t("settings.deleteOrganizationSection.organizationDeleted")),window.location.href="/"},e[3]=s.id,e[4]=s.slug,e[5]=t,e[6]=m):m=e[6];let n;e[7]!==t?(n=O=>{q.error(O instanceof Error?O.message:t("settings.deleteOrganizationSection.failedToDeleteOrganization"))},e[7]=t,e[8]=n):n=e[8];let a;e[9]!==r||e[10]!==m||e[11]!==n?(a={mutationFn:r,onSuccess:m,onError:n},e[9]=r,e[10]=m,e[11]=n,e[12]=a):a=e[12];const o=ie(a);let u;e[13]!==t?(u=t("settings.deleteOrganizationSection.dangerZone"),e[13]=t,e[14]=u):u=e[14];let h;e[15]!==t?(h=t("settings.deleteOrganizationSection.deleteOrganizationTitle"),e[15]=t,e[16]=h):h=e[16];let j;e[17]!==t?(j=t("settings.deleteOrganizationSection.deleteOrganizationDescription"),e[17]=t,e[18]=j):j=e[18];let x;e[19]===Symbol.for("react.memo_cache_sentinel")?(x=()=>g(!0),e[19]=x):x=e[19];const v=o.isPending;let S;e[20]!==t?(S=t("settings.deleteOrganizationSection.deleteButton"),e[20]=t,e[21]=S):S=e[21];let z;e[22]!==o.isPending||e[23]!==S?(z=i.jsx(pe,{variant:"destructive",size:"sm",onClick:x,disabled:v,children:S}),e[22]=o.isPending,e[23]=S,e[24]=z):z=e[24];let p;e[25]!==z||e[26]!==h||e[27]!==j?(p=i.jsx(se,{className:"border-destructive/40",children:i.jsx(Q,{title:h,description:j,action:z})}),e[25]=z,e[26]=h,e[27]=j,e[28]=p):p=e[28];let b;e[29]!==p||e[30]!==u?(b=i.jsx(ne,{title:u,children:p}),e[29]=p,e[30]=u,e[31]=b):b=e[31];let K;e[32]===Symbol.for("react.memo_cache_sentinel")?(K=O=>{g(O),O||c("")},e[32]=K):K=e[32];let y;e[33]!==t?(y=t("settings.deleteOrganizationSection.deleteOrganizationQuestion"),e[33]=t,e[34]=y):y=e[34];let C;e[35]!==y?(C=i.jsx(_e,{children:y}),e[35]=y,e[36]=C):C=e[36];let _;e[37]!==s.name||e[38]!==t?(_=t("settings.deleteOrganizationSection.deleteWarning",{organizationName:s.name}),e[37]=s.name,e[38]=t,e[39]=_):_=e[39];let F;e[40]!==_?(F=i.jsx("p",{children:_}),e[40]=_,e[41]=F):F=e[41];let D;e[42]!==s.name||e[43]!==t?(D=t("settings.deleteOrganizationSection.typeToConfirm",{organizationName:s.name}),e[42]=s.name,e[43]=t,e[44]=D):D=e[44];let A;e[45]!==D?(A=i.jsx("p",{className:"mt-3 mb-1.5",children:D}),e[45]=D,e[46]=A):A=e[46];let V;e[47]===Symbol.for("react.memo_cache_sentinel")?(V=O=>c(O.target.value),e[47]=V):V=e[47];let w;e[48]!==l||e[49]!==s.name?(w=i.jsx(ae,{value:l,onChange:V,placeholder:s.name,autoFocus:!0}),e[48]=l,e[49]=s.name,e[50]=w):w=e[50];let E;e[51]!==F||e[52]!==A||e[53]!==w?(E=i.jsx(Fe,{asChild:!0,children:i.jsxs("div",{children:[F,A,w]})}),e[51]=F,e[52]=A,e[53]=w,e[54]=E):E=e[54];let T;e[55]!==C||e[56]!==E?(T=i.jsxs(De,{children:[C,E]}),e[55]=C,e[56]=E,e[57]=T):T=e[57];let N;e[58]!==t?(N=t("settings.deleteOrganizationSection.cancel"),e[58]=t,e[59]=N):N=e[59];let L;e[60]!==N?(L=i.jsx(Ae,{children:N}),e[60]=N,e[61]=L):L=e[61];let P;e[62]!==o?(P=()=>o.mutate(),e[62]=o,e[63]=P):P=e[63];const Z=l!==s.name||o.isPending;let k;e[64]!==o.isPending||e[65]!==t?(k=o.isPending?t("settings.deleteOrganizationSection.deleting"):t("settings.deleteOrganizationSection.deleteOrganizationAction"),e[64]=o.isPending,e[65]=t,e[66]=k):k=e[66];let R;e[67]!==P||e[68]!==Z||e[69]!==k?(R=i.jsx(we,{onClick:P,disabled:Z,variant:"destructive",children:k}),e[67]=P,e[68]=Z,e[69]=k,e[70]=R):R=e[70];let B;e[71]!==L||e[72]!==R?(B=i.jsxs(Ee,{children:[L,R]}),e[71]=L,e[72]=R,e[73]=B):B=e[73];let I;e[74]!==T||e[75]!==B?(I=i.jsxs(Te,{children:[T,B]}),e[74]=T,e[75]=B,e[76]=I):I=e[76];let G;e[77]!==f||e[78]!==I?(G=i.jsx(Ne,{open:f,onOpenChange:K,children:I}),e[77]=f,e[78]=I,e[79]=G):G=e[79];let $;return e[80]!==b||e[81]!==G?($=i.jsxs(i.Fragment,{children:[b,G]}),e[80]=b,e[81]=G,e[82]=$):$=e[82],$}function Ie(){const e=Y.c(15),t=U(),{granted:s,loading:f,error:g}=xe("org:manage");if(f){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(je,{}),e[0]=a):a=e[0],a}if(g){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Le,{}),e[1]=a):a=e[1],a}let l;e[2]!==t?(l=t("settings.nav.general"),e[2]=t,e[3]=l):l=e[3];let c;e[4]!==l?(c=i.jsx(M.Title,{children:l}),e[4]=l,e[5]=c):c=e[5];let d;e[6]!==s?(d=s&&i.jsxs(i.Fragment,{children:[i.jsx(Re,{}),i.jsx(ve,{}),i.jsx(be,{})]}),e[6]=s,e[7]=d):d=e[7];let r;e[8]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(ye,{}),e[8]=r):r=e[8];let m;e[9]!==s?(m=s&&i.jsxs(i.Fragment,{children:[i.jsx(Ce,{}),i.jsx(Be,{})]}),e[9]=s,e[10]=m):m=e[10];let n;return e[11]!==c||e[12]!==d||e[13]!==m?(n=i.jsx(M,{children:i.jsx(M.Content,{children:i.jsx(M.Container,{children:i.jsxs(he,{children:[c,d,r,m]})})})}),e[11]=c,e[12]=d,e[13]=m,e[14]=n):n=e[14],n}function lt(){const e=Y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(Ie,{}),e[0]=t):t=e[0],t}export{lt as default};
|
|
1
|
+
import{b as U,a2 as te,o as oe,aE as re,aD as le,e as ie,y as H,t as q,K as J,j as i,ew as ne,ex as se,ey as Q,b5 as ce,I as ae,aF as ge,aG as X,c as Y,r as W,an as de,aw as ee,bY as me,bZ as ue,G as fe,B as pe,am as xe,n as M,fM as he,aY as je}from"./index-BphI8pNH.js";import{u as ze}from"./use-org-auth-client-CSFZu3Wj.js";import{u as Se}from"./use-debounced-autosave-XfpamUxh.js";import{A as Oe}from"./avatar-CFO-sRGJ.js";import{C as ve,B as be,a as ye}from"./review-settings-O8K_mvh6.js";import{D as Ce}from"./domain-settings-DvRELpY-.js";import{A as _e,a as Fe,b as De,c as Ae,g as we,d as Ee,e as Te,f as Ne}from"./alert-dialog-Bbqu21pF.js";import{C as Le}from"./capability-load-error-BfKRzvUM.js";import"./User01-vLr2BfmM.js";import"./switch-B0lPkF5_.js";import"./UserSquare-B7fe7FYj.js";import"./use-organization-settings-B2e749tN.js";import"./schema-Ddw2ah-q.js";import"./task-board-Cv7D_3uN.js";import"./use-connection-hBtWetVy.js";import"./use-mcp-client-DsrOnW9o.js";import"./auth-BypL5L1O.js";import"./badge-CYEiaJVw.js";import"./select-BAxIwkW7.js";import"./index-BdQq_4o_.js";import"./index-C5xgscqu.js";import"./ChevronUp-DtSKb4be.js";const Pe=e=>ge({name:X().min(1,e("settings.organizationForm.nameRequired")).max(255,e("settings.organizationForm.nameTooLong")),logo:X().optional()});function ke(e){const t=Y.c(17),{value:s,onChange:f,name:g,disabled:l}=e,c=U(),d=W.useRef(null);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>d.current?.click(),t[0]=r):r=t[0];const m=r;let n;t[1]!==f||t[2]!==c?(n=S=>{const z=S.target.files?.[0];if(!z)return;if(z.size>2097152){q.error(c("settings.organizationForm.imageTooLarge"));return}const p=new FileReader;p.onerror=()=>q.error(c("settings.organizationForm.failedToReadImage")),p.onloadend=()=>{p.result&&f(p.result),d.current&&(d.current.value="")},p.readAsDataURL(z)},t[1]=f,t[2]=c,t[3]=n):n=t[3];const a=n;let o;t[4]!==c?(o=c("settings.organizationForm.uploadLogoLabel"),t[4]=c,t[5]=o):o=t[5];let u;t[6]!==l||t[7]!==a?(u=i.jsx("input",{ref:d,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:l}),t[6]=l,t[7]=a,t[8]=u):u=t[8];const h=s||void 0,j=g??"?";let x;t[9]!==h||t[10]!==j?(x=i.jsx(Oe,{url:h,fallback:j,shape:"square",size:"base"}),t[9]=h,t[10]=j,t[11]=x):x=t[11];let v;return t[12]!==l||t[13]!==o||t[14]!==u||t[15]!==x?(v=i.jsxs("button",{type:"button",onClick:m,disabled:l,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":o,children:[u,x]}),t[12]=l,t[13]=o,t[14]=u,t[15]=x,t[16]=v):v=t[16],v}function Re(){const e=U(),{org:t}=te(),s=ze(),f=oe(),g=re({resolver:le(Pe(e)),values:{name:t.name??"",logo:t.logo??""}}),l=ie({mutationFn:async n=>{const a={name:n.name};n.logo&&(a.logo=n.logo);const o=await s.organization.update({data:a});if(o?.error)throw new Error(o.error.message||e("settings.organizationForm.failedToUpdateOrg"));return o},onSuccess:(n,a)=>{H("organization_settings_updated",{organization_id:t.id,fields:Object.keys(a)}),f.invalidateQueries({queryKey:J.organizations()}),f.invalidateQueries({queryKey:J.activeOrganization(t.slug)}),q.success(e("settings.organizationForm.updateSuccess"))},onError:(n,a)=>{H("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(a),error:n instanceof Error?n.message:String(n)}),q.error(n instanceof Error?n.message:e("settings.organizationForm.failedToUpdateOrg"))}}),{schedule:c,flush:d}=Se({save:async()=>{const n=g.control._formState.dirtyFields;if(Object.keys(n).length===0||!await g.trigger())return;const o=g.getValues(),u=g.control._defaultValues;g.reset(o,{keepValues:!0});try{await l.mutateAsync(o)}catch{g.reset(u,{keepValues:!0})}}}),r=g.formState.errors,m=typeof window<"u"?`${window.location.host}/`:"";return i.jsx(ne,{children:i.jsxs(se,{children:[i.jsx(Q,{title:e("settings.organizationForm.logoTitle"),description:e("settings.organizationForm.logoDescription"),action:i.jsx(ke,{value:g.watch("logo"),onChange:n=>{g.setValue("logo",n??"",{shouldDirty:!0}),d()},name:g.watch("name")})}),i.jsx(Q,{title:e("settings.organizationForm.nameTitle"),action:i.jsx(ce,{control:g.control,name:"name",render:({field:n})=>i.jsx(ae,{id:"org-name",...n,onChange:a=>{n.onChange(a),c()},onBlur:()=>{n.onBlur(),d()},placeholder:e("settings.organizationForm.namePlaceholder"),className:"w-[280px]"})})}),i.jsx(Q,{title:e("settings.organizationForm.urlTitle"),description:e("settings.organizationForm.urlDescription"),action:i.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-muted/40 overflow-hidden",children:[m&&i.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:m}),i.jsx("span",{className:"flex-1 min-w-0 px-2 py-1.5 text-sm text-foreground truncate",children:t.slug})]})}),(r.name||r.logo)&&i.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&i.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.logo&&i.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function Be(){const e=Y.c(83),t=U(),{org:s}=te(),[f,g]=W.useState(!1),[l,c]=W.useState(""),d=de();let r;e[0]!==s.id||e[1]!==d?(r=async()=>{await d.call("ORGANIZATION_DELETE",{id:s.id})},e[0]=s.id,e[1]=d,e[2]=r):r=e[2];let m;e[3]!==s.id||e[4]!==s.slug||e[5]!==t?(m=()=>{H("organization_deleted",{organization_id:s.id}),localStorage.getItem(ee.lastOrgSlug())===s.slug&&localStorage.removeItem(ee.lastOrgSlug()),me()?.org===s.slug&&ue(),fe(),q.success(t("settings.deleteOrganizationSection.organizationDeleted")),window.location.href="/"},e[3]=s.id,e[4]=s.slug,e[5]=t,e[6]=m):m=e[6];let n;e[7]!==t?(n=O=>{q.error(O instanceof Error?O.message:t("settings.deleteOrganizationSection.failedToDeleteOrganization"))},e[7]=t,e[8]=n):n=e[8];let a;e[9]!==r||e[10]!==m||e[11]!==n?(a={mutationFn:r,onSuccess:m,onError:n},e[9]=r,e[10]=m,e[11]=n,e[12]=a):a=e[12];const o=ie(a);let u;e[13]!==t?(u=t("settings.deleteOrganizationSection.dangerZone"),e[13]=t,e[14]=u):u=e[14];let h;e[15]!==t?(h=t("settings.deleteOrganizationSection.deleteOrganizationTitle"),e[15]=t,e[16]=h):h=e[16];let j;e[17]!==t?(j=t("settings.deleteOrganizationSection.deleteOrganizationDescription"),e[17]=t,e[18]=j):j=e[18];let x;e[19]===Symbol.for("react.memo_cache_sentinel")?(x=()=>g(!0),e[19]=x):x=e[19];const v=o.isPending;let S;e[20]!==t?(S=t("settings.deleteOrganizationSection.deleteButton"),e[20]=t,e[21]=S):S=e[21];let z;e[22]!==o.isPending||e[23]!==S?(z=i.jsx(pe,{variant:"destructive",size:"sm",onClick:x,disabled:v,children:S}),e[22]=o.isPending,e[23]=S,e[24]=z):z=e[24];let p;e[25]!==z||e[26]!==h||e[27]!==j?(p=i.jsx(se,{className:"border-destructive/40",children:i.jsx(Q,{title:h,description:j,action:z})}),e[25]=z,e[26]=h,e[27]=j,e[28]=p):p=e[28];let b;e[29]!==p||e[30]!==u?(b=i.jsx(ne,{title:u,children:p}),e[29]=p,e[30]=u,e[31]=b):b=e[31];let K;e[32]===Symbol.for("react.memo_cache_sentinel")?(K=O=>{g(O),O||c("")},e[32]=K):K=e[32];let y;e[33]!==t?(y=t("settings.deleteOrganizationSection.deleteOrganizationQuestion"),e[33]=t,e[34]=y):y=e[34];let C;e[35]!==y?(C=i.jsx(_e,{children:y}),e[35]=y,e[36]=C):C=e[36];let _;e[37]!==s.name||e[38]!==t?(_=t("settings.deleteOrganizationSection.deleteWarning",{organizationName:s.name}),e[37]=s.name,e[38]=t,e[39]=_):_=e[39];let F;e[40]!==_?(F=i.jsx("p",{children:_}),e[40]=_,e[41]=F):F=e[41];let D;e[42]!==s.name||e[43]!==t?(D=t("settings.deleteOrganizationSection.typeToConfirm",{organizationName:s.name}),e[42]=s.name,e[43]=t,e[44]=D):D=e[44];let A;e[45]!==D?(A=i.jsx("p",{className:"mt-3 mb-1.5",children:D}),e[45]=D,e[46]=A):A=e[46];let V;e[47]===Symbol.for("react.memo_cache_sentinel")?(V=O=>c(O.target.value),e[47]=V):V=e[47];let w;e[48]!==l||e[49]!==s.name?(w=i.jsx(ae,{value:l,onChange:V,placeholder:s.name,autoFocus:!0}),e[48]=l,e[49]=s.name,e[50]=w):w=e[50];let E;e[51]!==F||e[52]!==A||e[53]!==w?(E=i.jsx(Fe,{asChild:!0,children:i.jsxs("div",{children:[F,A,w]})}),e[51]=F,e[52]=A,e[53]=w,e[54]=E):E=e[54];let T;e[55]!==C||e[56]!==E?(T=i.jsxs(De,{children:[C,E]}),e[55]=C,e[56]=E,e[57]=T):T=e[57];let N;e[58]!==t?(N=t("settings.deleteOrganizationSection.cancel"),e[58]=t,e[59]=N):N=e[59];let L;e[60]!==N?(L=i.jsx(Ae,{children:N}),e[60]=N,e[61]=L):L=e[61];let P;e[62]!==o?(P=()=>o.mutate(),e[62]=o,e[63]=P):P=e[63];const Z=l!==s.name||o.isPending;let k;e[64]!==o.isPending||e[65]!==t?(k=o.isPending?t("settings.deleteOrganizationSection.deleting"):t("settings.deleteOrganizationSection.deleteOrganizationAction"),e[64]=o.isPending,e[65]=t,e[66]=k):k=e[66];let R;e[67]!==P||e[68]!==Z||e[69]!==k?(R=i.jsx(we,{onClick:P,disabled:Z,variant:"destructive",children:k}),e[67]=P,e[68]=Z,e[69]=k,e[70]=R):R=e[70];let B;e[71]!==L||e[72]!==R?(B=i.jsxs(Ee,{children:[L,R]}),e[71]=L,e[72]=R,e[73]=B):B=e[73];let I;e[74]!==T||e[75]!==B?(I=i.jsxs(Te,{children:[T,B]}),e[74]=T,e[75]=B,e[76]=I):I=e[76];let G;e[77]!==f||e[78]!==I?(G=i.jsx(Ne,{open:f,onOpenChange:K,children:I}),e[77]=f,e[78]=I,e[79]=G):G=e[79];let $;return e[80]!==b||e[81]!==G?($=i.jsxs(i.Fragment,{children:[b,G]}),e[80]=b,e[81]=G,e[82]=$):$=e[82],$}function Ie(){const e=Y.c(15),t=U(),{granted:s,loading:f,error:g}=xe("org:manage");if(f){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(je,{}),e[0]=a):a=e[0],a}if(g){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Le,{}),e[1]=a):a=e[1],a}let l;e[2]!==t?(l=t("settings.nav.general"),e[2]=t,e[3]=l):l=e[3];let c;e[4]!==l?(c=i.jsx(M.Title,{children:l}),e[4]=l,e[5]=c):c=e[5];let d;e[6]!==s?(d=s&&i.jsxs(i.Fragment,{children:[i.jsx(Re,{}),i.jsx(ve,{}),i.jsx(be,{})]}),e[6]=s,e[7]=d):d=e[7];let r;e[8]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(ye,{}),e[8]=r):r=e[8];let m;e[9]!==s?(m=s&&i.jsxs(i.Fragment,{children:[i.jsx(Ce,{}),i.jsx(Be,{})]}),e[9]=s,e[10]=m):m=e[10];let n;return e[11]!==c||e[12]!==d||e[13]!==m?(n=i.jsx(M,{children:i.jsx(M.Content,{children:i.jsx(M.Container,{children:i.jsxs(he,{children:[c,d,r,m]})})})}),e[11]=c,e[12]=d,e[13]=m,e[14]=n):n=e[14],n}function lt(){const e=Y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(Ie,{}),e[0]=t):t=e[0],t}export{lt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as $,b as O,F as re,a as D,am as G,j as s,n as M,r as R,a2 as B,h as Y,l as I,L as ie,y as F,an as ne,K as le,m as ae,B as ce,aa as me}from"./index-D2MFYEzD.js";import{C as fe}from"./index-Cs4qaYPX.js";import{b as q}from"./input-D9iDAvwy.js";import{D as W,a as U}from"./chat-context-DLezfYEa.js";import{a as J}from"./use-organization-settings-NOur1Lvu.js";import{C as X,u as pe,F as ue,R as de,M as ge,a as he,b as xe,P as je}from"./project-feed-BIwmxSQY.js";import{a as be,r as ye,s as _e}from"./daily-pulse-DRJB1hcS.js";import{N as Ne}from"./new-project-dialog-qMTAvOP0.js";import{P as ve}from"./projects-empty-state-CmtOjsbv.js";import{b as Z}from"./task-route-BvbHuTGP.js";import{u as Se}from"./use-inbox-feed-U2BOY_0m.js";import{b as ke}from"./use-recent-apps-B2LVD6z4.js";import{s as Q}from"./use-project-scope-CBw0FSEz.js";import{b as V}from"./repository-binding-4nTgXz1S.js";import{s as we}from"./Plus-BnqPSlPj.js";import{i as He}from"./UserSquare-B_yRFcN6.js";import{E as Ce}from"./empty-state-_a1QMwjl.js";import{R as $e}from"./repository-import-picker-De4sf2Gs.js";import{o as Ae}from"./shell-layout-CnXya3zZ.js";import{i as Te,n as Pe}from"./ArrowUp-723TVuFG.js";import{A as Ee}from"./agent-icon-g2PIrjzs.js";import{u as Me}from"./use-navigate-to-agent-DwJfjSMG.js";import{s as Oe,r as Re}from"./project-profile-Cc4MG3QN.js";import{i as Be}from"./LinkBroken01-DDgMbBWJ.js";import"./use-mobile-h4hHhZkm.js";import"./use-sidebar-collapsed-Bijbdhqq.js";import"./use-chat-layout-state-BV7ldzPe.js";import"./thread-route-UuA5SD5X.js";import"./use-panel-navigate-DxGjTjIo.js";import"./thread-intent-Ds79TVrW.js";import"./use-mcp-client-Cby5XqT6.js";import"./auth-DHZfBLZ5.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-CmsmQLFo.js";import"./task-board-6nf7vbPi.js";import"./schema-DrNvzI26.js";import"./slugify-CEUa2lfQ.js";import"./tooltip-bQVm_Ope.js";import"./index-CXWqnDP7.js";import"./toolbar-icon-button-BiR5ntfC.js";import"./sheet-BQCLSAhw.js";import"./resizable-DAXTAODq.js";import"./usage-stats-CvT3PVJT.js";import"./tool-namespace-CMW8ZB5L.js";import"./form-B2fhil9l.js";import"./label-3hTmrxoy.js";import"./utils-CVEq3hMx.js";import"./markdown-BeKN4MPt.js";import"./use-copy-Bc8JMSws.js";import"./Copy01-DRNuKy-h.js";import"./ZoomOut-DLICjI1h.js";import"./location-V0VwTJTt.js";import"./format-time-Cq80KKvY.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-decopilot-events-C_BQo06W.js";import"./XClose-DOXmYMF_.js";import"./icon-button-BQwa115u.js";import"./file-type-icon-CP6Bm0Pm.js";import"./autosend-Cwww7_9j.js";import"./chat-draft-BlRnwK9v.js";import"./use-session-runtime-BrkTaSa6.js";import"./ShoppingBag01-DVHnZchK.js";import"./Image01-QuVxFosz.js";import"./Upload01-D6tRQTgc.js";import"./AlertCircle-DgnxHqxe.js";import"./select-C9_0SSgH.js";import"./index-BdQq_4o_.js";import"./ChevronUp-DiTVmUiH.js";import"./ArrowLeft-BJ1448l4.js";import"./tabs-B6EQUSl_.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-BgLGkCcl.js";import"./use-ai-providers-CzmKfSB9.js";import"./toggle-group-C7NFln-0.js";import"./use-open-billing-url-CjWCFQM1.js";import"./index-B4yeJC5N.js";import"./checkbox-BlB_jfat.js";import"./Minus-DnJ8wbLv.js";import"./ChevronSelectorVertical-B0Z7parR.js";import"./Key01-C-QXsN23.js";import"./Tool01-rTZNmFct.js";import"./SearchMd-GQAKwnQD.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-DD5_JCl8.js";import"./avatar-BRRGslVN.js";import"./User01-1q78INo2.js";import"./popover-Dm_x8CV9.js";import"./drawer-C9bfrQZ2.js";import"./input-D43D11gI.js";import"./suggestion-B0A7rwRG.js";import"./use-mcp-prompts-DpGHOlEI.js";import"./use-org-fs-CyxFz8rw.js";import"./useInfiniteQuery-Dobhsojg.js";import"./infiniteQueryObserver-CaSjeDsE.js";import"./Link01-CbpFxbNY.js";import"./question-004-sINsf4GQ.js";import"./use-members-oF45MDF1.js";import"./use-org-auth-client-BFDehTsp.js";import"./feature-paywall-DcguOiJA.js";import"./plan-ladder-7wUcVwfI.js";import"./add-connection-dialog-BluC5xOJ.js";import"./collection-search-DcBOG84t.js";import"./extract-connection-data-mbA-zNaE.js";import"./metadata-D72DunRR.js";import"./connection-WJRbuDz1.js";import"./url-slug-BWq-dgp6.js";import"./connection-card-DnICQFn9.js";import"./connection-slug-CITJ0kGN.js";import"./integration-icon-CqbOWyvX.js";import"./textarea-DG3FcnmS.js";import"./use-connection-DTSe3r1K.js";import"./schema-xPkTs0YZ.js";import"./connection-form-helpers-CBYCAzPl.js";import"./Trash01-TPK4gSsp.js";import"./authenticate-and-persist-oauth-CbgraxNg.js";import"./mcp-oauth-DQ__DCEs.js";import"./mcp-oauth-BVLnM3ir.js";import"./collection-tabs-D5lfCRgo.js";import"./badge-DmeqGssZ.js";import"./use-infinite-scroll-CpvqXWve.js";import"./useSuspenseInfiniteQuery-CqyfVE9R.js";import"./use-task-board-events-B5yNhg5i.js";import"./client-icons-CpqRIiQr.js";import"./CheckCircle-C7csYE-y.js";import"./chart-CTinHp-8.js";import"./index-CeLGzS5y.js";import"./symbol-CYXY7_SE.js";import"./CategoricalChart-CinaMpxG.js";import"./project-icon-CJmvnLdz.js";import"./project-apps-DVzn0z1g.js";import"./config-BWrcU7H3.js";import"./core.esm-DHAYYfZu.js";import"./ReferenceLine-PgVE-Dmr.js";import"./CartesianChart-3-g5kX2i.js";import"./BarChart-BdOKvWnK.js";import"./tooltipContext-CMDZ9J9X.js";import"./ActiveShapeUtils-DC4ySNWR.js";import"./Sector-DG1U_Qdd.js";import"./ErrorBarContext-CCb5UZ88.js";import"./repository-picker-HOHNvmaE.js";import"./use-debounced-value-Cm7nwcam.js";import"./task-assignee-avatar-Dodx9W4w.js";import"./task-key-BCHdFiOO.js";import"./Building02-DU823ZCw.js";import"./use-clock-tick-C61VlTs_.js";import"./command-R1e1yMQ9.js";import"./index-R_qB4INp.js";import"./required-auth-layout-BZllo6Io.js";import"./use-org-sso-D5M4Sxwu.js";import"./CreditCard01-C3f2i_qY.js";import"./DotsVertical-eX97dPc6.js";import"./Globe04-ByvV2bPX.js";import"./SwitchHorizontal01-_kdH1ete.js";import"./Sun-Ct5gftPt.js";import"./Play-BgEaB30r.js";import"./Users01-D5MhP5r0.js";function ee(t){return t<12?"morning":t<18?"afternoon":"evening"}function te(t){const e=(t??"").trim().split(/\s+/)[0];return e||null}function Ie(t,e){return e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long"})}function Fe(t){return t==="morning"?"overnight":"today"}function Le(t,e){const r=new Date(e);return r.setHours(0,0,0,0),t==="morning"&&r.setHours(-6),r.getTime()}const De={morning:{named:"home.orgHome.greetingMorning",bare:"home.orgHome.greetingMorningBare"},afternoon:{named:"home.orgHome.greetingAfternoon",bare:"home.orgHome.greetingAfternoonBare"},evening:{named:"home.orgHome.greetingEvening",bare:"home.orgHome.greetingEveningBare"}};function ze(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex min-h-64 items-center justify-center",children:s.jsx(Y,{className:"size-5 text-muted-foreground"})}),t[0]=e):e=t[0],e}function Ke(t,e,r,i,n){const l=Fe(r)==="overnight",a=[];if(e>0){const o=t(e===1?"home.brief.changeOne":"home.brief.changeMany",{count:e});a.push(t(l?"home.brief.overnightShipped":"home.brief.todayShipped",{changes:o}))}else i===0&&a.push(t(n>0?"home.brief.working":l?"home.brief.quietNight":"home.brief.quietDay"));return a.push(i===0?t("home.brief.waitingNone"):t(i===1?"home.brief.waitingOne":"home.brief.waitingMany",{count:i})),a.join(" ")}function Ge(t){const e=$.c(40),{canManageProjects:r,eyebrow:i,greeting:n,slot:l}=t,a=O(),{org:o}=B(),{data:c}=D.useSession();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={pageSize:1e3},e[0]=m):m=e[0];const f=V(m),p=pe(),d=Se(),{recent:u}=ke(o.slug);let x,g;if(e[1]!==f||e[2]!==r||e[3]!==o.id){g=Symbol.for("react.early_return_sentinel");e:{let C;e[6]!==o.id?(C=A=>A.id!==o.id,e[6]=o.id,e[7]=C):C=e[7];const T=Q(f).filter(C);if(T.length===0){let A;e[8]!==r?(A=s.jsx(ve,{canCreate:r}),e[8]=r,e[9]=A):A=e[9],g=A;break e}x=Z(T)}e[1]=f,e[2]=r,e[3]=o.id,e[4]=x,e[5]=g}else x=e[4],g=e[5];if(g!==Symbol.for("react.early_return_sentinel"))return g;const j=x;let b,h;e[10]!==c?.user?.id||e[11]!==l||e[12]!==a||e[13]!==p?(h=be(p,c?.user?.id),b=Ke(a,_e(p,Le(l,new Date)),l,h.length,ye(p).length),e[10]=c?.user?.id,e[11]=l,e[12]=a,e[13]=p,e[14]=b,e[15]=h):(b=e[14],h=e[15]);const _=b;let y;e[16]!==i?(y=s.jsx("span",{className:"text-xs text-muted-foreground",children:i}),e[16]=i,e[17]=y):y=e[17];let N;e[18]!==_||e[19]!==n?(N=s.jsxs("h1",{className:"max-w-[40ch] text-2xl font-medium text-balance text-foreground",children:[n," ",_]}),e[18]=_,e[19]=n,e[20]=N):N=e[20];let v;e[21]!==y||e[22]!==N?(v=s.jsxs("div",{className:"flex flex-col gap-1",children:[y,N]}),e[21]=y,e[22]=N,e[23]=v):v=e[23];let k;e[24]!==d.updates||e[25]!==j||e[26]!==o.slug||e[27]!==p||e[28]!==h?(k=s.jsx(ue,{waiting:h,tasks:p,mentions:d.updates,index:j,orgSlug:o.slug}),e[24]=d.updates,e[25]=j,e[26]=o.slug,e[27]=p,e[28]=h,e[29]=k):k=e[29];let S;e[30]!==o.slug||e[31]!==u?(S=s.jsx(de,{recent:u,orgSlug:o.slug}),e[30]=o.slug,e[31]=u,e[32]=S):S=e[32];let w;e[33]!==p?(w=s.jsx(ge,{tasks:p}),e[33]=p,e[34]=w):w=e[34];let H;return e[35]!==w||e[36]!==v||e[37]!==k||e[38]!==S?(H=s.jsxs("div",{className:"flex flex-col gap-8",children:[v,k,S,w]}),e[35]=w,e[36]=v,e[37]=k,e[38]=S,e[39]=H):H=e[39],H}function Ye(){const t=$.c(25),e=O(),[r]=re(),i=J("home_task_intake_enabled"),{data:n}=D.useSession(),{granted:l}=G("agents:manage");let a,o,c;if(t[0]!==r.language||t[1]!==n?.user?.name||t[2]!==e){const h=new Date,_=te(n?.user?.name);o=ee(h.getHours());const y=De[o];a=Ie(r.language,h),c=_?e(y.named,{name:_}):e(y.bare),t[0]=r.language,t[1]=n?.user?.name,t[2]=e,t[3]=a,t[4]=o,t[5]=c}else a=t[3],o=t[4],c=t[5];const m=c;let f;t[6]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(X,{}),t[6]=f):f=t[6];let p;t[7]!==l?(p=l&&s.jsx(Ne,{source:"org_home_header"}),t[7]=l,t[8]=p):p=t[8];let d;t[9]!==p?(d=s.jsx(M.Actions,{secondary:f,children:p}),t[9]=p,t[10]=d):d=t[10];let u;t[11]!==i?(u=i&&s.jsx(R.Suspense,{fallback:null,children:s.jsx(W,{children:s.jsx(U,{children:s.jsx(q,{homeTaskComposer:!0})})})}),t[11]=i,t[12]=u):u=t[12];let x;t[13]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ze,{}),t[13]=x):x=t[13];let g;t[14]!==l||t[15]!==a||t[16]!==m||t[17]!==o?(g=s.jsx(R.Suspense,{fallback:x,children:s.jsx(Ge,{canManageProjects:l,eyebrow:a,greeting:m,slot:o})}),t[14]=l,t[15]=a,t[16]=m,t[17]=o,t[18]=g):g=t[18];let j;t[19]!==u||t[20]!==g?(j=s.jsx(M.Content,{children:s.jsxs(M.Container,{width:"wide",className:"flex min-h-full flex-col gap-10",children:[u,g]})}),t[19]=u,t[20]=g,t[21]=j):j=t[21];let b;return t[22]!==d||t[23]!==j?(b=s.jsxs(M,{children:[d,j]}),t[22]=d,t[23]=j,t[24]=b):b=t[24],b}function qe(t){const e=$.c(13),{label:r,count:i,action:n,children:l}=t;let a;e[0]!==i?(a=i!==void 0&&i>0&&s.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:i}),e[0]=i,e[1]=a):a=e[1];let o;e[2]!==r||e[3]!==a?(o=s.jsxs("h2",{className:"flex items-baseline gap-2 text-[0.9rem] font-medium tracking-tight text-foreground",children:[r,a]}),e[2]=r,e[3]=a,e[4]=o):o=e[4];let c;e[5]!==n||e[6]!==o?(c=s.jsxs("div",{className:"flex h-12 items-center justify-between gap-3 border-b border-border/70 px-5",children:[o,n]}),e[5]=n,e[6]=o,e[7]=c):c=e[7];let m;e[8]!==l?(m=s.jsx("ul",{className:"flex flex-col divide-y divide-border/70",children:l}),e[8]=l,e[9]=m):m=e[9];let f;return e[10]!==c||e[11]!==m?(f=s.jsxs("section",{className:"@container flex flex-col overflow-hidden surface",children:[c,m]}),e[10]=c,e[11]=m,e[12]=f):f=e[12],f}function se(t){const e=$.c(5),{children:r,className:i}=t;let n;e[0]!==i?(n=I("px-5 py-3.5 transition-colors hover:bg-accent",i),e[0]=i,e[1]=n):n=e[1];let l;return e[2]!==r||e[3]!==n?(l=s.jsx("li",{className:n,children:r}),e[2]=r,e[3]=n,e[4]=l):l=e[4],l}const We=56,Ue=16;function Je(t){const e=$.c(28),{series:r,className:i,label:n,height:l,stretch:a}=t,o=l===void 0?Ue:l,c=a===void 0?!1:a,m=Math.max(...r);if(r.length<2||m<=0)return null;const f=c?r.length*8:We,p=f/(r.length-1);let d;if(e[0]!==o||e[1]!==m||e[2]!==r||e[3]!==p){let v;e[5]!==o||e[6]!==m||e[7]!==p?(v=(S,w)=>({x:w*p,y:o-1-S/m*(o-2)}),e[5]=o,e[6]=m,e[7]=p,e[8]=v):v=e[8],d=r.map(v).map(Xe).join(" "),e[0]=o,e[1]=m,e[2]=r,e[3]=p,e[4]=d}else d=e[4];const u=d,x=`0 0 ${f} ${o}`,g=c?void 0:f,j=c?"none":void 0,b=c?"w-full":"shrink-0 overflow-visible";let h;e[9]!==i||e[10]!==b?(h=I(b,i),e[9]=i,e[10]=b,e[11]=h):h=e[11];let _;e[12]!==o||e[13]!==u||e[14]!==c||e[15]!==f?(_=c&&s.jsx("polygon",{points:`0,${o} ${u} ${f},${o}`,fill:"currentColor",opacity:.12}),e[12]=o,e[13]=u,e[14]=c,e[15]=f,e[16]=_):_=e[16];let y;e[17]!==u?(y=s.jsx("polyline",{points:u,fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),e[17]=u,e[18]=y):y=e[18];let N;return e[19]!==o||e[20]!==n||e[21]!==y||e[22]!==x||e[23]!==g||e[24]!==j||e[25]!==h||e[26]!==_?(N=s.jsxs("svg",{viewBox:x,width:g,height:o,role:"img","aria-label":n,preserveAspectRatio:j,className:h,children:[_,y]}),e[19]=o,e[20]=n,e[21]=y,e[22]=x,e[23]=g,e[24]=j,e[25]=h,e[26]=_,e[27]=N):N=e[27],N}function Xe(t){const{x:e,y:r}=t;return`${e.toFixed(1)},${r.toFixed(1)}`}const Ze={waiting:{labelKey:"home.projects.headlineWaiting",className:"text-foreground"},failed:{labelKey:"home.projects.headlineFailed",className:"text-destructive"},shipped:{labelKey:"home.projects.headlineShipped",className:"text-muted-foreground"},open:{labelKey:"home.projects.headlineOpen",className:"text-muted-foreground"}},z=6;function Qe(t){const e=$.c(10),{value:r,previous:i}=t,n=r-i;if(n===0)return null;const l=n>0?Te:Pe,a=n>0?"text-success":"text-muted-foreground";let o;e[0]!==a?(o=I("inline-flex items-center text-xs tabular-nums",a),e[0]=a,e[1]=o):o=e[1];let c;e[2]!==l?(c=s.jsx(l,{width:11,height:11,"aria-hidden":!0}),e[2]=l,e[3]=c):c=e[3];let m;e[4]!==n?(m=Math.abs(n),e[4]=n,e[5]=m):m=e[5];let f;return e[6]!==o||e[7]!==c||e[8]!==m?(f=s.jsxs("span",{className:o,children:[c,m]}),e[6]=o,e[7]=c,e[8]=m,e[9]=f):f=e[9],f}function Ve(t){const e=$.c(52),{project:r,summary:i,series:n}=t,l=O(),a=Me();let o;e[0]!==r?(o=Oe(Re(r).storeUrl),e[0]=r,e[1]=o):o=e[1];const c=o,m=i&&i.kind!=="quiet"?Ze[i.kind]:null,f=n.reduce(st,0),p=Math.floor(n.length/2);let d;e[2]!==p||e[3]!==n?(d=n.slice(0,p).reduce(tt,0),e[2]=p,e[3]=n,e[4]=d):d=e[4];const u=d;let x;e[5]!==p||e[6]!==n?(x=n.slice(p).reduce(et,0),e[5]=p,e[6]=n,e[7]=x):x=e[7];const g=x,j=r.title;let b;e[8]!==a||e[9]!==r.id?(b=()=>{F("org_home_project_clicked"),a(r.id)},e[8]=a,e[9]=r.id,e[10]=b):b=e[10];let h;e[11]!==r.icon||e[12]!==r.title?(h=s.jsx(Ee,{icon:r.icon,name:r.title,size:"xs"}),e[11]=r.icon,e[12]=r.title,e[13]=h):h=e[13];let _;e[14]!==r.title?(_=s.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:r.title}),e[14]=r.title,e[15]=_):_=e[15];let y;e[16]!==m||e[17]!==c||e[18]!==i||e[19]!==l?(y=m&&i?l(m.labelKey,{count:i.count}):c??l("home.projects.quiet"),e[16]=m,e[17]=c,e[18]=i,e[19]=l,e[20]=y):y=e[20];let N;e[21]!==y?(N=s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:y}),e[21]=y,e[22]=N):N=e[22];let v;e[23]!==_||e[24]!==N?(v=s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[_,N]}),e[23]=_,e[24]=N,e[25]=v):v=e[25];let k;e[26]!==r.title||e[27]!==l?(k=l("home.projects.rhythm",{name:r.title}),e[26]=r.title,e[27]=l,e[28]=k):k=e[28];let S;e[29]!==n||e[30]!==k?(S=s.jsx(Je,{series:n,className:"text-muted-foreground/60",label:k}),e[29]=n,e[30]=k,e[31]=S):S=e[31];const w=f>0?"text-foreground":"text-muted-foreground";let H;e[32]!==w?(H=I("text-sm tabular-nums",w),e[32]=w,e[33]=H):H=e[33];let C;e[34]!==f||e[35]!==H?(C=s.jsx("span",{className:H,children:f}),e[34]=f,e[35]=H,e[36]=C):C=e[36];let T;e[37]!==g||e[38]!==u?(T=s.jsx(Qe,{value:g,previous:u}),e[37]=g,e[38]=u,e[39]=T):T=e[39];let A;e[40]!==C||e[41]!==T?(A=s.jsxs("span",{className:"flex w-10 shrink-0 flex-col items-end",children:[C,T]}),e[40]=C,e[41]=T,e[42]=A):A=e[42];let P;e[43]!==S||e[44]!==A?(P=s.jsxs("span",{className:"flex shrink-0 items-center gap-2.5",children:[S,A]}),e[43]=S,e[44]=A,e[45]=P):P=e[45];let E;return e[46]!==r.title||e[47]!==v||e[48]!==P||e[49]!==b||e[50]!==h?(E=s.jsx(se,{className:"transition-colors hover:bg-accent",children:s.jsxs("button",{type:"button","aria-label":j,onClick:b,className:"flex w-full min-w-0 items-center gap-3 text-left",children:[h,v,P]})}),e[46]=r.title,e[47]=v,e[48]=P,e[49]=b,e[50]=h,e[51]=E):E=e[51],E}function et(t,e){return t+e}function tt(t,e){return t+e}function st(t,e){return t+e}const ot=new Map,rt=new Map;function it(t){const e=$.c(30),{projects:r,summaries:i,series:n}=t,l=i===void 0?ot:i,a=n===void 0?rt:n,o=O(),{org:c}=B();let m,f,p,d,u,x;if(e[0]!==r||e[1]!==a||e[2]!==l||e[3]!==o){const b=[...r].sort(nt).slice(0,z);f=r.length>z,m=qe,e[10]!==o?(p=o("home.projects.heading"),e[10]=o,e[11]=p):p=e[11],d=r.length;let h;e[12]!==o?(h=o("home.projects.shippedCaption"),e[12]=o,e[13]=h):h=e[13],e[14]!==h?(u=s.jsx("span",{className:"hidden whitespace-nowrap text-xs text-muted-foreground @[19rem]:inline",children:h}),e[14]=h,e[15]=u):u=e[15];let _;e[16]!==a||e[17]!==l?(_=y=>s.jsx(Ve,{project:y,summary:l.get(y.id),series:a.get(y.id)??[]},y.id),e[16]=a,e[17]=l,e[18]=_):_=e[18],x=b.map(_),e[0]=r,e[1]=a,e[2]=l,e[3]=o,e[4]=m,e[5]=f,e[6]=p,e[7]=d,e[8]=u,e[9]=x}else m=e[4],f=e[5],p=e[6],d=e[7],u=e[8],x=e[9];let g;e[19]!==f||e[20]!==c||e[21]!==o?(g=f&&s.jsx(se,{className:"py-2",children:s.jsx(ie,{to:"/$org/settings/projects",params:{org:c.slug},className:"text-xs text-muted-foreground hover:text-foreground hover:underline",children:o("home.projects.seeAll")})}),e[19]=f,e[20]=c,e[21]=o,e[22]=g):g=e[22];let j;return e[23]!==m||e[24]!==p||e[25]!==d||e[26]!==u||e[27]!==x||e[28]!==g?(j=s.jsxs(m,{label:p,count:d,action:u,children:[x,g]}),e[23]=m,e[24]=p,e[25]=d,e[26]=u,e[27]=x,e[28]=g,e[29]=j):j=e[29],j}function nt(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function lt(){const t=$.c(10),{org:e}=B(),r=ne();let i;t[0]!==e.id?(i=le.orgHasSite(e.id),t[0]=e.id,t[1]=i):i=t[1];const n=!!e.id;let l;t[2]!==r?(l=()=>r.call("ORGANIZATION_HAS_SITE",{}),t[2]=r,t[3]=l):l=t[3];let a;t[4]!==i||t[5]!==n||t[6]!==l?(a={queryKey:i,staleTime:3e5,enabled:n,queryFn:l},t[4]=i,t[5]=n,t[6]=l,t[7]=a):a=t[7];const{data:o}=ae(a),c=o?.hasSite??!1;let m;return t[8]!==c?(m={hasSite:c},t[8]=c,t[9]=m):m=t[9],m}const at="https://www.youtube.com/playlist?list=PLZ4WtTgnJfBw";function ct(t){const e=$.c(4),{className:r}=t;let i,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("path",{fill:"#FF0000",d:"M27.4 3.1c-.3-1.2-1.3-2.2-2.5-2.5C22.7 0 14 0 14 0S5.3 0 3.1.6C1.9.9.9 1.9.6 3.1.1 5.3 0 8 0 10s.1 4.7.6 6.9c.3 1.2 1.3 2.2 2.5 2.5C5.3 20 14 20 14 20s8.7 0 10.9-.6c1.2-.3 2.2-1.3 2.5-2.5.5-2.2.6-4.9.6-6.9s-.1-4.7-.6-6.9z"}),n=s.jsx("path",{fill:"#fff",d:"M11.2 14.3l7.3-4.3-7.3-4.3z"}),e[0]=i,e[1]=n):(i=e[0],n=e[1]);let l;return e[2]!==r?(l=s.jsxs("svg",{viewBox:"0 0 28 20",className:r,"aria-hidden":"true",focusable:"false",children:[i,n]}),e[2]=r,e[3]=l):l=e[3],l}function mt(){const t=$.c(27),e=O(),{hasSite:r}=lt();if(!r)return null;let i;t[0]!==e?(i=e("home.orgHome.trainingThumbnailAlt"),t[0]=e,t[1]=i):i=t[1];let n;t[2]!==i?(n=s.jsx("img",{src:"/cms-training.jpg",alt:i,className:"size-full object-cover"}),t[2]=i,t[3]=n):n=t[3];let l;t[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/10 transition-colors group-hover:bg-black/20",children:s.jsx(ct,{className:"w-9"})}),t[4]=l):l=t[4];let a;t[5]!==n?(a=s.jsxs("div",{className:"relative aspect-video w-40 shrink-0 overflow-hidden rounded-lg",children:[n,l]}),t[5]=n,t[6]=a):a=t[6];let o;t[7]!==e?(o=e("home.orgHome.trainingEyebrow"),t[7]=e,t[8]=o):o=t[8];let c;t[9]!==o?(c=s.jsx("p",{className:"text-xs text-muted-foreground",children:o}),t[9]=o,t[10]=c):c=t[10];let m;t[11]!==e?(m=e("home.orgHome.trainingTitle"),t[11]=e,t[12]=m):m=t[12];let f;t[13]!==m?(f=s.jsx("h3",{className:"text-sm font-medium text-foreground",children:m}),t[13]=m,t[14]=f):f=t[14];let p;t[15]!==e?(p=e("home.orgHome.trainingDescription"),t[15]=e,t[16]=p):p=t[16];let d;t[17]!==p?(d=s.jsx("p",{className:"mt-0.5 line-clamp-2 text-xs text-muted-foreground",children:p}),t[17]=p,t[18]=d):d=t[18];let u;t[19]!==c||t[20]!==f||t[21]!==d?(u=s.jsxs("div",{className:"min-w-0 flex-1",children:[c,f,d]}),t[19]=c,t[20]=f,t[21]=d,t[22]=u):u=t[22];let x;t[23]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Be,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"}),t[23]=x):x=t[23];let g;return t[24]!==u||t[25]!==a?(g=s.jsxs("a",{href:at,target:"_blank",rel:"noreferrer",onClick:ft,className:"group shadow-edge flex w-full items-center gap-4 rounded-2xl bg-card p-4 text-left transition-colors hover:bg-accent",children:[a,u,x]}),t[24]=u,t[25]=a,t[26]=g):g=t[26],g}function ft(){return F("cms_training_opened",{source:"org_home"})}const pt={morning:{named:"home.orgHome.greetingMorning",bare:"home.orgHome.greetingMorningBare"},afternoon:{named:"home.orgHome.greetingAfternoon",bare:"home.orgHome.greetingAfternoonBare"},evening:{named:"home.orgHome.greetingEvening",bare:"home.orgHome.greetingEveningBare"}};function ut(){const t=$.c(8),e=O();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(He,{className:"size-4 shrink-0 text-muted-foreground"}),t[0]=r):r=t[0];let i;t[1]!==e?(i=e("home.orgHome.searchPlaceholder"),t[1]=e,t[2]=i):i=t[2];let n;t[3]!==i?(n=s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:i}),t[3]=i,t[4]=n):n=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("kbd",{className:"shrink-0 rounded-md border border-border bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground",children:"⌘K"}),t[5]=l):l=t[5];let a;return t[6]!==n?(a=s.jsxs("button",{type:"button","data-testid":"org-home-search",onClick:dt,className:"shadow-edge flex w-full items-center gap-2 rounded-xl bg-card px-3 py-2.5 text-left transition-colors hover:bg-accent",children:[r,n,l]}),t[6]=n,t[7]=a):a=t[7],a}function dt(){F("command_palette_opened",{source:"org_home_search"}),Ae()}function K(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex min-h-64 items-center justify-center",children:s.jsx(Y,{className:"size-5 text-muted-foreground"})}),t[0]=e):e=t[0],e}function gt(t){const e=$.c(28),{canManageAgents:r}=t,i=O(),{org:n}=B();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={pageSize:1e3},e[0]=l):l=e[0];const a=V(l),o=he();let c,m,f;if(e[1]!==a||e[2]!==r||e[3]!==n||e[4]!==i||e[5]!==o){f=Symbol.for("react.early_return_sentinel");e:{let g;if(e[9]!==n?(g=j=>j.id!==n.id,e[9]=n,e[10]=g):g=e[10],c=Q(a).filter(g),c.length===0){let j;e[11]!==i?(j=i("routes.agentsList.noAgentsYet"),e[11]=i,e[12]=j):j=e[12];let b;e[13]!==r||e[14]!==i?(b=i(r?"home.orgAgents.importToGetStarted":"routes.agentsList.askAdminToCreate"),e[13]=r,e[14]=i,e[15]=b):b=e[15];let h;e[16]!==j||e[17]!==b?(h=s.jsx("div",{className:"flex items-center justify-center py-10",children:s.jsx(Ce,{actions:!1,image:null,title:j,description:b})}),e[16]=j,e[17]=b,e[18]=h):h=e[18],f=h;break e}m=xe(Z(c),o,null)}e[1]=a,e[2]=r,e[3]=n,e[4]=i,e[5]=o,e[6]=c,e[7]=m,e[8]=f}else c=e[6],m=e[7],f=e[8];if(f!==Symbol.for("react.early_return_sentinel"))return f;const p=m.length>0;let d;e[19]!==c?(d=s.jsx(it,{projects:c}),e[19]=c,e[20]=d):d=e[20];let u;e[21]!==c||e[22]!==p||e[23]!==o?(u=p&&s.jsx(je,{projects:c,tasks:o}),e[21]=c,e[22]=p,e[23]=o,e[24]=u):u=e[24];let x;return e[25]!==d||e[26]!==u?(x=s.jsxs("div",{className:"flex flex-col gap-12",children:[d,u]}),e[25]=d,e[26]=u,e[27]=x):x=e[27],x}function ht(){const t=$.c(55),e=O(),r=J("home_task_intake_enabled"),{data:i}=D.useSession(),[n,l]=R.useState(!1),{granted:a}=G("agents:manage");let o,c,m,f,p,d,u,x,g,j,b,h;if(t[0]!==a||t[1]!==i?.user?.name||t[2]!==e){const A=te(i?.user?.name),P=pt[ee(new Date().getHours())];let E;t[15]!==e?(E=oe=>s.jsxs(ce,{size:"sm",variant:"default",onClick:()=>{F("agent_create_clicked",{source:oe,method:"github"}),l(!0)},children:[s.jsx(we,{size:14}),e("home.orgAgents.importFromGitHub")]}),t[15]=e,t[16]=E):E=t[16];const L=E;m=M,t[17]!==a||t[18]!==L?(h=a&&s.jsx(M.Actions,{children:L("org_home")}),t[17]=a,t[18]=L,t[19]=h):h=t[19],c=M.Content,o=M.Container,j="reading",b="flex flex-col gap-12",u="flex flex-col items-center gap-12 text-center",t[20]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(X,{dense:!1}),g=s.jsx(mt,{}),t[20]=x,t[21]=g):(x=t[20],g=t[21]),d="flex w-full flex-col items-center gap-5",f="text-3xl font-medium tracking-tight text-foreground",p=A?e(P.named,{name:A}):e(P.bare),t[0]=a,t[1]=i?.user?.name,t[2]=e,t[3]=o,t[4]=c,t[5]=m,t[6]=f,t[7]=p,t[8]=d,t[9]=u,t[10]=x,t[11]=g,t[12]=j,t[13]=b,t[14]=h}else o=t[3],c=t[4],m=t[5],f=t[6],p=t[7],d=t[8],u=t[9],x=t[10],g=t[11],j=t[12],b=t[13],h=t[14];let _;t[22]!==f||t[23]!==p?(_=s.jsx("h2",{className:f,children:p}),t[22]=f,t[23]=p,t[24]=_):_=t[24];let y;t[25]!==r?(y=r?s.jsx(R.Suspense,{fallback:s.jsx(K,{}),children:s.jsx(W,{children:s.jsx(U,{children:s.jsx(q,{homeTaskComposer:!0})})})}):s.jsx(ut,{}),t[25]=r,t[26]=y):y=t[26];let N;t[27]!==y||t[28]!==d||t[29]!==_?(N=s.jsxs("div",{className:d,children:[_,y]}),t[27]=y,t[28]=d,t[29]=_,t[30]=N):N=t[30];let v;t[31]!==N||t[32]!==u||t[33]!==x||t[34]!==g?(v=s.jsxs("div",{className:u,children:[x,g,N]}),t[31]=N,t[32]=u,t[33]=x,t[34]=g,t[35]=v):v=t[35];let k;t[36]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(K,{}),t[36]=k):k=t[36];let S;t[37]!==a?(S=s.jsx(R.Suspense,{fallback:k,children:s.jsx(gt,{canManageAgents:a})}),t[37]=a,t[38]=S):S=t[38];let w;t[39]!==o||t[40]!==v||t[41]!==S||t[42]!==j||t[43]!==b?(w=s.jsxs(o,{width:j,className:b,children:[v,S]}),t[39]=o,t[40]=v,t[41]=S,t[42]=j,t[43]=b,t[44]=w):w=t[44];let H;t[45]!==c||t[46]!==w?(H=s.jsx(c,{children:w}),t[45]=c,t[46]=w,t[47]=H):H=t[47];let C;t[48]!==n?(C=s.jsx($e,{open:n,onOpenChange:l}),t[48]=n,t[49]=C):C=t[49];let T;return t[50]!==m||t[51]!==H||t[52]!==C||t[53]!==h?(T=s.jsxs(m,{children:[h,H,C]}),t[50]=m,t[51]=H,t[52]=C,t[53]=h,t[54]=T):T=t[54],T}function xt(){return me()?s.jsx(Ye,{}):s.jsx(ht,{})}function dr(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(fe.Content,{children:s.jsx(xt,{})}),t[0]=e):e=t[0],e}export{dr as default};
|
|
1
|
+
import{c as $,b as O,F as re,a as D,am as G,j as s,n as M,r as R,a2 as B,h as Y,l as I,L as ie,y as F,an as ne,K as le,m as ae,B as ce,aa as me}from"./index-BphI8pNH.js";import{C as fe}from"./index-BCGh3XTH.js";import{b as q}from"./input-otZYQGEr.js";import{D as W,a as U}from"./chat-context-DqNUlJMY.js";import{a as J}from"./use-organization-settings-B2e749tN.js";import{C as X,u as pe,F as ue,R as de,M as ge,a as he,b as xe,P as je}from"./project-feed-CZ6ECbBu.js";import{a as be,r as ye,s as _e}from"./daily-pulse-ambOqGdx.js";import{N as Ne}from"./new-project-dialog-Cs8HMQlb.js";import{P as ve}from"./projects-empty-state-B699jX9t.js";import{b as Z}from"./task-route-dMm35uIv.js";import{u as Se}from"./use-inbox-feed-DWwwp0yB.js";import{b as ke}from"./use-recent-apps-Dieru2LM.js";import{s as Q}from"./use-project-scope-DN9qkINS.js";import{b as V}from"./repository-binding-CqjA7Tko.js";import{s as we}from"./Plus-C4rGoU1F.js";import{i as He}from"./UserSquare-B7fe7FYj.js";import{E as Ce}from"./empty-state-bJzQYitF.js";import{R as $e}from"./repository-import-picker-DRcn5MCM.js";import{o as Ae}from"./shell-layout-DPflSDI7.js";import{i as Te,n as Pe}from"./ArrowUp-DUhCibLH.js";import{A as Ee}from"./agent-icon-BVqmbz-P.js";import{u as Me}from"./use-navigate-to-agent-CfXi671z.js";import{s as Oe,r as Re}from"./project-profile-Cc4MG3QN.js";import{i as Be}from"./LinkBroken01-Dz2vlPBe.js";import"./use-mobile-DruvZ2zF.js";import"./use-sidebar-collapsed-C9KH2wzy.js";import"./use-chat-layout-state-CIyU-XxO.js";import"./thread-route-BEIPJEss.js";import"./use-panel-navigate-C-ip5ing.js";import"./thread-intent-BQGp3MKl.js";import"./use-mcp-client-DsrOnW9o.js";import"./auth-BypL5L1O.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-B6MhK1l7.js";import"./task-board-Cv7D_3uN.js";import"./schema-Ddw2ah-q.js";import"./slugify-CEUa2lfQ.js";import"./tooltip-2YCPx1DM.js";import"./index-C5xgscqu.js";import"./toolbar-icon-button-3blDPoB6.js";import"./sheet-Dy9d78N0.js";import"./resizable-Bu3AyxKl.js";import"./usage-stats-BHO2m1GZ.js";import"./tool-namespace-DqsoHKmd.js";import"./form-uqsH1s-y.js";import"./label-BXumUTqC.js";import"./utils-CVEq3hMx.js";import"./markdown-Bqq3R66p.js";import"./use-copy-Ctyjo3u8.js";import"./Copy01-DVWv3lef.js";import"./ZoomOut-DzrH576O.js";import"./location-V0VwTJTt.js";import"./format-time-Cq80KKvY.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-decopilot-events-CmWo-JmL.js";import"./XClose-B_rQyiiY.js";import"./icon-button-BUDG7R_U.js";import"./file-type-icon-CIdo5ojc.js";import"./autosend-B4f5gabb.js";import"./chat-draft-DeylAkNb.js";import"./use-session-runtime-RS_ZeJDS.js";import"./ShoppingBag01-DvN3FHxE.js";import"./Image01-D_y3XkIW.js";import"./Upload01-CiTZ5ZQQ.js";import"./AlertCircle-CzTXJ0ax.js";import"./select-BAxIwkW7.js";import"./index-BdQq_4o_.js";import"./ChevronUp-DtSKb4be.js";import"./ArrowLeft-BQThfb60.js";import"./tabs-fkqYJpP8.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-DAnq8bae.js";import"./use-ai-providers-D11veeve.js";import"./toggle-group-DaYieoyW.js";import"./use-open-billing-url-0u6Rqj8b.js";import"./index-BtufcGJ5.js";import"./checkbox-JO6XiJJq.js";import"./Minus-DNpWuD14.js";import"./ChevronSelectorVertical-DaDJpoIU.js";import"./Key01-p2EsnMlr.js";import"./Tool01-_CVpzZpk.js";import"./SearchMd-BYCOzBqa.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-CYm-wjzD.js";import"./avatar-CFO-sRGJ.js";import"./User01-vLr2BfmM.js";import"./popover-D-MLGIKG.js";import"./drawer-txFUQcqx.js";import"./input-DeNGl9cT.js";import"./suggestion-BfzPP8A_.js";import"./use-mcp-prompts-B5RvuVy4.js";import"./use-org-fs-Bndw9m25.js";import"./useInfiniteQuery-Ctv8zOi3.js";import"./infiniteQueryObserver-CD6zPv_B.js";import"./Link01-D28gAr0F.js";import"./question-004-sINsf4GQ.js";import"./use-members-DQZYP7Cb.js";import"./use-org-auth-client-CSFZu3Wj.js";import"./feature-paywall-XpETcjbv.js";import"./plan-ladder-BJOn0tjJ.js";import"./add-connection-dialog-DyCA7E5B.js";import"./collection-search-CVvFJ5Bb.js";import"./extract-connection-data-DrQExIK1.js";import"./metadata-D72DunRR.js";import"./connection-y8T_LUE4.js";import"./url-slug-DxJ8K4M_.js";import"./connection-card-C_97TUuR.js";import"./connection-slug-CITJ0kGN.js";import"./integration-icon-C-_9oW7G.js";import"./textarea-aGNI5bvN.js";import"./use-connection-hBtWetVy.js";import"./schema-BKLQwKnK.js";import"./connection-form-helpers-B61Y3llL.js";import"./Trash01-CgNTH-jr.js";import"./authenticate-and-persist-oauth-ClTAD7nN.js";import"./mcp-oauth-ZxlBJ_T6.js";import"./mcp-oauth-CaTRnuQU.js";import"./collection-tabs-8dvqqnDR.js";import"./badge-CYEiaJVw.js";import"./use-infinite-scroll-CAGEOw6T.js";import"./useSuspenseInfiniteQuery-DRLUIOlU.js";import"./use-task-board-events-CemAfTjA.js";import"./client-icons-DbBtP136.js";import"./CheckCircle-OCgBlAwW.js";import"./chart-D7lvPdFx.js";import"./index-kjyiSPIZ.js";import"./symbol-CcauWbN2.js";import"./CategoricalChart-BtQQT8Ex.js";import"./project-icon-J_TfV9WN.js";import"./project-apps-FJ0TrEc6.js";import"./config-Ba5RPb40.js";import"./core.esm-Bnj1keGH.js";import"./ReferenceLine-BvmA07RC.js";import"./CartesianChart-CmRg3x8T.js";import"./BarChart-2wCpTPJ2.js";import"./tooltipContext-CgeI21sB.js";import"./ActiveShapeUtils-EYkJV7tD.js";import"./Sector-23KRNcXn.js";import"./ErrorBarContext-i8geYMQV.js";import"./repository-picker-BL6xlIly.js";import"./use-debounced-value-DppuiHxU.js";import"./task-assignee-avatar-BuSQPIHq.js";import"./task-key-BCHdFiOO.js";import"./Building02-BOLEL9nK.js";import"./use-clock-tick-DRqivY5H.js";import"./command-C9iGFbUT.js";import"./index-CW0mTKOH.js";import"./required-auth-layout-BA3Gxw_5.js";import"./use-org-sso-B7o6rhq2.js";import"./CreditCard01-Bw5uGiku.js";import"./DotsVertical-CEoX1VVK.js";import"./Globe04-CMBPkECo.js";import"./SwitchHorizontal01-D6mwjnXs.js";import"./Sun-DFIh8Vd-.js";import"./Play-cNq95jJS.js";import"./Users01-BgSWeeD_.js";function ee(t){return t<12?"morning":t<18?"afternoon":"evening"}function te(t){const e=(t??"").trim().split(/\s+/)[0];return e||null}function Ie(t,e){return e.toLocaleDateString(t,{weekday:"long",day:"numeric",month:"long"})}function Fe(t){return t==="morning"?"overnight":"today"}function Le(t,e){const r=new Date(e);return r.setHours(0,0,0,0),t==="morning"&&r.setHours(-6),r.getTime()}const De={morning:{named:"home.orgHome.greetingMorning",bare:"home.orgHome.greetingMorningBare"},afternoon:{named:"home.orgHome.greetingAfternoon",bare:"home.orgHome.greetingAfternoonBare"},evening:{named:"home.orgHome.greetingEvening",bare:"home.orgHome.greetingEveningBare"}};function ze(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex min-h-64 items-center justify-center",children:s.jsx(Y,{className:"size-5 text-muted-foreground"})}),t[0]=e):e=t[0],e}function Ke(t,e,r,i,n){const l=Fe(r)==="overnight",a=[];if(e>0){const o=t(e===1?"home.brief.changeOne":"home.brief.changeMany",{count:e});a.push(t(l?"home.brief.overnightShipped":"home.brief.todayShipped",{changes:o}))}else i===0&&a.push(t(n>0?"home.brief.working":l?"home.brief.quietNight":"home.brief.quietDay"));return a.push(i===0?t("home.brief.waitingNone"):t(i===1?"home.brief.waitingOne":"home.brief.waitingMany",{count:i})),a.join(" ")}function Ge(t){const e=$.c(40),{canManageProjects:r,eyebrow:i,greeting:n,slot:l}=t,a=O(),{org:o}=B(),{data:c}=D.useSession();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={pageSize:1e3},e[0]=m):m=e[0];const f=V(m),p=pe(),d=Se(),{recent:u}=ke(o.slug);let x,g;if(e[1]!==f||e[2]!==r||e[3]!==o.id){g=Symbol.for("react.early_return_sentinel");e:{let C;e[6]!==o.id?(C=A=>A.id!==o.id,e[6]=o.id,e[7]=C):C=e[7];const T=Q(f).filter(C);if(T.length===0){let A;e[8]!==r?(A=s.jsx(ve,{canCreate:r}),e[8]=r,e[9]=A):A=e[9],g=A;break e}x=Z(T)}e[1]=f,e[2]=r,e[3]=o.id,e[4]=x,e[5]=g}else x=e[4],g=e[5];if(g!==Symbol.for("react.early_return_sentinel"))return g;const j=x;let b,h;e[10]!==c?.user?.id||e[11]!==l||e[12]!==a||e[13]!==p?(h=be(p,c?.user?.id),b=Ke(a,_e(p,Le(l,new Date)),l,h.length,ye(p).length),e[10]=c?.user?.id,e[11]=l,e[12]=a,e[13]=p,e[14]=b,e[15]=h):(b=e[14],h=e[15]);const _=b;let y;e[16]!==i?(y=s.jsx("span",{className:"text-xs text-muted-foreground",children:i}),e[16]=i,e[17]=y):y=e[17];let N;e[18]!==_||e[19]!==n?(N=s.jsxs("h1",{className:"max-w-[40ch] text-2xl font-medium text-balance text-foreground",children:[n," ",_]}),e[18]=_,e[19]=n,e[20]=N):N=e[20];let v;e[21]!==y||e[22]!==N?(v=s.jsxs("div",{className:"flex flex-col gap-1",children:[y,N]}),e[21]=y,e[22]=N,e[23]=v):v=e[23];let k;e[24]!==d.updates||e[25]!==j||e[26]!==o.slug||e[27]!==p||e[28]!==h?(k=s.jsx(ue,{waiting:h,tasks:p,mentions:d.updates,index:j,orgSlug:o.slug}),e[24]=d.updates,e[25]=j,e[26]=o.slug,e[27]=p,e[28]=h,e[29]=k):k=e[29];let S;e[30]!==o.slug||e[31]!==u?(S=s.jsx(de,{recent:u,orgSlug:o.slug}),e[30]=o.slug,e[31]=u,e[32]=S):S=e[32];let w;e[33]!==p?(w=s.jsx(ge,{tasks:p}),e[33]=p,e[34]=w):w=e[34];let H;return e[35]!==w||e[36]!==v||e[37]!==k||e[38]!==S?(H=s.jsxs("div",{className:"flex flex-col gap-8",children:[v,k,S,w]}),e[35]=w,e[36]=v,e[37]=k,e[38]=S,e[39]=H):H=e[39],H}function Ye(){const t=$.c(25),e=O(),[r]=re(),i=J("home_task_intake_enabled"),{data:n}=D.useSession(),{granted:l}=G("agents:manage");let a,o,c;if(t[0]!==r.language||t[1]!==n?.user?.name||t[2]!==e){const h=new Date,_=te(n?.user?.name);o=ee(h.getHours());const y=De[o];a=Ie(r.language,h),c=_?e(y.named,{name:_}):e(y.bare),t[0]=r.language,t[1]=n?.user?.name,t[2]=e,t[3]=a,t[4]=o,t[5]=c}else a=t[3],o=t[4],c=t[5];const m=c;let f;t[6]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(X,{}),t[6]=f):f=t[6];let p;t[7]!==l?(p=l&&s.jsx(Ne,{source:"org_home_header"}),t[7]=l,t[8]=p):p=t[8];let d;t[9]!==p?(d=s.jsx(M.Actions,{secondary:f,children:p}),t[9]=p,t[10]=d):d=t[10];let u;t[11]!==i?(u=i&&s.jsx(R.Suspense,{fallback:null,children:s.jsx(W,{children:s.jsx(U,{children:s.jsx(q,{homeTaskComposer:!0})})})}),t[11]=i,t[12]=u):u=t[12];let x;t[13]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ze,{}),t[13]=x):x=t[13];let g;t[14]!==l||t[15]!==a||t[16]!==m||t[17]!==o?(g=s.jsx(R.Suspense,{fallback:x,children:s.jsx(Ge,{canManageProjects:l,eyebrow:a,greeting:m,slot:o})}),t[14]=l,t[15]=a,t[16]=m,t[17]=o,t[18]=g):g=t[18];let j;t[19]!==u||t[20]!==g?(j=s.jsx(M.Content,{children:s.jsxs(M.Container,{width:"wide",className:"flex min-h-full flex-col gap-10",children:[u,g]})}),t[19]=u,t[20]=g,t[21]=j):j=t[21];let b;return t[22]!==d||t[23]!==j?(b=s.jsxs(M,{children:[d,j]}),t[22]=d,t[23]=j,t[24]=b):b=t[24],b}function qe(t){const e=$.c(13),{label:r,count:i,action:n,children:l}=t;let a;e[0]!==i?(a=i!==void 0&&i>0&&s.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:i}),e[0]=i,e[1]=a):a=e[1];let o;e[2]!==r||e[3]!==a?(o=s.jsxs("h2",{className:"flex items-baseline gap-2 text-[0.9rem] font-medium tracking-tight text-foreground",children:[r,a]}),e[2]=r,e[3]=a,e[4]=o):o=e[4];let c;e[5]!==n||e[6]!==o?(c=s.jsxs("div",{className:"flex h-12 items-center justify-between gap-3 border-b border-border/70 px-5",children:[o,n]}),e[5]=n,e[6]=o,e[7]=c):c=e[7];let m;e[8]!==l?(m=s.jsx("ul",{className:"flex flex-col divide-y divide-border/70",children:l}),e[8]=l,e[9]=m):m=e[9];let f;return e[10]!==c||e[11]!==m?(f=s.jsxs("section",{className:"@container flex flex-col overflow-hidden surface",children:[c,m]}),e[10]=c,e[11]=m,e[12]=f):f=e[12],f}function se(t){const e=$.c(5),{children:r,className:i}=t;let n;e[0]!==i?(n=I("px-5 py-3.5 transition-colors hover:bg-accent",i),e[0]=i,e[1]=n):n=e[1];let l;return e[2]!==r||e[3]!==n?(l=s.jsx("li",{className:n,children:r}),e[2]=r,e[3]=n,e[4]=l):l=e[4],l}const We=56,Ue=16;function Je(t){const e=$.c(28),{series:r,className:i,label:n,height:l,stretch:a}=t,o=l===void 0?Ue:l,c=a===void 0?!1:a,m=Math.max(...r);if(r.length<2||m<=0)return null;const f=c?r.length*8:We,p=f/(r.length-1);let d;if(e[0]!==o||e[1]!==m||e[2]!==r||e[3]!==p){let v;e[5]!==o||e[6]!==m||e[7]!==p?(v=(S,w)=>({x:w*p,y:o-1-S/m*(o-2)}),e[5]=o,e[6]=m,e[7]=p,e[8]=v):v=e[8],d=r.map(v).map(Xe).join(" "),e[0]=o,e[1]=m,e[2]=r,e[3]=p,e[4]=d}else d=e[4];const u=d,x=`0 0 ${f} ${o}`,g=c?void 0:f,j=c?"none":void 0,b=c?"w-full":"shrink-0 overflow-visible";let h;e[9]!==i||e[10]!==b?(h=I(b,i),e[9]=i,e[10]=b,e[11]=h):h=e[11];let _;e[12]!==o||e[13]!==u||e[14]!==c||e[15]!==f?(_=c&&s.jsx("polygon",{points:`0,${o} ${u} ${f},${o}`,fill:"currentColor",opacity:.12}),e[12]=o,e[13]=u,e[14]=c,e[15]=f,e[16]=_):_=e[16];let y;e[17]!==u?(y=s.jsx("polyline",{points:u,fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),e[17]=u,e[18]=y):y=e[18];let N;return e[19]!==o||e[20]!==n||e[21]!==y||e[22]!==x||e[23]!==g||e[24]!==j||e[25]!==h||e[26]!==_?(N=s.jsxs("svg",{viewBox:x,width:g,height:o,role:"img","aria-label":n,preserveAspectRatio:j,className:h,children:[_,y]}),e[19]=o,e[20]=n,e[21]=y,e[22]=x,e[23]=g,e[24]=j,e[25]=h,e[26]=_,e[27]=N):N=e[27],N}function Xe(t){const{x:e,y:r}=t;return`${e.toFixed(1)},${r.toFixed(1)}`}const Ze={waiting:{labelKey:"home.projects.headlineWaiting",className:"text-foreground"},failed:{labelKey:"home.projects.headlineFailed",className:"text-destructive"},shipped:{labelKey:"home.projects.headlineShipped",className:"text-muted-foreground"},open:{labelKey:"home.projects.headlineOpen",className:"text-muted-foreground"}},z=6;function Qe(t){const e=$.c(10),{value:r,previous:i}=t,n=r-i;if(n===0)return null;const l=n>0?Te:Pe,a=n>0?"text-success":"text-muted-foreground";let o;e[0]!==a?(o=I("inline-flex items-center text-xs tabular-nums",a),e[0]=a,e[1]=o):o=e[1];let c;e[2]!==l?(c=s.jsx(l,{width:11,height:11,"aria-hidden":!0}),e[2]=l,e[3]=c):c=e[3];let m;e[4]!==n?(m=Math.abs(n),e[4]=n,e[5]=m):m=e[5];let f;return e[6]!==o||e[7]!==c||e[8]!==m?(f=s.jsxs("span",{className:o,children:[c,m]}),e[6]=o,e[7]=c,e[8]=m,e[9]=f):f=e[9],f}function Ve(t){const e=$.c(52),{project:r,summary:i,series:n}=t,l=O(),a=Me();let o;e[0]!==r?(o=Oe(Re(r).storeUrl),e[0]=r,e[1]=o):o=e[1];const c=o,m=i&&i.kind!=="quiet"?Ze[i.kind]:null,f=n.reduce(st,0),p=Math.floor(n.length/2);let d;e[2]!==p||e[3]!==n?(d=n.slice(0,p).reduce(tt,0),e[2]=p,e[3]=n,e[4]=d):d=e[4];const u=d;let x;e[5]!==p||e[6]!==n?(x=n.slice(p).reduce(et,0),e[5]=p,e[6]=n,e[7]=x):x=e[7];const g=x,j=r.title;let b;e[8]!==a||e[9]!==r.id?(b=()=>{F("org_home_project_clicked"),a(r.id)},e[8]=a,e[9]=r.id,e[10]=b):b=e[10];let h;e[11]!==r.icon||e[12]!==r.title?(h=s.jsx(Ee,{icon:r.icon,name:r.title,size:"xs"}),e[11]=r.icon,e[12]=r.title,e[13]=h):h=e[13];let _;e[14]!==r.title?(_=s.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:r.title}),e[14]=r.title,e[15]=_):_=e[15];let y;e[16]!==m||e[17]!==c||e[18]!==i||e[19]!==l?(y=m&&i?l(m.labelKey,{count:i.count}):c??l("home.projects.quiet"),e[16]=m,e[17]=c,e[18]=i,e[19]=l,e[20]=y):y=e[20];let N;e[21]!==y?(N=s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:y}),e[21]=y,e[22]=N):N=e[22];let v;e[23]!==_||e[24]!==N?(v=s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[_,N]}),e[23]=_,e[24]=N,e[25]=v):v=e[25];let k;e[26]!==r.title||e[27]!==l?(k=l("home.projects.rhythm",{name:r.title}),e[26]=r.title,e[27]=l,e[28]=k):k=e[28];let S;e[29]!==n||e[30]!==k?(S=s.jsx(Je,{series:n,className:"text-muted-foreground/60",label:k}),e[29]=n,e[30]=k,e[31]=S):S=e[31];const w=f>0?"text-foreground":"text-muted-foreground";let H;e[32]!==w?(H=I("text-sm tabular-nums",w),e[32]=w,e[33]=H):H=e[33];let C;e[34]!==f||e[35]!==H?(C=s.jsx("span",{className:H,children:f}),e[34]=f,e[35]=H,e[36]=C):C=e[36];let T;e[37]!==g||e[38]!==u?(T=s.jsx(Qe,{value:g,previous:u}),e[37]=g,e[38]=u,e[39]=T):T=e[39];let A;e[40]!==C||e[41]!==T?(A=s.jsxs("span",{className:"flex w-10 shrink-0 flex-col items-end",children:[C,T]}),e[40]=C,e[41]=T,e[42]=A):A=e[42];let P;e[43]!==S||e[44]!==A?(P=s.jsxs("span",{className:"flex shrink-0 items-center gap-2.5",children:[S,A]}),e[43]=S,e[44]=A,e[45]=P):P=e[45];let E;return e[46]!==r.title||e[47]!==v||e[48]!==P||e[49]!==b||e[50]!==h?(E=s.jsx(se,{className:"transition-colors hover:bg-accent",children:s.jsxs("button",{type:"button","aria-label":j,onClick:b,className:"flex w-full min-w-0 items-center gap-3 text-left",children:[h,v,P]})}),e[46]=r.title,e[47]=v,e[48]=P,e[49]=b,e[50]=h,e[51]=E):E=e[51],E}function et(t,e){return t+e}function tt(t,e){return t+e}function st(t,e){return t+e}const ot=new Map,rt=new Map;function it(t){const e=$.c(30),{projects:r,summaries:i,series:n}=t,l=i===void 0?ot:i,a=n===void 0?rt:n,o=O(),{org:c}=B();let m,f,p,d,u,x;if(e[0]!==r||e[1]!==a||e[2]!==l||e[3]!==o){const b=[...r].sort(nt).slice(0,z);f=r.length>z,m=qe,e[10]!==o?(p=o("home.projects.heading"),e[10]=o,e[11]=p):p=e[11],d=r.length;let h;e[12]!==o?(h=o("home.projects.shippedCaption"),e[12]=o,e[13]=h):h=e[13],e[14]!==h?(u=s.jsx("span",{className:"hidden whitespace-nowrap text-xs text-muted-foreground @[19rem]:inline",children:h}),e[14]=h,e[15]=u):u=e[15];let _;e[16]!==a||e[17]!==l?(_=y=>s.jsx(Ve,{project:y,summary:l.get(y.id),series:a.get(y.id)??[]},y.id),e[16]=a,e[17]=l,e[18]=_):_=e[18],x=b.map(_),e[0]=r,e[1]=a,e[2]=l,e[3]=o,e[4]=m,e[5]=f,e[6]=p,e[7]=d,e[8]=u,e[9]=x}else m=e[4],f=e[5],p=e[6],d=e[7],u=e[8],x=e[9];let g;e[19]!==f||e[20]!==c||e[21]!==o?(g=f&&s.jsx(se,{className:"py-2",children:s.jsx(ie,{to:"/$org/settings/projects",params:{org:c.slug},className:"text-xs text-muted-foreground hover:text-foreground hover:underline",children:o("home.projects.seeAll")})}),e[19]=f,e[20]=c,e[21]=o,e[22]=g):g=e[22];let j;return e[23]!==m||e[24]!==p||e[25]!==d||e[26]!==u||e[27]!==x||e[28]!==g?(j=s.jsxs(m,{label:p,count:d,action:u,children:[x,g]}),e[23]=m,e[24]=p,e[25]=d,e[26]=u,e[27]=x,e[28]=g,e[29]=j):j=e[29],j}function nt(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function lt(){const t=$.c(10),{org:e}=B(),r=ne();let i;t[0]!==e.id?(i=le.orgHasSite(e.id),t[0]=e.id,t[1]=i):i=t[1];const n=!!e.id;let l;t[2]!==r?(l=()=>r.call("ORGANIZATION_HAS_SITE",{}),t[2]=r,t[3]=l):l=t[3];let a;t[4]!==i||t[5]!==n||t[6]!==l?(a={queryKey:i,staleTime:3e5,enabled:n,queryFn:l},t[4]=i,t[5]=n,t[6]=l,t[7]=a):a=t[7];const{data:o}=ae(a),c=o?.hasSite??!1;let m;return t[8]!==c?(m={hasSite:c},t[8]=c,t[9]=m):m=t[9],m}const at="https://www.youtube.com/playlist?list=PLZ4WtTgnJfBw";function ct(t){const e=$.c(4),{className:r}=t;let i,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("path",{fill:"#FF0000",d:"M27.4 3.1c-.3-1.2-1.3-2.2-2.5-2.5C22.7 0 14 0 14 0S5.3 0 3.1.6C1.9.9.9 1.9.6 3.1.1 5.3 0 8 0 10s.1 4.7.6 6.9c.3 1.2 1.3 2.2 2.5 2.5C5.3 20 14 20 14 20s8.7 0 10.9-.6c1.2-.3 2.2-1.3 2.5-2.5.5-2.2.6-4.9.6-6.9s-.1-4.7-.6-6.9z"}),n=s.jsx("path",{fill:"#fff",d:"M11.2 14.3l7.3-4.3-7.3-4.3z"}),e[0]=i,e[1]=n):(i=e[0],n=e[1]);let l;return e[2]!==r?(l=s.jsxs("svg",{viewBox:"0 0 28 20",className:r,"aria-hidden":"true",focusable:"false",children:[i,n]}),e[2]=r,e[3]=l):l=e[3],l}function mt(){const t=$.c(27),e=O(),{hasSite:r}=lt();if(!r)return null;let i;t[0]!==e?(i=e("home.orgHome.trainingThumbnailAlt"),t[0]=e,t[1]=i):i=t[1];let n;t[2]!==i?(n=s.jsx("img",{src:"/cms-training.jpg",alt:i,className:"size-full object-cover"}),t[2]=i,t[3]=n):n=t[3];let l;t[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/10 transition-colors group-hover:bg-black/20",children:s.jsx(ct,{className:"w-9"})}),t[4]=l):l=t[4];let a;t[5]!==n?(a=s.jsxs("div",{className:"relative aspect-video w-40 shrink-0 overflow-hidden rounded-lg",children:[n,l]}),t[5]=n,t[6]=a):a=t[6];let o;t[7]!==e?(o=e("home.orgHome.trainingEyebrow"),t[7]=e,t[8]=o):o=t[8];let c;t[9]!==o?(c=s.jsx("p",{className:"text-xs text-muted-foreground",children:o}),t[9]=o,t[10]=c):c=t[10];let m;t[11]!==e?(m=e("home.orgHome.trainingTitle"),t[11]=e,t[12]=m):m=t[12];let f;t[13]!==m?(f=s.jsx("h3",{className:"text-sm font-medium text-foreground",children:m}),t[13]=m,t[14]=f):f=t[14];let p;t[15]!==e?(p=e("home.orgHome.trainingDescription"),t[15]=e,t[16]=p):p=t[16];let d;t[17]!==p?(d=s.jsx("p",{className:"mt-0.5 line-clamp-2 text-xs text-muted-foreground",children:p}),t[17]=p,t[18]=d):d=t[18];let u;t[19]!==c||t[20]!==f||t[21]!==d?(u=s.jsxs("div",{className:"min-w-0 flex-1",children:[c,f,d]}),t[19]=c,t[20]=f,t[21]=d,t[22]=u):u=t[22];let x;t[23]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Be,{className:"size-4 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"}),t[23]=x):x=t[23];let g;return t[24]!==u||t[25]!==a?(g=s.jsxs("a",{href:at,target:"_blank",rel:"noreferrer",onClick:ft,className:"group shadow-edge flex w-full items-center gap-4 rounded-2xl bg-card p-4 text-left transition-colors hover:bg-accent",children:[a,u,x]}),t[24]=u,t[25]=a,t[26]=g):g=t[26],g}function ft(){return F("cms_training_opened",{source:"org_home"})}const pt={morning:{named:"home.orgHome.greetingMorning",bare:"home.orgHome.greetingMorningBare"},afternoon:{named:"home.orgHome.greetingAfternoon",bare:"home.orgHome.greetingAfternoonBare"},evening:{named:"home.orgHome.greetingEvening",bare:"home.orgHome.greetingEveningBare"}};function ut(){const t=$.c(8),e=O();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(He,{className:"size-4 shrink-0 text-muted-foreground"}),t[0]=r):r=t[0];let i;t[1]!==e?(i=e("home.orgHome.searchPlaceholder"),t[1]=e,t[2]=i):i=t[2];let n;t[3]!==i?(n=s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:i}),t[3]=i,t[4]=n):n=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("kbd",{className:"shrink-0 rounded-md border border-border bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground",children:"⌘K"}),t[5]=l):l=t[5];let a;return t[6]!==n?(a=s.jsxs("button",{type:"button","data-testid":"org-home-search",onClick:dt,className:"shadow-edge flex w-full items-center gap-2 rounded-xl bg-card px-3 py-2.5 text-left transition-colors hover:bg-accent",children:[r,n,l]}),t[6]=n,t[7]=a):a=t[7],a}function dt(){F("command_palette_opened",{source:"org_home_search"}),Ae()}function K(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex min-h-64 items-center justify-center",children:s.jsx(Y,{className:"size-5 text-muted-foreground"})}),t[0]=e):e=t[0],e}function gt(t){const e=$.c(28),{canManageAgents:r}=t,i=O(),{org:n}=B();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={pageSize:1e3},e[0]=l):l=e[0];const a=V(l),o=he();let c,m,f;if(e[1]!==a||e[2]!==r||e[3]!==n||e[4]!==i||e[5]!==o){f=Symbol.for("react.early_return_sentinel");e:{let g;if(e[9]!==n?(g=j=>j.id!==n.id,e[9]=n,e[10]=g):g=e[10],c=Q(a).filter(g),c.length===0){let j;e[11]!==i?(j=i("routes.agentsList.noAgentsYet"),e[11]=i,e[12]=j):j=e[12];let b;e[13]!==r||e[14]!==i?(b=i(r?"home.orgAgents.importToGetStarted":"routes.agentsList.askAdminToCreate"),e[13]=r,e[14]=i,e[15]=b):b=e[15];let h;e[16]!==j||e[17]!==b?(h=s.jsx("div",{className:"flex items-center justify-center py-10",children:s.jsx(Ce,{actions:!1,image:null,title:j,description:b})}),e[16]=j,e[17]=b,e[18]=h):h=e[18],f=h;break e}m=xe(Z(c),o,null)}e[1]=a,e[2]=r,e[3]=n,e[4]=i,e[5]=o,e[6]=c,e[7]=m,e[8]=f}else c=e[6],m=e[7],f=e[8];if(f!==Symbol.for("react.early_return_sentinel"))return f;const p=m.length>0;let d;e[19]!==c?(d=s.jsx(it,{projects:c}),e[19]=c,e[20]=d):d=e[20];let u;e[21]!==c||e[22]!==p||e[23]!==o?(u=p&&s.jsx(je,{projects:c,tasks:o}),e[21]=c,e[22]=p,e[23]=o,e[24]=u):u=e[24];let x;return e[25]!==d||e[26]!==u?(x=s.jsxs("div",{className:"flex flex-col gap-12",children:[d,u]}),e[25]=d,e[26]=u,e[27]=x):x=e[27],x}function ht(){const t=$.c(55),e=O(),r=J("home_task_intake_enabled"),{data:i}=D.useSession(),[n,l]=R.useState(!1),{granted:a}=G("agents:manage");let o,c,m,f,p,d,u,x,g,j,b,h;if(t[0]!==a||t[1]!==i?.user?.name||t[2]!==e){const A=te(i?.user?.name),P=pt[ee(new Date().getHours())];let E;t[15]!==e?(E=oe=>s.jsxs(ce,{size:"sm",variant:"default",onClick:()=>{F("agent_create_clicked",{source:oe,method:"github"}),l(!0)},children:[s.jsx(we,{size:14}),e("home.orgAgents.importFromGitHub")]}),t[15]=e,t[16]=E):E=t[16];const L=E;m=M,t[17]!==a||t[18]!==L?(h=a&&s.jsx(M.Actions,{children:L("org_home")}),t[17]=a,t[18]=L,t[19]=h):h=t[19],c=M.Content,o=M.Container,j="reading",b="flex flex-col gap-12",u="flex flex-col items-center gap-12 text-center",t[20]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(X,{dense:!1}),g=s.jsx(mt,{}),t[20]=x,t[21]=g):(x=t[20],g=t[21]),d="flex w-full flex-col items-center gap-5",f="text-3xl font-medium tracking-tight text-foreground",p=A?e(P.named,{name:A}):e(P.bare),t[0]=a,t[1]=i?.user?.name,t[2]=e,t[3]=o,t[4]=c,t[5]=m,t[6]=f,t[7]=p,t[8]=d,t[9]=u,t[10]=x,t[11]=g,t[12]=j,t[13]=b,t[14]=h}else o=t[3],c=t[4],m=t[5],f=t[6],p=t[7],d=t[8],u=t[9],x=t[10],g=t[11],j=t[12],b=t[13],h=t[14];let _;t[22]!==f||t[23]!==p?(_=s.jsx("h2",{className:f,children:p}),t[22]=f,t[23]=p,t[24]=_):_=t[24];let y;t[25]!==r?(y=r?s.jsx(R.Suspense,{fallback:s.jsx(K,{}),children:s.jsx(W,{children:s.jsx(U,{children:s.jsx(q,{homeTaskComposer:!0})})})}):s.jsx(ut,{}),t[25]=r,t[26]=y):y=t[26];let N;t[27]!==y||t[28]!==d||t[29]!==_?(N=s.jsxs("div",{className:d,children:[_,y]}),t[27]=y,t[28]=d,t[29]=_,t[30]=N):N=t[30];let v;t[31]!==N||t[32]!==u||t[33]!==x||t[34]!==g?(v=s.jsxs("div",{className:u,children:[x,g,N]}),t[31]=N,t[32]=u,t[33]=x,t[34]=g,t[35]=v):v=t[35];let k;t[36]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(K,{}),t[36]=k):k=t[36];let S;t[37]!==a?(S=s.jsx(R.Suspense,{fallback:k,children:s.jsx(gt,{canManageAgents:a})}),t[37]=a,t[38]=S):S=t[38];let w;t[39]!==o||t[40]!==v||t[41]!==S||t[42]!==j||t[43]!==b?(w=s.jsxs(o,{width:j,className:b,children:[v,S]}),t[39]=o,t[40]=v,t[41]=S,t[42]=j,t[43]=b,t[44]=w):w=t[44];let H;t[45]!==c||t[46]!==w?(H=s.jsx(c,{children:w}),t[45]=c,t[46]=w,t[47]=H):H=t[47];let C;t[48]!==n?(C=s.jsx($e,{open:n,onOpenChange:l}),t[48]=n,t[49]=C):C=t[49];let T;return t[50]!==m||t[51]!==H||t[52]!==C||t[53]!==h?(T=s.jsxs(m,{children:[h,H,C]}),t[50]=m,t[51]=H,t[52]=C,t[53]=h,t[54]=T):T=t[54],T}function xt(){return me()?s.jsx(Ye,{}):s.jsx(ht,{})}function dr(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(fe.Content,{children:s.jsx(xt,{})}),t[0]=e):e=t[0],e}export{dr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,j as p,B as h}from"./index-
|
|
1
|
+
import{c as f,j as p,B as h}from"./index-BphI8pNH.js";import{T as j,a as v,c as T}from"./tooltip-2YCPx1DM.js";function B(d){const t=f.c(19);let e,o,i,n,r,a;t[0]!==d?({label:o,tooltipSide:n,variant:r,size:a,children:e,...i}=d,t[0]=d,t[1]=e,t[2]=o,t[3]=i,t[4]=n,t[5]=r,t[6]=a):(e=t[1],o=t[2],i=t[3],n=t[4],r=t[5],a=t[6]);const m=n===void 0?"top":n,u=r===void 0?"ghost":r,x=a===void 0?"icon-sm":a;let s;t[7]!==e||t[8]!==o||t[9]!==i||t[10]!==x||t[11]!==u?(s=p.jsx(j,{asChild:!0,children:p.jsx(h,{"data-slot":"icon-button","aria-label":o,variant:u,size:x,...i,children:e})}),t[7]=e,t[8]=o,t[9]=i,t[10]=x,t[11]=u,t[12]=s):s=t[12];let l;t[13]!==o||t[14]!==m?(l=p.jsx(v,{side:m,children:o}),t[13]=o,t[14]=m,t[15]=l):l=t[15];let c;return t[16]!==s||t[17]!==l?(c=p.jsxs(T,{children:[s,l]}),t[16]=s,t[17]=l,t[18]=c):c=t[18],c}export{B as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as $,x as D,_ as We,T as H,$ as je,a0 as I,a1 as U,o as W,a2 as G,a3 as J,a4 as me,a5 as qe,a6 as we,a7 as Xe,E as be,a8 as Ye,a9 as Ge,j as ve}from"./usage-stats-CvT3PVJT.js";import{eW as ye,fz as Ce,eV as Se,fA as Re,fB as Ee,fC as Te,fD as Oe,fE as Ae,eY as Ie,d$ as Me,r as C,b2 as ze}from"./index-D2MFYEzD.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 B=(T+O)%t*2,q=l[B];q==null||q!=L&&l[B+1]==1?(l[B]=L,l[B+1]=1):q==L&&l[B+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 $("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 A(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(I.from(c)))}const r=this.isColSelection()&&this.isRowSelection()?t:l;return new U(I.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(I.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 $("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(!A(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.left))}return!0}function cn(e,t){if(!A(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(!A(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(!A(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.top))}return!0}function hn(e,t){if(!A(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(!A(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=I.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(!A(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(!A(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(!A(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(!A(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(I.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(I.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(I.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(I.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,I.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":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:V,"Mod-Backspace":V,Delete:V,"Mod-Delete":V});function k(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 k(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 k(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),k(n,o,c)}}}function _(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?k(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(!A(e.state))return!1;let o=yt(n);const i=e.state.selection;if(i instanceof b){o||(o={width:1,height:1,rows:[I.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 At(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 It=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 $("tableColumnResizing");function yn({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=It,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}$e(e,l)}}}function Dt(e){if(!e.editable)return;const t=E.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(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 $e(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:At},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 $t(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 Bt=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(Ae(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():$t(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&&Ie(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 Be=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Bt({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?[Be({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(Ae(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);Ie({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 $(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 $(t)}const Kt=typeof window<"u"?C.useLayoutEffect:C.useEffect,_e=new Set(["left","opacity","position","top","visibility","width"]),_t=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"]),kt=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 ke(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("--")||_t.has(e)?String(t):`${t}px`}function Qt(e,t){_e.has(t)||e.style.removeProperty(ke(t))}function en(e,t,n){_e.has(t)||e.style.setProperty(ke(t),Zt(t,n))}function tn(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(o=>{if(kt.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=Be({...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{n as $,x as D,_ as We,T as H,$ as je,a0 as I,a1 as U,o as W,a2 as G,a3 as J,a4 as me,a5 as qe,a6 as we,a7 as Xe,E as be,a8 as Ye,a9 as Ge,j as ve}from"./usage-stats-BHO2m1GZ.js";import{eW as ye,fz as Ce,eV as Se,fA as Re,fB as Ee,fC as Te,fD as Oe,fE as Ae,eY as Ie,d$ as Me,r as C,b2 as ze}from"./index-BphI8pNH.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 B=(T+O)%t*2,q=l[B];q==null||q!=L&&l[B+1]==1?(l[B]=L,l[B+1]=1):q==L&&l[B+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 $("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 A(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(I.from(c)))}const r=this.isColSelection()&&this.isRowSelection()?t:l;return new U(I.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(I.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 $("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(!A(e))return!1;if(t){const n=M(e);t(Ne(e.tr,n,n.left))}return!0}function cn(e,t){if(!A(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(!A(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(!A(e))return!1;if(t){const n=M(e);t(Pe(e.tr,n,n.top))}return!0}function hn(e,t){if(!A(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(!A(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=I.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(!A(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(!A(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(!A(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(!A(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(I.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(I.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(I.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(I.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,I.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":_("horiz",-1),"Shift-ArrowRight":_("horiz",1),"Shift-ArrowUp":_("vert",-1),"Shift-ArrowDown":_("vert",1),Backspace:V,"Mod-Backspace":V,Delete:V,"Mod-Delete":V});function k(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 k(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 k(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),k(n,o,c)}}}function _(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?k(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(!A(e.state))return!1;let o=yt(n);const i=e.state.selection;if(i instanceof b){o||(o={width:1,height:1,rows:[I.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 At(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 It=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 $("tableColumnResizing");function yn({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=It,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}$e(e,l)}}}function Dt(e){if(!e.editable)return;const t=E.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&$e(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 $e(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:At},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 $t(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 Bt=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(Ae(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():$t(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&&Ie(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 Be=e=>new W({key:typeof e.pluginKey=="string"?new $(e.pluginKey):e.pluginKey,view:t=>new Bt({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?[Be({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(Ae(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);Ie({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 $(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 $(t)}const Kt=typeof window<"u"?C.useLayoutEffect:C.useEffect,_e=new Set(["left","opacity","position","top","visibility","width"]),_t=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"]),kt=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 ke(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("--")||_t.has(e)?String(t):`${t}px`}function Qt(e,t){_e.has(t)||e.style.removeProperty(ke(t))}function en(e,t,n){_e.has(t)||e.style.setProperty(ke(t),Zt(t,n))}function tn(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(o=>{if(kt.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=Be({...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};
|