@inkeep/open-knowledge 0.41.1 → 0.41.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-harness-probe-5nWJCUzq.mjs → acp-harness-probe-Ba7DTFOh.mjs} +2 -2
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/cli.mjs +6 -6
- package/dist/constants-Ej-ZzjYT.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/init-BHsIRFIC.mjs +1 -0
- package/dist/{init-CMNFw1f5.mjs → init-CBWhyX1U.mjs} +3 -3
- package/dist/{launch-json-removal-B-KyA7If.mjs → launch-json-removal-0rPdkMtH.mjs} +2 -2
- package/dist/{loader-CjkpHgrm.mjs → loader-C0DzGeNZ.mjs} +2 -2
- package/dist/loader-CjpqkbhW.mjs +1 -0
- package/dist/preview-DSJriqm9.mjs +1 -0
- package/dist/{preview-BnZNzXie.mjs → preview-Dn1YxNMX.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-BIXiMcGj.js → ActivityModeContent-BPE8dCmt.js} +1 -1
- package/dist/public/assets/{ActivityPanelDiffView-BlsCddlr.js → ActivityPanelDiffView-5HC6s5FJ.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-oYjLJDDr.js → AgentDiffPane-DBIJrjq2.js} +2 -2
- package/dist/public/assets/AgentThreadClientBinder-DIlw7iBC.js +1 -0
- package/dist/public/assets/AppMenubar-P4tLmEVD.js +1 -0
- package/dist/public/assets/CodeMirrorPropInput-RC4sdh9E.js +3 -0
- package/dist/public/assets/ConfigSharingInfoTooltip-DoEZ2Swh.js +1 -0
- package/dist/public/assets/{ConsentDialogBody-Cdr00Adv.js → ConsentDialogBody-Cng5hWwR.js} +1 -1
- package/dist/public/assets/{CopyButton-tIb30IiS.js → CopyButton-1Q6Wnnjb.js} +1 -1
- package/dist/public/assets/{DocumentContext-DNryw5tR.js → DocumentContext-DhKWMrL2.js} +10 -10
- package/dist/public/assets/EditorModeToggle-EBc2Cv8z.js +2 -0
- package/dist/public/assets/{EnableSyncConfirmDialog-33nr5d0R.js → EnableSyncConfirmDialog-Dv9jJ1OH.js} +1 -1
- package/dist/public/assets/FeedbackForm-Bb9Yf3Zz.js +1 -0
- package/dist/public/assets/{GraphPanel-9aikCCVz.js → GraphPanel-DBxTtvfS.js} +2 -2
- package/dist/public/assets/{LintConfigEditor-B2jlefwZ.js → LintConfigEditor-COmMwK8k.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-CPVNyhy5.js → ManagedArtifactProperties-urT0cuW8.js} +1 -1
- package/dist/public/assets/{McpConsentDialogBody-CMu1TYud.js → McpConsentDialogBody-QnsIyr5m.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-CQm9yLzC.js → MermaidDocEditor-CNmMqMG0.js} +1 -1
- package/dist/public/assets/PropertyPanel-mY4SzTn-.js +2 -0
- package/dist/public/assets/{RegisteredAgentIcon-BYstaLMY.js → RegisteredAgentIcon-CboP_G0l.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-BBAPrsS2.js → ReportBugDialogBody-D6DyX_AO.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-BrLVE7C0.js → SchemaConfigEditor-DOlc8PRA.js} +1 -1
- package/dist/public/assets/SettingsDialogBody-DT5rxl3R.js +7 -0
- package/dist/public/assets/{ShareBranchSwitchDialog-0huPygyG.js → ShareBranchSwitchDialog-DOd9FqHR.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-hM8VMNZj.js → ShareReceiveDialog-WarQNnjb.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-D8c_k3S3.js → ShareReceiveMissDialog-B4qzjtcO.js} +1 -1
- package/dist/public/assets/{SkillEditorActions-Cb7fW9DL.js → SkillEditorActions-BgCcV1OO.js} +1 -1
- package/dist/public/assets/{SourceEditor-BMamozBI.js → SourceEditor-iS9U8XVV.js} +1 -1
- package/dist/public/assets/{TerminalPanel-C32GYMMi.js → TerminalPanel-DCL0YXc0.js} +3 -3
- package/dist/public/assets/{TerminalSessionsHost-BLWkOyQV.js → TerminalSessionsHost-CjgiUwL3.js} +2 -2
- package/dist/public/assets/{TerminalWindowApp-BdSw_Ao-.js → TerminalWindowApp-BZhG11Jf.js} +1 -1
- package/dist/public/assets/{ThreadView-uWP49vc2.js → ThreadView-BExAZkQQ.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-CwAAi13Y.js → TimelineDiffPane-BBVTd7ZF.js} +2 -2
- package/dist/public/assets/__vite-browser-external-lJ8jEJ5u.js +1 -0
- package/dist/public/assets/{abnfDiagram-VRR7QNED-Pz-d7QUO.js → abnfDiagram-VRR7QNED-CSAyvmsc.js} +1 -1
- package/dist/public/assets/{agent-diff-store-D-khHmXD.js → agent-diff-store-C_yI-auj.js} +1 -1
- package/dist/public/assets/{agent-visibility-DFPh0MZF.js → agent-visibility-BKKH1E-K.js} +1 -1
- package/dist/public/assets/{arc-zavTz6Mi.js → arc-B9W1msik.js} +1 -1
- package/dist/public/assets/architecture-TIHT7OUA-DKHFhDk7.js +1 -0
- package/dist/public/assets/{architectureDiagram-ZJ3FMSHR-DPFdhM_J.js → architectureDiagram-ZJ3FMSHR-Dy2e_59w.js} +1 -1
- package/dist/public/assets/arrow-up-right-obRIg3Sv.js +1 -0
- package/dist/public/assets/auth-state-cache-BYWBVAT1.js +11 -0
- package/dist/public/assets/{badge-kWhLcwP5.js → badge-DBfQWFob.js} +1 -1
- package/dist/public/assets/{blockDiagram-677ZJIJ3-BcUTUrKf.js → blockDiagram-677ZJIJ3-BmJoPVWJ.js} +1 -1
- package/dist/public/assets/{braces-DUywltjC.js → braces-DwnwFx_V.js} +1 -1
- package/dist/public/assets/button-Gol9BgNB.js +1 -0
- package/dist/public/assets/{c4Diagram-LMCZKHZV-DX6b63EP.js → c4Diagram-LMCZKHZV-C6-daiGI.js} +1 -1
- package/dist/public/assets/{calendar-Be7C-x0e.js → calendar-DXLdgxzp.js} +1 -1
- package/dist/public/assets/{case-sensitive-B_HNX58h.js → case-sensitive-nl0tWMnZ.js} +1 -1
- package/dist/public/assets/channel-NPsbtL4g.js +1 -0
- package/dist/public/assets/check-GqWaoTdV.js +1 -0
- package/dist/public/assets/checkbox-DY-vIhnZ.js +1 -0
- package/dist/public/assets/{chevron-down-DQUaF_vw.js → chevron-down-Bx9f3tW-.js} +1 -1
- package/dist/public/assets/chevron-left-BQ6OM94c.js +1 -0
- package/dist/public/assets/chevron-right-C8oTR6gu.js +1 -0
- package/dist/public/assets/chunk-2Q5K7J3B-DfamThA8.js +1 -0
- package/dist/public/assets/{chunk-32BRIVSS-Demy6w9E.js → chunk-32BRIVSS-C7jABskg.js} +1 -1
- package/dist/public/assets/{chunk-52WLFC77-BlEIphDp.js → chunk-52WLFC77-BUClf2Bp.js} +1 -1
- package/dist/public/assets/{chunk-5FCAYU7R-lS620rLS.js → chunk-5FCAYU7R-Z1dECZ5H.js} +1 -1
- package/dist/public/assets/{chunk-5HE753X5-Ctwpftk0.js → chunk-5HE753X5-Dfo7SN9G.js} +1 -1
- package/dist/public/assets/{chunk-5JV3BV7I-B0xTm5To.js → chunk-5JV3BV7I-D6ZlRq93.js} +1 -1
- package/dist/public/assets/{chunk-5TONJI2A-CTbq1Ges.js → chunk-5TONJI2A-Bc8YFTWv.js} +1 -1
- package/dist/public/assets/{chunk-5VM5RSS4-DIOyJEh7.js → chunk-5VM5RSS4-CvuAf9WZ.js} +1 -1
- package/dist/public/assets/{chunk-7BUUIJ7U-DJAQBDRB.js → chunk-7BUUIJ7U-DY-mK6wf.js} +1 -1
- package/dist/public/assets/{chunk-BIQX33UG-BJ4KOiuD.js → chunk-BIQX33UG-C2_T_i6p.js} +1 -1
- package/dist/public/assets/{chunk-BO2N2NFS-BKwKMCf_.js → chunk-BO2N2NFS-Ce4FT8lM.js} +4 -4
- package/dist/public/assets/{chunk-C7G6YPKG-DKtlXCwT.js → chunk-C7G6YPKG-CvO0R0o7.js} +1 -1
- package/dist/public/assets/{chunk-CQNSW5MT-CztK3zab.js → chunk-CQNSW5MT-DGjPUuGA.js} +1 -1
- package/dist/public/assets/{chunk-CYSBUYHQ-CvFdHE5W.js → chunk-CYSBUYHQ-DskcbjWM.js} +1 -1
- package/dist/public/assets/{chunk-EMLP6XTP-VxWimccr.js → chunk-EMLP6XTP-BKQNoaGS.js} +1 -1
- package/dist/public/assets/{chunk-EX3LRPZG-CO_SPblJ.js → chunk-EX3LRPZG-78TNCFn5.js} +1 -1
- package/dist/public/assets/{chunk-FWX5IMBZ-JMqub3ht.js → chunk-FWX5IMBZ-DxBIwhGr.js} +2 -2
- package/dist/public/assets/{chunk-HOUHSVGY-By4XpU6I.js → chunk-HOUHSVGY-kaNydTBg.js} +1 -1
- package/dist/public/assets/{chunk-ICXQ74PX-DWdDeVYv.js → chunk-ICXQ74PX-D-vGAA8P.js} +1 -1
- package/dist/public/assets/{chunk-JG7HCLWE-BQ8U-ghC.js → chunk-JG7HCLWE-DoSkPoyk.js} +1 -1
- package/dist/public/assets/{chunk-JWPE2WC7-DcQSwMri.js → chunk-JWPE2WC7-rkRE9Qqb.js} +1 -1
- package/dist/public/assets/{chunk-MOJQB5TN-BBaMKQVw.js → chunk-MOJQB5TN-D1DVTiJI.js} +1 -1
- package/dist/public/assets/{chunk-MOZMSUNE-CRVOIrQ5.js → chunk-MOZMSUNE-DiQFG9Cr.js} +1 -1
- package/dist/public/assets/{chunk-OGEWGWER-ba9ltMXK.js → chunk-OGEWGWER-C9QV5NVV.js} +1 -1
- package/dist/public/assets/{chunk-OSBZ3O6U-BwLKYi-M.js → chunk-OSBZ3O6U-Bw7ZAe1u.js} +1 -1
- package/dist/public/assets/{chunk-PUDLZKDR-DJ-xx1Uu.js → chunk-PUDLZKDR-DgVVUNKz.js} +1 -1
- package/dist/public/assets/{chunk-Q4XR5HBZ-BNj93MDr.js → chunk-Q4XR5HBZ-Br_Ek2kF.js} +1 -1
- package/dist/public/assets/{chunk-QBLGF6JB-hOGtWhlz.js → chunk-QBLGF6JB-CZvU2V5k.js} +1 -1
- package/dist/public/assets/{chunk-R7FJI6CG-BjWQRpAc.js → chunk-R7FJI6CG-CYfna_Nn.js} +1 -1
- package/dist/public/assets/{chunk-RYQCIY6F-B9SS86ok.js → chunk-RYQCIY6F-CR_AyEUQ.js} +1 -1
- package/dist/public/assets/{chunk-U6XO7XAA-DBbzoX4Z.js → chunk-U6XO7XAA-yFhPi07f.js} +1 -1
- package/dist/public/assets/{chunk-V7JOEXUC-EpFJBpvk.js → chunk-V7JOEXUC-BM4jn0d2.js} +1 -1
- package/dist/public/assets/chunk-VAUOI2AC-D239kTEr.js +1 -0
- package/dist/public/assets/{chunk-VR4S4FIN-B7zogTZo.js → chunk-VR4S4FIN-DVkUa8jL.js} +1 -1
- package/dist/public/assets/{chunk-WYO6CB5R-bpRilmGb.js → chunk-WYO6CB5R-Dw6T7byG.js} +2 -2
- package/dist/public/assets/chunk-XXDRQBXY-CMjFZ5xa.js +1 -0
- package/dist/public/assets/{chunk-YOTPTUD7-WzuLu2rZ.js → chunk-YOTPTUD7-DaSKW7nc.js} +1 -1
- package/dist/public/assets/{chunk-ZGVPDNZ5-BwWckaeQ.js → chunk-ZGVPDNZ5-OZxGS9Bz.js} +1 -1
- package/dist/public/assets/{chunk-ZIRB5QZD-BtkU1hkD.js → chunk-ZIRB5QZD-PR0SNtII.js} +1 -1
- package/dist/public/assets/classDiagram-OUVF2IWQ-DpqUur3T.js +1 -0
- package/dist/public/assets/classDiagram-v2-EOCWNBFH-C6kGeSfX.js +1 -0
- package/dist/public/assets/client-version-D0idjqLu.js +1 -0
- package/dist/public/assets/{collapsible-snx-HFVG.js → collapsible-B1mS1n9y.js} +1 -1
- package/dist/public/assets/compiler-runtime-BfE3aGVn.js +1 -0
- package/dist/public/assets/config-context-BD8I9DHH.js +1 -0
- package/dist/public/assets/{config-provider-D6Ee_DYA.js → config-provider-DDGPIoo7.js} +2 -2
- package/dist/public/assets/{copilot-fpMAoCAq.js → copilot-BCybAoDg.js} +1 -1
- package/dist/public/assets/{copy-C1RMi2cI.js → copy-9EDFYcyR.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-v6AC1hlD.js → cose-bilkent-JH36ORCC-ByxyfkaW.js} +1 -1
- package/dist/public/assets/{createLucideIcon-BwsSSL7z.js → createLucideIcon-DAkhoPjT.js} +1 -1
- package/dist/public/assets/{cursor-BSZbWhxr.js → cursor-DNMIFrEn.js} +1 -1
- package/dist/public/assets/cynefin-VYW2F7L2-BZd3qk2O.js +1 -0
- package/dist/public/assets/{cynefinDiagram-TSTJHNR4-DJT_8PZ9.js → cynefinDiagram-TSTJHNR4-Bg9qBIQz.js} +1 -1
- package/dist/public/assets/{dagre-C139UR6G.js → dagre-BpQy_13x.js} +1 -1
- package/dist/public/assets/{dagre-VKFMJZFB-5RJKKLB6.js → dagre-VKFMJZFB-Bmq16kmA.js} +1 -1
- package/dist/public/assets/{diagram-FQU43EPY-CMw4bmCQ.js → diagram-FQU43EPY-DtqSToqm.js} +1 -1
- package/dist/public/assets/{diagram-G47NLZAW-CYLhDQDm.js → diagram-G47NLZAW-5rAHLii9.js} +1 -1
- package/dist/public/assets/{diagram-NH7WQ7WH-lnG_Yvrf.js → diagram-NH7WQ7WH-CNMy1n8N.js} +1 -1
- package/dist/public/assets/{diagram-OA4YK3LP-tjz67Utc.js → diagram-OA4YK3LP-DKrqwtw9.js} +1 -1
- package/dist/public/assets/{diagram-WEI45ONY-keCs6tdk.js → diagram-WEI45ONY-BEeh1WiJ.js} +1 -1
- package/dist/public/assets/{dialog-BvA78Pbg.js → dialog-D1Bdnm4T.js} +1 -1
- package/dist/public/assets/{dist-BPbnU4MJ.js → dist-BDUhB1eX.js} +1 -1
- package/dist/public/assets/dist-BJa2CfR3.js +1 -0
- package/dist/public/assets/dist-BNcdLYQI.js +1 -0
- package/dist/public/assets/{dist-t90i8nhW.js → dist-BTjBKsmV.js} +1 -1
- package/dist/public/assets/{dist-DoyeToaO.js → dist-BjDuLI_j.js} +1 -1
- package/dist/public/assets/{dist-Ds91W2q2.js → dist-BoIv4SAA.js} +1 -1
- package/dist/public/assets/{dist-EBCF8Hyi.js → dist-C-31u2Hx.js} +1 -1
- package/dist/public/assets/{dist-CUQV7eXO.js → dist-CHDGRvTt.js} +1 -1
- package/dist/public/assets/{dist-PyCLG6aQ.js → dist-Ci4TMg-i.js} +1 -1
- package/dist/public/assets/{dist-DNTp9iqB.js → dist-CpB1fiWh2.js} +1 -1
- package/dist/public/assets/{dist-DVNg6hPx.js → dist-D5BMBxix.js} +1 -1
- package/dist/public/assets/dist-D6h-uzOv.js +1 -0
- package/dist/public/assets/{dist-UJD1w5LO.js → dist-DAU1MdSo.js} +1 -1
- package/dist/public/assets/{dist-DoAMXMs5.js → dist-DCVeG4ut.js} +1 -1
- package/dist/public/assets/dist-DEamjSXE.js +1 -0
- package/dist/public/assets/dist-DFt8VaPU.js +1 -0
- package/dist/public/assets/{dist-Cm6pClkc2.js → dist-DU-4Kwni.js} +1 -1
- package/dist/public/assets/{dist-HcWgGcjp.js → dist-DgX6o3Xd.js} +54 -54
- package/dist/public/assets/{dist-CXEsWt_M.js → dist-DhDVYf0S.js} +1 -1
- package/dist/public/assets/{dist-B22zi36Z.js → dist-L0D4gE6z.js} +1 -1
- package/dist/public/assets/{dist-De9aiAJx.js → dist-Nvb76hAm.js} +1 -1
- package/dist/public/assets/{dist-C3RLAwRF.js → dist-PQ5KMVDh.js} +1 -1
- package/dist/public/assets/{dist-CEEceAlU.js → dist-WHJq_4dd.js} +1 -1
- package/dist/public/assets/dist-nHZgBxFS.js +1 -0
- package/dist/public/assets/{dist-BHnd2TCW.js → dist-pk7DKQo2.js} +1 -1
- package/dist/public/assets/{dist-Ck2P_69m.js → dist-qSIybngm.js} +1 -1
- package/dist/public/assets/{doc-hash-B0QmkVn8.js → doc-hash-CzmSG2uM.js} +1 -1
- package/dist/public/assets/{documents-events-Uo9wt1xU.js → documents-events-0MJ8ER3I.js} +1 -1
- package/dist/public/assets/dropdown-menu-xw8WTdb-.js +1 -0
- package/dist/public/assets/{ebnfDiagram-CCIWWBDH-B-u3v2zf.js → ebnfDiagram-CCIWWBDH-CuibBQuZ.js} +1 -1
- package/dist/public/assets/{erDiagram-Q63AITRT-CJ_Cnn6b.js → erDiagram-Q63AITRT-zXZiY3yq.js} +1 -1
- package/dist/public/assets/{es2015-BPXMTj9r.js → es2015-BNlmLq62.js} +1 -1
- package/dist/public/assets/{esm-BTOPTNTx.js → esm-CYdiz24Y.js} +1 -1
- package/dist/public/assets/eventmodeling-45OFAUF4-BP9HGrxz.js +1 -0
- package/dist/public/assets/{eye-Bd06Ragq.js → eye-CASw1HTi.js} +1 -1
- package/dist/public/assets/{field-L06JWfWh.js → field-DVIFAnvR.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-BhgVCRpc.js → file-tree-adapter-DGXFJhkO.js} +1 -1
- package/dist/public/assets/{file-tree-utils-CEfCYY3r.js → file-tree-utils-BvgxJuFW.js} +1 -1
- package/dist/public/assets/flowDiagram-23GEKE2U-DanFCWBY.js +1 -0
- package/dist/public/assets/{folder-open-uBVyDcrj.js → folder-open-wLd69QUc.js} +1 -1
- package/dist/public/assets/{follow-file-DcOgGK76.js → follow-file-DWTpe68g.js} +1 -1
- package/dist/public/assets/{form-DqVoiojI.js → form-BWpIYeba.js} +1 -1
- package/dist/public/assets/{ganttDiagram-NO4QXBWP-DHV4x4CM.js → ganttDiagram-NO4QXBWP-BV5e8uSJ.js} +1 -1
- package/dist/public/assets/{git-branch-Dt9AthpR.js → git-branch-CMJAiYLz.js} +1 -1
- package/dist/public/assets/gitGraph-TEB2WS4Q-GM2z_7na.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-IHSO6WYX-BCudlL0f.js → gitGraphDiagram-IHSO6WYX-BsCUZZG-.js} +1 -1
- package/dist/public/assets/globals-BUFslTqe.css +1 -0
- package/dist/public/assets/globals-CpkAXqfZ.js +9 -0
- package/dist/public/assets/{graphlib-C20MI2IN.js → graphlib-dbceUpjW.js} +1 -1
- package/dist/public/assets/{hash-BBX_Yf_s.js → hash-DNKDqZ18.js} +1 -1
- package/dist/public/assets/{highlighted-body-OFNGDK62-C-4VTnbV.js → highlighted-body-OFNGDK62-B_Qp3LVc.js} +1 -1
- package/dist/public/assets/index-CDpJ2gXn.css +1 -0
- package/dist/public/assets/index-DDSda67s.js +2014 -0
- package/dist/public/assets/info-DKCQHKI2-iobk9-Ws.js +1 -0
- package/dist/public/assets/{info-CUyu_utl.js → info-yKMseklR.js} +1 -1
- package/dist/public/assets/{infoDiagram-FWYZ7A6U-BgYy4d56.js → infoDiagram-FWYZ7A6U-NVc44Bk_.js} +1 -1
- package/dist/public/assets/{input-DAAOxj0-.js → input-7sjA3n4i.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-FXEZZL3T-CCS72EW8.js → ishikawaDiagram-FXEZZL3T-D-yYM5ms.js} +1 -1
- package/dist/public/assets/{journeyDiagram-5HDEW3XC-CoREp23c.js → journeyDiagram-5HDEW3XC-kBiD_QZa.js} +1 -1
- package/dist/public/assets/{jsx-runtime-Dda6ZcOg.js → jsx-runtime-BUgB2tll.js} +1 -1
- package/dist/public/assets/{kanban-definition-HUTT4EX6-DSFIJzBy.js → kanban-definition-HUTT4EX6-DY3T3bWl.js} +1 -1
- package/dist/public/assets/{label-BPs9TAEe.js → label-DyipnO5I.js} +1 -1
- package/dist/public/assets/{lib-7eiHvDyn.js → lib-Iu39CNZE.js} +1 -1
- package/dist/public/assets/{line-DN_hBe-O.js → line-D3ZxbkBh.js} +1 -1
- package/dist/public/assets/{linear-D449kPqH.js → linear-B32W-VIi.js} +1 -1
- package/dist/public/assets/{lint-config-client-DGu5tve1.js → lint-config-client-DXbikwgI.js} +1 -1
- package/dist/public/assets/loader-circle-Cg5SU7AZ.js +1 -0
- package/dist/public/assets/{map-MD1QDiqI.js → map-DzGP5XyB.js} +1 -1
- package/dist/public/assets/{markdownit-D5ckRcLX.js → markdownit-YwcN3EvW.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-tjMFNWqD.js → markdownlint-rule-browser-DHpnQBnJ.js} +1 -1
- package/dist/public/assets/mermaid-GHXKKRXX-CVB7aazr.js +1 -0
- package/dist/public/assets/{mermaid-parser.core-Cm2pHXoA.js → mermaid-parser.core-7ep81ntF.js} +2 -2
- package/dist/public/assets/{mermaid.core-CBLgP-tq.js → mermaid.core-CJOawCp7.js} +3 -3
- package/dist/public/assets/{mindmap-definition-LN4V7U3C-CuiM6FsU.js → mindmap-definition-LN4V7U3C-Voa40XCr.js} +1 -1
- package/dist/public/assets/minus-SecfYzeQ.js +1 -0
- package/dist/public/assets/{miss-dialog-store-tptqlgbE.js → miss-dialog-store-Bx4JLuKB.js} +1 -1
- package/dist/public/assets/{navigation-targets-CHPfEHEd.js → navigation-targets-Bo1TKplU.js} +1 -1
- package/dist/public/assets/{now-Dq6LIEaU.js → now-DWwHYXX2.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-C7p0w8HU.js → open-managed-artifact-tab-Dvme3cv4.js} +1 -1
- package/dist/public/assets/{ordinal-BIOoIzFp.js → ordinal-CDU8wU5Q.js} +1 -1
- package/dist/public/assets/packet-7NZHBO7P-JGiyDeqb.js +1 -0
- package/dist/public/assets/{panel-DoEQccon.js → panel-XnOCz9jd.js} +1 -1
- package/dist/public/assets/{panel-right-open-DXZ0AA7N.js → panel-right-open-B7ziq39V.js} +1 -1
- package/dist/public/assets/{paperclip-B0H0WUBm.js → paperclip-CX7J_G-w.js} +1 -1
- package/dist/public/assets/{pdf-DQbEAtJS.js → pdf-BuVCb1O9.js} +1 -1
- package/dist/public/assets/{pegDiagram-2B236MQR-BLm9aXLc.js → pegDiagram-2B236MQR-DXoRvE2_.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-Cr_gpf9x.js → pending-receive-nav-store-CVH9OLs-.js} +1 -1
- package/dist/public/assets/pie-RZYD4A2V-CVccm5ht.js +1 -0
- package/dist/public/assets/{pieDiagram-ENE6RG2P-DWSDBj0y.js → pieDiagram-ENE6RG2P-BXV5OM8g.js} +1 -1
- package/dist/public/assets/project-paths-D3bkszNf.js +1 -0
- package/dist/public/assets/{prop-types-Q2HEN1Rj.js → prop-types-BjU4ptk9.js} +1 -1
- package/dist/public/assets/{propagation-api-C2s1QQGZ.js → propagation-api-OHat7V1z.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-ABIIQ3AL-y4XpclHG.js → quadrantDiagram-ABIIQ3AL-CBYLKI5l.js} +1 -1
- package/dist/public/assets/radar-I7S5WNFK-Dv_FpNhf.js +1 -0
- package/dist/public/assets/radio-group-CGEdWasQ.js +1 -0
- package/dist/public/assets/railroad-3IZDKUUU-DxxZlb6D.js +1 -0
- package/dist/public/assets/railroad-abnf-AHOZXSZD-Kw1QtP0q.js +1 -0
- package/dist/public/assets/railroad-ebnf-EBAXGLYW-DLTXwgvB.js +1 -0
- package/dist/public/assets/railroad-peg-LSFZ7HO6-CTBWNv5Y.js +1 -0
- package/dist/public/assets/{railroadDiagram-RFXS5EU6-D9LfvazB.js → railroadDiagram-RFXS5EU6-BTEuq3mh.js} +1 -1
- package/dist/public/assets/{react-dom-BtuvISNc.js → react-dom-DPxgxlDT.js} +1 -1
- package/dist/public/assets/{react-BN2QHhcO.js → react-f2sANaYj.js} +1 -1
- package/dist/public/assets/{receive-store-CHxUL4MW.js → receive-store-DHX5arqk.js} +1 -1
- package/dist/public/assets/{refresh-cw-iL3pn0CM.js → refresh-cw-BfeWGCsv.js} +1 -1
- package/dist/public/assets/{requirementDiagram-TGXJPOKE-CagEMoI5.js → requirementDiagram-TGXJPOKE-B-OW4MFD.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-HTMAVEWB-DJKiupTl.js → sankeyDiagram-HTMAVEWB-CQEIYQCZ.js} +1 -1
- package/dist/public/assets/{schema-fields-view-intent-BjfU6Zlh.js → schema-fields-view-intent-CqT4jLW_.js} +1 -1
- package/dist/public/assets/{selection-context-Czw3Gzjc.js → selection-context-Cp7p3Q_N.js} +1 -1
- package/dist/public/assets/{separator-DDR192VD.js → separator-DExEeoYE.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-DBY2YBRQ-nJTL2lqd.js → sequenceDiagram-DBY2YBRQ-Cf31ZcvD.js} +1 -1
- package/dist/public/assets/{share-metadata-rows-Bv7Ioipm.js → share-metadata-rows-DVsD3vii.js} +1 -1
- package/dist/public/assets/{sizeCapture-X5ZJPWSS-dyd3KiMv.js → sizeCapture-X5ZJPWSS-BsQbG1hw.js} +1 -1
- package/dist/public/assets/{skeleton-CHlN2fwE.js → skeleton-BUPbE7lx.js} +1 -1
- package/dist/public/assets/{skill-actions-CNM51R7-.js → skill-actions-bZFiRAYm.js} +1 -1
- package/dist/public/assets/{skills-api-BQ2-TlzN.js → skills-api-DstI-vVv.js} +1 -1
- package/dist/public/assets/{sliders-horizontal-BF9G548a.js → sliders-horizontal-DhMBnUFY.js} +1 -1
- package/dist/public/assets/{sortable.esm-Cj1OlkyK.js → sortable.esm-Bj4QKaKT.js} +1 -1
- package/dist/public/assets/{square-pen-DYNBYC6t.js → square-pen-C1vIlMAW.js} +1 -1
- package/dist/public/assets/{src-BM1NAcg_.js → src-C224eFw1.js} +1 -1
- package/dist/public/assets/{src-DlF2sh0h.js → src-CAZXe_Ov.js} +1 -1
- package/dist/public/assets/{startup-marks-lzQ6NDDC.js → startup-marks-DzPXEHWK.js} +1 -1
- package/dist/public/assets/{stateDiagram-2N3HPSRC-SO_TzvB4.js → stateDiagram-2N3HPSRC-Cf_gE7Q-.js} +1 -1
- package/dist/public/assets/stateDiagram-v2-6OUMAXLB-ds4tEdhm.js +1 -0
- package/dist/public/assets/{stex-CcubjMmP.js → stex-ChFXL4wJ.js} +1 -1
- package/dist/public/assets/{swimlanes-5IMT3BWC-I_fog1Gx.js → swimlanes-5IMT3BWC-C9Z1DWiv.js} +2 -2
- package/dist/public/assets/swimlanesDiagram-G3AALYLV-BEuMfu0N.js +8 -0
- package/dist/public/assets/switch-DYic2V-1.js +1 -0
- package/dist/public/assets/{tag-pill-input-Bvy4mqfW.js → tag-pill-input-C7Caa2Cw.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-CINxIuHF.js → target-navigation-intent-B54BgTCv.js} +1 -1
- package/dist/public/assets/{telemetry-impl-SsuzKiyK.js → telemetry-impl-DX2no2Pi.js} +2 -2
- package/dist/public/assets/telemetry-startup-djxtrb5t.js +1 -0
- package/dist/public/assets/terminal-input-events-C5UuEsAB.js +1 -0
- package/dist/public/assets/{terminal-launch-events-MUnc4Ao4.js → terminal-launch-events-DG8hI3w-.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-2DZ6gb5C.js → terminal-telemetry-DSZCcYb_.js} +1 -1
- package/dist/public/assets/{textarea-BuxwyMFe.js → textarea-BEHTV0VU.js} +1 -1
- package/dist/public/assets/{thread-client-CZmxW8Kl.js → thread-client-CDPegj1U.js} +1 -1
- package/dist/public/assets/{timeline-definition-FHXFAJF6-BQOKl1Wr.js → timeline-definition-FHXFAJF6-BNgvIw8J.js} +1 -1
- package/dist/public/assets/{timeline-diff-store-C_Gy5mJi.js → timeline-diff-store-xY5A4cfR.js} +1 -1
- package/dist/public/assets/{toggle-group-D6QJybW6.js → toggle-group-CjXmmTGy.js} +1 -1
- package/dist/public/assets/tooltip-B4J7VHmA.js +1 -0
- package/dist/public/assets/{trash-2-Baoxa0CE.js → trash-2-DDVTy8gQ.js} +1 -1
- package/dist/public/assets/treeView-QDETBFTQ-CUFRFwxu.js +1 -0
- package/dist/public/assets/treemap-6X3UGDF4-CMpWG5zr.js +1 -0
- package/dist/public/assets/{triangle-alert-CoYdkHNh.js → triangle-alert-B0VxKCJQ.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-BTAAvRtL.js → typing-burst-detector-DfFn9ASH.js} +2 -2
- package/dist/public/assets/uninstall-C2rwdK6e.js +1 -0
- package/dist/public/assets/{use-activity-panel-Cb0fI4Mi.js → use-activity-panel-CHsvsZ8L.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-DvEpRM5l.js → use-apply-config-color-theme-Gy3JNvol.js} +2 -2
- package/dist/public/assets/{use-collab-url-YWBnKc4x.js → use-collab-url-9qlw7MfN.js} +1 -1
- package/dist/public/assets/{use-installed-clis-Civ9j_Zf.js → use-installed-clis-DBRSzrR3.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme--GcodYbe.js → use-live-xterm-theme-7CBgYc0a.js} +1 -1
- package/dist/public/assets/{use-settings-route-BIstEnPj.js → use-settings-route-DEm8dDzV.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-BKxiEhc6.js → use-terminal-enabled-Bx_nsTHh.js} +1 -1
- package/dist/public/assets/use-timeline-entry-diff-Y2CdT0M4.js +6 -0
- package/dist/public/assets/{use-workspace-DYQ06EP5.js → use-workspace-DnIHeQAh.js} +1 -1
- package/dist/public/assets/{useLintConfigViewMode-B3XLyk60.js → useLintConfigViewMode-BRx7jr5r.js} +1 -1
- package/dist/public/assets/{useQuery-4J-R1a0S.js → useQuery-ZeEDLtxh.js} +1 -1
- package/dist/public/assets/{vennDiagram-L72KCM5P-qzJ6aksY.js → vennDiagram-L72KCM5P-BemdrSYN.js} +1 -1
- package/dist/public/assets/wardley-OPB4EBWU-BJpGGUoN.js +1 -0
- package/dist/public/assets/{wardleyDiagram-EHGQE667-CiP5w3Gp.js → wardleyDiagram-EHGQE667-zyW2lMGX.js} +1 -1
- package/dist/public/assets/{workspace-paths-DnSg30T1.js → workspace-paths-CGx2PUFr.js} +1 -1
- package/dist/public/assets/{wrench-C6cgdqwA.js → wrench-Bjcf-2l0.js} +1 -1
- package/dist/public/assets/x-Cw3EsDCQ.js +1 -0
- package/dist/public/assets/{xychartDiagram-FW5EYKEG-DlKpchAN.js → xychartDiagram-FW5EYKEG-W-VJ6tvK.js} +1 -1
- package/dist/public/index.html +144 -138
- package/dist/public/uninstall.html +74 -0
- package/dist/{repair-launch-json-Cvo7H--u.mjs → repair-launch-json-BVxKvPAo.mjs} +2 -2
- package/dist/{repair-mcp-configs-hUcFqhtN.mjs → repair-mcp-configs-CL00iu8h.mjs} +2 -2
- package/dist/{src-C-55nUaz.mjs → src-CxD3JHmH.mjs} +2 -2
- package/dist/{start-BGQTUqXL.mjs → start-5e_XN39i.mjs} +2 -2
- package/dist/start-DULQ0fI2.mjs +1 -0
- package/package.json +5 -5
- package/dist/constants-OU2a_0ai.mjs +0 -2
- package/dist/init-KqLbVogk.mjs +0 -1
- package/dist/loader-D1SrU2q9.mjs +0 -1
- package/dist/preview-CBGJEzmr.mjs +0 -1
- package/dist/public/assets/AgentThreadClientBinder-CDaXXfLH.js +0 -1
- package/dist/public/assets/AppMenubar-CqSGRAc3.js +0 -1
- package/dist/public/assets/CodeMirrorPropInput-BnUZd1PH.js +0 -3
- package/dist/public/assets/EditorModeToggle-nwop4nLB.js +0 -2
- package/dist/public/assets/FeedbackForm-HhQaJvp8.js +0 -1
- package/dist/public/assets/PropertyPanel-DPhBAKy4.js +0 -2
- package/dist/public/assets/SettingsDialogBody-CSEdgzsB.js +0 -7
- package/dist/public/assets/__vite-browser-external-CMoDOr2B.js +0 -1
- package/dist/public/assets/architecture-TIHT7OUA-BmEXwMPm.js +0 -1
- package/dist/public/assets/arrow-up-right-DtHvY6Qg.js +0 -1
- package/dist/public/assets/auth-state-cache-CUE6Jtne.js +0 -11
- package/dist/public/assets/button-B5JstM7q.js +0 -1
- package/dist/public/assets/channel-DnLJ-ZjM.js +0 -1
- package/dist/public/assets/check-DJxEKgxy.js +0 -1
- package/dist/public/assets/checkbox-DgMFNyxc.js +0 -1
- package/dist/public/assets/chevron-left-DemaPXNL.js +0 -1
- package/dist/public/assets/chevron-right-DNxn1CM1.js +0 -1
- package/dist/public/assets/chunk-2Q5K7J3B-Bw7pux3Y.js +0 -1
- package/dist/public/assets/chunk-VAUOI2AC-Dn-E52TZ.js +0 -1
- package/dist/public/assets/chunk-XXDRQBXY-sKXoKzRW.js +0 -1
- package/dist/public/assets/classDiagram-OUVF2IWQ-DnCJ0gX4.js +0 -1
- package/dist/public/assets/classDiagram-v2-EOCWNBFH-Dm_rQEzS.js +0 -1
- package/dist/public/assets/client-version-BCrXgeNu.js +0 -1
- package/dist/public/assets/compiler-runtime-YPpVnfQ-.js +0 -1
- package/dist/public/assets/config-context-Lgd8fBM2.js +0 -1
- package/dist/public/assets/cynefin-VYW2F7L2-BgEeRk9i.js +0 -1
- package/dist/public/assets/dist-B2SLv_cy.js +0 -1
- package/dist/public/assets/dist-BNSJKKYT.js +0 -1
- package/dist/public/assets/dist-CwZTPnUs.js +0 -1
- package/dist/public/assets/dist-DEF-YX4p.js +0 -1
- package/dist/public/assets/dropdown-menu-Br5y3pW-.js +0 -1
- package/dist/public/assets/eventmodeling-45OFAUF4-ZjNWMPgH.js +0 -1
- package/dist/public/assets/flowDiagram-23GEKE2U-emKuZ14A.js +0 -1
- package/dist/public/assets/gitGraph-TEB2WS4Q-DULAthqL.js +0 -1
- package/dist/public/assets/index-Bpb9jEAD.js +0 -2022
- package/dist/public/assets/index-Dghffuut.css +0 -1
- package/dist/public/assets/info-DKCQHKI2-bR6bCx3M.js +0 -1
- package/dist/public/assets/loader-circle-DquHdXOY.js +0 -1
- package/dist/public/assets/mermaid-GHXKKRXX-CmCfs7wO.js +0 -1
- package/dist/public/assets/packet-7NZHBO7P-CcYWaX_e.js +0 -1
- package/dist/public/assets/pie-RZYD4A2V-BDSTcnr_.js +0 -1
- package/dist/public/assets/project-paths-s6FVZ5CP.js +0 -1
- package/dist/public/assets/radar-I7S5WNFK-BxDARIlg.js +0 -1
- package/dist/public/assets/radio-group-CAXEEQ3G.js +0 -1
- package/dist/public/assets/railroad-3IZDKUUU-BCCxSkZw.js +0 -1
- package/dist/public/assets/railroad-abnf-AHOZXSZD-Cuizy3dO.js +0 -1
- package/dist/public/assets/railroad-ebnf-EBAXGLYW-TmaYmurZ.js +0 -1
- package/dist/public/assets/railroad-peg-LSFZ7HO6-DB-VHQzx.js +0 -1
- package/dist/public/assets/stateDiagram-v2-6OUMAXLB-JVqQagQd.js +0 -1
- package/dist/public/assets/swimlanesDiagram-G3AALYLV-DRypLOPY.js +0 -8
- package/dist/public/assets/switch-BHGjWF45.js +0 -1
- package/dist/public/assets/telemetry-startup-BAMftrEk.js +0 -1
- package/dist/public/assets/terminal-input-events-8-6sH7qD.js +0 -1
- package/dist/public/assets/tooltip-BI4ZrlGO.js +0 -1
- package/dist/public/assets/treeView-QDETBFTQ-Dpe2j0i9.js +0 -1
- package/dist/public/assets/treemap-6X3UGDF4-C95sDBTA.js +0 -1
- package/dist/public/assets/use-timeline-entry-diff-BfVMAQlN.js +0 -6
- package/dist/public/assets/wardley-OPB4EBWU-Ce2t1r0s.js +0 -1
- package/dist/public/assets/x-CxAa17gB.js +0 -1
- package/dist/start-8dPNPLii.mjs +0 -1
- /package/dist/public/assets/{agent-presence-DNc33brV.js → agent-presence-D5fVEDeU.js} +0 -0
- /package/dist/public/assets/{array-CymCLnp2.js → array-5xyRnGq4.js} +0 -0
- /package/dist/public/assets/{bundle-mjs-Dy8bHgkj.js → bundle-mjs-SHeFpKGC.js} +0 -0
- /package/dist/public/assets/{chunk-zsgVPwQN.js → chunk-CYidjpOJ.js} +0 -0
- /package/dist/public/assets/{chunk-KEIR6QF5-lISElqQF.js → chunk-KEIR6QF5-6qpXgksS.js} +0 -0
- /package/dist/public/assets/{chunk-Y2CYZVJY-DG6TUVdx.js → chunk-Y2CYZVJY-YF3qT42b.js} +0 -0
- /package/dist/public/assets/{clike-9w8A902Z.js → clike-9DtPTvDi.js} +0 -0
- /package/dist/public/assets/{clipboard-adapter-Drwe8q2F.js → clipboard-adapter-B8XmDGe4.js} +0 -0
- /package/dist/public/assets/{colors-C5iIWSWx.js → colors-DBNHKQeM.js} +0 -0
- /package/dist/public/assets/{cytoscape.esm-o_6HroCP.js → cytoscape.esm-7ouTORdV.js} +0 -0
- /package/dist/public/assets/{defaultLocale-Ci_cmxto.js → defaultLocale-ihAJLooz.js} +0 -0
- /package/dist/public/assets/{desktop-bridge-types-D4yyohEA.js → desktop-bridge-types-BJP-ov02.js} +0 -0
- /package/dist/public/assets/{diff-n4NkdSZN.js → diff-BX2zBrG8.js} +0 -0
- /package/dist/public/assets/{dist-BsjuWfqE.js → dist-0uiGbm0b.js} +0 -0
- /package/dist/public/assets/{dist-AKpDSDgD.js → dist-D9L60t4S.js} +0 -0
- /package/dist/public/assets/{documents-fetch-DjUIhwk3.js → documents-fetch-D6LPbYRt.js} +0 -0
- /package/dist/public/assets/{external-link-I5y7ImPR.js → external-link-CkJSCVND.js} +0 -0
- /package/dist/public/assets/{file-tree-rename-validation-VypXChwN.js → file-tree-rename-validation-BUgsIr8g.js} +0 -0
- /package/dist/public/assets/{floating-ui.dom-DhDEJ-Ns.js → floating-ui.dom-DxCSXcm6.js} +0 -0
- /package/dist/public/assets/{format-Dz9WHgnR.js → format-BBLcLSVu.js} +0 -0
- /package/dist/public/assets/{go-D_ersHVS.js → go-Cmwm8DM7.js} +0 -0
- /package/dist/public/assets/{init-C7ZvyJtv.js → init-BtccacmP.js} +0 -0
- /package/dist/public/assets/{isObject-DaX0mC2K.js → isObject-VshW74Oj.js} +0 -0
- /package/dist/public/assets/{katex-DZtlYSy3.js → katex-BlgnTlTx.js} +0 -0
- /package/dist/public/assets/{libesm-Dk2Xd9ht.js → libesm-BmQ1EgRe.js} +0 -0
- /package/dist/public/assets/{lint-plugin-meta-CZ4Yze5u.js → lint-plugin-meta-ICZKrcJ-.js} +0 -0
- /package/dist/public/assets/{lru-string-cache-mZvIfIzw.js → lru-string-cache-k334Udn4.js} +0 -0
- /package/dist/public/assets/{lua-BZ3SwmRr.js → lua-uCz2GrxX.js} +0 -0
- /package/dist/public/assets/{mcp-consent-store-D6bfXqet.js → mcp-consent-store-Vh9GS7at.js} +0 -0
- /package/dist/public/assets/{min-BNBb-xib.js → min-BVKwPHf7.js} +0 -0
- /package/dist/public/assets/{panzoom.es-ChI1_jtK.js → panzoom.es-BS182qg8.js} +0 -0
- /package/dist/public/assets/{parse-api-error-CWeCvbNN.js → parse-api-error-mt0p1S6a.js} +0 -0
- /package/dist/public/assets/{path-CYY6b8e4.js → path-D5GPuhC0.js} +0 -0
- /package/dist/public/assets/{pdf.worker-DsFSKvhP.js → pdf.worker-qDy_6rvM.js} +0 -0
- /package/dist/public/assets/{perl-FdQByH_S.js → perl-C1bP7rXf.js} +0 -0
- /package/dist/public/assets/{preload-helper-2ej06EnG.js → preload-helper-Chd9yIcd.js} +0 -0
- /package/dist/public/assets/{properties-CBj992v9.js → properties-9eD1XXNO.js} +0 -0
- /package/dist/public/assets/{r-qg1NnfeR.js → r-07m8EdWF.js} +0 -0
- /package/dist/public/assets/{rough.esm-wROa2UhX.js → rough.esm-Cn87Pf5b.js} +0 -0
- /package/dist/public/assets/{ruby-Cg1fwXaw.js → ruby-BQ4RuSdq.js} +0 -0
- /package/dist/public/assets/{shell-CA2_MAbd.js → shell-C7Cp5Nxo.js} +0 -0
- /package/dist/public/assets/{sql-Cr2C6qVg.js → sql-B7qgW1y7.js} +0 -0
- /package/dist/public/assets/{src-CrMlpkn3.js → src-Cuc4Bklf.js} +0 -0
- /package/dist/public/assets/{swift-D3NgIBNg.js → swift-IL6DR1_Z.js} +0 -0
- /package/dist/public/assets/{thread-draft-staging-dd_DuIDX.js → thread-draft-staging-n8iW0G9g.js} +0 -0
- /package/dist/public/assets/{toml-DzNmVe9T.js → toml-C2ndrzEs.js} +0 -0
- /package/dist/public/assets/{trace-api-BEJdTRcX.js → trace-api-DHyWZzIa.js} +0 -0
- /package/dist/public/assets/{w3c-keyname-BPyKWMWB.js → w3c-keyname-DtWCia6R.js} +0 -0
- /package/dist/public/assets/{worktree-store-CcI-M07q.js → worktree-store-BQwOYPdd.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./markdownit-
|
|
2
|
-
import{a as e,i as t,n,o as r,r as i,t as a}from"./chunk-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./markdownit-YwcN3EvW.js","./chunk-CYidjpOJ.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,i as t,n,o as r,r as i,t as a}from"./chunk-CYidjpOJ.js";import{t as o}from"./preload-helper-Chd9yIcd.js";import{n as s,t as c}from"./trace-api-DHyWZzIa.js";import{$ as l,A as u,B as d,C as f,D as p,E as m,F as h,G as g,I as _,J as v,L as y,M as b,N as x,O as S,P as C,Q as w,R as T,S as E,T as ee,U as te,W as D,X as ne,Y as re,Z as ie,_ as ae,a as oe,b as se,c as ce,ct as O,d as k,f as le,g as ue,h as A,it as j,j as de,k as fe,l as pe,lt as me,m as he,mt as ge,n as _e,o as ve,ot as ye,p as M,pt as be,q as xe,r as Se,s as Ce,st as we,t as Te,u as Ee,ut as De,v as Oe,w as ke,x as Ae,y as je,z as Me}from"./lib-Iu39CNZE.js";import{n as Ne,t as Pe}from"./w3c-keyname-DtWCia6R.js";import{n as Fe,t as Ie}from"./markdownit-YwcN3EvW.js";var Le=Symbol.for(`yaml.alias`),Re=Symbol.for(`yaml.document`),ze=Symbol.for(`yaml.map`),Be=Symbol.for(`yaml.pair`),Ve=Symbol.for(`yaml.scalar`),He=Symbol.for(`yaml.seq`),Ue=Symbol.for(`yaml.node.type`),We=e=>!!e&&typeof e==`object`&&e[Ue]===Le,Ge=e=>!!e&&typeof e==`object`&&e[Ue]===Re,Ke=e=>!!e&&typeof e==`object`&&e[Ue]===ze,qe=e=>!!e&&typeof e==`object`&&e[Ue]===Be,Je=e=>!!e&&typeof e==`object`&&e[Ue]===Ve,Ye=e=>!!e&&typeof e==`object`&&e[Ue]===He;function Xe(e){if(e&&typeof e==`object`)switch(e[Ue]){case ze:case He:return!0}return!1}function Ze(e){if(e&&typeof e==`object`)switch(e[Ue]){case Le:case ze:case Ve:case He:return!0}return!1}var Qe=e=>(Je(e)||Xe(e))&&!!e.anchor,$e=Symbol(`break visit`),et=Symbol(`skip children`),tt=Symbol(`remove node`);function nt(e,t){let n=ot(t);Ge(e)?rt(null,e.contents,n,Object.freeze([e]))===tt&&(e.contents=null):rt(null,e,n,Object.freeze([]))}nt.BREAK=$e,nt.SKIP=et,nt.REMOVE=tt;function rt(e,t,n,r){let i=st(e,t,n,r);if(Ze(i)||qe(i))return ct(e,r,i),rt(e,i,n,r);if(typeof i!=`symbol`){if(Xe(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=rt(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===$e)return $e;else i===tt&&(t.items.splice(e,1),--e)}}else if(qe(t)){r=Object.freeze(r.concat(t));let e=rt(`key`,t.key,n,r);if(e===$e)return $e;e===tt&&(t.key=null);let i=rt(`value`,t.value,n,r);if(i===$e)return $e;i===tt&&(t.value=null)}}return i}async function it(e,t){let n=ot(t);Ge(e)?await at(null,e.contents,n,Object.freeze([e]))===tt&&(e.contents=null):await at(null,e,n,Object.freeze([]))}it.BREAK=$e,it.SKIP=et,it.REMOVE=tt;async function at(e,t,n,r){let i=await st(e,t,n,r);if(Ze(i)||qe(i))return ct(e,r,i),at(e,i,n,r);if(typeof i!=`symbol`){if(Xe(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await at(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===$e)return $e;else i===tt&&(t.items.splice(e,1),--e)}}else if(qe(t)){r=Object.freeze(r.concat(t));let e=await at(`key`,t.key,n,r);if(e===$e)return $e;e===tt&&(t.key=null);let i=await at(`value`,t.value,n,r);if(i===$e)return $e;i===tt&&(t.value=null)}}return i}function ot(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function st(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(Ke(t))return n.Map?.(e,t,r);if(Ye(t))return n.Seq?.(e,t,r);if(qe(t))return n.Pair?.(e,t,r);if(Je(t))return n.Scalar?.(e,t,r);if(We(t))return n.Alias?.(e,t,r)}function ct(e,t,n){let r=t[t.length-1];if(Xe(r))r.items[e]=n;else if(qe(r))e===`key`?r.key=n:r.value=n;else if(Ge(r))r.contents=n;else{let e=We(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var lt={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},ut=e=>e.replace(/[!,[\]{}]/g,e=>lt[e]),dt=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+ut(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&Ze(e.contents)){let t={};nt(e.contents,(e,n)=>{Ze(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
3
3
|
`)}};dt.defaultYaml={explicit:!1,version:`1.2`},dt.defaultTags={"!!":`tag:yaml.org,2002:`};function ft(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function pt(e){let t=new Set;return nt(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function mt(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function ht(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=pt(e);let a=mt(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(Je(t.node)||Xe(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function gt(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=gt(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=gt(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=gt(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=gt(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function _t(e,t,n){if(Array.isArray(e))return e.map((e,t)=>_t(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Qe(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var vt=class{constructor(e){Object.defineProperty(this,Ue,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Ge(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=_t(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?gt(i,{"":o},``,o):o}},yt=class extends vt{constructor(e){super(Le),this.source=e,Object.defineProperty(this,`tag`,{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],nt(e,{Node:(e,t)=>{(We(t)||Qe(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(_t(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=bt(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(ft(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function bt(e,t,n){if(We(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Xe(t)){let r=0;for(let i of t.items){let t=bt(e,i,n);t>r&&(r=t)}return r}else if(qe(t)){let r=bt(e,t.key,n),i=bt(e,t.value,n);return Math.max(r,i)}return 1}var xt=e=>!e||typeof e!=`function`&&typeof e!=`object`,N=class extends vt{constructor(e){super(Ve),this.value=e}toJSON(e,t){return t?.keep?this.value:_t(this.value,e,t)}toString(){return String(this.value)}};N.BLOCK_FOLDED=`BLOCK_FOLDED`,N.BLOCK_LITERAL=`BLOCK_LITERAL`,N.PLAIN=`PLAIN`,N.QUOTE_DOUBLE=`QUOTE_DOUBLE`,N.QUOTE_SINGLE=`QUOTE_SINGLE`;var St=`tag:yaml.org,2002:`;function Ct(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function wt(e,t,n){if(Ge(e)&&(e=e.contents),Ze(e))return e;if(qe(e)){let t=n.schema[ze].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??=i(e),new yt(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=St+t.slice(2));let l=Ct(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new N(e);return c&&(c.node=t),t}l=e instanceof Map?o[ze]:Symbol.iterator in Object(e)?o[He]:o[ze]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new N(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Tt(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return wt(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var Et=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,Dt=class extends vt{constructor(e,t){super(e),Object.defineProperty(this,`schema`,{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>Ze(t)||qe(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Et(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(Xe(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Tt(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(Xe(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&Je(i)?i.value:i:Xe(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!qe(t))return!1;let n=t.value;return n==null||e&&Je(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return Xe(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(Xe(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,Tt(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},Ot=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function kt(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var At=(e,t,n)=>e.endsWith(`
|
|
4
4
|
`)?kt(n,t):n.includes(`
|
|
5
5
|
`)?`
|
|
@@ -298,11 +298,11 @@ ${n}`}}),s}var uT=new WeakMap;function dT(e,t){let n=uT.get(e);if(!n){let t={cal
|
|
|
298
298
|
`,hD=`️`,gD=``,_D=``,vD=null,yD=null;function bD(e=[]){let t={};nE.groups=t;let n=new nE;vD??=wD(VT),yD??=wD(HT),Y(n,`'`,FE),Y(n,`{`,vE),Y(n,`}`,yE),Y(n,`[`,bE),Y(n,`]`,xE),Y(n,`(`,SE),Y(n,`)`,CE),Y(n,`<`,wE),Y(n,`>`,TE),Y(n,`(`,EE),Y(n,`)`,DE),Y(n,`「`,OE),Y(n,`」`,kE),Y(n,`『`,AE),Y(n,`』`,jE),Y(n,`<`,ME),Y(n,`>`,NE),Y(n,`&`,PE),Y(n,`*`,IE),Y(n,`@`,LE),Y(n,"`",zE),Y(n,`^`,BE),Y(n,`:`,VE),Y(n,`,`,HE),Y(n,`$`,UE),Y(n,`.`,WE),Y(n,`=`,GE),Y(n,`!`,KE),Y(n,`-`,qE),Y(n,`%`,JE),Y(n,`|`,YE),Y(n,`+`,XE),Y(n,`#`,ZE),Y(n,`?`,QE),Y(n,`"`,$E),Y(n,`/`,nD),Y(n,`;`,tD),Y(n,`~`,rD),Y(n,`_`,iD),Y(n,`\\`,RE),Y(n,`・`,eD);let r=iE(n,dD,hE,{[UT]:!0});iE(r,dD,r);let i=iE(r,cD,cE,{[KT]:!0}),a=iE(r,lD,lE,{[qT]:!0}),o=iE(n,cD,oE,{[WT]:!0});iE(o,dD,i),iE(o,cD,o),iE(i,dD,i),iE(i,cD,i);let s=iE(n,lD,sE,{[GT]:!0});iE(s,cD),iE(s,dD,a),iE(s,lD,s),iE(a,dD,a),iE(a,cD),iE(a,lD,a);let c=Y(n,mD,_E,{[QT]:!0}),l=Y(n,pD,gE,{[QT]:!0}),u=iE(n,fD,gE,{[QT]:!0});Y(n,_D,u),Y(l,mD,c),Y(l,_D,u),iE(l,fD,u),Y(u,pD),Y(u,mD),iE(u,fD,u),Y(u,_D,u);let d=iE(n,uD,aD,{[YT]:!0});Y(d,`#`),iE(d,uD,d),Y(d,hD,d);let f=Y(d,gD);Y(f,`#`),iE(f,uD,d);let p=[[cD,o],[dD,i]],m=[[cD,null],[lD,s],[dD,a]];for(let e=0;e<vD.length;e++)CD(n,vD[e],dE,oE,p);for(let e=0;e<yD.length;e++)CD(n,yD[e],fE,sE,m);eE(dE,{tld:!0,ascii:!0},t),eE(fE,{utld:!0,alpha:!0},t),CD(n,`file`,pE,oE,p),CD(n,`mailto`,pE,oE,p),CD(n,`http`,mE,oE,p),CD(n,`https`,mE,oE,p),CD(n,`ftp`,mE,oE,p),CD(n,`ftps`,mE,oE,p),eE(pE,{scheme:!0,ascii:!0},t),eE(mE,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[XT]:!0}:{[ZT]:!0};r.indexOf(`-`)>=0?i[JT]=!0:cD.test(r)?dD.test(r)?i[KT]=!0:i[WT]=!0:i[UT]=!0,aE(n,r,r,i)}return aE(n,`localhost`,uE,{ascii:!0}),n.jd=new nE(oD),{start:n,tokens:Object.assign({groups:t},sD)}}function xD(e,t){let n=SD(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function SD(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function CD(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new nE(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new nE(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function wD(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var TD={defaultProtocol:`http`,events:null,format:DD,formatHref:DD,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function ED(e,t=null){let n=Object.assign({},TD);e&&(n=Object.assign(n,e instanceof ED?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}ED.prototype={o:TD,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:TD[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function DD(e){return e}function OD(e,t){this.t=`token`,this.v=e,this.tk=t}OD.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=TD.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function kD(e,t){class n extends OD{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var AD=kD(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),jD=kD(`text`),MD=kD(`nl`),ND=kD(`url`,{isLink:!0,toHref(e=TD.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==uE&&e[1].t===VE}}),PD=e=>new nE(e);function FD({groups:e}){let t=e.domain.concat([PE,IE,LE,RE,zE,BE,UE,GE,qE,hE,JE,YE,XE,ZE,nD,oD,rD,iD]),n=[FE,VE,HE,WE,KE,JE,QE,$E,tD,wE,TE,vE,yE,xE,bE,SE,CE,EE,DE,OE,kE,AE,jE,ME,NE],r=[PE,FE,IE,RE,zE,BE,UE,GE,qE,vE,yE,JE,YE,XE,ZE,QE,nD,oD,rD,iD],i=PD(),a=Y(i,rD);rE(a,r,a),rE(a,e.domain,a);let o=PD(),s=PD(),c=PD();rE(i,e.domain,o),rE(i,e.scheme,s),rE(i,e.slashscheme,c),rE(o,r,a),rE(o,e.domain,o);let l=Y(o,LE);Y(a,LE,l),Y(s,LE,l),Y(c,LE,l);let u=Y(a,WE);rE(u,r,a),rE(u,e.domain,a);let d=PD();rE(l,e.domain,d),rE(d,e.domain,d);let f=Y(d,WE);rE(f,e.domain,d);let p=PD(AD);rE(f,e.tld,p),rE(f,e.utld,p),Y(l,uE,p);let m=Y(d,qE);Y(m,qE,m),rE(m,e.domain,d),rE(p,e.domain,d),Y(p,WE,f),Y(p,qE,m);let h=Y(o,qE),g=Y(o,WE);Y(h,qE,h),rE(h,e.domain,o),rE(g,r,a),rE(g,e.domain,o);let _=PD(ND);rE(g,e.tld,_),rE(g,e.utld,_),rE(_,e.domain,o),rE(_,r,a),Y(_,WE,g),Y(_,qE,h),Y(_,LE,l);let v=Y(_,VE),y=PD(ND);rE(v,e.numeric,y);let b=PD(ND),x=PD();rE(b,t,b),rE(b,n,x),rE(x,t,b),rE(x,n,x),Y(_,nD,b),Y(y,nD,b);let S=Y(s,VE),C=Y(Y(Y(c,VE),nD),nD);rE(s,e.domain,o),Y(s,WE,g),Y(s,qE,h),rE(c,e.domain,o),Y(c,WE,g),Y(c,qE,h),rE(S,e.domain,b),Y(S,nD,b),Y(S,QE,b),rE(C,e.domain,b),rE(C,t,b),Y(C,nD,b);let w=[[vE,yE],[bE,xE],[SE,CE],[wE,TE],[EE,DE],[OE,kE],[AE,jE],[ME,NE]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=Y(b,r);Y(x,r,a);let o=PD(ND);rE(a,t,o);let s=PD();rE(a,n,s),Y(a,i,b),rE(o,t,o),rE(o,n,s),rE(s,t,o),rE(s,n,s),Y(o,i,b),Y(s,i,b)}return Y(i,uE,_),Y(i,_E,MD),{start:i,tokens:sD}}function ID(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(LD(jD,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(LD(e,t,r))}}return o.length>0&&a.push(LD(jD,t,o)),a}function LD(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var RD=typeof console<`u`&&console&&console.warn||(()=>{}),zD=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,BD={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function VD(){return nE.groups={},BD.scanner=null,BD.parser=null,BD.tokenQueue=[],BD.pluginQueue=[],BD.customSchemes=[],BD.initialized=!1,BD}function HD(e,t=!1){if(BD.initialized&&RD(`linkifyjs: already initialized - will not register custom scheme "${e}" ${zD}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
|
|
299
299
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
300
300
|
2. Cannot start or end with "-"
|
|
301
|
-
3. "-" cannot repeat`);BD.customSchemes.push([e,t])}function UD(){BD.scanner=bD(BD.customSchemes);for(let e=0;e<BD.tokenQueue.length;e++)BD.tokenQueue[e][1]({scanner:BD.scanner});BD.parser=FD(BD.scanner.tokens);for(let e=0;e<BD.pluginQueue.length;e++)BD.pluginQueue[e][1]({scanner:BD.scanner,parser:BD.parser});return BD.initialized=!0,BD}function WD(e){return BD.initialized||UD(),ID(BD.parser.start,e,xD(BD.scanner.start,e))}WD.scan=xD;function GD(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new ED(n),i=WD(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var KD=`[\0- \xA0 -\u2029 ]`,qD=new RegExp(KD),JD=RegExp(`${KD}$`),YD=new RegExp(KD,`g`);function XD(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function ZD(e){return new ig({key:new sg(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(CC(WS(n.doc,[...t])).forEach(({newRange:t})=>{let n=qS(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!JD.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(qD).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=WD(n).map(t=>t.toObject(e.defaultProtocol));if(!XD(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{wC(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function QD(e){return new ig({key:new sg(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=bC(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function $D(e){return new ig({key:new sg(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=GD(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function eO(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(YD,``).match(RegExp(`^(?:(?:${n.join(`|`)}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,`i`))}var tO=xw.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){HD(e);return}HD(e.scheme,e.optionalSlashes)})},onDestroy(){VD()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!eO(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!eO(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!eO(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,aC(this.options.HTMLAttributes,e),0]:[`a`,aC(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!eO(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!eO(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addPasteRules(){return[gT({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=GD(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!eO(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(ZD({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!eO(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(QD({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push($D({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),nO=tO,rO=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,iO=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,aO=xw.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,aC(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)([^=]+)(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Kw({find:rO,type:this.type})]},addPasteRules(){return[gT({find:iO,type:this.type})]}}),oO,sO;if(typeof WeakMap<`u`){let e=new WeakMap;oO=t=>e.get(t),sO=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;oO=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},sO=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var cO=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return oO(e)||sO(e,lO(e))}};function lO(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=uO(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new cO(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&dO(s,o,e),s}function uO(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function dO(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=fO(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function fO(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function pO(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var mO=new sg(`selectingCells`);function hO(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function gO(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function _O(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function vO(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=hO(t.$head)||yO(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function yO(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function bO(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function xO(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function SO(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function CO(e,t,n){let r=e.node(-1),i=cO.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function wO(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function TO(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function EO(e,t,n){let r=pO(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var DO=class e extends G{constructor(e,t=e){let n=e.node(-1),r=cO.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new Wh(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(bO(r)&&bO(i)&&SO(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return K.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=cO.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=wO(e,0,l)),u>0&&(e=wO(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(U.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new W(U.from(o),1,1)}replace(e,t=W.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?W.empty:t)}let i=G.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new W(U.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=cO.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=cO.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=cO.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=cO.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new OO(this.$anchorCell.pos,this.$headCell.pos)}};DO.prototype.visible=!1,G.jsonID(`cell`,DO);var OO=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&SO(t,n)?new DO(t,n):G.near(n,1)}};function kO(e){if(!(e.selection instanceof DO))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(Ab.node(n,n+e.nodeSize,{class:`selectedCell`}))}),Nb.create(e.doc,t)}function AO({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function jO({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function MO(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof q&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=DO.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=DO.rowSelection(e,e)}else if(!n){let e=cO.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=DO.create(i,t+1,n)}}else r instanceof K&&AO(r)?a=K.create(i,r.from):r instanceof K&&jO(r)&&(a=K.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var NO=new sg(`fix-tables`);function PO(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?PO(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function FO(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=See(e,t,r,n))};return t?t.doc!=e.doc&&PO(t.doc,e.doc,0,r):e.doc.descendants(r),n}function See(e,t,n,r){let i=cO.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,wO(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=pO(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(NO,{fixTables:!0})}function Cee(e){return wee(e=>e.type.spec.tableRole===`table`,e)}function wee(e,t){for(let n=t.depth;n>=0;--n){let r=t.node(n);if(e(r))return{node:r,pos:n===0?0:t.before(n),start:t.start(n),depth:n}}return null}function IO(e){let t=e.selection,n=vO(e),r=n.node(-1),i=n.start(-1),a=cO.get(r);return{...t instanceof DO?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function LO(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;EO(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,TO(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?pO(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function Tee(e,t){if(!_O(e))return!1;if(t){let n=IO(e);t(LO(e.tr,n,n.left))}return!0}function Eee(e,t){if(!_O(e))return!1;if(t){let n=IO(e);t(LO(e.tr,n,n.right))}return!0}function Dee(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,wO(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function Oee(e,t){if(!_O(e))return!1;if(t){let n=IO(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;Dee(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=cO.get(e)}t(r)}return!0}function kee(e,t,n){let r=pO(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function RO(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;kee(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?pO(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,pO(r.type.schema).row.create(null,o)),e}function Aee(e,t){if(!_O(e))return!1;if(t){let n=IO(e);t(RO(e.tr,n,n.top))}return!0}function jee(e,t){if(!_O(e))return!1;if(t){let n=IO(e);t(RO(e.tr,n,n.bottom))}return!0}function Mee(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function Nee(e,t){if(!_O(e))return!1;if(t){let n=IO(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;Mee(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=cO.get(n.table)}t(r)}return!0}function zO(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Pee({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function BO(e,t){let n=e.selection;if(!(n instanceof DO)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=IO(e),{map:i}=r;if(Pee(i,r))return!1;if(t){let n=e.tr,a={},o=U.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{zO(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...TO(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=zO(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new DO(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function VO(e,t){let n=pO(e.schema);return Fee(({node:e})=>n[e.type.spec.tableRole])(e,t)}function Fee(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof DO){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=gO(r.$from),!i)return!1;a=hO(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=IO(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof DO&&u.setSelection(new DO(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function Iee(e,t){return function(n,r){if(!_O(n))return!1;let i=vO(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof DO?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function Lee(e){return function(t,n){if(!_O(t))return!1;if(n){let r=pO(t.schema),i=IO(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function HO(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function UO(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?Lee(e):function(t,n){if(!_O(t))return!1;if(n){let r=pO(t.schema),i=IO(t),a=t.tr,o=HO(`row`,i,r),s=HO(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}UO(`row`,{useDeprecatedLogic:!0}),UO(`column`,{useDeprecatedLogic:!0});var Ree=UO(`cell`,{useDeprecatedLogic:!0});function zee(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function WO(e){return function(t,n){if(!_O(t))return!1;let r=zee(vO(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(K.between(e,xO(e))).scrollIntoView())}return!0}}function Bee(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function GO(e,t){let n=e.selection;if(!(n instanceof DO))return!1;if(t){let r=e.tr,i=pO(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new W(i,0,0))}),r.docChanged&&t(r)}return!0}function Vee(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=KO(pO(o).row,new W(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?KO(pO(o).row,new W(t,n,r)).content:t);else return null;return Hee(o,s)}function Hee(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(U.empty),n[i]<r){let a=pO(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(U.from(o))}return{height:t.length,width:r,rows:t}}function KO(e,t){let n=e.createAndFill();return new Hh(n).replace(0,n.content.size,t).doc}function Uee({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(wO(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(U.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(U.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function Wee(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=pO(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,U.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function qO(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function JO(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,wO(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(wO(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function YO(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=cO.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=cO.get(a),f=d.mapping.maps.length}Wee(d,o,a,n,l,u,f)&&p(),qO(d,o,a,n,c,l,s,f)&&p(),qO(d,o,a,n,c,l,u,f)&&p(),JO(d,o,a,n,s,u,c,f)&&p(),JO(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new W(i.rows[e-s],0,0))}p(),d.setSelection(new DO(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var Gee=Dx({ArrowLeft:ZO(`horiz`,-1),ArrowRight:ZO(`horiz`,1),ArrowUp:ZO(`vert`,-1),ArrowDown:ZO(`vert`,1),"Shift-ArrowLeft":QO(`horiz`,-1),"Shift-ArrowRight":QO(`horiz`,1),"Shift-ArrowUp":QO(`vert`,-1),"Shift-ArrowDown":QO(`vert`,1),Backspace:GO,"Mod-Backspace":GO,Delete:GO,"Mod-Delete":GO});function XO(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function ZO(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof DO)return XO(n,r,G.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=$O(i,e,t);if(o==null)return!1;if(e==`horiz`)return XO(n,r,G.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=CO(i,e,t),s;return s=a?G.near(a,1):t<0?G.near(n.doc.resolve(i.before(-1)),-1):G.near(n.doc.resolve(i.after(-1)),1),XO(n,r,s)}}}function QO(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof DO)o=a;else{let r=$O(i,e,t);if(r==null)return!1;o=new DO(n.doc.resolve(r))}let s=CO(o.$headCell,e,t);return s?XO(n,r,new DO(o.$anchorCell,s)):!1}}function Kee(e,t){let n=e.state.doc,r=hO(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new DO(r))),!0):!1}function qee(e,t,n){if(!_O(e.state))return!1;let r=Vee(n),i=e.state.selection;if(i instanceof DO){r||={width:1,height:1,rows:[U.from(KO(pO(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=cO.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=Uee(r,o.right-o.left,o.bottom-o.top),YO(e.state,e.dispatch,a,o,r),!0}else if(r){let t=vO(e.state),n=t.start(-1);return YO(e.state,e.dispatch,n,cO.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function Jee(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=ek(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof DO)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=hO(e.state.selection.$anchor))!=null&&tk(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=tk(e,n),i=mO.getState(e.state)==null;if(!r||!SO(t,r))if(i)r=t;else return;let a=new DO(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(mO,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),mO.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(mO,-1))}function o(r){let o=r,s=mO.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(ek(e,o.target)!=n&&(c=tk(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function $O(e,t,n){if(!(e.state.selection instanceof K))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function ek(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function tk(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&hO(e.state.doc.resolve(r))||hO(e.state.doc.resolve(i))}var Yee=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),nk(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,nk(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function nk(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var rk=new sg(`tableColumnResizing`);function Xee({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=Yee,lastColumnResizable:i=!0}={}){let a=new ig({key:rk,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=pO(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new Zee(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=rk.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{Qee(t,n,e,i)},mouseleave:e=>{ik(e)},mousedown:(e,r)=>{ak(e,r,t,n)}},decorations:e=>{let t=rk.getState(e);if(t&&t.activeHandle>-1)return mk(e,t.activeHandle)},nodeViews:{}}});return a}var Zee=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(rk);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return bO(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function Qee(e,t,n,r){if(!e.editable)return;let i=rk.getState(e.state);if(i&&!i.dragging){let a=sk(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=ck(e,t,`left`,n):i-t.clientX<=n&&(o=ck(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=cO.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}uk(e,o)}}}function ik(e){if(!e.editable)return;let t=rk.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&uk(e,-1)}function ak(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=rk.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=ok(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(rk,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=rk.getState(e.state);r?.dragging&&(dk(e,r.activeHandle,lk(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(rk,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=rk.getState(e.state);if(i&&i.dragging){let a=lk(i.dragging,t,n);fk(e,i.activeHandle,a,r)}}return fk(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function ok(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function sk(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function ck(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=hO(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=cO.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function lk(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function uk(e,t){e.dispatch(e.state.tr.setMeta(rk,{setHandle:t}))}function dk(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=cO.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():pk(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function fk(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=cO.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&nk(a,c.firstChild,c,r,s,n)}function pk(e){return Array(e).fill(0)}function mk(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return Nb.empty;let a=cO.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,rk.getState(e)?.dragging&&n.push(Ab.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(Ab.widget(s,c))}}return Nb.create(e.doc,n)}function hk({allowTableNodeSelection:e=!1}={}){return new ig({key:mO,state:{init(){return null},apply(e,t){let n=e.getMeta(mO);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:kO,handleDOMEvents:{mousedown:Jee},createSelectionBetween(e){return mO.getState(e.state)==null?null:e.state.selection},handleTripleClick:Kee,handleKeyDown:Gee,handlePaste:qee},appendTransaction(t,n,r){return MO(r,FO(r,n),e)}})}function gk(e){return e===`left`||e===`right`||e===`center`?e:null}function _k(e){let t=(e.style.textAlign||``).trim().toLowerCase(),n=(e.getAttribute(`align`)||``).trim().toLowerCase();return gk(t||n)}function vk(e){return gk(e?.align)}function yk(){return{default:null,parseHTML:e=>_k(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}var bk=mT.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`),n=t?t.split(`,`).map(e=>parseInt(e,10)):null;if(!n){let t=e.closest(`table`)?.querySelectorAll(`colgroup > col`),n=Array.from(e.parentElement?.children||[]).indexOf(e);if(n&&n>-1&&t&&t[n]){let e=t[n].getAttribute(`width`);return e?[parseInt(e,10)]:null}}return n}},align:yk()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,aC(this.options.HTMLAttributes,e),0]}}),xk=mT.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}},align:yk()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,aC(this.options.HTMLAttributes,e),0]}}),Sk=mT.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,aC(this.options.HTMLAttributes,e),0]}});function Ck(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function wk(e,t,n,r,i,a){var o;let s=0,c=!0,l=t.firstChild,u=e.firstChild;if(u!==null)for(let e=0,n=0;e<u.childCount;e+=1){let{colspan:o,colwidth:d}=u.child(e).attrs;for(let e=0;e<o;e+=1,n+=1){let o=i===n?a:d&&d[e],u=o?`${o}px`:``;if(s+=o||r,o||(c=!1),l){if(l.style.width!==u){let[e,t]=Ck(r,o);l.style.setProperty(e,t)}l=l.nextSibling}else{let e=document.createElement(`col`),[n,i]=Ck(r,o);e.style.setProperty(n,i),t.appendChild(e)}}}for(;l;){let e=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);c&&!d?(n.style.width=`${s}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${s}px`)}var Tk=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),wk(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type===this.node.type?(this.node=e,wk(e,this.colgroup,this.table,this.cellMinWidth),!0):!1}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!(n&&!r&&(e.type===`attributes`||e.type===`childList`||e.type===`characterData`))}};function Ek(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=Ck(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function Dk(e,t){return t?e.createChecked(null,t):e.createAndFill()}function Ok(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function kk(e,t,n,r,i){let a=Ok(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=Dk(a.cell,i);if(e&&s.push(e),r){let e=Dk(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function Ak(e){return e instanceof DO}var jk=({editor:e})=>{let{selection:t}=e.state;if(!Ak(t))return!1;let n=0;return JS(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1};function Mk(e){return(e||``).replace(/\s+/g,` `).trim()}function Nk(e,t,n={}){let r=n.cellLineSeparator??``;if(!e||!e.content||e.content.length===0)return``;let i=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let i=``;i=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(r):e.content?t.renderChildren(e.content):``;let a=Mk(i),o=e.type===`tableHeader`,s=vk(e.attrs);n.push({text:a,isHeader:o,align:s})}),i.push(n)});let a=i.reduce((e,t)=>Math.max(e,t.length),0);if(a===0)return``;let o=Array(a).fill(0);i.forEach(e=>{for(let t=0;t<a;t+=1){let n=(e[t]?.text||``).length;n>o[t]&&(o[t]=n),o[t]<3&&(o[t]=3)}});let s=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),c=i[0],l=c.some(e=>e.isHeader),u=Array(a).fill(null);i.forEach(e=>{for(let t=0;t<a;t+=1)!u[t]&&e[t]?.align&&(u[t]=e[t].align)});let d=`
|
|
301
|
+
3. "-" cannot repeat`);BD.customSchemes.push([e,t])}function UD(){BD.scanner=bD(BD.customSchemes);for(let e=0;e<BD.tokenQueue.length;e++)BD.tokenQueue[e][1]({scanner:BD.scanner});BD.parser=FD(BD.scanner.tokens);for(let e=0;e<BD.pluginQueue.length;e++)BD.pluginQueue[e][1]({scanner:BD.scanner,parser:BD.parser});return BD.initialized=!0,BD}function WD(e){return BD.initialized||UD(),ID(BD.parser.start,e,xD(BD.scanner.start,e))}WD.scan=xD;function GD(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new ED(n),i=WD(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var KD=`[\0- \xA0 -\u2029 ]`,qD=new RegExp(KD),JD=RegExp(`${KD}$`),YD=new RegExp(KD,`g`);function XD(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function ZD(e){return new ig({key:new sg(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(CC(WS(n.doc,[...t])).forEach(({newRange:t})=>{let n=qS(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!JD.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(qD).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=WD(n).map(t=>t.toObject(e.defaultProtocol));if(!XD(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{wC(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function QD(e){return new ig({key:new sg(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=bC(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function $D(e){return new ig({key:new sg(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=GD(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function eO(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(YD,``).match(RegExp(`^(?:(?:${n.join(`|`)}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,`i`))}var tO=xw.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){HD(e);return}HD(e.scheme,e.optionalSlashes)})},onDestroy(){VD()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!eO(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!eO(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!eO(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,aC(this.options.HTMLAttributes,e),0]:[`a`,aC(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!eO(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!eO(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addPasteRules(){return[gT({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=GD(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!eO(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(ZD({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!eO(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(QD({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push($D({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),nO=tO,rO=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,iO=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,aO=xw.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,aC(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)([^=]+)(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Kw({find:rO,type:this.type})]},addPasteRules(){return[gT({find:iO,type:this.type})]}}),oO,sO;if(typeof WeakMap<`u`){let e=new WeakMap;oO=t=>e.get(t),sO=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;oO=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},sO=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var cO=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return oO(e)||sO(e,lO(e))}};function lO(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=uO(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new cO(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&dO(s,o,e),s}function uO(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function dO(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=fO(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function fO(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function pO(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var mO=new sg(`selectingCells`);function hO(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function gO(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function _O(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function vO(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=hO(t.$head)||yO(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function yO(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function bO(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function xO(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function SO(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function CO(e,t,n){let r=e.node(-1),i=cO.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function wO(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function TO(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function EO(e,t,n){let r=pO(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var DO=class e extends G{constructor(e,t=e){let n=e.node(-1),r=cO.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new Wh(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(bO(r)&&bO(i)&&SO(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return K.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=cO.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=wO(e,0,l)),u>0&&(e=wO(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(U.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new W(U.from(o),1,1)}replace(e,t=W.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?W.empty:t)}let i=G.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new W(U.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=cO.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=cO.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=cO.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=cO.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new OO(this.$anchorCell.pos,this.$headCell.pos)}};DO.prototype.visible=!1,G.jsonID(`cell`,DO);var OO=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&SO(t,n)?new DO(t,n):G.near(n,1)}};function kO(e){if(!(e.selection instanceof DO))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(Ab.node(n,n+e.nodeSize,{class:`selectedCell`}))}),Nb.create(e.doc,t)}function AO({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function jO({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function MO(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof q&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=DO.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=DO.rowSelection(e,e)}else if(!n){let e=cO.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=DO.create(i,t+1,n)}}else r instanceof K&&AO(r)?a=K.create(i,r.from):r instanceof K&&jO(r)&&(a=K.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var NO=new sg(`fix-tables`);function PO(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?PO(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function FO(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=IO(e,t,r,n))};return t?t.doc!=e.doc&&PO(t.doc,e.doc,0,r):e.doc.descendants(r),n}function IO(e,t,n,r){let i=cO.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,wO(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=pO(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(NO,{fixTables:!0})}function See(e){return Cee(e=>e.type.spec.tableRole===`table`,e)}function Cee(e,t){for(let n=t.depth;n>=0;--n){let r=t.node(n);if(e(r))return{node:r,pos:n===0?0:t.before(n),start:t.start(n),depth:n}}return null}function LO(e){let t=e.selection,n=vO(e),r=n.node(-1),i=n.start(-1),a=cO.get(r);return{...t instanceof DO?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function RO(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;EO(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,TO(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?pO(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function wee(e,t){if(!_O(e))return!1;if(t){let n=LO(e);t(RO(e.tr,n,n.left))}return!0}function Tee(e,t){if(!_O(e))return!1;if(t){let n=LO(e);t(RO(e.tr,n,n.right))}return!0}function Eee(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,wO(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function Dee(e,t){if(!_O(e))return!1;if(t){let n=LO(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;Eee(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=cO.get(e)}t(r)}return!0}function Oee(e,t,n){let r=pO(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function zO(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;Oee(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?pO(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,pO(r.type.schema).row.create(null,o)),e}function kee(e,t){if(!_O(e))return!1;if(t){let n=LO(e);t(zO(e.tr,n,n.top))}return!0}function Aee(e,t){if(!_O(e))return!1;if(t){let n=LO(e);t(zO(e.tr,n,n.bottom))}return!0}function jee(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function Mee(e,t){if(!_O(e))return!1;if(t){let n=LO(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;jee(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=cO.get(n.table)}t(r)}return!0}function BO(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Nee({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function VO(e,t){let n=e.selection;if(!(n instanceof DO)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=LO(e),{map:i}=r;if(Nee(i,r))return!1;if(t){let n=e.tr,a={},o=U.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{BO(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...TO(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=BO(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new DO(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function HO(e,t){let n=pO(e.schema);return Pee(({node:e})=>n[e.type.spec.tableRole])(e,t)}function Pee(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof DO){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=gO(r.$from),!i)return!1;a=hO(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=LO(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof DO&&u.setSelection(new DO(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function Fee(e,t){return function(n,r){if(!_O(n))return!1;let i=vO(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof DO?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function Iee(e){return function(t,n){if(!_O(t))return!1;if(n){let r=pO(t.schema),i=LO(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function UO(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function WO(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?Iee(e):function(t,n){if(!_O(t))return!1;if(n){let r=pO(t.schema),i=LO(t),a=t.tr,o=UO(`row`,i,r),s=UO(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}WO(`row`,{useDeprecatedLogic:!0}),WO(`column`,{useDeprecatedLogic:!0});var Lee=WO(`cell`,{useDeprecatedLogic:!0});function Ree(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function GO(e){return function(t,n){if(!_O(t))return!1;let r=Ree(vO(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(K.between(e,xO(e))).scrollIntoView())}return!0}}function zee(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function KO(e,t){let n=e.selection;if(!(n instanceof DO))return!1;if(t){let r=e.tr,i=pO(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new W(i,0,0))}),r.docChanged&&t(r)}return!0}function Bee(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=qO(pO(o).row,new W(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?qO(pO(o).row,new W(t,n,r)).content:t);else return null;return Vee(o,s)}function Vee(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(U.empty),n[i]<r){let a=pO(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(U.from(o))}return{height:t.length,width:r,rows:t}}function qO(e,t){let n=e.createAndFill();return new Hh(n).replace(0,n.content.size,t).doc}function Hee({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(wO(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(U.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(U.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function Uee(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=pO(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,U.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function JO(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function YO(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,wO(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(wO(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function XO(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=cO.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=cO.get(a),f=d.mapping.maps.length}Uee(d,o,a,n,l,u,f)&&p(),JO(d,o,a,n,c,l,s,f)&&p(),JO(d,o,a,n,c,l,u,f)&&p(),YO(d,o,a,n,s,u,c,f)&&p(),YO(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new W(i.rows[e-s],0,0))}p(),d.setSelection(new DO(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var Wee=Dx({ArrowLeft:QO(`horiz`,-1),ArrowRight:QO(`horiz`,1),ArrowUp:QO(`vert`,-1),ArrowDown:QO(`vert`,1),"Shift-ArrowLeft":$O(`horiz`,-1),"Shift-ArrowRight":$O(`horiz`,1),"Shift-ArrowUp":$O(`vert`,-1),"Shift-ArrowDown":$O(`vert`,1),Backspace:KO,"Mod-Backspace":KO,Delete:KO,"Mod-Delete":KO});function ZO(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function QO(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof DO)return ZO(n,r,G.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=ek(i,e,t);if(o==null)return!1;if(e==`horiz`)return ZO(n,r,G.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=CO(i,e,t),s;return s=a?G.near(a,1):t<0?G.near(n.doc.resolve(i.before(-1)),-1):G.near(n.doc.resolve(i.after(-1)),1),ZO(n,r,s)}}}function $O(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof DO)o=a;else{let r=ek(i,e,t);if(r==null)return!1;o=new DO(n.doc.resolve(r))}let s=CO(o.$headCell,e,t);return s?ZO(n,r,new DO(o.$anchorCell,s)):!1}}function Gee(e,t){let n=e.state.doc,r=hO(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new DO(r))),!0):!1}function Kee(e,t,n){if(!_O(e.state))return!1;let r=Bee(n),i=e.state.selection;if(i instanceof DO){r||={width:1,height:1,rows:[U.from(qO(pO(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=cO.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=Hee(r,o.right-o.left,o.bottom-o.top),XO(e.state,e.dispatch,a,o,r),!0}else if(r){let t=vO(e.state),n=t.start(-1);return XO(e.state,e.dispatch,n,cO.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function qee(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=tk(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof DO)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=hO(e.state.selection.$anchor))!=null&&nk(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=nk(e,n),i=mO.getState(e.state)==null;if(!r||!SO(t,r))if(i)r=t;else return;let a=new DO(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(mO,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),mO.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(mO,-1))}function o(r){let o=r,s=mO.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(tk(e,o.target)!=n&&(c=nk(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function ek(e,t,n){if(!(e.state.selection instanceof K))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function tk(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function nk(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&hO(e.state.doc.resolve(r))||hO(e.state.doc.resolve(i))}var Jee=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),rk(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,rk(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function rk(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var ik=new sg(`tableColumnResizing`);function Yee({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=Jee,lastColumnResizable:i=!0}={}){let a=new ig({key:ik,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=pO(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new Xee(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=ik.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{Zee(t,n,e,i)},mouseleave:e=>{Qee(e)},mousedown:(e,r)=>{ak(e,r,t,n)}},decorations:e=>{let t=ik.getState(e);if(t&&t.activeHandle>-1)return mk(e,t.activeHandle)},nodeViews:{}}});return a}var Xee=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(ik);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return bO(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function Zee(e,t,n,r){if(!e.editable)return;let i=ik.getState(e.state);if(i&&!i.dragging){let a=sk(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=ck(e,t,`left`,n):i-t.clientX<=n&&(o=ck(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=cO.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}uk(e,o)}}}function Qee(e){if(!e.editable)return;let t=ik.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&uk(e,-1)}function ak(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=ik.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=ok(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(ik,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=ik.getState(e.state);r?.dragging&&(dk(e,r.activeHandle,lk(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(ik,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=ik.getState(e.state);if(i&&i.dragging){let a=lk(i.dragging,t,n);fk(e,i.activeHandle,a,r)}}return fk(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function ok(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function sk(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function ck(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=hO(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=cO.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function lk(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function uk(e,t){e.dispatch(e.state.tr.setMeta(ik,{setHandle:t}))}function dk(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=cO.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():pk(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function fk(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=cO.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&rk(a,c.firstChild,c,r,s,n)}function pk(e){return Array(e).fill(0)}function mk(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return Nb.empty;let a=cO.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,ik.getState(e)?.dragging&&n.push(Ab.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(Ab.widget(s,c))}}return Nb.create(e.doc,n)}function hk({allowTableNodeSelection:e=!1}={}){return new ig({key:mO,state:{init(){return null},apply(e,t){let n=e.getMeta(mO);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:kO,handleDOMEvents:{mousedown:qee},createSelectionBetween(e){return mO.getState(e.state)==null?null:e.state.selection},handleTripleClick:Gee,handleKeyDown:Wee,handlePaste:Kee},appendTransaction(t,n,r){return MO(r,FO(r,n),e)}})}function gk(e){return e===`left`||e===`right`||e===`center`?e:null}function _k(e){let t=(e.style.textAlign||``).trim().toLowerCase(),n=(e.getAttribute(`align`)||``).trim().toLowerCase();return gk(t||n)}function vk(e){return gk(e?.align)}function yk(){return{default:null,parseHTML:e=>_k(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}var bk=mT.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`),n=t?t.split(`,`).map(e=>parseInt(e,10)):null;if(!n){let t=e.closest(`table`)?.querySelectorAll(`colgroup > col`),n=Array.from(e.parentElement?.children||[]).indexOf(e);if(n&&n>-1&&t&&t[n]){let e=t[n].getAttribute(`width`);return e?[parseInt(e,10)]:null}}return n}},align:yk()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,aC(this.options.HTMLAttributes,e),0]}}),xk=mT.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}},align:yk()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,aC(this.options.HTMLAttributes,e),0]}}),Sk=mT.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,aC(this.options.HTMLAttributes,e),0]}});function Ck(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function wk(e,t,n,r,i,a){var o;let s=0,c=!0,l=t.firstChild,u=e.firstChild;if(u!==null)for(let e=0,n=0;e<u.childCount;e+=1){let{colspan:o,colwidth:d}=u.child(e).attrs;for(let e=0;e<o;e+=1,n+=1){let o=i===n?a:d&&d[e],u=o?`${o}px`:``;if(s+=o||r,o||(c=!1),l){if(l.style.width!==u){let[e,t]=Ck(r,o);l.style.setProperty(e,t)}l=l.nextSibling}else{let e=document.createElement(`col`),[n,i]=Ck(r,o);e.style.setProperty(n,i),t.appendChild(e)}}}for(;l;){let e=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);c&&!d?(n.style.width=`${s}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${s}px`)}var Tk=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),wk(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type===this.node.type?(this.node=e,wk(e,this.colgroup,this.table,this.cellMinWidth),!0):!1}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!(n&&!r&&(e.type===`attributes`||e.type===`childList`||e.type===`characterData`))}};function Ek(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=Ck(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function Dk(e,t){return t?e.createChecked(null,t):e.createAndFill()}function Ok(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function kk(e,t,n,r,i){let a=Ok(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=Dk(a.cell,i);if(e&&s.push(e),r){let e=Dk(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function Ak(e){return e instanceof DO}var jk=({editor:e})=>{let{selection:t}=e.state;if(!Ak(t))return!1;let n=0;return JS(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1};function Mk(e){return(e||``).replace(/\s+/g,` `).trim()}function Nk(e,t,n={}){let r=n.cellLineSeparator??``;if(!e||!e.content||e.content.length===0)return``;let i=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let i=``;i=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(r):e.content?t.renderChildren(e.content):``;let a=Mk(i),o=e.type===`tableHeader`,s=vk(e.attrs);n.push({text:a,isHeader:o,align:s})}),i.push(n)});let a=i.reduce((e,t)=>Math.max(e,t.length),0);if(a===0)return``;let o=Array(a).fill(0);i.forEach(e=>{for(let t=0;t<a;t+=1){let n=(e[t]?.text||``).length;n>o[t]&&(o[t]=n),o[t]<3&&(o[t]=3)}});let s=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),c=i[0],l=c.some(e=>e.isHeader),u=Array(a).fill(null);i.forEach(e=>{for(let t=0;t<a;t+=1)!u[t]&&e[t]?.align&&(u[t]=e[t].align)});let d=`
|
|
302
302
|
`,f=Array(a).fill(0).map((e,t)=>l&&c[t]&&c[t].text||``);return d+=`| ${f.map((e,t)=>s(e,o[t])).join(` | `)} |
|
|
303
303
|
`,d+=`| ${o.map((e,t)=>{let n=Math.max(3,e),r=u[t];return r===`left`?`:${`-`.repeat(n)}`:r===`right`?`${`-`.repeat(n)}:`:r===`center`?`:${`-`.repeat(n)}:`:`-`.repeat(n)}).join(` | `)} |
|
|
304
304
|
`,(l?i.slice(1):i).forEach(e=>{d+=`| ${Array(a).fill(0).map((t,n)=>s(e[n]&&e[n].text||``,o[n])).join(` | `)} |
|
|
305
|
-
`}),d}var Pk=Nk,Fk=mT.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:Tk,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=Ek(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,aC(this.options.HTMLAttributes,t,{style:o()}),n,[`tbody`,0]];return this.options.renderWrapper?[`div`,{class:`tableWrapper`},s]:s},parseMarkdown:(e,t)=>{let n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){let i=[];e.header.forEach((e,n)=>{let a=gk(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableHeader`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach((e,n)=>{let a=gk(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableCell`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>Pk(e,t),addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=kk(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(K.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>
|
|
305
|
+
`}),d}var Pk=Nk,Fk=mT.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:Tk,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=Ek(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,aC(this.options.HTMLAttributes,t,{style:o()}),n,[`tbody`,0]];return this.options.renderWrapper?[`div`,{class:`tableWrapper`},s]:s},parseMarkdown:(e,t)=>{let n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){let i=[];e.header.forEach((e,n)=>{let a=gk(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableHeader`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach((e,n)=>{let a=gk(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableCell`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>Pk(e,t),addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=kk(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(K.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>wee(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>Tee(e,t),deleteColumn:()=>({state:e,dispatch:t})=>Dee(e,t),addRowBefore:()=>({state:e,dispatch:t})=>kee(e,t),addRowAfter:()=>({state:e,dispatch:t})=>Aee(e,t),deleteRow:()=>({state:e,dispatch:t})=>Mee(e,t),deleteTable:()=>({state:e,dispatch:t})=>zee(e,t),mergeCells:()=>({state:e,dispatch:t})=>VO(e,t),splitCell:()=>({state:e,dispatch:t})=>HO(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>WO(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>WO(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>Lee(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>VO(e,t)?!0:HO(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>Fee(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>GO(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>GO(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&FO(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=DO.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}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:jk,"Mod-Backspace":jk,Delete:jk,"Mod-Delete":jk}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Yee({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],hk({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){return{tableRole:$S(J(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}});Aw.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(Fk.configure(this.options.table)),this.options.tableCell!==!1&&e.push(bk.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(xk.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(Sk.configure(this.options.tableRow)),e}});var Ik=/^\s*>\s$/,Lk=mT.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return ST(`blockquote`,{...aC(this.options.HTMLAttributes,e),children:ST(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
|
|
306
306
|
`).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
|
|
307
307
|
`))}),n.join(`
|
|
308
308
|
>
|
|
@@ -377,7 +377,7 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
|
|
|
377
377
|
`:`\r`,s}t.exports.getPreferredLineEnding=D;function ne(e,t){let n=t&&t.homedir&&t.homedir();return n?e.replace(/^~($|\/|\\)/,`${n}$1`):e}t.exports.expandTildePath=ne;function re(e){let t={ruleNames:[],lineNumber:-1};return e.filter((e,n,r)=>{delete e.fixInfo,delete e.severity;let i=r[n-1]||t;return e.ruleNames[0]!==i.ruleNames[0]||e.lineNumber!==i.lineNumber})}function ie(e){for(let t of e)t.ruleName=t.ruleNames[0],t.ruleAlias=t.ruleNames[1]||t.ruleName,delete t.ruleNames;return e}function ae(e){let t={};for(let n of e){let e=n.ruleNames[0],r=t[e]||[];r.push(n.lineNumber),t[e]=r}return t}function oe(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=t(i.map(e=>({...e})));return n}t.exports.convertToResultVersion0=function(e){return oe(e,e=>ae(re(e)))},t.exports.convertToResultVersion1=function(e){return oe(e,e=>ie(re(e)))},t.exports.convertToResultVersion2=function(e){return oe(e,re)},t.exports.formatLintResults=function(e){let t=[],n=Object.entries(e||{});n.sort((e,t)=>e[0].localeCompare(t[0]));for(let[e,r]of n)for(let n of r){let{lineNumber:r,ruleNames:i,ruleDescription:a,errorDetail:o,errorContext:s,errorRange:c,severity:l}=n,u=i.join(`/`),d=`:${r}`,f=c&&c[0]||0,p=f?`:${f}`:``,m=a,h=o?` [${o}]`:``,g=s?` [Context: "${s}"]`:``;t.push(`${e}${d}${p} ${l} ${u} ${m}${h}${g}`)}return t}}))(),1),Z=QR(),$R=new Map,ez=void 0;function tz(e){$R.clear(),ez=e}function nz(){return ez?.parsers.micromark.tokens||[]}function rz(e,t){if($R.has(e))return $R.get(e);let n=t();return $R.set(e,n),n}function Q(e,t){return rz(JSON.stringify(arguments),()=>(0,Z.filterByTypes)(nz(),e,t))}function iz(){return rz(iz.name,()=>(0,X.getReferenceLinkImageData)(nz()))}var az=`https://github.com/DavidAnson/markdownlint`,oz=`0.41.1`,sz=a(((e,t)=>{function n(){return Ie()}t.exports={requireMarkdownItCjs:n}})),cz=a(((e,n)=>{var r=typeof __non_webpack_require__>`u`?t:__non_webpack_require__,i=(e,t,n=[])=>{let r=e.paths?.(``)||[];return e(t,{paths:[...n,...r]})};n.exports={resolveModule:(e,t)=>i(r.resolve,e,t),resolveModuleCustomResolve:i}})),lz=sz();cz();var uz={names:[`MD001`,`heading-increment`],description:`Heading levels should only increment by one level at a time`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=(0,X.frontMatterHasTitle)(e.frontMatterLines,e.config.front_matter_title)?1:2**53-1;for(let e of Q([`atxHeading`,`setextHeading`])){let r=(0,Z.getHeadingLevel)(e);r>n&&(0,X.addErrorDetailIf)(t,e.startLine,`h${n+1}`,`h${r}`),n=r}}},dz={names:[`MD003`,`heading-style`],description:`Heading style`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`);for(let e of Q([`atxHeading`,`setextHeading`])){let r=(0,Z.getHeadingStyle)(e);if(n===`consistent`&&(n=r),r!==n){let i=(0,Z.getHeadingLevel)(e)<=2;if(!(n===`setext_with_atx`&&(i&&r===`setext`||!i&&r===`atx`))&&!(n===`setext_with_atx_closed`&&(i&&r===`setext`||!i&&r===`atx_closed`))){let a=n;n===`setext_with_atx`?a=i?`setext`:`atx`:n===`setext_with_atx_closed`&&(a=i?`setext`:`atx_closed`),(0,X.addErrorDetailIf)(t,e.startLine,a,r)}}}}},fz=e=>e===`-`?`dash`:e===`+`?`plus`:`asterisk`,pz=e=>e===`dash`?`-`:e===`plus`?`+`:`*`,mz=e=>e===`dash`?`plus`:e===`plus`?`asterisk`:`dash`,hz=new Set([`asterisk`,`consistent`,`dash`,`plus`,`sublist`]),gz={names:[`MD004`,`ul-style`],description:`Unordered list style`,tags:[`bullet`,`ul`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`),r=hz.has(n)?n:`dash`,i=[];for(let e of Q([`listUnordered`])){let a=0;if(n===`sublist`){let t=e;for(;t=(0,Z.getParentOfType)(t,[`listOrdered`,`listUnordered`]);)a++}let o=(0,Z.getDescendantsByType)(e,[`listItemPrefix`,`listItemMarker`]);for(let e of o){let o=fz(e.text);n===`sublist`?(i[a]||(i[a]=o===i[a-1]?mz(o):o),r=i[a]):r===`consistent`&&(r=o);let s=e.startColumn,c=e.endColumn-e.startColumn;(0,X.addErrorDetailIf)(t,e.startLine,r,o,void 0,void 0,[s,c],{editColumn:s,deleteCount:c,insertText:pz(r)})}}}},_z={names:[`MD005`,`list-indent`],description:`Inconsistent indentation for list items at the same level`,tags:[`bullet`,`ul`,`indentation`],parser:`micromark`,function:function(e,t){for(let e of Q([`listOrdered`,`listUnordered`])){let n=e.startColumn-1,r=0,i=!1,a=e.children.filter(e=>e.type===`listItemPrefix`);for(let o of a){let a=o.startLine,s=o.startColumn-1,c=[1,o.endColumn-1];if(e.type===`listUnordered`)(0,X.addErrorDetailIf)(t,a,n,s,void 0,void 0,c);else{let e=o.text.trim().length,l=o.startColumn+e-1;if(r||=l,n!==s||i)if(r===l)i=!0;else{let o=i?`Expected: (${r}); Actual: (${l})`:`Expected: ${n}; Actual: ${s}`,u=i?r-e:n,d=i?l-e:s;(0,X.addError)(t,a,o,void 0,c,{editColumn:Math.min(d,u)+1,deleteCount:Math.max(d-u,0),insertText:``.padEnd(Math.max(u-d,0))})}}}}}},vz=[`blockQuotePrefix`,`listItemPrefix`,`listUnordered`],yz=[`blockQuote`,`listOrdered`,`listUnordered`],bz={names:[`MD007`,`ul-indent`],description:`Unordered list indentation`,tags:[`bullet`,`ul`,`indentation`],parser:`micromark`,function:function(e,t){let n=Number(e.config.indent||2),r=!!e.config.start_indented,i=Number(e.config.start_indent||n),a=new Map,o=null,s=Q(vz);for(let e of s){let{endColumn:s,parent:c,startColumn:l,startLine:u,type:d}=e;if(d===`blockQuotePrefix`)o=e;else if(d===`listUnordered`){let t=0,n=e;for(;n=(0,Z.getParentOfType)(n,yz);){if(n.type===`listUnordered`){t++;continue}else n.type===`listOrdered`&&(t=-1);break}t>=0&&a.set(e,t)}else{let d=a.get(c);if(d!==void 0){let a=((0,Z.getParentOfType)(e,[`gfmFootnoteDefinition`])?4:0)+(r?i:0)+d*n,c=o?.endLine===u?o.endColumn-1:0,f=l-1-c;(0,X.addErrorDetailIf)(t,u,a,f,void 0,void 0,[1,s-1],{editColumn:l-f,deleteCount:Math.max(f-a,0),insertText:``.padEnd(Math.max(a-f,0))})}}}}},xz={names:[`MD009`,`no-trailing-spaces`],description:`Trailing spaces`,tags:[`whitespace`],parser:`micromark`,function:function(e,t){let n=e.config.br_spaces;n=Number(n===void 0?2:n);let r=e.config.code_blocks,i=r===void 0?!1:!!r,a=!!e.config.list_item_empty_lines,o=!!e.config.strict,s=new Set;if(!i){for(let e of Q([`codeFenced`]))(0,Z.addRangeToSet)(s,e.startLine+1,e.endLine-1);for(let e of Q([`codeIndented`]))(0,Z.addRangeToSet)(s,e.startLine,e.endLine)}let c=new Set;if(a)for(let e of Q([`listOrdered`,`listUnordered`])){(0,Z.addRangeToSet)(c,e.startLine,e.endLine);let t=!0;for(let n=e.children.length-1;n>=0;n--){let r=e.children[n];switch(r.type){case`content`:t=!1;break;case`listItemIndent`:t&&c.delete(r.startLine);break;case`listItemPrefix`:t=!0;break;default:break}}}let l=new Set,u=new Set;if(o){for(let e of Q([`paragraph`]))(0,Z.addRangeToSet)(l,e.startLine,e.endLine-1);for(let e of Q([`codeText`]))(0,Z.addRangeToSet)(u,e.startLine,e.endLine-1)}let d=n<2?0:n;for(let n=0;n<e.lines.length;n++){let r=e.lines[n],i=n+1,a=r.length-r.trimEnd().length;if(a&&!s.has(i)&&!c.has(i)&&(d!==a||o&&(!l.has(i)||u.has(i)))){let e=r.length-a+1;(0,X.addError)(t,i,`Expected: `+(d===0?``:`0 or `)+d+`; Actual: `+a,void 0,[e,a],{editColumn:e,deleteCount:a})}}}},Sz=/\t+/g,Cz={names:[`MD010`,`no-hard-tabs`],description:`Hard tabs`,tags:[`whitespace`,`hard_tab`],parser:`micromark`,function:function(e,t){let n=e.config.code_blocks,r=n===void 0?!0:!!n,i=new Set((e.config.ignore_code_languages||[]).map(e=>String(e).toLowerCase())),a=e.config.spaces_per_tab,o=a===void 0?1:Math.max(0,Number(a)),s=[];r?i.size>0&&s.push(`codeFenced`):s.push(`codeFenced`,`codeIndented`,`codeText`);let c=Q(s).filter(e=>e.type===`codeFenced`&&i.size>0?(0,Z.getDescendantsByType)(e,[`codeFencedFence`,`codeFencedFenceInfo`]).every(e=>i.has(e.text.toLowerCase())):!0).map(e=>{let{type:t,startLine:n,startColumn:r,endLine:i,endColumn:a}=e,o=t===`codeFenced`;return{startLine:n+ +!!o,startColumn:o?0:r,endLine:i-+!!o,endColumn:o?2**53-1:a}});for(let n=0;n<e.lines.length;n++){let r=e.lines[n],i=null;for(;(i=Sz.exec(r))!==null;){let e=n+1,r=i.index+1,a=i[0].length,s={startLine:e,startColumn:r,endLine:e,endColumn:r+a-1};c.some(e=>(0,X.hasOverlap)(e,s))||(0,X.addError)(t,e,`Column: `+r,void 0,[r,a],{editColumn:r,deleteCount:a,insertText:``.padEnd(a*o)})}}}},wz=/(^|[^\\])\(([^()]+)\)\[([^\]^][^\]]*)\](?!\()/g,Tz={names:[`MD011`,`no-reversed-links`],description:`Reversed link syntax`,tags:[`links`],parser:`micromark`,function:function(e,t){let n=new Set;for(let e of Q([`codeFenced`,`codeIndented`,`mathFlow`]))(0,Z.addRangeToSet)(n,e.startLine,e.endLine);let r=Q([`codeText`,`mathText`]);for(let[i,a]of e.lines.entries()){let e=i+1;if(!n.has(e)){let n=null;for(;(n=wz.exec(a))!==null;){let[i,a,o,s]=n;if(!o.endsWith(`\\`)&&!s.endsWith(`\\`)){let c=n.index+a.length+1,l=n[0].length-a.length,u={startLine:e,startColumn:c,endLine:e,endColumn:c+l-1};r.some(e=>(0,X.hasOverlap)(e,u))||(0,X.addError)(t,e,i.slice(a.length),void 0,[c,l],{editColumn:c,deleteCount:l,insertText:`[${o}](${s})`})}}}}}},Ez={names:[`MD012`,`no-multiple-blanks`],description:`Multiple consecutive blank lines`,tags:[`whitespace`,`blank_lines`],parser:`micromark`,function:function(e,t){let n=Number(e.config.maximum||1),{lines:r}=e,i=new Set;for(let e of Q([`codeFenced`,`codeIndented`]))(0,Z.addRangeToSet)(i,e.startLine,e.endLine);let a=0;for(let[e,o]of r.entries())a=i.has(e+1)||o.trim().length>0?0:a+1,n<a&&(0,X.addErrorDetailIf)(t,e+1,n,a,void 0,void 0,void 0,{deleteCount:-1})}},Dz=/^(?:[#>\s]*\s)?\S*$/,Oz={names:[`MD013`,`line-length`],description:`Line length`,tags:[`line_length`],parser:`micromark`,function:function(e,t){let n=Number(e.config.line_length||80),r=Number(e.config.heading_line_length||n),i=Number(e.config.code_block_line_length||n),a=!!e.config.strict,o=!!e.config.stern,s=e.config.code_blocks,c=s===void 0?!0:!!s,l=e.config.tables,u=l===void 0?!0:!!l,d=e.config.headings,f=d===void 0?!0:!!d,p=new Set;for(let e of Q([`atxHeading`,`setextHeading`]))(0,Z.addRangeToSet)(p,e.startLine,e.endLine);let m=new Set;for(let e of Q([`codeFenced`,`codeIndented`]))(0,Z.addRangeToSet)(m,e.startLine,e.endLine);let h=new Set;for(let e of Q([`table`]))(0,Z.addRangeToSet)(h,e.startLine,e.endLine);let g=new Set;for(let e of Q([`autolink`,`image`,`link`,`literalAutolink`]))(0,Z.addRangeToSet)(g,e.startLine,e.endLine);let _=new Set;for(let e of Q([`paragraph`]))for(let t of(0,Z.getDescendantsByType)(e,[`data`]))(0,Z.addRangeToSet)(_,t.startLine,t.endLine);let v=new Set;for(let e of g)_.has(e)||v.add(e);let y=new Set(iz().definitionLineIndices);for(let s=0;s<e.lines.length;s++){let l=e.lines[s],d=s+1,g=p.has(d),_=m.has(d),b=h.has(d),x=_?i:g?r:n,S=a||o?l:l.replace(/\S*$/u,`#`);x>0&&(c||!_)&&(u||!b)&&(f||!g)&&!y.has(s)&&(a||!(o&&Dz.test(l))&&!v.has(d))&&S.length>x&&(0,X.addErrorDetailIf)(t,d,x,l.length,void 0,void 0,[x+1,l.length-x])}}},kz=/^(\s*)(\$\s+)/,Az={names:[`MD014`,`commands-show-output`],description:`Dollar signs used before commands without showing output`,tags:[`code`],parser:`micromark`,function:function(e,t){for(let e of Q([`codeFenced`,`codeIndented`])){let n=e.children.filter(e=>e.type===`codeFlowValue`),r=n.map(e=>({result:e.text.match(kz),startColumn:e.startColumn,startLine:e.startLine,text:e.text})).filter(e=>e.result);if(r.length===n.length)for(let e of r){let n=e.startColumn+e.result[1].length,r=e.result[2].length;(0,X.addErrorContext)(t,e.startLine,e.text,void 0,void 0,[n,r],{editColumn:n,deleteCount:r})}}}},jz={names:[`MD018`,`no-missing-space-atx`],description:`No space after hash on atx style heading`,tags:[`headings`,`atx`,`spaces`],parser:`micromark`,function:function(e,t){let{lines:n}=e,r=new Set;for(let e of Q([`codeFenced`,`codeIndented`,`htmlFlow`]))(0,Z.addRangeToSet)(r,e.startLine,e.endLine);for(let[e,i]of n.entries())if(!r.has(e+1)&&/^#+[^# \t]/.test(i)&&!/#\s*$/.test(i)&&!i.startsWith(`#️⃣`)){let n=/^#+/.exec(i)[0].length;(0,X.addErrorContext)(t,e+1,i.trim(),void 0,void 0,[1,n+1],{editColumn:n+1,insertText:` `})}}};function Mz(e,t,n){let{children:r,startLine:i,text:a}=t,o=n>0?0:r.length-1;for(;r[o]&&r[o].type!==`atxHeadingSequence`;)o+=n;let s=r[o],c=r[o+n];if(s?.type===`atxHeadingSequence`&&c?.type===`whitespace`&&c.text.length>1){let t=c.startColumn+1,r=c.endColumn-t;(0,X.addErrorContext)(e,i,a.trim(),n>0,n<0,[t,r],{editColumn:t,deleteCount:r})}}var Nz=[{names:[`MD019`,`no-multiple-space-atx`],description:`Multiple spaces after hash on atx style heading`,tags:[`headings`,`atx`,`spaces`],parser:`micromark`,function:function(e,t){let n=Q([`atxHeading`]).filter(e=>(0,Z.getHeadingStyle)(e)===`atx`);for(let e of n)Mz(t,e,1)}},{names:[`MD021`,`no-multiple-space-closed-atx`],description:`Multiple spaces inside hashes on closed atx style heading`,tags:[`headings`,`atx_closed`,`spaces`],parser:`micromark`,function:function(e,t){let n=Q([`atxHeading`]).filter(e=>(0,Z.getHeadingStyle)(e)===`atx_closed`);for(let e of n)Mz(t,e,1),Mz(t,e,-1)}}],Pz={names:[`MD020`,`no-missing-space-closed-atx`],description:`No space inside hashes on closed atx style heading`,tags:[`headings`,`atx_closed`,`spaces`],parser:`micromark`,function:function(e,t){let{lines:n}=e,r=new Set;for(let e of Q([`codeFenced`,`codeIndented`,`htmlFlow`]))(0,Z.addRangeToSet)(r,e.startLine,e.endLine);for(let[e,i]of n.entries())if(!r.has(e+1)){let n=/^(#+)([ \t]*)([^# \t\\]|[^# \t][^#]*?[^# \t\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec(i);if(n){let[,r,{length:a},o,{length:s},c,l,{length:u}]=n,d=r.length,f=l.length,p=!a,m=!s||!!c,h=c?`${c} `:``;if(p||m){let n=p?[1,d+1]:[i.length-u-f,f+1];(0,X.addErrorContext)(t,e+1,i.trim(),p,m,n,{editColumn:1,deleteCount:i.length,insertText:`${r} ${o} ${h}${l}`})}}}}},Fz=1,Iz=e=>{if(Array.isArray(e)){let t=[,,,,,,].fill(Fz);for(let[n,r]of[...e.entries()].slice(0,6))t[n]=r;return e=>t[(0,Z.getHeadingLevel)(e)-1]}let t=e===void 0?Fz:Number(e);return()=>t},Lz=(e,t,n,r)=>t>=0&&t<e.length?e[t]:r&&n.length>0&&t<0&&t>=-n.length?n[n.length+t]:``,Rz={names:[`MD022`,`blanks-around-headings`],description:`Headings should be surrounded by blank lines`,tags:[`headings`,`blank_lines`],parser:`micromark`,function:function(e,t){let n=Iz(e.config.lines_above),r=Iz(e.config.lines_below),i=!!e.config.include_front_matter,{lines:a,frontMatterLines:o}=e,s=Q([`blockQuotePrefix`,`linePrefix`]);for(let e of Q([`atxHeading`,`setextHeading`])){let{startLine:c,endLine:l}=e,u=a[c-1].trim(),d=n(e);if(d>=0){let e=0;for(let t=0;t<d&&(0,X.isBlankLine)(Lz(a,c-2-t,o,i));t++)e++;(0,X.addErrorDetailIf)(t,c,d,e,`Above`,u,void 0,{insertText:(0,Z.getBlockQuotePrefixText)(s,c-1,d-e)})}let f=r(e);if(f>=0){let e=0;for(let t=0;t<f&&(0,X.isBlankLine)(Lz(a,l+t,o,!1));t++)e++;(0,X.addErrorDetailIf)(t,c,f,e,`Below`,u,void 0,{lineNumber:l+1,insertText:(0,Z.getBlockQuotePrefixText)(s,l+1,f-e)})}}}},zz={names:[`MD023`,`heading-start-left`],description:`Headings must start at the beginning of the line`,tags:[`headings`,`spaces`],parser:`micromark`,function:function(e,t){let n=Q([`atxHeading`,`linePrefix`,`setextHeading`]);for(let r=0;r<n.length-1;r++)if(n[r].type===`linePrefix`&&n[r+1].type!==`linePrefix`&&n[r].startLine===n[r+1].startLine){let{endColumn:i,startColumn:a,startLine:o}=n[r],s=i-a;(0,X.addErrorContext)(t,o,e.lines[o-1],!0,!1,[a,s],{editColumn:a,deleteCount:s})}}},Bz={names:[`MD024`,`no-duplicate-heading`],description:`Multiple headings with the same content`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=!!e.config.siblings_only,r=[null,[]],i=1,a=r[i];for(let e of Q([`atxHeading`,`setextHeading`])){let o=(0,Z.getHeadingText)(e);if(n){let t=(0,Z.getHeadingLevel)(e);for(;i<t;)i++,r[i]=[];for(;i>t;)r[i]=[],i--;a=r[t]}a.includes(o)?(0,X.addErrorContext)(t,e.startLine,o.trim()):a.push(o)}}},Vz={names:[`MD025`,`single-title`,`single-h1`],description:`Multiple top-level headings in the same document`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=Number(e.config.level||1),{tokens:r}=e.parsers.micromark,i=Q([`atxHeading`,`setextHeading`]).filter(e=>n===(0,Z.getHeadingLevel)(e)&&!(0,Z.isDocfxTab)(e));if(i.length>0){let n=(0,X.frontMatterHasTitle)(e.frontMatterLines,e.config.front_matter_title),a=n;if(a||=r.slice(0,r.indexOf(i[0])).every(e=>Z.nonContentTokens.has(e.type)||(0,Z.isHtmlFlowComment)(e)),a)for(let e of i.slice(+!n))(0,X.addErrorContext)(t,e.startLine,(0,Z.getHeadingText)(e))}}},Hz={names:[`MD026`,`no-trailing-punctuation`],description:`Trailing punctuation in heading`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=e.config.punctuation;n=String(n===void 0?X.allPunctuationNoQuestion:n);let r=RegExp(`\\s*[`+(0,X.escapeForRegExp)(n)+`]+$`),i=Q([`atxHeadingText`,`setextHeadingText`]);for(let e of i){let{endColumn:n,endLine:i,text:a}=e,o=r.exec(a);if(o&&!X.endOfLineHtmlEntityRe.test(a)&&!X.endOfLineGemojiCodeRe.test(a)){let e=o[0],r=e.length,a=n-r;(0,X.addError)(t,i,`Punctuation: '${e}'`,void 0,[a,r],{editColumn:a,deleteCount:r})}}}},Uz=[`listOrdered`,`listUnordered`],Wz={names:[`MD027`,`no-multiple-space-blockquote`],description:`Multiple spaces after blockquote symbol`,tags:[`blockquote`,`whitespace`,`indentation`],parser:`micromark`,function:function(e,t){let n=e.config.list_items,r=n===void 0?!0:!!n,{tokens:i}=e.parsers.micromark;for(let n of Q([`linePrefix`])){let a=n.parent,o=a?.type===`codeIndented`,s=a?.children||i;if(!o&&s[s.indexOf(n)-1]?.type===`blockQuotePrefix`&&(r||!Uz.includes(s[s.indexOf(n)+1]?.type)&&!(0,Z.getParentOfType)(n,Uz))){let{startColumn:r,startLine:i,text:a}=n,{length:o}=a,s=e.lines[i-1];(0,X.addErrorContext)(t,i,s,void 0,void 0,[r,o],{editColumn:r,deleteCount:o})}}}},Gz=new Set([`lineEnding`,`listItemIndent`,`linePrefix`]),Kz={names:[`MD028`,`no-blanks-blockquote`],description:`Blank line inside blockquote`,tags:[`blockquote`,`whitespace`],parser:`micromark`,function:function(e,t){for(let n of Q([`blockQuote`])){let r=[],i=n.parent?.children||e.parsers.micromark.tokens;for(let e=i.indexOf(n)+1;e<i.length;e++){let{startLine:n,type:a}=i[e];if(a===`lineEndingBlank`)r.push(n);else if(!Gz.has(a))if(a===`blockQuote`){for(let e of r)(0,X.addError)(t,e);break}else break}}}},qz={one:`1/1/1`,ordered:`1/2/3`,zero:`0/0/0`},Jz=Object.keys(qz);function Yz(e){let{startColumn:t,endColumn:n,text:r}=(0,Z.getDescendantsByType)(e,[`listItemValue`])[0];return{startColumn:t,endColumn:n,text:r,number:Number(r)}}var Xz={names:[`MD029`,`ol-prefix`],description:`Ordered list item prefix`,tags:[`ol`],parser:`micromark`,function:function(e,t){let n=String(e.config.style);for(let e of Q([`listOrdered`])){let r=(0,Z.getDescendantsByType)(e,[`listItemPrefix`]),i=1,a=!1,o=!1,s=!1;if(r.length>0){let e=r[0].endColumn;if(o=r.every(t=>t.endColumn===e),r.length>1){let e=Yz(r[0]);(Yz(r[1]).number!==1||e.number===0)&&(a=!0,e.number===0&&(i=0)),s=e.text.startsWith(`0`)}}let c=Jz.includes(n)?n:a?`ordered`:`one`;c===`zero`?i=0:c===`one`&&(i=1);for(let e of r){let n=i.toString(),{endColumn:r,startColumn:a,number:l}=Yz(e),u=r-a,d={editColumn:a,deleteCount:u,insertText:o?n.padStart(u,s?`0`:` `):n};(0,X.addErrorDetailIf)(t,e.startLine,i,l,`Style: `+qz[c],void 0,[e.startColumn,e.endColumn-e.startColumn],d),c===`ordered`&&i++}}}},Zz={names:[`MD030`,`list-marker-space`],description:`Spaces after list markers`,tags:[`ol`,`ul`,`whitespace`],parser:`micromark`,function:function(e,t){let n=Number(e.config.ul_single||1),r=Number(e.config.ol_single||1),i=Number(e.config.ul_multi||1),a=Number(e.config.ol_multi||1);for(let e of Q([`listOrdered`,`listUnordered`])){let o=e.type===`listOrdered`,s=e.children.filter(e=>e.type===`listItemPrefix`),c=e.endLine-e.startLine+1===s.length,l=o?c?r:a:c?n:i;for(let e of s){let n=[e.startColumn,e.endColumn-e.startColumn],r=e.children.filter(e=>e.type===`listItemPrefixWhitespace`);for(let e of r){let{endColumn:r,startColumn:i,startLine:a}=e,o=r-i;(0,X.addErrorDetailIf)(t,a,l,o,void 0,void 0,n,{editColumn:i,deleteCount:o,insertText:``.padEnd(l)})}}}}},Qz=/^(.*?)[`~]/;function $z(e,t,n,r){let i=t[n-1],[,a]=i.match(Qz)||[],o=a===void 0?void 0:{lineNumber:n+ +!r,insertText:`${a.replace(/[^>]/g,` `).trim()}\n`};(0,X.addErrorContext)(e,n,i.trim(),void 0,void 0,void 0,o)}var eB={names:[`MD031`,`blanks-around-fences`],description:`Fenced code blocks should be surrounded by blank lines`,tags:[`code`,`blank_lines`],parser:`micromark`,function:function(e,t){let n=e.config.list_items,r=n===void 0?!0:!!n,{lines:i}=e;for(let e of Q([`codeFenced`]))(r||!(0,Z.getParentOfType)(e,[`listOrdered`,`listUnordered`]))&&((0,X.isBlankLine)(i[e.startLine-2])||$z(t,i,e.startLine,!0),!(0,X.isBlankLine)(i[e.endLine])&&!(0,X.isBlankLine)(i[e.endLine-1])&&$z(t,i,e.endLine,!1))}},tB=e=>e.type===`listOrdered`||e.type===`listUnordered`,nB={names:[`MD032`,`blanks-around-lists`],description:`Lists should be surrounded by blank lines`,tags:[`bullet`,`ul`,`ol`,`blank_lines`],parser:`micromark`,function:function(e,t){let{lines:n,parsers:r}=e,i=Q([`blockQuotePrefix`,`linePrefix`]),a=(0,Z.filterByPredicate)(r.micromark.tokens,tB,e=>tB(e)||e.type===`htmlFlow`?[]:e.children);for(let e of a){let r=e.startLine;(0,X.isBlankLine)(n[r-2])||(0,X.addErrorContext)(t,r,n[r-1].trim(),void 0,void 0,void 0,{insertText:(0,Z.getBlockQuotePrefixText)(i,r)});let a=(0,Z.filterByPredicate)(e.children,e=>!Z.nonContentTokens.has(e.type),e=>Z.nonContentTokens.has(e.type)?[]:e.children),o=(a.length>0?a[a.length-1]:e).endLine;(0,X.isBlankLine)(n[o])||(0,X.addErrorContext)(t,o,n[o-1].trim(),void 0,void 0,void 0,{lineNumber:o+1,insertText:(0,Z.getBlockQuotePrefixText)(i,o)})}}},rB=e=>Array.isArray(e)?e.map(e=>String(e).toLowerCase()):[],iB={names:[`MD033`,`no-inline-html`],description:`Inline HTML`,tags:[`html`],parser:`micromark`,function:function(e,t){let n=rB(e.config.allowed_elements),r=rB(e.config.table_allowed_elements||e.config.allowed_elements);for(let e of Q([`htmlText`],!0)){let i=(0,Z.getHtmlTagInfo)(e);if(i&&!i.close){let a=i?.name.toLowerCase(),o=!!(0,Z.getParentOfType)(e,[`table`]);if((o||!n.includes(a))&&(!o||!r.includes(a))){let n=[e.startColumn,e.text.replace(X.nextLinesRe,``).length];(0,X.addError)(t,e.startLine,`Element: `+i.name,void 0,n)}}}}},aB={names:[`MD034`,`no-bare-urls`],description:`Bare URL used`,tags:[`links`,`url`],parser:`micromark`,function:function(e,t){let n=e=>(0,Z.filterByPredicate)(e,e=>{if(e.type===`literalAutolink`&&!(0,Z.inHtmlFlow)(e)){let t=e.parent?.children,n=t?.indexOf(e),r=t?.at(n-1),i=t?.at(n+1);return!(r&&i&&r.type===`data`&&i.type===`data`&&r.text.endsWith(`<`)&&i.text.startsWith(`>`))}return!1},e=>{let{children:t}=e,n=[];for(let e=0;e<t.length;e++){let r=t[e],i=(0,Z.getHtmlTagInfo)(r);if(i&&!i.close){let n=1;for(let r=e+1;r<t.length;r++){let a=t[r],o=(0,Z.getHtmlTagInfo)(a);if(o&&i.name===o.name)if(o.close){if(n--,n===0){e=r;break}}else n++}}else n.push(r)}return n});for(let r of n(e.parsers.micromark.tokens)){let e=[r.startColumn,r.endColumn-r.startColumn],n={editColumn:e[0],deleteCount:e[1],insertText:`<${r.text}>`};(0,X.addErrorContext)(t,r.startLine,r.text,void 0,void 0,e,n)}}},oB={names:[`MD035`,`hr-style`],description:`Horizontal rule style`,tags:[`hr`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`).trim(),r=Q([`thematicBreak`]);for(let e of r){let{startLine:r,text:i}=e;n===`consistent`&&(n=i),(0,X.addErrorDetailIf)(t,r,n,i)}}},sB=[[`emphasis`,`emphasisText`],[`strong`,`strongText`]],cB=e=>!(e.type===`htmlText`||e.type===`data`&&e.text.trim().length===0),lB={names:[`MD036`,`no-emphasis-as-heading`],description:`Emphasis used instead of a heading`,tags:[`headings`,`emphasis`],parser:`micromark`,function:function(e,t){let n=e.config.punctuation;n=String(n===void 0?X.allPunctuation:n);let r=RegExp(`[`+n+`]$`),i=Q([`paragraph`],!0).filter(e=>e.parent?.type===`content`&&(!e.parent?.parent||e.parent?.parent?.type===`htmlFlow`&&!e.parent?.parent?.parent)&&e.children.filter(cB).length===1);for(let e of sB){let n=(0,Z.getDescendantsByType)(i,e);for(let e of n)e.children.length===1&&e.children[0].type===`data`&&!r.test(e.text)&&(0,X.addErrorContext)(t,e.startLine,e.text)}}},uB={names:[`MD037`,`no-space-in-emphasis`],description:`Spaces inside emphasis markers`,tags:[`whitespace`,`emphasis`],parser:`micromark`,function:function(e,t){let{lines:n,parsers:r}=e,i=new Map;for(let e of[`_`,`__`,`___`,`*`,`**`,`***`])i.set(e,[]);let a=(0,Z.filterByPredicate)(r.micromark.tokens,e=>e.children.some(e=>e.type===`data`));for(let e of a){for(let e of i.values())e.length=0;for(let t of e.children){let{text:e,type:n}=t;if(n===`data`&&e.length<=3){let n=i.get(e);n&&!(0,Z.inHtmlFlow)(t)&&n.push(t)}}for(let[e,r]of i)for(let i=0;i+1<r.length;i+=2){let a=r[i],o=n[a.startLine-1].slice(a.endColumn-1).match(/^\s+\S/);if(o){let[n]=o,r=`${e}${n}`,i=a.endColumn,s=n.length-1;(0,X.addError)(t,a.startLine,void 0,r,[i,s],{editColumn:i,deleteCount:s})}let s=r[i+1],c=n[s.startLine-1].slice(0,s.startColumn-1).match(/\S\s+$/);if(c){let[n]=c,r=`${n}${e}`,i=s.startColumn-(n.length-1),a=n.length-1;(0,X.addError)(t,s.startLine,void 0,r,[i,a],{editColumn:i,deleteCount:a})}}}}},dB={names:[`MD038`,`no-space-in-code`],description:`Spaces inside code span elements`,tags:[`whitespace`,`code`],parser:`micromark`,function:function(e,t){let n=Q([`codeText`]);for(let e of n){let n=(0,Z.getDescendantsByType)(e,[`codeTextData`]);if(n.length>0){let r=(0,Z.getDescendantsByType)(e,[`codeTextPadding`]),i=r[0],a=n[0],o=/^(\s+)(\S)/.exec(a.text)||[null,``,``],s=o[2]==="`",c=o[1].length-(s&&!i?1:0),l=c>0,u=r[r.length-1],d=n[n.length-1],f=/(\S)(\s+)$/.exec(d.text)||[null,``,``],p=f[1]==="`",m=f[2].length-(p&&!u?1:0),h=m>0,g=l&&h&&i&&u&&!s&&!p,_=e.text;if(l){let e=(g?i:a).startColumn,n=c+(g?i.text.length:0);(0,X.addErrorContext)(t,a.startLine,_,!0,!1,[e,n],{editColumn:e,deleteCount:n})}if(h){let e=(g?u:d).endColumn,n=m+(g?u.text.length:0);(0,X.addErrorContext)(t,d.endLine,_,!1,!0,[e-n,n],{editColumn:e-n,deleteCount:n})}}}}};function fB(e,t,n,r){let i=n.text.match(r?/^[^\S\r\n]+/:/[^\S\r\n]+$/),a=i?[r?n.startColumn:n.endColumn-i[0].length,i[0].length]:void 0;(0,X.addErrorContext)(e,r?n.startLine+ +!i:n.endLine-+!i,t.text.replace(/\s+/g,` `),r,!r,a,a?{editColumn:a[0],deleteCount:a[1]}:void 0)}var pB={names:[`MD039`,`no-space-in-links`],description:`Spaces inside link text`,tags:[`whitespace`,`links`],parser:`micromark`,function:function(e,t){let n=Q([`label`]).filter(e=>e.parent?.type===`link`);for(let e of n){let n=e.children.filter(e=>e.type===`labelText`);for(let r of n)r.text.trimStart().length!==r.text.length&&fB(t,e,r,!0),r.text.trimEnd().length!==r.text.length&&fB(t,e,r,!1)}}},mB={names:[`MD040`,`fenced-code-language`],description:`Fenced code blocks should have a language specified`,tags:[`code`,`language`],parser:`micromark`,function:function(e,t){let n=e.config.allowed_languages;n=Array.isArray(n)?n:[];let r=!!e.config.language_only,i=Q([`codeFenced`]);for(let e of i){let i=(0,Z.getDescendantsByType)(e,[`codeFencedFence`])[0],{startLine:a,text:o}=i,s=(0,Z.getDescendantsByType)(i,[`codeFencedFenceInfo`])[0]?.text;s?n.length>0&&!n.includes(s)&&(0,X.addError)(t,a,`"${s}" is not allowed`):(0,X.addErrorContext)(t,a,o),r&&(0,Z.getDescendantsByType)(i,[`codeFencedFenceMeta`]).length>0&&(0,X.addError)(t,a,`Info string contains more than language: "${o}"`)}}},hB=/^h[1-6]$/;function gB(e){let{children:t,type:n}=e;if(n===`htmlFlow`){let e=(0,Z.filterByTypes)(t,[`htmlText`],!0),n=e.length>0&&(0,Z.getHtmlTagInfo)(e[0]);if(n)return n.name.toLowerCase()}return null}var _B={names:[`MD041`,`first-line-heading`,`first-line-h1`],description:`First line in a file should be a top-level heading`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=!!e.config.allow_preamble,r=Number(e.config.level||1),{tokens:i}=e.parsers.micromark;if(!(0,X.frontMatterHasTitle)(e.frontMatterLines,e.config.front_matter_title)){let a=0;for(let e of i){let{startLine:t,type:i}=e;if(!Z.nonContentTokens.has(i)&&!(0,Z.isHtmlFlowComment)(e)){let o=null;if(i===`atxHeading`||i===`setextHeading`){(0,Z.getHeadingLevel)(e)!==r&&(a=t);break}else if((o=gB(e))&&hB.test(o)){o!==`h${r}`&&(a=t);break}else if(!n){a=t;break}}}a>0&&(0,X.addErrorContext)(t,a,e.lines[a-1])}}},vB={names:[`MD042`,`no-empty-links`],description:`No empty links`,tags:[`links`],parser:`micromark`,function:function(e,t){let{definitions:n}=iz(),r=e=>{let t=n.get(e.text.trim());return!!(t&&t[1]===`#`)},i=Q([`link`]);for(let e of i){let n=(0,Z.getDescendantsByType)(e,[`label`,`labelText`]),i=(0,Z.getDescendantsByType)(e,[`reference`]),a=(0,Z.getDescendantsByType)(e,[`resource`]),o=(0,Z.getDescendantsByType)(i,[`referenceString`]),s=(0,Z.getDescendantsByType)(a,[`resourceDestination`,[`resourceDestinationLiteral`,`resourceDestinationRaw`],`resourceDestinationString`]),c=n.length>0,l=i.length>0,u=a.length>0,d=o.length>0,f=s.length>0,p=!1;c&&(!l&&!u||l&&!d)?p=r(n[0]):d&&!f?p=r(o[0]):!d&&f?p=s[0].text.trim()===`#`:!d&&!f&&(p=!0),p&&(0,X.addErrorContext)(t,e.startLine,e.text,void 0,void 0,[e.startColumn,e.endColumn-e.startColumn])}}},yB={names:[`MD043`,`required-headings`],description:`Required heading structure`,tags:[`headings`],parser:`micromark`,function:function(e,t){let n=e.config.headings;if(!Array.isArray(n))return;let r=e.config.match_case||!1,i=0,a=!1,o=!1,s=!1,c=()=>String(n[i++]||`[None]`),l=e=>r?e:e.toLowerCase();for(let e of Q([`atxHeading`,`setextHeading`]))if(!o){let n=(0,Z.getHeadingText)(e),r=(0,Z.getHeadingLevel)(e);s=!0;let u=`${``.padEnd(r,`#`)} ${n}`,d=c();d===`*`?l(c())!==l(u)&&(a=!0,i--):d===`+`?a=!0:d===`?`||(l(d)===l(u)?a=!1:a?i--:((0,X.addErrorDetailIf)(t,e.startLine,d,u),o=!0))}let u=n.length-i;!o&&(u>1||u===1&&n[i]!==`*`)&&(s||!n.every(e=>e===`*`))&&(0,X.addErrorContext)(t,e.lines.length,n[i])}};function bB(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let g,v;return b;function b(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),S}function S(t){return t===35?(g=o,w(t)):t===46?(g=s,w(t)):m&&h(t)?ae(e,S,`whitespace`)(t):!m&&C(t)?ue(e,S)(t):t===null||x(t)||y(t)||_(t)&&t!==45&&t!==95?ce(t):(e.enter(a),e.enter(c),e.consume(t),ee)}function w(t){let n=g+`Marker`;return e.enter(a),e.enter(g),e.enter(n),e.consume(t),e.exit(n),T}function T(t){if(t===null||t===34||t===35||t===39||t===46||t===60||t===61||t===62||t===96||t===125||C(t))return n(t);let r=g+`Value`;return e.enter(r),e.consume(t),E}function E(t){if(t===null||t===34||t===39||t===60||t===61||t===62||t===96)return n(t);if(t===35||t===46||t===125||C(t)){let n=g+`Value`;return e.exit(n),e.exit(g),e.exit(a),S(t)}return e.consume(t),E}function ee(t){return t===null||x(t)||y(t)||_(t)&&t!==45&&t!==46&&t!==58&&t!==95?(e.exit(c),m&&h(t)?ae(e,te,`whitespace`)(t):!m&&C(t)?ue(e,te)(t):te(t)):(e.consume(t),ee)}function te(t){return t===61?(e.enter(l),e.consume(t),e.exit(l),D):(e.exit(a),S(t))}function D(t){return t===null||t===60||t===61||t===62||t===96||t===125||m&&x(t)?n(t):t===34||t===39?(e.enter(u),e.enter(f),e.consume(t),e.exit(f),v=t,re):m&&h(t)?ae(e,D,`whitespace`)(t):!m&&C(t)?ue(e,D)(t):(e.enter(d),e.enter(p),e.consume(t),v=void 0,ne)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===62||t===96?n(t):t===125||C(t)?(e.exit(p),e.exit(d),e.exit(a),S(t)):(e.consume(t),ne)}function re(t){return t===v?(e.enter(f),e.consume(t),e.exit(f),e.exit(u),e.exit(a),se):(e.enter(d),ie(t))}function ie(t){return t===v?(e.exit(d),re(t)):t===null?n(t):x(t)?m?n(t):ue(e,ie)(t):(e.enter(p),e.consume(t),oe)}function oe(t){return t===v||t===null||x(t)?(e.exit(p),ie(t)):(e.consume(t),oe)}function se(e){return e===125||C(e)?S(e):ce(e)}function ce(a){return a===125?(e.enter(i),e.consume(a),e.exit(i),e.exit(r),t):n(a)}}function xB(e,t,n,r,i,a,o){let s=0,c=0,l;return u;function u(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),d}function d(n){return n===93?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),f(n))}function f(t){if(t===93&&!c)return h(t);let n=e.enter(`chunkText`,{_contentTypeTextTrailing:!0,contentType:`text`,previous:l});return l&&(l.next=n),l=n,p(t)}function p(t){return t===null||s>999||t===91&&++c>32?n(t):t===93&&!c--?(e.exit(`chunkText`),h(t)):x(t)?o?n(t):(e.consume(t),e.exit(`chunkText`),f):(e.consume(t),t===92?m:p)}function m(t){return t===91||t===92||t===93?(e.consume(t),s++,p):p(t)}function h(n){return e.exit(a),e.enter(i),e.consume(n),e.exit(i),e.exit(r),t}}function SB(e,t,n,r){let i=this;return a;function a(t){return t===null||x(t)||_(t)||y(t)?n(t):(e.enter(r),e.consume(t),o)}function o(a){return a===null||x(a)||y(a)||_(a)&&a!==45&&a!==95?(e.exit(r),i.previous===45||i.previous===95?n(a):t(a)):(e.consume(a),o)}}var CB={tokenize:DB,concrete:!0},wB={tokenize:OB,partial:!0},TB={tokenize:kB,partial:!0},EB={tokenize:AB,partial:!0};function DB(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0,s;return c;function c(t){return e.enter(`directiveContainer`),e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),l(t)}function l(t){return t===58?(e.consume(t),o++,l):o<3?n(t):(e.exit(`directiveContainerSequence`),SB.call(r,e,u,n,`directiveContainerName`)(t))}function u(t){return t===91?e.attempt(wB,d,d)(t):d(t)}function d(t){return t===123?e.attempt(TB,f,f)(t):f(t)}function f(t){return ae(e,p,`whitespace`)(t)}function p(i){return e.exit(`directiveContainerFence`),i===null?w(i):x(i)?r.interrupt?t(i):e.attempt(EB,m,w)(i):n(i)}function m(t){return t===null?w(t):x(t)?e.check(EB,y,w)(t):(e.enter(`directiveContainerContent`),h(t))}function h(t){return e.attempt({tokenize:T,partial:!0},C,a?ae(e,g,`linePrefix`,a+1):g)(t)}function g(t){return t===null?C(t):x(t)?e.check(EB,v,C)(t):v(t)}function _(t){if(t===null){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,C(t)}return x(t)?e.check(EB,b,S)(t):(e.consume(t),_)}function v(t){let n=e.enter(`chunkDocument`,{contentType:`document`,previous:s});return s&&(s.next=n),s=n,_(t)}function y(t){return e.enter(`directiveContainerContent`),h(t)}function b(t){e.consume(t);let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,h}function S(t){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,C(t)}function C(t){return e.exit(`directiveContainerContent`),w(t)}function w(n){return e.exit(`directiveContainer`),t(n)}function T(e,t,n){let i=0;return ae(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),s(t)}function s(t){return t===58?(e.consume(t),i++,s):i<o?n(t):(e.exit(`directiveContainerSequence`),ae(e,c,`whitespace`)(t))}function c(r){return r===null||x(r)?(e.exit(`directiveContainerFence`),t(r)):n(r)}}}function OB(e,t,n){return xB(e,t,n,`directiveContainerLabel`,`directiveContainerLabelMarker`,`directiveContainerLabelString`,!0)}function kB(e,t,n){return bB(e,t,n,`directiveContainerAttributes`,`directiveContainerAttributesMarker`,`directiveContainerAttribute`,`directiveContainerAttributeId`,`directiveContainerAttributeClass`,`directiveContainerAttributeName`,`directiveContainerAttributeInitializerMarker`,`directiveContainerAttributeValueLiteral`,`directiveContainerAttributeValue`,`directiveContainerAttributeValueMarker`,`directiveContainerAttributeValueData`,!0)}function AB(e,t,n){let r=this;return i;function i(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var jB={tokenize:PB},MB={tokenize:FB,partial:!0},NB={tokenize:IB,partial:!0};function PB(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveLeaf`),e.enter(`directiveLeafSequence`),e.consume(t),a}function a(t){return t===58?(e.consume(t),e.exit(`directiveLeafSequence`),SB.call(r,e,o,n,`directiveLeafName`)):n(t)}function o(t){return t===91?e.attempt(MB,s,s)(t):s(t)}function s(t){return t===123?e.attempt(NB,c,c)(t):c(t)}function c(t){return ae(e,l,`whitespace`)(t)}function l(r){return r===null||x(r)?(e.exit(`directiveLeaf`),t(r)):n(r)}}function FB(e,t,n){return xB(e,t,n,`directiveLeafLabel`,`directiveLeafLabelMarker`,`directiveLeafLabelString`,!0)}function IB(e,t,n){return bB(e,t,n,`directiveLeafAttributes`,`directiveLeafAttributesMarker`,`directiveLeafAttribute`,`directiveLeafAttributeId`,`directiveLeafAttributeClass`,`directiveLeafAttributeName`,`directiveLeafAttributeInitializerMarker`,`directiveLeafAttributeValueLiteral`,`directiveLeafAttributeValue`,`directiveLeafAttributeValueMarker`,`directiveLeafAttributeValueData`,!0)}var LB={tokenize:VB,previous:BB},RB={tokenize:HB,partial:!0},zB={tokenize:UB,partial:!0};function BB(e){return e!==58||this.events[this.events.length-1][1].type===`characterEscape`}function VB(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveText`),e.enter(`directiveTextMarker`),e.consume(t),e.exit(`directiveTextMarker`),SB.call(r,e,a,n,`directiveTextName`)}function a(t){return t===58?n(t):t===91?e.attempt(RB,o,o)(t):o(t)}function o(t){return t===123?e.attempt(zB,s,s)(t):s(t)}function s(n){return e.exit(`directiveText`),t(n)}}function HB(e,t,n){return xB(e,t,n,`directiveTextLabel`,`directiveTextLabelMarker`,`directiveTextLabelString`)}function UB(e,t,n){return bB(e,t,n,`directiveTextAttributes`,`directiveTextAttributesMarker`,`directiveTextAttribute`,`directiveTextAttributeId`,`directiveTextAttributeClass`,`directiveTextAttributeName`,`directiveTextAttributeInitializerMarker`,`directiveTextAttributeValueLiteral`,`directiveTextAttributeValue`,`directiveTextAttributeValueMarker`,`directiveTextAttributeValueData`)}function WB(){return{text:{58:LB},flow:{58:[CB,jB]}}}var GB=Fe();function KB(){let e={...WB()};return delete e.text,e}function qB(e,t){return e.slice(t.start.offset,t.end.offset)}function JB(e,t={}){let n=[KB(),je(),he(),M(),CF(),...t.extensions||[]],r=[],i=A.tokenize;function a(t,n,a){let o=this,s=o.events;return i.call(o,t,n,t=>{let n=s.length;for(;--n>=0;){let[e,t]=s[n];if(e===`enter`){let{type:e}=t;if(e===`labelImage`||e===`labelLink`)break}}if(n>=0){let[,t]=s[n],[,i]=s[s.length-1],a={type:`undefinedReferenceShortcut`,start:t.start,end:i.end},c={type:`undefinedReference`,start:t.start,end:i.end},l=s.slice(n).filter(e=>{let[,t]=e,{type:n}=t;return n===`data`||n===`lineEnding`}),u=r.length>0&&r[r.length-1][0],d=u&&u[1];d&&d.end.line===a.start.line&&d.end.column===a.start.column&&(l.length===0?(d.type=`undefinedReferenceCollapsed`,d.end=i.end):(a.type=`undefinedReferenceFull`,a.start=d.start,r.pop()));let f=l.filter(e=>e[0]===`enter`).map(t=>qB(e,t[1])).join(``).trim();if(f.length>0&&!f.includes(`]`)){let e=[[`enter`,a,o],[`enter`,c,o]];for(let t of l){let[n,r]=t;e.push([n,{...r},o])}e.push([`exit`,c,o],[`exit`,a,o]),r.push(e)}}return a(t)})}try{A.tokenize=a;let i=pe({...t,extensions:n}),o=Ce()(e,void 0,!0);return ce(i.document().write(o)).concat(...r)}finally{A.tokenize=i}}function YB(e,t={},n={},r=0,i=void 0){let a=!!t.freezeTokens,o=JB(e,n),s=[],c=[],l={type:`data`,startLine:-1,startColumn:-1,endLine:-1,endColumn:-1,text:`ROOT`,children:s,parent:null},u=[l],d=l,f=null,p=null,m=!1;for(let s of o){let[o,h]=s,{type:g,start:_,end:v}=h,{column:y,line:b}=_,{column:x,line:S}=v,C=qB(e,h);if(o===`enter`&&!m){let a=d;if(u.push(a),d={type:g,startLine:b+r,startColumn:y,endLine:S+r,endColumn:x,text:C,children:[],parent:a===l?i||null:a},i&&Object.defineProperty(d,GB.htmlFlowSymbol,{value:!0}),a.children.push(d),c.push(d),d.type===`htmlFlow`&&!(0,Z.isHtmlFlowComment)(d)){m=!0,(!f||!p)&&(f={...n,extensions:[{disable:{null:[`codeIndented`,`htmlFlow`]}}]},p=e.split(GB.newlineRe));let r=YB(p.slice(d.startLine-1,d.endLine).join(`
|
|
378
378
|
`),t,f,d.startLine-1,d);d.children=r,c=c.concat(r[GB.flatTokensSymbol])}}else o===`exit`&&(g===`htmlFlow`&&(m=!1),m||(a&&(Object.freeze(d.children),Object.freeze(d)),d=u.pop()))}return Object.defineProperty(s,GB.flatTokensSymbol,{value:c}),a&&Object.freeze(s),s}function XB(e,t){return YB(e,t)}var ZB=new Set([`codeFencedFence`,`definition`,`reference`,`resource`]),QB={names:[`MD044`,`proper-names`],description:`Proper names should have the correct capitalization`,tags:[`spelling`],parser:`micromark`,function:function(e,t){let n=e.config.names;if(n=Array.isArray(n)?n:[],n.sort((e,t)=>t.length-e.length||e.localeCompare(t)),n.length===0)return;let r=e.config.code_blocks,i=r===void 0?!0:!!r,a=e.config.html_elements,o=a===void 0?!0:!!a,s=new Set([`data`]);i&&(s.add(`codeFlowValue`),s.add(`codeTextData`)),o&&(s.add(`htmlFlowData`),s.add(`htmlTextData`));let c=(0,Z.filterByPredicate)(e.parsers.micromark.tokens,e=>s.has(e.type),e=>e.children.filter(e=>!ZB.has(e.type))),l=[],u=new Set;for(let e of n){let r=(0,X.escapeForRegExp)(e),i=`(${/^\W/.test(e)?``:`\\b_*`})(${r})${/\W$/.test(e)?``:`_*\\b`}`,a=new RegExp(i,`gi`);for(let r of c){let i=null;for(;(i=a.exec(r.text))!==null;){let[,a,o]=i,s=r.startColumn+i.index+a.length,c=o.length,d=r.startLine,f={startLine:d,startColumn:s,endLine:d,endColumn:s+c-1};if(!n.includes(o)&&!l.some(e=>(0,X.hasOverlap)(e,f))){let n=[];u.has(r)||(n=(0,Z.filterByTypes)(XB(r.text),[`literalAutolink`]).map(e=>({startLine:d,startColumn:r.startColumn+e.startColumn-1,endLine:d,endColumn:r.endColumn+e.endColumn-1})),l.push(...n),u.add(r)),n.some(e=>(0,X.hasOverlap)(e,f))||(0,X.addErrorDetailIf)(t,r.startLine,e,o,void 0,void 0,[s,c],{editColumn:s,deleteCount:c,insertText:e})}l.push(f)}}}}},$B=(0,X.getHtmlAttributeRe)(`alt`),eV=(0,X.getHtmlAttributeRe)(`aria-hidden`),tV={names:[`MD045`,`no-alt-text`],description:`Images should have alternate text (alt text)`,tags:[`accessibility`,`images`],parser:`micromark`,function:function(e,t){let n=Q([`image`]);for(let e of n)if((0,Z.getDescendantsByType)(e,[`label`,`labelText`]).some(e=>e.text.length===0)){let n=e.startLine===e.endLine?[e.startColumn,e.endColumn-e.startColumn]:void 0;(0,X.addError)(t,e.startLine,void 0,void 0,n)}let r=Q([`htmlText`],!0);for(let e of r){let{startColumn:n,startLine:r,text:i}=e,a=(0,Z.getHtmlTagInfo)(e);a&&!a.close&&a.name.toLowerCase()===`img`&&!$B.test(i)&&eV.exec(i)?.[1].toLowerCase()!==`true`&&(0,X.addError)(t,r,void 0,void 0,[n,i.replace(X.nextLinesRe,``).length])}}},nV=e=>e===`codeFenced`?`fenced`:`indented`,rV={names:[`MD046`,`code-block-style`],description:`Code block style`,tags:[`code`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`);for(let e of Q([`codeFenced`,`codeIndented`])){let{startLine:r,type:i}=e;n===`consistent`&&(n=nV(i)),(0,X.addErrorDetailIf)(t,r,n,nV(i))}}},iV={names:[`MD047`,`single-trailing-newline`],description:`Files should end with a single newline character`,tags:[`blank_lines`],parser:`none`,function:function(e,t){let n=e.lines.length,r=e.lines[n-1];(0,X.isBlankLine)(r)||(0,X.addError)(t,n,void 0,void 0,[r.length,1],{insertText:`
|
|
379
379
|
`,editColumn:r.length+1})}};function aV(e){switch(e[0]){case`~`:return`tilde`;default:return`backtick`}}var oV={names:[`MD048`,`code-fence-style`],description:`Code fence style`,tags:[`code`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`),r=Q([`codeFenced`]);for(let e of r){let{startLine:r,text:i}=(0,Z.getDescendantsByType)(e,[`codeFencedFence`,`codeFencedFenceSequence`])[0];n===`consistent`&&(n=aV(i)),(0,X.addErrorDetailIf)(t,r,n,aV(i))}}},sV=/^\w$/;function cV(e){switch(e[0]){case`*`:return`asterisk`;default:return`underscore`}}var lV=(e,t,n,r,i,a,o=`consistent`)=>{let{lines:s,parsers:c}=e,l=(0,Z.filterByPredicate)(c.micromark.tokens,e=>e.type===n,e=>e.type===`htmlFlow`?[]:e.children);for(let e of l){let n=(0,Z.getDescendantsByType)(e,[r]),c=n[0],l=n[n.length-1];if(c&&l){let e=cV(c.text);if(o===`consistent`&&(o=e),o!==e&&!(o===`underscore`&&(sV.test(s[c.startLine-1][c.startColumn-2])||sV.test(s[l.endLine-1][l.endColumn-1]))))for(let n of[c,l])(0,X.addError)(t,n.startLine,`Expected: ${o}; Actual: ${e}`,void 0,[n.startColumn,n.text.length],{editColumn:n.startColumn,deleteCount:n.text.length,insertText:o===`asterisk`?i:a})}}},uV=[{names:[`MD049`,`emphasis-style`],description:`Emphasis style`,tags:[`emphasis`],parser:`micromark`,function:function(e,t){return lV(e,t,`emphasis`,`emphasisSequence`,`*`,`_`,e.config.style||void 0)}},{names:[`MD050`,`strong-style`],description:`Strong style`,tags:[`emphasis`],parser:`micromark`,function:function(e,t){return lV(e,t,`strong`,`strongSequence`,`**`,`__`,e.config.style||void 0)}}],dV=(0,X.getHtmlAttributeRe)(`id`),fV=(0,X.getHtmlAttributeRe)(`name`),pV=/\{(#[a-z\d]+(?:[-_][a-z\d]+)*)\}/gu,mV=/^#(?:L\d+(?:C\d+)?-L\d+(?:C\d+)?|L\d+)$/,hV=new Set([`image`,`reference`,`resource`]),gV=new Set([`characterEscapeValue`,`codeTextData`,`data`,`mathTextData`]);function _V(e){let t=(0,Z.filterByPredicate)(e.children,e=>gV.has(e.type),e=>hV.has(e.type)?[]:e.children).map(e=>e.text).join(``);return`#`+encodeURIComponent(t.toLowerCase().replace(/[^\p{Letter}\p{Mark}\p{Number}\p{Connector_Punctuation}\- ]/gu,``).replace(/ /gu,`-`).toWellFormed())}function vV(e){return(0,Z.filterByTypes)(e.children,[`characterEscapeValue`,`data`]).map(e=>e.text).join(``)}var yV={names:[`MD051`,`link-fragments`],description:`Link fragments should be valid`,tags:[`links`],parser:`micromark`,function:function(e,t){let n=e.config.ignore_case||!1,r=e.config.ignored_pattern||``,i=new RegExp(r||`^$`),a=new Map([[`#top`,0]]),o=Q([`atxHeadingText`,`setextHeadingText`]);for(let e of o){let t=_V(e);if(t!==`#`){let n=a.get(t)||0;n&&a.set(`${t}-${n}`,0),a.set(t,n+1);let r=null;for(;(r=pV.exec(e.text))!==null;){let[,e]=r;a.has(e)||a.set(e,1)}}}for(let e of Q([`htmlText`],!0)){let t=(0,Z.getHtmlTagInfo)(e);if(t&&!t.close){let n=dV.exec(e.text)||t.name.toLowerCase()===`a`&&fV.exec(e.text);n&&n.length>0&&a.set(`#${n[1]}`,0)}}for(let[e,r]of[[`link`,`resourceDestinationString`],[`definition`,`definitionDestinationString`]]){let o=Q([e]).filter(e=>!(e.parent?.type===`atxHeadingText`&&(0,Z.isDocfxTab)(e.parent.parent)));for(let e of o){let o=(0,Z.filterByTypes)(e.children,[r]);for(let r of o){let{endColumn:o,startColumn:s}=r,c=vV(r),l=c.slice(1),u=`#${encodeURIComponent(l.toWellFormed())}`;if(c.length>1&&c.startsWith(`#`)&&!a.has(u)&&!mV.test(u)&&!i.test(l)){let r,i,l;e.startLine===e.endLine&&(r=e.text,i=[e.startColumn,e.endColumn-e.startColumn],l={editColumn:s,deleteCount:o-s});let u=c.toLowerCase(),d=[...a.keys()].find(e=>u===e.toLowerCase());d?((l||{}).insertText=d,!n&&d!==c&&(0,X.addError)(t,e.startLine,`Expected: ${d}; Actual: ${c}`,r,i,l)):(0,X.addError)(t,e.startLine,void 0,r,i)}}}}}},bV={names:[`MD052`,`reference-links-images`],description:`Reference links and images should use a label that is defined`,tags:[`images`,`links`],parser:`none`,function:function(e,t){let{config:n,lines:r}=e,i=n.shortcut_syntax||!1,a=new Set(n.ignored_labels||[`x`]),{definitions:o,references:s,shortcuts:c}=iz(),l=i?[...s.entries(),...c.entries()]:s.entries();for(let e of l){let[n,i]=e;if(!o.has(n)&&!a.has(n))for(let e of i){let[i,a,o]=e,s=r[i].slice(a,a+o);(0,X.addError)(t,i+1,`Missing link or image reference definition: "${n}"`,s,[a+1,s.length])}}}},xV=/^ {0,3}\[([^\]]*[^\\])\]:/,SV={names:[`MD053`,`link-image-reference-definitions`],description:`Link and image reference definitions should be needed`,tags:[`images`,`links`],parser:`none`,function:function(e,t){let n=new Set(e.config.ignored_definitions||[`//`]),r=e.lines,{references:i,shortcuts:a,definitions:o,duplicateDefinitions:s}=iz(),c=e=>e.replace(xV,``).trim().length>0,l={deleteCount:-1};for(let e of o.entries()){let[o,[s]]=e;if(!n.has(o)&&!i.has(o)&&!a.has(o)){let e=r[s];(0,X.addError)(t,s+1,`Unused link or image reference definition: "${o}"`,(0,X.ellipsify)(e),[1,e.length],c(e)?l:void 0)}}for(let e of s){let[i,a]=e;if(!n.has(i)){let e=r[a];(0,X.addError)(t,a+1,`Duplicate link or image reference definition: "${i}"`,(0,X.ellipsify)(e),[1,e.length],c(e)?l:void 0)}}}},CV=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,wV=e=>e.replace(CV,`$1`),TV=/[ <>]/,EV=e=>{try{new URL(e)}catch{return!1}return!TV.test(e)},DV={names:[`MD054`,`link-image-style`],description:`Link and image style`,tags:[`images`,`links`],parser:`micromark`,function:(e,t)=>{let n=e.config,r=n.autolink===void 0||!!n.autolink,i=n.inline===void 0||!!n.inline,a=n.full===void 0||!!n.full,o=n.collapsed===void 0||!!n.collapsed,s=n.shortcut===void 0||!!n.shortcut,c=n.url_inline===void 0||!!n.url_inline;if(r&&i&&a&&o&&s&&c)return;let{definitions:l}=iz(),u=Q([`autolink`,`image`,`link`]);for(let e of u){let n=null,u=null,{endColumn:d,endLine:f,startColumn:p,startLine:m,text:h,type:g}=e,_=g===`image`,v=!1;if(g===`autolink`)u=(0,Z.getDescendantsByType)(e,[[`autolinkEmail`,`autolinkProtocol`]])[0]?.text,n=u,v=!r&&!!u;else if(n=(0,Z.getDescendantsByType)(e,[`label`,`labelText`])[0].text,u=(0,Z.getDescendantsByType)(e,[`resource`,`resourceDestination`,[`resourceDestinationLiteral`,`resourceDestinationRaw`],`resourceDestinationString`])[0]?.text,u){let t=(0,Z.getDescendantsByType)(e,[`resource`,`resourceTitle`,`resourceTitleString`])[0]?.text;v=!i||!c&&r&&!_&&!t&&n===u&&EV(u)}else{let t=(0,Z.getDescendantsByType)(e,[`reference`]).length===0,r=(0,Z.getDescendantsByType)(e,[`reference`,`referenceString`])[0]?.text,i=r===void 0,c=l.get(r||n);u=c&&c[1]||``,v=!!(u&&(t?!s:i?!o:!a))}if(v){let e,a;if(m===f){e=[p,d-p];let t=null,o=i&&n,s=r&&!_&&EV(u);o&&(c||!s)?t=`${_?`!`:``}[${n.replace(/[[\]]/g,`\\$&`)}](${u.replace(/[()]/g,`\\$&`)})`:s&&(t=`<${wV(u)}>`),t&&(a={editColumn:e[0],insertText:t,deleteCount:e[1]})}(0,X.addErrorContext)(t,m,h.replace(X.nextLinesRe,``),void 0,void 0,e,a)}}}},OV=new Set([`linePrefix`,`whitespace`]),kV=e=>e.filter(e=>!OV.has(e.type)),AV=e=>e[0],jV=e=>e[e.length-1],MV=(e,t)=>[e,t-e+1],NV={names:[`MD055`,`table-pipe-style`],description:`Table pipe style`,tags:[`table`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`consistent`),r=n!==`no_leading_or_trailing`&&n!==`trailing_only`,i=n!==`no_leading_or_trailing`&&n!==`leading_only`,a=Q([`tableDelimiterRow`,`tableRow`]);for(let e of a){let a=AV(e.children),o=AV(kV(a.children)).type===`tableCellDivider`,s=jV(e.children),c=jV(kV(s.children)).type===`tableCellDivider`,l=o?c?`leading_and_trailing`:`leading_only`:c?`trailing_only`:`no_leading_or_trailing`;n===`consistent`&&(n=l,r=o,i=c),o!==r&&(0,X.addErrorDetailIf)(t,a.startLine,n,l,`${r?`Missing`:`Unexpected`} leading pipe`,void 0,MV(e.startColumn,a.startColumn)),c!==i&&(0,X.addErrorDetailIf)(t,s.endLine,n,l,`${i?`Missing`:`Unexpected`} trailing pipe`,void 0,MV(s.endColumn-1,e.endColumn-1))}}},PV=(e,t)=>[e,t-e+1],FV={names:[`MD056`,`table-column-count`],description:`Table column count`,tags:[`table`],parser:`micromark`,function:function(e,t){let n=Q([`tableDelimiterRow`,`tableRow`]),r=0,i=null;for(let e of n){let n=(0,Z.getParentOfType)(e,[`table`]);i!==n&&(r=0,i=n);let a=e.children.filter(e=>[`tableData`,`tableDelimiter`,`tableHeader`].includes(e.type)),o=a.length;r||=o;let s,c;o<r?(s=`Too few cells, row will be missing data`,c=[e.endColumn-1,1]):r<o&&(s=`Too many cells, extra data will be missing`,c=PV(a[r].startColumn,e.endColumn-1)),(0,X.addErrorDetailIf)(t,e.endLine,r,o,s,void 0,c)}}},IV={names:[`MD058`,`blanks-around-tables`],description:`Tables should be surrounded by blank lines`,tags:[`table`],parser:`micromark`,function:function(e,t){let{lines:n}=e,r=Q([`blockQuotePrefix`,`linePrefix`]),i=Q([`table`]);for(let e of i){let i=e.startLine;(0,X.isBlankLine)(n[i-2])||(0,X.addErrorContext)(t,i,n[i-1].trim(),void 0,void 0,void 0,{insertText:(0,Z.getBlockQuotePrefixText)(r,i)});let a=e.endLine;(0,X.isBlankLine)(n[a])||(0,X.addErrorContext)(t,a,n[a-1].trim(),void 0,void 0,void 0,{lineNumber:a+1,insertText:(0,Z.getBlockQuotePrefixText)(r,a)})}}},LV=new Set([`codeText`,`htmlText`]),RV=[`click here`,`here`,`link`,`more`];function zV(e){return e.replace(/[\W_]+/g,` `).replace(/\s+/g,` `).toLowerCase().trim()}var BV={names:[`MD059`,`descriptive-link-text`],description:`Link text should be descriptive`,tags:[`accessibility`,`links`],parser:`micromark`,function:function(e,t){let n=new Set((e.config.prohibited_texts||RV).map(zV));if(n.size>0){let e=Q([`link`]);for(let r of e){let e=(0,Z.getDescendantsByType)(r,[`label`,`labelText`]);for(let r of e){let{children:e,endColumn:i,endLine:a,parent:o,startColumn:s,startLine:c,text:l}=r;if(!e.some(e=>LV.has(e.type))&&n.has(zV(l))){let e=c===a?[s,i-s]:void 0;(0,X.addErrorContext)(t,c,o.text,void 0,void 0,e)}}}}}};function VV({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}var HV=VV();function UV(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes(`\x1B`)&&!e.includes(``)?e:e.replace(HV,``)}var WV=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],GV=[12288,12288,65281,65376,65504,65510],KV=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],qV=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},JV=19968,[YV,XV]=ZV(KV);function ZV(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(JV>=i&&JV<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var QV=e=>e<161||e>1114109?!1:qV(WV,e),$V=e=>e<12288||e>65510?!1:qV(GV,e),eH=e=>e>=YV&&e<=XV?!0:e<4352||e>262141?!1:qV(KV,e);function tH(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function nH(e,{ambiguousAsWide:t=!1}={}){return tH(e),$V(e)||eH(e)||t&&QV(e)?2:1}var rH=new Intl.Segmenter,iH=RegExp(`^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Format}|\\p{Mark}|\\p{Surrogate})+$`,`v`),aH=RegExp(`^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+`,`v`),oH=RegExp(`^\\p{RGI_Emoji}$`,`v`),sH=/^[\d#*]\u20E3$/,cH=/\p{Extended_Pictographic}/gu;function lH(e){if(e.length>50)return!1;if(sH.test(e))return!0;if(e.includes(``)){let t=e.match(cH);return t!==null&&t.length>=2}return!1}function uH(e){return e.replace(aH,``)}function dH(e){return iH.test(e)}function fH(e){return e>=4352&&e<=4447||e>=43360&&e<=43388}function pH(e){return e>=4448&&e<=4519||e>=55216&&e<=55238}function mH(e){return e>=4520&&e<=4607||e>=55243&&e<=55291}function hH(e){return fH(e)||pH(e)||mH(e)}function gH(e,t){let n=[];for(let t of e)iH.test(t)||n.push(t.codePointAt(0));if(n.length===0)return;let r=0;for(let e=0;e<n.length;e++){let i=n[e];if(!hH(i)){if(r===0)return;for(let i=e;i<n.length;i++)r+=nH(n[i],t);return r}if(fH(i)&&pH(n[e+1])){r+=2,e+=mH(n[e+2])?2:1;continue}r+=nH(i,t)}return r}function _H(e,t){let n=0,r=!0;for(let i of e){if(r){r=!1;continue}i>=``&&i<=``&&(n+=nH(i.codePointAt(0),t))}return n}function vH(e,t={}){if(typeof e!=`string`||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t,i=e;if(!r&&(i.includes(`\x1B`)||i.includes(``))&&(i=UV(i)),i.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(i))return i.length;let a=0,o={ambiguousAsWide:!n};for(let{segment:e}of rH.segment(i)){if(dH(e))continue;if(oH.test(e)||lH(e)){a+=2;continue}let t=uH(e),n=gH(t,o);if(n!==void 0){a+=n;continue}let r=t.codePointAt(0);a+=nH(r,o),a+=_H(t,o)}return a}function yH(e,t,n,r,i){e.push({lineNumber:t,detail:r,range:[n,1],fixInfo:i})}function bH(e,t){return(0,Z.filterByTypes)(t.children,[`tableCellDivider`]).map(n=>({actual:n.startColumn,effective:vH(e[t.startLine-1].slice(0,n.startColumn-1))}))}function xH(e,t,n){let r=[],i=t[0],a=bH(e,i);for(let i of t.slice(1)){let t=new Set(a.map(e=>e.effective)),o=bH(e,i);for(let e of o)t.size>0&&!t.delete(e.effective)&&yH(r,i.startLine,e.actual,n)}return r}var SH={names:[`MD060`,`table-column-style`],description:`Table column style`,tags:[`table`],parser:`micromark`,function:function(e,t){let n=String(e.config.style||`any`),r=n===`any`||n===`aligned`,i=n===`any`||n===`compact`,a=n===`any`||n===`tight`,o=!!e.config.aligned_delimiter,s=e.lines,c=Q([`table`]);for(let e of c){let n=(0,Z.filterByTypes)(e.children,[`tableDelimiterRow`,`tableRow`]),c=[];r&&c.push(...xH(s,n,`Table pipe does not align with header for style "aligned"`));let l=[],u=[];if((i||a)&&!(r&&c.length===0)){if(o){let e=xH(s,n.slice(0,2),`Table pipe does not align with header for option "aligned_delimiter"`);l.push(...e),u.push(...e)}for(let e of n){let t=(0,Z.filterByTypes)(e.children,[`tableCellDivider`,`tableContent`,`whitespace`]);for(let n=0;n<t.length;n++){let{startColumn:r,startLine:i,type:a}=t[n];if(a===`tableCellDivider`){let a=t[n-1];a&&(a.type===`whitespace`?(a.text.length!==1&&yH(l,i,r,`Table pipe has extra space to the left for style "compact"`,{editColumn:a.startColumn,deleteCount:a.text.length-1}),yH(u,i,r,`Table pipe has space to the left for style "tight"`,{editColumn:a.startColumn,deleteCount:a.text.length})):yH(l,i,r,`Table pipe is missing space to the left for style "compact"`,{editColumn:a.endColumn,insertText:` `}));let o=t[n+1];o&&(o.type===`whitespace`?o.endColumn!==e.endColumn&&(o.text.length!==1&&yH(l,i,r,`Table pipe has extra space to the right for style "compact"`,{editColumn:o.startColumn,deleteCount:o.text.length-1}),yH(u,i,r,`Table pipe has space to the right for style "tight"`,{editColumn:o.startColumn,deleteCount:o.text.length})):yH(l,i,r,`Table pipe is missing space to the right for style "compact"`,{editColumn:o.startColumn,insertText:` `}))}}}}let d=c;i&&(l.length<d.length||!r)&&(d=l),a&&(u.length<d.length||!r&&!i)&&(d=u);for(let e of d)t(e)}}},[CH,wH]=Nz,[TH,EH]=uV,DH=[uz,dz,gz,_z,bz,xz,Cz,Tz,Ez,Oz,Az,jz,CH,Pz,wH,Rz,zz,Bz,Vz,Hz,Wz,Kz,Xz,Zz,eB,nB,iB,aB,oB,lB,uB,dB,pB,mB,_B,vB,yB,QB,tV,rV,iV,oV,TH,EH,yV,bV,SV,DV,NV,FV,IV,BV,SH];for(let e of DH){let t=e.names[0].toLowerCase();e.information=new URL(`${az}/blob/v${oz}/doc/${t}.md`)}function OH(e,t,n){let r=null,i=null,a=[],o=0;return(n||[JSON.parse]).every(e=>{try{let n=e(t);return r=n&&typeof n==`object`&&!Array.isArray(n)?n:{},!1}catch(e){a.push(`Parser ${o++}: ${e?.message}`)}return!0})&&(a.unshift(`Unable to parse '${e}'`),i=a.join(`; `)),{config:r,message:i}}function kH(e,t){let n=null;if(e.length===DH.length)return n;let r={};for(let[i,a]of e.entries()){let e=i-DH.length;function o(t,n){return Error(`Property '${t}' of custom rule at index ${e} is incorrect: '${n}'.`)}for(let e of[`names`,`tags`]){let t=a[e];!n&&(!t||!Array.isArray(t)||t.length===0||!t.every(X.isString)||t.some(X.isEmptyString))&&(n=o(e,t))}for(let e of[[`description`,`string`],[`function`,`function`]]){let t=e[0],r=a[t];!n&&(!r||typeof r!==e[1])&&(n=o(t,r))}if(!n&&a.parser!==void 0&&a.parser!==`markdownit`&&a.parser!==`micromark`&&a.parser!==`none`&&(n=o(`parser`,a.parser)),!n&&a.information&&!X.isUrl(a.information)&&(n=o(`information`,a.information)),!n&&a.asynchronous!==void 0&&typeof a.asynchronous!=`boolean`&&(n=o(`asynchronous`,a.asynchronous)),!n&&a.asynchronous&&t&&(n=Error(`Custom rule `+a.names.join(`/`)+` at index `+e+` is asynchronous and can not be used in a synchronous context.`)),!n){for(let t of a.names){let i=t.toUpperCase();!n&&r[i]!==void 0&&(n=Error(`Name '`+t+`' of custom rule at index `+e+` is already used as a name or tag.`)),r[i]=!0}for(let t of a.tags){let i=t.toUpperCase();!n&&r[i]&&(n=Error(`Tag '`+t+`' of custom rule at index `+e+` is already used as a name.`)),r[i]=!1}}}return n}function AH(e,t){let n=[];if(t){let r=e.match(t);if(r&&!r.index){let t=r[0];e=e.slice(t.length),n=t.split(X.newLineRe),n.length>0&&n[n.length-1]===``&&n.length--}}return{content:e,frontMatterLines:n}}function jH(e){let t={};for(let n of e){let e=n.names[0].toUpperCase();for(let r of n.names){let n=r.toUpperCase();t[n]=[e]}for(let r of n.tags){let n=r.toUpperCase(),i=t[n]||[];i.push(e),t[n]=i}}return t}function MH(e,t,n){let r=!0,i=`error`;Object.entries(t).every(([e,t])=>e.toUpperCase()===`DEFAULT`?(r=!!t,t===`warning`&&(i=`warning`),!1):!0);let a={},o=new Map,s=new Map,c=Object.freeze({});for(let t of e.map(e=>e.names[0].toUpperCase()))a[t]=c,o.set(t,r),s.set(t,i);for(let[e,r]of Object.entries(t)){let t=e.toUpperCase(),i=!1,c=`error`,l={};if(r)if(r instanceof Object){let e=r;i=e.enabled===void 0?!0:!!e.enabled,c=e.severity===`warning`?`warning`:`error`,l=Object.fromEntries(Object.entries(r).filter(([e])=>e!==`enabled`&&e!==`severity`))}else i=!0,c=r===`warning`?`warning`:`error`;for(let e of n[t]||[])Object.freeze(l),a[e]=l,o.set(e,i),s.set(e,c)}return{effectiveConfig:a,rulesEnabled:o,rulesSeverity:s}}function NH(e,t,n,r,i,a,o){let s=new Map,c=s,l=Array(1+n.length);function u(e,t,n=void 0){for(let[i,a]of e.entries()){if(!r){let e=null;for(;e=X.inlineCommentStartRe.exec(a);){let n=e[2].toUpperCase(),r=e.index+e[1].length,o=a.indexOf(`-->`,r);if(o===-1)break;t(n,a.slice(r,o),i+1)}}n&&n()}}function d(e,t){if(e===`CONFIGURE-FILE`){let{config:e}=OH(`CONFIGURE-FILE`,t,a);e&&(i={...i,...e})}}function f(e,t,n){n=new Map(n);let r=e.startsWith(`ENABLE`),i=t&&t.trim(),a=i?i.toUpperCase().split(/\s+/):b;for(let e of a)for(let t of o[e]||[])n.set(t,r);return n}function p(e,t){(e===`ENABLE-FILE`||e===`DISABLE-FILE`)&&(s=f(e,t,s))}function m(e,t){e===`CAPTURE`?c=s:e===`RESTORE`?s=c:(e===`ENABLE`||e===`DISABLE`)&&(s=f(e,t,s))}function h(){l.push(s)}function g(e,t,r){let i=e===`DISABLE-LINE`,a=e===`DISABLE-NEXT-LINE`;if(i||a){let i=n.length+r+ +!!a;l[i]=f(e,t,l[i])}}u([t.join(`
|
|
380
|
-
`)],d);let{effectiveConfig:_,rulesEnabled:v,rulesSeverity:y}=MH(e,i,o),b=[...v.keys()];return s=new Map(v),c=s,u(t,p),u(t,m,h),u(t,g),{effectiveConfig:_,enabledRulesPerLineNumber:l,enabledRuleList:e.filter(e=>{let t=e.names[0].toUpperCase();return l.some(e=>e.get(t))}),rulesSeverity:y}}function PH(e,t,n,i,a,s,c,l,u,d,f,p){let m=e=>p(e instanceof Error?e:Error(e));i=i.replace(/^\uFEFF/,``);let h=AH(i,l),{frontMatterLines:g}=h;i=h.content;let{effectiveConfig:_,enabledRulesPerLineNumber:v,enabledRuleList:y,rulesSeverity:b}=NH(e,i.split(X.newLineRe),g,d,s,c,t),x=y.some(e=>e.parser===`markdownit`||e.parser===void 0),S=y.some(e=>e.parser===`micromark`),C=e.length!==DH.length,w=S?XB(i,{freezeTokens:C}):[],T=i;i=X.clearHtmlCommentText(i);let E=i.split(X.newLineRe),ee=e=>{let t=Object.freeze({markdownit:Object.freeze({tokens:e})}),r=Object.freeze({micromark:Object.freeze({tokens:w})}),i=Object.freeze({}),a={name:n,version:oz,lines:Object.freeze(E),frontMatterLines:Object.freeze(g)};tz({...a,parsers:r,config:{}});let o=[],s=s=>{let c=s.names[0].toUpperCase(),l={},d=i;s.parser===void 0?(l.tokens=e,d=t):s.parser===`markdownit`?d=t:s.parser===`micromark`&&(d=r);let f=Object.freeze({...a,...l,parsers:d,config:_[c]});function p(e){throw Error(`Value of '${e}' passed to onError by '${c}' is incorrect for '${n}'.`)}function m(e){(!e||!X.isNumber(e.lineNumber)||e.lineNumber<1||e.lineNumber>E.length)&&p(`lineNumber`);let t=e.lineNumber+g.length;if(!v[t].get(c))return;e.detail&&!X.isString(e.detail)&&p(`detail`),e.context&&!X.isString(e.context)&&p(`context`),e.information&&!X.isUrl(e.information)&&p(`information`),e.range&&(!Array.isArray(e.range)||e.range.length!==2||!X.isNumber(e.range[0])||e.range[0]<1||!X.isNumber(e.range[1])||e.range[1]<1||e.range[0]+e.range[1]-1>E[e.lineNumber-1].length)&&p(`range`);let n=e.fixInfo,r={};if(n){X.isObject(n)||p(`fixInfo`),n.lineNumber!==void 0&&((!X.isNumber(n.lineNumber)||n.lineNumber<1||n.lineNumber>E.length)&&p(`fixInfo.lineNumber`),r.lineNumber=n.lineNumber+g.length);let t=n.lineNumber||e.lineNumber;n.editColumn!==void 0&&((!X.isNumber(n.editColumn)||n.editColumn<1||n.editColumn>E[t-1].length+1)&&p(`fixInfo.editColumn`),r.editColumn=n.editColumn),n.deleteCount!==void 0&&((!X.isNumber(n.deleteCount)||n.deleteCount<-1||n.deleteCount>E[t-1].length)&&p(`fixInfo.deleteCount`),r.deleteCount=n.deleteCount),n.insertText!==void 0&&(X.isString(n.insertText)||p(`fixInfo.insertText`),r.insertText=n.insertText)}let i=e.information||s.information;o.push({lineNumber:t,ruleNames:s.names,ruleDescription:s.description,ruleInformation:i?i.href:null,errorDetail:e.detail?.replace(X.newLineRe,` `)||null,errorContext:e.context?.replace(X.newLineRe,` `)||null,errorRange:e.range?[...e.range]:null,fixInfo:n?r:null,severity:b.get(c)})}let h=e=>m({lineNumber:1,detail:`This rule threw an exception: ${e.message||e}`}),y=()=>s.function(f,m);if(s.asynchronous){let e=Promise.resolve().then(y);return u?e.catch(h):e}try{y()}catch(e){if(u)h(e);else throw e}return null},c=()=>(o.sort((e,t)=>e.ruleNames[0].localeCompare(t.ruleNames[0])||e.lineNumber-t.lineNumber),o),l=y.filter(e=>e.asynchronous),d=y.filter(e=>!e.asynchronous),f=[...l,...d],h=()=>p(null,c());try{let e=f.map(s);l.length>0?Promise.all(e.slice(0,l.length)).then(h).catch(m):h()}catch(e){m(e)}finally{tz()}};!x||f?ee(x?(0,lz.requireMarkdownItCjs)().getMarkdownItTokens(a(),T,E):[]):Promise.all([o(()=>import(`./markdownit-
|
|
380
|
+
`)],d);let{effectiveConfig:_,rulesEnabled:v,rulesSeverity:y}=MH(e,i,o),b=[...v.keys()];return s=new Map(v),c=s,u(t,p),u(t,m,h),u(t,g),{effectiveConfig:_,enabledRulesPerLineNumber:l,enabledRuleList:e.filter(e=>{let t=e.names[0].toUpperCase();return l.some(e=>e.get(t))}),rulesSeverity:y}}function PH(e,t,n,i,a,s,c,l,u,d,f,p){let m=e=>p(e instanceof Error?e:Error(e));i=i.replace(/^\uFEFF/,``);let h=AH(i,l),{frontMatterLines:g}=h;i=h.content;let{effectiveConfig:_,enabledRulesPerLineNumber:v,enabledRuleList:y,rulesSeverity:b}=NH(e,i.split(X.newLineRe),g,d,s,c,t),x=y.some(e=>e.parser===`markdownit`||e.parser===void 0),S=y.some(e=>e.parser===`micromark`),C=e.length!==DH.length,w=S?XB(i,{freezeTokens:C}):[],T=i;i=X.clearHtmlCommentText(i);let E=i.split(X.newLineRe),ee=e=>{let t=Object.freeze({markdownit:Object.freeze({tokens:e})}),r=Object.freeze({micromark:Object.freeze({tokens:w})}),i=Object.freeze({}),a={name:n,version:oz,lines:Object.freeze(E),frontMatterLines:Object.freeze(g)};tz({...a,parsers:r,config:{}});let o=[],s=s=>{let c=s.names[0].toUpperCase(),l={},d=i;s.parser===void 0?(l.tokens=e,d=t):s.parser===`markdownit`?d=t:s.parser===`micromark`&&(d=r);let f=Object.freeze({...a,...l,parsers:d,config:_[c]});function p(e){throw Error(`Value of '${e}' passed to onError by '${c}' is incorrect for '${n}'.`)}function m(e){(!e||!X.isNumber(e.lineNumber)||e.lineNumber<1||e.lineNumber>E.length)&&p(`lineNumber`);let t=e.lineNumber+g.length;if(!v[t].get(c))return;e.detail&&!X.isString(e.detail)&&p(`detail`),e.context&&!X.isString(e.context)&&p(`context`),e.information&&!X.isUrl(e.information)&&p(`information`),e.range&&(!Array.isArray(e.range)||e.range.length!==2||!X.isNumber(e.range[0])||e.range[0]<1||!X.isNumber(e.range[1])||e.range[1]<1||e.range[0]+e.range[1]-1>E[e.lineNumber-1].length)&&p(`range`);let n=e.fixInfo,r={};if(n){X.isObject(n)||p(`fixInfo`),n.lineNumber!==void 0&&((!X.isNumber(n.lineNumber)||n.lineNumber<1||n.lineNumber>E.length)&&p(`fixInfo.lineNumber`),r.lineNumber=n.lineNumber+g.length);let t=n.lineNumber||e.lineNumber;n.editColumn!==void 0&&((!X.isNumber(n.editColumn)||n.editColumn<1||n.editColumn>E[t-1].length+1)&&p(`fixInfo.editColumn`),r.editColumn=n.editColumn),n.deleteCount!==void 0&&((!X.isNumber(n.deleteCount)||n.deleteCount<-1||n.deleteCount>E[t-1].length)&&p(`fixInfo.deleteCount`),r.deleteCount=n.deleteCount),n.insertText!==void 0&&(X.isString(n.insertText)||p(`fixInfo.insertText`),r.insertText=n.insertText)}let i=e.information||s.information;o.push({lineNumber:t,ruleNames:s.names,ruleDescription:s.description,ruleInformation:i?i.href:null,errorDetail:e.detail?.replace(X.newLineRe,` `)||null,errorContext:e.context?.replace(X.newLineRe,` `)||null,errorRange:e.range?[...e.range]:null,fixInfo:n?r:null,severity:b.get(c)})}let h=e=>m({lineNumber:1,detail:`This rule threw an exception: ${e.message||e}`}),y=()=>s.function(f,m);if(s.asynchronous){let e=Promise.resolve().then(y);return u?e.catch(h):e}try{y()}catch(e){if(u)h(e);else throw e}return null},c=()=>(o.sort((e,t)=>e.ruleNames[0].localeCompare(t.ruleNames[0])||e.lineNumber-t.lineNumber),o),l=y.filter(e=>e.asynchronous),d=y.filter(e=>!e.asynchronous),f=[...l,...d],h=()=>p(null,c());try{let e=f.map(s);l.length>0?Promise.all(e.slice(0,l.length)).then(h).catch(m):h()}catch(e){m(e)}finally{tz()}};!x||f?ee(x?(0,lz.requireMarkdownItCjs)().getMarkdownItTokens(a(),T,E):[]):Promise.all([o(()=>import(`./markdownit-YwcN3EvW.js`).then(e=>r(e.t(),1)),__vite__mapDeps([0,1]),import.meta.url),new Promise(e=>e(a()))]).then(([e,t])=>{ee(e.getMarkdownItTokens(t,T,E))}).catch(m)}function FH(e,t,n,r,i,a,o,s,c,l,u,d){function f(l,f){return l?d(l):PH(e,t,n,f,r,i,a,o,s,c,u,d)}u?f(null,l.readFileSync(n,`utf8`)):l.readFile(n,`utf8`,f)}function IH(e,t,n){e||={},n||=()=>{};let r=[e.customRules||[]].flat().map(e=>({names:X.cloneIfArray(e.names),description:e.description,information:X.cloneIfUrl(e.information),tags:X.cloneIfArray(e.tags),parser:e.parser,asynchronous:e.asynchronous,function:e.function})),i=DH.concat(r),a=kH(i,t);if(a){n(a);return}let o=[];Array.isArray(e.files)?o=[...e.files]:e.files&&(o=[String(e.files)]);let s=e.strings||{},c=Object.keys(s),l=e.config||{default:!0},u=e.configParsers||void 0,d=e.frontMatter===void 0?X.frontMatterRe:e.frontMatter,f=!!e.handleRuleFailures,p=!!e.noInlineConfig,m=e.markdownItFactory||(()=>{throw Error(`The option 'markdownItFactory' was required (due to the option 'customRules' including a rule requiring the 'markdown-it' parser), but 'markdownItFactory' was not set.`)}),h=e.fs||XR,g=jH(i),_={},v=!1,y=0;function b(){let e;function r(r,i){return y--,r?(v=!0,n(r)):(_[e]=i,t||b(),null)}if(!v){if(e=o.shift())y++,FH(i,g,e,m,l,u,d,f,p,h,t,r);else if(e=c.shift())y++,PH(i,g,e,s[e]||``,m,l,u,d,f,p,t,r);else if(y===0){v=!0;let e=Object.entries(_);e.sort(([e],[t])=>e.localeCompare(t));let t=Object.fromEntries(e);return n(null,t)}}return null}if(t)for(;!v;)b();else b(),b(),b(),b(),b(),b(),b(),b()}function LH(e){let t=null;return IH(e,!0,function(e,n){if(e)throw e;t=n}),t}function RH(e,t=0){return{lineNumber:e.lineNumber||t,editColumn:e.editColumn||1,deleteCount:e.deleteCount||0,insertText:e.insertText||``}}function zH(e,t,n=`
|
|
381
381
|
`){let{editColumn:r,deleteCount:i,insertText:a}=RH(t),o=r-1;return i===-1?null:e.slice(0,o)+a.replace(/\n/g,n)+e.slice(o+i)}function BH(e,t){let n=X.getPreferredLineEnding(e,ZR),r=e.split(X.newLineRe),i=t.filter(e=>e.fixInfo).map(e=>RH(e.fixInfo,e.lineNumber));i.sort((e,t)=>{let n=e.deleteCount===-1,r=t.deleteCount===-1;return t.lineNumber-e.lineNumber||(n?1:r?-1:0)||t.editColumn-e.editColumn||t.insertText.length-e.insertText.length});let a={};i=i.filter(e=>{let t=e.lineNumber!==a.lineNumber||e.editColumn!==a.editColumn||e.deleteCount!==a.deleteCount||e.insertText!==a.insertText;return a=e,t}),a={lineNumber:-1};for(let e of i)e.lineNumber===a.lineNumber&&e.editColumn===a.editColumn&&!e.insertText&&e.deleteCount>0&&a.insertText&&!a.deleteCount&&(e.insertText=a.insertText,a.lineNumber=0),a=e;i=i.filter(e=>e.lineNumber);let o=-1,s=-1;for(let e of i){let{lineNumber:t,editColumn:i,deleteCount:a}=e,c=t-1,l=i-1;(c!==o||a===-1||l+a<=s-(a>0?0:1))&&(r[c]=zH(r[c],e,n)),o=c,s=l}return r.filter(e=>e!==null).join(n)}var VH=/^>|^->|<!--|-->|--!>|<!-$/g,HH=[`>`],UH=[`<`,`>`];function WH(e,t,n,r){return r.settings.bogusComments?`<?`+uI(e.value,Object.assign({},r.settings.characterReferences,{subset:HH}))+`>`:`<!--`+e.value.replace(VH,i)+`-->`;function i(e){return uI(e,Object.assign({},r.settings.characterReferences,{subset:UH}))}}function GH(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var KH=YH(1),qH=YH(-1),JH=[];function YH(e){return t;function t(t,n,r){let i=t?t.children:JH,a=(n||0)+e,o=i[a];if(!r)for(;o&&re(o);)a+=e,o=i[a];return o}}var XH={}.hasOwnProperty;function ZH(e){return t;function t(t,n,r){return XH.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var QH=ZH({body:tU,caption:$H,colgroup:$H,dd:aU,dt:iU,head:$H,html:eU,li:rU,optgroup:sU,option:cU,p:nU,rp:oU,rt:oU,tbody:uU,td:pU,tfoot:dU,th:pU,thead:lU,tr:fU});function $H(e,t,n){let r=KH(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&re(r.value.charAt(0)))}function eU(e,t,n){let r=KH(n,t);return!r||r.type!==`comment`}function tU(e,t,n){let r=KH(n,t);return!r||r.type!==`comment`}function nU(e,t,n){let r=KH(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function rU(e,t,n){let r=KH(n,t);return!r||r.type===`element`&&r.tagName===`li`}function iU(e,t,n){let r=KH(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function aU(e,t,n){let r=KH(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function oU(e,t,n){let r=KH(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function sU(e,t,n){let r=KH(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function cU(e,t,n){let r=KH(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function lU(e,t,n){let r=KH(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function uU(e,t,n){let r=KH(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function dU(e,t,n){return!KH(n,t)}function fU(e,t,n){let r=KH(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function pU(e,t,n){let r=KH(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var mU=ZH({body:_U,colgroup:vU,head:gU,html:hU,tbody:yU});function hU(e){let t=KH(e,-1);return!t||t.type!==`comment`}function gU(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function _U(e){let t=KH(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&re(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function vU(e,t,n){let r=qH(n,t),i=KH(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&QH(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function yU(e,t,n){let r=qH(n,t),i=KH(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&QH(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var bU={name:[[`
|
|
382
382
|
\f\r &/=>`.split(``),`
|
|
383
383
|
\f\r "&'/=>\``.split(``)],[`\0
|
|
@@ -460,55 +460,55 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
460
460
|
out.textContent = '$' + Number(amt.value).toLocaleString();
|
|
461
461
|
});
|
|
462
462
|
<\/script>
|
|
463
|
-
</div>`}],LJ=[{name:`--chart-1`,light:`oklch(0.62 0.19 259)`,dark:`oklch(0.72 0.14 259)`},{name:`--chart-2`,light:`oklch(0.58 0.14 145)`,dark:`oklch(0.73 0.13 145)`},{name:`--chart-3`,light:`oklch(0.62 0.15 70)`,dark:`oklch(0.77 0.14 70)`},{name:`--chart-4`,light:`oklch(0.55 0.18 290)`,dark:`oklch(0.72 0.16 290)`},{name:`--chart-5`,light:`oklch(0.58 0.21 25)`,dark:`oklch(0.72 0.2 25)`},{name:`--primary`,light:`oklch(0.6321 0.1983 259.59)`,dark:`#69a3ff`},{name:`--primary-foreground`,light:`oklch(0.985 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--background`,light:`oklch(1 0 0)`,dark:`oklch(0.145 0 0)`},{name:`--card`,light:`oklch(1 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--card-foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--muted-foreground`,light:`oklch(0.556 0 0)`,dark:`oklch(0.708 0 0)`},{name:`--border`,light:`oklch(0.922 0 0)`,dark:`oklch(1 0 0 / 10%)`},{name:`--destructive`,light:`oklch(0.577 0.245 27.325)`,dark:`oklch(0.704 0.191 22.216)`},{name:`--radius`,light:`0.625rem`,dark:`0.625rem`}],RJ=Object.freeze([{value:`workflow-fit`,label:`It didn't fit into my workflow`},{value:`missing-feature`,label:`It was missing a feature I needed`},{value:`hard-to-start`,label:`It was too hard to set up or get started`},{value:`unreliable`,label:`Bugs, crashes, or it felt unreliable`},{value:`switched-tool`,label:`I'm switching to another tool`},{value:`one-off`,label:`It was a trial or one-off project`},{value:`other`,label:`Something else`}]);new Set(RJ.map(e=>e.value));var zJ=xT.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`},sourceClosingFenceLength:{default:null,rendered:!1},sourceUnclosedFence:{default:!1,rendered:!1},sourceFenceIndent:{default:null,rendered:!1},sourceInfoPadding:{default:null,rendered:!1},sourceIndents:{default:null,rendered:!1}}}}),BJ=PT.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[Kw({find:kT,type:this.type,getAttributes:{sourceDelimiter:`*`}}),Kw({find:jT,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),VJ=OT.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[Kw({find:CT,type:this.type,getAttributes:{sourceDelimiter:`**`}}),Kw({find:TT,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),HJ=xw.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),UJ=mT.create({name:`footnoteDefinition`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){let e=e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}};return[{tag:`aside[data-footnote-def]`,getAttrs:e},{tag:`aside.footnote-def`,getAttrs:e}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.identifier??``);return[`aside`,{...t,"data-footnote-def":``,"data-footnote-id":n,id:`fn-${n}`,class:`footnote-def`},[`div`,{class:`footnote-body`},0],[`a`,{href:`#fnref-${n}`,class:`footnote-backref`,contentEditable:`false`,"aria-label":`Back to reference`},`↩`]]},addCommands(){return{insertFootnoteDefinition:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e},content:[{type:`paragraph`}]})}}});function WJ(e){let t=0;for(let n of e){let e=Number.parseInt(n,10);!Number.isNaN(e)&&e>t&&(t=e)}return String(t+1)}function GJ(e){let t=[];return e.descendants(e=>(e.type.name===`footnoteDefinition`&&t.push(String(e.attrs.identifier??``)),!0)),t}function KJ(e){let t=null;return e.forEach((e,n)=>{e.type.name===`footnoteDefinition`&&(t=n+e.nodeSize)}),t??e.content.size}var qJ=mT.create({name:`footnoteReference`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),JJ=/^---[ \t]*\r?\n([\s\S]*?\r?\n)?---[ \t]*(\r?\n|$)/,YJ=/^---[ \t]*$/;function XJ(e){let t=e.match(JJ);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}function ZJ(e,t){return e?e+t:t}function QJ(e){if(e===``)return``;let t=e.match(JJ);return t?(t[1]??``).replace(/\r?\n$/,``):e}var $J=IT.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`},sourceRaw:{default:null}}}}),eY=RT.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null},sourceContiguousNext:{default:!1},sourceLeadingIndent:{default:null,rendered:!1},sourceInteriorSpacing:{default:null,rendered:!1}}}}),tY=mT.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}});function nY(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}var rY=BT.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=aC(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=nY(t.src)),[`img`,t]}}),iY=mT.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),aY=mT.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,addAttributes(){return{}},parseHTML(){return[{tag:`span[data-jsx-inline]`}]},renderHTML(){return[`span`,{"data-jsx-inline":``},0]}}),oY=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],sY=oY.map(e=>`${e}:`).join(`|`),cY=RegExp(`^(?:${sY}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function lY(e){let t=e.trim();return t===``?!0:cY.test(t)}function uY(e){let t=e.trim();if(t===``)return!0;let n=t.indexOf(`:`);if(n===-1)return!0;let r=t.indexOf(`/`),i=t.indexOf(`?`),a=t.indexOf(`#`);return n>Math.min(r===-1?1/0:r,i===-1?1/0:i,a===-1?1/0:a)}var dY=new Set(oY.map(e=>`${e}:`)),fY=`https://placeholder.invalid`;function pY(e){try{let t=new URL(e,fY);return dY.has(t.protocol.toLowerCase())}catch{return!1}}var mY=nO.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:pY,validate:pY,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1}}}}),hY=mT.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`]}});function gY(e){return e.type.name===`list`&&!e.attrs.ordered}function _Y(e){return e.type.name===`list`&&!!e.attrs.ordered}function vY(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function yY(e,t,n,r,i,a,o){let s=YS(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?Jg(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o})}}),t(n),!0}return Gg(n,a)(e,void 0)?t?Gg(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}var bY=mT.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,aC(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:yY(e,t,n,r,e=>gY(e)&&!vY(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:yY(e,t,n,r,e=>_Y(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:yY(e,t,n,r,e=>gY(e)&&vY(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[Yw({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),Yw({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new pw({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=ah(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),xY=mT.create({name:`listItem`,content:`paragraph block*`,defining:!0,addAttributes(){return{checked:{default:null},spread:{default:!1},sourceMarkerSpacing:{default:null,rendered:!1},sourceOrdinal:{default:null,rendered:!1},sourceCheckboxChar:{default:null,rendered:!1},sourceContinuationIndent:{default:null,rendered:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,aC(t),0]:[`li`,aC(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(aC(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`),c=()=>{o&&(o.disabled=!n.isEditable)};return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,c(),n.on(`update`,c),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,o.disabled=!n.isEditable,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)},destroy(){n.off(`update`,c)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),SY=bY,CY=xY,wY=mT.create({name:`mathInline`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`},sourceDelimiter:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e==`string`?!1:{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),TY=mT.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),EY=Rk.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),DY=Hk.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),OY=mT.create({name:`commentBlock`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}},sourceLayout:{default:`block`,parseHTML:e=>e.getAttribute(`data-source-layout`)===`inline`?`inline`:`block`,renderHTML:e=>e.sourceLayout===`inline`?{"data-source-layout":`inline`}:{}}}},parseHTML(){return[{tag:`aside[data-comment-block]`},{tag:`aside.comment-block`}]},renderHTML({HTMLAttributes:e}){return[`aside`,{"data-comment-block":``,"data-clipboard-omit":`true`,class:`comment-block`,style:`display: none;`,...e},0]},addCommands(){return{setCommentBlock:()=>({commands:e})=>e.wrapIn(this.name),toggleCommentBlock:()=>({commands:e})=>e.toggleWrap(this.name),unsetCommentBlock:()=>({commands:e})=>e.lift(this.name)}}}),kY=xw.create({name:`comment`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}}}},parseHTML(){return[{tag:`span[data-comment-mark]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-comment-mark":``,"data-clipboard-omit":`true`,class:`comment-mark`,style:`display: none;`,...e},0]},addCommands(){return{setComment:()=>({commands:e})=>e.setMark(this.name),toggleComment:()=>({commands:e})=>e.toggleMark(this.name),unsetComment:()=>({commands:e})=>e.unsetMark(this.name)}}}),AY=Aw.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}}),jY=mT.create({name:`imageReference`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:t||n}]}});function MY(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return t;return null}function NY(e){let t=!1;return e.descendants(e=>t?!1:(e.type.name===`list`&&(t=!0),!t)),t}function PY(e){let{selection:t}=e;return t instanceof K?t.$cursor:null}function FY(e){let t=PY(e);if(!t||t.parentOffset!==0)return!1;let n=MY(t);if(n===null||t.depth!==n+1||t.index(n)!==0)return!1;let r=t.index(n-1);return r===0?!1:NY(t.node(n-1).child(r-1))}function IY(e,t){for(let n=t-1;n>=0;n--){let t=e.node(n),r=e.index(n);if(r<t.childCount-1){let e=t.child(r+1),i=n+1;for(;e.type.name===`list`&&e.firstChild;)e=e.firstChild,i+=1;return e.type.name===`listItem`?i:null}}return null}function LY(e){let t=PY(e);if(!t||t.parentOffset!==t.parent.content.size)return!1;let n=MY(t);if(n===null)return!1;for(let e=t.depth;e>n;e--)if(t.index(e-1)!==t.node(e-1).childCount-1)return!1;let r=IY(t,n);return r!==null&&r<n}var RY=Aw.create({name:`listBoundaryMerge`,addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(!FY(e.state))return!1;if(e.commands.undoInputRule())return!0;let{state:t,view:n}=e;return dg(t,n.dispatch,n)},t=()=>{let{editor:e}=this;if(!LY(e.state))return!1;let{state:t,view:n}=e;return fg(t,n.dispatch,n)};return{Backspace:e,"Mod-Backspace":e,Delete:t,"Mod-Delete":t}}}),zY=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function BY(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function VY(e){let t=BY(e);return t!==null&&zY.has(t)}function HY(e){let t=BY(e);return t===null?null:zY.get(t)??null}var UY=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function WY(e){UY.lastIndex=0;let t=e.match(UY);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=HY(e);if(t===null)return null;n+=t}return n}var GY=xw.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function KY(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r||qY(n)===r?!0:WY(e)===t}function qY(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}var JY=OA.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),YY=Fk.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),XY=bk.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),ZY=xk.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),QY=mT.create({name:`tag`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),$Y=/^(?:---|—-|___\s|\*\*\*\s)$/;function eX(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}var tX=Gk.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[qw({find:$Y,type:this.type,getAttributes:e=>({sourceRaw:eX(e)})})]}}),$ee=/^\[\[([^[\]|#]+?)(?:#([^\]|]+?))?(?:\|([^\]]+?))?\]\]/;function nX(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function rX(e){let t=e.match($ee);if(!t)return null;let n=t[1]?.trim()??``;return n?{type:`wikilink`,raw:t[0],target:n,anchor:nX(t[2]),alias:nX(t[3])}:null}function iX(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var aX=mT.create({name:`wikiLink`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:nX(e.getAttribute(`data-alias`)),anchor:nX(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:nX(e.getAttribute(`data-alias`)),anchor:nX(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=nX(e.attrs.alias),i=nX(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},iX({target:n,alias:r,anchor:i})]}});function oX(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function sX(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var cX=mT.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:nX(e.getAttribute(`data-alias`)),anchor:nX(e.getAttribute(`data-anchor`))};return[{tag:`img[data-wiki-embed]`,getAttrs:e,priority:100},{tag:`a[data-wiki-embed]`,getAttrs:e,priority:100}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=nX(e.attrs.alias),i=nX(e.attrs.anchor),a=nX(e.attrs.resolvedSrc),o=oX(n);if(Pd.has(o))return[`img`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,src:a??n,alt:r??n}];let s=a??n;return[`a`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,href:i?`${s}#${i}`:s,target:`_blank`,rel:`noopener noreferrer`},sX({target:n,alias:r,anchor:i})]}}),lX=[iY,TY,aY,wY,aX,cX,QY,SY,CY,BJ,VJ,JY,DY,zJ,EY,eY,tX,mY,tY,hY,$J,HJ,AY,GY,Sj.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,listKeymap:{listTypes:[{itemName:`listItem`,wrapperNames:[`list`]}]},italic:!1,bold:!1,strike:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),RY,YY.configure({resizable:!0}),Sk,ZY,XY,rY.configure({inline:!0}),jY,aO,kY,OY,qJ,UJ];function uX(e){let t=e.indexOf(`/`);return t===-1?e:e.slice(t+1)}function dX(e,t){let n=encodeURIComponent(t.projectDir);if(t.prompt===``)return`claude://${e.mode}/new?folder=${n}`;let r=encodeURIComponent(t.prompt);return`claude://${e.mode}/new?q=${r}&folder=${n}`}function fX(e){let t=encodeURIComponent(e.projectDir);return e.prompt===``?`codex://new?path=${t}`:`codex://new?prompt=${encodeURIComponent(e.prompt)}&path=${t}`}function pX(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t<0?e:e.substring(t+1)}function mX(e){let t=encodeURIComponent(pX(e.projectDir));return e.prompt===``?`cursor://anysphere.cursor-deeplink/prompt?workspace=${t}&mode=agent`:`cursor://anysphere.cursor-deeplink/prompt?text=${encodeURIComponent(encodeURIComponent(e.prompt))}&workspace=${t}&mode=agent`}function hX(e){return`'${e.replace(/'/g,`'\\''`)}'`}var gX=[`mcp__${PJ}`,`Bash(ok open:*)`],_X=[`delete`,`move`,`share_link`,`install`].map(e=>`mcp__${PJ}__${e}`),vX=`-c ${hX(`mcp_servers.${PJ}.default_tools_approval_mode="approve"`)}`;function yX(e){let t={};return e.mcpPreApprove===!0&&(t.enabledMcpjsonServers=[PJ]),e.autoApproveOkTools===!0&&(t.permissions={allow:[...gX],deny:[..._X]}),t.enabledMcpjsonServers===void 0&&t.permissions===void 0?``:`--settings ${hX(JSON.stringify(t))}`}var bX=`\x1B`,xX=`${bX}[200~`,SX=`${bX}[201~`,CX={claude:{bin:`claude`,displayName:`Claude`,docsUrl:`https://docs.claude.com/en/docs/claude-code`,handoffTarget:`claude-code`},codex:{bin:`codex`,displayName:`Codex`,docsUrl:`https://developers.openai.com/codex/cli`,handoffTarget:`codex`,autoApproveArg:vX},copilot:{bin:`copilot`,displayName:`GitHub Copilot`,docsUrl:`https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started`,handoffTarget:`copilot`,promptFlag:`--interactive`},cursor:{bin:`cursor-agent`,displayName:`Cursor`,docsUrl:`https://cursor.com/docs/cli/overview`,handoffTarget:`cursor`},opencode:{bin:`opencode`,displayName:`OpenCode`,docsUrl:`https://opencode.ai/docs`,handoffTarget:`opencode`,promptFlag:`--prompt`},pi:{bin:`pi`,displayName:`Pi`,docsUrl:`https://pi.dev`,handoffTarget:`pi`},antigravity:{bin:`agy`,displayName:`Antigravity`,docsUrl:`https://antigravity.google/docs/cli-getting-started`,handoffTarget:`antigravity`,promptFlag:`--prompt-interactive`},openclaw:{bin:`openclaw`,subcommand:`chat`,displayName:`OpenClaw`,docsUrl:`https://docs.openclaw.ai/cli/tui`,handoffTarget:`openclaw`,promptFlag:`--message`},hermes:{bin:`hermes`,subcommand:`chat`,displayName:`Hermes`,docsUrl:`https://hermes-agent.nousresearch.com/docs/user-guide/cli`,handoffTarget:`hermes`,startupInjection:{submit:`\r`,readyMarker:`\x1B[?2004h`,settleMs:300,capMs:4e3}}},wX=[`claude`,`codex`,`opencode`,`cursor`,`copilot`,`pi`,`antigravity`,`openclaw`,`hermes`];function TX(e,t,n={}){let r=CX[e],i=e===`claude`?yX(n):n.autoApproveOkTools===!0&&r.autoApproveArg?r.autoApproveArg:``,a=i?`${i} `:``,o=r.subcommand?`${r.subcommand} `:``;if(r.startupInjection!=null||t==null||t.length===0)return`${r.bin} ${o}${a}`.trimEnd();let s=r.promptFlag?`${r.promptFlag} `:``;return`${r.bin} ${o}${a}${s}${hX(t)}`}function EX(e){return CX[e].startupInjection}function DX(e,t){let n=EX(e);return n==null||t==null||t.length===0?null:`${xX}${t.replaceAll(bX,``)}${SX}${n.submit}`}var OX=RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff`]+",`g`),kX=RegExp("[ \\u00a0\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff`]+",`g`);function AX(e){return e.replace(OX,`_`)}function jX(e){return e.replace(kX,`_`)}var MX="This is an OpenKnowledge project: load the `open-knowledge` skill and use the OpenKnowledge MCP tools for all markdown — don't probe for `.ok/` or use native file tools on `.md` / `.mdx`.";function NX(e){return`${MX} ${e}`}var PX=`You're running in the terminal of the OpenKnowledge desktop app.`,FX=`You're an agent working inside OpenKnowledge, with its MCP tools available to you.`;function IX(e){return`${FX} ${MX} ${e===null?`Then stop.`:`Read \`${AX(e)}\` via the OpenKnowledge MCP server, then stop.`}`}function LX(e){return`${PX} ${MX} ${e===null?`Then stop.`:`Read \`${AX(e)}\` via the OpenKnowledge MCP server, then stop.`}`}function RX(e,t,n,r=`url`){let i=`Let's work on \`${AX(e)}\` using OpenKnowledge.`;return sZ(t?`${i} Open the OK editor in web view.`:i,n,r)}function zX(e,t,n){let r=`Use your open-knowledge-write-skill skill to author the ${t} Open Knowledge skill \`${AX(e)}\`. Edit it with the Open Knowledge tools.`;return n?`${r} Open the OK editor in web view.`:r}function BX(e,t,n,r=`url`){let i=`Let's work on the \`${AX(e)}\` folder using OpenKnowledge.`;return sZ(t?`${i} Open the OK editor in web view.`:i,n,r)}function VX(e,t,n=`url`){let r=`Let's work on this project using OpenKnowledge.`;return sZ(e?`${r} Open the OK editor in web view.`:r,t,n)}function HX(e,t,n,r,i=`url`){let a=t?`Open the OK editor in web view.`:``,o=e=>a===``?e:e.includes(`
|
|
463
|
+
</div>`}],LJ=[{name:`--chart-1`,light:`oklch(0.62 0.19 259)`,dark:`oklch(0.72 0.14 259)`},{name:`--chart-2`,light:`oklch(0.58 0.14 145)`,dark:`oklch(0.73 0.13 145)`},{name:`--chart-3`,light:`oklch(0.62 0.15 70)`,dark:`oklch(0.77 0.14 70)`},{name:`--chart-4`,light:`oklch(0.55 0.18 290)`,dark:`oklch(0.72 0.16 290)`},{name:`--chart-5`,light:`oklch(0.58 0.21 25)`,dark:`oklch(0.72 0.2 25)`},{name:`--primary`,light:`oklch(0.6321 0.1983 259.59)`,dark:`#69a3ff`},{name:`--primary-foreground`,light:`oklch(0.985 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--background`,light:`oklch(1 0 0)`,dark:`oklch(0.145 0 0)`},{name:`--card`,light:`oklch(1 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--card-foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--muted-foreground`,light:`oklch(0.556 0 0)`,dark:`oklch(0.708 0 0)`},{name:`--border`,light:`oklch(0.922 0 0)`,dark:`oklch(1 0 0 / 10%)`},{name:`--destructive`,light:`oklch(0.577 0.245 27.325)`,dark:`oklch(0.704 0.191 22.216)`},{name:`--radius`,light:`0.625rem`,dark:`0.625rem`}],RJ=Object.freeze([{value:`workflow-fit`,label:`It didn't fit into my workflow`},{value:`missing-feature`,label:`It was missing a feature I needed`},{value:`hard-to-start`,label:`It was too hard to set up or get started`},{value:`unreliable`,label:`Bugs, crashes, or it felt unreliable`},{value:`switched-tool`,label:`I'm switching to another tool`},{value:`one-off`,label:`It was a trial or one-off project`},{value:`other`,label:`Something else`}]),zJ=1e4;new Set(RJ.map(e=>e.value));var BJ=xT.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`},sourceClosingFenceLength:{default:null,rendered:!1},sourceUnclosedFence:{default:!1,rendered:!1},sourceFenceIndent:{default:null,rendered:!1},sourceInfoPadding:{default:null,rendered:!1},sourceIndents:{default:null,rendered:!1}}}}),VJ=PT.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[Kw({find:kT,type:this.type,getAttributes:{sourceDelimiter:`*`}}),Kw({find:jT,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),HJ=OT.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[Kw({find:CT,type:this.type,getAttributes:{sourceDelimiter:`**`}}),Kw({find:TT,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),UJ=xw.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),WJ=mT.create({name:`footnoteDefinition`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){let e=e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}};return[{tag:`aside[data-footnote-def]`,getAttrs:e},{tag:`aside.footnote-def`,getAttrs:e}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.identifier??``);return[`aside`,{...t,"data-footnote-def":``,"data-footnote-id":n,id:`fn-${n}`,class:`footnote-def`},[`div`,{class:`footnote-body`},0],[`a`,{href:`#fnref-${n}`,class:`footnote-backref`,contentEditable:`false`,"aria-label":`Back to reference`},`↩`]]},addCommands(){return{insertFootnoteDefinition:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e},content:[{type:`paragraph`}]})}}});function GJ(e){let t=0;for(let n of e){let e=Number.parseInt(n,10);!Number.isNaN(e)&&e>t&&(t=e)}return String(t+1)}function KJ(e){let t=[];return e.descendants(e=>(e.type.name===`footnoteDefinition`&&t.push(String(e.attrs.identifier??``)),!0)),t}function qJ(e){let t=null;return e.forEach((e,n)=>{e.type.name===`footnoteDefinition`&&(t=n+e.nodeSize)}),t??e.content.size}var JJ=mT.create({name:`footnoteReference`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),YJ=/^---[ \t]*\r?\n([\s\S]*?\r?\n)?---[ \t]*(\r?\n|$)/,XJ=/^---[ \t]*$/;function ZJ(e){let t=e.match(YJ);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}function QJ(e,t){return e?e+t:t}function $J(e){if(e===``)return``;let t=e.match(YJ);return t?(t[1]??``).replace(/\r?\n$/,``):e}var eY=IT.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`},sourceRaw:{default:null}}}}),tY=RT.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null},sourceContiguousNext:{default:!1},sourceLeadingIndent:{default:null,rendered:!1},sourceInteriorSpacing:{default:null,rendered:!1}}}}),nY=mT.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}});function rY(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}var iY=BT.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=aC(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=rY(t.src)),[`img`,t]}}),aY=mT.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),oY=mT.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,addAttributes(){return{}},parseHTML(){return[{tag:`span[data-jsx-inline]`}]},renderHTML(){return[`span`,{"data-jsx-inline":``},0]}}),sY=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],cY=sY.map(e=>`${e}:`).join(`|`),lY=RegExp(`^(?:${cY}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function uY(e){let t=e.trim();return t===``?!0:lY.test(t)}function dY(e){let t=e.trim();if(t===``)return!0;let n=t.indexOf(`:`);if(n===-1)return!0;let r=t.indexOf(`/`),i=t.indexOf(`?`),a=t.indexOf(`#`);return n>Math.min(r===-1?1/0:r,i===-1?1/0:i,a===-1?1/0:a)}var fY=new Set(sY.map(e=>`${e}:`)),pY=`https://placeholder.invalid`;function mY(e){try{let t=new URL(e,pY);return fY.has(t.protocol.toLowerCase())}catch{return!1}}var hY=nO.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:mY,validate:mY,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1}}}}),gY=mT.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`]}});function _Y(e){return e.type.name===`list`&&!e.attrs.ordered}function vY(e){return e.type.name===`list`&&!!e.attrs.ordered}function yY(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function bY(e,t,n,r,i,a,o){let s=YS(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?Jg(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o})}}),t(n),!0}return Gg(n,a)(e,void 0)?t?Gg(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}var xY=mT.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,aC(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:bY(e,t,n,r,e=>_Y(e)&&!yY(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:bY(e,t,n,r,e=>vY(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:bY(e,t,n,r,e=>_Y(e)&&yY(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[Yw({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),Yw({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new pw({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=ah(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),SY=mT.create({name:`listItem`,content:`paragraph block*`,defining:!0,addAttributes(){return{checked:{default:null},spread:{default:!1},sourceMarkerSpacing:{default:null,rendered:!1},sourceOrdinal:{default:null,rendered:!1},sourceCheckboxChar:{default:null,rendered:!1},sourceContinuationIndent:{default:null,rendered:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,aC(t),0]:[`li`,aC(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(aC(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`),c=()=>{o&&(o.disabled=!n.isEditable)};return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,c(),n.on(`update`,c),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,o.disabled=!n.isEditable,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)},destroy(){n.off(`update`,c)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),CY=xY,wY=SY,TY=mT.create({name:`mathInline`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`},sourceDelimiter:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e==`string`?!1:{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),EY=mT.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),DY=Rk.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),OY=Hk.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),kY=mT.create({name:`commentBlock`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}},sourceLayout:{default:`block`,parseHTML:e=>e.getAttribute(`data-source-layout`)===`inline`?`inline`:`block`,renderHTML:e=>e.sourceLayout===`inline`?{"data-source-layout":`inline`}:{}}}},parseHTML(){return[{tag:`aside[data-comment-block]`},{tag:`aside.comment-block`}]},renderHTML({HTMLAttributes:e}){return[`aside`,{"data-comment-block":``,"data-clipboard-omit":`true`,class:`comment-block`,style:`display: none;`,...e},0]},addCommands(){return{setCommentBlock:()=>({commands:e})=>e.wrapIn(this.name),toggleCommentBlock:()=>({commands:e})=>e.toggleWrap(this.name),unsetCommentBlock:()=>({commands:e})=>e.lift(this.name)}}}),AY=xw.create({name:`comment`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}}}},parseHTML(){return[{tag:`span[data-comment-mark]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-comment-mark":``,"data-clipboard-omit":`true`,class:`comment-mark`,style:`display: none;`,...e},0]},addCommands(){return{setComment:()=>({commands:e})=>e.setMark(this.name),toggleComment:()=>({commands:e})=>e.toggleMark(this.name),unsetComment:()=>({commands:e})=>e.unsetMark(this.name)}}}),jY=Aw.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}}),MY=mT.create({name:`imageReference`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:t||n}]}});function NY(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return t;return null}function PY(e){let t=!1;return e.descendants(e=>t?!1:(e.type.name===`list`&&(t=!0),!t)),t}function FY(e){let{selection:t}=e;return t instanceof K?t.$cursor:null}function IY(e){let t=FY(e);if(!t||t.parentOffset!==0)return!1;let n=NY(t);if(n===null||t.depth!==n+1||t.index(n)!==0)return!1;let r=t.index(n-1);return r===0?!1:PY(t.node(n-1).child(r-1))}function LY(e,t){for(let n=t-1;n>=0;n--){let t=e.node(n),r=e.index(n);if(r<t.childCount-1){let e=t.child(r+1),i=n+1;for(;e.type.name===`list`&&e.firstChild;)e=e.firstChild,i+=1;return e.type.name===`listItem`?i:null}}return null}function RY(e){let t=FY(e);if(!t||t.parentOffset!==t.parent.content.size)return!1;let n=NY(t);if(n===null)return!1;for(let e=t.depth;e>n;e--)if(t.index(e-1)!==t.node(e-1).childCount-1)return!1;let r=LY(t,n);return r!==null&&r<n}var zY=Aw.create({name:`listBoundaryMerge`,addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(!IY(e.state))return!1;if(e.commands.undoInputRule())return!0;let{state:t,view:n}=e;return dg(t,n.dispatch,n)},t=()=>{let{editor:e}=this;if(!RY(e.state))return!1;let{state:t,view:n}=e;return fg(t,n.dispatch,n)};return{Backspace:e,"Mod-Backspace":e,Delete:t,"Mod-Delete":t}}}),BY=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function VY(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function HY(e){let t=VY(e);return t!==null&&BY.has(t)}function UY(e){let t=VY(e);return t===null?null:BY.get(t)??null}var WY=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function GY(e){WY.lastIndex=0;let t=e.match(WY);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=UY(e);if(t===null)return null;n+=t}return n}var KY=xw.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function qY(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r||JY(n)===r?!0:GY(e)===t}function JY(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}var YY=OA.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),XY=Fk.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),ZY=bk.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),QY=xk.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),$Y=mT.create({name:`tag`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),eX=/^(?:---|—-|___\s|\*\*\*\s)$/;function tX(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}var nX=Gk.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[qw({find:eX,type:this.type,getAttributes:e=>({sourceRaw:tX(e)})})]}}),$ee=/^\[\[([^[\]|#]+?)(?:#([^\]|]+?))?(?:\|([^\]]+?))?\]\]/;function rX(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function iX(e){let t=e.match($ee);if(!t)return null;let n=t[1]?.trim()??``;return n?{type:`wikilink`,raw:t[0],target:n,anchor:rX(t[2]),alias:rX(t[3])}:null}function aX(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var oX=mT.create({name:`wikiLink`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:rX(e.getAttribute(`data-alias`)),anchor:rX(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:rX(e.getAttribute(`data-alias`)),anchor:rX(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=rX(e.attrs.alias),i=rX(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},aX({target:n,alias:r,anchor:i})]}});function sX(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function cX(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var lX=mT.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:rX(e.getAttribute(`data-alias`)),anchor:rX(e.getAttribute(`data-anchor`))};return[{tag:`img[data-wiki-embed]`,getAttrs:e,priority:100},{tag:`a[data-wiki-embed]`,getAttrs:e,priority:100}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=rX(e.attrs.alias),i=rX(e.attrs.anchor),a=rX(e.attrs.resolvedSrc),o=sX(n);if(Pd.has(o))return[`img`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,src:a??n,alt:r??n}];let s=a??n;return[`a`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,href:i?`${s}#${i}`:s,target:`_blank`,rel:`noopener noreferrer`},cX({target:n,alias:r,anchor:i})]}}),uX=[aY,EY,oY,TY,oX,lX,$Y,CY,wY,VJ,HJ,YY,OY,BJ,DY,tY,nX,hY,nY,gY,eY,UJ,jY,KY,Sj.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,listKeymap:{listTypes:[{itemName:`listItem`,wrapperNames:[`list`]}]},italic:!1,bold:!1,strike:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),zY,XY.configure({resizable:!0}),Sk,QY,ZY,iY.configure({inline:!0}),MY,aO,AY,kY,JJ,WJ];function dX(e){let t=e.indexOf(`/`);return t===-1?e:e.slice(t+1)}function fX(e,t){let n=encodeURIComponent(t.projectDir);if(t.prompt===``)return`claude://${e.mode}/new?folder=${n}`;let r=encodeURIComponent(t.prompt);return`claude://${e.mode}/new?q=${r}&folder=${n}`}function pX(e){let t=encodeURIComponent(e.projectDir);return e.prompt===``?`codex://new?path=${t}`:`codex://new?prompt=${encodeURIComponent(e.prompt)}&path=${t}`}function mX(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t<0?e:e.substring(t+1)}function hX(e){let t=encodeURIComponent(mX(e.projectDir));return e.prompt===``?`cursor://anysphere.cursor-deeplink/prompt?workspace=${t}&mode=agent`:`cursor://anysphere.cursor-deeplink/prompt?text=${encodeURIComponent(encodeURIComponent(e.prompt))}&workspace=${t}&mode=agent`}function gX(e){return`'${e.replace(/'/g,`'\\''`)}'`}var _X=[`mcp__${PJ}`,`Bash(ok open:*)`],vX=[`delete`,`move`,`share_link`,`install`].map(e=>`mcp__${PJ}__${e}`),yX=`-c ${gX(`mcp_servers.${PJ}.default_tools_approval_mode="approve"`)}`;function bX(e){let t={};return e.mcpPreApprove===!0&&(t.enabledMcpjsonServers=[PJ]),e.autoApproveOkTools===!0&&(t.permissions={allow:[..._X],deny:[...vX]}),t.enabledMcpjsonServers===void 0&&t.permissions===void 0?``:`--settings ${gX(JSON.stringify(t))}`}var xX=`\x1B`,SX=`${xX}[200~`,CX=`${xX}[201~`,wX={claude:{bin:`claude`,displayName:`Claude`,docsUrl:`https://docs.claude.com/en/docs/claude-code`,handoffTarget:`claude-code`},codex:{bin:`codex`,displayName:`Codex`,docsUrl:`https://developers.openai.com/codex/cli`,handoffTarget:`codex`,autoApproveArg:yX},copilot:{bin:`copilot`,displayName:`GitHub Copilot`,docsUrl:`https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started`,handoffTarget:`copilot`,promptFlag:`--interactive`},cursor:{bin:`cursor-agent`,displayName:`Cursor`,docsUrl:`https://cursor.com/docs/cli/overview`,handoffTarget:`cursor`},opencode:{bin:`opencode`,displayName:`OpenCode`,docsUrl:`https://opencode.ai/docs`,handoffTarget:`opencode`,promptFlag:`--prompt`},pi:{bin:`pi`,displayName:`Pi`,docsUrl:`https://pi.dev`,handoffTarget:`pi`},antigravity:{bin:`agy`,displayName:`Antigravity`,docsUrl:`https://antigravity.google/docs/cli-getting-started`,handoffTarget:`antigravity`,promptFlag:`--prompt-interactive`},openclaw:{bin:`openclaw`,subcommand:`chat`,displayName:`OpenClaw`,docsUrl:`https://docs.openclaw.ai/cli/tui`,handoffTarget:`openclaw`,promptFlag:`--message`},hermes:{bin:`hermes`,subcommand:`chat`,displayName:`Hermes`,docsUrl:`https://hermes-agent.nousresearch.com/docs/user-guide/cli`,handoffTarget:`hermes`,startupInjection:{submit:`\r`,readyMarker:`\x1B[?2004h`,settleMs:300,capMs:4e3}}},TX=[`claude`,`codex`,`opencode`,`cursor`,`copilot`,`pi`,`antigravity`,`openclaw`,`hermes`];function EX(e,t,n={}){let r=wX[e],i=e===`claude`?bX(n):n.autoApproveOkTools===!0&&r.autoApproveArg?r.autoApproveArg:``,a=i?`${i} `:``,o=r.subcommand?`${r.subcommand} `:``;if(r.startupInjection!=null||t==null||t.length===0)return`${r.bin} ${o}${a}`.trimEnd();let s=r.promptFlag?`${r.promptFlag} `:``;return`${r.bin} ${o}${a}${s}${gX(t)}`}function DX(e){return wX[e].startupInjection}function OX(e,t){let n=DX(e);return n==null||t==null||t.length===0?null:`${SX}${t.replaceAll(xX,``)}${CX}${n.submit}`}var kX=RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff`]+",`g`),AX=RegExp("[ \\u00a0\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2069\\ufeff`]+",`g`);function jX(e){return e.replace(kX,`_`)}function MX(e){return e.replace(AX,`_`)}var NX="This is an OpenKnowledge project: load the `open-knowledge` skill and use the OpenKnowledge MCP tools for all markdown — don't probe for `.ok/` or use native file tools on `.md` / `.mdx`.";function PX(e){return`${NX} ${e}`}var FX=`You're running in the terminal of the OpenKnowledge desktop app.`,IX=`You're an agent working inside OpenKnowledge, with its MCP tools available to you.`;function LX(e){return`${IX} ${NX} ${e===null?`Then stop.`:`Read \`${jX(e)}\` via the OpenKnowledge MCP server, then stop.`}`}function RX(e){return`${FX} ${NX} ${e===null?`Then stop.`:`Read \`${jX(e)}\` via the OpenKnowledge MCP server, then stop.`}`}function zX(e,t,n,r=`url`){let i=`Let's work on \`${jX(e)}\` using OpenKnowledge.`;return cZ(t?`${i} Open the OK editor in web view.`:i,n,r)}function BX(e,t,n){let r=`Use your open-knowledge-write-skill skill to author the ${t} Open Knowledge skill \`${jX(e)}\`. Edit it with the Open Knowledge tools.`;return n?`${r} Open the OK editor in web view.`:r}function VX(e,t,n,r=`url`){let i=`Let's work on the \`${jX(e)}\` folder using OpenKnowledge.`;return cZ(t?`${i} Open the OK editor in web view.`:i,n,r)}function HX(e,t,n=`url`){let r=`Let's work on this project using OpenKnowledge.`;return cZ(e?`${r} Open the OK editor in web view.`:r,t,n)}function UX(e,t,n,r,i=`url`){let a=t?`Open the OK editor in web view.`:``,o=e=>a===``?e:e.includes(`
|
|
464
464
|
`)?[e,``,a].join(`
|
|
465
465
|
`):`${e} ${a}`,s=e=>e.split(`
|
|
466
466
|
`).map(e=>`> ${e}`).join(`
|
|
467
|
-
`),c=
|
|
467
|
+
`),c=bZ(r),l=e=>{let t=e.trim();if(n===`existing-repo`){let e=t===``?`Let's work on this project using OpenKnowledge.`:[`Here's what I'd like to do in this OpenKnowledge project:`,``,s(t)].join(`
|
|
468
468
|
`);return o(c===``?e:[e,``,c].join(`
|
|
469
469
|
`))}let r=`Scaffold the folders, templates, and AI-readable rules to match, using OpenKnowledge.`;return o(t===``?c===``?`Let's set up a new OpenKnowledge project. ${r}`:[`Let's set up a new OpenKnowledge project. ${r}`,``,c].join(`
|
|
470
470
|
`):[`I'm setting up a new OpenKnowledge project. Here's what I want to create:`,``,s(t),...c===``?[]:[``,c],``,r].join(`
|
|
471
|
-
`))};return l(
|
|
472
|
-
`),r=n===-1?t:t.slice(0,n);return Array.from(r).slice(0,
|
|
471
|
+
`))};return l(oZ(l,e.trim(),`cursor`,i,GX))}var WX=3072,GX=WX-nZ(`${NX} `,`cursor`),KX=100*1024-1024,qX=new TextEncoder;function JX(e,t,n){return n===`terminal`?qX.encode(gX(e)).length:nZ(e,t)}function YX(e,t){return e===`terminal`?KX:t}var XX=160,ZX=3,QX=` …`;function $X(e){let t=0,n=0;for(let r of e)r==="`"?(n+=1,n>t&&(t=n)):n=0;return t}function eZ(e){return"`".repeat(Math.max($X(e)+1,ZX))}function tZ(e){let t=e.trimStart(),n=t.indexOf(`
|
|
472
|
+
`),r=n===-1?t:t.slice(0,n);return Array.from(r).slice(0,XX).join(``).trimEnd()}function nZ(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function rZ(e){return`Let's work on the selected passage in @${e} using OpenKnowledge.`}function iZ(e){let t=e.trim();return t===``?[]:[`Instruction:`,``,t.split(`
|
|
473
473
|
`).map(e=>`> ${e}`).join(`
|
|
474
|
-
`),``]}function
|
|
475
|
-
`).trimEnd()}function
|
|
476
|
-
`)}function
|
|
477
|
-
`)}function
|
|
474
|
+
`),``]}function aZ(e,t){let n=iZ(t);return n.length===0?e:[e,``,...n].join(`
|
|
475
|
+
`).trimEnd()}function oZ(e,t,n,r=`url`,i=WX){let a=YX(r,i),o=t=>JX(e(t),n,r)<=a;if(o(t))return t;let s=Array.from(t),c=0,l=s.length;for(;c<l;){let e=Math.ceil((c+l)/2);o(s.slice(0,e).join(``).trimEnd()+QX)?c=e:l=e-1}let u=s.slice(0,c).join(``).trimEnd();return u===``?``:u+QX}function sZ(e,t,n){return oZ(t=>aZ(e,t),t,`cursor`,n,GX)}function cZ(e,t,n){return aZ(e,sZ(e,t??``,n))}function lZ(e,t,n){let r=eZ(n);return[rZ(e),``,...iZ(t),`Here is the passage:`,``,r,n,r].join(`
|
|
476
|
+
`)}function uZ(e,t,n){let r=tZ(n),i=eZ(r);return[rZ(e),``,...iZ(t),`The passage begins:`,``,i,r,i,``,`Read the full passage from @${e} via the OpenKnowledge MCP server before editing.`].join(`
|
|
477
|
+
`)}function dZ(e,t,n,r=`url`){return oZ(n,e,t,r)}function fZ(e){let t=MX(e.relativePath),n=e.transport??`url`,r=lZ(t,e.instruction,e.selectionMarkdown);return JX(r,e.target,n)<=YX(n,WX)?r:uZ(t,dZ(e.instruction,e.target,n=>uZ(t,n,e.selectionMarkdown),n),e.selectionMarkdown)}function pZ(e,t,n){let r=`Let's work on @${e} using OpenKnowledge.`,i=n?`Open the OK editor in web view.`:``,a=t.trim();if(a===``)return i===``?r:`${r} ${i}`;let o=[r,``,a.split(`
|
|
478
478
|
`).map(e=>`> ${e}`).join(`
|
|
479
479
|
`)];return i!==``&&o.push(``,i),o.join(`
|
|
480
|
-
`)}function
|
|
480
|
+
`)}function mZ(e,t,n,r,i=`url`){let a=MX(e);return pZ(a,dZ(t,r,e=>pZ(a,e,n),i),n)}var hZ=`Open the OK editor in web view.`;function gZ(e){return e.split(`
|
|
481
481
|
`).map(e=>`> ${e}`).join(`
|
|
482
|
-
`)}function
|
|
483
|
-
`)}function
|
|
484
|
-
`)}function
|
|
485
|
-
`)}function
|
|
486
|
-
|
|
487
|
-
`)}function
|
|
488
|
-
`)}function
|
|
489
|
-
`)){let t=r.exec(e);t&&t[1].length>=i&&(i=t[1].length+1)}return i}var
|
|
482
|
+
`)}function _Z(e){let t=eZ(e);return[`Here is the passage:`,``,t,e,t].join(`
|
|
483
|
+
`)}function vZ(e,t){let n=tZ(e),r=eZ(n);return[`The passage begins:`,``,r,n,r,``,`Read the full passage from @${t} via the OpenKnowledge MCP server before editing.`].join(`
|
|
484
|
+
`)}function yZ(e,t,n){return`The selected passage is ${e===t?`line ${e}`:`lines ${e}-${t}`} of @${n}. Read it from @${n} via the OpenKnowledge MCP server before editing.`}function bZ(e){let t=e.map(e=>MX(e)).filter(e=>e!==``);return t.length===0?``:[`Also reference:`,``,...t.map(e=>`@${e}`)].join(`
|
|
485
|
+
`)}function xZ(e){return e.scope===`doc`?`Let's work on @${MX(e.docRelativePath)} using OpenKnowledge.`:e.scope===`folder`?`Let's work on the @${MX(e.folderRelativePath)} folder using OpenKnowledge.`:`Let's work on this project using OpenKnowledge.`}function SZ(e,t,n,r,i){let a=t.trim();if(!(a!==``||n!==``||r!==``))return i===``?e:`${e} ${i}`;let o=[e];return a!==``&&o.push(gZ(a)),n!==``&&o.push(n),r!==``&&o.push(r),i!==``&&o.push(i),o.join(`
|
|
486
|
+
|
|
487
|
+
`)}function CZ(e,t,n,r,i,a,o){if(e.kind===`lines`)return yZ(e.startLine,e.endLine,n);if(e.kind===`anchor`)return vZ(e.markdown,n);let s=_Z(e.markdown);return JX(SZ(t,``,s,r,i),a,o)<=YX(o,WX)?s:vZ(e.markdown,n)}function wZ(e,t,n,r){let{target:i}=e,a=e.transport??`url`,o=MX(e.docRelativePath),s=`Let's work on @${o} using OpenKnowledge.`,c=CZ(t,s,o,n,r,i,a);return SZ(s,dZ(e.instruction,i,e=>SZ(s,e,c,n,r),a),c,n,r)}function TZ(e){let{target:t}=e,n=e.autoOpen?hZ:``,r=bZ(e.mentions);if(e.scope===`doc`&&e.selection!==void 0)return wZ(e,e.selection,r,n);let i=xZ(e);return SZ(i,dZ(e.instruction,t,e=>SZ(i,e,``,r,n),e.transport??`url`),``,r,n)}function EZ(e){let t=MX(e.relativePath),n=e.ruleAlias===void 0?`${e.source}/${e.code}`:`${e.source}/${e.code} (${e.ruleAlias})`,r=[`Fix this lint problem in @${t} using OpenKnowledge.`,``,`Problem: ${n} at line ${e.line}, column ${e.column}:`,``,gZ(e.message.trim())],i=e.lineText??``;if(i.trim()!==``){let t=eZ(i);r.push(``,`Line ${e.line} reads:`,``,t,i,t)}return r.push(``,`Edit @${t} via the OpenKnowledge MCP server, then re-lint it to confirm the problem is resolved.`),r.join(`
|
|
488
|
+
`)}function DZ(e){if(e.length===0)return{ok:!1,reason:`docName must not be empty`};if(e.trim().length===0)return{ok:!1,reason:`docName must not be blank (whitespace only)`};if(e!==e.trim())return{ok:!1,reason:`docName must not have leading or trailing whitespace`};for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return{ok:!1,reason:`docName must not contain control characters`}}if(e.includes(`..`)||e.startsWith(`/`)||e.includes(`\\`))return{ok:!1,reason:`docName must not contain "..", a leading "/", or a backslash`};for(let t of e.split(`/`)){if(t.length===0)return{ok:!1,reason:`docName must not contain empty path segments (no leading, trailing, or doubled "/")`};if(t.startsWith(`.`))return{ok:!1,reason:`docName path segments must not start with "." (hidden files are not addressable)`}}return{ok:!0}}var OZ=new Set([`opencode.json`]);function kZ(e){return e.split(`/`).some(e=>e.startsWith(`.`))?!0:OZ.has(e.slice(e.lastIndexOf(`/`)+1))}function AZ(e,t){let n=DZ(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}var jZ=I().superRefine(AZ).optional(),MZ=I().superRefine(AZ),NZ={agentId:I().optional(),agentName:I().optional(),colorSeed:I().optional(),clientName:I().optional(),clientVersion:I().optional(),label:I().optional()},PZ=I().optional(),FZ=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;Au(`kind`,[B({kind:H(`doc`),docPath:I().min(1)}).loose(),B({kind:H(`folder`),folderPath:I()}).loose()]);var IZ=V([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`]),LZ=V([`current`,`stale`,`absent`]),RZ=Au(`ok`,[B({ok:H(!0),shareUrl:I().min(1),sharedUrl:I().min(1),branch:I().min(1),freshness:LZ.optional().catch(void 0)}).loose(),B({ok:H(!1),error:IZ,branch:I().min(1).optional()}).loose()]),zZ=V([`user`,`org`]),BZ=B({login:I().min(1),kind:zZ,avatarUrl:I().optional()}).loose(),VZ=V([`auth-required`,`network`]),HZ=Au(`ok`,[B({ok:H(!0),owners:z(BZ)}).loose(),B({ok:H(!1),error:VZ}).loose()]),UZ=Au(`ok`,[B({ok:H(!0),available:R()}).loose(),B({ok:H(!1),error:VZ}).loose()]),WZ=V([`public`,`private`]);B({owner:I().min(1),name:I().min(1),visibility:WZ,description:I().optional()}).loose();var GZ=V([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),KZ=Au(`ok`,[B({ok:H(!0),ownerLogin:I().min(1),repoName:I().min(1),cloneUrl:I().min(1),defaultBranch:I().min(1)}).loose(),B({ok:H(!1),error:GZ}).loose()]);function qZ(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}var JZ=e=>e.refine(qZ,`invalid branch name`),YZ={shareTargetExists:R(),dirtyConflicts:B({conflicts:R(),files:z(I().min(1))}).loose(),branchIsLocal:R(),shareTargetOnOriginBranch:R().optional()};Au(`detached`,[B({detached:H(!1),currentBranch:I().min(1).nullable(),currentHeadSha:yu(),...YZ}).loose(),B({detached:H(!0),currentBranch:yu(),currentHeadSha:I().min(1),...YZ}).loose()]),B({branch:JZ(I().min(1)),principalId:I().optional(),fastForward:R().optional()}).loose();var XZ=V([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]);Au(`ok`,[B({ok:H(!0)}).loose(),B({ok:H(!1),reason:XZ,files:z(I().min(1)).optional(),otherWorktreePath:I().min(1).optional()}).loose()]),V([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]),B({branch:JZ(I().min(1)),path:I(),kind:V([`doc`,`folder`])}).loose(),Au(`verdict`,[B({verdict:H(`on-origin`)}).loose(),B({verdict:H(`renamed`),renamedTo:I().min(1)}).loose(),B({verdict:H(`deleted`)}).loose(),B({verdict:H(`never-on-branch`)}).loose(),B({verdict:H(`changed-locally`)}).loose(),B({verdict:H(`unknown`)}).loose()]).catch({verdict:`unknown`});var ZZ=B({startedAt:I().min(1),httpListenMs:L().nonnegative().optional(),seedWalkMs:L().nonnegative().optional(),indexesMs:L().nonnegative().optional(),readyMs:L().nonnegative().optional(),fileCount:L().nonnegative().optional()}),QZ=B({serverInstanceId:I().min(1),currentBranch:I().min(1).optional(),currentDiskAckSVs:Pu(I().min(1),I().min(1)).optional(),boot:ZZ.optional()}).loose(),$Z=B({id:I().min(1),display_name:I().min(1),display_email:I(),source:V([`git-config`,`synthesized`]),created_at:I().min(1)}).loose();B({collabUrl:I().nullable(),previewUrl:I().nullable(),port:L(),singleFile:R().default(!1)}).loose();var eQ=V(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:no-conflict-tracked.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed.urn:ok:error:registry-unreachable.urn:ok:error:config-not-writable`.split(`.`)),tQ=B({type:eQ,title:I().min(1),status:L().int().min(400).max(599),instance:I().regex(FZ,`instance must be urn:uuid:<uuid>`).optional(),detail:I().optional()}).loose();B({parentDocName:I().min(1),placement:V([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:I().min(1).optional(),agentName:I().min(1).optional()}).loose();var nQ=B({src:I().min(1),path:I().min(1).optional(),deduped:R().optional()}).loose();B({url:I().min(1),dir:I().min(1),branch:I().min(1).refine(qZ,`invalid branch name`).optional()}).loose(),B({type:H(`error`),problem:tQ}).loose();function rQ(e){return e.includes("`")?`~`:"`"}function iQ(e,t,n=3){let r=RegExp(`^ {0,3}(\\${e}+)[ \\t]*$`),i=Math.max(3,n);for(let e of t.split(`
|
|
489
|
+
`)){let t=r.exec(e);t&&t[1].length>=i&&(i=t[1].length+1)}return i}var aQ=/notionvc:/i,oQ=()=>e=>{sQ(e)&&(cQ(e),lQ(e))};function sQ(e){if(!(`children`in e)||!Array.isArray(e.children))return!1;for(let t of e.children){if(t.type===`comment`){let e=String(t.value??``);if(aQ.test(e))return!0}if(t.type===`element`&&sQ(t))return!0}return!1}function cQ(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&cQ(t);let t=[];for(let n of e.children){if(n.type!==`text`){t.push(n);continue}let e=String(n.value??``);if(!e.includes(`
|
|
490
490
|
`)){t.push(n);continue}let r=e.split(`
|
|
491
|
-
`);for(let e=0;e<r.length;e++)r[e]&&t.push({type:`text`,value:r[e]??``}),e<r.length-1&&t.push({type:`element`,tagName:`br`,properties:{},children:[]})}e.children=t}function
|
|
492
|
-
`)}]}]}}function
|
|
493
|
-
`)&&(e.value=e.value.replace(/[ \t]*\n[ \t]*/g,` `)),e.type===`html`&&e.value.includes(`|`)&&(e.value=e.value.replace(/\|/g,`\\|`)))
|
|
494
|
-
`).forEach((e,t)=>{t>0&&r(),e.length>0&&i({type:`text`,value:e})})},o=e=>{let t=e.ordered===!0,n=typeof e.start==`number`?e.start:1,a=e.data,o=typeof a?.bulletMarker==`string`?a.bulletMarker:`-`,c=typeof a?.listMarkerDelimiter==`string`?a.listMarkerDelimiter:`.`;e.children.forEach((e,a)=>{a>0&&r(),i({type:`text`,value:t?`${n+a}${c} `:`${o} `}),e.children.forEach((e,t)=>{t>0&&r(),s(e)})})},s=e=>{switch(e.type){case`paragraph`:case`heading`:e.children.forEach(i);return;case`list`:o(e);return;case`code`:case`html`:a(e.value);return;case`thematicBreak`:i({type:`text`,value:e.data?.sourceRaw??`---`});return;default:{let t=e;if(Array.isArray(t.children)&&t.children.length>0){t.children.forEach((e,t)=>{t>0&&r(),s(e)});return}let n=e;if(typeof n.value==`string`){a(n.value);return}console.warn(JSON.stringify({event:`table-cell-flatten-dropped-block`,nodeType:e.type}))}}};return e.forEach((e,t)=>{t>0&&r(),s(e)}),t}var n$=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},r$=[gQ,IQ,uQ,TQ,aQ,GQ,AQ,VQ,xQ];function i$(e){D(e,e=>{e.type===`strong`?(e.data??={},e.data.sourceDelimiter=`**`):e.type===`emphasis`?(e.data??={},e.data.sourceDelimiter=`*`):e.type===`inlineCode`?(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=1):e.type===`code`&&(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=3)})}function a$(e){D(e,`list`,e=>{for(let t of e.children){let e=t.children.filter(e=>e.type!==`list`).length;t.spread=t.spread===!0&&e>1}e.spread=e.children.some(e=>e.spread===!0)})}function o$(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new n$(e.length,n);let r=k().use(Fj,{fragment:!0});for(let e of r$)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(QN);let i=r.parse(e),a=r.runSync(i);return a$(a),i$(a),a}function s$(e){return e$(e),String(k().use(le).use(TP,{bullet:`-`,rule:`-`,fences:!0}).stringify(e))}function c$(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r++)e[n]===t[r]&&n++;return n===e.length}var l$=new Set([`sourceRaw`,`sourceDirty`,`position`]),u$=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),d$={type:`__br__`},f$=/^<br\s*\/?>$/i;function p$(e){let t=v$(e,p$);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:m$(t.content)}:t}function m$(e){let t=[];for(let n of e){let e=h$(n);e.length!==0&&(t.length>0&&t.push(d$),t.push(...e))}return t}function h$(e){return e.text!==void 0||e.type===`hardBreak`||e.type===`jsxInline`?[e]:!e.content||e.content.length===0?[]:e.content.some(e=>e.text===void 0&&e.type!==`hardBreak`&&e.type!==`jsxInline`&&!!e.content)?m$(e.content):e.content}function g$(e){return e.type===`hardBreak`||e.type===d$.type||e.text!==void 0&&f$.test(e.text.trim())?d$:v$(e,g$)}var _$=[{label:`table-cell-block-flatten`,severity:`pm-model-caused`,rationale:`GFM table cells have no block spelling; a block placed in a cell is flattened to inline on serialize, so a cell-with-blocks and a cell-with-inline describe the same persisted document.`,proofPointer:`markdown/table-cell-flatten.ts flattenCellBlocks (table-cell-flatten-dropped-block event)`,canonicalize:p$},{label:`void-hardbreak-br`,severity:`serializer-caused`,rationale:`A void hardBreak inside a table cell or heading serializes to a literal <br /> that a fresh parse keeps as text; the node form and the literal form are the same break.`,proofPointer:`markdown/void-br-promoter.ts + markdown/to-markdown-handlers.ts break handler`,canonicalize:g$}];function v$(e,t){return e.content?{...e,content:e.content.map(t)}:e}function y$(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=b$(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:b$(e.attrs,t)})).sort((e,t)=>S$(e).localeCompare(S$(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>y$(e,t))),n}function b$(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if(l$.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?x$(i,t):i)}return Object.keys(n).length>0?n:null}function x$(e,t){if(Array.isArray(e))return e.map(e=>x$(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=x$(i,t));return n}return e}function S$(e){return JSON.stringify(e,(e,t)=>{if(t&&typeof t==`object`&&!Array.isArray(t)){let e={};for(let n of Object.keys(t).sort())e[n]=t[n];return e}return t})}function C$(e){let t=``,n=e=>{if(e.text!==void 0&&(t+=e.text),e.content)for(let t of e.content)n(t)};return n(e),t.replace(/\s+/g,``)}function w$(e){let t=[],n=e=>{if(e.type&&u$.has(e.type)){let n=e.type===`jsxComponent`?String(e.attrs?.componentName??``):``;t.push(n?`${e.type}:${n}`:e.type)}if(e.content)for(let t of e.content)n(t)};return n(e),t.sort()}function T$(e){let t=e,n=[];for(let e of _$){let r=S$(t),i=e.canonicalize(t);S$(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function E$(e,t,n={}){let r=T$(e),i=T$(t),a=[...new Set([...r.fired,...i.fired])];if(!c$(C$(r.normalized),C$(i.normalized)))return{equivalent:!1,level:`L1`,reason:`content-loss`,appliedDegrades:a,detail:`authored text did not survive the round-trip`};let o=w$(r.normalized),s=w$(i.normalized);if(S$(o)!==S$(s))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${o.join(`, `)}] vs [${s.join(`, `)}]`};let c=y$(r.normalized,n.ignoreAttrs),l=y$(i.normalized,n.ignoreAttrs);return S$(c)===S$(l)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:D$(c,l)}}function D$(e,t,n=`doc`){let r=e,i=t;if(!r||!i)return`${n}: node presence differs`;if(r.type!==i.type)return`${n}: type ${String(r.type)} vs ${String(i.type)}`;let a=r.content??[],o=i.content??[];if(a.length!==o.length)return`${n}(${String(r.type)}): child count ${a.length} vs ${o.length}`;for(let e=0;e<a.length;e++)if(S$(a[e])!==S$(o[e]))return D$(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function O$(e,t,n){return!E$(e,t,{ignoreAttrs:n}).equivalent}var k$=new Set([`src`,`href`,`size`]),A$=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function j$(e){if(Array.isArray(e))return e.map(e=>j$(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))k$.has(n)||(t[n]=j$(r));return t}return e}function M$(e){return e.type===`jsxComponent`&&typeof e.attrs?.componentName==`string`&&A$.has(e.attrs.componentName)?j$(e):e.content?{...e,content:e.content.map(M$)}:e}function N$(e){if(Array.isArray(e))return e.map(e=>N$(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=N$(r));return t}return e}function P$(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=P$(t);if(e)return e}}function F$(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=P$(e.parse(r)),o=a?M$(N$(a)):null;if(n.size>=t){let e=n.keys().next().value;e!==void 0&&n.delete(e)}return n.set(r,o),o};return{isDiverged(e){if(e.type!==`jsxComponent`||!e.attrs||e.attrs.kind===`expression`)return!1;let t=e.attrs.sourceRaw;if(typeof t!=`string`||t.length===0)return!1;let n=r(t);return n?O$(n,M$(N$(e))):!1}}}function I$(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&L$(e.value.value,t))continue}let o=R$(e,t);r>=0?n[r]=o:n.push(o)}return n}function L$(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function R$(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function z$(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:I$(t,r),children:n.all(t),data:{}}}var B$=/^[A-Za-z0-9]{20,}$/,V$=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function H$(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function U$(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return B$.test(n)?n:null}function W$(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!H$(t.hostname))return null;let n=U$(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&V$.test(r)?r:null}}function G$(e){return W$(e)!==null}function K$(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function q$(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:K$(t.hostname)}var J$=/^[A-Za-z0-9_-]{11}$/;function Y$(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function X$(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function Z$(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return J$.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return J$.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function Q$(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!Y$(t.hostname))return null;let n=Z$(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?X$(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}var $$=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],e1=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:Ad,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],t1=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],n1=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:jd,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(q$(e.src)||G$(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:Ad,hideWhen:e=>typeof e.src==`string`&&(q$(e.src)||G$(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&G$(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(q$(e.src)||G$(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(Q$(e.src)!==null||q$(e.src)||G$(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],r1=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:Md,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],i1=[{name:`title`,type:`string`,required:!0,description:`Accordion heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the accordion renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],a1=[$$[0],$$[1],$$[4],$$[5],$$[6]],o1=[e1[0],e1[1],e1[7]],s1=[i1[0],i1[1],i1[4],i1[5]],c1=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],l1=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],u1=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],d1=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],f1=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],p1=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],m1=[p1[0]],h1=[p1[0]],g1=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],_1=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],v1=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],y1=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:Nd,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],b1=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],x1=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function S1(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function C1(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function w1(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}var T1=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:$$,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>z$(`Callout`,e,t,$$)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:e1,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>z$(`img`,e,t,e1)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:n1,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>z$(`video`,e,t,n1)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:r1,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>z$(`audio`,e,t,r1)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:y1,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>z$(`Pdf`,e,t,y1)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:v1,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>z$(`File`,e,t,v1)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:t1,icon:`AppWindow`,category:`media`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>z$(`Embed`,e,t,t1)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:i1,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`toggle`,`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>z$(`Accordion`,e,t,i1)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:d1,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
|
|
495
|
-
<Tab label="Two">Body of the second tab panel.</Tab>`,serialize:(e,t)=>
|
|
496
|
-
`)}\n\n`:``}var
|
|
491
|
+
`);for(let e=0;e<r.length;e++)r[e]&&t.push({type:`text`,value:r[e]??``}),e<r.length-1&&t.push({type:`element`,tagName:`br`,properties:{},children:[]})}e.children=t}function lQ(e){if(!(!(`children`in e)||!Array.isArray(e.children))){e.children=e.children.filter(e=>e.type===`comment`?!aQ.test(String(e.value??``)):!0);for(let t of e.children)t.type===`element`&&lQ(t)}}var uQ=new Set([`Apple-tab-span`,`Apple-converted-space`,`Apple-style-span`]),dQ=()=>e=>{fQ(e)};function fQ(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&fQ(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return pQ(t)?[]:mQ(t)?t.children:[t]})}}function pQ(e){if(e.tagName!==`meta`)return!1;let t=e.properties?.name,n=e.properties?.content;return t===`Generator`&&typeof n==`string`&&/Cocoa/i.test(n)}function mQ(e){if(e.tagName!==`span`)return!1;let t=e.properties?.className;return Array.isArray(t)?t.length>0&&t.every(e=>uQ.has(String(e))):!1}var hQ=`docs-internal-guid-`;function gQ(e,t){let n=e.children[t];!n||n.type!==`element`||e.children.splice(t,1,...n.children)}var _Q=()=>e=>{vQ(e)};function vQ(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&vQ(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(!n||n.type!==`element`){t++;continue}let r=n;if(yQ(r)||bQ(r)){gQ(e,t);continue}t++}}function yQ(e){if(e.tagName!==`b`)return!1;let t=e.properties?.id;return typeof t==`string`&&t.startsWith(hQ)}function bQ(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.children.filter(e=>e.type===`element`);return t.length===1?t[0]?.tagName===`table`:!1}var xQ=new Set([`commit-link`,`user-mention`,`team-mention`,`issue-link`]),SQ=()=>e=>{CQ(e)};function CQ(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&CQ(t);for(let t of e.children)t.type===`element`&&wQ(t)}}function wQ(e){if(!e.properties)return;for(let t of Object.keys(e.properties))t.startsWith(`dataHovercard`)&&delete e.properties[t];let t=e.properties.className;if(Array.isArray(t)){let n=t.filter(e=>!xQ.has(String(e)));n.length===0?delete e.properties.className:e.properties.className=n}}var TQ=/^gmail_/,EQ=()=>e=>{DQ(e)};function DQ(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&DQ(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(n.type!==`element`){t++;continue}let r=n;if(r.tagName===`div`&&OQ(r,`gmail_quote`)&&(r.tagName=`blockquote`),kQ(r),AQ(r)){e.children.splice(t,1,...r.children);continue}t++}}function OQ(e,t){let n=e.properties?.className;return Array.isArray(n)?n.some(e=>String(e)===t):!1}function kQ(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!TQ.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}function AQ(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.properties?.className;return t!=null&&!(Array.isArray(t)&&t.length===0)?!1:e.children.filter(e=>e.type===`element`).length<=1}var jQ=()=>e=>{MQ(e)};function MQ(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&MQ(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return t.tagName===`google-sheets-html-origin`?t.children:t.tagName===`style`?[]:(NQ(t),[t])})}}function NQ(e){if(e.properties)for(let t of Object.keys(e.properties))t.startsWith(`dataSheets`)&&delete e.properties[t]}var PQ=[`o:`,`w:`,`m:`,`v:`,`u1:`],FQ=/^Mso[A-Z]/,IQ=/^\s*\[if\s+[^\]]*\]/,LQ=()=>e=>{RQ(e)};function RQ(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&RQ(t);e.children=e.children.flatMap(e=>{if(e.type===`comment`){let t=String(e.value??``);return IQ.test(t)?[]:[e]}if(e.type!==`element`)return[e];let t=e;return zQ(t)?[]:(BQ(t),[t])})}}function zQ(e){return PQ.some(t=>e.tagName.startsWith(t))}function BQ(e){let t=e.properties;if(!t)return;let n=t.className;if(Array.isArray(n)){let e=n.filter(e=>typeof e==`string`&&!FQ.test(e));e.length===0?delete t.className:t.className=e}else typeof n==`string`&&FQ.test(n)&&delete t.className;let r=t.style;typeof r==`string`&&/mso-/i.test(r)&&delete t.style;for(let e of Object.keys(t))if(e.startsWith(`xmlns:`)){let n=e.slice(6);PQ.some(e=>e===`${n}:`)&&delete t[e]}}var VQ=/^c-(message_kit__|message__|compose|timestamp)/,HQ=()=>e=>{UQ(e)};function UQ(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&UQ(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return WQ(t)?[]:(GQ(t),[t])})}}function WQ(e){let t=e.properties?.className;return Array.isArray(t)?t.some(e=>String(e)===`c-timestamp`||String(e).startsWith(`c-timestamp`)):!1}function GQ(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!VQ.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}var KQ=()=>e=>{qQ(e)};function qQ(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&qQ(t);for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`element`)continue;let r=n;JQ(r)&&(e.children[t]=XQ(r))}}}function JQ(e){if(e.tagName!==`div`)return!1;let t=e.children.filter(e=>e.type===`element`&&e.tagName===`div`);return t.length<2?!1:t.some(e=>YQ(e))}function YQ(e){for(let t of e.children){if(t.type!==`element`)continue;let e=t,n=e.properties?.style;if(typeof n==`string`&&/color\s*:/i.test(n)||YQ(e))return!0}return!1}function XQ(e){return{type:`element`,tagName:`pre`,properties:{},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:e.children.filter(e=>e.type===`element`&&e.tagName===`div`).map(e=>ZQ(e)).join(`
|
|
492
|
+
`)}]}]}}function ZQ(e){let t=``;for(let n of e.children)n.type===`text`?t+=n.value??``:n.type===`element`&&(t+=ZQ(n));return t}var QQ=new Set([`break`,`delete`,`emphasis`,`footnoteReference`,`html`,`image`,`imageReference`,`inlineCode`,`link`,`linkReference`,`strong`,`text`]);function $Q(e){let t=e.children;Array.isArray(t)&&t.forEach((e,n)=>{if(e.type===`break`){t[n]={type:`html`,value:`<br />`};return}$Q(e)})}function e$(e){let t=e.children;if(Array.isArray(t))for(let e of t)(e.type===`inlineCode`||e.type===`html`)&&(e.value.includes(`
|
|
493
|
+
`)&&(e.value=e.value.replace(/[ \t]*\n[ \t]*/g,` `)),e.type===`html`&&e.value.includes(`|`)&&(e.value=e.value.replace(/\|/g,`\\|`))),e$(e)}function t$(e){D(e,`tableCell`,e=>{e.children.some(e=>!QQ.has(e.type))&&(e.children=n$(e.children)),$Q(e),e$(e)})}function n$(e){let t=[],n=0,r=()=>{t.length>0&&(n+=1)},i=e=>{for(;n>0;)t.push({type:`break`}),--n;t.push(e)},a=e=>{e.split(`
|
|
494
|
+
`).forEach((e,t)=>{t>0&&r(),e.length>0&&i({type:`text`,value:e})})},o=e=>{let t=e.ordered===!0,n=typeof e.start==`number`?e.start:1,a=e.data,o=typeof a?.bulletMarker==`string`?a.bulletMarker:`-`,c=typeof a?.listMarkerDelimiter==`string`?a.listMarkerDelimiter:`.`;e.children.forEach((e,a)=>{a>0&&r(),i({type:`text`,value:t?`${n+a}${c} `:`${o} `}),e.children.forEach((e,t)=>{t>0&&r(),s(e)})})},s=e=>{switch(e.type){case`paragraph`:case`heading`:e.children.forEach(i);return;case`list`:o(e);return;case`code`:case`html`:a(e.value);return;case`thematicBreak`:i({type:`text`,value:e.data?.sourceRaw??`---`});return;default:{let t=e;if(Array.isArray(t.children)&&t.children.length>0){t.children.forEach((e,t)=>{t>0&&r(),s(e)});return}let n=e;if(typeof n.value==`string`){a(n.value);return}console.warn(JSON.stringify({event:`table-cell-flatten-dropped-block`,nodeType:e.type}))}}};return e.forEach((e,t)=>{t>0&&r(),s(e)}),t}var r$=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},i$=[_Q,LQ,dQ,EQ,oQ,KQ,jQ,HQ,SQ];function a$(e){D(e,e=>{e.type===`strong`?(e.data??={},e.data.sourceDelimiter=`**`):e.type===`emphasis`?(e.data??={},e.data.sourceDelimiter=`*`):e.type===`inlineCode`?(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=1):e.type===`code`&&(e.data??={},e.data.sourceFenceChar="`",e.data.sourceFenceLength=3)})}function o$(e){D(e,`list`,e=>{for(let t of e.children){let e=t.children.filter(e=>e.type!==`list`).length;t.spread=t.spread===!0&&e>1}e.spread=e.children.some(e=>e.spread===!0)})}function s$(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new r$(e.length,n);let r=k().use(Fj,{fragment:!0});for(let e of i$)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(QN);let i=r.parse(e),a=r.runSync(i);return o$(a),a$(a),a}function c$(e){return t$(e),String(k().use(le).use(TP,{bullet:`-`,rule:`-`,fences:!0}).stringify(e))}function l$(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r++)e[n]===t[r]&&n++;return n===e.length}var u$=new Set([`sourceRaw`,`sourceDirty`,`position`]),d$=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),f$={type:`__br__`},p$=/^<br\s*\/?>$/i;function m$(e){let t=y$(e,m$);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:h$(t.content)}:t}function h$(e){let t=[];for(let n of e){let e=g$(n);e.length!==0&&(t.length>0&&t.push(f$),t.push(...e))}return t}function g$(e){return e.text!==void 0||e.type===`hardBreak`||e.type===`jsxInline`?[e]:!e.content||e.content.length===0?[]:e.content.some(e=>e.text===void 0&&e.type!==`hardBreak`&&e.type!==`jsxInline`&&!!e.content)?h$(e.content):e.content}function _$(e){return e.type===`hardBreak`||e.type===f$.type||e.text!==void 0&&p$.test(e.text.trim())?f$:y$(e,_$)}var v$=[{label:`table-cell-block-flatten`,severity:`pm-model-caused`,rationale:`GFM table cells have no block spelling; a block placed in a cell is flattened to inline on serialize, so a cell-with-blocks and a cell-with-inline describe the same persisted document.`,proofPointer:`markdown/table-cell-flatten.ts flattenCellBlocks (table-cell-flatten-dropped-block event)`,canonicalize:m$},{label:`void-hardbreak-br`,severity:`serializer-caused`,rationale:`A void hardBreak inside a table cell or heading serializes to a literal <br /> that a fresh parse keeps as text; the node form and the literal form are the same break.`,proofPointer:`markdown/void-br-promoter.ts + markdown/to-markdown-handlers.ts break handler`,canonicalize:_$}];function y$(e,t){return e.content?{...e,content:e.content.map(t)}:e}function b$(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=x$(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:x$(e.attrs,t)})).sort((e,t)=>C$(e).localeCompare(C$(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>b$(e,t))),n}function x$(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if(u$.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?S$(i,t):i)}return Object.keys(n).length>0?n:null}function S$(e,t){if(Array.isArray(e))return e.map(e=>S$(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=S$(i,t));return n}return e}function C$(e){return JSON.stringify(e,(e,t)=>{if(t&&typeof t==`object`&&!Array.isArray(t)){let e={};for(let n of Object.keys(t).sort())e[n]=t[n];return e}return t})}function w$(e){let t=``,n=e=>{if(e.text!==void 0&&(t+=e.text),e.content)for(let t of e.content)n(t)};return n(e),t.replace(/\s+/g,``)}function T$(e){let t=[],n=e=>{if(e.type&&d$.has(e.type)){let n=e.type===`jsxComponent`?String(e.attrs?.componentName??``):``;t.push(n?`${e.type}:${n}`:e.type)}if(e.content)for(let t of e.content)n(t)};return n(e),t.sort()}function E$(e){let t=e,n=[];for(let e of v$){let r=C$(t),i=e.canonicalize(t);C$(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function D$(e,t,n={}){let r=E$(e),i=E$(t),a=[...new Set([...r.fired,...i.fired])];if(!l$(w$(r.normalized),w$(i.normalized)))return{equivalent:!1,level:`L1`,reason:`content-loss`,appliedDegrades:a,detail:`authored text did not survive the round-trip`};let o=T$(r.normalized),s=T$(i.normalized);if(C$(o)!==C$(s))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${o.join(`, `)}] vs [${s.join(`, `)}]`};let c=b$(r.normalized,n.ignoreAttrs),l=b$(i.normalized,n.ignoreAttrs);return C$(c)===C$(l)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:O$(c,l)}}function O$(e,t,n=`doc`){let r=e,i=t;if(!r||!i)return`${n}: node presence differs`;if(r.type!==i.type)return`${n}: type ${String(r.type)} vs ${String(i.type)}`;let a=r.content??[],o=i.content??[];if(a.length!==o.length)return`${n}(${String(r.type)}): child count ${a.length} vs ${o.length}`;for(let e=0;e<a.length;e++)if(C$(a[e])!==C$(o[e]))return O$(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function k$(e,t,n){return!D$(e,t,{ignoreAttrs:n}).equivalent}var A$=new Set([`src`,`href`,`size`]),j$=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function M$(e){if(Array.isArray(e))return e.map(e=>M$(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))A$.has(n)||(t[n]=M$(r));return t}return e}function N$(e){return e.type===`jsxComponent`&&typeof e.attrs?.componentName==`string`&&j$.has(e.attrs.componentName)?M$(e):e.content?{...e,content:e.content.map(N$)}:e}function P$(e){if(Array.isArray(e))return e.map(e=>P$(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=P$(r));return t}return e}function F$(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=F$(t);if(e)return e}}function I$(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=F$(e.parse(r)),o=a?N$(P$(a)):null;if(n.size>=t){let e=n.keys().next().value;e!==void 0&&n.delete(e)}return n.set(r,o),o};return{isDiverged(e){if(e.type!==`jsxComponent`||!e.attrs||e.attrs.kind===`expression`)return!1;let t=e.attrs.sourceRaw;if(typeof t!=`string`||t.length===0)return!1;let n=r(t);return n?k$(n,N$(P$(e))):!1}}}function L$(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&R$(e.value.value,t))continue}let o=z$(e,t);r>=0?n[r]=o:n.push(o)}return n}function R$(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function z$(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function B$(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:L$(t,r),children:n.all(t),data:{}}}var V$=/^[A-Za-z0-9]{20,}$/,H$=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function U$(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function W$(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return V$.test(n)?n:null}function G$(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!U$(t.hostname))return null;let n=W$(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&H$.test(r)?r:null}}function K$(e){return G$(e)!==null}function q$(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function J$(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:q$(t.hostname)}var Y$=/^[A-Za-z0-9_-]{11}$/;function X$(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function Z$(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function Q$(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return Y$.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return Y$.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function $$(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!X$(t.hostname))return null;let n=Q$(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?Z$(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}var e1=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],t1=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:Ad,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],n1=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],r1=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:jd,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(J$(e.src)||K$(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:Ad,hideWhen:e=>typeof e.src==`string`&&(J$(e.src)||K$(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&K$(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(J$(e.src)||K$(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&($$(e.src)!==null||J$(e.src)||K$(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],i1=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:Md,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],a1=[{name:`title`,type:`string`,required:!0,description:`Accordion heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the accordion renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],o1=[e1[0],e1[1],e1[4],e1[5],e1[6]],s1=[t1[0],t1[1],t1[7]],c1=[a1[0],a1[1],a1[4],a1[5]],l1=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],u1=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],d1=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],f1=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],p1=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],m1=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],h1=[m1[0]],g1=[m1[0]],_1=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],v1=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],y1=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],b1=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:Nd,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],x1=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],S1=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function C1(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function w1(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function T1(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}var E1=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:e1,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>B$(`Callout`,e,t,e1)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:t1,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>B$(`img`,e,t,t1)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:r1,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>B$(`video`,e,t,r1)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:i1,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>B$(`audio`,e,t,i1)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:b1,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>B$(`Pdf`,e,t,b1)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:y1,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>B$(`File`,e,t,y1)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:n1,icon:`AppWindow`,category:`media`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>B$(`Embed`,e,t,n1)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:a1,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`toggle`,`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>B$(`Accordion`,e,t,a1)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:f1,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
|
|
495
|
+
<Tab label="Two">Body of the second tab panel.</Tab>`,serialize:(e,t)=>B$(`Tabs`,e,t,f1)},{name:`Tab`,surface:`canonical`,hasChildren:!0,props:p1,icon:`PanelTop`,category:`content`,displayName:`Tab`,description:"A single tab panel inside a `<Tabs>` container — carries the strip label and the block-content body.",searchTerms:[`tab`,`panel`],exampleBody:"Panel content — must be nested inside a `<Tabs>` parent.",serialize:(e,t)=>B$(`Tab`,e,t,p1)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:m1,icon:`Sigma`,category:`content`,displayName:`Math`,description:`Block math equation rendered with KaTeX from a LaTeX source string`,searchTerms:[`math`,`latex`,`equation`,`formula`,`katex`,`tex`],serialize:(e,t)=>B$(`Math`,e,t,m1)},{name:`MermaidFence`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:_1,icon:`Workflow`,category:`content`,displayName:`Mermaid`,placeholder:{label:`Add a Mermaid diagram`},description:"Diagram rendered from Mermaid source (flowchart, sequence, class, state, ER, gantt, pie). Authored exclusively as ` ```mermaid ` fenced code.",searchTerms:[`mermaid`,`diagram`,`flowchart`,`graph`,`sequence`,`sequencediagram`,`class`,`state`,`er`,`erdiagram`,`gantt`,`pie`,`chart`],serialize:e=>({type:`code`,lang:`mermaid`,meta:null,value:e.attrs.props?.chart??``})},{name:`Mirror`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:x1,icon:`CopyPlus`,category:`content`,displayName:`Mirror`,description:"Render a read-only copy of a `<MirrorSource>` block from another doc. Use to keep the same content in sync across multiple docs without copy-paste — edits land at the source, every Mirror reflects the change.",searchTerms:[`mirror`,`sync`,`synced`,`transclude`,`embed`,`reference`,`shared block`],serialize:(e,t)=>B$(`Mirror`,e,t,x1)},{name:`MirrorSource`,surface:`canonical`,hasChildren:!0,props:S1,icon:`GitBranch`,category:`content`,displayName:`Mirror Source`,description:'Mark a block as the source of truth for content that appears in multiple docs. Wrap any block content; `<Mirror src="…" anchor="<id>">` references render this verbatim read-only at every call-site. Edit here, propagate everywhere.',searchTerms:[`mirror source`,`sync source`,`source block`,`master block`,`shared`],exampleBody:"Authoritative content lives inside this block — edits here propagate to every `<Mirror>` that references this id.",serialize:(e,t)=>B$(`MirrorSource`,e,t,S1)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:o1,icon:`MessageSquareWarning`,category:`content`,displayName:`GFM Callout`,description:"GFM blockquote alert (`> [!NOTE]`) — read-only compat. Preserves `> [!NOTE]` syntax on round-trip; insert a fresh Callout block for the full prop surface.",rendersAs:`Callout`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),i=n?.type??`note`;return{type:`blockquote`,children:[{type:`html`,value:`[!${(r.has(i.toLowerCase())?i:`note`).toUpperCase()}]${n?.collapsible?n.defaultOpen===!1?`-`:`+`:``}${n?.title?` ${n.title}`:``}`},...t.all(e).filter(e=>{if(e.type!==`paragraph`)return!0;let t=e;return Array.isArray(t.children)&&t.children.length>0})]}}},{name:`CommonMarkImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:s1,icon:`Image`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (``) — read-only compat. Preserves `` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:t?.sourceUrl??t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:l1,icon:`ZoomIn`,category:`media`,displayName:`Wiki Embed Image`,description:"Obsidian-style `![[file.png]]` wiki-embed — read-only compat. Edit the alt-text via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`img`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,alt:t??n}},serialize:T1},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:u1,icon:`Film`,category:`media`,displayName:`Wiki Embed Video`,description:"Obsidian-style `![[clip.mp4]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`video`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:T1},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:d1,icon:`Volume2`,category:`media`,displayName:`Wiki Embed Audio`,description:"Obsidian-style `![[song.mp3]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`audio`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:T1},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:v1,icon:`Paperclip`,category:`media`,displayName:`Wiki Embed File`,description:"Obsidian-style `![[file.zip]]` wiki-embed — read-only compat for arbitrary downloadable attachments. Renders through the `File` canonical (inline row with file-up icon + bold name + optional dim size). Edit the display name via the alias slot.",rendersAs:`File`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.size==`string`&&e.size.length>0?e.size:null;return{src:e.src,name:t??void 0,size:n??void 0}},serialize:T1},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:c1,icon:`ChevronRight`,category:`content`,displayName:`HTML5 Details`,description:"HTML5 `<details><summary>` collapsible — read-only compat. Preserves `<details>` syntax on round-trip; insert a fresh Accordion block for icon / description / group-name props.",rendersAs:`Accordion`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=n?.defaultOpen?` open`:``,i=n?.name?` name="${C1(n.name)}"`:``,a=n?.id?` id="${C1(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${w1(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}},{name:`DollarMath`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:h1,icon:`Sigma`,category:`content`,displayName:`Dollar Math`,description:"Block math via `$$…$$` syntax — read-only compat. Preserves `$$…$$` form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`math`,value:e.attrs.props?.formula??``})},{name:`MathFence`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:g1,icon:`Sigma`,category:`content`,displayName:`Math Fence`,description:"Block math via ` ```math ` fenced code syntax — read-only compat. Preserves the fence form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`code`,lang:`math`,meta:null,value:e.attrs.props?.formula??``})}],D1={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>B$(e.attrs.componentName||`*`,e,t)};function O1(){let e=new Map;e.set(`*`,D1);for(let t of E1)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}var k1={parseFallback:{blockLevel:0,wholeDoc:0,wholeDocBudget:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{},jsxPopoverCloseRestoreFailed:{},jsxKeyboardDeleteFailed:{},blockGripClickSelectFailed:{},jsxArrowNodeSelectFailed:{}};function A1(){k1.parseFallback.blockLevel++}function j1(){k1.parseFallback.wholeDoc++}function M1(){k1.parseFallback.wholeDocBudget++}function N1(e){k1.jsxRenderFailure[e]=(k1.jsxRenderFailure[e]??0)+1}function P1(e){k1.jsxAutoConvertFailed[e]=(k1.jsxAutoConvertFailed[e]??0)+1}function F1(e){k1.jsxAutoConvertSucceeded[e]=(k1.jsxAutoConvertSucceeded[e]??0)+1}function I1(e){k1.jsxPropDropped[e]=(k1.jsxPropDropped[e]??0)+1}function L1(e){k1.jsxMoveFailed[e]=(k1.jsxMoveFailed[e]??0)+1}function R1(e){k1.jsxStuckCopyFailed[e]=(k1.jsxStuckCopyFailed[e]??0)+1}function z1(e){k1.jsxStuckDeleteFailed[e]=(k1.jsxStuckDeleteFailed[e]??0)+1}function B1(e){k1.jsxPopoverCloseRestoreFailed[e]=(k1.jsxPopoverCloseRestoreFailed[e]??0)+1}function V1(e){k1.jsxKeyboardDeleteFailed[e]=(k1.jsxKeyboardDeleteFailed[e]??0)+1}function H1(e){k1.blockGripClickSelectFailed[e]=(k1.blockGripClickSelectFailed[e]??0)+1}function U1(e){k1.jsxArrowNodeSelectFailed[e]=(k1.jsxArrowNodeSelectFailed[e]??0)+1}var W1=/^(`{3,}|~{3,})/gm;function G1(e){let t=[],n=null;for(let r of e.matchAll(W1)){let e=r[1],i=r.index;n?e[0]===n.marker[0]&&e.length>=n.marker.length&&(t.push([n.offset,i+r[0].length]),n=null):n={marker:e,offset:i}}return n&&t.push([n.offset,e.length]),t}function K1(e,t){return t.some(([t,n])=>e>=t&&e<n)}var q1=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function J1(e){let t=G1(e),n=[];for(let r of e.matchAll(q1))K1(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
|
|
496
|
+
`)}\n\n`:``}var Y1=500,X1=1e3;function Z1(e,t){let n={startMs:typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),calls:0};return t0(e,t.parse,0,n)}function Q1(e){return e.calls>=X1?!0:(typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now())-e.startMs>=Y1}var $1=500;function e0(e){return e instanceof Error?{name:e.name,message:e.message.slice(0,$1),stack:e.stack?.split(`
|
|
497
497
|
`).slice(0,4).join(`
|
|
498
|
-
`)}:{name:`UnknownError`,message:String(e??`unknown`).slice(0
|
|
499
|
-
`||n===`\r`||n==="`")return!1;if(n!==`[`&&n!==`]`)continue;let r=0;for(let n=e-1;n>=0&&t[n]===`\\`;n--)r++;if(r%2!=1){if(n===`]`||t[e+1]===`^`||t[e-1]===`]`)return!1;i=!0;break}}if(!i)return!1;let o=!1,s=-1,c=Math.min(t.length,e+1+
|
|
500
|
-
`||e===`\r`||e===
|
|
498
|
+
`)}:{name:`UnknownError`,message:String(e??`unknown`).slice(0,$1)}}function t0(e,t,n,r){if(n>20)return j1(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`MAX_SPLIT_DEPTH exceeded`})),d0(e);if(r){if(Q1(r))return M1(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`parse budget exhausted`,calls:r.calls})),d0(e);r.calls+=1}try{return t(e)}catch(i){let a=n0(i),o=e0(i);if(a===void 0){if(n===0){let n=u0(e,t,i,r);if(n)return n}return j1(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:o.message,error:o})),d0(e)}A1(),console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:a,reason:o.message,error:o}));try{let i=c0(e,a),s=e.slice(0,i.start),c=e.slice(i.start,i.end),l=e.slice(i.end),u=s.trim()?t0(s,t,n+1,r):{type:`doc`,content:[]},d=l.trim()?t0(J1(s)+l,t,n+1,r):{type:`doc`,content:[]},f={type:`rawMdxFallback`,attrs:{reason:o.message,originalSpan:{start:i.start,end:i.end}},content:c?[{type:`text`,text:c}]:[]},p=[...u.content??[],f,...d.content??[]];return{type:`doc`,content:p.length>0?p:[{type:`paragraph`,content:[]}]}}catch(t){j1();let n=e0(t);return console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`Recovery failed: ${n.message}`,recoveryPath:`block-split-then-rejoin`,error:n,originalError:o})),d0(e)}}}function n0(e){if(!e||typeof e!=`object`)return;let t=e;if(t.place&&typeof t.place.offset==`number`)return t.place.offset;if(t.place?.start&&typeof t.place.start.offset==`number`)return t.place.start.offset;if(t.position&&typeof t.position.offset==`number`)return t.position.offset;if(t.position?.start&&typeof t.position.start.offset==`number`)return t.position.start.offset}function r0(e,t){let n=/\n\s*\n/g,r=null;for(let i of e.matchAll(n)){if(i.index>=t)break;r=i.index+i[0].length}return r}function i0(e,t){for(let n of e.matchAll(/\n\s*\n/g))if(n.index>=t)return n.index;return null}var a0=32*1024;function o0(e,t){let n=[];for(let r of e.matchAll(/<(\/?)([A-Z][A-Za-z0-9.]*)/g)){let i=r.index;if(K1(i,t))continue;let a=r[1]===`/`,o=r[2],s=i+r[0].length,c=Math.min(e.length,s+a0),l=!1,u=0,d=-1,f=!1;for(let t=s;t<c;t++){let n=e[t];if(l){n===`"`&&(l=!1),n===`\\`&&t+1<c&&t++;continue}if(n===`"`){l=!0;continue}if(n===`{`){u++;continue}if(n===`}`&&u>0){u--;continue}if(!(u>0)&&n===`>`){d=t,t>0&&e[t-1]===`/`&&(f=!0);break}}if(d===-1)continue;let p=d+1;a?n.push({kind:`close`,name:o,start:i,end:p}):f?n.push({kind:`self-close`,name:o,start:i,end:p}):n.push({kind:`open`,name:o,start:i,end:p})}return n}function s0(e){let t=o0(e,G1(e)),n=[],r=[];for(let i of t){if(i.kind===`self-close`)continue;if(i.kind===`open`){n.push(i);continue}let t=-1;for(let e=n.length-1;e>=0;e--)if(n[e].name===i.name){t=e;break}if(t!==-1){for(let a=n.length-1;a>t;a--){let t=n[a],o=i0(e,t.start)??e.length;r.push({start:t.start,end:Math.min(i.start,o),source:`unmatched`})}r.push({start:n[t].start,end:i.end,source:`pair`}),n.length=t}}for(let t of n){let n=i0(e,t.start)??e.length;r.push({start:t.start,end:Math.min(e.length,n),source:`unmatched`})}return r}function c0(e,t){let n=s0(e),r=null;for(let e of n)e.start<=t&&t<=e.end&&(!r||e.end-e.start<r.end-r.start)&&(r=e);return r?{start:r.start,end:r.end}:{start:r0(e,t)??0,end:i0(e,t)??e.length}}function l0(e){let t=G1(e),n=/\n[ \t]*\n/g,r=[0];for(let i of e.matchAll(n)){let e=i.index;K1(e,t)||r.push(e+i[0].length)}r.push(e.length);let i=[];for(let t=0;t<r.length-1;t++){let n=r[t],a=r[t+1];if(a<=n)continue;let o=e.slice(n,a);o.trim()&&i.push({src:o,start:n,end:a})}return i}function u0(e,t,n,r){let i=l0(e);if(i.length<2)return null;let a=[],o=!1,s=``;for(let e of i){if(r&&Q1(r))break;r&&(r.calls+=1);let i=s+e.src;try{let n=t(i).content??[];s+=J1(e.src);let r=n.filter(e=>e.type!==`paragraph`||Array.isArray(e.content)&&e.content.length>0);if(r.length===0&&n.length>0){o=!0;continue}a.push(...r),o=!0}catch(t){A1();let r=t?.message?.slice(0,200)??`unknown block error`,i=n?.message?.slice(0,160)??`unknown`;console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:e.start,reason:`Per-block recovery after position-less error: ${i}`,blockError:r,blockErrorName:t?.name})),a.push({type:`rawMdxFallback`,attrs:{reason:r,originalSpan:{start:e.start,end:e.end}},content:[{type:`text`,text:e.src}]})}}return o?{type:`doc`,content:a.length>0?a:[{type:`paragraph`,content:[]}]}:null}function d0(e){return{type:`doc`,content:[{type:`paragraph`,content:[{type:`text`,text:e}]}]}}var f0=``,p0=``,m0=``,h0=``,g0=``,_0=[[f0,``],[p0,``],[m0,``],[h0,``],[g0,``]],v0=/[\uE000-\uE004]/,y0=/[\uE005-\uE009]/;_0.map(([e,t])=>({from:e,to:t}));var b0=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g,x0=/<!--[\s\S]*?-->/g,S0=/<\/([a-z][a-z0-9]*)\s*>/g,C0=/<([a-z][a-z0-9]*)(\s[^>]*)?\/?>/g,w0=new Set([`img`,`video`,`audio`]),T0=new Set([`mark`]),E0=/<\/([A-Z][A-Za-z0-9.]*)>/g;function D0(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n}function O0(e){let t=new Map,n=new RegExp(E0.source,`g`),r=n.exec(e);for(;r!==null;){let i=t.get(r[1]);i?i.push(r.index):t.set(r[1],[r.index]),r=n.exec(e)}return t}function k0(e){let t=[],n=/\n\s*\n/g,r=n.exec(e);for(;r!==null;)t.push(r.index),r=n.exec(e);return t}function A0(e){let t=[],n=e.indexOf(`/>`);for(;n!==-1;)t.push(n),n=e.indexOf(`/>`,n+2);return t}function j0(e){let t=[],n=e.indexOf(`>`);for(;n!==-1;)t.push(n),n=e.indexOf(`>`,n+1);return t}var M0=1024;function N0(e,t){if(t[e-1]!==`(`||t[e-2]!==`]`)return!1;let n=e-2,r=0;for(let e=n-1;e>=0&&t[e]===`\\`;e--)r++;if(r%2==1)return!1;let i=!1,a=Math.max(0,n-M0);for(let e=n-1;e>=a;e--){let n=t[e];if(n===`
|
|
499
|
+
`||n===`\r`||n==="`")return!1;if(n!==`[`&&n!==`]`)continue;let r=0;for(let n=e-1;n>=0&&t[n]===`\\`;n--)r++;if(r%2!=1){if(n===`]`||t[e+1]===`^`||t[e-1]===`]`)return!1;i=!0;break}}if(!i)return!1;let o=!1,s=-1,c=Math.min(t.length,e+1+M0);for(let n=e+1;n<c;n++){let e=t[n];if(e===`>`){s=n;break}if(e===`<`||e===`\\`||e===`
|
|
500
|
+
`||e===`\r`||e===f0||e===p0||e===m0||e===h0||e===g0)return!1;(e===` `||e===` `)&&(o=!0)}return s===-1||!o?!1:t[s+1]===`)`}function P0(e,t,n,r){let i=D0(n,e);if(i>=n.length)return!1;let a=n[i],o=D0(r,e);return a>=(o<r.length?r[o]:t.length)?!1:t[a-1]===`/`}function F0(e){let t=e;if(v0.test(t))for(let[e,n]of _0)t=t.replaceAll(e,n);t=t.replace(x0,e=>e.replace(/</g,f0).replace(/>/g,p0)),t=t.replace(b0,(e,t)=>`${f0}${t.replaceAll(`:`,m0).replaceAll(`@`,h0)}${p0}`),t=t.replace(S0,(e,t)=>T0.has(t)?e:e.replace(/</g,f0).replace(/>/g,p0)),t=t.replace(C0,(e,t)=>w0.has(t)&&e.endsWith(`/>`)||T0.has(t)?e:t[0]===t[0].toLowerCase()&&t[0]!==t[0].toUpperCase()?e.replace(/</g,f0).replace(/>/g,p0):e),t=t.replace(/<>/g,`${f0}${p0}`);let n=O0(t),r=k0(t),i=A0(t),a=j0(t);t=t.replace(/</g,(e,o)=>{if(N0(o,t))return e;let s=t.slice(o,o+256);if(s[1]===`/`)return/^<\/[a-zA-Z][a-zA-Z0-9.]*[ \t]*>/.test(s)?e:f0;let c=/^<([a-z][a-z0-9]*)/.exec(s);if(c&&w0.has(c[1])&&P0(o,t,a,r))return e;let l=/^<([a-z][a-z0-9]*)([\s/>])/.exec(s);if(l&&T0.has(l[1])){let n=l[1];return s.startsWith(`<${n}/>`)||t.indexOf(`</${n}>`,o)!==-1?e:f0}let u=/^<([A-Z][a-zA-Z0-9.]*)[\s/>]/.exec(s);if(!u)return f0;let d=u[1],f=D0(r,o),p=D0(i,f<r.length?r[f]:t.length);if(p>0){let n=i[p-1];if(n>o){let r=o+u[0].length-1;if(!t.slice(r,n).replace(/"[^"]*"|'[^']*'/g,``).includes(`/`))return e}}let m=n.get(d);return m&&D0(m,o)<m.length?e:f0});{let e=[],n=[];for(let r=0;r<t.length;r++){if(t[r]===`
|
|
501
501
|
`){let i=t[r+1];if(i===`
|
|
502
502
|
`||i===`>`){if(e.push(...n),n.length=0,i===`
|
|
503
503
|
`)for(;t[r+1]===`
|
|
504
|
-
`;)r++;continue}}if(t[r]===`{`||t[r]===`}`){let e=0;for(let n=r-1;n>=0&&t[n]===`\\`;n--)e++;if(e%2==1)continue;t[r]===`{`?n.push(r):n.length>0&&n.pop()}}if(e.push(...n),e.length>0){let n=t.split(``);for(let t of e)n[t]=
|
|
505
|
-
`,t),r=(n===-1?e.slice(t):e.slice(t,n)).match(
|
|
506
|
-
`?(n+=1,r=1):r+=1;return{line:n,column:r,offset:t}}function
|
|
507
|
-
`;)r--;let i=e.slice(r,n===t-1?n:n+1);if(i.trim().length===0){n=r-2;continue}return
|
|
508
|
-
`),n=!1;for(let e of t)if(e.length!==0&&(n=!0
|
|
504
|
+
`;)r++;continue}}if(t[r]===`{`||t[r]===`}`){let e=0;for(let n=r-1;n>=0&&t[n]===`\\`;n--)e++;if(e%2==1)continue;t[r]===`{`?n.push(r):n.length>0&&n.pop()}}if(e.push(...n),e.length>0){let n=t.split(``);for(let t of e)n[t]=g0;t=n.join(``)}}return t}function I0(e){return v0.test(e)||y0.test(e)}function L0(){return e=>{D(e,e=>{let t=e;typeof t.value==`string`&&I0(t.value)&&(t.value=R0(t.value)),typeof t.url==`string`&&I0(t.url)&&(t.url=R0(t.url)),typeof t.title==`string`&&I0(t.title)&&(t.title=R0(t.title)),typeof t.alt==`string`&&I0(t.alt)&&(t.alt=R0(t.alt)),typeof t.lang==`string`&&I0(t.lang)&&(t.lang=R0(t.lang)),typeof t.meta==`string`&&I0(t.meta)&&(t.meta=R0(t.meta))})}}function R0(e){let t=e.replaceAll(f0,`<`).replaceAll(p0,`>`).replaceAll(m0,`:`).replaceAll(h0,`@`).replaceAll(g0,`{`);if(y0.test(t))for(let[e,n]of _0)t=t.replaceAll(n,e);return t}var z0=``,B0=``,V0=/&(?:[A-Za-z][A-Za-z0-9]*|#[0-9]+|#[xX][0-9A-Fa-f]+);/g;function H0(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n}function U0(e,t,n){return t.lastIndex=0,e.replace(t,(t,r)=>typeof r!=`number`||H0(e,r)%2==1?t:n(t))}function W0(e){return V0.lastIndex=0,e.replace(V0,e=>{let t=e.slice(1,-1);if(t.startsWith(`#`)){let e=t[1]===`x`||t[1]===`X`;return E(t.slice(e?2:1),e?16:10)}let n=f(t);return n===!1?e:n})}function G0(e){return U0(e,V0,e=>`${z0}${e.slice(1,-1)}${B0}`)}var K0=RegExp(`${z0}([^${B0}]+)${B0}`,`g`);function q0(e){if(!e.includes(z0))return{value:e,spans:[]};let t=[],n=``,r=0;K0.lastIndex=0;let i=K0.exec(e);for(;i!==null;){i.index>r&&(n+=e.slice(r,i.index));let a=`&${i[1]??``};`;t.push({offset:n.length,length:a.length,raw:a}),n+=a,r=i.index+i[0].length,i=K0.exec(e)}return r<e.length&&(n+=e.slice(r)),{value:n,spans:t}}function J0(){return e=>{D(e,e=>{let t=e;if(typeof t.value==`string`&&t.value.includes(z0)){let{value:n,spans:r}=q0(t.value);if(t.value=n,e.type===`text`&&r.length>0){let t=e;t.data??={},t.data.entityRefSpans=r}}for(let e of[`url`,`title`,`alt`,`lang`,`meta`]){let n=t[e];typeof n==`string`&&n.includes(z0)&&(t[e]=q0(n).value)}})}}var Y0=``,X0=/\\</g;function Z0(e){return U0(e,X0,e=>`${Y0}${e.slice(1)}`)}function Q0(){return e=>{D(e,e=>{let t=e;typeof t.value==`string`&&t.value.includes(Y0)&&(t.value=t.value.split(Y0).join(``));for(let e of[`url`,`title`,`alt`]){let n=t[e];typeof n==`string`&&n.includes(Y0)&&(t[e]=n.split(Y0).join(``))}})}}var $0=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),e2={note:`note`,tip:`tip`,important:`important`,warning:`warning`,caution:`caution`,abstract:`abstract`,info:`info`,todo:`todo`,success:`success`,question:`question`,failure:`failure`,danger:`danger`,bug:`bug`,example:`example`,quote:`quote`,summary:`abstract`,tldr:`abstract`,check:`success`,done:`success`,help:`question`,faq:`question`,fail:`failure`,missing:`failure`,error:`danger`,cite:`quote`,idea:`tip`,hint:`tip`,warn:`warning`,attention:`warning`},t2=`ok-alert`,n2=RegExp(`(?:^|\\s)${t2}-(\\w+)(?:\\s|$)`),r2=/^>\s*\[!(\w+)\]([+-])?(?:\s+(.*?))?\s*$/i;function i2(e,t){if(t<0||t>=e.length)return null;let n=e.indexOf(`
|
|
505
|
+
`,t),r=(n===-1?e.slice(t):e.slice(t,n)).match(r2);return r?{rawType:r[1],foldableMarker:r[2]===`+`||r[2]===`-`?r[2]:null,title:r[3]?.trim()||null}:null}function a2(e){if(e.data?.hName!==`div`)return null;let t=e.data?.hProperties?.class;if(typeof t!=`string`)return null;let n=t.match(n2);return n?n[1].toLowerCase():null}function o2(e){return e2[e.toLowerCase()]??null}function s2(e,t,n,r,i=null){let a=[{type:`mdxJsxAttribute`,name:`type`,value:t}];n&&a.push({type:`mdxJsxAttribute`,name:`title`,value:n}),i&&a.push({type:`mdxJsxAttribute`,name:`data-authored-as`,value:i}),r!==null&&(a.push({type:`mdxJsxAttribute`,name:`collapsible`,value:null}),r===`+`?a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}):a.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}}));let o=e.children.slice(1),s=e.position?.start.line;return{type:`mdxJsxFlowElement`,name:`GFMCallout`,attributes:a,children:n&&o.length>0&&s!==void 0&&c2(o[0],s)?o.slice(1):o,position:e.position}}function c2(e,t){if(!e||typeof e!=`object`)return!1;let n=e;if(n.type!==`paragraph`)return!1;let r=n.position?.start?.line,i=n.position?.end?.line;return r===t&&i===t}function l2(e){if(!e||typeof e!=`object`||e.type!==`paragraph`)return!1;let t=e.data?.hProperties?.class;return typeof t==`string`&&t.includes(`${t2}-title`)}function u2(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,`blockquote`,(e,t,r)=>{if(r===void 0||typeof t!=`number`)return;let i=a2(e);if(!i)return;let a=o2(i),o=null,s=null;e.position?.start?.offset!==void 0&&(s=i2(n,e.position.start.offset),s&&(o=s.title,a||=o2(s.rawType)));let c=a??`note`,l=s&&$0.has(c)?s.foldableMarker:null,u=(()=>{if(e.position?.start?.offset!==void 0){let t=i2(n,e.position.start.offset);if(t?.rawType)return t.rawType}return i})(),d=u.toLowerCase()===c?null:u;if(!l2(e.children[0]))return;let f=s2(e,c,o,l,d);r.children[t]=f})}}var d2=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"></svg>`,f2={markers:`*`,classPrefix:t2,matchCaseSensitive:!1,icons:new Proxy({},{get:()=>d2})};function p2(e,t,n,r){let i=t,a=0;for(;a<r&&i<e.length;)e[i]===`\\`&&i+1<e.length&&n[a]===e[i+1]?(i+=2,a+=1):(i+=1,a+=1);return i}function m2(e,t){let n=1,r=1;for(let i=0;i<t&&i<e.length;i++)e[i]===`
|
|
506
|
+
`?(n+=1,r=1):r+=1;return{line:n,column:r,offset:t}}function h2(e,t,n){return{start:m2(e,t),end:m2(e,n)}}function g2(e,t,n,r){if(!e||!t.position||typeof t.position.start?.offset!=`number`)return;let i=t.position.start.offset;return h2(e,p2(e,i,t.value,n),p2(e,i,t.value,r))}var _2=/(?<!%)%%([^\n]*?[^\n%])%%(?!%)/g,v2=/<!--([\s\S]*?)-->/g;function y2(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;x2(e),D(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`%%`)===-1&&i.indexOf(`<!--`)===-1)return;let a=b2(i);if(a.length===0)return;let o=[],s=0;for(let t of a){if(t.start>s){let r={type:`text`,value:i.slice(s,t.start)},a=g2(n,e,s,t.start);a&&(r.position=a),o.push(r)}let r={type:`comment`,children:[{type:`text`,value:t.body}],data:{sourceForm:t.sourceForm}},a=g2(n,e,t.start,t.end);a&&(r.position=a),o.push(r),s=t.end}if(s<i.length){let t={type:`text`,value:i.slice(s)},r=g2(n,e,s,i.length);r&&(t.position=r),o.push(t)}return r.children.splice(t,1,...o),[g,t+o.length]})}}function b2(e){let t=[];_2.lastIndex=0;let n;for(;(n=_2.exec(e))!==null;)n[1].trim().length!==0&&t.push({start:n.index,end:n.index+n[0].length,body:n[1],sourceForm:`percent`});v2.lastIndex=0;let r;for(;(r=v2.exec(e))!==null;){let e=r[1].trim();e!==``&&t.push({start:r.index,end:r.index+r[0].length,body:e,sourceForm:`html`})}t.sort((e,t)=>e.start-t.start);let i=[],a=-1;for(let e of t)e.start<a||(i.push(e),a=e.end);return i}function x2(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(e.type===`paragraph`){let r=S2(e);if(r!==null){let e=C2(r);if(e!==null){let r={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:e}]}],data:{sourceForm:`percent`,sourceLayout:`block`}};t.splice(n,1,r),n+=1;continue}let i=w2(r);if(i!==null){let e={type:`commentBlock`,children:[{type:`paragraph`,children:[{type:`text`,value:i}]}],data:{sourceForm:`html`,sourceLayout:`inline`}};t.splice(n,1,e),n+=1;continue}}let i=T2(e);if(i!==null){let e={type:`commentBlock`,children:[i],data:{sourceForm:`html`,sourceLayout:`inline`}};t.splice(n,1,e),n+=1;continue}let a=E2(e);if(a!==null){let e={type:`commentBlock`,children:[a],data:{sourceForm:`percent`,sourceLayout:`inline`}};t.splice(n,1,e),n+=1;continue}}if(e.type===`paragraph`&&O2(e)){let e=n+1;for(;e<t.length;){let n=t[e];if(n.type===`paragraph`&&O2(n))break;e+=1}if(e<t.length&&e>n+1){let r={type:`commentBlock`,children:t.slice(n+1,e),data:{sourceForm:`percent`,sourceLayout:`block`}};t.splice(n,e-n+1,r),n+=1;continue}}n+=1}}function S2(e){if(e.children.length!==1)return null;let t=e.children[0];return t.type===`text`?t.value:null}function C2(e){let t=e.match(/^%%\n((?:.|\n(?!\n))+?)\n%%$/);return t===null?null:t[1]}function w2(e){let t=e.trim();if(!t.startsWith(`<!--`)||!t.endsWith(`-->`))return null;let n=t.slice(4,-3);if(n.includes(`-->`)||n.includes(`<!--`))return null;let r=n.trim();return r===``?null:r}function T2(e){if(e.children.length<2)return null;let t=e.children[0],n=e.children[e.children.length-1];if(t.type!==`text`||n.type!==`text`)return null;let r=t.value.trimStart();if(!r.startsWith(`<!--`))return null;let i=n.value.trimEnd();if(!i.endsWith(`-->`))return null;for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`text`)continue;let r=n.value;if(t===0){if(D2(r,`<!--`)>1||D2(r,`-->`)>0)return null}else if(t===e.children.length-1){if(D2(r,`<!--`)>0||D2(r,`-->`)>1)return null}else if(r.includes(`<!--`)||r.includes(`-->`))return null}let a=r.slice(4);a.startsWith(` `)&&(a=a.slice(1));let o=i.slice(0,-3);o.endsWith(` `)&&(o=o.slice(0,-1));let s=[];a.length>0&&s.push({...t,value:a});for(let t=1;t<e.children.length-1;t++)s.push(e.children[t]);return o.length>0&&s.push({...n,value:o}),s.length===0?null:{type:`paragraph`,children:s}}function E2(e){if(e.children.length<2)return null;let t=e.children[0],n=e.children[e.children.length-1];if(t.type!==`text`||n.type!==`text`)return null;let r=t.value.trimStart();if(!r.startsWith(`%%`)||r.startsWith(`%%%`))return null;let i=n.value.trimEnd();if(!i.endsWith(`%%`)||i.endsWith(`%%%`))return null;let a=r.slice(2);a.startsWith(` `)&&(a=a.slice(1));let o=i.slice(0,-2);if(o.endsWith(` `)&&(o=o.slice(0,-1)),a.indexOf(`%%`)!==-1||o.indexOf(`%%`)!==-1)return null;for(let t=1;t<e.children.length-1;t++){let n=e.children[t];if(n.type===`text`&&n.value.indexOf(`%%`)!==-1)return null}if(!(e.children.slice(1,-1).some(e=>e.type===`text`?e.value.trim().length>0:!0)||a.trim().length>0||o.trim().length>0))return null;let s=[];a.length>0&&s.push({...t,value:a});for(let t=1;t<e.children.length-1;t++)s.push(e.children[t]);return o.length>0&&s.push({...n,value:o}),s.length===0?null:{type:`paragraph`,children:s}}function D2(e,t){if(!t)return 0;let n=0,r=0;for(;;){let i=e.indexOf(t,r);if(i===-1)break;n+=1,r=i+t.length}return n}function O2(e){let t=S2(e);return t===null?!1:t.trim()===`%%`}var k2=/^([ ]{1,3})(<\/[A-Z][A-Za-z0-9_]*\s*>)([ \t]*)$/gm,A2=/^[ ]{0,3}([-*+]|\d{1,9}[.)])([ \t]|$)/;function j2(e,t){if(t===0)return!1;let n=t-1;for(;n>=0;){let r=n;for(;r>0&&e[r-1]!==`
|
|
507
|
+
`;)r--;let i=e.slice(r,n===t-1?n:n+1);if(i.trim().length===0){n=r-2;continue}return A2.test(i)}return!1}function M2(e){if(!e.includes(`</`))return e;let t=G1(e),n=!1,r=e.replace(k2,(r,i,a,o,s)=>K1(s,t)||!j2(e,s)?r:(n=!0,`${a}${o}`));return n?r:e}var N2=/^<details(\s[^>]*)?>\s*<summary>([\s\S]*?)<\/summary>([\s\S]*?)<\/details>\s*$/,P2=/^<details(\s[^>]*)?>(?:\s*<summary>([\s\S]*?)<\/summary>)?[\s\S]*$/,F2=/^\s*<\/details>\s*$/;function I2(e){let t=!1,n=null,r=null;if(!e)return{defaultOpen:t,name:n,id:r};let i=/(\w+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'<>]+)))?/g,a=i.exec(e);for(;a!==null;){let o=a[1].toLowerCase(),s=a[2]??a[3]??a[4]??null;o===`open`?t=!0:o===`name`?n=s:o===`id`&&(r=s),a=i.exec(e)}return{defaultOpen:t,name:n,id:r}}function L2(e){let t=[];return e.title!==null&&t.push({type:`mdxJsxAttribute`,name:`title`,value:e.title}),e.defaultOpen&&t.push({type:`mdxJsxAttribute`,name:`defaultOpen`,value:null}),e.name!==null&&t.push({type:`mdxJsxAttribute`,name:`name`,value:e.name}),e.id!==null&&t.push({type:`mdxJsxAttribute`,name:`id`,value:e.id}),t}function R2(e){if(e.type!==`paragraph`)return!1;let t=e.children;return t.length===1&&t[0].type===`text`}function z2(e){return e.children[0].value??``}function B2(e){if(!R2(e))return null;let t=z2(e).match(N2);if(!t)return null;let{defaultOpen:n,name:r,id:i}=I2(t[1]),a=t[2].trim()||null,o=t[3].trim(),s=o?[{type:`paragraph`,children:[{type:`text`,value:o}]}]:[];return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:L2({title:a,defaultOpen:n,name:r,id:i}),children:s,position:e.position}}function V2(e,t){let n=e[t];if(!R2(n))return null;let r=z2(n);if(!r.startsWith(`<details`)||r.includes(`</details>`))return null;let i=r.match(P2);if(!i)return null;let{defaultOpen:a,name:o,id:s}=I2(i[1]),c=i[2]?.trim()||null;for(let n=t+1;n<e.length;n++){let t=e[n];if(!R2(t))continue;let r=z2(t);if(F2.test(r))return{closerIdx:n,title:c,defaultOpen:a,name:o,id:s};if(r.includes(`</details>`))return null}return null}function H2(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(R2(e)){let r=B2(e);if(r){t[n]=r,n++;continue}let i=V2(t,n);if(i){let r=e,a=t[i.closerIdx],o=n+1,s=i.closerIdx,c=t.slice(o,s),l=r.position,u=a.position,d={type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:L2(i),children:c,position:l&&u?{start:l.start,end:u.end}:void 0},f=i.closerIdx-n+1;t.splice(n,f,d),n++;continue}}n++}}function U2(){return e=>{D(e,e=>{`children`in e&&Array.isArray(e.children)&&H2(e)})}}var W2=/(?<!=)==(?=\S)([^\n]*?[^\s=])==(?!=)/g;function G2(e){return e.type===`strong`||e.type===`emphasis`||e.type===`delete`||e.type===`inlineCode`}function K2(e){return e.type===`text`||e.type===`inlineCode`?e.value.length>0?e.value.charAt(0):null:`children`in e&&Array.isArray(e.children)&&e.children.length>0?K2(e.children[0]):null}function q2(e){if(e.type===`text`||e.type===`inlineCode`)return e.value.length>0?e.value.slice(-1):null;if(`children`in e&&Array.isArray(e.children)&&e.children.length>0){let t=e.children;return q2(t[t.length-1])}return null}function J2(e,t,n){let r={type:`text`,value:e.value.slice(t,n)},i=e.data?.entityRefSpans;if(i?.length){let e=i.filter(e=>e.offset>=t&&e.offset+e.length<=n).map(e=>({...e,offset:e.offset-t}));e.length>0&&(r.data={entityRefSpans:e})}return r}function Y2(e){let t=e.children,n=0;for(;n<t.length;){let e=t[n];if(e.type!==`text`){n++;continue}let r=e.value,i=-1;for(let e=0;e<=r.length-2;e++){if(r.charCodeAt(e)!==61||r.charCodeAt(e+1)!==61||e>0&&r.charCodeAt(e-1)===61)continue;let a;if(e+2<r.length)a=r.charAt(e+2);else{let e=t[n+1];if(!e)continue;a=K2(e)}if(!(a===null||/\s/.test(a))){i=e;break}}if(i===-1){n++;continue}let a=-1,o=-1,s=!1;for(let e=i+3;e<=r.length-2;e++){if(r.charCodeAt(e)!==61||r.charCodeAt(e+1)!==61)continue;let i=r.charAt(e-1);if(/[\s=]/.test(i))continue;let o;if(e+2<r.length)o=r.charAt(e+2);else{let e=t[n+1];o=e?e.type===`text`?e.value[0]??null:K2(e):null}if(o!==`=`){a=-2;break}}if(a===-2){n++;continue}for(let e=n+1;e<t.length;e++){let n=t[e];if(n.type===`text`){for(let r=0;r<=n.value.length-2;r++){if(n.value.charCodeAt(r)!==61||n.value.charCodeAt(r+1)!==61)continue;let i;if(r>0)i=n.value.charAt(r-1);else{let n=t[e-1];i=q2(n)}if(i===null||/[\s=]/.test(i))continue;let c;if(r+2<n.value.length)c=n.value.charAt(r+2);else{let n=t[e+1];c=n?n.type===`text`?n.value[0]??null:K2(n):null}if(c!==`=`){a=e,o=r,s=!0;break}}if(a>=0)break}else if(!G2(n))break}if(a<0){n++;continue}let c=t[a],l=r.slice(0,i),u=r.slice(i+2),d=c.value.slice(0,o),f=c.value.slice(o+2),p=[];u.length>0&&p.push(J2(e,i+2,r.length));for(let e=n+1;e<a;e++)p.push(t[e]);if(d.length>0&&p.push(J2(c,0,o)),!s){n++;continue}let m={type:`mark`,children:p},h=[];l.length>0&&h.push(J2(e,0,i)),h.push(m),f.length>0&&h.push(J2(c,o+2,c.value.length)),t.splice(n,a-n+1,...h),n+=+(l.length>0)+1}}function X2(e){if(`children`in e&&Array.isArray(e.children)){Y2(e);for(let t of e.children)X2(t)}}function Z2(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`==`)===-1)return;W2.lastIndex=0;let a=[],o;for(;(o=W2.exec(i))!==null;)a.push(o);if(a.length===0)return;let s=[],c=0;for(let t of a){let r=t.index,i=r+t[0].length;if(r>c){let t=J2(e,c,r),i=g2(n,e,c,r);i&&(t.position=i),s.push(t)}let a=J2(e,r+2,i-2),o=g2(n,e,r+2,i-2);o&&(a.position=o);let l={type:`mark`,children:[a]},u=g2(n,e,r,i);u&&(l.position=u),s.push(l),c=i}if(c<i.length){let t=J2(e,c,i.length),r=g2(n,e,c,i.length);r&&(t.position=r),s.push(t)}return r.children.splice(t,1,...s),[g,t+s.length]}),X2(e),D(e,`mdxJsxTextElement`,(e,t,n)=>{if(n===void 0||t==null||e.name!==`mark`)return;let r={type:`mark`,children:e.children??[]};return n.children.splice(t,1,r),t+1})}}function Q2(){return e=>{D(e,`paragraph`,(e,t,n)=>{if(!n||t==null||e.children.length!==1)return;let r=e.children[0];if(!r||r.type!==`image`)return;let i=$2(r,e);n.children[t]=i})}}function $2(e,t){let n=[{type:`mdxJsxAttribute`,name:`src`,value:e.url}];typeof e.alt==`string`&&n.push({type:`mdxJsxAttribute`,name:`alt`,value:e.alt}),e.title&&n.push({type:`mdxJsxAttribute`,name:`title`,value:e.title});let r={type:`mdxJsxFlowElement`,name:`CommonMarkImage`,attributes:n,children:[]};return t.position&&(r.position=t.position),r}var e4=/^( {4}|\t)/;function t4(e){let t=e.split(`
|
|
508
|
+
`),n=!1;for(let e of t)if(e.length!==0&&(n=!0,!e4.test(e)))return!1;return n}function n4(e){return e.split(`
|
|
509
509
|
`).map(e=>e.length===0?e:e.startsWith(` `)?e.slice(4):e.startsWith(` `)?e.slice(1):e).join(`
|
|
510
|
-
`)}function
|
|
511
|
-
`;)a--;if(a===r)return null;let o=t.slice(a,r);if(
|
|
510
|
+
`)}function r4(e,t){let n=e.position;if(!n||typeof n.start.offset!=`number`||typeof n.end.offset!=`number`)return null;let r=n.start.offset,i=n.end.offset;if(r<0||i>t.length||r>=i)return null;let a=r;for(;a>0&&t[a-1]!==`
|
|
511
|
+
`;)a--;if(a===r)return null;let o=t.slice(a,r);if(!e4.test(o))return null;let s=t.slice(a,i);if(!t4(s))return null;let c={start:{line:n.start.line,column:1,offset:a},end:n.end};return{type:`code`,lang:null,meta:null,value:n4(s).replace(/\n+$/,``),position:c,data:{sourceStyle:`indented`}}}var i4=function(){return(e,t)=>{let n=String(t.value??``);n&&D(e,`paragraph`,(e,t,r)=>{if(!r||r.type!==`root`||t==null)return;let i=r.children[t-1];if(i&&i.type===`list`)return;let a=r4(e,n);a&&(r.children[t]=a)})}};function a4(e,t,n){let r={type:`mdxJsxFlowElement`,name:e,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t}],children:[]};return n&&(r.position=n),r}function o4(){return e=>{D(e,`math`,(e,t,n)=>{if(!n||t==null)return;let r=a4(`DollarMath`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r}),D(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`math`)return;let r=a4(`MathFence`,typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}var s4=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g;function c4(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;s4.lastIndex=0;let a=[],o=0;for(;;){let n=s4.exec(e);if(n===null)break;let s=n[0],c=n[1],l=n.index;if(l>o){let n={type:`text`,value:e.slice(o,l)},r=g2(t,i,o,l);r&&(n.position=r),a.push(n)}let u={type:`text`,value:c},d=g2(t,i,l+1,l+1+c.length);d&&(u.position=d);let f={type:`link`,url:c,title:null,children:[u],data:{sourceStyle:`autolink`}},p=g2(t,i,l,l+s.length);p&&(f.position=p),a.push(f),o=l+s.length,r=!0}if(a.length===0)n.push(i);else{if(o<e.length){let n={type:`text`,value:e.slice(o)},r=g2(t,i,o,e.length);r&&(n.position=r),a.push(n)}n.push(...a)}}r&&(e.children=n)}var l4=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`.split(``));function u4(e){let t=[],n=``;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`&&r+1<e.length&&e[r+1]===`|`){n+=`${i}|`,r++;continue}if(i===`|`){t.push(n),n=``;continue}n+=i}return t.push(n),t}function d4(e,t,n=!1,r){if(!t)return;let i=e.position;if(!i||typeof i.start?.offset!=`number`){n&&console.warn(`[position-slice] node type=${e.type} has no position — fidelity defaults apply`);return}let a=i.start.offset,o=i.end?.offset??a;if(a<0||o>t.length){n&&console.warn(`[position-slice] node type=${e.type} position out of bounds: start=${a} end=${o} sourceLen=${t.length}`);return}switch(e.data??={},e.type){case`text`:{let n=t.slice(a,o),r=e.value??``;if(n.length>r.length&&n.includes(`\\`)){let t=[],i=0,a=0;for(;i<n.length&&a<r.length;)n[i]===`\\`&&i+1<n.length&&l4.has(n[i+1])&&r[a]===n[i+1]?(t.push({offset:a,char:n[i+1]}),i+=2,a+=1):(i++,a++);t.length>0&&(e.data.escapedChars=t)}n.endsWith(`\\`)&&r.endsWith(`\\`)&&(e.data.sourceRaw=n);break}case`emphasis`:{let n=t[a];(n===`*`||n===`_`)&&(e.data.sourceDelimiter=n);break}case`strong`:{let n=t.slice(a,a+2);(n===`**`||n===`__`)&&(e.data.sourceDelimiter=n);break}case`heading`:{let n=t[a],i=t.slice(a,o);if(n===`#`){if(e.data.sourceStyle=`atx`,r?.type===`root`){let n=a;for(;n>0&&t[n-1]!==`
|
|
512
512
|
`;)n--;let r=t.slice(n,a);r.length>=1&&r.length<=3&&/^ +$/.test(r)&&(e.data.sourceLeadingIndent=r.length)}let n=/^#+( {2,})[^ ]/.exec(i);n&&(e.data.sourceInteriorSpacing=n[1].length);let o=/^.*?[ \t](#+)[ \t]*$/.exec(i);o&&(e.data.sourceTrailingHashes=o[1].length)}else{let t=/\n(=+)[ \t]*$/.exec(i),n=/\n(-+)[ \t]*$/.exec(i),r=t??n;r?(e.data.sourceStyle=`setext`,e.data.sourceUnderlineLength=r[1].length):e.data.sourceStyle=`atx`}break}case`blockquote`:{let n=a;for(;n>0&&t[n-1]!==`
|
|
513
513
|
`;)n--;let r=!1;for(let e=n;e<a;e++)if(t[e]===`>`){r=!0;break}let i=t.slice(a,o).split(`
|
|
514
514
|
`),s=[];for(let e=0;e<i.length;e++){let t=i[e];if(t.trim().length===0)continue;if(r&&e>0)break;let n=t.replace(/^ {1,3}/,``);if(n[0]!==`>`){e>0&&t.trimStart()[0]!==`>`&&s.push(`lazy`);continue}if(n.slice(1).trimEnd()!==``)if(n[1]===` `)s.push(1);else{let e=0;for(;n[1+e]===` `;)e++;s.push(e)}}s.length>0&&(e.data.sourceMarkerSpacings=s);break}case`list`:{let n=e.children?.[0];if(n?.position?.start?.offset!=null){let r=n.position.start.offset;if(r>=0&&r<t.length){let n=t[r];if(!e.ordered&&(n===`-`||n===`*`||n===`+`))e.data.bulletMarker=n;else if(e.ordered){let n=t.slice(r,Math.min(r+10,t.length)).match(/^\d+([.)])/);n&&(e.data.listMarkerDelimiter=n[1])}}}break}case`listItem`:{let n=t.slice(a,o),r=/^(?:([-+*])|(\d{1,9})[.)])( *)/.exec(n);if(!r)break;let s=r[1]?1:(r[2]?.length??0)+1,c=r[3].length;c>=2&&c<=4&&(e.data.sourceMarkerSpacing=c),r[2]&&(e.data.sourceOrdinal=Number.parseInt(r[2],10)),e.checked!=null&&/^\[([xX])\] /.exec(n.slice(s+Math.max(c,1)))?.[1]===`X`&&(e.data.sourceCheckboxChar=`X`);let l=s+(c>=2&&c<=4?c:1),u=a;for(;u>0&&t[u-1]!==`
|
|
@@ -518,24 +518,24 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
518
518
|
`),r=(e.value??``).split(`
|
|
519
519
|
`);if(n.length===r.length){let t=[],i=!1,a=!0;for(let e=0;e<n.length;e++){let o=n[e],s=r[e];if(!o.endsWith(s)){a=!1;break}let c=o.slice(0,o.length-s.length);if(!/^[ \t]*$/.test(c)){a=!1;break}t.push(c),c!==(s.length>0?` `:``)&&(i=!0)}a&&i&&(e.data.sourceIndents=t)}}break}case`inlineCode`:{let n=t[a];if(n==="`"||n===`~`){e.data.sourceFenceChar=n;let r=0;for(;a+r<t.length&&t[a+r]===n;)r++;r>=1&&(e.data.sourceFenceLength=r);let i=t.slice(a+r,o-r),s=e.value??``;i!==s&&i===` ${s} `&&(e.data.sourcePadded=!0)}break}case`inlineMath`:if(t[a]===`$`){let n=0;for(;a+n<t.length&&t[a+n]===`$`;)n++;e.data.sourceDelimiter=`$`.repeat(n)}break;case`thematicBreak`:e.data.sourceRaw=t.slice(a,o);break;case`table`:{let n=t.slice(a,o),r=n.indexOf(`
|
|
520
520
|
`);if(r===-1)break;let i=n.slice(r+1),s=i.indexOf(`
|
|
521
|
-
`),c=s===-1?i:i.slice(0,s),l=c.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`),u=[];for(let e of l){let t=e.match(/-/g);u.push(t?t.length:0)}u.some(e=>e>0)&&(e.data.sourceDashCounts=u);{let t=c.trim(),n=
|
|
521
|
+
`),c=s===-1?i:i.slice(0,s),l=c.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`),u=[];for(let e of l){let t=e.match(/-/g);u.push(t?t.length:0)}u.some(e=>e>0)&&(e.data.sourceDashCounts=u);{let t=c.trim(),n=u4(t);n.length>0&&n[0]===``&&t.startsWith(`|`)&&n.shift(),n.length>0&&n[n.length-1]===``&&t.endsWith(`|`)&&n.pop();let r=n.every(e=>/^[-: ]+$/.test(e)),i=[];for(let e of n){let t=0;for(;t<e.length&&e[t]===` `;)t++;let n=0;for(;n<e.length-t&&e[e.length-1-n]===` `;)n++;i.push({left:t,right:n})}r&&i.length>0&&(e.data.sourceAlignmentPadding=i)}{let t=n.split(`
|
|
522
522
|
`).filter(e=>e.trim().length>0);if(t.length>=2){let n=t.map(e=>e.trimStart().startsWith(`|`)),r=t.map(e=>/(^|[^\\])\|$/.test(e.trimEnd())),i=n.every(e=>e===n[0]),a=r.every(e=>e===r[0]);if(i&&a){let t=n[0],i=r[0];(!t||!i)&&(e.data.sourceOuterPipes={leading:t,trailing:i})}}}for(let n of e.children??[]){if(n.type!==`tableRow`||!n.position)continue;let e=n.position.start.offset,r=n.position.end.offset;if(typeof e!=`number`||typeof r!=`number`)continue;let i=t.slice(e,r),a=i.indexOf(`
|
|
523
|
-
`);a!==-1&&(i=i.slice(0,a));let o=
|
|
523
|
+
`);a!==-1&&(i=i.slice(0,a));let o=u4(i);o.length>0&&o[0]===``&&i.startsWith(`|`)&&o.shift(),o.length>0&&o[o.length-1]===``&&i.endsWith(`|`)&&o.pop();let s=n.children??[],c=Math.min(s.length,o.length);for(let e=0;e<c;e++){let t=s[e];if(t.type!==`tableCell`)continue;let n=o[e],r=0;for(;r<n.length&&n[r]===` `;)r++;let i=0;for(;i<n.length-r&&n[n.length-1-i]===` `;)i++;t.data||={},t.data.sourcePadding={left:r,right:i}}}break}case`link`:case`linkReference`:if(`children`in e&&e.children.length===0&&(e.data.sourceRaw=t.slice(a,o)),e.type===`link`){let n=t[a];if(n!==`[`&&n!==`<`&&!e.title)e.data.sourceStyle=`gfm-autolink`;else if(n===`[`){let n=t.slice(a,o),r=n.lastIndexOf(`](`);if(r!==-1){let t=r+2;for(;t<n.length&&(n[t]===` `||n[t]===` `);)t++;if(n[t]===`<`&&(e.data.sourceUrlForm=`angle-bracketed`),e.title!==void 0&&e.title!==null&&n[n.length-1]===`)`){let t=n.length-2;for(;t>r+1&&(n[t]===` `||n[t]===` `||n[t]===`
|
|
524
524
|
`);)t--;n[t]===`"`?e.data.sourceTitleMarker=`double`:n[t]===`'`?e.data.sourceTitleMarker=`single`:n[t]===`)`&&(e.data.sourceTitleMarker=`paren`)}}}}break;case`definition`:{let n=t.slice(a,o);if(e.data.sourceLayout=n.includes(`
|
|
525
|
-
`)?`multiline`:`inline`,typeof e.title==`string`&&n.length>0){let t=n[n.length-1];t===`"`?e.data.sourceTitleMarker=`double`:t===`'`?e.data.sourceTitleMarker=`single`:t===`)`&&(e.data.sourceTitleMarker=`paren`)}break}case`mdxJsxFlowElement`:case`mdxJsxTextElement`:case`mdxFlowExpression`:case`mdxTextExpression`:e.data.sourceRaw=t.slice(a,o);break;case`break`:if(e.data.sourceRaw)break;t.slice(a,o).includes(`\\`)?e.data.sourceStyle=`backslash`:e.data.sourceStyle=`spaces`;break}}var
|
|
525
|
+
`)?`multiline`:`inline`,typeof e.title==`string`&&n.length>0){let t=n[n.length-1];t===`"`?e.data.sourceTitleMarker=`double`:t===`'`?e.data.sourceTitleMarker=`single`:t===`)`&&(e.data.sourceTitleMarker=`paren`)}break}case`mdxJsxFlowElement`:case`mdxJsxTextElement`:case`mdxFlowExpression`:case`mdxTextExpression`:e.data.sourceRaw=t.slice(a,o);break;case`break`:if(e.data.sourceRaw)break;t.slice(a,o).includes(`\\`)?e.data.sourceStyle=`backslash`:e.data.sourceStyle=`spaces`;break}}var f4=`(^|\\s)#([a-zA-Z][\\w/-]*)`;function p4(){return new RegExp(f4,`g`)}var m4=p4(),h4=/^[a-zA-Z][\w/-]*$/;function g4(e,t){if(t<=0||e[t-1]!==`\\`)return!1;let n=t-1,r=0;for(;n>=0&&e[n]===`\\`;)r++,n--;return r%2==1}function _4(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value,a=typeof i.position?.start?.offset==`number`?i.position?.start?.offset??0:0;m4.lastIndex=0;let o=[],s=0;for(;;){let n=m4.exec(e);if(n===null)break;let c=n[1]??``,l=n[2]??``,u=n.index+c.length;if(t&&a>=0){let n=a,r=0,i=-1;for(;r<=u&&n<t.length;){let a=t[n]===`\\`&&n+1<t.length&&e[r]===t[n+1],o=a?n+1:n;if(r===u){i=o;break}n=a?n+2:n+1,r+=1}if(i>=0&&g4(t,i))continue}if(u>s){let n={type:`text`,value:e.slice(s,u)},r=g2(t,i,s,u);r&&(n.position=r),o.push(n)}let d={type:`tag`,value:l},f=g2(t,i,u,u+1+l.length);f&&(d.position=f),o.push(d),s=u+1+l.length,r=!0}if(o.length===0)n.push(i);else{if(s<e.length){let n={type:`text`,value:e.slice(s)},r=g2(t,i,s,e.length);r&&(n.position=r),o.push(n)}n.push(...o)}}r&&(e.children=n)}var v4=new Set(`root.paragraph.heading.text.emphasis.strong.blockquote.list.listItem.code.inlineCode.link.image.linkReference.imageReference.definition.html.thematicBreak.break.yaml.toml.table.tableRow.tableCell.delete.footnoteDefinition.footnoteReference.mdxFlowExpression.mdxJsxFlowElement.mdxJsxTextElement.mdxTextExpression.wikiLink.wikiLinkEmbed.tag.math.inlineMath.mark.comment.commentBlock.rawMdxFallbackMdast`.split(`.`));function y4(e,t){if(!e||typeof e!=`object`)return null;if(typeof e.offset==`number`)return e.offset>=0&&e.offset<=t.length?e.offset:null;let{line:n,column:r}=e;if(typeof n!=`number`||typeof r!=`number`||n<1||r<1)return null;let i=0;for(let e=1;e<n;e++){let e=t.indexOf(`
|
|
526
526
|
`,i);if(e===-1)return null;i=e+1}let a=t.indexOf(`
|
|
527
|
-
`,i),o=a===-1?t.length:a,s=i+r-1;return s<=o?s:null}function y4(e,t){if(!e)return null;let n=v4(e.start,t),r=v4(e.end,t);return n===null||r===null||r<n?null:t.slice(n,r)}function b4(e,t){let n=y4(e.position,t);return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:n??``,unresolvedPosition:n===null,position:e.position}}function x4(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``,r=typeof process<`u`&&{}?.OK_DEBUG_POSITION_SLICE===`1`;D(e,(e,t,i)=>{if(i!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!_4.has(e.type)){let r=b4(e,n);return i.children[t]=r,g}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&(s4(t,n),g4(t,n))}if(u4(e,n,r,i),e.type===`heading`&&i!==void 0&&typeof t==`number`){let n=e.position?.end?.line,r=i.children[t+1],a=r?.position?.start?.line;if(r?.type===`paragraph`&&typeof n==`number`&&typeof a==`number`&&a===n+1){let t=e;t.data??={},t.data.sourceContiguousNext=!0}}})}}function S4(e,t){let n={type:`mdxJsxFlowElement`,name:`MermaidFence`,attributes:[{type:`mdxJsxAttribute`,name:`chart`,value:e}],children:[]};return t&&(n.position=t),n}function C4(){return e=>{D(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`mermaid`)return;let r=S4(typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}function w4(e,t){let n=e,r=t;return n.type===`heading`&&n.data?.sourceContiguousNext===!0&&r.type===`paragraph`}var T4=(e,t)=>{if(w4(e,t))return 0;let n=t.data?.sourcePrecedingBlankLines;if(typeof n==`number`&&n>=2)return n;let r=e.position,i=t.position;if(!r||!i)return;let a=i.start.line-r.end.line-1;return a>=1?a:void 0},E4=oL(),D4=TI(),O4=EI();function k4(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===E4)||t.push(E4);let n=e.fromMarkdownExtensions;n.some(e=>e===D4)||n.push(D4);let r=e.toMarkdownExtensions;r.some(e=>e===O4)||r.push(O4)}var A4=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function j4(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`$`)===-1)return;A4.lastIndex=0;let a=[],o;for(;(o=A4.exec(i))!==null;)a.push(o);if(a.length===0)return;let s=[],c=0;for(let t of a){let r=t.index,a=r+t[0].length;if(r>c){let t={type:`text`,value:i.slice(c,r)},a=h2(n,e,c,r);a&&(t.position=a),s.push(t)}let o={type:`inlineMath`,value:t[1]},l=h2(n,e,r,a);l&&(o.position=l),s.push(o),c=a}if(c<i.length){let t={type:`text`,value:i.slice(c)},r=h2(n,e,c,i.length);r&&(t.position=r),s.push(t)}return r.children.splice(t,1,...s),[g,t+s.length]})}}var M4=new Set([`strong`,`emphasis`,`delete`,`link`,`mark`,`comment`]);function N4(e){if(!e||e.type!==`break`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}function P4(e){if(!e||e.type!==`text`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}var F4=/[ \t]+$/,I4=/^[ \t]*$/;function L4(e){return e.some(e=>!(P4(e)&&I4.test(e.value)))}function R4(e,t=!1){for(;e.length>0;){let n=e[e.length-1];if(N4(n)){e.pop();continue}if(n&&M4.has(n.type)&&`children`in n){let t=n.children;if(R4(t,!0),t.length===0){e.pop();continue}}if(!t&&P4(n)&&F4.test(n.value)){let t=n.value.replace(F4,``);if(t.length>0){n.value=t;continue}if(L4(e.slice(0,-1))){e.pop();continue}if(e.every(e=>P4(e)&&I4.test(e.value))){let t=e[0];t.value=t.value.charAt(0),e.splice(1)}}break}}var z4=new Set([`paragraph`,`heading`,`tableCell`]);function B4(e){let t=e=>{if(z4.has(e.type)&&`children`in e&&R4(e.children),`children`in e)for(let n of e.children)t(n)};t(e)}var V4={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[a-zA-Z]`}]};function H4(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===V4)||e.toMarkdownExtensions.push(V4)}var U4=/(?<!\uE102)<br[ \t]*\/?>/g,W4=new Set([`mdxJsxTextElement`,`mdxJsxFlowElement`]);function G4(e,t){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;U4.lastIndex=0;let a=[],o=0;for(;;){let n=U4.exec(e);if(n===null)break;let s=n.index;if(s>o){let n={type:`text`,value:e.slice(o,s)},r=h2(t,i,o,s);r&&(n.position=r),a.push(n)}let c={type:`break`,data:{sourceStyle:`html`,sourceRaw:n[0]}},l=h2(t,i,s,s+n[0].length);l&&(c.position=l),a.push(c),o=s+n[0].length,r=!0}if(a.length===0)n.push(i);else{if(o<e.length){let n={type:`text`,value:e.slice(o)},r=h2(t,i,o,e.length);r&&(n.position=r),a.push(n)}n.push(...a)}}r&&(e.children=n)}function K4(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,e=>{if(W4.has(e.type))return g;let t=e;Array.isArray(t.children)&&G4(e,n)})}}var q4=33,J4=91,Y4=93,X4=124,Z4=35,Q4={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===J4?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===J4?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),c):n(t)}function c(t){return t===null||t===-5||t===-4||t===-3||t===J4?n(t):t===Y4?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===Z4?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===X4?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===J4?n(t):t===Y4?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===X4?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),i++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===J4?n(t):t===Y4?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===Y4?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===Y4?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}},$4={name:`wikiLinkEmbed`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===q4?(e.enter(`wikiLinkEmbed`),e.enter(`wikiLinkEmbedBang`),e.consume(t),e.exit(`wikiLinkEmbedBang`),s):n(t)}function s(t){return t===J4?(e.enter(`wikiLinkMarker`),e.consume(t),c):n(t)}function c(t){return t===J4?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),l):n(t)}function l(t){return t===null||t===-5||t===-4||t===-3||t===J4?n(t):t===Y4?r===0?n(t):(e.exit(`wikiLinkTarget`),f(t)):t===Z4?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),u):t===X4?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),r++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===J4?n(t):t===Y4?i===0?n(t):(e.exit(`wikiLinkAnchor`),f(t)):t===X4?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),i++,u)}function d(t){return t===null||t===-5||t===-4||t===-3||t===J4?n(t):t===Y4?a===0?n(t):(e.exit(`wikiLinkAlias`),f(t)):(e.consume(t),a++,d)}function f(t){return t===Y4?(e.enter(`wikiLinkMarker`),e.consume(t),p):n(t)}function p(r){return r===Y4?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLinkEmbed`),t):n(r)}}};function e3(){return{text:{[J4]:Q4,[q4]:$4}}}function t3(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function n3(e){this.enter({type:`wikiLinkEmbed`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function r3(e){return e.stack[e.stack.length-1]}function i3(e){let t=r3(this),n=this.sliceSerialize(e);t.data.target=n.trim(),n!==t.data.target&&(t.data.sourceTarget=n)}function a3(e){let t=r3(this),n=this.sliceSerialize(e),r=n.trim();t.data.anchor=r.length?r:null,t.data.anchor!==null&&n!==r&&(t.data.sourceAnchor=n)}function o3(e){let t=r3(this),n=this.sliceSerialize(e),r=n.trim();t.data.alias=r.length?r:null,t.data.alias!==null&&n!==r&&(t.data.sourceAlias=n)}function s3(e){let{target:t,anchor:n,alias:r}=e.data,i=r||(n?`${t}#${n}`:t);e.value=i,e.children=[{type:`text`,value:i}]}function c3(e){s3(r3(this)),this.exit(e)}function l3(e){s3(r3(this)),this.exit(e)}var u3={enter:{wikiLink:t3,wikiLinkEmbed:n3},exit:{wikiLinkTarget:i3,wikiLinkAnchor:a3,wikiLinkAlias:o3,wikiLink:c3,wikiLinkEmbed:l3}};function d3(e,t){return typeof e==`string`&&e.trim()===t?e:t}var f3={handlers:{wikiLink:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`[[${d3(t.data?.sourceTarget,n)}`;return r&&(a+=`#${d3(t.data?.sourceAnchor,r)}`),i&&(a+=`|${d3(t.data?.sourceAlias,i)}`),`${a}]]`},wikiLinkEmbed:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`![[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`}},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},p3=e3();function m3(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===p3)||e.micromarkExtensions.push(p3),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===u3)||e.fromMarkdownExtensions.push(u3),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===f3)||e.toMarkdownExtensions.push(f3)}function h3(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}var g3=[{name:`remark-parse`,plugin:ve},{name:`remark-mdx-agnostic`,plugin:k4},{name:`remark-gfm`,plugin:le},{name:`remark-math`,plugin:TF,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:m3},{name:`remark-github-alerts`,plugin:pF,options:d2},{name:`callout-transformer`,plugin:l2},{name:`restore-from-mdx`,plugin:I0},{name:`void-br-promoter`,plugin:K4},{name:`restore-entity-refs`,plugin:q0},{name:`restore-backslash-escapes`,plugin:Z0},{name:`details-accordion-promoter`,plugin:H2},{name:`image-promoter`,plugin:Z2},{name:`indented-code-promoter`,plugin:r4},{name:`math-promoter`,plugin:a4},{name:`single-dollar-math-promoter`,plugin:j4},{name:`highlight-promoter`,plugin:X2},{name:`mermaid-promoter`,plugin:C4},{name:`comment-promoter`,plugin:v2},{name:`merged-post-parse-walker`,plugin:x4},{name:`ensure-non-empty-doc`,plugin:()=>h3}];function _3(e){let t=k();for(let e of g3)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(RP,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function v3(e){let t=k().use(lF,[`yaml`]).use(le,{tablePipeAlign:!1}).use(TF,{singleDollarTextMath:!1}).use(k4).use(m3).use(H4).use(TP,{bullet:`-`,fences:!0,rule:`-`,join:[T4],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function y3(e){return e.charCodeAt(0)===65279?{source:e.slice(1),hadBom:!0}:{source:e,hadBom:!1}}var b3=3,x3=/^\n+$/,S3=/^\n{2,}$/;function C3(e,t,n){let r,i,a,o=e.children;if(o.length>0){let e=o[0]?.position?.start?.offset;if(typeof e==`number`&&e>0){let n=t.slice(0,e);x3.test(n)&&(r=n)}let n=o[o.length-1]?.position?.end?.offset;if(typeof n==`number`&&n<=t.length){let e=t.slice(n);S3.test(e)&&(i=e)}let s=[],c=!1;for(let e=1;e<o.length;e++){let n=o[e-1]?.position?.end?.offset,r=o[e]?.position?.start?.offset,i=null;if(typeof n==`number`&&typeof r==`number`&&r>=n){let e=t.slice(n,r);RegExp(`^\\n{${b3},}$`).test(e)&&(i=e.length-1,c=!0)}s.push(i)}c&&(a=s)}if(!n&&r===void 0&&i===void 0&&!a)return;let s={...n?{bom:!0}:{},...r===void 0?{}:{leading:r},...i===void 0?{}:{trailing:i},...a?{gapBlankLines:a}:{}};return e.data??={},e.data.sourceDocBoundary=s,s}function w3(e){if(typeof e!=`object`||!e)return;let t=e,n={};return t.bom===!0&&(n.bom=!0),typeof t.leading==`string`&&x3.test(t.leading)&&(n.leading=t.leading),typeof t.trailing==`string`&&S3.test(t.trailing)&&(n.trailing=t.trailing),Array.isArray(t.gapBlankLines)&&t.gapBlankLines.every(e=>e===null||typeof e==`number`&&Number.isInteger(e)&&e>=b3-1)&&(n.gapBlankLines=t.gapBlankLines),n.bom||n.leading||n.trailing||n.gapBlankLines?n:void 0}function T3(e,t){let{source:n,hadBom:r}=y3(e),i=j2(n),a=new ie(W0(P0(X0(i)))),o=t.parse(a);a.value=i;let s=t.runSync(o,a),c=C3(s,i,r),l=t.stringify(s);return c?l.type.create({...l.attrs,sourceDocBoundary:c},l.content,l.marks):l}function E3(e,t){let{source:n,hadBom:r}=y3(e),i=j2(n),a=new ie(W0(P0(X0(i)))),o=t.parse(a);a.value=i;let s=t.runSync(o,a);return C3(s,i,r),s}function D3(e,t,n){let r=BP(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});B4(r);let i=w3(e.attrs?.sourceDocBoundary),a=i?.gapBlankLines;if(a&&a.length===r.children.length-1)for(let e=1;e<r.children.length;e++){let t=a[e-1];if(typeof t==`number`){let n=r.children[e];n.data??={},n.data.sourcePrecedingBlankLines=t}}let o=String(t.stringify(r));return i?.leading&&(o=i.leading+o),i?.trailing&&(o=o.replace(/\n+$/,``)+i.trailing),i?.bom&&(o=`\uFEFF${o}`),o}function O3(){return!1}function k3(e){let t=e.lastIndexOf(`/`);return t===-1?``:t===0?`/`:e.slice(0,t)}function A3(e,t){let n=e?`${e}/${t}`:t,r=n.startsWith(`/`),i=[];for(let e of n.split(`/`))if(!(e===``||e===`.`)){if(e===`..`){let e=i[i.length-1];i.length>0&&e!==`..`?i.pop():r||i.push(`..`);continue}i.push(e)}let a=i.join(`/`);return r?`/${a}`:a}function j3(e,t){if(typeof e!=`string`||e===``||!t||e.startsWith(`/`)||!uY(e))return e;let n=A3(k3(t),e);return n===``||n===`..`||n.startsWith(`../`)?(O3()&&console.warn(`[resolve-image-url] doc-relative path escapes contentDir; emitting raw URL: ${e} (from sourcePath ${t})`),e):`/${n}`}var M3=Object.assign(r6,{peek:()=>`$`}),N3=Object.assign(i6,{peek:()=>`~`}),P3=(()=>{for(let e of O4.extensions??[]){let t=e?.handlers?.mdxJsxFlowElement;if(typeof t==`function`)return t}throw Error(`mdast-util-mdx-jsx mdxJsxFlowElement to-markdown handler not found — the dirty MDX JSX serialize path cannot bind. Likely a breaking change in mdast-util-mdx-jsx (pinned in the root overrides); re-run the markdown-pipeline upgrade protocol (test:fidelity).`)})(),F3=/^[ \t]*(?:$|#{1,6}(?:[ \t]|[ \t]*$)|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/,I3={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&KY(e.data.sourceRaw,e.value??``))return e.data.sourceRaw;if(e.data?.escapedChars?.length){let t=e.value??``,i=e.data.escapedChars,a=``,o=0;for(let{offset:e,char:s}of i)e>o&&(a+=q3(n,t.slice(o,e),{...r,before:r.before+a,after:`\\`})),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=q3(n,t.slice(o),{...r,before:r.before+a})),a}return q3(n,e.value??``,r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=e6(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=e6(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`)return`<${e.url??``}>`;if(e.data?.sourceStyle===`gfm-autolink`){let t=e.children?.length===1?e.children[0]:null;if(t?.type===`text`&&typeof t.value==`string`)return t.value}let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`),l=String(e.url??``),u=e.data?.sourceUrlForm===`angle-bracketed`,d=l.startsWith(`<`)&&l.endsWith(`>`),f=u&&!d?`<${l}>`:V3(l);if(s+=i.move(f),c(),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(B3(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(V3(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},definition(e,t,n,r){let i=e.data?.sourceLayout??`inline`,a=e.data?.sourceTitleMarker??`double`,o=n.enter(`definition`),s=n.createTracker(r),c=n.enter(`label`),l=s.move(`[`);l+=s.move(n.safe(n.associationId(e),{before:l,after:`]`,...s.current()})),l+=s.move(`]:`),c();let u=i===`multiline`?`
|
|
528
|
-
`:` `;l+=s.move(u);let d=String(e.url??``);if(!d||/[\0- ]/.test(d)){let e=n.enter(`destinationLiteral`);l+=s.move(`<`),l+=s.move(n.safe(d,{before:l,after:`>`,...s.current()})),l+=s.move(`>`),e()}else{let e=n.enter(`destinationRaw`);l+=s.move(
|
|
529
|
-
`:` `;l+=s.move(
|
|
527
|
+
`,i),o=a===-1?t.length:a,s=i+r-1;return s<=o?s:null}function b4(e,t){if(!e)return null;let n=y4(e.start,t),r=y4(e.end,t);return n===null||r===null||r<n?null:t.slice(n,r)}function x4(e,t){let n=b4(e.position,t);return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:n??``,unresolvedPosition:n===null,position:e.position}}function S4(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``,r=typeof process<`u`&&{}?.OK_DEBUG_POSITION_SLICE===`1`;D(e,(e,t,i)=>{if(i!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!v4.has(e.type)){let r=x4(e,n);return i.children[t]=r,g}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&(c4(t,n),_4(t,n))}if(d4(e,n,r,i),e.type===`heading`&&i!==void 0&&typeof t==`number`){let n=e.position?.end?.line,r=i.children[t+1],a=r?.position?.start?.line;if(r?.type===`paragraph`&&typeof n==`number`&&typeof a==`number`&&a===n+1){let t=e;t.data??={},t.data.sourceContiguousNext=!0}}})}}function C4(e,t){let n={type:`mdxJsxFlowElement`,name:`MermaidFence`,attributes:[{type:`mdxJsxAttribute`,name:`chart`,value:e}],children:[]};return t&&(n.position=t),n}function w4(){return e=>{D(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`mermaid`)return;let r=C4(typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}function T4(e,t){let n=e,r=t;return n.type===`heading`&&n.data?.sourceContiguousNext===!0&&r.type===`paragraph`}var E4=(e,t)=>{if(T4(e,t))return 0;let n=t.data?.sourcePrecedingBlankLines;if(typeof n==`number`&&n>=2)return n;let r=e.position,i=t.position;if(!r||!i)return;let a=i.start.line-r.end.line-1;return a>=1?a:void 0},D4=oL(),O4=TI(),k4=EI();function A4(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===D4)||t.push(D4);let n=e.fromMarkdownExtensions;n.some(e=>e===O4)||n.push(O4);let r=e.toMarkdownExtensions;r.some(e=>e===k4)||r.push(k4)}var j4=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function M4(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`$`)===-1)return;j4.lastIndex=0;let a=[],o;for(;(o=j4.exec(i))!==null;)a.push(o);if(a.length===0)return;let s=[],c=0;for(let t of a){let r=t.index,a=r+t[0].length;if(r>c){let t={type:`text`,value:i.slice(c,r)},a=g2(n,e,c,r);a&&(t.position=a),s.push(t)}let o={type:`inlineMath`,value:t[1]},l=g2(n,e,r,a);l&&(o.position=l),s.push(o),c=a}if(c<i.length){let t={type:`text`,value:i.slice(c)},r=g2(n,e,c,i.length);r&&(t.position=r),s.push(t)}return r.children.splice(t,1,...s),[g,t+s.length]})}}var N4=new Set([`strong`,`emphasis`,`delete`,`link`,`mark`,`comment`]);function P4(e){if(!e||e.type!==`break`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}function F4(e){if(!e||e.type!==`text`)return!1;let t=e.data?.sourceRaw;return typeof t!=`string`||t.length===0}var I4=/[ \t]+$/,L4=/^[ \t]*$/;function R4(e){return e.some(e=>!(F4(e)&&L4.test(e.value)))}function z4(e,t=!1){for(;e.length>0;){let n=e[e.length-1];if(P4(n)){e.pop();continue}if(n&&N4.has(n.type)&&`children`in n){let t=n.children;if(z4(t,!0),t.length===0){e.pop();continue}}if(!t&&F4(n)&&I4.test(n.value)){let t=n.value.replace(I4,``);if(t.length>0){n.value=t;continue}if(R4(e.slice(0,-1))){e.pop();continue}if(e.every(e=>F4(e)&&L4.test(e.value))){let t=e[0];t.value=t.value.charAt(0),e.splice(1)}}break}}var B4=new Set([`paragraph`,`heading`,`tableCell`]);function V4(e){let t=e=>{if(B4.has(e.type)&&`children`in e&&z4(e.children),`children`in e)for(let n of e.children)t(n)};t(e)}var H4={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[a-zA-Z]`}]};function U4(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===H4)||e.toMarkdownExtensions.push(H4)}var W4=/(?<!\uE102)<br[ \t]*\/?>/g,G4=new Set([`mdxJsxTextElement`,`mdxJsxFlowElement`]);function K4(e,t){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;W4.lastIndex=0;let a=[],o=0;for(;;){let n=W4.exec(e);if(n===null)break;let s=n.index;if(s>o){let n={type:`text`,value:e.slice(o,s)},r=g2(t,i,o,s);r&&(n.position=r),a.push(n)}let c={type:`break`,data:{sourceStyle:`html`,sourceRaw:n[0]}},l=g2(t,i,s,s+n[0].length);l&&(c.position=l),a.push(c),o=s+n[0].length,r=!0}if(a.length===0)n.push(i);else{if(o<e.length){let n={type:`text`,value:e.slice(o)},r=g2(t,i,o,e.length);r&&(n.position=r),a.push(n)}n.push(...a)}}r&&(e.children=n)}function q4(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;D(e,e=>{if(G4.has(e.type))return g;let t=e;Array.isArray(t.children)&&K4(e,n)})}}var J4=33,Y4=91,X4=93,Z4=124,Q4=35,$4={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===Y4?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===Y4?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),c):n(t)}function c(t){return t===null||t===-5||t===-4||t===-3||t===Y4?n(t):t===X4?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===Q4?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===Z4?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===Y4?n(t):t===X4?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===Z4?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),i++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===Y4?n(t):t===X4?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===X4?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===X4?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}},e3={name:`wikiLinkEmbed`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===J4?(e.enter(`wikiLinkEmbed`),e.enter(`wikiLinkEmbedBang`),e.consume(t),e.exit(`wikiLinkEmbedBang`),s):n(t)}function s(t){return t===Y4?(e.enter(`wikiLinkMarker`),e.consume(t),c):n(t)}function c(t){return t===Y4?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),l):n(t)}function l(t){return t===null||t===-5||t===-4||t===-3||t===Y4?n(t):t===X4?r===0?n(t):(e.exit(`wikiLinkTarget`),f(t)):t===Q4?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),u):t===Z4?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),r++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===Y4?n(t):t===X4?i===0?n(t):(e.exit(`wikiLinkAnchor`),f(t)):t===Z4?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),i++,u)}function d(t){return t===null||t===-5||t===-4||t===-3||t===Y4?n(t):t===X4?a===0?n(t):(e.exit(`wikiLinkAlias`),f(t)):(e.consume(t),a++,d)}function f(t){return t===X4?(e.enter(`wikiLinkMarker`),e.consume(t),p):n(t)}function p(r){return r===X4?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLinkEmbed`),t):n(r)}}};function t3(){return{text:{[Y4]:$4,[J4]:e3}}}function n3(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function r3(e){this.enter({type:`wikiLinkEmbed`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function i3(e){return e.stack[e.stack.length-1]}function a3(e){let t=i3(this),n=this.sliceSerialize(e);t.data.target=n.trim(),n!==t.data.target&&(t.data.sourceTarget=n)}function o3(e){let t=i3(this),n=this.sliceSerialize(e),r=n.trim();t.data.anchor=r.length?r:null,t.data.anchor!==null&&n!==r&&(t.data.sourceAnchor=n)}function s3(e){let t=i3(this),n=this.sliceSerialize(e),r=n.trim();t.data.alias=r.length?r:null,t.data.alias!==null&&n!==r&&(t.data.sourceAlias=n)}function c3(e){let{target:t,anchor:n,alias:r}=e.data,i=r||(n?`${t}#${n}`:t);e.value=i,e.children=[{type:`text`,value:i}]}function l3(e){c3(i3(this)),this.exit(e)}function u3(e){c3(i3(this)),this.exit(e)}var d3={enter:{wikiLink:n3,wikiLinkEmbed:r3},exit:{wikiLinkTarget:a3,wikiLinkAnchor:o3,wikiLinkAlias:s3,wikiLink:l3,wikiLinkEmbed:u3}};function f3(e,t){return typeof e==`string`&&e.trim()===t?e:t}var p3={handlers:{wikiLink:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`[[${f3(t.data?.sourceTarget,n)}`;return r&&(a+=`#${f3(t.data?.sourceAnchor,r)}`),i&&(a+=`|${f3(t.data?.sourceAlias,i)}`),`${a}]]`},wikiLinkEmbed:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`![[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`}},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},m3=t3();function h3(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===m3)||e.micromarkExtensions.push(m3),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===d3)||e.fromMarkdownExtensions.push(d3),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===p3)||e.toMarkdownExtensions.push(p3)}function g3(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}var _3=[{name:`remark-parse`,plugin:ve},{name:`remark-mdx-agnostic`,plugin:A4},{name:`remark-gfm`,plugin:le},{name:`remark-math`,plugin:TF,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:h3},{name:`remark-github-alerts`,plugin:pF,options:f2},{name:`callout-transformer`,plugin:u2},{name:`restore-from-mdx`,plugin:L0},{name:`void-br-promoter`,plugin:q4},{name:`restore-entity-refs`,plugin:J0},{name:`restore-backslash-escapes`,plugin:Q0},{name:`details-accordion-promoter`,plugin:U2},{name:`image-promoter`,plugin:Q2},{name:`indented-code-promoter`,plugin:i4},{name:`math-promoter`,plugin:o4},{name:`single-dollar-math-promoter`,plugin:M4},{name:`highlight-promoter`,plugin:Z2},{name:`mermaid-promoter`,plugin:w4},{name:`comment-promoter`,plugin:y2},{name:`merged-post-parse-walker`,plugin:S4},{name:`ensure-non-empty-doc`,plugin:()=>g3}];function v3(e){let t=k();for(let e of _3)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(RP,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function y3(e){let t=k().use(lF,[`yaml`]).use(le,{tablePipeAlign:!1}).use(TF,{singleDollarTextMath:!1}).use(A4).use(h3).use(U4).use(TP,{bullet:`-`,fences:!0,rule:`-`,join:[E4],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function b3(e){return e.charCodeAt(0)===65279?{source:e.slice(1),hadBom:!0}:{source:e,hadBom:!1}}var x3=3,S3=/^\n+$/,C3=/^\n{2,}$/;function w3(e,t,n){let r,i,a,o=e.children;if(o.length>0){let e=o[0]?.position?.start?.offset;if(typeof e==`number`&&e>0){let n=t.slice(0,e);S3.test(n)&&(r=n)}let n=o[o.length-1]?.position?.end?.offset;if(typeof n==`number`&&n<=t.length){let e=t.slice(n);C3.test(e)&&(i=e)}let s=[],c=!1;for(let e=1;e<o.length;e++){let n=o[e-1]?.position?.end?.offset,r=o[e]?.position?.start?.offset,i=null;if(typeof n==`number`&&typeof r==`number`&&r>=n){let e=t.slice(n,r);RegExp(`^\\n{${x3},}$`).test(e)&&(i=e.length-1,c=!0)}s.push(i)}c&&(a=s)}if(!n&&r===void 0&&i===void 0&&!a)return;let s={...n?{bom:!0}:{},...r===void 0?{}:{leading:r},...i===void 0?{}:{trailing:i},...a?{gapBlankLines:a}:{}};return e.data??={},e.data.sourceDocBoundary=s,s}function T3(e){if(typeof e!=`object`||!e)return;let t=e,n={};return t.bom===!0&&(n.bom=!0),typeof t.leading==`string`&&S3.test(t.leading)&&(n.leading=t.leading),typeof t.trailing==`string`&&C3.test(t.trailing)&&(n.trailing=t.trailing),Array.isArray(t.gapBlankLines)&&t.gapBlankLines.every(e=>e===null||typeof e==`number`&&Number.isInteger(e)&&e>=x3-1)&&(n.gapBlankLines=t.gapBlankLines),n.bom||n.leading||n.trailing||n.gapBlankLines?n:void 0}function E3(e,t){let{source:n,hadBom:r}=b3(e),i=M2(n),a=new ie(G0(F0(Z0(i)))),o=t.parse(a);a.value=i;let s=t.runSync(o,a),c=w3(s,i,r),l=t.stringify(s);return c?l.type.create({...l.attrs,sourceDocBoundary:c},l.content,l.marks):l}function D3(e,t){let{source:n,hadBom:r}=b3(e),i=M2(n),a=new ie(G0(F0(Z0(i)))),o=t.parse(a);a.value=i;let s=t.runSync(o,a);return w3(s,i,r),s}function O3(e,t,n){let r=BP(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});V4(r);let i=T3(e.attrs?.sourceDocBoundary),a=i?.gapBlankLines;if(a&&a.length===r.children.length-1)for(let e=1;e<r.children.length;e++){let t=a[e-1];if(typeof t==`number`){let n=r.children[e];n.data??={},n.data.sourcePrecedingBlankLines=t}}let o=String(t.stringify(r));return i?.leading&&(o=i.leading+o),i?.trailing&&(o=o.replace(/\n+$/,``)+i.trailing),i?.bom&&(o=`\uFEFF${o}`),o}function k3(){return!1}function A3(e){let t=e.lastIndexOf(`/`);return t===-1?``:t===0?`/`:e.slice(0,t)}function j3(e,t){let n=e?`${e}/${t}`:t,r=n.startsWith(`/`),i=[];for(let e of n.split(`/`))if(!(e===``||e===`.`)){if(e===`..`){let e=i[i.length-1];i.length>0&&e!==`..`?i.pop():r||i.push(`..`);continue}i.push(e)}let a=i.join(`/`);return r?`/${a}`:a}function M3(e,t){if(typeof e!=`string`||e===``||!t||e.startsWith(`/`)||!dY(e))return e;let n=j3(A3(t),e);return n===``||n===`..`||n.startsWith(`../`)?(k3()&&console.warn(`[resolve-image-url] doc-relative path escapes contentDir; emitting raw URL: ${e} (from sourcePath ${t})`),e):`/${n}`}var N3=Object.assign(i6,{peek:()=>`$`}),P3=Object.assign(a6,{peek:()=>`~`}),F3=(()=>{for(let e of k4.extensions??[]){let t=e?.handlers?.mdxJsxFlowElement;if(typeof t==`function`)return t}throw Error(`mdast-util-mdx-jsx mdxJsxFlowElement to-markdown handler not found — the dirty MDX JSX serialize path cannot bind. Likely a breaking change in mdast-util-mdx-jsx (pinned in the root overrides); re-run the markdown-pipeline upgrade protocol (test:fidelity).`)})(),I3=/^[ \t]*(?:$|#{1,6}(?:[ \t]|[ \t]*$)|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/,L3={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&qY(e.data.sourceRaw,e.value??``))return e.data.sourceRaw;if(e.data?.escapedChars?.length){let t=e.value??``,i=e.data.escapedChars,a=``,o=0;for(let{offset:e,char:s}of i)e>o&&(a+=J3(n,t.slice(o,e),{...r,before:r.before+a,after:`\\`})),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=J3(n,t.slice(o),{...r,before:r.before+a})),a}return J3(n,e.value??``,r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=t6(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=t6(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`)return`<${e.url??``}>`;if(e.data?.sourceStyle===`gfm-autolink`){let t=e.children?.length===1?e.children[0]:null;if(t?.type===`text`&&typeof t.value==`string`)return t.value}let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`),l=String(e.url??``),u=e.data?.sourceUrlForm===`angle-bracketed`,d=l.startsWith(`<`)&&l.endsWith(`>`),f=u&&!d?`<${l}>`:H3(l);if(s+=i.move(f),c(),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(V3(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(H3(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},definition(e,t,n,r){let i=e.data?.sourceLayout??`inline`,a=e.data?.sourceTitleMarker??`double`,o=n.enter(`definition`),s=n.createTracker(r),c=n.enter(`label`),l=s.move(`[`);l+=s.move(n.safe(n.associationId(e),{before:l,after:`]`,...s.current()})),l+=s.move(`]:`),c();let u=i===`multiline`?`
|
|
528
|
+
`:` `;l+=s.move(u);let d=String(e.url??``);if(!d||/[\0- ]/.test(d)){let e=n.enter(`destinationLiteral`);l+=s.move(`<`),l+=s.move(n.safe(d,{before:l,after:`>`,...s.current()})),l+=s.move(`>`),e()}else{let e=n.enter(`destinationRaw`);l+=s.move(H3(d)),e()}if(e.title){let t=i===`multiline`?`
|
|
529
|
+
`:` `;l+=s.move(V3(e.title,a,t))}return o(),l},thematicBreak(e){return e.data?.sourceRaw??`---`},break(e,t,n){let r=e.data?.sourceRaw;return typeof r==`string`&&r.length>0?r:n.stack.includes(`tableCell`)||n.stack.includes(`okAtxHeading`)?`<br />`:e.data?.sourceStyle===`backslash`?`\\
|
|
530
530
|
`:`
|
|
531
531
|
`},code(e,t){let n=e.value??``;if(e.data?.sourceStyle===`indented`){let t=n.split(`
|
|
532
532
|
`),r=e.data.sourceIndents;return Array.isArray(r)&&r.length===t.length?t.map((e,t)=>`${r[t]??(e.length>0?` `:``)}${e}`).join(`
|
|
533
533
|
`):t.map(e=>e.length>0?` ${e}`:e).join(`
|
|
534
|
-
`)}let r=e.data?.sourceFenceChar===`~`?`~`:"`",i=
|
|
534
|
+
`)}let r=e.data?.sourceFenceChar===`~`?`~`:"`",i=iQ(r,n,e.data?.sourceFenceLength??3),a=e.data?.sourceClosingFenceLength,o=typeof a==`number`&&a>i?a:i,s=e.data?.sourceFenceIndent,c=typeof s==`number`&&s>=1&&s<=3?` `.repeat(s):``,l=e.data?.sourceInfoPadding,u=r.repeat(i),d=e.lang??``,f=d&&typeof l==`number`&&l>=1?` `.repeat(l):``,p=e.meta?` ${e.meta}`:``;if(e.data?.sourceUnclosedFence===!0&&t?.type===`root`&&t.children[t.children.length-1]===e){let e=`${u}${f}${d}${p}${n.length>0?`\n${n}`:``}`;return c?e.split(`
|
|
535
535
|
`).map(e=>e.length>0?`${c}${e}`:e).join(`
|
|
536
536
|
`):e}let m=`${u}${f}${d}${p}\n${n}\n${r.repeat(o)}`;return c?m.split(`
|
|
537
537
|
`).map(e=>e.length>0?`${c}${e}`:e).join(`
|
|
538
|
-
`):m},inlineCode(e,t,n){let r=e.value??``,i=e.data?.sourceFenceChar===`~`?`~`:"`",a=typeof e.data?.sourceFenceLength==`number`&&e.data.sourceFenceLength>0?e.data.sourceFenceLength:1,o=i==="`"?"`":`~`,s=a;for(;RegExp(`(^|[^${o}])${o.repeat(s)}([^${o}]|$)`).test(r);)s+=1;let c=i.repeat(s);/[^ \r\n]/.test(r)&&(e.data?.sourcePadded===!0||/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||r.startsWith(i)||r.endsWith(i))&&(r=` ${r} `);let l=`${c}${r}${c}`;return n.stack.includes(`tableCell`)?l.replace(/\|/g,`\\$&`):l},inlineMath:
|
|
538
|
+
`):m},inlineCode(e,t,n){let r=e.value??``,i=e.data?.sourceFenceChar===`~`?`~`:"`",a=typeof e.data?.sourceFenceLength==`number`&&e.data.sourceFenceLength>0?e.data.sourceFenceLength:1,o=i==="`"?"`":`~`,s=a;for(;RegExp(`(^|[^${o}])${o.repeat(s)}([^${o}]|$)`).test(r);)s+=1;let c=i.repeat(s);/[^ \r\n]/.test(r)&&(e.data?.sourcePadded===!0||/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||r.startsWith(i)||r.endsWith(i))&&(r=` ${r} `);let l=`${c}${r}${c}`;return n.stack.includes(`tableCell`)?l.replace(/\|/g,`\\$&`):l},inlineMath:N3,delete:P3,heading(e,t,n,r){let i=e.data?.sourceStyle??`atx`,a=e.depth;if(i===`setext`&&(a===1||a===2)){let t=n.containerPhrasing(e,{...r,before:`
|
|
539
539
|
`,after:`
|
|
540
540
|
`}),i=e.data?.sourceUnderlineLength,o=typeof i==`number`&&i>=1?i:Math.max(t.length,3);return`${t}\n${(a===1?`=`:`-`).repeat(o)}`}let o=e.data?.sourceLeadingIndent,s=typeof o==`number`&&o>=1&&o<=3?` `.repeat(o):``,c=e.data?.sourceInteriorSpacing,l=typeof c==`number`&&c>=2?` `.repeat(c):` `,u=`#`.repeat(a),d=n.enter(`okAtxHeading`),f=n.containerPhrasing(e,{...r,before:`${u} `,after:`
|
|
541
541
|
`});d();let p=e.data?.sourceTrailingHashes;if(typeof p==`number`&&p>0){let e=`#`.repeat(p);return f?`${s}${u}${l}${f} ${e}`:`${s}${u} ${e}`}return f?`${s}${u}${l}${f}`:`${s}${u}`},list(e,t,n,r){let i=n.options.bullet||`-`,a=!!e.ordered,o=n.bulletCurrent,s=n.bulletLastUsed;if(!a){let t=e.data?.bulletMarker;(t===`-`||t===`*`||t===`+`)&&(n.bulletCurrent=t)}let c=e.children||[],l=[],u=a?e.data?.listMarkerDelimiter??`.`:null,d=e.start??1;for(let t=0;t<c.length;t++){let o=c[t],s=o.data?.sourceOrdinal,f=typeof s==`number`&&s>=0?s:d+t,p=a?`${f}${u}`:e.data?.bulletMarker??i,m=o.data?.sourceMarkerSpacing,h=typeof m==`number`&&m>=2&&m<=4?m:1,g=` `.repeat(h),_=p;o.checked===!0?_+=`${g}[${o.data?.sourceCheckboxChar===`X`?`X`:`x`}]`:o.checked===!1&&(_+=`${g}[ ]`);let v=o.data?.sourceContinuationIndent,y=p.length+h,b=typeof v==`number`&&v>=y&&v<=y+3?v:y,x=` `.repeat(b),S=o.checked===null||o.checked===void 0?g:` `,C=o.children??[],w=C[0]?.type===`list`,T;if(w){let e=o.checked!==null&&o.checked!==void 0,t=n.containerFlow({...o,children:[C[0]]},r),i=C.slice(1),a=i.length?n.containerFlow({...o,children:i},r):``,s=t.split(`
|
|
@@ -549,17 +549,17 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
549
549
|
|
|
550
550
|
`:`
|
|
551
551
|
`;return l.join(f)},table(e,t,n,r){let i=n.enter(`table`),a=[],o=[],s=e.children??[];for(let e of s){let t=e.children??[],i=[],s=[];for(let e of t){let t=n.enter(`tableCell`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,{...r,before:` `,after:` `});a(),t(),i.push(o);let c=e.data?.sourcePadding;s.push(c&&typeof c.left==`number`&&typeof c.right==`number`?{left:c.left,right:c.right}:null)}a.push(i),o.push(s)}i();let c=e.align??[],l=e.data?.sourceDashCounts,u=a[0]?.length??0,d=a.slice(1).reduce((e,t)=>Math.max(e,t.length),0),f=Math.max(u,d,c.length);if(f===0)return console.warn(JSON.stringify({event:`table-serialize-dropped-empty`,rows:s.length})),``;let p=[];for(let e=0;e<f;e++){let t=c[e],n=``,r=``;t===`center`?(n=`:`,r=`:`):t===`left`?n=`:`:t===`right`&&(r=`:`);let i=l?.[e],a=typeof i==`number`&&i>=1?i:1;p.push(n+`-`.repeat(a)+r)}let m=(e,t)=>{let n=[];for(let r=0;r<f;r++){let i=e[r]??``,a=t[r]??{left:1,right:1};n.push(` `.repeat(a.left)+i+` `.repeat(a.right))}let r=v&&!v.leading?``:`|`,i=v&&!v.trailing?``:`|`;return`${r}${n.join(`|`)}${i}`},h=e.data?.sourceAlignmentPadding,g=Array.from({length:f},(e,t)=>{let n=h?.[t];return n&&typeof n.left==`number`&&typeof n.right==`number`?n:null}),_=e.data?.sourceOuterPipes,v=_&&f>=2&&a.every(e=>{let t=(e[0]??``).trim(),n=(e[f-1]??``).trim();return(_.leading||t.length>0)&&(_.trailing||n.length>0&&!n.endsWith(`\\`))})?_:null;if(a.length===0)return m(p,g);let y=[];y.push(m(a[0],o[0]??[])),y.push(m(p,g));for(let e=1;e<a.length;e++)y.push(m(a[e],o[e]??[]));return y.join(`
|
|
552
|
-
`)},mdxJsxFlowElement(e,t,n,r){let i=e,a=i.data?.sourceRaw;if(typeof a==`string`)return a;let o=i.data?.htmlBoundary;if(o&&typeof o.opener==`string`&&typeof o.closer==`string`){let e=n.containerFlow({type:`root`,children:i.children??[]},r);return`${o.opener}\n\n${e}\n\n${o.closer}`}let s=i.name??``,c=
|
|
553
|
-
]|$)`};return delete t._compiled,t});let i;try{i=e.safe(
|
|
554
|
-
`||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function $3(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&Q3(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=Z3(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function e6(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=t.before??``,a=t.after??``,o=e,s=o.charCodeAt(0);t6(i.charCodeAt(i.length-1),s,r)&&(o=n6(s)+o.slice(1));let c=o.charCodeAt(o.length-1);return t6(a.charCodeAt(0),c,r)&&(o=o.slice(0,-1)+n6(c)),o}function t6(e,t,n){return!(m(t)!==J3||n===`_`&&m(e)===void 0)}function n6(e){return`&#x${e.toString(16).toUpperCase()};`}function r6(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!a6(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function i6(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=e6(n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),r,i),s+=a.move(i),o(),s}function a6(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function o6(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var s6=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};freshnessHolder={checker:void 0};constructor(e){this.schema=hC(e.extensions),this.handlers=_6(this.schema,this.parseCtx),this.freshnessHolder.checker=e.deriveStructuralFreshness?F$({parse:e=>this.parseWithFallback(e)}):void 0;let{nodeHandlers:t,markHandlers:n}=v6(this.schema,this.freshnessHolder);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=_3({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=v3({toMarkdownHandlers:I3})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return T3(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?E3(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?X1(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e,t){let n;try{n=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}let r=this.freshnessHolder.checker;t?.skipFreshnessDerive&&(this.freshnessHolder.checker=void 0);try{return D3(n,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}finally{this.freshnessHolder.checker=r}}},c6=D1();function l6(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function u6(e){let t=!1;return e.descendants(e=>t||e.type.name===`jsxInline`?!1:e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function d6(e,t){return e.attrs.sourceDirty||u6(e)?!0:t?t.isDiverged(e.toJSON()):!1}function f6(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function p6(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function m6(e,t){if(e.length===0)return p6({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return p6({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[m6(n.children,t)]}}return p6({type:`inlineCode`,value:h6(e)},t)}function h6(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=h6(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var g6=Pd;function _6(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=FP(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=FP(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=j3(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i)return r.sourceLiteral?e.text(n,[r.sourceLiteral.create({sourceRaw:i})]):e.text(n);let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n);let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&WY(t.raw)!==null&&VY(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=WY(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=IP(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=IP(r.highlight)),r.comment&&(i.comment=IP(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=FP(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=IP(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=IP(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=FP(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceUnclosedFence:t.data?.sourceUnclosedFence??!1,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`,sourceRaw:e.data?.sourceRaw??null})),n.list&&(i.list=FP(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=FP(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:``,title:null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=c6.getOrWildcard(o),c=l6(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=j3(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=oX(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&g6.has(l)&&n.jsxComponent&&c6.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&Fd.has(l)&&n.jsxComponent&&c6.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&Ld.has(l)&&n.jsxComponent&&c6.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&Rd.has(l)&&n.jsxComponent&&c6.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:o6(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``,sourceDelimiter:e.data?.sourceDelimiter??null})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=FP(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function v6(e,t){let n={},r={},i=e.nodes,a=e.marks;i.paragraph&&(n.paragraph=VP(`paragraph`)),i.blockquote&&(n.blockquote=VP(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),i.heading&&(n.heading=VP(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),i.codeBlock&&(n.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceUnclosedFence:e.attrs.sourceUnclosedFence===!0?!0:void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),i.thematicBreak&&(n.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),i.hardBreak&&(n.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle,...typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0?{sourceRaw:e.attrs.sourceRaw}:{}}})),i.list&&(n.list=VP(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),i.listItem&&(n.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&f6(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},children:i}}),i.table&&(n.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c={};Array.isArray(s)&&s.length>0&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),i.tableRow&&(n.tableRow=VP(`tableRow`));let o=(e,t)=>{let n={type:`tableCell`,children:t$(t)},r=e.attrs.sourcePadding;return typeof r==`object`&&r&&typeof r.left==`number`&&typeof r.right==`number`&&(n.data={sourcePadding:r}),n};if(i.tableCell&&(n.tableCell=(e,t,n)=>o(e,n.all(e))),i.tableHeader&&(n.tableHeader=(e,t,n)=>o(e,n.all(e))),i.image&&(n.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),i.imageReference&&(n.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),i.htmlBlock&&(n.htmlBlock=e=>({type:`html`,value:e.attrs.content})),i.linkDefinition??i.linkRefDef){let e=i.linkDefinition?`linkDefinition`:`linkRefDef`;n[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(i.jsxComponent&&(n.jsxComponent=(e,n,r)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let i=e.attrs.componentName||null,a=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!d6(e,t.checker)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:i,attributes:a,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:c6.getOrWildcard(i??`*`).serialize(e,{all:e=>r.all(e),registry:c6,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),i.rawMdxFallback&&(n.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),i.jsxInline&&(n.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),i.mathInline&&(n.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),i.wikiLink&&(n.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},children:[{type:`text`,value:i}]}}),i.tag&&(n.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),i.wikiLinkEmbed&&(n.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),a.emphasis&&(r.emphasis=HP(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.strong&&(r.strong=HP(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.code&&(r.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return m6(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),a.strike??a.delete){let e=a.strike?`strike`:`delete`;r[e]=HP(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return a.highlight&&(r.highlight=HP(`mark`)),a.comment&&(r.comment=HP(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),i.commentBlock&&(n.commentBlock=VP(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),i.footnoteReference&&(n.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),i.footnoteDefinition&&(n.footnoteDefinition=VP(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),a.link&&(r.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),a.escapeMark&&(r.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data??={},t.data.escapedChars??=[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),a.sourceLiteral&&(r.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return KY(t,e.value)&&(e.data??={},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:n,markHandlers:r}}var y6={default:!0,MD013:!1};function b6(e){return e??y6}function x6(e){let t=e.replace(/\\/g,`/`);for(;t.startsWith(`./`);)t=t.slice(2);let n=t.toLowerCase();for(let e of bJ)if(n.endsWith(e))return t.slice(0,-e.length);return t}function S6(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[],i=[],a=[],o=0;for(let e of t){let t=e.startsWith(`!`),s=t?e.slice(1):e;if(t||(o+=1),s.length===0){n.push({pattern:e,detail:`empty pattern`});continue}try{let e=(0,qR.default)(s,{dot:!0,strictBrackets:!0});(t?a:i).push(e)}catch(t){n.push({pattern:e,detail:t instanceof Error?t.message:String(t)});continue}if(s.endsWith(`/`))r.push({pattern:e,reason:`trailing-slash`});else if(s.startsWith(`/`))r.push({pattern:e,reason:`leading-slash`});else{let t=s.toLowerCase();bJ.some(e=>t.endsWith(e))&&r.push({pattern:e,reason:`doc-extension`})}}let s=o===0;return{invalidPatterns:n,suspiciousPatterns:r,matches(e){if(e===void 0||e===``)return!1;let t=x6(e);return t===``||!(s||i.some(e=>e(t)))?!1:!a.some(e=>e(t))}}}var C6=/[*?[\]{}()+@!|]/;function w6(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);if(n===-1||e.indexOf(`{`,t+1)!==-1||e.indexOf(`}`,n+1)!==-1)return null;let r=e.slice(t+1,n).split(`,`);return r.length<2||r.some(e=>e.trim()===``||C6.test(e))?null:r.map(r=>e.slice(0,t)+r+e.slice(n+1))}function T6(e){if(e.endsWith(`/`)||e.startsWith(`/`))return{kind:`matches-nothing`,pattern:e};try{(0,qR.default)(e,{dot:!0,strictBrackets:!0})}catch{return{kind:`invalid`,pattern:e}}if(e===`**`||e===`**/*`)return{kind:`everything`};{let t=e.match(/^\*\*\/(.+)\/\*\*$/)?.[1];if(t!==void 0&&!C6.test(t))return{kind:`folder-anywhere`,folder:t};let n=e.match(/^(.+)\/\*\*\/(.+)\/\*\*$/),r=n?.[1],i=n?.[2];if(r!==void 0&&i!==void 0&&!C6.test(r)&&!C6.test(i))return{kind:`folder-recursive-nested`,root:r,folder:i}}for(let t of[`/**/*`,`/**`])if(e.endsWith(t)){let n=e.slice(0,-t.length);if(n.length>0&&!C6.test(n))return{kind:`folder-recursive`,folder:n}}if(e.endsWith(`/*`)){let t=e.slice(0,-2);if(t.length>0&&!C6.test(t))return{kind:`folder-direct`,folder:t}}if(e.startsWith(`**/`)){let t=e.slice(3);if(t.length>0&&!t.includes(`/`)&&!C6.test(t))return{kind:`name-anywhere`,name:t}}return C6.test(e)?{kind:`pattern`,pattern:e}:{kind:`exact`,target:e}}function E6(e){let t=T6(e);if(t.kind!==`pattern`)return[t];let n=w6(e);if(n!==null){let e=n.map(T6);if(e.every(e=>e.kind!==`pattern`))return e}return[t]}function D6(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[];for(let e of t){let t=e.startsWith(`!`),i=t?e.slice(1):e;i.length!==0&&(t?r:n).push(...E6(i))}return{includes:n,excludes:r}}function O6(e,t){let n=new Set,r=[];for(let i of e){if(i.enabled===!1||!i.schema||!S6(i.appliesTo).matches(t))continue;let e=i.key??i.file;n.has(e)||(n.add(e),r.push({file:i.file,schema:i.schema}))}return r}var k6=[`http://json-schema.org/draft-07/schema#`,`http://json-schema.org/draft-07/schema`,`https://json-schema.org/draft-07/schema#`,`https://json-schema.org/draft-07/schema`];function A6(e){let t=e.$schema;return t===void 0?!0:typeof t==`string`&&k6.includes(t)}var j6=null;function M6(){return j6||(j6=new GR.default({allErrors:!0,strict:!1}),(0,KR.default)(j6)),j6}var N6=new Map,P6=256;function F6(e){let t=JSON.stringify(e),n=N6.get(t);if(n!==void 0)return n;let r=null;if(A6(e)){let{$schema:t,...n}=e;try{r=M6().compile(n)}catch{r=null}}return N6.size>=P6&&N6.clear(),N6.set(t,r),r}function I6(e){let t=new Map;if(!JJ.test(e))return{data:{},keyLines:t};let{frontmatter:n}=XJ(e),r=QJ(n);if(r.trim()===``)return{data:{},keyLines:t};let i=Ti(r,{uniqueKeys:!1});if(i.errors.length>0)return{data:{},keyLines:t};let a=i.toJS();if(typeof a!=`object`||!a||Array.isArray(a))return{data:{},keyLines:t};if(Ke(i.contents))for(let e of i.contents.items){let n=e.key;if(!Je(n)||typeof n.value!=`string`||!n.range)continue;let i=0,a=Math.min(n.range[0],r.length);for(let e=0;e<a;e++)r.charCodeAt(e)===10&&i++;t.has(n.value)||t.set(n.value,i+1)}return{data:a,keyLines:t}}function L6(e){if(e===void 0)return``;let t;if(typeof e==`string`)t=`"${e}"`;else try{t=JSON.stringify(e)??String(e)}catch{t=String(e)}return t.length>60&&(t=`${t.slice(0,57)}…`),` (got ${t})`}function R6(e){if(!e.startsWith(`/`))return null;let t=e.slice(1).split(`/`)[0]??``;return t===``?null:t.replace(/~1/g,`/`).replace(/~0/g,`~`)}function z6(e){return e.split(`/`).slice(1).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`)).join(`.`)}function B6(e,t){if(t.length===0)return[];let{data:n,keyLines:r}=I6(e),i=e.split(`
|
|
555
|
-
`),a=e=>({start:{line:e,character:0},end:{line:e,character:i[e]?.length??0}}),o=[];for(let{schema:e}of t){let t=
|
|
556
|
-
`),i=W6(t);return n.map(e=>K6(e,r,G6(e,i)))}function W6(e){let t=new Map;return Object.entries(e).forEach(([e,n],r)=>{let i=e.toUpperCase();if(i===`DEFAULT`)return;let a=null;if(n===`error`||n===`warning`)a=n;else if(typeof n==`object`&&n&&!Array.isArray(n)){let e=n.severity;(e===`error`||e===`warning`)&&(a=e)}a!==null&&t.set(i,{entryIndex:r,severity:a})}),t}function G6(e,t){let n;for(let r of e.ruleNames){let e=t.get(r.toUpperCase());e!==void 0&&(n===void 0||e.entryIndex>n.entryIndex)&&(n=e)}return n?.severity??`warning`}function K6(e,t,n){let[r,i]=e.errorRange??[1,null],a=e.lineNumber-1,o=(r??1)-1,s=t[a]?.length??0,c=i==null?s:Math.min(o+i,s),l=e.fixInfo?[q6(e.fixInfo,e.lineNumber,t)]:void 0;return{range:{start:{line:a,character:o},end:{line:a,character:Math.max(c,o)}},severity:n,source:`markdownlint`,code:e.ruleNames[0]??`MD000`,message:e.errorDetail?`${e.ruleDescription}: ${e.errorDetail}`:e.ruleDescription,...l?{fixes:l}:{}}}function q6(e,t,n){let r=e.lineNumber??t,i=r-1;if(e.deleteCount===-1){if(r<n.length)return{range:{start:{line:i,character:0},end:{line:i+1,character:0}},newText:``};if(i>0){let e=n[i-1]?.length??0;return{range:{start:{line:i-1,character:e},end:{line:i,character:n[i]?.length??0}},newText:``}}return{range:{start:{line:0,character:0},end:{line:0,character:n[0]?.length??0}},newText:``}}let a=(e.editColumn??1)-1;return{range:{start:{line:i,character:a},end:{line:i,character:a+Math.max(0,e.deleteCount??0)}},newText:e.insertText??``}}var J6=Ou([R(),V(cf),Pu(I(),xu())]),Y6={id:`markdownlint`,sliceSchema:B({enabled:R(),rules:Pu(I(),J6)}),defaultSlice:{enabled:!1,rules:y6},async lint(e,t){return U6(e,b6(t.rules))},fix(e,t){return H6(e,b6(t.rules))}},X6=B({appliesTo:Ou([I(),z(I())]).optional(),file:I(),enabled:R().optional(),key:I().optional(),schema:Pu(I(),xu()).optional()}),Z6=[Y6,{id:`frontmatter`,sliceSchema:B({enabled:R(),schemas:z(X6)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return B6(e,O6(t.schemas,n.docName))}}],Q6={enabled:!0,plugins:Object.fromEntries(Z6.map(e=>[e.id,e.defaultSlice]))},$6=new Set([`.markdownlint.json`,`.markdownlint.jsonc`]);function e8(e){return $6.has(e)}function t8(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??y6},frontmatter:{enabled:e.frontmatter?.enabled??!1,schemas:e.frontmatter?.schemas??[]}}}}var n8=Object.fromEntries(Z6.map(e=>[e.id,e.sliceSchema])),r8=B({effective:B({enabled:R(),plugins:B(n8)}),configFile:I().nullable().optional(),configProblems:z(I()).optional()}),i8=Ou([R(),Pu(I(),xu())]);B({ruleId:I().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:Ou([i8,yu()])}),B({file:I().min(1).max(512),delete:H(!0).optional(),field:I().min(1).max(256).optional(),parentPath:z(Ou([I().min(1).max(256),B({items:H(!0)}).strict()])).max(8).optional(),removeField:H(!0).optional(),renameTo:I().min(1).max(256).optional(),constraint:B({type:V([`string`,`number`,`boolean`,`array`,`object`]).nullable().optional(),enum:z(Ou([I(),L(),R()])).nullable().optional(),itemsEnum:z(Ou([I(),L(),R()])).nullable().optional(),itemsType:V([`string`,`number`,`boolean`,`object`]).nullable().optional(),pattern:I().nullable().optional(),format:I().nullable().optional(),description:I().max(2048).nullable().optional(),required:R().optional()}).optional()}).refine(e=>e.delete===void 0||e.field===void 0&&e.constraint===void 0&&e.removeField===void 0&&e.renameTo===void 0,{message:`delete cannot be combined with a field edit`}).refine(e=>[e.constraint,e.removeField,e.renameTo].filter(e=>e!==void 0).length<=1,{message:`constraint, removeField, and renameTo are mutually exclusive`}).refine(e=>e.removeField===void 0&&e.renameTo===void 0||e.field!==void 0,{message:`removeField and renameTo require field`}).refine(e=>e.parentPath===void 0||e.field!==void 0,{message:`parentPath requires field`}).refine(e=>e.field===void 0?e.constraint===void 0:e.constraint!==void 0||e.removeField!==void 0||e.renameTo!==void 0,{message:`field requires constraint, removeField, or renameTo`});var a8=B({schemas:z(I()),truncated:R()}).strict(),o8=B({line:L(),character:L()}),s8=B({start:o8,end:o8}),c8=B({range:s8,severity:V([`error`,`warning`,`info`,`hint`]),source:I(),code:I(),message:I(),fixes:z(B({range:s8,newText:I()})).optional()});B({files:z(B({file:I(),diagnostics:z(c8),warnings:z(I()).optional()})),fileCount:L(),errorCount:L(),warningCount:L(),warnings:z(I())});var l8=c8.extend({linkTarget:I().optional()}),u8=B({files:z(B({file:I(),diagnostics:z(l8)})),fileCount:L(),errorCount:L(),warningCount:L(),warnings:z(I())});B({docName:AZ,summary:NZ,...MZ}).loose();var d8=B({file:I(),fixedCount:L(),diagnostics:z(c8),errorCount:L(),warningCount:L(),warning:I().optional()});function f8(e){let t=e.trim().replace(/^\.\//,``);if(!t.startsWith(`.ok/schemas/`))return!1;let n=t.slice(12);return n.length>0&&!n.includes(`/`)&&!n.includes(`\\`)&&n!==`.`&&n!==`..`}function p8(e){let t=e.trim().toLowerCase().split(`/`).pop()??``;return t.endsWith(`.schema.json`)&&t.length>12?!0:f8(e)&&t.endsWith(`.json`)}var m8=[{id:`MD001`,alias:`heading-increment`,aliases:[`heading-increment`],name:`Heading levels should only increment by one level at a time`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md001.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`}]},{id:`MD003`,alias:`heading-style`,aliases:[`heading-style`],name:`Heading style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md003.md`,tags:[`headings`],options:[{key:`style`,type:`enum`,description:`Heading style`,enum:[`consistent`,`atx`,`atx_closed`,`setext`,`setext_with_atx`,`setext_with_atx_closed`],default:`consistent`}]},{id:`MD004`,alias:`ul-style`,aliases:[`ul-style`],name:`Unordered list style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md004.md`,tags:[`bullet`,`ul`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`consistent`,`asterisk`,`plus`,`dash`,`sublist`],default:`consistent`}]},{id:`MD005`,alias:`list-indent`,aliases:[`list-indent`],name:`Inconsistent indentation for list items at the same level`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md005.md`,tags:[`bullet`,`ul`,`indentation`],options:[]},{id:`MD007`,alias:`ul-indent`,aliases:[`ul-indent`],name:`Unordered list indentation`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md007.md`,tags:[`bullet`,`ul`,`indentation`],options:[{key:`indent`,type:`integer`,description:`Spaces for indent`,default:2,minimum:1},{key:`start_indented`,type:`boolean`,description:`Whether to indent the first level of the list`,default:!1},{key:`start_indent`,type:`integer`,description:`Spaces for first level indent (when start_indented is set)`,default:2,minimum:1}]},{id:`MD009`,alias:`no-trailing-spaces`,aliases:[`no-trailing-spaces`],name:`Trailing spaces`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md009.md`,tags:[`whitespace`],options:[{key:`br_spaces`,type:`integer`,description:`Spaces for line break`,default:2,minimum:0},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!1},{key:`list_item_empty_lines`,type:`boolean`,description:`Allow spaces for empty lines in list items`,default:!1},{key:`strict`,type:`boolean`,description:`Include unnecessary breaks`,default:!1}]},{id:`MD010`,alias:`no-hard-tabs`,aliases:[`no-hard-tabs`],name:`Hard tabs`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md010.md`,tags:[`whitespace`,`hard_tab`],options:[{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`ignore_code_languages`,type:`string-array`,description:`Fenced code languages to ignore`,default:[]},{key:`spaces_per_tab`,type:`integer`,description:`Number of spaces for each hard tab`,default:1,minimum:0}]},{id:`MD011`,alias:`no-reversed-links`,aliases:[`no-reversed-links`],name:`Reversed link syntax`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md011.md`,tags:[`links`],options:[]},{id:`MD012`,alias:`no-multiple-blanks`,aliases:[`no-multiple-blanks`],name:`Multiple consecutive blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md012.md`,tags:[`whitespace`,`blank_lines`],options:[{key:`maximum`,type:`integer`,description:`Consecutive blank lines`,default:1,minimum:1}]},{id:`MD013`,alias:`line-length`,aliases:[`line-length`],name:`Line length`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md013.md`,tags:[`line_length`],options:[{key:`line_length`,type:`integer`,description:`Number of characters`,default:80,minimum:1},{key:`heading_line_length`,type:`integer`,description:`Number of characters for headings`,default:80,minimum:1},{key:`code_block_line_length`,type:`integer`,description:`Number of characters for code blocks`,default:80,minimum:1},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`tables`,type:`boolean`,description:`Include tables`,default:!0},{key:`headings`,type:`boolean`,description:`Include headings`,default:!0},{key:`strict`,type:`boolean`,description:`Strict length checking`,default:!1},{key:`stern`,type:`boolean`,description:`Stern length checking`,default:!1}]},{id:`MD014`,alias:`commands-show-output`,aliases:[`commands-show-output`],name:`Dollar signs used before commands without showing output`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md014.md`,tags:[`code`],options:[]},{id:`MD018`,alias:`no-missing-space-atx`,aliases:[`no-missing-space-atx`],name:`No space after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md018.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD019`,alias:`no-multiple-space-atx`,aliases:[`no-multiple-space-atx`],name:`Multiple spaces after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md019.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD020`,alias:`no-missing-space-closed-atx`,aliases:[`no-missing-space-closed-atx`],name:`No space inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md020.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD021`,alias:`no-multiple-space-closed-atx`,aliases:[`no-multiple-space-closed-atx`],name:`Multiple spaces inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md021.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD022`,alias:`blanks-around-headings`,aliases:[`blanks-around-headings`],name:`Headings should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md022.md`,tags:[`headings`,`blank_lines`],options:[{key:`include_front_matter`,type:`boolean`,description:`Include front matter content`,default:!1},{key:`lines_above`,type:`unsupported`,description:`Blank lines above heading`,default:1},{key:`lines_below`,type:`unsupported`,description:`Blank lines below heading`,default:1}]},{id:`MD023`,alias:`heading-start-left`,aliases:[`heading-start-left`],name:`Headings must start at the beginning of the line`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md023.md`,tags:[`headings`,`spaces`],options:[]},{id:`MD024`,alias:`no-duplicate-heading`,aliases:[`no-duplicate-heading`],name:`Multiple headings with the same content`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md024.md`,tags:[`headings`],options:[{key:`siblings_only`,type:`boolean`,description:`Only check sibling headings`,default:!1}]},{id:`MD025`,alias:`single-title`,aliases:[`single-title`,`single-h1`],name:`Multiple top-level headings in the same document`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md025.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD026`,alias:`no-trailing-punctuation`,aliases:[`no-trailing-punctuation`],name:`Trailing punctuation in heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md026.md`,tags:[`headings`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!。,;:!`}]},{id:`MD027`,alias:`no-multiple-space-blockquote`,aliases:[`no-multiple-space-blockquote`],name:`Multiple spaces after blockquote symbol`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md027.md`,tags:[`indentation`,`whitespace`,`blockquote`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD028`,alias:`no-blanks-blockquote`,aliases:[`no-blanks-blockquote`],name:`Blank line inside blockquote`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md028.md`,tags:[`whitespace`,`blockquote`],options:[]},{id:`MD029`,alias:`ol-prefix`,aliases:[`ol-prefix`],name:`Ordered list item prefix`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md029.md`,tags:[`ol`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`one`,`ordered`,`one_or_ordered`,`zero`],default:`one_or_ordered`}]},{id:`MD030`,alias:`list-marker-space`,aliases:[`list-marker-space`],name:`Spaces after list markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md030.md`,tags:[`ul`,`whitespace`,`ol`],options:[{key:`ul_single`,type:`integer`,description:`Spaces for single-line unordered list items`,default:1,minimum:1},{key:`ol_single`,type:`integer`,description:`Spaces for single-line ordered list items`,default:1,minimum:1},{key:`ul_multi`,type:`integer`,description:`Spaces for multi-line unordered list items`,default:1,minimum:1},{key:`ol_multi`,type:`integer`,description:`Spaces for multi-line ordered list items`,default:1,minimum:1}]},{id:`MD031`,alias:`blanks-around-fences`,aliases:[`blanks-around-fences`],name:`Fenced code blocks should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md031.md`,tags:[`blank_lines`,`code`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD032`,alias:`blanks-around-lists`,aliases:[`blanks-around-lists`],name:`Lists should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md032.md`,tags:[`bullet`,`ul`,`blank_lines`,`ol`],options:[]},{id:`MD033`,alias:`no-inline-html`,aliases:[`no-inline-html`],name:`Inline HTML`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md033.md`,tags:[`html`],options:[{key:`allowed_elements`,type:`string-array`,description:`Allowed elements`,default:[]},{key:`table_allowed_elements`,type:`string-array`,description:`Allowed elements in tables`,default:[]}]},{id:`MD034`,alias:`no-bare-urls`,aliases:[`no-bare-urls`],name:`Bare URL used`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md034.md`,tags:[`links`,`url`],options:[]},{id:`MD035`,alias:`hr-style`,aliases:[`hr-style`],name:`Horizontal rule style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md035.md`,tags:[`hr`],options:[{key:`style`,type:`string`,description:`Horizontal rule style`,default:`consistent`}]},{id:`MD036`,alias:`no-emphasis-as-heading`,aliases:[`no-emphasis-as-heading`],name:`Emphasis used instead of a heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md036.md`,tags:[`headings`,`emphasis`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!?。,;:!?`}]},{id:`MD037`,alias:`no-space-in-emphasis`,aliases:[`no-space-in-emphasis`],name:`Spaces inside emphasis markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md037.md`,tags:[`whitespace`,`emphasis`],options:[]},{id:`MD038`,alias:`no-space-in-code`,aliases:[`no-space-in-code`],name:`Spaces inside code span elements`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md038.md`,tags:[`whitespace`,`code`],options:[]},{id:`MD039`,alias:`no-space-in-links`,aliases:[`no-space-in-links`],name:`Spaces inside link text`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md039.md`,tags:[`whitespace`,`links`],options:[]},{id:`MD040`,alias:`fenced-code-language`,aliases:[`fenced-code-language`],name:`Fenced code blocks should have a language specified`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md040.md`,tags:[`code`,`language`],options:[{key:`allowed_languages`,type:`string-array`,description:`List of languages`,default:[]},{key:`language_only`,type:`boolean`,description:`Require language only`,default:!1}]},{id:`MD041`,alias:`first-line-heading`,aliases:[`first-line-heading`,`first-line-h1`],name:`First line in a file should be a top-level heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md041.md`,tags:[`headings`],options:[{key:`allow_preamble`,type:`boolean`,description:`Allow content before first heading`,default:!1},{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD042`,alias:`no-empty-links`,aliases:[`no-empty-links`],name:`No empty links`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md042.md`,tags:[`links`],options:[]},{id:`MD043`,alias:`required-headings`,aliases:[`required-headings`],name:`Required heading structure`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md043.md`,tags:[`headings`],options:[{key:`headings`,type:`string-array`,description:`List of headings`,default:[]},{key:`match_case`,type:`boolean`,description:`Match case of headings`,default:!1}]},{id:`MD044`,alias:`proper-names`,aliases:[`proper-names`],name:`Proper names should have the correct capitalization`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md044.md`,tags:[`spelling`],options:[{key:`names`,type:`string-array`,description:`List of proper names`,default:[]},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`html_elements`,type:`boolean`,description:`Include HTML elements`,default:!0}]},{id:`MD045`,alias:`no-alt-text`,aliases:[`no-alt-text`],name:`Images should have alternate text (alt text)`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md045.md`,tags:[`accessibility`,`images`],options:[]},{id:`MD046`,alias:`code-block-style`,aliases:[`code-block-style`],name:`Code block style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md046.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Block style`,enum:[`consistent`,`fenced`,`indented`],default:`consistent`}]},{id:`MD047`,alias:`single-trailing-newline`,aliases:[`single-trailing-newline`],name:`Files should end with a single newline character`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md047.md`,tags:[`blank_lines`],options:[]},{id:`MD048`,alias:`code-fence-style`,aliases:[`code-fence-style`],name:`Code fence style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md048.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Code fence style`,enum:[`consistent`,`backtick`,`tilde`],default:`consistent`}]},{id:`MD049`,alias:`emphasis-style`,aliases:[`emphasis-style`],name:`Emphasis style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md049.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Emphasis style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD050`,alias:`strong-style`,aliases:[`strong-style`],name:`Strong style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md050.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Strong style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD051`,alias:`link-fragments`,aliases:[`link-fragments`],name:`Link fragments should be valid`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md051.md`,tags:[`links`],options:[{key:`ignore_case`,type:`boolean`,description:`Ignore case of fragments`,default:!1},{key:`ignored_pattern`,type:`string`,description:`Pattern for ignoring additional fragments`,default:``}]},{id:`MD052`,alias:`reference-links-images`,aliases:[`reference-links-images`],name:`Reference links and images should use a label that is defined`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md052.md`,tags:[`links`,`images`],options:[{key:`ignored_labels`,type:`string-array`,description:`Ignored link labels`,default:[`x`]},{key:`shortcut_syntax`,type:`boolean`,description:`Include shortcut syntax`,default:!1}]},{id:`MD053`,alias:`link-image-reference-definitions`,aliases:[`link-image-reference-definitions`],name:`Link and image reference definitions should be needed`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md053.md`,tags:[`links`,`images`],options:[{key:`ignored_definitions`,type:`string-array`,description:`Ignored definitions`,default:[`//`]}]},{id:`MD054`,alias:`link-image-style`,aliases:[`link-image-style`],name:`Link and image style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md054.md`,tags:[`links`,`images`],options:[{key:`autolink`,type:`boolean`,description:`Allow autolinks`,default:!0},{key:`inline`,type:`boolean`,description:`Allow inline links and images`,default:!0},{key:`full`,type:`boolean`,description:`Allow full reference links and images`,default:!0},{key:`collapsed`,type:`boolean`,description:`Allow collapsed reference links and images`,default:!0},{key:`shortcut`,type:`boolean`,description:`Allow shortcut reference links and images`,default:!0},{key:`url_inline`,type:`boolean`,description:`Allow URLs as inline links`,default:!0}]},{id:`MD055`,alias:`table-pipe-style`,aliases:[`table-pipe-style`],name:`Table pipe style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md055.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table pipe style`,enum:[`consistent`,`leading_only`,`trailing_only`,`leading_and_trailing`,`no_leading_or_trailing`],default:`consistent`}]},{id:`MD056`,alias:`table-column-count`,aliases:[`table-column-count`],name:`Table column count`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md056.md`,tags:[`table`],options:[]},{id:`MD058`,alias:`blanks-around-tables`,aliases:[`blanks-around-tables`],name:`Tables should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md058.md`,tags:[`table`],options:[]},{id:`MD059`,alias:`descriptive-link-text`,aliases:[`descriptive-link-text`],name:`Link text should be descriptive`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md059.md`,tags:[`links`,`accessibility`],options:[{key:`prohibited_texts`,type:`string-array`,description:`Prohibited link texts`,default:[`click here`,`here`,`link`,`more`]}]},{id:`MD060`,alias:`table-column-style`,aliases:[`table-column-style`],name:`Table column style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md060.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table column style`,enum:[`any`,`aligned`,`compact`,`tight`],default:`any`},{key:`aligned_delimiter`,type:`boolean`,description:`Aligned delimiter columns`,default:!1}]}],h8=(()=>{let e=new Map;for(let t of m8){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function g8(e){return h8.get(e.toUpperCase())??null}function _8(e,t){let n=g8(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))g8(t)===n&&(r={key:t,value:i});return r}var v8=[`Headings`,`Lists`,`Whitespace`,`Code`,`Links & images`,`Style`],y8=[[`headings`,`Headings`],[`bullet`,`Lists`],[`ul`,`Lists`],[`ol`,`Lists`],[`links`,`Links & images`],[`images`,`Links & images`],[`accessibility`,`Links & images`],[`code`,`Code`],[`language`,`Code`],[`emphasis`,`Style`],[`html`,`Style`],[`line_length`,`Whitespace`],[`whitespace`,`Whitespace`],[`hard_tab`,`Whitespace`],[`blank_lines`,`Whitespace`],[`indentation`,`Whitespace`]];function b8(e){for(let[t,n]of y8)if(e.tags.includes(t))return n;return`Style`}async function x8(e,t,n){if(!t.enabled)return[];let r=[];for(let i of Z6){let a=t.plugins[i.id];a.enabled&&r.push(...await i.lint(e,a,{docName:n}))}return r}var S8=/\p{M}+/gu,C8=/[^\p{L}\p{N}]+/gu,w8=/^-+|-+$/g;function T8(e){return e.trim().normalize(`NFKD`).replace(S8,``).toLowerCase().replace(C8,`-`).replace(w8,``)}function E8(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function D8(e,t){let n=T8(e);return n?E8(n,t):``}function O8(e,t){let n=T8(e);return t?`#${n}-${T8(t)}`:`#${n}`}var k8=new Set([`img`,`video`,`audio`,`mark`]),A8=new Map(T1.flatMap(e=>e.surface===`compat`&&k8.has(e.rendersAs)?[[e.name,e]]:[]));function j8(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function M8(e){let t=e.name;if(!t||!k8.has(t))return null;let n=j8(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function N8(e){let t=e.name;if(!t)return null;let n=A8.get(t);if(!n)return null;let r=j8(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var P8=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:O8(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},F8=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:O8(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},I8=(e,t)=>{let n=t,r=M8(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=N8(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,a),e.applyData(t,a)},L8=(e,t)=>{let n=t,r=M8(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=N8(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,a),e.applyData(t,a)},R8=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},z8=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function B8(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(B8).join(``):``}var V8={wikiLink:P8,wikiLinkEmbed:F8,mdxJsxFlowElement:I8,mdxJsxTextElement:L8,rawMdxFallback:R8,mark:z8,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:B8(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:B8(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},H8=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,U8=/\bexpression\s*\(/i,W8=1e4;function G8(e){return!(e.length>W8||H8.test(e)||U8.test(e))}function K8(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!lY(e.split(/\s+/)[0]??``))return!1}return!0}var q8={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},J8=new Set([`href`,`src`]),Y8=Oe(`<>`),X8=()=>e=>{D(e,`element`,e=>{let t=q8[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?U0(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(J8.has(e))if(t===`<>`||t===Y8)r=``;else{let e=U0(t);r=e===t?t:Oe(e)}else r=U0(t);r!==t&&(n[e]=r)}})},Z8=()=>e=>{D(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!lY(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!lY(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!lY(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!K8(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!K8(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!lY(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!G8(r)&&delete n.style})};function Q8(e){let t=k().use(Te,{handlers:V8}).use(X8).use(Z8).use(LU),n=t.runSync(e);return String(t.stringify(n))}function $8(e){let t=/\r?\n|\r/g,n=[],r=0,i=t.exec(e);for(;i!==null;)n.push(e5(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return n.push(e5(e.slice(r),r>0,!1)),n.join(``)}function e5(e,t,n){let r=0,i=e.length,a=e=>e===9||e===32;for(;t&&r<i&&a(e.charCodeAt(r));)r++;for(;n&&i>r&&a(e.charCodeAt(i-1));)i--;return i>r?e.slice(r,i):``}var t5=/\r?\n|\r/,n5=(e,t)=>{let n=$8(String(t.value));if(!t5.test(n)){let r={type:`text`,value:n};return e.patch(t,r),e.applyData(t,r)}let r=n.split(t5),i=[];for(let e=0;e<r.length;e++)e>0&&i.push({type:`element`,tagName:`br`,properties:{},children:[]}),r[e].length>0&&i.push({type:`text`,value:r[e]});return i};function r5(e){let t=k().use(ve).use(lF,[`yaml`]).use(k4).use(le).use(m3).use(I0).use(K4).use(Z0).use(Te,{handlers:{...V8,text:n5}}).use(X8).use(Z8).use(LU);return String(t.processSync(P0(X0(e))))}oL(),TI(),EI();var i5=`frontmatter`,a5=[`text`,`number`,`boolean`,`date`,`list`,`object`];V(a5);var o5=Ou([I(),L(),R()]),s5=ad(()=>Ou([o5.transform(e=>String(e)),Pu(I(),c5),z(s5)])),c5=ad(()=>Ou([I(),L(),R(),z(s5),Pu(I(),c5)])),l5=/^\d{4}-\d{2}-\d{2}$/;function u5(e){return typeof e==`string`&&l5.test(e)}function d5(e){return Array.isArray(e)?`list`:typeof e==`object`&&e?`object`:typeof e==`boolean`?`boolean`:typeof e==`number`?`number`:u5(e)?`date`:`text`}function f5(e){if(Array.isArray(e)){let t=[];for(let n of e)n!==null&&t.push(f5(n));return t}if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=r===null?``:f5(r);return t}return e}var p5=dd(f5,Pu(I(),c5)),m5=Pu(I(),Ou([c5,yu()]));function h5(e){return!!(e===null||typeof e==`string`&&e===``||Array.isArray(e)&&e.length===0)}function g5(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!g5(e[n],t[n]))return!1;return!0}if(e!==null&&t!==null&&typeof e==`object`&&typeof t==`object`&&!Array.isArray(e)&&!Array.isArray(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.hasOwn(t,r)||!g5(e[r],t[r]))return!1;return!0}return!1}B({docName:AZ,summary:NZ,content:I().optional(),...MZ}).loose(),B({docName:AZ,summary:NZ,markdown:I(),position:V([`append`,`prepend`,`replace`]).optional(),extension:V(bJ).optional(),...MZ}).loose(),B({docName:AZ,summary:NZ,find:I().min(1),replace:I(),offset:L().int().nonnegative().optional(),...MZ}).loose(),B({docName:AZ,connectionId:I().min(1),scope:V([`last`,`session`,`file`,`count`]).optional(),count:L().int().positive().optional(),...MZ}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});var _5=B({value:I(),truncatedFrom:L().int().nonnegative().optional(),hint:I().optional()}).loose(),v5=Au(`kind`,[B({kind:H(`inline`),content:I()}),B({kind:H(`truncated`),byteLength:L().int().nonnegative(),hint:I()})]),y5=B({kind:H(`content-divergence`),intendedBytes:L().int().nonnegative(),actualBytes:L().int().nonnegative(),byteDelta:L().int(),divergenceType:I().optional(),currentState:v5.optional(),hint:I().optional()}).loose(),b5=B({type:H(`orphan`),parentCandidates:z(I()),message:I()}).loose(),x5=B({kind:H(`disk-edit-reconciled`),intendedBytes:L().int().nonnegative(),actualBytes:L().int().nonnegative(),byteDelta:L().int(),mergeOutcome:I().optional(),hint:I().optional()}).loose(),S5=Au(`kind`,[y5,x5]),C5=z(Au(`kind`,[y5,x5,B({kind:H(`mermaid-parse-error`),fenceIndex:L().int().positive(),fenceFirstLine:I(),message:I(),line:L().int().positive().optional()}).loose(),B({kind:H(`lint-violation`),source:I(),code:I(),message:I(),severity:V([`error`,`warning`,`info`,`hint`]),line:L().int().positive(),column:L().int().positive(),linkTarget:I().optional()}).loose()])).min(1),w5=z(B({href:I(),resolvedTo:I().nullable(),reason:V([`no-such-doc`,`no-such-file`,`unresolvable`])}).loose());B({timestamp:I().min(1),summary:_5.optional(),warning:S5.optional(),warnings:C5.optional()}).loose(),B({timestamp:I().min(1),subscriberCount:L().int().nonnegative(),systemSubscriberCount:L().int().nonnegative(),hints:z(b5).optional(),summary:_5.optional(),warning:S5.optional(),warnings:C5.optional(),brokenLinks:w5}).loose(),B({timestamp:I().min(1),subscriberCount:L().int().nonnegative(),systemSubscriberCount:L().int().nonnegative(),summary:_5.optional(),warning:S5.optional(),warnings:C5.optional(),brokenLinks:w5}).loose(),B({docName:I().min(1),scope:V([`last`,`session`,`count`]),undone:R()}).loose(),B({docs:z(B({docName:jZ,markdown:I(),position:V([`append`,`prepend`,`replace`]).optional(),extension:V(bJ).optional(),summary:NZ}).loose()).min(1).max(100),...MZ}).loose();var T5=B({type:$Z,title:I(),detail:I().optional()}).loose(),E5=Au(`status`,[B({status:H(`written`),docName:I().min(1),summary:_5.optional(),warnings:C5.optional(),brokenLinks:w5}).loose(),B({status:H(`error`),docName:I().min(1),error:T5}).loose()]);B({timestamp:I().min(1),results:z(E5),written:L().int().nonnegative(),failed:L().int().nonnegative()}).loose(),B({docName:AZ,patch:Pu(I(),Ou([c5,yu()])),types:Pu(I(),V(a5)).optional(),summary:NZ,...MZ}).loose(),B({timestamp:I().min(1),subscriberCount:L().int().nonnegative(),systemSubscriberCount:L().int().nonnegative(),appliedKeys:z(I()),summary:_5.optional(),warning:S5.optional(),warnings:C5.optional(),brokenLinks:w5}).loose(),B({entries:z(B({level:V([`info`,`warn`,`error`]),message:I().max(kq),event:I().optional(),fields:Pu(I(),xu()).optional(),ts:L().optional(),sourceId:I().optional(),lineNumber:L().optional()}).loose()).max(100),droppedSinceLastFlush:L().int().min(0).optional()}).loose(),B({accepted:L().int().min(0)}).loose();var D5=B({status:I().min(1),reason:I()}).loose(),O5=B({docName:I().min(1),content:I(),lifecycle:D5.nullable()}).loose(),k5=B({kind:V([`document`,`asset`,`folder`,`file`]).default(`document`),docName:I().min(1).optional(),docExt:I().min(1).default(`.md`),size:L().int().nonnegative(),modified:I().min(1),isSymlink:R().default(!1),canonicalDocName:I().nullable().default(null),targetPath:I().nullable().default(null),path:I().min(1).optional(),assetExt:I().min(1).optional(),mediaKind:V([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`]).nullable().optional(),referencedBy:z(I().min(1)).optional(),hasChildren:R().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`}),A5=B({documents:z(k5),truncated:R().optional()}).loose(),j5=B({source:I().min(1),anchor:I().nullable(),title:I(),snippet:I().nullable()}).loose(),M5=B({docName:I().min(1),backlinks:z(j5)}).loose(),N5=B({counts:Pu(I().min(1),L().int().nonnegative())}).loose(),P5=Au(`kind`,[B({kind:H(`doc`),docName:I().min(1),anchor:I().nullable(),title:I(),snippet:I().nullable()}).loose(),B({kind:H(`external`),url:I().min(1),title:I(),snippet:I().nullable()}).loose()]),F5=B({docName:I().min(1),forwardLinks:z(P5)}).loose(),I5=Au(`kind`,[B({id:I().min(1),kind:H(`doc`),docName:I().min(1),anchor:I().nullable(),label:I(),cluster:I().nullable(),category:I().nullable(),tags:z(I()).nullable()}).loose(),B({id:I().min(1),kind:H(`external`),url:I().min(1),label:I()}).loose()]),L5=B({source:I().min(1),target:I().min(1)}).loose(),R5=B({nodes:z(I5),links:z(L5)}).loose(),z5=B({ts:L().int().min(0),url:I(),method:I(),ua:I().optional(),origin:I().optional(),referer:I().optional(),host:I().optional(),remote:I().optional(),secChUa:I().optional(),secChUaMobile:I().optional(),secChUaPlatform:I().optional(),secFetchSite:I().optional(),secFetchDest:I().optional(),secFetchMode:I().optional(),secFetchUser:I().optional()}).loose(),B5=B({app:Ou([H(`cursor`),H(`codex`),H(`claude`),yu()]),signals_fired:z(I())}).loose();B({entries:z(z5),count:L().int().min(0),detection:B5}).loose(),B({writers:z(B({id:I().min(1),name:I().optional(),email:I().optional()}).loose()).optional(),summary:NZ,...MZ}).loose(),B({checkpointRef:I().min(1)}).loose();var V5=B({v:L().int().optional(),id:I().min(1),name:I().min(1),colorSeed:I().optional(),docs:z(I()),summaries:z(I()).optional()}).loose();B({entries:z(B({sha:I().min(1),timestamp:I().min(1),author:I(),authorEmail:I(),type:V([`checkpoint`,`wip`,`upstream`,`park`]),message:I(),contributors:z(V5),checkpoint:xu().nullable(),parentSha:I().nullable().optional()}).loose()),total:L().int().nonnegative().optional(),truncated:R().optional(),hasMore:R().optional()}).loose(),B({sha:I().regex(/^[0-9a-f]{40}$/i),content:I(),timestamp:I(),author:I()}).loose();var H5=B({contentDir:I().min(1),pathSeparator:V([`/`,`\\`]),symlinkResolved:R()}).loose();z(Au(`source`,[B({docName:I().min(1),timestamp:I().min(1),size:L().int().nonnegative(),source:H(`flat`)}).loose(),B({docName:I().min(1),timestamp:I().min(1),source:H(`timeline`),sha:I().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var U5=B({domain:I().min(1),title:I().optional(),description:I().optional(),siteName:I().optional(),faviconDataUri:I().optional()}).loose();B({url:I()}).loose();var W5=Au(`ok`,[B({ok:H(!0),metadata:U5}).loose(),B({ok:H(!1),reason:I()}).loose()]),G5=B({orphans:z(B({docName:I().min(1),title:I()}).loose())}).loose(),K5=B({hubs:z(B({docName:I().min(1),title:I(),count:L().int().nonnegative()}).loose())}).loose(),q5=B({source:I().min(1),title:I(),snippet:I().nullable()}).loose();B({deadLinks:z(B({target:I().min(1),sources:z(q5)}).loose())}).loose(),B({target:B({docName:I().min(1),title:I(),aliases:z(I())}).loose(),mentions:z(B({source:I().min(1),excerpt:I(),offset:L().int().nonnegative()}).loose()),truncated:R()}).loose(),B({projectPath:I().min(1)}).loose();var J5=V([`not-a-git-worktree`,`init-failed`]);Au(`ok`,[B({ok:H(!0),projectPath:I().min(1)}).loose(),B({ok:H(!1),reason:J5,message:I().min(1)}).loose()]),B({host:I().min(1).optional()}).loose(),B({host:I().min(1).optional(),token:I().min(1)}).loose(),B({host:I(),login:I()}).loose(),B({key:I().min(1)}).loose(),B({keyPresent:R()}).loose();var Y5=V([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),X5=Au(`ok`,[B({ok:H(!0),endpoint:I().min(1),model:I().min(1),dimensions:L().int().positive()}).loose(),B({ok:H(!1),endpoint:I().min(1),model:I().min(1),reason:Y5,status:L().int().optional()}).loose()]);B({name:I().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:I().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),B({authenticated:R()}).loose(),B({}).loose();var Z5=B({stackIndex:L().int().min(0),ts:L().int().min(0),additions:L().int().min(0),deletions:L().int().min(0)}).loose(),Q5=B({docName:I().min(1),additionsTotal:L().int().min(0),deletionsTotal:L().int().min(0),lastTs:L().int().min(0),bursts:z(Z5)}).loose(),$5=B({displayName:I().min(1),color:I().min(1),icon:I().optional(),connectionId:I().min(1)}).loose(),e7=B({sessionAlive:R(),agent:$5.nullable(),files:z(Q5)}).loose(),t7=B({diff:I(),before:I(),after:I(),generatedAt:L().int().min(0)}).loose();B({}).loose(),B({}).loose(),B({}).loose(),B({}).loose(),B({}).loose(),B({}).loose();var n7=B({displayName:I().min(1),icon:I(),color:I().min(1),currentDoc:I().nullable(),mode:V([`idle`,`writing`]),ts:L().int().min(0)}).loose();B({presence:Pu(I().min(1),n7)}).loose();var r7=B({sessionId:I().min(1),agentType:I().min(1),ts:L().int().min(0),insertedChars:L().int().min(0),deletedChars:L().int().min(0)}).loose();B({effects:z(B({"doc.name":I().min(1),entries:z(r7)}).loose())}).loose(),B({decisions:z(B({ts:L().int().min(0),decision:I().min(1),kind:I().min(1),"doc.name":I().min(1),pathRole:I().min(1)}).loose())}).loose(),Pu(I().min(1),R()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),B({path:I().min(1,`path must be non-empty`)}).loose(),B({}).loose();var i7=B({fromDocName:I().min(1),toDocName:I().min(1)}).loose(),a7=B({fromPath:I().min(1),toPath:I().min(1)}).loose();B({}).loose(),B({path:I().min(1),...MZ,summary:NZ}).loose();var o7=B({docName:I().min(1)}).loose();B({path:I().min(1),...MZ,summary:NZ}).loose();var s7=B({path:I().min(1)}).loose();B({kind:V([`file`,`folder`]),path:I().min(1),...MZ,summary:NZ}).loose();var c7=B({kind:V([`file`,`folder`]),path:I().min(1),duplicatedDocNames:z(I().min(1))}).loose(),l7=B({pages:z(B({docName:I().min(1),title:I(),docExt:I().min(1),size:L().int().nonnegative(),modified:I().min(1),icon:I().min(1).max(2048).optional()}).loose())}).loose(),u7=B({level:L().int().min(1).max(6),text:I(),slug:I()}).loose(),d7=B({docName:I().min(1),headings:z(u7)}).loose(),f7=B({docName:I().min(1),rewrites:L().int().nonnegative()}).loose();B({kind:V([`file`,`folder`,`asset`]),fromPath:I().min(1),toPath:I().min(1),...MZ,summary:NZ}).loose();var p7=B({renamed:z(i7),renamedAssets:z(a7),rewrittenDocs:z(f7).optional(),summary:_5.optional()}).loose();B({kind:V([`file`,`folder`,`asset`]),path:I().min(1),...MZ}).loose();var m7=B({deletedDocNames:z(I().min(1))}).loose();B({kind:V([`file`,`folder`,`asset`]),path:I().min(1),...MZ,summary:NZ}).loose();var h7=B({deletedDocNames:z(I().min(1))}).loose();B({docName:I().min(1),commitSha:I().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:NZ,...MZ}).loose(),B({restoredFrom:I().min(1),timestamp:I().min(1),summary:_5.optional(),warning:y5.optional(),warnings:C5.optional()}).loose();var g7=V([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),_7=B({label:I().min(1),webUrl:Ql().nullable()}).loose(),v7=Au(`checkStatus`,[B({checkStatus:H(`allowed`)}).loose(),B({checkStatus:H(`denied`),deniedReason:V([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`])}).loose(),B({checkStatus:H(`unknown`),unknownError:V([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),y7=V([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]),b7=V(fd),x7=V([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);B({state:g7,lastSyncUtc:I().nullable(),lastFetchUtc:I().nullable(),lastPushedSha:I().nullable(),ahead:L().int().min(0),behind:L().int().min(0),consecutiveFailures:L().int().min(0),conflictCount:L().int().min(0),hasRemote:R(),syncEnabled:R(),identityUnresolved:R(),remote:_7.nullable().optional(),pushError:I().optional(),pushErrorCode:y7.optional(),pullError:I().optional(),pullErrorCode:y7.optional(),pausedReason:I().optional(),pushPermission:v7.optional(),syncMode:b7.optional(),lastPullUtc:I().nullable().optional(),lastPullOutcome:x7.nullable().optional()}).loose(),B({op:V([`sync`,`push`,`pull`]).optional()}).loose(),B({op:V([`sync`,`push`,`pull`])}).loose(),B({conflicts:z(B({file:I().min(1),detectedAt:I().min(1),oursSha:I().optional(),theirsSha:I().optional(),baseSha:I().optional()}).loose())}).loose(),B({file:I().min(1),strategy:V([`mine`,`theirs`,`content`,`delete`]),content:I().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),B({}).loose(),B({file:I().min(1),base:I(),ours:I(),theirs:I(),kind:V([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:I().nullable()}).loose(),B({plan:sd(e=>e!==void 0,{message:`plan is required`})}).loose(),B({plan:sd(e=>e!==void 0,{message:`plan is required`})}).loose(),B({result:sd(e=>e!==void 0,{message:`result is required`})}).loose();var S7=B({path:I().min(1),summary:I().min(1)}).loose(),C7=B({files:L().int().nonnegative(),folders:L().int().nonnegative()}).loose();B({packs:z(B({id:I().min(1),name:I().min(1),description:I().min(1),defaultSubfolder:I().optional(),folders:z(S7),entryCounts:C7}).loose())}).loose(),B({noOpen:R().optional(),out:I().min(1).optional()}).loose();var w7=B({reason:V([`unsupported-platform`,`spawn-error`]),message:I()}).loose();Au(`status`,[B({status:H(`installed`),outputPath:I(),size:L().int().nonnegative(),sha256:I(),skillVersion:I()}).loose(),B({status:H(`built`),outputPath:I(),size:L().int().nonnegative(),sha256:I(),skillVersion:I(),handoffError:w7.optional()}).loose(),B({status:H(`failed`),buildError:I()}).loose(),B({status:H(`skip-current`),skillVersion:I(),recordedAt:I().optional()}).loose()]);var T7=V(DJ);Eu({schema:H(1),targets:z(T7).default([])}),B({tags:z(B({name:I().min(1),count:L().int().nonnegative(),isLeaf:R()}).loose())}).loose();var E7=B({docName:I().min(1),title:I(),matchingTags:z(I().min(1)),snippet:I().nullable()}).loose();B({name:I().min(1),docs:z(E7)}).loose(),B({folder:xu(),frontmatter_local:Pu(I(),xu()).nullable()}).loose(),B({path:I(),frontmatter:Pu(I(),xu()).optional()}).loose(),B({applied:xu()}).loose();var D7=Pu(I(),xu()).meta({description:`Free-form frontmatter map embedded in template payloads.`});B({template:B({name:I().min(1),folder:I(),scope:V([`local`,`inherited`]),path:I().min(1),frontmatter:D7,body:I()}).strict()}).strict();var O7=B({templates:z(B({name:I().min(1),title:I().optional(),description:I().optional(),path:I().min(1),source_folder:I()}).strict()),truncated:R()}).strict();B({folder:I(),name:I(),body:I().optional(),frontmatter:D7.optional(),...MZ,summary:NZ}).strict(),B({path:I().min(1),created:R(),warnings:z(I())}).strict(),B({sourcePath:I().min(1),targetFolder:I(),name:I().optional(),title:I().optional(),deleteSource:R().optional(),...MZ,summary:NZ}).strict(),B({path:I().min(1),created:R(),warnings:z(I())}).strict(),B({existed:R(),path:I().min(1)}).strict(),B({fromFolder:I(),fromName:I(),toFolder:I(),toName:I(),body:I().optional(),frontmatter:D7.optional(),...MZ,summary:NZ}).strict(),B({from:I().min(1),to:I().min(1),committed:R()}).strict();var k7=V(cJ),A7=/^[a-z0-9-]+$/,j7=/^[A-Za-z0-9_-]+$/,M7=B({name:I(),description:I()}).strict();B({skill:B({name:I().min(1),scope:k7,path:I().min(1),frontmatter:M7,body:I(),files:z(B({path:I().min(1),text:I().nullable()})).optional(),managed:R().optional()}).strict()}).strict();var N7=B({skills:z(B({name:I().min(1),description:I().optional(),scope:k7,path:I().min(1),absolutePath:I().min(1).optional(),installed:R(),hosts:z(I()),installedVersion:I().optional(),bundledVersion:I().optional(),updateAvailable:R().optional(),managed:R().optional()}).strict()),truncated:R()}).strict();B({scope:k7.default(`project`),name:I(),body:I().optional(),frontmatter:M7,...MZ,summary:NZ}).strict(),B({path:I().min(1),created:R(),warnings:z(I())}).strict(),B({scope:k7.default(`project`),name:I(),...MZ,summary:NZ}).strict(),B({name:I().min(1),version:I().min(1),previousVersion:I().optional(),checkpointRef:I().optional()}).strict(),B({existed:R(),path:I().min(1)}).strict(),B({scope:k7.default(`project`),fromName:I(),toName:I(),body:I().optional(),frontmatter:M7.optional(),...MZ,summary:NZ}).strict(),B({from:I().min(1),to:I().min(1),committed:R()}).strict();var P7=V([`reference`,`script`]);B({scope:k7.default(`project`),name:I(),path:I().min(1),content:I(),...MZ,summary:NZ}).strict(),B({path:I().min(1),created:R(),kind:P7,content:R()}).strict(),B({path:I().min(1),kind:P7,text:I()}).strict(),B({path:I().min(1),existed:R(),kind:P7}).strict(),B({scope:k7.default(`project`),name:I(),targets:z(T7).optional().meta({description:`Explicit editor ids to install into; omit to use project-configured editors.`}),...MZ,summary:NZ}).strict(),B({name:I().min(1),hosts:z(I()),scripts:R(),warnings:z(I()),warningCodes:z(V([`no-targets`,`scripts-present`]))}).strict(),B({scope:k7.default(`project`),name:I()}).strict(),B({name:I().min(1),uninstalled:R()}).strict();var F7=B({targets:z(T7),configured:R()}).strict();B({targets:z(T7)}).strict(),B({targets:z(T7),reprojected:z(B({name:I(),hosts:z(I())}).strict()),bundleHosts:z(I()),removedFrom:z(I())}).strict(),B({scope:k7.default(`project`),name:I(),version:I().regex(/^[0-9a-f]{40}$/i),...MZ,summary:NZ}).strict(),B({name:I().min(1),version:I(),restoredFiles:z(I()),warnings:z(I())}).strict(),B({query:I().optional(),intent:V([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:V([`navigation`,`relevance`]).optional(),scopes:z(V([`page`,`folder`,`content`,`file`])).optional(),scope:I().optional(),limit:L().int().nonnegative().optional(),semantic:R().optional(),source:V([`omnibar`,`mcp`,`http`]).optional()}).loose();var I7=B({kind:V([`page`,`folder`,`content`,`file`]),path:I().min(1),title:I(),score:L(),signals:Pu(I(),xu()),snippet:I().optional()}).loose(),L7=B({capable:R(),applied:R(),coverage:B({embedded:L().int().nonnegative(),total:L().int().nonnegative()})}).loose();B({enabled:R(),keyPresent:R(),keyNotRequired:R(),keySource:V([`project`,`file`,`env`]).nullable(),keyHint:I().nullable(),ready:R(),capable:R(),embedded:L().int().nonnegative(),total:L().int().nonnegative()}).loose(),B({query:I(),intent:V([`autocomplete`,`full_text`,`omnibar`]),results:z(I7),elapsedMs:L().nonnegative(),semantic:L7.optional(),truncated:R().optional(),ready:R().optional()}).loose();var R7=B({version:I().min(1),recordedAt:I().min(1)}).loose();B({currentVersion:I().min(1),targets:Pu(I(),R7.nullable())}).loose();var z7=`server-info`,B7=`branch-switched`,V7=`disk-ack`,H7=`config-validation-rejected`,U7=`config-ignore-nested-error`,W7=V([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`lint-config`]),G7=B({v:H(1),ch:H(z7),seq:L(),serverInstanceId:I().min(1),currentBranch:I().min(1).optional()}).loose(),K7=B({v:H(1),ch:H(B7),seq:L(),branch:I().min(1)}).loose(),q7=B({v:H(1),ch:W7,seq:L()}).loose(),J7=B({v:H(1),ch:H(V7),seq:L(),docName:I().min(1),sv:I().min(1)}).loose(),Y7=B({v:H(1),ch:H(H7),seq:L(),docName:I().min(1),error:np}).loose(),X7=B({v:H(1),ch:H(U7),seq:L(),path:I().min(1),error:I().min(1)}).loose();function Z7(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function Q7(e){if(typeof e!=`string`||e.length===0)return e;let t=Q$(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(q$(e)){let t=Z7(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=W$(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var $7=`https://api.github.com/repos/inkeep/open-knowledge`;async function e9(e){let{signal:t,...n}=e??{},r=t?AbortSignal.any([AbortSignal.timeout(5e3),t]):AbortSignal.timeout(5e3);try{let e=await fetch($7,{headers:{accept:`application/vnd.github+json`,"user-agent":`openknowledge.ai`},...n,signal:r});if(!e.ok)return console.warn(`[github-stars] GitHub API responded ${e.status}`),null;let t=await e.json();return typeof t.stargazers_count==`number`?t.stargazers_count:null}catch(e){return console.warn(`[github-stars] fetch failed: ${e instanceof Error?e.message:String(e)}`),null}}function ete(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}new Cq.default;var tte=B({path:z(Ou([I(),L()])),message:I(),issueCode:I()});Au(`code`,[B({code:H(`SCHEMA_INVALID`),issues:z(tte)}),B({code:H(`WRITE_ERROR`),detail:I()})]);function nte(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function rte(e){if(e.code!==`SCHEMA_INVALID`)return{};let t={};for(let n of e.issues){let e=n.path[0];typeof e==`string`&&(t[e]=t[e]?`${t[e]}; ${n.message}`:n.message)}return t}var ite={defaultKeyType:`PLAIN`,defaultStringType:`PLAIN`,lineWidth:0};function ate(e){if(e.trim()===``)return{doc:new _r({}),map:{}};let t;try{t=Ti(e)}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new _r({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=p5.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function ote(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function t9(e,t,n){if(Array.isArray(n)){let r=e.createNode(n),i=Ye(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}if(ote(n)){let r=e.createNode(n),i=Ke(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}return n}function ste(e){return e===``?``:`---\n${e.endsWith(`
|
|
557
|
-
`)?e.slice(0,-1):e}\n---\n`}var n9=65536;function r9(e){let t=e.match(JJ);return t?{fenced:t[0],body:e.slice(t[0].length)}:{fenced:``,body:e}}function cte(e){if(e.trim()===``)return{doc:new _r({}),map:{}};let t;try{t=Ti(e,{uniqueKeys:!1})}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new _r({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=p5.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function i9(e){return e===``?{doc:new _r({}),map:{}}:cte(QJ(e))}function a9(e){let{fenced:t}=r9(e),{map:n,parseError:r}=i9(t);return{map:n??{},parseError:r}}function o9(e){let{fenced:t}=r9(e);if(t===``)return[];let{doc:n,map:r}=i9(t);return r===null?[]:u9(n)}function s9(e){return typeof e==`object`&&!!e&&`key`in e}function c9(e){let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}function l9(e,t){let n=e.key;if(typeof n==`string`){e.key=t;return}if(n&&typeof n==`object`){n.value=t;return}e.key=t}function u9(e){let t=e.contents;if(!t||!(`items`in t)||!Array.isArray(t.items))return[];let n=[];for(let e of t.items){if(!s9(e))continue;let t=c9(e);t!==null&&n.push(t)}return n}function d9(e){if(e.contents==null||!(`items`in e.contents)){let t=e.createNode({});return e.contents=t,t}return e.contents}function lte(e){let t=e.contents;return!t||!(`items`in t)||(t.items?.length??0)===0?``:ste(e.toString(ite))}function ute(e){let t=new TextEncoder().encode(e).byteLength;return t>65536?{kind:`region_too_large`,bytes:t,limit:n9}:null}function f9(e){let t=lte(e),n=ute(t);return n?{ok:!1,error:n}:{ok:!0,nextFenced:t}}function dte(e,t){if(Object.hasOwn(t,`frontmatter`))return{ok:!1,error:{kind:`reserved_key`,key:i5}};let{doc:n,map:r}=i9(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{d9(n);for(let[e,r]of Object.entries(t)){if(r===null){n.delete(e);continue}let t=c5.safeParse(r);if(!t.success)return{ok:!1,error:{kind:`invalid_value`,key:e,reason:t.error.issues[0]?.message??`invalid value`}};n.set(e,t9(n,n.get(e,!0),t.data))}return f9(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function fte(e,t,n,r={}){if(t===`frontmatter`||n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:i5}};let{doc:i,map:a}=i9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(t===n)return{ok:!0,nextFenced:e};let o=i.contents;if(!o||!(`items`in o)||!Array.isArray(o.items))return{ok:!1,error:{kind:`unknown_key`,key:t}};let s=o.items.find(e=>s9(e)&&c9(e)===t);if(!s)return{ok:!1,error:{kind:`unknown_key`,key:t}};if(!r.allowDuplicate&&o.items.some(e=>s9(e)&&e!==s&&c9(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return l9(s,n),f9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function p9(e,t){let{doc:n,map:r}=i9(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let i=n.contents;if(!i||!(`items`in i)||!Array.isArray(i.items))return{ok:!0,nextFenced:e};let a=u9(n);if(a.length!==t.length||!m9(a,t))return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};try{let e=i.items.filter(s9),r=[];for(let n of t){let i=e.findIndex(e=>c9(e)===n);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};let[o]=e.splice(i,1);o&&r.push(o)}return i.items=r,f9(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function m9(e,t){let n=new Map;for(let t of e)n.set(t,(n.get(t)??0)+1);for(let e of t){let t=(n.get(e)??0)-1;if(t<0)return!1;n.set(e,t)}for(let e of n.values())if(e!==0)return!1;return!0}function h9(e){if(e.length===0)return{kind:`invalid_path`,path:[...e],reason:`path must have at least one segment`};for(let t=0;t<e.length;t++){let n=e[t];if(typeof n!=`string`&&typeof n!=`number`)return{kind:`invalid_path`,path:[...e],reason:`path segment at index ${t} must be string or number`};if(typeof n==`number`&&(!Number.isInteger(n)||n<0))return{kind:`invalid_path`,path:[...e],reason:`numeric path segment at index ${t} must be a non-negative integer`}}return e[0]===`frontmatter`?{kind:`reserved_key`,key:i5}:null}function pte(e,t,n){let r=h9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=i9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=c5.safeParse(n);if(!o.success)return{ok:!1,error:{kind:`invalid_value`,key:String(t[t.length-1]),reason:o.error.issues[0]?.message??`invalid value`}};try{return d9(i),i.setIn(t,t9(i,i.getIn(t,!0),o.data)),f9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function mte(e,t){let n=h9(t);if(n)return{ok:!1,error:n};let{doc:r,map:i}=i9(e);if(i===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{return r.getIn(t,!0)===void 0?{ok:!0,nextFenced:e}:(r.deleteIn(t),f9(r))}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function hte(e,t){if(t.length===0){let t=e.contents;return Ke(t)?t:null}let n=e.getIn(t,!0);return Ke(n)?n:null}function gte(e,t,n,r={}){let i=h9(t);if(i)return{ok:!1,error:i};let a=t[t.length-1];if(typeof a!=`string`)return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot rename: last path segment must be a string (map key)`}};if(t.length===1&&n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:i5}};let{doc:o,map:s}=i9(e);if(s===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(a===n)return{ok:!0,nextFenced:e};let c=hte(o,t.slice(0,-1));if(!c)return{ok:!1,error:{kind:`unknown_key`,key:a}};let l=c.items.find(e=>s9(e)&&c9(e)===a);if(!l)return{ok:!1,error:{kind:`unknown_key`,key:a}};if(!r.allowDuplicate&&c.items.some(e=>s9(e)&&e!==l&&c9(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return l9(l,n),f9(o)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function _te(e,t,n){if(t.length===0)return p9(e,n);let r=h9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=i9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Ke(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a map`}};let s=[];for(let e of o.items){if(!s9(e))continue;let t=c9(e);t!==null&&s.push(t)}if(s.length!==n.length||!m9(s,n))return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};try{let e=o.items.filter(s9),t=[];for(let r of n){let i=e.findIndex(e=>c9(e)===r);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};let[a]=e.splice(i,1);a&&t.push(a)}return o.items=t,f9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function vte(e,t,n){let r=h9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=i9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Ye(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a sequence`}};let s=o,c=s.items.length,l=Array.from({length:c},(e,t)=>t),u=[...n];if(!yte(u,c))return{ok:!1,error:{kind:`reorder_mismatch`,expected:l.map(String),got:u.map(String)}};try{let e=s.items.slice();return s.items=u.map(t=>e[t]),f9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function yte(e,t){if(e.length!==t)return!1;let n=Array(t).fill(!1);for(let r of e){if(!Number.isInteger(r)||r<0||r>=t||n[r])return!1;n[r]=!0}return!0}var bte=Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});function g9(e){return{ok:!1,error:e}}function xte(e){return{ok:!0,...e}}function Ste(e){return{ok:!0,...e}}function Cte(e){return{ok:!0,...e}}function _9(e){return{ok:!0,...e}}function v9(e){switch(e.kind){case`unknown_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`unknown key '${e.key}'`,issueCode:`unknown_key`}]};case`duplicate_target`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`key '${e.key}' already exists`,issueCode:`duplicate_target`}]};case`invalid_value`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:e.reason,issueCode:`invalid_value`}]};case`reserved_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`'${e.key}' is a reserved frontmatter key`,issueCode:`reserved_key`}]};case`reorder_mismatch`:return{code:`WRITE_ERROR`,detail:`reorder list does not match current keys (state changed mid-drag)`};case`region_too_large`:return{code:`SCHEMA_INVALID`,issues:[{path:[],message:`Frontmatter region exceeds ${n9}-byte limit (would be ${e.bytes})`,issueCode:`region_too_large`}]};case`parse_failed`:return{code:`WRITE_ERROR`,detail:`Frontmatter YAML is malformed; fix in source mode to commit (${e.reason})`};case`invalid_path`:return{code:`SCHEMA_INVALID`,issues:[{path:[...e.path],message:e.reason,issueCode:`invalid_path`}]}}}function wte(e,t){if(e.parseError!==t.parseError||e.keys.length!==t.keys.length)return!1;for(let n=0;n<e.keys.length;n++)if(e.keys[n]!==t.keys[n])return!1;for(let n of e.keys)if(!g5(e.map[n],t.map[n]))return!1;return!0}var Tte=5;function y9(e){let t=e.toString();return{snapshot:Ete(t),raw:t}}function Ete(e){let{map:t,parseError:n}=a9(e);return{map:t,keys:o9(e),parseError:n}}function b9(e){return e.startsWith(`---`)}function Dte(e){let t=e.document,n=t.getText(`source`),r=new Set,i=y9(n),a=i.snapshot,o=r9(i.raw).fenced,s=b9(i.raw),c=!1;function l(e=!1){if(c)return;let t,i;try{let e=y9(n);t=e.snapshot,i=e.raw}catch(e){console.warn(`[bindFrontmatterDoc] readSnapshotFromYText threw:`,e);return}if(!e&&wte(a,t)){s=b9(i);return}a=t,o=r9(i).fenced,s=b9(i);for(let e of r)try{e(t)}catch(e){console.warn(`[bindFrontmatterDoc] listener threw:`,e)}}let u=e=>{c||Ote(e,o.length,s)&&l()};n.observe(u),e.on(`synced`,d);function d(){l(!0)}function f(e){let r;return t.transact(()=>{let{fenced:t}=r9(n.toString());r=e(t),r.ok&&r.nextFenced!==t&&(n.delete(0,t.length),r.nextFenced!==``&&n.insert(0,r.nextFenced))},bte),r??{ok:!1,error:{kind:`parse_failed`,reason:`commit transact produced no result`}}}function p(e){if(c)return g9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});if(Object.hasOwn(e,`frontmatter`))return g9({code:`SCHEMA_INVALID`,issues:[{path:[i5],message:`'${i5}' is a reserved frontmatter key`,issueCode:`reserved_key`}]});let t=m5.safeParse(e);if(!t.success)return g9({code:`SCHEMA_INVALID`,issues:t.error.issues.map(nte)});let n=t.data,r=Object.keys(n),i=f(e=>dte(e,n));return i.ok?xte({appliedKeys:r}):g9(v9(i.error))}function m(e,t,n={}){if(c)return g9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>fte(r,e,t,n));return r.ok?Ste({oldKey:e,newKey:t}):g9(v9(r.error))}function h(e){if(c)return g9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>p9(t,e));return t.ok?Cte({orderedKeys:[...e]}):g9(v9(t.error))}function g(e,t){if(c)return g9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>pte(n,e,t));return n.ok?_9({path:[...e]}):g9(v9(n.error))}function _(e){if(c)return g9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>mte(t,e));return t.ok?_9({path:[...e]}):g9(v9(t.error))}function v(e,t,n={}){if(c)return g9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>gte(r,e,t,n));return r.ok?_9({path:[...e]}):g9(v9(r.error))}function y(e,t){if(c)return g9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>_te(n,e,t));return n.ok?_9({path:[...e]}):g9(v9(n.error))}function b(e,t){if(c)return g9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>vte(n,e,t));return n.ok?_9({path:[...e]}):g9(v9(n.error))}return{current(){return y9(n).snapshot},patch(e){return p(e)},rename(e,t,n){return m(e,t,n)},reorder(e){return h(e)},patchPath(e,t){return g(e,t)},deletePath(e){return _(e)},renamePath(e,t,n){return v(e,t,n)},reorderPath(e,t){return y(e,t)},reorderSeqPath(e,t){return b(e,t)},subscribe(e){return r.add(e),()=>{r.delete(e)}},dispose(){c||(c=!0,n.unobserve(u),e.off(`synced`,d),r.clear())}}}function Ote(e,t,n){if(t===0&&n)return!0;let r=t>0?t:Tte,i=0;for(let t of e.delta){if(typeof t.retain==`number`){i+=t.retain;continue}if(typeof t.insert==`string`){if(i<r)return!0;i+=t.insert.length;continue}if(t.insert!==void 0){if(i<r)return!0;i+=1;continue}if(typeof t.delete==`number`&&i<r)return!0}return!1}var kte=new Cq.default;kte.Match_Threshold=.5;var Ate=/\\([!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~])/g,x9=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$/,S9=/^[ \t]+([-+*]|\d+[.)]|[a-zA-Z][.)])\s/,jte=/^\d+([.)])(?=\s)/,Mte=`1`,Nte=/\*\*\s*(`[^`]+`)\s*\*\*/g,Pte=/^(`{3,}|~{3,})/;function Fte(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r].trimEnd(),a=Pte.exec(i);if(a){let e=a[1][0];if(n===null){n=e;continue}if(n===e){n=null;continue}}if(n!==null||r===0||!x9.test(i))continue;let o=e[r-1].trimEnd();if(!(!o.startsWith(`|`)||x9.test(o))){t.add(r-1),t.add(r);for(let n=r+1;n<e.length&&e[n].trimEnd().startsWith(`|`);n++)t.add(n)}}return t}function C9(e){return e.slice(0,-1).trimEnd()}var w9=/^(?:#{1,6}[ \t]|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/;function T9(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r]??``,a=/^(`{3,}|~{3,})/.exec(i.trimStart());if(a?.[1]){let e=a[1][0];if(n===null){n=e;continue}if(n===e){n=null;continue}}n!==null&&t.add(r)}return t}var Ite=/^<\/?[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,Lte=/^<[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,Rte=/^<\/[A-Z][A-Za-z0-9.]*\s*>$/,zte=/<\/?[A-Z]/;function Bte(e){let t=!1;for(let n=0;n<e.length;n++)if(zte.test(e[n]??``)){t=!0;break}if(!t)return e;let n=T9(e),r=[],i=[],a=0;for(let t=0;t<e.length;t++){let o=e[t]??``,s=o.trim();if(n.has(t)){r.push(!1),i.push(a);continue}let c=a>=1||!/^[ \t]/.test(o);r.push(c&&Ite.test(s));let l=c&&Rte.test(s),u=c&&!l&&Lte.test(s)&&!s.endsWith(`/>`);l?(a=Math.max(0,a-1),i.push(a)):(i.push(a),u&&(a+=1))}let o=Array(e.length);for(let t=0,n=-1;t<e.length;t++)o[t]=n,(e[t]??``).trim()!==``&&(n=t);let s=Array(e.length);for(let t=e.length-1,n=e.length;t>=0;t--)s[t]=n,(e[t]??``).trim()!==``&&(n=t);let c=new Set;for(let t=0;t<e.length;t++){if((e[t]??``).trim()!==``||n.has(t)||(i[t]??0)<1)continue;let a=o[t]??-1,l=s[t]??e.length;(a>=0&&r[a]===!0||l<e.length&&r[l]===!0)&&c.add(t)}let l=[];for(let t=0;t<e.length;t++){if(c.has(t))continue;let n=e[t]??``;l.push(r[t]===!0&&(i[t]??0)>=1?n.replace(/^[ \t]+/,``):n)}return l}function Vte(e){let t=Bte(e.replace(/^/,``).replace(/\r/g,``).replace(Ate,`$1`).replace(Nte,`$1`).replace(/^\n+/,``).replace(/^[*-]{3,}(?=\n|$)/,`---`).replace(/(\n)([#>+-]|\d+[.)]|`{3,}|~{3,})/g,`
|
|
552
|
+
`)},mdxJsxFlowElement(e,t,n,r){let i=e,a=i.data?.sourceRaw;if(typeof a==`string`)return a;let o=i.data?.htmlBoundary;if(o&&typeof o.opener==`string`&&typeof o.closer==`string`){let e=n.containerFlow({type:`root`,children:i.children??[]},r);return`${o.opener}\n\n${e}\n\n${o.closer}`}let s=i.name??``,c=R3(i.attributes??[]);return!i.children||i.children.length===0?s?c?`<${s} ${c} />`:`<${s} />`:``:F3({...i,attributes:(i.attributes??[]).map(B3)},t,n,r)},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=t6(n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),r,`==`),o+=i.move(`==`),a(),o},comment(e,t,n,r){let i=e.data?.sourceForm,a=i===`html`?`<!-- `:`%%`,o=i===`html`?` -->`:`%%`,s=n.createTracker(r),c=n.enter(`comment`),l=s.move(a);return l+=n.containerPhrasing(e,{before:l,after:o,...s.current()}),l+=s.move(o),c(),l},commentBlock(e,t,n,r){let i=n.createTracker(r),a=n.enter(`commentBlock`),o=e.children??[],s=e.data?.sourceForm,c=e.data?.sourceLayout,l=o.length===1&&o[0]?.type===`paragraph`;if(s===`html`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`<!-- `,after:` -->`,...i.current()});return a(),`<!-- ${t} -->`}if(c===`inline`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`%% `,after:` %%`,...i.current()});return a(),`%% ${t} %%`}let u=n.containerFlow(e,i.current());return a(),`%%\n\n${u}\n\n%%`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;if(typeof t==`string`)return t;let n=e.name??``,r=R3(e.attributes??[]);return r?`<${n} ${r} />`:`<${n}/>`},rawMdxFallback(e){return e.value??``},blockquote(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.containerFlow(e,a.current());i();let s=e.data?.sourceMarkerSpacings,c=0;return n.indentLines(o,(e,t,n)=>{if(n)return`>`;let r=c++,i=s?.[r];return i===`lazy`&&r>0&&!I3.test(e)?e:i===`none`||i===0?`>${e}`:typeof i==`number`&&i>=2&&!e.startsWith(` `)?`>${` `.repeat(i)}${e}`:`> ${e}`})}};function R3(e){let t=[];for(let n of e){if(n.type===`mdxJsxExpressionAttribute`){t.push(`{${n.value}}`);continue}let e=n.name;if(n.value===null||n.value===void 0){t.push(e);continue}if(typeof n.value==`string`){n.value.includes(`"`)?t.push(`${e}={${z3(n.value)}}`):t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function z3(e){return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function B3(e){return e.type===`mdxJsxAttribute`&&typeof e.value==`string`&&e.value.includes(`"`)?{type:`mdxJsxAttribute`,name:e.name,value:{type:`mdxJsxAttributeValueExpression`,value:z3(e.value)}}:e}function V3(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function H3(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function U3(e){return e.replace(/(?<!\\)&(?=(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z][A-Za-z0-9]*);)/g,(e,t)=>W3(t)?e:`\\${e}`)}function W3(e){if(e.charCodeAt(0)!==35)return!1;let t=e[1]===`x`||e[1]===`X`?Number.parseInt(e.slice(2),16):Number.parseInt(e.slice(1),10);return t===9||t===10||t===11||t===12||t===13||t===32||t===160}var G3=``,K3=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function q3(e){return e.replace(K3,e=>HY(e)?G3+e.slice(1):e)}function J3(e,t,n){let r=e.unsafe;e.unsafe=r.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`||e.character===`[`||e.character===`(`||e.character===`!`&&e.after===`\\[`&&e.inConstruct===`phrasing`||e.character===`@`&&e.before===`[+\\-.\\w]`||e.character===`{`&&Array.isArray(e.inConstruct)&&e.inConstruct.includes(`phrasing`)||e.character==="`"||(e.character===`*`||e.character===`_`||e.character===`~`)&&e.inConstruct===`phrasing`||e.character===`=`&&e.atBreak===!0||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`)),e.unsafe=e.unsafe.map(e=>{if(e.character!==`)`||e.atBreak!==!0||e.before!==`\\d+`||e.after!==void 0)return e;let t={...e,after:`(?:[ \r
|
|
553
|
+
]|$)`};return delete t._compiled,t});let i;try{i=e.safe(q3(t),n)}finally{e.unsafe=r}return i=i.replaceAll(G3,`\\&`),U3(e6(i,n))}var Y3=1,X3=2;function Z3(e){if(Number.isNaN(e))return`ws`;let t=m(e);return t===Y3?`ws`:t===X3?`punct`:`other`}function Q3(e,t,n){let r=Z3(t),i=Z3(n),a=i!==`ws`&&(i===`other`||r!==`other`),o=r!==`ws`&&(r===`other`||i!==`other`);return e===`_`?a&&(!o||r===`punct`)||o&&(!a||i===`punct`):a||o}function $3(e,t,n){let r=t;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r<e.length)return e[r]===`
|
|
554
|
+
`||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function e6(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&$3(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=Q3(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function t6(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=t.before??``,a=t.after??``,o=e,s=o.charCodeAt(0);n6(i.charCodeAt(i.length-1),s,r)&&(o=r6(s)+o.slice(1));let c=o.charCodeAt(o.length-1);return n6(a.charCodeAt(0),c,r)&&(o=o.slice(0,-1)+r6(c)),o}function n6(e,t,n){return!(m(t)!==Y3||n===`_`&&m(e)===void 0)}function r6(e){return`&#x${e.toString(16).toUpperCase()};`}function i6(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!o6(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function a6(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=t6(n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),r,i),s+=a.move(i),o(),s}function o6(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function s6(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var c6=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};freshnessHolder={checker:void 0};constructor(e){this.schema=hC(e.extensions),this.handlers=v6(this.schema,this.parseCtx),this.freshnessHolder.checker=e.deriveStructuralFreshness?I$({parse:e=>this.parseWithFallback(e)}):void 0;let{nodeHandlers:t,markHandlers:n}=y6(this.schema,this.freshnessHolder);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=v3({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=y3({toMarkdownHandlers:L3})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return E3(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?D3(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?Z1(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e,t){let n;try{n=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}let r=this.freshnessHolder.checker;t?.skipFreshnessDerive&&(this.freshnessHolder.checker=void 0);try{return O3(n,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}finally{this.freshnessHolder.checker=r}}},l6=O1();function u6(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function d6(e){let t=!1;return e.descendants(e=>t||e.type.name===`jsxInline`?!1:e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function f6(e,t){return e.attrs.sourceDirty||d6(e)?!0:t?t.isDiverged(e.toJSON()):!1}function p6(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function m6(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function h6(e,t){if(e.length===0)return m6({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return m6({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[h6(n.children,t)]}}return m6({type:`inlineCode`,value:g6(e)},t)}function g6(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=g6(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var _6=Pd;function v6(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=FP(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=FP(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=M3(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i)return r.sourceLiteral?e.text(n,[r.sourceLiteral.create({sourceRaw:i})]):e.text(n);let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n);let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&GY(t.raw)!==null&&HY(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=GY(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=IP(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=IP(r.highlight)),r.comment&&(i.comment=IP(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=FP(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=IP(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=IP(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=FP(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceUnclosedFence:t.data?.sourceUnclosedFence??!1,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`,sourceRaw:e.data?.sourceRaw??null})),n.list&&(i.list=FP(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=FP(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:``,title:null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=l6.getOrWildcard(o),c=u6(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=M3(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=sX(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&_6.has(l)&&n.jsxComponent&&l6.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&Fd.has(l)&&n.jsxComponent&&l6.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&Ld.has(l)&&n.jsxComponent&&l6.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&Rd.has(l)&&n.jsxComponent&&l6.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:s6(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``,sourceDelimiter:e.data?.sourceDelimiter??null})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=FP(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function y6(e,t){let n={},r={},i=e.nodes,a=e.marks;i.paragraph&&(n.paragraph=VP(`paragraph`)),i.blockquote&&(n.blockquote=VP(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),i.heading&&(n.heading=VP(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),i.codeBlock&&(n.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceUnclosedFence:e.attrs.sourceUnclosedFence===!0?!0:void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),i.thematicBreak&&(n.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),i.hardBreak&&(n.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle,...typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0?{sourceRaw:e.attrs.sourceRaw}:{}}})),i.list&&(n.list=VP(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),i.listItem&&(n.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&p6(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},children:i}}),i.table&&(n.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c={};Array.isArray(s)&&s.length>0&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),i.tableRow&&(n.tableRow=VP(`tableRow`));let o=(e,t)=>{let n={type:`tableCell`,children:n$(t)},r=e.attrs.sourcePadding;return typeof r==`object`&&r&&typeof r.left==`number`&&typeof r.right==`number`&&(n.data={sourcePadding:r}),n};if(i.tableCell&&(n.tableCell=(e,t,n)=>o(e,n.all(e))),i.tableHeader&&(n.tableHeader=(e,t,n)=>o(e,n.all(e))),i.image&&(n.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),i.imageReference&&(n.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),i.htmlBlock&&(n.htmlBlock=e=>({type:`html`,value:e.attrs.content})),i.linkDefinition??i.linkRefDef){let e=i.linkDefinition?`linkDefinition`:`linkRefDef`;n[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(i.jsxComponent&&(n.jsxComponent=(e,n,r)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let i=e.attrs.componentName||null,a=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!f6(e,t.checker)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:i,attributes:a,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:l6.getOrWildcard(i??`*`).serialize(e,{all:e=>r.all(e),registry:l6,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),i.rawMdxFallback&&(n.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),i.jsxInline&&(n.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),i.mathInline&&(n.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),i.wikiLink&&(n.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},children:[{type:`text`,value:i}]}}),i.tag&&(n.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),i.wikiLinkEmbed&&(n.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),a.emphasis&&(r.emphasis=HP(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.strong&&(r.strong=HP(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.code&&(r.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return h6(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),a.strike??a.delete){let e=a.strike?`strike`:`delete`;r[e]=HP(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return a.highlight&&(r.highlight=HP(`mark`)),a.comment&&(r.comment=HP(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),i.commentBlock&&(n.commentBlock=VP(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),i.footnoteReference&&(n.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),i.footnoteDefinition&&(n.footnoteDefinition=VP(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),a.link&&(r.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),a.escapeMark&&(r.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data??={},t.data.escapedChars??=[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),a.sourceLiteral&&(r.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return qY(t,e.value)&&(e.data??={},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:n,markHandlers:r}}var b6={default:!0,MD013:!1};function x6(e){return e??b6}function S6(e){let t=e.replace(/\\/g,`/`);for(;t.startsWith(`./`);)t=t.slice(2);let n=t.toLowerCase();for(let e of bJ)if(n.endsWith(e))return t.slice(0,-e.length);return t}function C6(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[],i=[],a=[],o=0;for(let e of t){let t=e.startsWith(`!`),s=t?e.slice(1):e;if(t||(o+=1),s.length===0){n.push({pattern:e,detail:`empty pattern`});continue}try{let e=(0,qR.default)(s,{dot:!0,strictBrackets:!0});(t?a:i).push(e)}catch(t){n.push({pattern:e,detail:t instanceof Error?t.message:String(t)});continue}if(s.endsWith(`/`))r.push({pattern:e,reason:`trailing-slash`});else if(s.startsWith(`/`))r.push({pattern:e,reason:`leading-slash`});else{let t=s.toLowerCase();bJ.some(e=>t.endsWith(e))&&r.push({pattern:e,reason:`doc-extension`})}}let s=o===0;return{invalidPatterns:n,suspiciousPatterns:r,matches(e){if(e===void 0||e===``)return!1;let t=S6(e);return t===``||!(s||i.some(e=>e(t)))?!1:!a.some(e=>e(t))}}}var w6=/[*?[\]{}()+@!|]/;function T6(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);if(n===-1||e.indexOf(`{`,t+1)!==-1||e.indexOf(`}`,n+1)!==-1)return null;let r=e.slice(t+1,n).split(`,`);return r.length<2||r.some(e=>e.trim()===``||w6.test(e))?null:r.map(r=>e.slice(0,t)+r+e.slice(n+1))}function E6(e){if(e.endsWith(`/`)||e.startsWith(`/`))return{kind:`matches-nothing`,pattern:e};try{(0,qR.default)(e,{dot:!0,strictBrackets:!0})}catch{return{kind:`invalid`,pattern:e}}if(e===`**`||e===`**/*`)return{kind:`everything`};{let t=e.match(/^\*\*\/(.+)\/\*\*$/)?.[1];if(t!==void 0&&!w6.test(t))return{kind:`folder-anywhere`,folder:t};let n=e.match(/^(.+)\/\*\*\/(.+)\/\*\*$/),r=n?.[1],i=n?.[2];if(r!==void 0&&i!==void 0&&!w6.test(r)&&!w6.test(i))return{kind:`folder-recursive-nested`,root:r,folder:i}}for(let t of[`/**/*`,`/**`])if(e.endsWith(t)){let n=e.slice(0,-t.length);if(n.length>0&&!w6.test(n))return{kind:`folder-recursive`,folder:n}}if(e.endsWith(`/*`)){let t=e.slice(0,-2);if(t.length>0&&!w6.test(t))return{kind:`folder-direct`,folder:t}}if(e.startsWith(`**/`)){let t=e.slice(3);if(t.length>0&&!t.includes(`/`)&&!w6.test(t))return{kind:`name-anywhere`,name:t}}return w6.test(e)?{kind:`pattern`,pattern:e}:{kind:`exact`,target:e}}function D6(e){let t=E6(e);if(t.kind!==`pattern`)return[t];let n=T6(e);if(n!==null){let e=n.map(E6);if(e.every(e=>e.kind!==`pattern`))return e}return[t]}function O6(e){let t=(e===void 0?[]:Array.isArray(e)?e:[e]).map(e=>e.trim()).filter(e=>e.length>0),n=[],r=[];for(let e of t){let t=e.startsWith(`!`),i=t?e.slice(1):e;i.length!==0&&(t?r:n).push(...D6(i))}return{includes:n,excludes:r}}function k6(e,t){let n=new Set,r=[];for(let i of e){if(i.enabled===!1||!i.schema||!C6(i.appliesTo).matches(t))continue;let e=i.key??i.file;n.has(e)||(n.add(e),r.push({file:i.file,schema:i.schema}))}return r}var A6=[`http://json-schema.org/draft-07/schema#`,`http://json-schema.org/draft-07/schema`,`https://json-schema.org/draft-07/schema#`,`https://json-schema.org/draft-07/schema`];function j6(e){let t=e.$schema;return t===void 0?!0:typeof t==`string`&&A6.includes(t)}var M6=null;function N6(){return M6||(M6=new GR.default({allErrors:!0,strict:!1}),(0,KR.default)(M6)),M6}var P6=new Map,F6=256;function I6(e){let t=JSON.stringify(e),n=P6.get(t);if(n!==void 0)return n;let r=null;if(j6(e)){let{$schema:t,...n}=e;try{r=N6().compile(n)}catch{r=null}}return P6.size>=F6&&P6.clear(),P6.set(t,r),r}function L6(e){let t=new Map;if(!YJ.test(e))return{data:{},keyLines:t};let{frontmatter:n}=ZJ(e),r=$J(n);if(r.trim()===``)return{data:{},keyLines:t};let i=Ti(r,{uniqueKeys:!1});if(i.errors.length>0)return{data:{},keyLines:t};let a=i.toJS();if(typeof a!=`object`||!a||Array.isArray(a))return{data:{},keyLines:t};if(Ke(i.contents))for(let e of i.contents.items){let n=e.key;if(!Je(n)||typeof n.value!=`string`||!n.range)continue;let i=0,a=Math.min(n.range[0],r.length);for(let e=0;e<a;e++)r.charCodeAt(e)===10&&i++;t.has(n.value)||t.set(n.value,i+1)}return{data:a,keyLines:t}}function R6(e){if(e===void 0)return``;let t;if(typeof e==`string`)t=`"${e}"`;else try{t=JSON.stringify(e)??String(e)}catch{t=String(e)}return t.length>60&&(t=`${t.slice(0,57)}…`),` (got ${t})`}function z6(e){if(!e.startsWith(`/`))return null;let t=e.slice(1).split(`/`)[0]??``;return t===``?null:t.replace(/~1/g,`/`).replace(/~0/g,`~`)}function B6(e){return e.split(`/`).slice(1).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`)).join(`.`)}function V6(e,t){if(t.length===0)return[];let{data:n,keyLines:r}=L6(e),i=e.split(`
|
|
555
|
+
`),a=e=>({start:{line:e,character:0},end:{line:e,character:i[e]?.length??0}}),o=[];for(let{schema:e}of t){let t=I6(e);if(t&&!t(n))for(let e of t.errors??[]){let t=e.keyword,i=0,s;if(t===`required`&&e.instancePath===``)s=`Frontmatter property "${String(e.params.missingProperty??``)}" is required`;else if(e.instancePath===``)s=`Frontmatter ${e.message??`violates "${t}"`}`;else{let a=z6(e.instancePath);a!==null&&(i=r.get(a)??0);let o=B6(e.instancePath);if(t===`enum`){let t=e.params.allowedValues??[],r=a!==null&&o===a?n[a]:void 0;s=`Frontmatter property "${o}" must be one of: ${t.map(String).join(`, `)}${R6(r)}`}else s=`Frontmatter property "${o}" ${e.message??`violates "${t}"`}`}o.push({range:a(i),severity:`warning`,source:`frontmatter`,code:t,message:s})}}return o}var H6=`doc`;function U6(e,t){return BH(e,LH({strings:{[H6]:e},config:t})[H6]??[])}function W6(e,t){let n=LH({strings:{[H6]:e},config:t})[H6]??[],r=e.split(`
|
|
556
|
+
`),i=G6(t);return n.map(e=>q6(e,r,K6(e,i)))}function G6(e){let t=new Map;return Object.entries(e).forEach(([e,n],r)=>{let i=e.toUpperCase();if(i===`DEFAULT`)return;let a=null;if(n===`error`||n===`warning`)a=n;else if(typeof n==`object`&&n&&!Array.isArray(n)){let e=n.severity;(e===`error`||e===`warning`)&&(a=e)}a!==null&&t.set(i,{entryIndex:r,severity:a})}),t}function K6(e,t){let n;for(let r of e.ruleNames){let e=t.get(r.toUpperCase());e!==void 0&&(n===void 0||e.entryIndex>n.entryIndex)&&(n=e)}return n?.severity??`warning`}function q6(e,t,n){let[r,i]=e.errorRange??[1,null],a=e.lineNumber-1,o=(r??1)-1,s=t[a]?.length??0,c=i==null?s:Math.min(o+i,s),l=e.fixInfo?[J6(e.fixInfo,e.lineNumber,t)]:void 0;return{range:{start:{line:a,character:o},end:{line:a,character:Math.max(c,o)}},severity:n,source:`markdownlint`,code:e.ruleNames[0]??`MD000`,message:e.errorDetail?`${e.ruleDescription}: ${e.errorDetail}`:e.ruleDescription,...l?{fixes:l}:{}}}function J6(e,t,n){let r=e.lineNumber??t,i=r-1;if(e.deleteCount===-1){if(r<n.length)return{range:{start:{line:i,character:0},end:{line:i+1,character:0}},newText:``};if(i>0){let e=n[i-1]?.length??0;return{range:{start:{line:i-1,character:e},end:{line:i,character:n[i]?.length??0}},newText:``}}return{range:{start:{line:0,character:0},end:{line:0,character:n[0]?.length??0}},newText:``}}let a=(e.editColumn??1)-1;return{range:{start:{line:i,character:a},end:{line:i,character:a+Math.max(0,e.deleteCount??0)}},newText:e.insertText??``}}var Y6=Ou([R(),V(cf),Pu(I(),xu())]),X6={id:`markdownlint`,sliceSchema:B({enabled:R(),rules:Pu(I(),Y6)}),defaultSlice:{enabled:!1,rules:b6},async lint(e,t){return W6(e,x6(t.rules))},fix(e,t){return U6(e,x6(t.rules))}},Z6=B({appliesTo:Ou([I(),z(I())]).optional(),file:I(),enabled:R().optional(),key:I().optional(),schema:Pu(I(),xu()).optional()}),Q6=[X6,{id:`frontmatter`,sliceSchema:B({enabled:R(),schemas:z(Z6)}),defaultSlice:{enabled:!1,schemas:[]},async lint(e,t,n){return V6(e,k6(t.schemas,n.docName))}}],$6={enabled:!0,plugins:Object.fromEntries(Q6.map(e=>[e.id,e.defaultSlice]))},e8=new Set([`.markdownlint.json`,`.markdownlint.jsonc`]);function t8(e){return e8.has(e)}function n8(e){return{enabled:e.enabled??!0,plugins:{markdownlint:{...e.markdownlint,rules:e.markdownlint.rules??b6},frontmatter:{enabled:e.frontmatter?.enabled??!1,schemas:e.frontmatter?.schemas??[]}}}}var r8=Object.fromEntries(Q6.map(e=>[e.id,e.sliceSchema])),i8=B({effective:B({enabled:R(),plugins:B(r8)}),configFile:I().nullable().optional(),configProblems:z(I()).optional()}),a8=Ou([R(),Pu(I(),xu())]);B({ruleId:I().min(1).max(64).regex(/^[A-Za-z][A-Za-z0-9_-]*$/),value:Ou([a8,yu()])}),B({file:I().min(1).max(512),delete:H(!0).optional(),field:I().min(1).max(256).optional(),parentPath:z(Ou([I().min(1).max(256),B({items:H(!0)}).strict()])).max(8).optional(),removeField:H(!0).optional(),renameTo:I().min(1).max(256).optional(),constraint:B({type:V([`string`,`number`,`boolean`,`array`,`object`]).nullable().optional(),enum:z(Ou([I(),L(),R()])).nullable().optional(),itemsEnum:z(Ou([I(),L(),R()])).nullable().optional(),itemsType:V([`string`,`number`,`boolean`,`object`]).nullable().optional(),pattern:I().nullable().optional(),format:I().nullable().optional(),description:I().max(2048).nullable().optional(),required:R().optional()}).optional()}).refine(e=>e.delete===void 0||e.field===void 0&&e.constraint===void 0&&e.removeField===void 0&&e.renameTo===void 0,{message:`delete cannot be combined with a field edit`}).refine(e=>[e.constraint,e.removeField,e.renameTo].filter(e=>e!==void 0).length<=1,{message:`constraint, removeField, and renameTo are mutually exclusive`}).refine(e=>e.removeField===void 0&&e.renameTo===void 0||e.field!==void 0,{message:`removeField and renameTo require field`}).refine(e=>e.parentPath===void 0||e.field!==void 0,{message:`parentPath requires field`}).refine(e=>e.field===void 0?e.constraint===void 0:e.constraint!==void 0||e.removeField!==void 0||e.renameTo!==void 0,{message:`field requires constraint, removeField, or renameTo`});var o8=B({schemas:z(I()),truncated:R()}).strict(),s8=B({line:L(),character:L()}),c8=B({start:s8,end:s8}),l8=B({range:c8,severity:V([`error`,`warning`,`info`,`hint`]),source:I(),code:I(),message:I(),fixes:z(B({range:c8,newText:I()})).optional()});B({files:z(B({file:I(),diagnostics:z(l8),warnings:z(I()).optional()})),fileCount:L(),errorCount:L(),warningCount:L(),warnings:z(I())});var u8=l8.extend({linkTarget:I().optional()}),d8=B({files:z(B({file:I(),diagnostics:z(u8)})),fileCount:L(),errorCount:L(),warningCount:L(),warnings:z(I())});B({docName:jZ,summary:PZ,...NZ}).loose();var f8=B({file:I(),fixedCount:L(),diagnostics:z(l8),errorCount:L(),warningCount:L(),warning:I().optional()});function p8(e){let t=e.trim().replace(/^\.\//,``);if(!t.startsWith(`.ok/schemas/`))return!1;let n=t.slice(12);return n.length>0&&!n.includes(`/`)&&!n.includes(`\\`)&&n!==`.`&&n!==`..`}function m8(e){let t=e.trim().toLowerCase().split(`/`).pop()??``;return t.endsWith(`.schema.json`)&&t.length>12?!0:p8(e)&&t.endsWith(`.json`)}var h8=[{id:`MD001`,alias:`heading-increment`,aliases:[`heading-increment`],name:`Heading levels should only increment by one level at a time`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md001.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`}]},{id:`MD003`,alias:`heading-style`,aliases:[`heading-style`],name:`Heading style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md003.md`,tags:[`headings`],options:[{key:`style`,type:`enum`,description:`Heading style`,enum:[`consistent`,`atx`,`atx_closed`,`setext`,`setext_with_atx`,`setext_with_atx_closed`],default:`consistent`}]},{id:`MD004`,alias:`ul-style`,aliases:[`ul-style`],name:`Unordered list style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md004.md`,tags:[`bullet`,`ul`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`consistent`,`asterisk`,`plus`,`dash`,`sublist`],default:`consistent`}]},{id:`MD005`,alias:`list-indent`,aliases:[`list-indent`],name:`Inconsistent indentation for list items at the same level`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md005.md`,tags:[`bullet`,`ul`,`indentation`],options:[]},{id:`MD007`,alias:`ul-indent`,aliases:[`ul-indent`],name:`Unordered list indentation`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md007.md`,tags:[`bullet`,`ul`,`indentation`],options:[{key:`indent`,type:`integer`,description:`Spaces for indent`,default:2,minimum:1},{key:`start_indented`,type:`boolean`,description:`Whether to indent the first level of the list`,default:!1},{key:`start_indent`,type:`integer`,description:`Spaces for first level indent (when start_indented is set)`,default:2,minimum:1}]},{id:`MD009`,alias:`no-trailing-spaces`,aliases:[`no-trailing-spaces`],name:`Trailing spaces`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md009.md`,tags:[`whitespace`],options:[{key:`br_spaces`,type:`integer`,description:`Spaces for line break`,default:2,minimum:0},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!1},{key:`list_item_empty_lines`,type:`boolean`,description:`Allow spaces for empty lines in list items`,default:!1},{key:`strict`,type:`boolean`,description:`Include unnecessary breaks`,default:!1}]},{id:`MD010`,alias:`no-hard-tabs`,aliases:[`no-hard-tabs`],name:`Hard tabs`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md010.md`,tags:[`whitespace`,`hard_tab`],options:[{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`ignore_code_languages`,type:`string-array`,description:`Fenced code languages to ignore`,default:[]},{key:`spaces_per_tab`,type:`integer`,description:`Number of spaces for each hard tab`,default:1,minimum:0}]},{id:`MD011`,alias:`no-reversed-links`,aliases:[`no-reversed-links`],name:`Reversed link syntax`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md011.md`,tags:[`links`],options:[]},{id:`MD012`,alias:`no-multiple-blanks`,aliases:[`no-multiple-blanks`],name:`Multiple consecutive blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md012.md`,tags:[`whitespace`,`blank_lines`],options:[{key:`maximum`,type:`integer`,description:`Consecutive blank lines`,default:1,minimum:1}]},{id:`MD013`,alias:`line-length`,aliases:[`line-length`],name:`Line length`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md013.md`,tags:[`line_length`],options:[{key:`line_length`,type:`integer`,description:`Number of characters`,default:80,minimum:1},{key:`heading_line_length`,type:`integer`,description:`Number of characters for headings`,default:80,minimum:1},{key:`code_block_line_length`,type:`integer`,description:`Number of characters for code blocks`,default:80,minimum:1},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`tables`,type:`boolean`,description:`Include tables`,default:!0},{key:`headings`,type:`boolean`,description:`Include headings`,default:!0},{key:`strict`,type:`boolean`,description:`Strict length checking`,default:!1},{key:`stern`,type:`boolean`,description:`Stern length checking`,default:!1}]},{id:`MD014`,alias:`commands-show-output`,aliases:[`commands-show-output`],name:`Dollar signs used before commands without showing output`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md014.md`,tags:[`code`],options:[]},{id:`MD018`,alias:`no-missing-space-atx`,aliases:[`no-missing-space-atx`],name:`No space after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md018.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD019`,alias:`no-multiple-space-atx`,aliases:[`no-multiple-space-atx`],name:`Multiple spaces after hash on atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md019.md`,tags:[`headings`,`atx`,`spaces`],options:[]},{id:`MD020`,alias:`no-missing-space-closed-atx`,aliases:[`no-missing-space-closed-atx`],name:`No space inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md020.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD021`,alias:`no-multiple-space-closed-atx`,aliases:[`no-multiple-space-closed-atx`],name:`Multiple spaces inside hashes on closed atx style heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md021.md`,tags:[`headings`,`spaces`,`atx_closed`],options:[]},{id:`MD022`,alias:`blanks-around-headings`,aliases:[`blanks-around-headings`],name:`Headings should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md022.md`,tags:[`headings`,`blank_lines`],options:[{key:`include_front_matter`,type:`boolean`,description:`Include front matter content`,default:!1},{key:`lines_above`,type:`unsupported`,description:`Blank lines above heading`,default:1},{key:`lines_below`,type:`unsupported`,description:`Blank lines below heading`,default:1}]},{id:`MD023`,alias:`heading-start-left`,aliases:[`heading-start-left`],name:`Headings must start at the beginning of the line`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md023.md`,tags:[`headings`,`spaces`],options:[]},{id:`MD024`,alias:`no-duplicate-heading`,aliases:[`no-duplicate-heading`],name:`Multiple headings with the same content`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md024.md`,tags:[`headings`],options:[{key:`siblings_only`,type:`boolean`,description:`Only check sibling headings`,default:!1}]},{id:`MD025`,alias:`single-title`,aliases:[`single-title`,`single-h1`],name:`Multiple top-level headings in the same document`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md025.md`,tags:[`headings`],options:[{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD026`,alias:`no-trailing-punctuation`,aliases:[`no-trailing-punctuation`],name:`Trailing punctuation in heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md026.md`,tags:[`headings`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!。,;:!`}]},{id:`MD027`,alias:`no-multiple-space-blockquote`,aliases:[`no-multiple-space-blockquote`],name:`Multiple spaces after blockquote symbol`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md027.md`,tags:[`indentation`,`whitespace`,`blockquote`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD028`,alias:`no-blanks-blockquote`,aliases:[`no-blanks-blockquote`],name:`Blank line inside blockquote`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md028.md`,tags:[`whitespace`,`blockquote`],options:[]},{id:`MD029`,alias:`ol-prefix`,aliases:[`ol-prefix`],name:`Ordered list item prefix`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md029.md`,tags:[`ol`],options:[{key:`style`,type:`enum`,description:`List style`,enum:[`one`,`ordered`,`one_or_ordered`,`zero`],default:`one_or_ordered`}]},{id:`MD030`,alias:`list-marker-space`,aliases:[`list-marker-space`],name:`Spaces after list markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md030.md`,tags:[`ul`,`whitespace`,`ol`],options:[{key:`ul_single`,type:`integer`,description:`Spaces for single-line unordered list items`,default:1,minimum:1},{key:`ol_single`,type:`integer`,description:`Spaces for single-line ordered list items`,default:1,minimum:1},{key:`ul_multi`,type:`integer`,description:`Spaces for multi-line unordered list items`,default:1,minimum:1},{key:`ol_multi`,type:`integer`,description:`Spaces for multi-line ordered list items`,default:1,minimum:1}]},{id:`MD031`,alias:`blanks-around-fences`,aliases:[`blanks-around-fences`],name:`Fenced code blocks should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md031.md`,tags:[`blank_lines`,`code`],options:[{key:`list_items`,type:`boolean`,description:`Include list items`,default:!0}]},{id:`MD032`,alias:`blanks-around-lists`,aliases:[`blanks-around-lists`],name:`Lists should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md032.md`,tags:[`bullet`,`ul`,`blank_lines`,`ol`],options:[]},{id:`MD033`,alias:`no-inline-html`,aliases:[`no-inline-html`],name:`Inline HTML`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md033.md`,tags:[`html`],options:[{key:`allowed_elements`,type:`string-array`,description:`Allowed elements`,default:[]},{key:`table_allowed_elements`,type:`string-array`,description:`Allowed elements in tables`,default:[]}]},{id:`MD034`,alias:`no-bare-urls`,aliases:[`no-bare-urls`],name:`Bare URL used`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md034.md`,tags:[`links`,`url`],options:[]},{id:`MD035`,alias:`hr-style`,aliases:[`hr-style`],name:`Horizontal rule style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md035.md`,tags:[`hr`],options:[{key:`style`,type:`string`,description:`Horizontal rule style`,default:`consistent`}]},{id:`MD036`,alias:`no-emphasis-as-heading`,aliases:[`no-emphasis-as-heading`],name:`Emphasis used instead of a heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md036.md`,tags:[`headings`,`emphasis`],options:[{key:`punctuation`,type:`string`,description:`Punctuation characters`,default:`.,;:!?。,;:!?`}]},{id:`MD037`,alias:`no-space-in-emphasis`,aliases:[`no-space-in-emphasis`],name:`Spaces inside emphasis markers`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md037.md`,tags:[`whitespace`,`emphasis`],options:[]},{id:`MD038`,alias:`no-space-in-code`,aliases:[`no-space-in-code`],name:`Spaces inside code span elements`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md038.md`,tags:[`whitespace`,`code`],options:[]},{id:`MD039`,alias:`no-space-in-links`,aliases:[`no-space-in-links`],name:`Spaces inside link text`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md039.md`,tags:[`whitespace`,`links`],options:[]},{id:`MD040`,alias:`fenced-code-language`,aliases:[`fenced-code-language`],name:`Fenced code blocks should have a language specified`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md040.md`,tags:[`code`,`language`],options:[{key:`allowed_languages`,type:`string-array`,description:`List of languages`,default:[]},{key:`language_only`,type:`boolean`,description:`Require language only`,default:!1}]},{id:`MD041`,alias:`first-line-heading`,aliases:[`first-line-heading`,`first-line-h1`],name:`First line in a file should be a top-level heading`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md041.md`,tags:[`headings`],options:[{key:`allow_preamble`,type:`boolean`,description:`Allow content before first heading`,default:!1},{key:`front_matter_title`,type:`string`,description:`RegExp for matching title in front matter`,default:`^\\s*title\\s*[:=]`},{key:`level`,type:`integer`,description:`Heading level`,default:1,minimum:1,maximum:6}]},{id:`MD042`,alias:`no-empty-links`,aliases:[`no-empty-links`],name:`No empty links`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md042.md`,tags:[`links`],options:[]},{id:`MD043`,alias:`required-headings`,aliases:[`required-headings`],name:`Required heading structure`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md043.md`,tags:[`headings`],options:[{key:`headings`,type:`string-array`,description:`List of headings`,default:[]},{key:`match_case`,type:`boolean`,description:`Match case of headings`,default:!1}]},{id:`MD044`,alias:`proper-names`,aliases:[`proper-names`],name:`Proper names should have the correct capitalization`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md044.md`,tags:[`spelling`],options:[{key:`names`,type:`string-array`,description:`List of proper names`,default:[]},{key:`code_blocks`,type:`boolean`,description:`Include code blocks`,default:!0},{key:`html_elements`,type:`boolean`,description:`Include HTML elements`,default:!0}]},{id:`MD045`,alias:`no-alt-text`,aliases:[`no-alt-text`],name:`Images should have alternate text (alt text)`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md045.md`,tags:[`accessibility`,`images`],options:[]},{id:`MD046`,alias:`code-block-style`,aliases:[`code-block-style`],name:`Code block style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md046.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Block style`,enum:[`consistent`,`fenced`,`indented`],default:`consistent`}]},{id:`MD047`,alias:`single-trailing-newline`,aliases:[`single-trailing-newline`],name:`Files should end with a single newline character`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md047.md`,tags:[`blank_lines`],options:[]},{id:`MD048`,alias:`code-fence-style`,aliases:[`code-fence-style`],name:`Code fence style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md048.md`,tags:[`code`],options:[{key:`style`,type:`enum`,description:`Code fence style`,enum:[`consistent`,`backtick`,`tilde`],default:`consistent`}]},{id:`MD049`,alias:`emphasis-style`,aliases:[`emphasis-style`],name:`Emphasis style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md049.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Emphasis style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD050`,alias:`strong-style`,aliases:[`strong-style`],name:`Strong style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md050.md`,tags:[`emphasis`],options:[{key:`style`,type:`enum`,description:`Strong style`,enum:[`consistent`,`asterisk`,`underscore`],default:`consistent`}]},{id:`MD051`,alias:`link-fragments`,aliases:[`link-fragments`],name:`Link fragments should be valid`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md051.md`,tags:[`links`],options:[{key:`ignore_case`,type:`boolean`,description:`Ignore case of fragments`,default:!1},{key:`ignored_pattern`,type:`string`,description:`Pattern for ignoring additional fragments`,default:``}]},{id:`MD052`,alias:`reference-links-images`,aliases:[`reference-links-images`],name:`Reference links and images should use a label that is defined`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md052.md`,tags:[`links`,`images`],options:[{key:`ignored_labels`,type:`string-array`,description:`Ignored link labels`,default:[`x`]},{key:`shortcut_syntax`,type:`boolean`,description:`Include shortcut syntax`,default:!1}]},{id:`MD053`,alias:`link-image-reference-definitions`,aliases:[`link-image-reference-definitions`],name:`Link and image reference definitions should be needed`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md053.md`,tags:[`links`,`images`],options:[{key:`ignored_definitions`,type:`string-array`,description:`Ignored definitions`,default:[`//`]}]},{id:`MD054`,alias:`link-image-style`,aliases:[`link-image-style`],name:`Link and image style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md054.md`,tags:[`links`,`images`],options:[{key:`autolink`,type:`boolean`,description:`Allow autolinks`,default:!0},{key:`inline`,type:`boolean`,description:`Allow inline links and images`,default:!0},{key:`full`,type:`boolean`,description:`Allow full reference links and images`,default:!0},{key:`collapsed`,type:`boolean`,description:`Allow collapsed reference links and images`,default:!0},{key:`shortcut`,type:`boolean`,description:`Allow shortcut reference links and images`,default:!0},{key:`url_inline`,type:`boolean`,description:`Allow URLs as inline links`,default:!0}]},{id:`MD055`,alias:`table-pipe-style`,aliases:[`table-pipe-style`],name:`Table pipe style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md055.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table pipe style`,enum:[`consistent`,`leading_only`,`trailing_only`,`leading_and_trailing`,`no_leading_or_trailing`],default:`consistent`}]},{id:`MD056`,alias:`table-column-count`,aliases:[`table-column-count`],name:`Table column count`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md056.md`,tags:[`table`],options:[]},{id:`MD058`,alias:`blanks-around-tables`,aliases:[`blanks-around-tables`],name:`Tables should be surrounded by blank lines`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md058.md`,tags:[`table`],options:[]},{id:`MD059`,alias:`descriptive-link-text`,aliases:[`descriptive-link-text`],name:`Link text should be descriptive`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md059.md`,tags:[`links`,`accessibility`],options:[{key:`prohibited_texts`,type:`string-array`,description:`Prohibited link texts`,default:[`click here`,`here`,`link`,`more`]}]},{id:`MD060`,alias:`table-column-style`,aliases:[`table-column-style`],name:`Table column style`,docUrl:`https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md060.md`,tags:[`table`],options:[{key:`style`,type:`enum`,description:`Table column style`,enum:[`any`,`aligned`,`compact`,`tight`],default:`any`},{key:`aligned_delimiter`,type:`boolean`,description:`Aligned delimiter columns`,default:!1}]}],g8=(()=>{let e=new Map;for(let t of h8){e.set(t.id.toUpperCase(),t.id);for(let n of t.aliases)e.set(n.toUpperCase(),t.id)}return e})();function _8(e){return g8.get(e.toUpperCase())??null}function v8(e,t){let n=_8(t);if(n===null)return;let r;for(let[t,i]of Object.entries(e))_8(t)===n&&(r={key:t,value:i});return r}var y8=[`Headings`,`Lists`,`Whitespace`,`Code`,`Links & images`,`Style`],b8=[[`headings`,`Headings`],[`bullet`,`Lists`],[`ul`,`Lists`],[`ol`,`Lists`],[`links`,`Links & images`],[`images`,`Links & images`],[`accessibility`,`Links & images`],[`code`,`Code`],[`language`,`Code`],[`emphasis`,`Style`],[`html`,`Style`],[`line_length`,`Whitespace`],[`whitespace`,`Whitespace`],[`hard_tab`,`Whitespace`],[`blank_lines`,`Whitespace`],[`indentation`,`Whitespace`]];function x8(e){for(let[t,n]of b8)if(e.tags.includes(t))return n;return`Style`}async function S8(e,t,n){if(!t.enabled)return[];let r=[];for(let i of Q6){let a=t.plugins[i.id];a.enabled&&r.push(...await i.lint(e,a,{docName:n}))}return r}var C8=/\p{M}+/gu,w8=/[^\p{L}\p{N}]+/gu,T8=/^-+|-+$/g;function E8(e){return e.trim().normalize(`NFKD`).replace(C8,``).toLowerCase().replace(w8,`-`).replace(T8,``)}function D8(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function O8(e,t){let n=E8(e);return n?D8(n,t):``}function k8(e,t){let n=E8(e);return t?`#${n}-${E8(t)}`:`#${n}`}var A8=new Set([`img`,`video`,`audio`,`mark`]),j8=new Map(E1.flatMap(e=>e.surface===`compat`&&A8.has(e.rendersAs)?[[e.name,e]]:[]));function M8(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function N8(e){let t=e.name;if(!t||!A8.has(t))return null;let n=M8(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function P8(e){let t=e.name;if(!t)return null;let n=j8.get(t);if(!n)return null;let r=M8(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var F8=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:k8(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},I8=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:k8(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},L8=(e,t)=>{let n=t,r=N8(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=P8(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,a),e.applyData(t,a)},R8=(e,t)=>{let n=t,r=N8(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=P8(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,a),e.applyData(t,a)},z8=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},B8=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function V8(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(V8).join(``):``}var H8={wikiLink:F8,wikiLinkEmbed:I8,mdxJsxFlowElement:L8,mdxJsxTextElement:R8,rawMdxFallback:z8,mark:B8,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:V8(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:V8(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},U8=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,W8=/\bexpression\s*\(/i,G8=1e4;function K8(e){return!(e.length>G8||U8.test(e)||W8.test(e))}function q8(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!uY(e.split(/\s+/)[0]??``))return!1}return!0}var J8={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},Y8=new Set([`href`,`src`]),X8=Oe(`<>`),Z8=()=>e=>{D(e,`element`,e=>{let t=J8[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?W0(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(Y8.has(e))if(t===`<>`||t===X8)r=``;else{let e=W0(t);r=e===t?t:Oe(e)}else r=W0(t);r!==t&&(n[e]=r)}})},Q8=()=>e=>{D(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!uY(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!uY(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!uY(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!q8(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!q8(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!uY(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!K8(r)&&delete n.style})};function $8(e){let t=k().use(Te,{handlers:H8}).use(Z8).use(Q8).use(LU),n=t.runSync(e);return String(t.stringify(n))}function e5(e){let t=/\r?\n|\r/g,n=[],r=0,i=t.exec(e);for(;i!==null;)n.push(t5(e.slice(r,i.index),r>0,!0),i[0]),r=i.index+i[0].length,i=t.exec(e);return n.push(t5(e.slice(r),r>0,!1)),n.join(``)}function t5(e,t,n){let r=0,i=e.length,a=e=>e===9||e===32;for(;t&&r<i&&a(e.charCodeAt(r));)r++;for(;n&&i>r&&a(e.charCodeAt(i-1));)i--;return i>r?e.slice(r,i):``}var n5=/\r?\n|\r/,r5=(e,t)=>{let n=e5(String(t.value));if(!n5.test(n)){let r={type:`text`,value:n};return e.patch(t,r),e.applyData(t,r)}let r=n.split(n5),i=[];for(let e=0;e<r.length;e++)e>0&&i.push({type:`element`,tagName:`br`,properties:{},children:[]}),r[e].length>0&&i.push({type:`text`,value:r[e]});return i};function i5(e){let t=k().use(ve).use(lF,[`yaml`]).use(A4).use(le).use(h3).use(L0).use(q4).use(Q0).use(Te,{handlers:{...H8,text:r5}}).use(Z8).use(Q8).use(LU);return String(t.processSync(F0(Z0(e))))}oL(),TI(),EI();var a5=`frontmatter`,o5=[`text`,`number`,`boolean`,`date`,`list`,`object`];V(o5);var s5=Ou([I(),L(),R()]),c5=ad(()=>Ou([s5.transform(e=>String(e)),Pu(I(),l5),z(c5)])),l5=ad(()=>Ou([I(),L(),R(),z(c5),Pu(I(),l5)])),u5=/^\d{4}-\d{2}-\d{2}$/;function d5(e){return typeof e==`string`&&u5.test(e)}function f5(e){return Array.isArray(e)?`list`:typeof e==`object`&&e?`object`:typeof e==`boolean`?`boolean`:typeof e==`number`?`number`:d5(e)?`date`:`text`}function p5(e){if(Array.isArray(e)){let t=[];for(let n of e)n!==null&&t.push(p5(n));return t}if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=r===null?``:p5(r);return t}return e}var m5=dd(p5,Pu(I(),l5)),h5=Pu(I(),Ou([l5,yu()]));function g5(e){return!!(e===null||typeof e==`string`&&e===``||Array.isArray(e)&&e.length===0)}function _5(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!_5(e[n],t[n]))return!1;return!0}if(e!==null&&t!==null&&typeof e==`object`&&typeof t==`object`&&!Array.isArray(e)&&!Array.isArray(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.hasOwn(t,r)||!_5(e[r],t[r]))return!1;return!0}return!1}B({docName:jZ,summary:PZ,content:I().optional(),...NZ}).loose(),B({docName:jZ,summary:PZ,markdown:I(),position:V([`append`,`prepend`,`replace`]).optional(),extension:V(bJ).optional(),...NZ}).loose(),B({docName:jZ,summary:PZ,find:I().min(1),replace:I(),offset:L().int().nonnegative().optional(),...NZ}).loose(),B({docName:jZ,connectionId:I().min(1),scope:V([`last`,`session`,`file`,`count`]).optional(),count:L().int().positive().optional(),...NZ}).loose().refine(e=>e.scope!==`count`||e.count!==void 0,{message:`count is required when scope is 'count'`,path:[`count`]});var v5=B({value:I(),truncatedFrom:L().int().nonnegative().optional(),hint:I().optional()}).loose(),y5=Au(`kind`,[B({kind:H(`inline`),content:I()}),B({kind:H(`truncated`),byteLength:L().int().nonnegative(),hint:I()})]),b5=B({kind:H(`content-divergence`),intendedBytes:L().int().nonnegative(),actualBytes:L().int().nonnegative(),byteDelta:L().int(),divergenceType:I().optional(),currentState:y5.optional(),hint:I().optional()}).loose(),x5=B({type:H(`orphan`),parentCandidates:z(I()),message:I()}).loose(),S5=B({kind:H(`disk-edit-reconciled`),intendedBytes:L().int().nonnegative(),actualBytes:L().int().nonnegative(),byteDelta:L().int(),mergeOutcome:I().optional(),hint:I().optional()}).loose(),C5=Au(`kind`,[b5,S5]),w5=z(Au(`kind`,[b5,S5,B({kind:H(`mermaid-parse-error`),fenceIndex:L().int().positive(),fenceFirstLine:I(),message:I(),line:L().int().positive().optional()}).loose(),B({kind:H(`lint-violation`),source:I(),code:I(),message:I(),severity:V([`error`,`warning`,`info`,`hint`]),line:L().int().positive(),column:L().int().positive(),linkTarget:I().optional()}).loose()])).min(1),T5=z(B({href:I(),resolvedTo:I().nullable(),reason:V([`no-such-doc`,`no-such-file`,`unresolvable`])}).loose());B({timestamp:I().min(1),summary:v5.optional(),warning:C5.optional(),warnings:w5.optional()}).loose(),B({timestamp:I().min(1),subscriberCount:L().int().nonnegative(),systemSubscriberCount:L().int().nonnegative(),hints:z(x5).optional(),summary:v5.optional(),warning:C5.optional(),warnings:w5.optional(),brokenLinks:T5}).loose(),B({timestamp:I().min(1),subscriberCount:L().int().nonnegative(),systemSubscriberCount:L().int().nonnegative(),summary:v5.optional(),warning:C5.optional(),warnings:w5.optional(),brokenLinks:T5}).loose(),B({docName:I().min(1),scope:V([`last`,`session`,`count`]),undone:R()}).loose(),B({docs:z(B({docName:MZ,markdown:I(),position:V([`append`,`prepend`,`replace`]).optional(),extension:V(bJ).optional(),summary:PZ}).loose()).min(1).max(100),...NZ}).loose();var E5=B({type:eQ,title:I(),detail:I().optional()}).loose(),D5=Au(`status`,[B({status:H(`written`),docName:I().min(1),summary:v5.optional(),warnings:w5.optional(),brokenLinks:T5}).loose(),B({status:H(`error`),docName:I().min(1),error:E5}).loose()]);B({timestamp:I().min(1),results:z(D5),written:L().int().nonnegative(),failed:L().int().nonnegative()}).loose(),B({docName:jZ,patch:Pu(I(),Ou([l5,yu()])),types:Pu(I(),V(o5)).optional(),summary:PZ,...NZ}).loose(),B({timestamp:I().min(1),subscriberCount:L().int().nonnegative(),systemSubscriberCount:L().int().nonnegative(),appliedKeys:z(I()),summary:v5.optional(),warning:C5.optional(),warnings:w5.optional(),brokenLinks:T5}).loose(),B({entries:z(B({level:V([`info`,`warn`,`error`]),message:I().max(kq),event:I().optional(),fields:Pu(I(),xu()).optional(),ts:L().optional(),sourceId:I().optional(),lineNumber:L().optional()}).loose()).max(100),droppedSinceLastFlush:L().int().min(0).optional()}).loose(),B({accepted:L().int().min(0)}).loose();var O5=B({status:I().min(1),reason:I()}).loose(),k5=B({docName:I().min(1),content:I(),lifecycle:O5.nullable()}).loose(),A5=B({kind:V([`document`,`asset`,`folder`,`file`]).default(`document`),docName:I().min(1).optional(),docExt:I().min(1).default(`.md`),size:L().int().nonnegative(),modified:I().min(1),isSymlink:R().default(!1),canonicalDocName:I().nullable().default(null),targetPath:I().nullable().default(null),path:I().min(1).optional(),assetExt:I().min(1).optional(),mediaKind:V([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`]).nullable().optional(),referencedBy:z(I().min(1)).optional(),hasChildren:R().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`}),j5=B({documents:z(A5),truncated:R().optional()}).loose(),M5=B({source:I().min(1),anchor:I().nullable(),title:I(),snippet:I().nullable()}).loose(),N5=B({docName:I().min(1),backlinks:z(M5)}).loose(),P5=B({counts:Pu(I().min(1),L().int().nonnegative())}).loose(),F5=Au(`kind`,[B({kind:H(`doc`),docName:I().min(1),anchor:I().nullable(),title:I(),snippet:I().nullable()}).loose(),B({kind:H(`external`),url:I().min(1),title:I(),snippet:I().nullable()}).loose()]),I5=B({docName:I().min(1),forwardLinks:z(F5)}).loose(),L5=Au(`kind`,[B({id:I().min(1),kind:H(`doc`),docName:I().min(1),anchor:I().nullable(),label:I(),cluster:I().nullable(),category:I().nullable(),tags:z(I()).nullable()}).loose(),B({id:I().min(1),kind:H(`external`),url:I().min(1),label:I()}).loose()]),R5=B({source:I().min(1),target:I().min(1)}).loose(),z5=B({nodes:z(L5),links:z(R5)}).loose(),B5=B({ts:L().int().min(0),url:I(),method:I(),ua:I().optional(),origin:I().optional(),referer:I().optional(),host:I().optional(),remote:I().optional(),secChUa:I().optional(),secChUaMobile:I().optional(),secChUaPlatform:I().optional(),secFetchSite:I().optional(),secFetchDest:I().optional(),secFetchMode:I().optional(),secFetchUser:I().optional()}).loose(),V5=B({app:Ou([H(`cursor`),H(`codex`),H(`claude`),yu()]),signals_fired:z(I())}).loose();B({entries:z(B5),count:L().int().min(0),detection:V5}).loose(),B({writers:z(B({id:I().min(1),name:I().optional(),email:I().optional()}).loose()).optional(),summary:PZ,...NZ}).loose(),B({checkpointRef:I().min(1)}).loose();var H5=B({v:L().int().optional(),id:I().min(1),name:I().min(1),colorSeed:I().optional(),docs:z(I()),summaries:z(I()).optional()}).loose();B({entries:z(B({sha:I().min(1),timestamp:I().min(1),author:I(),authorEmail:I(),type:V([`checkpoint`,`wip`,`upstream`,`park`]),message:I(),contributors:z(H5),checkpoint:xu().nullable(),parentSha:I().nullable().optional()}).loose()),total:L().int().nonnegative().optional(),truncated:R().optional(),hasMore:R().optional()}).loose(),B({sha:I().regex(/^[0-9a-f]{40}$/i),content:I(),timestamp:I(),author:I()}).loose();var U5=B({contentDir:I().min(1),pathSeparator:V([`/`,`\\`]),symlinkResolved:R()}).loose();z(Au(`source`,[B({docName:I().min(1),timestamp:I().min(1),size:L().int().nonnegative(),source:H(`flat`)}).loose(),B({docName:I().min(1),timestamp:I().min(1),source:H(`timeline`),sha:I().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var W5=B({domain:I().min(1),title:I().optional(),description:I().optional(),siteName:I().optional(),faviconDataUri:I().optional()}).loose();B({url:I()}).loose();var G5=Au(`ok`,[B({ok:H(!0),metadata:W5}).loose(),B({ok:H(!1),reason:I()}).loose()]),K5=B({orphans:z(B({docName:I().min(1),title:I()}).loose())}).loose(),q5=B({hubs:z(B({docName:I().min(1),title:I(),count:L().int().nonnegative()}).loose())}).loose(),J5=B({source:I().min(1),title:I(),snippet:I().nullable()}).loose();B({deadLinks:z(B({target:I().min(1),sources:z(J5)}).loose())}).loose(),B({target:B({docName:I().min(1),title:I(),aliases:z(I())}).loose(),mentions:z(B({source:I().min(1),excerpt:I(),offset:L().int().nonnegative()}).loose()),truncated:R()}).loose(),B({projectPath:I().min(1)}).loose();var Y5=V([`not-a-git-worktree`,`init-failed`]);Au(`ok`,[B({ok:H(!0),projectPath:I().min(1)}).loose(),B({ok:H(!1),reason:Y5,message:I().min(1)}).loose()]),B({host:I().min(1).optional()}).loose(),B({host:I().min(1).optional(),token:I().min(1)}).loose(),B({host:I(),login:I()}).loose(),B({key:I().min(1)}).loose(),B({keyPresent:R()}).loose();var X5=V([`no_key`,`invalid_endpoint`,`rate_limit`,`timeout`,`http_error`,`network`,`dims_mismatch`,`malformed_response`]),Z5=Au(`ok`,[B({ok:H(!0),endpoint:I().min(1),model:I().min(1),dimensions:L().int().positive()}).loose(),B({ok:H(!1),endpoint:I().min(1),model:I().min(1),reason:X5,status:L().int().optional()}).loose()]);B({name:I().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:I().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),B({authenticated:R()}).loose(),B({}).loose();var Q5=B({stackIndex:L().int().min(0),ts:L().int().min(0),additions:L().int().min(0),deletions:L().int().min(0)}).loose(),$5=B({docName:I().min(1),additionsTotal:L().int().min(0),deletionsTotal:L().int().min(0),lastTs:L().int().min(0),bursts:z(Q5)}).loose(),e7=B({displayName:I().min(1),color:I().min(1),icon:I().optional(),connectionId:I().min(1)}).loose(),t7=B({sessionAlive:R(),agent:e7.nullable(),files:z($5)}).loose(),n7=B({diff:I(),before:I(),after:I(),generatedAt:L().int().min(0)}).loose();B({}).loose(),B({}).loose(),B({}).loose(),B({}).loose(),B({}).loose(),B({}).loose();var r7=B({displayName:I().min(1),icon:I(),color:I().min(1),currentDoc:I().nullable(),mode:V([`idle`,`writing`]),ts:L().int().min(0)}).loose();B({presence:Pu(I().min(1),r7)}).loose();var i7=B({sessionId:I().min(1),agentType:I().min(1),ts:L().int().min(0),insertedChars:L().int().min(0),deletedChars:L().int().min(0)}).loose();B({effects:z(B({"doc.name":I().min(1),entries:z(i7)}).loose())}).loose(),B({decisions:z(B({ts:L().int().min(0),decision:I().min(1),kind:I().min(1),"doc.name":I().min(1),pathRole:I().min(1)}).loose())}).loose(),Pu(I().min(1),R()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),B({path:I().min(1,`path must be non-empty`)}).loose(),B({}).loose();var a7=B({fromDocName:I().min(1),toDocName:I().min(1)}).loose(),o7=B({fromPath:I().min(1),toPath:I().min(1)}).loose();B({}).loose(),B({path:I().min(1),...NZ,summary:PZ}).loose();var s7=B({docName:I().min(1)}).loose();B({path:I().min(1),...NZ,summary:PZ}).loose();var c7=B({path:I().min(1)}).loose();B({kind:V([`file`,`folder`]),path:I().min(1),...NZ,summary:PZ}).loose();var l7=B({kind:V([`file`,`folder`]),path:I().min(1),duplicatedDocNames:z(I().min(1))}).loose(),u7=B({pages:z(B({docName:I().min(1),title:I(),docExt:I().min(1),size:L().int().nonnegative(),modified:I().min(1),icon:I().min(1).max(2048).optional()}).loose())}).loose(),d7=B({level:L().int().min(1).max(6),text:I(),slug:I()}).loose(),f7=B({docName:I().min(1),headings:z(d7)}).loose(),p7=B({docName:I().min(1),rewrites:L().int().nonnegative()}).loose();B({kind:V([`file`,`folder`,`asset`]),fromPath:I().min(1),toPath:I().min(1),...NZ,summary:PZ}).loose();var m7=B({renamed:z(a7),renamedAssets:z(o7),rewrittenDocs:z(p7).optional(),summary:v5.optional()}).loose();B({kind:V([`file`,`folder`,`asset`]),path:I().min(1),...NZ}).loose();var h7=B({deletedDocNames:z(I().min(1))}).loose();B({kind:V([`file`,`folder`,`asset`]),path:I().min(1),...NZ,summary:PZ}).loose();var g7=B({deletedDocNames:z(I().min(1))}).loose();B({docName:I().min(1),commitSha:I().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:PZ,...NZ}).loose(),B({restoredFrom:I().min(1),timestamp:I().min(1),summary:v5.optional(),warning:b5.optional(),warnings:w5.optional()}).loose();var _7=V([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),v7=B({label:I().min(1),webUrl:Ql().nullable()}).loose(),y7=Au(`checkStatus`,[B({checkStatus:H(`allowed`)}).loose(),B({checkStatus:H(`denied`),deniedReason:V([`no-collaborator`,`private-no-access`,`repo-not-found`,`not-authenticated`])}).loose(),B({checkStatus:H(`unknown`),unknownError:V([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`,`ssh-unverified`]).optional()}).loose()]),b7=V([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]),x7=V(fd),S7=V([`succeeded`,`up-to-date`,`conflict`,`refused`,`error`]);B({state:_7,lastSyncUtc:I().nullable(),lastFetchUtc:I().nullable(),lastPushedSha:I().nullable(),ahead:L().int().min(0),behind:L().int().min(0),consecutiveFailures:L().int().min(0),conflictCount:L().int().min(0),hasRemote:R(),syncEnabled:R(),identityUnresolved:R(),remote:v7.nullable().optional(),pushError:I().optional(),pushErrorCode:b7.optional(),pullError:I().optional(),pullErrorCode:b7.optional(),pausedReason:I().optional(),pushPermission:y7.optional(),syncMode:x7.optional(),lastPullUtc:I().nullable().optional(),lastPullOutcome:S7.nullable().optional()}).loose(),B({op:V([`sync`,`push`,`pull`]).optional()}).loose(),B({op:V([`sync`,`push`,`pull`])}).loose(),B({conflicts:z(B({file:I().min(1),detectedAt:I().min(1),oursSha:I().optional(),theirsSha:I().optional(),baseSha:I().optional()}).loose())}).loose(),B({file:I().min(1),strategy:V([`mine`,`theirs`,`content`,`delete`]),content:I().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),B({}).loose(),B({file:I().min(1),base:I(),ours:I(),theirs:I(),kind:V([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:I().nullable()}).loose(),B({plan:sd(e=>e!==void 0,{message:`plan is required`})}).loose(),B({plan:sd(e=>e!==void 0,{message:`plan is required`})}).loose(),B({result:sd(e=>e!==void 0,{message:`result is required`})}).loose();var C7=B({path:I().min(1),summary:I().min(1)}).loose(),w7=B({files:L().int().nonnegative(),folders:L().int().nonnegative()}).loose();B({packs:z(B({id:I().min(1),name:I().min(1),description:I().min(1),defaultSubfolder:I().optional(),folders:z(C7),entryCounts:w7}).loose())}).loose(),B({noOpen:R().optional(),out:I().min(1).optional()}).loose();var T7=B({reason:V([`unsupported-platform`,`spawn-error`]),message:I()}).loose();Au(`status`,[B({status:H(`installed`),outputPath:I(),size:L().int().nonnegative(),sha256:I(),skillVersion:I()}).loose(),B({status:H(`built`),outputPath:I(),size:L().int().nonnegative(),sha256:I(),skillVersion:I(),handoffError:T7.optional()}).loose(),B({status:H(`failed`),buildError:I()}).loose(),B({status:H(`skip-current`),skillVersion:I(),recordedAt:I().optional()}).loose()]);var E7=V(DJ);Eu({schema:H(1),targets:z(E7).default([])}),B({tags:z(B({name:I().min(1),count:L().int().nonnegative(),isLeaf:R()}).loose())}).loose();var D7=B({docName:I().min(1),title:I(),matchingTags:z(I().min(1)),snippet:I().nullable()}).loose();B({name:I().min(1),docs:z(D7)}).loose(),B({folder:xu(),frontmatter_local:Pu(I(),xu()).nullable()}).loose(),B({path:I(),frontmatter:Pu(I(),xu()).optional()}).loose(),B({applied:xu()}).loose();var O7=Pu(I(),xu()).meta({description:`Free-form frontmatter map embedded in template payloads.`});B({template:B({name:I().min(1),folder:I(),scope:V([`local`,`inherited`]),path:I().min(1),frontmatter:O7,body:I()}).strict()}).strict();var k7=B({templates:z(B({name:I().min(1),title:I().optional(),description:I().optional(),path:I().min(1),source_folder:I()}).strict()),truncated:R()}).strict();B({folder:I(),name:I(),body:I().optional(),frontmatter:O7.optional(),...NZ,summary:PZ}).strict(),B({path:I().min(1),created:R(),warnings:z(I())}).strict(),B({sourcePath:I().min(1),targetFolder:I(),name:I().optional(),title:I().optional(),deleteSource:R().optional(),...NZ,summary:PZ}).strict(),B({path:I().min(1),created:R(),warnings:z(I())}).strict(),B({existed:R(),path:I().min(1)}).strict(),B({fromFolder:I(),fromName:I(),toFolder:I(),toName:I(),body:I().optional(),frontmatter:O7.optional(),...NZ,summary:PZ}).strict(),B({from:I().min(1),to:I().min(1),committed:R()}).strict();var A7=V(cJ),j7=/^[a-z0-9-]+$/,M7=/^[A-Za-z0-9_-]+$/,N7=B({name:I(),description:I()}).strict();B({skill:B({name:I().min(1),scope:A7,path:I().min(1),frontmatter:N7,body:I(),files:z(B({path:I().min(1),text:I().nullable()})).optional(),managed:R().optional()}).strict()}).strict();var P7=B({skills:z(B({name:I().min(1),description:I().optional(),scope:A7,path:I().min(1),absolutePath:I().min(1).optional(),installed:R(),hosts:z(I()),installedVersion:I().optional(),bundledVersion:I().optional(),updateAvailable:R().optional(),managed:R().optional()}).strict()),truncated:R()}).strict();B({scope:A7.default(`project`),name:I(),body:I().optional(),frontmatter:N7,...NZ,summary:PZ}).strict(),B({path:I().min(1),created:R(),warnings:z(I())}).strict(),B({scope:A7.default(`project`),name:I(),...NZ,summary:PZ}).strict(),B({name:I().min(1),version:I().min(1),previousVersion:I().optional(),checkpointRef:I().optional()}).strict(),B({existed:R(),path:I().min(1)}).strict(),B({scope:A7.default(`project`),fromName:I(),toName:I(),body:I().optional(),frontmatter:N7.optional(),...NZ,summary:PZ}).strict(),B({from:I().min(1),to:I().min(1),committed:R()}).strict();var F7=V([`reference`,`script`]);B({scope:A7.default(`project`),name:I(),path:I().min(1),content:I(),...NZ,summary:PZ}).strict(),B({path:I().min(1),created:R(),kind:F7,content:R()}).strict(),B({path:I().min(1),kind:F7,text:I()}).strict(),B({path:I().min(1),existed:R(),kind:F7}).strict(),B({scope:A7.default(`project`),name:I(),targets:z(E7).optional().meta({description:`Explicit editor ids to install into; omit to use project-configured editors.`}),...NZ,summary:PZ}).strict(),B({name:I().min(1),hosts:z(I()),scripts:R(),warnings:z(I()),warningCodes:z(V([`no-targets`,`scripts-present`]))}).strict(),B({scope:A7.default(`project`),name:I()}).strict(),B({name:I().min(1),uninstalled:R()}).strict();var I7=B({targets:z(E7),configured:R()}).strict();B({targets:z(E7)}).strict(),B({targets:z(E7),reprojected:z(B({name:I(),hosts:z(I())}).strict()),bundleHosts:z(I()),removedFrom:z(I())}).strict(),B({scope:A7.default(`project`),name:I(),version:I().regex(/^[0-9a-f]{40}$/i),...NZ,summary:PZ}).strict(),B({name:I().min(1),version:I(),restoredFiles:z(I()),warnings:z(I())}).strict(),B({query:I().optional(),intent:V([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:V([`navigation`,`relevance`]).optional(),scopes:z(V([`page`,`folder`,`content`,`file`])).optional(),scope:I().optional(),limit:L().int().nonnegative().optional(),semantic:R().optional(),source:V([`omnibar`,`mcp`,`http`]).optional()}).loose();var L7=B({kind:V([`page`,`folder`,`content`,`file`]),path:I().min(1),title:I(),score:L(),signals:Pu(I(),xu()),snippet:I().optional()}).loose(),R7=B({capable:R(),applied:R(),coverage:B({embedded:L().int().nonnegative(),total:L().int().nonnegative()})}).loose();B({enabled:R(),keyPresent:R(),keyNotRequired:R(),keySource:V([`project`,`file`,`env`]).nullable(),keyHint:I().nullable(),ready:R(),capable:R(),embedded:L().int().nonnegative(),total:L().int().nonnegative()}).loose(),B({query:I(),intent:V([`autocomplete`,`full_text`,`omnibar`]),results:z(L7),elapsedMs:L().nonnegative(),semantic:R7.optional(),truncated:R().optional(),ready:R().optional()}).loose();var z7=B({version:I().min(1),recordedAt:I().min(1)}).loose();B({currentVersion:I().min(1),targets:Pu(I(),z7.nullable())}).loose();var B7=`server-info`,V7=`branch-switched`,H7=`disk-ack`,U7=`config-validation-rejected`,W7=`config-ignore-nested-error`,G7=V([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`,`lint-config`]),K7=B({v:H(1),ch:H(B7),seq:L(),serverInstanceId:I().min(1),currentBranch:I().min(1).optional()}).loose(),q7=B({v:H(1),ch:H(V7),seq:L(),branch:I().min(1)}).loose(),J7=B({v:H(1),ch:G7,seq:L()}).loose(),Y7=B({v:H(1),ch:H(H7),seq:L(),docName:I().min(1),sv:I().min(1)}).loose(),X7=B({v:H(1),ch:H(U7),seq:L(),docName:I().min(1),error:np}).loose(),Z7=B({v:H(1),ch:H(W7),seq:L(),path:I().min(1),error:I().min(1)}).loose();function Q7(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function $7(e){if(typeof e!=`string`||e.length===0)return e;let t=$$(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(J$(e)){let t=Q7(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=G$(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var e9=`https://api.github.com/repos/inkeep/open-knowledge`;async function ete(e){let{signal:t,...n}=e??{},r=t?AbortSignal.any([AbortSignal.timeout(5e3),t]):AbortSignal.timeout(5e3);try{let e=await fetch(e9,{headers:{accept:`application/vnd.github+json`,"user-agent":`openknowledge.ai`},...n,signal:r});if(!e.ok)return console.warn(`[github-stars] GitHub API responded ${e.status}`),null;let t=await e.json();return typeof t.stargazers_count==`number`?t.stargazers_count:null}catch(e){return console.warn(`[github-stars] fetch failed: ${e instanceof Error?e.message:String(e)}`),null}}function tte(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}new Cq.default;var nte=B({path:z(Ou([I(),L()])),message:I(),issueCode:I()});Au(`code`,[B({code:H(`SCHEMA_INVALID`),issues:z(nte)}),B({code:H(`WRITE_ERROR`),detail:I()})]);function rte(e){return{path:e.path.map(e=>typeof e==`symbol`?String(e):e),message:e.message,issueCode:e.code}}function ite(e){if(e.code!==`SCHEMA_INVALID`)return{};let t={};for(let n of e.issues){let e=n.path[0];typeof e==`string`&&(t[e]=t[e]?`${t[e]}; ${n.message}`:n.message)}return t}var ate={defaultKeyType:`PLAIN`,defaultStringType:`PLAIN`,lineWidth:0};function ote(e){if(e.trim()===``)return{doc:new _r({}),map:{}};let t;try{t=Ti(e)}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new _r({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=m5.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function ste(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function t9(e,t,n){if(Array.isArray(n)){let r=e.createNode(n),i=Ye(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}if(ste(n)){let r=e.createNode(n),i=Ke(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}return n}function cte(e){return e===``?``:`---\n${e.endsWith(`
|
|
557
|
+
`)?e.slice(0,-1):e}\n---\n`}var n9=65536;function r9(e){let t=e.match(YJ);return t?{fenced:t[0],body:e.slice(t[0].length)}:{fenced:``,body:e}}function lte(e){if(e.trim()===``)return{doc:new _r({}),map:{}};let t;try{t=Ti(e,{uniqueKeys:!1})}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new _r({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=m5.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function i9(e){return e===``?{doc:new _r({}),map:{}}:lte($J(e))}function a9(e){let{fenced:t}=r9(e),{map:n,parseError:r}=i9(t);return{map:n??{},parseError:r}}function o9(e){let{fenced:t}=r9(e);if(t===``)return[];let{doc:n,map:r}=i9(t);return r===null?[]:u9(n)}function s9(e){return typeof e==`object`&&!!e&&`key`in e}function c9(e){let t=e.key;return typeof t==`string`?t:t&&typeof t==`object`&&`value`in t&&typeof t.value==`string`?t.value:null}function l9(e,t){let n=e.key;if(typeof n==`string`){e.key=t;return}if(n&&typeof n==`object`){n.value=t;return}e.key=t}function u9(e){let t=e.contents;if(!t||!(`items`in t)||!Array.isArray(t.items))return[];let n=[];for(let e of t.items){if(!s9(e))continue;let t=c9(e);t!==null&&n.push(t)}return n}function d9(e){if(e.contents==null||!(`items`in e.contents)){let t=e.createNode({});return e.contents=t,t}return e.contents}function ute(e){let t=e.contents;return!t||!(`items`in t)||(t.items?.length??0)===0?``:cte(e.toString(ate))}function dte(e){let t=new TextEncoder().encode(e).byteLength;return t>65536?{kind:`region_too_large`,bytes:t,limit:n9}:null}function f9(e){let t=ute(e),n=dte(t);return n?{ok:!1,error:n}:{ok:!0,nextFenced:t}}function fte(e,t){if(Object.hasOwn(t,`frontmatter`))return{ok:!1,error:{kind:`reserved_key`,key:a5}};let{doc:n,map:r}=i9(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{d9(n);for(let[e,r]of Object.entries(t)){if(r===null){n.delete(e);continue}let t=l5.safeParse(r);if(!t.success)return{ok:!1,error:{kind:`invalid_value`,key:e,reason:t.error.issues[0]?.message??`invalid value`}};n.set(e,t9(n,n.get(e,!0),t.data))}return f9(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function pte(e,t,n,r={}){if(t===`frontmatter`||n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:a5}};let{doc:i,map:a}=i9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(t===n)return{ok:!0,nextFenced:e};let o=i.contents;if(!o||!(`items`in o)||!Array.isArray(o.items))return{ok:!1,error:{kind:`unknown_key`,key:t}};let s=o.items.find(e=>s9(e)&&c9(e)===t);if(!s)return{ok:!1,error:{kind:`unknown_key`,key:t}};if(!r.allowDuplicate&&o.items.some(e=>s9(e)&&e!==s&&c9(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return l9(s,n),f9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function p9(e,t){let{doc:n,map:r}=i9(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let i=n.contents;if(!i||!(`items`in i)||!Array.isArray(i.items))return{ok:!0,nextFenced:e};let a=u9(n);if(a.length!==t.length||!m9(a,t))return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};try{let e=i.items.filter(s9),r=[];for(let n of t){let i=e.findIndex(e=>c9(e)===n);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:a,got:[...t]}};let[o]=e.splice(i,1);o&&r.push(o)}return i.items=r,f9(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function m9(e,t){let n=new Map;for(let t of e)n.set(t,(n.get(t)??0)+1);for(let e of t){let t=(n.get(e)??0)-1;if(t<0)return!1;n.set(e,t)}for(let e of n.values())if(e!==0)return!1;return!0}function h9(e){if(e.length===0)return{kind:`invalid_path`,path:[...e],reason:`path must have at least one segment`};for(let t=0;t<e.length;t++){let n=e[t];if(typeof n!=`string`&&typeof n!=`number`)return{kind:`invalid_path`,path:[...e],reason:`path segment at index ${t} must be string or number`};if(typeof n==`number`&&(!Number.isInteger(n)||n<0))return{kind:`invalid_path`,path:[...e],reason:`numeric path segment at index ${t} must be a non-negative integer`}}return e[0]===`frontmatter`?{kind:`reserved_key`,key:a5}:null}function mte(e,t,n){let r=h9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=i9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=l5.safeParse(n);if(!o.success)return{ok:!1,error:{kind:`invalid_value`,key:String(t[t.length-1]),reason:o.error.issues[0]?.message??`invalid value`}};try{return d9(i),i.setIn(t,t9(i,i.getIn(t,!0),o.data)),f9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function hte(e,t){let n=h9(t);if(n)return{ok:!1,error:n};let{doc:r,map:i}=i9(e);if(i===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{return r.getIn(t,!0)===void 0?{ok:!0,nextFenced:e}:(r.deleteIn(t),f9(r))}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function gte(e,t){if(t.length===0){let t=e.contents;return Ke(t)?t:null}let n=e.getIn(t,!0);return Ke(n)?n:null}function _te(e,t,n,r={}){let i=h9(t);if(i)return{ok:!1,error:i};let a=t[t.length-1];if(typeof a!=`string`)return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot rename: last path segment must be a string (map key)`}};if(t.length===1&&n===`frontmatter`)return{ok:!1,error:{kind:`reserved_key`,key:a5}};let{doc:o,map:s}=i9(e);if(s===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};if(a===n)return{ok:!0,nextFenced:e};let c=gte(o,t.slice(0,-1));if(!c)return{ok:!1,error:{kind:`unknown_key`,key:a}};let l=c.items.find(e=>s9(e)&&c9(e)===a);if(!l)return{ok:!1,error:{kind:`unknown_key`,key:a}};if(!r.allowDuplicate&&c.items.some(e=>s9(e)&&e!==l&&c9(e)===n))return{ok:!1,error:{kind:`duplicate_target`,key:n}};try{return l9(l,n),f9(o)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function vte(e,t,n){if(t.length===0)return p9(e,n);let r=h9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=i9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Ke(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a map`}};let s=[];for(let e of o.items){if(!s9(e))continue;let t=c9(e);t!==null&&s.push(t)}if(s.length!==n.length||!m9(s,n))return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};try{let e=o.items.filter(s9),t=[];for(let r of n){let i=e.findIndex(e=>c9(e)===r);if(i===-1)return{ok:!1,error:{kind:`reorder_mismatch`,expected:s,got:[...n]}};let[a]=e.splice(i,1);a&&t.push(a)}return o.items=t,f9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function yte(e,t,n){let r=h9(t);if(r)return{ok:!1,error:r};let{doc:i,map:a}=i9(e);if(a===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};let o=i.getIn(t,!0);if(!Ye(o))return{ok:!1,error:{kind:`invalid_path`,path:[...t],reason:`cannot reorder: target is not a sequence`}};let s=o,c=s.items.length,l=Array.from({length:c},(e,t)=>t),u=[...n];if(!bte(u,c))return{ok:!1,error:{kind:`reorder_mismatch`,expected:l.map(String),got:u.map(String)}};try{let e=s.items.slice();return s.items=u.map(t=>e[t]),f9(i)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}function bte(e,t){if(e.length!==t)return!1;let n=Array(t).fill(!1);for(let r of e){if(!Number.isInteger(r)||r<0||r>=t||n[r])return!1;n[r]=!0}return!0}var xte=Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});function g9(e){return{ok:!1,error:e}}function Ste(e){return{ok:!0,...e}}function Cte(e){return{ok:!0,...e}}function wte(e){return{ok:!0,...e}}function _9(e){return{ok:!0,...e}}function v9(e){switch(e.kind){case`unknown_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`unknown key '${e.key}'`,issueCode:`unknown_key`}]};case`duplicate_target`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`key '${e.key}' already exists`,issueCode:`duplicate_target`}]};case`invalid_value`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:e.reason,issueCode:`invalid_value`}]};case`reserved_key`:return{code:`SCHEMA_INVALID`,issues:[{path:[e.key],message:`'${e.key}' is a reserved frontmatter key`,issueCode:`reserved_key`}]};case`reorder_mismatch`:return{code:`WRITE_ERROR`,detail:`reorder list does not match current keys (state changed mid-drag)`};case`region_too_large`:return{code:`SCHEMA_INVALID`,issues:[{path:[],message:`Frontmatter region exceeds ${n9}-byte limit (would be ${e.bytes})`,issueCode:`region_too_large`}]};case`parse_failed`:return{code:`WRITE_ERROR`,detail:`Frontmatter YAML is malformed; fix in source mode to commit (${e.reason})`};case`invalid_path`:return{code:`SCHEMA_INVALID`,issues:[{path:[...e.path],message:e.reason,issueCode:`invalid_path`}]}}}function Tte(e,t){if(e.parseError!==t.parseError||e.keys.length!==t.keys.length)return!1;for(let n=0;n<e.keys.length;n++)if(e.keys[n]!==t.keys[n])return!1;for(let n of e.keys)if(!_5(e.map[n],t.map[n]))return!1;return!0}var Ete=5;function y9(e){let t=e.toString();return{snapshot:Dte(t),raw:t}}function Dte(e){let{map:t,parseError:n}=a9(e);return{map:t,keys:o9(e),parseError:n}}function b9(e){return e.startsWith(`---`)}function Ote(e){let t=e.document,n=t.getText(`source`),r=new Set,i=y9(n),a=i.snapshot,o=r9(i.raw).fenced,s=b9(i.raw),c=!1;function l(e=!1){if(c)return;let t,i;try{let e=y9(n);t=e.snapshot,i=e.raw}catch(e){console.warn(`[bindFrontmatterDoc] readSnapshotFromYText threw:`,e);return}if(!e&&Tte(a,t)){s=b9(i);return}a=t,o=r9(i).fenced,s=b9(i);for(let e of r)try{e(t)}catch(e){console.warn(`[bindFrontmatterDoc] listener threw:`,e)}}let u=e=>{c||kte(e,o.length,s)&&l()};n.observe(u),e.on(`synced`,d);function d(){l(!0)}function f(e){let r;return t.transact(()=>{let{fenced:t}=r9(n.toString());r=e(t),r.ok&&r.nextFenced!==t&&(n.delete(0,t.length),r.nextFenced!==``&&n.insert(0,r.nextFenced))},xte),r??{ok:!1,error:{kind:`parse_failed`,reason:`commit transact produced no result`}}}function p(e){if(c)return g9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});if(Object.hasOwn(e,`frontmatter`))return g9({code:`SCHEMA_INVALID`,issues:[{path:[a5],message:`'${a5}' is a reserved frontmatter key`,issueCode:`reserved_key`}]});let t=h5.safeParse(e);if(!t.success)return g9({code:`SCHEMA_INVALID`,issues:t.error.issues.map(rte)});let n=t.data,r=Object.keys(n),i=f(e=>fte(e,n));return i.ok?Ste({appliedKeys:r}):g9(v9(i.error))}function m(e,t,n={}){if(c)return g9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>pte(r,e,t,n));return r.ok?Cte({oldKey:e,newKey:t}):g9(v9(r.error))}function h(e){if(c)return g9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>p9(t,e));return t.ok?wte({orderedKeys:[...e]}):g9(v9(t.error))}function g(e,t){if(c)return g9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>mte(n,e,t));return n.ok?_9({path:[...e]}):g9(v9(n.error))}function _(e){if(c)return g9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let t=f(t=>hte(t,e));return t.ok?_9({path:[...e]}):g9(v9(t.error))}function v(e,t,n={}){if(c)return g9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let r=f(r=>_te(r,e,t,n));return r.ok?_9({path:[...e]}):g9(v9(r.error))}function y(e,t){if(c)return g9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>vte(n,e,t));return n.ok?_9({path:[...e]}):g9(v9(n.error))}function b(e,t){if(c)return g9({code:`WRITE_ERROR`,detail:`FrontmatterBinding has been disposed`});let n=f(n=>yte(n,e,t));return n.ok?_9({path:[...e]}):g9(v9(n.error))}return{current(){return y9(n).snapshot},patch(e){return p(e)},rename(e,t,n){return m(e,t,n)},reorder(e){return h(e)},patchPath(e,t){return g(e,t)},deletePath(e){return _(e)},renamePath(e,t,n){return v(e,t,n)},reorderPath(e,t){return y(e,t)},reorderSeqPath(e,t){return b(e,t)},subscribe(e){return r.add(e),()=>{r.delete(e)}},dispose(){c||(c=!0,n.unobserve(u),e.off(`synced`,d),r.clear())}}}function kte(e,t,n){if(t===0&&n)return!0;let r=t>0?t:Ete,i=0;for(let t of e.delta){if(typeof t.retain==`number`){i+=t.retain;continue}if(typeof t.insert==`string`){if(i<r)return!0;i+=t.insert.length;continue}if(t.insert!==void 0){if(i<r)return!0;i+=1;continue}if(typeof t.delete==`number`&&i<r)return!0}return!1}var Ate=new Cq.default;Ate.Match_Threshold=.5;var jte=/\\([!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~])/g,x9=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$/,S9=/^[ \t]+([-+*]|\d+[.)]|[a-zA-Z][.)])\s/,Mte=/^\d+([.)])(?=\s)/,Nte=`1`,Pte=/\*\*\s*(`[^`]+`)\s*\*\*/g,Fte=/^(`{3,}|~{3,})/;function Ite(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r].trimEnd(),a=Fte.exec(i);if(a){let e=a[1][0];if(n===null){n=e;continue}if(n===e){n=null;continue}}if(n!==null||r===0||!x9.test(i))continue;let o=e[r-1].trimEnd();if(!(!o.startsWith(`|`)||x9.test(o))){t.add(r-1),t.add(r);for(let n=r+1;n<e.length&&e[n].trimEnd().startsWith(`|`);n++)t.add(n)}}return t}function C9(e){return e.slice(0,-1).trimEnd()}var w9=/^(?:#{1,6}[ \t]|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/;function T9(e){let t=new Set,n=null;for(let r=0;r<e.length;r++){let i=e[r]??``,a=/^(`{3,}|~{3,})/.exec(i.trimStart());if(a?.[1]){let e=a[1][0];if(n===null){n=e;continue}if(n===e){n=null;continue}}n!==null&&t.add(r)}return t}var Lte=/^<\/?[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,Rte=/^<[A-Z][A-Za-z0-9.]*(?:\s[^>]*)?>$/,zte=/^<\/[A-Z][A-Za-z0-9.]*\s*>$/,Bte=/<\/?[A-Z]/;function Vte(e){let t=!1;for(let n=0;n<e.length;n++)if(Bte.test(e[n]??``)){t=!0;break}if(!t)return e;let n=T9(e),r=[],i=[],a=0;for(let t=0;t<e.length;t++){let o=e[t]??``,s=o.trim();if(n.has(t)){r.push(!1),i.push(a);continue}let c=a>=1||!/^[ \t]/.test(o);r.push(c&&Lte.test(s));let l=c&&zte.test(s),u=c&&!l&&Rte.test(s)&&!s.endsWith(`/>`);l?(a=Math.max(0,a-1),i.push(a)):(i.push(a),u&&(a+=1))}let o=Array(e.length);for(let t=0,n=-1;t<e.length;t++)o[t]=n,(e[t]??``).trim()!==``&&(n=t);let s=Array(e.length);for(let t=e.length-1,n=e.length;t>=0;t--)s[t]=n,(e[t]??``).trim()!==``&&(n=t);let c=new Set;for(let t=0;t<e.length;t++){if((e[t]??``).trim()!==``||n.has(t)||(i[t]??0)<1)continue;let a=o[t]??-1,l=s[t]??e.length;(a>=0&&r[a]===!0||l<e.length&&r[l]===!0)&&c.add(t)}let l=[];for(let t=0;t<e.length;t++){if(c.has(t))continue;let n=e[t]??``;l.push(r[t]===!0&&(i[t]??0)>=1?n.replace(/^[ \t]+/,``):n)}return l}function Hte(e){let t=Vte(e.replace(/^/,``).replace(/\r/g,``).replace(jte,`$1`).replace(Pte,`$1`).replace(/^\n+/,``).replace(/^[*-]{3,}(?=\n|$)/,`---`).replace(/(\n)([#>+-]|\d+[.)]|`{3,}|~{3,})/g,`
|
|
558
558
|
|
|
559
559
|
$2`).replace(/^([#>+-].*|\d+[.)].*|`{3,}.*|~{3,}.*|<\/[A-Z][A-Za-z0-9]*>[ \t]*)\n([^\n])/gm,`$1
|
|
560
560
|
|
|
561
561
|
$2`).split(`
|
|
562
|
-
`)),n=
|
|
562
|
+
`)),n=Ite(t),r=T9(t);return t.map((e,i)=>{let a=e.trimEnd();if(i>0&&!r.has(i)&&/^[ \t]+\S/.test(a)&&(t[i-1]??``).trim()!==``&&!S9.test(a)&&!w9.test(a.trimStart())){let e=(t[i-1]??``).trimStart();if(!w9.test(e)&&!e.startsWith(`|`))return a.replace(/^[ \t]+/,``)}if(x9.test(a)){let e=a.replace(/\s+/g,``);return n.has(i)&&e.length>1&&e.startsWith(`|`)&&e.endsWith(`|`)?C9(e):e}let o=S9.test(a)?a.replace(/^[ \t]+/,``):a;return n.has(i)&&o.length>1&&o.startsWith(`|`)&&o.endsWith(`|`)&&(o=C9(o)),o.replace(Mte,`${Nte}$1`)}).join(`
|
|
563
563
|
`).replace(/\n{3,}/g,`
|
|
564
564
|
|
|
565
|
-
`).replace(/\n+$/,``)}var E9=/^[a-zA-Z0-9][\w/-]*$/;function Hte(e){if(typeof e!=`string`)return!1;let t=e.startsWith(`#`)?e.slice(1):e;return E9.test(t)}var Ute=`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`;function Wte(e){return e.startsWith(`#`)?e.slice(1):e}function Gte(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function Kte(e){if(!e||e.trim()===``)return[];let{map:t}=ate(e);if(!t)return[];let n=Gte(t.tags),r=[];for(let e of n){let t=Wte(e);E9.test(t)&&r.push(t)}return r}var qte=V(cJ),Jte=Eu({hosts:z(I()),scope:qte,scripts:R(),installedAt:xl()});Eu({schema:H(1),skills:Pu(I(),Jte).default({})});var Yte=100,Xte=500,Zte=450,Qte={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},D9=new WeakMap;function $te(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function O9(e){return e.trim().toLowerCase()}var ene=/\.(?:md|mdx)$/;function tne(e,t){if(t!==`page`)return e;let n=e.replace(ene,``);return n.length>0?n:e}function k9(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function nne(e){let t=k9(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function A9(e){let t=NK({schema:Qte});return e.length>0&&WK(t,e),t}function rne(e){let t={documents:e};return D9.set(t,A9(e)),t}function ine(e){let t=D9.get(e);if(t)return t;let n=A9(e.documents);return D9.set(e,n),n}function ane(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function j9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function one(e,t){let n=O9(t);if(!n)return 0;let r=tne(n,e.kind),i=O9(e.title),a=O9(e.name),o=O9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}var sne=.5;function M9(e,t){let n=one(e,t);return n<=0?n:OZ(e.path)?n*sne:n}var cne=60;function lne(e){return e===`file`?-cne:0}var une=1e3,N9=50,dne=1,fne=1,pne=.001;function mne(e,t,n,r,i){let a=i>0?t/i:0,o=N9>0?n/N9:0,s=r===`file`?-pne:0,c=dne*a+fne*o+s;return e*une+c}function P9(e,t,n,r){return e+t*20+n+lne(r)}function F9(e,t,n,r,i,a){return e===`relevance`?P9(t,n,r,i):mne(t,n,r,i,a)}function hne(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function I9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function gne(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function _ne(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function vne(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}function yne(e,t){return O9(t).length<4?0:+(e===`full_text`)}function bne(e){let{lexical:t,fullText:n}=e.signals;return t>=Xte?`lexical`:t===Zte&&n<=0?`pathOnly`:`body`}function xne(e){let t=[],n=[],r=[];for(let i of e){let e=bne(i);e===`lexical`?t.length<Yte&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function L9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=xne(e),i=[],a=0,o=0;for(let e of r){if(e.document.kind===`folder`){if(a>=3)continue;a+=1}else if(e.document.kind===`file`){if(o>=3)continue;o+=1}if(i.push(e),i.length>=n)break}return i}function Sne(e,t,n={}){let r=n.intent??`omnibar`,i=hne(r,n.ranking),a=$te(n.limit),o=new Set(n.scopes??ane(r)),s=e.documents.filter(e=>j9(e,o)),c=O9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=bq(ine(e),{term:c,properties:_ne(r),boost:vne(r),tolerance:yne(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>j9(e.document,o)).map(e=>[e.document.id,e.score])),d=gne(s),f=new Map;for(let e of s)M9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)j9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=I9(f.values(),u);return L9([...f.values()].map(t=>{let n=Math.max(0,M9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:F9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return L9(Cne({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function R9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function Cne(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=I9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,M9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?F9(o,t,n,s,e.kind,m):P9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=R9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=R9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function wne(e){return`https://${e.host}/${e.owner}/${e.repo}.git`}function Tne(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var z9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),B9=globalThis;B9[z9]===void 0&&(B9[z9]=Xs());var V9=B9[z9],H9=Eu({version:I().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(V9,{description:`Recorded skill version for this target.`}),recordedAt:xl().register(V9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:V([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(V9,{description:`Install-source surface that recorded this entry.`}).optional()}),Ene=Eu({enabled:R().register(V9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:xl().register(V9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});Eu({schema:H(1).register(V9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Eu({"claude-cowork":H9.optional(),"cli-hosts":H9.optional()}).register(V9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:Pu(I(),Ene).register(V9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional()});var Dne=new Set([`(connected)`,`(agent thread)`]);function One(e){return e!=null&&Dne.has(e)}var U9=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function kne(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??Ane,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new U9(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function Ane(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function jne(){let e=!1,t=``,n=0;return r=>{let i=Mne(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function Mne(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}var Nne=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Pne={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},Fne={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},W9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function Ine(e,t=Nne){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function Lne(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function Rne(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var zne={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function Bne(e){return e?zne[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function Vne(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function Hne(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function Une(e){let[t]=Vne(e);return Hne(t,45,32)}var Wne=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],Gne=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],G9=`ok-user-name-v3`,K9=`ok-user-color-v3`;function q9(e){return e[Math.floor(Math.random()*e.length)]}function Kne(){return`${q9(Wne)} ${q9(Gne)}`}function qne(){return q9(W9)}function J9(e){try{return localStorage.getItem(e)}catch{return null}}function Y9(e,t){try{localStorage.setItem(e,t)}catch{}}function Jne(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=J9(G9),r=J9(K9);return n||(n=Kne(),Y9(G9,n)),r||(r=qne(),Y9(K9,r)),{name:n,color:r,coeditor:e,tabId:t}}function Yne(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=l.startsWith(`/`),d=u?l.slice(1):l,f=u?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of d.split(`/`))if(e===`..`){if(f.length===0)return null;f.pop()}else e!==`.`&&e!==``&&f.push(e);return f.length===0?null:{docName:f.join(`/`),anchor:a||null}}function Xne(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var X9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function Z9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function Q9(e){return e.split(`/`).filter(Boolean)}function $9(e){let t=e.trim();return X9.test(t)||t.startsWith(`//`)}function Zne(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if($9(n))return{kind:`external`,url:n};let r=Yne(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=Z9(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function Qne(e,t){let n=e.trim();if(!n)return null;if($9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=Z9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function $ne(e,t){let n=e.trim();if(!n||X9.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function ere(e,t,n=null,r=`.md`){let i=Q9(e);i.pop();let a=Q9(t),o=0;for(;o<i.length&&o<a.length&&i[o]===a[o];)o+=1;let s=i.slice(o).map(()=>`..`),c=a.slice(o),l=[...s,...c].join(`/`);return l||=a.at(-1)??t,!l.startsWith(`./`)&&!l.startsWith(`../`)&&(l=`./${l}`),`${l}${r}${n?`#${n}`:``}`}function tre(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}export{d8 as $,va as $a,sg as $i,P1 as $n,EX as $r,dX as $t,k5 as A,hf as Aa,KS as Ai,jJ as An,Vte as Ar,LZ as At,F5 as B,Td as Ba,CS as Bi,o6 as Bn,ZJ as Br,QY as Bt,zJ as C,yf as Ca,pw as Ci,IX as Cn,x8 as Cr,p7 as Ct,SJ as D,kd as Da,fT as Di,rne as Dn,s$ as Dr,A7 as Dt,Q6 as E,Ff as Ea,hT as Ei,D1 as En,Q8 as Er,uJ as Et,kJ as F,rf as Fa,hC as Fi,Z9 as Fn,gJ as Fr,F7 as Ft,m4 as G,V as Ga,Jw as Gi,Jne as Gn,Q7 as Gr,aX as Gt,W9 as H,Uf as Ha,aC as Hi,g5 as Hn,o9 as Hr,h7 as Ht,Qq as I,yd as Ia,_C as Ii,Kte as In,ete as Ir,N7 as It,xJ as J,R as Ja,Nb as Ji,o$ as Jn,O6 as Jr,wZ as Jt,rY as K,ud as Ka,Ex as Ki,iX as Kn,tre as Kr,cX as Kt,YJ as L,vd as La,vC as Li,rte as Ln,Mq as Lr,j7 as Lt,O5 as M,Sd as Ma,CC as Mi,Pq as Mn,nX as Mr,VZ as Mt,c7 as N,op as Na,wC as Ni,$q as Nn,pJ as Nr,GZ as Nt,m7 as O,Cf as Oa,WS as Oi,nne as On,Jq as Or,tJ as Ot,TJ as P,rp as Pa,oC as Pi,oX as Pn,W$ as Pr,T7 as Pt,r8 as Q,I as Qa,ig as Qi,N1 as Qn,mJ as Qr,qq as Qt,Ute as R,xd as Ra,RC as Ri,KJ as Rn,rX as Rr,CX as Rt,U9 as S,Pd as Sa,Aw as Si,LX as Sn,q$ as Sr,TY as St,o7 as T,Ud as Ta,mT as Ti,jne as Tn,r5 as Tr,cY as Tt,n$ as U,Ed as Ua,BC as Ui,e9 as Un,a9 as Ur,tQ as Ut,a8 as V,If as Va,eS as Vi,Rne as Vn,dJ as Vr,O7 as Vt,K5 as W,Sf as Wa,dT as Wi,D8 as Wn,$ne as Wr,u8 as Wt,R5 as X,H as Xa,Jh as Xi,V1 as Xn,lX as Xr,Vq as Xt,mY as Y,Jl as Ya,px as Yi,Bne as Yn,nQ as Yr,Xne as Yt,W5 as Z,B as Za,q as Zi,H1 as Zn,hX as Zr,Dte as Zt,aJ as _,Mf as _a,cO as _i,RX as _n,NJ as _r,eQ as _t,t7 as a,qm as aa,T8 as ai,wne as an,L1 as ar,wY as at,rJ as b,sf as ba,Cee as bi,dZ as bn,lY as br,i5 as bt,M5 as c,Hh as ca,rQ as ci,Zne as cn,pY as cr,FJ as ct,Y7 as d,Mp as da,k9 as di,Dq as dn,p8 as dr,IJ as dt,G as ea,XJ as ei,TX as en,ba as eo,B1 as er,X5 as et,q7 as f,W as fa,vj as fi,GJ as fn,h5 as fr,LJ as ft,Fq as g,Hd as ga,DO as gi,VX as gn,e8 as gr,QZ as gt,wq as h,Rf as ha,fj as hi,HX as hn,lJ as hr,l7 as ht,e7 as i,Vm as ia,t8 as ii,DX as in,M1 as ir,s6 as it,A5 as j,Df as ja,qS as ji,b8 as jn,j3 as jr,HZ as jt,W7 as k,Cd as ka,$w as ki,Une as kn,WJ as kr,ZZ as kt,K7 as l,Cm as la,O8 as li,Qne as ln,CJ as lr,MJ as lt,G7 as m,Ld as ma,pj as mi,pZ as mn,G$ as mr,d7 as mt,Fne as n,K as na,D6 as ni,mX as nn,z1 as nr,cJ as nt,Oq as o,Zm as oa,Nq as oi,kne as on,R1 as or,PX as ot,J7 as p,Ad as pa,uj as pi,Ine as pn,OZ as pr,DJ as pt,iY as q,z as qa,Ab as qi,eJ as qn,Sne as qr,H5 as qt,wJ as r,Km as ra,nY as ri,ere as rn,F1 as rr,m8 as rt,N5 as s,Xm as sa,QJ as si,Tne as sn,d5 as sr,FX as st,Pne as t,Wh as ta,uX as ti,fX as tn,pa as to,I1 as tr,sJ as tt,X7 as u,U as ua,NX as ui,Eq as un,$9 as ur,G5 as ut,nJ as v,Nf as va,LO as vi,BX as vn,One as vr,Aq as vt,s7 as w,Fd as wa,LC as wi,Lne as wn,vJ as wr,oY as wt,yJ as x,Rd as xa,Gw as xi,zX as xn,Hte as xr,v8 as xt,iJ as y,Vd as ya,RO as yi,TZ as yn,uY as yr,kq as yt,E9 as z,af as za,eT as zi,_8 as zn,Q$ as zr,wX as zt};
|
|
565
|
+
`).replace(/\n+$/,``)}var E9=/^[a-zA-Z0-9][\w/-]*$/;function Ute(e){if(typeof e!=`string`)return!1;let t=e.startsWith(`#`)?e.slice(1):e;return E9.test(t)}var Wte=`Tags must start with a letter or digit and contain only letters, digits, underscores, dashes, and slashes.`;function Gte(e){return e.startsWith(`#`)?e.slice(1):e}function Kte(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function qte(e){if(!e||e.trim()===``)return[];let{map:t}=ote(e);if(!t)return[];let n=Kte(t.tags),r=[];for(let e of n){let t=Gte(e);E9.test(t)&&r.push(t)}return r}var Jte=V(cJ),Yte=Eu({hosts:z(I()),scope:Jte,scripts:R(),installedAt:xl()});Eu({schema:H(1),skills:Pu(I(),Yte).default({})});var Xte=100,Zte=500,Qte=450,$te={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},D9=new WeakMap;function ene(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function O9(e){return e.trim().toLowerCase()}var tne=/\.(?:md|mdx)$/;function nne(e,t){if(t!==`page`)return e;let n=e.replace(tne,``);return n.length>0?n:e}function k9(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function rne(e){let t=k9(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function A9(e){let t=NK({schema:$te});return e.length>0&&WK(t,e),t}function ine(e){let t={documents:e};return D9.set(t,A9(e)),t}function ane(e){let t=D9.get(e);if(t)return t;let n=A9(e.documents);return D9.set(e,n),n}function one(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function j9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function sne(e,t){let n=O9(t);if(!n)return 0;let r=nne(n,e.kind),i=O9(e.title),a=O9(e.name),o=O9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}var cne=.5;function M9(e,t){let n=sne(e,t);return n<=0?n:kZ(e.path)?n*cne:n}var lne=60;function une(e){return e===`file`?-lne:0}var dne=1e3,N9=50,fne=1,pne=1,mne=.001;function hne(e,t,n,r,i){let a=i>0?t/i:0,o=N9>0?n/N9:0,s=r===`file`?-mne:0,c=fne*a+pne*o+s;return e*dne+c}function P9(e,t,n,r){return e+t*20+n+une(r)}function F9(e,t,n,r,i,a){return e===`relevance`?P9(t,n,r,i):hne(t,n,r,i,a)}function gne(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function I9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function _ne(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function vne(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function yne(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}function bne(e,t){return O9(t).length<4?0:+(e===`full_text`)}function xne(e){let{lexical:t,fullText:n}=e.signals;return t>=Zte?`lexical`:t===Qte&&n<=0?`pathOnly`:`body`}function Sne(e){let t=[],n=[],r=[];for(let i of e){let e=xne(i);e===`lexical`?t.length<Xte&&t.push(i):e===`body`?n.length<6&&n.push(i):r.length<4&&r.push(i)}return[...t,...n,...r]}function L9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=Sne(e),i=[],a=0,o=0;for(let e of r){if(e.document.kind===`folder`){if(a>=3)continue;a+=1}else if(e.document.kind===`file`){if(o>=3)continue;o+=1}if(i.push(e),i.length>=n)break}return i}function Cne(e,t,n={}){let r=n.intent??`omnibar`,i=gne(r,n.ranking),a=ene(n.limit),o=new Set(n.scopes??one(r)),s=e.documents.filter(e=>j9(e,o)),c=O9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=bq(ane(e),{term:c,properties:vne(r),boost:yne(r),tolerance:bne(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>j9(e.document,o)).map(e=>[e.document.id,e.score])),d=_ne(s),f=new Map;for(let e of s)M9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)j9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=I9(f.values(),u);return L9([...f.values()].map(t=>{let n=Math.max(0,M9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:F9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return L9(wne({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function R9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function wne(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=I9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,M9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?F9(o,t,n,s,e.kind,m):P9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=R9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=R9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function Tne(e){return`https://${e.host}/${e.owner}/${e.repo}.git`}function Ene(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var z9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),B9=globalThis;B9[z9]===void 0&&(B9[z9]=Xs());var V9=B9[z9],H9=Eu({version:I().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(V9,{description:`Recorded skill version for this target.`}),recordedAt:xl().register(V9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:V([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(V9,{description:`Install-source surface that recorded this entry.`}).optional()}),Dne=Eu({enabled:R().register(V9,{description:`Whether this user-global skill bundle is opted in.`}),decidedAt:xl().register(V9,{description:`ISO 8601 timestamp of the opt-in / opt-out decision.`})});Eu({schema:H(1).register(V9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:Eu({"claude-cowork":H9.optional(),"cli-hosts":H9.optional()}).register(V9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({}),bundles:Pu(I(),Dne).register(V9,{description:`Per-bundle opt-in decisions keyed by install name. Absent key = no recorded decision.`}).optional()});var One=new Set([`(connected)`,`(agent thread)`]);function kne(e){return e!=null&&One.has(e)}var U9=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function Ane(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??jne,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new U9(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function jne(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function Mne(){let e=!1,t=``,n=0;return r=>{let i=Nne(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function Nne(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}var Pne=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Fne={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},Ine={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},W9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function Lne(e,t=Pne){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function Rne(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function zne(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var Bne={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function Vne(e){return e?Bne[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function Hne(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function Une(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function Wne(e){let[t]=Hne(e);return Une(t,45,32)}var Gne=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],Kne=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],G9=`ok-user-name-v3`,K9=`ok-user-color-v3`;function q9(e){return e[Math.floor(Math.random()*e.length)]}function qne(){return`${q9(Gne)} ${q9(Kne)}`}function Jne(){return q9(W9)}function J9(e){try{return localStorage.getItem(e)}catch{return null}}function Y9(e,t){try{localStorage.setItem(e,t)}catch{}}function Yne(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=J9(G9),r=J9(K9);return n||(n=qne(),Y9(G9,n)),r||(r=Jne(),Y9(K9,r)),{name:n,color:r,coeditor:e,tabId:t}}function Xne(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=l.startsWith(`/`),d=u?l.slice(1):l,f=u?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of d.split(`/`))if(e===`..`){if(f.length===0)return null;f.pop()}else e!==`.`&&e!==``&&f.push(e);return f.length===0?null:{docName:f.join(`/`),anchor:a||null}}function Zne(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var X9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function Z9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function Q9(e){return e.split(`/`).filter(Boolean)}function $9(e){let t=e.trim();return X9.test(t)||t.startsWith(`//`)}function Qne(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if($9(n))return{kind:`external`,url:n};let r=Xne(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=Z9(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function $ne(e,t){let n=e.trim();if(!n)return null;if($9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=Z9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function ere(e,t){let n=e.trim();if(!n||X9.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function tre(e,t,n=null,r=`.md`){let i=Q9(e);i.pop();let a=Q9(t),o=0;for(;o<i.length&&o<a.length&&i[o]===a[o];)o+=1;let s=i.slice(o).map(()=>`..`),c=a.slice(o),l=[...s,...c].join(`/`);return l||=a.at(-1)??t,!l.startsWith(`./`)&&!l.startsWith(`../`)&&(l=`./${l}`),`${l}${r}${n?`#${n}`:``}`}function nre(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}export{f8 as $,B as $a,q as $i,U1 as $n,gX as $r,Ote as $t,A5 as A,Cf as Aa,WS as Ai,rne as An,Jq as Ar,RZ as At,I5 as B,xd as Ba,RC as Bi,qJ as Bn,iX as Br,$Y as Bt,BJ as C,Rd as Ca,Gw as Ci,BX as Cn,Ute as Cr,m7 as Ct,SJ as D,Ud as Da,mT as Di,Mne as Dn,i5 as Dr,j7 as Dt,$6 as E,Fd as Ea,LC as Ei,Rne as En,vJ as Er,uJ as Et,kJ as F,op as Fa,wC as Fi,$q as Fn,pJ as Fr,I7 as Ft,h4 as G,Ed as Ga,BC as Gi,ete as Gn,a9 as Gr,nQ as Gt,W9 as H,Td as Ha,CS as Hi,s6 as Hn,QJ as Hr,g7 as Ht,Qq as I,rp as Ia,oC as Ii,sX as In,G$ as Ir,P7 as It,xJ as J,ud as Ja,Ex as Ji,aX as Jn,nre as Jr,lX as Jt,iY as K,Sf as Ka,dT as Ki,O8 as Kn,ere as Kr,d8 as Kt,XJ as L,rf as La,hC as Li,Z9 as Ln,gJ as Lr,M7 as Lt,k5 as M,hf as Ma,KS as Mi,jJ as Mn,Hte as Mr,HZ as Mt,l7 as N,Df as Na,qS as Ni,x8 as Nn,M3 as Nr,KZ as Nt,h7 as O,Ff as Oa,hT as Oi,O1 as On,$8 as Or,tJ as Ot,TJ as P,Sd as Pa,CC as Pi,Pq as Pn,rX as Pr,E7 as Pt,i8 as Q,H as Qa,Jh as Qi,H1 as Qn,uX as Qr,Vq as Qt,Wte as R,yd as Ra,_C as Ri,qte as Rn,tte as Rr,wX as Rt,U9 as S,sf as Sa,See as Si,fZ as Sn,uY as Sr,EY as St,s7 as T,yf as Ta,pw as Ti,LX as Tn,S8 as Tr,lY as Tt,r$ as U,If as Ua,eS as Ui,zne as Un,dJ as Ur,zJ as Ut,o8 as V,af as Va,eT as Vi,v8 as Vn,$$ as Vr,k7 as Vt,q5 as W,Uf as Wa,aC as Wi,_5 as Wn,o9 as Wr,RJ as Wt,z5 as X,R as Xa,Nb as Xi,s$ as Xn,k6 as Xr,TZ as Xt,hY as Y,z as Ya,Ab as Yi,eJ as Yn,Cne as Yr,U5 as Yt,G5 as Z,Jl as Za,px as Zi,Vne as Zn,rQ as Zr,Zne as Zt,aJ as _,Rf as _a,fj as _i,UX as _n,lJ as _r,tQ as _t,n7 as a,Km as aa,rY as ai,tre as an,I1 as ar,TY as at,rJ as b,Nf as ba,RO as bi,VX as bn,kne as br,a5 as bt,N5 as c,Zm as ca,Nq as ci,Ane as cn,z1 as cr,FJ as ct,X7 as d,Cm as da,k8 as di,$ne as dn,CJ as dr,IJ as dt,ig as ea,mJ as ei,qq as en,I as eo,P1 as er,Z5 as et,J7 as f,U as fa,PX as fi,Eq as fn,$9 as fr,LJ as ft,Fq as g,Ld as ga,pj as gi,mZ as gn,K$ as gr,$Z as gt,wq as h,Ad as ha,uj as hi,Lne as hn,kZ as hr,u7 as ht,t7 as i,K as ia,O6 as ii,hX as in,B1 as ir,c6 as it,j5 as j,Cd as ja,$w as ji,Wne as jn,GJ as jr,UZ as jt,G7 as k,kd as ka,fT as ki,ine as kn,c$ as kr,QZ as kt,q7 as l,Xm as la,$J as li,Ene as ln,f5 as lr,MJ as lt,K7 as m,W as ma,vj as mi,KJ as mn,g5 as mr,f7 as mt,Ine as n,G as na,ZJ as ni,EX as nn,ba as no,V1 as nr,cJ as nt,Oq as o,Vm as oa,n8 as oi,OX as on,N1 as or,FX as ot,Y7 as p,Mp as pa,k9 as pi,Dq as pn,m8 as pr,DJ as pt,aY as q,V as qa,Jw as qi,Yne as qn,$7 as qr,oX as qt,wJ as r,Wh as ra,dX as ri,pX as rn,pa as ro,L1 as rr,h8 as rt,P5 as s,qm as sa,E8 as si,Tne as sn,R1 as sr,IX as st,Fne as t,sg as ta,DX as ti,fX as tn,va as to,F1 as tr,sJ as tt,Z7 as u,Hh as ua,iQ as ui,Qne as un,mY as ur,K5 as ut,nJ as v,Hd as va,DO as vi,HX as vn,t8 as vr,Aq as vt,c7 as w,Pd as wa,Aw as wi,RX as wn,J$ as wr,sY as wt,yJ as x,Vd as xa,zO as xi,EZ as xn,dY as xr,y8 as xt,iJ as y,Mf as ya,cO as yi,zX as yn,NJ as yr,kq as yt,E9 as z,vd as za,vC as zi,ite as zn,Mq as zr,TX as zt};
|