@storybook/codemod 8.3.0-alpha.3 → 8.3.0-alpha.5
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -0
- package/dist/index.js +1 -1
- package/dist/transforms/csf-2-to-3.js +1 -1
- package/dist/transforms/mdx-to-csf.js +3 -3
- package/dist/transforms/storiesof-to-csf.js +1 -1
- package/dist/transforms/upgrade-deprecated-types.d.ts +1 -1
- package/dist/transforms/upgrade-deprecated-types.js +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
@@ -134,6 +134,7 @@ For example:
|
|
134
134
|
|
135
135
|
```js
|
136
136
|
import { Button } from './Button';
|
137
|
+
|
137
138
|
storiesOf('Button', module).add('story', () => <Button label="The Button" />);
|
138
139
|
```
|
139
140
|
|
@@ -141,6 +142,7 @@ Becomes:
|
|
141
142
|
|
142
143
|
```js
|
143
144
|
import { Button } from './Button';
|
145
|
+
|
144
146
|
storiesOf('Button', module)
|
145
147
|
.addParameters({ component: Button })
|
146
148
|
.add('story', () => <Button label="The Button" />);
|
package/dist/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};__export(src_exports,{listCodemods:()=>listCodemods,packageNames:()=>packageNames,runCodemod:()=>runCodemod,updateAddonInfo:()=>transformer2,updateOrganisationName:()=>transformer});module.exports=__toCommonJS(src_exports);var
|
1
|
+
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};__export(src_exports,{listCodemods:()=>listCodemods,packageNames:()=>packageNames,runCodemod:()=>runCodemod,updateAddonInfo:()=>transformer2,updateOrganisationName:()=>transformer});module.exports=__toCommonJS(src_exports);var import_node_fs=require("fs"),import_promises=require("fs/promises"),import_node_path=require("path"),import_cross_spawn=require("cross-spawn");var import_camelCase=__toESM(require("lodash/camelCase.js")),import_upperFirst=__toESM(require("lodash/upperFirst.js"));function jscodeshiftToPrettierParser(parser){let parserMap={babylon:"babel",flow:"flow",ts:"typescript",tsx:"typescript"};return parser&&parserMap[parser]||"babel"}var packageNames={"@kadira/react-storybook-decorator-centered":"@storybook/addon-centered","@kadira/storybook-addons":"storybook/internal/preview-api","@kadira/storybook-addon-actions":"@storybook/addon-actions","@kadira/storybook-addon-comments":"@storybook/addon-comments","@kadira/storybook-addon-graphql":"@storybook/addon-graphql","@kadira/storybook-addon-info":"@storybook/addon-info","@kadira/storybook-addon-knobs":"@storybook/addon-knobs","@kadira/storybook-addon-links":"@storybook/addon-links","@kadira/storybook-addon-notes":"@storybook/addon-notes","@kadira/storybook-addon-options":"@storybook/addon-options","@kadira/storybook-channels":"storybook/internal/channels","@kadira/storybook-channel-postmsg":"@storybook/channel-postmessage","@kadira/storybook-channel-websocket":"@storybook/channel-websocket","@kadira/storybook-ui":"storybook/internal/manager","@kadira/react-native-storybook":"@storybook/react-native","@kadira/react-storybook":"@storybook/react","@kadira/getstorybook":"storybook","@kadira/storybook":"@storybook/react",storyshots:"@storybook/addon-storyshots",getstorybook:"storybook"};function transformer(file,api){let j=api.jscodeshift,packageNamesKeys=Object.keys(packageNames),getMatch=oldpart=>packageNamesKeys.find(newpart=>oldpart.match(newpart)),getNewPackageName=oldPackageName=>{let match=getMatch(oldPackageName);if(match){let replacement=packageNames[match];return oldPackageName.replace(match,replacement)}return oldPackageName},updatePackageName=declaration=>(declaration.node.source.value=getNewPackageName(declaration.node.source.value),declaration.node);return j(file.source).find(j.ImportDeclaration).replaceWith(updatePackageName).toSource({quote:"single"})}function transformer2(file,api){let j=api.jscodeshift,root=j(file.source),getOptions=args=>args[3]===void 0?args[2]===void 0?[args[0]]:[args[1]]:[j.objectExpression([j.property("init",j.identifier("text"),args[1]),...args[3].properties])],withInfo=addWithInfoExpression=>{let{node}=addWithInfoExpression,args=node.arguments,storyComponent=args[2]?args[2]:args[1];return node.callee.property.name="add",node.arguments=[args[0],j.callExpression(j.callExpression(j.identifier("withInfo"),getOptions(args)),[storyComponent])],node},checkWithInfoImport=()=>{root.find(j.ImportDeclaration).filter(imp=>imp.node.source.value==="@storybook/addon-info").size()||root.find(j.ImportDeclaration).at(-1).insertAfter(j.importDeclaration([j.importSpecifier(j.identifier("withInfo"))],j.literal("@storybook/addon-info")))},addWithInfoExpressions=root.find(j.CallExpression,{callee:{property:{name:"addWithInfo"}}});return addWithInfoExpressions.size()&&(checkWithInfoImport(),addWithInfoExpressions.replaceWith(withInfo)),root.toSource()}var TRANSFORM_DIR=`${__dirname}/transforms`;function listCodemods(){return(0,import_node_fs.readdirSync)(TRANSFORM_DIR).filter(fname=>fname.endsWith(".js")).map(fname=>fname.slice(0,-3))}async function renameFile(file,from,to,{logger}){let newFile=file.replace(from,to);return logger.log(`Rename: ${file} ${newFile}`),(0,import_promises.rename)(file,newFile)}async function runCodemod(codemod,{glob,logger,dryRun,rename,parser}){if(!listCodemods().includes(codemod))throw new Error(`Unknown codemod ${codemod}. Run --list for options.`);let renameParts=null;if(rename&&(renameParts=rename.split(":"),renameParts.length!==2))throw new Error(`Codemod rename: expected format "from:to", got "${rename}"`);let inferredParser=parser;if(!parser){let extension=(0,import_node_path.extname)(glob).slice(1);jscodeshiftToPrettierParser(extension)!=="babel"&&(inferredParser=extension)}let{globby}=await import("globby"),files=await globby([glob,"!**/node_modules","!**/dist"]),extensions=new Set(files.map(file=>(0,import_node_path.extname)(file).slice(1))),commaSeparatedExtensions=Array.from(extensions).join(",");if(logger.log(`=> Applying ${codemod}: ${files.length} files`),files.length===0){logger.log(`=> No matching files for glob: ${glob}`);return}if(!dryRun&&files.length>0){let parserArgs=inferredParser?["--parser",inferredParser]:[],result=(0,import_cross_spawn.sync)("node",[require.resolve("jscodeshift/bin/jscodeshift"),"--no-babel",`--extensions=${commaSeparatedExtensions}`,"--fail-on-error","-t",`${TRANSFORM_DIR}/${codemod}.js`,...parserArgs,...files.map(file=>`"${file}"`)],{stdio:"inherit",shell:!0});if(codemod==="mdx-to-csf"&&result.status===1)logger.log("The codemod was not able to transform the files mentioned above. We have renamed the files to .mdx.broken. Please check the files and rename them back to .mdx after you have either manually transformed them to mdx + csf or fixed the issues so that the codemod can transform them.");else if(result.status===1){logger.log("Skipped renaming because of errors.");return}}if(renameParts){let[from,to]=renameParts;logger.log(`=> Renaming ${rename}: ${files.length} files`),await Promise.all(files.map(file=>renameFile(file,new RegExp(`${from}$`),to,{logger})))}}0&&(module.exports={listCodemods,packageNames,runCodemod,updateAddonInfo,updateOrganisationName});
|
@@ -1,3 +1,3 @@
|
|
1
|
-
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var csf_2_to_3_exports={};__export(csf_2_to_3_exports,{default:()=>transform,parser:()=>parser});module.exports=__toCommonJS(csf_2_to_3_exports);var
|
1
|
+
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var csf_2_to_3_exports={};__export(csf_2_to_3_exports,{default:()=>transform,parser:()=>parser});module.exports=__toCommonJS(csf_2_to_3_exports);var import_csf_tools2=require("@storybook/core/csf-tools"),babel2=__toESM(require("@babel/core")),t2=__toESM(require("@babel/types")),import_types=require("@babel/types"),import_prettier2=__toESM(require("prettier")),import_tiny_invariant=__toESM(require("tiny-invariant"));var import_csf_tools=require("@storybook/core/csf-tools"),babel=__toESM(require("@babel/core")),t=__toESM(require("@babel/types")),import_prettier=__toESM(require("prettier"));var deprecatedTypes=["ComponentStory","ComponentStoryFn","ComponentStoryObj","ComponentMeta","Story"];function migrateType(oldType){return oldType==="Story"||oldType==="ComponentStory"?"StoryFn":oldType.replace("Component","")}function upgradeDeprecatedTypes(file){let importedNamespaces=new Set,typeReferencesToUpdate=new Set,existingImports=[];file.path.traverse({ImportDeclaration:path=>{existingImports.push(...path.get("specifiers").map(specifier=>({name:specifier.node.local.name,isAlias:!(specifier.isImportSpecifier()&&t.isIdentifier(specifier.node.imported)&&specifier.node.local.name===specifier.node.imported.name),path:specifier}))),path.node.source.value.startsWith("@storybook")&&path.get("specifiers").forEach(specifier=>{if(specifier.isImportNamespaceSpecifier()&&importedNamespaces.add(specifier.node.local.name),!specifier.isImportSpecifier())return;let imported=specifier.get("imported");if(imported.isIdentifier()&&deprecatedTypes.includes(imported.node.name)){imported.node.name===specifier.node.local.name&&typeReferencesToUpdate.add(specifier.node.local.name);let newType=migrateType(imported.node.name);if(!existingImports.some(it=>it.name===newType))imported.replaceWith(t.identifier(newType)),existingImports.push({name:newType,isAlias:!1,path:specifier});else{let existingImport=existingImports.find(it=>it.name===newType&&it.isAlias);if(existingImport)throw existingImport.path.buildCodeFrameError(`This codemod does not support local imports that are called the same as a storybook import.
|
2
2
|
Rename this local import and try again.`);specifier.remove()}}})}}),file.path.traverse({TSTypeReference:path=>{let typeName=path.get("typeName");if(typeName.isIdentifier())typeReferencesToUpdate.has(typeName.node.name)&&typeName.replaceWith(t.identifier(migrateType(typeName.node.name)));else if(typeName.isTSQualifiedName()){let namespace=typeName.get("left");if(namespace.isIdentifier()&&importedNamespaces.has(namespace.node.name)){let right=typeName.get("right");deprecatedTypes.includes(right.node.name)&&right.replaceWith(t.identifier(migrateType(right.node.name)))}}}})}var logger=console,renameAnnotation=annotation=>annotation==="storyName"?"name":annotation,getTemplateBindVariable=init=>t2.isCallExpression(init)&&t2.isMemberExpression(init.callee)&&t2.isIdentifier(init.callee.object)&&t2.isIdentifier(init.callee.property)&&init.callee.property.name==="bind"&&(init.arguments.length===0||init.arguments.length===1&&t2.isObjectExpression(init.arguments[0])&&init.arguments[0].properties.length===0)?init.callee.object.name:null,isStoryAnnotation=(stmt,objectExports)=>t2.isExpressionStatement(stmt)&&t2.isAssignmentExpression(stmt.expression)&&t2.isMemberExpression(stmt.expression.left)&&t2.isIdentifier(stmt.expression.left.object)&&objectExports[stmt.expression.left.object.name],getNewExport=(stmt,objectExports)=>{if(t2.isExportNamedDeclaration(stmt)&&t2.isVariableDeclaration(stmt.declaration)&&stmt.declaration.declarations.length===1){let decl=stmt.declaration.declarations[0];if(t2.isVariableDeclarator(decl)&&t2.isIdentifier(decl.id))return objectExports[decl.id.name]}return null},isReactGlobalRenderFn=(csf,storyFn)=>{if(csf._meta?.component&&t2.isArrowFunctionExpression(storyFn)&&storyFn.params.length===1&&t2.isJSXElement(storyFn.body)){let{openingElement}=storyFn.body;if(openingElement.selfClosing&&t2.isJSXIdentifier(openingElement.name)&&openingElement.attributes.length===1){let attr=openingElement.attributes[0],param=storyFn.params[0];if(t2.isJSXSpreadAttribute(attr)&&t2.isIdentifier(attr.argument)&&t2.isIdentifier(param)&¶m.name===attr.argument.name&&csf._meta.component===openingElement.name.name)return!0}}return!1},isSimpleCSFStory=(init,annotations)=>annotations.length===0&&t2.isArrowFunctionExpression(init)&&init.params.length===0;function removeUnusedTemplates(csf){Object.entries(csf._templates).forEach(([template,templateExpression])=>{let references=[];if(babel2.traverse(csf._ast,{Identifier:path=>{path.node.name===template&&references.push(path)}}),references.length===1){let reference=references[0];reference.parentPath?.isVariableDeclarator()&&reference.parentPath.node.init===templateExpression&&reference.parentPath.remove()}})}async function transform(info,api,options){let makeTitle=userTitle=>userTitle||"FIXME",csf=(0,import_csf_tools2.loadCsf)(info.source,{makeTitle});try{csf.parse()}catch(err){return logger.log(`Error ${err}, skipping`),info.source}let file=new babel2.File({filename:info.path},{code:info.source,ast:csf._ast}),importHelper=new StorybookImportHelper(file,info),objectExports={};Object.entries(csf._storyExports).forEach(([key,decl])=>{let annotations=Object.entries(csf._storyAnnotations[key]).map(([annotation,val])=>t2.objectProperty(t2.identifier(renameAnnotation(annotation)),val));if(t2.isVariableDeclarator(decl)){let{init,id}=decl;(0,import_tiny_invariant.default)(init,"Inital value should be declared");let template=getTemplateBindVariable(init);if(!t2.isArrowFunctionExpression(init)&&!template)return;if(isSimpleCSFStory(init,annotations)){objectExports[key]=t2.exportNamedDeclaration(t2.variableDeclaration("const",[t2.variableDeclarator(importHelper.updateTypeTo(id,"StoryFn"),init)]));return}let storyFn=template?t2.identifier(template):init,renderAnnotation=isReactGlobalRenderFn(csf,template?csf._templates[template]:storyFn)?[]:[t2.objectProperty(t2.identifier("render"),storyFn)];objectExports[key]=t2.exportNamedDeclaration(t2.variableDeclaration("const",[t2.variableDeclarator(importHelper.updateTypeTo(id,"StoryObj"),t2.objectExpression([...renderAnnotation,...annotations]))]))}}),csf._ast.program.body=csf._ast.program.body.reduce((acc,stmt)=>{let statement=stmt;if(isStoryAnnotation(statement,objectExports))return acc;let newExport=getNewExport(statement,objectExports);return newExport?(acc.push(newExport),acc):(acc.push(statement),acc)},[]),upgradeDeprecatedTypes(file),importHelper.removeDeprecatedStoryImport(),removeUnusedTemplates(csf);let output=(0,import_csf_tools2.printCsf)(csf).code;try{output=await import_prettier2.default.format(output,{...await import_prettier2.default.resolveConfig(info.path),filepath:info.path})}catch{logger.log(`Failed applying prettier to ${info.path}.`)}return output}var StorybookImportHelper=class{constructor(file,info){this.getAllSbImportDeclarations=file=>{let found=[];return file.path.traverse({ImportDeclaration:path=>{let source=path.node.source.value;if(source.startsWith("@storybook/csf")||!source.startsWith("@storybook"))return;path.get("specifiers").some(specifier=>{if(specifier.isImportNamespaceSpecifier())throw new Error(`This codemod does not support namespace imports for a ${path.node.source.value} package.
|
3
3
|
Replace the namespace import with named imports and try again.`);if(!specifier.isImportSpecifier())return!1;let imported=specifier.get("imported");return Array.isArray(imported)?imported.some(importedSpecifier=>importedSpecifier.isIdentifier()?["Story","StoryFn","StoryObj","Meta","ComponentStory","ComponentStoryFn","ComponentStoryObj","ComponentMeta"].includes(importedSpecifier.node.name):!1):imported.isIdentifier()?["Story","StoryFn","StoryObj","Meta","ComponentStory","ComponentStoryFn","ComponentStoryObj","ComponentMeta"].includes(imported.node.name):!1})&&found.push(path)}}),found};this.getOrAddImport=type=>{let sbImport=this.sbImportDeclarations.find(path=>path.node.importKind==="type")??this.sbImportDeclarations[0];if(sbImport==null)return;let specifiers=sbImport.get("specifiers"),importSpecifier2=specifiers.find(specifier=>{if(!specifier.isImportSpecifier())return!1;let imported=specifier.get("imported");return imported.isIdentifier()?imported.node.name===type:!1});return importSpecifier2?importSpecifier2.node.local.name:(specifiers[0].insertBefore(t2.importSpecifier(t2.identifier(type),t2.identifier(type))),type)};this.removeDeprecatedStoryImport=()=>{this.sbImportDeclarations.flatMap(it=>it.get("specifiers")).filter(specifier=>{if(!specifier.isImportSpecifier())return!1;let imported=specifier.get("imported");return imported.isIdentifier()?imported.node.name==="Story":!1}).forEach(path=>path.remove())};this.getAllLocalImports=()=>this.sbImportDeclarations.flatMap(it=>it.get("specifiers")).map(it=>it.node.local.name);this.updateTypeTo=(id,type)=>{if((0,import_types.isIdentifier)(id)&&(0,import_types.isTSTypeAnnotation)(id.typeAnnotation)&&(0,import_types.isTSTypeReference)(id.typeAnnotation.typeAnnotation)&&(0,import_types.isIdentifier)(id.typeAnnotation.typeAnnotation.typeName)){let{name}=id.typeAnnotation.typeAnnotation.typeName;if(this.getAllLocalImports().includes(name)){let localTypeImport=this.getOrAddImport(type);return{...id,typeAnnotation:t2.tsTypeAnnotation(t2.tsTypeReference(t2.identifier(localTypeImport??""),id.typeAnnotation.typeAnnotation.typeParameters))}}}return id};this.sbImportDeclarations=this.getAllSbImportDeclarations(file)}},parser="tsx";0&&(module.exports={parser});
|
@@ -8,7 +8,7 @@ Defaulting to 2020, but this will stop working in the future.`)),options.ecmaVer
|
|
8
8
|
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},pp2.readEscapedChar=function(inTemplate){var ch=this.input.charCodeAt(++this.pos);switch(++this.pos,ch){case 110:return`
|
9
9
|
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString2(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),inTemplate){var codePos=this.pos-1;this.invalidStringToken(codePos,"Invalid escape sequence in template string")}default:if(ch>=48&&ch<=55){var octalStr=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],octal=parseInt(octalStr,8);return octal>255&&(octalStr=octalStr.slice(0,-1),octal=parseInt(octalStr,8)),this.pos+=octalStr.length-1,ch=this.input.charCodeAt(this.pos),(octalStr!=="0"||ch===56||ch===57)&&(this.strict||inTemplate)&&this.invalidStringToken(this.pos-1-octalStr.length,inTemplate?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(octal)}return isNewLine2(ch)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(ch)}},pp2.readHexChar=function(len){var codePos=this.pos,n=this.readInt(16,len);return n===null&&this.invalidStringToken(codePos,"Bad character escape sequence"),n},pp2.readWord1=function(){this.containsEsc=!1;for(var word="",first=!0,chunkStart=this.pos,astral=this.options.ecmaVersion>=6;this.pos<this.input.length;){var ch=this.fullCharCodeAtPos();if(isIdentifierChar2(ch,astral))this.pos+=ch<=65535?1:2;else if(ch===92){this.containsEsc=!0,word+=this.input.slice(chunkStart,this.pos);var escStart=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var esc=this.readCodePoint();(first?isIdentifierStart2:isIdentifierChar2)(esc,astral)||this.invalidStringToken(escStart,"Invalid Unicode escape"),word+=codePointToString2(esc),chunkStart=this.pos}else break;first=!1}return word+this.input.slice(chunkStart,this.pos)},pp2.readWord=function(){var word=this.readWord1(),type=types$12.name;return this.keywords.test(word)&&(type=keywords2[word]),this.finishToken(type,word)};var version2="8.12.1";Parser3.acorn={Parser:Parser3,version:version2,defaultOptions:defaultOptions2,Position:Position3,SourceLocation:SourceLocation3,getLineInfo:getLineInfo2,Node:Node3,TokenType:TokenType3,tokTypes:types$12,keywordTypes:keywords2,TokContext:TokContext3,tokContexts:types2,isIdentifierChar:isIdentifierChar2,isIdentifierStart:isIdentifierStart2,Token:Token3,isNewLine:isNewLine2,lineBreak:lineBreak2,lineBreakG:lineBreakG2,nonASCIIwhitespace:nonASCIIwhitespace2};function parse5(input,options){return Parser3.parse(input,options)}function parseExpressionAt2(input,pos,options){return Parser3.parseExpressionAt(input,pos,options)}function tokenizer2(input,options){return Parser3.tokenizer(input,options)}exports3.Node=Node3,exports3.Parser=Parser3,exports3.Position=Position3,exports3.SourceLocation=SourceLocation3,exports3.TokContext=TokContext3,exports3.Token=Token3,exports3.TokenType=TokenType3,exports3.defaultOptions=defaultOptions2,exports3.getLineInfo=getLineInfo2,exports3.isIdentifierChar=isIdentifierChar2,exports3.isIdentifierStart=isIdentifierStart2,exports3.isNewLine=isNewLine2,exports3.keywordTypes=keywords2,exports3.lineBreak=lineBreak2,exports3.lineBreakG=lineBreakG2,exports3.nonASCIIwhitespace=nonASCIIwhitespace2,exports3.parse=parse5,exports3.parseExpressionAt=parseExpressionAt2,exports3.tokContexts=types2,exports3.tokTypes=types$12,exports3.tokenizer=tokenizer2,exports3.version=version2})}});var require_acorn_jsx=__commonJS({"../../node_modules/micromark-extension-mdxjs/node_modules/acorn-jsx/index.js"(exports2,module2){"use strict";var XHTMLEntities=require_xhtml(),hexNumber=/^[\da-fA-F]+$/,decimalNumber=/^\d+$/,acornJsxMap=new WeakMap;function getJsxTokens(acorn){acorn=acorn.Parser.acorn||acorn;let acornJsx2=acornJsxMap.get(acorn);if(!acornJsx2){let tt=acorn.tokTypes,TokContext3=acorn.TokContext,TokenType3=acorn.TokenType,tc_oTag=new TokContext3("<tag",!1),tc_cTag=new TokContext3("</tag",!1),tc_expr=new TokContext3("<tag>...</tag>",!0,!0),tokContexts={tc_oTag,tc_cTag,tc_expr},tokTypes={jsxName:new TokenType3("jsxName"),jsxText:new TokenType3("jsxText",{beforeExpr:!0}),jsxTagStart:new TokenType3("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new TokenType3("jsxTagEnd")};tokTypes.jsxTagStart.updateContext=function(){this.context.push(tc_expr),this.context.push(tc_oTag),this.exprAllowed=!1},tokTypes.jsxTagEnd.updateContext=function(prevType){let out=this.context.pop();out===tc_oTag&&prevType===tt.slash||out===tc_cTag?(this.context.pop(),this.exprAllowed=this.curContext()===tc_expr):this.exprAllowed=!0},acornJsx2={tokContexts,tokTypes},acornJsxMap.set(acorn,acornJsx2)}return acornJsx2}function getQualifiedJSXName(object){if(!object)return object;if(object.type==="JSXIdentifier")return object.name;if(object.type==="JSXNamespacedName")return object.namespace.name+":"+object.name.name;if(object.type==="JSXMemberExpression")return getQualifiedJSXName(object.object)+"."+getQualifiedJSXName(object.property)}module2.exports=function(options){return options=options||{},function(Parser3){return plugin({allowNamespaces:options.allowNamespaces!==!1,allowNamespacedObjects:!!options.allowNamespacedObjects},Parser3)}};Object.defineProperty(module2.exports,"tokTypes",{get:function(){return getJsxTokens(require_acorn()).tokTypes},configurable:!0,enumerable:!0});function plugin(options,Parser3){let acorn=Parser3.acorn||require_acorn(),acornJsx2=getJsxTokens(acorn),tt=acorn.tokTypes,tok=acornJsx2.tokTypes,tokContexts=acorn.tokContexts,tc_oTag=acornJsx2.tokContexts.tc_oTag,tc_cTag=acornJsx2.tokContexts.tc_cTag,tc_expr=acornJsx2.tokContexts.tc_expr,isNewLine2=acorn.isNewLine,isIdentifierStart2=acorn.isIdentifierStart,isIdentifierChar2=acorn.isIdentifierChar;return class extends Parser3{static get acornJsx(){return acornJsx2}jsx_readToken(){let out="",chunkStart=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");let ch=this.input.charCodeAt(this.pos);switch(ch){case 60:case 123:return this.pos===this.start?ch===60&&this.exprAllowed?(++this.pos,this.finishToken(tok.jsxTagStart)):this.getTokenFromCode(ch):(out+=this.input.slice(chunkStart,this.pos),this.finishToken(tok.jsxText,out));case 38:out+=this.input.slice(chunkStart,this.pos),out+=this.jsx_readEntity(),chunkStart=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(ch===62?">":"}")+'` or `{"'+this.input[this.pos]+'"}`?');default:isNewLine2(ch)?(out+=this.input.slice(chunkStart,this.pos),out+=this.jsx_readNewLine(!0),chunkStart=this.pos):++this.pos}}}jsx_readNewLine(normalizeCRLF){let ch=this.input.charCodeAt(this.pos),out;return++this.pos,ch===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,out=normalizeCRLF?`
|
10
10
|
`:`\r
|
11
|
-
`):out=String.fromCharCode(ch),this.options.locations&&(++this.curLine,this.lineStart=this.pos),out}jsx_readString(quote){let out="",chunkStart=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let ch=this.input.charCodeAt(this.pos);if(ch===quote)break;ch===38?(out+=this.input.slice(chunkStart,this.pos),out+=this.jsx_readEntity(),chunkStart=this.pos):isNewLine2(ch)?(out+=this.input.slice(chunkStart,this.pos),out+=this.jsx_readNewLine(!1),chunkStart=this.pos):++this.pos}return out+=this.input.slice(chunkStart,this.pos++),this.finishToken(tt.string,out)}jsx_readEntity(){let str="",count=0,entity,ch=this.input[this.pos];ch!=="&"&&this.raise(this.pos,"Entity must start with an ampersand");let startPos=++this.pos;for(;this.pos<this.input.length&&count++<10;){if(ch=this.input[this.pos++],ch===";"){str[0]==="#"?str[1]==="x"?(str=str.substr(2),hexNumber.test(str)&&(entity=String.fromCharCode(parseInt(str,16)))):(str=str.substr(1),decimalNumber.test(str)&&(entity=String.fromCharCode(parseInt(str,10)))):entity=XHTMLEntities[str];break}str+=ch}return entity||(this.pos=startPos,"&")}jsx_readWord(){let ch,start2=this.pos;do ch=this.input.charCodeAt(++this.pos);while(isIdentifierChar2(ch)||ch===45);return this.finishToken(tok.jsxName,this.input.slice(start2,this.pos))}jsx_parseIdentifier(){let node3=this.startNode();return this.type===tok.jsxName?node3.name=this.value:this.type.keyword?node3.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(node3,"JSXIdentifier")}jsx_parseNamespacedName(){let startPos=this.start,startLoc=this.startLoc,name2=this.jsx_parseIdentifier();if(!options.allowNamespaces||!this.eat(tt.colon))return name2;var node3=this.startNodeAt(startPos,startLoc);return node3.namespace=name2,node3.name=this.jsx_parseIdentifier(),this.finishNode(node3,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===tok.jsxTagEnd)return"";let startPos=this.start,startLoc=this.startLoc,node3=this.jsx_parseNamespacedName();for(this.type===tt.dot&&node3.type==="JSXNamespacedName"&&!options.allowNamespacedObjects&&this.unexpected();this.eat(tt.dot);){let newNode=this.startNodeAt(startPos,startLoc);newNode.object=node3,newNode.property=this.jsx_parseIdentifier(),node3=this.finishNode(newNode,"JSXMemberExpression")}return node3}jsx_parseAttributeValue(){switch(this.type){case tt.braceL:let node3=this.jsx_parseExpressionContainer();return node3.expression.type==="JSXEmptyExpression"&&this.raise(node3.start,"JSX attributes must only be assigned a non-empty expression"),node3;case tok.jsxTagStart:case tt.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let node3=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(node3,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let node3=this.startNode();return this.next(),node3.expression=this.type===tt.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(tt.braceR),this.finishNode(node3,"JSXExpressionContainer")}jsx_parseAttribute(){let node3=this.startNode();return this.eat(tt.braceL)?(this.expect(tt.ellipsis),node3.argument=this.parseMaybeAssign(),this.expect(tt.braceR),this.finishNode(node3,"JSXSpreadAttribute")):(node3.name=this.jsx_parseNamespacedName(),node3.value=this.eat(tt.eq)?this.jsx_parseAttributeValue():null,this.finishNode(node3,"JSXAttribute"))}jsx_parseOpeningElementAt(startPos,startLoc){let node3=this.startNodeAt(startPos,startLoc);node3.attributes=[];let nodeName=this.jsx_parseElementName();for(nodeName&&(node3.name=nodeName);this.type!==tt.slash&&this.type!==tok.jsxTagEnd;)node3.attributes.push(this.jsx_parseAttribute());return node3.selfClosing=this.eat(tt.slash),this.expect(tok.jsxTagEnd),this.finishNode(node3,nodeName?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(startPos,startLoc){let node3=this.startNodeAt(startPos,startLoc),nodeName=this.jsx_parseElementName();return nodeName&&(node3.name=nodeName),this.expect(tok.jsxTagEnd),this.finishNode(node3,nodeName?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(startPos,startLoc){let node3=this.startNodeAt(startPos,startLoc),children=[],openingElement=this.jsx_parseOpeningElementAt(startPos,startLoc),closingElement=null;if(!openingElement.selfClosing){contents:for(;;)switch(this.type){case tok.jsxTagStart:if(startPos=this.start,startLoc=this.startLoc,this.next(),this.eat(tt.slash)){closingElement=this.jsx_parseClosingElementAt(startPos,startLoc);break contents}children.push(this.jsx_parseElementAt(startPos,startLoc));break;case tok.jsxText:children.push(this.parseExprAtom());break;case tt.braceL:children.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}getQualifiedJSXName(closingElement.name)!==getQualifiedJSXName(openingElement.name)&&this.raise(closingElement.start,"Expected corresponding JSX closing tag for <"+getQualifiedJSXName(openingElement.name)+">")}let fragmentOrElement=openingElement.name?"Element":"Fragment";return node3["opening"+fragmentOrElement]=openingElement,node3["closing"+fragmentOrElement]=closingElement,node3.children=children,this.type===tt.relational&&this.value==="<"&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(node3,"JSX"+fragmentOrElement)}jsx_parseText(){let node3=this.parseLiteral(this.value);return node3.type="JSXText",node3}jsx_parseElement(){let startPos=this.start,startLoc=this.startLoc;return this.next(),this.jsx_parseElementAt(startPos,startLoc)}parseExprAtom(refShortHandDefaultPos){return this.type===tok.jsxText?this.jsx_parseText():this.type===tok.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(refShortHandDefaultPos)}readToken(code2){let context=this.curContext();if(context===tc_expr)return this.jsx_readToken();if(context===tc_oTag||context===tc_cTag){if(isIdentifierStart2(code2))return this.jsx_readWord();if(code2==62)return++this.pos,this.finishToken(tok.jsxTagEnd);if((code2===34||code2===39)&&context==tc_oTag)return this.jsx_readString(code2)}return code2===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(tok.jsxTagStart)):super.readToken(code2)}updateContext(prevType){if(this.type==tt.braceL){var curContext=this.curContext();curContext==tc_oTag?this.context.push(tokContexts.b_expr):curContext==tc_expr?this.context.push(tokContexts.b_tmpl):super.updateContext(prevType),this.exprAllowed=!0}else if(this.type===tt.slash&&prevType===tok.jsxTagStart)this.context.length-=2,this.context.push(tc_cTag),this.exprAllowed=!1;else return super.updateContext(prevType)}}}}});var mdx_to_csf_exports={};__export(mdx_to_csf_exports,{default:()=>jscodeshift,nameToValidExport:()=>nameToValidExport,transform:()=>transform});module.exports=__toCommonJS(mdx_to_csf_exports);var import_csf_tools=require("@storybook/core/csf-tools");var emptyOptions={};function toString(value,options){let settings=options||emptyOptions,includeImageAlt=typeof settings.includeImageAlt=="boolean"?settings.includeImageAlt:!0,includeHtml=typeof settings.includeHtml=="boolean"?settings.includeHtml:!0;return one(value,includeImageAlt,includeHtml)}function one(value,includeImageAlt,includeHtml){if(node(value)){if("value"in value)return value.type==="html"&&!includeHtml?"":value.value;if(includeImageAlt&&"alt"in value&&value.alt)return value.alt;if("children"in value)return all(value.children,includeImageAlt,includeHtml)}return Array.isArray(value)?all(value,includeImageAlt,includeHtml):""}function all(values,includeImageAlt,includeHtml){let result=[],index2=-1;for(;++index2<values.length;)result[index2]=one(values[index2],includeImageAlt,includeHtml);return result.join("")}function node(value){return!!(value&&typeof value=="object")}var characterEntities={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",Aring:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",Mopf:"\u{1D544}",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
11
|
+
`):out=String.fromCharCode(ch),this.options.locations&&(++this.curLine,this.lineStart=this.pos),out}jsx_readString(quote){let out="",chunkStart=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let ch=this.input.charCodeAt(this.pos);if(ch===quote)break;ch===38?(out+=this.input.slice(chunkStart,this.pos),out+=this.jsx_readEntity(),chunkStart=this.pos):isNewLine2(ch)?(out+=this.input.slice(chunkStart,this.pos),out+=this.jsx_readNewLine(!1),chunkStart=this.pos):++this.pos}return out+=this.input.slice(chunkStart,this.pos++),this.finishToken(tt.string,out)}jsx_readEntity(){let str="",count=0,entity,ch=this.input[this.pos];ch!=="&"&&this.raise(this.pos,"Entity must start with an ampersand");let startPos=++this.pos;for(;this.pos<this.input.length&&count++<10;){if(ch=this.input[this.pos++],ch===";"){str[0]==="#"?str[1]==="x"?(str=str.substr(2),hexNumber.test(str)&&(entity=String.fromCharCode(parseInt(str,16)))):(str=str.substr(1),decimalNumber.test(str)&&(entity=String.fromCharCode(parseInt(str,10)))):entity=XHTMLEntities[str];break}str+=ch}return entity||(this.pos=startPos,"&")}jsx_readWord(){let ch,start2=this.pos;do ch=this.input.charCodeAt(++this.pos);while(isIdentifierChar2(ch)||ch===45);return this.finishToken(tok.jsxName,this.input.slice(start2,this.pos))}jsx_parseIdentifier(){let node3=this.startNode();return this.type===tok.jsxName?node3.name=this.value:this.type.keyword?node3.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(node3,"JSXIdentifier")}jsx_parseNamespacedName(){let startPos=this.start,startLoc=this.startLoc,name2=this.jsx_parseIdentifier();if(!options.allowNamespaces||!this.eat(tt.colon))return name2;var node3=this.startNodeAt(startPos,startLoc);return node3.namespace=name2,node3.name=this.jsx_parseIdentifier(),this.finishNode(node3,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===tok.jsxTagEnd)return"";let startPos=this.start,startLoc=this.startLoc,node3=this.jsx_parseNamespacedName();for(this.type===tt.dot&&node3.type==="JSXNamespacedName"&&!options.allowNamespacedObjects&&this.unexpected();this.eat(tt.dot);){let newNode=this.startNodeAt(startPos,startLoc);newNode.object=node3,newNode.property=this.jsx_parseIdentifier(),node3=this.finishNode(newNode,"JSXMemberExpression")}return node3}jsx_parseAttributeValue(){switch(this.type){case tt.braceL:let node3=this.jsx_parseExpressionContainer();return node3.expression.type==="JSXEmptyExpression"&&this.raise(node3.start,"JSX attributes must only be assigned a non-empty expression"),node3;case tok.jsxTagStart:case tt.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let node3=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(node3,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let node3=this.startNode();return this.next(),node3.expression=this.type===tt.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(tt.braceR),this.finishNode(node3,"JSXExpressionContainer")}jsx_parseAttribute(){let node3=this.startNode();return this.eat(tt.braceL)?(this.expect(tt.ellipsis),node3.argument=this.parseMaybeAssign(),this.expect(tt.braceR),this.finishNode(node3,"JSXSpreadAttribute")):(node3.name=this.jsx_parseNamespacedName(),node3.value=this.eat(tt.eq)?this.jsx_parseAttributeValue():null,this.finishNode(node3,"JSXAttribute"))}jsx_parseOpeningElementAt(startPos,startLoc){let node3=this.startNodeAt(startPos,startLoc);node3.attributes=[];let nodeName=this.jsx_parseElementName();for(nodeName&&(node3.name=nodeName);this.type!==tt.slash&&this.type!==tok.jsxTagEnd;)node3.attributes.push(this.jsx_parseAttribute());return node3.selfClosing=this.eat(tt.slash),this.expect(tok.jsxTagEnd),this.finishNode(node3,nodeName?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(startPos,startLoc){let node3=this.startNodeAt(startPos,startLoc),nodeName=this.jsx_parseElementName();return nodeName&&(node3.name=nodeName),this.expect(tok.jsxTagEnd),this.finishNode(node3,nodeName?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(startPos,startLoc){let node3=this.startNodeAt(startPos,startLoc),children=[],openingElement=this.jsx_parseOpeningElementAt(startPos,startLoc),closingElement=null;if(!openingElement.selfClosing){contents:for(;;)switch(this.type){case tok.jsxTagStart:if(startPos=this.start,startLoc=this.startLoc,this.next(),this.eat(tt.slash)){closingElement=this.jsx_parseClosingElementAt(startPos,startLoc);break contents}children.push(this.jsx_parseElementAt(startPos,startLoc));break;case tok.jsxText:children.push(this.parseExprAtom());break;case tt.braceL:children.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}getQualifiedJSXName(closingElement.name)!==getQualifiedJSXName(openingElement.name)&&this.raise(closingElement.start,"Expected corresponding JSX closing tag for <"+getQualifiedJSXName(openingElement.name)+">")}let fragmentOrElement=openingElement.name?"Element":"Fragment";return node3["opening"+fragmentOrElement]=openingElement,node3["closing"+fragmentOrElement]=closingElement,node3.children=children,this.type===tt.relational&&this.value==="<"&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(node3,"JSX"+fragmentOrElement)}jsx_parseText(){let node3=this.parseLiteral(this.value);return node3.type="JSXText",node3}jsx_parseElement(){let startPos=this.start,startLoc=this.startLoc;return this.next(),this.jsx_parseElementAt(startPos,startLoc)}parseExprAtom(refShortHandDefaultPos){return this.type===tok.jsxText?this.jsx_parseText():this.type===tok.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(refShortHandDefaultPos)}readToken(code2){let context=this.curContext();if(context===tc_expr)return this.jsx_readToken();if(context===tc_oTag||context===tc_cTag){if(isIdentifierStart2(code2))return this.jsx_readWord();if(code2==62)return++this.pos,this.finishToken(tok.jsxTagEnd);if((code2===34||code2===39)&&context==tc_oTag)return this.jsx_readString(code2)}return code2===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(tok.jsxTagStart)):super.readToken(code2)}updateContext(prevType){if(this.type==tt.braceL){var curContext=this.curContext();curContext==tc_oTag?this.context.push(tokContexts.b_expr):curContext==tc_expr?this.context.push(tokContexts.b_tmpl):super.updateContext(prevType),this.exprAllowed=!0}else if(this.type===tt.slash&&prevType===tok.jsxTagStart)this.context.length-=2,this.context.push(tc_cTag),this.exprAllowed=!1;else return super.updateContext(prevType)}}}}});var mdx_to_csf_exports={};__export(mdx_to_csf_exports,{default:()=>jscodeshift,nameToValidExport:()=>nameToValidExport,transform:()=>transform});module.exports=__toCommonJS(mdx_to_csf_exports);var import_node_fs=require("fs"),import_node_path2=require("path"),import_csf_tools=require("@storybook/core/csf-tools"),babel=__toESM(require("@babel/core")),t=__toESM(require("@babel/types")),import_camelCase=__toESM(require("lodash/camelCase")),import_prettier=__toESM(require("prettier")),recast=__toESM(require("recast"));var emptyOptions={};function toString(value,options){let settings=options||emptyOptions,includeImageAlt=typeof settings.includeImageAlt=="boolean"?settings.includeImageAlt:!0,includeHtml=typeof settings.includeHtml=="boolean"?settings.includeHtml:!0;return one(value,includeImageAlt,includeHtml)}function one(value,includeImageAlt,includeHtml){if(node(value)){if("value"in value)return value.type==="html"&&!includeHtml?"":value.value;if(includeImageAlt&&"alt"in value&&value.alt)return value.alt;if("children"in value)return all(value.children,includeImageAlt,includeHtml)}return Array.isArray(value)?all(value,includeImageAlt,includeHtml):""}function all(values,includeImageAlt,includeHtml){let result=[],index2=-1;for(;++index2<values.length;)result[index2]=one(values[index2],includeImageAlt,includeHtml);return result.join("")}function node(value){return!!(value&&typeof value=="object")}var characterEntities={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",Aring:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",Mopf:"\u{1D544}",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
12
12
|
`,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"};var own={}.hasOwnProperty;function decodeNamedCharacterReference(value){return own.call(characterEntities,value)?characterEntities[value]:!1}function splice(list4,start2,remove,items){let end=list4.length,chunkStart=0,parameters;if(start2<0?start2=-start2>end?0:end+start2:start2=start2>end?end:start2,remove=remove>0?remove:0,items.length<1e4)parameters=Array.from(items),parameters.unshift(start2,remove),list4.splice(...parameters);else for(remove&&list4.splice(start2,remove);chunkStart<items.length;)parameters=items.slice(chunkStart,chunkStart+1e4),parameters.unshift(start2,0),list4.splice(...parameters),chunkStart+=1e4,start2+=1e4}function push(list4,items){return list4.length>0?(splice(list4,list4.length,0,items),list4):items}var hasOwnProperty={}.hasOwnProperty;function combineExtensions(extensions){let all3={},index2=-1;for(;++index2<extensions.length;)syntaxExtension(all3,extensions[index2]);return all3}function syntaxExtension(all3,extension2){let hook;for(hook in extension2){let left=(hasOwnProperty.call(all3,hook)?all3[hook]:void 0)||(all3[hook]={}),right=extension2[hook],code2;if(right)for(code2 in right){hasOwnProperty.call(left,code2)||(left[code2]=[]);let value=right[code2];constructs(left[code2],Array.isArray(value)?value:value?[value]:[])}}}function constructs(existing,list4){let index2=-1,before=[];for(;++index2<list4.length;)(list4[index2].add==="after"?existing:before).push(list4[index2]);splice(existing,0,0,before)}function decodeNumericCharacterReference(value,base){let code2=Number.parseInt(value,base);return code2<9||code2===11||code2>13&&code2<32||code2>126&&code2<160||code2>55295&&code2<57344||code2>64975&&code2<65008||(code2&65535)===65535||(code2&65535)===65534||code2>1114111?"\uFFFD":String.fromCodePoint(code2)}function normalizeIdentifier(value){return value.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var unicodePunctuationInternal=regexCheck(new RegExp("\\p{P}","u")),asciiAlpha=regexCheck(/[A-Za-z]/),asciiAlphanumeric=regexCheck(/[\dA-Za-z]/),asciiAtext=regexCheck(/[#-'*+\--9=?A-Z^-~]/);function asciiControl(code2){return code2!==null&&(code2<32||code2===127)}var asciiDigit=regexCheck(/\d/),asciiHexDigit=regexCheck(/[\dA-Fa-f]/),asciiPunctuation=regexCheck(/[!-/:-@[-`{-~]/);function markdownLineEnding(code2){return code2!==null&&code2<-2}function markdownLineEndingOrSpace(code2){return code2!==null&&(code2<0||code2===32)}function markdownSpace(code2){return code2===-2||code2===-1||code2===32}function unicodePunctuation(code2){return asciiPunctuation(code2)||unicodePunctuationInternal(code2)}var unicodeWhitespace=regexCheck(/\s/);function regexCheck(regex){return check;function check(code2){return code2!==null&&code2>-1&®ex.test(String.fromCharCode(code2))}}function factorySpace(effects,ok2,type,max){let limit=max?max-1:Number.POSITIVE_INFINITY,size=0;return start2;function start2(code2){return markdownSpace(code2)?(effects.enter(type),prefix(code2)):ok2(code2)}function prefix(code2){return markdownSpace(code2)&&size++<limit?(effects.consume(code2),prefix):(effects.exit(type),ok2(code2))}}var content={tokenize:initializeContent};function initializeContent(effects){let contentStart=effects.attempt(this.parser.constructs.contentInitial,afterContentStartConstruct,paragraphInitial),previous2;return contentStart;function afterContentStartConstruct(code2){if(code2===null){effects.consume(code2);return}return effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),factorySpace(effects,contentStart,"linePrefix")}function paragraphInitial(code2){return effects.enter("paragraph"),lineStart(code2)}function lineStart(code2){let token=effects.enter("chunkText",{contentType:"text",previous:previous2});return previous2&&(previous2.next=token),previous2=token,data2(code2)}function data2(code2){if(code2===null){effects.exit("chunkText"),effects.exit("paragraph"),effects.consume(code2);return}return markdownLineEnding(code2)?(effects.consume(code2),effects.exit("chunkText"),lineStart):(effects.consume(code2),data2)}}var document={tokenize:initializeDocument},containerConstruct={tokenize:tokenizeContainer};function initializeDocument(effects){let self2=this,stack=[],continued=0,childFlow,childToken,lineStartOffset;return start2;function start2(code2){if(continued<stack.length){let item=stack[continued];return self2.containerState=item[1],effects.attempt(item[0].continuation,documentContinue,checkNewContainers)(code2)}return checkNewContainers(code2)}function documentContinue(code2){if(continued++,self2.containerState._closeFlow){self2.containerState._closeFlow=void 0,childFlow&&closeFlow();let indexBeforeExits=self2.events.length,indexBeforeFlow=indexBeforeExits,point3;for(;indexBeforeFlow--;)if(self2.events[indexBeforeFlow][0]==="exit"&&self2.events[indexBeforeFlow][1].type==="chunkFlow"){point3=self2.events[indexBeforeFlow][1].end;break}exitContainers(continued);let index2=indexBeforeExits;for(;index2<self2.events.length;)self2.events[index2][1].end=Object.assign({},point3),index2++;return splice(self2.events,indexBeforeFlow+1,0,self2.events.slice(indexBeforeExits)),self2.events.length=index2,checkNewContainers(code2)}return start2(code2)}function checkNewContainers(code2){if(continued===stack.length){if(!childFlow)return documentContinued(code2);if(childFlow.currentConstruct&&childFlow.currentConstruct.concrete)return flowStart(code2);self2.interrupt=!!(childFlow.currentConstruct&&!childFlow._gfmTableDynamicInterruptHack)}return self2.containerState={},effects.check(containerConstruct,thereIsANewContainer,thereIsNoNewContainer)(code2)}function thereIsANewContainer(code2){return childFlow&&closeFlow(),exitContainers(continued),documentContinued(code2)}function thereIsNoNewContainer(code2){return self2.parser.lazy[self2.now().line]=continued!==stack.length,lineStartOffset=self2.now().offset,flowStart(code2)}function documentContinued(code2){return self2.containerState={},effects.attempt(containerConstruct,containerContinue,flowStart)(code2)}function containerContinue(code2){return continued++,stack.push([self2.currentConstruct,self2.containerState]),documentContinued(code2)}function flowStart(code2){if(code2===null){childFlow&&closeFlow(),exitContainers(0),effects.consume(code2);return}return childFlow=childFlow||self2.parser.flow(self2.now()),effects.enter("chunkFlow",{contentType:"flow",previous:childToken,_tokenizer:childFlow}),flowContinue(code2)}function flowContinue(code2){if(code2===null){writeToChild(effects.exit("chunkFlow"),!0),exitContainers(0),effects.consume(code2);return}return markdownLineEnding(code2)?(effects.consume(code2),writeToChild(effects.exit("chunkFlow")),continued=0,self2.interrupt=void 0,start2):(effects.consume(code2),flowContinue)}function writeToChild(token,eof){let stream=self2.sliceStream(token);if(eof&&stream.push(null),token.previous=childToken,childToken&&(childToken.next=token),childToken=token,childFlow.defineSkip(token.start),childFlow.write(stream),self2.parser.lazy[token.start.line]){let index2=childFlow.events.length;for(;index2--;)if(childFlow.events[index2][1].start.offset<lineStartOffset&&(!childFlow.events[index2][1].end||childFlow.events[index2][1].end.offset>lineStartOffset))return;let indexBeforeExits=self2.events.length,indexBeforeFlow=indexBeforeExits,seen,point3;for(;indexBeforeFlow--;)if(self2.events[indexBeforeFlow][0]==="exit"&&self2.events[indexBeforeFlow][1].type==="chunkFlow"){if(seen){point3=self2.events[indexBeforeFlow][1].end;break}seen=!0}for(exitContainers(continued),index2=indexBeforeExits;index2<self2.events.length;)self2.events[index2][1].end=Object.assign({},point3),index2++;splice(self2.events,indexBeforeFlow+1,0,self2.events.slice(indexBeforeExits)),self2.events.length=index2}}function exitContainers(size){let index2=stack.length;for(;index2-- >size;){let entry=stack[index2];self2.containerState=entry[1],entry[0].exit.call(self2,effects)}stack.length=size}function closeFlow(){childFlow.write([null]),childToken=void 0,childFlow=void 0,self2.containerState._closeFlow=void 0}}function tokenizeContainer(effects,ok2,nok){return factorySpace(effects,effects.attempt(this.parser.constructs.document,ok2,nok),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function classifyCharacter(code2){if(code2===null||markdownLineEndingOrSpace(code2)||unicodeWhitespace(code2))return 1;if(unicodePunctuation(code2))return 2}function resolveAll(constructs2,events,context){let called=[],index2=-1;for(;++index2<constructs2.length;){let resolve=constructs2[index2].resolveAll;resolve&&!called.includes(resolve)&&(events=resolve(events,context),called.push(resolve))}return events}var attention={name:"attention",tokenize:tokenizeAttention,resolveAll:resolveAllAttention};function resolveAllAttention(events,context){let index2=-1,open,group,text4,openingSequence,closingSequence,use,nextEvents,offset2;for(;++index2<events.length;)if(events[index2][0]==="enter"&&events[index2][1].type==="attentionSequence"&&events[index2][1]._close){for(open=index2;open--;)if(events[open][0]==="exit"&&events[open][1].type==="attentionSequence"&&events[open][1]._open&&context.sliceSerialize(events[open][1]).charCodeAt(0)===context.sliceSerialize(events[index2][1]).charCodeAt(0)){if((events[open][1]._close||events[index2][1]._open)&&(events[index2][1].end.offset-events[index2][1].start.offset)%3&&!((events[open][1].end.offset-events[open][1].start.offset+events[index2][1].end.offset-events[index2][1].start.offset)%3))continue;use=events[open][1].end.offset-events[open][1].start.offset>1&&events[index2][1].end.offset-events[index2][1].start.offset>1?2:1;let start2=Object.assign({},events[open][1].end),end=Object.assign({},events[index2][1].start);movePoint(start2,-use),movePoint(end,use),openingSequence={type:use>1?"strongSequence":"emphasisSequence",start:start2,end:Object.assign({},events[open][1].end)},closingSequence={type:use>1?"strongSequence":"emphasisSequence",start:Object.assign({},events[index2][1].start),end},text4={type:use>1?"strongText":"emphasisText",start:Object.assign({},events[open][1].end),end:Object.assign({},events[index2][1].start)},group={type:use>1?"strong":"emphasis",start:Object.assign({},openingSequence.start),end:Object.assign({},closingSequence.end)},events[open][1].end=Object.assign({},openingSequence.start),events[index2][1].start=Object.assign({},closingSequence.end),nextEvents=[],events[open][1].end.offset-events[open][1].start.offset&&(nextEvents=push(nextEvents,[["enter",events[open][1],context],["exit",events[open][1],context]])),nextEvents=push(nextEvents,[["enter",group,context],["enter",openingSequence,context],["exit",openingSequence,context],["enter",text4,context]]),nextEvents=push(nextEvents,resolveAll(context.parser.constructs.insideSpan.null,events.slice(open+1,index2),context)),nextEvents=push(nextEvents,[["exit",text4,context],["enter",closingSequence,context],["exit",closingSequence,context],["exit",group,context]]),events[index2][1].end.offset-events[index2][1].start.offset?(offset2=2,nextEvents=push(nextEvents,[["enter",events[index2][1],context],["exit",events[index2][1],context]])):offset2=0,splice(events,open-1,index2-open+3,nextEvents),index2=open+nextEvents.length-offset2-2;break}}for(index2=-1;++index2<events.length;)events[index2][1].type==="attentionSequence"&&(events[index2][1].type="data");return events}function tokenizeAttention(effects,ok2){let attentionMarkers2=this.parser.constructs.attentionMarkers.null,previous2=this.previous,before=classifyCharacter(previous2),marker;return start2;function start2(code2){return marker=code2,effects.enter("attentionSequence"),inside(code2)}function inside(code2){if(code2===marker)return effects.consume(code2),inside;let token=effects.exit("attentionSequence"),after=classifyCharacter(code2),open=!after||after===2&&before||attentionMarkers2.includes(code2),close=!before||before===2&&after||attentionMarkers2.includes(previous2);return token._open=!!(marker===42?open:open&&(before||!close)),token._close=!!(marker===42?close:close&&(after||!open)),ok2(code2)}}function movePoint(point3,offset2){point3.column+=offset2,point3.offset+=offset2,point3._bufferIndex+=offset2}var autolink={name:"autolink",tokenize:tokenizeAutolink};function tokenizeAutolink(effects,ok2,nok){let size=0;return start2;function start2(code2){return effects.enter("autolink"),effects.enter("autolinkMarker"),effects.consume(code2),effects.exit("autolinkMarker"),effects.enter("autolinkProtocol"),open}function open(code2){return asciiAlpha(code2)?(effects.consume(code2),schemeOrEmailAtext):emailAtext(code2)}function schemeOrEmailAtext(code2){return code2===43||code2===45||code2===46||asciiAlphanumeric(code2)?(size=1,schemeInsideOrEmailAtext(code2)):emailAtext(code2)}function schemeInsideOrEmailAtext(code2){return code2===58?(effects.consume(code2),size=0,urlInside):(code2===43||code2===45||code2===46||asciiAlphanumeric(code2))&&size++<32?(effects.consume(code2),schemeInsideOrEmailAtext):(size=0,emailAtext(code2))}function urlInside(code2){return code2===62?(effects.exit("autolinkProtocol"),effects.enter("autolinkMarker"),effects.consume(code2),effects.exit("autolinkMarker"),effects.exit("autolink"),ok2):code2===null||code2===32||code2===60||asciiControl(code2)?nok(code2):(effects.consume(code2),urlInside)}function emailAtext(code2){return code2===64?(effects.consume(code2),emailAtSignOrDot):asciiAtext(code2)?(effects.consume(code2),emailAtext):nok(code2)}function emailAtSignOrDot(code2){return asciiAlphanumeric(code2)?emailLabel(code2):nok(code2)}function emailLabel(code2){return code2===46?(effects.consume(code2),size=0,emailAtSignOrDot):code2===62?(effects.exit("autolinkProtocol").type="autolinkEmail",effects.enter("autolinkMarker"),effects.consume(code2),effects.exit("autolinkMarker"),effects.exit("autolink"),ok2):emailValue(code2)}function emailValue(code2){if((code2===45||asciiAlphanumeric(code2))&&size++<63){let next=code2===45?emailValue:emailLabel;return effects.consume(code2),next}return nok(code2)}}var blankLine={tokenize:tokenizeBlankLine,partial:!0};function tokenizeBlankLine(effects,ok2,nok){return start2;function start2(code2){return markdownSpace(code2)?factorySpace(effects,after,"linePrefix")(code2):after(code2)}function after(code2){return code2===null||markdownLineEnding(code2)?ok2(code2):nok(code2)}}var blockQuote={name:"blockQuote",tokenize:tokenizeBlockQuoteStart,continuation:{tokenize:tokenizeBlockQuoteContinuation},exit};function tokenizeBlockQuoteStart(effects,ok2,nok){let self2=this;return start2;function start2(code2){if(code2===62){let state=self2.containerState;return state.open||(effects.enter("blockQuote",{_container:!0}),state.open=!0),effects.enter("blockQuotePrefix"),effects.enter("blockQuoteMarker"),effects.consume(code2),effects.exit("blockQuoteMarker"),after}return nok(code2)}function after(code2){return markdownSpace(code2)?(effects.enter("blockQuotePrefixWhitespace"),effects.consume(code2),effects.exit("blockQuotePrefixWhitespace"),effects.exit("blockQuotePrefix"),ok2):(effects.exit("blockQuotePrefix"),ok2(code2))}}function tokenizeBlockQuoteContinuation(effects,ok2,nok){let self2=this;return contStart;function contStart(code2){return markdownSpace(code2)?factorySpace(effects,contBefore,"linePrefix",self2.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(code2):contBefore(code2)}function contBefore(code2){return effects.attempt(blockQuote,ok2,nok)(code2)}}function exit(effects){effects.exit("blockQuote")}var characterEscape={name:"characterEscape",tokenize:tokenizeCharacterEscape};function tokenizeCharacterEscape(effects,ok2,nok){return start2;function start2(code2){return effects.enter("characterEscape"),effects.enter("escapeMarker"),effects.consume(code2),effects.exit("escapeMarker"),inside}function inside(code2){return asciiPunctuation(code2)?(effects.enter("characterEscapeValue"),effects.consume(code2),effects.exit("characterEscapeValue"),effects.exit("characterEscape"),ok2):nok(code2)}}var characterReference={name:"characterReference",tokenize:tokenizeCharacterReference};function tokenizeCharacterReference(effects,ok2,nok){let self2=this,size=0,max,test;return start2;function start2(code2){return effects.enter("characterReference"),effects.enter("characterReferenceMarker"),effects.consume(code2),effects.exit("characterReferenceMarker"),open}function open(code2){return code2===35?(effects.enter("characterReferenceMarkerNumeric"),effects.consume(code2),effects.exit("characterReferenceMarkerNumeric"),numeric):(effects.enter("characterReferenceValue"),max=31,test=asciiAlphanumeric,value(code2))}function numeric(code2){return code2===88||code2===120?(effects.enter("characterReferenceMarkerHexadecimal"),effects.consume(code2),effects.exit("characterReferenceMarkerHexadecimal"),effects.enter("characterReferenceValue"),max=6,test=asciiHexDigit,value):(effects.enter("characterReferenceValue"),max=7,test=asciiDigit,value(code2))}function value(code2){if(code2===59&&size){let token=effects.exit("characterReferenceValue");return test===asciiAlphanumeric&&!decodeNamedCharacterReference(self2.sliceSerialize(token))?nok(code2):(effects.enter("characterReferenceMarker"),effects.consume(code2),effects.exit("characterReferenceMarker"),effects.exit("characterReference"),ok2)}return test(code2)&&size++<max?(effects.consume(code2),value):nok(code2)}}var nonLazyContinuation={tokenize:tokenizeNonLazyContinuation,partial:!0},codeFenced={name:"codeFenced",tokenize:tokenizeCodeFenced,concrete:!0};function tokenizeCodeFenced(effects,ok2,nok){let self2=this,closeStart={tokenize:tokenizeCloseStart,partial:!0},initialPrefix=0,sizeOpen=0,marker;return start2;function start2(code2){return beforeSequenceOpen(code2)}function beforeSequenceOpen(code2){let tail=self2.events[self2.events.length-1];return initialPrefix=tail&&tail[1].type==="linePrefix"?tail[2].sliceSerialize(tail[1],!0).length:0,marker=code2,effects.enter("codeFenced"),effects.enter("codeFencedFence"),effects.enter("codeFencedFenceSequence"),sequenceOpen(code2)}function sequenceOpen(code2){return code2===marker?(sizeOpen++,effects.consume(code2),sequenceOpen):sizeOpen<3?nok(code2):(effects.exit("codeFencedFenceSequence"),markdownSpace(code2)?factorySpace(effects,infoBefore,"whitespace")(code2):infoBefore(code2))}function infoBefore(code2){return code2===null||markdownLineEnding(code2)?(effects.exit("codeFencedFence"),self2.interrupt?ok2(code2):effects.check(nonLazyContinuation,atNonLazyBreak,after)(code2)):(effects.enter("codeFencedFenceInfo"),effects.enter("chunkString",{contentType:"string"}),info(code2))}function info(code2){return code2===null||markdownLineEnding(code2)?(effects.exit("chunkString"),effects.exit("codeFencedFenceInfo"),infoBefore(code2)):markdownSpace(code2)?(effects.exit("chunkString"),effects.exit("codeFencedFenceInfo"),factorySpace(effects,metaBefore,"whitespace")(code2)):code2===96&&code2===marker?nok(code2):(effects.consume(code2),info)}function metaBefore(code2){return code2===null||markdownLineEnding(code2)?infoBefore(code2):(effects.enter("codeFencedFenceMeta"),effects.enter("chunkString",{contentType:"string"}),meta(code2))}function meta(code2){return code2===null||markdownLineEnding(code2)?(effects.exit("chunkString"),effects.exit("codeFencedFenceMeta"),infoBefore(code2)):code2===96&&code2===marker?nok(code2):(effects.consume(code2),meta)}function atNonLazyBreak(code2){return effects.attempt(closeStart,after,contentBefore)(code2)}function contentBefore(code2){return effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),contentStart}function contentStart(code2){return initialPrefix>0&&markdownSpace(code2)?factorySpace(effects,beforeContentChunk,"linePrefix",initialPrefix+1)(code2):beforeContentChunk(code2)}function beforeContentChunk(code2){return code2===null||markdownLineEnding(code2)?effects.check(nonLazyContinuation,atNonLazyBreak,after)(code2):(effects.enter("codeFlowValue"),contentChunk(code2))}function contentChunk(code2){return code2===null||markdownLineEnding(code2)?(effects.exit("codeFlowValue"),beforeContentChunk(code2)):(effects.consume(code2),contentChunk)}function after(code2){return effects.exit("codeFenced"),ok2(code2)}function tokenizeCloseStart(effects2,ok3,nok2){let size=0;return startBefore;function startBefore(code2){return effects2.enter("lineEnding"),effects2.consume(code2),effects2.exit("lineEnding"),start3}function start3(code2){return effects2.enter("codeFencedFence"),markdownSpace(code2)?factorySpace(effects2,beforeSequenceClose,"linePrefix",self2.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(code2):beforeSequenceClose(code2)}function beforeSequenceClose(code2){return code2===marker?(effects2.enter("codeFencedFenceSequence"),sequenceClose(code2)):nok2(code2)}function sequenceClose(code2){return code2===marker?(size++,effects2.consume(code2),sequenceClose):size>=sizeOpen?(effects2.exit("codeFencedFenceSequence"),markdownSpace(code2)?factorySpace(effects2,sequenceCloseAfter,"whitespace")(code2):sequenceCloseAfter(code2)):nok2(code2)}function sequenceCloseAfter(code2){return code2===null||markdownLineEnding(code2)?(effects2.exit("codeFencedFence"),ok3(code2)):nok2(code2)}}}function tokenizeNonLazyContinuation(effects,ok2,nok){let self2=this;return start2;function start2(code2){return code2===null?nok(code2):(effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),lineStart)}function lineStart(code2){return self2.parser.lazy[self2.now().line]?nok(code2):ok2(code2)}}var codeIndented={name:"codeIndented",tokenize:tokenizeCodeIndented},furtherStart={tokenize:tokenizeFurtherStart,partial:!0};function tokenizeCodeIndented(effects,ok2,nok){let self2=this;return start2;function start2(code2){return effects.enter("codeIndented"),factorySpace(effects,afterPrefix,"linePrefix",5)(code2)}function afterPrefix(code2){let tail=self2.events[self2.events.length-1];return tail&&tail[1].type==="linePrefix"&&tail[2].sliceSerialize(tail[1],!0).length>=4?atBreak(code2):nok(code2)}function atBreak(code2){return code2===null?after(code2):markdownLineEnding(code2)?effects.attempt(furtherStart,atBreak,after)(code2):(effects.enter("codeFlowValue"),inside(code2))}function inside(code2){return code2===null||markdownLineEnding(code2)?(effects.exit("codeFlowValue"),atBreak(code2)):(effects.consume(code2),inside)}function after(code2){return effects.exit("codeIndented"),ok2(code2)}}function tokenizeFurtherStart(effects,ok2,nok){let self2=this;return furtherStart2;function furtherStart2(code2){return self2.parser.lazy[self2.now().line]?nok(code2):markdownLineEnding(code2)?(effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),furtherStart2):factorySpace(effects,afterPrefix,"linePrefix",5)(code2)}function afterPrefix(code2){let tail=self2.events[self2.events.length-1];return tail&&tail[1].type==="linePrefix"&&tail[2].sliceSerialize(tail[1],!0).length>=4?ok2(code2):markdownLineEnding(code2)?furtherStart2(code2):nok(code2)}}var codeText={name:"codeText",tokenize:tokenizeCodeText,resolve:resolveCodeText,previous};function resolveCodeText(events){let tailExitIndex=events.length-4,headEnterIndex=3,index2,enter;if((events[headEnterIndex][1].type==="lineEnding"||events[headEnterIndex][1].type==="space")&&(events[tailExitIndex][1].type==="lineEnding"||events[tailExitIndex][1].type==="space")){for(index2=headEnterIndex;++index2<tailExitIndex;)if(events[index2][1].type==="codeTextData"){events[headEnterIndex][1].type="codeTextPadding",events[tailExitIndex][1].type="codeTextPadding",headEnterIndex+=2,tailExitIndex-=2;break}}for(index2=headEnterIndex-1,tailExitIndex++;++index2<=tailExitIndex;)enter===void 0?index2!==tailExitIndex&&events[index2][1].type!=="lineEnding"&&(enter=index2):(index2===tailExitIndex||events[index2][1].type==="lineEnding")&&(events[enter][1].type="codeTextData",index2!==enter+2&&(events[enter][1].end=events[index2-1][1].end,events.splice(enter+2,index2-enter-2),tailExitIndex-=index2-enter-2,index2=enter+2),enter=void 0);return events}function previous(code2){return code2!==96||this.events[this.events.length-1][1].type==="characterEscape"}function tokenizeCodeText(effects,ok2,nok){let self2=this,sizeOpen=0,size,token;return start2;function start2(code2){return effects.enter("codeText"),effects.enter("codeTextSequence"),sequenceOpen(code2)}function sequenceOpen(code2){return code2===96?(effects.consume(code2),sizeOpen++,sequenceOpen):(effects.exit("codeTextSequence"),between2(code2))}function between2(code2){return code2===null?nok(code2):code2===32?(effects.enter("space"),effects.consume(code2),effects.exit("space"),between2):code2===96?(token=effects.enter("codeTextSequence"),size=0,sequenceClose(code2)):markdownLineEnding(code2)?(effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),between2):(effects.enter("codeTextData"),data2(code2))}function data2(code2){return code2===null||code2===32||code2===96||markdownLineEnding(code2)?(effects.exit("codeTextData"),between2(code2)):(effects.consume(code2),data2)}function sequenceClose(code2){return code2===96?(effects.consume(code2),size++,sequenceClose):size===sizeOpen?(effects.exit("codeTextSequence"),effects.exit("codeText"),ok2(code2)):(token.type="codeTextData",data2(code2))}}function subtokenize(events){let jumps={},index2=-1,event,lineIndex,otherIndex,otherEvent,parameters,subevents,more;for(;++index2<events.length;){for(;index2 in jumps;)index2=jumps[index2];if(event=events[index2],index2&&event[1].type==="chunkFlow"&&events[index2-1][1].type==="listItemPrefix"&&(subevents=event[1]._tokenizer.events,otherIndex=0,otherIndex<subevents.length&&subevents[otherIndex][1].type==="lineEndingBlank"&&(otherIndex+=2),otherIndex<subevents.length&&subevents[otherIndex][1].type==="content"))for(;++otherIndex<subevents.length&&subevents[otherIndex][1].type!=="content";)subevents[otherIndex][1].type==="chunkText"&&(subevents[otherIndex][1]._isInFirstContentOfListItem=!0,otherIndex++);if(event[0]==="enter")event[1].contentType&&(Object.assign(jumps,subcontent(events,index2)),index2=jumps[index2],more=!0);else if(event[1]._container){for(otherIndex=index2,lineIndex=void 0;otherIndex--&&(otherEvent=events[otherIndex],otherEvent[1].type==="lineEnding"||otherEvent[1].type==="lineEndingBlank");)otherEvent[0]==="enter"&&(lineIndex&&(events[lineIndex][1].type="lineEndingBlank"),otherEvent[1].type="lineEnding",lineIndex=otherIndex);lineIndex&&(event[1].end=Object.assign({},events[lineIndex][1].start),parameters=events.slice(lineIndex,index2),parameters.unshift(event),splice(events,lineIndex,index2-lineIndex+1,parameters))}}return!more}function subcontent(events,eventIndex){let token=events[eventIndex][1],context=events[eventIndex][2],startPosition=eventIndex-1,startPositions=[],tokenizer2=token._tokenizer||context.parser[token.contentType](token.start),childEvents=tokenizer2.events,jumps=[],gaps={},stream,previous2,index2=-1,current2=token,adjust=0,start2=0,breaks=[start2];for(;current2;){for(;events[++startPosition][1]!==current2;);startPositions.push(startPosition),current2._tokenizer||(stream=context.sliceStream(current2),current2.next||stream.push(null),previous2&&tokenizer2.defineSkip(current2.start),current2._isInFirstContentOfListItem&&(tokenizer2._gfmTasklistFirstContentOfListItem=!0),tokenizer2.write(stream),current2._isInFirstContentOfListItem&&(tokenizer2._gfmTasklistFirstContentOfListItem=void 0)),previous2=current2,current2=current2.next}for(current2=token;++index2<childEvents.length;)childEvents[index2][0]==="exit"&&childEvents[index2-1][0]==="enter"&&childEvents[index2][1].type===childEvents[index2-1][1].type&&childEvents[index2][1].start.line!==childEvents[index2][1].end.line&&(start2=index2+1,breaks.push(start2),current2._tokenizer=void 0,current2.previous=void 0,current2=current2.next);for(tokenizer2.events=[],current2?(current2._tokenizer=void 0,current2.previous=void 0):breaks.pop(),index2=breaks.length;index2--;){let slice=childEvents.slice(breaks[index2],breaks[index2+1]),start3=startPositions.pop();jumps.unshift([start3,start3+slice.length-1]),splice(events,start3,2,slice)}for(index2=-1;++index2<jumps.length;)gaps[adjust+jumps[index2][0]]=adjust+jumps[index2][1],adjust+=jumps[index2][1]-jumps[index2][0]-1;return gaps}var content2={tokenize:tokenizeContent,resolve:resolveContent},continuationConstruct={tokenize:tokenizeContinuation,partial:!0};function resolveContent(events){return subtokenize(events),events}function tokenizeContent(effects,ok2){let previous2;return chunkStart;function chunkStart(code2){return effects.enter("content"),previous2=effects.enter("chunkContent",{contentType:"content"}),chunkInside(code2)}function chunkInside(code2){return code2===null?contentEnd(code2):markdownLineEnding(code2)?effects.check(continuationConstruct,contentContinue,contentEnd)(code2):(effects.consume(code2),chunkInside)}function contentEnd(code2){return effects.exit("chunkContent"),effects.exit("content"),ok2(code2)}function contentContinue(code2){return effects.consume(code2),effects.exit("chunkContent"),previous2.next=effects.enter("chunkContent",{contentType:"content",previous:previous2}),previous2=previous2.next,chunkInside}}function tokenizeContinuation(effects,ok2,nok){let self2=this;return startLookahead;function startLookahead(code2){return effects.exit("chunkContent"),effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),factorySpace(effects,prefixed,"linePrefix")}function prefixed(code2){if(code2===null||markdownLineEnding(code2))return nok(code2);let tail=self2.events[self2.events.length-1];return!self2.parser.constructs.disable.null.includes("codeIndented")&&tail&&tail[1].type==="linePrefix"&&tail[2].sliceSerialize(tail[1],!0).length>=4?ok2(code2):effects.interrupt(self2.parser.constructs.flow,nok,ok2)(code2)}}function factoryDestination(effects,ok2,nok,type,literalType,literalMarkerType,rawType,stringType,max){let limit=max||Number.POSITIVE_INFINITY,balance=0;return start2;function start2(code2){return code2===60?(effects.enter(type),effects.enter(literalType),effects.enter(literalMarkerType),effects.consume(code2),effects.exit(literalMarkerType),enclosedBefore):code2===null||code2===32||code2===41||asciiControl(code2)?nok(code2):(effects.enter(type),effects.enter(rawType),effects.enter(stringType),effects.enter("chunkString",{contentType:"string"}),raw(code2))}function enclosedBefore(code2){return code2===62?(effects.enter(literalMarkerType),effects.consume(code2),effects.exit(literalMarkerType),effects.exit(literalType),effects.exit(type),ok2):(effects.enter(stringType),effects.enter("chunkString",{contentType:"string"}),enclosed(code2))}function enclosed(code2){return code2===62?(effects.exit("chunkString"),effects.exit(stringType),enclosedBefore(code2)):code2===null||code2===60||markdownLineEnding(code2)?nok(code2):(effects.consume(code2),code2===92?enclosedEscape:enclosed)}function enclosedEscape(code2){return code2===60||code2===62||code2===92?(effects.consume(code2),enclosed):enclosed(code2)}function raw(code2){return!balance&&(code2===null||code2===41||markdownLineEndingOrSpace(code2))?(effects.exit("chunkString"),effects.exit(stringType),effects.exit(rawType),effects.exit(type),ok2(code2)):balance<limit&&code2===40?(effects.consume(code2),balance++,raw):code2===41?(effects.consume(code2),balance--,raw):code2===null||code2===32||code2===40||asciiControl(code2)?nok(code2):(effects.consume(code2),code2===92?rawEscape:raw)}function rawEscape(code2){return code2===40||code2===41||code2===92?(effects.consume(code2),raw):raw(code2)}}function factoryLabel(effects,ok2,nok,type,markerType,stringType){let self2=this,size=0,seen;return start2;function start2(code2){return effects.enter(type),effects.enter(markerType),effects.consume(code2),effects.exit(markerType),effects.enter(stringType),atBreak}function atBreak(code2){return size>999||code2===null||code2===91||code2===93&&!seen||code2===94&&!size&&"_hiddenFootnoteSupport"in self2.parser.constructs?nok(code2):code2===93?(effects.exit(stringType),effects.enter(markerType),effects.consume(code2),effects.exit(markerType),effects.exit(type),ok2):markdownLineEnding(code2)?(effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),atBreak):(effects.enter("chunkString",{contentType:"string"}),labelInside(code2))}function labelInside(code2){return code2===null||code2===91||code2===93||markdownLineEnding(code2)||size++>999?(effects.exit("chunkString"),atBreak(code2)):(effects.consume(code2),seen||(seen=!markdownSpace(code2)),code2===92?labelEscape:labelInside)}function labelEscape(code2){return code2===91||code2===92||code2===93?(effects.consume(code2),size++,labelInside):labelInside(code2)}}function factoryTitle(effects,ok2,nok,type,markerType,stringType){let marker;return start2;function start2(code2){return code2===34||code2===39||code2===40?(effects.enter(type),effects.enter(markerType),effects.consume(code2),effects.exit(markerType),marker=code2===40?41:code2,begin):nok(code2)}function begin(code2){return code2===marker?(effects.enter(markerType),effects.consume(code2),effects.exit(markerType),effects.exit(type),ok2):(effects.enter(stringType),atBreak(code2))}function atBreak(code2){return code2===marker?(effects.exit(stringType),begin(marker)):code2===null?nok(code2):markdownLineEnding(code2)?(effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),factorySpace(effects,atBreak,"linePrefix")):(effects.enter("chunkString",{contentType:"string"}),inside(code2))}function inside(code2){return code2===marker||code2===null||markdownLineEnding(code2)?(effects.exit("chunkString"),atBreak(code2)):(effects.consume(code2),code2===92?escape:inside)}function escape(code2){return code2===marker||code2===92?(effects.consume(code2),inside):inside(code2)}}function factoryWhitespace(effects,ok2){let seen;return start2;function start2(code2){return markdownLineEnding(code2)?(effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),seen=!0,start2):markdownSpace(code2)?factorySpace(effects,start2,seen?"linePrefix":"lineSuffix")(code2):ok2(code2)}}var definition={name:"definition",tokenize:tokenizeDefinition},titleBefore={tokenize:tokenizeTitleBefore,partial:!0};function tokenizeDefinition(effects,ok2,nok){let self2=this,identifier2;return start2;function start2(code2){return effects.enter("definition"),before(code2)}function before(code2){return factoryLabel.call(self2,effects,labelAfter,nok,"definitionLabel","definitionLabelMarker","definitionLabelString")(code2)}function labelAfter(code2){return identifier2=normalizeIdentifier(self2.sliceSerialize(self2.events[self2.events.length-1][1]).slice(1,-1)),code2===58?(effects.enter("definitionMarker"),effects.consume(code2),effects.exit("definitionMarker"),markerAfter):nok(code2)}function markerAfter(code2){return markdownLineEndingOrSpace(code2)?factoryWhitespace(effects,destinationBefore)(code2):destinationBefore(code2)}function destinationBefore(code2){return factoryDestination(effects,destinationAfter,nok,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(code2)}function destinationAfter(code2){return effects.attempt(titleBefore,after,after)(code2)}function after(code2){return markdownSpace(code2)?factorySpace(effects,afterWhitespace,"whitespace")(code2):afterWhitespace(code2)}function afterWhitespace(code2){return code2===null||markdownLineEnding(code2)?(effects.exit("definition"),self2.parser.defined.push(identifier2),ok2(code2)):nok(code2)}}function tokenizeTitleBefore(effects,ok2,nok){return titleBefore2;function titleBefore2(code2){return markdownLineEndingOrSpace(code2)?factoryWhitespace(effects,beforeMarker)(code2):nok(code2)}function beforeMarker(code2){return factoryTitle(effects,titleAfter,nok,"definitionTitle","definitionTitleMarker","definitionTitleString")(code2)}function titleAfter(code2){return markdownSpace(code2)?factorySpace(effects,titleAfterOptionalWhitespace,"whitespace")(code2):titleAfterOptionalWhitespace(code2)}function titleAfterOptionalWhitespace(code2){return code2===null||markdownLineEnding(code2)?ok2(code2):nok(code2)}}var hardBreakEscape={name:"hardBreakEscape",tokenize:tokenizeHardBreakEscape};function tokenizeHardBreakEscape(effects,ok2,nok){return start2;function start2(code2){return effects.enter("hardBreakEscape"),effects.consume(code2),after}function after(code2){return markdownLineEnding(code2)?(effects.exit("hardBreakEscape"),ok2(code2)):nok(code2)}}var headingAtx={name:"headingAtx",tokenize:tokenizeHeadingAtx,resolve:resolveHeadingAtx};function resolveHeadingAtx(events,context){let contentEnd=events.length-2,contentStart=3,content3,text4;return events[contentStart][1].type==="whitespace"&&(contentStart+=2),contentEnd-2>contentStart&&events[contentEnd][1].type==="whitespace"&&(contentEnd-=2),events[contentEnd][1].type==="atxHeadingSequence"&&(contentStart===contentEnd-1||contentEnd-4>contentStart&&events[contentEnd-2][1].type==="whitespace")&&(contentEnd-=contentStart+1===contentEnd?2:4),contentEnd>contentStart&&(content3={type:"atxHeadingText",start:events[contentStart][1].start,end:events[contentEnd][1].end},text4={type:"chunkText",start:events[contentStart][1].start,end:events[contentEnd][1].end,contentType:"text"},splice(events,contentStart,contentEnd-contentStart+1,[["enter",content3,context],["enter",text4,context],["exit",text4,context],["exit",content3,context]])),events}function tokenizeHeadingAtx(effects,ok2,nok){let size=0;return start2;function start2(code2){return effects.enter("atxHeading"),before(code2)}function before(code2){return effects.enter("atxHeadingSequence"),sequenceOpen(code2)}function sequenceOpen(code2){return code2===35&&size++<6?(effects.consume(code2),sequenceOpen):code2===null||markdownLineEndingOrSpace(code2)?(effects.exit("atxHeadingSequence"),atBreak(code2)):nok(code2)}function atBreak(code2){return code2===35?(effects.enter("atxHeadingSequence"),sequenceFurther(code2)):code2===null||markdownLineEnding(code2)?(effects.exit("atxHeading"),ok2(code2)):markdownSpace(code2)?factorySpace(effects,atBreak,"whitespace")(code2):(effects.enter("atxHeadingText"),data2(code2))}function sequenceFurther(code2){return code2===35?(effects.consume(code2),sequenceFurther):(effects.exit("atxHeadingSequence"),atBreak(code2))}function data2(code2){return code2===null||code2===35||markdownLineEndingOrSpace(code2)?(effects.exit("atxHeadingText"),atBreak(code2)):(effects.consume(code2),data2)}}var htmlBlockNames=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],htmlRawNames=["pre","script","style","textarea"];var htmlFlow={name:"htmlFlow",tokenize:tokenizeHtmlFlow,resolveTo:resolveToHtmlFlow,concrete:!0},blankLineBefore={tokenize:tokenizeBlankLineBefore,partial:!0},nonLazyContinuationStart={tokenize:tokenizeNonLazyContinuationStart,partial:!0};function resolveToHtmlFlow(events){let index2=events.length;for(;index2--&&!(events[index2][0]==="enter"&&events[index2][1].type==="htmlFlow"););return index2>1&&events[index2-2][1].type==="linePrefix"&&(events[index2][1].start=events[index2-2][1].start,events[index2+1][1].start=events[index2-2][1].start,events.splice(index2-2,2)),events}function tokenizeHtmlFlow(effects,ok2,nok){let self2=this,marker,closingTag,buffer,index2,markerB;return start2;function start2(code2){return before(code2)}function before(code2){return effects.enter("htmlFlow"),effects.enter("htmlFlowData"),effects.consume(code2),open}function open(code2){return code2===33?(effects.consume(code2),declarationOpen):code2===47?(effects.consume(code2),closingTag=!0,tagCloseStart):code2===63?(effects.consume(code2),marker=3,self2.interrupt?ok2:continuationDeclarationInside):asciiAlpha(code2)?(effects.consume(code2),buffer=String.fromCharCode(code2),tagName):nok(code2)}function declarationOpen(code2){return code2===45?(effects.consume(code2),marker=2,commentOpenInside):code2===91?(effects.consume(code2),marker=5,index2=0,cdataOpenInside):asciiAlpha(code2)?(effects.consume(code2),marker=4,self2.interrupt?ok2:continuationDeclarationInside):nok(code2)}function commentOpenInside(code2){return code2===45?(effects.consume(code2),self2.interrupt?ok2:continuationDeclarationInside):nok(code2)}function cdataOpenInside(code2){let value="CDATA[";return code2===value.charCodeAt(index2++)?(effects.consume(code2),index2===value.length?self2.interrupt?ok2:continuation:cdataOpenInside):nok(code2)}function tagCloseStart(code2){return asciiAlpha(code2)?(effects.consume(code2),buffer=String.fromCharCode(code2),tagName):nok(code2)}function tagName(code2){if(code2===null||code2===47||code2===62||markdownLineEndingOrSpace(code2)){let slash=code2===47,name2=buffer.toLowerCase();return!slash&&!closingTag&&htmlRawNames.includes(name2)?(marker=1,self2.interrupt?ok2(code2):continuation(code2)):htmlBlockNames.includes(buffer.toLowerCase())?(marker=6,slash?(effects.consume(code2),basicSelfClosing):self2.interrupt?ok2(code2):continuation(code2)):(marker=7,self2.interrupt&&!self2.parser.lazy[self2.now().line]?nok(code2):closingTag?completeClosingTagAfter(code2):completeAttributeNameBefore(code2))}return code2===45||asciiAlphanumeric(code2)?(effects.consume(code2),buffer+=String.fromCharCode(code2),tagName):nok(code2)}function basicSelfClosing(code2){return code2===62?(effects.consume(code2),self2.interrupt?ok2:continuation):nok(code2)}function completeClosingTagAfter(code2){return markdownSpace(code2)?(effects.consume(code2),completeClosingTagAfter):completeEnd(code2)}function completeAttributeNameBefore(code2){return code2===47?(effects.consume(code2),completeEnd):code2===58||code2===95||asciiAlpha(code2)?(effects.consume(code2),completeAttributeName):markdownSpace(code2)?(effects.consume(code2),completeAttributeNameBefore):completeEnd(code2)}function completeAttributeName(code2){return code2===45||code2===46||code2===58||code2===95||asciiAlphanumeric(code2)?(effects.consume(code2),completeAttributeName):completeAttributeNameAfter(code2)}function completeAttributeNameAfter(code2){return code2===61?(effects.consume(code2),completeAttributeValueBefore):markdownSpace(code2)?(effects.consume(code2),completeAttributeNameAfter):completeAttributeNameBefore(code2)}function completeAttributeValueBefore(code2){return code2===null||code2===60||code2===61||code2===62||code2===96?nok(code2):code2===34||code2===39?(effects.consume(code2),markerB=code2,completeAttributeValueQuoted):markdownSpace(code2)?(effects.consume(code2),completeAttributeValueBefore):completeAttributeValueUnquoted(code2)}function completeAttributeValueQuoted(code2){return code2===markerB?(effects.consume(code2),markerB=null,completeAttributeValueQuotedAfter):code2===null||markdownLineEnding(code2)?nok(code2):(effects.consume(code2),completeAttributeValueQuoted)}function completeAttributeValueUnquoted(code2){return code2===null||code2===34||code2===39||code2===47||code2===60||code2===61||code2===62||code2===96||markdownLineEndingOrSpace(code2)?completeAttributeNameAfter(code2):(effects.consume(code2),completeAttributeValueUnquoted)}function completeAttributeValueQuotedAfter(code2){return code2===47||code2===62||markdownSpace(code2)?completeAttributeNameBefore(code2):nok(code2)}function completeEnd(code2){return code2===62?(effects.consume(code2),completeAfter):nok(code2)}function completeAfter(code2){return code2===null||markdownLineEnding(code2)?continuation(code2):markdownSpace(code2)?(effects.consume(code2),completeAfter):nok(code2)}function continuation(code2){return code2===45&&marker===2?(effects.consume(code2),continuationCommentInside):code2===60&&marker===1?(effects.consume(code2),continuationRawTagOpen):code2===62&&marker===4?(effects.consume(code2),continuationClose):code2===63&&marker===3?(effects.consume(code2),continuationDeclarationInside):code2===93&&marker===5?(effects.consume(code2),continuationCdataInside):markdownLineEnding(code2)&&(marker===6||marker===7)?(effects.exit("htmlFlowData"),effects.check(blankLineBefore,continuationAfter,continuationStart)(code2)):code2===null||markdownLineEnding(code2)?(effects.exit("htmlFlowData"),continuationStart(code2)):(effects.consume(code2),continuation)}function continuationStart(code2){return effects.check(nonLazyContinuationStart,continuationStartNonLazy,continuationAfter)(code2)}function continuationStartNonLazy(code2){return effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),continuationBefore}function continuationBefore(code2){return code2===null||markdownLineEnding(code2)?continuationStart(code2):(effects.enter("htmlFlowData"),continuation(code2))}function continuationCommentInside(code2){return code2===45?(effects.consume(code2),continuationDeclarationInside):continuation(code2)}function continuationRawTagOpen(code2){return code2===47?(effects.consume(code2),buffer="",continuationRawEndTag):continuation(code2)}function continuationRawEndTag(code2){if(code2===62){let name2=buffer.toLowerCase();return htmlRawNames.includes(name2)?(effects.consume(code2),continuationClose):continuation(code2)}return asciiAlpha(code2)&&buffer.length<8?(effects.consume(code2),buffer+=String.fromCharCode(code2),continuationRawEndTag):continuation(code2)}function continuationCdataInside(code2){return code2===93?(effects.consume(code2),continuationDeclarationInside):continuation(code2)}function continuationDeclarationInside(code2){return code2===62?(effects.consume(code2),continuationClose):code2===45&&marker===2?(effects.consume(code2),continuationDeclarationInside):continuation(code2)}function continuationClose(code2){return code2===null||markdownLineEnding(code2)?(effects.exit("htmlFlowData"),continuationAfter(code2)):(effects.consume(code2),continuationClose)}function continuationAfter(code2){return effects.exit("htmlFlow"),ok2(code2)}}function tokenizeNonLazyContinuationStart(effects,ok2,nok){let self2=this;return start2;function start2(code2){return markdownLineEnding(code2)?(effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),after):nok(code2)}function after(code2){return self2.parser.lazy[self2.now().line]?nok(code2):ok2(code2)}}function tokenizeBlankLineBefore(effects,ok2,nok){return start2;function start2(code2){return effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),effects.attempt(blankLine,ok2,nok)}}var htmlText={name:"htmlText",tokenize:tokenizeHtmlText};function tokenizeHtmlText(effects,ok2,nok){let self2=this,marker,index2,returnState;return start2;function start2(code2){return effects.enter("htmlText"),effects.enter("htmlTextData"),effects.consume(code2),open}function open(code2){return code2===33?(effects.consume(code2),declarationOpen):code2===47?(effects.consume(code2),tagCloseStart):code2===63?(effects.consume(code2),instruction):asciiAlpha(code2)?(effects.consume(code2),tagOpen):nok(code2)}function declarationOpen(code2){return code2===45?(effects.consume(code2),commentOpenInside):code2===91?(effects.consume(code2),index2=0,cdataOpenInside):asciiAlpha(code2)?(effects.consume(code2),declaration):nok(code2)}function commentOpenInside(code2){return code2===45?(effects.consume(code2),commentEnd):nok(code2)}function comment(code2){return code2===null?nok(code2):code2===45?(effects.consume(code2),commentClose):markdownLineEnding(code2)?(returnState=comment,lineEndingBefore(code2)):(effects.consume(code2),comment)}function commentClose(code2){return code2===45?(effects.consume(code2),commentEnd):comment(code2)}function commentEnd(code2){return code2===62?end(code2):code2===45?commentClose(code2):comment(code2)}function cdataOpenInside(code2){let value="CDATA[";return code2===value.charCodeAt(index2++)?(effects.consume(code2),index2===value.length?cdata:cdataOpenInside):nok(code2)}function cdata(code2){return code2===null?nok(code2):code2===93?(effects.consume(code2),cdataClose):markdownLineEnding(code2)?(returnState=cdata,lineEndingBefore(code2)):(effects.consume(code2),cdata)}function cdataClose(code2){return code2===93?(effects.consume(code2),cdataEnd):cdata(code2)}function cdataEnd(code2){return code2===62?end(code2):code2===93?(effects.consume(code2),cdataEnd):cdata(code2)}function declaration(code2){return code2===null||code2===62?end(code2):markdownLineEnding(code2)?(returnState=declaration,lineEndingBefore(code2)):(effects.consume(code2),declaration)}function instruction(code2){return code2===null?nok(code2):code2===63?(effects.consume(code2),instructionClose):markdownLineEnding(code2)?(returnState=instruction,lineEndingBefore(code2)):(effects.consume(code2),instruction)}function instructionClose(code2){return code2===62?end(code2):instruction(code2)}function tagCloseStart(code2){return asciiAlpha(code2)?(effects.consume(code2),tagClose):nok(code2)}function tagClose(code2){return code2===45||asciiAlphanumeric(code2)?(effects.consume(code2),tagClose):tagCloseBetween(code2)}function tagCloseBetween(code2){return markdownLineEnding(code2)?(returnState=tagCloseBetween,lineEndingBefore(code2)):markdownSpace(code2)?(effects.consume(code2),tagCloseBetween):end(code2)}function tagOpen(code2){return code2===45||asciiAlphanumeric(code2)?(effects.consume(code2),tagOpen):code2===47||code2===62||markdownLineEndingOrSpace(code2)?tagOpenBetween(code2):nok(code2)}function tagOpenBetween(code2){return code2===47?(effects.consume(code2),end):code2===58||code2===95||asciiAlpha(code2)?(effects.consume(code2),tagOpenAttributeName):markdownLineEnding(code2)?(returnState=tagOpenBetween,lineEndingBefore(code2)):markdownSpace(code2)?(effects.consume(code2),tagOpenBetween):end(code2)}function tagOpenAttributeName(code2){return code2===45||code2===46||code2===58||code2===95||asciiAlphanumeric(code2)?(effects.consume(code2),tagOpenAttributeName):tagOpenAttributeNameAfter(code2)}function tagOpenAttributeNameAfter(code2){return code2===61?(effects.consume(code2),tagOpenAttributeValueBefore):markdownLineEnding(code2)?(returnState=tagOpenAttributeNameAfter,lineEndingBefore(code2)):markdownSpace(code2)?(effects.consume(code2),tagOpenAttributeNameAfter):tagOpenBetween(code2)}function tagOpenAttributeValueBefore(code2){return code2===null||code2===60||code2===61||code2===62||code2===96?nok(code2):code2===34||code2===39?(effects.consume(code2),marker=code2,tagOpenAttributeValueQuoted):markdownLineEnding(code2)?(returnState=tagOpenAttributeValueBefore,lineEndingBefore(code2)):markdownSpace(code2)?(effects.consume(code2),tagOpenAttributeValueBefore):(effects.consume(code2),tagOpenAttributeValueUnquoted)}function tagOpenAttributeValueQuoted(code2){return code2===marker?(effects.consume(code2),marker=void 0,tagOpenAttributeValueQuotedAfter):code2===null?nok(code2):markdownLineEnding(code2)?(returnState=tagOpenAttributeValueQuoted,lineEndingBefore(code2)):(effects.consume(code2),tagOpenAttributeValueQuoted)}function tagOpenAttributeValueUnquoted(code2){return code2===null||code2===34||code2===39||code2===60||code2===61||code2===96?nok(code2):code2===47||code2===62||markdownLineEndingOrSpace(code2)?tagOpenBetween(code2):(effects.consume(code2),tagOpenAttributeValueUnquoted)}function tagOpenAttributeValueQuotedAfter(code2){return code2===47||code2===62||markdownLineEndingOrSpace(code2)?tagOpenBetween(code2):nok(code2)}function end(code2){return code2===62?(effects.consume(code2),effects.exit("htmlTextData"),effects.exit("htmlText"),ok2):nok(code2)}function lineEndingBefore(code2){return effects.exit("htmlTextData"),effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),lineEndingAfter}function lineEndingAfter(code2){return markdownSpace(code2)?factorySpace(effects,lineEndingAfterPrefix,"linePrefix",self2.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(code2):lineEndingAfterPrefix(code2)}function lineEndingAfterPrefix(code2){return effects.enter("htmlTextData"),returnState(code2)}}var labelEnd={name:"labelEnd",tokenize:tokenizeLabelEnd,resolveTo:resolveToLabelEnd,resolveAll:resolveAllLabelEnd},resourceConstruct={tokenize:tokenizeResource},referenceFullConstruct={tokenize:tokenizeReferenceFull},referenceCollapsedConstruct={tokenize:tokenizeReferenceCollapsed};function resolveAllLabelEnd(events){let index2=-1;for(;++index2<events.length;){let token=events[index2][1];(token.type==="labelImage"||token.type==="labelLink"||token.type==="labelEnd")&&(events.splice(index2+1,token.type==="labelImage"?4:2),token.type="data",index2++)}return events}function resolveToLabelEnd(events,context){let index2=events.length,offset2=0,token,open,close,media;for(;index2--;)if(token=events[index2][1],open){if(token.type==="link"||token.type==="labelLink"&&token._inactive)break;events[index2][0]==="enter"&&token.type==="labelLink"&&(token._inactive=!0)}else if(close){if(events[index2][0]==="enter"&&(token.type==="labelImage"||token.type==="labelLink")&&!token._balanced&&(open=index2,token.type!=="labelLink")){offset2=2;break}}else token.type==="labelEnd"&&(close=index2);let group={type:events[open][1].type==="labelLink"?"link":"image",start:Object.assign({},events[open][1].start),end:Object.assign({},events[events.length-1][1].end)},label={type:"label",start:Object.assign({},events[open][1].start),end:Object.assign({},events[close][1].end)},text4={type:"labelText",start:Object.assign({},events[open+offset2+2][1].end),end:Object.assign({},events[close-2][1].start)};return media=[["enter",group,context],["enter",label,context]],media=push(media,events.slice(open+1,open+offset2+3)),media=push(media,[["enter",text4,context]]),media=push(media,resolveAll(context.parser.constructs.insideSpan.null,events.slice(open+offset2+4,close-3),context)),media=push(media,[["exit",text4,context],events[close-2],events[close-1],["exit",label,context]]),media=push(media,events.slice(close+1)),media=push(media,[["exit",group,context]]),splice(events,open,events.length,media),events}function tokenizeLabelEnd(effects,ok2,nok){let self2=this,index2=self2.events.length,labelStart,defined;for(;index2--;)if((self2.events[index2][1].type==="labelImage"||self2.events[index2][1].type==="labelLink")&&!self2.events[index2][1]._balanced){labelStart=self2.events[index2][1];break}return start2;function start2(code2){return labelStart?labelStart._inactive?labelEndNok(code2):(defined=self2.parser.defined.includes(normalizeIdentifier(self2.sliceSerialize({start:labelStart.end,end:self2.now()}))),effects.enter("labelEnd"),effects.enter("labelMarker"),effects.consume(code2),effects.exit("labelMarker"),effects.exit("labelEnd"),after):nok(code2)}function after(code2){return code2===40?effects.attempt(resourceConstruct,labelEndOk,defined?labelEndOk:labelEndNok)(code2):code2===91?effects.attempt(referenceFullConstruct,labelEndOk,defined?referenceNotFull:labelEndNok)(code2):defined?labelEndOk(code2):labelEndNok(code2)}function referenceNotFull(code2){return effects.attempt(referenceCollapsedConstruct,labelEndOk,labelEndNok)(code2)}function labelEndOk(code2){return ok2(code2)}function labelEndNok(code2){return labelStart._balanced=!0,nok(code2)}}function tokenizeResource(effects,ok2,nok){return resourceStart;function resourceStart(code2){return effects.enter("resource"),effects.enter("resourceMarker"),effects.consume(code2),effects.exit("resourceMarker"),resourceBefore}function resourceBefore(code2){return markdownLineEndingOrSpace(code2)?factoryWhitespace(effects,resourceOpen)(code2):resourceOpen(code2)}function resourceOpen(code2){return code2===41?resourceEnd(code2):factoryDestination(effects,resourceDestinationAfter,resourceDestinationMissing,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(code2)}function resourceDestinationAfter(code2){return markdownLineEndingOrSpace(code2)?factoryWhitespace(effects,resourceBetween)(code2):resourceEnd(code2)}function resourceDestinationMissing(code2){return nok(code2)}function resourceBetween(code2){return code2===34||code2===39||code2===40?factoryTitle(effects,resourceTitleAfter,nok,"resourceTitle","resourceTitleMarker","resourceTitleString")(code2):resourceEnd(code2)}function resourceTitleAfter(code2){return markdownLineEndingOrSpace(code2)?factoryWhitespace(effects,resourceEnd)(code2):resourceEnd(code2)}function resourceEnd(code2){return code2===41?(effects.enter("resourceMarker"),effects.consume(code2),effects.exit("resourceMarker"),effects.exit("resource"),ok2):nok(code2)}}function tokenizeReferenceFull(effects,ok2,nok){let self2=this;return referenceFull;function referenceFull(code2){return factoryLabel.call(self2,effects,referenceFullAfter,referenceFullMissing,"reference","referenceMarker","referenceString")(code2)}function referenceFullAfter(code2){return self2.parser.defined.includes(normalizeIdentifier(self2.sliceSerialize(self2.events[self2.events.length-1][1]).slice(1,-1)))?ok2(code2):nok(code2)}function referenceFullMissing(code2){return nok(code2)}}function tokenizeReferenceCollapsed(effects,ok2,nok){return referenceCollapsedStart;function referenceCollapsedStart(code2){return effects.enter("reference"),effects.enter("referenceMarker"),effects.consume(code2),effects.exit("referenceMarker"),referenceCollapsedOpen}function referenceCollapsedOpen(code2){return code2===93?(effects.enter("referenceMarker"),effects.consume(code2),effects.exit("referenceMarker"),effects.exit("reference"),ok2):nok(code2)}}var labelStartImage={name:"labelStartImage",tokenize:tokenizeLabelStartImage,resolveAll:labelEnd.resolveAll};function tokenizeLabelStartImage(effects,ok2,nok){let self2=this;return start2;function start2(code2){return effects.enter("labelImage"),effects.enter("labelImageMarker"),effects.consume(code2),effects.exit("labelImageMarker"),open}function open(code2){return code2===91?(effects.enter("labelMarker"),effects.consume(code2),effects.exit("labelMarker"),effects.exit("labelImage"),after):nok(code2)}function after(code2){return code2===94&&"_hiddenFootnoteSupport"in self2.parser.constructs?nok(code2):ok2(code2)}}var labelStartLink={name:"labelStartLink",tokenize:tokenizeLabelStartLink,resolveAll:labelEnd.resolveAll};function tokenizeLabelStartLink(effects,ok2,nok){let self2=this;return start2;function start2(code2){return effects.enter("labelLink"),effects.enter("labelMarker"),effects.consume(code2),effects.exit("labelMarker"),effects.exit("labelLink"),after}function after(code2){return code2===94&&"_hiddenFootnoteSupport"in self2.parser.constructs?nok(code2):ok2(code2)}}var lineEnding={name:"lineEnding",tokenize:tokenizeLineEnding};function tokenizeLineEnding(effects,ok2){return start2;function start2(code2){return effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),factorySpace(effects,ok2,"linePrefix")}}var thematicBreak={name:"thematicBreak",tokenize:tokenizeThematicBreak};function tokenizeThematicBreak(effects,ok2,nok){let size=0,marker;return start2;function start2(code2){return effects.enter("thematicBreak"),before(code2)}function before(code2){return marker=code2,atBreak(code2)}function atBreak(code2){return code2===marker?(effects.enter("thematicBreakSequence"),sequence(code2)):size>=3&&(code2===null||markdownLineEnding(code2))?(effects.exit("thematicBreak"),ok2(code2)):nok(code2)}function sequence(code2){return code2===marker?(effects.consume(code2),size++,sequence):(effects.exit("thematicBreakSequence"),markdownSpace(code2)?factorySpace(effects,atBreak,"whitespace")(code2):atBreak(code2))}}var list={name:"list",tokenize:tokenizeListStart,continuation:{tokenize:tokenizeListContinuation},exit:tokenizeListEnd},listItemPrefixWhitespaceConstruct={tokenize:tokenizeListItemPrefixWhitespace,partial:!0},indentConstruct={tokenize:tokenizeIndent,partial:!0};function tokenizeListStart(effects,ok2,nok){let self2=this,tail=self2.events[self2.events.length-1],initialSize=tail&&tail[1].type==="linePrefix"?tail[2].sliceSerialize(tail[1],!0).length:0,size=0;return start2;function start2(code2){let kind=self2.containerState.type||(code2===42||code2===43||code2===45?"listUnordered":"listOrdered");if(kind==="listUnordered"?!self2.containerState.marker||code2===self2.containerState.marker:asciiDigit(code2)){if(self2.containerState.type||(self2.containerState.type=kind,effects.enter(kind,{_container:!0})),kind==="listUnordered")return effects.enter("listItemPrefix"),code2===42||code2===45?effects.check(thematicBreak,nok,atMarker)(code2):atMarker(code2);if(!self2.interrupt||code2===49)return effects.enter("listItemPrefix"),effects.enter("listItemValue"),inside(code2)}return nok(code2)}function inside(code2){return asciiDigit(code2)&&++size<10?(effects.consume(code2),inside):(!self2.interrupt||size<2)&&(self2.containerState.marker?code2===self2.containerState.marker:code2===41||code2===46)?(effects.exit("listItemValue"),atMarker(code2)):nok(code2)}function atMarker(code2){return effects.enter("listItemMarker"),effects.consume(code2),effects.exit("listItemMarker"),self2.containerState.marker=self2.containerState.marker||code2,effects.check(blankLine,self2.interrupt?nok:onBlank,effects.attempt(listItemPrefixWhitespaceConstruct,endOfPrefix,otherPrefix))}function onBlank(code2){return self2.containerState.initialBlankLine=!0,initialSize++,endOfPrefix(code2)}function otherPrefix(code2){return markdownSpace(code2)?(effects.enter("listItemPrefixWhitespace"),effects.consume(code2),effects.exit("listItemPrefixWhitespace"),endOfPrefix):nok(code2)}function endOfPrefix(code2){return self2.containerState.size=initialSize+self2.sliceSerialize(effects.exit("listItemPrefix"),!0).length,ok2(code2)}}function tokenizeListContinuation(effects,ok2,nok){let self2=this;return self2.containerState._closeFlow=void 0,effects.check(blankLine,onBlank,notBlank);function onBlank(code2){return self2.containerState.furtherBlankLines=self2.containerState.furtherBlankLines||self2.containerState.initialBlankLine,factorySpace(effects,ok2,"listItemIndent",self2.containerState.size+1)(code2)}function notBlank(code2){return self2.containerState.furtherBlankLines||!markdownSpace(code2)?(self2.containerState.furtherBlankLines=void 0,self2.containerState.initialBlankLine=void 0,notInCurrentItem(code2)):(self2.containerState.furtherBlankLines=void 0,self2.containerState.initialBlankLine=void 0,effects.attempt(indentConstruct,ok2,notInCurrentItem)(code2))}function notInCurrentItem(code2){return self2.containerState._closeFlow=!0,self2.interrupt=void 0,factorySpace(effects,effects.attempt(list,ok2,nok),"linePrefix",self2.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(code2)}}function tokenizeIndent(effects,ok2,nok){let self2=this;return factorySpace(effects,afterPrefix,"listItemIndent",self2.containerState.size+1);function afterPrefix(code2){let tail=self2.events[self2.events.length-1];return tail&&tail[1].type==="listItemIndent"&&tail[2].sliceSerialize(tail[1],!0).length===self2.containerState.size?ok2(code2):nok(code2)}}function tokenizeListEnd(effects){effects.exit(this.containerState.type)}function tokenizeListItemPrefixWhitespace(effects,ok2,nok){let self2=this;return factorySpace(effects,afterPrefix,"listItemPrefixWhitespace",self2.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function afterPrefix(code2){let tail=self2.events[self2.events.length-1];return!markdownSpace(code2)&&tail&&tail[1].type==="listItemPrefixWhitespace"?ok2(code2):nok(code2)}}var setextUnderline={name:"setextUnderline",tokenize:tokenizeSetextUnderline,resolveTo:resolveToSetextUnderline};function resolveToSetextUnderline(events,context){let index2=events.length,content3,text4,definition3;for(;index2--;)if(events[index2][0]==="enter"){if(events[index2][1].type==="content"){content3=index2;break}events[index2][1].type==="paragraph"&&(text4=index2)}else events[index2][1].type==="content"&&events.splice(index2,1),!definition3&&events[index2][1].type==="definition"&&(definition3=index2);let heading2={type:"setextHeading",start:Object.assign({},events[text4][1].start),end:Object.assign({},events[events.length-1][1].end)};return events[text4][1].type="setextHeadingText",definition3?(events.splice(text4,0,["enter",heading2,context]),events.splice(definition3+1,0,["exit",events[content3][1],context]),events[content3][1].end=Object.assign({},events[definition3][1].end)):events[content3][1]=heading2,events.push(["exit",heading2,context]),events}function tokenizeSetextUnderline(effects,ok2,nok){let self2=this,marker;return start2;function start2(code2){let index2=self2.events.length,paragraph2;for(;index2--;)if(self2.events[index2][1].type!=="lineEnding"&&self2.events[index2][1].type!=="linePrefix"&&self2.events[index2][1].type!=="content"){paragraph2=self2.events[index2][1].type==="paragraph";break}return!self2.parser.lazy[self2.now().line]&&(self2.interrupt||paragraph2)?(effects.enter("setextHeadingLine"),marker=code2,before(code2)):nok(code2)}function before(code2){return effects.enter("setextHeadingLineSequence"),inside(code2)}function inside(code2){return code2===marker?(effects.consume(code2),inside):(effects.exit("setextHeadingLineSequence"),markdownSpace(code2)?factorySpace(effects,after,"lineSuffix")(code2):after(code2))}function after(code2){return code2===null||markdownLineEnding(code2)?(effects.exit("setextHeadingLine"),ok2(code2)):nok(code2)}}var flow={tokenize:initializeFlow};function initializeFlow(effects){let self2=this,initial=effects.attempt(blankLine,atBlankEnding,effects.attempt(this.parser.constructs.flowInitial,afterConstruct,factorySpace(effects,effects.attempt(this.parser.constructs.flow,afterConstruct,effects.attempt(content2,afterConstruct)),"linePrefix")));return initial;function atBlankEnding(code2){if(code2===null){effects.consume(code2);return}return effects.enter("lineEndingBlank"),effects.consume(code2),effects.exit("lineEndingBlank"),self2.currentConstruct=void 0,initial}function afterConstruct(code2){if(code2===null){effects.consume(code2);return}return effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),self2.currentConstruct=void 0,initial}}var resolver={resolveAll:createResolver()},string=initializeFactory("string"),text=initializeFactory("text");function initializeFactory(field){return{tokenize:initializeText,resolveAll:createResolver(field==="text"?resolveAllLineSuffixes:void 0)};function initializeText(effects){let self2=this,constructs2=this.parser.constructs[field],text4=effects.attempt(constructs2,start2,notText);return start2;function start2(code2){return atBreak(code2)?text4(code2):notText(code2)}function notText(code2){if(code2===null){effects.consume(code2);return}return effects.enter("data"),effects.consume(code2),data2}function data2(code2){return atBreak(code2)?(effects.exit("data"),text4(code2)):(effects.consume(code2),data2)}function atBreak(code2){if(code2===null)return!0;let list4=constructs2[code2],index2=-1;if(list4)for(;++index2<list4.length;){let item=list4[index2];if(!item.previous||item.previous.call(self2,self2.previous))return!0}return!1}}}function createResolver(extraResolver){return resolveAllText;function resolveAllText(events,context){let index2=-1,enter;for(;++index2<=events.length;)enter===void 0?events[index2]&&events[index2][1].type==="data"&&(enter=index2,index2++):(!events[index2]||events[index2][1].type!=="data")&&(index2!==enter+2&&(events[enter][1].end=events[index2-1][1].end,events.splice(enter+2,index2-enter-2),index2=enter+2),enter=void 0);return extraResolver?extraResolver(events,context):events}}function resolveAllLineSuffixes(events,context){let eventIndex=0;for(;++eventIndex<=events.length;)if((eventIndex===events.length||events[eventIndex][1].type==="lineEnding")&&events[eventIndex-1][1].type==="data"){let data2=events[eventIndex-1][1],chunks=context.sliceStream(data2),index2=chunks.length,bufferIndex=-1,size=0,tabs;for(;index2--;){let chunk=chunks[index2];if(typeof chunk=="string"){for(bufferIndex=chunk.length;chunk.charCodeAt(bufferIndex-1)===32;)size++,bufferIndex--;if(bufferIndex)break;bufferIndex=-1}else if(chunk===-2)tabs=!0,size++;else if(chunk!==-1){index2++;break}}if(size){let token={type:eventIndex===events.length||tabs||size<2?"lineSuffix":"hardBreakTrailing",start:{line:data2.end.line,column:data2.end.column-size,offset:data2.end.offset-size,_index:data2.start._index+index2,_bufferIndex:index2?bufferIndex:data2.start._bufferIndex+bufferIndex},end:Object.assign({},data2.end)};data2.end=Object.assign({},token.start),data2.start.offset===data2.end.offset?Object.assign(data2,token):(events.splice(eventIndex,0,["enter",token,context],["exit",token,context]),eventIndex+=2)}eventIndex++}return events}function createTokenizer(parser,initialize,from){let point3=Object.assign(from?Object.assign({},from):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1}),columnStart={},resolveAllConstructs=[],chunks=[],stack=[],consumed=!0,effects={consume,enter,exit:exit2,attempt:constructFactory(onsuccessfulconstruct),check:constructFactory(onsuccessfulcheck),interrupt:constructFactory(onsuccessfulcheck,{interrupt:!0})},context={previous:null,code:null,containerState:{},events:[],parser,sliceStream,sliceSerialize,now,defineSkip,write},state=initialize.tokenize.call(context,effects),expectedCode;return initialize.resolveAll&&resolveAllConstructs.push(initialize),context;function write(slice){return chunks=push(chunks,slice),main(),chunks[chunks.length-1]!==null?[]:(addResult(initialize,0),context.events=resolveAll(resolveAllConstructs,context.events,context),context.events)}function sliceSerialize(token,expandTabs){return serializeChunks(sliceStream(token),expandTabs)}function sliceStream(token){return sliceChunks(chunks,token)}function now(){let{line,column,offset:offset2,_index,_bufferIndex}=point3;return{line,column,offset:offset2,_index,_bufferIndex}}function defineSkip(value){columnStart[value.line]=value.column,accountForPotentialSkip()}function main(){let chunkIndex;for(;point3._index<chunks.length;){let chunk=chunks[point3._index];if(typeof chunk=="string")for(chunkIndex=point3._index,point3._bufferIndex<0&&(point3._bufferIndex=0);point3._index===chunkIndex&&point3._bufferIndex<chunk.length;)go(chunk.charCodeAt(point3._bufferIndex));else go(chunk)}}function go(code2){consumed=void 0,expectedCode=code2,state=state(code2)}function consume(code2){markdownLineEnding(code2)?(point3.line++,point3.column=1,point3.offset+=code2===-3?2:1,accountForPotentialSkip()):code2!==-1&&(point3.column++,point3.offset++),point3._bufferIndex<0?point3._index++:(point3._bufferIndex++,point3._bufferIndex===chunks[point3._index].length&&(point3._bufferIndex=-1,point3._index++)),context.previous=code2,consumed=!0}function enter(type,fields){let token=fields||{};return token.type=type,token.start=now(),context.events.push(["enter",token,context]),stack.push(token),token}function exit2(type){let token=stack.pop();return token.end=now(),context.events.push(["exit",token,context]),token}function onsuccessfulconstruct(construct,info){addResult(construct,info.from)}function onsuccessfulcheck(_,info){info.restore()}function constructFactory(onreturn,fields){return hook;function hook(constructs2,returnState,bogusState){let listOfConstructs,constructIndex,currentConstruct,info;return Array.isArray(constructs2)?handleListOfConstructs(constructs2):"tokenize"in constructs2?handleListOfConstructs([constructs2]):handleMapOfConstructs(constructs2);function handleMapOfConstructs(map4){return start2;function start2(code2){let def=code2!==null&&map4[code2],all3=code2!==null&&map4.null,list4=[...Array.isArray(def)?def:def?[def]:[],...Array.isArray(all3)?all3:all3?[all3]:[]];return handleListOfConstructs(list4)(code2)}}function handleListOfConstructs(list4){return listOfConstructs=list4,constructIndex=0,list4.length===0?bogusState:handleConstruct(list4[constructIndex])}function handleConstruct(construct){return start2;function start2(code2){return info=store(),currentConstruct=construct,construct.partial||(context.currentConstruct=construct),construct.name&&context.parser.constructs.disable.null.includes(construct.name)?nok(code2):construct.tokenize.call(fields?Object.assign(Object.create(context),fields):context,effects,ok2,nok)(code2)}}function ok2(code2){return consumed=!0,onreturn(currentConstruct,info),returnState}function nok(code2){return consumed=!0,info.restore(),++constructIndex<listOfConstructs.length?handleConstruct(listOfConstructs[constructIndex]):bogusState}}}function addResult(construct,from2){construct.resolveAll&&!resolveAllConstructs.includes(construct)&&resolveAllConstructs.push(construct),construct.resolve&&splice(context.events,from2,context.events.length-from2,construct.resolve(context.events.slice(from2),context)),construct.resolveTo&&(context.events=construct.resolveTo(context.events,context))}function store(){let startPoint=now(),startPrevious=context.previous,startCurrentConstruct=context.currentConstruct,startEventsIndex=context.events.length,startStack=Array.from(stack);return{restore,from:startEventsIndex};function restore(){point3=startPoint,context.previous=startPrevious,context.currentConstruct=startCurrentConstruct,context.events.length=startEventsIndex,stack=startStack,accountForPotentialSkip()}}function accountForPotentialSkip(){point3.line in columnStart&&point3.column<2&&(point3.column=columnStart[point3.line],point3.offset+=columnStart[point3.line]-1)}}function sliceChunks(chunks,token){let startIndex=token.start._index,startBufferIndex=token.start._bufferIndex,endIndex=token.end._index,endBufferIndex=token.end._bufferIndex,view;if(startIndex===endIndex)view=[chunks[startIndex].slice(startBufferIndex,endBufferIndex)];else{if(view=chunks.slice(startIndex,endIndex),startBufferIndex>-1){let head=view[0];typeof head=="string"?view[0]=head.slice(startBufferIndex):view.shift()}endBufferIndex>0&&view.push(chunks[endIndex].slice(0,endBufferIndex))}return view}function serializeChunks(chunks,expandTabs){let index2=-1,result=[],atTab;for(;++index2<chunks.length;){let chunk=chunks[index2],value;if(typeof chunk=="string")value=chunk;else switch(chunk){case-5:{value="\r";break}case-4:{value=`
|
13
13
|
`;break}case-3:{value=`\r
|
14
14
|
`;break}case-2:{value=expandTabs?" ":" ";break}case-1:{if(!expandTabs&&atTab)continue;value=" ";break}default:value=String.fromCharCode(chunk)}atTab=chunk===-2,result.push(value)}return result.join("")}var constructs_exports={};__export(constructs_exports,{attentionMarkers:()=>attentionMarkers,contentInitial:()=>contentInitial,disable:()=>disable,document:()=>document2,flow:()=>flow2,flowInitial:()=>flowInitial,insideSpan:()=>insideSpan,string:()=>string2,text:()=>text2});var document2={42:list,43:list,45:list,48:list,49:list,50:list,51:list,52:list,53:list,54:list,55:list,56:list,57:list,62:blockQuote},contentInitial={91:definition},flowInitial={[-2]:codeIndented,[-1]:codeIndented,32:codeIndented},flow2={35:headingAtx,42:thematicBreak,45:[setextUnderline,thematicBreak],60:htmlFlow,61:setextUnderline,95:thematicBreak,96:codeFenced,126:codeFenced},string2={38:characterReference,92:characterEscape},text2={[-5]:lineEnding,[-4]:lineEnding,[-3]:lineEnding,33:labelStartImage,38:characterReference,42:attention,60:[autolink,htmlText],91:labelStartLink,92:[hardBreakEscape,characterEscape],93:labelEnd,95:attention,96:codeText},insideSpan={null:[attention,resolver]},attentionMarkers={null:[42,95]},disable={null:[]};function parse(options){let constructs2=combineExtensions([constructs_exports,...(options||{}).extensions||[]]),parser={defined:[],lazy:{},constructs:constructs2,content:create(content),document:create(document),flow:create(flow),string:create(string),text:create(text)};return parser;function create(initial){return creator;function creator(from){return createTokenizer(parser,initial,from)}}}function postprocess(events){for(;!subtokenize(events););return events}var search=/[\0\t\n\r]/g;function preprocess(){let column=1,buffer="",start2=!0,atCarriageReturn;return preprocessor;function preprocessor(value,encoding,end){let chunks=[],match,next,startPosition,endPosition,code2;for(value=buffer+(typeof value=="string"?value.toString():new TextDecoder(encoding||void 0).decode(value)),startPosition=0,buffer="",start2&&(value.charCodeAt(0)===65279&&startPosition++,start2=void 0);startPosition<value.length;){if(search.lastIndex=startPosition,match=search.exec(value),endPosition=match&&match.index!==void 0?match.index:value.length,code2=value.charCodeAt(endPosition),!match){buffer=value.slice(startPosition);break}if(code2===10&&startPosition===endPosition&&atCarriageReturn)chunks.push(-3),atCarriageReturn=void 0;else switch(atCarriageReturn&&(chunks.push(-5),atCarriageReturn=void 0),startPosition<endPosition&&(chunks.push(value.slice(startPosition,endPosition)),column+=endPosition-startPosition),code2){case 0:{chunks.push(65533),column++;break}case 9:{for(next=Math.ceil(column/4)*4,chunks.push(-2);column++<next;)chunks.push(-1);break}case 10:{chunks.push(-4),column=1;break}default:atCarriageReturn=!0,column=1}startPosition=endPosition+1}return end&&(atCarriageReturn&&chunks.push(-5),buffer&&chunks.push(buffer),chunks.push(null)),chunks}}var characterEscapeOrReference=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function decodeString(value){return value.replace(characterEscapeOrReference,decode)}function decode($0,$1,$2){if($1)return $1;if($2.charCodeAt(0)===35){let head2=$2.charCodeAt(1),hex=head2===120||head2===88;return decodeNumericCharacterReference($2.slice(hex?2:1),hex?16:10)}return decodeNamedCharacterReference($2)||$0}function stringifyPosition(value){return!value||typeof value!="object"?"":"position"in value||"type"in value?position(value.position):"start"in value||"end"in value?position(value):"line"in value||"column"in value?point(value):""}function point(point3){return index(point3&&point3.line)+":"+index(point3&&point3.column)}function position(pos){return point(pos&&pos.start)+"-"+point(pos&&pos.end)}function index(value){return value&&typeof value=="number"?value:1}var own2={}.hasOwnProperty;function fromMarkdown(value,encoding,options){return typeof encoding!="string"&&(options=encoding,encoding=void 0),compiler(options)(postprocess(parse(options).document().write(preprocess()(value,encoding,!0))))}function compiler(options){let config={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:opener(link2),autolinkProtocol:onenterdata,autolinkEmail:onenterdata,atxHeading:opener(heading2),blockQuote:opener(blockQuote2),characterEscape:onenterdata,characterReference:onenterdata,codeFenced:opener(codeFlow),codeFencedFenceInfo:buffer,codeFencedFenceMeta:buffer,codeIndented:opener(codeFlow,buffer),codeText:opener(codeText2,buffer),codeTextData:onenterdata,data:onenterdata,codeFlowValue:onenterdata,definition:opener(definition3),definitionDestinationString:buffer,definitionLabelString:buffer,definitionTitleString:buffer,emphasis:opener(emphasis2),hardBreakEscape:opener(hardBreak2),hardBreakTrailing:opener(hardBreak2),htmlFlow:opener(html2,buffer),htmlFlowData:onenterdata,htmlText:opener(html2,buffer),htmlTextData:onenterdata,image:opener(image2),label:buffer,link:opener(link2),listItem:opener(listItem2),listItemValue:onenterlistitemvalue,listOrdered:opener(list4,onenterlistordered),listUnordered:opener(list4),paragraph:opener(paragraph2),reference:onenterreference,referenceString:buffer,resourceDestinationString:buffer,resourceTitleString:buffer,setextHeading:opener(heading2),strong:opener(strong2),thematicBreak:opener(thematicBreak3)},exit:{atxHeading:closer(),atxHeadingSequence:onexitatxheadingsequence,autolink:closer(),autolinkEmail:onexitautolinkemail,autolinkProtocol:onexitautolinkprotocol,blockQuote:closer(),characterEscapeValue:onexitdata,characterReferenceMarkerHexadecimal:onexitcharacterreferencemarker,characterReferenceMarkerNumeric:onexitcharacterreferencemarker,characterReferenceValue:onexitcharacterreferencevalue,codeFenced:closer(onexitcodefenced),codeFencedFence:onexitcodefencedfence,codeFencedFenceInfo:onexitcodefencedfenceinfo,codeFencedFenceMeta:onexitcodefencedfencemeta,codeFlowValue:onexitdata,codeIndented:closer(onexitcodeindented),codeText:closer(onexitcodetext),codeTextData:onexitdata,data:onexitdata,definition:closer(),definitionDestinationString:onexitdefinitiondestinationstring,definitionLabelString:onexitdefinitionlabelstring,definitionTitleString:onexitdefinitiontitlestring,emphasis:closer(),hardBreakEscape:closer(onexithardbreak),hardBreakTrailing:closer(onexithardbreak),htmlFlow:closer(onexithtmlflow),htmlFlowData:onexitdata,htmlText:closer(onexithtmltext),htmlTextData:onexitdata,image:closer(onexitimage),label:onexitlabel,labelText:onexitlabeltext,lineEnding:onexitlineending,link:closer(onexitlink),listItem:closer(),listOrdered:closer(),listUnordered:closer(),paragraph:closer(),referenceString:onexitreferencestring,resourceDestinationString:onexitresourcedestinationstring,resourceTitleString:onexitresourcetitlestring,resource:onexitresource,setextHeading:closer(onexitsetextheading),setextHeadingLineSequence:onexitsetextheadinglinesequence,setextHeadingText:onexitsetextheadingtext,strong:closer(),thematicBreak:closer()}};configure(config,(options||{}).mdastExtensions||[]);let data2={};return compile;function compile(events){let tree={type:"root",children:[]},context={stack:[tree],tokenStack:[],config,enter,exit:exit2,buffer,resume,data:data2},listStack=[],index2=-1;for(;++index2<events.length;)if(events[index2][1].type==="listOrdered"||events[index2][1].type==="listUnordered")if(events[index2][0]==="enter")listStack.push(index2);else{let tail=listStack.pop();index2=prepareList(events,tail,index2)}for(index2=-1;++index2<events.length;){let handler=config[events[index2][0]];own2.call(handler,events[index2][1].type)&&handler[events[index2][1].type].call(Object.assign({sliceSerialize:events[index2][2].sliceSerialize},context),events[index2][1])}if(context.tokenStack.length>0){let tail=context.tokenStack[context.tokenStack.length-1];(tail[1]||defaultOnError).call(context,void 0,tail[0])}for(tree.position={start:point2(events.length>0?events[0][1].start:{line:1,column:1,offset:0}),end:point2(events.length>0?events[events.length-2][1].end:{line:1,column:1,offset:0})},index2=-1;++index2<config.transforms.length;)tree=config.transforms[index2](tree)||tree;return tree}function prepareList(events,start2,length){let index2=start2-1,containerBalance=-1,listSpread=!1,listItem3,lineIndex,firstBlankLineIndex,atMarker;for(;++index2<=length;){let event=events[index2];switch(event[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{event[0]==="enter"?containerBalance++:containerBalance--,atMarker=void 0;break}case"lineEndingBlank":{event[0]==="enter"&&(listItem3&&!atMarker&&!containerBalance&&!firstBlankLineIndex&&(firstBlankLineIndex=index2),atMarker=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:atMarker=void 0}if(!containerBalance&&event[0]==="enter"&&event[1].type==="listItemPrefix"||containerBalance===-1&&event[0]==="exit"&&(event[1].type==="listUnordered"||event[1].type==="listOrdered")){if(listItem3){let tailIndex=index2;for(lineIndex=void 0;tailIndex--;){let tailEvent=events[tailIndex];if(tailEvent[1].type==="lineEnding"||tailEvent[1].type==="lineEndingBlank"){if(tailEvent[0]==="exit")continue;lineIndex&&(events[lineIndex][1].type="lineEndingBlank",listSpread=!0),tailEvent[1].type="lineEnding",lineIndex=tailIndex}else if(!(tailEvent[1].type==="linePrefix"||tailEvent[1].type==="blockQuotePrefix"||tailEvent[1].type==="blockQuotePrefixWhitespace"||tailEvent[1].type==="blockQuoteMarker"||tailEvent[1].type==="listItemIndent"))break}firstBlankLineIndex&&(!lineIndex||firstBlankLineIndex<lineIndex)&&(listItem3._spread=!0),listItem3.end=Object.assign({},lineIndex?events[lineIndex][1].start:event[1].end),events.splice(lineIndex||index2,0,["exit",listItem3,event[2]]),index2++,length++}if(event[1].type==="listItemPrefix"){let item={type:"listItem",_spread:!1,start:Object.assign({},event[1].start),end:void 0};listItem3=item,events.splice(index2,0,["enter",item,event[2]]),index2++,length++,firstBlankLineIndex=void 0,atMarker=!0}}}return events[start2][1]._spread=listSpread,length}function opener(create,and){return open;function open(token){enter.call(this,create(token),token),and&&and.call(this,token)}}function buffer(){this.stack.push({type:"fragment",children:[]})}function enter(node3,token,errorHandler){this.stack[this.stack.length-1].children.push(node3),this.stack.push(node3),this.tokenStack.push([token,errorHandler]),node3.position={start:point2(token.start),end:void 0}}function closer(and){return close;function close(token){and&&and.call(this,token),exit2.call(this,token)}}function exit2(token,onExitError){let node3=this.stack.pop(),open=this.tokenStack.pop();if(open)open[0].type!==token.type&&(onExitError?onExitError.call(this,token,open[0]):(open[1]||defaultOnError).call(this,token,open[0]));else throw new Error("Cannot close `"+token.type+"` ("+stringifyPosition({start:token.start,end:token.end})+"): it\u2019s not open");node3.position.end=point2(token.end)}function resume(){return toString(this.stack.pop())}function onenterlistordered(){this.data.expectingFirstListItemValue=!0}function onenterlistitemvalue(token){if(this.data.expectingFirstListItemValue){let ancestor=this.stack[this.stack.length-2];ancestor.start=Number.parseInt(this.sliceSerialize(token),10),this.data.expectingFirstListItemValue=void 0}}function onexitcodefencedfenceinfo(){let data3=this.resume(),node3=this.stack[this.stack.length-1];node3.lang=data3}function onexitcodefencedfencemeta(){let data3=this.resume(),node3=this.stack[this.stack.length-1];node3.meta=data3}function onexitcodefencedfence(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function onexitcodefenced(){let data3=this.resume(),node3=this.stack[this.stack.length-1];node3.value=data3.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function onexitcodeindented(){let data3=this.resume(),node3=this.stack[this.stack.length-1];node3.value=data3.replace(/(\r?\n|\r)$/g,"")}function onexitdefinitionlabelstring(token){let label=this.resume(),node3=this.stack[this.stack.length-1];node3.label=label,node3.identifier=normalizeIdentifier(this.sliceSerialize(token)).toLowerCase()}function onexitdefinitiontitlestring(){let data3=this.resume(),node3=this.stack[this.stack.length-1];node3.title=data3}function onexitdefinitiondestinationstring(){let data3=this.resume(),node3=this.stack[this.stack.length-1];node3.url=data3}function onexitatxheadingsequence(token){let node3=this.stack[this.stack.length-1];if(!node3.depth){let depth=this.sliceSerialize(token).length;node3.depth=depth}}function onexitsetextheadingtext(){this.data.setextHeadingSlurpLineEnding=!0}function onexitsetextheadinglinesequence(token){let node3=this.stack[this.stack.length-1];node3.depth=this.sliceSerialize(token).codePointAt(0)===61?1:2}function onexitsetextheading(){this.data.setextHeadingSlurpLineEnding=void 0}function onenterdata(token){let siblings=this.stack[this.stack.length-1].children,tail=siblings[siblings.length-1];(!tail||tail.type!=="text")&&(tail=text4(),tail.position={start:point2(token.start),end:void 0},siblings.push(tail)),this.stack.push(tail)}function onexitdata(token){let tail=this.stack.pop();tail.value+=this.sliceSerialize(token),tail.position.end=point2(token.end)}function onexitlineending(token){let context=this.stack[this.stack.length-1];if(this.data.atHardBreak){let tail=context.children[context.children.length-1];tail.position.end=point2(token.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&config.canContainEols.includes(context.type)&&(onenterdata.call(this,token),onexitdata.call(this,token))}function onexithardbreak(){this.data.atHardBreak=!0}function onexithtmlflow(){let data3=this.resume(),node3=this.stack[this.stack.length-1];node3.value=data3}function onexithtmltext(){let data3=this.resume(),node3=this.stack[this.stack.length-1];node3.value=data3}function onexitcodetext(){let data3=this.resume(),node3=this.stack[this.stack.length-1];node3.value=data3}function onexitlink(){let node3=this.stack[this.stack.length-1];if(this.data.inReference){let referenceType=this.data.referenceType||"shortcut";node3.type+="Reference",node3.referenceType=referenceType,delete node3.url,delete node3.title}else delete node3.identifier,delete node3.label;this.data.referenceType=void 0}function onexitimage(){let node3=this.stack[this.stack.length-1];if(this.data.inReference){let referenceType=this.data.referenceType||"shortcut";node3.type+="Reference",node3.referenceType=referenceType,delete node3.url,delete node3.title}else delete node3.identifier,delete node3.label;this.data.referenceType=void 0}function onexitlabeltext(token){let string3=this.sliceSerialize(token),ancestor=this.stack[this.stack.length-2];ancestor.label=decodeString(string3),ancestor.identifier=normalizeIdentifier(string3).toLowerCase()}function onexitlabel(){let fragment=this.stack[this.stack.length-1],value=this.resume(),node3=this.stack[this.stack.length-1];if(this.data.inReference=!0,node3.type==="link"){let children=fragment.children;node3.children=children}else node3.alt=value}function onexitresourcedestinationstring(){let data3=this.resume(),node3=this.stack[this.stack.length-1];node3.url=data3}function onexitresourcetitlestring(){let data3=this.resume(),node3=this.stack[this.stack.length-1];node3.title=data3}function onexitresource(){this.data.inReference=void 0}function onenterreference(){this.data.referenceType="collapsed"}function onexitreferencestring(token){let label=this.resume(),node3=this.stack[this.stack.length-1];node3.label=label,node3.identifier=normalizeIdentifier(this.sliceSerialize(token)).toLowerCase(),this.data.referenceType="full"}function onexitcharacterreferencemarker(token){this.data.characterReferenceType=token.type}function onexitcharacterreferencevalue(token){let data3=this.sliceSerialize(token),type=this.data.characterReferenceType,value;type?(value=decodeNumericCharacterReference(data3,type==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):value=decodeNamedCharacterReference(data3);let tail=this.stack.pop();tail.value+=value,tail.position.end=point2(token.end)}function onexitautolinkprotocol(token){onexitdata.call(this,token);let node3=this.stack[this.stack.length-1];node3.url=this.sliceSerialize(token)}function onexitautolinkemail(token){onexitdata.call(this,token);let node3=this.stack[this.stack.length-1];node3.url="mailto:"+this.sliceSerialize(token)}function blockQuote2(){return{type:"blockquote",children:[]}}function codeFlow(){return{type:"code",lang:null,meta:null,value:""}}function codeText2(){return{type:"inlineCode",value:""}}function definition3(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function emphasis2(){return{type:"emphasis",children:[]}}function heading2(){return{type:"heading",depth:0,children:[]}}function hardBreak2(){return{type:"break"}}function html2(){return{type:"html",value:""}}function image2(){return{type:"image",title:null,url:"",alt:null}}function link2(){return{type:"link",title:null,url:"",children:[]}}function list4(token){return{type:"list",ordered:token.type==="listOrdered",start:null,spread:token._spread,children:[]}}function listItem2(token){return{type:"listItem",spread:token._spread,checked:null,children:[]}}function paragraph2(){return{type:"paragraph",children:[]}}function strong2(){return{type:"strong",children:[]}}function text4(){return{type:"text",value:""}}function thematicBreak3(){return{type:"thematicBreak"}}}function point2(d){return{line:d.line,column:d.column,offset:d.offset}}function configure(combined,extensions){let index2=-1;for(;++index2<extensions.length;){let value=extensions[index2];Array.isArray(value)?configure(combined,value):extension(combined,value)}}function extension(combined,extension2){let key;for(key in extension2)if(own2.call(extension2,key))switch(key){case"canContainEols":{let right=extension2[key];right&&combined[key].push(...right);break}case"transforms":{let right=extension2[key];right&&combined[key].push(...right);break}case"enter":case"exit":{let right=extension2[key];right&&Object.assign(combined[key],right);break}}}function defaultOnError(left,right){throw left?new Error("Cannot close `"+left.type+"` ("+stringifyPosition({start:left.start,end:left.end})+"): a different token (`"+right.type+"`, "+stringifyPosition({start:right.start,end:right.end})+") is open"):new Error("Cannot close document, a token (`"+right.type+"`, "+stringifyPosition({start:right.start,end:right.end})+") is still open")}function remarkParse(options){let self2=this;self2.parser=parser;function parser(doc){return fromMarkdown(doc,{...self2.data("settings"),...options,extensions:self2.data("micromarkExtensions")||[],mdastExtensions:self2.data("fromMarkdownExtensions")||[]})}}var own3={}.hasOwnProperty;function zwitch(key,options){let settings=options||{};function one3(value,...parameters){let fn=one3.invalid,handlers=one3.handlers;if(value&&own3.call(value,key)){let id=String(value[key]);fn=own3.call(handlers,id)?handlers[id]:one3.unknown}if(fn)return fn.call(this,value,...parameters)}return one3.handlers=settings.handlers||{},one3.invalid=settings.invalid,one3.unknown=settings.unknown,one3}var own4={}.hasOwnProperty;function configure2(base,extension2){let index2=-1,key;if(extension2.extensions)for(;++index2<extension2.extensions.length;)configure2(base,extension2.extensions[index2]);for(key in extension2)if(own4.call(extension2,key))switch(key){case"extensions":break;case"unsafe":{list2(base[key],extension2[key]);break}case"join":{list2(base[key],extension2[key]);break}case"handlers":{map(base[key],extension2[key]);break}default:base.options[key]=extension2[key]}return base}function list2(left,right){right&&left.push(...right)}function map(left,right){right&&Object.assign(left,right)}function blockquote(node3,_,state,info){let exit2=state.enter("blockquote"),tracker=state.createTracker(info);tracker.move("> "),tracker.shift(2);let value=state.indentLines(state.containerFlow(node3,tracker.current()),map2);return exit2(),value}function map2(line,_,blank){return">"+(blank?"":" ")+line}function patternInScope(stack,pattern){return listInScope(stack,pattern.inConstruct,!0)&&!listInScope(stack,pattern.notInConstruct,!1)}function listInScope(stack,list4,none){if(typeof list4=="string"&&(list4=[list4]),!list4||list4.length===0)return none;let index2=-1;for(;++index2<list4.length;)if(stack.includes(list4[index2]))return!0;return!1}function hardBreak(_,_1,state,info){let index2=-1;for(;++index2<state.unsafe.length;)if(state.unsafe[index2].character===`
|
@@ -41,7 +41,7 @@ Defaulting to 2020, but this will stop working in the future.`)),options.ecmaVer
|
|
41
41
|
`}var eol=/\r?\n|\r/g;function indentLines(value,map4){let result=[],start2=0,line=0,match;for(;match=eol.exec(value);)one3(value.slice(start2,match.index)),result.push(match[0]),start2=match.index+match[0].length,line++;return one3(value.slice(start2)),result.join("");function one3(value2){result.push(map4(value2,line,!value2))}}function safe(state,input,config){let value=(config.before||"")+(input||"")+(config.after||""),positions=[],result=[],infos={},index2=-1;for(;++index2<state.unsafe.length;){let pattern=state.unsafe[index2];if(!patternInScope(state.stack,pattern))continue;let expression=state.compilePattern(pattern),match;for(;match=expression.exec(value);){let before="before"in pattern||!!pattern.atBreak,after="after"in pattern,position2=match.index+(before?match[1].length:0);positions.includes(position2)?(infos[position2].before&&!before&&(infos[position2].before=!1),infos[position2].after&&!after&&(infos[position2].after=!1)):(positions.push(position2),infos[position2]={before,after})}}positions.sort(numerical);let start2=config.before?config.before.length:0,end=value.length-(config.after?config.after.length:0);for(index2=-1;++index2<positions.length;){let position2=positions[index2];position2<start2||position2>=end||position2+1<end&&positions[index2+1]===position2+1&&infos[position2].after&&!infos[position2+1].before&&!infos[position2+1].after||positions[index2-1]===position2-1&&infos[position2].before&&!infos[position2-1].before&&!infos[position2-1].after||(start2!==position2&&result.push(escapeBackslashes(value.slice(start2,position2),"\\")),start2=position2,/[!-/:-@[-`{-~]/.test(value.charAt(position2))&&(!config.encode||!config.encode.includes(value.charAt(position2)))?result.push("\\"):(result.push("&#x"+value.charCodeAt(position2).toString(16).toUpperCase()+";"),start2++))}return result.push(escapeBackslashes(value.slice(start2,end),config.after)),result.join("")}function numerical(a,b){return a-b}function escapeBackslashes(value,after){let expression=/\\(?=[!-/:-@[-`{-~])/g,positions=[],results=[],whole=value+after,index2=-1,start2=0,match;for(;match=expression.exec(whole);)positions.push(match.index);for(;++index2<positions.length;)start2!==positions[index2]&&results.push(value.slice(start2,positions[index2])),results.push("\\"),start2=positions[index2];return results.push(value.slice(start2)),results.join("")}function track(config){let options=config||{},now=options.now||{},lineShift=options.lineShift||0,line=now.line||1,column=now.column||1;return{move,current:current2,shift};function current2(){return{now:{line,column},lineShift}}function shift(value){lineShift+=value}function move(input){let value=input||"",chunks=value.split(/\r?\n|\r/g),tail=chunks[chunks.length-1];return line+=chunks.length-1,column=chunks.length===1?column+tail.length:1+tail.length+lineShift,value}}function toMarkdown(tree,options={}){let state={enter,indentLines,associationId:association,containerPhrasing:containerPhrasingBound,containerFlow:containerFlowBound,createTracker:track,compilePattern,safe:safeBound,stack:[],unsafe:[...unsafe],join:[...join],handlers:{...handle},options:{},indexStack:[],handle:void 0};configure2(state,options),state.options.tightDefinitions&&state.join.push(joinDefinition),state.handle=zwitch("type",{invalid,unknown,handlers:state.handlers});let result=state.handle(tree,void 0,state,{before:`
|
42
42
|
`,after:`
|
43
43
|
`,now:{line:1,column:1},lineShift:0});return result&&result.charCodeAt(result.length-1)!==10&&result.charCodeAt(result.length-1)!==13&&(result+=`
|
44
|
-
`),result;function enter(name2){return state.stack.push(name2),exit2;function exit2(){state.stack.pop()}}}function invalid(value){throw new Error("Cannot handle value `"+value+"`, expected node")}function unknown(value){let node3=value;throw new Error("Cannot handle unknown node `"+node3.type+"`")}function joinDefinition(left,right){if(left.type==="definition"&&left.type===right.type)return 0}function containerPhrasingBound(parent,info){return containerPhrasing(parent,this,info)}function containerFlowBound(parent,info){return containerFlow(parent,this,info)}function safeBound(value,config){return safe(this,value,config)}function remarkStringify(options){let self2=this;self2.compiler=compiler2;function compiler2(tree){return toMarkdown(tree,{...self2.data("settings"),...options,extensions:self2.data("toMarkdownExtensions")||[]})}}function bail(error){if(error)throw error}var import_extend=__toESM(require_extend(),1);function isPlainObject(value){if(typeof value!="object"||value===null)return!1;let prototype=Object.getPrototypeOf(value);return(prototype===null||prototype===Object.prototype||Object.getPrototypeOf(prototype)===null)&&!(Symbol.toStringTag in value)&&!(Symbol.iterator in value)}function trough(){let fns=[],pipeline={run,use};return pipeline;function run(...values){let middlewareIndex=-1,callback=values.pop();if(typeof callback!="function")throw new TypeError("Expected function as last argument, not "+callback);next(null,...values);function next(error,...output){let fn=fns[++middlewareIndex],index2=-1;if(error){callback(error);return}for(;++index2<values.length;)(output[index2]===null||output[index2]===void 0)&&(output[index2]=values[index2]);values=output,fn?wrap(fn,next)(...output):callback(null,...output)}}function use(middelware){if(typeof middelware!="function")throw new TypeError("Expected `middelware` to be a function, not "+middelware);return fns.push(middelware),pipeline}}function wrap(middleware,callback){let called;return wrapped;function wrapped(...parameters){let fnExpectsCallback=middleware.length>parameters.length,result;fnExpectsCallback&¶meters.push(done);try{result=middleware.apply(this,parameters)}catch(error){let exception=error;if(fnExpectsCallback&&called)throw exception;return done(exception)}fnExpectsCallback||(result instanceof Promise?result.then(then,done):result instanceof Error?done(result):then(result))}function done(error,...output){called||(called=!0,callback(error,...output))}function then(value){done(null,value)}}var VFileMessage=class extends Error{constructor(causeOrReason,optionsOrParentOrPlace,origin){super(),typeof optionsOrParentOrPlace=="string"&&(origin=optionsOrParentOrPlace,optionsOrParentOrPlace=void 0);let reason="",options={},legacyCause=!1;if(optionsOrParentOrPlace&&("line"in optionsOrParentOrPlace&&"column"in optionsOrParentOrPlace?options={place:optionsOrParentOrPlace}:"start"in optionsOrParentOrPlace&&"end"in optionsOrParentOrPlace?options={place:optionsOrParentOrPlace}:"type"in optionsOrParentOrPlace?options={ancestors:[optionsOrParentOrPlace],place:optionsOrParentOrPlace.position}:options={...optionsOrParentOrPlace}),typeof causeOrReason=="string"?reason=causeOrReason:!options.cause&&causeOrReason&&(legacyCause=!0,reason=causeOrReason.message,options.cause=causeOrReason),!options.ruleId&&!options.source&&typeof origin=="string"){let index2=origin.indexOf(":");index2===-1?options.ruleId=origin:(options.source=origin.slice(0,index2),options.ruleId=origin.slice(index2+1))}if(!options.place&&options.ancestors&&options.ancestors){let parent=options.ancestors[options.ancestors.length-1];parent&&(options.place=parent.position)}let start2=options.place&&"start"in options.place?options.place.start:options.place;this.ancestors=options.ancestors||void 0,this.cause=options.cause||void 0,this.column=start2?start2.column:void 0,this.fatal=void 0,this.file,this.message=reason,this.line=start2?start2.line:void 0,this.name=stringifyPosition(options.place)||"1:1",this.place=options.place||void 0,this.reason=this.message,this.ruleId=options.ruleId||void 0,this.source=options.source||void 0,this.stack=legacyCause&&options.cause&&typeof options.cause.stack=="string"?options.cause.stack:"",this.actual,this.expected,this.note,this.url}};VFileMessage.prototype.file="";VFileMessage.prototype.name="";VFileMessage.prototype.reason="";VFileMessage.prototype.message="";VFileMessage.prototype.stack="";VFileMessage.prototype.column=void 0;VFileMessage.prototype.line=void 0;VFileMessage.prototype.ancestors=void 0;VFileMessage.prototype.cause=void 0;VFileMessage.prototype.fatal=void 0;VFileMessage.prototype.place=void 0;VFileMessage.prototype.ruleId=void 0;VFileMessage.prototype.source=void 0;var import_node_path=__toESM(require("path"),1);var import_node_process=__toESM(require("process"),1);var import_node_url=require("url");function isUrl(fileUrlOrPath){return!!(fileUrlOrPath!==null&&typeof fileUrlOrPath=="object"&&"href"in fileUrlOrPath&&fileUrlOrPath.href&&"protocol"in fileUrlOrPath&&fileUrlOrPath.protocol&&fileUrlOrPath.auth===void 0)}var order=["history","path","basename","stem","extname","dirname"],VFile=class{constructor(value){let options;value?isUrl(value)?options={path:value}:typeof value=="string"||isUint8Array(value)?options={value}:options=value:options={},this.cwd=import_node_process.default.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let index2=-1;for(;++index2<order.length;){let prop2=order[index2];prop2 in options&&options[prop2]!==void 0&&options[prop2]!==null&&(this[prop2]=prop2==="history"?[...options[prop2]]:options[prop2])}let prop;for(prop in options)order.includes(prop)||(this[prop]=options[prop])}get basename(){return typeof this.path=="string"?import_node_path.default.basename(this.path):void 0}set basename(basename2){assertNonEmpty(basename2,"basename"),assertPart(basename2,"basename"),this.path=import_node_path.default.join(this.dirname||"",basename2)}get dirname(){return typeof this.path=="string"?import_node_path.default.dirname(this.path):void 0}set dirname(dirname){assertPath(this.basename,"dirname"),this.path=import_node_path.default.join(dirname||"",this.basename)}get extname(){return typeof this.path=="string"?import_node_path.default.extname(this.path):void 0}set extname(extname){if(assertPart(extname,"extname"),assertPath(this.dirname,"extname"),extname){if(extname.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(extname.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=import_node_path.default.join(this.dirname,this.stem+(extname||""))}get path(){return this.history[this.history.length-1]}set path(path2){isUrl(path2)&&(path2=(0,import_node_url.fileURLToPath)(path2)),assertNonEmpty(path2,"path"),this.path!==path2&&this.history.push(path2)}get stem(){return typeof this.path=="string"?import_node_path.default.basename(this.path,this.extname):void 0}set stem(stem){assertNonEmpty(stem,"stem"),assertPart(stem,"stem"),this.path=import_node_path.default.join(this.dirname||"",stem+(this.extname||""))}fail(causeOrReason,optionsOrParentOrPlace,origin){let message=this.message(causeOrReason,optionsOrParentOrPlace,origin);throw message.fatal=!0,message}info(causeOrReason,optionsOrParentOrPlace,origin){let message=this.message(causeOrReason,optionsOrParentOrPlace,origin);return message.fatal=void 0,message}message(causeOrReason,optionsOrParentOrPlace,origin){let message=new VFileMessage(causeOrReason,optionsOrParentOrPlace,origin);return this.path&&(message.name=this.path+":"+message.name,message.file=this.path),message.fatal=!1,this.messages.push(message),message}toString(encoding){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(encoding||void 0).decode(this.value)}};function assertPart(part,name2){if(part&&part.includes(import_node_path.default.sep))throw new Error("`"+name2+"` cannot be a path: did not expect `"+import_node_path.default.sep+"`")}function assertNonEmpty(part,name2){if(!part)throw new Error("`"+name2+"` cannot be empty")}function assertPath(path2,name2){if(!path2)throw new Error("Setting `"+name2+"` requires `path` to be set too")}function isUint8Array(value){return!!(value&&typeof value=="object"&&"byteLength"in value&&"byteOffset"in value)}var CallableInstance=function(property){let proto=this.constructor.prototype,func=proto[property],apply=function(){return func.apply(apply,arguments)};Object.setPrototypeOf(apply,proto);let names=Object.getOwnPropertyNames(func);for(let p of names){let descriptor=Object.getOwnPropertyDescriptor(func,p);descriptor&&Object.defineProperty(apply,p,descriptor)}return apply};var own5={}.hasOwnProperty,Processor=class _Processor extends CallableInstance{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=trough()}copy(){let destination=new _Processor,index2=-1;for(;++index2<this.attachers.length;){let attacher=this.attachers[index2];destination.use(...attacher)}return destination.data((0,import_extend.default)(!0,{},this.namespace)),destination}data(key,value){return typeof key=="string"?arguments.length===2?(assertUnfrozen("data",this.frozen),this.namespace[key]=value,this):own5.call(this.namespace,key)&&this.namespace[key]||void 0:key?(assertUnfrozen("data",this.frozen),this.namespace=key,this):this.namespace}freeze(){if(this.frozen)return this;let self2=this;for(;++this.freezeIndex<this.attachers.length;){let[attacher,...options]=this.attachers[this.freezeIndex];if(options[0]===!1)continue;options[0]===!0&&(options[0]=void 0);let transformer=attacher.call(self2,...options);typeof transformer=="function"&&this.transformers.use(transformer)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(file){this.freeze();let realFile=vfile(file),parser=this.parser||this.Parser;return assertParser("parse",parser),parser(String(realFile),realFile)}process(file,done){let self2=this;return this.freeze(),assertParser("process",this.parser||this.Parser),assertCompiler("process",this.compiler||this.Compiler),done?executor(void 0,done):new Promise(executor);function executor(resolve,reject){let realFile=vfile(file),parseTree=self2.parse(realFile);self2.run(parseTree,realFile,function(error,tree,file2){if(error||!tree||!file2)return realDone(error);let compileTree=tree,compileResult=self2.stringify(compileTree,file2);looksLikeAValue(compileResult)?file2.value=compileResult:file2.result=compileResult,realDone(error,file2)});function realDone(error,file2){error||!file2?reject(error):resolve?resolve(file2):done(void 0,file2)}}}processSync(file){let complete=!1,result;return this.freeze(),assertParser("processSync",this.parser||this.Parser),assertCompiler("processSync",this.compiler||this.Compiler),this.process(file,realDone),assertDone("processSync","process",complete),result;function realDone(error,file2){complete=!0,bail(error),result=file2}}run(tree,file,done){assertNode(tree),this.freeze();let transformers=this.transformers;return!done&&typeof file=="function"&&(done=file,file=void 0),done?executor(void 0,done):new Promise(executor);function executor(resolve,reject){let realFile=vfile(file);transformers.run(tree,realFile,realDone);function realDone(error,outputTree,file2){let resultingTree=outputTree||tree;error?reject(error):resolve?resolve(resultingTree):done(void 0,resultingTree,file2)}}}runSync(tree,file){let complete=!1,result;return this.run(tree,file,realDone),assertDone("runSync","run",complete),result;function realDone(error,tree2){bail(error),result=tree2,complete=!0}}stringify(tree,file){this.freeze();let realFile=vfile(file),compiler2=this.compiler||this.Compiler;return assertCompiler("stringify",compiler2),assertNode(tree),compiler2(tree,realFile)}use(value,...parameters){let attachers=this.attachers,namespace=this.namespace;if(assertUnfrozen("use",this.frozen),value!=null)if(typeof value=="function")addPlugin(value,parameters);else if(typeof value=="object")Array.isArray(value)?addList(value):addPreset(value);else throw new TypeError("Expected usable value, not `"+value+"`");return this;function add(value2){if(typeof value2=="function")addPlugin(value2,[]);else if(typeof value2=="object")if(Array.isArray(value2)){let[plugin,...parameters2]=value2;addPlugin(plugin,parameters2)}else addPreset(value2);else throw new TypeError("Expected usable value, not `"+value2+"`")}function addPreset(result){if(!("plugins"in result)&&!("settings"in result))throw new Error("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");addList(result.plugins),result.settings&&(namespace.settings=(0,import_extend.default)(!0,namespace.settings,result.settings))}function addList(plugins){let index2=-1;if(plugins!=null)if(Array.isArray(plugins))for(;++index2<plugins.length;){let thing=plugins[index2];add(thing)}else throw new TypeError("Expected a list of plugins, not `"+plugins+"`")}function addPlugin(plugin,parameters2){let index2=-1,entryIndex=-1;for(;++index2<attachers.length;)if(attachers[index2][0]===plugin){entryIndex=index2;break}if(entryIndex===-1)attachers.push([plugin,...parameters2]);else if(parameters2.length>0){let[primary,...rest]=parameters2,currentPrimary=attachers[entryIndex][1];isPlainObject(currentPrimary)&&isPlainObject(primary)&&(primary=(0,import_extend.default)(!0,currentPrimary,primary)),attachers[entryIndex]=[plugin,primary,...rest]}}}},unified=new Processor().freeze();function assertParser(name2,value){if(typeof value!="function")throw new TypeError("Cannot `"+name2+"` without `parser`")}function assertCompiler(name2,value){if(typeof value!="function")throw new TypeError("Cannot `"+name2+"` without `compiler`")}function assertUnfrozen(name2,frozen){if(frozen)throw new Error("Cannot call `"+name2+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function assertNode(node3){if(!isPlainObject(node3)||typeof node3.type!="string")throw new TypeError("Expected node, got `"+node3+"`")}function assertDone(name2,asyncName,complete){if(!complete)throw new Error("`"+name2+"` finished async. Use `"+asyncName+"` instead")}function vfile(value){return looksLikeAVFile(value)?value:new VFile(value)}function looksLikeAVFile(value){return!!(value&&typeof value=="object"&&"message"in value&&"messages"in value)}function looksLikeAValue(value){return typeof value=="string"||isUint8Array2(value)}function isUint8Array2(value){return!!(value&&typeof value=="object"&&"byteLength"in value&&"byteOffset"in value)}var remark=unified().use(remarkParse).use(remarkStringify).freeze();function mdxExpressionFromMarkdown(){return{enter:{mdxFlowExpression:enterMdxFlowExpression,mdxTextExpression:enterMdxTextExpression},exit:{mdxFlowExpression:exitMdxExpression,mdxFlowExpressionChunk:exitMdxExpressionData,mdxTextExpression:exitMdxExpression,mdxTextExpressionChunk:exitMdxExpressionData}}}function mdxExpressionToMarkdown(){return{handlers:{mdxFlowExpression:handleMdxExpression,mdxTextExpression:handleMdxExpression},unsafe:[{character:"{",inConstruct:["phrasing"]},{atBreak:!0,character:"{"}]}}function enterMdxFlowExpression(token){this.enter({type:"mdxFlowExpression",value:""},token),this.buffer()}function enterMdxTextExpression(token){this.enter({type:"mdxTextExpression",value:""},token),this.buffer()}function exitMdxExpression(token){let value=this.resume(),estree=token.estree,node3=this.stack[this.stack.length-1];node3.type==="mdxFlowExpression"||node3.type,this.exit(token),node3.value=value,estree&&(node3.data={estree})}function exitMdxExpressionData(token){this.config.enter.data.call(this,token),this.config.exit.data.call(this,token)}function handleMdxExpression(node3){return"{"+(node3.value||"")+"}"}function ccount(value,character){let source=String(value);if(typeof character!="string")throw new TypeError("Expected character");let count=0,index2=source.indexOf(character);for(;index2!==-1;)count++,index2=source.indexOf(character,index2+character.length);return count}var characterEntitiesLegacy=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"];var characterReferenceInvalid={0:"\uFFFD",128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};function isDecimal(character){let code2=typeof character=="string"?character.charCodeAt(0):character;return code2>=48&&code2<=57}function isHexadecimal(character){let code2=typeof character=="string"?character.charCodeAt(0):character;return code2>=97&&code2<=102||code2>=65&&code2<=70||code2>=48&&code2<=57}function isAlphabetical(character){let code2=typeof character=="string"?character.charCodeAt(0):character;return code2>=97&&code2<=122||code2>=65&&code2<=90}function isAlphanumerical(character){return isAlphabetical(character)||isDecimal(character)}var fromCharCode=String.fromCharCode,messages=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function parseEntities(value,options={}){let additional=typeof options.additional=="string"?options.additional.charCodeAt(0):options.additional,result=[],index2=0,lines=-1,queue="",point3,indent2;options.position&&("start"in options.position||"indent"in options.position?(indent2=options.position.indent,point3=options.position.start):point3=options.position);let line=(point3?point3.line:0)||1,column=(point3?point3.column:0)||1,previous2=now(),character;for(index2--;++index2<=value.length;)if(character===10&&(column=(indent2?indent2[lines]:0)||1),character=value.charCodeAt(index2),character===38){let following=value.charCodeAt(index2+1);if(following===9||following===10||following===12||following===32||following===38||following===60||Number.isNaN(following)||additional&&following===additional){queue+=fromCharCode(character),column++;continue}let start2=index2+1,begin=start2,end=start2,type;if(following===35){end=++begin;let following2=value.charCodeAt(end);following2===88||following2===120?(type="hexadecimal",end=++begin):type="decimal"}else type="named";let characterReferenceCharacters="",characterReference2="",characters="",test=type==="named"?isAlphanumerical:type==="decimal"?isDecimal:isHexadecimal;for(end--;++end<=value.length;){let following2=value.charCodeAt(end);if(!test(following2))break;characters+=fromCharCode(following2),type==="named"&&characterEntitiesLegacy.includes(characters)&&(characterReferenceCharacters=characters,characterReference2=decodeNamedCharacterReference(characters))}let terminated=value.charCodeAt(end)===59;if(terminated){end++;let namedReference=type==="named"?decodeNamedCharacterReference(characters):!1;namedReference&&(characterReferenceCharacters=characters,characterReference2=namedReference)}let diff=1+end-start2,reference="";if(!(!terminated&&options.nonTerminated===!1))if(!characters)type!=="named"&&warning(4,diff);else if(type==="named"){if(terminated&&!characterReference2)warning(5,1);else if(characterReferenceCharacters!==characters&&(end=begin+characterReferenceCharacters.length,diff=1+end-begin,terminated=!1),!terminated){let reason=characterReferenceCharacters?1:3;if(options.attribute){let following2=value.charCodeAt(end);following2===61?(warning(reason,diff),characterReference2=""):isAlphanumerical(following2)?characterReference2="":warning(reason,diff)}else warning(reason,diff)}reference=characterReference2}else{terminated||warning(2,diff);let referenceCode=Number.parseInt(characters,type==="hexadecimal"?16:10);if(prohibited(referenceCode))warning(7,diff),reference=fromCharCode(65533);else if(referenceCode in characterReferenceInvalid)warning(6,diff),reference=characterReferenceInvalid[referenceCode];else{let output="";disallowed(referenceCode)&&warning(6,diff),referenceCode>65535&&(referenceCode-=65536,output+=fromCharCode(referenceCode>>>10|55296),referenceCode=56320|referenceCode&1023),reference=output+fromCharCode(referenceCode)}}if(reference){flush(),previous2=now(),index2=end-1,column+=end-start2+1,result.push(reference);let next=now();next.offset++,options.reference&&options.reference.call(options.referenceContext,reference,{start:previous2,end:next},value.slice(start2-1,end)),previous2=next}else characters=value.slice(start2-1,end),queue+=characters,column+=characters.length,index2=end-1}else character===10&&(line++,lines++,column=0),Number.isNaN(character)?flush():(queue+=fromCharCode(character),column++);return result.join("");function now(){return{line,column,offset:index2+((point3?point3.offset:0)||0)}}function warning(code2,offset2){let position2;options.warning&&(position2=now(),position2.column+=offset2,position2.offset+=offset2,options.warning.call(options.warningContext,messages[code2],position2,code2))}function flush(){queue&&(result.push(queue),options.text&&options.text.call(options.textContext,queue,{start:previous2,end:now()}),queue="")}}function prohibited(code2){return code2>=55296&&code2<=57343||code2>1114111}function disallowed(code2){return code2>=1&&code2<=8||code2===11||code2>=13&&code2<=31||code2>=127&&code2<=159||code2>=64976&&code2<=65007||(code2&65535)===65535||(code2&65535)===65534}function core(value,options){if(value=value.replace(options.subset?charactersToExpression(options.subset):/["&'<>`]/g,basic),options.subset||options.escapeOnly)return value;return value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,surrogate).replace(/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,basic);function surrogate(pair,index2,all3){return options.format((pair.charCodeAt(0)-55296)*1024+pair.charCodeAt(1)-56320+65536,all3.charCodeAt(index2+2),options)}function basic(character,index2,all3){return options.format(character.charCodeAt(0),all3.charCodeAt(index2+1),options)}}function charactersToExpression(subset){let groups=[],index2=-1;for(;++index2<subset.length;)groups.push(subset[index2].replace(/[|\\{}()[\]^$+*?.]/g,"\\$&"));return new RegExp("(?:"+groups.join("|")+")","g")}function formatBasic(code2){return"&#x"+code2.toString(16).toUpperCase()+";"}function stringifyEntitiesLight(value,options){return core(value,Object.assign({format:formatBasic},options))}var indent=" ";function mdxJsxFromMarkdown(){return{canContainEols:["mdxJsxTextElement"],enter:{mdxJsxFlowTag:enterMdxJsxTag,mdxJsxFlowTagClosingMarker:enterMdxJsxTagClosingMarker,mdxJsxFlowTagAttribute:enterMdxJsxTagAttribute,mdxJsxFlowTagExpressionAttribute:enterMdxJsxTagExpressionAttribute,mdxJsxFlowTagAttributeValueLiteral:buffer,mdxJsxFlowTagAttributeValueExpression:buffer,mdxJsxFlowTagSelfClosingMarker:enterMdxJsxTagSelfClosingMarker,mdxJsxTextTag:enterMdxJsxTag,mdxJsxTextTagClosingMarker:enterMdxJsxTagClosingMarker,mdxJsxTextTagAttribute:enterMdxJsxTagAttribute,mdxJsxTextTagExpressionAttribute:enterMdxJsxTagExpressionAttribute,mdxJsxTextTagAttributeValueLiteral:buffer,mdxJsxTextTagAttributeValueExpression:buffer,mdxJsxTextTagSelfClosingMarker:enterMdxJsxTagSelfClosingMarker},exit:{mdxJsxFlowTagClosingMarker:exitMdxJsxTagClosingMarker,mdxJsxFlowTagNamePrimary:exitMdxJsxTagNamePrimary,mdxJsxFlowTagNameMember:exitMdxJsxTagNameMember,mdxJsxFlowTagNameLocal:exitMdxJsxTagNameLocal,mdxJsxFlowTagExpressionAttribute:exitMdxJsxTagExpressionAttribute,mdxJsxFlowTagExpressionAttributeValue:data2,mdxJsxFlowTagAttributeNamePrimary:exitMdxJsxTagAttributeNamePrimary,mdxJsxFlowTagAttributeNameLocal:exitMdxJsxTagAttributeNameLocal,mdxJsxFlowTagAttributeValueLiteral:exitMdxJsxTagAttributeValueLiteral,mdxJsxFlowTagAttributeValueLiteralValue:data2,mdxJsxFlowTagAttributeValueExpression:exitMdxJsxTagAttributeValueExpression,mdxJsxFlowTagAttributeValueExpressionValue:data2,mdxJsxFlowTagSelfClosingMarker:exitMdxJsxTagSelfClosingMarker,mdxJsxFlowTag:exitMdxJsxTag,mdxJsxTextTagClosingMarker:exitMdxJsxTagClosingMarker,mdxJsxTextTagNamePrimary:exitMdxJsxTagNamePrimary,mdxJsxTextTagNameMember:exitMdxJsxTagNameMember,mdxJsxTextTagNameLocal:exitMdxJsxTagNameLocal,mdxJsxTextTagExpressionAttribute:exitMdxJsxTagExpressionAttribute,mdxJsxTextTagExpressionAttributeValue:data2,mdxJsxTextTagAttributeNamePrimary:exitMdxJsxTagAttributeNamePrimary,mdxJsxTextTagAttributeNameLocal:exitMdxJsxTagAttributeNameLocal,mdxJsxTextTagAttributeValueLiteral:exitMdxJsxTagAttributeValueLiteral,mdxJsxTextTagAttributeValueLiteralValue:data2,mdxJsxTextTagAttributeValueExpression:exitMdxJsxTagAttributeValueExpression,mdxJsxTextTagAttributeValueExpressionValue:data2,mdxJsxTextTagSelfClosingMarker:exitMdxJsxTagSelfClosingMarker,mdxJsxTextTag:exitMdxJsxTag}};function buffer(){this.buffer()}function data2(token){this.config.enter.data.call(this,token),this.config.exit.data.call(this,token)}function enterMdxJsxTag(token){let tag={name:void 0,attributes:[],close:!1,selfClosing:!1,start:token.start,end:token.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=tag,this.buffer()}function enterMdxJsxTagClosingMarker(token){let stack=this.data.mdxJsxTagStack;if(stack.length===0)throw new VFileMessage("Unexpected closing slash `/` in tag, expected an open tag first",{start:token.start,end:token.end},"mdast-util-mdx-jsx:unexpected-closing-slash")}function enterMdxJsxTagAnyAttribute(token){let tag=this.data.mdxJsxTag;if(tag.close)throw new VFileMessage("Unexpected attribute in closing tag, expected the end of the tag",{start:token.start,end:token.end},"mdast-util-mdx-jsx:unexpected-attribute")}function enterMdxJsxTagSelfClosingMarker(token){let tag=this.data.mdxJsxTag;if(tag.close)throw new VFileMessage("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:token.start,end:token.end},"mdast-util-mdx-jsx:unexpected-self-closing-slash")}function exitMdxJsxTagClosingMarker(){let tag=this.data.mdxJsxTag;tag.close=!0}function exitMdxJsxTagNamePrimary(token){let tag=this.data.mdxJsxTag;tag.name=this.sliceSerialize(token)}function exitMdxJsxTagNameMember(token){let tag=this.data.mdxJsxTag;tag.name+="."+this.sliceSerialize(token)}function exitMdxJsxTagNameLocal(token){let tag=this.data.mdxJsxTag;tag.name+=":"+this.sliceSerialize(token)}function enterMdxJsxTagAttribute(token){let tag=this.data.mdxJsxTag;enterMdxJsxTagAnyAttribute.call(this,token),tag.attributes.push({type:"mdxJsxAttribute",name:"",value:null})}function enterMdxJsxTagExpressionAttribute(token){let tag=this.data.mdxJsxTag;enterMdxJsxTagAnyAttribute.call(this,token),tag.attributes.push({type:"mdxJsxExpressionAttribute",value:""}),this.buffer()}function exitMdxJsxTagExpressionAttribute(token){let tag=this.data.mdxJsxTag;let tail=tag.attributes[tag.attributes.length-1];tail.type;let estree=token.estree;tail.value=this.resume(),estree&&(tail.data={estree})}function exitMdxJsxTagAttributeNamePrimary(token){let tag=this.data.mdxJsxTag;let node3=tag.attributes[tag.attributes.length-1];node3.type,node3.name=this.sliceSerialize(token)}function exitMdxJsxTagAttributeNameLocal(token){let tag=this.data.mdxJsxTag;let node3=tag.attributes[tag.attributes.length-1];node3.type,node3.name+=":"+this.sliceSerialize(token)}function exitMdxJsxTagAttributeValueLiteral(){let tag=this.data.mdxJsxTag;tag.attributes[tag.attributes.length-1].value=parseEntities(this.resume(),{nonTerminated:!1})}function exitMdxJsxTagAttributeValueExpression(token){let tag=this.data.mdxJsxTag;let tail=tag.attributes[tag.attributes.length-1];tail.type;let node3={type:"mdxJsxAttributeValueExpression",value:this.resume()},estree=token.estree;estree&&(node3.data={estree}),tail.value=node3}function exitMdxJsxTagSelfClosingMarker(){let tag=this.data.mdxJsxTag;tag.selfClosing=!0}function exitMdxJsxTag(token){let tag=this.data.mdxJsxTag;let stack=this.data.mdxJsxTagStack;let tail=stack[stack.length-1];if(tag.close&&tail.name!==tag.name)throw new VFileMessage("Unexpected closing tag `"+serializeAbbreviatedTag(tag)+"`, expected corresponding closing tag for `"+serializeAbbreviatedTag(tail)+"` ("+stringifyPosition(tail)+")",{start:token.start,end:token.end},"mdast-util-mdx-jsx:end-tag-mismatch");this.resume(),tag.close?stack.pop():this.enter({type:token.type==="mdxJsxTextTag"?"mdxJsxTextElement":"mdxJsxFlowElement",name:tag.name||null,attributes:tag.attributes,children:[]},token,onErrorRightIsTag),tag.selfClosing||tag.close?this.exit(token,onErrorLeftIsTag):stack.push(tag)}function onErrorRightIsTag(closing,open){let tag=this.data.mdxJsxTag;let place=closing?" before the end of `"+closing.type+"`":"",position2=closing?{start:closing.start,end:closing.end}:void 0;throw new VFileMessage("Expected a closing tag for `"+serializeAbbreviatedTag(tag)+"` ("+stringifyPosition({start:open.start,end:open.end})+")"+place,position2,"mdast-util-mdx-jsx:end-tag-mismatch")}function onErrorLeftIsTag(a,b){let tag=this.data.mdxJsxTag;throw new VFileMessage("Expected the closing tag `"+serializeAbbreviatedTag(tag)+"` either after the end of `"+b.type+"` ("+stringifyPosition(b.end)+") or another opening tag after the start of `"+b.type+"` ("+stringifyPosition(b.start)+")",{start:a.start,end:a.end},"mdast-util-mdx-jsx:end-tag-mismatch")}function serializeAbbreviatedTag(tag){return"<"+(tag.close?"/":"")+(tag.name||"")+">"}}function mdxJsxToMarkdown(options){let options_=options||{},quote=options_.quote||'"',quoteSmart=options_.quoteSmart||!1,tightSelfClosing=options_.tightSelfClosing||!1,printWidth=options_.printWidth||Number.POSITIVE_INFINITY,alternative=quote==='"'?"'":'"';if(quote!=='"'&"e!=="'")throw new Error("Cannot serialize attribute values with `"+quote+"` for `options.quote`, expected `\"`, or `'`");return mdxElement.peek=peekElement,{handlers:{mdxJsxFlowElement:mdxElement,mdxJsxTextElement:mdxElement},unsafe:[{character:"<",inConstruct:["phrasing"]},{atBreak:!0,character:"<"}],fences:!0,resourceLink:!0};function mdxElement(node3,_,state,info){let flow3=node3.type==="mdxJsxFlowElement",selfClosing=node3.name?!node3.children||node3.children.length===0:!1,depth=inferDepth(state),currentIndent=createIndent(depth),trackerOneLine=state.createTracker(info),trackerMultiLine=state.createTracker(info),serializedAttributes=[],prefix=(flow3?currentIndent:"")+"<"+(node3.name||""),exit2=state.enter(node3.type);if(trackerOneLine.move(prefix),trackerMultiLine.move(prefix),node3.attributes&&node3.attributes.length>0){if(!node3.name)throw new Error("Cannot serialize fragment w/ attributes");let index2=-1;for(;++index2<node3.attributes.length;){let attribute=node3.attributes[index2],result;if(attribute.type==="mdxJsxExpressionAttribute")result="{"+(attribute.value||"")+"}";else{if(!attribute.name)throw new Error("Cannot serialize attribute w/o name");let value2=attribute.value,left=attribute.name,right="";if(value2!=null)if(typeof value2=="object")right="{"+(value2.value||"")+"}";else{let appliedQuote=quoteSmart&&ccount(value2,quote)>ccount(value2,alternative)?alternative:quote;right=appliedQuote+stringifyEntitiesLight(value2,{subset:[appliedQuote]})+appliedQuote}result=left+(right?"=":"")+right}serializedAttributes.push(result)}}let attributesOnTheirOwnLine=!1,attributesOnOneLine=serializedAttributes.join(" ");flow3&&(/\r?\n|\r/.test(attributesOnOneLine)||trackerOneLine.current().now.column+attributesOnOneLine.length+(selfClosing?tightSelfClosing?2:3:1)>printWidth)&&(attributesOnTheirOwnLine=!0);let tracker=trackerOneLine,value=prefix;if(attributesOnTheirOwnLine){tracker=trackerMultiLine;let index2=-1;for(;++index2<serializedAttributes.length;)serializedAttributes[index2]=currentIndent+indent+serializedAttributes[index2];value+=tracker.move(`
|
44
|
+
`),result;function enter(name2){return state.stack.push(name2),exit2;function exit2(){state.stack.pop()}}}function invalid(value){throw new Error("Cannot handle value `"+value+"`, expected node")}function unknown(value){let node3=value;throw new Error("Cannot handle unknown node `"+node3.type+"`")}function joinDefinition(left,right){if(left.type==="definition"&&left.type===right.type)return 0}function containerPhrasingBound(parent,info){return containerPhrasing(parent,this,info)}function containerFlowBound(parent,info){return containerFlow(parent,this,info)}function safeBound(value,config){return safe(this,value,config)}function remarkStringify(options){let self2=this;self2.compiler=compiler2;function compiler2(tree){return toMarkdown(tree,{...self2.data("settings"),...options,extensions:self2.data("toMarkdownExtensions")||[]})}}function bail(error){if(error)throw error}var import_extend=__toESM(require_extend(),1);function isPlainObject(value){if(typeof value!="object"||value===null)return!1;let prototype=Object.getPrototypeOf(value);return(prototype===null||prototype===Object.prototype||Object.getPrototypeOf(prototype)===null)&&!(Symbol.toStringTag in value)&&!(Symbol.iterator in value)}function trough(){let fns=[],pipeline={run,use};return pipeline;function run(...values){let middlewareIndex=-1,callback=values.pop();if(typeof callback!="function")throw new TypeError("Expected function as last argument, not "+callback);next(null,...values);function next(error,...output){let fn=fns[++middlewareIndex],index2=-1;if(error){callback(error);return}for(;++index2<values.length;)(output[index2]===null||output[index2]===void 0)&&(output[index2]=values[index2]);values=output,fn?wrap(fn,next)(...output):callback(null,...output)}}function use(middelware){if(typeof middelware!="function")throw new TypeError("Expected `middelware` to be a function, not "+middelware);return fns.push(middelware),pipeline}}function wrap(middleware,callback){let called;return wrapped;function wrapped(...parameters){let fnExpectsCallback=middleware.length>parameters.length,result;fnExpectsCallback&¶meters.push(done);try{result=middleware.apply(this,parameters)}catch(error){let exception=error;if(fnExpectsCallback&&called)throw exception;return done(exception)}fnExpectsCallback||(result instanceof Promise?result.then(then,done):result instanceof Error?done(result):then(result))}function done(error,...output){called||(called=!0,callback(error,...output))}function then(value){done(null,value)}}var VFileMessage=class extends Error{constructor(causeOrReason,optionsOrParentOrPlace,origin){super(),typeof optionsOrParentOrPlace=="string"&&(origin=optionsOrParentOrPlace,optionsOrParentOrPlace=void 0);let reason="",options={},legacyCause=!1;if(optionsOrParentOrPlace&&("line"in optionsOrParentOrPlace&&"column"in optionsOrParentOrPlace?options={place:optionsOrParentOrPlace}:"start"in optionsOrParentOrPlace&&"end"in optionsOrParentOrPlace?options={place:optionsOrParentOrPlace}:"type"in optionsOrParentOrPlace?options={ancestors:[optionsOrParentOrPlace],place:optionsOrParentOrPlace.position}:options={...optionsOrParentOrPlace}),typeof causeOrReason=="string"?reason=causeOrReason:!options.cause&&causeOrReason&&(legacyCause=!0,reason=causeOrReason.message,options.cause=causeOrReason),!options.ruleId&&!options.source&&typeof origin=="string"){let index2=origin.indexOf(":");index2===-1?options.ruleId=origin:(options.source=origin.slice(0,index2),options.ruleId=origin.slice(index2+1))}if(!options.place&&options.ancestors&&options.ancestors){let parent=options.ancestors[options.ancestors.length-1];parent&&(options.place=parent.position)}let start2=options.place&&"start"in options.place?options.place.start:options.place;this.ancestors=options.ancestors||void 0,this.cause=options.cause||void 0,this.column=start2?start2.column:void 0,this.fatal=void 0,this.file,this.message=reason,this.line=start2?start2.line:void 0,this.name=stringifyPosition(options.place)||"1:1",this.place=options.place||void 0,this.reason=this.message,this.ruleId=options.ruleId||void 0,this.source=options.source||void 0,this.stack=legacyCause&&options.cause&&typeof options.cause.stack=="string"?options.cause.stack:"",this.actual,this.expected,this.note,this.url}};VFileMessage.prototype.file="";VFileMessage.prototype.name="";VFileMessage.prototype.reason="";VFileMessage.prototype.message="";VFileMessage.prototype.stack="";VFileMessage.prototype.column=void 0;VFileMessage.prototype.line=void 0;VFileMessage.prototype.ancestors=void 0;VFileMessage.prototype.cause=void 0;VFileMessage.prototype.fatal=void 0;VFileMessage.prototype.place=void 0;VFileMessage.prototype.ruleId=void 0;VFileMessage.prototype.source=void 0;var import_node_path=__toESM(require("path"),1);var import_node_process=__toESM(require("process"),1);var import_node_url=require("url");function isUrl(fileUrlOrPath){return!!(fileUrlOrPath!==null&&typeof fileUrlOrPath=="object"&&"href"in fileUrlOrPath&&fileUrlOrPath.href&&"protocol"in fileUrlOrPath&&fileUrlOrPath.protocol&&fileUrlOrPath.auth===void 0)}var order=["history","path","basename","stem","extname","dirname"],VFile=class{constructor(value){let options;value?isUrl(value)?options={path:value}:typeof value=="string"||isUint8Array(value)?options={value}:options=value:options={},this.cwd=import_node_process.default.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let index2=-1;for(;++index2<order.length;){let prop2=order[index2];prop2 in options&&options[prop2]!==void 0&&options[prop2]!==null&&(this[prop2]=prop2==="history"?[...options[prop2]]:options[prop2])}let prop;for(prop in options)order.includes(prop)||(this[prop]=options[prop])}get basename(){return typeof this.path=="string"?import_node_path.default.basename(this.path):void 0}set basename(basename2){assertNonEmpty(basename2,"basename"),assertPart(basename2,"basename"),this.path=import_node_path.default.join(this.dirname||"",basename2)}get dirname(){return typeof this.path=="string"?import_node_path.default.dirname(this.path):void 0}set dirname(dirname){assertPath(this.basename,"dirname"),this.path=import_node_path.default.join(dirname||"",this.basename)}get extname(){return typeof this.path=="string"?import_node_path.default.extname(this.path):void 0}set extname(extname){if(assertPart(extname,"extname"),assertPath(this.dirname,"extname"),extname){if(extname.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(extname.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=import_node_path.default.join(this.dirname,this.stem+(extname||""))}get path(){return this.history[this.history.length-1]}set path(path){isUrl(path)&&(path=(0,import_node_url.fileURLToPath)(path)),assertNonEmpty(path,"path"),this.path!==path&&this.history.push(path)}get stem(){return typeof this.path=="string"?import_node_path.default.basename(this.path,this.extname):void 0}set stem(stem){assertNonEmpty(stem,"stem"),assertPart(stem,"stem"),this.path=import_node_path.default.join(this.dirname||"",stem+(this.extname||""))}fail(causeOrReason,optionsOrParentOrPlace,origin){let message=this.message(causeOrReason,optionsOrParentOrPlace,origin);throw message.fatal=!0,message}info(causeOrReason,optionsOrParentOrPlace,origin){let message=this.message(causeOrReason,optionsOrParentOrPlace,origin);return message.fatal=void 0,message}message(causeOrReason,optionsOrParentOrPlace,origin){let message=new VFileMessage(causeOrReason,optionsOrParentOrPlace,origin);return this.path&&(message.name=this.path+":"+message.name,message.file=this.path),message.fatal=!1,this.messages.push(message),message}toString(encoding){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(encoding||void 0).decode(this.value)}};function assertPart(part,name2){if(part&&part.includes(import_node_path.default.sep))throw new Error("`"+name2+"` cannot be a path: did not expect `"+import_node_path.default.sep+"`")}function assertNonEmpty(part,name2){if(!part)throw new Error("`"+name2+"` cannot be empty")}function assertPath(path,name2){if(!path)throw new Error("Setting `"+name2+"` requires `path` to be set too")}function isUint8Array(value){return!!(value&&typeof value=="object"&&"byteLength"in value&&"byteOffset"in value)}var CallableInstance=function(property){let proto=this.constructor.prototype,func=proto[property],apply=function(){return func.apply(apply,arguments)};Object.setPrototypeOf(apply,proto);let names=Object.getOwnPropertyNames(func);for(let p of names){let descriptor=Object.getOwnPropertyDescriptor(func,p);descriptor&&Object.defineProperty(apply,p,descriptor)}return apply};var own5={}.hasOwnProperty,Processor=class _Processor extends CallableInstance{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=trough()}copy(){let destination=new _Processor,index2=-1;for(;++index2<this.attachers.length;){let attacher=this.attachers[index2];destination.use(...attacher)}return destination.data((0,import_extend.default)(!0,{},this.namespace)),destination}data(key,value){return typeof key=="string"?arguments.length===2?(assertUnfrozen("data",this.frozen),this.namespace[key]=value,this):own5.call(this.namespace,key)&&this.namespace[key]||void 0:key?(assertUnfrozen("data",this.frozen),this.namespace=key,this):this.namespace}freeze(){if(this.frozen)return this;let self2=this;for(;++this.freezeIndex<this.attachers.length;){let[attacher,...options]=this.attachers[this.freezeIndex];if(options[0]===!1)continue;options[0]===!0&&(options[0]=void 0);let transformer=attacher.call(self2,...options);typeof transformer=="function"&&this.transformers.use(transformer)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(file){this.freeze();let realFile=vfile(file),parser=this.parser||this.Parser;return assertParser("parse",parser),parser(String(realFile),realFile)}process(file,done){let self2=this;return this.freeze(),assertParser("process",this.parser||this.Parser),assertCompiler("process",this.compiler||this.Compiler),done?executor(void 0,done):new Promise(executor);function executor(resolve,reject){let realFile=vfile(file),parseTree=self2.parse(realFile);self2.run(parseTree,realFile,function(error,tree,file2){if(error||!tree||!file2)return realDone(error);let compileTree=tree,compileResult=self2.stringify(compileTree,file2);looksLikeAValue(compileResult)?file2.value=compileResult:file2.result=compileResult,realDone(error,file2)});function realDone(error,file2){error||!file2?reject(error):resolve?resolve(file2):done(void 0,file2)}}}processSync(file){let complete=!1,result;return this.freeze(),assertParser("processSync",this.parser||this.Parser),assertCompiler("processSync",this.compiler||this.Compiler),this.process(file,realDone),assertDone("processSync","process",complete),result;function realDone(error,file2){complete=!0,bail(error),result=file2}}run(tree,file,done){assertNode(tree),this.freeze();let transformers=this.transformers;return!done&&typeof file=="function"&&(done=file,file=void 0),done?executor(void 0,done):new Promise(executor);function executor(resolve,reject){let realFile=vfile(file);transformers.run(tree,realFile,realDone);function realDone(error,outputTree,file2){let resultingTree=outputTree||tree;error?reject(error):resolve?resolve(resultingTree):done(void 0,resultingTree,file2)}}}runSync(tree,file){let complete=!1,result;return this.run(tree,file,realDone),assertDone("runSync","run",complete),result;function realDone(error,tree2){bail(error),result=tree2,complete=!0}}stringify(tree,file){this.freeze();let realFile=vfile(file),compiler2=this.compiler||this.Compiler;return assertCompiler("stringify",compiler2),assertNode(tree),compiler2(tree,realFile)}use(value,...parameters){let attachers=this.attachers,namespace=this.namespace;if(assertUnfrozen("use",this.frozen),value!=null)if(typeof value=="function")addPlugin(value,parameters);else if(typeof value=="object")Array.isArray(value)?addList(value):addPreset(value);else throw new TypeError("Expected usable value, not `"+value+"`");return this;function add(value2){if(typeof value2=="function")addPlugin(value2,[]);else if(typeof value2=="object")if(Array.isArray(value2)){let[plugin,...parameters2]=value2;addPlugin(plugin,parameters2)}else addPreset(value2);else throw new TypeError("Expected usable value, not `"+value2+"`")}function addPreset(result){if(!("plugins"in result)&&!("settings"in result))throw new Error("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");addList(result.plugins),result.settings&&(namespace.settings=(0,import_extend.default)(!0,namespace.settings,result.settings))}function addList(plugins){let index2=-1;if(plugins!=null)if(Array.isArray(plugins))for(;++index2<plugins.length;){let thing=plugins[index2];add(thing)}else throw new TypeError("Expected a list of plugins, not `"+plugins+"`")}function addPlugin(plugin,parameters2){let index2=-1,entryIndex=-1;for(;++index2<attachers.length;)if(attachers[index2][0]===plugin){entryIndex=index2;break}if(entryIndex===-1)attachers.push([plugin,...parameters2]);else if(parameters2.length>0){let[primary,...rest]=parameters2,currentPrimary=attachers[entryIndex][1];isPlainObject(currentPrimary)&&isPlainObject(primary)&&(primary=(0,import_extend.default)(!0,currentPrimary,primary)),attachers[entryIndex]=[plugin,primary,...rest]}}}},unified=new Processor().freeze();function assertParser(name2,value){if(typeof value!="function")throw new TypeError("Cannot `"+name2+"` without `parser`")}function assertCompiler(name2,value){if(typeof value!="function")throw new TypeError("Cannot `"+name2+"` without `compiler`")}function assertUnfrozen(name2,frozen){if(frozen)throw new Error("Cannot call `"+name2+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function assertNode(node3){if(!isPlainObject(node3)||typeof node3.type!="string")throw new TypeError("Expected node, got `"+node3+"`")}function assertDone(name2,asyncName,complete){if(!complete)throw new Error("`"+name2+"` finished async. Use `"+asyncName+"` instead")}function vfile(value){return looksLikeAVFile(value)?value:new VFile(value)}function looksLikeAVFile(value){return!!(value&&typeof value=="object"&&"message"in value&&"messages"in value)}function looksLikeAValue(value){return typeof value=="string"||isUint8Array2(value)}function isUint8Array2(value){return!!(value&&typeof value=="object"&&"byteLength"in value&&"byteOffset"in value)}var remark=unified().use(remarkParse).use(remarkStringify).freeze();function mdxExpressionFromMarkdown(){return{enter:{mdxFlowExpression:enterMdxFlowExpression,mdxTextExpression:enterMdxTextExpression},exit:{mdxFlowExpression:exitMdxExpression,mdxFlowExpressionChunk:exitMdxExpressionData,mdxTextExpression:exitMdxExpression,mdxTextExpressionChunk:exitMdxExpressionData}}}function mdxExpressionToMarkdown(){return{handlers:{mdxFlowExpression:handleMdxExpression,mdxTextExpression:handleMdxExpression},unsafe:[{character:"{",inConstruct:["phrasing"]},{atBreak:!0,character:"{"}]}}function enterMdxFlowExpression(token){this.enter({type:"mdxFlowExpression",value:""},token),this.buffer()}function enterMdxTextExpression(token){this.enter({type:"mdxTextExpression",value:""},token),this.buffer()}function exitMdxExpression(token){let value=this.resume(),estree=token.estree,node3=this.stack[this.stack.length-1];node3.type==="mdxFlowExpression"||node3.type,this.exit(token),node3.value=value,estree&&(node3.data={estree})}function exitMdxExpressionData(token){this.config.enter.data.call(this,token),this.config.exit.data.call(this,token)}function handleMdxExpression(node3){return"{"+(node3.value||"")+"}"}function ccount(value,character){let source=String(value);if(typeof character!="string")throw new TypeError("Expected character");let count=0,index2=source.indexOf(character);for(;index2!==-1;)count++,index2=source.indexOf(character,index2+character.length);return count}var characterEntitiesLegacy=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"];var characterReferenceInvalid={0:"\uFFFD",128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};function isDecimal(character){let code2=typeof character=="string"?character.charCodeAt(0):character;return code2>=48&&code2<=57}function isHexadecimal(character){let code2=typeof character=="string"?character.charCodeAt(0):character;return code2>=97&&code2<=102||code2>=65&&code2<=70||code2>=48&&code2<=57}function isAlphabetical(character){let code2=typeof character=="string"?character.charCodeAt(0):character;return code2>=97&&code2<=122||code2>=65&&code2<=90}function isAlphanumerical(character){return isAlphabetical(character)||isDecimal(character)}var fromCharCode=String.fromCharCode,messages=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function parseEntities(value,options={}){let additional=typeof options.additional=="string"?options.additional.charCodeAt(0):options.additional,result=[],index2=0,lines=-1,queue="",point3,indent2;options.position&&("start"in options.position||"indent"in options.position?(indent2=options.position.indent,point3=options.position.start):point3=options.position);let line=(point3?point3.line:0)||1,column=(point3?point3.column:0)||1,previous2=now(),character;for(index2--;++index2<=value.length;)if(character===10&&(column=(indent2?indent2[lines]:0)||1),character=value.charCodeAt(index2),character===38){let following=value.charCodeAt(index2+1);if(following===9||following===10||following===12||following===32||following===38||following===60||Number.isNaN(following)||additional&&following===additional){queue+=fromCharCode(character),column++;continue}let start2=index2+1,begin=start2,end=start2,type;if(following===35){end=++begin;let following2=value.charCodeAt(end);following2===88||following2===120?(type="hexadecimal",end=++begin):type="decimal"}else type="named";let characterReferenceCharacters="",characterReference2="",characters="",test=type==="named"?isAlphanumerical:type==="decimal"?isDecimal:isHexadecimal;for(end--;++end<=value.length;){let following2=value.charCodeAt(end);if(!test(following2))break;characters+=fromCharCode(following2),type==="named"&&characterEntitiesLegacy.includes(characters)&&(characterReferenceCharacters=characters,characterReference2=decodeNamedCharacterReference(characters))}let terminated=value.charCodeAt(end)===59;if(terminated){end++;let namedReference=type==="named"?decodeNamedCharacterReference(characters):!1;namedReference&&(characterReferenceCharacters=characters,characterReference2=namedReference)}let diff=1+end-start2,reference="";if(!(!terminated&&options.nonTerminated===!1))if(!characters)type!=="named"&&warning(4,diff);else if(type==="named"){if(terminated&&!characterReference2)warning(5,1);else if(characterReferenceCharacters!==characters&&(end=begin+characterReferenceCharacters.length,diff=1+end-begin,terminated=!1),!terminated){let reason=characterReferenceCharacters?1:3;if(options.attribute){let following2=value.charCodeAt(end);following2===61?(warning(reason,diff),characterReference2=""):isAlphanumerical(following2)?characterReference2="":warning(reason,diff)}else warning(reason,diff)}reference=characterReference2}else{terminated||warning(2,diff);let referenceCode=Number.parseInt(characters,type==="hexadecimal"?16:10);if(prohibited(referenceCode))warning(7,diff),reference=fromCharCode(65533);else if(referenceCode in characterReferenceInvalid)warning(6,diff),reference=characterReferenceInvalid[referenceCode];else{let output="";disallowed(referenceCode)&&warning(6,diff),referenceCode>65535&&(referenceCode-=65536,output+=fromCharCode(referenceCode>>>10|55296),referenceCode=56320|referenceCode&1023),reference=output+fromCharCode(referenceCode)}}if(reference){flush(),previous2=now(),index2=end-1,column+=end-start2+1,result.push(reference);let next=now();next.offset++,options.reference&&options.reference.call(options.referenceContext,reference,{start:previous2,end:next},value.slice(start2-1,end)),previous2=next}else characters=value.slice(start2-1,end),queue+=characters,column+=characters.length,index2=end-1}else character===10&&(line++,lines++,column=0),Number.isNaN(character)?flush():(queue+=fromCharCode(character),column++);return result.join("");function now(){return{line,column,offset:index2+((point3?point3.offset:0)||0)}}function warning(code2,offset2){let position2;options.warning&&(position2=now(),position2.column+=offset2,position2.offset+=offset2,options.warning.call(options.warningContext,messages[code2],position2,code2))}function flush(){queue&&(result.push(queue),options.text&&options.text.call(options.textContext,queue,{start:previous2,end:now()}),queue="")}}function prohibited(code2){return code2>=55296&&code2<=57343||code2>1114111}function disallowed(code2){return code2>=1&&code2<=8||code2===11||code2>=13&&code2<=31||code2>=127&&code2<=159||code2>=64976&&code2<=65007||(code2&65535)===65535||(code2&65535)===65534}function core(value,options){if(value=value.replace(options.subset?charactersToExpression(options.subset):/["&'<>`]/g,basic),options.subset||options.escapeOnly)return value;return value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,surrogate).replace(/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,basic);function surrogate(pair,index2,all3){return options.format((pair.charCodeAt(0)-55296)*1024+pair.charCodeAt(1)-56320+65536,all3.charCodeAt(index2+2),options)}function basic(character,index2,all3){return options.format(character.charCodeAt(0),all3.charCodeAt(index2+1),options)}}function charactersToExpression(subset){let groups=[],index2=-1;for(;++index2<subset.length;)groups.push(subset[index2].replace(/[|\\{}()[\]^$+*?.]/g,"\\$&"));return new RegExp("(?:"+groups.join("|")+")","g")}function formatBasic(code2){return"&#x"+code2.toString(16).toUpperCase()+";"}function stringifyEntitiesLight(value,options){return core(value,Object.assign({format:formatBasic},options))}var indent=" ";function mdxJsxFromMarkdown(){return{canContainEols:["mdxJsxTextElement"],enter:{mdxJsxFlowTag:enterMdxJsxTag,mdxJsxFlowTagClosingMarker:enterMdxJsxTagClosingMarker,mdxJsxFlowTagAttribute:enterMdxJsxTagAttribute,mdxJsxFlowTagExpressionAttribute:enterMdxJsxTagExpressionAttribute,mdxJsxFlowTagAttributeValueLiteral:buffer,mdxJsxFlowTagAttributeValueExpression:buffer,mdxJsxFlowTagSelfClosingMarker:enterMdxJsxTagSelfClosingMarker,mdxJsxTextTag:enterMdxJsxTag,mdxJsxTextTagClosingMarker:enterMdxJsxTagClosingMarker,mdxJsxTextTagAttribute:enterMdxJsxTagAttribute,mdxJsxTextTagExpressionAttribute:enterMdxJsxTagExpressionAttribute,mdxJsxTextTagAttributeValueLiteral:buffer,mdxJsxTextTagAttributeValueExpression:buffer,mdxJsxTextTagSelfClosingMarker:enterMdxJsxTagSelfClosingMarker},exit:{mdxJsxFlowTagClosingMarker:exitMdxJsxTagClosingMarker,mdxJsxFlowTagNamePrimary:exitMdxJsxTagNamePrimary,mdxJsxFlowTagNameMember:exitMdxJsxTagNameMember,mdxJsxFlowTagNameLocal:exitMdxJsxTagNameLocal,mdxJsxFlowTagExpressionAttribute:exitMdxJsxTagExpressionAttribute,mdxJsxFlowTagExpressionAttributeValue:data2,mdxJsxFlowTagAttributeNamePrimary:exitMdxJsxTagAttributeNamePrimary,mdxJsxFlowTagAttributeNameLocal:exitMdxJsxTagAttributeNameLocal,mdxJsxFlowTagAttributeValueLiteral:exitMdxJsxTagAttributeValueLiteral,mdxJsxFlowTagAttributeValueLiteralValue:data2,mdxJsxFlowTagAttributeValueExpression:exitMdxJsxTagAttributeValueExpression,mdxJsxFlowTagAttributeValueExpressionValue:data2,mdxJsxFlowTagSelfClosingMarker:exitMdxJsxTagSelfClosingMarker,mdxJsxFlowTag:exitMdxJsxTag,mdxJsxTextTagClosingMarker:exitMdxJsxTagClosingMarker,mdxJsxTextTagNamePrimary:exitMdxJsxTagNamePrimary,mdxJsxTextTagNameMember:exitMdxJsxTagNameMember,mdxJsxTextTagNameLocal:exitMdxJsxTagNameLocal,mdxJsxTextTagExpressionAttribute:exitMdxJsxTagExpressionAttribute,mdxJsxTextTagExpressionAttributeValue:data2,mdxJsxTextTagAttributeNamePrimary:exitMdxJsxTagAttributeNamePrimary,mdxJsxTextTagAttributeNameLocal:exitMdxJsxTagAttributeNameLocal,mdxJsxTextTagAttributeValueLiteral:exitMdxJsxTagAttributeValueLiteral,mdxJsxTextTagAttributeValueLiteralValue:data2,mdxJsxTextTagAttributeValueExpression:exitMdxJsxTagAttributeValueExpression,mdxJsxTextTagAttributeValueExpressionValue:data2,mdxJsxTextTagSelfClosingMarker:exitMdxJsxTagSelfClosingMarker,mdxJsxTextTag:exitMdxJsxTag}};function buffer(){this.buffer()}function data2(token){this.config.enter.data.call(this,token),this.config.exit.data.call(this,token)}function enterMdxJsxTag(token){let tag={name:void 0,attributes:[],close:!1,selfClosing:!1,start:token.start,end:token.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=tag,this.buffer()}function enterMdxJsxTagClosingMarker(token){let stack=this.data.mdxJsxTagStack;if(stack.length===0)throw new VFileMessage("Unexpected closing slash `/` in tag, expected an open tag first",{start:token.start,end:token.end},"mdast-util-mdx-jsx:unexpected-closing-slash")}function enterMdxJsxTagAnyAttribute(token){let tag=this.data.mdxJsxTag;if(tag.close)throw new VFileMessage("Unexpected attribute in closing tag, expected the end of the tag",{start:token.start,end:token.end},"mdast-util-mdx-jsx:unexpected-attribute")}function enterMdxJsxTagSelfClosingMarker(token){let tag=this.data.mdxJsxTag;if(tag.close)throw new VFileMessage("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:token.start,end:token.end},"mdast-util-mdx-jsx:unexpected-self-closing-slash")}function exitMdxJsxTagClosingMarker(){let tag=this.data.mdxJsxTag;tag.close=!0}function exitMdxJsxTagNamePrimary(token){let tag=this.data.mdxJsxTag;tag.name=this.sliceSerialize(token)}function exitMdxJsxTagNameMember(token){let tag=this.data.mdxJsxTag;tag.name+="."+this.sliceSerialize(token)}function exitMdxJsxTagNameLocal(token){let tag=this.data.mdxJsxTag;tag.name+=":"+this.sliceSerialize(token)}function enterMdxJsxTagAttribute(token){let tag=this.data.mdxJsxTag;enterMdxJsxTagAnyAttribute.call(this,token),tag.attributes.push({type:"mdxJsxAttribute",name:"",value:null})}function enterMdxJsxTagExpressionAttribute(token){let tag=this.data.mdxJsxTag;enterMdxJsxTagAnyAttribute.call(this,token),tag.attributes.push({type:"mdxJsxExpressionAttribute",value:""}),this.buffer()}function exitMdxJsxTagExpressionAttribute(token){let tag=this.data.mdxJsxTag;let tail=tag.attributes[tag.attributes.length-1];tail.type;let estree=token.estree;tail.value=this.resume(),estree&&(tail.data={estree})}function exitMdxJsxTagAttributeNamePrimary(token){let tag=this.data.mdxJsxTag;let node3=tag.attributes[tag.attributes.length-1];node3.type,node3.name=this.sliceSerialize(token)}function exitMdxJsxTagAttributeNameLocal(token){let tag=this.data.mdxJsxTag;let node3=tag.attributes[tag.attributes.length-1];node3.type,node3.name+=":"+this.sliceSerialize(token)}function exitMdxJsxTagAttributeValueLiteral(){let tag=this.data.mdxJsxTag;tag.attributes[tag.attributes.length-1].value=parseEntities(this.resume(),{nonTerminated:!1})}function exitMdxJsxTagAttributeValueExpression(token){let tag=this.data.mdxJsxTag;let tail=tag.attributes[tag.attributes.length-1];tail.type;let node3={type:"mdxJsxAttributeValueExpression",value:this.resume()},estree=token.estree;estree&&(node3.data={estree}),tail.value=node3}function exitMdxJsxTagSelfClosingMarker(){let tag=this.data.mdxJsxTag;tag.selfClosing=!0}function exitMdxJsxTag(token){let tag=this.data.mdxJsxTag;let stack=this.data.mdxJsxTagStack;let tail=stack[stack.length-1];if(tag.close&&tail.name!==tag.name)throw new VFileMessage("Unexpected closing tag `"+serializeAbbreviatedTag(tag)+"`, expected corresponding closing tag for `"+serializeAbbreviatedTag(tail)+"` ("+stringifyPosition(tail)+")",{start:token.start,end:token.end},"mdast-util-mdx-jsx:end-tag-mismatch");this.resume(),tag.close?stack.pop():this.enter({type:token.type==="mdxJsxTextTag"?"mdxJsxTextElement":"mdxJsxFlowElement",name:tag.name||null,attributes:tag.attributes,children:[]},token,onErrorRightIsTag),tag.selfClosing||tag.close?this.exit(token,onErrorLeftIsTag):stack.push(tag)}function onErrorRightIsTag(closing,open){let tag=this.data.mdxJsxTag;let place=closing?" before the end of `"+closing.type+"`":"",position2=closing?{start:closing.start,end:closing.end}:void 0;throw new VFileMessage("Expected a closing tag for `"+serializeAbbreviatedTag(tag)+"` ("+stringifyPosition({start:open.start,end:open.end})+")"+place,position2,"mdast-util-mdx-jsx:end-tag-mismatch")}function onErrorLeftIsTag(a,b){let tag=this.data.mdxJsxTag;throw new VFileMessage("Expected the closing tag `"+serializeAbbreviatedTag(tag)+"` either after the end of `"+b.type+"` ("+stringifyPosition(b.end)+") or another opening tag after the start of `"+b.type+"` ("+stringifyPosition(b.start)+")",{start:a.start,end:a.end},"mdast-util-mdx-jsx:end-tag-mismatch")}function serializeAbbreviatedTag(tag){return"<"+(tag.close?"/":"")+(tag.name||"")+">"}}function mdxJsxToMarkdown(options){let options_=options||{},quote=options_.quote||'"',quoteSmart=options_.quoteSmart||!1,tightSelfClosing=options_.tightSelfClosing||!1,printWidth=options_.printWidth||Number.POSITIVE_INFINITY,alternative=quote==='"'?"'":'"';if(quote!=='"'&"e!=="'")throw new Error("Cannot serialize attribute values with `"+quote+"` for `options.quote`, expected `\"`, or `'`");return mdxElement.peek=peekElement,{handlers:{mdxJsxFlowElement:mdxElement,mdxJsxTextElement:mdxElement},unsafe:[{character:"<",inConstruct:["phrasing"]},{atBreak:!0,character:"<"}],fences:!0,resourceLink:!0};function mdxElement(node3,_,state,info){let flow3=node3.type==="mdxJsxFlowElement",selfClosing=node3.name?!node3.children||node3.children.length===0:!1,depth=inferDepth(state),currentIndent=createIndent(depth),trackerOneLine=state.createTracker(info),trackerMultiLine=state.createTracker(info),serializedAttributes=[],prefix=(flow3?currentIndent:"")+"<"+(node3.name||""),exit2=state.enter(node3.type);if(trackerOneLine.move(prefix),trackerMultiLine.move(prefix),node3.attributes&&node3.attributes.length>0){if(!node3.name)throw new Error("Cannot serialize fragment w/ attributes");let index2=-1;for(;++index2<node3.attributes.length;){let attribute=node3.attributes[index2],result;if(attribute.type==="mdxJsxExpressionAttribute")result="{"+(attribute.value||"")+"}";else{if(!attribute.name)throw new Error("Cannot serialize attribute w/o name");let value2=attribute.value,left=attribute.name,right="";if(value2!=null)if(typeof value2=="object")right="{"+(value2.value||"")+"}";else{let appliedQuote=quoteSmart&&ccount(value2,quote)>ccount(value2,alternative)?alternative:quote;right=appliedQuote+stringifyEntitiesLight(value2,{subset:[appliedQuote]})+appliedQuote}result=left+(right?"=":"")+right}serializedAttributes.push(result)}}let attributesOnTheirOwnLine=!1,attributesOnOneLine=serializedAttributes.join(" ");flow3&&(/\r?\n|\r/.test(attributesOnOneLine)||trackerOneLine.current().now.column+attributesOnOneLine.length+(selfClosing?tightSelfClosing?2:3:1)>printWidth)&&(attributesOnTheirOwnLine=!0);let tracker=trackerOneLine,value=prefix;if(attributesOnTheirOwnLine){tracker=trackerMultiLine;let index2=-1;for(;++index2<serializedAttributes.length;)serializedAttributes[index2]=currentIndent+indent+serializedAttributes[index2];value+=tracker.move(`
|
45
45
|
`+serializedAttributes.join(`
|
46
46
|
`)+`
|
47
47
|
`+currentIndent)}else attributesOnOneLine&&(value+=tracker.move(" "+attributesOnOneLine));return selfClosing&&(value+=tracker.move((tightSelfClosing||attributesOnTheirOwnLine?"":" ")+"/")),value+=tracker.move(">"),node3.children&&node3.children.length>0&&(node3.type==="mdxJsxTextElement"?value+=tracker.move(state.containerPhrasing(node3,{...tracker.current(),before:">",after:"<"})):(tracker.shift(2),value+=tracker.move(`
|
@@ -61,7 +61,7 @@ Defaulting to 2020, but this will stop working in the future.`)),options.ecmaVer
|
|
61
61
|
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),inTemplate){var codePos=this.pos-1;this.invalidStringToken(codePos,"Invalid escape sequence in template string")}default:if(ch>=48&&ch<=55){var octalStr=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],octal=parseInt(octalStr,8);return octal>255&&(octalStr=octalStr.slice(0,-1),octal=parseInt(octalStr,8)),this.pos+=octalStr.length-1,ch=this.input.charCodeAt(this.pos),(octalStr!=="0"||ch===56||ch===57)&&(this.strict||inTemplate)&&this.invalidStringToken(this.pos-1-octalStr.length,inTemplate?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(octal)}return isNewLine(ch)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(ch)}};pp.readHexChar=function(len){var codePos=this.pos,n=this.readInt(16,len);return n===null&&this.invalidStringToken(codePos,"Bad character escape sequence"),n};pp.readWord1=function(){this.containsEsc=!1;for(var word="",first=!0,chunkStart=this.pos,astral=this.options.ecmaVersion>=6;this.pos<this.input.length;){var ch=this.fullCharCodeAtPos();if(isIdentifierChar(ch,astral))this.pos+=ch<=65535?1:2;else if(ch===92){this.containsEsc=!0,word+=this.input.slice(chunkStart,this.pos);var escStart=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var esc=this.readCodePoint();(first?isIdentifierStart:isIdentifierChar)(esc,astral)||this.invalidStringToken(escStart,"Invalid Unicode escape"),word+=codePointToString(esc),chunkStart=this.pos}else break;first=!1}return word+this.input.slice(chunkStart,this.pos)};pp.readWord=function(){var word=this.readWord1(),type=types$1.name;return this.keywords.test(word)&&(type=keywords[word]),this.finishToken(type,word)};var version="8.12.1";Parser.acorn={Parser,version,defaultOptions,Position,SourceLocation,getLineInfo,Node,TokenType,tokTypes:types$1,keywordTypes:keywords,TokContext,tokContexts:types,isIdentifierChar,isIdentifierStart,Token,isNewLine,lineBreak,lineBreakG,nonASCIIwhitespace};var import_acorn_jsx=__toESM(require_acorn_jsx(),1);function color2(d){return"\x1B[33m"+d+"\x1B[39m"}var own6={}.hasOwnProperty,CONTINUE2=Symbol("continue"),EXIT2=Symbol("exit"),SKIP2=Symbol("skip");function visit2(tree,visitor){let enter,leave;typeof visitor=="function"?enter=visitor:visitor&&typeof visitor=="object"&&(visitor.enter&&(enter=visitor.enter),visitor.leave&&(leave=visitor.leave)),build(tree,void 0,void 0,[])();function build(node3,key,index2,parents){return nodelike(node3)&&(visit3.displayName="node ("+color2(node3.type)+")"),visit3;function visit3(){let result=enter?toResult2(enter(node3,key,index2,parents)):[];if(result[0]===EXIT2)return result;if(result[0]!==SKIP2){let cKey;for(cKey in node3)if(own6.call(node3,cKey)&&node3[cKey]&&typeof node3[cKey]=="object"&&cKey!=="data"&&cKey!=="position"){let grandparents=parents.concat(node3),value=node3[cKey];if(Array.isArray(value)){let nodes=value,cIndex=0;for(;cIndex>-1&&cIndex<nodes.length;){let subvalue=nodes[cIndex];if(nodelike(subvalue)){let subresult=build(subvalue,cKey,cIndex,grandparents)();if(subresult[0]===EXIT2)return subresult;cIndex=typeof subresult[1]=="number"?subresult[1]:cIndex+1}else cIndex++}}else if(nodelike(value)){let subresult=build(value,cKey,void 0,grandparents)();if(subresult[0]===EXIT2)return subresult}}}return leave?toResult2(leave(node3,key,index2,parents)):result}}}function toResult2(value){return Array.isArray(value)?value:typeof value=="number"?[CONTINUE2,value]:[value]}function nodelike(value){return!!(value&&typeof value=="object"&&"type"in value&&typeof value.type=="string"&&value.type.length>0)}function eventsToAcorn(events,options){let prefix=options.prefix||"",suffix=options.suffix||"",acornOptions=Object.assign({},options.acornOptions),comments=[],tokens=[],onComment=acornOptions.onComment,onToken=acornOptions.onToken,swallow=!1,estree,exception,acornConfig=Object.assign({},acornOptions,{onComment:comments,preserveParens:!0});onToken&&(acornConfig.onToken=tokens);let collection=collect(events,options.tokenTypes),source=collection.value,value=prefix+source+suffix,isEmptyExpression=options.expression&&empty3(source);if(isEmptyExpression&&!options.allowEmpty)throw new VFileMessage("Unexpected empty expression",{place:parseOffsetToUnistPoint(0),ruleId:"unexpected-empty-expression",source:"micromark-extension-mdx-expression"});try{estree=options.expression&&!isEmptyExpression?options.acorn.parseExpressionAt(value,0,acornConfig):options.acorn.parse(value,acornConfig)}catch(error_){let error=error_,point3=parseOffsetToUnistPoint(error.pos);error.message=String(error.message).replace(/ \(\d+:\d+\)$/,""),error.pos=point3.offset,error.loc={line:point3.line,column:point3.column-1},exception=error,swallow=error.raisedAt>=prefix.length+source.length||error.message==="Unterminated comment"}if(estree&&options.expression&&!isEmptyExpression)if(empty3(value.slice(estree.end,value.length-suffix.length)))estree={type:"Program",start:0,end:prefix.length+source.length,body:[{type:"ExpressionStatement",expression:estree,start:0,end:prefix.length+source.length}],sourceType:"module",comments:[]};else{let point3=parseOffsetToUnistPoint(estree.end),error=new Error("Unexpected content after expression");error.pos=point3.offset,error.loc={line:point3.line,column:point3.column-1},exception=error,estree=void 0}if(estree){if(estree.comments=comments,visit2(estree,function(esnode,field,index2,parents){let context=parents[parents.length-1],prop=field;esnode.type==="ParenthesizedExpression"&&context&&prop&&(typeof index2=="number"&&(context=context[prop],prop=index2),context[prop]=esnode.expression),fixPosition(esnode)}),Array.isArray(onComment))onComment.push(...comments);else if(typeof onComment=="function")for(let comment of comments)onComment(comment.type==="Block",comment.value,comment.start,comment.end,comment.loc.start,comment.loc.end);for(let token of tokens)token.end<=prefix.length||token.start-prefix.length>=source.length||(fixPosition(token),Array.isArray(onToken)?onToken.push(token):onToken(token))}return{estree,error:exception,swallow};function fixPosition(nodeOrToken){let pointStart=parseOffsetToUnistPoint(nodeOrToken.start),pointEnd=parseOffsetToUnistPoint(nodeOrToken.end);nodeOrToken.start=pointStart.offset,nodeOrToken.end=pointEnd.offset,nodeOrToken.loc={start:{line:pointStart.line,column:pointStart.column-1,offset:pointStart.offset},end:{line:pointEnd.line,column:pointEnd.column-1,offset:pointEnd.offset}},nodeOrToken.range=[nodeOrToken.start,nodeOrToken.end]}function parseOffsetToUnistPoint(acornOffset){let sourceOffset=acornOffset-prefix.length;sourceOffset<0?sourceOffset=0:sourceOffset>source.length&&(sourceOffset=source.length);let point3=relativeToPoint(collection.stops,sourceOffset);return point3||(point3={line:options.start.line,column:options.start.column,offset:options.start.offset}),point3}}function empty3(value){return/^\s*$/.test(value.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,""))}function collect(events,tokenTypes){let result={value:"",stops:[]},index2=-1;for(;++index2<events.length;){let event=events[index2];if(event[0]==="enter"){let type=event[1].type;if(type==="lineEnding"||tokenTypes.includes(type)){let chunks=event[2].sliceStream(event[1]);for(;chunks.length>0&&chunks[0]===-1;)chunks.shift();let value=serializeChunks2(chunks);result.stops.push([result.value.length,event[1].start]),result.value+=value,result.stops.push([result.value.length,event[1].end])}}}return result}function relativeToPoint(stops,relative){let index2=0;for(;index2<stops.length&&stops[index2][0]<=relative;)index2+=1;if(index2===0)return;let[stopRelative,stopAbsolute]=stops[index2-1],rest=relative-stopRelative;return{line:stopAbsolute.line,column:stopAbsolute.column+rest,offset:stopAbsolute.offset+rest}}function serializeChunks2(chunks){let index2=-1,result=[],atTab;for(;++index2<chunks.length;){let chunk=chunks[index2],value;if(typeof chunk=="string")value=chunk;else switch(chunk){case-5:{value="\r";break}case-4:{value=`
|
62
62
|
`;break}case-3:{value=`\r
|
63
63
|
`;break}case-2:{value=" ";break}case-1:{if(atTab)continue;value=" ";break}default:value=String.fromCharCode(chunk)}atTab=chunk===-2,result.push(value)}return result.join("")}function positionFromEstree(node3){let nodeLike=node3||{},loc=nodeLike.loc||{},range=nodeLike.range||[void 0,void 0],start2=pointOrUndefined(loc.start,range[0]||nodeLike.start),end=pointOrUndefined(loc.end,range[1]||nodeLike.end);if(start2&&end)return{start:start2,end}}function pointOrUndefined(estreePoint,estreeOffset){if(estreePoint&&typeof estreePoint=="object"){let line="line"in estreePoint?numberOrUndefined(estreePoint.line):void 0,column="column"in estreePoint?numberOrUndefined(estreePoint.column):void 0;if(line&&column!==void 0)return{line,column:column+1,offset:numberOrUndefined(estreeOffset)}}}function numberOrUndefined(value){return typeof value=="number"&&value>-1?value:void 0}var trouble="https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression",unexpectedEofHash="#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-",unexpectedLazyHash="#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed",nonSpreadHash="#unexpected-type-in-code-expected-an-object-spread-spread",spreadExtraHash="#unexpected-extra-content-in-spread-only-a-single-spread-is-supported",acornHash="#could-not-parse-expression-with-acorn";function factoryMdxExpression(effects,ok2,type,markerType,chunkType,acorn,acornOptions,addResult,spread,allowEmpty,allowLazy){let self2=this,eventStart=this.events.length+3,size=0,pointStart,lastCrash;return start2;function start2(code2){return effects.enter(type),effects.enter(markerType),effects.consume(code2),effects.exit(markerType),pointStart=self2.now(),before}function before(code2){if(code2===null){if(lastCrash)throw lastCrash;let error=new VFileMessage("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:self2.now(),ruleId:"unexpected-eof",source:"micromark-extension-mdx-expression"});throw error.url=trouble+unexpectedEofHash,error}if(markdownLineEnding(code2))return effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),eolAfter;if(code2===125&&size===0){let next=acorn?mdxExpressionParse.call(self2,acorn,acornOptions,chunkType,eventStart,pointStart,allowEmpty||!1,spread||!1):{type:"ok",estree:void 0};if(next.type==="ok"){effects.enter(markerType),effects.consume(code2),effects.exit(markerType);let token=effects.exit(type);return addResult&&next.estree&&Object.assign(token,{estree:next.estree}),ok2}return lastCrash=next.message,effects.enter(chunkType),effects.consume(code2),inside}return effects.enter(chunkType),inside(code2)}function inside(code2){return code2===125&&size===0||code2===null||markdownLineEnding(code2)?(effects.exit(chunkType),before(code2)):(code2===123&&!acorn?size+=1:code2===125&&(size-=1),effects.consume(code2),inside)}function eolAfter(code2){let now=self2.now();if(now.line!==pointStart.line&&!allowLazy&&self2.parser.lazy[now.line]){let error=new VFileMessage("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:self2.now(),ruleId:"unexpected-lazy",source:"micromark-extension-mdx-expression"});throw error.url=trouble+unexpectedLazyHash,error}return before(code2)}}function mdxExpressionParse(acorn,acornOptions,chunkType,eventStart,pointStart,allowEmpty,spread){let result=eventsToAcorn(this.events.slice(eventStart),{acorn,tokenTypes:[chunkType],acornOptions,start:pointStart,expression:!0,allowEmpty,prefix:spread?"({":"",suffix:spread?"})":""}),estree=result.estree;if(spread&&estree){let head=estree.body[0];if(head.type!=="ExpressionStatement"||head.expression.type!=="ObjectExpression"){let place=positionFromEstree(head),error=new VFileMessage("Unexpected `"+head.type+"` in code: expected an object spread (`{...spread}`)",{place:place.start,ruleId:"non-spread",source:"micromark-extension-mdx-expression"});throw error.url=trouble+nonSpreadHash,error}if(head.expression.properties[1]){let place=positionFromEstree(head.expression.properties[1]),error=new VFileMessage("Unexpected extra content in spread: only a single spread is supported",{place:place.start,ruleId:"spread-extra",source:"micromark-extension-mdx-expression"});throw error.url=trouble+spreadExtraHash,error}if(head.expression.properties[0]&&head.expression.properties[0].type!=="SpreadElement"){let place=positionFromEstree(head.expression.properties[0]),error=new VFileMessage("Unexpected `"+head.expression.properties[0].type+"` in code: only spread elements are supported",{place:place.start,ruleId:"non-spread",source:"micromark-extension-mdx-expression"});throw error.url=trouble+nonSpreadHash,error}}if(result.error){let error=new VFileMessage("Could not parse expression with acorn",{cause:result.error,place:{line:result.error.loc.line,column:result.error.loc.column+1,offset:result.error.pos},ruleId:"acorn",source:"micromark-extension-mdx-expression"});return error.url=trouble+acornHash,{type:"nok",message:error}}return{type:"ok",estree}}function mdxExpression(options){let options_=options||{},addResult=options_.addResult,acorn=options_.acorn,spread=options_.spread,allowEmpty=options_.allowEmpty,acornOptions;if(allowEmpty==null&&(allowEmpty=!0),acorn){if(!acorn.parseExpressionAt)throw new Error("Expected a proper `acorn` instance passed in as `options.acorn`");acornOptions=Object.assign({ecmaVersion:2024,sourceType:"module"},options_.acornOptions)}else if(options_.acornOptions||options_.addResult)throw new Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:"mdxFlowExpression",tokenize:tokenizeFlowExpression,concrete:!0}},text:{123:{name:"mdxTextExpression",tokenize:tokenizeTextExpression}}};function tokenizeFlowExpression(effects,ok2,nok){let self2=this;return start2;function start2(code2){return before(code2)}function before(code2){return factoryMdxExpression.call(self2,effects,after,"mdxFlowExpression","mdxFlowExpressionMarker","mdxFlowExpressionChunk",acorn,acornOptions,addResult,spread,allowEmpty)(code2)}function after(code2){return markdownSpace(code2)?factorySpace(effects,end,"whitespace")(code2):end(code2)}function end(code2){let lessThanValue=self2.parser.constructs.flow[60],jsxTag=(Array.isArray(lessThanValue)?lessThanValue:lessThanValue?[lessThanValue]:[]).find(function(d){return d.name==="mdxJsxFlowTag"});return code2===60&&jsxTag?effects.attempt(jsxTag,end,nok)(code2):code2===null||markdownLineEnding(code2)?ok2(code2):nok(code2)}}function tokenizeTextExpression(effects,ok2){let self2=this;return start2;function start2(code2){return factoryMdxExpression.call(self2,effects,ok2,"mdxTextExpression","mdxTextExpressionMarker","mdxTextExpressionChunk",acorn,acornOptions,addResult,spread,allowEmpty,!0)(code2)}}}var startRe=/[$_\p{ID_Start}]/u,contRe=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,contReJsx=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u;var emptyOptions3={};function start(code2){return code2?startRe.test(String.fromCodePoint(code2)):!1}function cont(code2,options){let re=(options||emptyOptions3).jsx?contReJsx:contRe;return code2?re.test(String.fromCodePoint(code2)):!1}var trouble2="https://github.com/micromark/micromark-extension-mdx-jsx";function factoryTag(effects,ok2,nok,acorn,acornOptions,addResult,allowLazy,tagType,tagMarkerType,tagClosingMarkerType,tagSelfClosingMarker,tagNameType,tagNamePrimaryType,tagNameMemberMarkerType,tagNameMemberType,tagNamePrefixMarkerType,tagNameLocalType,tagExpressionAttributeType,tagExpressionAttributeMarkerType,tagExpressionAttributeValueType,tagAttributeType,tagAttributeNameType,tagAttributeNamePrimaryType,tagAttributeNamePrefixMarkerType,tagAttributeNameLocalType,tagAttributeInitializerMarkerType,tagAttributeValueLiteralType,tagAttributeValueLiteralMarkerType,tagAttributeValueLiteralValueType,tagAttributeValueExpressionType,tagAttributeValueExpressionMarkerType,tagAttributeValueExpressionValueType){let self2=this,returnState,marker;return start2;function start2(code2){return effects.enter(tagType),effects.enter(tagMarkerType),effects.consume(code2),effects.exit(tagMarkerType),startAfter}function startAfter(code2){return markdownLineEndingOrSpace(code2)?nok(code2):(returnState=nameBefore,esWhitespaceStart(code2))}function nameBefore(code2){if(code2===47)return effects.enter(tagClosingMarkerType),effects.consume(code2),effects.exit(tagClosingMarkerType),returnState=closingTagNameBefore,esWhitespaceStart;if(code2===62)return tagEnd(code2);if(code2!==null&&code2>=0&&start(code2))return effects.enter(tagNameType),effects.enter(tagNamePrimaryType),effects.consume(code2),primaryName;crash(code2,"before name","a character that can start a name, such as a letter, `$`, or `_`"+(code2===33?" (note: to create a comment in MDX, use `{/* text */}`)":""))}function closingTagNameBefore(code2){if(code2===62)return tagEnd(code2);if(code2!==null&&code2>=0&&start(code2))return effects.enter(tagNameType),effects.enter(tagNamePrimaryType),effects.consume(code2),primaryName;crash(code2,"before name","a character that can start a name, such as a letter, `$`, or `_`"+(code2===42||code2===47?" (note: JS comments in JSX tags are not supported in MDX)":""))}function primaryName(code2){if(code2!==null&&code2>=0&&cont(code2,{jsx:!0}))return effects.consume(code2),primaryName;if(code2===46||code2===47||code2===58||code2===62||code2===123||markdownLineEndingOrSpace(code2)||unicodeWhitespace(code2))return effects.exit(tagNamePrimaryType),returnState=primaryNameAfter,esWhitespaceStart(code2);crash(code2,"in name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(code2===64?" (note: to create a link in MDX, use `[text](url)`)":""))}function primaryNameAfter(code2){if(code2===46)return effects.enter(tagNameMemberMarkerType),effects.consume(code2),effects.exit(tagNameMemberMarkerType),returnState=memberNameBefore,esWhitespaceStart;if(code2===58)return effects.enter(tagNamePrefixMarkerType),effects.consume(code2),effects.exit(tagNamePrefixMarkerType),returnState=localNameBefore,esWhitespaceStart;if(code2===47||code2===62||code2===123||code2!==null&&code2>=0&&start(code2))return effects.exit(tagNameType),attributeBefore(code2);crash(code2,"after name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function memberNameBefore(code2){if(code2!==null&&code2>=0&&start(code2))return effects.enter(tagNameMemberType),effects.consume(code2),memberName;crash(code2,"before member name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function memberName(code2){if(code2!==null&&code2>=0&&cont(code2,{jsx:!0}))return effects.consume(code2),memberName;if(code2===46||code2===47||code2===62||code2===123||markdownLineEndingOrSpace(code2)||unicodeWhitespace(code2))return effects.exit(tagNameMemberType),returnState=memberNameAfter,esWhitespaceStart(code2);crash(code2,"in member name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(code2===64?" (note: to create a link in MDX, use `[text](url)`)":""))}function memberNameAfter(code2){if(code2===46)return effects.enter(tagNameMemberMarkerType),effects.consume(code2),effects.exit(tagNameMemberMarkerType),returnState=memberNameBefore,esWhitespaceStart;if(code2===47||code2===62||code2===123||code2!==null&&code2>=0&&start(code2))return effects.exit(tagNameType),attributeBefore(code2);crash(code2,"after member name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function localNameBefore(code2){if(code2!==null&&code2>=0&&start(code2))return effects.enter(tagNameLocalType),effects.consume(code2),localName;crash(code2,"before local name","a character that can start a name, such as a letter, `$`, or `_`"+(code2===43||code2!==null&&code2>46&&code2<58?" (note: to create a link in MDX, use `[text](url)`)":""))}function localName(code2){if(code2!==null&&code2>=0&&cont(code2,{jsx:!0}))return effects.consume(code2),localName;if(code2===47||code2===62||code2===123||markdownLineEndingOrSpace(code2)||unicodeWhitespace(code2))return effects.exit(tagNameLocalType),returnState=localNameAfter,esWhitespaceStart(code2);crash(code2,"in local name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function localNameAfter(code2){if(code2===47||code2===62||code2===123||code2!==null&&code2>=0&&start(code2))return effects.exit(tagNameType),attributeBefore(code2);crash(code2,"after local name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function attributeBefore(code2){if(code2===47)return effects.enter(tagSelfClosingMarker),effects.consume(code2),effects.exit(tagSelfClosingMarker),returnState=selfClosing,esWhitespaceStart;if(code2===62)return tagEnd(code2);if(code2===123)return factoryMdxExpression.call(self2,effects,attributeExpressionAfter,tagExpressionAttributeType,tagExpressionAttributeMarkerType,tagExpressionAttributeValueType,acorn,acornOptions,addResult,!0,!1,allowLazy)(code2);if(code2!==null&&code2>=0&&start(code2))return effects.enter(tagAttributeType),effects.enter(tagAttributeNameType),effects.enter(tagAttributeNamePrimaryType),effects.consume(code2),attributePrimaryName;crash(code2,"before attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function attributeExpressionAfter(code2){return returnState=attributeBefore,esWhitespaceStart(code2)}function attributePrimaryName(code2){if(code2!==null&&code2>=0&&cont(code2,{jsx:!0}))return effects.consume(code2),attributePrimaryName;if(code2===47||code2===58||code2===61||code2===62||code2===123||markdownLineEndingOrSpace(code2)||unicodeWhitespace(code2))return effects.exit(tagAttributeNamePrimaryType),returnState=attributePrimaryNameAfter,esWhitespaceStart(code2);crash(code2,"in attribute name","an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function attributePrimaryNameAfter(code2){if(code2===58)return effects.enter(tagAttributeNamePrefixMarkerType),effects.consume(code2),effects.exit(tagAttributeNamePrefixMarkerType),returnState=attributeLocalNameBefore,esWhitespaceStart;if(code2===61)return effects.exit(tagAttributeNameType),effects.enter(tagAttributeInitializerMarkerType),effects.consume(code2),effects.exit(tagAttributeInitializerMarkerType),returnState=attributeValueBefore,esWhitespaceStart;if(code2===47||code2===62||code2===123||markdownLineEndingOrSpace(code2)||unicodeWhitespace(code2)||code2!==null&&code2>=0&&start(code2))return effects.exit(tagAttributeNameType),effects.exit(tagAttributeType),returnState=attributeBefore,esWhitespaceStart(code2);crash(code2,"after attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function attributeLocalNameBefore(code2){if(code2!==null&&code2>=0&&start(code2))return effects.enter(tagAttributeNameLocalType),effects.consume(code2),attributeLocalName;crash(code2,"before local attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function attributeLocalName(code2){if(code2!==null&&code2>=0&&cont(code2,{jsx:!0}))return effects.consume(code2),attributeLocalName;if(code2===47||code2===61||code2===62||code2===123||markdownLineEndingOrSpace(code2)||unicodeWhitespace(code2))return effects.exit(tagAttributeNameLocalType),effects.exit(tagAttributeNameType),returnState=attributeLocalNameAfter,esWhitespaceStart(code2);crash(code2,"in local attribute name","an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function attributeLocalNameAfter(code2){if(code2===61)return effects.enter(tagAttributeInitializerMarkerType),effects.consume(code2),effects.exit(tagAttributeInitializerMarkerType),returnState=attributeValueBefore,esWhitespaceStart;if(code2===47||code2===62||code2===123||code2!==null&&code2>=0&&start(code2))return effects.exit(tagAttributeType),attributeBefore(code2);crash(code2,"after local attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function attributeValueBefore(code2){if(code2===34||code2===39)return effects.enter(tagAttributeValueLiteralType),effects.enter(tagAttributeValueLiteralMarkerType),effects.consume(code2),effects.exit(tagAttributeValueLiteralMarkerType),marker=code2,attributeValueQuotedStart;if(code2===123)return factoryMdxExpression.call(self2,effects,attributeValueExpressionAfter,tagAttributeValueExpressionType,tagAttributeValueExpressionMarkerType,tagAttributeValueExpressionValueType,acorn,acornOptions,addResult,!1,!1,allowLazy)(code2);crash(code2,"before attribute value","a character that can start an attribute value, such as `\"`, `'`, or `{`"+(code2===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":""))}function attributeValueExpressionAfter(code2){return effects.exit(tagAttributeType),returnState=attributeBefore,esWhitespaceStart(code2)}function attributeValueQuotedStart(code2){return code2===null&&crash(code2,"in attribute value","a corresponding closing quote `"+String.fromCodePoint(marker)+"`"),code2===marker?(effects.enter(tagAttributeValueLiteralMarkerType),effects.consume(code2),effects.exit(tagAttributeValueLiteralMarkerType),effects.exit(tagAttributeValueLiteralType),effects.exit(tagAttributeType),marker=void 0,returnState=attributeBefore,esWhitespaceStart):markdownLineEnding(code2)?(returnState=attributeValueQuotedStart,esWhitespaceStart(code2)):(effects.enter(tagAttributeValueLiteralValueType),attributeValueQuoted(code2))}function attributeValueQuoted(code2){return code2===null||code2===marker||markdownLineEnding(code2)?(effects.exit(tagAttributeValueLiteralValueType),attributeValueQuotedStart(code2)):(effects.consume(code2),attributeValueQuoted)}function selfClosing(code2){if(code2===62)return tagEnd(code2);crash(code2,"after self-closing slash","`>` to end the tag"+(code2===42||code2===47?" (note: JS comments in JSX tags are not supported in MDX)":""))}function tagEnd(code2){return effects.enter(tagMarkerType),effects.consume(code2),effects.exit(tagMarkerType),effects.exit(tagType),ok2}function esWhitespaceStart(code2){return markdownLineEnding(code2)?(effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),esWhitespaceEolAfter):markdownSpace(code2)||unicodeWhitespace(code2)?(effects.enter("esWhitespace"),esWhitespaceInside(code2)):returnState(code2)}function esWhitespaceInside(code2){return markdownLineEnding(code2)?(effects.exit("esWhitespace"),esWhitespaceStart(code2)):markdownSpace(code2)||unicodeWhitespace(code2)?(effects.consume(code2),esWhitespaceInside):(effects.exit("esWhitespace"),returnState(code2))}function esWhitespaceEolAfter(code2){if(!allowLazy&&self2.parser.lazy[self2.now().line]){let error=new VFileMessage("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",self2.now(),"micromark-extension-mdx-jsx:unexpected-lazy");throw error.url=trouble2+"#unexpected-lazy-line-in-container-expected-line-to-be",error}return esWhitespaceStart(code2)}function crash(code2,at2,expect){let error=new VFileMessage("Unexpected "+(code2===null?"end of file":"character `"+(code2===96?"` ` `":String.fromCodePoint(code2))+"` ("+serializeCharCode(code2)+")")+" "+at2+", expected "+expect,self2.now(),"micromark-extension-mdx-jsx:unexpected-"+(code2===null?"eof":"character"));throw error.url=trouble2+(code2===null?"#unexpected-end-of-file-at-expected-expect":"#unexpected-character-at-expected-expect"),error}}function serializeCharCode(code2){return"U+"+code2.toString(16).toUpperCase().padStart(4,"0")}function jsxText(acorn,options){return{name:"mdxJsxTextTag",tokenize:tokenizeJsxText};function tokenizeJsxText(effects,ok2,nok){return factoryTag.call(this,effects,ok2,nok,acorn,options.acornOptions,options.addResult,!0,"mdxJsxTextTag","mdxJsxTextTagMarker","mdxJsxTextTagClosingMarker","mdxJsxTextTagSelfClosingMarker","mdxJsxTextTagName","mdxJsxTextTagNamePrimary","mdxJsxTextTagNameMemberMarker","mdxJsxTextTagNameMember","mdxJsxTextTagNamePrefixMarker","mdxJsxTextTagNameLocal","mdxJsxTextTagExpressionAttribute","mdxJsxTextTagExpressionAttributeMarker","mdxJsxTextTagExpressionAttributeValue","mdxJsxTextTagAttribute","mdxJsxTextTagAttributeName","mdxJsxTextTagAttributeNamePrimary","mdxJsxTextTagAttributeNamePrefixMarker","mdxJsxTextTagAttributeNameLocal","mdxJsxTextTagAttributeInitializerMarker","mdxJsxTextTagAttributeValueLiteral","mdxJsxTextTagAttributeValueLiteralMarker","mdxJsxTextTagAttributeValueLiteralValue","mdxJsxTextTagAttributeValueExpression","mdxJsxTextTagAttributeValueExpressionMarker","mdxJsxTextTagAttributeValueExpressionValue")}}function jsxFlow(acorn,options){return{name:"mdxJsxFlowTag",tokenize:tokenizeJsxFlow,concrete:!0};function tokenizeJsxFlow(effects,ok2,nok){let self2=this;return start2;function start2(code2){return before(code2)}function before(code2){return factoryTag.call(self2,effects,after,nok,acorn,options.acornOptions,options.addResult,!1,"mdxJsxFlowTag","mdxJsxFlowTagMarker","mdxJsxFlowTagClosingMarker","mdxJsxFlowTagSelfClosingMarker","mdxJsxFlowTagName","mdxJsxFlowTagNamePrimary","mdxJsxFlowTagNameMemberMarker","mdxJsxFlowTagNameMember","mdxJsxFlowTagNamePrefixMarker","mdxJsxFlowTagNameLocal","mdxJsxFlowTagExpressionAttribute","mdxJsxFlowTagExpressionAttributeMarker","mdxJsxFlowTagExpressionAttributeValue","mdxJsxFlowTagAttribute","mdxJsxFlowTagAttributeName","mdxJsxFlowTagAttributeNamePrimary","mdxJsxFlowTagAttributeNamePrefixMarker","mdxJsxFlowTagAttributeNameLocal","mdxJsxFlowTagAttributeInitializerMarker","mdxJsxFlowTagAttributeValueLiteral","mdxJsxFlowTagAttributeValueLiteralMarker","mdxJsxFlowTagAttributeValueLiteralValue","mdxJsxFlowTagAttributeValueExpression","mdxJsxFlowTagAttributeValueExpressionMarker","mdxJsxFlowTagAttributeValueExpressionValue")(code2)}function after(code2){return markdownSpace(code2)?factorySpace(effects,end,"whitespace")(code2):end(code2)}function end(code2){let leftBraceValue=self2.parser.constructs.flow[123],expression=(Array.isArray(leftBraceValue)?leftBraceValue:leftBraceValue?[leftBraceValue]:[]).find(d=>d.name==="mdxFlowExpression");return code2===60?start2(code2):code2===123&&expression?effects.attempt(expression,end,nok)(code2):code2===null||markdownLineEnding(code2)?ok2(code2):nok(code2)}}}function mdxJsx(options){let settings=options||{},acorn=settings.acorn,acornOptions;if(acorn){if(!acorn.parse||!acorn.parseExpressionAt)throw new Error("Expected a proper `acorn` instance passed in as `options.acorn`");acornOptions=Object.assign({ecmaVersion:2024,sourceType:"module"},settings.acornOptions,{locations:!0})}else if(settings.acornOptions||settings.addResult)throw new Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:jsxFlow(acorn||void 0,{acornOptions,addResult:settings.addResult||void 0})},text:{60:jsxText(acorn||void 0,{acornOptions,addResult:settings.addResult||void 0})}}}function mdxMd(){return{disable:{null:["autolink","codeIndented","htmlFlow","htmlText"]}}}var blankLineBefore2={tokenize:tokenizeNextBlank,partial:!0},trouble3="https://github.com/micromark/micromark-extension-mdxjs-esm",allowedAcornTypes=new Set(["ExportAllDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ImportDeclaration"]);function mdxjsEsm(options){let exportImportConstruct={tokenize:tokenizeExportImport,concrete:!0};if(!options||!options.acorn||!options.acorn.parse)throw new Error("Expected an `acorn` instance passed in as `options.acorn`");let acorn=options.acorn,acornOptions=Object.assign({ecmaVersion:2024,sourceType:"module"},options.acornOptions,{locations:!0});return{flow:{101:exportImportConstruct,105:exportImportConstruct}};function tokenizeExportImport(effects,ok2,nok){let self2=this,definedModuleSpecifiers=self2.parser.definedModuleSpecifiers||(self2.parser.definedModuleSpecifiers=[]),eventStart=this.events.length+1,buffer="";return self2.interrupt?nok:start2;function start2(code2){return self2.now().column>1?nok(code2):(effects.enter("mdxjsEsm"),effects.enter("mdxjsEsmData"),effects.consume(code2),buffer+=String.fromCharCode(code2),word)}function word(code2){return asciiAlpha(code2)?(effects.consume(code2),buffer+=String.fromCharCode(code2),word):(buffer==="import"||buffer==="export")&&code2===32?(effects.consume(code2),inside):nok(code2)}function inside(code2){return code2===null||markdownLineEnding(code2)?(effects.exit("mdxjsEsmData"),lineStart(code2)):(effects.consume(code2),inside)}function lineStart(code2){return code2===null?atEnd(code2):markdownLineEnding(code2)?effects.check(blankLineBefore2,atEnd,continuationStart)(code2):(effects.enter("mdxjsEsmData"),inside(code2))}function continuationStart(code2){return effects.enter("lineEnding"),effects.consume(code2),effects.exit("lineEnding"),lineStart}function atEnd(code2){let result=eventsToAcorn(self2.events.slice(eventStart),{acorn,acornOptions,tokenTypes:["mdxjsEsmData"],prefix:definedModuleSpecifiers.length>0?"var "+definedModuleSpecifiers.join(",")+`
|
64
|
-
`:""});if(result.error){if(code2!==null&&result.swallow)return continuationStart(code2);let error=new VFileMessage("Could not parse import/exports with acorn",{cause:result.error,place:{line:result.error.loc.line,column:result.error.loc.column+1,offset:result.error.pos},ruleId:"acorn",source:"micromark-extension-mdxjs-esm"});throw error.url=trouble3+"#could-not-parse-importexports-with-acorn",error}if(definedModuleSpecifiers.length>0){let declaration=result.estree.body.shift()}let index2=-1;for(;++index2<result.estree.body.length;){let node3=result.estree.body[index2];if(!allowedAcornTypes.has(node3.type)){let error=new VFileMessage("Unexpected `"+node3.type+"` in code: only import/exports are supported",{place:positionFromEstree(node3),ruleId:"non-esm",source:"micromark-extension-mdxjs-esm"});throw error.url=trouble3+"#unexpected-type-in-code-only-importexports-are-supported",error}if(node3.type==="ImportDeclaration"&&!self2.interrupt){let index3=-1;for(;++index3<node3.specifiers.length;){let specifier=node3.specifiers[index3];definedModuleSpecifiers.push(specifier.local.name)}}}return Object.assign(effects.exit("mdxjsEsm"),options.addResult?{estree:result.estree}:void 0),ok2(code2)}}}function tokenizeNextBlank(effects,ok2,nok){return start2;function start2(code2){return effects.enter("lineEndingBlank"),effects.consume(code2),effects.exit("lineEndingBlank"),effects.attempt(blankLine,ok2,nok)}}function mdxjs(options){let settings=Object.assign({acorn:Parser.extend((0,import_acorn_jsx.default)()),acornOptions:{ecmaVersion:2024,sourceType:"module"},addResult:!0},options);return combineExtensions([mdxjsEsm(settings),mdxExpression(settings),mdxJsx(settings),mdxMd()])}var emptyOptions4={};function remarkMdx(options){let self2=this,settings=options||emptyOptions4,data2=self2.data(),micromarkExtensions=data2.micromarkExtensions||(data2.micromarkExtensions=[]),fromMarkdownExtensions=data2.fromMarkdownExtensions||(data2.fromMarkdownExtensions=[]),toMarkdownExtensions=data2.toMarkdownExtensions||(data2.toMarkdownExtensions=[]);micromarkExtensions.push(mdxjs(settings)),fromMarkdownExtensions.push(mdxFromMarkdown()),toMarkdownExtensions.push(mdxToMarkdown(settings))}var
|
64
|
+
`:""});if(result.error){if(code2!==null&&result.swallow)return continuationStart(code2);let error=new VFileMessage("Could not parse import/exports with acorn",{cause:result.error,place:{line:result.error.loc.line,column:result.error.loc.column+1,offset:result.error.pos},ruleId:"acorn",source:"micromark-extension-mdxjs-esm"});throw error.url=trouble3+"#could-not-parse-importexports-with-acorn",error}if(definedModuleSpecifiers.length>0){let declaration=result.estree.body.shift()}let index2=-1;for(;++index2<result.estree.body.length;){let node3=result.estree.body[index2];if(!allowedAcornTypes.has(node3.type)){let error=new VFileMessage("Unexpected `"+node3.type+"` in code: only import/exports are supported",{place:positionFromEstree(node3),ruleId:"non-esm",source:"micromark-extension-mdxjs-esm"});throw error.url=trouble3+"#unexpected-type-in-code-only-importexports-are-supported",error}if(node3.type==="ImportDeclaration"&&!self2.interrupt){let index3=-1;for(;++index3<node3.specifiers.length;){let specifier=node3.specifiers[index3];definedModuleSpecifiers.push(specifier.local.name)}}}return Object.assign(effects.exit("mdxjsEsm"),options.addResult?{estree:result.estree}:void 0),ok2(code2)}}}function tokenizeNextBlank(effects,ok2,nok){return start2;function start2(code2){return effects.enter("lineEndingBlank"),effects.consume(code2),effects.exit("lineEndingBlank"),effects.attempt(blankLine,ok2,nok)}}function mdxjs(options){let settings=Object.assign({acorn:Parser.extend((0,import_acorn_jsx.default)()),acornOptions:{ecmaVersion:2024,sourceType:"module"},addResult:!0},options);return combineExtensions([mdxjsEsm(settings),mdxExpression(settings),mdxJsx(settings),mdxMd()])}var emptyOptions4={};function remarkMdx(options){let self2=this,settings=options||emptyOptions4,data2=self2.data(),micromarkExtensions=data2.micromarkExtensions||(data2.micromarkExtensions=[]),fromMarkdownExtensions=data2.fromMarkdownExtensions||(data2.fromMarkdownExtensions=[]),toMarkdownExtensions=data2.toMarkdownExtensions||(data2.toMarkdownExtensions=[]);micromarkExtensions.push(mdxjs(settings)),fromMarkdownExtensions.push(mdxFromMarkdown()),toMarkdownExtensions.push(mdxToMarkdown(settings))}var mdxProcessor=remark().use(remarkMdx),renameList=[],brokenList=[];async function jscodeshift(info){let parsed=(0,import_node_path2.parse)(info.path),baseName=(0,import_node_path2.join)(parsed.dir,parsed.name.replace(".mdx","").replace(".stories","").replace(".story",""));for(;(0,import_node_fs.existsSync)(`${baseName}.stories.js`);)baseName+="_";try{let{csf,mdx}=await transform(info,(0,import_node_path2.basename)(baseName));return csf!=null&&(0,import_node_fs.writeFileSync)(`${baseName}.stories.js`,csf),renameList.push({original:info.path,baseName}),mdx}catch(e){throw brokenList.push({original:info.path,baseName}),e}}process.on("exit",()=>{renameList.forEach(file=>{(0,import_node_fs.renameSync)(file.original,`${file.baseName}.mdx`)}),brokenList.forEach(file=>{(0,import_node_fs.renameSync)(file.original,`${file.original}.broken`)})});async function transform(info,baseName){let root2=mdxProcessor.parse(info.source),storyNamespaceName=nameToValidExport(`${baseName}Stories`),metaAttributes=[],storiesMap=new Map;visit(root2,["mdxjsEsm"],node3=>{if(node3.value=node3.value.replaceAll("@storybook/addon-docs/blocks","@storybook/blocks").replaceAll("@storybook/addon-docs","@storybook/blocks"),node3.value.includes("@storybook/blocks")){let file2=new babel.File({filename:"info.path"},{code:node3.value,ast:(0,import_csf_tools.babelParse)(node3.value)});file2.path.traverse({ImportDeclaration(path2){path2.node.source.value==="@storybook/blocks"&&path2.get("specifiers").forEach(specifier=>{if(specifier.isImportSpecifier()){let imported=specifier.get("imported");imported.isIdentifier()&&imported.node.name==="ArgsTable"&&(imported.node.name="Controls")}})}}),node3.value=recast.print(file2.ast).code}});let file=getEsmAst(root2);if(visit(root2,["mdxJsxFlowElement","mdxJsxTextElement"],(node3,index2,parent)=>{if((node3.type==="mdxJsxFlowElement"||node3.type==="mdxJsxTextElement")&&(is(node3,{name:"ArgsTable"})&&(node3.name="Controls",node3.attributes=[]),is(node3,{name:"Story"}))){let nameAttribute=node3.attributes.find(it=>it.type==="mdxJsxAttribute"&&it.name==="name"),idAttribute=node3.attributes.find(it=>it.type==="mdxJsxAttribute"&&it.name==="id"),storyAttribute=node3.attributes.find(it=>it.type==="mdxJsxAttribute"&&it.name==="story");if(typeof nameAttribute?.value=="string"){let name2=nameToValidExport(nameAttribute.value);for(;variableNameExists(name2);)name2+="_";storiesMap.set(name2,{type:"value",attributes:node3.attributes,children:node3.children}),node3.attributes=[{type:"mdxJsxAttribute",name:"of",value:{type:"mdxJsxAttributeValueExpression",value:`${storyNamespaceName}.${name2}`}}],node3.children=[]}else if(idAttribute?.value){let newNode={type:"mdxFlowExpression",value:`/* ${mdxProcessor.stringify({type:"root",children:[node3]}).trim()} is deprecated, please migrate it to <Story of={referenceToStory} /> see: https://storybook.js.org/migration-guides/7.0 */`};return storiesMap.set(idAttribute.value,{type:"id"}),parent?.children.splice(index2,0,newNode),[SKIP,index2+2]}else if(storyAttribute?.type==="mdxJsxAttribute"&&typeof storyAttribute.value=="object"&&storyAttribute.value?.type==="mdxJsxAttributeValueExpression"){let name2=storyAttribute.value?.value;node3.attributes=[{type:"mdxJsxAttribute",name:"of",value:{type:"mdxJsxAttributeValueExpression",value:`${storyNamespaceName}.${name2}`}}],node3.children=[],storiesMap.set(name2??"",{type:"reference"})}else return parent?.children.splice(index2,1),[SKIP,index2]}}),file.path.traverse({ImportDeclaration(path2){path2.node.source.value==="@storybook/blocks"&&path2.remove()},ExportNamedDeclaration(path2){path2.replaceWith(path2.node.declaration)}}),storiesMap.size===0)return{csf:null,mdx:mdxProcessor.stringify(root2)};visit(root2,["mdxJsxFlowElement","mdxJsxTextElement"],(node3,index2,parent)=>{(node3.type==="mdxJsxFlowElement"||node3.type==="mdxJsxTextElement")&&is(node3,{name:"Meta"})&&(metaAttributes.push(...node3.attributes),node3.attributes=[{type:"mdxJsxAttribute",name:"of",value:{type:"mdxJsxAttributeValueExpression",value:storyNamespaceName}}])});let metaProperties=metaAttributes.flatMap(attribute=>attribute.type==="mdxJsxAttribute"?typeof attribute.value=="string"?[t.objectProperty(t.identifier(attribute.name),t.stringLiteral(attribute.value))]:[t.objectProperty(t.identifier(attribute.name),(0,import_csf_tools.babelParseExpression)(attribute.value?.value??""))]:[]);addStoriesImport(root2,baseName,storyNamespaceName);let newStatements=[t.exportDefaultDeclaration(t.objectExpression(metaProperties))];function mapChildrenToRender(children){let child=children[0];if(!child)return;if(child.type==="text")return t.arrowFunctionExpression([],t.stringLiteral(child.value));if(child.type==="mdxFlowExpression"||child.type==="mdxTextExpression"){let expression2=(0,import_csf_tools.babelParseExpression)(child.value);return/\.bind\(.*\)/.test(child.value)||t.isIdentifier(expression2)||t.isArrowFunctionExpression(expression2)?expression2:t.arrowFunctionExpression([],expression2)}let expression=(0,import_csf_tools.babelParseExpression)(mdxProcessor.stringify({type:"root",children:[child]}));return t.arrowFunctionExpression([],expression)}function variableNameExists(name2){let found=!1;return file.path.traverse({VariableDeclarator:path2=>{let lVal=path2.node.id;t.isIdentifier(lVal)&&lVal.name===name2&&(found=!0)}}),found}newStatements.push(...[...storiesMap].flatMap(([key,value])=>{if(value.type==="id")return[];if(value.type==="reference")return[t.exportNamedDeclaration(null,[t.exportSpecifier(t.identifier(key),t.identifier(key))])];let renderProperty=mapChildrenToRender(value.children),newObject=t.objectExpression([...renderProperty?[t.objectProperty(t.identifier("render"),renderProperty)]:[],...value.attributes.flatMap(attribute=>attribute.type==="mdxJsxAttribute"?typeof attribute.value=="string"?[t.objectProperty(t.identifier(attribute.name),t.stringLiteral(attribute.value))]:[t.objectProperty(t.identifier(attribute.name),(0,import_csf_tools.babelParseExpression)(attribute.value?.value??""))]:[])]);return[t.exportNamedDeclaration(t.variableDeclaration("const",[t.variableDeclarator(t.identifier(key),newObject)]))]})),file.path.node.body=[...file.path.node.body,...newStatements];let newMdx=mdxProcessor.stringify(root2),output=recast.print(file.path.node).code,path=`${info.path}.jsx`;return output=await import_prettier.default.format(output.trim(),{...await import_prettier.default.resolveConfig(path),filepath:path}),{csf:output,mdx:newMdx}}function getEsmAst(root2){let esm=[];visit(root2,"mdxjsEsm",node3=>{esm.push(node3.value)});let esmSource=`${esm.join(`
|
65
65
|
|
66
66
|
`)}`;return new babel.File({filename:"info.path"},{code:esmSource,ast:(0,import_csf_tools.babelParse)(esmSource)})}function addStoriesImport(root2,baseName,storyNamespaceName){let found=!1;visit(root2,"mdxjsEsm",node3=>{found||(node3.value+=`
|
67
67
|
import * as ${storyNamespaceName} from './${baseName}.stories';`,found=!0)})}function nameToValidExport(name2){let[first,...rest]=Array.from((0,import_camelCase.default)(name2));return`${first.match(/[a-zA-Z_$]/)?first.toUpperCase():`$${first}`}${rest.join("")}`}0&&(module.exports={nameToValidExport,transform});
|
@@ -1 +1 @@
|
|
1
|
-
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var storiesof_to_csf_exports={};__export(storiesof_to_csf_exports,{default:()=>transformer});module.exports=__toCommonJS(storiesof_to_csf_exports);var
|
1
|
+
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var storiesof_to_csf_exports={};__export(storiesof_to_csf_exports,{default:()=>transformer});module.exports=__toCommonJS(storiesof_to_csf_exports);var import_csf=require("@storybook/csf"),import_node_logger=require("@storybook/core/node-logger"),import_prettier=__toESM(require("prettier"));var import_camelCase=__toESM(require("lodash/camelCase.js")),import_upperFirst=__toESM(require("lodash/upperFirst.js")),sanitizeName=name=>{let key=(0,import_upperFirst.default)((0,import_camelCase.default)(name));return/^\d/.test(key)&&(key=`_${key}`),/^\d/.test(key)&&(key=`_${key}`),key};function jscodeshiftToPrettierParser(parser){let parserMap={babylon:"babel",flow:"flow",ts:"typescript",tsx:"typescript"};return parser&&parserMap[parser]||"babel"}async function transformer(file,api,options){let LITERAL=["ts","tsx"].includes(options.parser)?"StringLiteral":"Literal",j=api.jscodeshift,root=j(file.source);function extractDecorators(parameters){if(!parameters)return{};if(!parameters.properties)return{storyParams:parameters};let storyDecorators=parameters.properties.find(p=>p.key.name==="decorators");if(!storyDecorators)return{storyParams:parameters};storyDecorators=storyDecorators.value;let storyParams={...parameters};return storyParams.properties=storyParams.properties.filter(p=>p.key.name!=="decorators"),storyParams.properties.length===0?{storyDecorators}:{storyParams,storyDecorators}}function convertToModuleExports(path,originalExports2){let base=j(path),statements=[],extraExports=[],decorators=[];base.find(j.CallExpression).filter(call=>call.node.callee.property&&call.node.callee.property.name==="addDecorator").forEach(add=>{let decorator=add.node.arguments[0];decorators.push(decorator)}),decorators.length>0&&(decorators.reverse(),extraExports.push(j.property("init",j.identifier("decorators"),j.arrayExpression(decorators))));let parameters=[];base.find(j.CallExpression).filter(call=>call.node.callee.property&&call.node.callee.property.name==="addParameters").forEach(add=>{let params=[...add.node.arguments[0].properties];params.reverse(),params.forEach(prop=>parameters.push(prop))}),parameters.length>0&&(parameters.reverse(),extraExports.push(j.property("init",j.identifier("parameters"),j.objectExpression(parameters)))),originalExports2.length>0&&extraExports.push(j.property("init",j.identifier("excludeStories"),j.arrayExpression(originalExports2.map(exp=>j.literal(exp))))),base.find(j.CallExpression).filter(call=>call.node.callee.name==="storiesOf").filter(call=>call.node.arguments.length>0&&call.node.arguments[0].type===LITERAL).forEach(storiesOf=>{let title=storiesOf.node.arguments[0].value;statements.push(j.exportDefaultDeclaration(j.objectExpression([j.property("init",j.identifier("title"),j.literal(title)),...extraExports])))});let adds=[];base.find(j.CallExpression).filter(add=>add.node.callee.property&&add.node.callee.property.name==="add").filter(add=>add.node.arguments.length>=2&&add.node.arguments[0].type===LITERAL).forEach(add=>adds.push(add)),adds.reverse(),adds.push(path);let identifiers=new Set;root.find(j.Identifier).forEach(({value})=>identifiers.add(value.name)),adds.forEach(add=>{let name=add.node.arguments[0].value,key=sanitizeName(name);for(;identifiers.has(key);)key=`_${key}`;identifiers.add(key),(0,import_csf.storyNameFromExport)(key)===name&&(name=null);let val=add.node.arguments[1];statements.push(j.exportDeclaration(!1,j.variableDeclaration("const",[j.variableDeclarator(j.identifier(key),val)])));let storyAnnotations=[];if(name&&storyAnnotations.push(j.property("init",j.identifier("name"),j.literal(name))),add.node.arguments.length>2){let originalStoryParams=add.node.arguments[2],{storyParams,storyDecorators}=extractDecorators(originalStoryParams);storyParams&&storyAnnotations.push(j.property("init",j.identifier("parameters"),storyParams)),storyDecorators&&storyAnnotations.push(j.property("init",j.identifier("decorators"),storyDecorators))}storyAnnotations.length>0&&statements.push(j.assignmentStatement("=",j.memberExpression(j.identifier(key),j.identifier("story")),j.objectExpression(storyAnnotations)))});let stmt=path.parent.node.type==="VariableDeclarator"?path.parent.parent:path.parent;statements.reverse(),statements.forEach(s=>stmt.insertAfter(s)),j(stmt).remove()}let initialStoriesOf=root.find(j.CallExpression).filter(call=>call.node.callee.name==="storiesOf");if(root.find(j.ExportDefaultDeclaration).size()>0)return initialStoriesOf.size()>0&&import_node_logger.logger.warn(`Found ${initialStoriesOf.size()} 'storiesOf' calls but existing default export, SKIPPING: '${file.path}'`),root.toSource();let originalExports=[];root.find(j.ExportNamedDeclaration).forEach(exp=>{let{declaration,specifiers}=exp.node;if(declaration){let{id,declarations}=declaration;declarations?declarations.forEach(decl=>{let{name,properties}=decl.id;name?originalExports.push(name):properties&&properties.forEach(prop=>originalExports.push(prop.key.name))}):id&&originalExports.push(id.name)}else specifiers&&specifiers.forEach(spec=>originalExports.push(spec.exported.name))}),root.find(j.CallExpression).filter(add=>add.node.callee.property&&add.node.callee.property.name==="add").filter(add=>add.node.arguments.length>=2&&add.node.arguments[0].type===LITERAL).filter(add=>["ExpressionStatement","VariableDeclarator"].includes(add.parentPath.node.type)).forEach(path=>convertToModuleExports(path,originalExports)),root.find(j.ImportSpecifier).filter(spec=>spec.node.imported.name==="storiesOf"&&spec.parent.node.source.value.startsWith("@storybook/")).forEach(spec=>{let toRemove=spec.parent.node.specifiers.length>1?spec:spec.parent;j(toRemove).remove()});let source=root.toSource({trailingComma:!0,quote:"single",tabWidth:2});if(initialStoriesOf.size()>1)return import_node_logger.logger.warn(`Found ${initialStoriesOf.size()} 'storiesOf' calls, PLEASE FIX BY HAND: '${file.path}'`),source;let output=source;try{let prettierConfig=await import_prettier.default.resolveConfig(file.path);output=import_prettier.default.format(source,{...prettierConfig,parser:jscodeshiftToPrettierParser(options.parser)})}catch{import_node_logger.logger.warn(`Failed to format ${file.path} with prettier`)}return output}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var upgrade_deprecated_types_exports={};__export(upgrade_deprecated_types_exports,{default:()=>transform,parser:()=>parser,upgradeDeprecatedTypes:()=>upgradeDeprecatedTypes});module.exports=__toCommonJS(upgrade_deprecated_types_exports);var
|
1
|
+
var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var upgrade_deprecated_types_exports={};__export(upgrade_deprecated_types_exports,{default:()=>transform,parser:()=>parser,upgradeDeprecatedTypes:()=>upgradeDeprecatedTypes});module.exports=__toCommonJS(upgrade_deprecated_types_exports);var import_csf_tools=require("@storybook/core/csf-tools"),babel=__toESM(require("@babel/core")),t=__toESM(require("@babel/types")),import_prettier=__toESM(require("prettier")),logger=console,deprecatedTypes=["ComponentStory","ComponentStoryFn","ComponentStoryObj","ComponentMeta","Story"];function migrateType(oldType){return oldType==="Story"||oldType==="ComponentStory"?"StoryFn":oldType.replace("Component","")}async function transform(info,api,options){let csf=(0,import_csf_tools.loadCsf)(info.source,{makeTitle:title=>title}),fileNode=csf._ast,file=new babel.File({filename:info.path},{code:info.source,ast:fileNode});upgradeDeprecatedTypes(file);let output=(0,import_csf_tools.printCsf)(csf).code;try{output=await import_prettier.default.format(output,{...await import_prettier.default.resolveConfig(info.path),filepath:info.path})}catch{logger.log(`Failed applying prettier to ${info.path}.`)}return output}var parser="tsx";function upgradeDeprecatedTypes(file){let importedNamespaces=new Set,typeReferencesToUpdate=new Set,existingImports=[];file.path.traverse({ImportDeclaration:path=>{existingImports.push(...path.get("specifiers").map(specifier=>({name:specifier.node.local.name,isAlias:!(specifier.isImportSpecifier()&&t.isIdentifier(specifier.node.imported)&&specifier.node.local.name===specifier.node.imported.name),path:specifier}))),path.node.source.value.startsWith("@storybook")&&path.get("specifiers").forEach(specifier=>{if(specifier.isImportNamespaceSpecifier()&&importedNamespaces.add(specifier.node.local.name),!specifier.isImportSpecifier())return;let imported=specifier.get("imported");if(imported.isIdentifier()&&deprecatedTypes.includes(imported.node.name)){imported.node.name===specifier.node.local.name&&typeReferencesToUpdate.add(specifier.node.local.name);let newType=migrateType(imported.node.name);if(!existingImports.some(it=>it.name===newType))imported.replaceWith(t.identifier(newType)),existingImports.push({name:newType,isAlias:!1,path:specifier});else{let existingImport=existingImports.find(it=>it.name===newType&&it.isAlias);if(existingImport)throw existingImport.path.buildCodeFrameError(`This codemod does not support local imports that are called the same as a storybook import.
|
2
2
|
Rename this local import and try again.`);specifier.remove()}}})}}),file.path.traverse({TSTypeReference:path=>{let typeName=path.get("typeName");if(typeName.isIdentifier())typeReferencesToUpdate.has(typeName.node.name)&&typeName.replaceWith(t.identifier(migrateType(typeName.node.name)));else if(typeName.isTSQualifiedName()){let namespace=typeName.get("left");if(namespace.isIdentifier()&&importedNamespaces.has(namespace.node.name)){let right=typeName.get("right");deprecatedTypes.includes(right.node.name)&&right.replaceWith(t.identifier(migrateType(right.node.name)))}}}})}0&&(module.exports={parser,upgradeDeprecatedTypes});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storybook/codemod",
|
3
|
-
"version": "8.3.0-alpha.
|
3
|
+
"version": "8.3.0-alpha.5",
|
4
4
|
"description": "A collection of codemod scripts written with JSCodeshift",
|
5
5
|
"keywords": [
|
6
6
|
"storybook"
|
@@ -50,14 +50,14 @@
|
|
50
50
|
"!src/**/*"
|
51
51
|
],
|
52
52
|
"scripts": {
|
53
|
-
"check": "
|
54
|
-
"prep": "
|
53
|
+
"check": "jiti ../../../scripts/prepare/check.ts",
|
54
|
+
"prep": "jiti ../../../scripts/prepare/bundle.ts"
|
55
55
|
},
|
56
56
|
"dependencies": {
|
57
57
|
"@babel/core": "^7.24.4",
|
58
58
|
"@babel/preset-env": "^7.24.4",
|
59
59
|
"@babel/types": "^7.24.0",
|
60
|
-
"@storybook/core": "8.3.0-alpha.
|
60
|
+
"@storybook/core": "8.3.0-alpha.5",
|
61
61
|
"@storybook/csf": "^0.1.11",
|
62
62
|
"@types/cross-spawn": "^6.0.2",
|
63
63
|
"cross-spawn": "^7.0.3",
|