decocms 4.562.1 → 4.563.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Cwj2JDLb.js → AlertCircle-2LbzMVC9.js} +1 -1
- package/dist/client/assets/{AreaChart-M71cxP0N.js → AreaChart-qBz2MFzD.js} +1 -1
- package/dist/client/assets/{ArrowLeft-D6im8CSl.js → ArrowLeft-BeuQwyHa.js} +1 -1
- package/dist/client/assets/{ArrowUp-zoWFBt83.js → ArrowUp-DmxAfWhF.js} +1 -1
- package/dist/client/assets/{CartesianChart-CkRq1ukN.js → CartesianChart-BSwxZ1ZU.js} +1 -1
- package/dist/client/assets/{CategoricalChart-CJyVrm-b.js → CategoricalChart-DVdTZlRq.js} +1 -1
- package/dist/client/assets/{CheckCircle-Dycaqr3_.js → CheckCircle-BzNTGMCW.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-Cq__IjWt.js → ChevronSelectorVertical-XdbRnSsi.js} +1 -1
- package/dist/client/assets/{ChevronUp-B0uKxpVg.js → ChevronUp-aYmfXYet.js} +1 -1
- package/dist/client/assets/{CreditCard01-CMHPxKus.js → CreditCard01-yFcUZGe-.js} +1 -1
- package/dist/client/assets/{Globe04-BLpPYUUd.js → Globe04-RPMmcIuy.js} +1 -1
- package/dist/client/assets/{Key01-KS2Cdqso.js → Key01-jvDltRrN.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CFo-1erV.js → LinkBroken01-Jybptj_M.js} +1 -1
- package/dist/client/assets/{Minus-CR14C6Ew.js → Minus-BqtyYKKc.js} +1 -1
- package/dist/client/assets/{Monitor01-PjSuNm4O.js → Monitor01-As0zpJLy.js} +1 -1
- package/dist/client/assets/{Play-DAD0wkps.js → Play-CdlorRHF.js} +1 -1
- package/dist/client/assets/{Plus-Caq968Zm.js → Plus-CzoopYlU.js} +1 -1
- package/dist/client/assets/ReferenceLine-CJng4Q0_.js +1 -0
- package/dist/client/assets/{SearchMd-BionSqTl.js → SearchMd-By2dNUiw.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DUpALglE.js → ShoppingBag01-DhegylE0.js} +1 -1
- package/dist/client/assets/{Sun-x19ShBxe.js → Sun-Hd0LHTxB.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Dghq_Bvd.js → SwitchHorizontal01-Czrqzt6f.js} +1 -1
- package/dist/client/assets/{Tool01-GdBdG6P_.js → Tool01-D38zOT0h.js} +1 -1
- package/dist/client/assets/{Tooltip-CDDThlKy.js → Tooltip-Dxjn-_yM.js} +1 -1
- package/dist/client/assets/{Trash01-DhMVlpac.js → Trash01-BxSWir9J.js} +1 -1
- package/dist/client/assets/{Upload01-hsehoAUh.js → Upload01-C8sapTWh.js} +1 -1
- package/dist/client/assets/{UserSquare-T5uOviXx.js → UserSquare-CEg-eLCw.js} +1 -1
- package/dist/client/assets/{Users01-DDaeVlhF.js → Users01-CMreTMtq.js} +1 -1
- package/dist/client/assets/{XClose-NmocES7U.js → XClose-DGifUqyQ.js} +1 -1
- package/dist/client/assets/{Zap-aTbgq59l.js → Zap-BLaVFWQx.js} +1 -1
- package/dist/client/assets/{access-gate-CpAtBb_h.js → access-gate-BJSZ7nU5.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BFqv_pWT.js → add-connection-dialog-Dpu5ecJP.js} +1 -1
- package/dist/client/assets/agent-app-CHKycGm0.js +1 -0
- package/dist/client/assets/agent-assets-7nArEuts.js +1 -0
- package/dist/client/assets/{agent-automation-7-KjK-1c.js → agent-automation-Dq1UMpQM.js} +3 -3
- package/dist/client/assets/{agent-automations-DnNwxwTt.js → agent-automations-DF3vcb3-.js} +1 -1
- package/dist/client/assets/agent-calendar-CsvxRBRw.js +1 -0
- package/dist/client/assets/agent-capabilities-CaXbVMop.js +1 -0
- package/dist/client/assets/{agent-connect-sources-SuTyB8Qe.js → agent-connect-sources-84FLUgzX.js} +1 -1
- package/dist/client/assets/agent-deck-DEx4qeYv.js +1 -0
- package/dist/client/assets/agent-e2e-CfTkWgUa.js +1 -0
- package/dist/client/assets/agent-experiments-BMy2QOPP.js +1 -0
- package/dist/client/assets/agent-file-C7mhhKFK.js +1 -0
- package/dist/client/assets/agent-hosting-BmtgVBqV.js +1 -0
- package/dist/client/assets/{agent-icon-DD6O0sln.js → agent-icon-U2nlXoBG.js} +1 -1
- package/dist/client/assets/agent-library-DIxeSWXa.js +1 -0
- package/dist/client/assets/agent-library-file-DQB6i5_0.js +1 -0
- package/dist/client/assets/agent-overview-D8ZTdoEM.js +1 -0
- package/dist/client/assets/agent-releases-DOPovy0S.js +2 -0
- package/dist/client/assets/agent-settings-x3yUV6x9.js +1 -0
- package/dist/client/assets/{agent-site-editor-YGSo4JHf.js → agent-site-editor-Pg_WHlnv.js} +2 -2
- package/dist/client/assets/agent-site-editor-code-DDscaXHP.js +2 -0
- package/dist/client/assets/agent-site-editor-content-CBj6Azpl.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-Doqukvwz.js +1 -0
- package/dist/client/assets/agent-view-CvpQlU18.js +1 -0
- package/dist/client/assets/{agent-view-guard-Ud9RVhUT.js → agent-view-guard-BFnkZyhp.js} +1 -1
- package/dist/client/assets/{ai-providers-CdWvTe6E.js → ai-providers-tFJSU00y.js} +1 -1
- package/dist/client/assets/{alert-rSlkmSpl.js → alert-B52lXsYB.js} +1 -1
- package/dist/client/assets/{analytics-sections-CdJGMHGj.js → analytics-sections-DgZGw207.js} +1 -1
- package/dist/client/assets/api-keys-BEFmsf3L.js +1 -0
- package/dist/client/assets/{api-keys-CgV7T2W3.js → api-keys-Bc1E8umo.js} +1 -1
- package/dist/client/assets/app-editor-a13s_yZZ.js +1 -0
- package/dist/client/assets/{asset-utils-DJaTbmOK.js → asset-utils-DxOK6Cj3.js} +1 -1
- package/dist/client/assets/{auth-Dfx2bf9S.js → auth-D991fBKg.js} +1 -1
- package/dist/client/assets/{auth-catchall-BzI646tE.js → auth-catchall-CO4eQSBG.js} +1 -1
- package/dist/client/assets/{auth-entry-BA2dv7O1.js → auth-entry-IOobChfY.js} +1 -1
- package/dist/client/assets/{auth-split-layout-3t1_TKos.js → auth-split-layout-Dn_4EroD.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-EuyAX3Gy.js → authenticate-and-persist-oauth-CM3iiCDW.js} +1 -1
- package/dist/client/assets/{automation-list-row-BK5XD6ZY.js → automation-list-row-sEGCpgiC.js} +1 -1
- package/dist/client/assets/{automation-runs-BekfbsHI.js → automation-runs-DnhCJL7r.js} +1 -1
- package/dist/client/assets/{automations-ocOVuWpR.js → automations-BopJHgke.js} +1 -1
- package/dist/client/assets/{autosend-BLYIlkXq.js → autosend-D6GGYoeu.js} +1 -1
- package/dist/client/assets/{badge-9UZ-oy57.js → badge-C9w1KAGQ.js} +1 -1
- package/dist/client/assets/{block-document-B5Xpou_B.js → block-document-ExA3sDvi.js} +2 -2
- package/dist/client/assets/{blocks-preview-workspace-context-CGoI0EUn.js → blocks-preview-workspace-context-Gbv7_zq8.js} +1 -1
- package/dist/client/assets/blocks-tab-states-oXZbJa9b.js +1 -0
- package/dist/client/assets/{blog-schema-DMB79fe6.js → blog-schema-4OEvCOpU.js} +1 -1
- package/dist/client/assets/{buckets-C5e8GKB5.js → buckets-DsGf5D8D.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-aExDV9Mz.js → build-improve-prompt-doc-BpZBupFA.js} +1 -1
- package/dist/client/assets/{calendar-CKcdkgh5.js → calendar-ahGH-Iwe.js} +1 -1
- package/dist/client/assets/{capability-load-error-D8AT7eAw.js → capability-load-error-BG7LprlO.js} +1 -1
- package/dist/client/assets/category-editor-Ctbp0oQy.js +1 -0
- package/dist/client/assets/{chart-Ch4wXn1G.js → chart-DnblhNHq.js} +1 -1
- package/dist/client/assets/{chat-context-tsaqCp6v.js → chat-context-CCj5lauv.js} +2 -2
- package/dist/client/assets/{chat-draft-DeOYn8wH.js → chat-draft-BtMWyLm7.js} +1 -1
- package/dist/client/assets/{checkbox-bO8ZnM7n.js → checkbox-DB14k3TQ.js} +1 -1
- package/dist/client/assets/{choose-editor-B-1DX2pl.js → choose-editor-D4zx1UJt.js} +1 -1
- package/dist/client/assets/{cli-auth-success-WUcj8Laj.js → cli-auth-success-DeaH4VUx.js} +1 -1
- package/dist/client/assets/{client-icons-CJKwmsS5.js → client-icons-C4W9Kqhd.js} +1 -1
- package/dist/client/assets/cms-settings-editor-CcuLaEnU.js +1 -0
- package/dist/client/assets/cms-store-drafts-BumH78UY.js +1 -0
- package/dist/client/assets/{collapsible-CehJ-xlR.js → collapsible-BPEhSNLz.js} +1 -1
- package/dist/client/assets/{collection-detail-w7NYTWNb.js → collection-detail-ralZDDkv.js} +1 -1
- package/dist/client/assets/{collection-display-button-CVOVdzmi.js → collection-display-button-CigTGx80.js} +1 -1
- package/dist/client/assets/{collection-search-Lm88VC-w.js → collection-search-D_oD-yY0.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-LUTykEyP.js → collection-table-wrapper-C2dK4p_4.js} +1 -1
- package/dist/client/assets/{collection-tabs-BW9NTpao.js → collection-tabs-SAUXvS4g.js} +1 -1
- package/dist/client/assets/{combobox-C8IS_aP5.js → combobox-hVgdYGtQ.js} +1 -1
- package/dist/client/assets/{command-B42vqDSm.js → command-DiccrIM8.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-gN7svOR8.js → companion-mcps-section-BUEyDlWy.js} +1 -1
- package/dist/client/assets/{config--cZAprAj.js → config-DgUlbPLE.js} +1 -1
- package/dist/client/assets/{connect-BAZtz6qy.js → connect-DhpQ_i5Y.js} +3 -3
- package/dist/client/assets/{connect-layout-FGHNVpHc.js → connect-layout-Dgb_j_Nn.js} +1 -1
- package/dist/client/assets/{connect-source-dialog-BlacChCY.js → connect-source-dialog-Dga8Dh15.js} +1 -1
- package/dist/client/assets/{connection-Brtus8mh.js → connection-DF20RpK_.js} +1 -1
- package/dist/client/assets/{connection-card-CSkWTxJN.js → connection-card-DeCnJCAi.js} +1 -1
- package/dist/client/assets/{connection-detail-Dz92Js40.js → connection-detail-Dn5XmXHk.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CQaJSXmJ.js → connection-form-helpers-B4MG2Fy2.js} +1 -1
- package/dist/client/assets/{connection-slug-DREkgXeA.js → connection-slug-tS8GnOSc.js} +1 -1
- package/dist/client/assets/{connections-BZUJ_roU.js → connections-DREB4U2P.js} +1 -1
- package/dist/client/assets/{content-tab-Bc_Tg1a4.js → content-tab-kF-GtTU9.js} +8 -8
- package/dist/client/assets/context-Gpy7m9cw.js +1 -0
- package/dist/client/assets/{context-menu-D-JkcRvL.js → context-menu-vUs3I8Wh.js} +1 -1
- package/dist/client/assets/{context-shell-Bwve3xDx.js → context-shell-vU2YMH1K.js} +3 -3
- package/dist/client/assets/{core.esm-ByTukYOF.js → core.esm-CWyzckxm.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BIe1f-Sz.js → create-organization-dialog-qsB5dfrW.js} +1 -1
- package/dist/client/assets/device-hint-DMMaEP-p.js +1 -0
- package/dist/client/assets/{discover-D050EtE3.js → discover-DN-I6i-O.js} +1 -1
- package/dist/client/assets/{domain-settings-DPbJEdjs.js → domain-settings-FZeIPnhT.js} +1 -1
- package/dist/client/assets/{drawer-Dijofbhl.js → drawer-CMTReHxa.js} +1 -1
- package/dist/client/assets/{editor-BODVgWYK.js → editor-C6CE2FNQ.js} +1 -1
- package/dist/client/assets/{editor-classes-BdpfcKyR.js → editor-classes-DbMPYB4Z.js} +1 -1
- package/dist/client/assets/{empty-state-Drt9QRbX.js → empty-state-DF9St1T6.js} +1 -1
- package/dist/client/assets/{empty-state-CwfRxt_B.js → empty-state-ovRL7NEK.js} +1 -1
- package/dist/client/assets/experiments-tab-choice-BXlwzycK.js +1 -0
- package/dist/client/assets/{extract-connection-data-Pe-Tip3g.js → extract-connection-data-Q1k0ncm3.js} +1 -1
- package/dist/client/assets/{feature-gate-2Z3FyCIy.js → feature-gate-DKF86Lcy.js} +1 -1
- package/dist/client/assets/{feature-paywall-CpM-erQe.js → feature-paywall-BoU9TII8.js} +1 -1
- package/dist/client/assets/{feedback-DcWPFhR_.js → feedback-f3MT17uD.js} +1 -1
- package/dist/client/assets/{file-explorer-xWdf34ip.js → file-explorer-DmvPCizi.js} +2 -2
- package/dist/client/assets/{file-preview-Ca_4k6rv.js → file-preview-aD0sVwV5.js} +1 -1
- package/dist/client/assets/{file-share-button-DgOCZ5mM.js → file-share-button-agT85qGG.js} +2 -2
- package/dist/client/assets/{file-type-icon-DiS0iV28.js → file-type-icon-CflTIvHJ.js} +1 -1
- package/dist/client/assets/{folder-icon-swAD3bQU.js → folder-icon-BKhbsJwX.js} +1 -1
- package/dist/client/assets/{form-CRja9i9j.js → form-B_3ZthF3.js} +1 -1
- package/dist/client/assets/{general-C7SfdAAF.js → general-BdjsCK2j.js} +1 -1
- package/dist/client/assets/{github-icon-tpEVyIwD.js → github-icon-M-2WiP3Y.js} +1 -1
- package/dist/client/assets/home-dTYjLEfm.js +1 -0
- package/dist/client/assets/{home-overview-CMI03yPH.js → home-overview-BAVfF6qS.js} +1 -1
- package/dist/client/assets/hosted-reconcile-B3o4dv7j.js +1 -0
- package/dist/client/assets/{icon-button-BZ9f2Pt9.js → icon-button-DQuPTgIB.js} +1 -1
- package/dist/client/assets/{index-Z8XjhDCo.js → index-0kopV6YP.js} +2 -2
- package/dist/client/assets/{index-68Cr2r1N.js → index-2bmOBUEF.js} +1 -1
- package/dist/client/assets/{index-LnWr599j.js → index-BM0DSfBG.js} +1 -1
- package/dist/client/assets/{index-Cvc22Qvh.js → index-BZX-7ipZ.js} +45 -45
- package/dist/client/assets/index-BlTJ0I-U.js +4 -0
- package/dist/client/assets/{index-C2wTYLQr.js → index-BvJNHE6H.js} +6 -6
- package/dist/client/assets/{index-CbuCRTrW.js → index-C2-s3ia2.js} +1 -1
- package/dist/client/assets/{index-CcZq_9Fb.js → index-C81DBcO6.js} +1 -1
- package/dist/client/assets/{index-BGom2FnM.js → index-Cjc_aSrk.js} +1 -1
- package/dist/client/assets/{index-Dw1u8oXT.js → index-D7Mi9FGh.js} +1 -1
- package/dist/client/assets/{index-Dt7ZIwRY.js → index-DHMhIfTt.js} +1 -1
- package/dist/client/assets/{index-D0G5dFqT.js → index-DT3lYd1R.js} +1 -1
- package/dist/client/assets/{index-CZXPJi4-.js → index-DzmcFP3y.js} +1 -1
- package/dist/client/assets/index-SmuiYnIl.css +1 -0
- package/dist/client/assets/{index-DQAtcq3Z.js → index-cmF_qGuq.js} +1 -1
- package/dist/client/assets/{index-BW7-bbk0.js → index-iezPx7cK.js} +1 -1
- package/dist/client/assets/index-mtR249ru.js +1 -0
- package/dist/client/assets/{index-redirect-PbFd_QHU.js → index-redirect-ay83YA5a.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CmujZk55.js → infiniteQueryObserver-CQGSlzKO.js} +1 -1
- package/dist/client/assets/{infra-billing-BlZrBUYP.js → infra-billing-DUjivW_p.js} +1 -1
- package/dist/client/assets/{input-D6ZRMHIB.js → input-3OyhKW_c.js} +1 -1
- package/dist/client/assets/input-CcFFY__7.js +17 -0
- package/dist/client/assets/{integration-icon-DMt85Vdd.js → integration-icon-Btk7lWbK.js} +1 -1
- package/dist/client/assets/{jira-icon-C0C7R9Uf.js → jira-icon-TeK8CaRV.js} +1 -1
- package/dist/client/assets/{label-RB5C5N6z.js → label-BGCn7A0y.js} +1 -1
- package/dist/client/assets/{layout-CBfnb3CZ.js → layout-XVKa9Y6f.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-zWqSTSjP.js → legacy-agents-deep-DksTbOzF.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BZlpoESe.js → legacy-main-redirect-8kA2UC85.js} +1 -1
- package/dist/client/assets/library-O1-Gs4qz.js +1 -0
- package/dist/client/assets/{library-tab-C7gKe5iN.js → library-tab-DJKD7rUC.js} +3 -3
- package/dist/client/assets/{login-D9zRzHBo.js → login-CH5yud2M.js} +1 -1
- package/dist/client/assets/{markdown-HhU9_nSI.js → markdown-B6eeRWQb.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DeLjk14w.js → mcp-app-renderer-DwuRGgZk.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DLwsgkOm.js → mcp-oauth-BvqIKSqR.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C-i6IZ7F.js → mcp-oauth-Bz1Lo9Pk.js} +1 -1
- package/dist/client/assets/{members-DocomT72.js → members-FYjquUkN.js} +1 -1
- package/dist/client/assets/{memory-BP3-K3oo.js → memory-CoUl94G3.js} +1 -1
- package/dist/client/assets/{mock-board-CoWf0eSd.js → mock-board-DvOE8ZQh.js} +4 -4
- package/dist/client/assets/{monaco-editor-oUmtqDLR.js → monaco-editor-vUgphdkE.js} +1 -1
- package/dist/client/assets/monitoring-UUQquQf7.js +2 -0
- package/dist/client/assets/{monitoring-stats-row-XSvwSWAi.js → monitoring-stats-row-BY92i-Bt.js} +1 -1
- package/dist/client/assets/{multi-select-CISJC82c.js → multi-select-9ieJQPsD.js} +1 -1
- package/dist/client/assets/mustache-CgF6ozKS.js +4 -0
- package/dist/client/assets/named-rule-view-CdhLqAy7.js +1 -0
- package/dist/client/assets/{new-project-dialog-BA0jmhgS.js → new-project-dialog-EK9WMEhp.js} +1 -1
- package/dist/client/assets/{oauth-callback-C1NevZMJ.js → oauth-callback-Cuv6PAYs.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BJwoy8qA.js → oauth-callback-ai-provider-BGc97raN.js} +1 -1
- package/dist/client/assets/{oauth-consent-BTT41r6l.js → oauth-consent-fGbsmdGY.js} +1 -1
- package/dist/client/assets/{onboarding-C2uIwwWY.js → onboarding-DF5AGUdi.js} +1 -1
- package/dist/client/assets/openai-conversation-CMIme_Ur.js +3 -0
- package/dist/client/assets/{optimistic-project-sidebar-views-BnUNFsLR.js → optimistic-project-sidebar-views-mQ0HUqGi.js} +1 -1
- package/dist/client/assets/{order-monitor-day-BzMajB7Y.js → order-monitor-day-BPx4Aihv.js} +1 -1
- package/dist/client/assets/{organization-choice-5ra3ZqkQ.js → organization-choice-KNGQur5O.js} +1 -1
- package/dist/client/assets/{orgs-ZeqGcjOU.js → orgs-C5Zlwg3I.js} +1 -1
- package/dist/client/assets/{own-accounts-section-Dd8ELrvu.js → own-accounts-section-C_F0-lzr.js} +1 -1
- package/dist/client/assets/{pair-Bx1LbJmC.js → pair-C5KKQk8r.js} +7 -7
- package/dist/client/assets/{parse-sections-BTDQNPKy.js → parse-sections-DE2O_vev.js} +7 -7
- package/dist/client/assets/{plan-bz8_rmrJ.js → plan-DdvgvWt2.js} +1 -1
- package/dist/client/assets/{plan-ladder-CZUMQESY.js → plan-ladder-BQ0gcfdF.js} +1 -1
- package/dist/client/assets/{plan-usage-card-SygAb3OS.js → plan-usage-card-8-3zMqsW.js} +2 -2
- package/dist/client/assets/{popover-D5YX99Kp.js → popover-CkuSZicN.js} +1 -1
- package/dist/client/assets/post-calendar-DVrcXuZq.js +1 -0
- package/dist/client/assets/{post-editor-BAf1z147.js → post-editor-CG6NXsGN.js} +2 -2
- package/dist/client/assets/{preview-content-TDEad-bh.js → preview-content-xRBU7B3O.js} +1 -1
- package/dist/client/assets/{preview-dialog-BkHpQdXG.js → preview-dialog-D36kXBk6.js} +1 -1
- package/dist/client/assets/{preview-panel-DduOnxXk.js → preview-panel-Cp7F1lqp.js} +1 -1
- package/dist/client/assets/preview-tab-Dn0RGnhj.js +551 -0
- package/dist/client/assets/{product-picker-dialog-DDkB9ByB.js → product-picker-dialog-C2KLekZA.js} +1 -1
- package/dist/client/assets/{profile-DHJVxDvo.js → profile-BfDfzRPA.js} +1 -1
- package/dist/client/assets/project-app-view-DVhAuH9N.js +1 -0
- package/dist/client/assets/project-apps-D47w7eJj.js +1 -0
- package/dist/client/assets/{project-icon-eZOGIGwj.js → project-icon-ofE-LDok.js} +1 -1
- package/dist/client/assets/{project-index-BSMjLbxc.js → project-index-PpuyCKHe.js} +1 -1
- package/dist/client/assets/project-reports-BuJS86vH.js +1 -0
- package/dist/client/assets/project-sidebar-views-Dew_3OKS.js +1 -0
- package/dist/client/assets/project-tasks-CZtVWSYo.js +1 -0
- package/dist/client/assets/{projects-D7HB1QKY.js → projects-Be7d593_.js} +1 -1
- package/dist/client/assets/{projects-empty-state-DBWek16Y.js → projects-empty-state-DpmH0sch.js} +1 -1
- package/dist/client/assets/{prompts-MMmII7eb.js → prompts-ClmMS_OK.js} +1 -1
- package/dist/client/assets/record-editor-OoLxSu9R.js +1 -0
- package/dist/client/assets/redirect-editor-W9B4A_h8.js +1 -0
- package/dist/client/assets/{reports-D0VzI1C_.js → reports-DCsJlho1.js} +1 -1
- package/dist/client/assets/{reports-onboarding-DonafHiF.js → reports-onboarding-CMTzWUTp.js} +1 -1
- package/dist/client/assets/reports-s2E9cwFc.js +1 -0
- package/dist/client/assets/{reports-tab-Wl9IyKm6.js → reports-tab-BKnG1JmX.js} +2 -2
- package/dist/client/assets/repositories-Dj2kaTIN.js +1 -0
- package/dist/client/assets/{repositories-9kTJbSW8.js → repositories-KlUH4dUR.js} +1 -1
- package/dist/client/assets/{repository-binding-B7A7NBUB.js → repository-binding-CqOunspI.js} +1 -1
- package/dist/client/assets/{repository-picker-CI7xSsin.js → repository-picker-DNdEQtlZ.js} +1 -1
- package/dist/client/assets/{require-capability-BTBUQsVM.js → require-capability-RYn3iksk.js} +1 -1
- package/dist/client/assets/{required-auth-layout-ClYF4eFR.js → required-auth-layout-Dfyc4Zas.js} +1 -1
- package/dist/client/assets/{reset-password-Ah3K7D-l.js → reset-password-CTGJ7V-t.js} +1 -1
- package/dist/client/assets/{resizable-DzzgKGKP.js → resizable-BCGqPRic.js} +1 -1
- package/dist/client/assets/resolve-tab-icon-BnqDq-fY.js +1 -0
- package/dist/client/assets/{review-settings-Fxdols3J.js → review-settings-DvoYyrmi.js} +1 -1
- package/dist/client/assets/{role-color-CEkb11P4.js → role-color-cUMHSMVi.js} +1 -1
- package/dist/client/assets/{roles-CqJ0hOtT.js → roles-x3B4vLKU.js} +1 -1
- package/dist/client/assets/route-PbputQp9.js +1 -0
- package/dist/client/assets/route-h-Fc_oVe.js +1 -0
- package/dist/client/assets/route-wINBwrny.js +1 -0
- package/dist/client/assets/sandbox-lifecycle-context-CXwLCWvJ.js +1 -0
- package/dist/client/assets/{schema-BH82js-o.js → schema-C1bLOk3P.js} +1 -1
- package/dist/client/assets/{schema-DHahXPsT.js → schema-DHLwjAWR.js} +1 -1
- package/dist/client/assets/{scroll-area-BN87AboJ.js → scroll-area-rELMi4e6.js} +1 -1
- package/dist/client/assets/{search-input-BBYghT-z.js → search-input-Crult1Qo.js} +1 -1
- package/dist/client/assets/{search-toggle-pLnMgrhP.js → search-toggle-DzMf9QP4.js} +1 -1
- package/dist/client/assets/{secret-picker-DWWFQJzg.js → secret-picker-CimF9dsx.js} +1 -1
- package/dist/client/assets/{secrets-CM4b3_qA.js → secrets-CZCnF6s4.js} +1 -1
- package/dist/client/assets/section-array-field-C3Tpx16b.js +1 -0
- package/dist/client/assets/{sections-CgO1w_IT.js → sections-346PcP2T.js} +1 -1
- package/dist/client/assets/sections-editor-DwV32_3f.js +1 -0
- package/dist/client/assets/{select-GzsOSPza.js → select-CwDmbwEv.js} +1 -1
- package/dist/client/assets/{select-model-BU2ssn1V.js → select-model-B1ocDBwF.js} +1 -1
- package/dist/client/assets/seo-editor-D1gGpMMF.js +1 -0
- package/dist/client/assets/{separator-CuwdHpjW.js → separator-C05SxAdn.js} +1 -1
- package/dist/client/assets/settings-tab-BImv5HgS.js +1 -0
- package/dist/client/assets/{sheet-BIQm-3An.js → sheet-BYgfxL9i.js} +1 -1
- package/dist/client/assets/{shell-layout-CH0j9rog.js → shell-layout-BvJfyzsq.js} +1 -1
- package/dist/client/assets/site-draft-actions-CgeV78uL.js +3 -0
- package/dist/client/assets/site-draft-view-Dkq2XweK.js +1 -0
- package/dist/client/assets/site-editor-B9ARkCiN.js +1 -0
- package/dist/client/assets/site-editor-toast-D83gMpdg.js +1 -0
- package/dist/client/assets/{skills-C71x-yhC.js → skills-OVV2oEwU.js} +1 -1
- package/dist/client/assets/{slider-BTgIuWj6.js → slider-Ipy9G5jv.js} +1 -1
- package/dist/client/assets/{sortable.esm-Dd1EVaQb.js → sortable.esm-DgwAq-fn.js} +1 -1
- package/dist/client/assets/{sso-BfwIPTh8.js → sso-C9cutlah.js} +1 -1
- package/dist/client/assets/{suggestion-CsEyXKDY.js → suggestion-Dwy6qysF.js} +1 -1
- package/dist/client/assets/{switch-BRZA_xq0.js → switch-BLkpF22m.js} +1 -1
- package/dist/client/assets/{synced-repos-Do7bESqI.js → synced-repos-orJHnVxs.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-BsVyyg_A.js → tab-icon-glyph-Co1M723I.js} +1 -1
- package/dist/client/assets/{table-DJd8n4EY.js → table-DPFxRA7S.js} +1 -1
- package/dist/client/assets/{tabs-D5AMuciq.js → tabs--wmPR0cZ.js} +1 -1
- package/dist/client/assets/{task-board-DN88kD7h.js → task-board-DJtwkz3O.js} +1 -1
- package/dist/client/assets/{task-route-4C0M-4XY.js → task-route-vCMrJPp9.js} +1 -1
- package/dist/client/assets/{task-status-B2JNuBbQ.js → task-status-msgu5x2s.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-D_AXxVNg.js → taskboard-analytics-5nxg7YXN.js} +1 -1
- package/dist/client/assets/{tasks-dMEgvkta.js → tasks-DpWVcTLT.js} +1 -1
- package/dist/client/assets/tasks-hbXv3hSd.js +1 -0
- package/dist/client/assets/{textarea-D7HQlMVo.js → textarea-D5OF_Tld.js} +1 -1
- package/dist/client/assets/{thread-analytics-BQjHh_yV.js → thread-analytics-CVsji2MZ.js} +1 -1
- package/dist/client/assets/{thread-intent-Bs-Q7fma.js → thread-intent-DIce2mks.js} +2 -2
- package/dist/client/assets/{thread-route-C-uX4C4C.js → thread-route-CGqDFJ1K.js} +1 -1
- package/dist/client/assets/{thread-route-B44higRI.js → thread-route-CP2TR6nw.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BNo76_XD.js → thread-sheet-body-Cba15kJF.js} +1 -1
- package/dist/client/assets/{time-range-picker-D4sglVBw.js → time-range-picker-OdWLHy9U.js} +1 -1
- package/dist/client/assets/{toggle-group-BBgjmF6C.js → toggle-group-DbLOGwe7.js} +1 -1
- package/dist/client/assets/{tool-namespace-l4eN7YZ5.js → tool-namespace-BQhkJpu9.js} +1 -1
- package/dist/client/assets/{tool-set-selector-Bi-Sw2KD.js → tool-set-selector-BmAnaEsw.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-nrUHQe-I.js → toolbar-icon-button-BzIcnxXk.js} +1 -1
- package/dist/client/assets/{tooltip-C0GWPsi8.js → tooltip--uPFG1gb.js} +1 -1
- package/dist/client/assets/{tooltipContext-DdEokZtY.js → tooltipContext-C8ArdkXW.js} +1 -1
- package/dist/client/assets/{track-29FVOdFL.js → track-Bb4064-s.js} +1 -1
- package/dist/client/assets/{types-DKuFfsqr.js → types-EjHtXl5u.js} +1 -1
- package/dist/client/assets/{url-slug-5t39ocbn.js → url-slug-rCJqhuIp.js} +1 -1
- package/dist/client/assets/{usage-stats-CHeI7dPd.js → usage-stats-DaOtdhEm.js} +2 -2
- package/dist/client/assets/{use-ai-providers-BbVlPdZd.js → use-ai-providers-C5rCFpU_.js} +1 -1
- package/dist/client/assets/{use-apply-named-rule-CnOcORn0.js → use-apply-named-rule-zZmpVvRd.js} +1 -1
- package/dist/client/assets/use-ask-in-chat-BaG9i0zc.js +1 -0
- package/dist/client/assets/{use-automations-BoyfX_H0.js → use-automations-CI7vvUzE.js} +1 -1
- package/dist/client/assets/{use-autosave-CZD-Fkyk.js → use-autosave-DUBcsRSH.js} +1 -1
- package/dist/client/assets/use-blocks-v8-project-CXrKL60y.js +1 -0
- package/dist/client/assets/{use-chat-layout-state-BC5WrKKn.js → use-chat-layout-state-CZaSk8YF.js} +1 -1
- package/dist/client/assets/{use-cms-publish-actions-BbDVRUuf.js → use-cms-publish-actions-BV2nwL3g.js} +5 -5
- package/dist/client/assets/{use-connect-companion-DEAJWvqA.js → use-connect-companion-DC6UOpxV.js} +1 -1
- package/dist/client/assets/{use-connection-Dqyf1wn8.js → use-connection-BEb786wf.js} +1 -1
- package/dist/client/assets/{use-content-sync-vr73v2b2.js → use-content-sync-CtHfpBJp.js} +1 -1
- package/dist/client/assets/{use-copy-BGfQrJIh.js → use-copy-DccRTYvG.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-C4jbLuwI.js → use-date-fns-locale-DD1YxYKP.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BrjHHNNB.js → use-debounced-autosave-clO2CzWE.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BF84eZeF.js → use-debounced-value-CJpdUTvG.js} +1 -1
- package/dist/client/assets/{use-deco-credits-MCc3vHir.js → use-deco-credits-DtE2LNZs.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-uSeDcfUe.js → use-decopilot-events-DxBT3zOC.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CLe-XFxn.js → use-delete-connection-COvFjvtJ.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-ShnoFTNr.js → use-deployment-admin-BSEuekHe.js} +1 -1
- package/dist/client/assets/{use-entitlements-wE65MYfi.js → use-entitlements-CWXMyUT0.js} +1 -1
- package/dist/client/assets/use-fast-preview-draft-url-BCmBxVQg.js +1 -0
- package/dist/client/assets/{use-file-configs-D9BR1kJU.js → use-file-configs-DsyBYIJw.js} +1 -1
- package/dist/client/assets/{use-id-selection-BcfcmGZl.js → use-id-selection-6CmUdc1s.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-EYADn16y.js → use-inbox-feed-okLCp4Pp.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Ds1Wd1cw.js → use-infinite-scroll-4e7tB3Vz.js} +1 -1
- package/dist/client/assets/{use-join-requests-CkWiAH0i.js → use-join-requests-muPMmn0O.js} +1 -1
- package/dist/client/assets/use-main-panel-tabs-BcP_qZl8.js +1 -0
- package/dist/client/assets/use-mcp-auth-status-D_TqnxnH.js +1 -0
- package/dist/client/assets/{use-mcp-client-BfCmeMHR.js → use-mcp-client-CrdyqnFt.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DoojBZhS.js → use-mcp-prompts-C3SHzM_d.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DwTtnjNb.js → use-mcp-tools-DQIJMlw-.js} +1 -1
- package/dist/client/assets/{use-mobile-C1stVK0E.js → use-mobile-BDWitdax.js} +1 -1
- package/dist/client/assets/use-move-blocks-B48xFUbp.js +1 -0
- package/dist/client/assets/{use-navigate-to-agent-D2d0cpFU.js → use-navigate-to-agent-C3sX18jI.js} +1 -1
- package/dist/client/assets/{use-org-fs-DHnEDbF9.js → use-org-fs-BRERSVus.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CcoLGdUP.js → use-org-repo-syncs-BFFdo3jR.js} +1 -1
- package/dist/client/assets/{use-org-sso-d82WgyRM.js → use-org-sso-BHDTii7j.js} +1 -1
- package/dist/client/assets/{use-organization-settings-a6mUKPHv.js → use-organization-settings-DPCrcu8e.js} +1 -1
- package/dist/client/assets/{use-project-scope-C0EKXyqg.js → use-project-scope-k7OaKjIm.js} +1 -1
- package/dist/client/assets/{use-recent-apps-DEMyNf2W.js → use-recent-apps-Buo9cWvj.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-rjeHGSYu.js → use-reports-diagnostic-B1lbI319.js} +1 -1
- package/dist/client/assets/use-sandbox-events-BRJYKM54.js +2 -0
- package/dist/client/assets/{use-secrets-CifnNbah.js → use-secrets-DlNiP0j4.js} +1 -1
- package/dist/client/assets/use-section-preview-base-CL9U3MEc.js +1 -0
- package/dist/client/assets/use-sidebar-collapsed-ByMTBVZc.js +1 -0
- package/dist/client/assets/{use-tags-CgXVAtG9.js → use-tags-CcJayzHf.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BTZNDNnK.js → use-task-board-analytics-0-6_3j_2.js} +1 -1
- package/dist/client/assets/{use-task-board-events-DCguN7A5.js → use-task-board-events-CzDIUBok.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-CnqmEndd.js → use-task-board-item-prs-DbHC-4Ry.js} +1 -1
- package/dist/client/assets/{use-task-board-items-BmpaMZkF.js → use-task-board-items-COxHF7_K.js} +1 -1
- package/dist/client/assets/{use-task-board-prompts-DdSO4gLi.js → use-task-board-prompts-CKi9j8wF.js} +1 -1
- package/dist/client/assets/{use-task-metadata-D3xqf4sH.js → use-task-metadata-BxcNhivS.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-D6sQTVJo.js → use-thread-outputs-lMVF4bT2.js} +1 -1
- package/dist/client/assets/use-voice-input-DsJxHyTh.js +1 -0
- package/dist/client/assets/useInfiniteQuery-B313haH3.js +1 -0
- package/dist/client/assets/{useQueries-BuMODvFG.js → useQueries-BO8pZ9q-.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-07GrICuv.js +1 -0
- package/dist/client/assets/{users-Ct3PwBMT.js → users-DCPPe9Uo.js} +1 -1
- package/dist/client/assets/{utils-DA49HMaO.js → utils-D0xixM8q.js} +3 -3
- package/dist/client/assets/{variant-calendar-CPtUMCAS.js → variant-calendar-C5r0ak32.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-DnlLYEoa.js → variant-matcher-override-QQd3tA7f.js} +1 -1
- package/dist/client/assets/{view-header-CAO18iqy.js → view-header-BPAnt0vh.js} +1 -1
- package/dist/client/assets/{virtual-mcp-C4mAz3N8.js → virtual-mcp-Dzr3mFmO.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-BI4P-Lkx.js → watch-sse-pool-j0K-nQ0i.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server.js +464 -464
- package/package.json +1 -1
- package/dist/client/assets/ReferenceLine-DEAQfOjW.js +0 -1
- package/dist/client/assets/agent-app-ZW_Vm-c7.js +0 -1
- package/dist/client/assets/agent-assets-kQe7VufN.js +0 -1
- package/dist/client/assets/agent-calendar-CbAiDaBT.js +0 -1
- package/dist/client/assets/agent-capabilities-DKq2l6j_.js +0 -1
- package/dist/client/assets/agent-deck-8VVMhl7J.js +0 -1
- package/dist/client/assets/agent-e2e-C9FJgu1a.js +0 -1
- package/dist/client/assets/agent-file-D5ZobkO7.js +0 -1
- package/dist/client/assets/agent-hosting-Df5G-pNf.js +0 -1
- package/dist/client/assets/agent-library-C_HTRhOS.js +0 -1
- package/dist/client/assets/agent-library-file-8gKy0Im-.js +0 -1
- package/dist/client/assets/agent-overview-CSsPaJjm.js +0 -1
- package/dist/client/assets/agent-releases-6IDVzk1I.js +0 -2
- package/dist/client/assets/agent-settings-uWS3yWiw.js +0 -1
- package/dist/client/assets/agent-site-editor-code-wtgSW_Bw.js +0 -2
- package/dist/client/assets/agent-site-editor-content-BC5jgNMj.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-Dd0H-yKP.js +0 -1
- package/dist/client/assets/agent-view-C4jCWfsN.js +0 -1
- package/dist/client/assets/api-keys-CmWPTVBS.js +0 -1
- package/dist/client/assets/app-editor-DQrUb2qq.js +0 -1
- package/dist/client/assets/blocks-tab-states-CNkB95lx.js +0 -1
- package/dist/client/assets/category-editor-DDFXYf_d.js +0 -1
- package/dist/client/assets/cms-settings-editor-CL1HXF3j.js +0 -1
- package/dist/client/assets/cms-store-drafts-C_ZG08jQ.js +0 -1
- package/dist/client/assets/context-2NK4t-Lg.js +0 -1
- package/dist/client/assets/device-hint-Djy4F7LR.js +0 -1
- package/dist/client/assets/home-DsrjQvGT.js +0 -1
- package/dist/client/assets/hosted-reconcile-BnVn2LVL.js +0 -1
- package/dist/client/assets/index-B8Pa92mK.js +0 -4
- package/dist/client/assets/index-D-DRzVEB.js +0 -2
- package/dist/client/assets/index-ug7KC70Z.css +0 -1
- package/dist/client/assets/input-C7_FCkgY.js +0 -17
- package/dist/client/assets/library-pMQg4GCR.js +0 -1
- package/dist/client/assets/monitoring-DKfNSCeR.js +0 -2
- package/dist/client/assets/mustache-D4zVU9iA.js +0 -4
- package/dist/client/assets/named-rule-view-BTwHmZ5L.js +0 -1
- package/dist/client/assets/openai-conversation-pUSF1vof.js +0 -3
- package/dist/client/assets/post-calendar-BIBU13NF.js +0 -1
- package/dist/client/assets/preview-tab-Cgfndmyh.js +0 -551
- package/dist/client/assets/project-app-view-BfcPf6du.js +0 -1
- package/dist/client/assets/project-apps-Bny6_T2A.js +0 -1
- package/dist/client/assets/project-reports-BzA8d8hO.js +0 -1
- package/dist/client/assets/project-sidebar-views-CrRbPbLq.js +0 -1
- package/dist/client/assets/project-tasks-BCE2SgoF.js +0 -1
- package/dist/client/assets/record-editor-DVouiUmR.js +0 -1
- package/dist/client/assets/redirect-editor-cm3-huyu.js +0 -1
- package/dist/client/assets/reports-BHAVwnBG.js +0 -1
- package/dist/client/assets/repositories-bPxFm30V.js +0 -1
- package/dist/client/assets/resolve-tab-icon-DMbVCUvi.js +0 -1
- package/dist/client/assets/route-BA7jjOjA.js +0 -1
- package/dist/client/assets/route-DGCMYgfH.js +0 -1
- package/dist/client/assets/route-DJbiUXJl.js +0 -1
- package/dist/client/assets/sandbox-lifecycle-context-WaQV2LhH.js +0 -1
- package/dist/client/assets/sections-editor-Uk83RbMN.js +0 -1
- package/dist/client/assets/seo-editor-dMXY0ofk.js +0 -1
- package/dist/client/assets/settings-tab-FvtSSyQC.js +0 -1
- package/dist/client/assets/site-draft-view-C74WkBDm.js +0 -3
- package/dist/client/assets/site-editor-CazX9Ijc.js +0 -1
- package/dist/client/assets/site-editor-toast-DrW9VMK5.js +0 -1
- package/dist/client/assets/tasks-BlrmxtrG.js +0 -1
- package/dist/client/assets/use-ask-in-chat-Cp_wqFIx.js +0 -1
- package/dist/client/assets/use-fast-preview-draft-url-BmUgrEyk.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-DTMcBtUc.js +0 -1
- package/dist/client/assets/use-mcp-auth-status-DhFx8XVQ.js +0 -1
- package/dist/client/assets/use-move-blocks-Bclcq-Qe.js +0 -1
- package/dist/client/assets/use-section-preview-base-SkN8HQaB.js +0 -1
- package/dist/client/assets/use-sidebar-collapsed-DwcGl0-e.js +0 -1
- package/dist/client/assets/useInfiniteQuery-P9--kf7E.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-C2ZhOGvp.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as $,b as j,r as E,j as x,m as q,bx as At,t as ue,b2 as Je,a5 as Mt,hb as St,i as Ct,K as Rt,bQ as Et,h as Ye,o as $t}from"./index-Cvc22Qvh.js";import{a as _t,n as et,E as ie,o as Lt,x as It,y as P,z as zt,A as Pt,B as tt,C as N,G as Ee,H as Ht,I as jt,J as $e,K as Nt,L as V,N as D,m as H,O as Y,T as nt,R as ke,Q as xe,U as Ot,V as Bt,W as Dt,X as Ft,Y as qt,s as Wt,Z as Ut,u as Gt,b as Zt}from"./usage-stats-CHeI7dPd.js";import{T as _,n as Vt,i as Kt,E as Qt}from"./editor-classes-BdpfcKyR.js";import{a as Xt,e as rt,s as Jt,S as Yt}from"./suggestion-CsEyXKDY.js";import{B as en,c as tn,t as nn,C as st,f as rn,g as _e,s as sn,m as Le,a as Ie,b as an,d as ze,e as on,h as ln,i as cn,j as un,k as hn,l as dn,n as pn}from"./index-CcZq_9Fb.js";import{aJ as fn,ae as gn,af as mn,ah as kn,X as xn,bl as bn,aY as wn}from"./agent-icon-DD6O0sln.js";import{i as yn}from"./SwitchHorizontal01-Dghq_Bvd.js";import{s as Tn}from"./Trash01-DhMVlpac.js";import{k as vn,a as An}from"./use-org-fs-DHnEDbF9.js";import{E as Pe,i as it,b as Mn,c as Sn,d as at,A as Cn,e as Rn,m as En,f as $n,g as _n}from"./markdown-HhU9_nSI.js";import{f as Ln,a as In,c as zn,C as Pn,b as He}from"./command-B42vqDSm.js";import{I as Hn}from"./icon-button-BZ9f2Pt9.js";function jn(t){const e=$.c(30),{editor:n}=t,r=j(),[s,i]=E.useState(!1),[a,l]=E.useState(""),[o,u]=E.useState(!1);let c;e[0]!==n?(c=n.isActive("link"),e[0]=n,e[1]=c):c=e[1];const h=c;let d;e[2]!==n||e[3]!==s?(d=()=>{if(s){i(!1);return}const A=n.getAttributes("link").href;l(typeof A=="string"?A:""),u(!1),i(!0)},e[2]=n,e[3]=s,e[4]=d):d=e[4];const f=d;let p;e[5]!==n?(p=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[5]=n,e[6]=p):p=e[6];const g=p;let m;e[7]!==a||e[8]!==n||e[9]!==g?(m=()=>{const A=Vt(a);if(A===""){g();return}if(!Kt(A)){u(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:A}).run(),i(!1)},e[7]=a,e[8]=n,e[9]=g,e[10]=m):m=e[10];const k=m;let y;e[11]!==r?(y=r("markdownEditor.link"),e[11]=r,e[12]=y):y=e[12];let T;e[13]===Symbol.for("react.memo_cache_sentinel")?(T=x.jsx(fn,{size:14}),e[13]=T):T=e[13];let v;e[14]!==h||e[15]!==y||e[16]!==f?(v=x.jsx(_,{active:h,label:y,onClick:f,children:T}),e[14]=h,e[15]=y,e[16]=f,e[17]=v):v=e[17];let b;e[18]!==h||e[19]!==k||e[20]!==a||e[21]!==n||e[22]!==o||e[23]!==s||e[24]!==g||e[25]!==r?(b=s&&x.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md bg-popover p-1 shadow-soft",onBlur:A=>{A.currentTarget.contains(A.relatedTarget)||i(!1)},children:[x.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:r("markdownEditor.linkPlaceholder"),value:a,onChange:A=>{l(A.target.value),u(!1)},onKeyDown:A=>{A.key==="Enter"?(A.preventDefault(),k()):A.key==="Escape"&&(A.preventDefault(),i(!1),n.chain().focus().run())},className:q("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",o&&"text-destructive")}),x.jsx(_,{active:!1,label:r("markdownEditor.linkApply"),onClick:k,children:x.jsx(At,{size:14})}),h&&x.jsx(_,{active:!1,label:r("markdownEditor.linkRemove"),onClick:g,children:x.jsx(Tn,{size:14})})]}),e[18]=h,e[19]=k,e[20]=a,e[21]=n,e[22]=o,e[23]=s,e[24]=g,e[25]=r,e[26]=b):b=e[26];let w;return e[27]!==v||e[28]!==b?(w=x.jsxs("div",{className:"relative",children:[v,b]}),e[27]=v,e[28]=b,e[29]=w):w=e[29],w}const le=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},je=t=>{const e=$.c(2),{children:n}=t;let r;return e[0]!==n?(r=x.jsx("span",{className:"text-2xs font-semibold leading-none",children:n}),e[0]=n,e[1]=r):r=e[1],r},ot=[1,2,3],Nn=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function On(t){const e=$.c(20),{editor:n}=t,r=j(),[s,i]=E.useState(null);let a;e[0]!==n?(a={editor:n,selector:Bn},e[0]=n,e[1]=a):a=e[1];const l=_t(a);let o;e[2]!==r?(o=r("markdownEditor.heading1"),e[2]=r,e[3]=o):o=e[3];let u;e[4]!==r?(u=r("markdownEditor.heading2"),e[4]=r,e[5]=u):u=e[5];let c;e[6]!==r?(c=r("markdownEditor.heading3"),e[6]=r,e[7]=c):c=e[7];let h;e[8]!==o||e[9]!==u||e[10]!==c?(h={1:o,2:u,3:c},e[8]=o,e[9]=u,e[10]=c,e[11]=h):h=e[11];const d=h;let f;e[12]!==n||e[13]!==d||e[14]!==s||e[15]!==l||e[16]!==r?(f=s&&x.jsxs(en,{editor:n,shouldShow:Nn,appendTo:s,className:"flex items-center gap-0.5 rounded-lg bg-popover p-1 shadow-soft","aria-label":r("markdownEditor.toolbarAriaLabel"),children:[x.jsx(_,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:x.jsx(gn,{size:14})}),x.jsx(_,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:x.jsx(mn,{size:14})}),x.jsx(_,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:x.jsx(kn,{size:14})}),x.jsx(_,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:x.jsx(xn,{size:14})}),x.jsx(le,{}),ot.map((g,m)=>x.jsx(_,{active:l.headings[m]??!1,label:d[g],onClick:()=>n.chain().focus().toggleHeading({level:g}).run(),children:x.jsx(je,{children:`H${g}`})},g)),x.jsx(le,{}),x.jsx(_,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:x.jsx(yn,{size:14})}),x.jsx(_,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:x.jsx(je,{children:"1."})}),x.jsx(_,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:x.jsx(bn,{size:14})}),x.jsx(le,{}),x.jsx(jn,{editor:n})]}),e[12]=n,e[13]=d,e[14]=s,e[15]=l,e[16]=r,e[17]=f):f=e[17];let p;return e[18]!==f?(p=x.jsx("div",{ref:i,className:"relative z-20",children:f}),e[18]=f,e[19]=p):p=e[19],p}function Bn(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:ot.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const Dn=10,Fn=25,qn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function Wn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??qn[t.type]??""}function Un(){const t=$.c(4),e=j(),{upload:n}=vn(Pe),r=An(Pe);let s;return t[0]!==r||t[1]!==e||t[2]!==n?(s={uploadFile:async a=>{const l=it(a),o=l?Dn:Fn;if(a.size>o*1024*1024)return ue.error(e("markdownEditor.fileTooLarge",{name:a.name,max:String(o)})),null;const u=l?Mn:Sn,c=`${crypto.randomUUID()}${Wn(a)}`;try{return await n.mutateAsync({dir:u,files:[new File([a],c,{type:a.type})]}),r(`${u}/${c}`)}catch{return ue.error(e("markdownEditor.uploadFailed",{name:a.name})),null}}},t[0]=r,t[1]=e,t[2]=n,t[3]=s):s=t[3],s}const ee=new et("uploadSlots"),Gn=ie.create({name:"uploadSlots",addProseMirrorPlugins(){return[new Lt({key:ee,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(ee);if(!t.docChanged&&!n)return e;const r=new Map;for(const[s,i]of e)r.set(s,t.mapping.map(i));if(n){const[s,i]=n;i===null?r.delete(s):r.set(s,i)}return r}}})]}});function he(t,e,n){return t.setMeta(ee,[e,n])}function Zn(t,e){return ee.getState(t)?.get(e)}function Vn(t,e,n,r,s){const{schema:i}=t.state,a=i.nodes[n];if(!a)return;const l=a.create(r),o=t.state.selection.to===e,u=t.state.doc.resolve(e),c=u.parent.textBetween(Math.max(0,u.parentOffset-1),u.parentOffset,void 0,""),h=()=>i.text(" "),d=l.isInline?[...c&&!/\s/.test(c)?[h()]:[],l,h()]:l,f=t.state.tr.replaceWith(e,e,d);let p=e,g=e;f.mapping.maps.at(-1)?.forEach((v,b,w,A)=>{p=w,g=A});let m;f.doc.nodesBetween(p,g,(v,b)=>{v===l&&(m=b+v.nodeSize)});let k=m??g;m!==void 0&&l.isInline&&(k+=1);const y=i.nodes.paragraph;m!==void 0&&l.isBlock&&y&&(f.doc.resolve(m).nodeAfter?.isTextblock||f.insert(m,y.create()),k=m+1);const T=It.near(f.doc.resolve(k));o&&f.setSelection(T),s&&he(f,s,T.to),t.dispatch(f)}function Kn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function Qn(t=!0){const e=j(),{uploadFile:n}=Un(),r=E.useRef(n);r.current=n;const[s,i]=E.useState(0),a=E.useRef(0),l=h=>{a.current+=h,i(a.current)},o=(h,d,f)=>{if(!t||d.length===0)return!1;l(d.length);const p=Symbol("upload");return h.dispatch(he(h.state.tr,p,f)),(async()=>{for(const g of d)try{const m=await r.current(g);if(!m||h.isDestroyed)continue;const k=it(g);Vn(h,Zn(h.state,p)??h.state.selection.to,k?"image":"attachment",k?{src:m,alt:g.name}:{href:m,name:g.name},p)}catch{ue.error(e("markdownEditor.uploadFailed",{name:g.name}))}finally{l(-1)}h.isDestroyed||h.dispatch(he(h.state.tr,p,null))})(),!0};return{pending:s,uploading:()=>a.current>0,uploadInto:o,handlePaste:(h,d)=>{const f=Kn(d.clipboardData);return f.length===0?!1:(d.stopPropagation(),o(h,f,h.state.selection.to))},handleDrop:(h,d,f,p)=>{if(p)return!1;const g=Array.from(d.dataTransfer?.files??[]);if(g.length===0)return!1;const m=h.posAtCoords({left:d.clientX,top:d.clientY})?.pos;return m===void 0?!1:(d.stopPropagation(),o(h,g,m))}}}function be(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var F=be();function lt(t){F=t}var O={exec:()=>null};function M(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(R.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,e)};return r}var Xn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Jn=/^(?:[ \t]*(?:\n|$))+/,Yn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,er=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,K=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,we=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ct=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ut=M(ct).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nr=M(ct).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ye=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rr=/^[^\n]+/,Te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sr=M(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ir=M(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,we).getRegex(),ae="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ve=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ar=M("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ve).replace("tag",ae).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ht=M(ye).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),or=M(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ht).getRegex(),Ae={blockquote:or,code:Yn,def:sr,fences:er,heading:tr,hr:K,html:ar,lheading:ut,list:ir,newline:Jn,paragraph:ht,table:O,text:rr},Ne=M("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),lr={...Ae,lheading:nr,table:Ne,paragraph:M(ye).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ne).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex()},cr={...Ae,html:M(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:O,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:M(ye).replace("hr",K).replace("heading",` *#{1,6} *[^
|
|
1
|
+
import{c as $,b as j,r as E,j as x,m as q,bx as At,t as ue,b2 as Ye,a5 as Mt,hb as St,i as Ct,K as Rt,bQ as Et,h as Je,o as $t}from"./index-BZX-7ipZ.js";import{a as _t,n as et,E as ie,o as Lt,x as It,y as P,z as zt,A as Pt,B as tt,C as N,G as Ee,H as Ht,I as jt,J as $e,K as Nt,L as V,N as D,m as H,O as J,T as nt,R as ke,Q as xe,U as Ot,V as Bt,W as Dt,X as Ft,Y as qt,s as Wt,Z as Ut,u as Gt,b as Zt}from"./usage-stats-DaOtdhEm.js";import{T as _,n as Vt,i as Kt,E as Qt}from"./editor-classes-DbMPYB4Z.js";import{a as Xt,e as rt,s as Yt,S as Jt}from"./suggestion-Dwy6qysF.js";import{B as en,c as tn,t as nn,C as st,f as rn,g as _e,s as sn,m as Le,a as Ie,b as an,d as ze,e as on,h as ln,i as cn,j as un,k as hn,l as dn,n as pn}from"./index-C81DBcO6.js";import{aU as fn,af as gn,ag as mn,ai as kn,Y as xn,bm as bn,aZ as wn}from"./agent-icon-U2nlXoBG.js";import{i as yn}from"./SwitchHorizontal01-Czrqzt6f.js";import{s as Tn}from"./Trash01-BxSWir9J.js";import{k as vn,a as An}from"./use-org-fs-BRERSVus.js";import{E as Pe,i as it,b as Mn,c as Sn,d as at,A as Cn,e as Rn,m as En,f as $n,g as _n}from"./markdown-B6eeRWQb.js";import{f as Ln,a as In,c as zn,C as Pn,b as He}from"./command-DiccrIM8.js";import{I as Hn}from"./icon-button-DQuPTgIB.js";function jn(t){const e=$.c(30),{editor:n}=t,r=j(),[s,i]=E.useState(!1),[a,l]=E.useState(""),[o,u]=E.useState(!1);let c;e[0]!==n?(c=n.isActive("link"),e[0]=n,e[1]=c):c=e[1];const h=c;let d;e[2]!==n||e[3]!==s?(d=()=>{if(s){i(!1);return}const A=n.getAttributes("link").href;l(typeof A=="string"?A:""),u(!1),i(!0)},e[2]=n,e[3]=s,e[4]=d):d=e[4];const f=d;let p;e[5]!==n?(p=()=>{n.chain().focus().extendMarkRange("link").unsetLink().run(),i(!1)},e[5]=n,e[6]=p):p=e[6];const g=p;let m;e[7]!==a||e[8]!==n||e[9]!==g?(m=()=>{const A=Vt(a);if(A===""){g();return}if(!Kt(A)){u(!0);return}n.chain().focus().extendMarkRange("link").setLink({href:A}).run(),i(!1)},e[7]=a,e[8]=n,e[9]=g,e[10]=m):m=e[10];const k=m;let y;e[11]!==r?(y=r("markdownEditor.link"),e[11]=r,e[12]=y):y=e[12];let T;e[13]===Symbol.for("react.memo_cache_sentinel")?(T=x.jsx(fn,{size:14}),e[13]=T):T=e[13];let v;e[14]!==h||e[15]!==y||e[16]!==f?(v=x.jsx(_,{active:h,label:y,onClick:f,children:T}),e[14]=h,e[15]=y,e[16]=f,e[17]=v):v=e[17];let b;e[18]!==h||e[19]!==k||e[20]!==a||e[21]!==n||e[22]!==o||e[23]!==s||e[24]!==g||e[25]!==r?(b=s&&x.jsxs("div",{className:"absolute left-0 top-full z-20 mt-1.5 flex w-64 items-center gap-0.5 rounded-md bg-popover p-1 shadow-soft",onBlur:A=>{A.currentTarget.contains(A.relatedTarget)||i(!1)},children:[x.jsx("input",{autoFocus:!0,type:"text","aria-label":r("markdownEditor.linkInputAriaLabel"),"aria-invalid":o,placeholder:r("markdownEditor.linkPlaceholder"),value:a,onChange:A=>{l(A.target.value),u(!1)},onKeyDown:A=>{A.key==="Enter"?(A.preventDefault(),k()):A.key==="Escape"&&(A.preventDefault(),i(!1),n.chain().focus().run())},className:q("h-7 min-w-0 flex-1 rounded bg-transparent px-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none",o&&"text-destructive")}),x.jsx(_,{active:!1,label:r("markdownEditor.linkApply"),onClick:k,children:x.jsx(At,{size:14})}),h&&x.jsx(_,{active:!1,label:r("markdownEditor.linkRemove"),onClick:g,children:x.jsx(Tn,{size:14})})]}),e[18]=h,e[19]=k,e[20]=a,e[21]=n,e[22]=o,e[23]=s,e[24]=g,e[25]=r,e[26]=b):b=e[26];let w;return e[27]!==v||e[28]!==b?(w=x.jsxs("div",{className:"relative",children:[v,b]}),e[27]=v,e[28]=b,e[29]=w):w=e[29],w}const le=()=>{const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=x.jsx("div",{className:"mx-0.5 h-4 w-px bg-border"}),t[0]=e):e=t[0],e},je=t=>{const e=$.c(2),{children:n}=t;let r;return e[0]!==n?(r=x.jsx("span",{className:"text-2xs font-semibold leading-none",children:n}),e[0]=n,e[1]=r):r=e[1],r},ot=[1,2,3],Nn=({editor:t,state:e})=>t.isEditable&&!e.selection.empty&&!t.isActive("image")&&!t.isActive("attachment")&&!t.isActive("codeBlock");function On(t){const e=$.c(20),{editor:n}=t,r=j(),[s,i]=E.useState(null);let a;e[0]!==n?(a={editor:n,selector:Bn},e[0]=n,e[1]=a):a=e[1];const l=_t(a);let o;e[2]!==r?(o=r("markdownEditor.heading1"),e[2]=r,e[3]=o):o=e[3];let u;e[4]!==r?(u=r("markdownEditor.heading2"),e[4]=r,e[5]=u):u=e[5];let c;e[6]!==r?(c=r("markdownEditor.heading3"),e[6]=r,e[7]=c):c=e[7];let h;e[8]!==o||e[9]!==u||e[10]!==c?(h={1:o,2:u,3:c},e[8]=o,e[9]=u,e[10]=c,e[11]=h):h=e[11];const d=h;let f;e[12]!==n||e[13]!==d||e[14]!==s||e[15]!==l||e[16]!==r?(f=s&&x.jsxs(en,{editor:n,shouldShow:Nn,appendTo:s,className:"flex items-center gap-0.5 rounded-lg bg-popover p-1 shadow-soft","aria-label":r("markdownEditor.toolbarAriaLabel"),children:[x.jsx(_,{active:l.bold,label:r("markdownEditor.bold"),onClick:()=>n.chain().focus().toggleBold().run(),children:x.jsx(gn,{size:14})}),x.jsx(_,{active:l.italic,label:r("markdownEditor.italic"),onClick:()=>n.chain().focus().toggleItalic().run(),children:x.jsx(mn,{size:14})}),x.jsx(_,{active:l.strike,label:r("markdownEditor.strikethrough"),onClick:()=>n.chain().focus().toggleStrike().run(),children:x.jsx(kn,{size:14})}),x.jsx(_,{active:l.code,label:r("markdownEditor.code"),onClick:()=>n.chain().focus().toggleCode().run(),children:x.jsx(xn,{size:14})}),x.jsx(le,{}),ot.map((g,m)=>x.jsx(_,{active:l.headings[m]??!1,label:d[g],onClick:()=>n.chain().focus().toggleHeading({level:g}).run(),children:x.jsx(je,{children:`H${g}`})},g)),x.jsx(le,{}),x.jsx(_,{active:l.bulletList,label:r("markdownEditor.bulletList"),onClick:()=>n.chain().focus().toggleBulletList().run(),children:x.jsx(yn,{size:14})}),x.jsx(_,{active:l.orderedList,label:r("markdownEditor.orderedList"),onClick:()=>n.chain().focus().toggleOrderedList().run(),children:x.jsx(je,{children:"1."})}),x.jsx(_,{active:l.blockquote,label:r("markdownEditor.quote"),onClick:()=>n.chain().focus().toggleBlockquote().run(),children:x.jsx(bn,{size:14})}),x.jsx(le,{}),x.jsx(jn,{editor:n})]}),e[12]=n,e[13]=d,e[14]=s,e[15]=l,e[16]=r,e[17]=f):f=e[17];let p;return e[18]!==f?(p=x.jsx("div",{ref:i,className:"relative z-20",children:f}),e[18]=f,e[19]=p):p=e[19],p}function Bn(t){const{editor:e}=t;return{bold:e.isActive("bold"),italic:e.isActive("italic"),strike:e.isActive("strike"),code:e.isActive("code"),headings:ot.map(n=>e.isActive("heading",{level:n})),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote")}}const Dn=10,Fn=25,qn={"image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"};function Wn(t){return t.name.match(/\.[a-z0-9]{1,8}$/i)?.[0]??qn[t.type]??""}function Un(){const t=$.c(4),e=j(),{upload:n}=vn(Pe),r=An(Pe);let s;return t[0]!==r||t[1]!==e||t[2]!==n?(s={uploadFile:async a=>{const l=it(a),o=l?Dn:Fn;if(a.size>o*1024*1024)return ue.error(e("markdownEditor.fileTooLarge",{name:a.name,max:String(o)})),null;const u=l?Mn:Sn,c=`${crypto.randomUUID()}${Wn(a)}`;try{return await n.mutateAsync({dir:u,files:[new File([a],c,{type:a.type})]}),r(`${u}/${c}`)}catch{return ue.error(e("markdownEditor.uploadFailed",{name:a.name})),null}}},t[0]=r,t[1]=e,t[2]=n,t[3]=s):s=t[3],s}const ee=new et("uploadSlots"),Gn=ie.create({name:"uploadSlots",addProseMirrorPlugins(){return[new Lt({key:ee,state:{init:()=>new Map,apply(t,e){const n=t.getMeta(ee);if(!t.docChanged&&!n)return e;const r=new Map;for(const[s,i]of e)r.set(s,t.mapping.map(i));if(n){const[s,i]=n;i===null?r.delete(s):r.set(s,i)}return r}}})]}});function he(t,e,n){return t.setMeta(ee,[e,n])}function Zn(t,e){return ee.getState(t)?.get(e)}function Vn(t,e,n,r,s){const{schema:i}=t.state,a=i.nodes[n];if(!a)return;const l=a.create(r),o=t.state.selection.to===e,u=t.state.doc.resolve(e),c=u.parent.textBetween(Math.max(0,u.parentOffset-1),u.parentOffset,void 0,""),h=()=>i.text(" "),d=l.isInline?[...c&&!/\s/.test(c)?[h()]:[],l,h()]:l,f=t.state.tr.replaceWith(e,e,d);let p=e,g=e;f.mapping.maps.at(-1)?.forEach((v,b,w,A)=>{p=w,g=A});let m;f.doc.nodesBetween(p,g,(v,b)=>{v===l&&(m=b+v.nodeSize)});let k=m??g;m!==void 0&&l.isInline&&(k+=1);const y=i.nodes.paragraph;m!==void 0&&l.isBlock&&y&&(f.doc.resolve(m).nodeAfter?.isTextblock||f.insert(m,y.create()),k=m+1);const T=It.near(f.doc.resolve(k));o&&f.setSelection(T),s&&he(f,s,T.to),t.dispatch(f)}function Kn(t){return!t||t.files.length===0?[]:t.getData("text/html")!==""&&t.getData("text/plain").trim()!==""?[]:Array.from(t.files)}function Qn(t=!0){const e=j(),{uploadFile:n}=Un(),r=E.useRef(n);r.current=n;const[s,i]=E.useState(0),a=E.useRef(0),l=h=>{a.current+=h,i(a.current)},o=(h,d,f)=>{if(!t||d.length===0)return!1;l(d.length);const p=Symbol("upload");return h.dispatch(he(h.state.tr,p,f)),(async()=>{for(const g of d)try{const m=await r.current(g);if(!m||h.isDestroyed)continue;const k=it(g);Vn(h,Zn(h.state,p)??h.state.selection.to,k?"image":"attachment",k?{src:m,alt:g.name}:{href:m,name:g.name},p)}catch{ue.error(e("markdownEditor.uploadFailed",{name:g.name}))}finally{l(-1)}h.isDestroyed||h.dispatch(he(h.state.tr,p,null))})(),!0};return{pending:s,uploading:()=>a.current>0,uploadInto:o,handlePaste:(h,d)=>{const f=Kn(d.clipboardData);return f.length===0?!1:(d.stopPropagation(),o(h,f,h.state.selection.to))},handleDrop:(h,d,f,p)=>{if(p)return!1;const g=Array.from(d.dataTransfer?.files??[]);if(g.length===0)return!1;const m=h.posAtCoords({left:d.clientX,top:d.clientY})?.pos;return m===void 0?!1:(d.stopPropagation(),o(h,g,m))}}}function be(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var F=be();function lt(t){F=t}var O={exec:()=>null};function M(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(R.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,e)};return r}var Xn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},Yn=/^(?:[ \t]*(?:\n|$))+/,Jn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,er=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,K=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,we=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ct=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ut=M(ct).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nr=M(ct).replace(/bull/g,we).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ye=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rr=/^[^\n]+/,Te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sr=M(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ir=M(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,we).getRegex(),ae="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ve=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ar=M("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ve).replace("tag",ae).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ht=M(ye).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),or=M(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ht).getRegex(),Ae={blockquote:or,code:Jn,def:sr,fences:er,heading:tr,hr:K,html:ar,lheading:ut,list:ir,newline:Yn,paragraph:ht,table:O,text:rr},Ne=M("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex(),lr={...Ae,lheading:nr,table:Ne,paragraph:M(ye).replace("hr",K).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ne).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ae).getRegex()},cr={...Ae,html:M(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:O,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:M(ye).replace("hr",K).replace("heading",` *#{1,6} *[^
|
|
2
2
|
]`).replace("lheading",ut).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ur=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,dt=/^( {2,}|\\)\n(?!\s*$)/,dr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,W=/[\p{P}\p{S}]/u,oe=/[\s\p{P}\p{S}]/u,Me=/[^\s\p{P}\p{S}]/u,pr=M(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,oe).getRegex(),pt=/(?!~)[\p{P}\p{S}]/u,fr=/(?!~)[\s\p{P}\p{S}]/u,gr=/(?:[^\s\p{P}\p{S}]|~)/u,mr=M(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Xn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ft=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,kr=M(ft,"u").replace(/punct/g,W).getRegex(),xr=M(ft,"u").replace(/punct/g,pt).getRegex(),gt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",br=M(gt,"gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,W).getRegex(),wr=M(gt,"gu").replace(/notPunctSpace/g,gr).replace(/punctSpace/g,fr).replace(/punct/g,pt).getRegex(),yr=M("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,W).getRegex(),Tr=M(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,W).getRegex(),vr="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ar=M(vr,"gu").replace(/notPunctSpace/g,Me).replace(/punctSpace/g,oe).replace(/punct/g,W).getRegex(),Mr=M(/\\(punct)/,"gu").replace(/punct/g,W).getRegex(),Sr=M(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Cr=M(ve).replace("(?:-->|$)","-->").getRegex(),Rr=M("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Cr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),te=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Er=M(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",te).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),mt=M(/^!?\[(label)\]\[(ref)\]/).replace("label",te).replace("ref",Te).getRegex(),kt=M(/^!?\[(ref)\](?:\[\])?/).replace("ref",Te).getRegex(),$r=M("reflink|nolink(?!\\()","g").replace("reflink",mt).replace("nolink",kt).getRegex(),Oe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Se={_backpedal:O,anyPunctuation:Mr,autolink:Sr,blockSkip:mr,br:dt,code:hr,del:O,delLDelim:O,delRDelim:O,emStrongLDelim:kr,emStrongRDelimAst:br,emStrongRDelimUnd:yr,escape:ur,link:Er,nolink:kt,punctuation:pr,reflink:mt,reflinkSearch:$r,tag:Rr,text:dr,url:O},_r={...Se,link:M(/^!?\[(label)\]\((.*?)\)/).replace("label",te).getRegex(),reflink:M(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te).getRegex()},de={...Se,emStrongRDelimAst:wr,emStrongLDelim:xr,delLDelim:Tr,delRDelim:Ar,url:M(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Oe).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:M(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Oe).getRegex()},Lr={...de,br:M(dt).replace("{2,}","*").getRegex(),text:M(de.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Q={normal:Ae,gfm:lr,pedantic:cr},U={normal:Se,gfm:de,breaks:Lr,pedantic:_r},Ir={"&":"&","<":"<",">":">",'"':""","'":"'"},Be=t=>Ir[t];function z(t,e){if(e){if(R.escapeTest.test(t))return t.replace(R.escapeReplace,Be)}else if(R.escapeTestNoEncode.test(t))return t.replace(R.escapeReplaceNoEncode,Be);return t}function De(t){try{t=encodeURI(t).replace(R.percentDecode,"%")}catch{return null}return t}function Fe(t,e){let n=t.replace(R.findPipe,(i,a,l)=>{let o=!1,u=a;for(;--u>=0&&l[u]==="\\";)o=!o;return o?"|":" |"}),r=n.split(R.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(R.slashPipe,"|");return r}function G(t,e,n){let r=t.length;if(r===0)return"";let s=0;for(;s<r&&t.charAt(r-s-1)===e;)s++;return t.slice(0,r-s)}function zr(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function Pr(t,e=0){let n=e,r="";for(let s of t)if(s===" "){let i=4-n%4;r+=" ".repeat(i),n+=i}else r+=s,n++;return r}function qe(t,e,n,r,s){let i=e.href,a=e.title||null,l=t[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let o={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,o}function Hr(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
|
|
3
3
|
`).map(i=>{let a=i.match(n.other.beginningSpace);if(a===null)return i;let[l]=a;return l.length>=s.length?i.slice(s.length):i}).join(`
|
|
4
4
|
`)}var ne=class{options;rules;lexer;constructor(t){this.options=t||F}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:G(n,`
|
|
@@ -63,10 +63,10 @@ Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error
|
|
|
63
63
|
`),g=p[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),m=g?g[2]:"";let k=[];if(p.length>1&&p.slice(1).join(`
|
|
64
64
|
`).trim()){const y=p.slice(1),T=y.filter(v=>v.trim());if(T.length>0){const v=Math.min(...T.map(w=>w.length-w.trimStart().length)),b=y.map(w=>w.trim()?w.slice(v):"").join(`
|
|
65
65
|
`).trim();b&&(k=this.markedInstance.lexer(`${b}
|
|
66
|
-
`))}}d={type:"taskItem",raw:"",mainContent:m,indentLevel:h,checked:c??!1,text:m,tokens:this.tokenizeInline(m),nestedTokens:k}}const f=u?"taskList":"list";i!==f?(s.length>0&&r.push({type:i,items:s}),s=[d],i=f):s.push(d)}s.length>0&&r.push({type:i,items:s});const a=[];for(let l=0;l<r.length;l+=1){const o=r[l],u={...t,type:o.type,items:o.items},c=this.parseToken(u);c&&(Array.isArray(c)?a.push(...c):a.push(c))}return a.length>0?a:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(e.find(r=>{if(!r.parseMarkdown)return!1;const s=r.parseMarkdown(t,n),i=this.normalizeParseResult(s);return i&&(!Array.isArray(i)||i.length>0)?(this.lastParseResult=i,!0):!1})&&this.lastParseResult){const r=this.lastParseResult;return this.lastParseResult=null,r}return this.parseFallbackToken(t)}createParseHelpers(){return{parseInline:t=>this.parseInlineTokens(t),tokenizeInline:t=>this.tokenizeInline(t),parseChildren:t=>this.parseTokens(t),parseBlockChildren:t=>this.parseTokens(t,!0),createTextNode:(t,e)=>({type:"text",text:t,marks:e||void 0}),createNode:(t,e,n)=>{const r={type:t,attrs:e||void 0,content:n||void 0};return(!e||Object.keys(e).length===0)&&delete r.attrs,r},applyMark:(t,e,n)=>({mark:t,content:e,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(t){const e=[];for(let a=0;a<t.length;a+=1){const l=t[a];if(l.type==="text")e.push({type:"text",text:Ee(l.text||"")});else if(l.type==="escape")e.push({type:"text",text:l.text||""});else if(l.type==="html"){var n,r;const o=((n=(r=l.raw)!==null&&r!==void 0?r:l.text)!==null&&n!==void 0?n:"").toString(),u=/^<\/[\s]*[\w-]+/i.test(o),c=o.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!u&&c&&!/\/>$/.test(o)){const d=c[1],f=this.escapeRegex(d),p=new RegExp(`^<\\/\\s*${f}\\b`,"i");let g=-1;const m=[o];for(let k=a+1;k<t.length;k+=1){var s,i;const y=t[k],T=((s=(i=y.raw)!==null&&i!==void 0?i:y.text)!==null&&s!==void 0?s:"").toString();if(m.push(T),y.type==="html"&&p.test(T)){g=k;break}}if(g!==-1){const k=m.join(""),y={type:"html",raw:k,text:k,block:!1},T=this.parseHTMLToken(y);if(T){const v=this.normalizeParseResult(T);Array.isArray(v)?e.push(...v):v&&e.push(v)}a=g;continue}}const h=this.parseHTMLToken(l);if(h){const d=this.normalizeParseResult(h);Array.isArray(d)?e.push(...d):d&&e.push(d)}}else if(l.type){const o=this.getHandlerForToken(l.type);if(o&&o.parseMarkdown){const u=this.createParseHelpers(),c=o.parseMarkdown(l,u);if(this.isMarkResult(c)){const h=this.applyMarkToContent(c.mark,c.content,c.attrs);e.push(...h)}else{const h=this.normalizeParseResult(c);Array.isArray(h)?e.push(...h):h&&e.push(h)}}else l.tokens&&e.push(...this.parseInlineTokens(l.tokens))}}for(let a=e.length-1;a>0;a-=1){const l=e[a],o=e[a-1];if(l.type==="text"&&o.type==="text"){const u=l.marks||[],c=o.marks||[];Ht(u,c)&&(o.text=(o.text||"")+(l.text||""),e.splice(a,1))}}return e}applyMarkToContent(t,e,n){return e.map(r=>{if(r.type==="text"){const s=r.marks||[],i=n?{type:t,attrs:n}:{type:t};return{...r,marks:[...s,i]}}return{...r,content:r.content?this.applyMarkToContent(t,r.content,n):void 0}})}isMarkResult(t){return t&&typeof t=="object"&&"mark"in t}normalizeParseResult(t){return t?this.isMarkResult(t)?t.content:t:null}parseFallbackToken(t,e=!1){switch(t.type){case"paragraph":return{type:"paragraph",content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"heading":return{type:"heading",attrs:{level:t.depth||1},content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"text":return{type:"text",text:Ee(t.text||"")};case"html":return this.parseHTMLToken(t);case"escape":return{type:"text",text:t.text||""};case"space":return null;default:return t.tokens?this.parseTokens(t.tokens,e):null}}parseHTMLToken(t){const e=t.text||t.raw||"";if(!e.trim())return null;if(this.isUnrecognizedHtml(e))return this.htmlAsLiteralText(e,!!t.block);if(typeof window>"u"||typeof window.DOMParser>"u")return this.htmlAsLiteralText(e,!!t.block);try{const n=jt(e,this.baseExtensions);if(n.type==="doc"&&n.content){if(t.block)return n.content;const r=this.toInlineContent(n.content);return r.length>0?r:null}return n}catch(n){throw new Error(`Failed to parse HTML in markdown: ${n}`)}}toInlineContent(t){const e=this.getInlineNodeTypes();return t.flatMap(n=>n.type&&e.has(n.type)?[n]:n.content?this.toInlineContent(n.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;const t=new Set(["text"]);try{const e=$e(this.baseExtensions);Object.values(e.nodes).forEach(n=>{n.isInline&&t.add(n.name)})}catch{}return this.inlineNodeTypesCache=t,t}isUnrecognizedHtml(t){return Qr(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=$e(this.baseExtensions),n=r=>{const s=r?.parseDOM;Array.isArray(s)&&s.forEach(i=>{if(typeof i?.tag=="string"){const a=i.tag.match(/^[a-zA-Z][\w-]*/);a&&t.add(a[0].toLowerCase())}})};Object.values(e.nodes).forEach(r=>n(r.spec)),Object.values(e.marks).forEach(r=>n(r.spec))}catch{}return this.schemaParseDomTagsCache=t,t}htmlAsLiteralText(t,e){const n=t.replace(/\s+$/,"");return n?e?{type:"paragraph",content:[{type:"text",text:n}]}:{type:"text",text:n}:null}encodeTextForMarkdown(t,e,n){return n?.type!=null&&this.codeTypes.has(n.type)||(e.marks||[]).some(r=>this.codeTypes.has(typeof r=="string"?r:r.type))?t:this.escapeMarkdownSyntax(Nt(t))}escapeMarkdownSyntax(t){return t.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(t,e,n=0,r=0,s={}){var i;if(t.type==="text")return this.encodeTextForMarkdown(t.text||"",t,e);if(!t.type)return"";const a=this.getHandlerForToken(t.type);if(!a)return"";const l=Array.isArray(e?.content)&&n>0?e.content[n-1]:void 0,o={renderChildren:(c,h)=>{const d=a.isIndenting?r+1:r;return!Array.isArray(c)&&c.content?this.renderNodes(c.content,t,h||"",n,d):this.renderNodes(c,t,h||"",n,d)},renderChild:(c,h)=>{const d=a.isIndenting?r+1:r;return this.renderNodeToMarkdown(c,t,h,d)},indent:c=>this.indentString+c,wrapInBlock:Br},u={index:n,level:r,parentType:e?.type,previousNode:l,meta:{parentAttrs:e?.attrs,...s}};return((i=a.renderMarkdown)===null||i===void 0?void 0:i.call(a,t,o,u))||""}renderNodes(t,e,n="",r=0,s=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,n,s):t.type?this.renderNodeToMarkdown(t,e,r,s):""}renderNodesWithMarkBoundaries(t,e,n="",r=0){const s=[],i=new Map,a=new Set,l=new Map;return t.forEach((o,u)=>{const c=u<t.length-1?t[u+1]:null;if(o.type)if(o.type==="text"){let h=this.encodeTextForMarkdown(o.text||"",o,e);const d=new Map((o.marks||[]).map(b=>[b.type,b])),f=this.getMarksToOpenForSerialization(i,d,c),p=Dr(d,c),g=p.filter(b=>i.has(b)),m=g.length>0&&f.length>0;let k="";if(p.length>0&&!m){const b=h.match(/(\s+)$/);b&&(k=b[1],h=h.slice(0,-k.length))}m||p.slice().reverse().forEach(b=>{if(!i.has(b))return;const w=d.get(b),A=this.getMarkClosing(b,w,l.get(b));A&&(h+=A),i.has(b)&&(i.delete(b),l.delete(b))});let y="";if(f.length>0){const b=h.match(/^(\s+)/);b&&(y=b[1],h=h.slice(y.length))}f.forEach(({type:b,mark:w})=>{const A=a.has(b)?"html":"markdown",C=this.getMarkOpening(b,w,A);C&&(h=C+h),l.set(b,A),a.delete(b)}),m||f.slice().reverse().forEach(({type:b,mark:w})=>{i.set(b,w)}),h=y+h;let T;if(m){const b=new Set((c?.marks||[]).map(C=>C.type));f.forEach(({type:C})=>{b.has(C)&&this.getHtmlReopenTags(C)&&a.add(C)});const w=Array.from(i.keys()),A=g.slice().sort((C,vt)=>w.indexOf(vt)-w.indexOf(C));T=[...f.map(C=>C.type),...A]}else T=qr(i,d,c,this.markSetsEqual.bind(this));let v="";if(T.length>0){const b=h.match(/(\s+)$/);b&&(v=b[1],h=h.slice(0,-v.length))}T.forEach(b=>{var w;const A=(w=i.get(b))!==null&&w!==void 0?w:d.get(b),C=this.getMarkClosing(b,A,l.get(b));C&&(h+=C),i.delete(b),l.delete(b)}),h+=v,h+=k,s.push(h)}else{const h=new Set((o.marks||[]).map(k=>k.type)),d=new Map,f=new Map;i.forEach((k,y)=>{if(h.has(y)){var T;d.set(y,k),f.set(y,(T=l.get(y))!==null&&T!==void 0?T:"markdown")}});const p=Wr(i,(k,y)=>this.getMarkClosing(k,y,l.get(k)));l.clear();const g=this.renderNodeToMarkdown(o,e,u,r),m=o.type==="hardBreak"?"":Ur(d,i,(k,y)=>{var T;const v=(T=f.get(k))!==null&&T!==void 0?T:"markdown";return l.set(k,v),this.getMarkOpening(k,y,v)});s.push(p+g+m)}}),s.join(n)}getMarkOpening(t,e,n="markdown"){if(n==="html"){var r;return((r=this.getHtmlReopenTags(t))===null||r===void 0?void 0:r.open)||""}const s=this.getHandlersForNodeType(t),i=s.length>0?s[0]:void 0;if(!i||!i.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:a}]};try{const o=i.renderMarkdown(l,{renderChildren:()=>a,renderChild:()=>a,indent:c=>c,wrapInBlock:(c,h)=>c+h},{index:0,level:0,parentType:"text",meta:{}}),u=o.indexOf(a);return u>=0?o.substring(0,u):""}catch(o){throw new Error(`Failed to get mark opening for ${t}: ${o}`)}}getMarkClosing(t,e,n="markdown"){if(n==="html"){var r;return((r=this.getHtmlReopenTags(t))===null||r===void 0?void 0:r.close)||""}const s=this.getHandlersForNodeType(t),i=s.length>0?s[0]:void 0;if(!i||!i.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:a}]};try{const o=i.renderMarkdown(l,{renderChildren:()=>a,renderChild:()=>a,indent:h=>h,wrapInBlock:(h,d)=>h+d},{index:0,level:0,parentType:"text",meta:{}}),u=o.indexOf(a),c=u+33;return u>=0?o.substring(c):""}catch(o){throw new Error(`Failed to get mark closing for ${t}: ${o}`)}}getHtmlReopenTags(t){const e=this.getHandlersForNodeType(t),n=e.length>0?e[0]:void 0;return n?.htmlReopen}markSetsEqual(t,e){return t.size!==e.size?!1:Array.from(t.entries()).every(([n,r])=>{const s=e.get(n);return s&&V(r.attrs,s.attrs)})}getMarksToOpenForSerialization(t,e,n){const r=Fr(t,e);if(r.length<=1)return r;const s=n?.marks||[],i=(u,c)=>s.some(h=>h.type===u&&V(h.attrs,c)),a=(u,c)=>{var h,d;const f=(h=this.extensionRanks.get(u.type))!==null&&h!==void 0?h:Number.MAX_SAFE_INTEGER,p=(d=this.extensionRanks.get(c.type))!==null&&d!==void 0?d:Number.MAX_SAFE_INTEGER;return f!==p?p-f:u.type.localeCompare(c.type)},l=r.filter(u=>!i(u.type,u.mark.attrs)).sort(a),o=r.filter(u=>i(u.type,u.mark.attrs)).sort(a);return[...l,...o]}};const Xr=ie.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return P.setContent(t,e);if(X(t,e?.contentType)!=="markdown"||!this.editor.markdown)return P.setContent(t,e);const n=this.editor.markdown.parse(t);return P.setContent(n,e)},insertContent:(t,e)=>{if(!e?.contentType)return P.insertContent(t,e);if(X(t,e?.contentType)!=="markdown"||!this.editor.markdown)return P.insertContent(t,e);const n=this.editor.markdown.parse(t);return P.insertContent(n,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return P.insertContentAt(t,e,n);if(X(e,n?.contentType)!=="markdown"||!this.editor.markdown)return P.insertContentAt(t,e,n);const r=this.editor.markdown.parse(e);return P.insertContentAt(t,r,n)}}},addStorage(){return{manager:new We({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var t;if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new We({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||X(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const e=this.editor.markdown.parse(this.editor.options.content);!((t=e.content)===null||t===void 0)&&t.length&&(this.editor.options.content=e)}});function se(t){return t==="left"||t==="right"||t==="center"?t:null}function Jr(t){const e=(t.style.textAlign||"").trim().toLowerCase(),n=(t.getAttribute("align")||"").trim().toLowerCase();return se(e||n)}function Yr(t){return se(t?.align)}function xt(){return{default:null,parseHTML:t=>Jr(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}function es(t){var e;const n=t.parentElement,r=t.closest("table");if(!n||!r)return null;const s=Array.from(n.children).indexOf(t),i=(e=r.querySelectorAll("colgroup > col")[s])===null||e===void 0?void 0:e.getAttribute("width");return i?[parseInt(i,10)]:null}function bt(t){const e=t.getAttribute("colwidth");return e?e.split(",").map(n=>parseInt(n,10)):es(t)}const ts=/[ \t\r\n\f]+/g;function wt(t){var e;return t.children.length>0?!1:((e=t.textContent)!==null&&e!==void 0?e:"").replace(ts,"")===""}function yt(t){const e=t.createAndFill();if(!e)throw new Error(`[tiptap error]: "${t.name}" has no default content to backfill.`);return e.content}const ns=D.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:bt},align:xt()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:t=>wt(t)?{}:!1,getContent:(t,e)=>yt(e.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",H(this.options.HTMLAttributes,t),0]}}),rs=D.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:bt},align:xt()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:t=>wt(t)?{}:!1,getContent:(t,e)=>yt(e.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",H(this.options.HTMLAttributes,t),0]}}),ss=D.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",H(this.options.HTMLAttributes,t),0]}});function ge(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function Ue(t,e,n,r,s,i){let a=0,l=!0,o=e.firstChild;const u=t.firstChild;if(u!==null)for(let d=0,f=0;d<u.childCount;d+=1){const{colspan:p,colwidth:g}=u.child(d).attrs;for(let m=0;m<p;m+=1,f+=1){const k=s===f?i:g&&g[m],y=k?`${k}px`:"";if(a+=k||r,k||(l=!1),o){if(o.style.width!==y){const[T,v]=ge(r,k);o.style.setProperty(T,v)}o=o.nextSibling}else{const T=document.createElement("col"),[v,b]=ge(r,k);T.style.setProperty(v,b),e.appendChild(T)}}}for(;o;){var c;const d=o.nextSibling;(c=o.parentNode)===null||c===void 0||c.removeChild(o),o=d}const h=t.attrs.style&&typeof t.attrs.style=="string"&&/\bwidth\s*:/i.test(t.attrs.style);l&&!h?(n.style.width=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`)}var is=class{constructor(t,e,n,r={}){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table"));for(const[s,i]of Object.entries(r))i!=null&&(s==="style"?this.table.style.cssText=String(i):this.table.setAttribute(s,String(i)));t.attrs.style&&(this.table.style.cssText=t.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Ue(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,Ue(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){const e=t.target,n=this.dom.contains(e),r=this.contentDOM.contains(e);return!!(n&&!r&&(t.type==="attributes"||t.type==="childList"||t.type==="characterData"))}};function as(t,e,n,r){let s=0,i=!0;const a=[],l=t.firstChild;if(!l)return{};for(let c=0,h=0;c<l.childCount;c+=1){const{colspan:d,colwidth:f}=l.child(c).attrs;for(let p=0;p<d;p+=1,h+=1){const g=n===h?r:f&&f[p];s+=g||e,g||(i=!1);const[m,k]=ge(e,g);a.push(["col",{style:`${m}: ${k}`}])}}const o=i?`${s}px`:"",u=i?"":`${s}px`;return{colgroup:["colgroup",{},...a],tableWidth:o,tableMinWidth:u}}function Ge(t,e){return t.createAndFill()}function os(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function ls(t,e,n,r,s){const i=os(t),a=[],l=[];for(let u=0;u<n;u+=1){const c=Ge(i.cell);if(c&&l.push(c),r){const h=Ge(i.header_cell);h&&a.push(h)}}const o=[];for(let u=0;u<e;u+=1)o.push(i.row.createChecked(null,r&&u===0?a:l));return i.table.createChecked(null,o)}function cs(t){return t instanceof st}const J=({editor:t})=>{const{selection:e}=t.state;if(!cs(e))return!1;let n=0;const r=Y(e.ranges[0].$from,s=>s.type.name==="table");return r?.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(n+=1)}),n!==e.ranges.length?!1:(t.commands.deleteTable(),!0)};function Ze(t,e){const n=t.mapping.map(e),r=Y(t.selection.$from,a=>a.type.name==="table");if(r?.pos===n)return;const s=t.doc.nodeAt(n);if(!s)return;const i=n+s.nodeSize-1;t.setSelection(nt.near(t.doc.resolve(i),-1))}function us(t){let e="",n=0;for(;n<t.length;){if(t[n]==="\\"&&n+1<t.length){e+=t[n]+t[n+1],n+=2;continue}if(t[n]!=="`"){e+=t[n++];continue}let r=0;for(;n+r<t.length&&t[n+r]==="`";)r+=1;let s=n+r,i=!1;for(;s<t.length;){if(t[s]!=="`"){s+=1;continue}let a=0;for(;s+a<t.length&&t[s+a]==="`";)a+=1;if(a===r){const l=t.slice(n+r,s);e+=t.slice(n,n+r)+l.replace(/\\\||\|/g,o=>o==="|"?"\\|":o)+t.slice(s,s+r),n=s+r,i=!0;break}s+=a}i||(e+=t.slice(n,n+r),n+=r)}return e}function hs(t){return t.split(`
|
|
66
|
+
`))}}d={type:"taskItem",raw:"",mainContent:m,indentLevel:h,checked:c??!1,text:m,tokens:this.tokenizeInline(m),nestedTokens:k}}const f=u?"taskList":"list";i!==f?(s.length>0&&r.push({type:i,items:s}),s=[d],i=f):s.push(d)}s.length>0&&r.push({type:i,items:s});const a=[];for(let l=0;l<r.length;l+=1){const o=r[l],u={...t,type:o.type,items:o.items},c=this.parseToken(u);c&&(Array.isArray(c)?a.push(...c):a.push(c))}return a.length>0?a:null}parseTokenWithHandlers(t){if(!t.type)return null;const e=this.getHandlersForToken(t.type),n=this.createParseHelpers();if(e.find(r=>{if(!r.parseMarkdown)return!1;const s=r.parseMarkdown(t,n),i=this.normalizeParseResult(s);return i&&(!Array.isArray(i)||i.length>0)?(this.lastParseResult=i,!0):!1})&&this.lastParseResult){const r=this.lastParseResult;return this.lastParseResult=null,r}return this.parseFallbackToken(t)}createParseHelpers(){return{parseInline:t=>this.parseInlineTokens(t),tokenizeInline:t=>this.tokenizeInline(t),parseChildren:t=>this.parseTokens(t),parseBlockChildren:t=>this.parseTokens(t,!0),createTextNode:(t,e)=>({type:"text",text:t,marks:e||void 0}),createNode:(t,e,n)=>{const r={type:t,attrs:e||void 0,content:n||void 0};return(!e||Object.keys(e).length===0)&&delete r.attrs,r},applyMark:(t,e,n)=>({mark:t,content:e,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(t){const e=[];for(let a=0;a<t.length;a+=1){const l=t[a];if(l.type==="text")e.push({type:"text",text:Ee(l.text||"")});else if(l.type==="escape")e.push({type:"text",text:l.text||""});else if(l.type==="html"){var n,r;const o=((n=(r=l.raw)!==null&&r!==void 0?r:l.text)!==null&&n!==void 0?n:"").toString(),u=/^<\/[\s]*[\w-]+/i.test(o),c=o.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!u&&c&&!/\/>$/.test(o)){const d=c[1],f=this.escapeRegex(d),p=new RegExp(`^<\\/\\s*${f}\\b`,"i");let g=-1;const m=[o];for(let k=a+1;k<t.length;k+=1){var s,i;const y=t[k],T=((s=(i=y.raw)!==null&&i!==void 0?i:y.text)!==null&&s!==void 0?s:"").toString();if(m.push(T),y.type==="html"&&p.test(T)){g=k;break}}if(g!==-1){const k=m.join(""),y={type:"html",raw:k,text:k,block:!1},T=this.parseHTMLToken(y);if(T){const v=this.normalizeParseResult(T);Array.isArray(v)?e.push(...v):v&&e.push(v)}a=g;continue}}const h=this.parseHTMLToken(l);if(h){const d=this.normalizeParseResult(h);Array.isArray(d)?e.push(...d):d&&e.push(d)}}else if(l.type){const o=this.getHandlerForToken(l.type);if(o&&o.parseMarkdown){const u=this.createParseHelpers(),c=o.parseMarkdown(l,u);if(this.isMarkResult(c)){const h=this.applyMarkToContent(c.mark,c.content,c.attrs);e.push(...h)}else{const h=this.normalizeParseResult(c);Array.isArray(h)?e.push(...h):h&&e.push(h)}}else l.tokens&&e.push(...this.parseInlineTokens(l.tokens))}}for(let a=e.length-1;a>0;a-=1){const l=e[a],o=e[a-1];if(l.type==="text"&&o.type==="text"){const u=l.marks||[],c=o.marks||[];Ht(u,c)&&(o.text=(o.text||"")+(l.text||""),e.splice(a,1))}}return e}applyMarkToContent(t,e,n){return e.map(r=>{if(r.type==="text"){const s=r.marks||[],i=n?{type:t,attrs:n}:{type:t};return{...r,marks:[...s,i]}}return{...r,content:r.content?this.applyMarkToContent(t,r.content,n):void 0}})}isMarkResult(t){return t&&typeof t=="object"&&"mark"in t}normalizeParseResult(t){return t?this.isMarkResult(t)?t.content:t:null}parseFallbackToken(t,e=!1){switch(t.type){case"paragraph":return{type:"paragraph",content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"heading":return{type:"heading",attrs:{level:t.depth||1},content:t.tokens?this.parseInlineTokens(t.tokens):[]};case"text":return{type:"text",text:Ee(t.text||"")};case"html":return this.parseHTMLToken(t);case"escape":return{type:"text",text:t.text||""};case"space":return null;default:return t.tokens?this.parseTokens(t.tokens,e):null}}parseHTMLToken(t){const e=t.text||t.raw||"";if(!e.trim())return null;if(this.isUnrecognizedHtml(e))return this.htmlAsLiteralText(e,!!t.block);if(typeof window>"u"||typeof window.DOMParser>"u")return this.htmlAsLiteralText(e,!!t.block);try{const n=jt(e,this.baseExtensions);if(n.type==="doc"&&n.content){if(t.block)return n.content;const r=this.toInlineContent(n.content);return r.length>0?r:null}return n}catch(n){throw new Error(`Failed to parse HTML in markdown: ${n}`)}}toInlineContent(t){const e=this.getInlineNodeTypes();return t.flatMap(n=>n.type&&e.has(n.type)?[n]:n.content?this.toInlineContent(n.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;const t=new Set(["text"]);try{const e=$e(this.baseExtensions);Object.values(e.nodes).forEach(n=>{n.isInline&&t.add(n.name)})}catch{}return this.inlineNodeTypesCache=t,t}isUnrecognizedHtml(t){return Qr(t,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const t=new Set;try{const e=$e(this.baseExtensions),n=r=>{const s=r?.parseDOM;Array.isArray(s)&&s.forEach(i=>{if(typeof i?.tag=="string"){const a=i.tag.match(/^[a-zA-Z][\w-]*/);a&&t.add(a[0].toLowerCase())}})};Object.values(e.nodes).forEach(r=>n(r.spec)),Object.values(e.marks).forEach(r=>n(r.spec))}catch{}return this.schemaParseDomTagsCache=t,t}htmlAsLiteralText(t,e){const n=t.replace(/\s+$/,"");return n?e?{type:"paragraph",content:[{type:"text",text:n}]}:{type:"text",text:n}:null}encodeTextForMarkdown(t,e,n){return n?.type!=null&&this.codeTypes.has(n.type)||(e.marks||[]).some(r=>this.codeTypes.has(typeof r=="string"?r:r.type))?t:this.escapeMarkdownSyntax(Nt(t))}escapeMarkdownSyntax(t){return t.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(t,e,n=0,r=0,s={}){var i;if(t.type==="text")return this.encodeTextForMarkdown(t.text||"",t,e);if(!t.type)return"";const a=this.getHandlerForToken(t.type);if(!a)return"";const l=Array.isArray(e?.content)&&n>0?e.content[n-1]:void 0,o={renderChildren:(c,h)=>{const d=a.isIndenting?r+1:r;return!Array.isArray(c)&&c.content?this.renderNodes(c.content,t,h||"",n,d):this.renderNodes(c,t,h||"",n,d)},renderChild:(c,h)=>{const d=a.isIndenting?r+1:r;return this.renderNodeToMarkdown(c,t,h,d)},indent:c=>this.indentString+c,wrapInBlock:Br},u={index:n,level:r,parentType:e?.type,previousNode:l,meta:{parentAttrs:e?.attrs,...s}};return((i=a.renderMarkdown)===null||i===void 0?void 0:i.call(a,t,o,u))||""}renderNodes(t,e,n="",r=0,s=0){return Array.isArray(t)?this.renderNodesWithMarkBoundaries(t,e,n,s):t.type?this.renderNodeToMarkdown(t,e,r,s):""}renderNodesWithMarkBoundaries(t,e,n="",r=0){const s=[],i=new Map,a=new Set,l=new Map;return t.forEach((o,u)=>{const c=u<t.length-1?t[u+1]:null;if(o.type)if(o.type==="text"){let h=this.encodeTextForMarkdown(o.text||"",o,e);const d=new Map((o.marks||[]).map(b=>[b.type,b])),f=this.getMarksToOpenForSerialization(i,d,c),p=Dr(d,c),g=p.filter(b=>i.has(b)),m=g.length>0&&f.length>0;let k="";if(p.length>0&&!m){const b=h.match(/(\s+)$/);b&&(k=b[1],h=h.slice(0,-k.length))}m||p.slice().reverse().forEach(b=>{if(!i.has(b))return;const w=d.get(b),A=this.getMarkClosing(b,w,l.get(b));A&&(h+=A),i.has(b)&&(i.delete(b),l.delete(b))});let y="";if(f.length>0){const b=h.match(/^(\s+)/);b&&(y=b[1],h=h.slice(y.length))}f.forEach(({type:b,mark:w})=>{const A=a.has(b)?"html":"markdown",C=this.getMarkOpening(b,w,A);C&&(h=C+h),l.set(b,A),a.delete(b)}),m||f.slice().reverse().forEach(({type:b,mark:w})=>{i.set(b,w)}),h=y+h;let T;if(m){const b=new Set((c?.marks||[]).map(C=>C.type));f.forEach(({type:C})=>{b.has(C)&&this.getHtmlReopenTags(C)&&a.add(C)});const w=Array.from(i.keys()),A=g.slice().sort((C,vt)=>w.indexOf(vt)-w.indexOf(C));T=[...f.map(C=>C.type),...A]}else T=qr(i,d,c,this.markSetsEqual.bind(this));let v="";if(T.length>0){const b=h.match(/(\s+)$/);b&&(v=b[1],h=h.slice(0,-v.length))}T.forEach(b=>{var w;const A=(w=i.get(b))!==null&&w!==void 0?w:d.get(b),C=this.getMarkClosing(b,A,l.get(b));C&&(h+=C),i.delete(b),l.delete(b)}),h+=v,h+=k,s.push(h)}else{const h=new Set((o.marks||[]).map(k=>k.type)),d=new Map,f=new Map;i.forEach((k,y)=>{if(h.has(y)){var T;d.set(y,k),f.set(y,(T=l.get(y))!==null&&T!==void 0?T:"markdown")}});const p=Wr(i,(k,y)=>this.getMarkClosing(k,y,l.get(k)));l.clear();const g=this.renderNodeToMarkdown(o,e,u,r),m=o.type==="hardBreak"?"":Ur(d,i,(k,y)=>{var T;const v=(T=f.get(k))!==null&&T!==void 0?T:"markdown";return l.set(k,v),this.getMarkOpening(k,y,v)});s.push(p+g+m)}}),s.join(n)}getMarkOpening(t,e,n="markdown"){if(n==="html"){var r;return((r=this.getHtmlReopenTags(t))===null||r===void 0?void 0:r.open)||""}const s=this.getHandlersForNodeType(t),i=s.length>0?s[0]:void 0;if(!i||!i.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:a}]};try{const o=i.renderMarkdown(l,{renderChildren:()=>a,renderChild:()=>a,indent:c=>c,wrapInBlock:(c,h)=>c+h},{index:0,level:0,parentType:"text",meta:{}}),u=o.indexOf(a);return u>=0?o.substring(0,u):""}catch(o){throw new Error(`Failed to get mark opening for ${t}: ${o}`)}}getMarkClosing(t,e,n="markdown"){if(n==="html"){var r;return((r=this.getHtmlReopenTags(t))===null||r===void 0?void 0:r.close)||""}const s=this.getHandlersForNodeType(t),i=s.length>0?s[0]:void 0;if(!i||!i.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:t,attrs:e.attrs||{},content:[{type:"text",text:a}]};try{const o=i.renderMarkdown(l,{renderChildren:()=>a,renderChild:()=>a,indent:h=>h,wrapInBlock:(h,d)=>h+d},{index:0,level:0,parentType:"text",meta:{}}),u=o.indexOf(a),c=u+33;return u>=0?o.substring(c):""}catch(o){throw new Error(`Failed to get mark closing for ${t}: ${o}`)}}getHtmlReopenTags(t){const e=this.getHandlersForNodeType(t),n=e.length>0?e[0]:void 0;return n?.htmlReopen}markSetsEqual(t,e){return t.size!==e.size?!1:Array.from(t.entries()).every(([n,r])=>{const s=e.get(n);return s&&V(r.attrs,s.attrs)})}getMarksToOpenForSerialization(t,e,n){const r=Fr(t,e);if(r.length<=1)return r;const s=n?.marks||[],i=(u,c)=>s.some(h=>h.type===u&&V(h.attrs,c)),a=(u,c)=>{var h,d;const f=(h=this.extensionRanks.get(u.type))!==null&&h!==void 0?h:Number.MAX_SAFE_INTEGER,p=(d=this.extensionRanks.get(c.type))!==null&&d!==void 0?d:Number.MAX_SAFE_INTEGER;return f!==p?p-f:u.type.localeCompare(c.type)},l=r.filter(u=>!i(u.type,u.mark.attrs)).sort(a),o=r.filter(u=>i(u.type,u.mark.attrs)).sort(a);return[...l,...o]}};const Xr=ie.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(t,e)=>{if(!e?.contentType)return P.setContent(t,e);if(X(t,e?.contentType)!=="markdown"||!this.editor.markdown)return P.setContent(t,e);const n=this.editor.markdown.parse(t);return P.setContent(n,e)},insertContent:(t,e)=>{if(!e?.contentType)return P.insertContent(t,e);if(X(t,e?.contentType)!=="markdown"||!this.editor.markdown)return P.insertContent(t,e);const n=this.editor.markdown.parse(t);return P.insertContent(n,e)},insertContentAt:(t,e,n)=>{if(!n?.contentType)return P.insertContentAt(t,e,n);if(X(e,n?.contentType)!=="markdown"||!this.editor.markdown)return P.insertContentAt(t,e,n);const r=this.editor.markdown.parse(e);return P.insertContentAt(t,r,n)}}},addStorage(){return{manager:new We({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var t;if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new We({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||X(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const e=this.editor.markdown.parse(this.editor.options.content);!((t=e.content)===null||t===void 0)&&t.length&&(this.editor.options.content=e)}});function se(t){return t==="left"||t==="right"||t==="center"?t:null}function Yr(t){const e=(t.style.textAlign||"").trim().toLowerCase(),n=(t.getAttribute("align")||"").trim().toLowerCase();return se(e||n)}function Jr(t){return se(t?.align)}function xt(){return{default:null,parseHTML:t=>Yr(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}function es(t){var e;const n=t.parentElement,r=t.closest("table");if(!n||!r)return null;const s=Array.from(n.children).indexOf(t),i=(e=r.querySelectorAll("colgroup > col")[s])===null||e===void 0?void 0:e.getAttribute("width");return i?[parseInt(i,10)]:null}function bt(t){const e=t.getAttribute("colwidth");return e?e.split(",").map(n=>parseInt(n,10)):es(t)}const ts=/[ \t\r\n\f]+/g;function wt(t){var e;return t.children.length>0?!1:((e=t.textContent)!==null&&e!==void 0?e:"").replace(ts,"")===""}function yt(t){const e=t.createAndFill();if(!e)throw new Error(`[tiptap error]: "${t.name}" has no default content to backfill.`);return e.content}const ns=D.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:bt},align:xt()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:t=>wt(t)?{}:!1,getContent:(t,e)=>yt(e.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",H(this.options.HTMLAttributes,t),0]}}),rs=D.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:bt},align:xt()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:t=>wt(t)?{}:!1,getContent:(t,e)=>yt(e.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",H(this.options.HTMLAttributes,t),0]}}),ss=D.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",H(this.options.HTMLAttributes,t),0]}});function ge(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function Ue(t,e,n,r,s,i){let a=0,l=!0,o=e.firstChild;const u=t.firstChild;if(u!==null)for(let d=0,f=0;d<u.childCount;d+=1){const{colspan:p,colwidth:g}=u.child(d).attrs;for(let m=0;m<p;m+=1,f+=1){const k=s===f?i:g&&g[m],y=k?`${k}px`:"";if(a+=k||r,k||(l=!1),o){if(o.style.width!==y){const[T,v]=ge(r,k);o.style.setProperty(T,v)}o=o.nextSibling}else{const T=document.createElement("col"),[v,b]=ge(r,k);T.style.setProperty(v,b),e.appendChild(T)}}}for(;o;){var c;const d=o.nextSibling;(c=o.parentNode)===null||c===void 0||c.removeChild(o),o=d}const h=t.attrs.style&&typeof t.attrs.style=="string"&&/\bwidth\s*:/i.test(t.attrs.style);l&&!h?(n.style.width=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`)}var is=class{constructor(t,e,n,r={}){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table"));for(const[s,i]of Object.entries(r))i!=null&&(s==="style"?this.table.style.cssText=String(i):this.table.setAttribute(s,String(i)));t.attrs.style&&(this.table.style.cssText=t.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Ue(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,Ue(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){const e=t.target,n=this.dom.contains(e),r=this.contentDOM.contains(e);return!!(n&&!r&&(t.type==="attributes"||t.type==="childList"||t.type==="characterData"))}};function as(t,e,n,r){let s=0,i=!0;const a=[],l=t.firstChild;if(!l)return{};for(let c=0,h=0;c<l.childCount;c+=1){const{colspan:d,colwidth:f}=l.child(c).attrs;for(let p=0;p<d;p+=1,h+=1){const g=n===h?r:f&&f[p];s+=g||e,g||(i=!1);const[m,k]=ge(e,g);a.push(["col",{style:`${m}: ${k}`}])}}const o=i?`${s}px`:"",u=i?"":`${s}px`;return{colgroup:["colgroup",{},...a],tableWidth:o,tableMinWidth:u}}function Ge(t,e){return t.createAndFill()}function os(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function ls(t,e,n,r,s){const i=os(t),a=[],l=[];for(let u=0;u<n;u+=1){const c=Ge(i.cell);if(c&&l.push(c),r){const h=Ge(i.header_cell);h&&a.push(h)}}const o=[];for(let u=0;u<e;u+=1)o.push(i.row.createChecked(null,r&&u===0?a:l));return i.table.createChecked(null,o)}function cs(t){return t instanceof st}const Y=({editor:t})=>{const{selection:e}=t.state;if(!cs(e))return!1;let n=0;const r=J(e.ranges[0].$from,s=>s.type.name==="table");return r?.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(n+=1)}),n!==e.ranges.length?!1:(t.commands.deleteTable(),!0)};function Ze(t,e){const n=t.mapping.map(e),r=J(t.selection.$from,a=>a.type.name==="table");if(r?.pos===n)return;const s=t.doc.nodeAt(n);if(!s)return;const i=n+s.nodeSize-1;t.setSelection(nt.near(t.doc.resolve(i),-1))}function us(t){let e="",n=0;for(;n<t.length;){if(t[n]==="\\"&&n+1<t.length){e+=t[n]+t[n+1],n+=2;continue}if(t[n]!=="`"){e+=t[n++];continue}let r=0;for(;n+r<t.length&&t[n+r]==="`";)r+=1;let s=n+r,i=!1;for(;s<t.length;){if(t[s]!=="`"){s+=1;continue}let a=0;for(;s+a<t.length&&t[s+a]==="`";)a+=1;if(a===r){const l=t.slice(n+r,s);e+=t.slice(n,n+r)+l.replace(/\\\||\|/g,o=>o==="|"?"\\|":o)+t.slice(s,s+r),n=s+r,i=!0;break}s+=a}i||(e+=t.slice(n,n+r),n+=r)}return e}function hs(t){return t.split(`
|
|
67
67
|
`).map(e=>!e.includes("|")||!e.includes("`")?e:us(e)).join(`
|
|
68
68
|
`)}function ds(t){return(t||"").replace(/\s+/g," ").trim()}function ps(t,e,n={}){var r;const s=(r=n.cellLineSeparator)!==null&&r!==void 0?r:"";if(!t||!t.content||t.content.length===0)return"";const i=[];t.content.forEach(p=>{const g=[];p.content&&p.content.forEach(m=>{let k="";m.content&&Array.isArray(m.content)&&m.content.length>1?k=m.content.map(b=>e.renderChildren(b)).join(s):k=m.content?e.renderChildren(m.content):"";const y=ds(k.split(s).join(`
|
|
69
|
-
`).replace(/[ \t]*\r?\n[ \t]*/g,"<br>")),T=m.type==="tableHeader",v=
|
|
69
|
+
`).replace(/[ \t]*\r?\n[ \t]*/g,"<br>")),T=m.type==="tableHeader",v=Jr(m.attrs);g.push({text:y,isHeader:T,align:v})}),i.push(g)});const a=i.reduce((p,g)=>Math.max(p,g.length),0);if(a===0)return"";const l=Array.from({length:a}).fill(0);i.forEach(p=>{for(let m=0;m<a;m+=1){var g;const k=(((g=p[m])===null||g===void 0?void 0:g.text)||"").length;k>l[m]&&(l[m]=k),l[m]<3&&(l[m]=3)}});const o=(p,g)=>p+" ".repeat(Math.max(0,g-p.length)),u=i[0],c=u.some(p=>p.isHeader),h=Array.from({length:a}).fill(null);i.forEach(p=>{for(let m=0;m<a;m+=1){var g;!h[m]&&(!((g=p[m])===null||g===void 0)&&g.align)&&(h[m]=p[m].align)}});let d=`
|
|
70
70
|
`;const f=Array.from({length:a}).map((p,g)=>c&&u[g]&&u[g].text||"");return d+=`| ${f.map((p,g)=>o(p,l[g])).join(" | ")} |
|
|
71
71
|
`,d+=`| ${l.map((p,g)=>{const m=Math.max(3,p),k=h[g];return k==="left"?`:${"-".repeat(m)}`:k==="right"?`${"-".repeat(m)}:`:k==="center"?`:${"-".repeat(m)}:`:"-".repeat(m)}).join(" | ")} |
|
|
72
72
|
`,(c?i.slice(1):i).forEach(p=>{d+=`| ${Array.from({length:a}).fill(0).map((g,m)=>o(p[m]&&p[m].text||"",l[m])).join(" | ")} |
|
|
@@ -77,7 +77,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error
|
|
|
77
77
|
`);if(i.length<2)return;const a=i[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(a)||!a.includes("|"))return;const l=hs(s);if(l===s)return;const o=n.blockTokens(l)[0];if(o?.type!=="table"||!o.raw)return;const u=o.raw.split(`
|
|
78
78
|
`).length,c=t.split(`
|
|
79
79
|
`).slice(0,u).join(`
|
|
80
|
-
`);return{...o,raw:c}}},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:s,editor:i})=>{const a=ls(i.schema,t,e,n);if(s){const l=r.selection.from+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(nt.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>pn(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>dn(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{const n=
|
|
81
|
-
`],allow:({state:n,range:r})=>{const s=t.dismissal;return s?r.from===s.from&&Es(n.doc,s.from,s.text.length)===s.text?!1:(t.dismissal=null,!0):!0},items:()=>[],render:()=>({onStart:n=>{t.set({query:n.query,range:n.range,rect:n.clientRect??null,editor:n.editor})},onUpdate:n=>{t.set({query:n.query,range:n.range,rect:n.clientRect??null,editor:n.editor})},onKeyDown:({event:n})=>n.key==="Escape"?(Tt(this.editor,t),t.close(),!0):!1,onExit:()=>{t.latched||t.close()}})};return[Xt(e)]}})}const Qe=256,_s=40,Xe=280,Ls=140,Is=[];function zs(t){const e=$.c(5),{store:n,agents:r}=t,s=r===void 0?Is:r,i=E.useSyncExternalStore(n.subscribe,n.getSnapshot),a=i.range!==null;let l;return e[0]!==s||e[1]!==a||e[2]!==i||e[3]!==n?(l=a?x.jsx(Ps,{store:n,state:i,agents:s}):null,e[0]=s,e[1]=a,e[2]=i,e[3]=n,e[4]=l):l=e[4],l}function Ps({store:t,state:e,agents:n}){const r=j(),{members:s,loading:i}=Ss(!0),[a,l]=E.useState(e.query),[o,u]=E.useState(null),c=Hs(e.editor),h=c.getBoundingClientRect(),d=c===document.body?new DOMRect(0,0,window.innerWidth,window.innerHeight):h,f=e.rect?.()??new DOMRect(0,0,0,0),p=d.bottom-f.bottom,g=p<Xe&&f.top-d.top>p,m=(g?f.top-d.top:p)-8,k=Math.min(Xe,Math.max(m,Ls))-_s,y={position:"absolute",width:Qe,left:Math.min(f.left,d.right-Qe-8)-h.left,...g?{bottom:h.bottom-f.top+6}:{top:f.bottom-h.top+6}},T=()=>{e.editor&&Tt(e.editor,t),t.close()},v=w=>{const A=w.relatedTarget;if((!A||e.editor?.view.dom.contains(A)===!0)&&t.latched){o?.focus();return}T()},b=w=>{!e.editor||!e.range||(Rs(e.editor,e.range,w),t.close())};return Et.createPortal(x.jsx("div",{style:y,"data-testid":"mention-menu",className:"z-50 overflow-hidden rounded-lg bg-popover shadow-soft",children:x.jsxs(Ln,{onKeyDown:w=>{w.key==="Escape"&&(w.preventDefault(),T(),e.editor?.commands.focus())},children:[x.jsx(In,{ref:u,autoFocus:!0,onFocus:()=>{t.latched=!0},value:a,onValueChange:l,placeholder:r("markdownEditor.mentionSearch"),onBlur:v}),x.jsxs(zn,{style:{maxHeight:k},children:[i?x.jsx("div",{className:"flex items-center justify-center py-6",children:x.jsx(
|
|
80
|
+
`);return{...o,raw:c}}},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:s,editor:i})=>{const a=ls(i.schema,t,e,n);if(s){const l=r.selection.from+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(nt.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>pn(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>dn(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{const n=J(t.selection.$from,r=>r.type.name==="table");return hn(t,e&&(r=>{n&&Ze(r,n.pos),e(r)}))},addRowBefore:()=>({state:t,dispatch:e})=>un(t,e),addRowAfter:()=>({state:t,dispatch:e})=>cn(t,e),deleteRow:()=>({state:t,dispatch:e})=>{const n=J(t.selection.$from,r=>r.type.name==="table");return ln(t,e&&(r=>{n&&Ze(r,n.pos),e(r)}))},deleteTable:()=>({state:t,dispatch:e})=>on(t,e),mergeCells:()=>({state:t,dispatch:e})=>Le(t,e),splitCell:()=>({state:t,dispatch:e})=>Ie(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>ze("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>ze("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>an(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Le(t,e)?!0:Ie(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>sn(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>_e(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>_e(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&rn(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=st.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Y,"Mod-Backspace":Y,Delete:Y,"Mod-Delete":Y}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[tn({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],nn({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){const t=this.options.resizable&&this.editor.isEditable,e=this.options.View;return t||!e?null:({node:n,view:r,HTMLAttributes:s})=>{const i=H(this.options.HTMLAttributes,s);return new e(n,this.options.cellMinWidth,r,i)}},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:tt(N(t,"tableRole",e))}}}),gs=ie.create({name:"tableKit",addExtensions(){const t=[];return this.options.table!==!1&&t.push(fs.configure(this.options.table)),this.options.tableCell!==!1&&t.push(ns.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(rs.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(ss.configure(this.options.tableRow)),t}});function ms(t){const e=$.c(13),{node:n,selected:r,editor:s,deleteNode:i}=t,a=j(),l=typeof n.attrs.href=="string"?n.attrs.href:"",o=typeof n.attrs.name=="string"?n.attrs.name:"",u=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let c;e[0]!==u?(c=q(Cn,"select-none",u),e[0]=u,e[1]=c):c=e[1];let h;e[2]!==i||e[3]!==s.isEditable||e[4]!==a?(h=s.isEditable&&x.jsx("button",{type:"button","aria-label":a("markdownEditor.removeFile"),onMouseDown:ks,onClick:i,className:"shrink-0 rounded-lg p-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:x.jsx(Ye,{size:14})}),e[2]=i,e[3]=s.isEditable,e[4]=a,e[5]=h):h=e[5];let d;e[6]!==l||e[7]!==o||e[8]!==h?(d=x.jsx(Rn,{href:l,name:o,children:h}),e[6]=l,e[7]=o,e[8]=h,e[9]=d):d=e[9];let f;return e[10]!==c||e[11]!==d?(f=x.jsx(xe,{as:"span",className:c,children:d}),e[10]=c,e[11]=d,e[12]=f):f=e[12],f}function ks(t){return t.preventDefault()}function xs(t){return t.replace(/([[\]])/g,"\\$1")}const bs=D.create({name:"attachment",group:"inline",inline:!0,atom:!0,draggable:!0,addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href"),renderHTML:t=>t.href?{href:t.href}:{}},name:{default:null,parseHTML:t=>t.getAttribute("data-name")||t.textContent,renderHTML:t=>t.name?{"data-name":t.name}:{}}}},parseHTML(){return[{tag:"a[data-attachment]",getAttrs:t=>at(t.getAttribute("href")??"")?null:!1}]},renderHTML({HTMLAttributes:t,node:e}){return["a",H(t,{"data-attachment":""}),typeof e.attrs.name=="string"?e.attrs.name:""]},renderMarkdown:t=>{const e=typeof t.attrs?.href=="string"?t.attrs.href:"",n=typeof t.attrs?.name=="string"?t.attrs.name:"";return`[${xs(n)}](${e})`},addNodeView(){return ke(ms)}});function ws(t){const e=$.c(6),{node:n,selected:r}=t,s=typeof n.attrs.name=="string"?n.attrs.name:"";let i;e[0]!==n.attrs.id||e[1]!==r?(i=q("select-none",$n(typeof n.attrs.id=="string"?n.attrs.id:null),r&&"ring-2 ring-ring"),e[0]=n.attrs.id,e[1]=r,e[2]=i):i=e[2];let a;return e[3]!==s||e[4]!==i?(a=x.jsxs(xe,{as:"span","data-testid":"mention-chip",className:i,children:["@",s]}),e[3]=s,e[4]=i,e[5]=a):a=e[5],a}const ys=D.create({name:"mention",group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-mention-id"),renderHTML:t=>t.id?{"data-mention-id":t.id}:{}},name:{default:null,parseHTML:t=>t.getAttribute("data-mention-name"),renderHTML:t=>t.name?{"data-mention-name":t.name}:{}}}},parseHTML(){return[{tag:"span[data-mention-id]"}]},renderHTML({HTMLAttributes:t,node:e}){return["span",H(t),`@${typeof e.attrs.name=="string"?e.attrs.name:""}`]},renderMarkdown:t=>{const e=typeof t.attrs?.id=="string"?t.attrs.id:"",n=typeof t.attrs?.name=="string"?t.attrs.name:"";return e?En(e,n):`@${n}`},addNodeView(){return ke(ws)}}),Ts="studio.mention-members.",me=new Map;function Ve(t){const e=me.get(t);if(e)return e;try{const n=localStorage.getItem(t);if(!n)return;const r=JSON.parse(n);if(!Array.isArray(r))return;const s=r.filter(i=>!!i&&typeof i.id=="string"&&typeof i.name=="string");return me.set(t,s),s}catch{return}}function vs(t,e){me.set(t,e);try{localStorage.setItem(t,JSON.stringify(e))}catch{}}function As(t,e){if(!t?.length)return e;const n=new Map(t.map(r=>[r.id,r]));return e.map(r=>{const s=n.get(r.id);return s&&s.name===r.name&&s.email===r.email&&s.image===r.image?s:r})}function Ms(t){return t.map(e=>({id:e.userId,name:e.user?.name?.trim()||e.user?.email?.trim()||"",email:e.user?.email??"",image:e.user?.image??null})).filter(e=>!!e.name).sort((e,n)=>e.name.localeCompare(n.name))}function Ss(t){const e=$.c(17),{locator:n}=Mt(),r=St(),s=`${Ts}${n}`;let i;e[0]!==n?(i=Rt.mentionMembers(n),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==s?(a=()=>Ve(s),e[2]=s,e[3]=a):a=e[3];let l;e[4]!==r||e[5]!==s?(l=async()=>{const f=await r.organization.listMembers(),p=As(Ve(s),Ms(f?.data?.members??[]));return vs(s,p),p},e[4]=r,e[5]=s,e[6]=l):l=e[6];let o;e[7]!==t||e[8]!==i||e[9]!==a||e[10]!==l?(o={queryKey:i,enabled:t,staleTime:0,placeholderData:a,queryFn:l},e[7]=t,e[8]=i,e[9]=a,e[10]=l,e[11]=o):o=e[11];const u=Ct(o);let c;e[12]!==u.data?(c=u.data??[],e[12]=u.data,e[13]=c):c=e[13];const h=u.isFetching&&!u.data;let d;return e[14]!==c||e[15]!==h?(d={members:c,loading:h},e[14]=c,e[15]=h,e[16]=d):d=e[16],d}const Ke={query:"",range:null,rect:null,editor:null};class Cs{state=Ke;listeners=new Set;dismissal=null;latched=!1;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.state;set(e){this.state=e;for(const n of this.listeners)n()}close(){this.latched=!1,this.set(Ke)}}const Re=new et("markdownEditorMention");function Rs(t,e,n){t.chain().focus().insertContentAt(e,[{type:"mention",attrs:{id:n.id,name:n.name}},{type:"text",text:" "}]).run(),rt(t.view,Re)}function Es(t,e,n){const r=Math.min(e+n,t.content.size);return e>=r?"":t.textBetween(e,r,"","")}function Tt(t,e){const n=e.getSnapshot().range??void 0;n&&n.to>n.from&&(e.dismissal={from:n.from,text:t.state.doc.textBetween(n.from,n.to,"")}),rt(t.view,Re)}function $s(t){return ie.create({name:"mentionSuggestion",addProseMirrorPlugins(){const e={editor:this.editor,char:"@",pluginKey:Re,allowedPrefixes:[" ",`
|
|
81
|
+
`],allow:({state:n,range:r})=>{const s=t.dismissal;return s?r.from===s.from&&Es(n.doc,s.from,s.text.length)===s.text?!1:(t.dismissal=null,!0):!0},items:()=>[],render:()=>({onStart:n=>{t.set({query:n.query,range:n.range,rect:n.clientRect??null,editor:n.editor})},onUpdate:n=>{t.set({query:n.query,range:n.range,rect:n.clientRect??null,editor:n.editor})},onKeyDown:({event:n})=>n.key==="Escape"?(Tt(this.editor,t),t.close(),!0):!1,onExit:()=>{t.latched||t.close()}})};return[Xt(e)]}})}const Qe=256,_s=40,Xe=280,Ls=140,Is=[];function zs(t){const e=$.c(5),{store:n,agents:r}=t,s=r===void 0?Is:r,i=E.useSyncExternalStore(n.subscribe,n.getSnapshot),a=i.range!==null;let l;return e[0]!==s||e[1]!==a||e[2]!==i||e[3]!==n?(l=a?x.jsx(Ps,{store:n,state:i,agents:s}):null,e[0]=s,e[1]=a,e[2]=i,e[3]=n,e[4]=l):l=e[4],l}function Ps({store:t,state:e,agents:n}){const r=j(),{members:s,loading:i}=Ss(!0),[a,l]=E.useState(e.query),[o,u]=E.useState(null),c=Hs(e.editor),h=c.getBoundingClientRect(),d=c===document.body?new DOMRect(0,0,window.innerWidth,window.innerHeight):h,f=e.rect?.()??new DOMRect(0,0,0,0),p=d.bottom-f.bottom,g=p<Xe&&f.top-d.top>p,m=(g?f.top-d.top:p)-8,k=Math.min(Xe,Math.max(m,Ls))-_s,y={position:"absolute",width:Qe,left:Math.min(f.left,d.right-Qe-8)-h.left,...g?{bottom:h.bottom-f.top+6}:{top:f.bottom-h.top+6}},T=()=>{e.editor&&Tt(e.editor,t),t.close()},v=w=>{const A=w.relatedTarget;if((!A||e.editor?.view.dom.contains(A)===!0)&&t.latched){o?.focus();return}T()},b=w=>{!e.editor||!e.range||(Rs(e.editor,e.range,w),t.close())};return Et.createPortal(x.jsx("div",{style:y,"data-testid":"mention-menu",className:"z-50 overflow-hidden rounded-lg bg-popover shadow-soft",children:x.jsxs(Ln,{onKeyDown:w=>{w.key==="Escape"&&(w.preventDefault(),T(),e.editor?.commands.focus())},children:[x.jsx(In,{ref:u,autoFocus:!0,onFocus:()=>{t.latched=!0},value:a,onValueChange:l,placeholder:r("markdownEditor.mentionSearch"),onBlur:v}),x.jsxs(zn,{style:{maxHeight:k},children:[i?x.jsx("div",{className:"flex items-center justify-center py-6",children:x.jsx(Je,{size:"sm"})}):x.jsx(Pn,{children:r("markdownEditor.mentionEmpty")}),n.map(w=>x.jsxs(He,{value:w.name,onSelect:()=>b(w),onMouseDown:A=>A.preventDefault(),className:"gap-2",children:[w.icon,x.jsx("span",{className:"min-w-0 flex-1 truncate",children:w.name})]},w.id)),s.map(w=>x.jsxs(He,{value:`${w.name} ${w.email}`,onSelect:()=>b(w),onMouseDown:A=>A.preventDefault(),className:"gap-2",children:[x.jsx($t,{url:w.image??void 0,fallback:w.name??"?",shape:"circle",size:"xs"}),x.jsx("span",{className:"min-w-0 flex-1 truncate",children:w.name})]},w.id))]})]})}),c)}function Hs(t){const e=t?.view.dom.closest('[role="dialog"]');return e instanceof HTMLElement?e:document.body}const js=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Ns=D.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",H(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,r,s,i,a;const l=(e=(n=t.attrs)===null||n===void 0?void 0:n.src)!==null&&e!==void 0?e:"",o=(r=(s=t.attrs)===null||s===void 0?void 0:s.alt)!==null&&r!==void 0?r:"",u=(i=(a=t.attrs)===null||a===void 0?void 0:a.title)!==null&&i!==void 0?i:"";return u?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize,s=new Set(["src","width","height"]);return({node:i,getPos:a,HTMLAttributes:l,editor:o})=>{const u=document.createElement("img");u.draggable=!1;const c=H(this.options.HTMLAttributes,l);Object.entries(c).forEach(([k,y])=>{if(y!=null)switch(k){case"src":case"width":case"height":break;default:u.setAttribute(k,y)}}),c.src!==null&&(u.src=c.src);let h={...l};const d=k=>{if(typeof k=="string"&&k!==""){u.getAttribute("src")!==k&&(u.src=k);return}u.hasAttribute("src")&&u.removeAttribute("src"),u.src!==""&&(u.src="")};d(l.src);const f=k=>{if(k.type!==i.type)return!1;const y=o.extensionManager.attributes.filter(v=>v.type===k.type.name),T=Dt(k,y);return Object.keys(h).forEach(v=>{!s.has(v)&&!(v in T)&&u.removeAttribute(v)}),Object.entries(T).forEach(([v,b])=>{s.has(v)||(b!=null?u.setAttribute(v,b):u.removeAttribute(v))}),d(T.src),h=T,!0},p=new Bt({element:u,editor:o,node:i,getPos:a,onResize:(k,y)=>{u.style.width=`${k}px`,u.style.height=`${y}px`},onCommit:(k,y)=>{const T=a();T!==void 0&&this.editor.chain().setNodeSelection(T).updateAttributes(this.name,{width:k,height:y}).run()},onUpdate:f,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),g=p.dom,m=()=>{g.style.visibility="",g.style.pointerEvents=""};return g.style.visibility="hidden",g.style.pointerEvents="none",u.complete&&u.naturalWidth>0?m():(u.onload=m,u.onerror=m),p}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[Ot({find:js,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});var Os=Ns;function Bs(t){const e=$.c(16),{node:n,selected:r,editor:s,deleteNode:i}=t,a=j(),l=typeof n.attrs.src=="string"?n.attrs.src:"",o=typeof n.attrs.alt=="string"?n.attrs.alt:"";let u;e[0]!==o||e[1]!==a?(u=o||a("markdownEditor.imageAltFallback"),e[0]=o,e[1]=a,e[2]=u):u=e[2];const c=r&&"ring-2 ring-ring ring-offset-2 ring-offset-background";let h;e[3]!==c?(h=q("max-h-[420px] max-w-full rounded-lg border border-border object-contain",c),e[3]=c,e[4]=h):h=e[4];let d;e[5]!==l||e[6]!==u||e[7]!==h?(d=x.jsx("img",{src:l,alt:u,draggable:!1,className:h}),e[5]=l,e[6]=u,e[7]=h,e[8]=d):d=e[8];let f;e[9]!==i||e[10]!==s.isEditable||e[11]!==a?(f=s.isEditable&&x.jsx("button",{type:"button","aria-label":a("markdownEditor.removeImage"),onMouseDown:Ds,onClick:i,className:"absolute right-2 top-2 flex size-7 items-center justify-center rounded-lg bg-card text-muted-foreground opacity-0 shadow-edge transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover/image:opacity-100",children:x.jsx(Ye,{size:14})}),e[9]=i,e[10]=s.isEditable,e[11]=a,e[12]=f):f=e[12];let p;return e[13]!==d||e[14]!==f?(p=x.jsxs(xe,{className:"group/image relative my-3 w-fit max-w-full",children:[d,f]}),e[13]=d,e[14]=f,e[15]=p):p=e[15],p}function Ds(t){return t.preventDefault()}const Fs=Os.extend({addNodeView(){return ke(Bs)}}).configure({inline:!1,allowBase64:!1}),qs={openOnClick:!1,autolink:!0,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}},Ws=Ft.extend({parseMarkdown:(t,e)=>{const n=typeof t.href=="string"?t.href:"";if(at(n))return e.createNode("attachment",{href:n,name:t.text??""});const r=_n(n);return r?e.createNode("mention",{id:r,name:(t.text??"").replace(/^@/,"")}):e.applyMark("link",e.parseInline(t.tokens??[]),{href:n,title:t.title||null})}});function Us(t="",e){return[Wt.configure({heading:{levels:[1,2,3]},underline:!1,link:!1}),Ws.configure(qs),Yt.configure({placeholder:t}),gs,qt,Ut.configure({nested:!0}),Fs,bs,Gn,ys,...e?[$s(e)]:[],Xr.configure({markedOptions:{breaks:!0}})]}const Gs=/^(\s*)([-*+]|\d+[.)])\s+\S/,Zs=/^\s*(```|~~~)/,Vs=/^\s+(?![-*+>#]|\d+[.)]\s)\S/;function Ks(t){const e=[];let n=!1,r=!1;for(const s of t.split(`
|
|
82
82
|
`)){if(Zs.test(s)){n=!n,r=!1,e.push(s);continue}if(n){e.push(s);continue}if(Gs.test(s)){r=!0,e.push(s);continue}if(!s.trim()){r=!1,e.push(s);continue}if(r&&Vs.test(s)){e[e.length-1]=`${e[e.length-1]} ${s.trim()}`;continue}r=!1,e.push(s)}return e.join(`
|
|
83
|
-
`)}function Qs(t){const e=$.c(12),{onFiles:n,disabled:r}=t,s=j(),i=E.useRef(null);let a;e[0]!==s?(a=s("markdownEditor.attachFile"),e[0]=s,e[1]=a):a=e[1];let l,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>i.current?.click(),o=x.jsx(wn,{size:16}),e[2]=l,e[3]=o):(l=e[2],o=e[3]);let u;e[4]!==r||e[5]!==a?(u=x.jsx(Hn,{type:"button",label:a,disabled:r,onClick:l,children:o}),e[4]=r,e[5]=a,e[6]=u):u=e[6];let c;e[7]!==n?(c=x.jsx("input",{ref:i,type:"file",multiple:!0,className:"hidden",onChange:d=>{const f=Array.from(d.target.files??[]);d.target.value="",f.length>0&&n(f)}}),e[7]=n,e[8]=c):c=e[8];let h;return e[9]!==u||e[10]!==c?(h=x.jsxs(x.Fragment,{children:[u,c]}),e[9]=u,e[10]=c,e[11]=h):h=e[11],h}function Xs(t){const e=$.c(6),{pending:n}=t,r=j();if(n===0)return null;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=x.jsx(
|
|
83
|
+
`)}function Qs(t){const e=$.c(12),{onFiles:n,disabled:r}=t,s=j(),i=E.useRef(null);let a;e[0]!==s?(a=s("markdownEditor.attachFile"),e[0]=s,e[1]=a):a=e[1];let l,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>i.current?.click(),o=x.jsx(wn,{size:16}),e[2]=l,e[3]=o):(l=e[2],o=e[3]);let u;e[4]!==r||e[5]!==a?(u=x.jsx(Hn,{type:"button",label:a,disabled:r,onClick:l,children:o}),e[4]=r,e[5]=a,e[6]=u):u=e[6];let c;e[7]!==n?(c=x.jsx("input",{ref:i,type:"file",multiple:!0,className:"hidden",onChange:d=>{const f=Array.from(d.target.files??[]);d.target.value="",f.length>0&&n(f)}}),e[7]=n,e[8]=c):c=e[8];let h;return e[9]!==u||e[10]!==c?(h=x.jsxs(x.Fragment,{children:[u,c]}),e[9]=u,e[10]=c,e[11]=h):h=e[11],h}function Xs(t){const e=$.c(6),{pending:n}=t,r=j();if(n===0)return null;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=x.jsx(Je,{className:"size-3"}),e[0]=s):s=e[0];let i;e[1]!==n||e[2]!==r?(i=n===1?r("markdownEditor.uploading"):r("markdownEditor.uploadingCount",{count:String(n)}),e[1]=n,e[2]=r,e[3]=i):i=e[3];let a;return e[4]!==i?(a=x.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","aria-live":"polite",role:"status",children:[s,i]}),e[4]=i,e[5]=a):a=e[5],a}const Ys=["outline-none","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0","[&_p]:my-3 [&_p]:leading-[1.5]","[&_h1]:my-3 [&_h1]:text-xl [&_h1]:font-semibold [&_h1]:leading-[1.5] [&_h1]:text-foreground","[&_h2]:my-3 [&_h2]:text-lg [&_h2]:font-semibold [&_h2]:leading-[1.5] [&_h2]:text-foreground","[&_h3]:my-3 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:leading-[1.5] [&_h3]:text-foreground","[&_ul]:my-3 [&_ul]:list-disc [&_ul]:pl-5","[&_ol]:my-3 [&_ol]:list-decimal [&_ol]:pl-5","[&_li]:my-0.5 [&_li>p]:my-0","[&_blockquote]:my-2 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground","[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.85em]","[&_pre]:my-3 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-muted [&_pre]:p-3 [&_pre]:font-mono [&_pre]:text-sm","[&_pre_code]:bg-transparent [&_pre_code]:p-0",Qt,"[&_hr]:my-4 [&_hr]:border-border","[&_strong]:font-semibold [&_strong]:text-foreground","[&_table]:my-3 [&_table]:w-full [&_table]:table-fixed [&_table]:border-collapse","[&_th]:border [&_th]:border-border [&_th]:bg-muted [&_th]:p-2 [&_th]:text-left [&_th]:font-semibold","[&_td]:border [&_td]:border-border [&_td]:p-2 [&_td]:align-top","[&_th>p]:my-0 [&_td>p]:my-0","[&_ul[data-type=taskList]]:my-3 [&_ul[data-type=taskList]]:list-none [&_ul[data-type=taskList]]:pl-0","[&_li[data-type=taskItem]]:flex [&_li[data-type=taskItem]]:items-start [&_li[data-type=taskItem]]:gap-2","[&_li[data-type=taskItem]>label]:mt-1 [&_li[data-type=taskItem]>label]:shrink-0","[&_li[data-type=taskItem]>div]:min-w-0 [&_li[data-type=taskItem]>div>p]:my-0"].join(" "),Js=["[&_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_p.is-editor-empty:first-child::before]:text-muted-foreground/50","[&_p.is-editor-empty:first-child::before]:float-left","[&_p.is-editor-empty:first-child::before]:h-0","[&_p.is-editor-empty:first-child::before]:pointer-events-none"].join(" ");function ei(t){const e=$.c(10),{editor:n,mentions:r}=t,s=r.items;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["markdown-editor-mentions"],e[0]=i):i=e[0];let a;e[1]!==s?(a=u=>{const{query:c}=u,h=c.trim().toLowerCase();return Promise.resolve(h?s.filter(d=>`${d.name} ${d.title??""}`.toLowerCase().includes(h)):s)},e[1]=s,e[2]=a):a=e[2];let l;e[3]!==n?(l=u=>{const{range:c,item:h}=u;n.chain().focus().insertContentAt(c,[{type:"text",text:`@${h.name}`,marks:h.href?[{type:"link",attrs:{href:h.href}}]:void 0},{type:"text",text:" "}]).run()},e[3]=n,e[4]=l):l=e[4];let o;return e[5]!==n||e[6]!==r.emptyLabel||e[7]!==a||e[8]!==l?(o=x.jsx(Jt,{editor:n,char:"@",pluginKey:"markdownMentionMenu",queryKey:i,queryFn:a,emptyLabel:r.emptyLabel,renderItem:ti,onSelect:l}),e[5]=n,e[6]=r.emptyLabel,e[7]=a,e[8]=l,e[9]=o):o=e[9],o}function ti(t){return x.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[x.jsx("span",{className:"truncate font-medium",children:t.title??t.name}),t.description&&x.jsx("span",{className:"line-clamp-1 text-xs text-muted-foreground",children:t.description})]})}function fi({defaultValue:t,onChange:e,placeholder:n,editable:r=!0,attachments:s=!0,mentions:i,inline:a=!1}){const l=Qn(s),[o]=E.useState(()=>new Cs),u=E.useRef(e);u.current=e;const c=Gt({extensions:Us(n,i?void 0:o),content:Ks(t),contentType:"markdown",editable:r,autofocus:a?"end":!1,editorProps:{attributes:{role:"textbox","aria-label":n??"","aria-multiline":"true",class:q(Ys,!a&&"min-h-[200px] sm:min-h-[320px]",Js)},handlePaste:l.handlePaste,handleDrop:l.handleDrop},onUpdate:({editor:h,transaction:d})=>{d.docChanged&&u.current(h.getMarkdown())}});return c?x.jsxs("div",{className:"flex flex-col",children:[x.jsx(On,{editor:c}),!i&&x.jsx(zs,{store:o}),x.jsx(Zt,{editor:c,className:q(a?"text-sm text-foreground":"text-base text-muted-foreground")}),r&&i&&x.jsx(ei,{editor:c,mentions:i}),x.jsxs("div",{className:"mt-4 flex items-center gap-2 text-xs text-muted-foreground empty:mt-0",children:[r&&i?.hint&&x.jsx("span",{children:i.hint}),r&&s&&x.jsx(Qs,{onFiles:h=>l.uploadInto(c.view,h,c.state.selection.to)}),x.jsx(Xs,{pending:l.pending})]})]}):null}export{Qs as A,Cs as M,Gn as U,ys as a,Xr as b,Fs as c,bs as d,Re as e,zs as f,Xs as g,fi as h,$s as m,Qn as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,a5 as h,gV as d,j as g,N as m,af as p,a2 as j}from"./index-
|
|
1
|
+
import{c as f,a5 as h,gV as d,j as g,N as m,af as p,a2 as j}from"./index-BZX-7ipZ.js";import{L as v}from"./legacy-main-redirect-8kA2UC85.js";import"./thread-route-CP2TR6nw.js";const x=j("/shell/$org/org-shell/");function L(){const t=f.c(19),{org:a}=h(),l=x.useSearch(),{main:i,virtualmcpid:o}=l;if(i!==void 0){let e;t[0]!==i||t[1]!==a.slug||t[2]!==l||t[3]!==o?(e=d({org:a.slug,agentId:o,main:i,search:l}),t[0]=i,t[1]=a.slug,t[2]=l,t[3]=o,t[4]=e):e=t[4];const s=e;if(s?.kind==="canonical"){let r;return t[5]!==s?(r=g.jsx(v,{target:s}),t[5]=s,t[6]=r):r=t[6],r}}let n;t[7]!==o?(n=o?.trim()||null,t[7]=o,t[8]=n):n=t[8];const u=n;if(u){let e;t[9]!==a.slug||t[10]!==u?(e={org:a.slug,agentId:u},t[9]=a.slug,t[10]=u,t[11]=e):e=t[11];let s;t[12]!==l?(s={...l,virtualmcpid:void 0},t[12]=l,t[13]=s):s=t[13];let r;return t[14]!==e||t[15]!==s?(r=g.jsx(m,{to:p.projects,params:e,search:s,hash:!0,replace:!0}),t[14]=e,t[15]=s,t[16]=r):r=t[16],r}let c;return t[17]!==a.slug?(c=g.jsx(m,{to:p.home,params:{org:a.slug},search:N,hash:!0,replace:!0}),t[17]=a.slug,t[18]=c):c=t[18],c}function N(t){return{...t,virtualmcpid:void 0}}export{L as default};
|