@coderminer/vue-markdown 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +110 -0
- package/LICENSE +21 -0
- package/README.md +579 -3
- package/README.zh-CN.md +547 -0
- package/dist/chunks/MarkdownBlockquote-DVXziX2t.js +18 -0
- package/dist/chunks/MarkdownBlockquote-DVXziX2t.js.map +1 -0
- package/dist/chunks/MarkdownBreak-BwCi2Itt.js +18 -0
- package/dist/chunks/MarkdownBreak-BwCi2Itt.js.map +1 -0
- package/dist/chunks/MarkdownCode-B1k9tmW5.js +65 -0
- package/dist/chunks/MarkdownCode-B1k9tmW5.js.map +1 -0
- package/dist/chunks/MarkdownConfigProvider-5N3ylrIu.js +51 -0
- package/dist/chunks/MarkdownConfigProvider-5N3ylrIu.js.map +1 -0
- package/dist/chunks/MarkdownContent-BAK6dqo7.js +15 -0
- package/dist/chunks/MarkdownContent-BAK6dqo7.js.map +1 -0
- package/dist/chunks/MarkdownCustomTag-BBdn3-WO.js +42 -0
- package/dist/chunks/MarkdownCustomTag-BBdn3-WO.js.map +1 -0
- package/dist/chunks/MarkdownEmphasis-CppivOEu.js +18 -0
- package/dist/chunks/MarkdownEmphasis-CppivOEu.js.map +1 -0
- package/dist/chunks/MarkdownEmpty-Av5k6bqa.js +16 -0
- package/dist/chunks/MarkdownEmpty-Av5k6bqa.js.map +1 -0
- package/dist/chunks/MarkdownError-C0sPs5W0.js +19 -0
- package/dist/chunks/MarkdownError-C0sPs5W0.js.map +1 -0
- package/dist/chunks/MarkdownFootnoteReference-Dy3Khwyj.js +24 -0
- package/dist/chunks/MarkdownFootnoteReference-Dy3Khwyj.js.map +1 -0
- package/dist/chunks/MarkdownFootnotes-BRPzkbXv.js +23 -0
- package/dist/chunks/MarkdownFootnotes-BRPzkbXv.js.map +1 -0
- package/dist/chunks/MarkdownHeading-DaNcP0_6.js +31 -0
- package/dist/chunks/MarkdownHeading-DaNcP0_6.js.map +1 -0
- package/dist/chunks/MarkdownHorizontalRule-QNe_cuUI.js +18 -0
- package/dist/chunks/MarkdownHorizontalRule-QNe_cuUI.js.map +1 -0
- package/dist/chunks/MarkdownHtml-66lYkvwM.js +15 -0
- package/dist/chunks/MarkdownHtml-66lYkvwM.js.map +1 -0
- package/dist/chunks/MarkdownImage-BRy76svs.js +53 -0
- package/dist/chunks/MarkdownImage-BRy76svs.js.map +1 -0
- package/dist/chunks/MarkdownInlineCode-MXZYFwex.js +18 -0
- package/dist/chunks/MarkdownInlineCode-MXZYFwex.js.map +1 -0
- package/dist/chunks/MarkdownLink-Dbx3NwgV.js +47 -0
- package/dist/chunks/MarkdownLink-Dbx3NwgV.js.map +1 -0
- package/dist/chunks/MarkdownList-BJ-_C71k.js +22 -0
- package/dist/chunks/MarkdownList-BJ-_C71k.js.map +1 -0
- package/dist/chunks/MarkdownListItem-Z1EHIY26.js +18 -0
- package/dist/chunks/MarkdownListItem-Z1EHIY26.js.map +1 -0
- package/dist/chunks/MarkdownLoading-D-RYtXxf.js +17 -0
- package/dist/chunks/MarkdownLoading-D-RYtXxf.js.map +1 -0
- package/dist/chunks/MarkdownParagraph-BxLSmSaG.js +18 -0
- package/dist/chunks/MarkdownParagraph-BxLSmSaG.js.map +1 -0
- package/dist/chunks/MarkdownRenderer-DLRRfsdI.js +416 -0
- package/dist/chunks/MarkdownRenderer-DLRRfsdI.js.map +1 -0
- package/dist/chunks/MarkdownRoot-DEE6iVfh.js +25 -0
- package/dist/chunks/MarkdownRoot-DEE6iVfh.js.map +1 -0
- package/dist/chunks/MarkdownStrikethrough-CblvbqDk.js +18 -0
- package/dist/chunks/MarkdownStrikethrough-CblvbqDk.js.map +1 -0
- package/dist/chunks/MarkdownStrong-uU5MzAoJ.js +18 -0
- package/dist/chunks/MarkdownStrong-uU5MzAoJ.js.map +1 -0
- package/dist/chunks/MarkdownTable-DmBTg_CR.js +18 -0
- package/dist/chunks/MarkdownTable-DmBTg_CR.js.map +1 -0
- package/dist/chunks/MarkdownTableCell-eiCJe847.js +33 -0
- package/dist/chunks/MarkdownTableCell-eiCJe847.js.map +1 -0
- package/dist/chunks/MarkdownTableRow-DuJaPntg.js +18 -0
- package/dist/chunks/MarkdownTableRow-DuJaPntg.js.map +1 -0
- package/dist/chunks/MarkdownTableSection-PFHz-R33.js +26 -0
- package/dist/chunks/MarkdownTableSection-PFHz-R33.js.map +1 -0
- package/dist/chunks/MarkdownTaskItem-BcmKo1lk.js +40 -0
- package/dist/chunks/MarkdownTaskItem-BcmKo1lk.js.map +1 -0
- package/dist/chunks/MarkdownToc-BdOHF-Yo.js +51 -0
- package/dist/chunks/MarkdownToc-BdOHF-Yo.js.map +1 -0
- package/dist/chunks/MarkdownTocItem-DT9mR3vL.js +27 -0
- package/dist/chunks/MarkdownTocItem-DT9mR3vL.js.map +1 -0
- package/dist/chunks/MermaidLiveEditor-W-qf3G-5.js +416 -0
- package/dist/chunks/MermaidLiveEditor-W-qf3G-5.js.map +1 -0
- package/dist/chunks/VueSyntaxHighlighter-DyLsYMwy.js +262 -0
- package/dist/chunks/VueSyntaxHighlighter-DyLsYMwy.js.map +1 -0
- package/dist/chunks/adapters-CMwX_NEI.js +28 -0
- package/dist/chunks/adapters-CMwX_NEI.js.map +1 -0
- package/dist/chunks/asyncToGenerator-ChigusFD.js +26 -0
- package/dist/chunks/blank-line-Cb-JBP_5.js +90 -0
- package/dist/chunks/blank-line-Cb-JBP_5.js.map +1 -0
- package/dist/chunks/codemirror-DyphMAEg.js +84 -0
- package/dist/chunks/codemirror-DyphMAEg.js.map +1 -0
- package/dist/chunks/config-aRYo2R8_.js +12 -0
- package/dist/chunks/config-aRYo2R8_.js.map +1 -0
- package/dist/chunks/context-8NfW6fxI.js +32 -0
- package/dist/chunks/context-8NfW6fxI.js.map +1 -0
- package/dist/chunks/default-DWVS-I_8.js +23 -0
- package/dist/chunks/default-DWVS-I_8.js.map +1 -0
- package/dist/chunks/diagnostics-CtHoJyiX.js +25 -0
- package/dist/chunks/diagnostics-CtHoJyiX.js.map +1 -0
- package/dist/chunks/export-DZQ3cUry.js +1575 -0
- package/dist/chunks/export-DZQ3cUry.js.map +1 -0
- package/dist/chunks/hast-nodes-C0bX3M5Z.js +35 -0
- package/dist/chunks/hast-nodes-C0bX3M5Z.js.map +1 -0
- package/dist/chunks/highlightjs-BEh-YwEG.js +6041 -0
- package/dist/chunks/highlightjs-BEh-YwEG.js.map +1 -0
- package/dist/chunks/identity-jZEhX2d5.js +6244 -0
- package/dist/chunks/identity-jZEhX2d5.js.map +1 -0
- package/dist/chunks/labels-BtHiUTQI.js +49 -0
- package/dist/chunks/labels-BtHiUTQI.js.map +1 -0
- package/dist/chunks/lib-BQiWGWpu.js +5087 -0
- package/dist/chunks/lib-BQiWGWpu.js.map +1 -0
- package/dist/chunks/lib-LwqA_W3J.js +127 -0
- package/dist/chunks/lib-LwqA_W3J.js.map +1 -0
- package/dist/chunks/longest-streak-DZE_EqsU.js +10 -0
- package/dist/chunks/longest-streak-DZE_EqsU.js.map +1 -0
- package/dist/chunks/micromark-factory-space-Db040TnW.js +139 -0
- package/dist/chunks/micromark-factory-space-Db040TnW.js.map +1 -0
- package/dist/chunks/normalize-CRYv3Wqt.js +220 -0
- package/dist/chunks/normalize-CRYv3Wqt.js.map +1 -0
- package/dist/chunks/objectSpread2-CtBNx0TF.js +57 -0
- package/dist/chunks/plugin-DqkFHyny.js +28 -0
- package/dist/chunks/plugin-DqkFHyny.js.map +1 -0
- package/dist/chunks/preset-BjaOuJUL.js +46 -0
- package/dist/chunks/preset-BjaOuJUL.js.map +1 -0
- package/dist/chunks/registry-DLjr93-V.js +6144 -0
- package/dist/chunks/registry-DLjr93-V.js.map +1 -0
- package/dist/chunks/render-Cs8iKrgz.js +1724 -0
- package/dist/chunks/render-Cs8iKrgz.js.map +1 -0
- package/dist/chunks/runtime-DJMnzjah.js +546 -0
- package/dist/chunks/runtime-DJMnzjah.js.map +1 -0
- package/dist/chunks/security-y4EwUyAs.js +214 -0
- package/dist/chunks/security-y4EwUyAs.js.map +1 -0
- package/dist/chunks/shared-DNAvZ-UY.js +76 -0
- package/dist/chunks/shared-DNAvZ-UY.js.map +1 -0
- package/dist/chunks/space-separated-tokens-CmBjEPdR.js +1099 -0
- package/dist/chunks/space-separated-tokens-CmBjEPdR.js.map +1 -0
- package/dist/chunks/url-D2BoivaE.js +26 -0
- package/dist/chunks/url-D2BoivaE.js.map +1 -0
- package/dist/chunks/useActiveHeading-BaGVMJnB.js +316 -0
- package/dist/chunks/useActiveHeading-BaGVMJnB.js.map +1 -0
- package/dist/components/CodeBlock.d.ts +73 -0
- package/dist/components/CodeBlock.js +1 -0
- package/dist/components/Icon.d.ts +6 -0
- package/dist/components/MarkdownBlockquote.d.ts +18 -0
- package/dist/components/MarkdownBlockquote.js +1 -0
- package/dist/components/MarkdownBreak.d.ts +8 -0
- package/dist/components/MarkdownBreak.js +1 -0
- package/dist/components/MarkdownChildren.d.ts +17 -0
- package/dist/components/MarkdownCode.d.ts +29 -0
- package/dist/components/MarkdownCode.js +1 -0
- package/dist/components/MarkdownConfigProvider.d.ts +33 -0
- package/dist/components/MarkdownConfigProvider.js +1 -0
- package/dist/components/MarkdownContent.d.ts +16 -0
- package/dist/components/MarkdownContent.js +1 -0
- package/dist/components/MarkdownCustomTag.d.ts +20 -0
- package/dist/components/MarkdownCustomTag.js +1 -0
- package/dist/components/MarkdownEmphasis.d.ts +18 -0
- package/dist/components/MarkdownEmphasis.js +1 -0
- package/dist/components/MarkdownEmpty.d.ts +8 -0
- package/dist/components/MarkdownEmpty.js +1 -0
- package/dist/components/MarkdownError.d.ts +11 -0
- package/dist/components/MarkdownError.js +1 -0
- package/dist/components/MarkdownFootnoteReference.d.ts +19 -0
- package/dist/components/MarkdownFootnoteReference.js +1 -0
- package/dist/components/MarkdownFootnotes.d.ts +17 -0
- package/dist/components/MarkdownFootnotes.js +1 -0
- package/dist/components/MarkdownHeading.d.ts +18 -0
- package/dist/components/MarkdownHeading.js +1 -0
- package/dist/components/MarkdownHorizontalRule.d.ts +8 -0
- package/dist/components/MarkdownHorizontalRule.js +1 -0
- package/dist/components/MarkdownHtml.d.ts +8 -0
- package/dist/components/MarkdownHtml.js +1 -0
- package/dist/components/MarkdownImage.d.ts +15 -0
- package/dist/components/MarkdownImage.js +1 -0
- package/dist/components/MarkdownInlineCode.d.ts +18 -0
- package/dist/components/MarkdownInlineCode.js +1 -0
- package/dist/components/MarkdownLink.d.ts +22 -0
- package/dist/components/MarkdownLink.js +1 -0
- package/dist/components/MarkdownList.d.ts +18 -0
- package/dist/components/MarkdownList.js +1 -0
- package/dist/components/MarkdownListItem.d.ts +18 -0
- package/dist/components/MarkdownListItem.js +1 -0
- package/dist/components/MarkdownLoading.d.ts +8 -0
- package/dist/components/MarkdownLoading.js +1 -0
- package/dist/components/MarkdownMath.d.ts +12 -0
- package/dist/components/MarkdownMath.js +1 -0
- package/dist/components/MarkdownMermaid.d.ts +78 -0
- package/dist/components/MarkdownMermaid.js +1 -0
- package/dist/components/MarkdownParagraph.d.ts +18 -0
- package/dist/components/MarkdownParagraph.js +1 -0
- package/dist/components/MarkdownRenderer.d.ts +170 -0
- package/dist/components/MarkdownRenderer.js +1 -0
- package/dist/components/MarkdownRoot.d.ts +24 -0
- package/dist/components/MarkdownRoot.js +1 -0
- package/dist/components/MarkdownStrikethrough.d.ts +18 -0
- package/dist/components/MarkdownStrikethrough.js +1 -0
- package/dist/components/MarkdownStrong.d.ts +18 -0
- package/dist/components/MarkdownStrong.js +1 -0
- package/dist/components/MarkdownTable.d.ts +18 -0
- package/dist/components/MarkdownTable.js +1 -0
- package/dist/components/MarkdownTableCell.d.ts +20 -0
- package/dist/components/MarkdownTableCell.js +1 -0
- package/dist/components/MarkdownTableRow.d.ts +18 -0
- package/dist/components/MarkdownTableRow.js +1 -0
- package/dist/components/MarkdownTableSection.d.ts +18 -0
- package/dist/components/MarkdownTableSection.js +1 -0
- package/dist/components/MarkdownTaskItem.d.ts +20 -0
- package/dist/components/MarkdownTaskItem.js +1 -0
- package/dist/components/MarkdownToc.d.ts +36 -0
- package/dist/components/MarkdownToc.js +1 -0
- package/dist/components/MarkdownTocItem.d.ts +14 -0
- package/dist/components/MarkdownTocItem.js +1 -0
- package/dist/components/MermaidBlock.d.ts +50 -0
- package/dist/components/MermaidBlock.js +1 -0
- package/dist/components/MermaidLiveEditor.d.ts +44 -0
- package/dist/components/MermaidLiveEditor.js +1 -0
- package/dist/components/VueSyntaxHighlighter.d.ts +39 -0
- package/dist/components/VueSyntaxHighlighter.js +1 -0
- package/dist/components/codeRegion.d.ts +14 -0
- package/dist/components/config.d.ts +7 -0
- package/dist/components/context.d.ts +45 -0
- package/dist/components/index.d.ts +42 -0
- package/dist/components/index.js +38 -0
- package/dist/components/render.d.ts +9 -0
- package/dist/components/scroll-lock.d.ts +7 -0
- package/dist/components/types.d.ts +29 -0
- package/dist/composables/useActiveHeading.d.ts +12 -0
- package/dist/composables/useCodeHighlighter.d.ts +30 -0
- package/dist/composables/useLineWindow.d.ts +38 -0
- package/dist/composables/useMarkdownDocument.d.ts +23 -0
- package/dist/core/adapters.d.ts +7 -0
- package/dist/core/config.d.ts +5 -0
- package/dist/core/diagnostics.d.ts +9 -0
- package/dist/core/finalize.d.ts +18 -0
- package/dist/core/hast-nodes.d.ts +6 -0
- package/dist/core/highlight-lines.d.ts +8 -0
- package/dist/core/identity.d.ts +4 -0
- package/dist/core/labels.d.ts +4 -0
- package/dist/core/manifest.d.ts +38 -0
- package/dist/core/memo.d.ts +5 -0
- package/dist/core/model-hast.d.ts +8 -0
- package/dist/core/model.d.ts +10 -0
- package/dist/core/normalize.d.ts +27 -0
- package/dist/core/parts.d.ts +135 -0
- package/dist/core/preset.d.ts +10 -0
- package/dist/core/run.d.ts +16 -0
- package/dist/core/search.d.ts +5 -0
- package/dist/core/security.d.ts +21 -0
- package/dist/core/slugger.d.ts +6 -0
- package/dist/core/types.d.ts +390 -0
- package/dist/core/url.d.ts +10 -0
- package/dist/editor/codemirror.d.ts +14 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/editor/index.js +1 -0
- package/dist/export/index.d.ts +6 -0
- package/dist/headless.d.ts +21 -0
- package/dist/headless.js +12 -0
- package/dist/highlight/highlightjs.d.ts +7 -0
- package/dist/highlight/index.d.ts +3 -0
- package/dist/highlight/index.js +3 -0
- package/dist/highlight/shared.d.ts +16 -0
- package/dist/highlight/shiki.d.ts +7 -0
- package/dist/highlight/shiki.js +76 -0
- package/dist/highlight/shiki.js.map +1 -0
- package/dist/html/index.d.ts +17 -0
- package/dist/html/index.js +13 -0
- package/dist/html/index.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/math/index.d.ts +4 -0
- package/dist/math/index.js +583 -0
- package/dist/math/index.js.map +1 -0
- package/dist/math/katex.d.ts +4 -0
- package/dist/math/plugin.d.ts +20 -0
- package/dist/mermaid/index.d.ts +5 -0
- package/dist/mermaid/index.js +3 -0
- package/dist/mermaid/plugin.d.ts +14 -0
- package/dist/mermaid/runtime.d.ts +12 -0
- package/dist/mermaid/sanitize.d.ts +12 -0
- package/dist/node-components.d.ts +1 -0
- package/dist/node-components.js +39 -0
- package/dist/pipeline/custom.d.ts +8 -0
- package/dist/pipeline/identity.d.ts +12 -0
- package/dist/pipeline/index.d.ts +5 -0
- package/dist/pipeline/official.d.ts +6 -0
- package/dist/pipeline.d.ts +1 -0
- package/dist/pipeline.js +1 -0
- package/dist/plugins/builtin.d.ts +15 -0
- package/dist/plugins/define.d.ts +7 -0
- package/dist/plugins/registry.d.ts +16 -0
- package/dist/plugins/source.d.ts +7 -0
- package/dist/plugins.d.ts +3 -0
- package/dist/plugins.js +1 -0
- package/dist/presets.d.ts +3 -0
- package/dist/presets.js +1 -0
- package/dist/style.css +2 -0
- package/dist/styles/components.css +712 -0
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/math-full.css +3 -0
- package/dist/styles/math.css +18 -0
- package/dist/styles/tokens.css +96 -0
- package/package.json +211 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-jZEhX2d5.js","names":["wrap","own","extend","isPlainObj","own","content","thematicBreak","list","thematicBreak","document","flow","content","string","text","list","thematicBreak","text","resolveText","defaultConstructs","document","flow","string","text","own","point","toString","root","text","structuredClone","own","defaultHandlers","structuredClone","patch","structuredClone","__toESM","__commonJSMin","__exportAll","errorMessage","createDiagnostic","DANGEROUS_TAGS","ALLOWED_TAGS","_objectSpread2","stringifyPosition","VFile","asciiAlphanumeric","markdownSpace","markdownLineEndingOrSpace","asciiAtext","markdownLineEnding","factorySpaceMinMax","asciiPunctuation","visit","asciiAlpha","factorySpace","asciiControl","splice","normalizeIdentifier","push","resolveAll","classifyCharacter","combineExtensions","toString$1","blankLine","_asyncToGenerator","bail","error","import_extend","hasOwn","toStr","defineProperty","gOPD","isArray","arr","isPlainObject","obj","hasOwnConstructor","hasIsPrototypeOf","key","setProperty","options","target","getProperty","name","extend","src","copy","copyIsArray","clone","i","length","deep","value","prototype","trough","fns","pipeline","run","values","middlewareIndex","callback","next","output","fn","index","wrap$1","use","middelware","called","wrapped","parameters","fnExpectsCallback","middleware","result","done","exception","then","CallableInstance","proto","property","apply","own$4","unified","Processor","destination","attacher","assertUnfrozen","self","transformer","realFile","vfile","file","parser","assertParser","assertCompiler","executor","parseTree","tree","realDone","compileTree","compileResult","looksLikeAValue","reject","resolve","complete","assertDone","assertNode","transformers","resultingTree","outputTree","compiler","attachers","namespace","addList","addPreset","add","plugin","plugins","thing","addPlugin","entryIndex","primary","rest","currentPrimary","frozen","node","asyncName","looksLikeAVFile","isUint8Array","htmlBlockNames","htmlRawNames","characterEntities","own$3","decodeNamedCharacterReference","decodeNumericCharacterReference","code","base","characterEscapeOrReference","decodeString","decode","$1","$2","head","hex","$0","normalizeUri","start","skip","replace","attention","resolveAllAttention","tokenizeAttention","nextEvents","events","open","context","end","movePoint","openingSequence","closingSequence","text","group","offset","attentionMarkers","previous","before","marker","effects","inside","token","after","close","ok","autolink","tokenizeAutolink","size","schemeOrEmailAtext","nok","emailAtext","schemeInsideOrEmailAtext","urlInside","emailAtSignOrDot","emailLabel","emailValue","blockQuote","tokenizeBlockQuoteContinuation","tokenizeBlockQuoteStart","state","contStart","contBefore","exit","characterEscape","tokenizeCharacterEscape","characterReference","tokenizeCharacterReference","max","test","numeric","asciiHexDigit","asciiDigit","nonLazyContinuation","tokenizeNonLazyContinuation","codeFenced","tokenizeCodeFenced","closeStart","tokenizeCloseStart","initialPrefix","sizeOpen","beforeSequenceOpen","tail","sequenceOpen","infoBefore","atNonLazyBreak","info","metaBefore","meta","contentBefore","contentStart","beforeContentChunk","contentChunk","startBefore","beforeSequenceClose","sequenceClose","sequenceCloseAfter","codeIndented","tokenizeCodeIndented","furtherStart","tokenizeFurtherStart","atBreak","onNotEnoughPrefix","codeText","resolveCodeText","tokenizeCodeText","tailExitIndex","headEnterIndex","enter","between","data","SpliceBuffer","initial","stop","count","deleteCount","removed","items","chunkedPush","item","n","chunkStart","right","list","subtokenize","jumps","event","lineIndex","otherIndex","otherEvent","subevents","more","eventsArray","subcontent","eventIndex","startPosition","startPositions","tokenizer","childEvents","gaps","stream","current","adjust","breaks","slice","content$1","resolveContent","tokenizeContent","continuationConstruct","tokenizeContinuation","chunkInside","contentEnd","contentContinue","startLookahead","prefixed","factoryDestination","limit","balance","type","literalType","literalMarkerType","enclosedBefore","rawType","stringType","raw","enclosed","enclosedEscape","rawEscape","factoryLabel","seen","markerType","labelInside","labelEscape","factoryTitle","begin","escape","factoryWhitespace","definition","tokenizeDefinition","titleBefore","tokenizeTitleBefore","identifier","labelAfter","markerAfter","destinationBefore","destinationAfter","afterWhitespace","beforeMarker","titleAfter","titleAfterOptionalWhitespace","hardBreakEscape","tokenizeHardBreakEscape","headingAtx","resolveHeadingAtx","tokenizeHeadingAtx","content","sequenceFurther","htmlFlow","resolveToHtmlFlow","tokenizeHtmlFlow","blankLineBefore","tokenizeBlankLineBefore","closingTag","buffer","markerB","declarationOpen","tagCloseStart","continuationDeclarationInside","tagName","commentOpenInside","cdataOpenInside","continuation","slash","basicSelfClosing","completeClosingTagAfter","completeAttributeNameBefore","completeEnd","completeAttributeName","completeAttributeNameAfter","completeAttributeValueBefore","completeAttributeValueQuoted","completeAttributeValueUnquoted","completeAttributeValueQuotedAfter","completeAfter","continuationCommentInside","continuationRawTagOpen","continuationClose","continuationCdataInside","continuationAfter","continuationStart","continuationStartNonLazy","continuationBefore","continuationRawEndTag","htmlText","tokenizeHtmlText","returnState","instruction","tagOpen","declaration","commentEnd","comment","commentClose","lineEndingBefore","cdata","cdataClose","cdataEnd","instructionClose","tagClose","tagCloseBetween","tagOpenBetween","tagOpenAttributeName","tagOpenAttributeNameAfter","tagOpenAttributeValueBefore","tagOpenAttributeValueQuoted","tagOpenAttributeValueUnquoted","tagOpenAttributeValueQuotedAfter","lineEndingAfter","lineEndingAfterPrefix","labelEnd","resolveAllLabelEnd","resolveToLabelEnd","tokenizeLabelEnd","resourceConstruct","tokenizeResource","referenceFullConstruct","tokenizeReferenceFull","referenceCollapsedConstruct","tokenizeReferenceCollapsed","newEvents","media","label","labelStarts","labelStart","defined","labelEndNok","labelEndOk","referenceNotFull","resourceStart","resourceBefore","resourceOpen","resourceEnd","resourceDestinationAfter","resourceDestinationMissing","resourceBetween","resourceTitleAfter","referenceFull","referenceFullAfter","referenceFullMissing","referenceCollapsedStart","referenceCollapsedOpen","labelStartImage","tokenizeLabelStartImage","labelImage","labelStartLink","tokenizeLabelStartLink","labelLink","lineEnding","tokenizeLineEnding","thematicBreak$1","tokenizeThematicBreak","sequence","list$1","tokenizeListContinuation","tokenizeListEnd","tokenizeListStart","listItemPrefixWhitespaceConstruct","tokenizeListItemPrefixWhitespace","indentConstruct","tokenizeIndent","initialSize","kind","atMarker","onBlank","endOfPrefix","otherPrefix","notBlank","notInCurrentItem","afterPrefix","EditMap","remove","a","b","vecs","element","addImplementation","existing","editMap","at","change","setextUnderline","resolveToSetextUnderline","tokenizeSetextUnderline","heading","paragraph","initializeContent","afterContentStartConstruct","paragraphInitial","lineStart","document$1","initializeDocument","containerConstruct","tokenizeContainer","stack","continued","childFlow","childToken","lineStartOffset","documentContinue","checkNewContainers","closeFlow","indexBeforeExits","indexBeforeFlow","point","documentContinued","flowStart","thereIsANewContainer","thereIsNoNewContainer","exitContainers","containerContinue","flowContinue","writeToChild","endOfFile","entry","flow$1","initializeFlow","atBlankEnding","afterConstruct","resolver","createResolver","string$1","initializeFactory","text$3","field","resolveAllLineSuffixes","initializeText","constructs","notText","resolveAllText","extraResolver","chunks","bufferIndex","tabs","chunk","constructs_exports","contentInitial","disable","document","flow","flowInitial","insideSpan","string","text$2","createTokenizer","from","columnStart","resolveAllConstructs","constructFactory","onsuccessfulconstruct","onsuccessfulcheck","initialize","write","main","addResult","sliceSerialize","serializeChunks","sliceStream","expandTabs","sliceChunks","now","defineSkip","accountForPotentialSkip","chunkIndex","go","consume","fields","construct","hook","listOfConstructs","constructIndex","currentConstruct","handleListOfConstructs","handleMapOfConstructs","left","map","all","bogusState","handleConstruct","store","onreturn","startPoint","startPrevious","startCurrentConstruct","startEventsIndex","startStack","restore","startIndex","startBufferIndex","endIndex","endBufferIndex","view","atTab","parse","create","creator","postprocess","search","preprocess","column","atCarriageReturn","preprocessor","encoding","match","endPosition","own$2","fromMarkdown","config","opener","link","onenterdata","codeFlow","emphasis","hardBreak","html","image","listItem","onenterlistitemvalue","onenterlistordered","onenterreference","strong","thematicBreak","closer","onexitatxheadingsequence","onexitautolinkemail","onexitautolinkprotocol","onexitdata","onexitcharacterreferencemarker","onexitcharacterreferencevalue","onexitcharacterreference","onexitcodefenced","onexitcodefencedfence","onexitcodefencedfenceinfo","onexitcodefencedfencemeta","onexitcodeindented","onexitcodetext","onexitdefinitiondestinationstring","onexitdefinitionlabelstring","onexitdefinitiontitlestring","onexithardbreak","onexithtmlflow","onexithtmltext","onexitimage","onexitlabel","onexitlabeltext","onexitlineending","onexitlink","onexitreferencestring","onexitresourcedestinationstring","onexitresourcetitlestring","onexitresource","onexitsetextheading","onexitsetextheadinglinesequence","onexitsetextheadingtext","compile","listStack","prepared","prepareList","handler","callListeners","defaultOnError","point$1","listeners","containerBalance","listSpread","firstBlankLineIndex","insertions","tailIndex","tailEvent","listEvents","insertion","and","errorHandler","onExitError","resume","ancestor","siblings","referenceType","fragment","d","configure","extensions","combined","extension","remarkParse","doc","blockquote","properties","language","strikethrough","footnoteReference","clobberPrefix","id","safeId","counter","reuseCounter","sup","revert","subtype","suffix","contents","imageReference","inlineCode","linkReference","results","loose","parent","listLoose","listItemLoose","children","child","spread","root$1","pointEnd","pointStart","position","table","rows","firstRow","tableContent","body","tableRow","align","cellIndex","cells","cell","alignValue","tableCell","tab","space","trimLines","source","last","lines","trimLine","text$1","handlers","ignore","env","guard","init","deserializer","as","$","out","unpair","_","object","k","flags","set","message","deserialize","serialized","EMPTY","typeOf","asString","toString","shouldSkip","TYPE","serializer","pair","is","strict","json","entries","keys","serialize","lossy","esm_default","any","defaultFootnoteBackContent","rereferenceIndex","defaultFootnoteBackLabel","referenceIndex","footer","footnoteBackContent","footnoteBackLabel","footnoteLabel","footnoteLabelTagName","footnoteLabelProperties","listItems","backReferences","counts","tailTail","_objectWithoutPropertiesLoose","r","t","e","_objectWithoutProperties","o","s","_excluded","own$1","emptyOptions","createState","settings","definitionById","footnoteById","patch$1","one","handle","defaultUnknownHandler","nodes","trimMarkdownSpaceStart","applyData","to","hName","hChildren","hProperties","wrap","toHast","foot","remarkRehype","_ref","hastTree","aria","defaultSchema","own","sanitize","transform","unsafe","doctype","root","patch","properties_","safeElement","ancestors","childrenUnknown","attributes","required","specific","defaults","safe","propertyValue","findDefinition","propertyValueMany","propertyValuePrimitive","safeProtocol","allowed","protocols","url","colon","questionMark","numberSign","protocol","cleanPosition","dataDefault","definitions","rehypeSanitize","identities","nextIdentity","identityOf","listIdentity","CONTEXT_KEY","CAPABILITIES","useItem","recordPluginError","readContext","fallback","pluginContext","_ctx$options","ctx","diagnostic","reportPluginError","phase","owner","secondary","ownerOf","guardItem","pluginName","args","_item$name","isRehypeRaw","rehypeDropRaw","textContent","rehypeHeadingIds","_options$slugger$rese","_options$slugger","sanitizeSchema","_defaultSchema$attrib","_defaults$","_defaults$a","_defaults$img","_defaultSchema$protoc","tagNames","tag","_extension$tags","_extension$attributes","_extension$attributes2","_extension$attributes3","_attributes$tag","extra","lower","createOfficialPipeline","_options$name","cachedKey","cachedProcessor","build","htmlPlugins","rawItems","hasRaw","hostRehype","processor","read","_file$data","hast","defineMarkdownPipeline","issues","validatePipeline","issue","diagnostics","candidate","assertPipelineResult","resolvePipeline","createPipelineIdentity","_options$idPrefix","_options$baseUrl","_options$allowedEleme","_options$disallowedEl","_options$search$query","_options$search","_options$search2","input","createMemoKey","pipelineIdentity"],"sources":["../../node_modules/bail/index.js","../../node_modules/extend/index.js","../../node_modules/is-plain-obj/index.js","../../node_modules/trough/lib/index.js","../../node_modules/unified/lib/callable-instance.js","../../node_modules/unified/lib/index.js","../../node_modules/micromark-util-html-tag-name/index.js","../../node_modules/character-entities/index.js","../../node_modules/decode-named-character-reference/index.js","../../node_modules/micromark-util-decode-numeric-character-reference/index.js","../../node_modules/micromark-util-decode-string/index.js","../../node_modules/micromark-util-sanitize-uri/index.js","../../node_modules/micromark-core-commonmark/lib/attention.js","../../node_modules/micromark-core-commonmark/lib/autolink.js","../../node_modules/micromark-core-commonmark/lib/block-quote.js","../../node_modules/micromark-core-commonmark/lib/character-escape.js","../../node_modules/micromark-core-commonmark/lib/character-reference.js","../../node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js","../../node_modules/micromark-core-commonmark/lib/code-fenced.js","../../node_modules/micromark-core-commonmark/lib/code-indented.js","../../node_modules/micromark-core-commonmark/lib/code-text.js","../../node_modules/micromark-util-subtokenize/lib/splice-buffer.js","../../node_modules/micromark-util-subtokenize/index.js","../../node_modules/micromark-core-commonmark/lib/content.js","../../node_modules/micromark-factory-destination/index.js","../../node_modules/micromark-factory-label/index.js","../../node_modules/micromark-factory-title/index.js","../../node_modules/micromark-factory-whitespace/index.js","../../node_modules/micromark-core-commonmark/lib/definition.js","../../node_modules/micromark-core-commonmark/lib/hard-break-escape.js","../../node_modules/micromark-core-commonmark/lib/heading-atx.js","../../node_modules/micromark-core-commonmark/lib/html-flow.js","../../node_modules/micromark-core-commonmark/lib/html-text.js","../../node_modules/micromark-core-commonmark/lib/label-end.js","../../node_modules/micromark-core-commonmark/lib/label-start-image.js","../../node_modules/micromark-core-commonmark/lib/label-start-link.js","../../node_modules/micromark-core-commonmark/lib/line-ending.js","../../node_modules/micromark-core-commonmark/lib/thematic-break.js","../../node_modules/micromark-core-commonmark/lib/list.js","../../node_modules/micromark-util-edit-map/index.js","../../node_modules/micromark-core-commonmark/lib/setext-underline.js","../../node_modules/micromark/lib/initialize/content.js","../../node_modules/micromark/lib/initialize/document.js","../../node_modules/micromark/lib/initialize/flow.js","../../node_modules/micromark/lib/initialize/text.js","../../node_modules/micromark/lib/constructs.js","../../node_modules/micromark/lib/create-tokenizer.js","../../node_modules/micromark/lib/parse.js","../../node_modules/micromark/lib/postprocess.js","../../node_modules/micromark/lib/preprocess.js","../../node_modules/mdast-util-from-markdown/lib/index.js","../../node_modules/remark-parse/lib/index.js","../../node_modules/mdast-util-to-hast/lib/handlers/blockquote.js","../../node_modules/mdast-util-to-hast/lib/handlers/break.js","../../node_modules/mdast-util-to-hast/lib/handlers/code.js","../../node_modules/mdast-util-to-hast/lib/handlers/delete.js","../../node_modules/mdast-util-to-hast/lib/handlers/emphasis.js","../../node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js","../../node_modules/mdast-util-to-hast/lib/handlers/heading.js","../../node_modules/mdast-util-to-hast/lib/handlers/html.js","../../node_modules/mdast-util-to-hast/lib/revert.js","../../node_modules/mdast-util-to-hast/lib/handlers/image-reference.js","../../node_modules/mdast-util-to-hast/lib/handlers/image.js","../../node_modules/mdast-util-to-hast/lib/handlers/inline-code.js","../../node_modules/mdast-util-to-hast/lib/handlers/link-reference.js","../../node_modules/mdast-util-to-hast/lib/handlers/link.js","../../node_modules/mdast-util-to-hast/lib/handlers/list-item.js","../../node_modules/mdast-util-to-hast/lib/handlers/list.js","../../node_modules/mdast-util-to-hast/lib/handlers/paragraph.js","../../node_modules/mdast-util-to-hast/lib/handlers/root.js","../../node_modules/mdast-util-to-hast/lib/handlers/strong.js","../../node_modules/unist-util-position/lib/index.js","../../node_modules/mdast-util-to-hast/lib/handlers/table.js","../../node_modules/mdast-util-to-hast/lib/handlers/table-row.js","../../node_modules/mdast-util-to-hast/lib/handlers/table-cell.js","../../node_modules/trim-lines/index.js","../../node_modules/mdast-util-to-hast/lib/handlers/text.js","../../node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js","../../node_modules/mdast-util-to-hast/lib/handlers/index.js","../../node_modules/@ungap/structured-clone/esm/deserialize.js","../../node_modules/@ungap/structured-clone/esm/serialize.js","../../node_modules/@ungap/structured-clone/esm/index.js","../../node_modules/mdast-util-to-hast/lib/footer.js","../../node_modules/mdast-util-to-hast/lib/state.js","../../node_modules/mdast-util-to-hast/lib/index.js","../../node_modules/remark-rehype/lib/index.js","../../node_modules/hast-util-sanitize/lib/schema.js","../../node_modules/hast-util-sanitize/lib/index.js","../../node_modules/rehype-sanitize/lib/index.js","../../src/core/identity.ts","../../src/pipeline/official.ts","../../src/pipeline/custom.ts","../../src/pipeline/identity.ts"],"sourcesContent":["/**\n * Throw a given error.\n *\n * @param {Error|null|undefined} [error]\n * Maybe error.\n * @returns {asserts error is null|undefined}\n */\nexport function bail(error) {\n if (error) {\n throw error\n }\n}\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n","export default function isPlainObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);\n}\n","// To do: remove `void`s\n// To do: remove `null` from output of our APIs, allow it as user APIs.\n\n/**\n * @typedef {(error?: Error | null | undefined, ...output: Array<any>) => void} Callback\n * Callback.\n *\n * @typedef {(...input: Array<any>) => any} Middleware\n * Ware.\n *\n * @typedef Pipeline\n * Pipeline.\n * @property {Run} run\n * Run the pipeline.\n * @property {Use} use\n * Add middleware.\n *\n * @typedef {(...input: Array<any>) => void} Run\n * Call all middleware.\n *\n * Calls `done` on completion with either an error or the output of the\n * last middleware.\n *\n * > 👉 **Note**: as the length of input defines whether async functions get a\n * > `next` function,\n * > it’s recommended to keep `input` at one value normally.\n\n *\n * @typedef {(fn: Middleware) => Pipeline} Use\n * Add middleware.\n */\n\n/**\n * Create new middleware.\n *\n * @returns {Pipeline}\n * Pipeline.\n */\nexport function trough() {\n /** @type {Array<Middleware>} */\n const fns = []\n /** @type {Pipeline} */\n const pipeline = {run, use}\n\n return pipeline\n\n /** @type {Run} */\n function run(...values) {\n let middlewareIndex = -1\n /** @type {Callback} */\n const callback = values.pop()\n\n if (typeof callback !== 'function') {\n throw new TypeError('Expected function as last argument, not ' + callback)\n }\n\n next(null, ...values)\n\n /**\n * Run the next `fn`, or we’re done.\n *\n * @param {Error | null | undefined} error\n * @param {Array<any>} output\n */\n function next(error, ...output) {\n const fn = fns[++middlewareIndex]\n let index = -1\n\n if (error) {\n callback(error)\n return\n }\n\n // Copy non-nullish input into values.\n while (++index < values.length) {\n if (output[index] === null || output[index] === undefined) {\n output[index] = values[index]\n }\n }\n\n // Save the newly created `output` for the next call.\n values = output\n\n // Next or done.\n if (fn) {\n wrap(fn, next)(...output)\n } else {\n callback(null, ...output)\n }\n }\n }\n\n /** @type {Use} */\n function use(middelware) {\n if (typeof middelware !== 'function') {\n throw new TypeError(\n 'Expected `middelware` to be a function, not ' + middelware\n )\n }\n\n fns.push(middelware)\n return pipeline\n }\n}\n\n/**\n * Wrap `middleware` into a uniform interface.\n *\n * You can pass all input to the resulting function.\n * `callback` is then called with the output of `middleware`.\n *\n * If `middleware` accepts more arguments than the later given in input,\n * an extra `done` function is passed to it after that input,\n * which must be called by `middleware`.\n *\n * The first value in `input` is the main input value.\n * All other input values are the rest input values.\n * The values given to `callback` are the input values,\n * merged with every non-nullish output value.\n *\n * * if `middleware` throws an error,\n * returns a promise that is rejected,\n * or calls the given `done` function with an error,\n * `callback` is called with that error\n * * if `middleware` returns a value or returns a promise that is resolved,\n * that value is the main output value\n * * if `middleware` calls `done`,\n * all non-nullish values except for the first one (the error) overwrite the\n * output values\n *\n * @param {Middleware} middleware\n * Function to wrap.\n * @param {Callback} callback\n * Callback called with the output of `middleware`.\n * @returns {Run}\n * Wrapped middleware.\n */\nexport function wrap(middleware, callback) {\n /** @type {boolean} */\n let called\n\n return wrapped\n\n /**\n * Call `middleware`.\n * @this {any}\n * @param {Array<any>} parameters\n * @returns {void}\n */\n function wrapped(...parameters) {\n const fnExpectsCallback = middleware.length > parameters.length\n /** @type {any} */\n let result\n\n if (fnExpectsCallback) {\n parameters.push(done)\n }\n\n try {\n result = middleware.apply(this, parameters)\n } catch (error) {\n const exception = /** @type {Error} */ (error)\n\n // Well, this is quite the pickle.\n // `middleware` received a callback and called it synchronously, but that\n // threw an error.\n // The only thing left to do is to throw the thing instead.\n if (fnExpectsCallback && called) {\n throw exception\n }\n\n return done(exception)\n }\n\n if (!fnExpectsCallback) {\n if (result && result.then && typeof result.then === 'function') {\n result.then(then, done)\n } else if (result instanceof Error) {\n done(result)\n } else {\n then(result)\n }\n }\n }\n\n /**\n * Call `callback`, only once.\n *\n * @type {Callback}\n */\n function done(error, ...output) {\n if (!called) {\n called = true\n callback(error, ...output)\n }\n }\n\n /**\n * Call `done` with one value.\n *\n * @param {any} [value]\n */\n function then(value) {\n done(null, value)\n }\n}\n","export const CallableInstance =\n /**\n * @type {new <Parameters extends Array<unknown>, Result>(property: string | symbol) => (...parameters: Parameters) => Result}\n */\n (\n /** @type {unknown} */\n (\n /**\n * @this {Function}\n * @param {string | symbol} property\n * @returns {(...parameters: Array<unknown>) => unknown}\n */\n function (property) {\n const self = this\n const constr = self.constructor\n const proto = /** @type {Record<string | symbol, Function>} */ (\n // Prototypes do exist.\n // type-coverage:ignore-next-line\n constr.prototype\n )\n const value = proto[property]\n /** @type {(...parameters: Array<unknown>) => unknown} */\n const apply = function () {\n return value.apply(apply, arguments)\n }\n\n Object.setPrototypeOf(apply, proto)\n\n // Not needed for us in `unified`: we only call this on the `copy`\n // function,\n // and we don't need to add its fields (`length`, `name`)\n // over.\n // See also: GH-246.\n // const names = Object.getOwnPropertyNames(value)\n //\n // for (const p of names) {\n // const descriptor = Object.getOwnPropertyDescriptor(value, p)\n // if (descriptor) Object.defineProperty(apply, p, descriptor)\n // }\n\n return apply\n }\n )\n )\n","/**\n * @typedef {import('trough').Pipeline} Pipeline\n *\n * @typedef {import('unist').Node} Node\n *\n * @typedef {import('vfile').Compatible} Compatible\n * @typedef {import('vfile').Value} Value\n *\n * @typedef {import('../index.js').CompileResultMap} CompileResultMap\n * @typedef {import('../index.js').Data} Data\n * @typedef {import('../index.js').Settings} Settings\n */\n\n/**\n * @typedef {CompileResultMap[keyof CompileResultMap]} CompileResults\n * Acceptable results from compilers.\n *\n * To register custom results, add them to\n * {@linkcode CompileResultMap}.\n */\n\n/**\n * @template {Node} [Tree=Node]\n * The node that the compiler receives (default: `Node`).\n * @template {CompileResults} [Result=CompileResults]\n * The thing that the compiler yields (default: `CompileResults`).\n * @callback Compiler\n * A **compiler** handles the compiling of a syntax tree to something else\n * (in most cases, text) (TypeScript type).\n *\n * It is used in the stringify phase and called with a {@linkcode Node}\n * and {@linkcode VFile} representation of the document to compile.\n * It should return the textual representation of the given tree (typically\n * `string`).\n *\n * > **Note**: unified typically compiles by serializing: most compilers\n * > return `string` (or `Uint8Array`).\n * > Some compilers, such as the one configured with\n * > [`rehype-react`][rehype-react], return other values (in this case, a\n * > React tree).\n * > If you’re using a compiler that doesn’t serialize, expect different\n * > result values.\n * >\n * > To register custom results in TypeScript, add them to\n * > {@linkcode CompileResultMap}.\n *\n * [rehype-react]: https://github.com/rehypejs/rehype-react\n * @param {Tree} tree\n * Tree to compile.\n * @param {VFile} file\n * File associated with `tree`.\n * @returns {Result}\n * New content: compiled text (`string` or `Uint8Array`, for `file.value`) or\n * something else (for `file.result`).\n */\n\n/**\n * @template {Node} [Tree=Node]\n * The node that the parser yields (default: `Node`)\n * @callback Parser\n * A **parser** handles the parsing of text to a syntax tree.\n *\n * It is used in the parse phase and is called with a `string` and\n * {@linkcode VFile} of the document to parse.\n * It must return the syntax tree representation of the given file\n * ({@linkcode Node}).\n * @param {string} document\n * Document to parse.\n * @param {VFile} file\n * File associated with `document`.\n * @returns {Tree}\n * Node representing the given file.\n */\n\n/**\n * @typedef {(\n * Plugin<Array<any>, any, any> |\n * PluginTuple<Array<any>, any, any> |\n * Preset\n * )} Pluggable\n * Union of the different ways to add plugins and settings.\n */\n\n/**\n * @typedef {Array<Pluggable>} PluggableList\n * List of plugins and presets.\n */\n\n// Note: we can’t use `callback` yet as it messes up `this`:\n// <https://github.com/microsoft/TypeScript/issues/55197>.\n/**\n * @template {Array<unknown>} [PluginParameters=[]]\n * Arguments passed to the plugin (default: `[]`, the empty tuple).\n * @template {Node | string | undefined} [Input=Node]\n * Value that is expected as input (default: `Node`).\n *\n * * If the plugin returns a {@linkcode Transformer}, this\n * should be the node it expects.\n * * If the plugin sets a {@linkcode Parser}, this should be\n * `string`.\n * * If the plugin sets a {@linkcode Compiler}, this should be the\n * node it expects.\n * @template [Output=Input]\n * Value that is yielded as output (default: `Input`).\n *\n * * If the plugin returns a {@linkcode Transformer}, this\n * should be the node that that yields.\n * * If the plugin sets a {@linkcode Parser}, this should be the\n * node that it yields.\n * * If the plugin sets a {@linkcode Compiler}, this should be\n * result it yields.\n * @typedef {(\n * (this: Processor, ...parameters: PluginParameters) =>\n * Input extends string ? // Parser.\n * Output extends Node | undefined ? undefined | void : never :\n * Output extends CompileResults ? // Compiler.\n * Input extends Node | undefined ? undefined | void : never :\n * Transformer<\n * Input extends Node ? Input : Node,\n * Output extends Node ? Output : Node\n * > | undefined | void\n * )} Plugin\n * Single plugin.\n *\n * Plugins configure the processors they are applied on in the following\n * ways:\n *\n * * they change the processor, such as the parser, the compiler, or by\n * configuring data\n * * they specify how to handle trees and files\n *\n * In practice, they are functions that can receive options and configure the\n * processor (`this`).\n *\n * > **Note**: plugins are called when the processor is *frozen*, not when\n * > they are applied.\n */\n\n/**\n * Tuple of a plugin and its configuration.\n *\n * The first item is a plugin, the rest are its parameters.\n *\n * @template {Array<unknown>} [TupleParameters=[]]\n * Arguments passed to the plugin (default: `[]`, the empty tuple).\n * @template {Node | string | undefined} [Input=undefined]\n * Value that is expected as input (optional).\n *\n * * If the plugin returns a {@linkcode Transformer}, this\n * should be the node it expects.\n * * If the plugin sets a {@linkcode Parser}, this should be\n * `string`.\n * * If the plugin sets a {@linkcode Compiler}, this should be the\n * node it expects.\n * @template [Output=undefined] (optional).\n * Value that is yielded as output.\n *\n * * If the plugin returns a {@linkcode Transformer}, this\n * should be the node that that yields.\n * * If the plugin sets a {@linkcode Parser}, this should be the\n * node that it yields.\n * * If the plugin sets a {@linkcode Compiler}, this should be\n * result it yields.\n * @typedef {(\n * [\n * plugin: Plugin<TupleParameters, Input, Output>,\n * ...parameters: TupleParameters\n * ]\n * )} PluginTuple\n */\n\n/**\n * @typedef Preset\n * Sharable configuration.\n *\n * They can contain plugins and settings.\n * @property {PluggableList | undefined} [plugins]\n * List of plugins and presets (optional).\n * @property {Settings | undefined} [settings]\n * Shared settings for parsers and compilers (optional).\n */\n\n/**\n * @template {VFile} [File=VFile]\n * The file that the callback receives (default: `VFile`).\n * @callback ProcessCallback\n * Callback called when the process is done.\n *\n * Called with either an error or a result.\n * @param {Error | undefined} [error]\n * Fatal error (optional).\n * @param {File | undefined} [file]\n * Processed file (optional).\n * @returns {undefined}\n * Nothing.\n */\n\n/**\n * @template {Node} [Tree=Node]\n * The tree that the callback receives (default: `Node`).\n * @callback RunCallback\n * Callback called when transformers are done.\n *\n * Called with either an error or results.\n * @param {Error | undefined} [error]\n * Fatal error (optional).\n * @param {Tree | undefined} [tree]\n * Transformed tree (optional).\n * @param {VFile | undefined} [file]\n * File (optional).\n * @returns {undefined}\n * Nothing.\n */\n\n/**\n * @template {Node} [Output=Node]\n * Node type that the transformer yields (default: `Node`).\n * @callback TransformCallback\n * Callback passed to transforms.\n *\n * If the signature of a `transformer` accepts a third argument, the\n * transformer may perform asynchronous operations, and must call it.\n * @param {Error | undefined} [error]\n * Fatal error to stop the process (optional).\n * @param {Output | undefined} [tree]\n * New, changed, tree (optional).\n * @param {VFile | undefined} [file]\n * New, changed, file (optional).\n * @returns {undefined}\n * Nothing.\n */\n\n/**\n * @template {Node} [Input=Node]\n * Node type that the transformer expects (default: `Node`).\n * @template {Node} [Output=Input]\n * Node type that the transformer yields (default: `Input`).\n * @callback Transformer\n * Transformers handle syntax trees and files.\n *\n * They are functions that are called each time a syntax tree and file are\n * passed through the run phase.\n * When an error occurs in them (either because it’s thrown, returned,\n * rejected, or passed to `next`), the process stops.\n *\n * The run phase is handled by [`trough`][trough], see its documentation for\n * the exact semantics of these functions.\n *\n * > **Note**: you should likely ignore `next`: don’t accept it.\n * > it supports callback-style async work.\n * > But promises are likely easier to reason about.\n *\n * [trough]: https://github.com/wooorm/trough#function-fninput-next\n * @param {Input} tree\n * Tree to handle.\n * @param {VFile} file\n * File to handle.\n * @param {TransformCallback<Output>} next\n * Callback.\n * @returns {(\n * Promise<Output | undefined | void> |\n * Promise<never> | // For some reason this is needed separately.\n * Output |\n * Error |\n * undefined |\n * void\n * )}\n * If you accept `next`, nothing.\n * Otherwise:\n *\n * * `Error` — fatal error to stop the process\n * * `Promise<undefined>` or `undefined` — the next transformer keeps using\n * same tree\n * * `Promise<Node>` or `Node` — new, changed, tree\n */\n\n/**\n * @template {Node | undefined} ParseTree\n * Output of `parse`.\n * @template {Node | undefined} HeadTree\n * Input for `run`.\n * @template {Node | undefined} TailTree\n * Output for `run`.\n * @template {Node | undefined} CompileTree\n * Input of `stringify`.\n * @template {CompileResults | undefined} CompileResult\n * Output of `stringify`.\n * @template {Node | string | undefined} Input\n * Input of plugin.\n * @template Output\n * Output of plugin (optional).\n * @typedef {(\n * Input extends string\n * ? Output extends Node | undefined\n * ? // Parser.\n * Processor<\n * Output extends undefined ? ParseTree : Output,\n * HeadTree,\n * TailTree,\n * CompileTree,\n * CompileResult\n * >\n * : // Unknown.\n * Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>\n * : Output extends CompileResults\n * ? Input extends Node | undefined\n * ? // Compiler.\n * Processor<\n * ParseTree,\n * HeadTree,\n * TailTree,\n * Input extends undefined ? CompileTree : Input,\n * Output extends undefined ? CompileResult : Output\n * >\n * : // Unknown.\n * Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>\n * : Input extends Node | undefined\n * ? Output extends Node | undefined\n * ? // Transform.\n * Processor<\n * ParseTree,\n * HeadTree extends undefined ? Input : HeadTree,\n * Output extends undefined ? TailTree : Output,\n * CompileTree,\n * CompileResult\n * >\n * : // Unknown.\n * Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>\n * : // Unknown.\n * Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>\n * )} UsePlugin\n * Create a processor based on the input/output of a {@link Plugin plugin}.\n */\n\n/**\n * @template {CompileResults | undefined} Result\n * Node type that the transformer yields.\n * @typedef {(\n * Result extends Value | undefined ?\n * VFile :\n * VFile & {result: Result}\n * )} VFileWithOutput\n * Type to generate a {@linkcode VFile} corresponding to a compiler result.\n *\n * If a result that is not acceptable on a `VFile` is used, that will\n * be stored on the `result` field of {@linkcode VFile}.\n */\n\nimport {bail} from 'bail'\nimport extend from 'extend'\nimport {ok as assert} from 'devlop'\nimport isPlainObj from 'is-plain-obj'\nimport {trough} from 'trough'\nimport {VFile} from 'vfile'\nimport {CallableInstance} from './callable-instance.js'\n\n// To do: next major: drop `Compiler`, `Parser`: prefer lowercase.\n\n// To do: we could start yielding `never` in TS when a parser is missing and\n// `parse` is called.\n// Currently, we allow directly setting `processor.parser`, which is untyped.\n\nconst own = {}.hasOwnProperty\n\n/**\n * @template {Node | undefined} [ParseTree=undefined]\n * Output of `parse` (optional).\n * @template {Node | undefined} [HeadTree=undefined]\n * Input for `run` (optional).\n * @template {Node | undefined} [TailTree=undefined]\n * Output for `run` (optional).\n * @template {Node | undefined} [CompileTree=undefined]\n * Input of `stringify` (optional).\n * @template {CompileResults | undefined} [CompileResult=undefined]\n * Output of `stringify` (optional).\n * @extends {CallableInstance<[], Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>>}\n */\nexport class Processor extends CallableInstance {\n /**\n * Create a processor.\n */\n constructor() {\n // If `Processor()` is called (w/o new), `copy` is called instead.\n super('copy')\n\n /**\n * Compiler to use (deprecated).\n *\n * @deprecated\n * Use `compiler` instead.\n * @type {(\n * Compiler<\n * CompileTree extends undefined ? Node : CompileTree,\n * CompileResult extends undefined ? CompileResults : CompileResult\n * > |\n * undefined\n * )}\n */\n this.Compiler = undefined\n\n /**\n * Parser to use (deprecated).\n *\n * @deprecated\n * Use `parser` instead.\n * @type {(\n * Parser<ParseTree extends undefined ? Node : ParseTree> |\n * undefined\n * )}\n */\n this.Parser = undefined\n\n // Note: the following fields are considered private.\n // However, they are needed for tests, and TSC generates an untyped\n // `private freezeIndex` field for, which trips `type-coverage` up.\n // Instead, we use `@deprecated` to visualize that they shouldn’t be used.\n /**\n * Internal list of configured plugins.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {Array<PluginTuple<Array<unknown>>>}\n */\n this.attachers = []\n\n /**\n * Compiler to use.\n *\n * @type {(\n * Compiler<\n * CompileTree extends undefined ? Node : CompileTree,\n * CompileResult extends undefined ? CompileResults : CompileResult\n * > |\n * undefined\n * )}\n */\n this.compiler = undefined\n\n /**\n * Internal state to track where we are while freezing.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {number}\n */\n this.freezeIndex = -1\n\n /**\n * Internal state to track whether we’re frozen.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {boolean | undefined}\n */\n this.frozen = undefined\n\n /**\n * Internal state.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {Data}\n */\n this.namespace = {}\n\n /**\n * Parser to use.\n *\n * @type {(\n * Parser<ParseTree extends undefined ? Node : ParseTree> |\n * undefined\n * )}\n */\n this.parser = undefined\n\n /**\n * Internal list of configured transformers.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {Pipeline}\n */\n this.transformers = trough()\n }\n\n /**\n * Copy a processor.\n *\n * @deprecated\n * This is a private internal method and should not be used.\n * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}\n * New *unfrozen* processor ({@linkcode Processor}) that is\n * configured to work the same as its ancestor.\n * When the descendant processor is configured in the future it does not\n * affect the ancestral processor.\n */\n copy() {\n // Cast as the type parameters will be the same after attaching.\n const destination =\n /** @type {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>} */ (\n new Processor()\n )\n let index = -1\n\n while (++index < this.attachers.length) {\n const attacher = this.attachers[index]\n destination.use(...attacher)\n }\n\n destination.data(extend(true, {}, this.namespace))\n\n return destination\n }\n\n /**\n * Configure the processor with info available to all plugins.\n * Information is stored in an object.\n *\n * Typically, options can be given to a specific plugin, but sometimes it\n * makes sense to have information shared with several plugins.\n * For example, a list of HTML elements that are self-closing, which is\n * needed during all phases.\n *\n * > **Note**: setting information cannot occur on *frozen* processors.\n * > Call the processor first to create a new unfrozen processor.\n *\n * > **Note**: to register custom data in TypeScript, augment the\n * > {@linkcode Data} interface.\n *\n * @example\n * This example show how to get and set info:\n *\n * ```js\n * import {unified} from 'unified'\n *\n * const processor = unified().data('alpha', 'bravo')\n *\n * processor.data('alpha') // => 'bravo'\n *\n * processor.data() // => {alpha: 'bravo'}\n *\n * processor.data({charlie: 'delta'})\n *\n * processor.data() // => {charlie: 'delta'}\n * ```\n *\n * @template {keyof Data} Key\n *\n * @overload\n * @returns {Data}\n *\n * @overload\n * @param {Data} dataset\n * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}\n *\n * @overload\n * @param {Key} key\n * @returns {Data[Key]}\n *\n * @overload\n * @param {Key} key\n * @param {Data[Key]} value\n * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}\n *\n * @param {Data | Key} [key]\n * Key to get or set, or entire dataset to set, or nothing to get the\n * entire dataset (optional).\n * @param {Data[Key]} [value]\n * Value to set (optional).\n * @returns {unknown}\n * The current processor when setting, the value at `key` when getting, or\n * the entire dataset when getting without key.\n */\n data(key, value) {\n if (typeof key === 'string') {\n // Set `key`.\n if (arguments.length === 2) {\n assertUnfrozen('data', this.frozen)\n this.namespace[key] = value\n return this\n }\n\n // Get `key`.\n return (own.call(this.namespace, key) && this.namespace[key]) || undefined\n }\n\n // Set space.\n if (key) {\n assertUnfrozen('data', this.frozen)\n this.namespace = key\n return this\n }\n\n // Get space.\n return this.namespace\n }\n\n /**\n * Freeze a processor.\n *\n * Frozen processors are meant to be extended and not to be configured\n * directly.\n *\n * When a processor is frozen it cannot be unfrozen.\n * New processors working the same way can be created by calling the\n * processor.\n *\n * It’s possible to freeze processors explicitly by calling `.freeze()`.\n * Processors freeze automatically when `.parse()`, `.run()`, `.runSync()`,\n * `.stringify()`, `.process()`, or `.processSync()` are called.\n *\n * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}\n * The current processor.\n */\n freeze() {\n if (this.frozen) {\n return this\n }\n\n // Cast so that we can type plugins easier.\n // Plugins are supposed to be usable on different processors, not just on\n // this exact processor.\n const self = /** @type {Processor} */ (/** @type {unknown} */ (this))\n\n while (++this.freezeIndex < this.attachers.length) {\n const [attacher, ...options] = this.attachers[this.freezeIndex]\n\n if (options[0] === false) {\n continue\n }\n\n if (options[0] === true) {\n options[0] = undefined\n }\n\n const transformer = attacher.call(self, ...options)\n\n if (typeof transformer === 'function') {\n this.transformers.use(transformer)\n }\n }\n\n this.frozen = true\n this.freezeIndex = Number.POSITIVE_INFINITY\n\n return this\n }\n\n /**\n * Parse text to a syntax tree.\n *\n * > **Note**: `parse` freezes the processor if not already *frozen*.\n *\n * > **Note**: `parse` performs the parse phase, not the run phase or other\n * > phases.\n *\n * @param {Compatible | undefined} [file]\n * file to parse (optional); typically `string` or `VFile`; any value\n * accepted as `x` in `new VFile(x)`.\n * @returns {ParseTree extends undefined ? Node : ParseTree}\n * Syntax tree representing `file`.\n */\n parse(file) {\n this.freeze()\n const realFile = vfile(file)\n const parser = this.parser || this.Parser\n assertParser('parse', parser)\n return parser(String(realFile), realFile)\n }\n\n /**\n * Process the given file as configured on the processor.\n *\n * > **Note**: `process` freezes the processor if not already *frozen*.\n *\n * > **Note**: `process` performs the parse, run, and stringify phases.\n *\n * @overload\n * @param {Compatible | undefined} file\n * @param {ProcessCallback<VFileWithOutput<CompileResult>>} done\n * @returns {undefined}\n *\n * @overload\n * @param {Compatible | undefined} [file]\n * @returns {Promise<VFileWithOutput<CompileResult>>}\n *\n * @param {Compatible | undefined} [file]\n * File (optional); typically `string` or `VFile`]; any value accepted as\n * `x` in `new VFile(x)`.\n * @param {ProcessCallback<VFileWithOutput<CompileResult>> | undefined} [done]\n * Callback (optional).\n * @returns {Promise<VFile> | undefined}\n * Nothing if `done` is given.\n * Otherwise a promise, rejected with a fatal error or resolved with the\n * processed file.\n *\n * The parsed, transformed, and compiled value is available at\n * `file.value` (see note).\n *\n * > **Note**: unified typically compiles by serializing: most\n * > compilers return `string` (or `Uint8Array`).\n * > Some compilers, such as the one configured with\n * > [`rehype-react`][rehype-react], return other values (in this case, a\n * > React tree).\n * > If you’re using a compiler that doesn’t serialize, expect different\n * > result values.\n * >\n * > To register custom results in TypeScript, add them to\n * > {@linkcode CompileResultMap}.\n *\n * [rehype-react]: https://github.com/rehypejs/rehype-react\n */\n process(file, done) {\n const self = this\n\n this.freeze()\n assertParser('process', this.parser || this.Parser)\n assertCompiler('process', this.compiler || this.Compiler)\n\n return done ? executor(undefined, done) : new Promise(executor)\n\n // Note: `void`s needed for TS.\n /**\n * @param {((file: VFileWithOutput<CompileResult>) => undefined | void) | undefined} resolve\n * @param {(error: Error | undefined) => undefined | void} reject\n * @returns {undefined}\n */\n function executor(resolve, reject) {\n const realFile = vfile(file)\n // Assume `ParseTree` (the result of the parser) matches `HeadTree` (the\n // input of the first transform).\n const parseTree =\n /** @type {HeadTree extends undefined ? Node : HeadTree} */ (\n /** @type {unknown} */ (self.parse(realFile))\n )\n\n self.run(parseTree, realFile, function (error, tree, file) {\n if (error || !tree || !file) {\n return realDone(error)\n }\n\n // Assume `TailTree` (the output of the last transform) matches\n // `CompileTree` (the input of the compiler).\n const compileTree =\n /** @type {CompileTree extends undefined ? Node : CompileTree} */ (\n /** @type {unknown} */ (tree)\n )\n\n const compileResult = self.stringify(compileTree, file)\n\n if (looksLikeAValue(compileResult)) {\n file.value = compileResult\n } else {\n file.result = compileResult\n }\n\n realDone(error, /** @type {VFileWithOutput<CompileResult>} */ (file))\n })\n\n /**\n * @param {Error | undefined} error\n * @param {VFileWithOutput<CompileResult> | undefined} [file]\n * @returns {undefined}\n */\n function realDone(error, file) {\n if (error || !file) {\n reject(error)\n } else if (resolve) {\n resolve(file)\n } else {\n assert(done, '`done` is defined if `resolve` is not')\n done(undefined, file)\n }\n }\n }\n }\n\n /**\n * Process the given file as configured on the processor.\n *\n * An error is thrown if asynchronous transforms are configured.\n *\n * > **Note**: `processSync` freezes the processor if not already *frozen*.\n *\n * > **Note**: `processSync` performs the parse, run, and stringify phases.\n *\n * @param {Compatible | undefined} [file]\n * File (optional); typically `string` or `VFile`; any value accepted as\n * `x` in `new VFile(x)`.\n * @returns {VFileWithOutput<CompileResult>}\n * The processed file.\n *\n * The parsed, transformed, and compiled value is available at\n * `file.value` (see note).\n *\n * > **Note**: unified typically compiles by serializing: most\n * > compilers return `string` (or `Uint8Array`).\n * > Some compilers, such as the one configured with\n * > [`rehype-react`][rehype-react], return other values (in this case, a\n * > React tree).\n * > If you’re using a compiler that doesn’t serialize, expect different\n * > result values.\n * >\n * > To register custom results in TypeScript, add them to\n * > {@linkcode CompileResultMap}.\n *\n * [rehype-react]: https://github.com/rehypejs/rehype-react\n */\n processSync(file) {\n /** @type {boolean} */\n let complete = false\n /** @type {VFileWithOutput<CompileResult> | undefined} */\n let result\n\n this.freeze()\n assertParser('processSync', this.parser || this.Parser)\n assertCompiler('processSync', this.compiler || this.Compiler)\n\n this.process(file, realDone)\n assertDone('processSync', 'process', complete)\n assert(result, 'we either bailed on an error or have a tree')\n\n return result\n\n /**\n * @type {ProcessCallback<VFileWithOutput<CompileResult>>}\n */\n function realDone(error, file) {\n complete = true\n bail(error)\n result = file\n }\n }\n\n /**\n * Run *transformers* on a syntax tree.\n *\n * > **Note**: `run` freezes the processor if not already *frozen*.\n *\n * > **Note**: `run` performs the run phase, not other phases.\n *\n * @overload\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * @param {RunCallback<TailTree extends undefined ? Node : TailTree>} done\n * @returns {undefined}\n *\n * @overload\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * @param {Compatible | undefined} file\n * @param {RunCallback<TailTree extends undefined ? Node : TailTree>} done\n * @returns {undefined}\n *\n * @overload\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * @param {Compatible | undefined} [file]\n * @returns {Promise<TailTree extends undefined ? Node : TailTree>}\n *\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * Tree to transform and inspect.\n * @param {(\n * RunCallback<TailTree extends undefined ? Node : TailTree> |\n * Compatible\n * )} [file]\n * File associated with `node` (optional); any value accepted as `x` in\n * `new VFile(x)`.\n * @param {RunCallback<TailTree extends undefined ? Node : TailTree>} [done]\n * Callback (optional).\n * @returns {Promise<TailTree extends undefined ? Node : TailTree> | undefined}\n * Nothing if `done` is given.\n * Otherwise, a promise rejected with a fatal error or resolved with the\n * transformed tree.\n */\n run(tree, file, done) {\n assertNode(tree)\n this.freeze()\n\n const transformers = this.transformers\n\n if (!done && typeof file === 'function') {\n done = file\n file = undefined\n }\n\n return done ? executor(undefined, done) : new Promise(executor)\n\n // Note: `void`s needed for TS.\n /**\n * @param {(\n * ((tree: TailTree extends undefined ? Node : TailTree) => undefined | void) |\n * undefined\n * )} resolve\n * @param {(error: Error) => undefined | void} reject\n * @returns {undefined}\n */\n function executor(resolve, reject) {\n assert(\n typeof file !== 'function',\n '`file` can’t be a `done` anymore, we checked'\n )\n const realFile = vfile(file)\n transformers.run(tree, realFile, realDone)\n\n /**\n * @param {Error | undefined} error\n * @param {Node} outputTree\n * @param {VFile} file\n * @returns {undefined}\n */\n function realDone(error, outputTree, file) {\n const resultingTree =\n /** @type {TailTree extends undefined ? Node : TailTree} */ (\n outputTree || tree\n )\n\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(resultingTree)\n } else {\n assert(done, '`done` is defined if `resolve` is not')\n done(undefined, resultingTree, file)\n }\n }\n }\n }\n\n /**\n * Run *transformers* on a syntax tree.\n *\n * An error is thrown if asynchronous transforms are configured.\n *\n * > **Note**: `runSync` freezes the processor if not already *frozen*.\n *\n * > **Note**: `runSync` performs the run phase, not other phases.\n *\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * Tree to transform and inspect.\n * @param {Compatible | undefined} [file]\n * File associated with `node` (optional); any value accepted as `x` in\n * `new VFile(x)`.\n * @returns {TailTree extends undefined ? Node : TailTree}\n * Transformed tree.\n */\n runSync(tree, file) {\n /** @type {boolean} */\n let complete = false\n /** @type {(TailTree extends undefined ? Node : TailTree) | undefined} */\n let result\n\n this.run(tree, file, realDone)\n\n assertDone('runSync', 'run', complete)\n assert(result, 'we either bailed on an error or have a tree')\n return result\n\n /**\n * @type {RunCallback<TailTree extends undefined ? Node : TailTree>}\n */\n function realDone(error, tree) {\n bail(error)\n result = tree\n complete = true\n }\n }\n\n /**\n * Compile a syntax tree.\n *\n * > **Note**: `stringify` freezes the processor if not already *frozen*.\n *\n * > **Note**: `stringify` performs the stringify phase, not the run phase\n * > or other phases.\n *\n * @param {CompileTree extends undefined ? Node : CompileTree} tree\n * Tree to compile.\n * @param {Compatible | undefined} [file]\n * File associated with `node` (optional); any value accepted as `x` in\n * `new VFile(x)`.\n * @returns {CompileResult extends undefined ? Value : CompileResult}\n * Textual representation of the tree (see note).\n *\n * > **Note**: unified typically compiles by serializing: most compilers\n * > return `string` (or `Uint8Array`).\n * > Some compilers, such as the one configured with\n * > [`rehype-react`][rehype-react], return other values (in this case, a\n * > React tree).\n * > If you’re using a compiler that doesn’t serialize, expect different\n * > result values.\n * >\n * > To register custom results in TypeScript, add them to\n * > {@linkcode CompileResultMap}.\n *\n * [rehype-react]: https://github.com/rehypejs/rehype-react\n */\n stringify(tree, file) {\n this.freeze()\n const realFile = vfile(file)\n const compiler = this.compiler || this.Compiler\n assertCompiler('stringify', compiler)\n assertNode(tree)\n\n return compiler(tree, realFile)\n }\n\n /**\n * Configure the processor to use a plugin, a list of usable values, or a\n * preset.\n *\n * If the processor is already using a plugin, the previous plugin\n * configuration is changed based on the options that are passed in.\n * In other words, the plugin is not added a second time.\n *\n * > **Note**: `use` cannot be called on *frozen* processors.\n * > Call the processor first to create a new unfrozen processor.\n *\n * @example\n * There are many ways to pass plugins to `.use()`.\n * This example gives an overview:\n *\n * ```js\n * import {unified} from 'unified'\n *\n * unified()\n * // Plugin with options:\n * .use(pluginA, {x: true, y: true})\n * // Passing the same plugin again merges configuration (to `{x: true, y: false, z: true}`):\n * .use(pluginA, {y: false, z: true})\n * // Plugins:\n * .use([pluginB, pluginC])\n * // Two plugins, the second with options:\n * .use([pluginD, [pluginE, {}]])\n * // Preset with plugins and settings:\n * .use({plugins: [pluginF, [pluginG, {}]], settings: {position: false}})\n * // Settings only:\n * .use({settings: {position: false}})\n * ```\n *\n * @template {Array<unknown>} [Parameters=[]]\n * @template {Node | string | undefined} [Input=undefined]\n * @template [Output=Input]\n *\n * @overload\n * @param {Preset | null | undefined} [preset]\n * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}\n *\n * @overload\n * @param {PluggableList} list\n * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}\n *\n * @overload\n * @param {Plugin<Parameters, Input, Output>} plugin\n * @param {...(Parameters | [boolean])} parameters\n * @returns {UsePlugin<ParseTree, HeadTree, TailTree, CompileTree, CompileResult, Input, Output>}\n *\n * @param {PluggableList | Plugin | Preset | null | undefined} value\n * Usable value.\n * @param {...unknown} parameters\n * Parameters, when a plugin is given as a usable value.\n * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}\n * Current processor.\n */\n use(value, ...parameters) {\n const attachers = this.attachers\n const namespace = this.namespace\n\n assertUnfrozen('use', this.frozen)\n\n if (value === null || value === undefined) {\n // Empty.\n } else if (typeof value === 'function') {\n addPlugin(value, parameters)\n } else if (typeof value === 'object') {\n if (Array.isArray(value)) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new TypeError('Expected usable value, not `' + value + '`')\n }\n\n return this\n\n /**\n * @param {Pluggable} value\n * @returns {undefined}\n */\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value, [])\n } else if (typeof value === 'object') {\n if (Array.isArray(value)) {\n const [plugin, ...parameters] =\n /** @type {PluginTuple<Array<unknown>>} */ (value)\n addPlugin(plugin, parameters)\n } else {\n addPreset(value)\n }\n } else {\n throw new TypeError('Expected usable value, not `' + value + '`')\n }\n }\n\n /**\n * @param {Preset} result\n * @returns {undefined}\n */\n function addPreset(result) {\n if (!('plugins' in result) && !('settings' in result)) {\n throw new Error(\n 'Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither'\n )\n }\n\n addList(result.plugins)\n\n if (result.settings) {\n namespace.settings = extend(true, namespace.settings, result.settings)\n }\n }\n\n /**\n * @param {PluggableList | null | undefined} plugins\n * @returns {undefined}\n */\n function addList(plugins) {\n let index = -1\n\n if (plugins === null || plugins === undefined) {\n // Empty.\n } else if (Array.isArray(plugins)) {\n while (++index < plugins.length) {\n const thing = plugins[index]\n add(thing)\n }\n } else {\n throw new TypeError('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n /**\n * @param {Plugin} plugin\n * @param {Array<unknown>} parameters\n * @returns {undefined}\n */\n function addPlugin(plugin, parameters) {\n let index = -1\n let entryIndex = -1\n\n while (++index < attachers.length) {\n if (attachers[index][0] === plugin) {\n entryIndex = index\n break\n }\n }\n\n if (entryIndex === -1) {\n attachers.push([plugin, ...parameters])\n }\n // Only set if there was at least a `primary` value, otherwise we’d change\n // `arguments.length`.\n else if (parameters.length > 0) {\n let [primary, ...rest] = parameters\n const currentPrimary = attachers[entryIndex][1]\n if (isPlainObj(currentPrimary) && isPlainObj(primary)) {\n primary = extend(true, currentPrimary, primary)\n }\n\n attachers[entryIndex] = [plugin, primary, ...rest]\n }\n }\n }\n}\n\n// Note: this returns a *callable* instance.\n// That’s why it’s documented as a function.\n/**\n * Create a new processor.\n *\n * @example\n * This example shows how a new processor can be created (from `remark`) and linked\n * to **stdin**(4) and **stdout**(4).\n *\n * ```js\n * import process from 'node:process'\n * import concatStream from 'concat-stream'\n * import {remark} from 'remark'\n *\n * process.stdin.pipe(\n * concatStream(function (buf) {\n * process.stdout.write(String(remark().processSync(buf)))\n * })\n * )\n * ```\n *\n * @returns\n * New *unfrozen* processor (`processor`).\n *\n * This processor is configured to work the same as its ancestor.\n * When the descendant processor is configured in the future it does not\n * affect the ancestral processor.\n */\nexport const unified = new Processor().freeze()\n\n/**\n * Assert a parser is available.\n *\n * @param {string} name\n * @param {unknown} value\n * @returns {asserts value is Parser}\n */\nfunction assertParser(name, value) {\n if (typeof value !== 'function') {\n throw new TypeError('Cannot `' + name + '` without `parser`')\n }\n}\n\n/**\n * Assert a compiler is available.\n *\n * @param {string} name\n * @param {unknown} value\n * @returns {asserts value is Compiler}\n */\nfunction assertCompiler(name, value) {\n if (typeof value !== 'function') {\n throw new TypeError('Cannot `' + name + '` without `compiler`')\n }\n}\n\n/**\n * Assert the processor is not frozen.\n *\n * @param {string} name\n * @param {unknown} frozen\n * @returns {asserts frozen is false}\n */\nfunction assertUnfrozen(name, frozen) {\n if (frozen) {\n throw new Error(\n 'Cannot call `' +\n name +\n '` on a frozen processor.\\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.'\n )\n }\n}\n\n/**\n * Assert `node` is a unist node.\n *\n * @param {unknown} node\n * @returns {asserts node is Node}\n */\nfunction assertNode(node) {\n // `isPlainObj` unfortunately uses `any` instead of `unknown`.\n // type-coverage:ignore-next-line\n if (!isPlainObj(node) || typeof node.type !== 'string') {\n throw new TypeError('Expected node, got `' + node + '`')\n // Fine.\n }\n}\n\n/**\n * Assert that `complete` is `true`.\n *\n * @param {string} name\n * @param {string} asyncName\n * @param {unknown} complete\n * @returns {asserts complete is true}\n */\nfunction assertDone(name, asyncName, complete) {\n if (!complete) {\n throw new Error(\n '`' + name + '` finished async. Use `' + asyncName + '` instead'\n )\n }\n}\n\n/**\n * @param {Compatible | undefined} [value]\n * @returns {VFile}\n */\nfunction vfile(value) {\n return looksLikeAVFile(value) ? value : new VFile(value)\n}\n\n/**\n * @param {Compatible | undefined} [value]\n * @returns {value is VFile}\n */\nfunction looksLikeAVFile(value) {\n return Boolean(\n value &&\n typeof value === 'object' &&\n 'message' in value &&\n 'messages' in value\n )\n}\n\n/**\n * @param {unknown} [value]\n * @returns {value is Value}\n */\nfunction looksLikeAValue(value) {\n return typeof value === 'string' || isUint8Array(value)\n}\n\n/**\n * Assert `value` is an `Uint8Array`.\n *\n * @param {unknown} value\n * thing.\n * @returns {value is Uint8Array}\n * Whether `value` is an `Uint8Array`.\n */\nfunction isUint8Array(value) {\n return Boolean(\n value &&\n typeof value === 'object' &&\n 'byteLength' in value &&\n 'byteOffset' in value\n )\n}\n","/**\n * List of lowercase HTML “block” tag names.\n *\n * The list, when parsing HTML (flow), results in more relaxed rules (condition\n * 6).\n * Because they are known blocks, the HTML-like syntax doesn’t have to be\n * strictly parsed.\n * For tag names not in this list, a more strict algorithm (condition 7) is used\n * to detect whether the HTML-like syntax is seen as HTML (flow) or not.\n *\n * This is copied from:\n * <https://spec.commonmark.org/0.30/#html-blocks>.\n *\n * > 👉 **Note**: `search` was added in `CommonMark@0.31`.\n */\nexport const htmlBlockNames = [\n 'address',\n 'article',\n 'aside',\n 'base',\n 'basefont',\n 'blockquote',\n 'body',\n 'caption',\n 'center',\n 'col',\n 'colgroup',\n 'dd',\n 'details',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'frame',\n 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'iframe',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'menu',\n 'menuitem',\n 'nav',\n 'noframes',\n 'ol',\n 'optgroup',\n 'option',\n 'p',\n 'param',\n 'search',\n 'section',\n 'summary',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'title',\n 'tr',\n 'track',\n 'ul'\n]\n\n/**\n * List of lowercase HTML “raw” tag names.\n *\n * The list, when parsing HTML (flow), results in HTML that can include lines\n * without exiting, until a closing tag also in this list is found (condition\n * 1).\n *\n * This module is copied from:\n * <https://spec.commonmark.org/0.30/#html-blocks>.\n *\n * > 👉 **Note**: `textarea` was added in `CommonMark@0.30`.\n */\nexport const htmlRawNames = ['pre', 'script', 'style', 'textarea']\n","/**\n * Map of named character references.\n *\n * @type {Record<string, string>}\n */\nexport const characterEntities = {\n AElig: 'Æ',\n AMP: '&',\n Aacute: 'Á',\n Abreve: 'Ă',\n Acirc: 'Â',\n Acy: 'А',\n Afr: '𝔄',\n Agrave: 'À',\n Alpha: 'Α',\n Amacr: 'Ā',\n And: '⩓',\n Aogon: 'Ą',\n Aopf: '𝔸',\n ApplyFunction: '',\n Aring: 'Å',\n Ascr: '𝒜',\n Assign: '≔',\n Atilde: 'Ã',\n Auml: 'Ä',\n Backslash: '∖',\n Barv: '⫧',\n Barwed: '⌆',\n Bcy: 'Б',\n Because: '∵',\n Bernoullis: 'ℬ',\n Beta: 'Β',\n Bfr: '𝔅',\n Bopf: '𝔹',\n Breve: '˘',\n Bscr: 'ℬ',\n Bumpeq: '≎',\n CHcy: 'Ч',\n COPY: '©',\n Cacute: 'Ć',\n Cap: '⋒',\n CapitalDifferentialD: 'ⅅ',\n Cayleys: 'ℭ',\n Ccaron: 'Č',\n Ccedil: 'Ç',\n Ccirc: 'Ĉ',\n Cconint: '∰',\n Cdot: 'Ċ',\n Cedilla: '¸',\n CenterDot: '·',\n Cfr: 'ℭ',\n Chi: 'Χ',\n CircleDot: '⊙',\n CircleMinus: '⊖',\n CirclePlus: '⊕',\n CircleTimes: '⊗',\n ClockwiseContourIntegral: '∲',\n CloseCurlyDoubleQuote: '”',\n CloseCurlyQuote: '’',\n Colon: '∷',\n Colone: '⩴',\n Congruent: '≡',\n Conint: '∯',\n ContourIntegral: '∮',\n Copf: 'ℂ',\n Coproduct: '∐',\n CounterClockwiseContourIntegral: '∳',\n Cross: '⨯',\n Cscr: '𝒞',\n Cup: '⋓',\n CupCap: '≍',\n DD: 'ⅅ',\n DDotrahd: '⤑',\n DJcy: 'Ђ',\n DScy: 'Ѕ',\n DZcy: 'Џ',\n Dagger: '‡',\n Darr: '↡',\n Dashv: '⫤',\n Dcaron: 'Ď',\n Dcy: 'Д',\n Del: '∇',\n Delta: 'Δ',\n Dfr: '𝔇',\n DiacriticalAcute: '´',\n DiacriticalDot: '˙',\n DiacriticalDoubleAcute: '˝',\n DiacriticalGrave: '`',\n DiacriticalTilde: '˜',\n Diamond: '⋄',\n DifferentialD: 'ⅆ',\n Dopf: '𝔻',\n Dot: '¨',\n DotDot: '⃜',\n DotEqual: '≐',\n DoubleContourIntegral: '∯',\n DoubleDot: '¨',\n DoubleDownArrow: '⇓',\n DoubleLeftArrow: '⇐',\n DoubleLeftRightArrow: '⇔',\n DoubleLeftTee: '⫤',\n DoubleLongLeftArrow: '⟸',\n DoubleLongLeftRightArrow: '⟺',\n DoubleLongRightArrow: '⟹',\n DoubleRightArrow: '⇒',\n DoubleRightTee: '⊨',\n DoubleUpArrow: '⇑',\n DoubleUpDownArrow: '⇕',\n DoubleVerticalBar: '∥',\n DownArrow: '↓',\n DownArrowBar: '⤓',\n DownArrowUpArrow: '⇵',\n DownBreve: '̑',\n DownLeftRightVector: '⥐',\n DownLeftTeeVector: '⥞',\n DownLeftVector: '↽',\n DownLeftVectorBar: '⥖',\n DownRightTeeVector: '⥟',\n DownRightVector: '⇁',\n DownRightVectorBar: '⥗',\n DownTee: '⊤',\n DownTeeArrow: '↧',\n Downarrow: '⇓',\n Dscr: '𝒟',\n Dstrok: 'Đ',\n ENG: 'Ŋ',\n ETH: 'Ð',\n Eacute: 'É',\n Ecaron: 'Ě',\n Ecirc: 'Ê',\n Ecy: 'Э',\n Edot: 'Ė',\n Efr: '𝔈',\n Egrave: 'È',\n Element: '∈',\n Emacr: 'Ē',\n EmptySmallSquare: '◻',\n EmptyVerySmallSquare: '▫',\n Eogon: 'Ę',\n Eopf: '𝔼',\n Epsilon: 'Ε',\n Equal: '⩵',\n EqualTilde: '≂',\n Equilibrium: '⇌',\n Escr: 'ℰ',\n Esim: '⩳',\n Eta: 'Η',\n Euml: 'Ë',\n Exists: '∃',\n ExponentialE: 'ⅇ',\n Fcy: 'Ф',\n Ffr: '𝔉',\n FilledSmallSquare: '◼',\n FilledVerySmallSquare: '▪',\n Fopf: '𝔽',\n ForAll: '∀',\n Fouriertrf: 'ℱ',\n Fscr: 'ℱ',\n GJcy: 'Ѓ',\n GT: '>',\n Gamma: 'Γ',\n Gammad: 'Ϝ',\n Gbreve: 'Ğ',\n Gcedil: 'Ģ',\n Gcirc: 'Ĝ',\n Gcy: 'Г',\n Gdot: 'Ġ',\n Gfr: '𝔊',\n Gg: '⋙',\n Gopf: '𝔾',\n GreaterEqual: '≥',\n GreaterEqualLess: '⋛',\n GreaterFullEqual: '≧',\n GreaterGreater: '⪢',\n GreaterLess: '≷',\n GreaterSlantEqual: '⩾',\n GreaterTilde: '≳',\n Gscr: '𝒢',\n Gt: '≫',\n HARDcy: 'Ъ',\n Hacek: 'ˇ',\n Hat: '^',\n Hcirc: 'Ĥ',\n Hfr: 'ℌ',\n HilbertSpace: 'ℋ',\n Hopf: 'ℍ',\n HorizontalLine: '─',\n Hscr: 'ℋ',\n Hstrok: 'Ħ',\n HumpDownHump: '≎',\n HumpEqual: '≏',\n IEcy: 'Е',\n IJlig: 'IJ',\n IOcy: 'Ё',\n Iacute: 'Í',\n Icirc: 'Î',\n Icy: 'И',\n Idot: 'İ',\n Ifr: 'ℑ',\n Igrave: 'Ì',\n Im: 'ℑ',\n Imacr: 'Ī',\n ImaginaryI: 'ⅈ',\n Implies: '⇒',\n Int: '∬',\n Integral: '∫',\n Intersection: '⋂',\n InvisibleComma: '',\n InvisibleTimes: '',\n Iogon: 'Į',\n Iopf: '𝕀',\n Iota: 'Ι',\n Iscr: 'ℐ',\n Itilde: 'Ĩ',\n Iukcy: 'І',\n Iuml: 'Ï',\n Jcirc: 'Ĵ',\n Jcy: 'Й',\n Jfr: '𝔍',\n Jopf: '𝕁',\n Jscr: '𝒥',\n Jsercy: 'Ј',\n Jukcy: 'Є',\n KHcy: 'Х',\n KJcy: 'Ќ',\n Kappa: 'Κ',\n Kcedil: 'Ķ',\n Kcy: 'К',\n Kfr: '𝔎',\n Kopf: '𝕂',\n Kscr: '𝒦',\n LJcy: 'Љ',\n LT: '<',\n Lacute: 'Ĺ',\n Lambda: 'Λ',\n Lang: '⟪',\n Laplacetrf: 'ℒ',\n Larr: '↞',\n Lcaron: 'Ľ',\n Lcedil: 'Ļ',\n Lcy: 'Л',\n LeftAngleBracket: '⟨',\n LeftArrow: '←',\n LeftArrowBar: '⇤',\n LeftArrowRightArrow: '⇆',\n LeftCeiling: '⌈',\n LeftDoubleBracket: '⟦',\n LeftDownTeeVector: '⥡',\n LeftDownVector: '⇃',\n LeftDownVectorBar: '⥙',\n LeftFloor: '⌊',\n LeftRightArrow: '↔',\n LeftRightVector: '⥎',\n LeftTee: '⊣',\n LeftTeeArrow: '↤',\n LeftTeeVector: '⥚',\n LeftTriangle: '⊲',\n LeftTriangleBar: '⧏',\n LeftTriangleEqual: '⊴',\n LeftUpDownVector: '⥑',\n LeftUpTeeVector: '⥠',\n LeftUpVector: '↿',\n LeftUpVectorBar: '⥘',\n LeftVector: '↼',\n LeftVectorBar: '⥒',\n Leftarrow: '⇐',\n Leftrightarrow: '⇔',\n LessEqualGreater: '⋚',\n LessFullEqual: '≦',\n LessGreater: '≶',\n LessLess: '⪡',\n LessSlantEqual: '⩽',\n LessTilde: '≲',\n Lfr: '𝔏',\n Ll: '⋘',\n Lleftarrow: '⇚',\n Lmidot: 'Ŀ',\n LongLeftArrow: '⟵',\n LongLeftRightArrow: '⟷',\n LongRightArrow: '⟶',\n Longleftarrow: '⟸',\n Longleftrightarrow: '⟺',\n Longrightarrow: '⟹',\n Lopf: '𝕃',\n LowerLeftArrow: '↙',\n LowerRightArrow: '↘',\n Lscr: 'ℒ',\n Lsh: '↰',\n Lstrok: 'Ł',\n Lt: '≪',\n Map: '⤅',\n Mcy: 'М',\n MediumSpace: ' ',\n Mellintrf: 'ℳ',\n Mfr: '𝔐',\n MinusPlus: '∓',\n Mopf: '𝕄',\n Mscr: 'ℳ',\n Mu: 'Μ',\n NJcy: 'Њ',\n Nacute: 'Ń',\n Ncaron: 'Ň',\n Ncedil: 'Ņ',\n Ncy: 'Н',\n NegativeMediumSpace: '',\n NegativeThickSpace: '',\n NegativeThinSpace: '',\n NegativeVeryThinSpace: '',\n NestedGreaterGreater: '≫',\n NestedLessLess: '≪',\n NewLine: '\\n',\n Nfr: '𝔑',\n NoBreak: '',\n NonBreakingSpace: ' ',\n Nopf: 'ℕ',\n Not: '⫬',\n NotCongruent: '≢',\n NotCupCap: '≭',\n NotDoubleVerticalBar: '∦',\n NotElement: '∉',\n NotEqual: '≠',\n NotEqualTilde: '≂̸',\n NotExists: '∄',\n NotGreater: '≯',\n NotGreaterEqual: '≱',\n NotGreaterFullEqual: '≧̸',\n NotGreaterGreater: '≫̸',\n NotGreaterLess: '≹',\n NotGreaterSlantEqual: '⩾̸',\n NotGreaterTilde: '≵',\n NotHumpDownHump: '≎̸',\n NotHumpEqual: '≏̸',\n NotLeftTriangle: '⋪',\n NotLeftTriangleBar: '⧏̸',\n NotLeftTriangleEqual: '⋬',\n NotLess: '≮',\n NotLessEqual: '≰',\n NotLessGreater: '≸',\n NotLessLess: '≪̸',\n NotLessSlantEqual: '⩽̸',\n NotLessTilde: '≴',\n NotNestedGreaterGreater: '⪢̸',\n NotNestedLessLess: '⪡̸',\n NotPrecedes: '⊀',\n NotPrecedesEqual: '⪯̸',\n NotPrecedesSlantEqual: '⋠',\n NotReverseElement: '∌',\n NotRightTriangle: '⋫',\n NotRightTriangleBar: '⧐̸',\n NotRightTriangleEqual: '⋭',\n NotSquareSubset: '⊏̸',\n NotSquareSubsetEqual: '⋢',\n NotSquareSuperset: '⊐̸',\n NotSquareSupersetEqual: '⋣',\n NotSubset: '⊂⃒',\n NotSubsetEqual: '⊈',\n NotSucceeds: '⊁',\n NotSucceedsEqual: '⪰̸',\n NotSucceedsSlantEqual: '⋡',\n NotSucceedsTilde: '≿̸',\n NotSuperset: '⊃⃒',\n NotSupersetEqual: '⊉',\n NotTilde: '≁',\n NotTildeEqual: '≄',\n NotTildeFullEqual: '≇',\n NotTildeTilde: '≉',\n NotVerticalBar: '∤',\n Nscr: '𝒩',\n Ntilde: 'Ñ',\n Nu: 'Ν',\n OElig: 'Œ',\n Oacute: 'Ó',\n Ocirc: 'Ô',\n Ocy: 'О',\n Odblac: 'Ő',\n Ofr: '𝔒',\n Ograve: 'Ò',\n Omacr: 'Ō',\n Omega: 'Ω',\n Omicron: 'Ο',\n Oopf: '𝕆',\n OpenCurlyDoubleQuote: '“',\n OpenCurlyQuote: '‘',\n Or: '⩔',\n Oscr: '𝒪',\n Oslash: 'Ø',\n Otilde: 'Õ',\n Otimes: '⨷',\n Ouml: 'Ö',\n OverBar: '‾',\n OverBrace: '⏞',\n OverBracket: '⎴',\n OverParenthesis: '⏜',\n PartialD: '∂',\n Pcy: 'П',\n Pfr: '𝔓',\n Phi: 'Φ',\n Pi: 'Π',\n PlusMinus: '±',\n Poincareplane: 'ℌ',\n Popf: 'ℙ',\n Pr: '⪻',\n Precedes: '≺',\n PrecedesEqual: '⪯',\n PrecedesSlantEqual: '≼',\n PrecedesTilde: '≾',\n Prime: '″',\n Product: '∏',\n Proportion: '∷',\n Proportional: '∝',\n Pscr: '𝒫',\n Psi: 'Ψ',\n QUOT: '\"',\n Qfr: '𝔔',\n Qopf: 'ℚ',\n Qscr: '𝒬',\n RBarr: '⤐',\n REG: '®',\n Racute: 'Ŕ',\n Rang: '⟫',\n Rarr: '↠',\n Rarrtl: '⤖',\n Rcaron: 'Ř',\n Rcedil: 'Ŗ',\n Rcy: 'Р',\n Re: 'ℜ',\n ReverseElement: '∋',\n ReverseEquilibrium: '⇋',\n ReverseUpEquilibrium: '⥯',\n Rfr: 'ℜ',\n Rho: 'Ρ',\n RightAngleBracket: '⟩',\n RightArrow: '→',\n RightArrowBar: '⇥',\n RightArrowLeftArrow: '⇄',\n RightCeiling: '⌉',\n RightDoubleBracket: '⟧',\n RightDownTeeVector: '⥝',\n RightDownVector: '⇂',\n RightDownVectorBar: '⥕',\n RightFloor: '⌋',\n RightTee: '⊢',\n RightTeeArrow: '↦',\n RightTeeVector: '⥛',\n RightTriangle: '⊳',\n RightTriangleBar: '⧐',\n RightTriangleEqual: '⊵',\n RightUpDownVector: '⥏',\n RightUpTeeVector: '⥜',\n RightUpVector: '↾',\n RightUpVectorBar: '⥔',\n RightVector: '⇀',\n RightVectorBar: '⥓',\n Rightarrow: '⇒',\n Ropf: 'ℝ',\n RoundImplies: '⥰',\n Rrightarrow: '⇛',\n Rscr: 'ℛ',\n Rsh: '↱',\n RuleDelayed: '⧴',\n SHCHcy: 'Щ',\n SHcy: 'Ш',\n SOFTcy: 'Ь',\n Sacute: 'Ś',\n Sc: '⪼',\n Scaron: 'Š',\n Scedil: 'Ş',\n Scirc: 'Ŝ',\n Scy: 'С',\n Sfr: '𝔖',\n ShortDownArrow: '↓',\n ShortLeftArrow: '←',\n ShortRightArrow: '→',\n ShortUpArrow: '↑',\n Sigma: 'Σ',\n SmallCircle: '∘',\n Sopf: '𝕊',\n Sqrt: '√',\n Square: '□',\n SquareIntersection: '⊓',\n SquareSubset: '⊏',\n SquareSubsetEqual: '⊑',\n SquareSuperset: '⊐',\n SquareSupersetEqual: '⊒',\n SquareUnion: '⊔',\n Sscr: '𝒮',\n Star: '⋆',\n Sub: '⋐',\n Subset: '⋐',\n SubsetEqual: '⊆',\n Succeeds: '≻',\n SucceedsEqual: '⪰',\n SucceedsSlantEqual: '≽',\n SucceedsTilde: '≿',\n SuchThat: '∋',\n Sum: '∑',\n Sup: '⋑',\n Superset: '⊃',\n SupersetEqual: '⊇',\n Supset: '⋑',\n THORN: 'Þ',\n TRADE: '™',\n TSHcy: 'Ћ',\n TScy: 'Ц',\n Tab: '\\t',\n Tau: 'Τ',\n Tcaron: 'Ť',\n Tcedil: 'Ţ',\n Tcy: 'Т',\n Tfr: '𝔗',\n Therefore: '∴',\n Theta: 'Θ',\n ThickSpace: ' ',\n ThinSpace: ' ',\n Tilde: '∼',\n TildeEqual: '≃',\n TildeFullEqual: '≅',\n TildeTilde: '≈',\n Topf: '𝕋',\n TripleDot: '⃛',\n Tscr: '𝒯',\n Tstrok: 'Ŧ',\n Uacute: 'Ú',\n Uarr: '↟',\n Uarrocir: '⥉',\n Ubrcy: 'Ў',\n Ubreve: 'Ŭ',\n Ucirc: 'Û',\n Ucy: 'У',\n Udblac: 'Ű',\n Ufr: '𝔘',\n Ugrave: 'Ù',\n Umacr: 'Ū',\n UnderBar: '_',\n UnderBrace: '⏟',\n UnderBracket: '⎵',\n UnderParenthesis: '⏝',\n Union: '⋃',\n UnionPlus: '⊎',\n Uogon: 'Ų',\n Uopf: '𝕌',\n UpArrow: '↑',\n UpArrowBar: '⤒',\n UpArrowDownArrow: '⇅',\n UpDownArrow: '↕',\n UpEquilibrium: '⥮',\n UpTee: '⊥',\n UpTeeArrow: '↥',\n Uparrow: '⇑',\n Updownarrow: '⇕',\n UpperLeftArrow: '↖',\n UpperRightArrow: '↗',\n Upsi: 'ϒ',\n Upsilon: 'Υ',\n Uring: 'Ů',\n Uscr: '𝒰',\n Utilde: 'Ũ',\n Uuml: 'Ü',\n VDash: '⊫',\n Vbar: '⫫',\n Vcy: 'В',\n Vdash: '⊩',\n Vdashl: '⫦',\n Vee: '⋁',\n Verbar: '‖',\n Vert: '‖',\n VerticalBar: '∣',\n VerticalLine: '|',\n VerticalSeparator: '❘',\n VerticalTilde: '≀',\n VeryThinSpace: ' ',\n Vfr: '𝔙',\n Vopf: '𝕍',\n Vscr: '𝒱',\n Vvdash: '⊪',\n Wcirc: 'Ŵ',\n Wedge: '⋀',\n Wfr: '𝔚',\n Wopf: '𝕎',\n Wscr: '𝒲',\n Xfr: '𝔛',\n Xi: 'Ξ',\n Xopf: '𝕏',\n Xscr: '𝒳',\n YAcy: 'Я',\n YIcy: 'Ї',\n YUcy: 'Ю',\n Yacute: 'Ý',\n Ycirc: 'Ŷ',\n Ycy: 'Ы',\n Yfr: '𝔜',\n Yopf: '𝕐',\n Yscr: '𝒴',\n Yuml: 'Ÿ',\n ZHcy: 'Ж',\n Zacute: 'Ź',\n Zcaron: 'Ž',\n Zcy: 'З',\n Zdot: 'Ż',\n ZeroWidthSpace: '',\n Zeta: 'Ζ',\n Zfr: 'ℨ',\n Zopf: 'ℤ',\n Zscr: '𝒵',\n aacute: 'á',\n abreve: 'ă',\n ac: '∾',\n acE: '∾̳',\n acd: '∿',\n acirc: 'â',\n acute: '´',\n acy: 'а',\n aelig: 'æ',\n af: '',\n afr: '𝔞',\n agrave: 'à',\n alefsym: 'ℵ',\n aleph: 'ℵ',\n alpha: 'α',\n amacr: 'ā',\n amalg: '⨿',\n amp: '&',\n and: '∧',\n andand: '⩕',\n andd: '⩜',\n andslope: '⩘',\n andv: '⩚',\n ang: '∠',\n ange: '⦤',\n angle: '∠',\n angmsd: '∡',\n angmsdaa: '⦨',\n angmsdab: '⦩',\n angmsdac: '⦪',\n angmsdad: '⦫',\n angmsdae: '⦬',\n angmsdaf: '⦭',\n angmsdag: '⦮',\n angmsdah: '⦯',\n angrt: '∟',\n angrtvb: '⊾',\n angrtvbd: '⦝',\n angsph: '∢',\n angst: 'Å',\n angzarr: '⍼',\n aogon: 'ą',\n aopf: '𝕒',\n ap: '≈',\n apE: '⩰',\n apacir: '⩯',\n ape: '≊',\n apid: '≋',\n apos: \"'\",\n approx: '≈',\n approxeq: '≊',\n aring: 'å',\n ascr: '𝒶',\n ast: '*',\n asymp: '≈',\n asympeq: '≍',\n atilde: 'ã',\n auml: 'ä',\n awconint: '∳',\n awint: '⨑',\n bNot: '⫭',\n backcong: '≌',\n backepsilon: '϶',\n backprime: '‵',\n backsim: '∽',\n backsimeq: '⋍',\n barvee: '⊽',\n barwed: '⌅',\n barwedge: '⌅',\n bbrk: '⎵',\n bbrktbrk: '⎶',\n bcong: '≌',\n bcy: 'б',\n bdquo: '„',\n becaus: '∵',\n because: '∵',\n bemptyv: '⦰',\n bepsi: '϶',\n bernou: 'ℬ',\n beta: 'β',\n beth: 'ℶ',\n between: '≬',\n bfr: '𝔟',\n bigcap: '⋂',\n bigcirc: '◯',\n bigcup: '⋃',\n bigodot: '⨀',\n bigoplus: '⨁',\n bigotimes: '⨂',\n bigsqcup: '⨆',\n bigstar: '★',\n bigtriangledown: '▽',\n bigtriangleup: '△',\n biguplus: '⨄',\n bigvee: '⋁',\n bigwedge: '⋀',\n bkarow: '⤍',\n blacklozenge: '⧫',\n blacksquare: '▪',\n blacktriangle: '▴',\n blacktriangledown: '▾',\n blacktriangleleft: '◂',\n blacktriangleright: '▸',\n blank: '␣',\n blk12: '▒',\n blk14: '░',\n blk34: '▓',\n block: '█',\n bne: '=⃥',\n bnequiv: '≡⃥',\n bnot: '⌐',\n bopf: '𝕓',\n bot: '⊥',\n bottom: '⊥',\n bowtie: '⋈',\n boxDL: '╗',\n boxDR: '╔',\n boxDl: '╖',\n boxDr: '╓',\n boxH: '═',\n boxHD: '╦',\n boxHU: '╩',\n boxHd: '╤',\n boxHu: '╧',\n boxUL: '╝',\n boxUR: '╚',\n boxUl: '╜',\n boxUr: '╙',\n boxV: '║',\n boxVH: '╬',\n boxVL: '╣',\n boxVR: '╠',\n boxVh: '╫',\n boxVl: '╢',\n boxVr: '╟',\n boxbox: '⧉',\n boxdL: '╕',\n boxdR: '╒',\n boxdl: '┐',\n boxdr: '┌',\n boxh: '─',\n boxhD: '╥',\n boxhU: '╨',\n boxhd: '┬',\n boxhu: '┴',\n boxminus: '⊟',\n boxplus: '⊞',\n boxtimes: '⊠',\n boxuL: '╛',\n boxuR: '╘',\n boxul: '┘',\n boxur: '└',\n boxv: '│',\n boxvH: '╪',\n boxvL: '╡',\n boxvR: '╞',\n boxvh: '┼',\n boxvl: '┤',\n boxvr: '├',\n bprime: '‵',\n breve: '˘',\n brvbar: '¦',\n bscr: '𝒷',\n bsemi: '⁏',\n bsim: '∽',\n bsime: '⋍',\n bsol: '\\\\',\n bsolb: '⧅',\n bsolhsub: '⟈',\n bull: '•',\n bullet: '•',\n bump: '≎',\n bumpE: '⪮',\n bumpe: '≏',\n bumpeq: '≏',\n cacute: 'ć',\n cap: '∩',\n capand: '⩄',\n capbrcup: '⩉',\n capcap: '⩋',\n capcup: '⩇',\n capdot: '⩀',\n caps: '∩︀',\n caret: '⁁',\n caron: 'ˇ',\n ccaps: '⩍',\n ccaron: 'č',\n ccedil: 'ç',\n ccirc: 'ĉ',\n ccups: '⩌',\n ccupssm: '⩐',\n cdot: 'ċ',\n cedil: '¸',\n cemptyv: '⦲',\n cent: '¢',\n centerdot: '·',\n cfr: '𝔠',\n chcy: 'ч',\n check: '✓',\n checkmark: '✓',\n chi: 'χ',\n cir: '○',\n cirE: '⧃',\n circ: 'ˆ',\n circeq: '≗',\n circlearrowleft: '↺',\n circlearrowright: '↻',\n circledR: '®',\n circledS: 'Ⓢ',\n circledast: '⊛',\n circledcirc: '⊚',\n circleddash: '⊝',\n cire: '≗',\n cirfnint: '⨐',\n cirmid: '⫯',\n cirscir: '⧂',\n clubs: '♣',\n clubsuit: '♣',\n colon: ':',\n colone: '≔',\n coloneq: '≔',\n comma: ',',\n commat: '@',\n comp: '∁',\n compfn: '∘',\n complement: '∁',\n complexes: 'ℂ',\n cong: '≅',\n congdot: '⩭',\n conint: '∮',\n copf: '𝕔',\n coprod: '∐',\n copy: '©',\n copysr: '℗',\n crarr: '↵',\n cross: '✗',\n cscr: '𝒸',\n csub: '⫏',\n csube: '⫑',\n csup: '⫐',\n csupe: '⫒',\n ctdot: '⋯',\n cudarrl: '⤸',\n cudarrr: '⤵',\n cuepr: '⋞',\n cuesc: '⋟',\n cularr: '↶',\n cularrp: '⤽',\n cup: '∪',\n cupbrcap: '⩈',\n cupcap: '⩆',\n cupcup: '⩊',\n cupdot: '⊍',\n cupor: '⩅',\n cups: '∪︀',\n curarr: '↷',\n curarrm: '⤼',\n curlyeqprec: '⋞',\n curlyeqsucc: '⋟',\n curlyvee: '⋎',\n curlywedge: '⋏',\n curren: '¤',\n curvearrowleft: '↶',\n curvearrowright: '↷',\n cuvee: '⋎',\n cuwed: '⋏',\n cwconint: '∲',\n cwint: '∱',\n cylcty: '⌭',\n dArr: '⇓',\n dHar: '⥥',\n dagger: '†',\n daleth: 'ℸ',\n darr: '↓',\n dash: '‐',\n dashv: '⊣',\n dbkarow: '⤏',\n dblac: '˝',\n dcaron: 'ď',\n dcy: 'д',\n dd: 'ⅆ',\n ddagger: '‡',\n ddarr: '⇊',\n ddotseq: '⩷',\n deg: '°',\n delta: 'δ',\n demptyv: '⦱',\n dfisht: '⥿',\n dfr: '𝔡',\n dharl: '⇃',\n dharr: '⇂',\n diam: '⋄',\n diamond: '⋄',\n diamondsuit: '♦',\n diams: '♦',\n die: '¨',\n digamma: 'ϝ',\n disin: '⋲',\n div: '÷',\n divide: '÷',\n divideontimes: '⋇',\n divonx: '⋇',\n djcy: 'ђ',\n dlcorn: '⌞',\n dlcrop: '⌍',\n dollar: '$',\n dopf: '𝕕',\n dot: '˙',\n doteq: '≐',\n doteqdot: '≑',\n dotminus: '∸',\n dotplus: '∔',\n dotsquare: '⊡',\n doublebarwedge: '⌆',\n downarrow: '↓',\n downdownarrows: '⇊',\n downharpoonleft: '⇃',\n downharpoonright: '⇂',\n drbkarow: '⤐',\n drcorn: '⌟',\n drcrop: '⌌',\n dscr: '𝒹',\n dscy: 'ѕ',\n dsol: '⧶',\n dstrok: 'đ',\n dtdot: '⋱',\n dtri: '▿',\n dtrif: '▾',\n duarr: '⇵',\n duhar: '⥯',\n dwangle: '⦦',\n dzcy: 'џ',\n dzigrarr: '⟿',\n eDDot: '⩷',\n eDot: '≑',\n eacute: 'é',\n easter: '⩮',\n ecaron: 'ě',\n ecir: '≖',\n ecirc: 'ê',\n ecolon: '≕',\n ecy: 'э',\n edot: 'ė',\n ee: 'ⅇ',\n efDot: '≒',\n efr: '𝔢',\n eg: '⪚',\n egrave: 'è',\n egs: '⪖',\n egsdot: '⪘',\n el: '⪙',\n elinters: '⏧',\n ell: 'ℓ',\n els: '⪕',\n elsdot: '⪗',\n emacr: 'ē',\n empty: '∅',\n emptyset: '∅',\n emptyv: '∅',\n emsp13: ' ',\n emsp14: ' ',\n emsp: ' ',\n eng: 'ŋ',\n ensp: ' ',\n eogon: 'ę',\n eopf: '𝕖',\n epar: '⋕',\n eparsl: '⧣',\n eplus: '⩱',\n epsi: 'ε',\n epsilon: 'ε',\n epsiv: 'ϵ',\n eqcirc: '≖',\n eqcolon: '≕',\n eqsim: '≂',\n eqslantgtr: '⪖',\n eqslantless: '⪕',\n equals: '=',\n equest: '≟',\n equiv: '≡',\n equivDD: '⩸',\n eqvparsl: '⧥',\n erDot: '≓',\n erarr: '⥱',\n escr: 'ℯ',\n esdot: '≐',\n esim: '≂',\n eta: 'η',\n eth: 'ð',\n euml: 'ë',\n euro: '€',\n excl: '!',\n exist: '∃',\n expectation: 'ℰ',\n exponentiale: 'ⅇ',\n fallingdotseq: '≒',\n fcy: 'ф',\n female: '♀',\n ffilig: 'ffi',\n fflig: 'ff',\n ffllig: 'ffl',\n ffr: '𝔣',\n filig: 'fi',\n fjlig: 'fj',\n flat: '♭',\n fllig: 'fl',\n fltns: '▱',\n fnof: 'ƒ',\n fopf: '𝕗',\n forall: '∀',\n fork: '⋔',\n forkv: '⫙',\n fpartint: '⨍',\n frac12: '½',\n frac13: '⅓',\n frac14: '¼',\n frac15: '⅕',\n frac16: '⅙',\n frac18: '⅛',\n frac23: '⅔',\n frac25: '⅖',\n frac34: '¾',\n frac35: '⅗',\n frac38: '⅜',\n frac45: '⅘',\n frac56: '⅚',\n frac58: '⅝',\n frac78: '⅞',\n frasl: '⁄',\n frown: '⌢',\n fscr: '𝒻',\n gE: '≧',\n gEl: '⪌',\n gacute: 'ǵ',\n gamma: 'γ',\n gammad: 'ϝ',\n gap: '⪆',\n gbreve: 'ğ',\n gcirc: 'ĝ',\n gcy: 'г',\n gdot: 'ġ',\n ge: '≥',\n gel: '⋛',\n geq: '≥',\n geqq: '≧',\n geqslant: '⩾',\n ges: '⩾',\n gescc: '⪩',\n gesdot: '⪀',\n gesdoto: '⪂',\n gesdotol: '⪄',\n gesl: '⋛︀',\n gesles: '⪔',\n gfr: '𝔤',\n gg: '≫',\n ggg: '⋙',\n gimel: 'ℷ',\n gjcy: 'ѓ',\n gl: '≷',\n glE: '⪒',\n gla: '⪥',\n glj: '⪤',\n gnE: '≩',\n gnap: '⪊',\n gnapprox: '⪊',\n gne: '⪈',\n gneq: '⪈',\n gneqq: '≩',\n gnsim: '⋧',\n gopf: '𝕘',\n grave: '`',\n gscr: 'ℊ',\n gsim: '≳',\n gsime: '⪎',\n gsiml: '⪐',\n gt: '>',\n gtcc: '⪧',\n gtcir: '⩺',\n gtdot: '⋗',\n gtlPar: '⦕',\n gtquest: '⩼',\n gtrapprox: '⪆',\n gtrarr: '⥸',\n gtrdot: '⋗',\n gtreqless: '⋛',\n gtreqqless: '⪌',\n gtrless: '≷',\n gtrsim: '≳',\n gvertneqq: '≩︀',\n gvnE: '≩︀',\n hArr: '⇔',\n hairsp: ' ',\n half: '½',\n hamilt: 'ℋ',\n hardcy: 'ъ',\n harr: '↔',\n harrcir: '⥈',\n harrw: '↭',\n hbar: 'ℏ',\n hcirc: 'ĥ',\n hearts: '♥',\n heartsuit: '♥',\n hellip: '…',\n hercon: '⊹',\n hfr: '𝔥',\n hksearow: '⤥',\n hkswarow: '⤦',\n hoarr: '⇿',\n homtht: '∻',\n hookleftarrow: '↩',\n hookrightarrow: '↪',\n hopf: '𝕙',\n horbar: '―',\n hscr: '𝒽',\n hslash: 'ℏ',\n hstrok: 'ħ',\n hybull: '⁃',\n hyphen: '‐',\n iacute: 'í',\n ic: '',\n icirc: 'î',\n icy: 'и',\n iecy: 'е',\n iexcl: '¡',\n iff: '⇔',\n ifr: '𝔦',\n igrave: 'ì',\n ii: 'ⅈ',\n iiiint: '⨌',\n iiint: '∭',\n iinfin: '⧜',\n iiota: '℩',\n ijlig: 'ij',\n imacr: 'ī',\n image: 'ℑ',\n imagline: 'ℐ',\n imagpart: 'ℑ',\n imath: 'ı',\n imof: '⊷',\n imped: 'Ƶ',\n in: '∈',\n incare: '℅',\n infin: '∞',\n infintie: '⧝',\n inodot: 'ı',\n int: '∫',\n intcal: '⊺',\n integers: 'ℤ',\n intercal: '⊺',\n intlarhk: '⨗',\n intprod: '⨼',\n iocy: 'ё',\n iogon: 'į',\n iopf: '𝕚',\n iota: 'ι',\n iprod: '⨼',\n iquest: '¿',\n iscr: '𝒾',\n isin: '∈',\n isinE: '⋹',\n isindot: '⋵',\n isins: '⋴',\n isinsv: '⋳',\n isinv: '∈',\n it: '',\n itilde: 'ĩ',\n iukcy: 'і',\n iuml: 'ï',\n jcirc: 'ĵ',\n jcy: 'й',\n jfr: '𝔧',\n jmath: 'ȷ',\n jopf: '𝕛',\n jscr: '𝒿',\n jsercy: 'ј',\n jukcy: 'є',\n kappa: 'κ',\n kappav: 'ϰ',\n kcedil: 'ķ',\n kcy: 'к',\n kfr: '𝔨',\n kgreen: 'ĸ',\n khcy: 'х',\n kjcy: 'ќ',\n kopf: '𝕜',\n kscr: '𝓀',\n lAarr: '⇚',\n lArr: '⇐',\n lAtail: '⤛',\n lBarr: '⤎',\n lE: '≦',\n lEg: '⪋',\n lHar: '⥢',\n lacute: 'ĺ',\n laemptyv: '⦴',\n lagran: 'ℒ',\n lambda: 'λ',\n lang: '⟨',\n langd: '⦑',\n langle: '⟨',\n lap: '⪅',\n laquo: '«',\n larr: '←',\n larrb: '⇤',\n larrbfs: '⤟',\n larrfs: '⤝',\n larrhk: '↩',\n larrlp: '↫',\n larrpl: '⤹',\n larrsim: '⥳',\n larrtl: '↢',\n lat: '⪫',\n latail: '⤙',\n late: '⪭',\n lates: '⪭︀',\n lbarr: '⤌',\n lbbrk: '❲',\n lbrace: '{',\n lbrack: '[',\n lbrke: '⦋',\n lbrksld: '⦏',\n lbrkslu: '⦍',\n lcaron: 'ľ',\n lcedil: 'ļ',\n lceil: '⌈',\n lcub: '{',\n lcy: 'л',\n ldca: '⤶',\n ldquo: '“',\n ldquor: '„',\n ldrdhar: '⥧',\n ldrushar: '⥋',\n ldsh: '↲',\n le: '≤',\n leftarrow: '←',\n leftarrowtail: '↢',\n leftharpoondown: '↽',\n leftharpoonup: '↼',\n leftleftarrows: '⇇',\n leftrightarrow: '↔',\n leftrightarrows: '⇆',\n leftrightharpoons: '⇋',\n leftrightsquigarrow: '↭',\n leftthreetimes: '⋋',\n leg: '⋚',\n leq: '≤',\n leqq: '≦',\n leqslant: '⩽',\n les: '⩽',\n lescc: '⪨',\n lesdot: '⩿',\n lesdoto: '⪁',\n lesdotor: '⪃',\n lesg: '⋚︀',\n lesges: '⪓',\n lessapprox: '⪅',\n lessdot: '⋖',\n lesseqgtr: '⋚',\n lesseqqgtr: '⪋',\n lessgtr: '≶',\n lesssim: '≲',\n lfisht: '⥼',\n lfloor: '⌊',\n lfr: '𝔩',\n lg: '≶',\n lgE: '⪑',\n lhard: '↽',\n lharu: '↼',\n lharul: '⥪',\n lhblk: '▄',\n ljcy: 'љ',\n ll: '≪',\n llarr: '⇇',\n llcorner: '⌞',\n llhard: '⥫',\n lltri: '◺',\n lmidot: 'ŀ',\n lmoust: '⎰',\n lmoustache: '⎰',\n lnE: '≨',\n lnap: '⪉',\n lnapprox: '⪉',\n lne: '⪇',\n lneq: '⪇',\n lneqq: '≨',\n lnsim: '⋦',\n loang: '⟬',\n loarr: '⇽',\n lobrk: '⟦',\n longleftarrow: '⟵',\n longleftrightarrow: '⟷',\n longmapsto: '⟼',\n longrightarrow: '⟶',\n looparrowleft: '↫',\n looparrowright: '↬',\n lopar: '⦅',\n lopf: '𝕝',\n loplus: '⨭',\n lotimes: '⨴',\n lowast: '∗',\n lowbar: '_',\n loz: '◊',\n lozenge: '◊',\n lozf: '⧫',\n lpar: '(',\n lparlt: '⦓',\n lrarr: '⇆',\n lrcorner: '⌟',\n lrhar: '⇋',\n lrhard: '⥭',\n lrm: '',\n lrtri: '⊿',\n lsaquo: '‹',\n lscr: '𝓁',\n lsh: '↰',\n lsim: '≲',\n lsime: '⪍',\n lsimg: '⪏',\n lsqb: '[',\n lsquo: '‘',\n lsquor: '‚',\n lstrok: 'ł',\n lt: '<',\n ltcc: '⪦',\n ltcir: '⩹',\n ltdot: '⋖',\n lthree: '⋋',\n ltimes: '⋉',\n ltlarr: '⥶',\n ltquest: '⩻',\n ltrPar: '⦖',\n ltri: '◃',\n ltrie: '⊴',\n ltrif: '◂',\n lurdshar: '⥊',\n luruhar: '⥦',\n lvertneqq: '≨︀',\n lvnE: '≨︀',\n mDDot: '∺',\n macr: '¯',\n male: '♂',\n malt: '✠',\n maltese: '✠',\n map: '↦',\n mapsto: '↦',\n mapstodown: '↧',\n mapstoleft: '↤',\n mapstoup: '↥',\n marker: '▮',\n mcomma: '⨩',\n mcy: 'м',\n mdash: '—',\n measuredangle: '∡',\n mfr: '𝔪',\n mho: '℧',\n micro: 'µ',\n mid: '∣',\n midast: '*',\n midcir: '⫰',\n middot: '·',\n minus: '−',\n minusb: '⊟',\n minusd: '∸',\n minusdu: '⨪',\n mlcp: '⫛',\n mldr: '…',\n mnplus: '∓',\n models: '⊧',\n mopf: '𝕞',\n mp: '∓',\n mscr: '𝓂',\n mstpos: '∾',\n mu: 'μ',\n multimap: '⊸',\n mumap: '⊸',\n nGg: '⋙̸',\n nGt: '≫⃒',\n nGtv: '≫̸',\n nLeftarrow: '⇍',\n nLeftrightarrow: '⇎',\n nLl: '⋘̸',\n nLt: '≪⃒',\n nLtv: '≪̸',\n nRightarrow: '⇏',\n nVDash: '⊯',\n nVdash: '⊮',\n nabla: '∇',\n nacute: 'ń',\n nang: '∠⃒',\n nap: '≉',\n napE: '⩰̸',\n napid: '≋̸',\n napos: 'ʼn',\n napprox: '≉',\n natur: '♮',\n natural: '♮',\n naturals: 'ℕ',\n nbsp: ' ',\n nbump: '≎̸',\n nbumpe: '≏̸',\n ncap: '⩃',\n ncaron: 'ň',\n ncedil: 'ņ',\n ncong: '≇',\n ncongdot: '⩭̸',\n ncup: '⩂',\n ncy: 'н',\n ndash: '–',\n ne: '≠',\n neArr: '⇗',\n nearhk: '⤤',\n nearr: '↗',\n nearrow: '↗',\n nedot: '≐̸',\n nequiv: '≢',\n nesear: '⤨',\n nesim: '≂̸',\n nexist: '∄',\n nexists: '∄',\n nfr: '𝔫',\n ngE: '≧̸',\n nge: '≱',\n ngeq: '≱',\n ngeqq: '≧̸',\n ngeqslant: '⩾̸',\n nges: '⩾̸',\n ngsim: '≵',\n ngt: '≯',\n ngtr: '≯',\n nhArr: '⇎',\n nharr: '↮',\n nhpar: '⫲',\n ni: '∋',\n nis: '⋼',\n nisd: '⋺',\n niv: '∋',\n njcy: 'њ',\n nlArr: '⇍',\n nlE: '≦̸',\n nlarr: '↚',\n nldr: '‥',\n nle: '≰',\n nleftarrow: '↚',\n nleftrightarrow: '↮',\n nleq: '≰',\n nleqq: '≦̸',\n nleqslant: '⩽̸',\n nles: '⩽̸',\n nless: '≮',\n nlsim: '≴',\n nlt: '≮',\n nltri: '⋪',\n nltrie: '⋬',\n nmid: '∤',\n nopf: '𝕟',\n not: '¬',\n notin: '∉',\n notinE: '⋹̸',\n notindot: '⋵̸',\n notinva: '∉',\n notinvb: '⋷',\n notinvc: '⋶',\n notni: '∌',\n notniva: '∌',\n notnivb: '⋾',\n notnivc: '⋽',\n npar: '∦',\n nparallel: '∦',\n nparsl: '⫽⃥',\n npart: '∂̸',\n npolint: '⨔',\n npr: '⊀',\n nprcue: '⋠',\n npre: '⪯̸',\n nprec: '⊀',\n npreceq: '⪯̸',\n nrArr: '⇏',\n nrarr: '↛',\n nrarrc: '⤳̸',\n nrarrw: '↝̸',\n nrightarrow: '↛',\n nrtri: '⋫',\n nrtrie: '⋭',\n nsc: '⊁',\n nsccue: '⋡',\n nsce: '⪰̸',\n nscr: '𝓃',\n nshortmid: '∤',\n nshortparallel: '∦',\n nsim: '≁',\n nsime: '≄',\n nsimeq: '≄',\n nsmid: '∤',\n nspar: '∦',\n nsqsube: '⋢',\n nsqsupe: '⋣',\n nsub: '⊄',\n nsubE: '⫅̸',\n nsube: '⊈',\n nsubset: '⊂⃒',\n nsubseteq: '⊈',\n nsubseteqq: '⫅̸',\n nsucc: '⊁',\n nsucceq: '⪰̸',\n nsup: '⊅',\n nsupE: '⫆̸',\n nsupe: '⊉',\n nsupset: '⊃⃒',\n nsupseteq: '⊉',\n nsupseteqq: '⫆̸',\n ntgl: '≹',\n ntilde: 'ñ',\n ntlg: '≸',\n ntriangleleft: '⋪',\n ntrianglelefteq: '⋬',\n ntriangleright: '⋫',\n ntrianglerighteq: '⋭',\n nu: 'ν',\n num: '#',\n numero: '№',\n numsp: ' ',\n nvDash: '⊭',\n nvHarr: '⤄',\n nvap: '≍⃒',\n nvdash: '⊬',\n nvge: '≥⃒',\n nvgt: '>⃒',\n nvinfin: '⧞',\n nvlArr: '⤂',\n nvle: '≤⃒',\n nvlt: '<⃒',\n nvltrie: '⊴⃒',\n nvrArr: '⤃',\n nvrtrie: '⊵⃒',\n nvsim: '∼⃒',\n nwArr: '⇖',\n nwarhk: '⤣',\n nwarr: '↖',\n nwarrow: '↖',\n nwnear: '⤧',\n oS: 'Ⓢ',\n oacute: 'ó',\n oast: '⊛',\n ocir: '⊚',\n ocirc: 'ô',\n ocy: 'о',\n odash: '⊝',\n odblac: 'ő',\n odiv: '⨸',\n odot: '⊙',\n odsold: '⦼',\n oelig: 'œ',\n ofcir: '⦿',\n ofr: '𝔬',\n ogon: '˛',\n ograve: 'ò',\n ogt: '⧁',\n ohbar: '⦵',\n ohm: 'Ω',\n oint: '∮',\n olarr: '↺',\n olcir: '⦾',\n olcross: '⦻',\n oline: '‾',\n olt: '⧀',\n omacr: 'ō',\n omega: 'ω',\n omicron: 'ο',\n omid: '⦶',\n ominus: '⊖',\n oopf: '𝕠',\n opar: '⦷',\n operp: '⦹',\n oplus: '⊕',\n or: '∨',\n orarr: '↻',\n ord: '⩝',\n order: 'ℴ',\n orderof: 'ℴ',\n ordf: 'ª',\n ordm: 'º',\n origof: '⊶',\n oror: '⩖',\n orslope: '⩗',\n orv: '⩛',\n oscr: 'ℴ',\n oslash: 'ø',\n osol: '⊘',\n otilde: 'õ',\n otimes: '⊗',\n otimesas: '⨶',\n ouml: 'ö',\n ovbar: '⌽',\n par: '∥',\n para: '¶',\n parallel: '∥',\n parsim: '⫳',\n parsl: '⫽',\n part: '∂',\n pcy: 'п',\n percnt: '%',\n period: '.',\n permil: '‰',\n perp: '⊥',\n pertenk: '‱',\n pfr: '𝔭',\n phi: 'φ',\n phiv: 'ϕ',\n phmmat: 'ℳ',\n phone: '☎',\n pi: 'π',\n pitchfork: '⋔',\n piv: 'ϖ',\n planck: 'ℏ',\n planckh: 'ℎ',\n plankv: 'ℏ',\n plus: '+',\n plusacir: '⨣',\n plusb: '⊞',\n pluscir: '⨢',\n plusdo: '∔',\n plusdu: '⨥',\n pluse: '⩲',\n plusmn: '±',\n plussim: '⨦',\n plustwo: '⨧',\n pm: '±',\n pointint: '⨕',\n popf: '𝕡',\n pound: '£',\n pr: '≺',\n prE: '⪳',\n prap: '⪷',\n prcue: '≼',\n pre: '⪯',\n prec: '≺',\n precapprox: '⪷',\n preccurlyeq: '≼',\n preceq: '⪯',\n precnapprox: '⪹',\n precneqq: '⪵',\n precnsim: '⋨',\n precsim: '≾',\n prime: '′',\n primes: 'ℙ',\n prnE: '⪵',\n prnap: '⪹',\n prnsim: '⋨',\n prod: '∏',\n profalar: '⌮',\n profline: '⌒',\n profsurf: '⌓',\n prop: '∝',\n propto: '∝',\n prsim: '≾',\n prurel: '⊰',\n pscr: '𝓅',\n psi: 'ψ',\n puncsp: ' ',\n qfr: '𝔮',\n qint: '⨌',\n qopf: '𝕢',\n qprime: '⁗',\n qscr: '𝓆',\n quaternions: 'ℍ',\n quatint: '⨖',\n quest: '?',\n questeq: '≟',\n quot: '\"',\n rAarr: '⇛',\n rArr: '⇒',\n rAtail: '⤜',\n rBarr: '⤏',\n rHar: '⥤',\n race: '∽̱',\n racute: 'ŕ',\n radic: '√',\n raemptyv: '⦳',\n rang: '⟩',\n rangd: '⦒',\n range: '⦥',\n rangle: '⟩',\n raquo: '»',\n rarr: '→',\n rarrap: '⥵',\n rarrb: '⇥',\n rarrbfs: '⤠',\n rarrc: '⤳',\n rarrfs: '⤞',\n rarrhk: '↪',\n rarrlp: '↬',\n rarrpl: '⥅',\n rarrsim: '⥴',\n rarrtl: '↣',\n rarrw: '↝',\n ratail: '⤚',\n ratio: '∶',\n rationals: 'ℚ',\n rbarr: '⤍',\n rbbrk: '❳',\n rbrace: '}',\n rbrack: ']',\n rbrke: '⦌',\n rbrksld: '⦎',\n rbrkslu: '⦐',\n rcaron: 'ř',\n rcedil: 'ŗ',\n rceil: '⌉',\n rcub: '}',\n rcy: 'р',\n rdca: '⤷',\n rdldhar: '⥩',\n rdquo: '”',\n rdquor: '”',\n rdsh: '↳',\n real: 'ℜ',\n realine: 'ℛ',\n realpart: 'ℜ',\n reals: 'ℝ',\n rect: '▭',\n reg: '®',\n rfisht: '⥽',\n rfloor: '⌋',\n rfr: '𝔯',\n rhard: '⇁',\n rharu: '⇀',\n rharul: '⥬',\n rho: 'ρ',\n rhov: 'ϱ',\n rightarrow: '→',\n rightarrowtail: '↣',\n rightharpoondown: '⇁',\n rightharpoonup: '⇀',\n rightleftarrows: '⇄',\n rightleftharpoons: '⇌',\n rightrightarrows: '⇉',\n rightsquigarrow: '↝',\n rightthreetimes: '⋌',\n ring: '˚',\n risingdotseq: '≓',\n rlarr: '⇄',\n rlhar: '⇌',\n rlm: '',\n rmoust: '⎱',\n rmoustache: '⎱',\n rnmid: '⫮',\n roang: '⟭',\n roarr: '⇾',\n robrk: '⟧',\n ropar: '⦆',\n ropf: '𝕣',\n roplus: '⨮',\n rotimes: '⨵',\n rpar: ')',\n rpargt: '⦔',\n rppolint: '⨒',\n rrarr: '⇉',\n rsaquo: '›',\n rscr: '𝓇',\n rsh: '↱',\n rsqb: ']',\n rsquo: '’',\n rsquor: '’',\n rthree: '⋌',\n rtimes: '⋊',\n rtri: '▹',\n rtrie: '⊵',\n rtrif: '▸',\n rtriltri: '⧎',\n ruluhar: '⥨',\n rx: '℞',\n sacute: 'ś',\n sbquo: '‚',\n sc: '≻',\n scE: '⪴',\n scap: '⪸',\n scaron: 'š',\n sccue: '≽',\n sce: '⪰',\n scedil: 'ş',\n scirc: 'ŝ',\n scnE: '⪶',\n scnap: '⪺',\n scnsim: '⋩',\n scpolint: '⨓',\n scsim: '≿',\n scy: 'с',\n sdot: '⋅',\n sdotb: '⊡',\n sdote: '⩦',\n seArr: '⇘',\n searhk: '⤥',\n searr: '↘',\n searrow: '↘',\n sect: '§',\n semi: ';',\n seswar: '⤩',\n setminus: '∖',\n setmn: '∖',\n sext: '✶',\n sfr: '𝔰',\n sfrown: '⌢',\n sharp: '♯',\n shchcy: 'щ',\n shcy: 'ш',\n shortmid: '∣',\n shortparallel: '∥',\n shy: '',\n sigma: 'σ',\n sigmaf: 'ς',\n sigmav: 'ς',\n sim: '∼',\n simdot: '⩪',\n sime: '≃',\n simeq: '≃',\n simg: '⪞',\n simgE: '⪠',\n siml: '⪝',\n simlE: '⪟',\n simne: '≆',\n simplus: '⨤',\n simrarr: '⥲',\n slarr: '←',\n smallsetminus: '∖',\n smashp: '⨳',\n smeparsl: '⧤',\n smid: '∣',\n smile: '⌣',\n smt: '⪪',\n smte: '⪬',\n smtes: '⪬︀',\n softcy: 'ь',\n sol: '/',\n solb: '⧄',\n solbar: '⌿',\n sopf: '𝕤',\n spades: '♠',\n spadesuit: '♠',\n spar: '∥',\n sqcap: '⊓',\n sqcaps: '⊓︀',\n sqcup: '⊔',\n sqcups: '⊔︀',\n sqsub: '⊏',\n sqsube: '⊑',\n sqsubset: '⊏',\n sqsubseteq: '⊑',\n sqsup: '⊐',\n sqsupe: '⊒',\n sqsupset: '⊐',\n sqsupseteq: '⊒',\n squ: '□',\n square: '□',\n squarf: '▪',\n squf: '▪',\n srarr: '→',\n sscr: '𝓈',\n ssetmn: '∖',\n ssmile: '⌣',\n sstarf: '⋆',\n star: '☆',\n starf: '★',\n straightepsilon: 'ϵ',\n straightphi: 'ϕ',\n strns: '¯',\n sub: '⊂',\n subE: '⫅',\n subdot: '⪽',\n sube: '⊆',\n subedot: '⫃',\n submult: '⫁',\n subnE: '⫋',\n subne: '⊊',\n subplus: '⪿',\n subrarr: '⥹',\n subset: '⊂',\n subseteq: '⊆',\n subseteqq: '⫅',\n subsetneq: '⊊',\n subsetneqq: '⫋',\n subsim: '⫇',\n subsub: '⫕',\n subsup: '⫓',\n succ: '≻',\n succapprox: '⪸',\n succcurlyeq: '≽',\n succeq: '⪰',\n succnapprox: '⪺',\n succneqq: '⪶',\n succnsim: '⋩',\n succsim: '≿',\n sum: '∑',\n sung: '♪',\n sup1: '¹',\n sup2: '²',\n sup3: '³',\n sup: '⊃',\n supE: '⫆',\n supdot: '⪾',\n supdsub: '⫘',\n supe: '⊇',\n supedot: '⫄',\n suphsol: '⟉',\n suphsub: '⫗',\n suplarr: '⥻',\n supmult: '⫂',\n supnE: '⫌',\n supne: '⊋',\n supplus: '⫀',\n supset: '⊃',\n supseteq: '⊇',\n supseteqq: '⫆',\n supsetneq: '⊋',\n supsetneqq: '⫌',\n supsim: '⫈',\n supsub: '⫔',\n supsup: '⫖',\n swArr: '⇙',\n swarhk: '⤦',\n swarr: '↙',\n swarrow: '↙',\n swnwar: '⤪',\n szlig: 'ß',\n target: '⌖',\n tau: 'τ',\n tbrk: '⎴',\n tcaron: 'ť',\n tcedil: 'ţ',\n tcy: 'т',\n tdot: '⃛',\n telrec: '⌕',\n tfr: '𝔱',\n there4: '∴',\n therefore: '∴',\n theta: 'θ',\n thetasym: 'ϑ',\n thetav: 'ϑ',\n thickapprox: '≈',\n thicksim: '∼',\n thinsp: ' ',\n thkap: '≈',\n thksim: '∼',\n thorn: 'þ',\n tilde: '˜',\n times: '×',\n timesb: '⊠',\n timesbar: '⨱',\n timesd: '⨰',\n tint: '∭',\n toea: '⤨',\n top: '⊤',\n topbot: '⌶',\n topcir: '⫱',\n topf: '𝕥',\n topfork: '⫚',\n tosa: '⤩',\n tprime: '‴',\n trade: '™',\n triangle: '▵',\n triangledown: '▿',\n triangleleft: '◃',\n trianglelefteq: '⊴',\n triangleq: '≜',\n triangleright: '▹',\n trianglerighteq: '⊵',\n tridot: '◬',\n trie: '≜',\n triminus: '⨺',\n triplus: '⨹',\n trisb: '⧍',\n tritime: '⨻',\n trpezium: '⏢',\n tscr: '𝓉',\n tscy: 'ц',\n tshcy: 'ћ',\n tstrok: 'ŧ',\n twixt: '≬',\n twoheadleftarrow: '↞',\n twoheadrightarrow: '↠',\n uArr: '⇑',\n uHar: '⥣',\n uacute: 'ú',\n uarr: '↑',\n ubrcy: 'ў',\n ubreve: 'ŭ',\n ucirc: 'û',\n ucy: 'у',\n udarr: '⇅',\n udblac: 'ű',\n udhar: '⥮',\n ufisht: '⥾',\n ufr: '𝔲',\n ugrave: 'ù',\n uharl: '↿',\n uharr: '↾',\n uhblk: '▀',\n ulcorn: '⌜',\n ulcorner: '⌜',\n ulcrop: '⌏',\n ultri: '◸',\n umacr: 'ū',\n uml: '¨',\n uogon: 'ų',\n uopf: '𝕦',\n uparrow: '↑',\n updownarrow: '↕',\n upharpoonleft: '↿',\n upharpoonright: '↾',\n uplus: '⊎',\n upsi: 'υ',\n upsih: 'ϒ',\n upsilon: 'υ',\n upuparrows: '⇈',\n urcorn: '⌝',\n urcorner: '⌝',\n urcrop: '⌎',\n uring: 'ů',\n urtri: '◹',\n uscr: '𝓊',\n utdot: '⋰',\n utilde: 'ũ',\n utri: '▵',\n utrif: '▴',\n uuarr: '⇈',\n uuml: 'ü',\n uwangle: '⦧',\n vArr: '⇕',\n vBar: '⫨',\n vBarv: '⫩',\n vDash: '⊨',\n vangrt: '⦜',\n varepsilon: 'ϵ',\n varkappa: 'ϰ',\n varnothing: '∅',\n varphi: 'ϕ',\n varpi: 'ϖ',\n varpropto: '∝',\n varr: '↕',\n varrho: 'ϱ',\n varsigma: 'ς',\n varsubsetneq: '⊊︀',\n varsubsetneqq: '⫋︀',\n varsupsetneq: '⊋︀',\n varsupsetneqq: '⫌︀',\n vartheta: 'ϑ',\n vartriangleleft: '⊲',\n vartriangleright: '⊳',\n vcy: 'в',\n vdash: '⊢',\n vee: '∨',\n veebar: '⊻',\n veeeq: '≚',\n vellip: '⋮',\n verbar: '|',\n vert: '|',\n vfr: '𝔳',\n vltri: '⊲',\n vnsub: '⊂⃒',\n vnsup: '⊃⃒',\n vopf: '𝕧',\n vprop: '∝',\n vrtri: '⊳',\n vscr: '𝓋',\n vsubnE: '⫋︀',\n vsubne: '⊊︀',\n vsupnE: '⫌︀',\n vsupne: '⊋︀',\n vzigzag: '⦚',\n wcirc: 'ŵ',\n wedbar: '⩟',\n wedge: '∧',\n wedgeq: '≙',\n weierp: '℘',\n wfr: '𝔴',\n wopf: '𝕨',\n wp: '℘',\n wr: '≀',\n wreath: '≀',\n wscr: '𝓌',\n xcap: '⋂',\n xcirc: '◯',\n xcup: '⋃',\n xdtri: '▽',\n xfr: '𝔵',\n xhArr: '⟺',\n xharr: '⟷',\n xi: 'ξ',\n xlArr: '⟸',\n xlarr: '⟵',\n xmap: '⟼',\n xnis: '⋻',\n xodot: '⨀',\n xopf: '𝕩',\n xoplus: '⨁',\n xotime: '⨂',\n xrArr: '⟹',\n xrarr: '⟶',\n xscr: '𝓍',\n xsqcup: '⨆',\n xuplus: '⨄',\n xutri: '△',\n xvee: '⋁',\n xwedge: '⋀',\n yacute: 'ý',\n yacy: 'я',\n ycirc: 'ŷ',\n ycy: 'ы',\n yen: '¥',\n yfr: '𝔶',\n yicy: 'ї',\n yopf: '𝕪',\n yscr: '𝓎',\n yucy: 'ю',\n yuml: 'ÿ',\n zacute: 'ź',\n zcaron: 'ž',\n zcy: 'з',\n zdot: 'ż',\n zeetrf: 'ℨ',\n zeta: 'ζ',\n zfr: '𝔷',\n zhcy: 'ж',\n zigrarr: '⇝',\n zopf: '𝕫',\n zscr: '𝓏',\n zwj: '',\n zwnj: ''\n}\n","import {characterEntities} from 'character-entities'\n\n// To do: next major: use `Object.hasOwn`.\nconst own = {}.hasOwnProperty\n\n/**\n * Decode a single character reference (without the `&` or `;`).\n * You probably only need this when you’re building parsers yourself that follow\n * different rules compared to HTML.\n * This is optimized to be tiny in browsers.\n *\n * @param {string} value\n * `notin` (named), `#123` (deci), `#x123` (hexa).\n * @returns {string|false}\n * Decoded reference.\n */\nexport function decodeNamedCharacterReference(value) {\n return own.call(characterEntities, value) ? characterEntities[value] : false\n}\n","/**\n * Turn the number (in string form as either hexa- or plain decimal) coming from\n * a numeric character reference into a character.\n *\n * Sort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes\n * non-characters and control characters safe.\n *\n * @param {string} value\n * Value to decode.\n * @param {number} base\n * Numeric base.\n * @returns {string}\n * Character.\n */\nexport function decodeNumericCharacterReference(value, base) {\n const code = Number.parseInt(value, base);\n if (\n // C0 except for HT, LF, FF, CR, space.\n code < 9 || code === 11 || code > 13 && code < 32 ||\n // Control character (DEL) of C0, and C1 controls.\n code > 126 && code < 160 ||\n // Lone high surrogates and low surrogates.\n code > 55_295 && code < 57_344 ||\n // Noncharacters.\n code > 64_975 && code < 65_008 || /* eslint-disable no-bitwise */\n (code & 65_535) === 65_535 || (code & 65_535) === 65_534 || /* eslint-enable no-bitwise */\n // Out of range\n code > 1_114_111) {\n return \"\\uFFFD\";\n }\n return String.fromCodePoint(code);\n}","import { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';\nconst characterEscapeOrReference = /\\\\([!-/:-@[-`{-~])|&(#(?:\\d{1,7}|x[\\da-f]{1,6})|[\\da-z]{1,31});/gi;\n\n/**\n * Decode markdown strings (which occur in places such as fenced code info\n * strings, destinations, labels, and titles).\n *\n * The “string” content type allows character escapes and -references.\n * This decodes those.\n *\n * @param {string} value\n * Value to decode.\n * @returns {string}\n * Decoded value.\n */\nexport function decodeString(value) {\n return value.replace(characterEscapeOrReference, decode);\n}\n\n/**\n * @param {string} $0\n * Match.\n * @param {string} $1\n * Character escape.\n * @param {string} $2\n * Character reference.\n * @returns {string}\n * Decoded value\n */\nfunction decode($0, $1, $2) {\n if ($1) {\n // Escape.\n return $1;\n }\n\n // Reference.\n const head = $2.charCodeAt(0);\n if (head === 35) {\n const head = $2.charCodeAt(1);\n const hex = head === 120 || head === 88;\n return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10);\n }\n return decodeNamedCharacterReference($2) || $0;\n}","import { asciiAlphanumeric } from 'micromark-util-character';\nimport { encode } from 'micromark-util-encode';\n/**\n * Make a value safe for injection as a URL.\n *\n * This encodes unsafe characters with percent-encoding and skips already\n * encoded sequences (see `normalizeUri`).\n * Further unsafe characters are encoded as character references (see\n * `micromark-util-encode`).\n *\n * A regex of allowed protocols can be given, in which case the URL is\n * sanitized.\n * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`, or\n * `/^https?$/i` for `img[src]` (this is what `github.com` allows).\n * If the URL includes an unknown protocol (one not matched by `protocol`, such\n * as a dangerous example, `javascript:`), the value is ignored.\n *\n * @param {string | null | undefined} url\n * URI to sanitize.\n * @param {RegExp | null | undefined} [protocol]\n * Allowed protocols.\n * @returns {string}\n * Sanitized URI.\n */\nexport function sanitizeUri(url, protocol) {\n const value = encode(normalizeUri(url || ''));\n if (!protocol) {\n return value;\n }\n const colon = value.indexOf(':');\n const questionMark = value.indexOf('?');\n const numberSign = value.indexOf('#');\n const slash = value.indexOf('/');\n if (\n // If there is no protocol, it’s relative.\n colon < 0 ||\n // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.\n slash > -1 && colon > slash || questionMark > -1 && colon > questionMark || numberSign > -1 && colon > numberSign ||\n // It is a protocol, it should be allowed.\n protocol.test(value.slice(0, colon))) {\n return value;\n }\n return '';\n}\n\n/**\n * Normalize a URL.\n *\n * Encode unsafe characters with percent-encoding, skipping already encoded\n * sequences.\n *\n * @param {string} value\n * URI to normalize.\n * @returns {string}\n * Normalized URI.\n */\nexport function normalizeUri(value) {\n /** @type {Array<string>} */\n const result = [];\n let index = -1;\n let start = 0;\n let skip = 0;\n while (++index < value.length) {\n const code = value.charCodeAt(index);\n /** @type {string} */\n let replace = '';\n\n // A correct percent encoded value.\n if (code === 37 && asciiAlphanumeric(value.charCodeAt(index + 1)) && asciiAlphanumeric(value.charCodeAt(index + 2))) {\n skip = 2;\n }\n // ASCII.\n else if (code < 128) {\n if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) {\n replace = String.fromCharCode(code);\n }\n }\n // Astral.\n else if (code > 55_295 && code < 57_344) {\n const next = value.charCodeAt(index + 1);\n\n // A correct surrogate pair.\n if (code < 56_320 && next > 56_319 && next < 57_344) {\n replace = String.fromCharCode(code, next);\n skip = 1;\n }\n // Lone surrogate.\n else {\n replace = \"\\uFFFD\";\n }\n }\n // Unicode.\n else {\n replace = String.fromCharCode(code);\n }\n if (replace) {\n result.push(value.slice(start, index), encodeURIComponent(replace));\n start = index + skip + 1;\n replace = '';\n }\n if (skip) {\n index += skip;\n skip = 0;\n }\n }\n return result.join('') + value.slice(start);\n}","/**\n * @import {\n * Code,\n * Construct,\n * Event,\n * Point,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { push, splice } from 'micromark-util-chunked';\nimport { classifyCharacter } from 'micromark-util-classify-character';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/** @type {Construct} */\nexport const attention = {\n name: 'attention',\n resolveAll: resolveAllAttention,\n tokenize: tokenizeAttention\n};\n\n/**\n * Take all events and resolve attention to emphasis or strong.\n *\n * @type {Resolver}\n */\n// eslint-disable-next-line complexity\nfunction resolveAllAttention(events, context) {\n let index = -1;\n /** @type {Array<Event>} */\n let nextEvents;\n\n // Walk through all events.\n //\n // Note: performance of this is fine on an mb of normal markdown, but it’s\n // a bottleneck for malicious stuff.\n while (++index < events.length) {\n // Find a token that can close.\n if (events[index][0] === 'enter' && events[index][1].type === 'attentionSequence' && events[index][1]._close) {\n let open = index;\n\n // Now walk back to find an opener.\n while (open--) {\n // Find a token that can open the closer.\n if (events[open][0] === 'exit' && events[open][1].type === 'attentionSequence' && events[open][1]._open &&\n // If the markers are the same:\n context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index][1]).charCodeAt(0)) {\n // If the opening can close or the closing can open,\n // and the close size *is not* a multiple of three,\n // but the sum of the opening and closing size *is* multiple of three,\n // then don’t match.\n if ((events[open][1]._close || events[index][1]._open) && (events[index][1].end.offset - events[index][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index][1].end.offset - events[index][1].start.offset) % 3)) {\n continue;\n }\n\n // Number of markers to use from the sequence.\n const use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1;\n const start = {\n ...events[open][1].end\n };\n const end = {\n ...events[index][1].start\n };\n movePoint(start, -use);\n movePoint(end, use);\n const openingSequence = {\n type: use > 1 ? \"strongSequence\" : \"emphasisSequence\",\n start,\n end: {\n ...events[open][1].end\n }\n };\n const closingSequence = {\n type: use > 1 ? \"strongSequence\" : \"emphasisSequence\",\n start: {\n ...events[index][1].start\n },\n end\n };\n const text = {\n type: use > 1 ? \"strongText\" : \"emphasisText\",\n start: {\n ...events[open][1].end\n },\n end: {\n ...events[index][1].start\n }\n };\n const group = {\n type: use > 1 ? \"strong\" : \"emphasis\",\n start: {\n ...openingSequence.start\n },\n end: {\n ...closingSequence.end\n }\n };\n events[open][1].end = {\n ...openingSequence.start\n };\n events[index][1].start = {\n ...closingSequence.end\n };\n nextEvents = [];\n\n // If there are more markers in the opening, add them before.\n if (events[open][1].end.offset - events[open][1].start.offset) {\n nextEvents = push(nextEvents, [['enter', events[open][1], context], ['exit', events[open][1], context]]);\n }\n\n // Opening.\n nextEvents = push(nextEvents, [['enter', group, context], ['enter', openingSequence, context], ['exit', openingSequence, context], ['enter', text, context]]);\n\n // Always populated by defaults.\n\n // Between.\n nextEvents = push(nextEvents, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + 1, index), context));\n\n // Closing.\n nextEvents = push(nextEvents, [['exit', text, context], ['enter', closingSequence, context], ['exit', closingSequence, context], ['exit', group, context]]);\n\n /** @type {number} */\n let offset = 0;\n\n // If there are more markers in the closing, add them after.\n if (events[index][1].end.offset - events[index][1].start.offset) {\n offset = 2;\n nextEvents = push(nextEvents, [['enter', events[index][1], context], ['exit', events[index][1], context]]);\n }\n splice(events, open - 1, index - open + 3, nextEvents);\n index = open + nextEvents.length - offset - 2;\n break;\n }\n }\n }\n }\n\n // Remove remaining sequences.\n index = -1;\n while (++index < events.length) {\n if (events[index][1].type === 'attentionSequence') {\n events[index][1].type = 'data';\n }\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeAttention(effects, ok) {\n const attentionMarkers = this.parser.constructs.attentionMarkers.null;\n const previous = this.previous;\n const before = classifyCharacter(previous);\n\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Before a sequence.\n *\n * ```markdown\n * > | **\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n marker = code;\n effects.enter('attentionSequence');\n return inside(code);\n }\n\n /**\n * In a sequence.\n *\n * ```markdown\n * > | **\n * ^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code);\n return inside;\n }\n const token = effects.exit('attentionSequence');\n\n // To do: next major: move this to resolver, just like `markdown-rs`.\n const after = classifyCharacter(code);\n\n // Always populated by defaults.\n\n // Note: `*` and `_` are in `attentionMarkers` through core.\n // They are excluded here as the loosening is meant for markers registered\n // by *other* constructs (such as GFM strikethrough’s `~`).\n const open = !after || after === 2 && before || attentionMarkers.includes(code) && code !== 42 && code !== 95;\n const close = !before || before === 2 && after || attentionMarkers.includes(previous) && previous !== 42 && previous !== 95;\n token._open = Boolean(marker === 42 ? open : open && (before || !close));\n token._close = Boolean(marker === 42 ? close : close && (after || !open));\n return ok(code);\n }\n}\n\n/**\n * Move a point a bit.\n *\n * Note: `move` only works inside lines! It’s not possible to move past other\n * chunks (replacement characters, tabs, or line endings).\n *\n * @param {Point} point\n * Point.\n * @param {number} offset\n * Amount to move.\n * @returns {undefined}\n * Nothing.\n */\nfunction movePoint(point, offset) {\n point.column += offset;\n point.offset += offset;\n point._bufferIndex += offset;\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { asciiAlphanumeric, asciiAlpha, asciiAtext, asciiControl } from 'micromark-util-character';\n/** @type {Construct} */\nexport const autolink = {\n name: 'autolink',\n tokenize: tokenizeAutolink\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeAutolink(effects, ok, nok) {\n let size = 0;\n return start;\n\n /**\n * Start of an autolink.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"autolink\");\n effects.enter(\"autolinkMarker\");\n effects.consume(code);\n effects.exit(\"autolinkMarker\");\n effects.enter(\"autolinkProtocol\");\n return open;\n }\n\n /**\n * After `<`, at protocol or atext.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (asciiAlpha(code)) {\n effects.consume(code);\n return schemeOrEmailAtext;\n }\n if (code === 64) {\n return nok(code);\n }\n return emailAtext(code);\n }\n\n /**\n * At second byte of protocol or atext.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function schemeOrEmailAtext(code) {\n // ASCII alphanumeric and `+`, `-`, and `.`.\n if (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) {\n // Count the previous alphabetical from `open` too.\n size = 1;\n return schemeInsideOrEmailAtext(code);\n }\n return emailAtext(code);\n }\n\n /**\n * In ambiguous protocol or atext.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function schemeInsideOrEmailAtext(code) {\n if (code === 58) {\n effects.consume(code);\n size = 0;\n return urlInside;\n }\n\n // ASCII alphanumeric and `+`, `-`, and `.`.\n if ((code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) && size++ < 32) {\n effects.consume(code);\n return schemeInsideOrEmailAtext;\n }\n size = 0;\n return emailAtext(code);\n }\n\n /**\n * After protocol, in URL.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function urlInside(code) {\n if (code === 62) {\n effects.exit(\"autolinkProtocol\");\n effects.enter(\"autolinkMarker\");\n effects.consume(code);\n effects.exit(\"autolinkMarker\");\n effects.exit(\"autolink\");\n return ok;\n }\n\n // ASCII control, space, or `<`.\n if (code === null || code === 32 || code === 60 || asciiControl(code)) {\n return nok(code);\n }\n effects.consume(code);\n return urlInside;\n }\n\n /**\n * In email atext.\n *\n * ```markdown\n * > | a<user.name@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailAtext(code) {\n if (code === 64) {\n effects.consume(code);\n return emailAtSignOrDot;\n }\n if (asciiAtext(code)) {\n effects.consume(code);\n return emailAtext;\n }\n return nok(code);\n }\n\n /**\n * In label, after at-sign or dot.\n *\n * ```markdown\n * > | a<user.name@example.com>b\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function emailAtSignOrDot(code) {\n return asciiAlphanumeric(code) ? emailLabel(code) : nok(code);\n }\n\n /**\n * In label, where `.` and `>` are allowed.\n *\n * ```markdown\n * > | a<user.name@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailLabel(code) {\n if (code === 46) {\n effects.consume(code);\n size = 0;\n return emailAtSignOrDot;\n }\n if (code === 62) {\n // Exit, then change the token type.\n effects.exit(\"autolinkProtocol\").type = \"autolinkEmail\";\n effects.enter(\"autolinkMarker\");\n effects.consume(code);\n effects.exit(\"autolinkMarker\");\n effects.exit(\"autolink\");\n return ok;\n }\n return emailValue(code);\n }\n\n /**\n * In label, where `.` and `>` are *not* allowed.\n *\n * Though, this is also used in `emailLabel` to parse other values.\n *\n * ```markdown\n * > | a<user.name@ex-ample.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailValue(code) {\n // ASCII alphanumeric or `-`.\n if ((code === 45 || asciiAlphanumeric(code)) && size++ < 63) {\n const next = code === 45 ? emailValue : emailLabel;\n effects.consume(code);\n return next;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * Exiter,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const blockQuote = {\n continuation: {\n tokenize: tokenizeBlockQuoteContinuation\n },\n exit,\n name: 'blockQuote',\n tokenize: tokenizeBlockQuoteStart\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlockQuoteStart(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * Start of block quote.\n *\n * ```markdown\n * > | > a\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === 62) {\n const state = self.containerState;\n if (!state.open) {\n effects.enter(\"blockQuote\", {\n _container: true\n });\n state.open = true;\n }\n effects.enter(\"blockQuotePrefix\");\n effects.enter(\"blockQuoteMarker\");\n effects.consume(code);\n effects.exit(\"blockQuoteMarker\");\n return after;\n }\n return nok(code);\n }\n\n /**\n * After `>`, before optional whitespace.\n *\n * ```markdown\n * > | > a\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (markdownSpace(code)) {\n effects.enter(\"blockQuotePrefixWhitespace\");\n effects.consume(code);\n effects.exit(\"blockQuotePrefixWhitespace\");\n effects.exit(\"blockQuotePrefix\");\n return ok;\n }\n effects.exit(\"blockQuotePrefix\");\n return ok(code);\n }\n}\n\n/**\n * Start of block quote continuation.\n *\n * ```markdown\n * | > a\n * > | > b\n * ^\n * ```\n *\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlockQuoteContinuation(effects, ok, nok) {\n const self = this;\n return contStart;\n\n /**\n * Start of block quote continuation.\n *\n * Also used to parse the first block quote opening.\n *\n * ```markdown\n * | > a\n * > | > b\n * ^\n * ```\n *\n * @type {State}\n */\n function contStart(code) {\n if (markdownSpace(code)) {\n // Always populated by defaults.\n\n return factorySpace(effects, contBefore, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n return contBefore(code);\n }\n\n /**\n * At `>`, after optional whitespace.\n *\n * Also used to parse the first block quote opening.\n *\n * ```markdown\n * | > a\n * > | > b\n * ^\n * ```\n *\n * @type {State}\n */\n function contBefore(code) {\n return effects.attempt(blockQuote, ok, nok)(code);\n }\n}\n\n/** @type {Exiter} */\nfunction exit(effects) {\n effects.exit(\"blockQuote\");\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { asciiPunctuation } from 'micromark-util-character';\n/** @type {Construct} */\nexport const characterEscape = {\n name: 'characterEscape',\n tokenize: tokenizeCharacterEscape\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCharacterEscape(effects, ok, nok) {\n return start;\n\n /**\n * Start of character escape.\n *\n * ```markdown\n * > | a\\*b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"characterEscape\");\n effects.enter(\"escapeMarker\");\n effects.consume(code);\n effects.exit(\"escapeMarker\");\n return inside;\n }\n\n /**\n * After `\\`, at punctuation.\n *\n * ```markdown\n * > | a\\*b\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n // ASCII punctuation.\n if (asciiPunctuation(code)) {\n effects.enter(\"characterEscapeValue\");\n effects.consume(code);\n effects.exit(\"characterEscapeValue\");\n effects.exit(\"characterEscape\");\n return ok;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { asciiAlphanumeric, asciiDigit, asciiHexDigit } from 'micromark-util-character';\n/** @type {Construct} */\nexport const characterReference = {\n name: 'characterReference',\n tokenize: tokenizeCharacterReference\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCharacterReference(effects, ok, nok) {\n const self = this;\n let size = 0;\n /** @type {number} */\n let max;\n /** @type {(code: Code) => boolean} */\n let test;\n return start;\n\n /**\n * Start of character reference.\n *\n * ```markdown\n * > | a&b\n * ^\n * > | a{b\n * ^\n * > | a	b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"characterReference\");\n effects.enter(\"characterReferenceMarker\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarker\");\n return open;\n }\n\n /**\n * After `&`, at `#` for numeric references or alphanumeric for named\n * references.\n *\n * ```markdown\n * > | a&b\n * ^\n * > | a{b\n * ^\n * > | a	b\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 35) {\n effects.enter(\"characterReferenceMarkerNumeric\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarkerNumeric\");\n return numeric;\n }\n effects.enter(\"characterReferenceValue\");\n max = 31;\n test = asciiAlphanumeric;\n return value(code);\n }\n\n /**\n * After `#`, at `x` for hexadecimals or digit for decimals.\n *\n * ```markdown\n * > | a{b\n * ^\n * > | a	b\n * ^\n * ```\n *\n * @type {State}\n */\n function numeric(code) {\n if (code === 88 || code === 120) {\n effects.enter(\"characterReferenceMarkerHexadecimal\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarkerHexadecimal\");\n effects.enter(\"characterReferenceValue\");\n max = 6;\n test = asciiHexDigit;\n return value;\n }\n effects.enter(\"characterReferenceValue\");\n max = 7;\n test = asciiDigit;\n return value(code);\n }\n\n /**\n * After markers (`&#x`, `&#`, or `&`), in value, before `;`.\n *\n * The character reference kind defines what and how many characters are\n * allowed.\n *\n * ```markdown\n * > | a&b\n * ^^^\n * > | a{b\n * ^^^\n * > | a	b\n * ^\n * ```\n *\n * @type {State}\n */\n function value(code) {\n if (code === 59 && size) {\n const token = effects.exit(\"characterReferenceValue\");\n if (test === asciiAlphanumeric && !decodeNamedCharacterReference(self.sliceSerialize(token))) {\n return nok(code);\n }\n\n // To do: `markdown-rs` uses a different name:\n // `CharacterReferenceMarkerSemi`.\n effects.enter(\"characterReferenceMarker\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarker\");\n effects.exit(\"characterReference\");\n return ok;\n }\n if (test(code) && size++ < max) {\n effects.consume(code);\n return value;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const nonLazyContinuation = {\n partial: true,\n tokenize: tokenizeNonLazyContinuation\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuation(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * At eol, before continuation.\n *\n * ```markdown\n * > | * ```js\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === null) {\n return nok(code);\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return after;\n }\n\n /**\n * A continuation.\n *\n * ```markdown\n * | * ```js\n * > | b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { nonLazyContinuation } from './partial-non-lazy-continuation.js';\n\n/** @type {Construct} */\nexport const codeFenced = {\n concrete: true,\n name: 'codeFenced',\n tokenize: tokenizeCodeFenced\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCodeFenced(effects, ok, nok) {\n const self = this;\n /** @type {Construct} */\n const closeStart = {\n partial: true,\n tokenize: tokenizeCloseStart\n };\n let initialPrefix = 0;\n let sizeOpen = 0;\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Start of code.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse whitespace like `markdown-rs`.\n return beforeSequenceOpen(code);\n }\n\n /**\n * In opening fence, after prefix, at sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeSequenceOpen(code) {\n const tail = self.events[self.events.length - 1];\n initialPrefix = tail && tail[1].type === \"linePrefix\" ? tail[2].sliceSerialize(tail[1], true).length : 0;\n marker = code;\n effects.enter(\"codeFenced\");\n effects.enter(\"codeFencedFence\");\n effects.enter(\"codeFencedFenceSequence\");\n return sequenceOpen(code);\n }\n\n /**\n * In opening fence sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === marker) {\n sizeOpen++;\n effects.consume(code);\n return sequenceOpen;\n }\n if (sizeOpen < 3) {\n return nok(code);\n }\n effects.exit(\"codeFencedFenceSequence\");\n return markdownSpace(code) ? factorySpace(effects, infoBefore, \"whitespace\")(code) : infoBefore(code);\n }\n\n /**\n * In opening fence, after the sequence (and optional whitespace), before info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function infoBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFencedFence\");\n return self.interrupt ? ok(code) : effects.check(nonLazyContinuation, atNonLazyBreak, after)(code);\n }\n effects.enter(\"codeFencedFenceInfo\");\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return info(code);\n }\n\n /**\n * In info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function info(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceInfo\");\n return infoBefore(code);\n }\n if (markdownSpace(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceInfo\");\n return factorySpace(effects, metaBefore, \"whitespace\")(code);\n }\n if (code === 96 && code === marker) {\n return nok(code);\n }\n effects.consume(code);\n return info;\n }\n\n /**\n * In opening fence, after info and whitespace, before meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function metaBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return infoBefore(code);\n }\n effects.enter(\"codeFencedFenceMeta\");\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return meta(code);\n }\n\n /**\n * In meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function meta(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceMeta\");\n return infoBefore(code);\n }\n if (code === 96 && code === marker) {\n return nok(code);\n }\n effects.consume(code);\n return meta;\n }\n\n /**\n * At eol/eof in code, before a non-lazy closing fence or content.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function atNonLazyBreak(code) {\n return effects.attempt(closeStart, after, contentBefore)(code);\n }\n\n /**\n * Before code content, not a closing fence, at eol.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentBefore(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return contentStart;\n }\n\n /**\n * Before code content, not a closing fence.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentStart(code) {\n return initialPrefix > 0 && markdownSpace(code) ? factorySpace(effects, beforeContentChunk, \"linePrefix\", initialPrefix + 1)(code) : beforeContentChunk(code);\n }\n\n /**\n * Before code content, after optional prefix.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeContentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code);\n }\n effects.enter(\"codeFlowValue\");\n return contentChunk(code);\n }\n\n /**\n * In code content.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^^^^^^^^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFlowValue\");\n return beforeContentChunk(code);\n }\n effects.consume(code);\n return contentChunk;\n }\n\n /**\n * After code.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n effects.exit(\"codeFenced\");\n return ok(code);\n }\n\n /**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\n function tokenizeCloseStart(effects, ok, nok) {\n let size = 0;\n return startBefore;\n\n /**\n *\n *\n * @type {State}\n */\n function startBefore(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return start;\n }\n\n /**\n * Before closing fence, at optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Always populated by defaults.\n\n // To do: `enter` here or in next state?\n effects.enter(\"codeFencedFence\");\n return markdownSpace(code) ? factorySpace(effects, beforeSequenceClose, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code) : beforeSequenceClose(code);\n }\n\n /**\n * In closing fence, after optional whitespace, at sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeSequenceClose(code) {\n if (code === marker) {\n effects.enter(\"codeFencedFenceSequence\");\n return sequenceClose(code);\n }\n return nok(code);\n }\n\n /**\n * In closing fence sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n if (code === marker) {\n size++;\n effects.consume(code);\n return sequenceClose;\n }\n if (size >= sizeOpen) {\n effects.exit(\"codeFencedFenceSequence\");\n return markdownSpace(code) ? factorySpace(effects, sequenceCloseAfter, \"whitespace\")(code) : sequenceCloseAfter(code);\n }\n return nok(code);\n }\n\n /**\n * After closing fence sequence, after optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceCloseAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFencedFence\");\n return ok(code);\n }\n return nok(code);\n }\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpaceMinMax } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const codeIndented = {\n name: 'codeIndented',\n tokenize: tokenizeCodeIndented\n};\n\n/** @type {Construct} */\nconst furtherStart = {\n partial: true,\n tokenize: tokenizeFurtherStart\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCodeIndented(effects, ok, nok) {\n return start;\n\n /**\n * Start of code (indented).\n *\n * > **Parsing note**: it is not needed to check if this first line is a\n * > filled line (that it has a non-whitespace character), because blank lines\n * > are parsed already, so we never run into that.\n *\n * ```markdown\n * > | aaa\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: manually check if interrupting like `markdown-rs`.\n\n effects.enter(\"codeIndented\");\n return factorySpaceMinMax(effects, atBreak, nok, \"linePrefix\", 4, 4)(code);\n }\n\n /**\n * At a break.\n *\n * ```markdown\n * > | aaa\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === null) {\n return after(code);\n }\n if (markdownLineEnding(code)) {\n return effects.attempt(furtherStart, atBreak, after)(code);\n }\n effects.enter(\"codeFlowValue\");\n return inside(code);\n }\n\n /**\n * In code content.\n *\n * ```markdown\n * > | aaa\n * ^^^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFlowValue\");\n return atBreak(code);\n }\n effects.consume(code);\n return inside;\n }\n\n /** @type {State} */\n function after(code) {\n effects.exit(\"codeIndented\");\n // To do: allow interrupting like `markdown-rs`.\n // Feel free to interrupt.\n // tokenizer.interrupt = false\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeFurtherStart(effects, ok, nok) {\n const self = this;\n return furtherStart;\n\n /**\n * At eol, trying to parse another indent.\n *\n * ```markdown\n * > | aaa\n * ^\n * | bbb\n * ```\n *\n * @type {State}\n */\n function furtherStart(code) {\n // To do: improve `lazy` / `pierce` handling.\n // If this is a lazy line, it can’t be code.\n if (self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return furtherStart;\n }\n\n // To do: the code here in `micromark-js` is a bit different from\n // `markdown-rs` because there it can attempt spaces.\n // We can’t yet.\n return factorySpaceMinMax(effects, ok, onNotEnoughPrefix, \"linePrefix\", 4, 4)(code);\n }\n\n /**\n * After not enough of a prefix.\n *\n * A following line ending is another (potentially blank) line to try,\n * anything else means this isn’t a continuation.\n *\n * ```markdown\n * > | aaa\n *\n * | bbb\n * ```\n *\n * @type {State}\n */\n function onNotEnoughPrefix(code) {\n return markdownLineEnding(code) ? furtherStart(code) : nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * Previous,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const codeText = {\n name: 'codeText',\n previous,\n resolve: resolveCodeText,\n tokenize: tokenizeCodeText\n};\n\n// To do: next major: don’t resolve, like `markdown-rs`.\n/** @type {Resolver} */\nfunction resolveCodeText(events) {\n let tailExitIndex = events.length - 4;\n let headEnterIndex = 3;\n /** @type {number} */\n let index;\n /** @type {number | undefined} */\n let enter;\n\n // If we start and end with an EOL or a space.\n if ((events[headEnterIndex][1].type === \"lineEnding\" || events[headEnterIndex][1].type === 'space') && (events[tailExitIndex][1].type === \"lineEnding\" || events[tailExitIndex][1].type === 'space')) {\n index = headEnterIndex;\n\n // And we have data.\n while (++index < tailExitIndex) {\n if (events[index][1].type === \"codeTextData\") {\n // Then we have padding.\n events[headEnterIndex][1].type = \"codeTextPadding\";\n events[tailExitIndex][1].type = \"codeTextPadding\";\n headEnterIndex += 2;\n tailExitIndex -= 2;\n break;\n }\n }\n }\n\n // Merge adjacent spaces and data.\n index = headEnterIndex - 1;\n tailExitIndex++;\n while (++index <= tailExitIndex) {\n if (enter === undefined) {\n if (index !== tailExitIndex && events[index][1].type !== \"lineEnding\") {\n enter = index;\n }\n } else if (index === tailExitIndex || events[index][1].type === \"lineEnding\") {\n events[enter][1].type = \"codeTextData\";\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end;\n events.splice(enter + 2, index - enter - 2);\n tailExitIndex -= index - enter - 2;\n index = enter + 2;\n }\n enter = undefined;\n }\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Previous}\n */\nfunction previous(code) {\n // If there is a previous code, there will always be a tail.\n return code !== 96 || this.events[this.events.length - 1][1].type === \"characterEscape\";\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCodeText(effects, ok, nok) {\n const self = this;\n let sizeOpen = 0;\n /** @type {number} */\n let size;\n /** @type {Token} */\n let token;\n return start;\n\n /**\n * Start of code (text).\n *\n * ```markdown\n * > | `a`\n * ^\n * > | \\`a`\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"codeText\");\n effects.enter(\"codeTextSequence\");\n return sequenceOpen(code);\n }\n\n /**\n * In opening sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === 96) {\n effects.consume(code);\n sizeOpen++;\n return sequenceOpen;\n }\n effects.exit(\"codeTextSequence\");\n return between(code);\n }\n\n /**\n * Between something and something else.\n *\n * ```markdown\n * > | `a`\n * ^^\n * ```\n *\n * @type {State}\n */\n function between(code) {\n // EOF.\n if (code === null) {\n return nok(code);\n }\n\n // To do: next major: don’t do spaces in resolve, but when compiling,\n // like `markdown-rs`.\n // Tabs don’t work, and virtual spaces don’t make sense.\n if (code === 32) {\n effects.enter('space');\n effects.consume(code);\n effects.exit('space');\n return between;\n }\n\n // Closing fence? Could also be data.\n if (code === 96) {\n token = effects.enter(\"codeTextSequence\");\n size = 0;\n return sequenceClose(code);\n }\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return between;\n }\n\n // Data.\n effects.enter(\"codeTextData\");\n return data(code);\n }\n\n /**\n * In data.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function data(code) {\n if (code === null || code === 32 || code === 96 || markdownLineEnding(code)) {\n effects.exit(\"codeTextData\");\n return between(code);\n }\n effects.consume(code);\n return data;\n }\n\n /**\n * In closing sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n // More.\n if (code === 96) {\n effects.consume(code);\n size++;\n return sequenceClose;\n }\n\n // Done!\n if (size === sizeOpen) {\n effects.exit(\"codeTextSequence\");\n effects.exit(\"codeText\");\n return ok(code);\n }\n\n // More or less accents: mark as data.\n token.type = \"codeTextData\";\n return data(code);\n }\n}","/**\n * Some of the internal operations of micromark do lots of editing\n * operations on very large arrays. This runs into problems with two\n * properties of most circa-2020 JavaScript interpreters:\n *\n * - Array-length modifications at the high end of an array (push/pop) are\n * expected to be common and are implemented in (amortized) time\n * proportional to the number of elements added or removed, whereas\n * other operations (shift/unshift and splice) are much less efficient.\n * - Function arguments are passed on the stack, so adding tens of thousands\n * of elements to an array with `arr.push(...newElements)` will frequently\n * cause stack overflows. (see <https://stackoverflow.com/questions/22123769/rangeerror-maximum-call-stack-size-exceeded-why>)\n *\n * SpliceBuffers are an implementation of gap buffers, which are a\n * generalization of the \"queue made of two stacks\" idea. The splice buffer\n * maintains a cursor, and moving the cursor has cost proportional to the\n * distance the cursor moves, but inserting, deleting, or splicing in\n * new information at the cursor is as efficient as the push/pop operation.\n * This allows for an efficient sequence of splices (or pushes, pops, shifts,\n * or unshifts) as long such edits happen at the same part of the array or\n * generally sweep through the array from the beginning to the end.\n *\n * The interface for splice buffers also supports large numbers of inputs by\n * passing a single array argument rather passing multiple arguments on the\n * function call stack.\n *\n * @template T\n * Item type.\n */\nexport class SpliceBuffer {\n /**\n * @param {ReadonlyArray<T> | null | undefined} [initial]\n * Initial items (optional).\n * @returns\n * Splice buffer.\n */\n constructor(initial) {\n /** @type {Array<T>} */\n this.left = initial ? [...initial] : [];\n /** @type {Array<T>} */\n this.right = [];\n }\n\n /**\n * Array access;\n * does not move the cursor.\n *\n * @param {number} index\n * Index.\n * @return {T}\n * Item.\n */\n get(index) {\n if (index < 0 || index >= this.left.length + this.right.length) {\n throw new RangeError('Cannot access index `' + index + '` in a splice buffer of size `' + (this.left.length + this.right.length) + '`');\n }\n if (index < this.left.length) return this.left[index];\n return this.right[this.right.length - index + this.left.length - 1];\n }\n\n /**\n * The length of the splice buffer, one greater than the largest index in the\n * array.\n */\n get length() {\n return this.left.length + this.right.length;\n }\n\n /**\n * Remove and return `list[0]`;\n * moves the cursor to `0`.\n *\n * @returns {T | undefined}\n * Item, optional.\n */\n shift() {\n this.setCursor(0);\n return this.right.pop();\n }\n\n /**\n * Slice the buffer to get an array;\n * does not move the cursor.\n *\n * @param {number} start\n * Start.\n * @param {number | null | undefined} [end]\n * End (optional).\n * @returns {Array<T>}\n * Array of items.\n */\n slice(start, end) {\n /** @type {number} */\n const stop = end === null || end === undefined ? Number.POSITIVE_INFINITY : end;\n if (stop < this.left.length) {\n return this.left.slice(start, stop);\n }\n if (start > this.left.length) {\n return this.right.slice(this.right.length - stop + this.left.length, this.right.length - start + this.left.length).reverse();\n }\n return this.left.slice(start).concat(this.right.slice(this.right.length - stop + this.left.length).reverse());\n }\n\n /**\n * Mimics the behavior of Array.prototype.splice() except for the change of\n * interface necessary to avoid segfaults when patching in very large arrays.\n *\n * This operation moves cursor is moved to `start` and results in the cursor\n * placed after any inserted items.\n *\n * @param {number} start\n * Start;\n * zero-based index at which to start changing the array;\n * negative numbers count backwards from the end of the array and values\n * that are out-of bounds are clamped to the appropriate end of the array.\n * @param {number | null | undefined} [deleteCount=0]\n * Delete count (default: `0`);\n * maximum number of elements to delete, starting from start.\n * @param {Array<T> | null | undefined} [items=[]]\n * Items to include in place of the deleted items (default: `[]`).\n * @return {Array<T>}\n * Any removed items.\n */\n splice(start, deleteCount, items) {\n /** @type {number} */\n const count = deleteCount || 0;\n this.setCursor(Math.trunc(start));\n const removed = this.right.splice(this.right.length - count, Number.POSITIVE_INFINITY);\n if (items) chunkedPush(this.left, items);\n return removed.reverse();\n }\n\n /**\n * Remove and return the highest-numbered item in the array, so\n * `list[list.length - 1]`;\n * Moves the cursor to `length`.\n *\n * @returns {T | undefined}\n * Item, optional.\n */\n pop() {\n this.setCursor(Number.POSITIVE_INFINITY);\n return this.left.pop();\n }\n\n /**\n * Inserts a single item to the high-numbered side of the array;\n * moves the cursor to `length`.\n *\n * @param {T} item\n * Item.\n * @returns {undefined}\n * Nothing.\n */\n push(item) {\n this.setCursor(Number.POSITIVE_INFINITY);\n this.left.push(item);\n }\n\n /**\n * Inserts many items to the high-numbered side of the array.\n * Moves the cursor to `length`.\n *\n * @param {Array<T>} items\n * Items.\n * @returns {undefined}\n * Nothing.\n */\n pushMany(items) {\n this.setCursor(Number.POSITIVE_INFINITY);\n chunkedPush(this.left, items);\n }\n\n /**\n * Inserts a single item to the low-numbered side of the array;\n * Moves the cursor to `0`.\n *\n * @param {T} item\n * Item.\n * @returns {undefined}\n * Nothing.\n */\n unshift(item) {\n this.setCursor(0);\n this.right.push(item);\n }\n\n /**\n * Inserts many items to the low-numbered side of the array;\n * moves the cursor to `0`.\n *\n * @param {Array<T>} items\n * Items.\n * @returns {undefined}\n * Nothing.\n */\n unshiftMany(items) {\n this.setCursor(0);\n chunkedPush(this.right, items.reverse());\n }\n\n /**\n * Move the cursor to a specific position in the array. Requires\n * time proportional to the distance moved.\n *\n * If `n < 0`, the cursor will end up at the beginning.\n * If `n > length`, the cursor will end up at the end.\n *\n * @param {number} n\n * Position.\n * @return {undefined}\n * Nothing.\n */\n setCursor(n) {\n if (n === this.left.length || n > this.left.length && this.right.length === 0 || n < 0 && this.left.length === 0) return;\n if (n < this.left.length) {\n // Move cursor to the this.left\n const removed = this.left.splice(n, Number.POSITIVE_INFINITY);\n chunkedPush(this.right, removed.reverse());\n } else {\n // Move cursor to the this.right\n const removed = this.right.splice(this.left.length + this.right.length - n, Number.POSITIVE_INFINITY);\n chunkedPush(this.left, removed.reverse());\n }\n }\n}\n\n/**\n * Avoid stack overflow by pushing items onto the stack in segments\n *\n * @template T\n * Item type.\n * @param {Array<T>} list\n * List to inject into.\n * @param {ReadonlyArray<T>} right\n * Items to inject.\n * @return {undefined}\n * Nothing.\n */\nfunction chunkedPush(list, right) {\n /** @type {number} */\n let chunkStart = 0;\n if (right.length < 10000) {\n list.push(...right);\n } else {\n while (chunkStart < right.length) {\n list.push(...right.slice(chunkStart, chunkStart + 10000));\n chunkStart += 10000;\n }\n }\n}","/**\n * @import {Chunk, Event, Token} from 'micromark-util-types'\n */\n\nimport { splice } from 'micromark-util-chunked';\nimport { SpliceBuffer } from './lib/splice-buffer.js';\n\n// Hidden API exposed for testing.\nexport { SpliceBuffer } from './lib/splice-buffer.js';\n\n/**\n * Tokenize subcontent.\n *\n * @param {Array<Event>} eventsArray\n * List of events.\n * @returns {boolean}\n * Whether subtokens were found.\n */\n// eslint-disable-next-line complexity\nexport function subtokenize(eventsArray) {\n /** @type {Record<string, number>} */\n const jumps = {};\n let index = -1;\n /** @type {Event} */\n let event;\n /** @type {number | undefined} */\n let lineIndex;\n /** @type {number} */\n let otherIndex;\n /** @type {Event} */\n let otherEvent;\n /** @type {Array<Event>} */\n let parameters;\n /** @type {Array<Event>} */\n let subevents;\n /** @type {boolean | undefined} */\n let more;\n const events = new SpliceBuffer(eventsArray);\n while (++index < events.length) {\n while (index in jumps) {\n index = jumps[index];\n }\n event = events.get(index);\n\n // Add a hook for the GFM tasklist extension, which needs to know if text\n // is in the first content of a list item.\n if (index && event[1].type === \"chunkFlow\" && events.get(index - 1)[1].type === \"listItemPrefix\") {\n subevents = event[1]._tokenizer.events;\n otherIndex = 0;\n if (otherIndex < subevents.length && subevents[otherIndex][1].type === \"lineEndingBlank\") {\n otherIndex += 2;\n }\n if (otherIndex < subevents.length && subevents[otherIndex][1].type === \"content\") {\n while (++otherIndex < subevents.length) {\n if (subevents[otherIndex][1].type === \"content\") {\n break;\n }\n if (subevents[otherIndex][1].type === \"chunkText\") {\n subevents[otherIndex][1]._isInFirstContentOfListItem = true;\n otherIndex++;\n }\n }\n }\n }\n\n // Enter.\n if (event[0] === 'enter') {\n if (event[1].contentType) {\n Object.assign(jumps, subcontent(events, index));\n index = jumps[index];\n more = true;\n }\n }\n // Exit.\n else if (event[1]._container) {\n otherIndex = index;\n lineIndex = undefined;\n while (otherIndex--) {\n otherEvent = events.get(otherIndex);\n if (otherEvent[1].type === \"lineEnding\" || otherEvent[1].type === \"lineEndingBlank\") {\n if (otherEvent[0] === 'enter') {\n if (lineIndex) {\n events.get(lineIndex)[1].type = \"lineEndingBlank\";\n }\n otherEvent[1].type = \"lineEnding\";\n lineIndex = otherIndex;\n }\n } else if (otherEvent[1].type === \"linePrefix\" || otherEvent[1].type === \"listItemIndent\") {\n // Move past.\n } else {\n break;\n }\n }\n if (lineIndex) {\n // Fix position.\n event[1].end = {\n ...events.get(lineIndex)[1].start\n };\n\n // Switch container exit w/ line endings.\n parameters = events.slice(lineIndex, index);\n parameters.unshift(event);\n events.splice(lineIndex, index - lineIndex + 1, parameters);\n }\n }\n }\n\n // The changes to the `events` buffer must be copied back into the eventsArray\n splice(eventsArray, 0, Number.POSITIVE_INFINITY, events.slice(0));\n return !more;\n}\n\n/**\n * Tokenize embedded tokens.\n *\n * @param {SpliceBuffer<Event>} events\n * Events.\n * @param {number} eventIndex\n * Index.\n * @returns {Record<string, number>}\n * Gaps.\n */\nfunction subcontent(events, eventIndex) {\n const token = events.get(eventIndex)[1];\n const context = events.get(eventIndex)[2];\n let startPosition = eventIndex - 1;\n /** @type {Array<number>} */\n const startPositions = [];\n let tokenizer = token._tokenizer;\n if (!tokenizer) {\n tokenizer = context.parser[token.contentType](token.start);\n if (token._contentTypeTextTrailing) {\n tokenizer._contentTypeTextTrailing = true;\n }\n }\n const childEvents = tokenizer.events;\n /** @type {Array<[number, number]>} */\n const jumps = [];\n /** @type {Record<string, number>} */\n const gaps = {};\n /** @type {Array<Chunk>} */\n let stream;\n /** @type {Token | undefined} */\n let previous;\n let index = -1;\n /** @type {Token | undefined} */\n let current = token;\n let adjust = 0;\n let start = 0;\n const breaks = [start];\n\n // Loop forward through the linked tokens to pass them in order to the\n // subtokenizer.\n while (current) {\n // Find the position of the event for this token.\n while (events.get(++startPosition)[1] !== current) {\n // Empty.\n }\n startPositions.push(startPosition);\n if (!current._tokenizer) {\n stream = context.sliceStream(current);\n if (!current.next) {\n stream.push(null);\n }\n if (previous) {\n tokenizer.defineSkip(current.start);\n }\n if (current._isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = true;\n }\n tokenizer.write(stream);\n if (current._isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = undefined;\n }\n }\n\n // Unravel the next token.\n previous = current;\n current = current.next;\n }\n\n // Now, loop back through all events (and linked tokens), to figure out which\n // parts belong where.\n current = token;\n while (++index < childEvents.length) {\n if (\n // Find a void token that includes a break.\n childEvents[index][0] === 'exit' && childEvents[index - 1][0] === 'enter' && childEvents[index][1].type === childEvents[index - 1][1].type && childEvents[index][1].start.line !== childEvents[index][1].end.line) {\n start = index + 1;\n breaks.push(start);\n // Help GC.\n current._tokenizer = undefined;\n current.previous = undefined;\n current = current.next;\n }\n }\n\n // Help GC.\n tokenizer.events = [];\n\n // If there’s one more token (which is the cases for lines that end in an\n // EOF), that’s perfect: the last point we found starts it.\n // If there isn’t then make sure any remaining content is added to it.\n if (current) {\n // Help GC.\n current._tokenizer = undefined;\n current.previous = undefined;\n } else {\n breaks.pop();\n }\n\n // Now splice the events from the subtokenizer into the current events,\n // moving back to front so that splice indices aren’t affected.\n index = breaks.length;\n while (index--) {\n const slice = childEvents.slice(breaks[index], breaks[index + 1]);\n const start = startPositions.pop();\n jumps.push([start, start + slice.length - 1]);\n events.splice(start, 2, slice);\n }\n jumps.reverse();\n index = -1;\n while (++index < jumps.length) {\n gaps[adjust + jumps[index][0]] = adjust + jumps[index][1];\n adjust += jumps[index][1] - jumps[index][0] - 1;\n }\n return gaps;\n}","/**\n * @import {\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { subtokenize } from 'micromark-util-subtokenize';\n/**\n * No name because it must not be turned off.\n * @type {Construct}\n */\nexport const content = {\n resolve: resolveContent,\n tokenize: tokenizeContent\n};\n\n/** @type {Construct} */\nconst continuationConstruct = {\n partial: true,\n tokenize: tokenizeContinuation\n};\n\n/**\n * Content is transparent: it’s parsed right now. That way, definitions are also\n * parsed right now: before text in paragraphs (specifically, media) are parsed.\n *\n * @type {Resolver}\n */\nfunction resolveContent(events) {\n subtokenize(events);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeContent(effects, ok) {\n /** @type {Token | undefined} */\n let previous;\n return chunkStart;\n\n /**\n * Before a content chunk.\n *\n * ```markdown\n * > | abc\n * ^\n * ```\n *\n * @type {State}\n */\n function chunkStart(code) {\n effects.enter(\"content\");\n previous = effects.enter(\"chunkContent\", {\n contentType: \"content\"\n });\n return chunkInside(code);\n }\n\n /**\n * In a content chunk.\n *\n * ```markdown\n * > | abc\n * ^^^\n * ```\n *\n * @type {State}\n */\n function chunkInside(code) {\n if (code === null) {\n return contentEnd(code);\n }\n\n // To do: in `markdown-rs`, each line is parsed on its own, and everything\n // is stitched together resolving.\n if (markdownLineEnding(code)) {\n return effects.check(continuationConstruct, contentContinue, contentEnd)(code);\n }\n\n // Data.\n effects.consume(code);\n return chunkInside;\n }\n\n /**\n *\n *\n * @type {State}\n */\n function contentEnd(code) {\n effects.exit(\"chunkContent\");\n effects.exit(\"content\");\n return ok(code);\n }\n\n /**\n *\n *\n * @type {State}\n */\n function contentContinue(code) {\n effects.consume(code);\n effects.exit(\"chunkContent\");\n previous.next = effects.enter(\"chunkContent\", {\n contentType: \"content\",\n previous\n });\n previous = previous.next;\n return chunkInside;\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeContinuation(effects, ok, nok) {\n const self = this;\n return startLookahead;\n\n /**\n *\n *\n * @type {State}\n */\n function startLookahead(code) {\n effects.exit(\"chunkContent\");\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, prefixed, \"linePrefix\");\n }\n\n /**\n *\n *\n * @type {State}\n */\n function prefixed(code) {\n if (code === null || markdownLineEnding(code)) {\n return nok(code);\n }\n\n // Always populated by defaults.\n\n const tail = self.events[self.events.length - 1];\n if (!self.parser.constructs.disable.null.includes('codeIndented') && tail && tail[1].type === \"linePrefix\" && tail[2].sliceSerialize(tail[1], true).length >= 4) {\n return ok(code);\n }\n return effects.interrupt(self.parser.constructs.flow, nok, ok)(code);\n }\n}","/**\n * @import {Effects, State, TokenType} from 'micromark-util-types'\n */\n\nimport { asciiControl, markdownLineEndingOrSpace, markdownLineEnding } from 'micromark-util-character';\n/**\n * Parse destinations.\n *\n * ###### Examples\n *\n * ```markdown\n * <a>\n * <a\\>b>\n * <a b>\n * <a)>\n * a\n * a\\)b\n * a(b)c\n * a(b)\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type for whole (`<a>` or `b`).\n * @param {TokenType} literalType\n * Type when enclosed (`<a>`).\n * @param {TokenType} literalMarkerType\n * Type for enclosing (`<` and `>`).\n * @param {TokenType} rawType\n * Type when not enclosed (`b`).\n * @param {TokenType} stringType\n * Type for the value (`a` or `b`).\n * @param {number | undefined} [max=Infinity]\n * Depth of nested parens (inclusive).\n * @returns {State}\n * Start state.\n */\nexport function factoryDestination(effects, ok, nok, type, literalType, literalMarkerType, rawType, stringType, max) {\n const limit = max || Number.POSITIVE_INFINITY;\n let balance = 0;\n return start;\n\n /**\n * Start of destination.\n *\n * ```markdown\n * > | <aa>\n * ^\n * > | aa\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === 60) {\n effects.enter(type);\n effects.enter(literalType);\n effects.enter(literalMarkerType);\n effects.consume(code);\n effects.exit(literalMarkerType);\n return enclosedBefore;\n }\n\n // ASCII control, space, closing paren.\n if (code === null || code === 32 || code === 41 || asciiControl(code)) {\n return nok(code);\n }\n effects.enter(type);\n effects.enter(rawType);\n effects.enter(stringType);\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return raw(code);\n }\n\n /**\n * After `<`, at an enclosed destination.\n *\n * ```markdown\n * > | <aa>\n * ^\n * ```\n *\n * @type {State}\n */\n function enclosedBefore(code) {\n if (code === 62) {\n effects.enter(literalMarkerType);\n effects.consume(code);\n effects.exit(literalMarkerType);\n effects.exit(literalType);\n effects.exit(type);\n return ok;\n }\n effects.enter(stringType);\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return enclosed(code);\n }\n\n /**\n * In enclosed destination.\n *\n * ```markdown\n * > | <aa>\n * ^\n * ```\n *\n * @type {State}\n */\n function enclosed(code) {\n if (code === 62) {\n effects.exit(\"chunkString\");\n effects.exit(stringType);\n return enclosedBefore(code);\n }\n if (code === null || code === 60 || markdownLineEnding(code)) {\n return nok(code);\n }\n effects.consume(code);\n return code === 92 ? enclosedEscape : enclosed;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * ```markdown\n * > | <a\\*a>\n * ^\n * ```\n *\n * @type {State}\n */\n function enclosedEscape(code) {\n if (code === 60 || code === 62 || code === 92) {\n effects.consume(code);\n return enclosed;\n }\n return enclosed(code);\n }\n\n /**\n * In raw destination.\n *\n * ```markdown\n * > | aa\n * ^\n * ```\n *\n * @type {State}\n */\n function raw(code) {\n if (!balance && (code === null || code === 41 || markdownLineEndingOrSpace(code))) {\n effects.exit(\"chunkString\");\n effects.exit(stringType);\n effects.exit(rawType);\n effects.exit(type);\n return ok(code);\n }\n if (balance < limit && code === 40) {\n effects.consume(code);\n balance++;\n return raw;\n }\n if (code === 41) {\n effects.consume(code);\n balance--;\n return raw;\n }\n\n // ASCII control (but *not* `\\0`) and space and `(`.\n // Note: in `markdown-rs`, `\\0` exists in codes, in `micromark-js` it\n // doesn’t.\n if (code === null || code === 32 || code === 40 || asciiControl(code)) {\n return nok(code);\n }\n effects.consume(code);\n return code === 92 ? rawEscape : raw;\n }\n\n /**\n * After `\\`, at special character.\n *\n * ```markdown\n * > | a\\*a\n * ^\n * ```\n *\n * @type {State}\n */\n function rawEscape(code) {\n if (code === 40 || code === 41 || code === 92) {\n effects.consume(code);\n return raw;\n }\n return raw(code);\n }\n}","/**\n * @import {\n * Effects,\n * State,\n * TokenizeContext,\n * TokenType\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/**\n * Parse labels.\n *\n * > 👉 **Note**: labels in markdown are capped at 999 characters in the string.\n *\n * ###### Examples\n *\n * ```markdown\n * [a]\n * [a\n * b]\n * [a\\]b]\n * ```\n *\n * @this {TokenizeContext}\n * Tokenize context.\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole label (`[a]`).\n * @param {TokenType} markerType\n * Type for the markers (`[` and `]`).\n * @param {TokenType} stringType\n * Type for the identifier (`a`).\n * @returns {State}\n * Start state.\n */\nexport function factoryLabel(effects, ok, nok, type, markerType, stringType) {\n const self = this;\n let size = 0;\n /** @type {boolean} */\n let seen;\n return start;\n\n /**\n * Start of label.\n *\n * ```markdown\n * > | [a]\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(type);\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n effects.enter(stringType);\n return atBreak;\n }\n\n /**\n * In label, at something, before something else.\n *\n * ```markdown\n * > | [a]\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (size > 999 || code === null || code === 91 || code === 93 && !seen ||\n // To do: remove in the future once we’ve switched from\n // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,\n // which doesn’t need this.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n code === 94 && !size && '_hiddenFootnoteSupport' in self.parser.constructs) {\n return nok(code);\n }\n if (code === 93) {\n effects.exit(stringType);\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n effects.exit(type);\n return ok;\n }\n\n // To do: indent? Link chunks and EOLs together?\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return atBreak;\n }\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return labelInside(code);\n }\n\n /**\n * In label, in text.\n *\n * ```markdown\n * > | [a]\n * ^\n * ```\n *\n * @type {State}\n */\n function labelInside(code) {\n if (code === null || code === 91 || code === 93 || markdownLineEnding(code) || size++ > 999) {\n effects.exit(\"chunkString\");\n return atBreak(code);\n }\n effects.consume(code);\n if (!seen) seen = !markdownSpace(code);\n return code === 92 ? labelEscape : labelInside;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * ```markdown\n * > | [a\\*a]\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code);\n size++;\n return labelInside;\n }\n return labelInside(code);\n }\n}","/**\n * @import {\n * Code,\n * Effects,\n * State,\n * TokenType\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/**\n * Parse titles.\n *\n * ###### Examples\n *\n * ```markdown\n * \"a\"\n * 'b'\n * (c)\n * \"a\n * b\"\n * 'a\n * b'\n * (a\\)b)\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole title (`\"a\"`, `'b'`, `(c)`).\n * @param {TokenType} markerType\n * Type for the markers (`\"`, `'`, `(`, and `)`).\n * @param {TokenType} stringType\n * Type for the value (`a`).\n * @returns {State}\n * Start state.\n */\nexport function factoryTitle(effects, ok, nok, type, markerType, stringType) {\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Start of title.\n *\n * ```markdown\n * > | \"a\"\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === 34 || code === 39 || code === 40) {\n effects.enter(type);\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n marker = code === 40 ? 41 : code;\n return begin;\n }\n return nok(code);\n }\n\n /**\n * After opening marker.\n *\n * This is also used at the closing marker.\n *\n * ```markdown\n * > | \"a\"\n * ^\n * ```\n *\n * @type {State}\n */\n function begin(code) {\n if (code === marker) {\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n effects.exit(type);\n return ok;\n }\n effects.enter(stringType);\n return atBreak(code);\n }\n\n /**\n * At something, before something else.\n *\n * ```markdown\n * > | \"a\"\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === marker) {\n effects.exit(stringType);\n return begin(marker);\n }\n if (code === null) {\n return nok(code);\n }\n\n // Note: blank lines can’t exist in content.\n if (markdownLineEnding(code)) {\n // To do: use `space_or_tab_eol_with_options`, connect.\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, atBreak, \"linePrefix\");\n }\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return inside(code);\n }\n\n /**\n *\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker || code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n return atBreak(code);\n }\n effects.consume(code);\n return code === 92 ? escape : inside;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * ```markdown\n * > | \"a\\*b\"\n * ^\n * ```\n *\n * @type {State}\n */\n function escape(code) {\n if (code === marker || code === 92) {\n effects.consume(code);\n return inside;\n }\n return inside(code);\n }\n}","/**\n * @import {Effects, State} from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/**\n * Parse spaces and tabs.\n *\n * There is no `nok` parameter:\n *\n * * line endings or spaces in markdown are often optional, in which case this\n * factory can be used and `ok` will be switched to whether spaces were found\n * or not\n * * one line ending or space can be detected with\n * `markdownLineEndingOrSpace(code)` right before using `factoryWhitespace`\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @returns {State}\n * Start state.\n */\nexport function factoryWhitespace(effects, ok) {\n /** @type {boolean} */\n let seen;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n seen = true;\n return start;\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, start, seen ? \"linePrefix\" : \"lineSuffix\")(code);\n }\n return ok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factoryDestination } from 'micromark-factory-destination';\nimport { factoryLabel } from 'micromark-factory-label';\nimport { factorySpace } from 'micromark-factory-space';\nimport { factoryTitle } from 'micromark-factory-title';\nimport { factoryWhitespace } from 'micromark-factory-whitespace';\nimport { markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\n/** @type {Construct} */\nexport const definition = {\n name: 'definition',\n tokenize: tokenizeDefinition\n};\n\n/** @type {Construct} */\nconst titleBefore = {\n partial: true,\n tokenize: tokenizeTitleBefore\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeDefinition(effects, ok, nok) {\n const self = this;\n /** @type {string} */\n let identifier;\n return start;\n\n /**\n * At start of a definition.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Do not interrupt paragraphs (but do follow definitions).\n // To do: do `interrupt` the way `markdown-rs` does.\n // To do: parse whitespace the way `markdown-rs` does.\n effects.enter(\"definition\");\n return before(code);\n }\n\n /**\n * After optional whitespace, at `[`.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n // To do: parse whitespace the way `markdown-rs` does.\n\n return factoryLabel.call(self, effects, labelAfter,\n // Note: we don’t need to reset the way `markdown-rs` does.\n nok, \"definitionLabel\", \"definitionLabelMarker\", \"definitionLabelString\")(code);\n }\n\n /**\n * After label.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAfter(code) {\n identifier = normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1));\n if (code === 58) {\n effects.enter(\"definitionMarker\");\n effects.consume(code);\n effects.exit(\"definitionMarker\");\n return markerAfter;\n }\n return nok(code);\n }\n\n /**\n * After marker.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function markerAfter(code) {\n // Note: whitespace is optional.\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, destinationBefore)(code) : destinationBefore(code);\n }\n\n /**\n * Before destination.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function destinationBefore(code) {\n return factoryDestination(effects, destinationAfter,\n // Note: we don’t need to reset the way `markdown-rs` does.\n nok, \"definitionDestination\", \"definitionDestinationLiteral\", \"definitionDestinationLiteralMarker\", \"definitionDestinationRaw\", \"definitionDestinationString\")(code);\n }\n\n /**\n * After destination.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function destinationAfter(code) {\n return effects.attempt(titleBefore, after, after)(code);\n }\n\n /**\n * After definition.\n *\n * ```markdown\n * > | [a]: b\n * ^\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return markdownSpace(code) ? factorySpace(effects, afterWhitespace, \"whitespace\")(code) : afterWhitespace(code);\n }\n\n /**\n * After definition, after optional whitespace.\n *\n * ```markdown\n * > | [a]: b\n * ^\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function afterWhitespace(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"definition\");\n\n // Note: we don’t care about uniqueness.\n // It’s likely that that doesn’t happen very frequently.\n // It is more likely that it wastes precious time.\n self.parser.defined.push(identifier);\n\n // To do: `markdown-rs` interrupt.\n // // You’d be interrupting.\n // tokenizer.interrupt = true\n return ok(code);\n }\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeTitleBefore(effects, ok, nok) {\n return titleBefore;\n\n /**\n * After destination, at whitespace.\n *\n * ```markdown\n * > | [a]: b\n * ^\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function titleBefore(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, beforeMarker)(code) : nok(code);\n }\n\n /**\n * At title.\n *\n * ```markdown\n * | [a]: b\n * > | \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeMarker(code) {\n return factoryTitle(effects, titleAfter, nok, \"definitionTitle\", \"definitionTitleMarker\", \"definitionTitleString\")(code);\n }\n\n /**\n * After title.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function titleAfter(code) {\n return markdownSpace(code) ? factorySpace(effects, titleAfterOptionalWhitespace, \"whitespace\")(code) : titleAfterOptionalWhitespace(code);\n }\n\n /**\n * After title, after optional whitespace.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function titleAfterOptionalWhitespace(code) {\n return code === null || markdownLineEnding(code) ? ok(code) : nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const hardBreakEscape = {\n name: 'hardBreakEscape',\n tokenize: tokenizeHardBreakEscape\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHardBreakEscape(effects, ok, nok) {\n return start;\n\n /**\n * Start of a hard break (escape).\n *\n * ```markdown\n * > | a\\\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"hardBreakEscape\");\n effects.consume(code);\n return after;\n }\n\n /**\n * After `\\`, at eol.\n *\n * ```markdown\n * > | a\\\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (markdownLineEnding(code)) {\n effects.exit(\"hardBreakEscape\");\n return ok(code);\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { splice } from 'micromark-util-chunked';\n/** @type {Construct} */\nexport const headingAtx = {\n name: 'headingAtx',\n resolve: resolveHeadingAtx,\n tokenize: tokenizeHeadingAtx\n};\n\n/** @type {Resolver} */\nfunction resolveHeadingAtx(events, context) {\n let contentEnd = events.length - 2;\n let contentStart = 3;\n\n // Prefix whitespace, part of the opening.\n if (events[contentStart][1].type === \"whitespace\") {\n contentStart += 2;\n }\n\n // Suffix whitespace, part of the closing.\n if (contentEnd - 2 > contentStart && events[contentEnd][1].type === \"whitespace\") {\n contentEnd -= 2;\n }\n if (events[contentEnd][1].type === \"atxHeadingSequence\" && (contentStart === contentEnd - 1 || contentEnd - 4 > contentStart && events[contentEnd - 2][1].type === \"whitespace\")) {\n contentEnd -= contentStart + 1 === contentEnd ? 2 : 4;\n }\n if (contentEnd > contentStart) {\n const content = {\n type: \"atxHeadingText\",\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end\n };\n const text = {\n type: \"chunkText\",\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end,\n contentType: \"text\"\n };\n splice(events, contentStart, contentEnd - contentStart + 1, [['enter', content, context], ['enter', text, context], ['exit', text, context], ['exit', content, context]]);\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHeadingAtx(effects, ok, nok) {\n let size = 0;\n return start;\n\n /**\n * Start of a heading (atx).\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse indent like `markdown-rs`.\n effects.enter(\"atxHeading\");\n return before(code);\n }\n\n /**\n * After optional whitespace, at `#`.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter(\"atxHeadingSequence\");\n return sequenceOpen(code);\n }\n\n /**\n * In opening sequence.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === 35 && size++ < 6) {\n effects.consume(code);\n return sequenceOpen;\n }\n\n // Always at least one `#`.\n if (code === null || markdownLineEndingOrSpace(code)) {\n effects.exit(\"atxHeadingSequence\");\n return atBreak(code);\n }\n return nok(code);\n }\n\n /**\n * After something, before something else.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === 35) {\n effects.enter(\"atxHeadingSequence\");\n return sequenceFurther(code);\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"atxHeading\");\n // To do: interrupt like `markdown-rs`.\n // // Feel free to interrupt.\n // tokenizer.interrupt = false\n return ok(code);\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, atBreak, \"whitespace\")(code);\n }\n\n // To do: generate `data` tokens, add the `text` token later.\n // Needs edit map, see: `markdown.rs`.\n effects.enter(\"atxHeadingText\");\n return data(code);\n }\n\n /**\n * In further sequence (after whitespace).\n *\n * Could be normal “visible” hashes in the heading or a final sequence.\n *\n * ```markdown\n * > | ## aa ##\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceFurther(code) {\n if (code === 35) {\n effects.consume(code);\n return sequenceFurther;\n }\n effects.exit(\"atxHeadingSequence\");\n return atBreak(code);\n }\n\n /**\n * In text.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function data(code) {\n if (code === null || code === 35 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"atxHeadingText\");\n return atBreak(code);\n }\n effects.consume(code);\n return data;\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { asciiAlphanumeric, asciiAlpha, markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { htmlBlockNames, htmlRawNames } from 'micromark-util-html-tag-name';\nimport { blankLine } from './blank-line.js';\nimport { nonLazyContinuation } from './partial-non-lazy-continuation.js';\n\n/** @type {Construct} */\nexport const htmlFlow = {\n concrete: true,\n name: 'htmlFlow',\n resolveTo: resolveToHtmlFlow,\n tokenize: tokenizeHtmlFlow\n};\n\n/** @type {Construct} */\nconst blankLineBefore = {\n partial: true,\n tokenize: tokenizeBlankLineBefore\n};\n\n/** @type {Resolver} */\nfunction resolveToHtmlFlow(events) {\n let index = events.length;\n while (index--) {\n if (events[index][0] === 'enter' && events[index][1].type === \"htmlFlow\") {\n break;\n }\n }\n if (index > 1 && events[index - 2][1].type === \"linePrefix\") {\n // Add the prefix start to the HTML token.\n events[index][1].start = events[index - 2][1].start;\n // Add the prefix start to the HTML line token.\n events[index + 1][1].start = events[index - 2][1].start;\n // Remove the line prefix.\n events.splice(index - 2, 2);\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHtmlFlow(effects, ok, nok) {\n const self = this;\n /** @type {number} */\n let marker;\n /** @type {boolean} */\n let closingTag;\n /** @type {string} */\n let buffer;\n /** @type {number} */\n let index;\n /** @type {Code} */\n let markerB;\n return start;\n\n /**\n * Start of HTML (flow).\n *\n * ```markdown\n * > | <x />\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse indent like `markdown-rs`.\n return before(code);\n }\n\n /**\n * At `<`, after optional whitespace.\n *\n * ```markdown\n * > | <x />\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter(\"htmlFlow\");\n effects.enter(\"htmlFlowData\");\n effects.consume(code);\n return open;\n }\n\n /**\n * After `<`, at tag name or other stuff.\n *\n * ```markdown\n * > | <x />\n * ^\n * > | <!doctype>\n * ^\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 33) {\n effects.consume(code);\n return declarationOpen;\n }\n if (code === 47) {\n effects.consume(code);\n closingTag = true;\n return tagCloseStart;\n }\n if (code === 63) {\n effects.consume(code);\n marker = 3;\n // To do:\n // tokenizer.concrete = true\n // To do: use `markdown-rs` style interrupt.\n // While we’re in an instruction instead of a declaration, we’re on a `?`\n // right now, so we do need to search for `>`, similar to declarations.\n return self.interrupt ? ok : continuationDeclarationInside;\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n // Always the case.\n effects.consume(code);\n buffer = String.fromCharCode(code);\n return tagName;\n }\n return nok(code);\n }\n\n /**\n * After `<!`, at declaration, comment, or CDATA.\n *\n * ```markdown\n * > | <!doctype>\n * ^\n * > | <!--xxx-->\n * ^\n * > | <![CDATA[>&<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code);\n marker = 2;\n return commentOpenInside;\n }\n if (code === 91) {\n effects.consume(code);\n marker = 5;\n index = 0;\n return cdataOpenInside;\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n marker = 4;\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuationDeclarationInside;\n }\n return nok(code);\n }\n\n /**\n * After `<!-`, inside a comment, at another `-`.\n *\n * ```markdown\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code);\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuationDeclarationInside;\n }\n return nok(code);\n }\n\n /**\n * After `<![`, inside CDATA, expecting `CDATA[`.\n *\n * ```markdown\n * > | <![CDATA[>&<]]>\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function cdataOpenInside(code) {\n const value = \"CDATA[\";\n if (code === value.charCodeAt(index++)) {\n effects.consume(code);\n if (index === value.length) {\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuation;\n }\n return cdataOpenInside;\n }\n return nok(code);\n }\n\n /**\n * After `</`, in closing tag, at tag name.\n *\n * ```markdown\n * > | </x>\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseStart(code) {\n if (asciiAlpha(code)) {\n // Always the case.\n effects.consume(code);\n buffer = String.fromCharCode(code);\n return tagName;\n }\n return nok(code);\n }\n\n /**\n * In tag name.\n *\n * ```markdown\n * > | <ab>\n * ^^\n * > | </ab>\n * ^^\n * ```\n *\n * @type {State}\n */\n function tagName(code) {\n if (code === null || code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n const slash = code === 47;\n const name = buffer.toLowerCase();\n if (!slash && !closingTag && htmlRawNames.includes(name)) {\n marker = 1;\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok(code) : continuation(code);\n }\n if (htmlBlockNames.includes(buffer.toLowerCase())) {\n marker = 6;\n if (slash) {\n effects.consume(code);\n return basicSelfClosing;\n }\n\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok(code) : continuation(code);\n }\n marker = 7;\n // Do not support complete HTML when interrupting.\n return self.interrupt && !self.parser.lazy[self.now().line] ? nok(code) : closingTag ? completeClosingTagAfter(code) : completeAttributeNameBefore(code);\n }\n\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n buffer += String.fromCharCode(code);\n return tagName;\n }\n return nok(code);\n }\n\n /**\n * After closing slash of a basic tag name.\n *\n * ```markdown\n * > | <div/>\n * ^\n * ```\n *\n * @type {State}\n */\n function basicSelfClosing(code) {\n if (code === 62) {\n effects.consume(code);\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuation;\n }\n return nok(code);\n }\n\n /**\n * After closing slash of a complete tag name.\n *\n * ```markdown\n * > | <x/>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeClosingTagAfter(code) {\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeClosingTagAfter;\n }\n return completeEnd(code);\n }\n\n /**\n * At an attribute name.\n *\n * At first, this state is used after a complete tag name, after whitespace,\n * where it expects optional attributes or the end of the tag.\n * It is also reused after attributes, when expecting more optional\n * attributes.\n *\n * ```markdown\n * > | <a />\n * ^\n * > | <a :b>\n * ^\n * > | <a _b>\n * ^\n * > | <a b>\n * ^\n * > | <a >\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeNameBefore(code) {\n if (code === 47) {\n effects.consume(code);\n return completeEnd;\n }\n\n // ASCII alphanumerical and `:` and `_`.\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code);\n return completeAttributeName;\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAttributeNameBefore;\n }\n return completeEnd(code);\n }\n\n /**\n * In attribute name.\n *\n * ```markdown\n * > | <a :b>\n * ^\n * > | <a _b>\n * ^\n * > | <a b>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeName(code) {\n // ASCII alphanumerical and `-`, `.`, `:`, and `_`.\n if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return completeAttributeName;\n }\n return completeAttributeNameAfter(code);\n }\n\n /**\n * After attribute name, at an optional initializer, the end of the tag, or\n * whitespace.\n *\n * ```markdown\n * > | <a b>\n * ^\n * > | <a b=c>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code);\n return completeAttributeValueBefore;\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAttributeNameAfter;\n }\n return completeAttributeNameBefore(code);\n }\n\n /**\n * Before unquoted, double quoted, or single quoted attribute value, allowing\n * whitespace.\n *\n * ```markdown\n * > | <a b=c>\n * ^\n * > | <a b=\"c\">\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueBefore(code) {\n if (code === null || code === 60 || code === 61 || code === 62 || code === 96) {\n return nok(code);\n }\n if (code === 34 || code === 39) {\n effects.consume(code);\n markerB = code;\n return completeAttributeValueQuoted;\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAttributeValueBefore;\n }\n return completeAttributeValueUnquoted(code);\n }\n\n /**\n * In double or single quoted attribute value.\n *\n * ```markdown\n * > | <a b=\"c\">\n * ^\n * > | <a b='c'>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueQuoted(code) {\n if (code === markerB) {\n effects.consume(code);\n markerB = null;\n return completeAttributeValueQuotedAfter;\n }\n if (code === null || markdownLineEnding(code)) {\n return nok(code);\n }\n effects.consume(code);\n return completeAttributeValueQuoted;\n }\n\n /**\n * In unquoted attribute value.\n *\n * ```markdown\n * > | <a b=c>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueUnquoted(code) {\n if (code === null || code === 34 || code === 39 || code === 47 || code === 60 || code === 61 || code === 62 || code === 96 || markdownLineEndingOrSpace(code)) {\n return completeAttributeNameAfter(code);\n }\n effects.consume(code);\n return completeAttributeValueUnquoted;\n }\n\n /**\n * After double or single quoted attribute value, before whitespace or the\n * end of the tag.\n *\n * ```markdown\n * > | <a b=\"c\">\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownSpace(code)) {\n return completeAttributeNameBefore(code);\n }\n return nok(code);\n }\n\n /**\n * In certain circumstances of a complete tag where only an `>` is allowed.\n *\n * ```markdown\n * > | <a b=\"c\">\n * ^\n * ```\n *\n * @type {State}\n */\n function completeEnd(code) {\n if (code === 62) {\n effects.consume(code);\n return completeAfter;\n }\n return nok(code);\n }\n\n /**\n * After `>` in a complete tag.\n *\n * ```markdown\n * > | <x>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n // // Do not form containers.\n // tokenizer.concrete = true\n return continuation(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAfter;\n }\n return nok(code);\n }\n\n /**\n * In continuation of any HTML kind.\n *\n * ```markdown\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function continuation(code) {\n if (code === 45 && marker === 2) {\n effects.consume(code);\n return continuationCommentInside;\n }\n if (code === 60 && marker === 1) {\n effects.consume(code);\n return continuationRawTagOpen;\n }\n if (code === 62 && marker === 4) {\n effects.consume(code);\n return continuationClose;\n }\n if (code === 63 && marker === 3) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n if (code === 93 && marker === 5) {\n effects.consume(code);\n return continuationCdataInside;\n }\n if (markdownLineEnding(code) && (marker === 6 || marker === 7)) {\n effects.exit(\"htmlFlowData\");\n return effects.check(blankLineBefore, continuationAfter, continuationStart)(code);\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"htmlFlowData\");\n return continuationStart(code);\n }\n effects.consume(code);\n return continuation;\n }\n\n /**\n * In continuation, at eol.\n *\n * ```markdown\n * > | <x>\n * ^\n * | asd\n * ```\n *\n * @type {State}\n */\n function continuationStart(code) {\n return effects.check(nonLazyContinuation, continuationStartNonLazy, continuationAfter)(code);\n }\n\n /**\n * In continuation, at eol, before non-lazy content.\n *\n * ```markdown\n * > | <x>\n * ^\n * | asd\n * ```\n *\n * @type {State}\n */\n function continuationStartNonLazy(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return continuationBefore;\n }\n\n /**\n * In continuation, before non-lazy content.\n *\n * ```markdown\n * | <x>\n * > | asd\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return continuationStart(code);\n }\n effects.enter(\"htmlFlowData\");\n return continuation(code);\n }\n\n /**\n * In comment continuation, after one `-`, expecting another.\n *\n * ```markdown\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationCommentInside(code) {\n if (code === 45) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In raw continuation, after `<`, at `/`.\n *\n * ```markdown\n * > | <script>console.log(1)</script>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationRawTagOpen(code) {\n if (code === 47) {\n effects.consume(code);\n buffer = '';\n return continuationRawEndTag;\n }\n return continuation(code);\n }\n\n /**\n * In raw continuation, after `</`, in a raw tag name.\n *\n * ```markdown\n * > | <script>console.log(1)</script>\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function continuationRawEndTag(code) {\n if (code === 62) {\n const name = buffer.toLowerCase();\n if (htmlRawNames.includes(name)) {\n effects.consume(code);\n return continuationClose;\n }\n return continuation(code);\n }\n if (asciiAlpha(code) && buffer.length < 8) {\n // Always the case.\n effects.consume(code);\n buffer += String.fromCharCode(code);\n return continuationRawEndTag;\n }\n return continuation(code);\n }\n\n /**\n * In cdata continuation, after `]`, expecting `]>`.\n *\n * ```markdown\n * > | <![CDATA[>&<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationCdataInside(code) {\n if (code === 93) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In declaration or instruction continuation, at `>`.\n *\n * ```markdown\n * > | <!-->\n * ^\n * > | <?>\n * ^\n * > | <!q>\n * ^\n * > | <!--ab-->\n * ^\n * > | <![CDATA[>&<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationDeclarationInside(code) {\n if (code === 62) {\n effects.consume(code);\n return continuationClose;\n }\n\n // More dashes.\n if (code === 45 && marker === 2) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In closed continuation: everything we get until the eol/eof is part of it.\n *\n * ```markdown\n * > | <!doctype>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationClose(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"htmlFlowData\");\n return continuationAfter(code);\n }\n effects.consume(code);\n return continuationClose;\n }\n\n /**\n * Done.\n *\n * ```markdown\n * > | <!doctype>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationAfter(code) {\n effects.exit(\"htmlFlow\");\n // // Feel free to interrupt.\n // tokenizer.interrupt = false\n // // No longer concrete.\n // tokenizer.concrete = false\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlankLineBefore(effects, ok, nok) {\n return start;\n\n /**\n * Before eol, expecting blank line.\n *\n * ```markdown\n * > | <div>\n * ^\n * |\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return effects.attempt(blankLine, ok, nok);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { asciiAlphanumeric, asciiAlpha, markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const htmlText = {\n name: 'htmlText',\n tokenize: tokenizeHtmlText\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHtmlText(effects, ok, nok) {\n const self = this;\n /** @type {NonNullable<Code> | undefined} */\n let marker;\n /** @type {number} */\n let index;\n /** @type {State} */\n let returnState;\n return start;\n\n /**\n * Start of HTML (text).\n *\n * ```markdown\n * > | a <b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"htmlText\");\n effects.enter(\"htmlTextData\");\n effects.consume(code);\n return open;\n }\n\n /**\n * After `<`, at tag name or other stuff.\n *\n * ```markdown\n * > | a <b> c\n * ^\n * > | a <!doctype> c\n * ^\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 33) {\n effects.consume(code);\n return declarationOpen;\n }\n if (code === 47) {\n effects.consume(code);\n return tagCloseStart;\n }\n if (code === 63) {\n effects.consume(code);\n return instruction;\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n return tagOpen;\n }\n return nok(code);\n }\n\n /**\n * After `<!`, at declaration, comment, or CDATA.\n *\n * ```markdown\n * > | a <!doctype> c\n * ^\n * > | a <!--b--> c\n * ^\n * > | a <![CDATA[>&<]]> c\n * ^\n * ```\n *\n * @type {State}\n */\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code);\n return commentOpenInside;\n }\n if (code === 91) {\n effects.consume(code);\n index = 0;\n return cdataOpenInside;\n }\n if (asciiAlpha(code)) {\n effects.consume(code);\n return declaration;\n }\n return nok(code);\n }\n\n /**\n * In a comment, after `<!-`, at another `-`.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code);\n return commentEnd;\n }\n return nok(code);\n }\n\n /**\n * In comment.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function comment(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 45) {\n effects.consume(code);\n return commentClose;\n }\n if (markdownLineEnding(code)) {\n returnState = comment;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return comment;\n }\n\n /**\n * In comment, after `-`.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentClose(code) {\n if (code === 45) {\n effects.consume(code);\n return commentEnd;\n }\n return comment(code);\n }\n\n /**\n * In comment, after `--`.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentEnd(code) {\n return code === 62 ? end(code) : code === 45 ? commentClose(code) : comment(code);\n }\n\n /**\n * After `<![`, in CDATA, expecting `CDATA[`.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function cdataOpenInside(code) {\n const value = \"CDATA[\";\n if (code === value.charCodeAt(index++)) {\n effects.consume(code);\n return index === value.length ? cdata : cdataOpenInside;\n }\n return nok(code);\n }\n\n /**\n * In CDATA.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^^^\n * ```\n *\n * @type {State}\n */\n function cdata(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 93) {\n effects.consume(code);\n return cdataClose;\n }\n if (markdownLineEnding(code)) {\n returnState = cdata;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return cdata;\n }\n\n /**\n * In CDATA, after `]`, at another `]`.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataClose(code) {\n if (code === 93) {\n effects.consume(code);\n return cdataEnd;\n }\n return cdata(code);\n }\n\n /**\n * In CDATA, after `]]`, at `>`.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataEnd(code) {\n if (code === 62) {\n return end(code);\n }\n if (code === 93) {\n effects.consume(code);\n return cdataEnd;\n }\n return cdata(code);\n }\n\n /**\n * In declaration.\n *\n * ```markdown\n * > | a <!b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function declaration(code) {\n if (code === null || code === 62) {\n return end(code);\n }\n if (markdownLineEnding(code)) {\n returnState = declaration;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return declaration;\n }\n\n /**\n * In instruction.\n *\n * ```markdown\n * > | a <?b?> c\n * ^\n * ```\n *\n * @type {State}\n */\n function instruction(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 63) {\n effects.consume(code);\n return instructionClose;\n }\n if (markdownLineEnding(code)) {\n returnState = instruction;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return instruction;\n }\n\n /**\n * In instruction, after `?`, at `>`.\n *\n * ```markdown\n * > | a <?b?> c\n * ^\n * ```\n *\n * @type {State}\n */\n function instructionClose(code) {\n return code === 62 ? end(code) : instruction(code);\n }\n\n /**\n * After `</`, in closing tag, at tag name.\n *\n * ```markdown\n * > | a </b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseStart(code) {\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n return tagClose;\n }\n return nok(code);\n }\n\n /**\n * After `</x`, in a tag name.\n *\n * ```markdown\n * > | a </b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagClose(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagClose;\n }\n return tagCloseBetween(code);\n }\n\n /**\n * In closing tag, after tag name.\n *\n * ```markdown\n * > | a </b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseBetween(code) {\n if (markdownLineEnding(code)) {\n returnState = tagCloseBetween;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagCloseBetween;\n }\n return end(code);\n }\n\n /**\n * After `<x`, in opening tag name.\n *\n * ```markdown\n * > | a <b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpen(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagOpen;\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n return nok(code);\n }\n\n /**\n * In opening tag, after tag name.\n *\n * ```markdown\n * > | a <b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenBetween(code) {\n if (code === 47) {\n effects.consume(code);\n return end;\n }\n\n // ASCII alphabetical and `:` and `_`.\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code);\n return tagOpenAttributeName;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenBetween;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenBetween;\n }\n return end(code);\n }\n\n /**\n * In attribute name.\n *\n * ```markdown\n * > | a <b c> d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeName(code) {\n // ASCII alphabetical and `-`, `.`, `:`, and `_`.\n if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagOpenAttributeName;\n }\n return tagOpenAttributeNameAfter(code);\n }\n\n /**\n * After attribute name, before initializer, the end of the tag, or\n * whitespace.\n *\n * ```markdown\n * > | a <b c> d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code);\n return tagOpenAttributeValueBefore;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeNameAfter;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenAttributeNameAfter;\n }\n return tagOpenBetween(code);\n }\n\n /**\n * Before unquoted, double quoted, or single quoted attribute value, allowing\n * whitespace.\n *\n * ```markdown\n * > | a <b c=d> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueBefore(code) {\n if (code === null || code === 60 || code === 61 || code === 62 || code === 96) {\n return nok(code);\n }\n if (code === 34 || code === 39) {\n effects.consume(code);\n marker = code;\n return tagOpenAttributeValueQuoted;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueBefore;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenAttributeValueBefore;\n }\n effects.consume(code);\n return tagOpenAttributeValueUnquoted;\n }\n\n /**\n * In double or single quoted attribute value.\n *\n * ```markdown\n * > | a <b c=\"d\"> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuoted(code) {\n if (code === marker) {\n effects.consume(code);\n marker = undefined;\n return tagOpenAttributeValueQuotedAfter;\n }\n if (code === null) {\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueQuoted;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return tagOpenAttributeValueQuoted;\n }\n\n /**\n * In unquoted attribute value.\n *\n * ```markdown\n * > | a <b c=d> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueUnquoted(code) {\n if (code === null || code === 34 || code === 39 || code === 60 || code === 61 || code === 96) {\n return nok(code);\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n effects.consume(code);\n return tagOpenAttributeValueUnquoted;\n }\n\n /**\n * After double or single quoted attribute value, before whitespace or the end\n * of the tag.\n *\n * ```markdown\n * > | a <b c=\"d\"> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n return nok(code);\n }\n\n /**\n * In certain circumstances of a tag where only an `>` is allowed.\n *\n * ```markdown\n * > | a <b c=\"d\"> e\n * ^\n * ```\n *\n * @type {State}\n */\n function end(code) {\n if (code === 62) {\n effects.consume(code);\n effects.exit(\"htmlTextData\");\n effects.exit(\"htmlText\");\n return ok;\n }\n return nok(code);\n }\n\n /**\n * At eol.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * > | a <!--a\n * ^\n * | b-->\n * ```\n *\n * @type {State}\n */\n function lineEndingBefore(code) {\n effects.exit(\"htmlTextData\");\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return lineEndingAfter;\n }\n\n /**\n * After eol, at optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a <!--a\n * > | b-->\n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfter(code) {\n // Always populated by defaults.\n\n return markdownSpace(code) ? factorySpace(effects, lineEndingAfterPrefix, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code) : lineEndingAfterPrefix(code);\n }\n\n /**\n * After eol, after optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a <!--a\n * > | b-->\n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfterPrefix(code) {\n effects.enter(\"htmlTextData\");\n return returnState(code);\n }\n}","/**\n * @import {\n * Construct,\n * Event,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factoryDestination } from 'micromark-factory-destination';\nimport { factoryLabel } from 'micromark-factory-label';\nimport { factoryTitle } from 'micromark-factory-title';\nimport { factoryWhitespace } from 'micromark-factory-whitespace';\nimport { markdownLineEndingOrSpace } from 'micromark-util-character';\nimport { push, splice } from 'micromark-util-chunked';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/** @type {Construct} */\nexport const labelEnd = {\n name: 'labelEnd',\n resolveAll: resolveAllLabelEnd,\n resolveTo: resolveToLabelEnd,\n tokenize: tokenizeLabelEnd\n};\n\n/** @type {Construct} */\nconst resourceConstruct = {\n tokenize: tokenizeResource\n};\n/** @type {Construct} */\nconst referenceFullConstruct = {\n tokenize: tokenizeReferenceFull\n};\n/** @type {Construct} */\nconst referenceCollapsedConstruct = {\n tokenize: tokenizeReferenceCollapsed\n};\n\n/** @type {Resolver} */\nfunction resolveAllLabelEnd(events) {\n let index = -1;\n /** @type {Array<Event>} */\n const newEvents = [];\n while (++index < events.length) {\n const token = events[index][1];\n newEvents.push(events[index]);\n if (token.type === \"labelImage\" || token.type === \"labelLink\" || token.type === \"labelEnd\") {\n // Remove the marker.\n const offset = token.type === \"labelImage\" ? 4 : 2;\n token.type = \"data\";\n index += offset;\n }\n }\n\n // If the events are equal, we don't have to copy newEvents to events\n if (events.length !== newEvents.length) {\n splice(events, 0, events.length, newEvents);\n }\n return events;\n}\n\n/** @type {Resolver} */\nfunction resolveToLabelEnd(events, context) {\n let index = events.length;\n let offset = 0;\n /** @type {number | undefined} */\n let open;\n /** @type {number | undefined} */\n let close;\n /** @type {Array<Event>} */\n let media;\n\n // Find an opening.\n while (index--) {\n const token = events[index][1];\n if (open) {\n // If we see another link, or inactive link label, we’ve been here before.\n if (token.type === \"link\" || token.type === \"labelLink\" && token._inactive) {\n break;\n }\n\n // Mark other link openings as inactive, as we can’t have links in\n // links.\n if (events[index][0] === 'enter' && token.type === \"labelLink\") {\n token._inactive = true;\n }\n } else if (close) {\n if (events[index][0] === 'enter' && (token.type === \"labelImage\" || token.type === \"labelLink\") && !token._balanced) {\n open = index;\n if (token.type !== \"labelLink\") {\n offset = 2;\n break;\n }\n }\n } else if (token.type === \"labelEnd\") {\n close = index;\n }\n }\n const group = {\n type: events[open][1].type === \"labelLink\" ? \"link\" : \"image\",\n start: {\n ...events[open][1].start\n },\n end: {\n ...events[events.length - 1][1].end\n }\n };\n const label = {\n type: \"label\",\n start: {\n ...events[open][1].start\n },\n end: {\n ...events[close][1].end\n }\n };\n const text = {\n type: \"labelText\",\n start: {\n ...events[open + offset + 2][1].end\n },\n end: {\n ...events[close - 2][1].start\n }\n };\n media = [['enter', group, context], ['enter', label, context]];\n\n // Opening marker.\n media = push(media, events.slice(open + 1, open + offset + 3));\n\n // Text open.\n media = push(media, [['enter', text, context]]);\n\n // Always populated by defaults.\n\n // Between.\n media = push(media, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + offset + 4, close - 3), context));\n\n // Text close, marker close, label close.\n media = push(media, [['exit', text, context], events[close - 2], events[close - 1], ['exit', label, context]]);\n\n // Reference, resource, or so.\n media = push(media, events.slice(close + 1));\n\n // Media close.\n media = push(media, [['exit', group, context]]);\n splice(events, open, events.length, media);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelEnd(effects, ok, nok) {\n const self = this;\n const labelStarts = self._labelStarts;\n /** @type {Token} */\n let labelStart;\n /** @type {boolean} */\n let defined;\n if (labelStarts) {\n // Discard ones that failed to close,\n // they’re not needed anymore.\n while (labelStarts.length > 0 && labelStarts[labelStarts.length - 1]._balanced) {\n labelStarts.pop();\n }\n labelStart = labelStarts[labelStarts.length - 1];\n }\n return start;\n\n /**\n * Start of label end.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // If there is not an okay opening.\n if (!labelStart) {\n return nok(code);\n }\n\n // If the corresponding label (link) start is marked as inactive,\n // it means we’d be wrapping a link, like this:\n //\n // ```markdown\n // > | a [b [c](d) e](f) g.\n // ^\n // ```\n //\n // We can’t have that, so it’s just balanced brackets.\n if (labelStart._inactive) {\n return labelEndNok(code);\n }\n defined = self.parser.defined.includes(normalizeIdentifier(self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })));\n effects.enter(\"labelEnd\");\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n effects.exit(\"labelEnd\");\n return after;\n }\n\n /**\n * After `]`.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Note: `markdown-rs` also parses GFM footnotes here, which for us is in\n // an extension.\n\n // Resource (`[asd](fgh)`)?\n if (code === 40) {\n return effects.attempt(resourceConstruct, labelEndOk, defined ? labelEndOk : labelEndNok)(code);\n }\n\n // Full (`[asd][fgh]`) or collapsed (`[asd][]`) reference?\n if (code === 91) {\n return effects.attempt(referenceFullConstruct, labelEndOk, defined ? referenceNotFull : labelEndNok)(code);\n }\n\n // Shortcut (`[asd]`) reference?\n return defined ? labelEndOk(code) : labelEndNok(code);\n }\n\n /**\n * After `]`, at `[`, but not at a full reference.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceNotFull(code) {\n return effects.attempt(referenceCollapsedConstruct, labelEndOk, labelEndNok)(code);\n }\n\n /**\n * Done, we found something.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndOk(code) {\n // Note: `markdown-rs` does a bunch of stuff here.\n // This label start is now used up: discard it so it’s never found again.\n\n labelStarts.pop();\n return ok(code);\n }\n\n /**\n * Done, it’s nothing.\n *\n * There was an okay opening, but we didn’t match anything.\n *\n * ```markdown\n * > | [a](b c\n * ^\n * > | [a][b c\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndNok(code) {\n labelStart._balanced = true;\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeResource(effects, ok, nok) {\n return resourceStart;\n\n /**\n * At a resource.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceStart(code) {\n effects.enter(\"resource\");\n effects.enter(\"resourceMarker\");\n effects.consume(code);\n effects.exit(\"resourceMarker\");\n return resourceBefore;\n }\n\n /**\n * In resource, after `(`, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBefore(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceOpen)(code) : resourceOpen(code);\n }\n\n /**\n * In resource, after optional whitespace, at `)` or a destination.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceOpen(code) {\n if (code === 41) {\n return resourceEnd(code);\n }\n return factoryDestination(effects, resourceDestinationAfter, resourceDestinationMissing, \"resourceDestination\", \"resourceDestinationLiteral\", \"resourceDestinationLiteralMarker\", \"resourceDestinationRaw\", \"resourceDestinationString\", 32)(code);\n }\n\n /**\n * In resource, after destination, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationAfter(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceBetween)(code) : resourceEnd(code);\n }\n\n /**\n * At invalid destination.\n *\n * ```markdown\n * > | [a](<<) b\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationMissing(code) {\n return nok(code);\n }\n\n /**\n * In resource, after destination and whitespace, at `(` or title.\n *\n * ```markdown\n * > | [a](b ) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBetween(code) {\n if (code === 34 || code === 39 || code === 40) {\n return factoryTitle(effects, resourceTitleAfter, nok, \"resourceTitle\", \"resourceTitleMarker\", \"resourceTitleString\")(code);\n }\n return resourceEnd(code);\n }\n\n /**\n * In resource, after title, at optional whitespace.\n *\n * ```markdown\n * > | [a](b \"c\") d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceTitleAfter(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceEnd)(code) : resourceEnd(code);\n }\n\n /**\n * In resource, at `)`.\n *\n * ```markdown\n * > | [a](b) d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceEnd(code) {\n if (code === 41) {\n effects.enter(\"resourceMarker\");\n effects.consume(code);\n effects.exit(\"resourceMarker\");\n effects.exit(\"resource\");\n return ok;\n }\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceFull(effects, ok, nok) {\n const self = this;\n return referenceFull;\n\n /**\n * In a reference (full), at the `[`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFull(code) {\n return factoryLabel.call(self, effects, referenceFullAfter, referenceFullMissing, \"reference\", \"referenceMarker\", \"referenceString\")(code);\n }\n\n /**\n * In a reference (full), after `]`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullAfter(code) {\n return self.parser.defined.includes(normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1))) ? ok(code) : nok(code);\n }\n\n /**\n * In reference (full) that was missing.\n *\n * ```markdown\n * > | [a][b d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullMissing(code) {\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceCollapsed(effects, ok, nok) {\n return referenceCollapsedStart;\n\n /**\n * In reference (collapsed), at `[`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedStart(code) {\n // We only attempt a collapsed label if there’s a `[`.\n\n effects.enter(\"reference\");\n effects.enter(\"referenceMarker\");\n effects.consume(code);\n effects.exit(\"referenceMarker\");\n return referenceCollapsedOpen;\n }\n\n /**\n * In reference (collapsed), at `]`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedOpen(code) {\n if (code === 93) {\n effects.enter(\"referenceMarker\");\n effects.consume(code);\n effects.exit(\"referenceMarker\");\n effects.exit(\"reference\");\n return ok;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * Token,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { labelEnd } from './label-end.js';\n\n/** @type {Construct} */\nexport const labelStartImage = {\n name: 'labelStartImage',\n resolveAll: labelEnd.resolveAll,\n tokenize: tokenizeLabelStartImage\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartImage(effects, ok, nok) {\n const self = this;\n /** @type {Token} */\n let labelImage;\n return start;\n\n /**\n * Start of label (image) start.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"labelImage\");\n effects.enter(\"labelImageMarker\");\n effects.consume(code);\n effects.exit(\"labelImageMarker\");\n return open;\n }\n\n /**\n * After `!`, at `[`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 91) {\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n labelImage = effects.exit(\"labelImage\");\n return after;\n }\n return nok(code);\n }\n\n /**\n * After `![`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * This is needed in because, when GFM footnotes are enabled, images never\n * form when started with a `^`.\n * Instead, links form:\n *\n * ```markdown\n * \n *\n * ![^a][b]\n *\n * [b]: c\n * ```\n *\n * ```html\n * <p>!<a href=\\\"b\\\">^a</a></p>\n * <p>!<a href=\\\"c\\\">^a</a></p>\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // To do: use a new field to do this, this is still needed for\n // `micromark-extension-gfm-footnote`, but the `label-start-link`\n // behavior isn’t.\n // Hidden footnotes hook.\n /* c8 ignore next 6 */\n if (code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs) {\n return nok(code);\n }\n self._labelStarts = self._labelStarts || [];\n self._labelStarts.push(labelImage);\n return ok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * Token,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { labelEnd } from './label-end.js';\n\n/** @type {Construct} */\nexport const labelStartLink = {\n name: 'labelStartLink',\n resolveAll: labelEnd.resolveAll,\n tokenize: tokenizeLabelStartLink\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartLink(effects, ok, nok) {\n const self = this;\n /** @type {Token} */\n let labelLink;\n return start;\n\n /**\n * Start of label (link) start.\n *\n * ```markdown\n * > | a [b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"labelLink\");\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n labelLink = effects.exit(\"labelLink\");\n return after;\n }\n\n /** @type {State} */\n function after(code) {\n // To do: this isn’t needed in `micromark-extension-gfm-footnote`,\n // remove.\n // Hidden footnotes hook.\n /* c8 ignore next 6 */\n if (code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs) {\n return nok(code);\n }\n self._labelStarts = self._labelStarts || [];\n self._labelStarts.push(labelLink);\n return ok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const lineEnding = {\n name: 'lineEnding',\n tokenize: tokenizeLineEnding\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLineEnding(effects, ok) {\n return start;\n\n /** @type {State} */\n function start(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, ok, \"linePrefix\");\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const thematicBreak = {\n name: 'thematicBreak',\n tokenize: tokenizeThematicBreak\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeThematicBreak(effects, ok, nok) {\n let size = 0;\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Start of thematic break.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"thematicBreak\");\n // To do: parse indent like `markdown-rs`.\n return before(code);\n }\n\n /**\n * After optional whitespace, at marker.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n marker = code;\n return atBreak(code);\n }\n\n /**\n * After something, before something else.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === marker) {\n effects.enter(\"thematicBreakSequence\");\n return sequence(code);\n }\n if (size >= 3 && (code === null || markdownLineEnding(code))) {\n effects.exit(\"thematicBreak\");\n return ok(code);\n }\n return nok(code);\n }\n\n /**\n * In sequence.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function sequence(code) {\n if (code === marker) {\n effects.consume(code);\n size++;\n return sequence;\n }\n effects.exit(\"thematicBreakSequence\");\n return markdownSpace(code) ? factorySpace(effects, atBreak, \"whitespace\")(code) : atBreak(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * Exiter,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { asciiDigit, markdownSpace } from 'micromark-util-character';\nimport { blankLine } from './blank-line.js';\nimport { thematicBreak } from './thematic-break.js';\n\n/** @type {Construct} */\nexport const list = {\n continuation: {\n tokenize: tokenizeListContinuation\n },\n exit: tokenizeListEnd,\n name: 'list',\n tokenize: tokenizeListStart\n};\n\n/** @type {Construct} */\nconst listItemPrefixWhitespaceConstruct = {\n partial: true,\n tokenize: tokenizeListItemPrefixWhitespace\n};\n\n/** @type {Construct} */\nconst indentConstruct = {\n partial: true,\n tokenize: tokenizeIndent\n};\n\n// To do: `markdown-rs` parses list items on their own and later stitches them\n// together.\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListStart(effects, ok, nok) {\n const self = this;\n const tail = self.events[self.events.length - 1];\n let initialSize = tail && tail[1].type === \"linePrefix\" ? tail[2].sliceSerialize(tail[1], true).length : 0;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n const kind = self.containerState.type || (code === 42 || code === 43 || code === 45 ? \"listUnordered\" : \"listOrdered\");\n if (kind === \"listUnordered\" ? !self.containerState.marker || code === self.containerState.marker : asciiDigit(code)) {\n if (!self.containerState.type) {\n self.containerState.type = kind;\n effects.enter(kind, {\n _container: true\n });\n }\n if (kind === \"listUnordered\") {\n effects.enter(\"listItemPrefix\");\n return code === 42 || code === 45 ? effects.check(thematicBreak, nok, atMarker)(code) : atMarker(code);\n }\n if (!self.interrupt || code === 49) {\n effects.enter(\"listItemPrefix\");\n effects.enter(\"listItemValue\");\n return inside(code);\n }\n }\n return nok(code);\n }\n\n /** @type {State} */\n function inside(code) {\n if (asciiDigit(code) && ++size < 10) {\n effects.consume(code);\n return inside;\n }\n if ((!self.interrupt || size < 2) && (self.containerState.marker ? code === self.containerState.marker : code === 41 || code === 46)) {\n effects.exit(\"listItemValue\");\n return atMarker(code);\n }\n return nok(code);\n }\n\n /**\n * @type {State}\n **/\n function atMarker(code) {\n effects.enter(\"listItemMarker\");\n effects.consume(code);\n effects.exit(\"listItemMarker\");\n self.containerState.marker = self.containerState.marker || code;\n return effects.check(blankLine,\n // Can’t be empty when interrupting.\n self.interrupt ? nok : onBlank, effects.attempt(listItemPrefixWhitespaceConstruct, endOfPrefix, otherPrefix));\n }\n\n /** @type {State} */\n function onBlank(code) {\n self.containerState.initialBlankLine = true;\n initialSize++;\n return endOfPrefix(code);\n }\n\n /** @type {State} */\n function otherPrefix(code) {\n if (markdownSpace(code)) {\n effects.enter(\"listItemPrefixWhitespace\");\n effects.consume(code);\n effects.exit(\"listItemPrefixWhitespace\");\n return endOfPrefix;\n }\n return nok(code);\n }\n\n /** @type {State} */\n function endOfPrefix(code) {\n self.containerState.size = initialSize + self.sliceSerialize(effects.exit(\"listItemPrefix\"), true).length;\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListContinuation(effects, ok, nok) {\n const self = this;\n self.containerState._closeFlow = undefined;\n return effects.check(blankLine, onBlank, notBlank);\n\n /** @type {State} */\n function onBlank(code) {\n self.containerState.furtherBlankLines = self.containerState.furtherBlankLines || self.containerState.initialBlankLine;\n\n // We have a blank line.\n // Still, try to consume at most the items size.\n return factorySpace(effects, ok, \"listItemIndent\", self.containerState.size + 1)(code);\n }\n\n /** @type {State} */\n function notBlank(code) {\n if (self.containerState.furtherBlankLines || !markdownSpace(code)) {\n self.containerState.furtherBlankLines = undefined;\n self.containerState.initialBlankLine = undefined;\n return notInCurrentItem(code);\n }\n self.containerState.furtherBlankLines = undefined;\n self.containerState.initialBlankLine = undefined;\n return effects.attempt(indentConstruct, ok, notInCurrentItem)(code);\n }\n\n /** @type {State} */\n function notInCurrentItem(code) {\n // While we do continue, we signal that the flow should be closed.\n self.containerState._closeFlow = true;\n // As we’re closing flow, we’re no longer interrupting.\n self.interrupt = undefined;\n // Always populated by defaults.\n\n return factorySpace(effects, effects.attempt(list, ok, nok), \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeIndent(effects, ok, nok) {\n const self = this;\n return factorySpace(effects, afterPrefix, \"listItemIndent\", self.containerState.size + 1);\n\n /** @type {State} */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return tail && tail[1].type === \"listItemIndent\" && tail[2].sliceSerialize(tail[1], true).length === self.containerState.size ? ok(code) : nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Exiter}\n */\nfunction tokenizeListEnd(effects) {\n effects.exit(this.containerState.type);\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListItemPrefixWhitespace(effects, ok, nok) {\n const self = this;\n\n // Always populated by defaults.\n\n return factorySpace(effects, afterPrefix, \"listItemPrefixWhitespace\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4 + 1);\n\n /** @type {State} */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return !markdownSpace(code) && tail && tail[1].type === \"listItemPrefixWhitespace\" ? ok(code) : nok(code);\n }\n}","/**\n * @import {Event} from 'micromark-util-types'\n */\n\n/**\n * @typedef {[number, number, Array<Event>]} Change\n * @typedef {[number, number, number]} Jump\n */\n\n/**\n * Tracks a bunch of edits.\n *\n * Port of `edit_map.rs` from `markdown-rs`:\n * <https://github.com/wooorm/markdown-rs/blob/1506572f/src/util/edit_map.rs>.\n *\n * Deal with several changes in events, batching them together.\n *\n * Preferably, changes should be kept to a minimum.\n * Sometimes, it’s needed to change the list of events, because parsing can be\n * messy, and it helps to expose a cleaner interface of events to the compiler\n * and other users.\n * It can also help to merge many adjacent similar events.\n * And, in other cases, it’s needed to parse subcontent: pass some events\n * through another tokenizer and inject the result.\n */\nexport class EditMap {\n /**\n * Create a new edit map.\n *\n * @returns\n * New instance.\n */\n constructor() {\n /**\n * Changes by index, so `add` does not need to scan `map` (which is\n * quadratic for documents with many edits at different places).\n *\n * @type {Map<number, Change>}\n */\n this.index = new Map();\n\n /**\n * Record of changes.\n *\n * @type {Array<Change>}\n */\n this.map = [];\n }\n\n /**\n * Create an edit: a remove and/or add at a certain place.\n *\n * @param {number} index\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @returns {undefined}\n * Nothing.\n */\n add(index, remove, add) {\n addImplementation(this, index, remove, add, false);\n }\n\n /**\n * Create an edit: but insert `add` before existing additions, instead of\n * after them.\n *\n * @param {number} index\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @returns {undefined}\n * Nothing.\n */\n addBefore(index, remove, add) {\n addImplementation(this, index, remove, add, true);\n }\n\n /**\n * Done, change the events.\n *\n * @param {Array<Event>} events\n * List of events to apply the edits to.\n * @returns {undefined}\n * Nothing.\n */\n consume(events) {\n this.map.sort(function (a, b) {\n return a[0] - b[0];\n });\n if (this.map.length === 0) {\n return;\n }\n\n // To do: if links are added in events, like they are in `markdown-rs`,\n // this is needed.\n // // Calculate jumps: where items in the current list move to.\n // /** @type {Array<Jump>} */\n // const jumps = []\n // let index = 0\n // let addAcc = 0\n // let removeAcc = 0\n // while (index < this.map.length) {\n // const [at, remove, add] = this.map[index]\n // removeAcc += remove\n // addAcc += add.length\n // jumps.push([at, removeAcc, addAcc])\n // index += 1\n // }\n //\n // shiftLinks(events, jumps)\n\n let index = this.map.length;\n /** @type {Array<Array<Event>>} */\n const vecs = [];\n while (index > 0) {\n index -= 1;\n vecs.push(events.slice(this.map[index][0] + this.map[index][1]), this.map[index][2]);\n\n // Truncate rest.\n events.length = this.map[index][0];\n }\n vecs.push(events.slice());\n events.length = 0;\n let slice = vecs.pop();\n while (slice) {\n for (const element of slice) {\n events.push(element);\n }\n slice = vecs.pop();\n }\n\n // Truncate everything.\n this.map.length = 0;\n this.index.clear();\n }\n}\n\n/**\n * Create an edit.\n *\n * @param {EditMap} editMap\n * Edit map to apply to.\n * @param {number} at\n * Index at which to apply the edit.\n * @param {number} remove\n * Count of items to remove at the index.\n * @param {Array<Event>} add\n * Items to add at the index.\n * @param {boolean} before\n * Insert `add` before existing additions at `at`, instead of after them.\n * @returns {undefined}\n * Nothing.\n */\nfunction addImplementation(editMap, at, remove, add, before) {\n if (remove === 0 && add.length === 0) {\n return;\n }\n const existing = editMap.index.get(at);\n if (existing) {\n existing[1] += remove;\n if (before) {\n add.push(...existing[2]);\n existing[2] = add;\n } else {\n existing[2].push(...add);\n }\n return;\n }\n\n /** @type {Change} */\n const change = [at, remove, add];\n editMap.map.push(change);\n editMap.index.set(at, change);\n}\n\n// /**\n// * Shift `previous` and `next` links according to `jumps`.\n// *\n// * This fixes links in case there are events removed or added between them.\n// *\n// * @param {Array<Event>} events\n// * @param {Array<Jump>} jumps\n// */\n// function shiftLinks(events, jumps) {\n// let jumpIndex = 0\n// let index = 0\n// let add = 0\n// let rm = 0\n\n// while (index < events.length) {\n// const rmCurr = rm\n\n// while (jumpIndex < jumps.length && jumps[jumpIndex][0] <= index) {\n// add = jumps[jumpIndex][2]\n// rm = jumps[jumpIndex][1]\n// jumpIndex += 1\n// }\n\n// // Ignore items that will be removed.\n// if (rm > rmCurr) {\n// index += rm - rmCurr\n// } else {\n// // ?\n// // if let Some(link) = &events[index].link {\n// // if let Some(next) = link.next {\n// // events[next].link.as_mut().unwrap().previous = Some(index + add - rm);\n// // while jumpIndex < jumps.len() && jumps[jumpIndex].0 <= next {\n// // add = jumps[jumpIndex].2;\n// // rm = jumps[jumpIndex].1;\n// // jumpIndex += 1;\n// // }\n// // events[index].link.as_mut().unwrap().next = Some(next + add - rm);\n// // index = next;\n// // continue;\n// // }\n// // }\n// index += 1\n// }\n// }\n// }","/**\n * @import {\n * Code,\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { EditMap } from 'micromark-util-edit-map';\n/** @type {Construct} */\nexport const setextUnderline = {\n name: 'setextUnderline',\n resolveTo: resolveToSetextUnderline,\n tokenize: tokenizeSetextUnderline\n};\n\n/** @type {Resolver} */\nfunction resolveToSetextUnderline(events, context) {\n const editMap = new EditMap();\n let index = events.length;\n /** @type {number | undefined} */\n let content;\n /** @type {number | undefined} */\n let text;\n /** @type {number | undefined} */\n let definition;\n\n // Find the opening of the content.\n // It’ll always exist: we don’t tokenize if it isn’t there.\n while (index--) {\n if (events[index][0] === 'enter') {\n if (events[index][1].type === \"content\") {\n content = index;\n break;\n }\n if (events[index][1].type === \"paragraph\") {\n text = index;\n }\n }\n // Exit\n else {\n if (events[index][1].type === \"content\") {\n // Remove the content end (if needed we’ll add it later)\n editMap.add(index, 1, []);\n }\n if (!definition && events[index][1].type === \"definition\") {\n definition = index;\n }\n }\n }\n const heading = {\n type: \"setextHeading\",\n start: {\n ...events[content][1].start\n },\n end: {\n ...events[events.length - 1][1].end\n }\n };\n\n // Change the paragraph to setext heading text.\n events[text][1].type = \"setextHeadingText\";\n\n // If we have definitions in the content, we’ll keep on having content,\n // but we need move it.\n if (definition) {\n editMap.add(text, 0, [['enter', heading, context]]);\n editMap.add(definition + 1, 0, [['exit', events[content][1], context]]);\n events[content][1].end = {\n ...events[definition][1].end\n };\n } else {\n events[content][1] = heading;\n }\n\n // Add the heading exit at the end.\n editMap.add(events.length, 0, [['exit', heading, context]]);\n editMap.consume(events);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeSetextUnderline(effects, ok, nok) {\n const self = this;\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * At start of heading (setext) underline.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n let index = self.events.length;\n /** @type {boolean | undefined} */\n let paragraph;\n // Find an opening.\n while (index--) {\n // Skip enter/exit of line ending, line prefix, and content.\n // We can now either have a definition or a paragraph.\n if (self.events[index][1].type !== \"lineEnding\" && self.events[index][1].type !== \"linePrefix\" && self.events[index][1].type !== \"content\") {\n paragraph = self.events[index][1].type === \"paragraph\";\n break;\n }\n }\n\n // To do: handle lazy/pierce like `markdown-rs`.\n // To do: parse indent like `markdown-rs`.\n if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph)) {\n effects.enter(\"setextHeadingLine\");\n marker = code;\n return before(code);\n }\n return nok(code);\n }\n\n /**\n * After optional whitespace, at `-` or `=`.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter(\"setextHeadingLineSequence\");\n return inside(code);\n }\n\n /**\n * In sequence.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code);\n return inside;\n }\n effects.exit(\"setextHeadingLineSequence\");\n return markdownSpace(code) ? factorySpace(effects, after, \"lineSuffix\")(code) : after(code);\n }\n\n /**\n * After sequence, after optional whitespace.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"setextHeadingLine\");\n return ok(code);\n }\n return nok(code);\n }\n}","/**\n * @import {\n * InitialConstruct,\n * Initializer,\n * State,\n * TokenizeContext,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {InitialConstruct} */\nexport const content = {\n tokenize: initializeContent\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Initializer}\n * Content.\n */\nfunction initializeContent(effects) {\n const contentStart = effects.attempt(this.parser.constructs.contentInitial, afterContentStartConstruct, paragraphInitial);\n /** @type {Token} */\n let previous;\n return contentStart;\n\n /** @type {State} */\n function afterContentStartConstruct(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, contentStart, \"linePrefix\");\n }\n\n /** @type {State} */\n function paragraphInitial(code) {\n effects.enter(\"paragraph\");\n return lineStart(code);\n }\n\n /** @type {State} */\n function lineStart(code) {\n const token = effects.enter(\"chunkText\", {\n contentType: \"text\",\n previous\n });\n if (previous) {\n previous.next = token;\n }\n previous = token;\n return data(code);\n }\n\n /** @type {State} */\n function data(code) {\n if (code === null) {\n effects.exit(\"chunkText\");\n effects.exit(\"paragraph\");\n effects.consume(code);\n return;\n }\n if (markdownLineEnding(code)) {\n effects.consume(code);\n effects.exit(\"chunkText\");\n return lineStart;\n }\n\n // Data.\n effects.consume(code);\n return data;\n }\n}","/**\n * @import {\n * Construct,\n * ContainerState,\n * InitialConstruct,\n * Initializer,\n * Point,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\n/**\n * @typedef {[Construct, ContainerState]} StackItem\n * Construct and its state.\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { EditMap } from 'micromark-util-edit-map';\n/** @type {InitialConstruct} */\nexport const document = {\n tokenize: initializeDocument\n};\n\n/** @type {Construct} */\nconst containerConstruct = {\n tokenize: tokenizeContainer\n};\n\n/**\n * @this {TokenizeContext}\n * Self.\n * @type {Initializer}\n * Initializer.\n */\nfunction initializeDocument(effects) {\n const self = this;\n /** @type {Array<StackItem>} */\n const stack = [];\n let continued = 0;\n /** @type {TokenizeContext | undefined} */\n let childFlow;\n /** @type {Token | undefined} */\n let childToken;\n /** @type {number} */\n let lineStartOffset;\n return start;\n\n /** @type {State} */\n function start(code) {\n // First we iterate through the open blocks, starting with the root\n // document, and descending through last children down to the last open\n // block.\n // Each block imposes a condition that the line must satisfy if the block is\n // to remain open.\n // For example, a block quote requires a `>` character.\n // A paragraph requires a non-blank line.\n // In this phase we may match all or just some of the open blocks.\n // But we cannot close unmatched blocks yet, because we may have a lazy\n // continuation line.\n if (continued < stack.length) {\n const item = stack[continued];\n self.containerState = item[1];\n return effects.attempt(item[0].continuation, documentContinue, checkNewContainers)(code);\n }\n\n // Done.\n return checkNewContainers(code);\n }\n\n /** @type {State} */\n function documentContinue(code) {\n continued++;\n\n // Note: this field is called `_closeFlow` but it also closes containers.\n // Perhaps a good idea to rename it but it’s already used in the wild by\n // extensions.\n if (self.containerState._closeFlow) {\n self.containerState._closeFlow = undefined;\n if (childFlow) {\n closeFlow();\n }\n\n // Note: this algorithm for moving events around is similar to the\n // algorithm when dealing with lazy lines in `writeToChild`.\n const indexBeforeExits = self.events.length;\n let indexBeforeFlow = indexBeforeExits;\n /** @type {Point | undefined} */\n let point;\n\n // Find the flow chunk.\n while (indexBeforeFlow--) {\n if (self.events[indexBeforeFlow][0] === 'exit' && self.events[indexBeforeFlow][1].type === \"chunkFlow\") {\n point = self.events[indexBeforeFlow][1].end;\n break;\n }\n }\n exitContainers(continued);\n\n // Fix positions.\n let index = indexBeforeExits;\n while (index < self.events.length) {\n self.events[index][1].end = {\n ...point\n };\n index++;\n }\n const editMap = new EditMap();\n // Inject the exits earlier (they’re still also at the end).\n editMap.add(indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));\n // Discard the duplicate exits.\n editMap.add(indexBeforeExits, index - indexBeforeExits, []);\n editMap.consume(self.events);\n return checkNewContainers(code);\n }\n return start(code);\n }\n\n /** @type {State} */\n function checkNewContainers(code) {\n // Next, after consuming the continuation markers for existing blocks, we\n // look for new block starts (e.g. `>` for a block quote).\n // If we encounter a new block start, we close any blocks unmatched in\n // step 1 before creating the new block as a child of the last matched\n // block.\n if (continued === stack.length) {\n // No need to `check` whether there’s a container, of `exitContainers`\n // would be moot.\n // We can instead immediately `attempt` to parse one.\n if (!childFlow) {\n return documentContinued(code);\n }\n\n // If we have concrete content, such as block HTML or fenced code,\n // we can’t have containers “pierce” into them, so we can immediately\n // start.\n if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) {\n return flowStart(code);\n }\n\n // If we do have flow, it could still be a blank line,\n // but we’d be interrupting it w/ a new container if there’s a current\n // construct.\n // To do: next major: remove `_gfmTableDynamicInterruptHack` (no longer\n // needed in micromark-extension-gfm-table@1.0.6).\n self.interrupt = Boolean(childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack);\n }\n\n // Check if there is a new container.\n self.containerState = {};\n return effects.check(containerConstruct, thereIsANewContainer, thereIsNoNewContainer)(code);\n }\n\n /** @type {State} */\n function thereIsANewContainer(code) {\n if (childFlow) {\n closeFlow();\n }\n exitContainers(continued);\n return documentContinued(code);\n }\n\n /** @type {State} */\n function thereIsNoNewContainer(code) {\n self.parser.lazy[self.now().line] = continued !== stack.length;\n lineStartOffset = self.now().offset;\n return flowStart(code);\n }\n\n /** @type {State} */\n function documentContinued(code) {\n // Try new containers.\n self.containerState = {};\n return effects.attempt(containerConstruct, containerContinue, flowStart)(code);\n }\n\n /** @type {State} */\n function containerContinue(code) {\n continued++;\n stack.push([self.currentConstruct, self.containerState]);\n // Try another.\n return documentContinued(code);\n }\n\n /** @type {State} */\n function flowStart(code) {\n if (code === null) {\n if (childFlow) {\n closeFlow();\n }\n exitContainers(0);\n effects.consume(code);\n return;\n }\n childFlow = childFlow || self.parser.flow(self.now());\n effects.enter(\"chunkFlow\", {\n _tokenizer: childFlow,\n contentType: \"flow\",\n previous: childToken\n });\n return flowContinue(code);\n }\n\n /** @type {State} */\n function flowContinue(code) {\n if (code === null) {\n writeToChild(effects.exit(\"chunkFlow\"), true);\n exitContainers(0);\n effects.consume(code);\n return;\n }\n if (markdownLineEnding(code)) {\n effects.consume(code);\n writeToChild(effects.exit(\"chunkFlow\"));\n // Get ready for the next line.\n continued = 0;\n self.interrupt = undefined;\n return start;\n }\n effects.consume(code);\n return flowContinue;\n }\n\n /**\n * @param {Token} token\n * Token.\n * @param {boolean | undefined} [endOfFile]\n * Whether the token is at the end of the file (default: `false`).\n * @returns {undefined}\n * Nothing.\n */\n function writeToChild(token, endOfFile) {\n const stream = self.sliceStream(token);\n if (endOfFile) {\n stream.push(null);\n }\n token.previous = childToken;\n if (childToken) {\n childToken.next = token;\n }\n childToken = token;\n childFlow.defineSkip(token.start);\n childFlow.write(stream);\n\n // Alright, so we just added a lazy line:\n //\n // ```markdown\n // > a\n // b.\n //\n // Or:\n //\n // > ~~~c\n // d\n //\n // Or:\n //\n // > | e |\n // f\n // ```\n //\n // The construct in the second example (fenced code) does not accept lazy\n // lines, so it marked itself as done at the end of its first line, and\n // then the content construct parses `d`.\n // Most constructs in markdown match on the first line: if the first line\n // forms a construct, a non-lazy line can’t “unmake” it.\n //\n // The construct in the third example is potentially a GFM table, and\n // those are *weird*.\n // It *could* be a table, from the first line, if the following line\n // matches a condition.\n // In this case, that second line is lazy, which “unmakes” the first line\n // and turns the whole into one content block.\n //\n // We’ve now parsed the non-lazy and the lazy line, and can figure out\n // whether the lazy line started a new flow block.\n // If it did, we exit the current containers between the two flow blocks.\n if (self.parser.lazy[token.start.line]) {\n let index = childFlow.events.length;\n while (index--) {\n if (\n // The token starts before the line ending…\n childFlow.events[index][1].start.offset < lineStartOffset && (\n // …and either is not ended yet…\n !childFlow.events[index][1].end ||\n // …or ends after it.\n childFlow.events[index][1].end.offset > lineStartOffset)) {\n // Exit: there’s still something open, which means it’s a lazy line\n // part of something.\n return;\n }\n }\n\n // Note: this algorithm for moving events around is similar to the\n // algorithm when closing flow in `documentContinue`.\n const indexBeforeExits = self.events.length;\n let indexBeforeFlow = indexBeforeExits;\n /** @type {boolean | undefined} */\n let seen;\n /** @type {Point | undefined} */\n let point;\n\n // Find the previous chunk (the one before the lazy line).\n while (indexBeforeFlow--) {\n if (self.events[indexBeforeFlow][0] === 'exit' && self.events[indexBeforeFlow][1].type === \"chunkFlow\") {\n if (seen) {\n point = self.events[indexBeforeFlow][1].end;\n break;\n }\n seen = true;\n }\n }\n exitContainers(continued);\n\n // Fix positions.\n index = indexBeforeExits;\n while (index < self.events.length) {\n self.events[index][1].end = {\n ...point\n };\n index++;\n }\n const editMap = new EditMap();\n // Inject the exits earlier (they’re still also at the end).\n editMap.add(indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));\n // Discard the duplicate exits.\n editMap.add(indexBeforeExits, index - indexBeforeExits, []);\n editMap.consume(self.events);\n }\n }\n\n /**\n * @param {number} size\n * Size.\n * @returns {undefined}\n * Nothing.\n */\n function exitContainers(size) {\n let index = stack.length;\n\n // Exit open containers.\n while (index-- > size) {\n const entry = stack[index];\n self.containerState = entry[1];\n entry[0].exit.call(self, effects);\n }\n stack.length = size;\n }\n function closeFlow() {\n childFlow.write([null]);\n childToken = undefined;\n childFlow = undefined;\n self.containerState._closeFlow = undefined;\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n * Tokenizer.\n */\nfunction tokenizeContainer(effects, ok, nok) {\n // Always populated by defaults.\n\n return factorySpace(effects, effects.attempt(this.parser.constructs.document, ok, nok), \"linePrefix\", this.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4);\n}","/**\n * @import {\n * InitialConstruct,\n * Initializer,\n * State,\n * TokenizeContext\n * } from 'micromark-util-types'\n */\n\nimport { blankLine, content } from 'micromark-core-commonmark';\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {InitialConstruct} */\nexport const flow = {\n tokenize: initializeFlow\n};\n\n/**\n * @this {TokenizeContext}\n * Self.\n * @type {Initializer}\n * Initializer.\n */\nfunction initializeFlow(effects) {\n const self = this;\n const initial = effects.attempt(\n // Try to parse a blank line.\n blankLine, atBlankEnding,\n // Try to parse initial flow (essentially, only code).\n effects.attempt(this.parser.constructs.flowInitial, afterConstruct, factorySpace(effects, effects.attempt(this.parser.constructs.flow, afterConstruct, effects.attempt(content, afterConstruct)), \"linePrefix\")));\n return initial;\n\n /** @type {State} */\n function atBlankEnding(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEndingBlank\");\n effects.consume(code);\n effects.exit(\"lineEndingBlank\");\n self.currentConstruct = undefined;\n return initial;\n }\n\n /** @type {State} */\n function afterConstruct(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n self.currentConstruct = undefined;\n return initial;\n }\n}","/**\n * @import {\n * Code,\n * InitialConstruct,\n * Initializer,\n * Resolver,\n * State,\n * TokenizeContext\n * } from 'micromark-util-types'\n */\n\nimport { EditMap } from 'micromark-util-edit-map';\nexport const resolver = {\n resolveAll: createResolver()\n};\nexport const string = initializeFactory('string');\nexport const text = initializeFactory('text');\n\n/**\n * @param {'string' | 'text'} field\n * Field.\n * @returns {InitialConstruct}\n * Construct.\n */\nfunction initializeFactory(field) {\n return {\n resolveAll: createResolver(field === 'text' ? resolveAllLineSuffixes : undefined),\n tokenize: initializeText\n };\n\n /**\n * @this {TokenizeContext}\n * Context.\n * @type {Initializer}\n */\n function initializeText(effects) {\n const self = this;\n const constructs = this.parser.constructs[field];\n const text = effects.attempt(constructs, start, notText);\n return start;\n\n /** @type {State} */\n function start(code) {\n return atBreak(code) ? text(code) : notText(code);\n }\n\n /** @type {State} */\n function notText(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"data\");\n effects.consume(code);\n return data;\n }\n\n /** @type {State} */\n function data(code) {\n if (atBreak(code)) {\n effects.exit(\"data\");\n return text(code);\n }\n\n // Data.\n effects.consume(code);\n return data;\n }\n\n /**\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether the code is a break.\n */\n function atBreak(code) {\n if (code === null) {\n return true;\n }\n const list = constructs[code];\n let index = -1;\n if (list) {\n // Always populated by defaults.\n\n while (++index < list.length) {\n const item = list[index];\n if (!item.previous || item.previous.call(self, self.previous)) {\n return true;\n }\n }\n }\n return false;\n }\n }\n}\n\n/**\n * @param {Resolver | undefined} [extraResolver]\n * Resolver.\n * @returns {Resolver}\n * Resolver.\n */\nfunction createResolver(extraResolver) {\n return resolveAllText;\n\n /** @type {Resolver} */\n function resolveAllText(events, context) {\n let index = -1;\n /** @type {number | undefined} */\n let enter;\n\n // A rather boring computation (to merge adjacent `data` events) which\n // improves mm performance by 29%.\n while (++index <= events.length) {\n if (enter === undefined) {\n if (events[index] && events[index][1].type === \"data\") {\n enter = index;\n index++;\n }\n } else if (!events[index] || events[index][1].type !== \"data\") {\n // Don’t do anything if there is one data token.\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end;\n events.splice(enter + 2, index - enter - 2);\n index = enter + 2;\n }\n enter = undefined;\n }\n }\n return extraResolver ? extraResolver(events, context) : events;\n }\n}\n\n/**\n * A rather ugly set of instructions which again looks at chunks in the input\n * stream.\n * The reason to do this here is that it is *much* faster to parse in reverse.\n * And that we can’t hook into `null` to split the line suffix before an EOF.\n * To do: figure out if we can make this into a clean utility, or even in core.\n * As it will be useful for GFMs literal autolink extension (and maybe even\n * tables?)\n *\n * @type {Resolver}\n */\nfunction resolveAllLineSuffixes(events, context) {\n const editMap = new EditMap();\n let eventIndex = 0; // Skip first.\n\n while (++eventIndex <= events.length) {\n if ((eventIndex === events.length || events[eventIndex][1].type === \"lineEnding\") && events[eventIndex - 1][1].type === \"data\") {\n const data = events[eventIndex - 1][1];\n const chunks = context.sliceStream(data);\n let index = chunks.length;\n let bufferIndex = -1;\n let size = 0;\n /** @type {boolean | undefined} */\n let tabs;\n while (index--) {\n const chunk = chunks[index];\n if (typeof chunk === 'string') {\n bufferIndex = chunk.length;\n while (chunk.charCodeAt(bufferIndex - 1) === 32) {\n size++;\n bufferIndex--;\n }\n if (bufferIndex) {\n break;\n }\n bufferIndex = -1;\n }\n // Number\n else if (chunk === -2) {\n tabs = true;\n size++;\n } else if (chunk === -1) {\n // Empty\n } else {\n // Replacement character, exit.\n index++;\n break;\n }\n }\n\n // Allow final trailing whitespace.\n if (context._contentTypeTextTrailing && eventIndex === events.length) {\n size = 0;\n }\n if (size) {\n const token = {\n type: eventIndex === events.length || tabs || size < 2 ? \"lineSuffix\" : \"hardBreakTrailing\",\n start: {\n _bufferIndex: index ? bufferIndex : data.start._bufferIndex + bufferIndex,\n _index: data.start._index + index,\n line: data.end.line,\n column: data.end.column - size,\n offset: data.end.offset - size\n },\n end: {\n ...data.end\n }\n };\n data.end = {\n ...token.start\n };\n if (data.start.offset === data.end.offset) {\n Object.assign(data, token);\n } else {\n editMap.add(eventIndex, 0, [['enter', token, context], ['exit', token, context]]);\n }\n }\n eventIndex++;\n }\n }\n editMap.consume(events);\n return events;\n}","/**\n * @import {Extension} from 'micromark-util-types'\n */\n\nimport { attention, autolink, blockQuote, characterEscape, characterReference, codeFenced, codeIndented, codeText, definition, hardBreakEscape, headingAtx, htmlFlow, htmlText, labelEnd, labelStartImage, labelStartLink, lineEnding, list, setextUnderline, thematicBreak } from 'micromark-core-commonmark';\nimport { resolver as resolveText } from './initialize/text.js';\n\n/** @satisfies {Extension['document']} */\nexport const document = {\n [42]: list,\n [43]: list,\n [45]: list,\n [48]: list,\n [49]: list,\n [50]: list,\n [51]: list,\n [52]: list,\n [53]: list,\n [54]: list,\n [55]: list,\n [56]: list,\n [57]: list,\n [62]: blockQuote\n};\n\n/** @satisfies {Extension['contentInitial']} */\nexport const contentInitial = {\n [91]: definition\n};\n\n/** @satisfies {Extension['flowInitial']} */\nexport const flowInitial = {\n [-2]: codeIndented,\n [-1]: codeIndented,\n [32]: codeIndented\n};\n\n/** @satisfies {Extension['flow']} */\nexport const flow = {\n [35]: headingAtx,\n [42]: thematicBreak,\n [45]: [setextUnderline, thematicBreak],\n [60]: htmlFlow,\n [61]: setextUnderline,\n [95]: thematicBreak,\n [96]: codeFenced,\n [126]: codeFenced\n};\n\n/** @satisfies {Extension['string']} */\nexport const string = {\n [38]: characterReference,\n [92]: characterEscape\n};\n\n/** @satisfies {Extension['text']} */\nexport const text = {\n [-5]: lineEnding,\n [-4]: lineEnding,\n [-3]: lineEnding,\n [33]: labelStartImage,\n [38]: characterReference,\n [42]: attention,\n [60]: [autolink, htmlText],\n [91]: labelStartLink,\n [92]: [hardBreakEscape, characterEscape],\n [93]: labelEnd,\n [95]: attention,\n [96]: codeText\n};\n\n/** @satisfies {Extension['insideSpan']} */\nexport const insideSpan = {\n null: [attention, resolveText]\n};\n\n/** @satisfies {Extension['attentionMarkers']} */\nexport const attentionMarkers = {\n null: [42, 95]\n};\n\n/** @satisfies {Extension['disable']} */\nexport const disable = {\n null: []\n};","/**\n * @import {\n * Chunk,\n * Code,\n * ConstructRecord,\n * Construct,\n * Effects,\n * InitialConstruct,\n * ParseContext,\n * Point,\n * State,\n * TokenizeContext,\n * Token\n * } from 'micromark-util-types'\n */\n\n/**\n * @callback Restore\n * Restore the state.\n * @returns {undefined}\n * Nothing.\n *\n * @typedef Info\n * Info.\n * @property {Restore} restore\n * Restore.\n * @property {number} from\n * From.\n *\n * @callback ReturnHandle\n * Handle a successful run.\n * @param {Construct} construct\n * Construct.\n * @param {Info} info\n * Info.\n * @returns {undefined}\n * Nothing.\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { push, splice } from 'micromark-util-chunked';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/**\n * Create a tokenizer.\n * Tokenizers deal with one type of data (e.g., containers, flow, text).\n * The parser is the object dealing with it all.\n * `initialize` works like other constructs, except that only its `tokenize`\n * function is used, in which case it doesn’t receive an `ok` or `nok`.\n * `from` can be given to set the point before the first character, although\n * when further lines are indented, they must be set with `defineSkip`.\n *\n * @param {ParseContext} parser\n * Parser.\n * @param {InitialConstruct} initialize\n * Construct.\n * @param {Omit<Point, '_bufferIndex' | '_index'> | undefined} [from]\n * Point (optional).\n * @returns {TokenizeContext}\n * Context.\n */\nexport function createTokenizer(parser, initialize, from) {\n /** @type {Point} */\n let point = {\n _bufferIndex: -1,\n _index: 0,\n line: from && from.line || 1,\n column: from && from.column || 1,\n offset: from && from.offset || 0\n };\n /** @type {Record<string, number>} */\n const columnStart = {};\n /** @type {Array<Construct>} */\n const resolveAllConstructs = [];\n /** @type {Array<Chunk>} */\n let chunks = [];\n /** @type {Array<Token>} */\n let stack = [];\n /** @type {boolean | undefined} */\n let consumed = true;\n\n /**\n * Tools used for tokenizing.\n *\n * @type {Effects}\n */\n const effects = {\n attempt: constructFactory(onsuccessfulconstruct),\n check: constructFactory(onsuccessfulcheck),\n consume,\n enter,\n exit,\n interrupt: constructFactory(onsuccessfulcheck, {\n interrupt: true\n })\n };\n\n /**\n * State and tools for resolving and serializing.\n *\n * @type {TokenizeContext}\n */\n const context = {\n code: null,\n containerState: {},\n defineSkip,\n events: [],\n now,\n parser,\n previous: null,\n sliceSerialize,\n sliceStream,\n write\n };\n\n /**\n * The state function.\n *\n * @type {State | undefined}\n */\n let state = initialize.tokenize.call(context, effects);\n\n /**\n * Track which character we expect to be consumed, to catch bugs.\n *\n * @type {Code}\n */\n let expectedCode;\n if (initialize.resolveAll) {\n resolveAllConstructs.push(initialize);\n }\n return context;\n\n /** @type {TokenizeContext['write']} */\n function write(slice) {\n chunks = push(chunks, slice);\n main();\n\n // Exit if we’re not done, resolve might change stuff.\n if (chunks[chunks.length - 1] !== null) {\n return [];\n }\n addResult(initialize, 0);\n\n // Otherwise, resolve, and exit.\n context.events = resolveAll(resolveAllConstructs, context.events, context);\n return context.events;\n }\n\n //\n // Tools.\n //\n\n /** @type {TokenizeContext['sliceSerialize']} */\n function sliceSerialize(token, expandTabs) {\n return serializeChunks(sliceStream(token), expandTabs);\n }\n\n /** @type {TokenizeContext['sliceStream']} */\n function sliceStream(token) {\n return sliceChunks(chunks, token);\n }\n\n /** @type {TokenizeContext['now']} */\n function now() {\n // This is a hot path, so we clone manually instead of `Object.assign({}, point)`\n const {\n _bufferIndex,\n _index,\n line,\n column,\n offset\n } = point;\n return {\n _bufferIndex,\n _index,\n line,\n column,\n offset\n };\n }\n\n /** @type {TokenizeContext['defineSkip']} */\n function defineSkip(value) {\n columnStart[value.line] = value.column;\n accountForPotentialSkip();\n }\n\n //\n // State management.\n //\n\n /**\n * Main loop (note that `_index` and `_bufferIndex` in `point` are modified by\n * `consume`).\n * Here is where we walk through the chunks, which either include strings of\n * several characters, or numerical character codes.\n * The reason to do this in a loop instead of a call is so the stack can\n * drain.\n *\n * @returns {undefined}\n * Nothing.\n */\n function main() {\n while (point._index < chunks.length) {\n const chunk = chunks[point._index];\n\n // If we’re in a buffer chunk, loop through it.\n if (typeof chunk === 'string') {\n const chunkIndex = point._index;\n if (point._bufferIndex < 0) {\n point._bufferIndex = 0;\n }\n while (point._index === chunkIndex && point._bufferIndex < chunk.length) {\n go(chunk.charCodeAt(point._bufferIndex));\n }\n } else {\n go(chunk);\n }\n }\n }\n\n /**\n * Deal with one code.\n *\n * @param {Code} code\n * Code.\n * @returns {undefined}\n * Nothing.\n */\n function go(code) {\n consumed = undefined;\n expectedCode = code;\n state = state(code);\n }\n\n /** @type {Effects['consume']} */\n function consume(code) {\n if (markdownLineEnding(code)) {\n point.line++;\n point.column = 1;\n point.offset += code === -3 ? 2 : 1;\n accountForPotentialSkip();\n } else if (code !== -1) {\n point.column++;\n point.offset++;\n }\n\n // Not in a string chunk.\n if (point._bufferIndex < 0) {\n point._index++;\n } else {\n point._bufferIndex++;\n\n // At end of string chunk.\n if (point._bufferIndex ===\n // Points w/ non-negative `_bufferIndex` reference\n // strings.\n /** @type {string} */\n chunks[point._index].length) {\n point._bufferIndex = -1;\n point._index++;\n }\n }\n\n // Expose the previous character.\n context.previous = code;\n\n // Mark as consumed.\n consumed = true;\n }\n\n /** @type {Effects['enter']} */\n function enter(type, fields) {\n /** @type {Token} */\n // @ts-expect-error Patch instead of assign required fields to help GC.\n const token = fields || {};\n token.type = type;\n token.start = now();\n context.events.push(['enter', token, context]);\n stack.push(token);\n return token;\n }\n\n /** @type {Effects['exit']} */\n function exit(type) {\n const token = stack.pop();\n token.end = now();\n context.events.push(['exit', token, context]);\n return token;\n }\n\n /**\n * Use results.\n *\n * @type {ReturnHandle}\n */\n function onsuccessfulconstruct(construct, info) {\n addResult(construct, info.from);\n }\n\n /**\n * Discard results.\n *\n * @type {ReturnHandle}\n */\n function onsuccessfulcheck(_, info) {\n info.restore();\n }\n\n /**\n * Factory to attempt/check/interrupt.\n *\n * @param {ReturnHandle} onreturn\n * Callback.\n * @param {{interrupt?: boolean | undefined} | undefined} [fields]\n * Fields.\n */\n function constructFactory(onreturn, fields) {\n return hook;\n\n /**\n * Handle either an object mapping codes to constructs, a list of\n * constructs, or a single construct.\n *\n * @param {Array<Construct> | ConstructRecord | Construct} constructs\n * Constructs.\n * @param {State} returnState\n * State.\n * @param {State | undefined} [bogusState]\n * State.\n * @returns {State}\n * State.\n */\n function hook(constructs, returnState, bogusState) {\n /** @type {ReadonlyArray<Construct>} */\n let listOfConstructs;\n /** @type {number} */\n let constructIndex;\n /** @type {Construct} */\n let currentConstruct;\n /** @type {Info} */\n let info;\n return Array.isArray(constructs) ? /* c8 ignore next 1 */\n handleListOfConstructs(constructs) : 'tokenize' in constructs ?\n // Looks like a construct.\n handleListOfConstructs([(/** @type {Construct} */constructs)]) : handleMapOfConstructs(constructs);\n\n /**\n * Handle a list of construct.\n *\n * @param {ConstructRecord} map\n * Constructs.\n * @returns {State}\n * State.\n */\n function handleMapOfConstructs(map) {\n return start;\n\n /** @type {State} */\n function start(code) {\n const left = code !== null && map[code];\n const all = code !== null && map.null;\n const list = [\n // To do: add more extension tests.\n /* c8 ignore next 2 */\n ...(Array.isArray(left) ? left : left ? [left] : []), ...(Array.isArray(all) ? all : all ? [all] : [])];\n return handleListOfConstructs(list)(code);\n }\n }\n\n /**\n * Handle a list of construct.\n *\n * @param {ReadonlyArray<Construct>} list\n * Constructs.\n * @returns {State}\n * State.\n */\n function handleListOfConstructs(list) {\n listOfConstructs = list;\n constructIndex = 0;\n if (list.length === 0) {\n return bogusState;\n }\n return handleConstruct(list[constructIndex]);\n }\n\n /**\n * Handle a single construct.\n *\n * @param {Construct} construct\n * Construct.\n * @returns {State}\n * State.\n */\n function handleConstruct(construct) {\n return start;\n\n /** @type {State} */\n function start(code) {\n // To do: not needed to store if there is no bogus state, probably?\n // Currently doesn’t work because `inspect` in document does a check\n // w/o a bogus, which doesn’t make sense. But it does seem to help perf\n // by not storing.\n info = store();\n currentConstruct = construct;\n if (!construct.partial) {\n context.currentConstruct = construct;\n }\n\n // Always populated by defaults.\n\n if (construct.name && context.parser.constructs.disable.null.includes(construct.name)) {\n return nok(code);\n }\n return construct.tokenize.call(\n // If we do have fields, create an object w/ `context` as its\n // prototype.\n // This allows a “live binding”, which is needed for `interrupt`.\n fields ? Object.assign(Object.create(context), fields) : context, effects, ok, nok)(code);\n }\n }\n\n /** @type {State} */\n function ok(code) {\n consumed = true;\n onreturn(currentConstruct, info);\n return returnState;\n }\n\n /** @type {State} */\n function nok(code) {\n consumed = true;\n info.restore();\n if (++constructIndex < listOfConstructs.length) {\n return handleConstruct(listOfConstructs[constructIndex]);\n }\n return bogusState;\n }\n }\n }\n\n /**\n * @param {Construct} construct\n * Construct.\n * @param {number} from\n * From.\n * @returns {undefined}\n * Nothing.\n */\n function addResult(construct, from) {\n if (construct.resolveAll && !resolveAllConstructs.includes(construct)) {\n resolveAllConstructs.push(construct);\n }\n if (construct.resolve) {\n splice(context.events, from, context.events.length - from, construct.resolve(context.events.slice(from), context));\n }\n if (construct.resolveTo) {\n context.events = construct.resolveTo(context.events, context);\n }\n }\n\n /**\n * Store state.\n *\n * @returns {Info}\n * Info.\n */\n function store() {\n const startPoint = now();\n const startPrevious = context.previous;\n const startCurrentConstruct = context.currentConstruct;\n const startEventsIndex = context.events.length;\n const startStack = Array.from(stack);\n return {\n from: startEventsIndex,\n restore\n };\n\n /**\n * Restore state.\n *\n * @returns {undefined}\n * Nothing.\n */\n function restore() {\n point = startPoint;\n context.previous = startPrevious;\n context.currentConstruct = startCurrentConstruct;\n context.events.length = startEventsIndex;\n stack = startStack;\n accountForPotentialSkip();\n }\n }\n\n /**\n * Move the current point a bit forward in the line when it’s on a column\n * skip.\n *\n * @returns {undefined}\n * Nothing.\n */\n function accountForPotentialSkip() {\n if (point.line in columnStart && point.column < 2) {\n point.column = columnStart[point.line];\n point.offset += columnStart[point.line] - 1;\n }\n }\n}\n\n/**\n * Get the chunks from a slice of chunks in the range of a token.\n *\n * @param {ReadonlyArray<Chunk>} chunks\n * Chunks.\n * @param {Pick<Token, 'end' | 'start'>} token\n * Token.\n * @returns {Array<Chunk>}\n * Chunks.\n */\nfunction sliceChunks(chunks, token) {\n const startIndex = token.start._index;\n const startBufferIndex = token.start._bufferIndex;\n const endIndex = token.end._index;\n const endBufferIndex = token.end._bufferIndex;\n /** @type {Array<Chunk>} */\n let view;\n if (startIndex === endIndex) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)];\n } else {\n view = chunks.slice(startIndex, endIndex);\n if (startBufferIndex > -1) {\n const head = view[0];\n if (typeof head === 'string') {\n view[0] = head.slice(startBufferIndex);\n /* c8 ignore next 4 -- used to be used, no longer */\n } else {\n view.shift();\n }\n }\n if (endBufferIndex > 0) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view.push(chunks[endIndex].slice(0, endBufferIndex));\n }\n }\n return view;\n}\n\n/**\n * Get the string value of a slice of chunks.\n *\n * @param {ReadonlyArray<Chunk>} chunks\n * Chunks.\n * @param {boolean | undefined} [expandTabs=false]\n * Whether to expand tabs (default: `false`).\n * @returns {string}\n * Result.\n */\nfunction serializeChunks(chunks, expandTabs) {\n let index = -1;\n /** @type {Array<string>} */\n const result = [];\n /** @type {boolean | undefined} */\n let atTab;\n while (++index < chunks.length) {\n const chunk = chunks[index];\n /** @type {string} */\n let value;\n if (typeof chunk === 'string') {\n value = chunk;\n } else {\n switch (chunk) {\n case -5:\n {\n value = \"\\r\";\n break;\n }\n case -4:\n {\n value = \"\\n\";\n break;\n }\n case -3:\n {\n value = \"\\r\" + \"\\n\";\n break;\n }\n case -2:\n {\n value = expandTabs ? \" \" : \"\\t\";\n break;\n }\n case -1:\n {\n if (!expandTabs && atTab) {\n continue;\n }\n value = \" \";\n break;\n }\n default:\n {\n // Currently only replacement character.\n value = String.fromCharCode(chunk);\n }\n }\n }\n atTab = chunk === -2;\n result.push(value);\n }\n return result.join('');\n}","/**\n * @import {\n * Create,\n * FullNormalizedExtension,\n * InitialConstruct,\n * ParseContext,\n * ParseOptions\n * } from 'micromark-util-types'\n */\n\nimport { combineExtensions } from 'micromark-util-combine-extensions';\nimport { content } from './initialize/content.js';\nimport { document } from './initialize/document.js';\nimport { flow } from './initialize/flow.js';\nimport { string, text } from './initialize/text.js';\nimport * as defaultConstructs from './constructs.js';\nimport { createTokenizer } from './create-tokenizer.js';\n\n/**\n * @param {ParseOptions | null | undefined} [options]\n * Configuration (optional).\n * @returns {ParseContext}\n * Parser.\n */\nexport function parse(options) {\n const settings = options || {};\n const constructs = /** @type {FullNormalizedExtension} */\n combineExtensions([defaultConstructs, ...(settings.extensions || [])]);\n\n /** @type {ParseContext} */\n const parser = {\n constructs,\n content: create(content),\n defined: [],\n document: create(document),\n flow: create(flow),\n lazy: {},\n string: create(string),\n text: create(text)\n };\n return parser;\n\n /**\n * @param {InitialConstruct} initial\n * Construct to start with.\n * @returns {Create}\n * Create a tokenizer.\n */\n function create(initial) {\n return creator;\n /** @type {Create} */\n function creator(from) {\n return createTokenizer(parser, initial, from);\n }\n }\n}","/**\n * @import {Event} from 'micromark-util-types'\n */\n\nimport { subtokenize } from 'micromark-util-subtokenize';\n\n/**\n * @param {Array<Event>} events\n * Events.\n * @returns {Array<Event>}\n * Events.\n */\nexport function postprocess(events) {\n while (!subtokenize(events)) {\n // Empty\n }\n return events;\n}","/**\n * @import {Chunk, Code, Encoding, Value} from 'micromark-util-types'\n */\n\n/**\n * @callback Preprocessor\n * Preprocess a value.\n * @param {Value} value\n * Value.\n * @param {Encoding | null | undefined} [encoding]\n * Encoding when `value` is a typed array (optional).\n * @param {boolean | null | undefined} [end=false]\n * Whether this is the last chunk (default: `false`).\n * @returns {Array<Chunk>}\n * Chunks.\n */\n\nconst search = /[\\0\\t\\n\\r]/g;\n\n/**\n * @returns {Preprocessor}\n * Preprocess a value.\n */\nexport function preprocess() {\n let column = 1;\n let buffer = '';\n /** @type {boolean | undefined} */\n let start = true;\n /** @type {boolean | undefined} */\n let atCarriageReturn;\n return preprocessor;\n\n /** @type {Preprocessor} */\n // eslint-disable-next-line complexity\n function preprocessor(value, encoding, end) {\n value = buffer + (typeof value === 'string' ? value.toString() : new TextDecoder(encoding || undefined).decode(value));\n\n /** @type {Array<Chunk>} */\n const chunks = [];\n let startPosition = 0;\n buffer = '';\n if (start) {\n // To do: `markdown-rs` actually parses BOMs (byte order mark).\n if (value.charCodeAt(0) === 65279) {\n startPosition++;\n }\n start = undefined;\n }\n while (startPosition < value.length) {\n search.lastIndex = startPosition;\n const match = search.exec(value);\n const endPosition = match && match.index !== undefined ? match.index : value.length;\n const code = value.charCodeAt(endPosition);\n if (!match) {\n buffer = value.slice(startPosition);\n break;\n }\n if (code === 10 && startPosition === endPosition && atCarriageReturn) {\n chunks.push(-3);\n atCarriageReturn = undefined;\n } else {\n if (atCarriageReturn) {\n chunks.push(-5);\n atCarriageReturn = undefined;\n }\n if (startPosition < endPosition) {\n chunks.push(value.slice(startPosition, endPosition));\n column += endPosition - startPosition;\n }\n switch (code) {\n case 0:\n {\n chunks.push(65533);\n column++;\n break;\n }\n case 9:\n {\n const next = Math.ceil(column / 4) * 4;\n chunks.push(-2);\n while (column++ < next) {\n chunks.push(-1);\n }\n break;\n }\n case 10:\n {\n chunks.push(-4);\n column = 1;\n break;\n }\n default:\n {\n atCarriageReturn = true;\n column = 1;\n }\n }\n }\n startPosition = endPosition + 1;\n }\n if (end) {\n if (atCarriageReturn) {\n chunks.push(-5);\n }\n if (buffer) {\n chunks.push(buffer);\n }\n chunks.push(null);\n }\n return chunks;\n }\n}","/**\n * @import {\n * Break,\n * Blockquote,\n * Code,\n * Definition,\n * Emphasis,\n * Heading,\n * Html,\n * Image,\n * InlineCode,\n * Link,\n * ListItem,\n * List,\n * Nodes,\n * Paragraph,\n * PhrasingContent,\n * ReferenceType,\n * Root,\n * Strong,\n * Text,\n * ThematicBreak\n * } from 'mdast'\n * @import {\n * Encoding,\n * Event,\n * Token,\n * Value\n * } from 'micromark-util-types'\n * @import {Point} from 'unist'\n * @import {\n * CompileContext,\n * CompileData,\n * Config,\n * Extension,\n * Handle,\n * OnEnterError,\n * Options\n * } from './types.js'\n */\n\nimport { toString } from 'mdast-util-to-string';\nimport { parse, postprocess, preprocess } from 'micromark';\nimport { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';\nimport { decodeString } from 'micromark-util-decode-string';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nimport { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { stringifyPosition } from 'unist-util-stringify-position';\nconst own = {}.hasOwnProperty;\n\n/**\n * Turn markdown into a syntax tree.\n *\n * @overload\n * @param {Value} value\n * @param {Encoding | null | undefined} [encoding]\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n *\n * @overload\n * @param {Value} value\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n *\n * @param {Value} value\n * Markdown to parse.\n * @param {Encoding | Options | null | undefined} [encoding]\n * Character encoding for when `value` is `Buffer`.\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {Root}\n * mdast tree.\n */\nexport function fromMarkdown(value, encoding, options) {\n if (encoding && typeof encoding === 'object') {\n options = encoding;\n encoding = undefined;\n }\n return compiler(options)(postprocess(parse(options).document().write(preprocess()(value, encoding, true))));\n}\n\n/**\n * Note this compiler only understand complete buffering, not streaming.\n *\n * @param {Options | null | undefined} [options]\n */\nfunction compiler(options) {\n /** @type {Config} */\n const config = {\n afterExit: [],\n beforeEnter: [],\n transforms: [],\n canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'],\n enter: {\n autolink: opener(link),\n autolinkProtocol: onenterdata,\n autolinkEmail: onenterdata,\n atxHeading: opener(heading),\n blockQuote: opener(blockQuote),\n characterEscape: onenterdata,\n characterReference: onenterdata,\n codeFenced: opener(codeFlow),\n codeFencedFenceInfo: buffer,\n codeFencedFenceMeta: buffer,\n codeIndented: opener(codeFlow, buffer),\n codeText: opener(codeText, buffer),\n codeTextData: onenterdata,\n data: onenterdata,\n codeFlowValue: onenterdata,\n definition: opener(definition),\n definitionDestinationString: buffer,\n definitionLabelString: buffer,\n definitionTitleString: buffer,\n emphasis: opener(emphasis),\n hardBreakEscape: opener(hardBreak),\n hardBreakTrailing: opener(hardBreak),\n htmlFlow: opener(html, buffer),\n htmlFlowData: onenterdata,\n htmlText: opener(html, buffer),\n htmlTextData: onenterdata,\n image: opener(image),\n label: buffer,\n link: opener(link),\n listItem: opener(listItem),\n listItemValue: onenterlistitemvalue,\n listOrdered: opener(list, onenterlistordered),\n listUnordered: opener(list),\n paragraph: opener(paragraph),\n reference: onenterreference,\n referenceString: buffer,\n resourceDestinationString: buffer,\n resourceTitleString: buffer,\n setextHeading: opener(heading),\n strong: opener(strong),\n thematicBreak: opener(thematicBreak)\n },\n exit: {\n atxHeading: closer(),\n atxHeadingSequence: onexitatxheadingsequence,\n autolink: closer(),\n autolinkEmail: onexitautolinkemail,\n autolinkProtocol: onexitautolinkprotocol,\n blockQuote: closer(),\n characterEscapeValue: onexitdata,\n characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,\n characterReferenceMarkerNumeric: onexitcharacterreferencemarker,\n characterReferenceValue: onexitcharacterreferencevalue,\n characterReference: onexitcharacterreference,\n codeFenced: closer(onexitcodefenced),\n codeFencedFence: onexitcodefencedfence,\n codeFencedFenceInfo: onexitcodefencedfenceinfo,\n codeFencedFenceMeta: onexitcodefencedfencemeta,\n codeFlowValue: onexitdata,\n codeIndented: closer(onexitcodeindented),\n codeText: closer(onexitcodetext),\n codeTextData: onexitdata,\n data: onexitdata,\n definition: closer(),\n definitionDestinationString: onexitdefinitiondestinationstring,\n definitionLabelString: onexitdefinitionlabelstring,\n definitionTitleString: onexitdefinitiontitlestring,\n emphasis: closer(),\n hardBreakEscape: closer(onexithardbreak),\n hardBreakTrailing: closer(onexithardbreak),\n htmlFlow: closer(onexithtmlflow),\n htmlFlowData: onexitdata,\n htmlText: closer(onexithtmltext),\n htmlTextData: onexitdata,\n image: closer(onexitimage),\n label: onexitlabel,\n labelText: onexitlabeltext,\n lineEnding: onexitlineending,\n link: closer(onexitlink),\n listItem: closer(),\n listOrdered: closer(),\n listUnordered: closer(),\n paragraph: closer(),\n referenceString: onexitreferencestring,\n resourceDestinationString: onexitresourcedestinationstring,\n resourceTitleString: onexitresourcetitlestring,\n resource: onexitresource,\n setextHeading: closer(onexitsetextheading),\n setextHeadingLineSequence: onexitsetextheadinglinesequence,\n setextHeadingText: onexitsetextheadingtext,\n strong: closer(),\n thematicBreak: closer()\n }\n };\n configure(config, (options || {}).mdastExtensions || []);\n\n /** @type {CompileData} */\n const data = {};\n return compile;\n\n /**\n * Turn micromark events into an mdast tree.\n *\n * @param {Array<Event>} events\n * Events.\n * @returns {Root}\n * mdast tree.\n */\n function compile(events) {\n /** @type {Root} */\n let tree = {\n type: 'root',\n children: [],\n position: undefined\n };\n /** @type {Omit<CompileContext, 'sliceSerialize'>} */\n const context = {\n stack: [tree],\n tokenStack: [],\n config,\n enter,\n exit,\n buffer,\n resume,\n data\n };\n /** @type {Array<number>} */\n const listStack = [];\n /** @type {Array<Event>} */\n const prepared = [];\n let index = -1;\n\n // Add `listItem` tokens and infer spread.\n // Each list is prepared while it is last in `prepared`, so nothing shifts.\n while (++index < events.length) {\n prepared.push(events[index]);\n if (events[index][1].type === \"listOrdered\" || events[index][1].type === \"listUnordered\") {\n if (events[index][0] === 'enter') {\n listStack.push(prepared.length - 1);\n } else {\n const tail = listStack.pop();\n prepareList(prepared, tail);\n }\n }\n }\n events = prepared;\n index = -1;\n while (++index < events.length) {\n const handler = config[events[index][0]];\n if (events[index][0] === 'enter' && config.beforeEnter.length > 0) {\n callListeners(config.beforeEnter, {\n ...context,\n sliceSerialize: events[index][2].sliceSerialize\n }, events[index][1]);\n }\n if (own.call(handler, events[index][1].type)) {\n // Note: spread first, V8 has optimizations for object shape cloning.\n handler[events[index][1].type].call({\n ...context,\n sliceSerialize: events[index][2].sliceSerialize\n }, events[index][1]);\n }\n if (events[index][0] === 'exit' && config.afterExit.length > 0) {\n callListeners(config.afterExit, {\n ...context,\n sliceSerialize: events[index][2].sliceSerialize\n }, events[index][1]);\n }\n }\n\n // Handle tokens still being open.\n if (context.tokenStack.length > 0) {\n const tail = context.tokenStack[context.tokenStack.length - 1];\n const handler = tail[1] || defaultOnError;\n handler.call(context, undefined, tail[0]);\n }\n\n // Figure out `root` position.\n tree.position = {\n start: point(events.length > 0 ? events[0][1].start : {\n line: 1,\n column: 1,\n offset: 0\n }),\n end: point(events.length > 0 ? events[events.length - 2][1].end : {\n line: 1,\n column: 1,\n offset: 0\n })\n };\n\n // Call transforms.\n index = -1;\n while (++index < config.transforms.length) {\n tree = config.transforms[index](tree) || tree;\n }\n return tree;\n }\n\n /**\n * @param {Array<Handle>} listeners\n * Listeners.\n * @param {CompileContext} context\n * Context.\n * @param {Token} token\n * Token.\n * @returns {undefined}\n * Nothing.\n */\n function callListeners(listeners, context, token) {\n let index = -1;\n while (++index < listeners.length) {\n listeners[index].call(context, token);\n }\n }\n\n /**\n * @param {Array<Event>} events\n * Events, ending with the list to prepare.\n * @param {number} start\n * Index of the list enter.\n * @returns {undefined}\n */\n function prepareList(events, start) {\n const end = events.length - 1;\n let index = start - 1;\n let containerBalance = -1;\n let listSpread = false;\n /** @type {Token | undefined} */\n let listItem;\n /** @type {number | undefined} */\n let lineIndex;\n /** @type {number | undefined} */\n let firstBlankLineIndex;\n /** @type {boolean | undefined} */\n let atMarker;\n /**\n * `listItem` events to insert before the event at `at`, in walk order.\n * Merged in after the walk, as inserting while walking would shift the\n * rest of the list once per item.\n * @type {Array<{at: number, event: Event}>}\n */\n const insertions = [];\n while (++index <= end) {\n const event = events[index];\n switch (event[1].type) {\n case \"listUnordered\":\n case \"listOrdered\":\n case \"blockQuote\":\n {\n if (event[0] === 'enter') {\n containerBalance++;\n } else {\n containerBalance--;\n }\n atMarker = undefined;\n break;\n }\n case \"lineEndingBlank\":\n {\n if (event[0] === 'enter') {\n if (listItem && !atMarker && !containerBalance && !firstBlankLineIndex) {\n firstBlankLineIndex = index;\n }\n atMarker = undefined;\n }\n break;\n }\n case \"linePrefix\":\n case \"listItemValue\":\n case \"listItemMarker\":\n case \"listItemPrefix\":\n case \"listItemPrefixWhitespace\":\n {\n // Empty.\n\n break;\n }\n default:\n {\n atMarker = undefined;\n }\n }\n if (!containerBalance && event[0] === 'enter' && event[1].type === \"listItemPrefix\" || containerBalance === -1 && event[0] === 'exit' && (event[1].type === \"listUnordered\" || event[1].type === \"listOrdered\")) {\n if (listItem) {\n let tailIndex = index;\n lineIndex = undefined;\n while (tailIndex--) {\n const tailEvent = events[tailIndex];\n if (tailEvent[1].type === \"lineEnding\" || tailEvent[1].type === \"lineEndingBlank\") {\n if (tailEvent[0] === 'exit') continue;\n if (lineIndex) {\n events[lineIndex][1].type = \"lineEndingBlank\";\n listSpread = true;\n }\n tailEvent[1].type = \"lineEnding\";\n lineIndex = tailIndex;\n } else if (tailEvent[1].type === \"linePrefix\" || tailEvent[1].type === \"blockQuotePrefix\" || tailEvent[1].type === \"blockQuotePrefixWhitespace\" || tailEvent[1].type === \"blockQuoteMarker\" || tailEvent[1].type === \"listItemIndent\") {\n // Empty\n } else {\n break;\n }\n }\n if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) {\n listItem._spread = true;\n }\n\n // Fix position.\n listItem.end = Object.assign({}, lineIndex ? events[lineIndex][1].start : event[1].end);\n insertions.push({\n at: lineIndex || index,\n event: ['exit', listItem, event[2]]\n });\n }\n\n // Create a new list item.\n if (event[1].type === \"listItemPrefix\") {\n /** @type {Token} */\n const item = {\n type: 'listItem',\n _spread: false,\n start: Object.assign({}, event[1].start),\n // @ts-expect-error: we’ll add `end` in a second.\n end: undefined\n };\n listItem = item;\n insertions.push({\n at: index,\n event: ['enter', item, event[2]]\n });\n firstBlankLineIndex = undefined;\n atMarker = true;\n }\n }\n }\n\n // The list is at the end of `events`: take it off, then push it back with\n // the insertions merged in.\n // Nothing follows the list, so nothing shifts.\n const listEvents = events.splice(start);\n let insertion = 0;\n index = -1;\n while (++index < listEvents.length) {\n while (insertion < insertions.length && insertions[insertion].at === start + index) {\n events.push(insertions[insertion++].event);\n }\n events.push(listEvents[index]);\n }\n events[start][1]._spread = listSpread;\n }\n\n /**\n * Create an opener handle.\n *\n * @param {(token: Token) => Nodes} create\n * Create a node.\n * @param {Handle | undefined} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function opener(create, and) {\n return open;\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {undefined}\n */\n function open(token) {\n enter.call(this, create(token), token);\n if (and) and.call(this, token);\n }\n }\n\n /**\n * @type {CompileContext['buffer']}\n */\n function buffer() {\n this.stack.push({\n type: 'fragment',\n children: []\n });\n }\n\n /**\n * @type {CompileContext['enter']}\n */\n function enter(node, token, errorHandler) {\n const parent = this.stack[this.stack.length - 1];\n /** @type {Array<Nodes>} */\n const siblings = parent.children;\n siblings.push(node);\n this.stack.push(node);\n this.tokenStack.push([token, errorHandler || undefined]);\n node.position = {\n start: point(token.start),\n // @ts-expect-error: `end` will be patched later.\n end: undefined\n };\n }\n\n /**\n * Create a closer handle.\n *\n * @param {Handle | undefined} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function closer(and) {\n return close;\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {undefined}\n */\n function close(token) {\n if (and) and.call(this, token);\n exit.call(this, token);\n }\n }\n\n /**\n * @type {CompileContext['exit']}\n */\n function exit(token, onExitError) {\n const node = this.stack.pop();\n const open = this.tokenStack.pop();\n if (!open) {\n throw new Error('Cannot close `' + token.type + '` (' + stringifyPosition({\n start: token.start,\n end: token.end\n }) + '): it’s not open');\n }\n if (open[0].type !== token.type) {\n if (onExitError) {\n onExitError.call(this, token, open[0]);\n } else {\n const handler = open[1] || defaultOnError;\n handler.call(this, token, open[0]);\n }\n }\n node.position.end = point(token.end);\n }\n\n /**\n * @type {CompileContext['resume']}\n */\n function resume() {\n return toString(this.stack.pop());\n }\n\n //\n // Handlers.\n //\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistordered() {\n this.data.expectingFirstListItemValue = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistitemvalue(token) {\n if (this.data.expectingFirstListItemValue) {\n const ancestor = this.stack[this.stack.length - 2];\n ancestor.start = Number.parseInt(this.sliceSerialize(token), 10);\n this.data.expectingFirstListItemValue = undefined;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfenceinfo() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.lang = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfencemeta() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.meta = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfence() {\n // Exit if this is the closing fence.\n if (this.data.flowCodeInside) return;\n this.buffer();\n this.data.flowCodeInside = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefenced() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data.replace(/^(\\r?\\n|\\r)|(\\r?\\n|\\r)$/g, '');\n this.data.flowCodeInside = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodeindented() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data.replace(/(\\r?\\n|\\r)$/g, '');\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitionlabelstring(token) {\n const label = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.label = label;\n node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiontitlestring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.title = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiondestinationstring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.url = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitatxheadingsequence(token) {\n const node = this.stack[this.stack.length - 1];\n if (!node.depth) {\n const depth = this.sliceSerialize(token).length;\n node.depth = depth;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadingtext() {\n this.data.setextHeadingSlurpLineEnding = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadinglinesequence(token) {\n const node = this.stack[this.stack.length - 1];\n node.depth = this.sliceSerialize(token).codePointAt(0) === 61 ? 1 : 2;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheading() {\n this.data.setextHeadingSlurpLineEnding = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterdata(token) {\n const node = this.stack[this.stack.length - 1];\n /** @type {Array<Nodes>} */\n const siblings = node.children;\n let tail = siblings[siblings.length - 1];\n if (!tail || tail.type !== 'text') {\n // Add a new text node.\n tail = text();\n tail.position = {\n start: point(token.start),\n // @ts-expect-error: we’ll add `end` later.\n end: undefined\n };\n siblings.push(tail);\n }\n this.stack.push(tail);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitdata(token) {\n const tail = this.stack.pop();\n tail.value += this.sliceSerialize(token);\n tail.position.end = point(token.end);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlineending(token) {\n const context = this.stack[this.stack.length - 1];\n // If we’re at a hard break, include the line ending in there.\n if (this.data.atHardBreak) {\n const tail = context.children[context.children.length - 1];\n tail.position.end = point(token.end);\n this.data.atHardBreak = undefined;\n return;\n }\n if (!this.data.setextHeadingSlurpLineEnding && config.canContainEols.includes(context.type)) {\n onenterdata.call(this, token);\n onexitdata.call(this, token);\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithardbreak() {\n this.data.atHardBreak = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmlflow() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmltext() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcodetext() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlink() {\n const node = this.stack[this.stack.length - 1];\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n\n // To do: clean.\n if (this.data.inReference) {\n /** @type {ReferenceType} */\n const referenceType = this.data.referenceType || 'shortcut';\n node.type += 'Reference';\n // @ts-expect-error: mutate.\n node.referenceType = referenceType;\n // @ts-expect-error: mutate.\n delete node.url;\n delete node.title;\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier;\n // @ts-expect-error: mutate.\n delete node.label;\n }\n this.data.referenceType = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitimage() {\n const node = this.stack[this.stack.length - 1];\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n\n // To do: clean.\n if (this.data.inReference) {\n /** @type {ReferenceType} */\n const referenceType = this.data.referenceType || 'shortcut';\n node.type += 'Reference';\n // @ts-expect-error: mutate.\n node.referenceType = referenceType;\n // @ts-expect-error: mutate.\n delete node.url;\n delete node.title;\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier;\n // @ts-expect-error: mutate.\n delete node.label;\n }\n this.data.referenceType = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabeltext(token) {\n const string = this.sliceSerialize(token);\n const ancestor = this.stack[this.stack.length - 2];\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n ancestor.label = decodeString(string);\n // @ts-expect-error: same as above.\n ancestor.identifier = normalizeIdentifier(string).toLowerCase();\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabel() {\n const fragment = this.stack[this.stack.length - 1];\n const value = this.resume();\n const node = this.stack[this.stack.length - 1];\n // Assume a reference.\n this.data.inReference = true;\n if (node.type === 'link') {\n /** @type {Array<PhrasingContent>} */\n const children = fragment.children;\n node.children = children;\n } else {\n node.alt = value;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcedestinationstring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.url = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcetitlestring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.title = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresource() {\n this.data.inReference = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterreference() {\n this.data.referenceType = 'collapsed';\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitreferencestring(token) {\n const label = this.resume();\n const node = this.stack[this.stack.length - 1];\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n node.label = label;\n // @ts-expect-error: same as above.\n node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();\n this.data.referenceType = 'full';\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcharacterreferencemarker(token) {\n this.data.characterReferenceType = token.type;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcharacterreferencevalue(token) {\n const data = this.sliceSerialize(token);\n const type = this.data.characterReferenceType;\n /** @type {string} */\n let value;\n if (type) {\n value = decodeNumericCharacterReference(data, type === \"characterReferenceMarkerNumeric\" ? 10 : 16);\n this.data.characterReferenceType = undefined;\n } else {\n const result = decodeNamedCharacterReference(data);\n value = result;\n }\n const tail = this.stack[this.stack.length - 1];\n tail.value += value;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcharacterreference(token) {\n const tail = this.stack.pop();\n tail.position.end = point(token.end);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkprotocol(token) {\n onexitdata.call(this, token);\n const node = this.stack[this.stack.length - 1];\n node.url = this.sliceSerialize(token);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkemail(token) {\n onexitdata.call(this, token);\n const node = this.stack[this.stack.length - 1];\n node.url = 'mailto:' + this.sliceSerialize(token);\n }\n\n //\n // Creaters.\n //\n\n // Each node factory pre-declares `position` as undefined as the trailing\n // property. enter() patches it to a real value, but the property already\n // exists, so V8 sees a single hidden class for each node type from\n // construction through the rest of the pipeline. Without the pre-declare,\n // each node took a hidden-class transition when enter() added position.\n\n /** @returns {Blockquote} */\n function blockQuote() {\n return {\n type: 'blockquote',\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Code} */\n function codeFlow() {\n return {\n type: 'code',\n lang: null,\n meta: null,\n value: '',\n position: undefined\n };\n }\n\n /** @returns {InlineCode} */\n function codeText() {\n return {\n type: 'inlineCode',\n value: '',\n position: undefined\n };\n }\n\n /** @returns {Definition} */\n function definition() {\n return {\n type: 'definition',\n identifier: '',\n label: null,\n title: null,\n url: '',\n position: undefined\n };\n }\n\n /** @returns {Emphasis} */\n function emphasis() {\n return {\n type: 'emphasis',\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Heading} */\n function heading() {\n return {\n type: 'heading',\n // @ts-expect-error `depth` will be set later.\n depth: 0,\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Break} */\n function hardBreak() {\n return {\n type: 'break',\n position: undefined\n };\n }\n\n /** @returns {Html} */\n function html() {\n return {\n type: 'html',\n value: '',\n position: undefined\n };\n }\n\n /** @returns {Image} */\n function image() {\n return {\n type: 'image',\n title: null,\n url: '',\n alt: null,\n position: undefined\n };\n }\n\n /** @returns {Link} */\n function link() {\n return {\n type: 'link',\n title: null,\n url: '',\n children: [],\n position: undefined\n };\n }\n\n /**\n * @param {Token} token\n * @returns {List}\n */\n function list(token) {\n return {\n type: 'list',\n ordered: token.type === 'listOrdered',\n start: null,\n spread: token._spread,\n children: [],\n position: undefined\n };\n }\n\n /**\n * @param {Token} token\n * @returns {ListItem}\n */\n function listItem(token) {\n return {\n type: 'listItem',\n spread: token._spread,\n checked: null,\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Paragraph} */\n function paragraph() {\n return {\n type: 'paragraph',\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Strong} */\n function strong() {\n return {\n type: 'strong',\n children: [],\n position: undefined\n };\n }\n\n /** @returns {Text} */\n function text() {\n return {\n type: 'text',\n value: '',\n position: undefined\n };\n }\n\n /** @returns {ThematicBreak} */\n function thematicBreak() {\n return {\n type: 'thematicBreak',\n position: undefined\n };\n }\n}\n\n/**\n * Copy a point-like value.\n *\n * @param {Point} d\n * Point-like value.\n * @returns {Point}\n * unist point.\n */\nfunction point(d) {\n return {\n line: d.line,\n column: d.column,\n offset: d.offset\n };\n}\n\n/**\n * @param {Config} combined\n * @param {Array<Array<Extension> | Extension>} extensions\n * @returns {undefined}\n */\nfunction configure(combined, extensions) {\n let index = -1;\n while (++index < extensions.length) {\n const value = extensions[index];\n if (Array.isArray(value)) {\n configure(combined, value);\n } else {\n extension(combined, value);\n }\n }\n}\n\n/**\n * @param {Config} combined\n * @param {Extension} extension\n * @returns {undefined}\n */\nfunction extension(combined, extension) {\n /** @type {keyof Extension} */\n let key;\n for (key in extension) {\n if (own.call(extension, key)) {\n switch (key) {\n case 'canContainEols':\n {\n const right = extension[key];\n if (right) {\n combined[key].push(...right);\n }\n break;\n }\n case 'transforms':\n {\n const right = extension[key];\n if (right) {\n combined[key].push(...right);\n }\n break;\n }\n case 'afterExit':\n case 'beforeEnter':\n {\n const right = extension[key];\n if (right) {\n combined[key].push(right);\n }\n break;\n }\n case 'enter':\n case 'exit':\n {\n const right = extension[key];\n if (right) {\n Object.assign(combined[key], right);\n }\n break;\n }\n // No default\n }\n }\n }\n}\n\n/** @type {OnEnterError} */\nfunction defaultOnError(left, right) {\n if (left) {\n throw new Error('Cannot close `' + left.type + '` (' + stringifyPosition({\n start: left.start,\n end: left.end\n }) + '): a different token (`' + right.type + '`, ' + stringifyPosition({\n start: right.start,\n end: right.end\n }) + ') is open');\n }\n throw new Error('Cannot close document, a token (`' + right.type + '`, ' + stringifyPosition({\n start: right.start,\n end: right.end\n }) + ') is still open');\n}","/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast-util-from-markdown').Options} FromMarkdownOptions\n * @typedef {import('unified').Parser<Root>} Parser\n * @typedef {import('unified').Processor<Root>} Processor\n */\n\n/**\n * @typedef {Omit<FromMarkdownOptions, 'extensions' | 'mdastExtensions'>} Options\n */\n\nimport {fromMarkdown} from 'mdast-util-from-markdown'\n\n/**\n * Aadd support for parsing from markdown.\n *\n * @param {Readonly<Options> | null | undefined} [options]\n * Configuration (optional).\n * @returns {undefined}\n * Nothing.\n */\nexport default function remarkParse(options) {\n /** @type {Processor} */\n // @ts-expect-error: TS in JSDoc generates wrong types if `this` is typed regularly.\n const self = this\n\n self.parser = parser\n\n /**\n * @type {Parser}\n */\n function parser(doc) {\n return fromMarkdown(doc, {\n ...self.data('settings'),\n ...options,\n // Note: these options are not in the readme.\n // The goal is for them to be set by plugins on `data` instead of being\n // passed by users.\n extensions: self.data('micromarkExtensions') || [],\n mdastExtensions: self.data('fromMarkdownExtensions') || []\n })\n }\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Blockquote} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `blockquote` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Blockquote} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function blockquote(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'blockquote',\n properties: {},\n children: state.wrap(state.all(node), true)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element, Text} from 'hast'\n * @import {Break} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `break` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Break} node\n * mdast node.\n * @returns {Array<Element | Text>}\n * hast element content.\n */\nexport function hardBreak(state, node) {\n /** @type {Element} */\n const result = {type: 'element', tagName: 'br', properties: {}, children: []}\n state.patch(node, result)\n return [state.applyData(node, result), {type: 'text', value: '\\n'}]\n}\n","/**\n * @import {Element, Properties} from 'hast'\n * @import {Code} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `code` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Code} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function code(state, node) {\n const value = node.value ? node.value + '\\n' : ''\n /** @type {Properties} */\n const properties = {}\n // Someone can write `js python	ruby`.\n const language = node.lang ? node.lang.split(/\\s+/) : []\n\n // GH/CM still drop the non-first languages.\n if (language.length > 0) {\n properties.className = ['language-' + language[0]]\n }\n\n // Create `<code>`.\n /** @type {Element} */\n let result = {\n type: 'element',\n tagName: 'code',\n properties,\n children: [{type: 'text', value}]\n }\n\n if (node.meta) {\n result.data = {meta: node.meta}\n }\n\n state.patch(node, result)\n result = state.applyData(node, result)\n\n // Create `<pre>`.\n result = {type: 'element', tagName: 'pre', properties: {}, children: [result]}\n state.patch(node, result)\n return result\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Delete} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `delete` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Delete} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function strikethrough(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'del',\n properties: {},\n children: state.all(node)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Emphasis} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `emphasis` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Emphasis} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function emphasis(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'em',\n properties: {},\n children: state.all(node)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {FootnoteReference} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `footnoteReference` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {FootnoteReference} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function footnoteReference(state, node) {\n const clobberPrefix =\n typeof state.options.clobberPrefix === 'string'\n ? state.options.clobberPrefix\n : 'user-content-'\n const id = String(node.identifier).toUpperCase()\n const safeId = normalizeUri(id.toLowerCase())\n const index = state.footnoteOrder.indexOf(id)\n /** @type {number} */\n let counter\n\n let reuseCounter = state.footnoteCounts.get(id)\n\n if (reuseCounter === undefined) {\n reuseCounter = 0\n state.footnoteOrder.push(id)\n counter = state.footnoteOrder.length\n } else {\n counter = index + 1\n }\n\n reuseCounter += 1\n state.footnoteCounts.set(id, reuseCounter)\n\n /** @type {Element} */\n const link = {\n type: 'element',\n tagName: 'a',\n properties: {\n href: '#' + clobberPrefix + 'fn-' + safeId,\n id:\n clobberPrefix +\n 'fnref-' +\n safeId +\n (reuseCounter > 1 ? '-' + reuseCounter : ''),\n dataFootnoteRef: true,\n ariaDescribedBy: ['footnote-label']\n },\n children: [{type: 'text', value: String(counter)}]\n }\n state.patch(node, link)\n\n /** @type {Element} */\n const sup = {\n type: 'element',\n tagName: 'sup',\n properties: {},\n children: [link]\n }\n state.patch(node, sup)\n return state.applyData(node, sup)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Heading} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `heading` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Heading} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function heading(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'h' + node.depth,\n properties: {},\n children: state.all(node)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Html} from 'mdast'\n * @import {State} from '../state.js'\n * @import {Raw} from '../../index.js'\n */\n\n/**\n * Turn an mdast `html` node into hast (`raw` node in dangerous mode, otherwise\n * nothing).\n *\n * @param {State} state\n * Info passed around.\n * @param {Html} node\n * mdast node.\n * @returns {Element | Raw | undefined}\n * hast node.\n */\nexport function html(state, node) {\n if (state.options.allowDangerousHtml) {\n /** @type {Raw} */\n const result = {type: 'raw', value: node.value}\n state.patch(node, result)\n return state.applyData(node, result)\n }\n\n return undefined\n}\n","/**\n * @import {ElementContent} from 'hast'\n * @import {Reference, Nodes} from 'mdast'\n * @import {State} from './state.js'\n */\n\n/**\n * Return the content of a reference without definition as plain text.\n *\n * @param {State} state\n * Info passed around.\n * @param {Extract<Nodes, Reference>} node\n * Reference node (image, link).\n * @returns {Array<ElementContent>}\n * hast content.\n */\nexport function revert(state, node) {\n const subtype = node.referenceType\n let suffix = ']'\n\n if (subtype === 'collapsed') {\n suffix += '[]'\n } else if (subtype === 'full') {\n suffix += '[' + (node.label || node.identifier) + ']'\n }\n\n if (node.type === 'imageReference') {\n return [{type: 'text', value: '![' + node.alt + suffix}]\n }\n\n const contents = state.all(node)\n const head = contents[0]\n\n if (head && head.type === 'text') {\n head.value = '[' + head.value\n } else {\n contents.unshift({type: 'text', value: '['})\n }\n\n const tail = contents[contents.length - 1]\n\n if (tail && tail.type === 'text') {\n tail.value += suffix\n } else {\n contents.push({type: 'text', value: suffix})\n }\n\n return contents\n}\n","/**\n * @import {ElementContent, Element, Properties} from 'hast'\n * @import {ImageReference} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `imageReference` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {ImageReference} node\n * mdast node.\n * @returns {Array<ElementContent> | ElementContent}\n * hast node.\n */\nexport function imageReference(state, node) {\n const id = String(node.identifier).toUpperCase()\n const definition = state.definitionById.get(id)\n\n if (!definition) {\n return revert(state, node)\n }\n\n /** @type {Properties} */\n const properties = {src: normalizeUri(definition.url || ''), alt: node.alt}\n\n if (definition.title !== null && definition.title !== undefined) {\n properties.title = definition.title\n }\n\n /** @type {Element} */\n const result = {type: 'element', tagName: 'img', properties, children: []}\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element, Properties} from 'hast'\n * @import {Image} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `image` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Image} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function image(state, node) {\n /** @type {Properties} */\n const properties = {src: normalizeUri(node.url)}\n\n if (node.alt !== null && node.alt !== undefined) {\n properties.alt = node.alt\n }\n\n if (node.title !== null && node.title !== undefined) {\n properties.title = node.title\n }\n\n /** @type {Element} */\n const result = {type: 'element', tagName: 'img', properties, children: []}\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element, Text} from 'hast'\n * @import {InlineCode} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `inlineCode` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {InlineCode} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function inlineCode(state, node) {\n /** @type {Text} */\n const text = {type: 'text', value: node.value.replace(/\\r?\\n|\\r/g, ' ')}\n state.patch(node, text)\n\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'code',\n properties: {},\n children: [text]\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {ElementContent, Element, Properties} from 'hast'\n * @import {LinkReference} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `linkReference` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {LinkReference} node\n * mdast node.\n * @returns {Array<ElementContent> | ElementContent}\n * hast node.\n */\nexport function linkReference(state, node) {\n const id = String(node.identifier).toUpperCase()\n const definition = state.definitionById.get(id)\n\n if (!definition) {\n return revert(state, node)\n }\n\n /** @type {Properties} */\n const properties = {href: normalizeUri(definition.url || '')}\n\n if (definition.title !== null && definition.title !== undefined) {\n properties.title = definition.title\n }\n\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'a',\n properties,\n children: state.all(node)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element, Properties} from 'hast'\n * @import {Link} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `link` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Link} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function link(state, node) {\n /** @type {Properties} */\n const properties = {href: normalizeUri(node.url)}\n\n if (node.title !== null && node.title !== undefined) {\n properties.title = node.title\n }\n\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'a',\n properties,\n children: state.all(node)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {ElementContent, Element, Properties} from 'hast'\n * @import {ListItem, Parents} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `listItem` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {ListItem} node\n * mdast node.\n * @param {Parents | undefined} parent\n * Parent of `node`.\n * @returns {Element}\n * hast node.\n */\nexport function listItem(state, node, parent) {\n const results = state.all(node)\n const loose = parent ? listLoose(parent) : listItemLoose(node)\n /** @type {Properties} */\n const properties = {}\n /** @type {Array<ElementContent>} */\n const children = []\n\n if (typeof node.checked === 'boolean') {\n const head = results[0]\n /** @type {Element} */\n let paragraph\n\n if (head && head.type === 'element' && head.tagName === 'p') {\n paragraph = head\n } else {\n paragraph = {type: 'element', tagName: 'p', properties: {}, children: []}\n results.unshift(paragraph)\n }\n\n if (paragraph.children.length > 0) {\n paragraph.children.unshift({type: 'text', value: ' '})\n }\n\n paragraph.children.unshift({\n type: 'element',\n tagName: 'input',\n properties: {type: 'checkbox', checked: node.checked, disabled: true},\n children: []\n })\n\n // According to github-markdown-css, this class hides bullet.\n // See: <https://github.com/sindresorhus/github-markdown-css>.\n properties.className = ['task-list-item']\n }\n\n let index = -1\n\n while (++index < results.length) {\n const child = results[index]\n\n // Add eols before nodes, except if this is a loose, first paragraph.\n if (\n loose ||\n index !== 0 ||\n child.type !== 'element' ||\n child.tagName !== 'p'\n ) {\n children.push({type: 'text', value: '\\n'})\n }\n\n if (child.type === 'element' && child.tagName === 'p' && !loose) {\n children.push(...child.children)\n } else {\n children.push(child)\n }\n }\n\n const tail = results[results.length - 1]\n\n // Add a final eol.\n if (tail && (loose || tail.type !== 'element' || tail.tagName !== 'p')) {\n children.push({type: 'text', value: '\\n'})\n }\n\n /** @type {Element} */\n const result = {type: 'element', tagName: 'li', properties, children}\n state.patch(node, result)\n return state.applyData(node, result)\n}\n\n/**\n * @param {Parents} node\n * @return {Boolean}\n */\nfunction listLoose(node) {\n let loose = false\n if (node.type === 'list') {\n loose = node.spread || false\n const children = node.children\n let index = -1\n\n while (!loose && ++index < children.length) {\n loose = listItemLoose(children[index])\n }\n }\n\n return loose\n}\n\n/**\n * @param {ListItem} node\n * @return {Boolean}\n */\nfunction listItemLoose(node) {\n const spread = node.spread\n\n return spread === null || spread === undefined\n ? node.children.length > 1\n : spread\n}\n","/**\n * @import {Element, Properties} from 'hast'\n * @import {List} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `list` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {List} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function list(state, node) {\n /** @type {Properties} */\n const properties = {}\n const results = state.all(node)\n let index = -1\n\n if (typeof node.start === 'number' && node.start !== 1) {\n properties.start = node.start\n }\n\n // Like GitHub, add a class for custom styling.\n while (++index < results.length) {\n const child = results[index]\n\n if (\n child.type === 'element' &&\n child.tagName === 'li' &&\n child.properties &&\n Array.isArray(child.properties.className) &&\n child.properties.className.includes('task-list-item')\n ) {\n properties.className = ['contains-task-list']\n break\n }\n }\n\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: node.ordered ? 'ol' : 'ul',\n properties,\n children: state.wrap(results, true)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Paragraph} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `paragraph` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Paragraph} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function paragraph(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'p',\n properties: {},\n children: state.all(node)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Parents as HastParents, Root as HastRoot} from 'hast'\n * @import {Root as MdastRoot} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `root` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdastRoot} node\n * mdast node.\n * @returns {HastParents}\n * hast node.\n */\nexport function root(state, node) {\n /** @type {HastRoot} */\n const result = {type: 'root', children: state.wrap(state.all(node))}\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Strong} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `strong` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Strong} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function strong(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'strong',\n properties: {},\n children: state.all(node)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Point} Point\n * @typedef {import('unist').Position} Position\n */\n\n/**\n * @typedef NodeLike\n * @property {string} type\n * @property {PositionLike | null | undefined} [position]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n *\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n */\n\n/**\n * Get the ending point of `node`.\n *\n * @param node\n * Node.\n * @returns\n * Point.\n */\nexport const pointEnd = point('end')\n\n/**\n * Get the starting point of `node`.\n *\n * @param node\n * Node.\n * @returns\n * Point.\n */\nexport const pointStart = point('start')\n\n/**\n * Get the positional info of `node`.\n *\n * @param {'end' | 'start'} type\n * Side.\n * @returns\n * Getter.\n */\nfunction point(type) {\n return point\n\n /**\n * Get the point info of `node` at a bound side.\n *\n * @param {Node | NodeLike | null | undefined} [node]\n * @returns {Point | undefined}\n */\n function point(node) {\n const point = (node && node.position && node.position[type]) || {}\n\n if (\n typeof point.line === 'number' &&\n point.line > 0 &&\n typeof point.column === 'number' &&\n point.column > 0\n ) {\n return {\n line: point.line,\n column: point.column,\n offset:\n typeof point.offset === 'number' && point.offset > -1\n ? point.offset\n : undefined\n }\n }\n }\n}\n\n/**\n * Get the positional info of `node`.\n *\n * @param {Node | NodeLike | null | undefined} [node]\n * Node.\n * @returns {Position | undefined}\n * Position.\n */\nexport function position(node) {\n const start = pointStart(node)\n const end = pointEnd(node)\n\n if (start && end) {\n return {start, end}\n }\n}\n","/**\n * @import {Table} from 'mdast'\n * @import {Element} from 'hast'\n * @import {State} from '../state.js'\n */\n\nimport {pointEnd, pointStart} from 'unist-util-position'\n\n/**\n * Turn an mdast `table` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Table} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function table(state, node) {\n const rows = state.all(node)\n const firstRow = rows.shift()\n /** @type {Array<Element>} */\n const tableContent = []\n\n if (firstRow) {\n /** @type {Element} */\n const head = {\n type: 'element',\n tagName: 'thead',\n properties: {},\n children: state.wrap([firstRow], true)\n }\n state.patch(node.children[0], head)\n tableContent.push(head)\n }\n\n if (rows.length > 0) {\n /** @type {Element} */\n const body = {\n type: 'element',\n tagName: 'tbody',\n properties: {},\n children: state.wrap(rows, true)\n }\n\n const start = pointStart(node.children[1])\n const end = pointEnd(node.children[node.children.length - 1])\n if (start && end) body.position = {start, end}\n tableContent.push(body)\n }\n\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'table',\n properties: {},\n children: state.wrap(tableContent, true)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element, ElementContent, Properties} from 'hast'\n * @import {Parents, TableRow} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `tableRow` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {TableRow} node\n * mdast node.\n * @param {Parents | undefined} parent\n * Parent of `node`.\n * @returns {Element}\n * hast node.\n */\nexport function tableRow(state, node, parent) {\n const siblings = parent ? parent.children : undefined\n // Generate a body row when without parent.\n const rowIndex = siblings ? siblings.indexOf(node) : 1\n const tagName = rowIndex === 0 ? 'th' : 'td'\n // To do: option to use `style`?\n const align = parent && parent.type === 'table' ? parent.align : undefined\n const length = align ? align.length : node.children.length\n let cellIndex = -1\n /** @type {Array<ElementContent>} */\n const cells = []\n\n while (++cellIndex < length) {\n // Note: can also be undefined.\n const cell = node.children[cellIndex]\n /** @type {Properties} */\n const properties = {}\n const alignValue = align ? align[cellIndex] : undefined\n\n if (alignValue) {\n properties.align = alignValue\n }\n\n /** @type {Element} */\n let result = {type: 'element', tagName, properties, children: []}\n\n if (cell) {\n result.children = state.all(cell)\n state.patch(cell, result)\n result = state.applyData(cell, result)\n }\n\n cells.push(result)\n }\n\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'tr',\n properties: {},\n children: state.wrap(cells, true)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {TableCell} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `tableCell` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {TableCell} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function tableCell(state, node) {\n // Note: this function is normally not called: see `table-row` for how rows\n // and their cells are compiled.\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'td', // Assume body cell.\n properties: {},\n children: state.all(node)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","const tab = 9 /* `\\t` */\nconst space = 32 /* ` ` */\n\n/**\n * Remove initial and final spaces and tabs at the line breaks in `value`.\n * Does not trim initial and final spaces and tabs of the value itself.\n *\n * @param {string} value\n * Value to trim.\n * @returns {string}\n * Trimmed value.\n */\nexport function trimLines(value) {\n const source = String(value)\n const search = /\\r?\\n|\\r/g\n let match = search.exec(source)\n let last = 0\n /** @type {Array<string>} */\n const lines = []\n\n while (match) {\n lines.push(\n trimLine(source.slice(last, match.index), last > 0, true),\n match[0]\n )\n\n last = match.index + match[0].length\n match = search.exec(source)\n }\n\n lines.push(trimLine(source.slice(last), last > 0, false))\n\n return lines.join('')\n}\n\n/**\n * @param {string} value\n * Line to trim.\n * @param {boolean} start\n * Whether to trim the start of the line.\n * @param {boolean} end\n * Whether to trim the end of the line.\n * @returns {string}\n * Trimmed line.\n */\nfunction trimLine(value, start, end) {\n let startIndex = 0\n let endIndex = value.length\n\n if (start) {\n let code = value.codePointAt(startIndex)\n\n while (code === tab || code === space) {\n startIndex++\n code = value.codePointAt(startIndex)\n }\n }\n\n if (end) {\n let code = value.codePointAt(endIndex - 1)\n\n while (code === tab || code === space) {\n endIndex--\n code = value.codePointAt(endIndex - 1)\n }\n }\n\n return endIndex > startIndex ? value.slice(startIndex, endIndex) : ''\n}\n","/**\n * @import {Element as HastElement, Text as HastText} from 'hast'\n * @import {Text as MdastText} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {trimLines} from 'trim-lines'\n\n/**\n * Turn an mdast `text` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdastText} node\n * mdast node.\n * @returns {HastElement | HastText}\n * hast node.\n */\nexport function text(state, node) {\n /** @type {HastText} */\n const result = {type: 'text', value: trimLines(String(node.value))}\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {ThematicBreak} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `thematicBreak` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {ThematicBreak} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function thematicBreak(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'hr',\n properties: {},\n children: []\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Handlers} from '../state.js'\n */\n\nimport {blockquote} from './blockquote.js'\nimport {hardBreak} from './break.js'\nimport {code} from './code.js'\nimport {strikethrough} from './delete.js'\nimport {emphasis} from './emphasis.js'\nimport {footnoteReference} from './footnote-reference.js'\nimport {heading} from './heading.js'\nimport {html} from './html.js'\nimport {imageReference} from './image-reference.js'\nimport {image} from './image.js'\nimport {inlineCode} from './inline-code.js'\nimport {linkReference} from './link-reference.js'\nimport {link} from './link.js'\nimport {listItem} from './list-item.js'\nimport {list} from './list.js'\nimport {paragraph} from './paragraph.js'\nimport {root} from './root.js'\nimport {strong} from './strong.js'\nimport {table} from './table.js'\nimport {tableRow} from './table-row.js'\nimport {tableCell} from './table-cell.js'\nimport {text} from './text.js'\nimport {thematicBreak} from './thematic-break.js'\n\n/**\n * Default handlers for nodes.\n *\n * @satisfies {Handlers}\n */\nexport const handlers = {\n blockquote,\n break: hardBreak,\n code,\n delete: strikethrough,\n emphasis,\n footnoteReference,\n heading,\n html,\n imageReference,\n image,\n inlineCode,\n linkReference,\n link,\n listItem,\n list,\n paragraph,\n // @ts-expect-error: root is different, but hard to type.\n root,\n strong,\n table,\n tableCell,\n tableRow,\n text,\n thematicBreak,\n toml: ignore,\n yaml: ignore,\n definition: ignore,\n footnoteDefinition: ignore\n}\n\n// Return nothing for nodes that are ignored.\nfunction ignore() {\n return undefined\n}\n","import {\n VOID, PRIMITIVE,\n ARRAY, OBJECT,\n DATE, REGEXP, MAP, SET,\n ERROR, BIGINT\n} from './types.js';\n\nconst { defineProperty } = Object;\nconst env = typeof self === 'object' ? self : globalThis;\n\nconst guard = (name, init) => {\n switch (name) {\n case 'Function':\n case 'SharedWorker':\n case 'Worker':\n case 'eval':\n case 'setInterval':\n case 'setTimeout':\n throw new TypeError('unable to deserialize ' + name);\n }\n return new env[name](init);\n};\n\nconst deserializer = ($, _) => {\n const as = (out, index) => {\n $.set(index, out);\n return out;\n };\n\n const unpair = index => {\n if ($.has(index))\n return $.get(index);\n\n const [type, value] = _[index];\n switch (type) {\n case PRIMITIVE:\n case VOID:\n return as(value, index);\n case ARRAY: {\n const arr = as([], index);\n for (const index of value)\n arr.push(unpair(index));\n return arr;\n }\n case OBJECT: {\n const object = as({}, index);\n for (const [key, index] of value) {\n const k = unpair(key), value = unpair(index);\n if (k === '__proto__') defineProperty(object, k, {\n value,\n configurable: true,\n enumerable: true,\n writable: true\n });\n else object[k] = value;\n }\n return object;\n }\n case DATE:\n return as(new Date(value), index);\n case REGEXP: {\n const {source, flags} = value;\n return as(new RegExp(source, flags), index);\n }\n case MAP: {\n const map = as(new Map, index);\n for (const [key, index] of value)\n map.set(unpair(key), unpair(index));\n return map;\n }\n case SET: {\n const set = as(new Set, index);\n for (const index of value)\n set.add(unpair(index));\n return set;\n }\n case ERROR: {\n const {name, message} = value;\n return as(\n typeof env[name] === 'function' ?\n guard(name, message) :\n new Error(message),\n index\n );\n }\n case BIGINT:\n return as(BigInt(value), index);\n case 'BigInt':\n return as(Object(BigInt(value)), index);\n case 'ArrayBuffer':\n return as(new Uint8Array(value).buffer, value);\n case 'DataView': {\n const { buffer } = new Uint8Array(value);\n return as(new DataView(buffer), value);\n }\n case '-0': return -0;\n }\n return as(guard(type, value), index);\n };\n\n return unpair;\n};\n\n/**\n * @typedef {Array<string,any>} Record a type representation\n */\n\n/**\n * Returns a deserialized value from a serialized array of Records.\n * @param {Record[]} serialized a previously serialized value.\n * @returns {any}\n */\nexport const deserialize = serialized => deserializer(new Map, serialized)(0);\n","import {\n VOID, PRIMITIVE,\n ARRAY, OBJECT,\n DATE, REGEXP, MAP, SET,\n ERROR, BIGINT\n} from './types.js';\n\nconst EMPTY = '';\n\nconst {toString} = {};\nconst {keys, is} = Object;\n\nconst typeOf = value => {\n const type = typeof value;\n if (type !== 'object' || !value)\n return [PRIMITIVE, type];\n\n const asString = toString.call(value).slice(8, -1);\n switch (asString) {\n case 'Array':\n return [ARRAY, EMPTY];\n case 'Object':\n return [OBJECT, EMPTY];\n case 'Date':\n return [DATE, EMPTY];\n case 'RegExp':\n return [REGEXP, EMPTY];\n case 'Map':\n return [MAP, EMPTY];\n case 'Set':\n return [SET, EMPTY];\n case 'DataView':\n return [ARRAY, asString];\n }\n\n if (asString.includes('Array'))\n return [ARRAY, asString];\n\n if (value instanceof Error)\n return [ERROR, value.name || 'Error'];\n\n return [OBJECT, asString];\n};\n\nconst shouldSkip = ([TYPE, type]) => (\n TYPE === PRIMITIVE &&\n (type === 'function' || type === 'symbol')\n);\n\nconst serializer = (strict, json, $, _) => {\n\n const as = (out, value) => {\n const index = _.push(out) - 1;\n $.set(value, index);\n return index;\n };\n\n const pair = value => {\n if ($.has(value))\n return $.get(value);\n\n let [TYPE, type] = typeOf(value);\n switch (TYPE) {\n case PRIMITIVE: {\n let entry = value;\n switch (type) {\n case 'bigint':\n TYPE = BIGINT;\n entry = value.toString();\n break;\n case 'number':\n if (!value && is(value, -0))\n return _.push(['-0']) - 1;\n break;\n case 'function':\n case 'symbol':\n if (strict)\n throw new TypeError('unable to serialize ' + type);\n entry = null;\n break;\n case 'undefined':\n return as([VOID], value);\n }\n return as([TYPE, entry], value);\n }\n case ARRAY: {\n if (type) {\n let spread = value;\n if (type === 'DataView') {\n spread = new Uint8Array(value.buffer);\n }\n else if (type === 'ArrayBuffer') {\n spread = new Uint8Array(value);\n }\n return as([type, [...spread]], value);\n }\n\n const arr = [];\n const index = as([TYPE, arr], value);\n for (const entry of value)\n arr.push(pair(entry));\n return index;\n }\n case OBJECT: {\n if (type) {\n switch (type) {\n case 'BigInt':\n return as([type, value.toString()], value);\n case 'Boolean':\n case 'Number':\n case 'String':\n return as([type, value.valueOf()], value);\n }\n }\n\n if (json && ('toJSON' in value))\n return pair(value.toJSON());\n\n const entries = [];\n const index = as([TYPE, entries], value);\n for (const key of keys(value)) {\n if (strict || !shouldSkip(typeOf(value[key])))\n entries.push([pair(key), pair(value[key])]);\n }\n return index;\n }\n case DATE:\n return as([TYPE, isNaN(value.getTime()) ? EMPTY : value.toISOString()], value);\n case REGEXP: {\n const {source, flags} = value;\n return as([TYPE, {source, flags}], value);\n }\n case MAP: {\n const entries = [];\n const index = as([TYPE, entries], value);\n for (const [key, entry] of value) {\n if (strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry))))\n entries.push([pair(key), pair(entry)]);\n }\n return index;\n }\n case SET: {\n const entries = [];\n const index = as([TYPE, entries], value);\n for (const entry of value) {\n if (strict || !shouldSkip(typeOf(entry)))\n entries.push(pair(entry));\n }\n return index;\n }\n }\n\n const {message} = value;\n return as([TYPE, {name: type, message}], value);\n };\n\n return pair;\n};\n\n/**\n * @typedef {Array<string,any>} Record a type representation\n */\n\n/**\n * Returns an array of serialized Records.\n * @param {any} value a serializable value.\n * @param {{json?: boolean, lossy?: boolean}?} options an object with a `lossy` or `json` property that,\n * if `true`, will not throw errors on incompatible types, and behave more\n * like JSON stringify would behave. Symbol and Function will be discarded.\n * @returns {Record[]}\n */\n export const serialize = (value, {json, lossy} = {}) => {\n const _ = [];\n return serializer(!(json || lossy), !!json, new Map, _)(value), _;\n};\n","import {deserialize} from './deserialize.js';\nimport {serialize} from './serialize.js';\n\n/**\n * @typedef {Array<string,any>} Record a type representation\n */\n\n/**\n * Returns an array of serialized Records.\n * @param {any} any a serializable value.\n * @param {{transfer?: any[], json?: boolean, lossy?: boolean}?} options an object with\n * a transfer option (ignored when polyfilled) and/or non standard fields that\n * fallback to the polyfill if present.\n * @returns {Record[]}\n */\nexport default typeof structuredClone === \"function\" ?\n /* c8 ignore start */\n (any, options) => (\n options && ('json' in options || 'lossy' in options) ?\n deserialize(serialize(any, options)) : structuredClone(any)\n ) :\n (any, options) => deserialize(serialize(any, options));\n /* c8 ignore stop */\n\nexport {deserialize, serialize};\n","/**\n * @import {ElementContent, Element} from 'hast'\n * @import {State} from './state.js'\n */\n\n/**\n * @callback FootnoteBackContentTemplate\n * Generate content for the backreference dynamically.\n *\n * For the following markdown:\n *\n * ```markdown\n * Alpha[^micromark], bravo[^micromark], and charlie[^remark].\n *\n * [^remark]: things about remark\n * [^micromark]: things about micromark\n * ```\n *\n * This function will be called with:\n *\n * * `0` and `0` for the backreference from `things about micromark` to\n * `alpha`, as it is the first used definition, and the first call to it\n * * `0` and `1` for the backreference from `things about micromark` to\n * `bravo`, as it is the first used definition, and the second call to it\n * * `1` and `0` for the backreference from `things about remark` to\n * `charlie`, as it is the second used definition\n * @param {number} referenceIndex\n * Index of the definition in the order that they are first referenced,\n * 0-indexed.\n * @param {number} rereferenceIndex\n * Index of calls to the same definition, 0-indexed.\n * @returns {Array<ElementContent> | ElementContent | string}\n * Content for the backreference when linking back from definitions to their\n * reference.\n *\n * @callback FootnoteBackLabelTemplate\n * Generate a back label dynamically.\n *\n * For the following markdown:\n *\n * ```markdown\n * Alpha[^micromark], bravo[^micromark], and charlie[^remark].\n *\n * [^remark]: things about remark\n * [^micromark]: things about micromark\n * ```\n *\n * This function will be called with:\n *\n * * `0` and `0` for the backreference from `things about micromark` to\n * `alpha`, as it is the first used definition, and the first call to it\n * * `0` and `1` for the backreference from `things about micromark` to\n * `bravo`, as it is the first used definition, and the second call to it\n * * `1` and `0` for the backreference from `things about remark` to\n * `charlie`, as it is the second used definition\n * @param {number} referenceIndex\n * Index of the definition in the order that they are first referenced,\n * 0-indexed.\n * @param {number} rereferenceIndex\n * Index of calls to the same definition, 0-indexed.\n * @returns {string}\n * Back label to use when linking back from definitions to their reference.\n */\n\nimport structuredClone from '@ungap/structured-clone'\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Generate the default content that GitHub uses on backreferences.\n *\n * @param {number} _\n * Index of the definition in the order that they are first referenced,\n * 0-indexed.\n * @param {number} rereferenceIndex\n * Index of calls to the same definition, 0-indexed.\n * @returns {Array<ElementContent>}\n * Content.\n */\nexport function defaultFootnoteBackContent(_, rereferenceIndex) {\n /** @type {Array<ElementContent>} */\n const result = [{type: 'text', value: '↩'}]\n\n if (rereferenceIndex > 1) {\n result.push({\n type: 'element',\n tagName: 'sup',\n properties: {},\n children: [{type: 'text', value: String(rereferenceIndex)}]\n })\n }\n\n return result\n}\n\n/**\n * Generate the default label that GitHub uses on backreferences.\n *\n * @param {number} referenceIndex\n * Index of the definition in the order that they are first referenced,\n * 0-indexed.\n * @param {number} rereferenceIndex\n * Index of calls to the same definition, 0-indexed.\n * @returns {string}\n * Label.\n */\nexport function defaultFootnoteBackLabel(referenceIndex, rereferenceIndex) {\n return (\n 'Back to reference ' +\n (referenceIndex + 1) +\n (rereferenceIndex > 1 ? '-' + rereferenceIndex : '')\n )\n}\n\n/**\n * Generate a hast footer for called footnote definitions.\n *\n * @param {State} state\n * Info passed around.\n * @returns {Element | undefined}\n * `section` element or `undefined`.\n */\n// eslint-disable-next-line complexity\nexport function footer(state) {\n const clobberPrefix =\n typeof state.options.clobberPrefix === 'string'\n ? state.options.clobberPrefix\n : 'user-content-'\n const footnoteBackContent =\n state.options.footnoteBackContent || defaultFootnoteBackContent\n const footnoteBackLabel =\n state.options.footnoteBackLabel || defaultFootnoteBackLabel\n const footnoteLabel = state.options.footnoteLabel || 'Footnotes'\n const footnoteLabelTagName = state.options.footnoteLabelTagName || 'h2'\n const footnoteLabelProperties = state.options.footnoteLabelProperties || {\n className: ['sr-only']\n }\n /** @type {Array<ElementContent>} */\n const listItems = []\n let referenceIndex = -1\n\n while (++referenceIndex < state.footnoteOrder.length) {\n const definition = state.footnoteById.get(\n state.footnoteOrder[referenceIndex]\n )\n\n if (!definition) {\n continue\n }\n\n const content = state.all(definition)\n const id = String(definition.identifier).toUpperCase()\n const safeId = normalizeUri(id.toLowerCase())\n let rereferenceIndex = 0\n /** @type {Array<ElementContent>} */\n const backReferences = []\n const counts = state.footnoteCounts.get(id)\n\n // eslint-disable-next-line no-unmodified-loop-condition\n while (counts !== undefined && ++rereferenceIndex <= counts) {\n if (backReferences.length > 0) {\n backReferences.push({type: 'text', value: ' '})\n }\n\n let children =\n typeof footnoteBackContent === 'string'\n ? footnoteBackContent\n : footnoteBackContent(referenceIndex, rereferenceIndex)\n\n if (typeof children === 'string') {\n children = {type: 'text', value: children}\n }\n\n backReferences.push({\n type: 'element',\n tagName: 'a',\n properties: {\n href:\n '#' +\n clobberPrefix +\n 'fnref-' +\n safeId +\n (rereferenceIndex > 1 ? '-' + rereferenceIndex : ''),\n dataFootnoteBackref: '',\n ariaLabel:\n typeof footnoteBackLabel === 'string'\n ? footnoteBackLabel\n : footnoteBackLabel(referenceIndex, rereferenceIndex),\n className: ['data-footnote-backref']\n },\n children: Array.isArray(children) ? children : [children]\n })\n }\n\n const tail = content[content.length - 1]\n\n if (tail && tail.type === 'element' && tail.tagName === 'p') {\n const tailTail = tail.children[tail.children.length - 1]\n if (tailTail && tailTail.type === 'text') {\n tailTail.value += ' '\n } else {\n tail.children.push({type: 'text', value: ' '})\n }\n\n tail.children.push(...backReferences)\n } else {\n content.push(...backReferences)\n }\n\n /** @type {Element} */\n const listItem = {\n type: 'element',\n tagName: 'li',\n properties: {id: clobberPrefix + 'fn-' + safeId},\n children: state.wrap(content, true)\n }\n\n state.patch(definition, listItem)\n\n listItems.push(listItem)\n }\n\n if (listItems.length === 0) {\n return\n }\n\n return {\n type: 'element',\n tagName: 'section',\n properties: {dataFootnotes: true, className: ['footnotes']},\n children: [\n {\n type: 'element',\n tagName: footnoteLabelTagName,\n properties: {\n ...structuredClone(footnoteLabelProperties),\n id: 'footnote-label'\n },\n children: [{type: 'text', value: footnoteLabel}]\n },\n {type: 'text', value: '\\n'},\n {\n type: 'element',\n tagName: 'ol',\n properties: {},\n children: state.wrap(listItems, true)\n },\n {type: 'text', value: '\\n'}\n ]\n }\n}\n","/**\n * @import {\n * ElementContent as HastElementContent,\n * Element as HastElement,\n * Nodes as HastNodes,\n * Properties as HastProperties,\n * RootContent as HastRootContent,\n * Text as HastText\n * } from 'hast'\n * @import {\n * Definition as MdastDefinition,\n * FootnoteDefinition as MdastFootnoteDefinition,\n * Nodes as MdastNodes,\n * Parents as MdastParents\n * } from 'mdast'\n * @import {VFile} from 'vfile'\n * @import {\n * FootnoteBackContentTemplate,\n * FootnoteBackLabelTemplate\n * } from './footer.js'\n */\n\n/**\n * @callback Handler\n * Handle a node.\n * @param {State} state\n * Info passed around.\n * @param {any} node\n * mdast node to handle.\n * @param {MdastParents | undefined} parent\n * Parent of `node`.\n * @returns {Array<HastElementContent> | HastElementContent | undefined}\n * hast node.\n *\n * @typedef {Partial<Record<MdastNodes['type'], Handler>>} Handlers\n * Handle nodes.\n *\n * @typedef Options\n * Configuration (optional).\n * @property {boolean | null | undefined} [allowDangerousHtml=false]\n * Whether to persist raw HTML in markdown in the hast tree (default:\n * `false`).\n * @property {string | null | undefined} [clobberPrefix='user-content-']\n * Prefix to use before the `id` property on footnotes to prevent them from\n * *clobbering* (default: `'user-content-'`).\n *\n * Pass `''` for trusted markdown and when you are careful with\n * polyfilling.\n * You could pass a different prefix.\n *\n * DOM clobbering is this:\n *\n * ```html\n * <p id=\"x\"></p>\n * <script>alert(x) // `x` now refers to the `p#x` DOM element</script>\n * ```\n *\n * The above example shows that elements are made available by browsers, by\n * their ID, on the `window` object.\n * This is a security risk because you might be expecting some other variable\n * at that place.\n * It can also break polyfills.\n * Using a prefix solves these problems.\n * @property {VFile | null | undefined} [file]\n * Corresponding virtual file representing the input document (optional).\n * @property {FootnoteBackContentTemplate | string | null | undefined} [footnoteBackContent]\n * Content of the backreference back to references (default: `defaultFootnoteBackContent`).\n *\n * The default value is:\n *\n * ```js\n * function defaultFootnoteBackContent(_, rereferenceIndex) {\n * const result = [{type: 'text', value: '↩'}]\n *\n * if (rereferenceIndex > 1) {\n * result.push({\n * type: 'element',\n * tagName: 'sup',\n * properties: {},\n * children: [{type: 'text', value: String(rereferenceIndex)}]\n * })\n * }\n *\n * return result\n * }\n * ```\n *\n * This content is used in the `a` element of each backreference (the `↩`\n * links).\n * @property {FootnoteBackLabelTemplate | string | null | undefined} [footnoteBackLabel]\n * Label to describe the backreference back to references (default:\n * `defaultFootnoteBackLabel`).\n *\n * The default value is:\n *\n * ```js\n * function defaultFootnoteBackLabel(referenceIndex, rereferenceIndex) {\n * return (\n * 'Back to reference ' +\n * (referenceIndex + 1) +\n * (rereferenceIndex > 1 ? '-' + rereferenceIndex : '')\n * )\n * }\n * ```\n *\n * Change it when the markdown is not in English.\n *\n * This label is used in the `ariaLabel` property on each backreference\n * (the `↩` links).\n * It affects users of assistive technology.\n * @property {string | null | undefined} [footnoteLabel='Footnotes']\n * Textual label to use for the footnotes section (default: `'Footnotes'`).\n *\n * Change it when the markdown is not in English.\n *\n * This label is typically hidden visually (assuming a `sr-only` CSS class\n * is defined that does that) and so affects screen readers only.\n * If you do have such a class, but want to show this section to everyone,\n * pass different properties with the `footnoteLabelProperties` option.\n * @property {HastProperties | null | undefined} [footnoteLabelProperties={className: ['sr-only']}]\n * Properties to use on the footnote label (default: `{className:\n * ['sr-only']}`).\n *\n * Change it to show the label and add other properties.\n *\n * This label is typically hidden visually (assuming an `sr-only` CSS class\n * is defined that does that) and so affects screen readers only.\n * If you do have such a class, but want to show this section to everyone,\n * pass an empty string.\n * You can also add different properties.\n *\n * > **Note**: `id: 'footnote-label'` is always added, because footnote\n * > calls use it with `aria-describedby` to provide an accessible label.\n * @property {string | null | undefined} [footnoteLabelTagName='h2']\n * HTML tag name to use for the footnote label element (default: `'h2'`).\n *\n * Change it to match your document structure.\n *\n * This label is typically hidden visually (assuming a `sr-only` CSS class\n * is defined that does that) and so affects screen readers only.\n * If you do have such a class, but want to show this section to everyone,\n * pass different properties with the `footnoteLabelProperties` option.\n * @property {Handlers | null | undefined} [handlers]\n * Extra handlers for nodes (optional).\n * @property {Array<MdastNodes['type']> | null | undefined} [passThrough]\n * List of custom mdast node types to pass through (keep) in hast (note that\n * the node itself is passed, but eventual children are transformed)\n * (optional).\n * @property {Handler | null | undefined} [unknownHandler]\n * Handler for all unknown nodes (optional).\n *\n * @typedef State\n * Info passed around.\n * @property {(node: MdastNodes) => Array<HastElementContent>} all\n * Transform the children of an mdast parent to hast.\n * @property {<Type extends HastNodes>(from: MdastNodes, to: Type) => HastElement | Type} applyData\n * Honor the `data` of `from`, and generate an element instead of `node`.\n * @property {Map<string, MdastDefinition>} definitionById\n * Definitions by their identifier.\n * @property {Map<string, MdastFootnoteDefinition>} footnoteById\n * Footnote definitions by their identifier.\n * @property {Map<string, number>} footnoteCounts\n * Counts for how often the same footnote was called.\n * @property {Array<string>} footnoteOrder\n * Identifiers of order when footnote calls first appear in tree order.\n * @property {Handlers} handlers\n * Applied handlers.\n * @property {(node: MdastNodes, parent: MdastParents | undefined) => Array<HastElementContent> | HastElementContent | undefined} one\n * Transform an mdast node to hast.\n * @property {Options} options\n * Configuration.\n * @property {(from: MdastNodes, node: HastNodes) => undefined} patch\n * Copy a node’s positional info.\n * @property {<Type extends HastRootContent>(nodes: Array<Type>, loose?: boolean | undefined) => Array<HastText | Type>} wrap\n * Wrap `nodes` with line endings between each node, adds initial/final line endings when `loose`.\n */\n\nimport structuredClone from '@ungap/structured-clone'\nimport {visit} from 'unist-util-visit'\nimport {position} from 'unist-util-position'\nimport {handlers as defaultHandlers} from './handlers/index.js'\n\nconst own = {}.hasOwnProperty\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/**\n * Create `state` from an mdast tree.\n *\n * @param {MdastNodes} tree\n * mdast node to transform.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {State}\n * `state` function.\n */\nexport function createState(tree, options) {\n const settings = options || emptyOptions\n /** @type {Map<string, MdastDefinition>} */\n const definitionById = new Map()\n /** @type {Map<string, MdastFootnoteDefinition>} */\n const footnoteById = new Map()\n /** @type {Map<string, number>} */\n const footnoteCounts = new Map()\n /** @type {Handlers} */\n // @ts-expect-error: the root handler returns a root.\n // Hard to type.\n const handlers = {...defaultHandlers, ...settings.handlers}\n\n /** @type {State} */\n const state = {\n all,\n applyData,\n definitionById,\n footnoteById,\n footnoteCounts,\n footnoteOrder: [],\n handlers,\n one,\n options: settings,\n patch,\n wrap\n }\n\n visit(tree, function (node) {\n if (node.type === 'definition' || node.type === 'footnoteDefinition') {\n const map = node.type === 'definition' ? definitionById : footnoteById\n const id = String(node.identifier).toUpperCase()\n\n // Mimick CM behavior of link definitions.\n // See: <https://github.com/syntax-tree/mdast-util-definitions/blob/9032189/lib/index.js#L20-L21>.\n if (!map.has(id)) {\n // @ts-expect-error: node type matches map.\n map.set(id, node)\n }\n }\n })\n\n return state\n\n /**\n * Transform an mdast node into a hast node.\n *\n * @param {MdastNodes} node\n * mdast node.\n * @param {MdastParents | undefined} [parent]\n * Parent of `node`.\n * @returns {Array<HastElementContent> | HastElementContent | undefined}\n * Resulting hast node.\n */\n function one(node, parent) {\n const type = node.type\n const handle = state.handlers[type]\n\n if (own.call(state.handlers, type) && handle) {\n return handle(state, node, parent)\n }\n\n if (state.options.passThrough && state.options.passThrough.includes(type)) {\n if ('children' in node) {\n const {children, ...shallow} = node\n const result = structuredClone(shallow)\n // @ts-expect-error: TS doesn’t understand…\n result.children = state.all(node)\n // @ts-expect-error: TS doesn’t understand…\n return result\n }\n\n // @ts-expect-error: it’s custom.\n return structuredClone(node)\n }\n\n const unknown = state.options.unknownHandler || defaultUnknownHandler\n\n return unknown(state, node, parent)\n }\n\n /**\n * Transform the children of an mdast node into hast nodes.\n *\n * @param {MdastNodes} parent\n * mdast node to compile\n * @returns {Array<HastElementContent>}\n * Resulting hast nodes.\n */\n function all(parent) {\n /** @type {Array<HastElementContent>} */\n const values = []\n\n if ('children' in parent) {\n const nodes = parent.children\n let index = -1\n while (++index < nodes.length) {\n const result = state.one(nodes[index], parent)\n\n // To do: see if we van clean this? Can we merge texts?\n if (result) {\n if (index && nodes[index - 1].type === 'break') {\n if (!Array.isArray(result) && result.type === 'text') {\n result.value = trimMarkdownSpaceStart(result.value)\n }\n\n if (!Array.isArray(result) && result.type === 'element') {\n const head = result.children[0]\n\n if (head && head.type === 'text') {\n head.value = trimMarkdownSpaceStart(head.value)\n }\n }\n }\n\n if (Array.isArray(result)) {\n values.push(...result)\n } else {\n values.push(result)\n }\n }\n }\n }\n\n return values\n }\n}\n\n/**\n * Copy a node’s positional info.\n *\n * @param {MdastNodes} from\n * mdast node to copy from.\n * @param {HastNodes} to\n * hast node to copy into.\n * @returns {undefined}\n * Nothing.\n */\nfunction patch(from, to) {\n if (from.position) to.position = position(from)\n}\n\n/**\n * Honor the `data` of `from` and maybe generate an element instead of `to`.\n *\n * @template {HastNodes} Type\n * Node type.\n * @param {MdastNodes} from\n * mdast node to use data from.\n * @param {Type} to\n * hast node to change.\n * @returns {HastElement | Type}\n * Nothing.\n */\nfunction applyData(from, to) {\n /** @type {HastElement | Type} */\n let result = to\n\n // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n if (from && from.data) {\n const hName = from.data.hName\n const hChildren = from.data.hChildren\n const hProperties = from.data.hProperties\n\n if (typeof hName === 'string') {\n // Transforming the node resulted in an element with a different name\n // than wanted:\n if (result.type === 'element') {\n result.tagName = hName\n }\n // Transforming the node resulted in a non-element, which happens for\n // raw, text, and root nodes (unless custom handlers are passed).\n // The intent of `hName` is to create an element, but likely also to keep\n // the content around (otherwise: pass `hChildren`).\n else {\n /** @type {Array<HastElementContent>} */\n // @ts-expect-error: assume no doctypes in `root`.\n const children = 'children' in result ? result.children : [result]\n result = {type: 'element', tagName: hName, properties: {}, children}\n }\n }\n\n if (result.type === 'element' && hProperties) {\n Object.assign(result.properties, structuredClone(hProperties))\n }\n\n if (\n 'children' in result &&\n result.children &&\n hChildren !== null &&\n hChildren !== undefined\n ) {\n result.children = hChildren\n }\n }\n\n return result\n}\n\n/**\n * Transform an unknown node.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdastNodes} node\n * Unknown mdast node.\n * @returns {HastElement | HastText}\n * Resulting hast node.\n */\nfunction defaultUnknownHandler(state, node) {\n const data = node.data || {}\n /** @type {HastElement | HastText} */\n const result =\n 'value' in node &&\n !(own.call(data, 'hProperties') || own.call(data, 'hChildren'))\n ? {type: 'text', value: node.value}\n : {\n type: 'element',\n tagName: 'div',\n properties: {},\n children: state.all(node)\n }\n\n state.patch(node, result)\n return state.applyData(node, result)\n}\n\n/**\n * Wrap `nodes` with line endings between each node.\n *\n * @template {HastRootContent} Type\n * Node type.\n * @param {Array<Type>} nodes\n * List of nodes to wrap.\n * @param {boolean | undefined} [loose=false]\n * Whether to add line endings at start and end (default: `false`).\n * @returns {Array<HastText | Type>}\n * Wrapped nodes.\n */\nexport function wrap(nodes, loose) {\n /** @type {Array<HastText | Type>} */\n const result = []\n let index = -1\n\n if (loose) {\n result.push({type: 'text', value: '\\n'})\n }\n\n while (++index < nodes.length) {\n if (index) result.push({type: 'text', value: '\\n'})\n result.push(nodes[index])\n }\n\n if (loose && nodes.length > 0) {\n result.push({type: 'text', value: '\\n'})\n }\n\n return result\n}\n\n/**\n * Trim spaces and tabs at the start of `value`.\n *\n * @param {string} value\n * Value to trim.\n * @returns {string}\n * Result.\n */\nfunction trimMarkdownSpaceStart(value) {\n let index = 0\n let code = value.charCodeAt(index)\n\n while (code === 9 || code === 32) {\n index++\n code = value.charCodeAt(index)\n }\n\n return value.slice(index)\n}\n","/**\n * @import {Nodes as HastNodes} from 'hast'\n * @import {Nodes as MdastNodes} from 'mdast'\n * @import {Options} from './state.js'\n */\n\nimport {ok as assert} from 'devlop'\nimport {footer} from './footer.js'\nimport {createState} from './state.js'\n\n/**\n * Transform mdast to hast.\n *\n * ##### Notes\n *\n * ###### HTML\n *\n * Raw HTML is available in mdast as `html` nodes and can be embedded in hast\n * as semistandard `raw` nodes.\n * Most utilities ignore `raw` nodes but two notable ones don’t:\n *\n * * `hast-util-to-html` also has an option `allowDangerousHtml` which will\n * output the raw HTML.\n * This is typically discouraged as noted by the option name but is useful\n * if you completely trust authors\n * * `hast-util-raw` can handle the raw embedded HTML strings by parsing them\n * into standard hast nodes (`element`, `text`, etc).\n * This is a heavy task as it needs a full HTML parser, but it is the only\n * way to support untrusted content\n *\n * ###### Footnotes\n *\n * Many options supported here relate to footnotes.\n * Footnotes are not specified by CommonMark, which we follow by default.\n * They are supported by GitHub, so footnotes can be enabled in markdown with\n * `mdast-util-gfm`.\n *\n * The options `footnoteBackLabel` and `footnoteLabel` define natural language\n * that explains footnotes, which is hidden for sighted users but shown to\n * assistive technology.\n * When your page is not in English, you must define translated values.\n *\n * Back references use ARIA attributes, but the section label itself uses a\n * heading that is hidden with an `sr-only` class.\n * To show it to sighted users, define different attributes in\n * `footnoteLabelProperties`.\n *\n * ###### Clobbering\n *\n * Footnotes introduces a problem, as it links footnote calls to footnote\n * definitions on the page through `id` attributes generated from user content,\n * which results in DOM clobbering.\n *\n * DOM clobbering is this:\n *\n * ```html\n * <p id=x></p>\n * <script>alert(x) // `x` now refers to the DOM `p#x` element</script>\n * ```\n *\n * Elements by their ID are made available by browsers on the `window` object,\n * which is a security risk.\n * Using a prefix solves this problem.\n *\n * More information on how to handle clobbering and the prefix is explained in\n * Example: headings (DOM clobbering) in `rehype-sanitize`.\n *\n * ###### Unknown nodes\n *\n * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`.\n * The default behavior for unknown nodes is:\n *\n * * when the node has a `value` (and doesn’t have `data.hName`,\n * `data.hProperties`, or `data.hChildren`, see later), create a hast `text`\n * node\n * * otherwise, create a `<div>` element (which could be changed with\n * `data.hName`), with its children mapped from mdast to hast as well\n *\n * This behavior can be changed by passing an `unknownHandler`.\n *\n * @param {MdastNodes} tree\n * mdast tree.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {HastNodes}\n * hast tree.\n */\nexport function toHast(tree, options) {\n const state = createState(tree, options)\n const node = state.one(tree, undefined)\n const foot = footer(state)\n /** @type {HastNodes} */\n const result = Array.isArray(node)\n ? {type: 'root', children: node}\n : node || {type: 'root', children: []}\n\n if (foot) {\n // If there’s a footer, there were definitions, meaning block\n // content.\n // So `result` is a parent node.\n assert('children' in result)\n result.children.push({type: 'text', value: '\\n'}, foot)\n }\n\n return result\n}\n","/**\n * @import {Root as HastRoot} from 'hast'\n * @import {Root as MdastRoot} from 'mdast'\n * @import {Options as ToHastOptions} from 'mdast-util-to-hast'\n * @import {Processor} from 'unified'\n * @import {VFile} from 'vfile'\n */\n\n/**\n * @typedef {Omit<ToHastOptions, 'file'>} Options\n *\n * @callback TransformBridge\n * Bridge-mode.\n *\n * Runs the destination with the new hast tree.\n * Discards result.\n * @param {MdastRoot} tree\n * Tree.\n * @param {VFile} file\n * File.\n * @returns {Promise<undefined>}\n * Nothing.\n *\n * @callback TransformMutate\n * Mutate-mode.\n *\n * Further transformers run on the hast tree.\n * @param {MdastRoot} tree\n * Tree.\n * @param {VFile} file\n * File.\n * @returns {HastRoot}\n * Tree (hast).\n */\n\nimport {toHast} from 'mdast-util-to-hast'\n\n/**\n * Turn markdown into HTML.\n *\n * ##### Notes\n *\n * ###### Signature\n *\n * * if a processor is given,\n * runs the (rehype) plugins used on it with a hast tree,\n * then discards the result (*bridge mode*)\n * * otherwise,\n * returns a hast tree,\n * the plugins used after `remarkRehype` are rehype plugins (*mutate mode*)\n *\n * > 👉 **Note**:\n * > It’s highly unlikely that you want to pass a `processor`.\n *\n * ###### HTML\n *\n * Raw HTML is available in mdast as `html` nodes and can be embedded in hast\n * as semistandard `raw` nodes.\n * Most plugins ignore `raw` nodes but two notable ones don’t:\n *\n * * `rehype-stringify` also has an option `allowDangerousHtml` which will\n * output the raw HTML.\n * This is typically discouraged as noted by the option name but is useful if\n * you completely trust authors\n * * `rehype-raw` can handle the raw embedded HTML strings by parsing them\n * into standard hast nodes (`element`, `text`, etc);\n * this is a heavy task as it needs a full HTML parser,\n * but it is the only way to support untrusted content\n *\n * ###### Footnotes\n *\n * Many options supported here relate to footnotes.\n * Footnotes are not specified by CommonMark,\n * which we follow by default.\n * They are supported by GitHub,\n * so footnotes can be enabled in markdown with `remark-gfm`.\n *\n * The options `footnoteBackLabel` and `footnoteLabel` define natural language\n * that explains footnotes,\n * which is hidden for sighted users but shown to assistive technology.\n * When your page is not in English,\n * you must define translated values.\n *\n * Back references use ARIA attributes,\n * but the section label itself uses a heading that is hidden with an\n * `sr-only` class.\n * To show it to sighted users,\n * define different attributes in `footnoteLabelProperties`.\n *\n * ###### Clobbering\n *\n * Footnotes introduces a problem,\n * as it links footnote calls to footnote definitions on the page through `id`\n * attributes generated from user content,\n * which results in DOM clobbering.\n *\n * DOM clobbering is this:\n *\n * ```html\n * <p id=x></p>\n * <script>alert(x) // `x` now refers to the DOM `p#x` element</script>\n * ```\n *\n * Elements by their ID are made available by browsers on the `window` object,\n * which is a security risk.\n * Using a prefix solves this problem.\n *\n * More information on how to handle clobbering and the prefix is explained in\n * *Example: headings (DOM clobbering)* in `rehype-sanitize`.\n *\n * ###### Unknown nodes\n *\n * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`.\n * The default behavior for unknown nodes is:\n *\n * * when the node has a `value`\n * (and doesn’t have `data.hName`, `data.hProperties`, or `data.hChildren`,\n * see later),\n * create a hast `text` node\n * * otherwise,\n * create a `<div>` element (which could be changed with `data.hName`),\n * with its children mapped from mdast to hast as well\n *\n * This behavior can be changed by passing an `unknownHandler`.\n *\n * @overload\n * @param {Processor} processor\n * @param {Readonly<Options> | null | undefined} [options]\n * @returns {TransformBridge}\n *\n * @overload\n * @param {Readonly<Options> | null | undefined} [options]\n * @returns {TransformMutate}\n *\n * @overload\n * @param {Readonly<Options> | Processor | null | undefined} [destination]\n * @param {Readonly<Options> | null | undefined} [options]\n * @returns {TransformBridge | TransformMutate}\n *\n * @param {Readonly<Options> | Processor | null | undefined} [destination]\n * Processor or configuration (optional).\n * @param {Readonly<Options> | null | undefined} [options]\n * When a processor was given,\n * configuration (optional).\n * @returns {TransformBridge | TransformMutate}\n * Transform.\n */\nexport default function remarkRehype(destination, options) {\n if (destination && 'run' in destination) {\n /**\n * @type {TransformBridge}\n */\n return async function (tree, file) {\n // Cast because root in -> root out.\n const hastTree = /** @type {HastRoot} */ (\n toHast(tree, {file, ...options})\n )\n await destination.run(hastTree, file)\n }\n }\n\n /**\n * @type {TransformMutate}\n */\n return function (tree, file) {\n // Cast because root in -> root out.\n // To do: in the future, disallow ` || options` fallback.\n // With `unified-engine`, `destination` can be `undefined` but\n // `options` will be the file set.\n // We should not pass that as `options`.\n return /** @type {HastRoot} */ (\n toHast(tree, {file, ...(destination || options)})\n )\n }\n}\n","/**\n * @import {Schema} from 'hast-util-sanitize'\n */\n\n// Couple of ARIA attributes allowed in several, but not all, places.\nconst aria = ['ariaDescribedBy', 'ariaLabel', 'ariaLabelledBy']\n\n/**\n * Default schema.\n *\n * Follows GitHub style sanitation.\n *\n * @type {Schema}\n */\nexport const defaultSchema = {\n ancestors: {\n tbody: ['table'],\n td: ['table'],\n th: ['table'],\n thead: ['table'],\n tfoot: ['table'],\n tr: ['table']\n },\n attributes: {\n a: [\n ...aria,\n // Note: these 3 are used by GFM footnotes, they do work on all links.\n 'dataFootnoteBackref',\n 'dataFootnoteRef',\n ['className', 'data-footnote-backref'],\n 'href'\n ],\n blockquote: ['cite'],\n // Note: this class is not normally allowed by GH, when manually writing\n // `code` as HTML in markdown, they adds it some other way.\n // We can’t do that, so we have to allow it.\n code: [['className', /^language-./]],\n del: ['cite'],\n div: ['itemScope', 'itemType'],\n dl: [...aria],\n // Note: this is used by GFM footnotes.\n h2: [['className', 'sr-only']],\n img: [...aria, 'longDesc', 'src'],\n // Note: `input` is not normally allowed by GH, when manually writing\n // it in markdown, they add it from tasklists some other way.\n // We can’t do that, so we have to allow it.\n input: [\n ['disabled', true],\n ['type', 'checkbox']\n ],\n ins: ['cite'],\n // Note: this class is not normally allowed by GH, when manually writing\n // `li` as HTML in markdown, they adds it some other way.\n // We can’t do that, so we have to allow it.\n li: [['className', 'task-list-item']],\n // Note: this class is not normally allowed by GH, when manually writing\n // `ol` as HTML in markdown, they adds it some other way.\n // We can’t do that, so we have to allow it.\n ol: [...aria, ['className', 'contains-task-list']],\n q: ['cite'],\n section: ['dataFootnotes', ['className', 'footnotes']],\n source: ['srcSet'],\n summary: [...aria],\n table: [...aria],\n // Note: this class is not normally allowed by GH, when manually writing\n // `ol` as HTML in markdown, they adds it some other way.\n // We can’t do that, so we have to allow it.\n ul: [...aria, ['className', 'contains-task-list']],\n '*': [\n 'abbr',\n 'accept',\n 'acceptCharset',\n 'accessKey',\n 'action',\n 'align',\n 'alt',\n 'axis',\n 'border',\n 'cellPadding',\n 'cellSpacing',\n 'char',\n 'charOff',\n 'charSet',\n 'checked',\n 'clear',\n 'colSpan',\n 'color',\n 'cols',\n 'compact',\n 'coords',\n 'dateTime',\n 'dir',\n // Note: `disabled` is technically allowed on all elements by GH.\n // But it is useless on everything except `input`.\n // Because `input`s are normally not allowed, but we allow them for\n // checkboxes due to tasklists, we allow `disabled` only there.\n 'encType',\n 'frame',\n 'hSpace',\n 'headers',\n 'height',\n 'hrefLang',\n 'htmlFor',\n 'id',\n 'isMap',\n 'itemProp',\n 'label',\n 'lang',\n 'maxLength',\n 'media',\n 'method',\n 'multiple',\n 'name',\n 'noHref',\n 'noShade',\n 'noWrap',\n 'open',\n 'prompt',\n 'readOnly',\n 'rev',\n 'rowSpan',\n 'rows',\n 'rules',\n 'scope',\n 'selected',\n 'shape',\n 'size',\n 'span',\n 'start',\n 'summary',\n 'tabIndex',\n 'title',\n 'useMap',\n 'vAlign',\n 'value',\n 'width'\n ]\n },\n clobber: ['ariaDescribedBy', 'ariaLabelledBy', 'id', 'name'],\n clobberPrefix: 'user-content-',\n protocols: {\n cite: ['http', 'https'],\n href: ['http', 'https', 'irc', 'ircs', 'mailto', 'xmpp'],\n longDesc: ['http', 'https'],\n src: ['http', 'https']\n },\n required: {\n input: {disabled: true, type: 'checkbox'}\n },\n strip: ['script'],\n tagNames: [\n 'a',\n 'b',\n 'blockquote',\n 'br',\n 'code',\n 'dd',\n 'del',\n 'details',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'hr',\n 'i',\n 'img',\n // Note: `input` is not normally allowed by GH, when manually writing\n // it in markdown, they add it from tasklists some other way.\n // We can’t do that, so we have to allow it.\n 'input',\n 'ins',\n 'kbd',\n 'li',\n 'ol',\n 'p',\n 'picture',\n 'pre',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'section',\n 'source',\n 'span',\n 'strike',\n 'strong',\n 'sub',\n 'summary',\n 'sup',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'tr',\n 'tt',\n 'ul',\n 'var'\n ]\n}\n","/**\n * @import {\n * Comment,\n * Doctype,\n * ElementContent,\n * Element,\n * Nodes,\n * Properties,\n * RootContent,\n * Root,\n * Text\n * } from 'hast'\n */\n\n/**\n * @typedef {[string, ...Array<Exclude<Properties[keyof Properties], Array<any>> | RegExp>] | string} PropertyDefinition\n * Definition for a property.\n *\n * @typedef Schema\n * Schema that defines what nodes and properties are allowed.\n *\n * The default schema is `defaultSchema`, which follows how GitHub cleans.\n * If any top-level key is missing in the given schema, the corresponding\n * value of the default schema is used.\n *\n * To extend the standard schema with a few changes, clone `defaultSchema`\n * like so:\n *\n * ```js\n * import deepmerge from 'deepmerge'\n * import {h} from 'hastscript'\n * import {defaultSchema, sanitize} from 'hast-util-sanitize'\n *\n * // This allows `className` on all elements.\n * const schema = deepmerge(defaultSchema, {attributes: {'*': ['className']}})\n *\n * const tree = sanitize(h('div', {className: ['foo']}), schema)\n *\n * // `tree` still has `className`.\n * console.log(tree)\n * // {\n * // type: 'element',\n * // tagName: 'div',\n * // properties: {className: ['foo']},\n * // children: []\n * // }\n * ```\n * @property {boolean | null | undefined} [allowComments=false]\n * Whether to allow comment nodes (default: `false`).\n *\n * For example:\n *\n * ```js\n * allowComments: true\n * ```\n * @property {boolean | null | undefined} [allowDoctypes=false]\n * Whether to allow doctype nodes (default: `false`).\n *\n * For example:\n *\n * ```js\n * allowDoctypes: true\n * ```\n * @property {Record<string, Array<string>> | null | undefined} [ancestors]\n * Map of tag names to a list of tag names which are required ancestors\n * (default: `defaultSchema.ancestors`).\n *\n * Elements with these tag names will be ignored if they occur outside of one\n * of their allowed parents.\n *\n * For example:\n *\n * ```js\n * ancestors: {\n * tbody: ['table'],\n * // …\n * tr: ['table']\n * }\n * ```\n * @property {Record<string, Array<PropertyDefinition>> | null | undefined} [attributes]\n * Map of tag names to allowed property names (default:\n * `defaultSchema.attributes`).\n *\n * The special key `'*'` as a tag name defines property names allowed on all\n * elements.\n *\n * The special value `'data*'` as a property name can be used to allow all\n * `data` properties.\n *\n * For example:\n *\n * ```js\n * attributes: {\n * 'ariaDescribedBy', 'ariaLabel', 'ariaLabelledBy', …, 'href'\n * // …\n * '*': [\n * 'abbr',\n * 'accept',\n * 'acceptCharset',\n * // …\n * 'vAlign',\n * 'value',\n * 'width'\n * ]\n * }\n * ```\n *\n * Instead of a single string in the array, which allows any property value\n * for the field, you can use an array to allow several values.\n * For example, `input: ['type']` allows `type` set to any value on `input`s.\n * But `input: [['type', 'checkbox', 'radio']]` allows `type` when set to\n * `'checkbox'` or `'radio'`.\n *\n * You can use regexes, so for example `span: [['className', /^hljs-/]]`\n * allows any class that starts with `hljs-` on `span`s.\n *\n * When comma- or space-separated values are used (such as `className`), each\n * value in is checked individually.\n * For example, to allow certain classes on `span`s for syntax highlighting,\n * use `span: [['className', 'number', 'operator', 'token']]`.\n * This will allow `'number'`, `'operator'`, and `'token'` classes, but drop\n * others.\n * @property {Array<string> | null | undefined} [clobber]\n * List of property names that clobber (default: `defaultSchema.clobber`).\n *\n * For example:\n *\n * ```js\n * clobber: ['ariaDescribedBy', 'ariaLabelledBy', 'id', 'name']\n * ```\n * @property {string | null | undefined} [clobberPrefix]\n * Prefix to use before clobbering properties (default:\n * `defaultSchema.clobberPrefix`).\n *\n * For example:\n *\n * ```js\n * clobberPrefix: 'user-content-'\n * ```\n * @property {Record<string, Array<string> | null | undefined> | null | undefined} [protocols]\n * Map of *property names* to allowed protocols (default:\n * `defaultSchema.protocols`).\n *\n * This defines URLs that are always allowed to have local URLs (relative to\n * the current website, such as `this`, `#this`, `/this`, or `?this`), and\n * only allowed to have remote URLs (such as `https://example.com`) if they\n * use a known protocol.\n *\n * For example:\n *\n * ```js\n * protocols: {\n * cite: ['http', 'https'],\n * // …\n * src: ['http', 'https']\n * }\n * ```\n * @property {Record<string, Record<string, Properties[keyof Properties]>> | null | undefined} [required]\n * Map of tag names to required property names with a default value\n * (default: `defaultSchema.required`).\n *\n * This defines properties that must be set.\n * If a field does not exist (after the element was made safe), these will be\n * added with the given value.\n *\n * For example:\n *\n * ```js\n * required: {\n * input: {disabled: true, type: 'checkbox'}\n * }\n * ```\n *\n * > 👉 **Note**: properties are first checked based on `schema.attributes`,\n * > then on `schema.required`.\n * > That means properties could be removed by `attributes` and then added\n * > again with `required`.\n * @property {Array<string> | null | undefined} [strip]\n * List of tag names to strip from the tree (default: `defaultSchema.strip`).\n *\n * By default, unsafe elements (those not in `schema.tagNames`) are replaced\n * by what they contain.\n * This option can drop their contents.\n *\n * For example:\n *\n * ```js\n * strip: ['script']\n * ```\n * @property {Array<string> | null | undefined} [tagNames]\n * List of allowed tag names (default: `defaultSchema.tagNames`).\n *\n * For example:\n *\n * ```js\n * tagNames: [\n * 'a',\n * 'b',\n * // …\n * 'ul',\n * 'var'\n * ]\n * ```\n *\n * @typedef State\n * Info passed around.\n * @property {Readonly<Schema>} schema\n * Schema.\n * @property {Array<string>} stack\n * Tag names of ancestors.\n */\n\nimport structuredClone from '@ungap/structured-clone'\nimport {position} from 'unist-util-position'\nimport {defaultSchema} from './schema.js'\n\nconst own = {}.hasOwnProperty\n\n/**\n * Sanitize a tree.\n *\n * @param {Readonly<Nodes>} node\n * Unsafe tree.\n * @param {Readonly<Schema> | null | undefined} [options]\n * Configuration (default: `defaultSchema`).\n * @returns {Nodes}\n * New, safe tree.\n */\nexport function sanitize(node, options) {\n /** @type {Nodes} */\n let result = {type: 'root', children: []}\n\n /** @type {State} */\n const state = {\n schema: options ? {...defaultSchema, ...options} : defaultSchema,\n stack: []\n }\n const replace = transform(state, node)\n\n if (replace) {\n if (Array.isArray(replace)) {\n if (replace.length === 1) {\n result = replace[0]\n } else {\n result.children = replace\n }\n } else {\n result = replace\n }\n }\n\n return result\n}\n\n/**\n * Sanitize `node`.\n *\n * @param {State} state\n * Info passed around.\n * @param {Readonly<unknown>} node\n * Unsafe node.\n * @returns {Array<ElementContent> | Nodes | undefined}\n * Safe result.\n */\nfunction transform(state, node) {\n if (node && typeof node === 'object') {\n const unsafe = /** @type {Record<string, Readonly<unknown>>} */ (node)\n const type = typeof unsafe.type === 'string' ? unsafe.type : ''\n\n switch (type) {\n case 'comment': {\n return comment(state, unsafe)\n }\n\n case 'doctype': {\n return doctype(state, unsafe)\n }\n\n case 'element': {\n return element(state, unsafe)\n }\n\n case 'root': {\n return root(state, unsafe)\n }\n\n case 'text': {\n return text(state, unsafe)\n }\n\n default:\n }\n }\n}\n\n/**\n * Make a safe comment.\n *\n * @param {State} state\n * Info passed around.\n * @param {Readonly<Record<string, Readonly<unknown>>>} unsafe\n * Unsafe comment-like value.\n * @returns {Comment | undefined}\n * Safe comment (if with `allowComments`).\n */\nfunction comment(state, unsafe) {\n if (state.schema.allowComments) {\n // See <https://html.spec.whatwg.org/multipage/parsing.html#serialising-html-fragments>\n const result = typeof unsafe.value === 'string' ? unsafe.value : ''\n const index = result.indexOf('-->')\n const value = index < 0 ? result : result.slice(0, index)\n\n /** @type {Comment} */\n const node = {type: 'comment', value}\n\n patch(node, unsafe)\n\n return node\n }\n}\n\n/**\n * Make a safe doctype.\n *\n * @param {State} state\n * Info passed around.\n * @param {Readonly<Record<string, Readonly<unknown>>>} unsafe\n * Unsafe doctype-like value.\n * @returns {Doctype | undefined}\n * Safe doctype (if with `allowDoctypes`).\n */\nfunction doctype(state, unsafe) {\n if (state.schema.allowDoctypes) {\n /** @type {Doctype} */\n const node = {type: 'doctype'}\n\n patch(node, unsafe)\n\n return node\n }\n}\n\n/**\n * Make a safe element.\n *\n * @param {State} state\n * Info passed around.\n * @param {Readonly<Record<string, Readonly<unknown>>>} unsafe\n * Unsafe element-like value.\n * @returns {Array<ElementContent> | Element | undefined}\n * Safe element.\n */\nfunction element(state, unsafe) {\n const name = typeof unsafe.tagName === 'string' ? unsafe.tagName : ''\n\n state.stack.push(name)\n\n const content = /** @type {Array<ElementContent>} */ (\n children(state, unsafe.children)\n )\n const properties_ = properties(state, unsafe.properties)\n\n state.stack.pop()\n\n let safeElement = false\n\n if (\n name &&\n name !== '*' &&\n (!state.schema.tagNames || state.schema.tagNames.includes(name))\n ) {\n safeElement = true\n\n // Some nodes can break out of their context if they don’t have a certain\n // ancestor.\n if (state.schema.ancestors && own.call(state.schema.ancestors, name)) {\n const ancestors = state.schema.ancestors[name]\n let index = -1\n\n safeElement = false\n\n while (++index < ancestors.length) {\n if (state.stack.includes(ancestors[index])) {\n safeElement = true\n }\n }\n }\n }\n\n if (!safeElement) {\n return state.schema.strip && !state.schema.strip.includes(name)\n ? content\n : undefined\n }\n\n /** @type {Element} */\n const node = {\n type: 'element',\n tagName: name,\n properties: properties_,\n children: content\n }\n\n patch(node, unsafe)\n\n return node\n}\n\n/**\n * Make a safe root.\n *\n * @param {State} state\n * Info passed around.\n * @param {Readonly<Record<string, Readonly<unknown>>>} unsafe\n * Unsafe root-like value.\n * @returns {Root}\n * Safe root.\n */\nfunction root(state, unsafe) {\n const content = /** @type {Array<RootContent>} */ (\n children(state, unsafe.children)\n )\n\n /** @type {Root} */\n const node = {type: 'root', children: content}\n\n patch(node, unsafe)\n\n return node\n}\n\n/**\n * Make a safe text.\n *\n * @param {State} _\n * Info passed around.\n * @param {Readonly<Record<string, Readonly<unknown>>>} unsafe\n * Unsafe text-like value.\n * @returns {Text}\n * Safe text.\n */\nfunction text(_, unsafe) {\n const value = typeof unsafe.value === 'string' ? unsafe.value : ''\n /** @type {Text} */\n const node = {type: 'text', value}\n\n patch(node, unsafe)\n\n return node\n}\n\n/**\n * Make children safe.\n *\n * @param {State} state\n * Info passed around.\n * @param {Readonly<unknown>} children\n * Unsafe value.\n * @returns {Array<Nodes>}\n * Safe children.\n */\nfunction children(state, children) {\n /** @type {Array<Nodes>} */\n const results = []\n\n if (Array.isArray(children)) {\n const childrenUnknown = /** @type {Array<Readonly<unknown>>} */ (children)\n let index = -1\n\n while (++index < childrenUnknown.length) {\n const value = transform(state, childrenUnknown[index])\n\n if (value) {\n if (Array.isArray(value)) {\n results.push(...value)\n } else {\n results.push(value)\n }\n }\n }\n }\n\n return results\n}\n\n/**\n * Make element properties safe.\n *\n * @param {State} state\n * Info passed around.\n * @param {Readonly<unknown>} properties\n * Unsafe value.\n * @returns {Properties}\n * Safe value.\n */\nfunction properties(state, properties) {\n const tagName = state.stack[state.stack.length - 1]\n const attributes = state.schema.attributes\n const required = state.schema.required\n const specific =\n attributes && own.call(attributes, tagName)\n ? attributes[tagName]\n : undefined\n const defaults =\n attributes && own.call(attributes, '*') ? attributes['*'] : undefined\n const properties_ =\n /** @type {Readonly<Record<string, Readonly<unknown>>>} */ (\n properties && typeof properties === 'object' ? properties : {}\n )\n /** @type {Properties} */\n const result = {}\n /** @type {string} */\n let key\n\n for (key in properties_) {\n if (own.call(properties_, key)) {\n const unsafe = properties_[key]\n let safe = propertyValue(\n state,\n findDefinition(specific, key),\n key,\n unsafe\n )\n\n if (safe === null || safe === undefined) {\n safe = propertyValue(state, findDefinition(defaults, key), key, unsafe)\n }\n\n if (safe !== null && safe !== undefined) {\n result[key] = safe\n }\n }\n }\n\n if (required && own.call(required, tagName)) {\n const properties = required[tagName]\n\n for (key in properties) {\n if (own.call(properties, key) && !own.call(result, key)) {\n result[key] = properties[key]\n }\n }\n }\n\n return result\n}\n\n/**\n * Sanitize a property value.\n *\n * @param {State} state\n * Info passed around.\n * @param {Readonly<PropertyDefinition> | undefined} definition\n * Definition.\n * @param {string} key\n * Field name.\n * @param {Readonly<unknown>} value\n * Unsafe value (but an array).\n * @returns {Array<number | string> | boolean | number | string | undefined}\n * Safe value.\n */\nfunction propertyValue(state, definition, key, value) {\n return definition\n ? Array.isArray(value)\n ? propertyValueMany(state, definition, key, value)\n : propertyValuePrimitive(state, definition, key, value)\n : undefined\n}\n\n/**\n * Sanitize a property value which is a list.\n *\n * @param {State} state\n * Info passed around.\n * @param {Readonly<PropertyDefinition>} definition\n * Definition.\n * @param {string} key\n * Field name.\n * @param {Readonly<Array<Readonly<unknown>>>} values\n * Unsafe value (but an array).\n * @returns {Array<number | string>}\n * Safe value.\n */\nfunction propertyValueMany(state, definition, key, values) {\n let index = -1\n /** @type {Array<number | string>} */\n const result = []\n\n while (++index < values.length) {\n const value = propertyValuePrimitive(state, definition, key, values[index])\n\n if (typeof value === 'number' || typeof value === 'string') {\n result.push(value)\n }\n }\n\n return result\n}\n\n/**\n * Sanitize a property value which is a primitive.\n *\n * @param {State} state\n * Info passed around.\n * @param {Readonly<PropertyDefinition>} definition\n * Definition.\n * @param {string} key\n * Field name.\n * @param {Readonly<unknown>} value\n * Unsafe value (but not an array).\n * @returns {boolean | number | string | undefined}\n * Safe value.\n */\nfunction propertyValuePrimitive(state, definition, key, value) {\n if (\n typeof value !== 'boolean' &&\n typeof value !== 'number' &&\n typeof value !== 'string'\n ) {\n return\n }\n\n if (!safeProtocol(state, key, value)) {\n return\n }\n\n // Just a string, or only one item in an array, means all values are OK.\n // More than one item means an allow list.\n if (typeof definition === 'object' && definition.length > 1) {\n let ok = false\n let index = 0 // Ignore `key`, which is the first item.\n\n while (++index < definition.length) {\n const allowed = definition[index]\n\n // Expression.\n if (allowed && typeof allowed === 'object' && 'flags' in allowed) {\n if (allowed.test(String(value))) {\n ok = true\n break\n }\n }\n // Primitive.\n else if (allowed === value) {\n ok = true\n break\n }\n }\n\n if (!ok) return\n }\n\n return state.schema.clobber &&\n state.schema.clobberPrefix &&\n state.schema.clobber.includes(key)\n ? state.schema.clobberPrefix + value\n : value\n}\n\n/**\n * Check whether `value` is a safe URL.\n *\n * @param {State} state\n * Info passed around.\n * @param {string} key\n * Field name.\n * @param {Readonly<unknown>} value\n * Unsafe value.\n * @returns {boolean}\n * Whether it’s a safe value.\n */\nfunction safeProtocol(state, key, value) {\n const protocols =\n state.schema.protocols && own.call(state.schema.protocols, key)\n ? state.schema.protocols[key]\n : undefined\n\n // No protocols defined? Then everything is fine.\n if (!protocols || protocols.length === 0) {\n return true\n }\n\n const url = String(value)\n const colon = url.indexOf(':')\n const questionMark = url.indexOf('?')\n const numberSign = url.indexOf('#')\n const slash = url.indexOf('/')\n\n if (\n colon < 0 ||\n // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.\n (slash > -1 && colon > slash) ||\n (questionMark > -1 && colon > questionMark) ||\n (numberSign > -1 && colon > numberSign)\n ) {\n return true\n }\n\n let index = -1\n\n while (++index < protocols.length) {\n const protocol = protocols[index]\n\n if (\n colon === protocol.length &&\n url.slice(0, protocol.length) === protocol\n ) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * Add data and position.\n *\n * @param {Nodes} node\n * Node to patch safe data and position on.\n * @param {Readonly<Record<string, Readonly<unknown>>>} unsafe\n * Unsafe node-like value.\n * @returns {undefined}\n * Nothing.\n */\nfunction patch(node, unsafe) {\n const cleanPosition = position(\n // @ts-expect-error: looks like a node.\n unsafe\n )\n\n if (unsafe.data) {\n node.data = structuredClone(unsafe.data)\n }\n\n if (cleanPosition) node.position = cleanPosition\n}\n\n/**\n *\n * @param {Readonly<Array<PropertyDefinition>> | undefined} definitions\n * @param {string} key\n * @returns {Readonly<PropertyDefinition> | undefined}\n */\nfunction findDefinition(definitions, key) {\n /** @type {PropertyDefinition | undefined} */\n let dataDefault\n let index = -1\n\n if (definitions) {\n while (++index < definitions.length) {\n const entry = definitions[index]\n const name = typeof entry === 'string' ? entry : entry[0]\n\n if (name === key) {\n return entry\n }\n\n if (name === 'data*') dataDefault = entry\n }\n }\n\n if (key.length > 4 && key.slice(0, 4).toLowerCase() === 'data') {\n return dataDefault\n }\n}\n","/**\n * @typedef {import('hast').Root} Root\n * @typedef {import('hast-util-sanitize').Schema} Schema\n */\n\nimport {sanitize} from 'hast-util-sanitize'\n\n/**\n * Sanitize HTML.\n *\n * @param {Schema | null | undefined} [options]\n * Configuration (optional).\n * @returns\n * Transform.\n */\nexport default function rehypeSanitize(options) {\n /**\n * @param {Root} tree\n * Tree.\n * @returns {Root}\n * New tree.\n */\n return function (tree) {\n // Assume root in -> root out.\n const result = /** @type {Root} */ (sanitize(tree, options))\n return result\n }\n}\n","const identities = new WeakMap<object, number>()\r\nlet nextIdentity = 1\r\n\r\n/** Stable process-local identity for objects and functions. */\r\nexport function identityOf(value: unknown): string {\r\n if (value === null) return 'null'\r\n if (value === undefined) return 'undefined'\r\n\r\n const type = typeof value\r\n if (type !== 'object' && type !== 'function') {\r\n return `${type}:${String(value)}`\r\n }\r\n\r\n const object = value as object\r\n let id = identities.get(object)\r\n if (id === undefined) {\r\n id = nextIdentity++\r\n identities.set(object, id)\r\n }\r\n return `${type}:${id}`\r\n}\r\n\r\nexport function listIdentity(list: readonly unknown[] | undefined): string {\r\n if (!list || list.length === 0) return ''\r\n return list.map(identityOf).join(',')\r\n}\r\n\r\nexport function stringListIdentity(list: readonly string[] | undefined): string {\r\n if (!list || list.length === 0) return ''\r\n return list.join('\\u001f')\r\n}\r\n","import { unified, type Pluggable, type Processor } from 'unified'\r\nimport type { Root } from 'hast'\r\nimport { VFile } from 'vfile'\r\nimport remarkParse from 'remark-parse'\r\nimport remarkRehype from 'remark-rehype'\r\nimport rehypeSanitize from 'rehype-sanitize'\r\nimport { defaultSchema, type Schema } from 'hast-util-sanitize'\r\nimport { visit } from 'unist-util-visit'\r\nimport type {\r\n HtmlSchemaExtension,\r\n MarkdownPipeline,\r\n MarkdownPlugin,\r\n PipelineCapabilities,\r\n PipelineContext,\r\n PipelineResult,\r\n PluginContext,\r\n} from '../core/types'\r\nimport { identityOf, listIdentity } from '../core/identity'\r\nimport { createDiagnostic, errorMessage } from '../core/diagnostics'\r\nimport { ALLOWED_TAGS, DANGEROUS_TAGS } from '../core/security'\r\n\r\nconst CONTEXT_KEY = 'vmdPipelineContext'\r\n\r\nconst CAPABILITIES: PipelineCapabilities = {\r\n sync: true,\r\n plugins: true,\r\n}\r\n\r\ntype AnyProcessor = Processor<any, any, any, any, any>\r\n\r\nfunction useItem(processor: AnyProcessor, item: Pluggable): void {\r\n if (Array.isArray(item)) {\r\n const [plugin, ...rest] = item\r\n processor.use(plugin as never, ...(rest as never[]))\r\n } else {\r\n processor.use(item as never)\r\n }\r\n}\r\n\r\nfunction recordPluginError(\r\n ctx: PipelineContext,\r\n phase: 'remark' | 'rehype',\r\n plugin: string,\r\n error: unknown,\r\n): void {\r\n ctx.diagnostics.push(\r\n createDiagnostic('plugin-run', errorMessage(error), {\r\n phase,\r\n plugin,\r\n }),\r\n )\r\n}\r\n\r\nfunction readContext(file: unknown, fallback: PipelineContext): PipelineContext {\r\n const data = (file as { data?: Record<string, unknown> } | undefined)?.data\r\n const value = data?.[CONTEXT_KEY]\r\n return value && typeof value === 'object'\r\n ? (value as PipelineContext)\r\n : fallback\r\n}\r\n\r\nfunction pluginContext(ctx: PipelineContext): PluginContext {\r\n return {\r\n source: ctx.source,\r\n options: ctx.options ?? {},\r\n diagnostics: ctx.diagnostics,\r\n addDiagnostic(diagnostic) {\r\n ctx.diagnostics.push(diagnostic)\r\n },\r\n }\r\n}\r\n\r\nfunction reportPluginError(\r\n ctx: PipelineContext,\r\n phase: 'remark' | 'rehype',\r\n name: string,\r\n error: unknown,\r\n owner: MarkdownPlugin | undefined,\r\n): void {\r\n recordPluginError(ctx, phase, name, error)\r\n if (!owner?.onError) return\r\n try {\r\n owner.onError(error, phase, pluginContext(ctx))\r\n } catch (secondary) {\r\n ctx.diagnostics.push(\r\n createDiagnostic('plugin-onerror', errorMessage(secondary), {\r\n phase,\r\n plugin: name,\r\n }),\r\n )\r\n }\r\n}\r\n\r\nfunction ownerOf(\r\n ctx: PipelineContext,\r\n item: Pluggable,\r\n phase: 'remark' | 'rehype',\r\n): MarkdownPlugin | undefined {\r\n for (const plugin of ctx.plugins) {\r\n const list = phase === 'remark' ? plugin.remarkPlugins : plugin.rehypePlugins\r\n if (list && list.indexOf(item) !== -1) return plugin\r\n }\r\n return undefined\r\n}\r\n\r\n/** Isolate a plugin transformer so one failure cannot abort the pipeline. */\r\nfunction guardItem(\r\n item: Pluggable,\r\n phase: 'remark' | 'rehype',\r\n owner: MarkdownPlugin | undefined,\r\n fallback: PipelineContext,\r\n): Pluggable {\r\n const name = pluginName(item) || owner?.name || 'anonymous'\r\n\r\n const wrap = (plugin: unknown): unknown => {\r\n if (typeof plugin !== 'function') return plugin\r\n return function (this: unknown, ...args: unknown[]) {\r\n const transformer = (plugin as (...values: unknown[]) => unknown).apply(\r\n this,\r\n args,\r\n )\r\n if (typeof transformer !== 'function') return transformer\r\n return (tree: unknown, file: unknown) => {\r\n const ctx = readContext(file, fallback)\r\n try {\r\n const result = (\r\n transformer as (tree: unknown, file: unknown) => unknown\r\n )(tree, file)\r\n if (result && typeof (result as Promise<unknown>).then === 'function') {\r\n return (result as Promise<unknown>).catch((error: unknown) => {\r\n reportPluginError(ctx, phase, name, error, owner)\r\n return tree\r\n })\r\n }\r\n return result\r\n } catch (error) {\r\n reportPluginError(ctx, phase, name, error, owner)\r\n return tree\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (Array.isArray(item)) {\r\n return [wrap(item[0]), ...item.slice(1)] as Pluggable\r\n }\r\n return wrap(item) as Pluggable\r\n}\r\n\r\nexport function pluginName(item: unknown): string {\r\n if (typeof item === 'function') return item.name\r\n if (Array.isArray(item) && item.length > 0) return pluginName(item[0])\r\n if (item && typeof item === 'object' && 'name' in item) {\r\n return String((item as { name?: unknown }).name ?? '')\r\n }\r\n return ''\r\n}\r\n\r\nfunction isRehypeRaw(item: Pluggable): boolean {\r\n // Best-effort only: the supported path takes the parser by reference from\r\n // htmlPlugin(), and raw nodes are dropped before host rehype plugins run, so\r\n // a wrapped or minified manual parser cannot affect the result.\r\n return /^rehype[-_]?raw$/i.test(pluginName(item))\r\n}\r\n\r\nfunction rehypeDropRaw() {\r\n return () => (tree: Root) => {\r\n visit(tree, 'raw', (node, index, parent) => {\r\n if (parent && typeof index === 'number') {\r\n parent.children.splice(index, 1)\r\n return index\r\n }\r\n })\r\n }\r\n}\r\n\r\nfunction textContent(node: unknown): string {\r\n if (!node || typeof node !== 'object') return ''\r\n const value = (node as { value?: unknown }).value\r\n if (typeof value === 'string') return value\r\n const children = (node as { children?: unknown[] }).children\r\n if (!Array.isArray(children)) return ''\r\n return children.map(textContent).join('')\r\n}\r\n\r\nfunction rehypeHeadingIds(options: { slugger: PipelineContext['slugger']; idPrefix: string }) {\r\n return () => (tree: Root) => {\r\n options.slugger.reset?.()\r\n visit(tree, 'element', (node) => {\r\n if (!/^h[1-6]$/.test(node.tagName)) return\r\n const text = textContent(node).trim()\r\n if (!text) return\r\n node.properties = {\r\n ...node.properties,\r\n id: `${options.idPrefix}${options.slugger.slug(text)}`,\r\n }\r\n })\r\n }\r\n}\r\n\r\nfunction sanitizeSchema(\r\n extensions: Array<HtmlSchemaExtension | undefined>,\r\n): Schema {\r\n const defaults = defaultSchema.attributes ?? {}\r\n const tagNames = [...ALLOWED_TAGS]\r\n const attributes = {\r\n ...defaults,\r\n '*': [\r\n ...(defaults['*'] ?? []),\r\n 'className',\r\n 'data*',\r\n 'role',\r\n 'hidden',\r\n 'ariaLabel',\r\n 'ariaLabelledBy',\r\n 'ariaDescribedBy',\r\n 'ariaHidden',\r\n 'ariaCurrent',\r\n 'ariaExpanded',\r\n 'ariaControls',\r\n 'ariaLive',\r\n ],\r\n a: [...(defaults.a ?? []), 'target', 'rel', 'download'],\r\n img: [\r\n ...(defaults.img ?? []),\r\n 'srcSet',\r\n 'sizes',\r\n 'loading',\r\n 'decoding',\r\n ],\r\n source: ['src', 'srcSet', 'media', 'sizes', 'type'],\r\n } as NonNullable<Schema['attributes']>\r\n const protocols = {\r\n ...(defaultSchema.protocols ?? {}),\r\n // The core URL policy still rejects data:image/svg+xml and non-image data\r\n // URLs; allowing data here keeps raster image data URLs at parity with\r\n // Markdown image syntax.\r\n src: ['http', 'https', 'data'],\r\n } as NonNullable<Schema['protocols']>\r\n\r\n // `hast-util-sanitize` checks tag-specific definitions before the `'*'`\r\n // fallback. Replace the restrictive `className` entries (for example\r\n // `code: [['className', /^language-./]]`) with an unconstrained definition\r\n // so raw HTML classes and math classes survive. Class names are not\r\n // executable, and the core model builder keeps its global class policy.\r\n for (const tag of Object.keys(attributes)) {\r\n if (tag === '*') continue\r\n const definitions = attributes[tag]\r\n if (\r\n !definitions.some(\r\n (entry) => (typeof entry === 'string' ? entry : entry[0]) === 'className',\r\n )\r\n ) {\r\n continue\r\n }\r\n attributes[tag] = [\r\n 'className',\r\n ...definitions.filter(\r\n (entry) => (typeof entry === 'string' ? entry : entry[0]) !== 'className',\r\n ),\r\n ]\r\n }\r\n\r\n for (const extension of extensions) {\r\n if (!extension) continue\r\n for (const tag of extension.tags ?? []) {\r\n // tagNames membership short-circuits the strip list in\r\n // hast-util-sanitize, so a dangerous tag must never be added here.\r\n if (DANGEROUS_TAGS.has(tag)) continue\r\n if (tagNames.indexOf(tag) === -1) tagNames.push(tag)\r\n }\r\n for (const tag of Object.keys(extension.attributes ?? {})) {\r\n const extra = (extension.attributes?.[tag] ?? []).filter((name) => {\r\n const lower = name.toLowerCase()\r\n return (\r\n !lower.startsWith('on') &&\r\n lower !== 'style' &&\r\n lower !== 'srcdoc'\r\n )\r\n })\r\n attributes[tag] = [...(attributes[tag] ?? []), ...extra]\r\n }\r\n }\r\n\r\n return {\r\n ...defaultSchema,\r\n clobberPrefix: '',\r\n tagNames,\r\n strip: [...DANGEROUS_TAGS],\r\n attributes,\r\n protocols,\r\n }\r\n}\r\n\r\nexport interface OfficialPipelineOptions {\r\n name?: string\r\n}\r\n\r\nexport function createOfficialPipeline(\r\n options: OfficialPipelineOptions = {},\r\n): MarkdownPipeline {\r\n let cachedKey = ''\r\n let cachedProcessor: AnyProcessor | undefined\r\n\r\n const build = (ctx: PipelineContext): AnyProcessor => {\r\n const htmlPlugins = ctx.plugins.filter((plugin) => plugin.html === true)\r\n const rawItems: Pluggable[] = []\r\n for (const plugin of htmlPlugins) {\r\n if (plugin.rehypePlugins) rawItems.push(...plugin.rehypePlugins)\r\n }\r\n const hasRaw = rawItems.length > 0\r\n const hostRehype = ctx.rehypePlugins.filter((item) => {\r\n if (rawItems.indexOf(item) !== -1) return false\r\n if (!isRehypeRaw(item)) return true\r\n // Manual rehype-raw bypasses the guaranteed sanitizer and the documented\r\n // stage order. It is ignored, and raw nodes are dropped before host\r\n // plugins run, so a wrapped parser cannot inject elements either.\r\n ctx.diagnostics.push(\r\n createDiagnostic(\r\n 'html-plugin',\r\n 'Raw HTML is enabled with `htmlPlugin()` from \"@coderminer/vue-markdown/html\"; manual rehype-raw is ignored.',\r\n { severity: 'warning', phase: 'pipeline', plugin: 'html' },\r\n ),\r\n )\r\n return false\r\n })\r\n\r\n const key = [\r\n ctx.plugins.map((plugin) => identityOf(plugin)).join(','),\r\n listIdentity(ctx.remarkPlugins),\r\n listIdentity(hostRehype),\r\n listIdentity(rawItems),\r\n identityOf(ctx.remarkRehypeOptions),\r\n identityOf(ctx.slugger),\r\n ctx.idPrefix,\r\n htmlPlugins.map((plugin) => identityOf(plugin.htmlSchema)).join(','),\r\n hasRaw ? '1' : '0',\r\n ].join('\\u001e')\r\n\r\n if (cachedProcessor && cachedKey === key) return cachedProcessor\r\n\r\n const processor = unified().use(remarkParse)\r\n\r\n for (const item of ctx.remarkPlugins) {\r\n useItem(processor, guardItem(item, 'remark', ownerOf(ctx, item, 'remark'), ctx))\r\n }\r\n\r\n processor.use(remarkRehype, {\r\n allowDangerousHtml: true,\r\n ...ctx.remarkRehypeOptions,\r\n })\r\n\r\n if (hasRaw) {\r\n for (const item of rawItems) {\r\n useItem(processor, guardItem(item, 'rehype', ownerOf(ctx, item, 'rehype'), ctx))\r\n }\r\n processor.use(\r\n rehypeSanitize,\r\n sanitizeSchema(htmlPlugins.map((plugin) => plugin.htmlSchema)),\r\n )\r\n } else {\r\n processor.use(rehypeDropRaw())\r\n }\r\n\r\n processor.use(rehypeHeadingIds({ slugger: ctx.slugger, idPrefix: ctx.idPrefix }) as never)\r\n\r\n for (const item of hostRehype) {\r\n useItem(processor, guardItem(item, 'rehype', ownerOf(ctx, item, 'rehype'), ctx))\r\n }\r\n\r\n cachedKey = key\r\n cachedProcessor = processor\r\n return processor\r\n }\r\n\r\n const read = (hast: Root | undefined, file: VFile): PipelineResult => {\r\n if (!hast || hast.type !== 'root') {\r\n throw new Error('The Markdown pipeline did not produce a hast root.')\r\n }\r\n const frontmatter = file.data?.frontmatter as Record<string, unknown> | undefined\r\n return { hast, frontmatter }\r\n }\r\n\r\n return {\r\n name: options.name ?? 'official',\r\n capabilities: { ...CAPABILITIES },\r\n async process(source, ctx) {\r\n const processor = build(ctx)\r\n const file = new VFile({ value: source })\r\n const data = file.data as Record<string, unknown>\r\n data[CONTEXT_KEY] = ctx\r\n const tree = processor.parse(file)\r\n const hast = (await processor.run(tree, file)) as unknown as Root\r\n return read(hast, file)\r\n },\r\n processSync(source, ctx) {\r\n const processor = build(ctx)\r\n const file = new VFile({ value: source })\r\n const data = file.data as Record<string, unknown>\r\n data[CONTEXT_KEY] = ctx\r\n const tree = processor.parse(file)\r\n const hast = processor.runSync(tree, file) as unknown as Root\r\n return read(hast, file)\r\n },\r\n dispose() {\r\n cachedProcessor = undefined\r\n cachedKey = ''\r\n },\r\n }\r\n}\r\n","import type {\r\n MarkdownDiagnostic,\r\n MarkdownPipeline,\r\n PipelineResult,\r\n} from '../core/types'\r\nimport { createDiagnostic } from '../core/diagnostics'\r\nimport { createOfficialPipeline } from './official'\r\n\r\nexport function defineMarkdownPipeline(pipeline: MarkdownPipeline): MarkdownPipeline {\r\n const issues = validatePipeline(pipeline)\r\n if (issues.length > 0) {\r\n throw new TypeError(issues.map((issue) => issue.message).join(' '))\r\n }\r\n return pipeline\r\n}\r\n\r\nexport function validatePipeline(pipeline: unknown): MarkdownDiagnostic[] {\r\n const diagnostics: MarkdownDiagnostic[] = []\r\n if (!pipeline || typeof pipeline !== 'object') {\r\n diagnostics.push(\r\n createDiagnostic('pipeline-invalid', 'A pipeline must be an object.', {\r\n phase: 'pipeline',\r\n }),\r\n )\r\n return diagnostics\r\n }\r\n\r\n const candidate = pipeline as Partial<MarkdownPipeline>\r\n if (typeof candidate.name !== 'string' || candidate.name.trim() === '') {\r\n diagnostics.push(\r\n createDiagnostic('pipeline-name', 'A pipeline requires a non-empty name.', {\r\n phase: 'pipeline',\r\n }),\r\n )\r\n }\r\n if (typeof candidate.process !== 'function') {\r\n diagnostics.push(\r\n createDiagnostic(\r\n 'pipeline-process',\r\n 'A pipeline requires a `process` function.',\r\n { phase: 'pipeline' },\r\n ),\r\n )\r\n }\r\n if (\r\n candidate.processSync !== undefined &&\r\n typeof candidate.processSync !== 'function'\r\n ) {\r\n diagnostics.push(\r\n createDiagnostic(\r\n 'pipeline-sync',\r\n '`processSync` must be a function when provided.',\r\n { phase: 'pipeline' },\r\n ),\r\n )\r\n }\r\n if (candidate.dispose !== undefined && typeof candidate.dispose !== 'function') {\r\n diagnostics.push(\r\n createDiagnostic('pipeline-dispose', '`dispose` must be a function when provided.', {\r\n phase: 'pipeline',\r\n }),\r\n )\r\n }\r\n return diagnostics\r\n}\r\n\r\nexport function assertPipelineResult(result: unknown): PipelineResult {\r\n if (!result || typeof result !== 'object') {\r\n throw new TypeError('A pipeline must return a result object.')\r\n }\r\n const candidate = result as Partial<PipelineResult>\r\n if (!candidate.hast || candidate.hast.type !== 'root') {\r\n throw new TypeError('A pipeline result must include a hast root.')\r\n }\r\n return candidate as PipelineResult\r\n}\r\n\r\nexport function resolvePipeline(pipeline?: MarkdownPipeline): {\r\n pipeline: MarkdownPipeline\r\n diagnostics: MarkdownDiagnostic[]\r\n} {\r\n if (!pipeline) {\r\n return { pipeline: createOfficialPipeline(), diagnostics: [] }\r\n }\r\n\r\n const diagnostics = validatePipeline(pipeline)\r\n if (diagnostics.length > 0) {\r\n diagnostics.push(\r\n createDiagnostic(\r\n 'pipeline-fallback',\r\n 'Falling back to the official pipeline because the custom pipeline is invalid.',\r\n { severity: 'warning', phase: 'pipeline' },\r\n ),\r\n )\r\n return { pipeline: createOfficialPipeline(), diagnostics }\r\n }\r\n\r\n return { pipeline, diagnostics }\r\n}\r\n","import { identityOf, listIdentity } from '../core/identity'\r\nimport type { MarkdownDocumentOptions, MarkdownPlugin } from '../core/types'\r\n\r\nexport interface PipelineIdentityInput {\r\n pipelineName: string\r\n plugins: readonly MarkdownPlugin[]\r\n remarkPlugins: readonly unknown[]\r\n rehypePlugins: readonly unknown[]\r\n remarkRehypeOptions: Record<string, unknown> | undefined\r\n options: MarkdownDocumentOptions\r\n}\r\n\r\n/** Deterministic identity for parse-affecting configuration. */\r\nexport function createPipelineIdentity(input: PipelineIdentityInput): string {\r\n const { options } = input\r\n return [\r\n input.pipelineName,\r\n input.plugins.map((plugin) => plugin.name).join(','),\r\n input.plugins.map((plugin) => identityOf(plugin)).join(','),\r\n listIdentity(input.remarkPlugins),\r\n listIdentity(input.rehypePlugins),\r\n identityOf(input.remarkRehypeOptions),\r\n identityOf(options.slugger),\r\n options.idPrefix ?? '',\r\n options.baseUrl ?? '',\r\n (options.allowedElements ?? []).join('\\u001f'),\r\n (options.disallowedElements ?? []).join('\\u001f'),\r\n options.unwrapDisallowed ? '1' : '0',\r\n identityOf(options.allowElement),\r\n identityOf(options.urlTransform),\r\n options.search?.query?.trim() ?? '',\r\n options.search?.caseSensitive ? '1' : '0',\r\n ].join('\\u001e')\r\n}\r\n\r\nexport function createMemoKey(\r\n source: string,\r\n pipelineIdentity: string,\r\n extra = '',\r\n): string {\r\n return `${pipelineIdentity}\\u001d${extra}\\u001d${source}`\r\n}\r\n"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88],"mappings":";;;;;;;;;AAOA,SAAgBgE,EAAK,GAAO;CAC1B,IAAIC,GACF,MAAMA;AAEV;;;CCTA,IAAIE,IAAS,OAAO,UAAU,gBAC1BC,IAAQ,OAAO,UAAU,UACzBC,IAAiB,OAAO,gBACxBC,IAAO,OAAO,0BAEdC,IAAU,SAAiB,GAAK;EAKnC,OAJI,OAAO,MAAM,WAAY,aACrB,MAAM,QAAQC,CAAG,IAGlBJ,EAAM,KAAKI,CAAG,MAAM;CAC5B,GAEIC,IAAgB,SAAuB,GAAK;EAC/C,IAAI,CAACC,KAAON,EAAM,KAAKM,CAAG,MAAM,mBAC/B,OAAO;EAGR,IAAIC,IAAoBR,EAAO,KAAKO,GAAK,aAAa,GAClDE,IAAmBF,EAAI,eAAeA,EAAI,YAAY,aAAaP,EAAO,KAAKO,EAAI,YAAY,WAAW,eAAe;EAE7H,IAAIA,EAAI,eAAe,CAACC,KAAqB,CAACC,GAC7C,OAAO;EAMR,KADA,IAAIC,KACQH;EAEZ,OAAcG,MAAQ,UAAeV,EAAO,KAAKO,GAAKG,CAAG;CAC1D,GAGIC,IAAc,SAAqB,GAAQ,GAAS;EACvD,AAAIT,KAAkBU,EAAQ,SAAS,cACtCV,EAAeW,GAAQD,EAAQ,MAAM;GACpC,YAAY;GACZ,cAAc;GACd,OAAOA,EAAQ;GACf,UAAU;EACX,CAAC,IAED,EAAOA,EAAQ,QAAQA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