diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..1f518ab --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.{eslintrc,json,mdastrc,svg,yml}] +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..741fbfa --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +build/ +components/ +coverage/ +build.js +alex.js +alex.min.js diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..692faee --- /dev/null +++ b/.eslintrc @@ -0,0 +1,10 @@ +{ + "extends": "eslint:recommended", + "env": { + "node": true, + "browser": true + }, + "rules": { + "quotes": [2, "single"] + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..806800e --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.DS_Store +*.log +bower_components/ +build/ +components/ +node_modules/ +coverage/ +build.js diff --git a/.jscs.json b/.jscs.json new file mode 100644 index 0000000..0244193 --- /dev/null +++ b/.jscs.json @@ -0,0 +1,144 @@ +{ + "excludeFiles": [ + "build/", + "components/", + "coverage/", + "node_modules/", + "build.js", + "alex.js", + "alex.min.js" + ], + "jsDoc": { + "checkAnnotations": "jsdoc3", + "checkParamNames": true, + "checkRedundantAccess": true, + "checkRedundantParams": true, + "checkRedundantReturns": true, + "checkReturnTypes": true, + "checkTypes": "strictNativeCase", + "enforceExistence": true, + "requireHyphenBeforeDescription": true, + "requireNewlineAfterDescription": true, + "requireParamTypes": true, + "requireParamDescription": true, + "requireReturnTypes": true + }, + "requireCurlyBraces": [ + "if", + "else", + "for", + "while", + "do", + "try", + "catch" + ], + "requireSpaceAfterKeywords": [ + "if", + "else", + "for", + "while", + "do", + "switch", + "return", + "try", + "catch" + ], + "requireSpaceBeforeBlockStatements": true, + "requireParenthesesAroundIIFE": true, + "requireSpacesInConditionalExpression": true, + "requireSpacesInFunctionExpression": { + "beforeOpeningCurlyBrace": true + }, + "requireSpacesInAnonymousFunctionExpression": { + "beforeOpeningRoundBrace": true, + "beforeOpeningCurlyBrace": true + }, + "requireSpacesInNamedFunctionExpression": { + "beforeOpeningRoundBrace": true, + "beforeOpeningCurlyBrace": true + }, + "requireBlocksOnNewline": true, + "disallowEmptyBlocks": true, + "disallowSpacesInsideObjectBrackets": true, + "disallowSpacesInsideArrayBrackets": true, + "disallowSpacesInsideParentheses": true, + "requireSpacesInsideObjectBrackets": "all", + "disallowDanglingUnderscores": true, + "disallowSpaceAfterObjectKeys": true, + "requireCommaBeforeLineBreak": true, + "requireOperatorBeforeLineBreak": [ + "?", + "+", + "-", + "/", + "*", + "=", + "==", + "===", + "!=", + "!==", + ">", + ">=", + "<", + "<=" + ], + "requireSpaceBeforeBinaryOperators": [ + "+", + "-", + "/", + "*", + "=", + "==", + "===", + "!=", + "!==" + ], + "requireSpaceAfterBinaryOperators": [ + "+", + "-", + "/", + "*", + "=", + "==", + "===", + "!=", + "!==" + ], + "disallowSpaceAfterPrefixUnaryOperators": [ + "++", + "--", + "+", + "-", + "~", + "!" + ], + "disallowSpaceBeforePostfixUnaryOperators": [ + "++", + "--" + ], + "disallowImplicitTypeConversion": [ + "numeric", + "boolean", + "binary", + "string" + ], + "requireCamelCaseOrUpperCaseIdentifiers": true, + "disallowKeywords": [ + "with" + ], + "disallowMultipleLineStrings": true, + "disallowMultipleLineBreaks": true, + "validateLineBreaks": "LF", + "validateQuoteMarks": "'", + "disallowMixedSpacesAndTabs": true, + "disallowTrailingWhitespace": true, + "disallowTrailingComma": true, + "disallowKeywordsOnNewLine": [ + "else" + ], + "requireLineFeedAtFileEnd": true, + "requireCapitalizedConstructors": true, + "safeContextKeyword": "self", + "requireDotNotation": true, + "disallowYodaConditions": true +} diff --git a/.mdastignore b/.mdastignore new file mode 100644 index 0000000..68ffb32 --- /dev/null +++ b/.mdastignore @@ -0,0 +1 @@ +components/ diff --git a/.mdastrc b/.mdastrc new file mode 100644 index 0000000..c5ec5af --- /dev/null +++ b/.mdastrc @@ -0,0 +1,13 @@ +{ + "output": true, + "plugins": [ + "lint", + "github", + "comment-config", + "slug", + "validate-links" + ], + "settings": { + "bullet": "*" + } +} diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..8d45900 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +script: npm run-script test-travis +node_js: +- '0.10' +- '0.11' +- '0.12' +- iojs +sudo: false +after_script: npm install codecov.io && cat ./coverage/lcov.info | codecov diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f3722d9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/alex.js b/alex.js new file mode 100644 index 0000000..bcd5af2 --- /dev/null +++ b/alex.js @@ -0,0 +1,15055 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.alex = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o} nodes - NLCST nodes. + * @param {File} file - Virtual file. + * @param {number} offset - Starting offset for `nodes`. + * @return {Array.} - `nodes`. + */ +function patch(nodes, file, offset) { + var length = nodes.length; + var index = -1; + var start = offset; + var children; + var node; + var end; + + while (++index < length) { + node = nodes[index]; + children = node.children; + + if (children) { + patch(children, file, start); + } + + end = start + toString(node).length; + + node.position = location(start, end, file); + + start = end; + } + + return nodes; +} + +/* + * Transformers. + */ + +var all; +var one; + +/** + * Convert all nodes in `parent` (mdast) into NLCST. + * + * @param {MDASTNode} parent - Parent node. + * @param {File} file - Virtual file. + * @param {Parser} parser - NLCST parser. + * @return {Array.} - Concatenation of calling + * `one` on each MDASTNode in `parent`. + */ +all = function (parent, file, parser) { + var children = parent.children; + var length = children && children.length; + var index = -1; + var result = []; + var child; + + while (++index < length) { + child = one(children[index], index, parent, file, parser); + + if (child) { + result = result.concat(child); + } + } + + return result; +}; + +/** + * Convert `node` into NLCST. + * + * @param {MDASTNode} node - Node. + * @param {number} index - Position of `node` in `parent`. + * @param {MDASTNode} parent - Parent node of `node`. + * @param {File} file - Virtual file. + * @param {Parser} parser - NLCST parser. + * @return {Array.?} - A list of NLCST nodes, if + * `node` could be converted. + */ +one = function (node, index, parent, file, parser) { + var type = node.type; + var siblings = parent && parent.children; + var prev = siblings && siblings[index - 1]; + var pos = node.position; + var start = pos.start; + var end = pos.end; + var final = prev && prev.position.end.offset; + var replacement; + var result; + var space; + + space = final && file.toString().slice(final, start.offset); + + if (type in IGNORE) { + return null; + } + + if (node.children) { + replacement = all(node, file, parser); + } else if ( + type === 'image' || + type === 'imageReference' + ) { + replacement = patch(parser.tokenize( + node.alt + ), file, start.offset + 2); + } else if ( + type === 'text' || + type === 'escape' + ) { + replacement = patch(parser.tokenize(node.value), file, start.offset); + } else if (node.type === 'break') { + replacement = patch([ + parser.tokenizeWhiteSpace('\n') + ], file, start.offset); + } else if (node.type === 'inlineCode') { + replacement = patch([parser.tokenizeSource( + file.toString().slice(start.offset, end.offset) + )], file, start.offset); + } + + /** + * There’s a difference between block-nodes with + * lines between them. NLCST parsers need them to + * differentiate between paragraphs. + */ + + if (replacement && space && !NON_NEWLINE.test(space)) { + result = parser.tokenizeWhiteSpace(space); + + patch([result], file, final); + + replacement.unshift(result); + } + + return replacement || null; +}; + +/** + * Transform `ast` into `nlcst`. + * + * @param {File} file - Virtual file. + * @param {Function?} [Parser] - Constructor of an nlcst + * parser. Defaults to `ParseLatin`. + * @return {NLCSTNode} - NLCST. + */ +function toNLCST(file, Parser) { + var ast; + var parser; + var cst; + + /* + * Warn for invalid parameters. + */ + + if (!file || !file.messages) { + throw new Error('mdast-util-to-nlcst expected file'); + } + + ast = file.namespace('mdast').ast; + + if (!ast || !ast.type) { + throw new Error('mdast-util-to-nlcst expected node'); + } + + if ( + !ast.position || + !ast.position.start || + !ast.position.start.column || + !ast.position.start.line + ) { + throw new Error('mdast-util-to-nlcst expected position on nodes'); + } + + /* + * Construct parser. + */ + + if (!Parser) { + Parser = Latin; + } + + if ('parse' in Parser) { + parser = Parser; + parser.position = true; + } else { + parser = new Parser({ + 'position': true + }); + } + + /* + * Patch ranges. + */ + + range()(ast, file); + + /* + * Transform mdast into NLCST tokens, and pass these + * into `parser.parse` to insert sentences, paragraphs + * where needed. + */ + + cst = parser.parse(one(ast, null, null, file, parser)); + + file.namespace('retext').cst = cst; + + return cst; +} + +/* + * Expose. + */ + +module.exports = toNLCST; + +},{"mdast-range":4,"nlcst-to-string":29,"parse-latin":31}],4:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var visit = require('mdast-util-visit'); + +/** + * Calculate offsets for `lines`. + * + * @param {Array.} lines + * @return {Array.} + */ +function toOffsets(lines) { + var total = 0; + var index = -1; + var length = lines.length; + var result = []; + + while (++index < length) { + result[index] = total += lines[index].length + 1; + } + + return result; +} + +/** + * Add an offset based on `offsets` to `position`. + * + * @param {Object} position + */ +function addRange(position, fn) { + position.offset = fn(position); +} + +/** + * Factory to reverse an offset into a line--column + * tuple. + * + * @param {Array.} offsets - Offsets, as returned + * by `toOffsets()`. + * @return {Function} - Bound method. + */ +function positionToOffsetFactory(offsets) { + /** + * Calculate offsets for `lines`. + * + * @param {Object} position - Position. + * @return {Object} - Object with `line` and `colymn` + * properties based on the bound `offsets`. + */ + function positionToOffset(position) { + var line = position && position.line; + var column = position && position.column; + + if (!isNaN(line) && !isNaN(column)) { + return ((offsets[line - 2] || 0) + column - 1) || 0; + } + + return -1; + } + + return positionToOffset; +} + +/** + * Factory to reverse an offset into a line--column + * tuple. + * + * @param {Array.} offsets - Offsets, as returned + * by `toOffsets()`. + * @return {Function} - Bound method. + */ +function offsetToPositionFactory(offsets) { + /** + * Calculate offsets for `lines`. + * + * @param {number} offset - Offset. + * @return {Object} - Object with `line` and `colymn` + * properties based on the bound `offsets`. + */ + function offsetToPosition(offset) { + var index = -1; + var length = offsets.length; + + if (offset < 0) { + return {}; + } + + while (++index < length) { + if (offsets[index] > offset) { + return { + 'line': index + 1, + 'column': (offset - (offsets[index - 1] || 0)) + 1 + }; + } + } + + return {}; + } + + return offsetToPosition; +} + +/** + * Add ranges for `doc` to `ast`. + * + * @param {Node} ast + * @param {File} file + */ +function transformer(ast, file) { + var contents = String(file).split('\n'); + var positionToOffset; + + /* + * Invalid. + */ + + if (!file || typeof file.contents !== 'string') { + throw new Error('Missing `file` for mdast-range'); + } + + /* + * Construct. + */ + + contents = toOffsets(contents); + positionToOffset = positionToOffsetFactory(contents); + + /* + * Expose methods. + */ + + file.offsetToPosition = offsetToPositionFactory(contents); + file.positionToOffset = positionToOffset; + + /* + * Add `offset` on both `start` and `end`. + */ + + visit(ast, function (node) { + var position = node.position; + + if (position && position.start) { + addRange(position.start, positionToOffset); + } + + if (position && position.end) { + addRange(position.end, positionToOffset); + } + }); +} + +/** + * Attacher. + * + * @return {Function} - `transformer`. + */ +function attacher() { + return transformer; +} + +/* + * Expose. + */ + +module.exports = attacher; + +},{"mdast-util-visit":5}],5:[function(require,module,exports){ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer. All rights reserved. + * @module mdast-util-visit + * @fileoverview Utility to recursively walk over mdast nodes. + */ + +'use strict'; + +/** + * Walk forwards. + * + * @param {Array.<*>} values - Things to iterate over, + * forwards. + * @param {function(*, number): boolean} callback - Function + * to invoke. + * @return {boolean} - False if iteration stopped. + */ +function forwards(values, callback) { + var index = -1; + var length = values.length; + + while (++index < length) { + if (callback(values[index], index) === false) { + return false; + } + } + + return true; +} + +/** + * Walk backwards. + * + * @param {Array.<*>} values - Things to iterate over, + * backwards. + * @param {function(*, number): boolean} callback - Function + * to invoke. + * @return {boolean} - False if iteration stopped. + */ +function backwards(values, callback) { + var index = values.length; + var length = -1; + + while (--index > length) { + if (callback(values[index], index) === false) { + return false; + } + } + + return true; +} + +/** + * Visit. + * + * @param {Node} tree - Root node + * @param {string} [type] - Node type. + * @param {function(node): boolean?} callback - Invoked + * with each found node. Can return `false` to stop. + * @param {boolean} [reverse] - By default, `visit` will + * walk forwards, when `reverse` is `true`, `visit` + * walks backwards. + */ +function visit(tree, type, callback, reverse) { + var iterate; + var one; + var all; + + if (typeof type === 'function') { + reverse = callback; + callback = type; + type = null; + } + + iterate = reverse ? backwards : forwards; + + /** + * Visit `children` in `parent`. + */ + all = function (children, parent) { + return iterate(children, function (child, index) { + return child && one(child, index, parent); + }); + }; + + /** + * Visit a single node. + */ + one = function (node, index, parent) { + var result; + + index = index || (parent ? 0 : null); + + if (!type || node.type === type) { + result = callback(node, index, parent || null); + } + + if (node.children && result !== false) { + return all(node.children, node); + } + + return result; + }; + + one(tree); +} + +/* + * Expose. + */ + +module.exports = visit; + +},{}],6:[function(require,module,exports){ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module mdast + * @fileoverview Markdown processor powered by plugins. + */ + +'use strict'; + +/* + * Dependencies. + */ + +var unified = require('unified'); +var Parser = require('./lib/parse.js'); +var Compiler = require('./lib/stringify.js'); + +/* + * Exports. + */ + +module.exports = unified({ + 'name': 'mdast', + 'type': 'ast', + 'Parser': Parser, + 'Compiler': Compiler +}); + +},{"./lib/parse.js":9,"./lib/stringify.js":10,"unified":21}],7:[function(require,module,exports){ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module mdast:defaults + * @fileoverview Default values for parse and + * stringification settings. + */ + +'use strict'; + +/* + * Note that `stringify.entities` is a string. + */ + +module.exports = { + 'parse': { + 'position': true, + 'gfm': true, + 'yaml': true, + 'commonmark': false, + 'footnotes': false, + 'pedantic': false, + 'breaks': false + }, + 'stringify': { + 'entities': 'false', + 'setext': false, + 'closeAtx': false, + 'looseTable': false, + 'spacedTable': true, + 'incrementListMarker': true, + 'fences': false, + 'fence': '`', + 'bullet': '-', + 'listItemIndent': 'tab', + 'rule': '*', + 'ruleSpaces': true, + 'ruleRepetition': 3, + 'strong': '*', + 'emphasis': '_' + } +}; + +},{}],8:[function(require,module,exports){ +/* This file is generated by `script/build-expressions.js` */ +module.exports = { + 'rules': { + 'newline': /^\n([ \t]*\n)*/, + 'code': /^((?: {4}|\t)[^\n]*\n?([ \t]*\n)*)+/, + 'horizontalRule': /^[ \t]*([-*_])( *\1){2,} *(?=\n|$)/, + 'heading': /^([ \t]*)(#{1,6})(?:([ \t]+)([^\n]+?))??(?:[ \t]+#+)?[ \t]*(?=\n|$)/, + 'lineHeading': /^(\ {0,3})([^\n]+?)[ \t]*\n\ {0,3}(=|-){1,}[ \t]*(?=\n|$)/, + 'definition': /^[ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$)/, + 'bullet': /(?:[*+-]|\d+\.)/, + 'indent': /^([ \t]*)((?:[*+-]|\d+\.))( {1,4}(?! )| |\t)/, + 'item': /([ \t]*)((?:[*+-]|\d+\.))( {1,4}(?! )| |\t)[^\n]*(?:\n(?!\1(?:[*+-]|\d+\.)[ \t])[^\n]*)*/gm, + 'list': /^([ \t]*)((?:[*+-]|\d+\.))[ \t][\s\S]+?(?:(?=\n+\1?(?:[-*_][ \t]*){3,}(?:\n|$))|(?=\n+[ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$))|\n{2,}(?![ \t])(?!\1(?:[*+-]|\d+\.)[ \t])|$)/, + 'blockquote': /^(?=[ \t]*>)(?:(?:(?:[ \t]*>[^\n]*\n)*(?:[ \t]*>[^\n]+(?=\n|$))|(?![ \t]*>)(?![ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$))[^\n]+)(?:\n|$))*(?:[ \t]*>[ \t]*(?:\n[ \t]*>[ \t]*)*)?/, + 'html': /^(?:[ \t]*(?:(?:(?:<(?:article|header|aside|hgroup|blockquote|hr|iframe|body|li|map|button|object|canvas|ol|caption|output|col|p|colgroup|pre|dd|progress|div|section|dl|table|td|dt|tbody|embed|textarea|fieldset|tfoot|figcaption|th|figure|thead|footer|tr|form|ul|h1|h2|h3|h4|h5|h6|video|script|style)(?:(?:\s+)(?:[a-zA-Z_:][a-zA-Z0-9_.:-]*)(?:(?:\s+)?=(?:\s+)?(?:[^"'=<>`]+|'[^']*'|"[^"]*"))?)*(?:\s+)?\/?>?)|(?:<\/(?:article|header|aside|hgroup|blockquote|hr|iframe|body|li|map|button|object|canvas|ol|caption|output|col|p|colgroup|pre|dd|progress|div|section|dl|table|td|dt|tbody|embed|textarea|fieldset|tfoot|figcaption|th|figure|thead|footer|tr|form|ul|h1|h2|h3|h4|h5|h6|video|script|style)(?:\s+)?>))||(?:<\?(?:[^\?]|\?(?!>))+\?>)|(?:)|(?:))[\s\S]*?[ \t]*?(?:\n{2,}|\s*$))/i, + 'paragraph': /^(?:(?:[^\n]+\n?(?![ \t]*([-*_])( *\1){2,} *(?=\n|$)|([ \t]*)(#{1,6})(?:([ \t]+)([^\n]+?))??(?:[ \t]+#+)?[ \t]*(?=\n|$)|(\ {0,3})([^\n]+?)[ \t]*\n\ {0,3}(=|-){1,}[ \t]*(?=\n|$)|[ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$)|(?=[ \t]*>)(?:(?:(?:[ \t]*>[^\n]*\n)*(?:[ \t]*>[^\n]+(?=\n|$))|(?![ \t]*>)(?![ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$))[^\n]+)(?:\n|$))*(?:[ \t]*>[ \t]*(?:\n[ \t]*>[ \t]*)*)?|<(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\b)(?!mailto:)\w+(?!:\/|[^\w\s@]*@)\b))+)/, + 'escape': /^\\([\\`*{}\[\]()#+\-.!_>])/, + 'autoLink': /^<([^ >]+(@|:\/)[^ >]+)>/, + 'tag': /^(?:(?:<(?:[a-zA-Z][a-zA-Z0-9]*)(?:(?:\s+)(?:[a-zA-Z_:][a-zA-Z0-9_.:-]*)(?:(?:\s+)?=(?:\s+)?(?:[^"'=<>`]+|'[^']*'|"[^"]*"))?)*(?:\s+)?\/?>)|(?:<\/(?:[a-zA-Z][a-zA-Z0-9]*)(?:\s+)?>)||(?:<\?(?:[^\?]|\?(?!>))+\?>)|(?:)|(?:))/, + 'strong': /^(_)_((?:\\[\s\S]|[^\\])+?)__(?!_)|^(\*)\*((?:\\[\s\S]|[^\\])+?)\*\*(?!\*)/, + 'emphasis': /^\b(_)((?:__|\\[\s\S]|[^\\])+?)_\b|^(\*)((?:\*\*|\\[\s\S]|[^\\])+?)\*(?!\*)/, + 'inlineCode': /^(`+)((?!`)[\s\S]*?(?:`\s+|[^`]))?(\1)(?!`)/, + 'break': /^ {2,}\n(?!\s*$)/, + 'inlineText': /^[\s\S]+?(?=[\\)(?:\s+['"]([\s\S]*?)['"])?\s*\)/, + 'shortcutReference': /^(!?\[)((?:\\[\s\S]|[^\[\]])+?)\]/, + 'reference': /^(!?\[)((?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*)\]\s*\[((?:\\[\s\S]|[^\[\]])*)\]/ + }, + 'gfm': { + 'fences': /^( *)(([`~])\3{2,})[ \t]*([^\n`~]+)?[ \t]*(?:\n([\s\S]*?))??(?:\n\ {0,3}\2\3*[ \t]*(?=\n|$)|$)/, + 'paragraph': /^(?:(?:[^\n]+\n?(?![ \t]*([-*_])( *\1){2,} *(?=\n|$)|( *)(([`~])\5{2,})[ \t]*([^\n`~]+)?[ \t]*(?:\n([\s\S]*?))??(?:\n\ {0,3}\4\5*[ \t]*(?=\n|$)|$)|([ \t]*)((?:[*+-]|\d+\.))[ \t][\s\S]+?(?:(?=\n+\8?(?:[-*_][ \t]*){3,}(?:\n|$))|(?=\n+[ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$))|\n{2,}(?![ \t])(?!\8(?:[*+-]|\d+\.)[ \t])|$)|([ \t]*)(#{1,6})(?:([ \t]+)([^\n]+?))??(?:[ \t]+#+)?[ \t]*(?=\n|$)|(\ {0,3})([^\n]+?)[ \t]*\n\ {0,3}(=|-){1,}[ \t]*(?=\n|$)|[ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$)|(?=[ \t]*>)(?:(?:(?:[ \t]*>[^\n]*\n)*(?:[ \t]*>[^\n]+(?=\n|$))|(?![ \t]*>)(?![ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$))[^\n]+)(?:\n|$))*(?:[ \t]*>[ \t]*(?:\n[ \t]*>[ \t]*)*)?|<(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\b)(?!mailto:)\w+(?!:\/|[^\w\s@]*@)\b))+)/, + 'table': /^( *\|(.+))\n( *\|( *[-:]+[-| :]*)\n)((?: *\|.*(?:\n|$))*)/, + 'looseTable': /^( *(\S.*\|.*))\n( *([-:]+ *\|[-| :]*)\n)((?:.*\|.*(?:\n|$))*)/, + 'escape': /^\\([\\`*{}\[\]()#+\-.!_>~|])/, + 'url': /^https?:\/\/[^\s<]+[^<.,:;"')\]\s]/, + 'deletion': /^~~(?=\S)([\s\S]*?\S)~~/, + 'inlineText': /^[\s\S]+?(?=[\\\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$))|\n{2,}(?![ \t])(?!\1(?:[*+-]|\d+[\.\)])[ \t])|$)/, + 'item': /([ \t]*)((?:[*+-]|\d+[\.\)]))( {1,4}(?! )| |\t)[^\n]*(?:\n(?!\1(?:[*+-]|\d+[\.\)])[ \t])[^\n]*)*/gm, + 'bullet': /(?:[*+-]|\d+[\.\)])/, + 'indent': /^([ \t]*)((?:[*+-]|\d+[\.\)]))( {1,4}(?! )| |\t)/, + 'html': /^(?:[ \t]*(?:(?:(?:<(?:article|header|aside|hgroup|blockquote|hr|iframe|body|li|map|button|object|canvas|ol|caption|output|col|p|colgroup|pre|dd|progress|div|section|dl|table|td|dt|tbody|embed|textarea|fieldset|tfoot|figcaption|th|figure|thead|footer|tr|form|ul|h1|h2|h3|h4|h5|h6|video|script|style)(?:(?:\s+)(?:[a-zA-Z_:][a-zA-Z0-9_.:-]*)(?:(?:\s+)?=(?:\s+)?(?:[^"'=<>`]+|'[^']*'|"[^"]*"))?)*(?:\s+)?\/?>?)|(?:<\/(?:article|header|aside|hgroup|blockquote|hr|iframe|body|li|map|button|object|canvas|ol|caption|output|col|p|colgroup|pre|dd|progress|div|section|dl|table|td|dt|tbody|embed|textarea|fieldset|tfoot|figcaption|th|figure|thead|footer|tr|form|ul|h1|h2|h3|h4|h5|h6|video|script|style)(?:\s+)?>))|(?:)|(?:<\?(?:[^\?]|\?(?!>))+\?>)|(?:)|(?:))[\s\S]*?[ \t]*?(?:\n{2,}|\s*$))/i, + 'tag': /^(?:(?:<(?:[a-zA-Z][a-zA-Z0-9]*)(?:(?:\s+)(?:[a-zA-Z_:][a-zA-Z0-9_.:-]*)(?:(?:\s+)?=(?:\s+)?(?:[^"'=<>`]+|'[^']*'|"[^"]*"))?)*(?:\s+)?\/?>)|(?:<\/(?:[a-zA-Z][a-zA-Z0-9]*)(?:\s+)?>)|(?:)|(?:<\?(?:[^\?]|\?(?!>))+\?>)|(?:)|(?:))/, + 'link': /^(!?\[)((?:(?:\[(?:\[(?:\\[\s\S]|[^\[\]])*?\]|\\[\s\S]|[^\[\]])*?\])|\\[\s\S]|[^\[\]])*?)\]\(\s*(?:(?!<)((?:\((?:\\[\s\S]|[^\(\)\s])*?\)|\\[\s\S]|[^\(\)\s])*?)|<([^\n]*?)>)(?:\s+(?:\'((?:\\[\s\S]|[^\'])*?)\'|"((?:\\[\s\S]|[^"])*?)"|\(((?:\\[\s\S]|[^\)])*?)\)))?\s*\)/, + 'reference': /^(!?\[)((?:(?:\[(?:\[(?:\\[\s\S]|[^\[\]])*?\]|\\[\s\S]|[^\[\]])*?\])|\\[\s\S]|[^\[\]])*?)\]\s*\[((?:\\[\s\S]|[^\[\]])*)\]/, + 'paragraph': /^(?:(?:[^\n]+\n?(?!\ {0,3}([-*_])( *\1){2,} *(?=\n|$)|(\ {0,3})(#{1,6})(?:([ \t]+)([^\n]+?))??(?:[ \t]+#+)?\ {0,3}(?=\n|$)|(?=\ {0,3}>)(?:(?:(?:\ {0,3}>[^\n]*\n)*(?:\ {0,3}>[^\n]+(?=\n|$))|(?!\ {0,3}>)(?!\ {0,3}\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?\ {0,3}(?=\n|$))[^\n]+)(?:\n|$))*(?:\ {0,3}>\ {0,3}(?:\n\ {0,3}>\ {0,3})*)?|<(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\b)(?!mailto:)\w+(?!:\/|[^\w\s@]*@)\b))+)/, + 'blockquote': /^(?=[ \t]*>)(?:(?:(?:[ \t]*>[^\n]*\n)*(?:[ \t]*>[^\n]+(?=\n|$))|(?![ \t]*>)(?![ \t]*([-*_])( *\1){2,} *(?=\n|$)|([ \t]*)((?:[*+-]|\d+\.))[ \t][\s\S]+?(?:(?=\n+\3?(?:[-*_][ \t]*){3,}(?:\n|$))|(?=\n+[ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$))|\n{2,}(?![ \t])(?!\3(?:[*+-]|\d+\.)[ \t])|$)|( *)(([`~])\10{2,})[ \t]*([^\n`~]+)?[ \t]*(?:\n([\s\S]*?))??(?:\n\ {0,3}\9\10*[ \t]*(?=\n|$)|$)|((?: {4}|\t)[^\n]*\n?([ \t]*\n)*)+|[ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$))[^\n]+)(?:\n|$))*(?:[ \t]*>[ \t]*(?:\n[ \t]*>[ \t]*)*)?/, + 'escape': /^\\(\n|[\\`*{}\[\]()#+\-.!_>"$%&',\/:;<=?@^~|])/ + }, + 'commonmarkGFM': { + 'paragraph': /^(?:(?:[^\n]+\n?(?!\ {0,3}([-*_])( *\1){2,} *(?=\n|$)|( *)(([`~])\5{2,})\ {0,3}([^\n`~]+)?\ {0,3}(?:\n([\s\S]*?))??(?:\n\ {0,3}\4\5*\ {0,3}(?=\n|$)|$)|(\ {0,3})((?:[*+-]|\d+\.))[ \t][\s\S]+?(?:(?=\n+\8?(?:[-*_]\ {0,3}){3,}(?:\n|$))|(?=\n+\ {0,3}\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?\ {0,3}(?=\n|$))|\n{2,}(?![ \t])(?!\8(?:[*+-]|\d+\.)[ \t])|$)|(\ {0,3})(#{1,6})(?:([ \t]+)([^\n]+?))??(?:[ \t]+#+)?\ {0,3}(?=\n|$)|(?=\ {0,3}>)(?:(?:(?:\ {0,3}>[^\n]*\n)*(?:\ {0,3}>[^\n]+(?=\n|$))|(?!\ {0,3}>)(?!\ {0,3}\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?\ {0,3}(?=\n|$))[^\n]+)(?:\n|$))*(?:\ {0,3}>\ {0,3}(?:\n\ {0,3}>\ {0,3})*)?|<(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\b)(?!mailto:)\w+(?!:\/|[^\w\s@]*@)\b))+)/ + }, + 'breaks': { + 'break': /^ *\n(?!\s*$)/, + 'inlineText': /^[\s\S]+?(?=[\\'; +var BRACKET_OPEN = '['; + +/* + * Types. + */ + +var BLOCK = 'block'; +var INLINE = 'inline'; +var HORIZONTAL_RULE = 'horizontalRule'; +var HTML = 'html'; +var YAML = 'yaml'; +var TABLE = 'table'; +var TABLE_CELL = 'tableCell'; +var TABLE_HEADER = 'tableHeader'; +var TABLE_ROW = 'tableRow'; +var PARAGRAPH = 'paragraph'; +var TEXT = 'text'; +var CODE = 'code'; +var LIST = 'list'; +var LIST_ITEM = 'listItem'; +var FOOTNOTE_DEFINITION = 'footnoteDefinition'; +var HEADING = 'heading'; +var BLOCKQUOTE = 'blockquote'; +var LINK = 'link'; +var IMAGE = 'image'; +var FOOTNOTE = 'footnote'; +var ESCAPE = 'escape'; +var STRONG = 'strong'; +var EMPHASIS = 'emphasis'; +var DELETE = 'delete'; +var INLINE_CODE = 'inlineCode'; +var BREAK = 'break'; +var ROOT = 'root'; + +/** + * Wrapper around he's `decode` function. + * + * @example + * decode('&'); // '&' + * decode('&'); // '&' + * + * @param {string} value + * @param {function(string)} eat + * @return {string} + * @throws {Error} - When `eat.file.quiet` is not `true`. + * However, by default `he` does not throw on incorrect + * encoded entities, but when + * `he.decode.options.strict: true`, they occur on + * entities with a missing closing semi-colon. + */ +function decode(value, eat) { + try { + return he.decode(value); + } catch (exception) { + eat.file.fail(exception, eat.now()); + } +} + +/** + * Factory to de-escape a value, based on an expression + * at `key` in `scope`. + * + * @example + * var expressions = {escape: /\\(a)/} + * var descape = descapeFactory(expressions, 'escape'); + * + * @param {Object} scope - Map of expressions. + * @param {string} key - Key in `map` at which the + * non-global expression exists. + * @return {function(string): string} - Function which + * takes a value and returns its unescaped version. + */ +function descapeFactory(scope, key) { + var globalExpression; + var expression; + + /** + * Private method to get a global expression + * from the expression at `key` in `scope`. + * This method is smart about not recreating + * the expressions every time. + * + * @private + * @return {RegExp} + */ + function generate() { + if (scope[key] !== globalExpression) { + globalExpression = scope[key]; + expression = new RegExp( + scope[key].source.replace(CARET, EMPTY), 'g' + ); + } + + return expression; + } + + /** + * De-escape a string using the expression at `key` + * in `scope`. + * + * @example + * var expressions = {escape: /\\(a)/} + * var descape = descapeFactory(expressions, 'escape'); + * descape('\a'); // 'a' + * + * @param {string} value - Escaped string. + * @return {string} - Unescaped string. + */ + function descape(value) { + return value.replace(generate(), '$1'); + } + + return descape; +} + +/* + * Tab size. + */ + +var TAB_SIZE = 4; + +/* + * Expressions. + */ + +var EXPRESSION_RIGHT_ALIGNMENT = /^[ \t]*-+:[ \t]*$/; +var EXPRESSION_CENTER_ALIGNMENT = /^[ \t]*:-+:[ \t]*$/; +var EXPRESSION_LEFT_ALIGNMENT = /^[ \t]*:-+[ \t]*$/; +var EXPRESSION_TABLE_FENCE = /^[ \t]*|\|[ \t]*$/g; +var EXPRESSION_TABLE_INITIAL = /^[ \t]*\|/g; +var EXPRESSION_TABLE_CONTENT = + /[ \t]*?((?:\\[\s\S]|[^\|])+?)([ \t]?\|[ \t]?\n?|\n?$)/g; +var EXPRESSION_TABLE_BORDER = /[ \t]*\|[ \t]*/; +var EXPRESSION_BLOCK_QUOTE = /^[ \t]*>[ \t]?/gm; +var EXPRESSION_BULLET = /^([ \t]*)([*+-]|\d+[.)])( {1,4}(?! )| |\t)([^\n]*)/; +var EXPRESSION_PEDANTIC_BULLET = /^([ \t]*)([*+-]|\d+[.)])([ \t]+)/; +var EXPRESSION_INITIAL_INDENT = /^( {1,4}|\t)?/gm; +var EXPRESSION_INITIAL_TAB = /^( {4}|\t)?/gm; +var EXPRESSION_HTML_LINK_OPEN = /^/i; +var EXPRESSION_LOOSE_LIST_ITEM = /\n\n(?!\s*$)/; +var EXPRESSION_TASK_ITEM = /^\[([\ \t]|x|X)\][\ \t]/; + +/* + * A map of characters, and their column length, + * which can be used as indentation. + */ + +var INDENTATION_CHARACTERS = {}; + +INDENTATION_CHARACTERS[SPACE] = SPACE.length; +INDENTATION_CHARACTERS[TAB] = TAB_SIZE; + +/** + * Gets indentation information for a line. + * + * @example + * getIndent(' foo'); + * // {indent: 2, stops: {1: 0, 2: 1}} + * + * getIndent('\tfoo'); + * // {indent: 4, stops: {4: 0}} + * + * getIndent(' \tfoo'); + * // {indent: 4, stops: {1: 0, 2: 1, 4: 2}} + * + * getIndent('\t foo') + * // {indent: 6, stops: {4: 0, 5: 1, 6: 2}} + * + * @param {string} value - Indented line. + * @return {Object} + */ +function getIndent(value) { + var index = 0; + var indent = 0; + var character = value.charAt(index); + var stops = {}; + var size; + + while (character in INDENTATION_CHARACTERS) { + size = INDENTATION_CHARACTERS[character]; + + indent += size; + + if (size > 1) { + indent = Math.floor(indent / size) * size; + } + + stops[indent] = index; + + character = value.charAt(++index); + } + + return { + 'indent': indent, + 'stops': stops + }; +} + +/** + * Remove the minimum indent from every line in `value`. + * Supports both tab, spaced, and mixed indentation (as + * well as possible). + * + * @example + * removeIndentation(' foo'); // 'foo' + * removeIndentation(' foo', 2); // ' foo' + * removeIndentation('\tfoo', 2); // ' foo' + * removeIndentation(' foo\n bar'); // ' foo\n bar' + * + * @param {string} value + * @param {number?} [maximum] - Maximum indentation + * to remove. + * @return {string} - Unindented `value`. + */ +function removeIndentation(value, maximum) { + var values = value.split(NEW_LINE); + var position = values.length + 1; + var minIndent = Infinity; + var matrix = []; + var index; + var indentation; + var stops; + var padding; + + values.unshift(repeat(SPACE, maximum) + EXCLAMATION_MARK); + + while (position--) { + indentation = getIndent(values[position]); + + matrix[position] = indentation.stops; + + if (trim(values[position]).length === 0) { + continue; + } + + if (indentation.indent) { + if (indentation.indent > 0 && indentation.indent < minIndent) { + minIndent = indentation.indent; + } + } else { + minIndent = Infinity; + + break; + } + } + + if (minIndent !== Infinity) { + position = values.length; + + while (position--) { + stops = matrix[position]; + index = minIndent; + + while (index && !(index in stops)) { + index--; + } + + if ( + trim(values[position]).length !== 0 && + minIndent && + index !== minIndent + ) { + padding = TAB; + } else { + padding = EMPTY; + } + + values[position] = padding + values[position].slice( + index in stops ? stops[index] + 1 : 0 + ); + } + } + + values.shift(); + + return values.join(NEW_LINE); +} + +/** + * Ensure that `value` is at least indented with + * `indent` spaces. Does not support tabs. Does support + * multiple lines. + * + * @example + * ensureIndentation('foo', 2); // ' foo' + * ensureIndentation(' foo', 4); // ' foo' + * + * @param {string} value + * @param {number} indent - The maximum amount of + * spacing to insert. + * @return {string} - indented `value`. + */ +function ensureIndentation(value, indent) { + var values = value.split(NEW_LINE); + var length = values.length; + var index = -1; + var line; + var position; + + while (++index < length) { + line = values[index]; + + position = -1; + + while (++position < indent) { + if (line.charAt(position) !== SPACE) { + values[index] = repeat(SPACE, indent - position) + line; + break; + } + } + } + + return values.join(NEW_LINE); +} + +/** + * Get the alignment from a table rule. + * + * @example + * getAlignment([':-', ':-:', '-:', '--']); + * // ['left', 'center', 'right', null]; + * + * @param {Array.} cells + * @return {Array.} + */ +function getAlignment(cells) { + var results = []; + var index = -1; + var length = cells.length; + var alignment; + + while (++index < length) { + alignment = cells[index]; + + if (EXPRESSION_RIGHT_ALIGNMENT.test(alignment)) { + results[index] = 'right'; + } else if (EXPRESSION_CENTER_ALIGNMENT.test(alignment)) { + results[index] = 'center'; + } else if (EXPRESSION_LEFT_ALIGNMENT.test(alignment)) { + results[index] = 'left'; + } else { + results[index] = null; + } + } + + return results; +} + +/** + * Construct a state `toggler`: a function which inverses + * `property` in context based on its current value. + * The by `toggler` returned function restores that value. + * + * @example + * var context = {}; + * var key = 'foo'; + * var val = true; + * context[key] = val; + * context.enter = stateToggler(key, val); + * context[key]; // true + * var exit = context.enter(); + * context[key]; // false + * var nested = context.enter(); + * context[key]; // false + * nested(); + * context[key]; // false + * exit(); + * context[key]; // true + * + * @param {string} key - Property to toggle. + * @param {boolean} state - It's default state. + * @return {function(): function()} - Enter. + */ +function stateToggler(key, state) { + /** + * Construct a toggler for the bound `key`. + * + * @return {Function} - Exit state. + */ + function enter() { + var self = this; + var current = self[key]; + + self[key] = !state; + + /** + * State canceler, cancels the state, if allowed. + */ + function exit() { + self[key] = current; + } + + return exit; + } + + return enter; +} + +/** + * Construct a state toggler which doesn't toggle. + * + * @example + * var context = {}; + * var key = 'foo'; + * var val = true; + * context[key] = val; + * context.enter = noopToggler(); + * context[key]; // true + * var exit = context.enter(); + * context[key]; // true + * exit(); + * context[key]; // true + * + * @return {function(): function()} - Enter. + */ +function noopToggler() { + /** + * No-operation. + */ + function exit() {} + + /** + * @return {Function} + */ + function enter() { + return exit; + } + + return enter; +} + +/* + * Define nodes of a type which can be merged. + */ + +var MERGEABLE_NODES = {}; + +/** + * Merge two text nodes: `node` into `prev`. + * + * @param {Object} prev - Preceding sibling. + * @param {Object} node - Following sibling. + * @return {Object} - `prev`. + */ +MERGEABLE_NODES.text = function (prev, node) { + prev.value += node.value; + + return prev; +}; + +/** + * Merge two blockquotes: `node` into `prev`, unless in + * CommonMark mode. + * + * @param {Object} prev - Preceding sibling. + * @param {Object} node - Following sibling. + * @return {Object} - `prev`, or `node` in CommonMark mode. + */ +MERGEABLE_NODES.blockquote = function (prev, node) { + if (this.options.commonmark) { + return node; + } + + prev.children = prev.children.concat(node.children); + + return prev; +}; + +/** + * Merge two lists: `node` into `prev`. Knows, about + * which bullets were used. + * + * @param {Object} prev - Preceding sibling. + * @param {Object} node - Following sibling. + * @return {Object} - `prev`, or `node` when the lists are + * of different types (a different bullet is used). + */ +MERGEABLE_NODES.list = function (prev, node) { + if ( + !this.currentBullet || + this.currentBullet !== this.previousBullet || + this.currentBullet.length !== 1 + ) { + return node; + } + + prev.children = prev.children.concat(node.children); + + return prev; +}; + +/** + * Tokenise a line. Unsets `currentBullet` and + * `previousBullet` if more than one lines are found, thus + * preventing lists from merging when they use different + * bullets. + * + * @example + * tokenizeNewline(eat, '\n\n'); + * + * @param {function(string)} eat + * @param {string} $0 - Lines. + */ +function tokenizeNewline(eat, $0) { + if ($0.length > 1) { + this.currentBullet = null; + this.previousBullet = null; + } + + eat($0); +} + +/** + * Tokenise an indented code block. + * + * @example + * tokenizeCode(eat, '\tfoo'); + * + * @param {function(string)} eat + * @param {string} $0 - Whole code. + * @return {Node} - `code` node. + */ +function tokenizeCode(eat, $0) { + $0 = trimTrailingLines($0); + + return eat($0)(this.renderCodeBlock( + removeIndentation($0, TAB_SIZE), null, eat) + ); +} + +/** + * Tokenise a fenced code block. + * + * @example + * var $0 = '```js\nfoo()\n```'; + * tokenizeFences(eat, $0, '', '```', '`', 'js', 'foo()\n'); + * + * @param {function(string)} eat + * @param {string} $0 - Whole code. + * @param {string} $1 - Initial spacing. + * @param {string} $2 - Initial fence. + * @param {string} $3 - Fence marker. + * @param {string} $4 - Programming language flag. + * @param {string} $5 - Content. + * @return {Node} - `code` node. + */ +function tokenizeFences(eat, $0, $1, $2, $3, $4, $5) { + $0 = trimTrailingLines($0); + + /* + * If the initial fence was preceded by spaces, + * exdent that amount of white space from the code + * block. Because it's possible that the code block + * is exdented, we first have to ensure at least + * those spaces are available. + */ + + if ($1) { + $5 = removeIndentation(ensureIndentation($5, $1.length), $1.length); + } + + return eat($0)(this.renderCodeBlock($5, $4, eat)); +} + +/** + * Tokenise an ATX-style heading. + * + * @example + * tokenizeHeading(eat, ' # foo', ' ', '#', ' ', 'foo'); + * + * @param {function(string)} eat + * @param {string} $0 - Whole heading. + * @param {string} $1 - Initial spacing. + * @param {string} $2 - Hashes. + * @param {string} $3 - Internal spacing. + * @param {string} $4 - Content. + * @return {Node} - `heading` node. + */ +function tokenizeHeading(eat, $0, $1, $2, $3, $4) { + var now = eat.now(); + + now.column += ($1 + $2 + ($3 || '')).length; + + return eat($0)(this.renderHeading($4, $2.length, now)); +} + +/** + * Tokenise a Setext-style heading. + * + * @example + * tokenizeLineHeading(eat, 'foo\n===', '', 'foo', '='); + * + * @param {function(string)} eat + * @param {string} $0 - Whole heading. + * @param {string} $1 - Initial spacing. + * @param {string} $2 - Content. + * @param {string} $3 - Underline marker. + * @return {Node} - `heading` node. + */ +function tokenizeLineHeading(eat, $0, $1, $2, $3) { + var now = eat.now(); + + now.column += $1.length; + + return eat($0)(this.renderHeading($2, $3 === EQUALS ? 1 : 2, now)); +} + +/** + * Tokenise a horizontal rule. + * + * @example + * tokenizeHorizontalRule(eat, '***'); + * + * @param {function(string)} eat + * @param {string} $0 - Whole rule. + * @return {Node} - `horizontalRule` node. + */ +function tokenizeHorizontalRule(eat, $0) { + return eat($0)(this.renderVoid(HORIZONTAL_RULE)); +} + +/** + * Tokenise a blockquote. + * + * @example + * tokenizeBlockquote(eat, '> Foo'); + * + * @param {function(string)} eat + * @param {string} $0 - Whole blockquote. + * @return {Node} - `blockquote` node. + */ +function tokenizeBlockquote(eat, $0) { + var now = eat.now(); + var indent = this.indent(now.line); + var value = trimTrailingLines($0); + var add = eat(value); + + value = value.replace(EXPRESSION_BLOCK_QUOTE, function (prefix) { + indent(prefix.length); + + return ''; + }); + + return add(this.renderBlockquote(value, now)); +} + +/** + * Tokenise a list. + * + * @example + * tokenizeList(eat, '- Foo', '', '-'); + * + * @param {function(string)} eat + * @param {string} $0 - Whole list. + * @param {string} $1 - Indent. + * @param {string} $2 - Bullet. + * @return {Node} - `list` node. + */ +function tokenizeList(eat, $0, $1, $2) { + var self = this; + var firstBullet = $2; + var value = trimTrailingLines($0); + var matches = value.match(self.rules.item); + var length = matches.length; + var index = 0; + var isLoose = false; + var now; + var bullet; + var item; + var enterTop; + var exitBlockquote; + var node; + var indent; + var size; + var position; + var end; + + /* + * Determine if all list-items belong to the + * same list. + */ + + if (!self.options.pedantic) { + while (++index < length) { + bullet = self.rules.bullet.exec(matches[index])[0]; + + if ( + firstBullet !== bullet && + ( + firstBullet.length === 1 && bullet.length === 1 || + bullet.charAt(bullet.length - 1) !== + firstBullet.charAt(firstBullet.length - 1) + ) + ) { + matches = matches.slice(0, index); + matches[index - 1] = trimTrailingLines(matches[index - 1]); + + length = matches.length; + + break; + } + } + } + + if (self.options.commonmark) { + index = -1; + + while (++index < length) { + item = matches[index]; + indent = self.rules.indent.exec(item); + indent = indent[1] + repeat(SPACE, indent[2].length) + indent[3]; + size = getIndent(indent).indent; + position = indent.length; + end = item.length; + + while (++position < end) { + if ( + item.charAt(position) === NEW_LINE && + item.charAt(position - 1) === NEW_LINE && + getIndent(item.slice(position + 1)).indent < size + ) { + matches[index] = item.slice(0, position - 1); + + matches = matches.slice(0, index + 1); + length = matches.length; + + break; + } + } + } + } + + self.previousBullet = self.currentBullet; + self.currentBullet = firstBullet; + + index = -1; + + node = eat(matches.join(NEW_LINE)).reset( + self.renderList([], firstBullet) + ); + + enterTop = self.exitTop(); + exitBlockquote = self.enterBlockquote(); + + while (++index < length) { + item = matches[index]; + now = eat.now(); + + item = eat(item)(self.renderListItem(item, now), node); + + if (item.loose) { + isLoose = true; + } + + if (index !== length - 1) { + eat(NEW_LINE); + } + } + + node.loose = isLoose; + + enterTop(); + exitBlockquote(); + + return node; +} + +/** + * Tokenise HTML. + * + * @example + * tokenizeHtml(eat, 'foo'); + * + * @param {function(string)} eat + * @param {string} $0 - Whole HTML. + * @return {Node} - `html` node. + */ +function tokenizeHtml(eat, $0) { + $0 = trimTrailingLines($0); + + return eat($0)(this.renderRaw(HTML, $0)); +} + +/** + * Tokenise a definition. + * + * @example + * var $0 = '[foo]: http://example.com "Example Domain"'; + * var $1 = 'foo'; + * var $2 = 'http://example.com'; + * var $3 = 'Example Domain'; + * tokenizeDefinition(eat, $0, $1, $2, $3); + * + * @property {boolean} onlyAtTop + * @property {boolean} notInBlockquote + * @param {function(string)} eat + * @param {string} $0 - Whole definition. + * @param {string} $1 - Key. + * @param {string} $2 - URL. + * @param {string} $3 - Title. + * @return {Node} - `definition` node. + */ +function tokenizeDefinition(eat, $0, $1, $2, $3) { + var link = $2; + + /* + * Remove angle-brackets from `link`. + */ + + if (link.charAt(0) === LT && link.charAt(link.length - 1) === GT) { + link = link.slice(1, -1); + } + + return eat($0)({ + 'type': 'definition', + 'identifier': normalize($1), + 'title': $3 ? decode(this.descape($3), eat) : null, + 'link': decode(this.descape(link), eat) + }); +} + +tokenizeDefinition.onlyAtTop = true; +tokenizeDefinition.notInBlockquote = true; + +/** + * Tokenise YAML front matter. + * + * @example + * var $0 = '---\nfoo: bar\n---'; + * var $1 = 'foo: bar'; + * tokenizeYAMLFrontMatter(eat, $0, $1); + * + * @property {boolean} onlyAtStart + * @param {function(string)} eat + * @param {string} $0 - Whole front matter. + * @param {string} $1 - Content. + * @return {Node} - `yaml` node. + */ +function tokenizeYAMLFrontMatter(eat, $0, $1) { + return eat($0)(this.renderRaw(YAML, $1 ? trimTrailingLines($1) : EMPTY)); +} + +tokenizeYAMLFrontMatter.onlyAtStart = true; + +/** + * Tokenise a footnote definition. + * + * @example + * var $0 = '[foo]: Bar.'; + * var $1 = '[foo]'; + * var $2 = 'foo'; + * var $3 = 'Bar.'; + * tokenizeFootnoteDefinition(eat, $0, $1, $2, $3); + * + * @property {boolean} onlyAtTop + * @property {boolean} notInBlockquote + * @param {function(string)} eat + * @param {string} $0 - Whole definition. + * @param {string} $1 - Whole key. + * @param {string} $2 - Key. + * @param {string} $3 - Whole value. + * @return {Node} - `footnoteDefinition` node. + */ +function tokenizeFootnoteDefinition(eat, $0, $1, $2, $3) { + var self = this; + var now = eat.now(); + var indent = self.indent(now.line); + + $3 = $3.replace(EXPRESSION_INITIAL_TAB, function (value) { + indent(value.length); + + return EMPTY; + }); + + now.column += $1.length; + + return eat($0)(self.renderFootnoteDefinition(normalize($2), $3, now)); +} + +tokenizeFootnoteDefinition.onlyAtTop = true; +tokenizeFootnoteDefinition.notInBlockquote = true; + +/** + * Tokenise a table. + * + * @example + * var $0 = ' | foo |\n | --- |\n | bar |'; + * var $1 = ' | foo |'; + * var $2 = '| foo |'; + * var $3 = ' | --- |'; + * var $4 = '| --- |'; + * var $5 = ' | bar |'; + * tokenizeTable(eat, $0, $1, $2, $3, $4, $5); + * + * @property {boolean} onlyAtTop + * @param {function(string)} eat + * @param {string} $0 - Whole table. + * @param {string} $1 - Whole heading. + * @param {string} $2 - Trimmed heading. + * @param {string} $3 - Whole alignment. + * @param {string} $4 - Trimmed alignment. + * @param {string} $5 - Rows. + * @return {Node} - `table` node. + */ +function tokenizeTable(eat, $0, $1, $2, $3, $4, $5) { + var self = this; + var node; + var index; + var length; + + $0 = trimTrailingLines($0); + + node = eat($0).reset({ + 'type': TABLE, + 'align': [], + 'children': [] + }); + + /** + * Eat a fence. Returns an empty string so it can be + * passed to `String#replace()`. + * + * @param {string} value - Fence. + * @return {string} - Empty string. + */ + function eatFence(value) { + eat(value); + + return EMPTY; + } + + /** + * Factory to eat a cell to a bound `row`. + * + * @param {Object} row - Parent to add cells to. + * @return {Function} - `eatCell` bound to `row`. + */ + function eatCellFactory(row) { + /** + * Eat a cell. Returns an empty string so it can be + * passed to `String#replace()`. + * + * @param {string} value - Complete match. + * @param {string} content - Cell content. + * @param {string} pipe - Fence. + * @return {string} - Empty string. + */ + function eatCell(value, content, pipe) { + var cell = trim.left(content); + var diff = content.length - cell.length; + var now; + + eat(content.slice(0, diff)); + + now = eat.now(); + + eat(cell)(self.renderInline( + TABLE_CELL, trim.right(cell), now + ), row); + + eat(pipe); + + return EMPTY; + } + + return eatCell; + } + + /** + * Eat a row of type `type`. + * + * @param {string} type - Type of the returned node, + * such as `tableHeader` or `tableRow`. + * @param {string} value - Row, including initial and + * final fences. + */ + function renderRow(type, value) { + var row = eat(value).reset(self.renderParent(type, []), node); + + value + .replace(EXPRESSION_TABLE_INITIAL, eatFence) + .replace(EXPRESSION_TABLE_CONTENT, eatCellFactory(row)); + } + + /* + * Add the table's header. + */ + + renderRow(TABLE_HEADER, $1); + + eat(NEW_LINE); + + /* + * Add the table's alignment. + */ + + eat($3); + + $4 = $4 + .replace(EXPRESSION_TABLE_FENCE, EMPTY) + .split(EXPRESSION_TABLE_BORDER); + + node.align = getAlignment($4); + + /* + * Add the table rows to table's children. + */ + + $5 = trimTrailingLines($5).split(NEW_LINE); + + index = -1; + length = $5.length; + + while (++index < length) { + renderRow(TABLE_ROW, $5[index]); + + if (index !== length - 1) { + eat(NEW_LINE); + } + } + + return node; +} + +tokenizeTable.onlyAtTop = true; + +/** + * Tokenise a paragraph node. + * + * @example + * tokenizeParagraph(eat, 'Foo.'); + * + * @param {function(string)} eat + * @param {string} $0 - Whole paragraph. + * @return {Node?} - `paragraph` node, when the node does + * not just contain white space. + */ +function tokenizeParagraph(eat, $0) { + var now = eat.now(); + + if (trim($0) === EMPTY) { + eat($0); + + return null; + } + + $0 = trimTrailingLines($0); + + return eat($0)(this.renderInline(PARAGRAPH, $0, now)); +} + +/** + * Tokenise a text node. + * + * @example + * tokenizeText(eat, 'foo'); + * + * @param {function(string)} eat + * @param {string} $0 - Whole text. + * @return {Node} - `text` node. + */ +function tokenizeText(eat, $0) { + return eat($0)(this.renderRaw(TEXT, $0)); +} + +/** + * Create a code-block node. + * + * @example + * renderCodeBlock('foo()', 'js', now()); + * + * @param {string?} [value] - Code. + * @param {string?} [language] - Optional language flag. + * @param {Function} eat + * @return {Object} - `code` node. + */ +function renderCodeBlock(value, language, eat) { + return { + 'type': CODE, + 'lang': language ? decode(this.descape(language), eat) : null, + 'value': trimTrailingLines(value || EMPTY) + }; +} + +/** + * Create a list node. + * + * @example + * var children = [renderListItem('- foo')]; + * renderList(children, '-'); + * + * @param {string} children - Children. + * @param {string} bullet - First bullet. + * @return {Object} - `list` node. + */ +function renderList(children, bullet) { + var start = parseInt(bullet, 10); + + if (start !== start) { + start = null; + } + + /* + * `loose` should be added later. + */ + + return { + 'type': LIST, + 'ordered': bullet.length > 1, + 'start': start, + 'loose': null, + 'children': children + }; +} + +/** + * Create a list-item using overly simple mechanics. + * + * @example + * renderPedanticListItem('- _foo_', now()); + * + * @param {string} value - List-item. + * @param {Object} position - List-item location. + * @return {string} - Cleaned `value`. + */ +function renderPedanticListItem(value, position) { + var self = this; + var indent = self.indent(position.line); + + /** + * A simple replacer which removed all matches, + * and adds their length to `offset`. + * + * @param {string} $0 + * @return {string} + */ + function replacer($0) { + indent($0.length); + + return EMPTY; + } + + /* + * Remove the list-item's bullet. + */ + + value = value.replace(EXPRESSION_PEDANTIC_BULLET, replacer); + + /* + * The initial line was also matched by the below, so + * we reset the `line`. + */ + + indent = self.indent(position.line); + + return value.replace(EXPRESSION_INITIAL_INDENT, replacer); +} + +/** + * Create a list-item using sane mechanics. + * + * @example + * renderNormalListItem('- _foo_', now()); + * + * @param {string} value - List-item. + * @param {Object} position - List-item location. + * @return {string} - Cleaned `value`. + */ +function renderNormalListItem(value, position) { + var self = this; + var indent = self.indent(position.line); + var bullet; + var rest; + var lines; + var trimmedLines; + var index; + var length; + var max; + + /* + * Remove the list-item's bullet. + */ + + value = value.replace(EXPRESSION_BULLET, function ($0, $1, $2, $3, $4) { + bullet = $1 + $2 + $3; + rest = $4; + + /* + * Make sure that the first nine numbered list items + * can indent with an extra space. That is, when + * the bullet did not receive an extra final space. + */ + + if (Number($2) < 10 && bullet.length % 2 === 1) { + $2 = SPACE + $2; + } + + max = $1 + repeat(SPACE, $2.length) + $3; + + return max + rest; + }); + + lines = value.split(NEW_LINE); + + trimmedLines = removeIndentation( + value, getIndent(max).indent + ).split(NEW_LINE); + + /* + * We replaced the initial bullet with something + * else above, which was used to trick + * `removeIndentation` into removing some more + * characters when possible. However, that could + * result in the initial line to be stripped more + * than it should be. + */ + + trimmedLines[0] = rest; + + indent(bullet.length); + + index = 0; + length = lines.length; + + while (++index < length) { + indent(lines[index].length - trimmedLines[index].length); + } + + return trimmedLines.join(NEW_LINE); +} + +/* + * A map of two functions which can create list items. + */ + +var LIST_ITEM_MAP = {}; + +LIST_ITEM_MAP.true = renderPedanticListItem; +LIST_ITEM_MAP.false = renderNormalListItem; + +/** + * Create a list-item node. + * + * @example + * renderListItem('- _foo_', now()); + * + * @param {Object} value - List-item. + * @param {Object} position - List-item location. + * @return {Object} - `listItem` node. + */ +function renderListItem(value, position) { + var self = this; + var checked = null; + var node; + var task; + var indent; + + value = LIST_ITEM_MAP[self.options.pedantic].apply(self, arguments); + + if (self.options.gfm) { + task = value.match(EXPRESSION_TASK_ITEM); + + if (task) { + indent = task[0].length; + checked = task[1].toLowerCase() === 'x'; + + self.indent(position.line)(indent); + value = value.slice(indent); + } + } + + node = { + 'type': LIST_ITEM, + 'loose': EXPRESSION_LOOSE_LIST_ITEM.test(value) || + value.charAt(value.length - 1) === NEW_LINE + }; + + if (self.options.gfm) { + node.checked = checked; + } + + node.children = self.tokenizeBlock(value, position); + + return node; +} + +/** + * Create a footnote-definition node. + * + * @example + * renderFootnoteDefinition('1', '_foo_', now()); + * + * @param {string} identifier - Unique reference. + * @param {string} value - Contents + * @param {Object} position - Definition location. + * @return {Object} - `footnoteDefinition` node. + */ +function renderFootnoteDefinition(identifier, value, position) { + var self = this; + var exitBlockquote = self.enterBlockquote(); + var node; + + node = { + 'type': FOOTNOTE_DEFINITION, + 'identifier': identifier, + 'children': self.tokenizeBlock(value, position) + }; + + exitBlockquote(); + + return node; +} + +/** + * Create a heading node. + * + * @example + * renderHeading('_foo_', 1, now()); + * + * @param {string} value - Content. + * @param {number} depth - Heading depth. + * @param {Object} position - Heading content location. + * @return {Object} - `heading` node + */ +function renderHeading(value, depth, position) { + return { + 'type': HEADING, + 'depth': depth, + 'children': this.tokenizeInline(value, position) + }; +} + +/** + * Create a blockquote node. + * + * @example + * renderBlockquote('_foo_', eat); + * + * @param {string} value - Content. + * @param {Object} now - Position. + * @return {Object} - `blockquote` node. + */ +function renderBlockquote(value, now) { + var self = this; + var exitBlockquote = self.enterBlockquote(); + var node = { + 'type': BLOCKQUOTE, + 'children': this.tokenizeBlock(value, now) + }; + + exitBlockquote(); + + return node; +} + +/** + * Create a void node. + * + * @example + * renderVoid('horizontalRule'); + * + * @param {string} type - Node type. + * @return {Object} - Node of type `type`. + */ +function renderVoid(type) { + return { + 'type': type + }; +} + +/** + * Create a parent. + * + * @example + * renderParent('paragraph', '_foo_'); + * + * @param {string} type - Node type. + * @param {Array.} children - Child nodes. + * @return {Object} - Node of type `type`. + */ +function renderParent(type, children) { + return { + 'type': type, + 'children': children + }; +} + +/** + * Create a raw node. + * + * @example + * renderRaw('inlineCode', 'foo()'); + * + * @param {string} type - Node type. + * @param {string} value - Contents. + * @return {Object} - Node of type `type`. + */ +function renderRaw(type, value) { + return { + 'type': type, + 'value': value + }; +} + +/** + * Create a link node. + * + * @example + * renderLink(true, 'example.com', 'example', 'Example Domain', now(), eat); + * renderLink(false, 'fav.ico', 'example', 'Example Domain', now(), eat); + * + * @param {boolean} isLink - Whether linking to a document + * or an image. + * @param {string} href - URI reference. + * @param {string} text - Content. + * @param {string?} title - Title. + * @param {Object} position - Location of link. + * @param {function(string)} eat + * @return {Object} - `link` or `image` node. + */ +function renderLink(isLink, href, text, title, position, eat) { + var self = this; + var exitLink = self.enterLink(); + var node; + + node = { + 'type': isLink ? LINK : IMAGE, + 'title': title ? decode(self.descape(title), eat) : null + }; + + href = decode(href, eat); + + if (isLink) { + node.href = href; + node.children = self.tokenizeInline(text, position); + } else { + node.src = href; + node.alt = text ? decode(self.descape(text), eat) : null; + } + + exitLink(); + + return node; +} + +/** + * Create a footnote node. + * + * @example + * renderFootnote('_foo_', now()); + * + * @param {string} value - Contents. + * @param {Object} position - Location of footnote. + * @return {Object} - `footnote` node. + */ +function renderFootnote(value, position) { + return this.renderInline(FOOTNOTE, value, position); +} + +/** + * Add a node with inline content. + * + * @example + * renderInline('strong', '_foo_', now()); + * + * @param {string} type - Node type. + * @param {string} value - Contents. + * @param {Object} position - Location of node. + * @return {Object} - Node of type `type`. + */ +function renderInline(type, value, position) { + return this.renderParent(type, this.tokenizeInline(value, position)); +} + +/** + * Add a node with block content. + * + * @example + * renderBlock('blockquote', 'Foo.', now()); + * + * @param {string} type - Node type. + * @param {string} value - Contents. + * @param {Object} position - Location of node. + * @return {Object} - Node of type `type`. + */ +function renderBlock(type, value, position) { + return this.renderParent(type, this.tokenizeBlock(value, position)); +} + +/** + * Tokenise an escape sequence. + * + * @example + * tokenizeEscape(eat, '\\a', 'a'); + * + * @param {function(string)} eat + * @param {string} $0 - Whole escape. + * @param {string} $1 - Escaped character. + * @return {Node} - `escape` node. + */ +function tokenizeEscape(eat, $0, $1) { + return eat($0)(this.renderRaw(ESCAPE, $1)); +} + +/** + * Tokenise a URL in carets. + * + * @example + * tokenizeAutoLink(eat, '', 'http://foo.bar', ''); + * + * @property {boolean} notInLink + * @param {function(string)} eat + * @param {string} $0 - Whole link. + * @param {string} $1 - URL. + * @param {string?} [$2] - Protocol or at. + * @return {Node} - `link` node. + */ +function tokenizeAutoLink(eat, $0, $1, $2) { + var self = this; + var href = $1; + var text = $1; + var now = eat.now(); + var offset = 1; + var tokenize; + var node; + + if ($2 === AT_SIGN) { + if ( + text.substr(0, MAILTO_PROTOCOL.length).toLowerCase() !== + MAILTO_PROTOCOL + ) { + href = MAILTO_PROTOCOL + text; + } else { + text = text.substr(MAILTO_PROTOCOL.length); + offset += MAILTO_PROTOCOL.length; + } + } + + now.column += offset; + + /* + * Temporarily remove support for escapes in autolinks. + */ + + tokenize = self.inlineTokenizers.escape; + self.inlineTokenizers.escape = null; + + node = eat($0)(self.renderLink(true, href, text, null, now, eat)); + + self.inlineTokenizers.escape = tokenize; + + return node; +} + +tokenizeAutoLink.notInLink = true; + +/** + * Tokenise a URL in text. + * + * @example + * tokenizeURL(eat, 'http://foo.bar'); + * + * @property {boolean} notInLink + * @param {function(string)} eat + * @param {string} $0 - Whole link. + * @return {Node} - `link` node. + */ +function tokenizeURL(eat, $0) { + var now = eat.now(); + + return eat($0)(this.renderLink(true, $0, $0, null, now, eat)); +} + +tokenizeURL.notInLink = true; + +/** + * Tokenise an HTML tag. + * + * @example + * tokenizeTag(eat, ''); + * + * @param {function(string)} eat + * @param {string} $0 - Content. + * @return {Node} - `html` node. + */ +function tokenizeTag(eat, $0) { + var self = this; + + if (!self.inLink && EXPRESSION_HTML_LINK_OPEN.test($0)) { + self.inLink = true; + } else if (self.inLink && EXPRESSION_HTML_LINK_CLOSE.test($0)) { + self.inLink = false; + } + + return eat($0)(self.renderRaw(HTML, $0)); +} + +/** + * Tokenise a link. + * + * @example + * tokenizeLink( + * eat, '![foo](fav.ico "Favicon")', '![', 'foo', null, + * 'fav.ico', 'Foo Domain' + * ); + * + * @param {function(string)} eat + * @param {string} $0 - Whole link. + * @param {string} $1 - Prefix. + * @param {string} $2 - Text. + * @param {string?} $3 - URL wrapped in angle braces. + * @param {string?} $4 - Literal URL. + * @param {string?} $5 - Title wrapped in single or double + * quotes. + * @param {string?} [$6] - Title wrapped in double quotes. + * @param {string?} [$7] - Title wrapped in parentheses. + * @return {Node?} - `link` node, `image` node, or `null`. + */ +function tokenizeLink(eat, $0, $1, $2, $3, $4, $5, $6, $7) { + var isLink = $1 === BRACKET_OPEN; + var href = $4 || $3 || ''; + var title = $7 || $6 || $5; + var now; + + if (!isLink || !this.inLink) { + now = eat.now(); + + now.column += $1.length; + + return eat($0)(this.renderLink( + isLink, this.descape(href), $2, title, now, eat + )); + } + + return null; +} + +/** + * Tokenise a reference link, image, or footnote; + * shortcut reference link, or footnote. + * + * @example + * tokenizeReference(eat, '[foo]', '[', 'foo'); + * tokenizeReference(eat, '[foo][]', '[', 'foo', ''); + * tokenizeReference(eat, '[foo][bar]', '[', 'foo', 'bar'); + * + * @param {function(string)} eat + * @param {string} $0 - Whole link. + * @param {string} $1 - Prefix. + * @param {string} $2 - identifier. + * @param {string} $3 - Content. + * @return {Node?} - `linkReference`, `imageReference`, or + * `footnoteReference`. Returns null when this is a link + * reference, but we're already in a link. + */ +function tokenizeReference(eat, $0, $1, $2, $3) { + var self = this; + var text = $2; + var identifier = $3 || $2; + var type = $1 === BRACKET_OPEN ? 'link' : 'image'; + var isFootnote = self.options.footnotes && identifier.charAt(0) === CARET; + var now = eat.now(); + var referenceType; + var node; + var exitLink; + + if ($3 === undefined) { + referenceType = 'shortcut'; + } else if ($3 === '') { + referenceType = 'collapsed'; + } else { + referenceType = 'full'; + } + + if (referenceType !== 'shortcut') { + isFootnote = false; + } + + if (isFootnote) { + identifier = identifier.substr(1); + } + + if (isFootnote) { + if (identifier.indexOf(SPACE) !== -1) { + return eat($0)(self.renderFootnote(identifier, eat.now())); + } else { + type = 'footnote'; + } + } + + if (self.inLink && type === 'link') { + return null; + } + + now.column += $1.length; + + node = { + 'type': type + 'Reference', + 'identifier': normalize(identifier) + }; + + if (type === 'link' || type === 'image') { + node.referenceType = referenceType; + } + + if (type === 'link') { + exitLink = self.enterLink(); + node.children = self.tokenizeInline(text, now); + exitLink(); + } else if (type === 'image') { + node.alt = decode(self.descape(text), eat); + } + + return eat($0)(node); +} + +/** + * Tokenise strong emphasis. + * + * @example + * tokenizeStrong(eat, '**foo**', '**', 'foo'); + * tokenizeStrong(eat, '__foo__', null, null, '__', 'foo'); + * + * @param {function(string)} eat + * @param {string} $0 - Whole emphasis. + * @param {string?} $1 - Marker. + * @param {string?} $2 - Content. + * @param {string?} [$3] - Marker. + * @param {string?} [$4] - Content. + * @return {Node?} - `strong` node, when not empty. + */ +function tokenizeStrong(eat, $0, $1, $2, $3, $4) { + var now = eat.now(); + var value = $2 || $4; + + if (trim(value) === EMPTY) { + return null; + } + + now.column += 2; + + return eat($0)(this.renderInline(STRONG, value, now)); +} + +/** + * Tokenise slight emphasis. + * + * @example + * tokenizeEmphasis(eat, '*foo*', '*', 'foo'); + * tokenizeEmphasis(eat, '_foo_', null, null, '_', 'foo'); + * + * @param {function(string)} eat + * @param {string} $0 - Whole emphasis. + * @param {string?} $1 - Marker. + * @param {string?} $2 - Content. + * @param {string?} [$3] - Marker. + * @param {string?} [$4] - Content. + * @return {Node?} - `emphasis` node, when not empty. + */ +function tokenizeEmphasis(eat, $0, $1, $2, $3, $4) { + var now = eat.now(); + var marker = $1 || $3; + var value = $2 || $4; + + if ( + trim(value) === EMPTY || + value.charAt(0) === marker || + value.charAt(value.length - 1) === marker + ) { + return null; + } + + now.column += 1; + + return eat($0)(this.renderInline(EMPHASIS, value, now)); +} + +/** + * Tokenise a deletion. + * + * @example + * tokenizeDeletion(eat, '~~foo~~', '~~', 'foo'); + * + * @param {function(string)} eat + * @param {string} $0 - Whole deletion. + * @param {string} $1 - Content. + * @return {Node} - `delete` node. + */ +function tokenizeDeletion(eat, $0, $1) { + var now = eat.now(); + + now.column += 2; + + return eat($0)(this.renderInline(DELETE, $1, now)); +} + +/** + * Tokenise inline code. + * + * @example + * tokenizeInlineCode(eat, '`foo()`', '`', 'foo()'); + * + * @param {function(string)} eat + * @param {string} $0 - Whole code. + * @param {string} $1 - Initial markers. + * @param {string} $2 - Content. + * @return {Node} - `inlineCode` node. + */ +function tokenizeInlineCode(eat, $0, $1, $2) { + return eat($0)(this.renderRaw(INLINE_CODE, trim($2 || ''))); +} + +/** + * Tokenise a break. + * + * @example + * tokenizeBreak(eat, ' \n'); + * + * @param {function(string)} eat + * @param {string} $0 + * @return {Node} - `break` node. + */ +function tokenizeBreak(eat, $0) { + return eat($0)(this.renderVoid(BREAK)); +} + +/** + * Construct a new parser. + * + * @example + * var parser = new Parser(new VFile('Foo')); + * + * @constructor + * @class {Parser} + * @param {VFile} file - File to parse. + * @param {Object?} [options] - Passed to + * `Parser#setOptions()`. + */ +function Parser(file, options) { + var self = this; + var rules = extend({}, self.expressions.rules); + + self.file = file; + self.inLink = false; + self.atTop = true; + self.atStart = true; + self.inBlockquote = false; + + self.rules = rules; + self.descape = descapeFactory(rules, 'escape'); + + self.options = extend({}, self.options); + + self.setOptions(options); +} + +/** + * Set options. Does not overwrite previously set + * options. + * + * @example + * var parser = new Parser(); + * parser.setOptions({gfm: true}); + * + * @this {Parser} + * @throws {Error} - When an option is invalid. + * @param {Object?} [options] - Parse settings. + * @return {Parser} - `self`. + */ +Parser.prototype.setOptions = function (options) { + var self = this; + var expressions = self.expressions; + var rules = self.rules; + var current = self.options; + var key; + + if (options === null || options === undefined) { + options = {}; + } else if (typeof options === 'object') { + options = extend({}, options); + } else { + raise(options, 'options'); + } + + self.options = options; + + for (key in defaultOptions) { + validate.boolean(options, key, current[key]); + + if (options[key]) { + extend(rules, expressions[key]); + } + } + + if (options.gfm && options.breaks) { + extend(rules, expressions.breaksGFM); + } + + if (options.gfm && options.commonmark) { + extend(rules, expressions.commonmarkGFM); + } + + if (options.commonmark) { + self.enterBlockquote = noopToggler(); + } + + return self; +}; + +/* + * Expose `defaults`. + */ + +Parser.prototype.options = defaultOptions; + +/* + * Expose `expressions`. + */ + +Parser.prototype.expressions = defaultExpressions; + +/** + * Factory to track indentation for each line corresponding + * to the given `start` and the number of invocations. + * + * @param {number} start - Starting line. + * @return {function(offset)} - Indenter. + */ +Parser.prototype.indent = function (start) { + var self = this; + var line = start; + + /** + * Intender which increments the global offset, + * starting at the bound line, and further incrementing + * each line for each invocation. + * + * @example + * indenter(2) + * + * @param {number} offset - Number to increment the + * offset. + */ + function indenter(offset) { + self.offset[line] = (self.offset[line] || 0) + offset; + + line++; + } + + return indenter; +}; + +/** + * Parse the bound file. + * + * @example + * new Parser(new File('_Foo_.')).parse(); + * + * @this {Parser} + * @return {Object} - `root` node. + */ +Parser.prototype.parse = function () { + var self = this; + var value = clean(String(self.file)); + var node; + + /* + * Add an `offset` matrix, used to keep track of + * syntax and white space indentation per line. + */ + + self.offset = {}; + + node = self.renderBlock(ROOT, value); + + if (self.options.position) { + node.position = { + 'start': { + 'line': 1, + 'column': 1 + } + }; + + node.position.end = self.eof || node.position.start; + } + + return node; +}; + +/* + * Enter and exit helpers. + */ + +Parser.prototype.enterLink = stateToggler('inLink', false); +Parser.prototype.exitTop = stateToggler('atTop', true); +Parser.prototype.exitStart = stateToggler('atStart', true); +Parser.prototype.enterBlockquote = stateToggler('inBlockquote', false); + +/* + * Expose helpers + */ + +Parser.prototype.renderRaw = renderRaw; +Parser.prototype.renderVoid = renderVoid; +Parser.prototype.renderParent = renderParent; +Parser.prototype.renderInline = renderInline; +Parser.prototype.renderBlock = renderBlock; + +Parser.prototype.renderLink = renderLink; +Parser.prototype.renderCodeBlock = renderCodeBlock; +Parser.prototype.renderBlockquote = renderBlockquote; +Parser.prototype.renderList = renderList; +Parser.prototype.renderListItem = renderListItem; +Parser.prototype.renderFootnoteDefinition = renderFootnoteDefinition; +Parser.prototype.renderHeading = renderHeading; +Parser.prototype.renderFootnote = renderFootnote; + +/** + * Construct a tokenizer. This creates both + * `tokenizeInline` and `tokenizeBlock`. + * + * @example + * Parser.prototype.tokenizeInline = tokenizeFactory('inline'); + * + * @param {string} type - Name of parser, used to find + * its expressions (`%sMethods`) and tokenizers + * (`%Tokenizers`). + * @return {function(string, Object?): Array.} + */ +function tokenizeFactory(type) { + /** + * Tokenizer for a bound `type` + * + * @example + * parser = new Parser(); + * parser.tokenizeInline('_foo_'); + * + * @param {string} value - Content. + * @param {Object?} [location] - Offset at which `value` + * starts. + * @return {Array.} - Nodes. + */ + function tokenize(value, location) { + var self = this; + var offset = self.offset; + var tokens = []; + var rules = self.rules; + var methods = self[type + 'Methods']; + var tokenizers = self[type + 'Tokenizers']; + var line = location ? location.line : 1; + var column = location ? location.column : 1; + var patchPosition = self.options.position; + var add; + var index; + var length; + var method; + var name; + var match; + var matched; + var valueLength; + var eater; + + /* + * Trim white space only lines. + */ + + if (!value) { + return tokens; + } + + /** + * Update line and column based on `value`. + * + * @example + * updatePosition('foo'); + * + * @param {string} subvalue + */ + function updatePosition(subvalue) { + var character = -1; + var subvalueLength = subvalue.length; + var lastIndex = -1; + + while (++character < subvalueLength) { + if (subvalue.charAt(character) === NEW_LINE) { + lastIndex = character; + line++; + } + } + + if (lastIndex === -1) { + column = column + subvalue.length; + } else { + column = subvalue.length - lastIndex; + } + + if (line in offset) { + if (lastIndex !== -1) { + column += offset[line]; + } else if (column <= offset[line]) { + column = offset[line] + 1; + } + } + } + + /** + * Get offset. Called before the fisrt character is + * eaten to retrieve the range's offsets. + * + * @return {Function} - `done`, to be called when + * the last character is eaten. + */ + function getOffset() { + var indentation = []; + var pos = line + 1; + + /** + * Done. Called when the last character is + * eaten to retrieve the range's offsets. + * + * @return {Array.} - Offset. + */ + function done() { + var last = line + 1; + + while (pos < last) { + indentation.push((offset[pos] || 0) + 1); + + pos++; + } + + return indentation; + } + + return done; + } + + /** + * Get the current position. + * + * @example + * position = now(); // {line: 1, column: 1} + * + * @return {Object} + */ + function now() { + return { + 'line': line, + 'column': column + }; + } + + /** + * Store position information for a node. + * + * @example + * start = now(); + * updatePosition('foo'); + * location = new Position(start); + * // {start: {line: 1, column: 1}, end: {line: 1, column: 3}} + * + * @param {Object} start + */ + function Position(start) { + this.start = start; + this.end = now(); + } + + /** + * Throw when a value is incorrectly eaten. + * This shouldn’t happen but will throw on new, + * incorrect rules. + * + * @example + * // When the current value is set to `foo bar`. + * validateEat('foo'); + * eat('foo'); + * + * validateEat('bar'); + * // throws, because the space is not eaten. + * + * @param {string} subvalue - Value to be eaten. + * @throws {Error} - When `subvalue` cannot be eaten. + */ + function validateEat(subvalue) { + /* istanbul ignore if */ + if (value.substring(0, subvalue.length) !== subvalue) { + self.file.fail( + 'Incorrectly eaten value: please report this ' + + 'warning on http://git.io/vUYWz', now() + ); + } + } + + /** + * Mark position and patch `node.position`. + * + * @example + * var update = position(); + * updatePosition('foo'); + * update({}); + * // { + * // position: { + * // start: {line: 1, column: 1} + * // end: {line: 1, column: 3} + * // } + * // } + * + * @returns {function(Node): Node} + */ + function position() { + var before = now(); + + /** + * Add the position to a node. + * + * @example + * update({type: 'text', value: 'foo'}); + * + * @param {Node} node - Node to attach position + * on. + * @return {Node} - `node`. + */ + function update(node, indent) { + var prev = node.position; + var start = prev ? prev.start : before; + var combined = []; + var n = prev && prev.end.line; + var l = before.line; + + node.position = new Position(start); + + /* + * If there was already a `position`, this + * node was merged. Fixing `start` wasn't + * hard, but the indent is different. + * Especially because some information, the + * indent between `n` and `l` wasn't + * tracked. Luckily, that space is + * (should be?) empty, so we can safely + * check for it now. + */ + + if (prev) { + combined = prev.indent; + + if (n < l) { + while (++n < l) { + combined.push((offset[n] || 0) + 1); + } + + combined.push(before.column); + } + + indent = combined.concat(indent); + } + + node.position.indent = indent; + + return node; + } + + return update; + } + + /** + * Add `node` to `parent`s children or to `tokens`. + * Performs merges where possible. + * + * @example + * add({}); + * + * add({}, {children: []}); + * + * @param {Object} node - Node to add. + * @param {Object} [parent] - Parent to insert into. + * @return {Object} - Added or merged into node. + */ + add = function (node, parent) { + var isMultiple = 'length' in node; + var prev; + var children; + + if (!parent) { + children = tokens; + } else { + children = parent.children; + } + + if (isMultiple) { + arrayPush.apply(children, node); + } else { + if (type === INLINE && node.type === TEXT) { + node.value = decode(node.value, eater); + } + + prev = children[children.length - 1]; + + if ( + prev && + node.type === prev.type && + node.type in MERGEABLE_NODES + ) { + node = MERGEABLE_NODES[node.type].call( + self, prev, node + ); + } + + if (node !== prev) { + children.push(node); + } + + if (self.atStart && tokens.length) { + self.exitStart(); + } + } + + return node; + }; + + /** + * Remove `subvalue` from `value`. + * Expects `subvalue` to be at the start from + * `value`, and applies no validation. + * + * @example + * eat('foo')({type: 'text', value: 'foo'}); + * + * @param {string} subvalue - Removed from `value`, + * and passed to `updatePosition`. + * @return {Function} - Wrapper around `add`, which + * also adds `position` to node. + */ + function eat(subvalue) { + var indent = getOffset(); + var pos = position(); + var current = now(); + + validateEat(subvalue); + + /** + * Add the given arguments, add `position` to + * the returned node, and return the node. + * + * @return {Node} + */ + function apply() { + return pos(add.apply(null, arguments), indent); + } + + /** + * Functions just like apply, but resets the + * content: the line and column are reversed, + * and the eaten value is re-added. + * + * This is useful for nodes with a single + * type of content, such as lists and tables. + * + * See `apply` above for what parameters are + * expected. + * + * @return {Node} + */ + function reset() { + var node = apply.apply(null, arguments); + + line = current.line; + column = current.column; + value = subvalue + value; + + return node; + } + + apply.reset = reset; + + value = value.substring(subvalue.length); + + updatePosition(subvalue); + + indent = indent(); + + return apply; + } + + /** + * Same as `eat` above, but will not add positional + * information to nodes. + * + * @example + * noEat('foo')({type: 'text', value: 'foo'}); + * + * @param {string} subvalue - Removed from `value`. + * @return {Function} - Wrapper around `add`. + */ + function noEat(subvalue) { + validateEat(subvalue); + + /** + * Add the given arguments, and return the + * node. + * + * @return {Node} + */ + function apply() { + return add.apply(null, arguments); + } + + /** + * Functions just like apply, but resets the + * content: the eaten value is re-added. + * + * @return {Node} + */ + function reset() { + var node = apply.apply(null, arguments); + + value = subvalue + value; + + return node; + } + + apply.reset = reset; + + value = value.substring(subvalue.length); + + return apply; + } + + /* + * Expose the eater, depending on if `position`s + * should be patched on nodes. + */ + + eater = patchPosition ? eat : noEat; + + /* + * Expose `now` on `eater`. + */ + + eater.now = now; + + /* + * Expose `file` on `eater`. + */ + + eater.file = self.file; + + /* + * Sync initial offset. + */ + + updatePosition(EMPTY); + + /* + * Iterate over `value`, and iterate over all + * block-expressions. When one matches, invoke + * its companion function. If no expression + * matches, something failed (should not happen) + * and an exception is thrown. + */ + + while (value) { + index = -1; + length = methods.length; + matched = false; + + while (++index < length) { + name = methods[index]; + method = tokenizers[name]; + + if ( + method && + rules[name] && + (!method.onlyAtStart || self.atStart) && + (!method.onlyAtTop || self.atTop) && + (!method.notInBlockquote || !self.inBlockquote) && + (!method.notInLink || !self.inLink) + ) { + match = rules[name].exec(value); + + if (match) { + valueLength = value.length; + + method.apply(self, [eater].concat(match)); + + matched = valueLength !== value.length; + + if (matched) { + break; + } + } + } + } + + /* istanbul ignore if */ + if (!matched) { + self.file.fail('Infinite loop', eater.now()); + + /* + * Errors are not thrown on `File#fail` + * when `quiet: true`. + */ + + break; + } + } + + self.eof = now(); + + return tokens; + } + + return tokenize; +} + +/* + * Expose tokenizers for block-level nodes. + */ + +Parser.prototype.blockTokenizers = { + 'yamlFrontMatter': tokenizeYAMLFrontMatter, + 'newline': tokenizeNewline, + 'code': tokenizeCode, + 'fences': tokenizeFences, + 'heading': tokenizeHeading, + 'lineHeading': tokenizeLineHeading, + 'horizontalRule': tokenizeHorizontalRule, + 'blockquote': tokenizeBlockquote, + 'list': tokenizeList, + 'html': tokenizeHtml, + 'definition': tokenizeDefinition, + 'footnoteDefinition': tokenizeFootnoteDefinition, + 'looseTable': tokenizeTable, + 'table': tokenizeTable, + 'paragraph': tokenizeParagraph +}; + +/* + * Expose order in which to parse block-level nodes. + */ + +Parser.prototype.blockMethods = [ + 'yamlFrontMatter', + 'newline', + 'code', + 'fences', + 'blockquote', + 'heading', + 'horizontalRule', + 'list', + 'lineHeading', + 'html', + 'definition', + 'footnoteDefinition', + 'looseTable', + 'table', + 'paragraph', + 'blockText' +]; + +/** + * Block tokenizer. + * + * @example + * var parser = new Parser(); + * parser.tokenizeBlock('> foo.'); + * + * @param {string} value - Content. + * @return {Array.} - Nodes. + */ + +Parser.prototype.tokenizeBlock = tokenizeFactory(BLOCK); + +/* + * Expose tokenizers for inline-level nodes. + */ + +Parser.prototype.inlineTokenizers = { + 'escape': tokenizeEscape, + 'autoLink': tokenizeAutoLink, + 'url': tokenizeURL, + 'tag': tokenizeTag, + 'link': tokenizeLink, + 'reference': tokenizeReference, + 'shortcutReference': tokenizeReference, + 'strong': tokenizeStrong, + 'emphasis': tokenizeEmphasis, + 'deletion': tokenizeDeletion, + 'inlineCode': tokenizeInlineCode, + 'break': tokenizeBreak, + 'inlineText': tokenizeText +}; + +/* + * Expose order in which to parse inline-level nodes. + */ + +Parser.prototype.inlineMethods = [ + 'escape', + 'autoLink', + 'url', + 'tag', + 'link', + 'reference', + 'shortcutReference', + 'strong', + 'emphasis', + 'deletion', + 'inlineCode', + 'break', + 'inlineText' +]; + +/** + * Inline tokenizer. + * + * @example + * var parser = new Parser(); + * parser.tokenizeInline('_foo_'); + * + * @param {string} value - Content. + * @return {Array.} - Nodes. + */ + +Parser.prototype.tokenizeInline = tokenizeFactory(INLINE); + +/* + * Expose `tokenizeFactory` so dependencies could create + * their own tokenizers. + */ + +Parser.prototype.tokenizeFactory = tokenizeFactory; + +/* + * Expose `parse` on `module.exports`. + */ + +module.exports = Parser; + +},{"./defaults.js":7,"./expressions.js":8,"./utilities.js":11,"extend.js":14,"he":15,"repeat-string":18,"trim":20,"trim-trailing-lines":19}],10:[function(require,module,exports){ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module mdast:stringify + * @fileoverview Compile an abstract syntax tree into + * a markdown document. + */ + +'use strict'; + +/* + * Dependencies. + */ + +var he = require('he'); +var table = require('markdown-table'); +var repeat = require('repeat-string'); +var extend = require('extend.js'); +var ccount = require('ccount'); +var longestStreak = require('longest-streak'); +var utilities = require('./utilities.js'); +var defaultOptions = require('./defaults.js').stringify; + +/* + * Methods. + */ + +var raise = utilities.raise; +var validate = utilities.validate; + +/* + * Constants. + */ + +var INDENT = 4; +var MINIMUM_CODE_FENCE_LENGTH = 3; +var YAML_FENCE_LENGTH = 3; +var MINIMUM_RULE_LENGTH = 3; +var MAILTO = 'mailto:'; + +/* + * Expressions. + */ + +var EXPRESSIONS_WHITE_SPACE = /\s/; + +/* + * Naive fence expression. + */ + +var FENCE = /([`~])\1{2}/; + +/* + * Expression for a protocol. + * + * @see http://en.wikipedia.org/wiki/URI_scheme#Generic_syntax + */ + +var PROTOCOL = /^[a-z][a-z+.-]+:\/?/i; + +/* + * Characters. + */ + +var ANGLE_BRACKET_CLOSE = '>'; +var ANGLE_BRACKET_OPEN = '<'; +var ASTERISK = '*'; +var CARET = '^'; +var COLON = ':'; +var DASH = '-'; +var DOT = '.'; +var EMPTY = ''; +var EQUALS = '='; +var EXCLAMATION_MARK = '!'; +var HASH = '#'; +var LINE = '\n'; +var PARENTHESIS_OPEN = '('; +var PARENTHESIS_CLOSE = ')'; +var PIPE = '|'; +var PLUS = '+'; +var QUOTE_DOUBLE = '"'; +var QUOTE_SINGLE = '\''; +var SPACE = ' '; +var SQUARE_BRACKET_OPEN = '['; +var SQUARE_BRACKET_CLOSE = ']'; +var TICK = '`'; +var TILDE = '~'; +var UNDERSCORE = '_'; + +/* + * Character combinations. + */ + +var BREAK = LINE + LINE; +var GAP = BREAK + LINE; +var DOUBLE_TILDE = TILDE + TILDE; + +/* + * Allowed entity options. + */ + +var ENTITY_OPTIONS = {}; + +ENTITY_OPTIONS.true = true; +ENTITY_OPTIONS.false = true; +ENTITY_OPTIONS.numbers = true; +ENTITY_OPTIONS.escape = true; + +/* + * Allowed list-bullet characters. + */ + +var LIST_BULLETS = {}; + +LIST_BULLETS[ASTERISK] = true; +LIST_BULLETS[DASH] = true; +LIST_BULLETS[PLUS] = true; + +/* + * Allowed horizontal-rule bullet characters. + */ + +var HORIZONTAL_RULE_BULLETS = {}; + +HORIZONTAL_RULE_BULLETS[ASTERISK] = true; +HORIZONTAL_RULE_BULLETS[DASH] = true; +HORIZONTAL_RULE_BULLETS[UNDERSCORE] = true; + +/* + * Allowed emphasis characters. + */ + +var EMPHASIS_MARKERS = {}; + +EMPHASIS_MARKERS[UNDERSCORE] = true; +EMPHASIS_MARKERS[ASTERISK] = true; + +/* + * Allowed fence markers. + */ + +var FENCE_MARKERS = {}; + +FENCE_MARKERS[TICK] = true; +FENCE_MARKERS[TILDE] = true; + +/* + * Which method to use based on `list.ordered`. + */ + +var ORDERED_MAP = {}; + +ORDERED_MAP.true = 'visitOrderedItems'; +ORDERED_MAP.false = 'visitUnorderedItems'; + +/* + * Allowed list-item-indent's. + */ + +var LIST_ITEM_INDENTS = {}; + +var LIST_ITEM_TAB = 'tab'; +var LIST_ITEM_ONE = '1'; +var LIST_ITEM_MIXED = 'mixed'; + +LIST_ITEM_INDENTS[LIST_ITEM_ONE] = true; +LIST_ITEM_INDENTS[LIST_ITEM_TAB] = true; +LIST_ITEM_INDENTS[LIST_ITEM_MIXED] = true; + +/* + * Which checkbox to use. + */ + +var CHECKBOX_MAP = {}; + +CHECKBOX_MAP.null = EMPTY; +CHECKBOX_MAP.undefined = EMPTY; +CHECKBOX_MAP.true = SQUARE_BRACKET_OPEN + 'x' + SQUARE_BRACKET_CLOSE + SPACE; +CHECKBOX_MAP.false = SQUARE_BRACKET_OPEN + SPACE + SQUARE_BRACKET_CLOSE + + SPACE; + +/** + * Encode noop. + * Simply returns the given value. + * + * @example + * var encode = encodeNoop(); + * encode('AT&T') // 'AT&T' + * + * @param {string} value - Content. + * @return {string} - Content, without any modifications. + */ +function encodeNoop(value) { + return value; +} + +/** + * Factory to encode HTML entities. + * Creates a no-operation function when `type` is + * `'false'`, a function which encodes using named + * references when `type` is `'true'`, and a function + * which encodes using numbered references when `type` is + * `'numbers'`. + * + * By default this should not throw errors, but he does + * throw an error when in `strict` mode: + * + * he.encode.options.strict = true; + * encodeFactory('true')('\x01') // throws + * + * These are thrown on the currently compiled `File`. + * + * @example + * var file = new File(); + * + * var encode = encodeFactory('false', file); + * encode('AT&T') // 'AT&T' + * + * encode = encodeFactory('true', file); + * encode('AT&T') // 'AT&T' + * + * encode = encodeFactory('numbers', file); + * encode('AT&T') // 'ATT&T' + * + * @param {string} type - Either `'true'`, `'false'`, or + * `numbers`. + * @param {File} file - Currently compiled virtual file. + * @return {function(string): string} - Function which + * takes a value and returns its encoded version. + */ +function encodeFactory(type, file) { + var options = {}; + var fn; + + if (type === 'false') { + return encodeNoop; + } + + if (type === 'true') { + options.useNamedReferences = true; + } + + fn = type === 'escape' ? 'escape' : 'encode'; + + /** + * Encode HTML entities using `he` using bound options. + * + * @see https://github.com/mathiasbynens/he#strict + * + * @example + * // When `type` is `'true'`. + * encode('AT&T'); // 'AT&T' + * + * // When `type` is `'numbers'`. + * encode('AT&T'); // 'ATT&T' + * + * @param {string} value - Content. + * @param {Object} node - Node which is compiled. + * @return {string} - Encoded content. + * @throws {Error} - When `file.quiet` is not `true`. + * However, by default `he` does not throw on + * parse errors, but when + * `he.encode.options.strict: true`, they occur on + * invalid HTML. + */ + function encode(value, node) { + try { + return he[fn](value, options); + } catch (exception) { + file.fail(exception, node.position); + } + } + + return encode; +} + +/** + * Wrap `url` in angle brackets when needed, or when + * forced. + * + * In links, images, and definitions, the URL part needs + * to be enclosed when it: + * + * - has a length of `0`; + * - contains white-space; + * - has more or less opening than closing parentheses. + * + * @example + * encloseURI('foo bar') // '' + * encloseURI('foo(bar(baz)') // '' + * encloseURI('') // '<>' + * encloseURI('example.com') // 'example.com' + * encloseURI('example.com', true) // '' + * + * @param {string} uri + * @param {boolean?} [always] - Force enclosing. + * @return {boolean} - Properly enclosed `uri`. + */ +function encloseURI(uri, always) { + if ( + always || + !uri.length || + EXPRESSIONS_WHITE_SPACE.test(uri) || + ccount(uri, PARENTHESIS_OPEN) !== ccount(uri, PARENTHESIS_CLOSE) + ) { + return ANGLE_BRACKET_OPEN + uri + ANGLE_BRACKET_CLOSE; + } + + return uri; +} + +/** + * There is currently no way to support nested delimiters + * across Markdown.pl, CommonMark, and GitHub (RedCarpet). + * The following code supports Markdown.pl and GitHub. + * CommonMark is not supported when mixing double- and + * single quotes inside a title. + * + * @see https://github.com/vmg/redcarpet/issues/473 + * @see https://github.com/jgm/CommonMark/issues/308 + * + * @example + * encloseTitle('foo') // '"foo"' + * encloseTitle('foo \'bar\' baz') // '"foo \'bar\' baz"' + * encloseTitle('foo "bar" baz') // '\'foo "bar" baz\'' + * encloseTitle('foo "bar" \'baz\'') // '"foo "bar" \'baz\'"' + * + * @param {string} title - Content. + * @return {string} - Properly enclosed title. + */ +function encloseTitle(title) { + var delimiter = QUOTE_DOUBLE; + + if (title.indexOf(delimiter) !== -1) { + delimiter = QUOTE_SINGLE; + } + + return delimiter + title + delimiter; +} + +/** + * Pad `value` with `level * INDENT` spaces. Respects + * lines. Ignores empty lines. + * + * @example + * pad('foo', 1) // ' foo' + * + * @param {string} value - Content. + * @param {number} level - Indentation level. + * @return {string} - Padded `value`. + */ +function pad(value, level) { + var index; + var padding; + + value = value.split(LINE); + + index = value.length; + padding = repeat(SPACE, level * INDENT); + + while (index--) { + if (value[index].length !== 0) { + value[index] = padding + value[index]; + } + } + + return value.join(LINE); +} + +/** + * Construct a new compiler. + * + * @example + * var compiler = new Compiler(new File('> foo.')); + * + * @constructor + * @class {Compiler} + * @param {File} file - Virtual file. + * @param {Object?} [options] - Passed to + * `Compiler#setOptions()`. + */ +function Compiler(file, options) { + var self = this; + + self.file = file; + + self.options = extend({}, self.options); + + self.setOptions(options); +} + +/* + * Cache prototype. + */ + +var compilerPrototype = Compiler.prototype; + +/* + * Expose defaults. + */ + +compilerPrototype.options = defaultOptions; + +/* + * Map of applicable enum's. + */ + +var maps = { + 'entities': ENTITY_OPTIONS, + 'bullet': LIST_BULLETS, + 'rule': HORIZONTAL_RULE_BULLETS, + 'listItemIndent': LIST_ITEM_INDENTS, + 'emphasis': EMPHASIS_MARKERS, + 'strong': EMPHASIS_MARKERS, + 'fence': FENCE_MARKERS +}; + +/** + * Set options. Does not overwrite previously set + * options. + * + * @example + * var compiler = new Compiler(); + * compiler.setOptions({bullet: '*'}); + * + * @this {Compiler} + * @throws {Error} - When an option is invalid. + * @param {Object?} [options] - Stringify settings. + * @return {Compiler} - `self`. + */ +compilerPrototype.setOptions = function (options) { + var self = this; + var current = self.options; + var ruleRepetition; + var key; + + if (options === null || options === undefined) { + options = {}; + } else if (typeof options === 'object') { + options = extend({}, options); + } else { + raise(options, 'options'); + } + + for (key in defaultOptions) { + validate[typeof current[key]]( + options, key, current[key], maps[key] + ); + } + + ruleRepetition = options.ruleRepetition; + + if (ruleRepetition && ruleRepetition < MINIMUM_RULE_LENGTH) { + raise(ruleRepetition, 'options.ruleRepetition'); + } + + self.encode = encodeFactory(String(options.entities), self.file); + + self.options = options; + + return self; +}; + +/** + * Visit a node. + * + * @example + * var compiler = new Compiler(); + * + * compiler.visit({ + * type: 'strong', + * children: [{ + * type: 'text', + * value: 'Foo' + * }] + * }); + * // '**Foo**' + * + * @param {Object} node - Node. + * @param {Object?} [parent] - `node`s parent. + * @return {string} - Compiled `node`. + */ +compilerPrototype.visit = function (node, parent) { + var self = this; + + /* + * Fail on unknown nodes. + */ + + if (typeof self[node.type] !== 'function') { + self.file.fail( + 'Missing compiler for node of type `' + + node.type + '`: `' + node + '`', + node + ); + } + + return self[node.type](node, parent); +}; + +/** + * Visit all children of `parent`. + * + * @example + * var compiler = new Compiler(); + * + * compiler.all({ + * type: 'strong', + * children: [{ + * type: 'text', + * value: 'Foo' + * }, + * { + * type: 'text', + * value: 'Bar' + * }] + * }); + * // ['Foo', 'Bar'] + * + * @param {Object} parent - Parent node of children. + * @return {Array.} - List of compiled children. + */ +compilerPrototype.all = function (parent) { + var self = this; + var children = parent.children; + var values = []; + var index = -1; + var length = children.length; + + while (++index < length) { + values[index] = self.visit(children[index], parent); + } + + return values; +}; + +/** + * Visit ordered list items. + * + * Starts the list with + * `node.start` and increments each following list item + * bullet by one: + * + * 2. foo + * 3. bar + * + * In `incrementListMarker: false` mode, does not increment + * each marker and stays on `node.start`: + * + * 1. foo + * 1. bar + * + * Adds an extra line after an item if it has + * `loose: true`. + * + * @example + * var compiler = new Compiler(); + * + * compiler.visitOrderedItems({ + * type: 'list', + * ordered: true, + * children: [{ + * type: 'listItem', + * children: [{ + * type: 'text', + * value: 'bar' + * }] + * }] + * }); + * // '1. bar' + * + * @param {Object} node - `list` node with + * `ordered: true`. + * @return {string} - Markdown list. + */ +compilerPrototype.visitOrderedItems = function (node) { + var self = this; + var increment = self.options.incrementListMarker; + var values = []; + var start = node.start; + var children = node.children; + var length = children.length; + var index = -1; + var bullet; + + while (++index < length) { + bullet = (increment ? start + index : start) + DOT; + values[index] = self.listItem(children[index], node, index, bullet); + } + + return values.join(LINE); +}; + +/** + * Visit unordered list items. + * + * Uses `options.bullet` as each item's bullet. + * + * Adds an extra line after an item if it has + * `loose: true`. + * + * @example + * var compiler = new Compiler(); + * + * compiler.visitUnorderedItems({ + * type: 'list', + * ordered: false, + * children: [{ + * type: 'listItem', + * children: [{ + * type: 'text', + * value: 'bar' + * }] + * }] + * }); + * // '- bar' + * + * @param {Object} node - `list` node with + * `ordered: false`. + * @return {string} - Markdown list. + */ +compilerPrototype.visitUnorderedItems = function (node) { + var self = this; + var values = []; + var children = node.children; + var length = children.length; + var index = -1; + var bullet = self.options.bullet; + + while (++index < length) { + values[index] = self.listItem(children[index], node, index, bullet); + } + + return values.join(LINE); +}; + +/** + * Stringify a block node with block children (e.g., `root` + * or `blockquote`). + * + * Knows about code following a list, or adjacent lists + * with similar bullets, and places an extra newline + * between them. + * + * @example + * var compiler = new Compiler(); + * + * compiler.block({ + * type: 'root', + * children: [{ + * type: 'paragraph', + * children: [{ + * type: 'text', + * value: 'bar' + * }] + * }] + * }); + * // 'bar' + * + * @param {Object} node - `root` node. + * @return {string} - Markdown block content. + */ +compilerPrototype.block = function (node) { + var self = this; + var values = []; + var children = node.children; + var length = children.length; + var index = -1; + var child; + var prev; + + while (++index < length) { + child = children[index]; + + if (prev) { + /* + * Duplicate nodes, such as a list + * directly following another list, + * often need multiple new lines. + * + * Additionally, code blocks following a list + * might easily be mistaken for a paragraph + * in the list itself. + */ + + if (child.type === prev.type && prev.type === 'list') { + values.push(prev.ordered === child.ordered ? GAP : BREAK); + } else if ( + prev.type === 'list' && + child.type === 'code' && + !child.lang + ) { + values.push(GAP); + } else { + values.push(BREAK); + } + } + + values.push(self.visit(child, node)); + + prev = child; + } + + return values.join(EMPTY); +}; + +/** + * Stringify a root. + * + * Adds a final newline to ensure valid POSIX files. + * + * @example + * var compiler = new Compiler(); + * + * compiler.root({ + * type: 'root', + * children: [{ + * type: 'paragraph', + * children: [{ + * type: 'text', + * value: 'bar' + * }] + * }] + * }); + * // 'bar' + * + * @param {Object} node - `root` node. + * @return {string} - Markdown document. + */ +compilerPrototype.root = function (node) { + return this.block(node) + LINE; +}; + +/** + * Stringify a heading. + * + * In `setext: true` mode and when `depth` is smaller than + * three, creates a setext header: + * + * Foo + * === + * + * Otherwise, an ATX header is generated: + * + * ### Foo + * + * In `closeAtx: true` mode, the header is closed with + * hashes: + * + * ### Foo ### + * + * @example + * var compiler = new Compiler(); + * + * compiler.heading({ + * type: 'heading', + * depth: 2, + * children: [{ + * type: 'strong', + * children: [{ + * type: 'text', + * value: 'bar' + * }] + * }] + * }); + * // '## **bar**' + * + * @param {Object} node - `heading` node. + * @return {string} - Markdown heading. + */ +compilerPrototype.heading = function (node) { + var self = this; + var setext = self.options.setext; + var closeAtx = self.options.closeAtx; + var depth = node.depth; + var content = self.all(node).join(EMPTY); + var prefix; + + if (setext && depth < 3) { + return content + LINE + + repeat(depth === 1 ? EQUALS : DASH, content.length); + } + + prefix = repeat(HASH, node.depth); + content = prefix + SPACE + content; + + if (closeAtx) { + content += SPACE + prefix; + } + + return content; +}; + +/** + * Stringify text. + * + * Supports named entities in `settings.encode: true` mode: + * + * AT&T + * + * Supports numbered entities in `settings.encode: numbers` + * mode: + * + * AT&T + * + * @example + * var compiler = new Compiler(); + * + * compiler.text({ + * type: 'text', + * value: 'foo' + * }); + * // 'foo' + * + * @param {Object} node - `text` node. + * @return {string} - Raw markdown text. + */ +compilerPrototype.text = function (node) { + return this.encode(node.value, node); +}; + +/** + * Stringify escaped text. + * + * @example + * var compiler = new Compiler(); + * + * compiler.escape({ + * type: 'escape', + * value: '\n' + * }); + * // '\\\n' + * + * @param {Object} node - `escape` node. + * @return {string} - Markdown escape. + */ +compilerPrototype.escape = function (node) { + return '\\' + node.value; +}; + +/** + * Stringify a paragraph. + * + * @example + * var compiler = new Compiler(); + * + * compiler.paragraph({ + * type: 'paragraph', + * children: [{ + * type: 'strong', + * children: [{ + * type: 'text', + * value: 'bar' + * }] + * }] + * }); + * // '**bar**' + * + * @param {Object} node - `paragraph` node. + * @return {string} - Markdown paragraph. + */ +compilerPrototype.paragraph = function (node) { + return this.all(node).join(EMPTY); +}; + +/** + * Stringify a block quote. + * + * @example + * var compiler = new Compiler(); + * + * compiler.paragraph({ + * type: 'blockquote', + * children: [{ + * type: 'paragraph', + * children: [{ + * type: 'strong', + * children: [{ + * type: 'text', + * value: 'bar' + * }] + * }] + * }] + * }); + * // '> **bar**' + * + * @param {Object} node - `blockquote` node. + * @return {string} - Markdown block quote. + */ +compilerPrototype.blockquote = function (node) { + var indent = ANGLE_BRACKET_CLOSE + SPACE; + + return indent + this.block(node).split(LINE).join(LINE + indent); +}; + +/** + * Stringify a list. See `Compiler#visitOrderedList()` and + * `Compiler#visitUnorderedList()` for internal working. + * + * @example + * var compiler = new Compiler(); + * + * compiler.visitUnorderedItems({ + * type: 'list', + * ordered: false, + * children: [{ + * type: 'listItem', + * children: [{ + * type: 'text', + * value: 'bar' + * }] + * }] + * }); + * // '- bar' + * + * @param {Object} node - `list` node. + * @return {string} - Markdown list. + */ +compilerPrototype.list = function (node) { + return this[ORDERED_MAP[node.ordered]](node); +}; + +/** + * Stringify a list item. + * + * Prefixes the content with a checked checkbox when + * `checked: true`: + * + * [x] foo + * + * Prefixes the content with an unchecked checkbox when + * `checked: false`: + * + * [ ] foo + * + * @example + * var compiler = new Compiler(); + * + * compiler.listItem({ + * type: 'listItem', + * checked: true, + * children: [{ + * type: 'text', + * value: 'bar' + * }] + * }, { + * type: 'list', + * ordered: false, + * children: [{ + * type: 'listItem', + * checked: true, + * children: [{ + * type: 'text', + * value: 'bar' + * }] + * }] + * }, 0, '*'); + * '- [x] bar' + * + * @param {Object} node - `listItem` node. + * @param {Object} parent - `list` node. + * @param {number} position - Index of `node` in `parent`. + * @param {string} bullet - Bullet to use. This, and the + * `listItemIndent` setting define the used indent. + * @return {string} - Markdown list item. + */ +compilerPrototype.listItem = function (node, parent, position, bullet) { + var self = this; + var style = self.options.listItemIndent; + var children = node.children; + var values = []; + var index = -1; + var length = children.length; + var loose = node.loose; + var value; + var indent; + var spacing; + + while (++index < length) { + values[index] = self.visit(children[index], node); + } + + value = CHECKBOX_MAP[node.checked] + values.join(loose ? BREAK : LINE); + + if ( + style === LIST_ITEM_ONE || + (style === LIST_ITEM_MIXED && value.indexOf(LINE) === -1) + ) { + indent = bullet.length + 1; + spacing = SPACE; + } else { + indent = Math.ceil((bullet.length + 1) / INDENT) * INDENT; + spacing = repeat(SPACE, indent - bullet.length); + } + + value = bullet + spacing + pad(value, indent / INDENT).slice(indent); + + if (loose && parent.children.length - 1 !== position) { + value += LINE; + } + + return value; +}; + +/** + * Stringify inline code. + * + * Knows about internal ticks (`\``), and ensures one more + * tick is used to enclose the inline code: + * + * ```foo ``bar`` baz``` + * + * Even knows about inital and final ticks: + * + * `` `foo `` + * `` foo` `` + * + * @example + * var compiler = new Compiler(); + * + * compiler.inlineCode({ + * type: 'inlineCode', + * value: 'foo(); `bar`; baz()' + * }); + * // '``foo(); `bar`; baz()``' + * + * @param {Object} node - `inlineCode` node. + * @return {string} - Markdown inline code. + */ +compilerPrototype.inlineCode = function (node) { + var value = node.value; + var ticks = repeat(TICK, longestStreak(value, TICK) + 1); + var start = ticks; + var end = ticks; + + if (value.charAt(0) === TICK) { + start += SPACE; + } + + if (value.charAt(value.length - 1) === TICK) { + end = SPACE + end; + } + + return start + node.value + end; +}; + +/** + * Stringify YAML front matter. + * + * @example + * var compiler = new Compiler(); + * + * compiler.yaml({ + * type: 'yaml', + * value: 'foo: bar' + * }); + * // '---\nfoo: bar\n---' + * + * @param {Object} node - `yaml` node. + * @return {string} - Markdown YAML document. + */ +compilerPrototype.yaml = function (node) { + var delimiter = repeat(DASH, YAML_FENCE_LENGTH); + var value = node.value ? LINE + node.value : EMPTY; + + return delimiter + value + LINE + delimiter; +}; + +/** + * Stringify a code block. + * + * Creates indented code when: + * + * - No language tag exists; + * - Not in `fences: true` mode; + * - A non-empty value exists. + * + * Otherwise, GFM fenced code is created: + * + * ```js + * foo(); + * ``` + * + * When in ``fence: `~` `` mode, uses tildes as fences: + * + * ~~~js + * foo(); + * ~~~ + * + * Knows about internal fences (Note: GitHub/Kramdown does + * not support this): + * + * ````javascript + * ```markdown + * foo + * ``` + * ```` + * + * Supports named entities in the language flag with + * `settings.encode` mode. + * + * @example + * var compiler = new Compiler(); + * + * compiler.code({ + * type: 'code', + * lang: 'js', + * value: 'fooo();' + * }); + * // '```js\nfooo();\n```' + * + * @param {Object} node - `code` node. + * @return {string} - Markdown code block. + */ +compilerPrototype.code = function (node) { + var value = node.value; + var marker = this.options.fence; + var language = this.encode(node.lang || EMPTY, node); + var fence; + + /* + * Probably pedantic. + */ + + if (!language && !this.options.fences && value) { + return pad(value, 1); + } + + fence = longestStreak(value, marker) + 1; + + /* + * Fix GFM / RedCarpet bug, where fence-like characters + * inside fenced code can exit a code-block. + * Yes, even when the outer fence uses different + * characters, or is longer. + * Thus, we can only pad the code to make it work. + */ + + if (FENCE.test(value)) { + value = pad(value, 1); + } + + fence = repeat(marker, Math.max(fence, MINIMUM_CODE_FENCE_LENGTH)); + + return fence + language + LINE + value + LINE + fence; +}; + +/** + * Stringify HTML. + * + * @example + * var compiler = new Compiler(); + * + * compiler.html({ + * type: 'html', + * value: '
bar
' + * }); + * // '
bar
' + * + * @param {Object} node - `html` node. + * @return {string} - Markdown HTML. + */ +compilerPrototype.html = function (node) { + return node.value; +}; + +/** + * Stringify a horizontal rule. + * + * The character used is configurable by `rule`: (`'_'`) + * + * ___ + * + * The number of repititions is defined through + * `ruleRepetition`: (`6`) + * + * ****** + * + * Whether spaces delimit each character, is configured + * through `ruleSpaces`: (`true`) + * + * * * * + * + * @example + * var compiler = new Compiler(); + * + * compiler.horizontalRule({ + * type: 'horizontalRule' + * }); + * // '***' + * + * @return {string} - Markdown rule. + */ +compilerPrototype.horizontalRule = function () { + var options = this.options; + var rule = repeat(options.rule, options.ruleRepetition); + + if (options.ruleSpaces) { + rule = rule.split(EMPTY).join(SPACE); + } + + return rule; +}; + +/** + * Stringify a strong. + * + * The marker used is configurable by `strong`, which + * defaults to an asterisk (`'*'`) but also accepts an + * underscore (`'_'`): + * + * _foo_ + * + * @example + * var compiler = new Compiler(); + * + * compiler.strong({ + * type: 'strong', + * children: [{ + * type: 'text', + * value: 'Foo' + * }] + * }); + * // '**Foo**' + * + * @param {Object} node - `strong` node. + * @return {string} - Markdown strong-emphasised text. + */ +compilerPrototype.strong = function (node) { + var marker = this.options.strong; + + marker = marker + marker; + + return marker + this.all(node).join(EMPTY) + marker; +}; + +/** + * Stringify an emphasis. + * + * The marker used is configurable by `emphasis`, which + * defaults to an underscore (`'_'`) but also accepts an + * asterisk (`'*'`): + * + * *foo* + * + * @example + * var compiler = new Compiler(); + * + * compiler.emphasis({ + * type: 'emphasis', + * children: [{ + * type: 'text', + * value: 'Foo' + * }] + * }); + * // '_Foo_' + * + * @param {Object} node - `emphasis` node. + * @return {string} - Markdown emphasised text. + */ +compilerPrototype.emphasis = function (node) { + var marker = this.options.emphasis; + + return marker + this.all(node).join(EMPTY) + marker; +}; + +/** + * Stringify a hard break. + * + * @example + * var compiler = new Compiler(); + * + * compiler.break({ + * type: 'break' + * }); + * // ' \n' + * + * @return {string} - Hard markdown break. + */ +compilerPrototype.break = function () { + return SPACE + SPACE + LINE; +}; + +/** + * Stringify a delete. + * + * @example + * var compiler = new Compiler(); + * + * compiler.delete({ + * type: 'delete', + * children: [{ + * type: 'text', + * value: 'Foo' + * }] + * }); + * // '~~Foo~~' + * + * @param {Object} node - `delete` node. + * @return {string} - Markdown strike-through. + */ +compilerPrototype.delete = function (node) { + return DOUBLE_TILDE + this.all(node).join(EMPTY) + DOUBLE_TILDE; +}; + +/** + * Stringify a link. + * + * When no title exists, the compiled `children` equal + * `href`, and `href` starts with a protocol, an auto + * link is created: + * + * + * + * Otherwise, is smart about enclosing `href` (see + * `encloseURI()`) and `title` (see `encloseTitle()`). + * + * [foo]( 'An "example" e-mail') + * + * Supports named entities in the `href` and `title` when + * in `settings.encode` mode. + * + * @example + * var compiler = new Compiler(); + * + * compiler.link({ + * type: 'link', + * href: 'http://example.com', + * title: 'Example Domain', + * children: [{ + * type: 'text', + * value: 'Foo' + * }] + * }); + * // '[Foo](http://example.com "Example Domain")' + * + * @param {Object} node - `link` node. + * @return {string} - Markdown link. + */ +compilerPrototype.link = function (node) { + var self = this; + var url = self.encode(node.href, node); + var value = self.all(node).join(EMPTY); + + if ( + node.title === null && + PROTOCOL.test(url) && + (url === value || url === MAILTO + value) + ) { + return encloseURI(url, true); + } + + url = encloseURI(url); + + if (node.title) { + url += SPACE + encloseTitle(self.encode(node.title, node)); + } + + value = SQUARE_BRACKET_OPEN + value + SQUARE_BRACKET_CLOSE; + + value += PARENTHESIS_OPEN + url + PARENTHESIS_CLOSE; + + return value; +}; + +/** + * Stringify a link label. + * + * Because link references are easily, mistakingly, + * created (for example, `[foo]`), reference nodes have + * an extra property depicting how it looked in the + * original document, so stringification can cause minimal + * changes. + * + * @example + * label({ + * type: 'referenceImage', + * referenceType: 'full', + * identifier: 'foo' + * }); + * // '[foo]' + * + * label({ + * type: 'referenceImage', + * referenceType: 'collapsed', + * identifier: 'foo' + * }); + * // '[]' + * + * label({ + * type: 'referenceImage', + * referenceType: 'shortcut', + * identifier: 'foo' + * }); + * // '' + * + * @param {Object} node - `linkReference` or + * `imageReference` node. + * @return {string} - Markdown label reference. + */ +function label(node) { + var value = EMPTY; + var type = node.referenceType; + + if (type === 'full') { + value = node.identifier; + } + + if (type !== 'shortcut') { + value = SQUARE_BRACKET_OPEN + value + SQUARE_BRACKET_CLOSE; + } + + return value; +} + +/** + * Stringify a link reference. + * + * See `label()` on how reference labels are created. + * + * @example + * var compiler = new Compiler(); + * + * compiler.linkReference({ + * type: 'linkReference', + * referenceType: 'collapsed', + * identifier: 'foo', + * children: [{ + * type: 'text', + * value: 'Foo' + * }] + * }); + * // '[Foo][]' + * + * @param {Object} node - `linkReference` node. + * @return {string} - Markdown link reference. + */ +compilerPrototype.linkReference = function (node) { + return SQUARE_BRACKET_OPEN + + this.all(node).join(EMPTY) + SQUARE_BRACKET_CLOSE + + label(node); +}; + +/** + * Stringify an image reference. + * + * See `label()` on how reference labels are created. + * + * Supports named entities in the `alt` when + * in `settings.encode` mode. + * + * @example + * var compiler = new Compiler(); + * + * compiler.imageReference({ + * type: 'imageReference', + * referenceType: 'full', + * identifier: 'foo', + * alt: 'Foo' + * }); + * // '![Foo][foo]' + * + * @param {Object} node - `imageReference` node. + * @return {string} - Markdown image reference. + */ +compilerPrototype.imageReference = function (node) { + var alt = this.encode(node.alt, node); + + return EXCLAMATION_MARK + + SQUARE_BRACKET_OPEN + alt + SQUARE_BRACKET_CLOSE + + label(node); +}; + +/** + * Stringify a footnote reference. + * + * @example + * var compiler = new Compiler(); + * + * compiler.footnoteReference({ + * type: 'footnoteReference', + * identifier: 'foo' + * }); + * // '[^foo]' + * + * @param {Object} node - `footnoteReference` node. + * @return {string} - Markdown footnote reference. + */ +compilerPrototype.footnoteReference = function (node) { + return SQUARE_BRACKET_OPEN + CARET + node.identifier + + SQUARE_BRACKET_CLOSE; +}; + +/** + * Stringify an link- or image definition. + * + * Is smart about enclosing `href` (see `encloseURI()`) and + * `title` (see `encloseTitle()`). + * + * [foo]: 'An "example" e-mail' + * + * @example + * var compiler = new Compiler(); + * + * compiler.definition({ + * type: 'definition', + * link: 'http://example.com', + * title: 'Example Domain', + * identifier: 'foo' + * }); + * // '[foo]: http://example.com "Example Domain"' + * + * @param {Object} node - `definition` node. + * @return {string} - Markdown link- or image definition. + */ +compilerPrototype.definition = function (node) { + var value = SQUARE_BRACKET_OPEN + node.identifier + SQUARE_BRACKET_CLOSE; + var url = encloseURI(node.link); + + if (node.title) { + url += SPACE + encloseTitle(node.title); + } + + return value + COLON + SPACE + url; +}; + +/** + * Stringify an image. + * + * Is smart about enclosing `href` (see `encloseURI()`) and + * `title` (see `encloseTitle()`). + * + * ![foo]( 'My "favourite" icon') + * + * Supports named entities in `src`, `alt`, and `title` + * when in `settings.encode` mode. + * + * @example + * var compiler = new Compiler(); + * + * compiler.image({ + * type: 'image', + * href: 'http://example.png/favicon.png', + * title: 'Example Icon', + * alt: 'Foo' + * }); + * // '![Foo](http://example.png/favicon.png "Example Icon")' + * + * @param {Object} node - `image` node. + * @return {string} - Markdown image. + */ +compilerPrototype.image = function (node) { + var encode = this.encode; + var url = encloseURI(encode(node.src, node)); + var value; + + if (node.title) { + url += SPACE + encloseTitle(encode(node.title, node)); + } + + value = EXCLAMATION_MARK + + SQUARE_BRACKET_OPEN + encode(node.alt || EMPTY, node) + + SQUARE_BRACKET_CLOSE; + + value += PARENTHESIS_OPEN + url + PARENTHESIS_CLOSE; + + return value; +}; + +/** + * Stringify a footnote. + * + * @example + * var compiler = new Compiler(); + * + * compiler.footnote({ + * type: 'footnote', + * children: [{ + * type: 'text', + * value: 'Foo' + * }] + * }); + * // '[^Foo]' + * + * @param {Object} node - `footnote` node. + * @return {string} - Markdown footnote. + */ +compilerPrototype.footnote = function (node) { + return SQUARE_BRACKET_OPEN + CARET + this.all(node).join(EMPTY) + + SQUARE_BRACKET_CLOSE; +}; + +/** + * Stringify a footnote definition. + * + * @example + * var compiler = new Compiler(); + * + * compiler.footnoteDefinition({ + * type: 'footnoteDefinition', + * identifier: 'foo', + * children: [{ + * type: 'paragraph', + * children: [{ + * type: 'text', + * value: 'bar' + * }] + * }] + * }); + * // '[^foo]: bar' + * + * @param {Object} node - `footnoteDefinition` node. + * @return {string} - Markdown footnote definition. + */ +compilerPrototype.footnoteDefinition = function (node) { + var id = node.identifier.toLowerCase(); + + return SQUARE_BRACKET_OPEN + CARET + id + + SQUARE_BRACKET_CLOSE + COLON + SPACE + + this.all(node).join(BREAK + repeat(SPACE, INDENT)); +}; + +/** + * Stringify table. + * + * Creates a fenced table by default, but not in + * `looseTable: true` mode: + * + * Foo | Bar + * :-: | --- + * Baz | Qux + * + * NOTE: Be careful with `looseTable: true` mode, as a + * loose table inside an indented code block on GitHub + * renders as an actual table! + * + * Creates a spaces table by default, but not in + * `spacedTable: false`: + * + * |Foo|Bar| + * |:-:|---| + * |Baz|Qux| + * + * @example + * var compiler = new Compiler(); + * + * compiler.table({ + * type: 'table', + * align: ['center', null], + * children: [ + * { + * type: 'tableHeader', + * children: [ + * { + * type: 'tableCell' + * children: [{ + * type: 'text' + * value: 'Foo' + * }] + * }, + * { + * type: 'tableCell' + * children: [{ + * type: 'text' + * value: 'Bar' + * }] + * } + * ] + * }, + * { + * type: 'tableRow', + * children: [ + * { + * type: 'tableCell' + * children: [{ + * type: 'text' + * value: 'Baz' + * }] + * }, + * { + * type: 'tableCell' + * children: [{ + * type: 'text' + * value: 'Qux' + * }] + * } + * ] + * } + * ] + * }); + * // '| Foo | Bar |\n| :-: | --- |\n| Baz | Qux |' + * + * @param {Object} node - `table` node. + * @return {string} - Markdown table. + */ +compilerPrototype.table = function (node) { + var self = this; + var loose = self.options.looseTable; + var spaced = self.options.spacedTable; + var rows = node.children; + var index = rows.length; + var result = []; + var start; + + while (index--) { + result[index] = self.all(rows[index]); + } + + start = loose ? EMPTY : spaced ? PIPE + SPACE : PIPE; + + return table(result, { + 'align': node.align, + 'start': start, + 'end': start.split(EMPTY).reverse().join(EMPTY), + 'delimiter': spaced ? SPACE + PIPE + SPACE : PIPE + }); +}; + +/** + * Stringify a table cell. + * + * @example + * var compiler = new Compiler(); + * + * compiler.tableCell({ + * type: 'tableCell', + * children: [{ + * type: 'text' + * value: 'Qux' + * }] + * }); + * // 'Qux' + * + * @param {Object} node - `tableCell` node. + * @return {string} - Markdown table cell. + */ +compilerPrototype.tableCell = function (node) { + return this.all(node).join(EMPTY); +}; + +/** + * Stringify the bound file. + * + * @example + * var file = new VFile('__Foo__'); + * + * file.namespace('mdast').ast = { + * type: 'strong', + * children: [{ + * type: 'text', + * value: 'Foo' + * }] + * }); + * + * new Compiler(file).compile(); + * // '**Foo**' + * + * @this {Compiler} + * @return {string} - Markdown document. + */ +compilerPrototype.compile = function () { + return this.visit(this.file.namespace('mdast').ast); +}; + +/* + * Expose `stringify` on `module.exports`. + */ + +module.exports = Compiler; + +},{"./defaults.js":7,"./utilities.js":11,"ccount":12,"extend.js":14,"he":15,"longest-streak":16,"markdown-table":17,"repeat-string":18}],11:[function(require,module,exports){ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module mdast:utilities + * @fileoverview Collection of tiny helpers useful for + * both parsing and compiling markdown. + */ + +'use strict'; + +/* + * Dependencies. + */ + +var collapseWhiteSpace = require('collapse-white-space'); + +/* + * Expressions. + */ + +var EXPRESSION_LINE_BREAKS = /\r\n|\r/g; +var EXPRESSION_SYMBOL_FOR_NEW_LINE = /\u2424/g; +var EXPRESSION_BOM = /^\ufeff/; + +/** + * Throw an exception with in its `message` `value` + * and `name`. + * + * @param {*} value - Invalid value. + * @param {string} name - Setting name. + */ +function raise(value, name) { + throw new Error( + 'Invalid value `' + value + '` ' + + 'for setting `' + name + '`' + ); +} + +/** + * Validate a value to be boolean. Defaults to `def`. + * Raises an exception with `context[name]` when not + * a boolean. + * + * @example + * validateBoolean({foo: null}, 'foo', true) // true + * validateBoolean({foo: false}, 'foo', true) // false + * validateBoolean({foo: 'bar'}, 'foo', true) // Throws + * + * @throws {Error} - When a setting is neither omitted nor + * a boolean. + * @param {Object} context - Settings. + * @param {string} name - Setting name. + * @param {boolean} def - Default value. + */ +function validateBoolean(context, name, def) { + var value = context[name]; + + if (value === null || value === undefined) { + value = def; + } + + if (typeof value !== 'boolean') { + raise(value, 'options.' + name); + } + + context[name] = value; +} + +/** + * Validate a value to be boolean. Defaults to `def`. + * Raises an exception with `context[name]` when not + * a boolean. + * + * @example + * validateNumber({foo: null}, 'foo', 1) // 1 + * validateNumber({foo: 2}, 'foo', 1) // 2 + * validateNumber({foo: 'bar'}, 'foo', 1) // Throws + * + * @throws {Error} - When a setting is neither omitted nor + * a number. + * @param {Object} context - Settings. + * @param {string} name - Setting name. + * @param {number} def - Default value. + */ +function validateNumber(context, name, def) { + var value = context[name]; + + if (value === null || value === undefined) { + value = def; + } + + if (typeof value !== 'number' || value !== value) { + raise(value, 'options.' + name); + } + + context[name] = value; +} + +/** + * Validate a value to be in `map`. Defaults to `def`. + * Raises an exception with `context[name]` when not + * not in `map`. + * + * @example + * var map = {bar: true, baz: true}; + * validateString({foo: null}, 'foo', 'bar', map) // 'bar' + * validateString({foo: 'baz'}, 'foo', 'bar', map) // 'baz' + * validateString({foo: true}, 'foo', 'bar', map) // Throws + * + * @throws {Error} - When a setting is neither omitted nor + * in `map`. + * @param {Object} context - Settings. + * @param {string} name - Setting name. + * @param {string} def - Default value. + * @param {Object} map - Enum. + */ +function validateString(context, name, def, map) { + var value = context[name]; + + if (value === null || value === undefined) { + value = def; + } + + if (!(value in map)) { + raise(value, 'options.' + name); + } + + context[name] = value; +} + +/** + * Clean a string in preperation of parsing. + * + * @example + * clean('\ufefffoo'); // 'foo' + * clean('foo\r\nbar'); // 'foo\nbar' + * clean('foo\u2424bar'); // 'foo\nbar' + * + * @param {string} value - Content to clean. + * @return {string} - Cleaned content. + */ +function clean(value) { + return String(value) + .replace(EXPRESSION_BOM, '') + .replace(EXPRESSION_LINE_BREAKS, '\n') + .replace(EXPRESSION_SYMBOL_FOR_NEW_LINE, '\n'); +} + +/** + * Normalize an identifier. Collapses multiple white space + * characters into a single space, and removes casing. + * + * @example + * normalizeIdentifier('FOO\t bar'); // 'foo bar' + * + * @param {string} value - Content to normalize. + * @return {string} - Normalized content. + */ +function normalizeIdentifier(value) { + return collapseWhiteSpace(value).toLowerCase(); +} + +/* + * Expose `validate`. + */ + +exports.validate = { + 'boolean': validateBoolean, + 'string': validateString, + 'number': validateNumber +}; + +/* + * Expose. + */ + +exports.normalizeIdentifier = normalizeIdentifier; +exports.clean = clean; +exports.raise = raise; + +},{"collapse-white-space":13}],12:[function(require,module,exports){ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer. All rights reserved. + * @module ccount + * @fileoverview Count characters. + */ + +'use strict'; + +/** + * Count how many characters `character` occur in `value`. + * + * @example + * ccount('foo(bar(baz)', '(') // 2 + * ccount('foo(bar(baz)', ')') // 1 + * + * @param {string} value - Content, coerced to string. + * @param {string} character - Single character to look + * for. + * @return {number} - Count. + * @throws {Error} - when `character` is not a single + * character. + */ +function ccount(value, character) { + var index = -1; + var count = 0; + var length; + + value = String(value); + length = value.length; + + if (typeof character !== 'string' || character.length !== 1) { + throw new Error('Expected character'); + } + + while (++index < length) { + if (value.charAt(index) === character) { + count++; + } + } + + return count; +} + +/* + * Expose. + */ + +module.exports = ccount; + +},{}],13:[function(require,module,exports){ +'use strict'; + +/* + * Constants. + */ + +var WHITE_SPACE_COLLAPSABLE = /\s+/g; +var SPACE = ' '; + +/** + * Replace multiple white-space characters with a single space. + * + * @example + * collapse(' \t\nbar \nbaz\t'); // ' bar baz ' + * + * @param {string} value - Value with uncollapsed white-space, + * coerced to string. + * @return {string} - Value with collapsed white-space. + */ +function collapse(value) { + return String(value).replace(WHITE_SPACE_COLLAPSABLE, SPACE); +} + +/* + * Expose. + */ + +module.exports = collapse; + +},{}],14:[function(require,module,exports){ +/** + * Extend an object with another. + * + * @param {Object, ...} src, ... + * @return {Object} merged + * @api private + */ + +module.exports = function(src) { + var objs = [].slice.call(arguments, 1), obj; + + for (var i = 0, len = objs.length; i < len; i++) { + obj = objs[i]; + for (var prop in obj) { + src[prop] = obj[prop]; + } + } + + return src; +} + +},{}],15:[function(require,module,exports){ +(function (global){ +/*! http://mths.be/he v0.5.0 by @mathias | MIT license */ +;(function(root) { + + // Detect free variables `exports`. + var freeExports = typeof exports == 'object' && exports; + + // Detect free variable `module`. + var freeModule = typeof module == 'object' && module && + module.exports == freeExports && module; + + // Detect free variable `global`, from Node.js or Browserified code, + // and use it as `root`. + var freeGlobal = typeof global == 'object' && global; + if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { + root = freeGlobal; + } + + /*--------------------------------------------------------------------------*/ + + // All astral symbols. + var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; + // All ASCII symbols (not just printable ASCII) except those listed in the + // first column of the overrides table. + // http://whatwg.org/html/tokenization.html#table-charref-overrides + var regexAsciiWhitelist = /[\x01-\x7F]/g; + // All BMP symbols that are not ASCII newlines, printable ASCII symbols, or + // code points listed in the first column of the overrides table on + // http://whatwg.org/html/tokenization.html#table-charref-overrides. + var regexBmpWhitelist = /[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g; + + var regexEncodeNonAscii = /<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g; + var encodeMap = {'\xC1':'Aacute','\xE1':'aacute','\u0102':'Abreve','\u0103':'abreve','\u223E':'ac','\u223F':'acd','\u223E\u0333':'acE','\xC2':'Acirc','\xE2':'acirc','\xB4':'acute','\u0410':'Acy','\u0430':'acy','\xC6':'AElig','\xE6':'aelig','\u2061':'af','\uD835\uDD04':'Afr','\uD835\uDD1E':'afr','\xC0':'Agrave','\xE0':'agrave','\u2135':'aleph','\u0391':'Alpha','\u03B1':'alpha','\u0100':'Amacr','\u0101':'amacr','\u2A3F':'amalg','&':'amp','\u2A55':'andand','\u2A53':'And','\u2227':'and','\u2A5C':'andd','\u2A58':'andslope','\u2A5A':'andv','\u2220':'ang','\u29A4':'ange','\u29A8':'angmsdaa','\u29A9':'angmsdab','\u29AA':'angmsdac','\u29AB':'angmsdad','\u29AC':'angmsdae','\u29AD':'angmsdaf','\u29AE':'angmsdag','\u29AF':'angmsdah','\u2221':'angmsd','\u221F':'angrt','\u22BE':'angrtvb','\u299D':'angrtvbd','\u2222':'angsph','\xC5':'angst','\u237C':'angzarr','\u0104':'Aogon','\u0105':'aogon','\uD835\uDD38':'Aopf','\uD835\uDD52':'aopf','\u2A6F':'apacir','\u2248':'ap','\u2A70':'apE','\u224A':'ape','\u224B':'apid','\'':'apos','\xE5':'aring','\uD835\uDC9C':'Ascr','\uD835\uDCB6':'ascr','\u2254':'colone','*':'ast','\u224D':'CupCap','\xC3':'Atilde','\xE3':'atilde','\xC4':'Auml','\xE4':'auml','\u2233':'awconint','\u2A11':'awint','\u224C':'bcong','\u03F6':'bepsi','\u2035':'bprime','\u223D':'bsim','\u22CD':'bsime','\u2216':'setmn','\u2AE7':'Barv','\u22BD':'barvee','\u2305':'barwed','\u2306':'Barwed','\u23B5':'bbrk','\u23B6':'bbrktbrk','\u0411':'Bcy','\u0431':'bcy','\u201E':'bdquo','\u2235':'becaus','\u29B0':'bemptyv','\u212C':'Bscr','\u0392':'Beta','\u03B2':'beta','\u2136':'beth','\u226C':'twixt','\uD835\uDD05':'Bfr','\uD835\uDD1F':'bfr','\u22C2':'xcap','\u25EF':'xcirc','\u22C3':'xcup','\u2A00':'xodot','\u2A01':'xoplus','\u2A02':'xotime','\u2A06':'xsqcup','\u2605':'starf','\u25BD':'xdtri','\u25B3':'xutri','\u2A04':'xuplus','\u22C1':'Vee','\u22C0':'Wedge','\u290D':'rbarr','\u29EB':'lozf','\u25AA':'squf','\u25B4':'utrif','\u25BE':'dtrif','\u25C2':'ltrif','\u25B8':'rtrif','\u2423':'blank','\u2592':'blk12','\u2591':'blk14','\u2593':'blk34','\u2588':'block','=\u20E5':'bne','\u2261\u20E5':'bnequiv','\u2AED':'bNot','\u2310':'bnot','\uD835\uDD39':'Bopf','\uD835\uDD53':'bopf','\u22A5':'bot','\u22C8':'bowtie','\u29C9':'boxbox','\u2510':'boxdl','\u2555':'boxdL','\u2556':'boxDl','\u2557':'boxDL','\u250C':'boxdr','\u2552':'boxdR','\u2553':'boxDr','\u2554':'boxDR','\u2500':'boxh','\u2550':'boxH','\u252C':'boxhd','\u2564':'boxHd','\u2565':'boxhD','\u2566':'boxHD','\u2534':'boxhu','\u2567':'boxHu','\u2568':'boxhU','\u2569':'boxHU','\u229F':'minusb','\u229E':'plusb','\u22A0':'timesb','\u2518':'boxul','\u255B':'boxuL','\u255C':'boxUl','\u255D':'boxUL','\u2514':'boxur','\u2558':'boxuR','\u2559':'boxUr','\u255A':'boxUR','\u2502':'boxv','\u2551':'boxV','\u253C':'boxvh','\u256A':'boxvH','\u256B':'boxVh','\u256C':'boxVH','\u2524':'boxvl','\u2561':'boxvL','\u2562':'boxVl','\u2563':'boxVL','\u251C':'boxvr','\u255E':'boxvR','\u255F':'boxVr','\u2560':'boxVR','\u02D8':'breve','\xA6':'brvbar','\uD835\uDCB7':'bscr','\u204F':'bsemi','\u29C5':'bsolb','\\':'bsol','\u27C8':'bsolhsub','\u2022':'bull','\u224E':'bump','\u2AAE':'bumpE','\u224F':'bumpe','\u0106':'Cacute','\u0107':'cacute','\u2A44':'capand','\u2A49':'capbrcup','\u2A4B':'capcap','\u2229':'cap','\u22D2':'Cap','\u2A47':'capcup','\u2A40':'capdot','\u2145':'DD','\u2229\uFE00':'caps','\u2041':'caret','\u02C7':'caron','\u212D':'Cfr','\u2A4D':'ccaps','\u010C':'Ccaron','\u010D':'ccaron','\xC7':'Ccedil','\xE7':'ccedil','\u0108':'Ccirc','\u0109':'ccirc','\u2230':'Cconint','\u2A4C':'ccups','\u2A50':'ccupssm','\u010A':'Cdot','\u010B':'cdot','\xB8':'cedil','\u29B2':'cemptyv','\xA2':'cent','\xB7':'middot','\uD835\uDD20':'cfr','\u0427':'CHcy','\u0447':'chcy','\u2713':'check','\u03A7':'Chi','\u03C7':'chi','\u02C6':'circ','\u2257':'cire','\u21BA':'olarr','\u21BB':'orarr','\u229B':'oast','\u229A':'ocir','\u229D':'odash','\u2299':'odot','\xAE':'reg','\u24C8':'oS','\u2296':'ominus','\u2295':'oplus','\u2297':'otimes','\u25CB':'cir','\u29C3':'cirE','\u2A10':'cirfnint','\u2AEF':'cirmid','\u29C2':'cirscir','\u2232':'cwconint','\u201D':'rdquo','\u2019':'rsquo','\u2663':'clubs',':':'colon','\u2237':'Colon','\u2A74':'Colone',',':'comma','@':'commat','\u2201':'comp','\u2218':'compfn','\u2102':'Copf','\u2245':'cong','\u2A6D':'congdot','\u2261':'equiv','\u222E':'oint','\u222F':'Conint','\uD835\uDD54':'copf','\u2210':'coprod','\xA9':'copy','\u2117':'copysr','\u21B5':'crarr','\u2717':'cross','\u2A2F':'Cross','\uD835\uDC9E':'Cscr','\uD835\uDCB8':'cscr','\u2ACF':'csub','\u2AD1':'csube','\u2AD0':'csup','\u2AD2':'csupe','\u22EF':'ctdot','\u2938':'cudarrl','\u2935':'cudarrr','\u22DE':'cuepr','\u22DF':'cuesc','\u21B6':'cularr','\u293D':'cularrp','\u2A48':'cupbrcap','\u2A46':'cupcap','\u222A':'cup','\u22D3':'Cup','\u2A4A':'cupcup','\u228D':'cupdot','\u2A45':'cupor','\u222A\uFE00':'cups','\u21B7':'curarr','\u293C':'curarrm','\u22CE':'cuvee','\u22CF':'cuwed','\xA4':'curren','\u2231':'cwint','\u232D':'cylcty','\u2020':'dagger','\u2021':'Dagger','\u2138':'daleth','\u2193':'darr','\u21A1':'Darr','\u21D3':'dArr','\u2010':'dash','\u2AE4':'Dashv','\u22A3':'dashv','\u290F':'rBarr','\u02DD':'dblac','\u010E':'Dcaron','\u010F':'dcaron','\u0414':'Dcy','\u0434':'dcy','\u21CA':'ddarr','\u2146':'dd','\u2911':'DDotrahd','\u2A77':'eDDot','\xB0':'deg','\u2207':'Del','\u0394':'Delta','\u03B4':'delta','\u29B1':'demptyv','\u297F':'dfisht','\uD835\uDD07':'Dfr','\uD835\uDD21':'dfr','\u2965':'dHar','\u21C3':'dharl','\u21C2':'dharr','\u02D9':'dot','`':'grave','\u02DC':'tilde','\u22C4':'diam','\u2666':'diams','\xA8':'die','\u03DD':'gammad','\u22F2':'disin','\xF7':'div','\u22C7':'divonx','\u0402':'DJcy','\u0452':'djcy','\u231E':'dlcorn','\u230D':'dlcrop','$':'dollar','\uD835\uDD3B':'Dopf','\uD835\uDD55':'dopf','\u20DC':'DotDot','\u2250':'doteq','\u2251':'eDot','\u2238':'minusd','\u2214':'plusdo','\u22A1':'sdotb','\u21D0':'lArr','\u21D4':'iff','\u27F8':'xlArr','\u27FA':'xhArr','\u27F9':'xrArr','\u21D2':'rArr','\u22A8':'vDash','\u21D1':'uArr','\u21D5':'vArr','\u2225':'par','\u2913':'DownArrowBar','\u21F5':'duarr','\u0311':'DownBreve','\u2950':'DownLeftRightVector','\u295E':'DownLeftTeeVector','\u2956':'DownLeftVectorBar','\u21BD':'lhard','\u295F':'DownRightTeeVector','\u2957':'DownRightVectorBar','\u21C1':'rhard','\u21A7':'mapstodown','\u22A4':'top','\u2910':'RBarr','\u231F':'drcorn','\u230C':'drcrop','\uD835\uDC9F':'Dscr','\uD835\uDCB9':'dscr','\u0405':'DScy','\u0455':'dscy','\u29F6':'dsol','\u0110':'Dstrok','\u0111':'dstrok','\u22F1':'dtdot','\u25BF':'dtri','\u296F':'duhar','\u29A6':'dwangle','\u040F':'DZcy','\u045F':'dzcy','\u27FF':'dzigrarr','\xC9':'Eacute','\xE9':'eacute','\u2A6E':'easter','\u011A':'Ecaron','\u011B':'ecaron','\xCA':'Ecirc','\xEA':'ecirc','\u2256':'ecir','\u2255':'ecolon','\u042D':'Ecy','\u044D':'ecy','\u0116':'Edot','\u0117':'edot','\u2147':'ee','\u2252':'efDot','\uD835\uDD08':'Efr','\uD835\uDD22':'efr','\u2A9A':'eg','\xC8':'Egrave','\xE8':'egrave','\u2A96':'egs','\u2A98':'egsdot','\u2A99':'el','\u2208':'in','\u23E7':'elinters','\u2113':'ell','\u2A95':'els','\u2A97':'elsdot','\u0112':'Emacr','\u0113':'emacr','\u2205':'empty','\u25FB':'EmptySmallSquare','\u25AB':'EmptyVerySmallSquare','\u2004':'emsp13','\u2005':'emsp14','\u2003':'emsp','\u014A':'ENG','\u014B':'eng','\u2002':'ensp','\u0118':'Eogon','\u0119':'eogon','\uD835\uDD3C':'Eopf','\uD835\uDD56':'eopf','\u22D5':'epar','\u29E3':'eparsl','\u2A71':'eplus','\u03B5':'epsi','\u0395':'Epsilon','\u03F5':'epsiv','\u2242':'esim','\u2A75':'Equal','=':'equals','\u225F':'equest','\u21CC':'rlhar','\u2A78':'equivDD','\u29E5':'eqvparsl','\u2971':'erarr','\u2253':'erDot','\u212F':'escr','\u2130':'Escr','\u2A73':'Esim','\u0397':'Eta','\u03B7':'eta','\xD0':'ETH','\xF0':'eth','\xCB':'Euml','\xEB':'euml','\u20AC':'euro','!':'excl','\u2203':'exist','\u0424':'Fcy','\u0444':'fcy','\u2640':'female','\uFB03':'ffilig','\uFB00':'fflig','\uFB04':'ffllig','\uD835\uDD09':'Ffr','\uD835\uDD23':'ffr','\uFB01':'filig','\u25FC':'FilledSmallSquare','fj':'fjlig','\u266D':'flat','\uFB02':'fllig','\u25B1':'fltns','\u0192':'fnof','\uD835\uDD3D':'Fopf','\uD835\uDD57':'fopf','\u2200':'forall','\u22D4':'fork','\u2AD9':'forkv','\u2131':'Fscr','\u2A0D':'fpartint','\xBD':'half','\u2153':'frac13','\xBC':'frac14','\u2155':'frac15','\u2159':'frac16','\u215B':'frac18','\u2154':'frac23','\u2156':'frac25','\xBE':'frac34','\u2157':'frac35','\u215C':'frac38','\u2158':'frac45','\u215A':'frac56','\u215D':'frac58','\u215E':'frac78','\u2044':'frasl','\u2322':'frown','\uD835\uDCBB':'fscr','\u01F5':'gacute','\u0393':'Gamma','\u03B3':'gamma','\u03DC':'Gammad','\u2A86':'gap','\u011E':'Gbreve','\u011F':'gbreve','\u0122':'Gcedil','\u011C':'Gcirc','\u011D':'gcirc','\u0413':'Gcy','\u0433':'gcy','\u0120':'Gdot','\u0121':'gdot','\u2265':'ge','\u2267':'gE','\u2A8C':'gEl','\u22DB':'gel','\u2A7E':'ges','\u2AA9':'gescc','\u2A80':'gesdot','\u2A82':'gesdoto','\u2A84':'gesdotol','\u22DB\uFE00':'gesl','\u2A94':'gesles','\uD835\uDD0A':'Gfr','\uD835\uDD24':'gfr','\u226B':'gg','\u22D9':'Gg','\u2137':'gimel','\u0403':'GJcy','\u0453':'gjcy','\u2AA5':'gla','\u2277':'gl','\u2A92':'glE','\u2AA4':'glj','\u2A8A':'gnap','\u2A88':'gne','\u2269':'gnE','\u22E7':'gnsim','\uD835\uDD3E':'Gopf','\uD835\uDD58':'gopf','\u2AA2':'GreaterGreater','\u2273':'gsim','\uD835\uDCA2':'Gscr','\u210A':'gscr','\u2A8E':'gsime','\u2A90':'gsiml','\u2AA7':'gtcc','\u2A7A':'gtcir','>':'gt','\u22D7':'gtdot','\u2995':'gtlPar','\u2A7C':'gtquest','\u2978':'gtrarr','\u2269\uFE00':'gvnE','\u200A':'hairsp','\u210B':'Hscr','\u042A':'HARDcy','\u044A':'hardcy','\u2948':'harrcir','\u2194':'harr','\u21AD':'harrw','^':'Hat','\u210F':'hbar','\u0124':'Hcirc','\u0125':'hcirc','\u2665':'hearts','\u2026':'mldr','\u22B9':'hercon','\uD835\uDD25':'hfr','\u210C':'Hfr','\u2925':'searhk','\u2926':'swarhk','\u21FF':'hoarr','\u223B':'homtht','\u21A9':'larrhk','\u21AA':'rarrhk','\uD835\uDD59':'hopf','\u210D':'Hopf','\u2015':'horbar','\uD835\uDCBD':'hscr','\u0126':'Hstrok','\u0127':'hstrok','\u2043':'hybull','\xCD':'Iacute','\xED':'iacute','\u2063':'ic','\xCE':'Icirc','\xEE':'icirc','\u0418':'Icy','\u0438':'icy','\u0130':'Idot','\u0415':'IEcy','\u0435':'iecy','\xA1':'iexcl','\uD835\uDD26':'ifr','\u2111':'Im','\xCC':'Igrave','\xEC':'igrave','\u2148':'ii','\u2A0C':'qint','\u222D':'tint','\u29DC':'iinfin','\u2129':'iiota','\u0132':'IJlig','\u0133':'ijlig','\u012A':'Imacr','\u012B':'imacr','\u2110':'Iscr','\u0131':'imath','\u22B7':'imof','\u01B5':'imped','\u2105':'incare','\u221E':'infin','\u29DD':'infintie','\u22BA':'intcal','\u222B':'int','\u222C':'Int','\u2124':'Zopf','\u2A17':'intlarhk','\u2A3C':'iprod','\u2062':'it','\u0401':'IOcy','\u0451':'iocy','\u012E':'Iogon','\u012F':'iogon','\uD835\uDD40':'Iopf','\uD835\uDD5A':'iopf','\u0399':'Iota','\u03B9':'iota','\xBF':'iquest','\uD835\uDCBE':'iscr','\u22F5':'isindot','\u22F9':'isinE','\u22F4':'isins','\u22F3':'isinsv','\u0128':'Itilde','\u0129':'itilde','\u0406':'Iukcy','\u0456':'iukcy','\xCF':'Iuml','\xEF':'iuml','\u0134':'Jcirc','\u0135':'jcirc','\u0419':'Jcy','\u0439':'jcy','\uD835\uDD0D':'Jfr','\uD835\uDD27':'jfr','\u0237':'jmath','\uD835\uDD41':'Jopf','\uD835\uDD5B':'jopf','\uD835\uDCA5':'Jscr','\uD835\uDCBF':'jscr','\u0408':'Jsercy','\u0458':'jsercy','\u0404':'Jukcy','\u0454':'jukcy','\u039A':'Kappa','\u03BA':'kappa','\u03F0':'kappav','\u0136':'Kcedil','\u0137':'kcedil','\u041A':'Kcy','\u043A':'kcy','\uD835\uDD0E':'Kfr','\uD835\uDD28':'kfr','\u0138':'kgreen','\u0425':'KHcy','\u0445':'khcy','\u040C':'KJcy','\u045C':'kjcy','\uD835\uDD42':'Kopf','\uD835\uDD5C':'kopf','\uD835\uDCA6':'Kscr','\uD835\uDCC0':'kscr','\u21DA':'lAarr','\u0139':'Lacute','\u013A':'lacute','\u29B4':'laemptyv','\u2112':'Lscr','\u039B':'Lambda','\u03BB':'lambda','\u27E8':'lang','\u27EA':'Lang','\u2991':'langd','\u2A85':'lap','\xAB':'laquo','\u21E4':'larrb','\u291F':'larrbfs','\u2190':'larr','\u219E':'Larr','\u291D':'larrfs','\u21AB':'larrlp','\u2939':'larrpl','\u2973':'larrsim','\u21A2':'larrtl','\u2919':'latail','\u291B':'lAtail','\u2AAB':'lat','\u2AAD':'late','\u2AAD\uFE00':'lates','\u290C':'lbarr','\u290E':'lBarr','\u2772':'lbbrk','{':'lcub','[':'lsqb','\u298B':'lbrke','\u298F':'lbrksld','\u298D':'lbrkslu','\u013D':'Lcaron','\u013E':'lcaron','\u013B':'Lcedil','\u013C':'lcedil','\u2308':'lceil','\u041B':'Lcy','\u043B':'lcy','\u2936':'ldca','\u201C':'ldquo','\u2967':'ldrdhar','\u294B':'ldrushar','\u21B2':'ldsh','\u2264':'le','\u2266':'lE','\u21C6':'lrarr','\u27E6':'lobrk','\u2961':'LeftDownTeeVector','\u2959':'LeftDownVectorBar','\u230A':'lfloor','\u21BC':'lharu','\u21C7':'llarr','\u21CB':'lrhar','\u294E':'LeftRightVector','\u21A4':'mapstoleft','\u295A':'LeftTeeVector','\u22CB':'lthree','\u29CF':'LeftTriangleBar','\u22B2':'vltri','\u22B4':'ltrie','\u2951':'LeftUpDownVector','\u2960':'LeftUpTeeVector','\u2958':'LeftUpVectorBar','\u21BF':'uharl','\u2952':'LeftVectorBar','\u2A8B':'lEg','\u22DA':'leg','\u2A7D':'les','\u2AA8':'lescc','\u2A7F':'lesdot','\u2A81':'lesdoto','\u2A83':'lesdotor','\u22DA\uFE00':'lesg','\u2A93':'lesges','\u22D6':'ltdot','\u2276':'lg','\u2AA1':'LessLess','\u2272':'lsim','\u297C':'lfisht','\uD835\uDD0F':'Lfr','\uD835\uDD29':'lfr','\u2A91':'lgE','\u2962':'lHar','\u296A':'lharul','\u2584':'lhblk','\u0409':'LJcy','\u0459':'ljcy','\u226A':'ll','\u22D8':'Ll','\u296B':'llhard','\u25FA':'lltri','\u013F':'Lmidot','\u0140':'lmidot','\u23B0':'lmoust','\u2A89':'lnap','\u2A87':'lne','\u2268':'lnE','\u22E6':'lnsim','\u27EC':'loang','\u21FD':'loarr','\u27F5':'xlarr','\u27F7':'xharr','\u27FC':'xmap','\u27F6':'xrarr','\u21AC':'rarrlp','\u2985':'lopar','\uD835\uDD43':'Lopf','\uD835\uDD5D':'lopf','\u2A2D':'loplus','\u2A34':'lotimes','\u2217':'lowast','_':'lowbar','\u2199':'swarr','\u2198':'searr','\u25CA':'loz','(':'lpar','\u2993':'lparlt','\u296D':'lrhard','\u200E':'lrm','\u22BF':'lrtri','\u2039':'lsaquo','\uD835\uDCC1':'lscr','\u21B0':'lsh','\u2A8D':'lsime','\u2A8F':'lsimg','\u2018':'lsquo','\u201A':'sbquo','\u0141':'Lstrok','\u0142':'lstrok','\u2AA6':'ltcc','\u2A79':'ltcir','<':'lt','\u22C9':'ltimes','\u2976':'ltlarr','\u2A7B':'ltquest','\u25C3':'ltri','\u2996':'ltrPar','\u294A':'lurdshar','\u2966':'luruhar','\u2268\uFE00':'lvnE','\xAF':'macr','\u2642':'male','\u2720':'malt','\u2905':'Map','\u21A6':'map','\u21A5':'mapstoup','\u25AE':'marker','\u2A29':'mcomma','\u041C':'Mcy','\u043C':'mcy','\u2014':'mdash','\u223A':'mDDot','\u205F':'MediumSpace','\u2133':'Mscr','\uD835\uDD10':'Mfr','\uD835\uDD2A':'mfr','\u2127':'mho','\xB5':'micro','\u2AF0':'midcir','\u2223':'mid','\u2212':'minus','\u2A2A':'minusdu','\u2213':'mp','\u2ADB':'mlcp','\u22A7':'models','\uD835\uDD44':'Mopf','\uD835\uDD5E':'mopf','\uD835\uDCC2':'mscr','\u039C':'Mu','\u03BC':'mu','\u22B8':'mumap','\u0143':'Nacute','\u0144':'nacute','\u2220\u20D2':'nang','\u2249':'nap','\u2A70\u0338':'napE','\u224B\u0338':'napid','\u0149':'napos','\u266E':'natur','\u2115':'Nopf','\xA0':'nbsp','\u224E\u0338':'nbump','\u224F\u0338':'nbumpe','\u2A43':'ncap','\u0147':'Ncaron','\u0148':'ncaron','\u0145':'Ncedil','\u0146':'ncedil','\u2247':'ncong','\u2A6D\u0338':'ncongdot','\u2A42':'ncup','\u041D':'Ncy','\u043D':'ncy','\u2013':'ndash','\u2924':'nearhk','\u2197':'nearr','\u21D7':'neArr','\u2260':'ne','\u2250\u0338':'nedot','\u200B':'ZeroWidthSpace','\u2262':'nequiv','\u2928':'toea','\u2242\u0338':'nesim','\n':'NewLine','\u2204':'nexist','\uD835\uDD11':'Nfr','\uD835\uDD2B':'nfr','\u2267\u0338':'ngE','\u2271':'nge','\u2A7E\u0338':'nges','\u22D9\u0338':'nGg','\u2275':'ngsim','\u226B\u20D2':'nGt','\u226F':'ngt','\u226B\u0338':'nGtv','\u21AE':'nharr','\u21CE':'nhArr','\u2AF2':'nhpar','\u220B':'ni','\u22FC':'nis','\u22FA':'nisd','\u040A':'NJcy','\u045A':'njcy','\u219A':'nlarr','\u21CD':'nlArr','\u2025':'nldr','\u2266\u0338':'nlE','\u2270':'nle','\u2A7D\u0338':'nles','\u226E':'nlt','\u22D8\u0338':'nLl','\u2274':'nlsim','\u226A\u20D2':'nLt','\u22EA':'nltri','\u22EC':'nltrie','\u226A\u0338':'nLtv','\u2224':'nmid','\u2060':'NoBreak','\uD835\uDD5F':'nopf','\u2AEC':'Not','\xAC':'not','\u226D':'NotCupCap','\u2226':'npar','\u2209':'notin','\u2279':'ntgl','\u22F5\u0338':'notindot','\u22F9\u0338':'notinE','\u22F7':'notinvb','\u22F6':'notinvc','\u29CF\u0338':'NotLeftTriangleBar','\u2278':'ntlg','\u2AA2\u0338':'NotNestedGreaterGreater','\u2AA1\u0338':'NotNestedLessLess','\u220C':'notni','\u22FE':'notnivb','\u22FD':'notnivc','\u2280':'npr','\u2AAF\u0338':'npre','\u22E0':'nprcue','\u29D0\u0338':'NotRightTriangleBar','\u22EB':'nrtri','\u22ED':'nrtrie','\u228F\u0338':'NotSquareSubset','\u22E2':'nsqsube','\u2290\u0338':'NotSquareSuperset','\u22E3':'nsqsupe','\u2282\u20D2':'vnsub','\u2288':'nsube','\u2281':'nsc','\u2AB0\u0338':'nsce','\u22E1':'nsccue','\u227F\u0338':'NotSucceedsTilde','\u2283\u20D2':'vnsup','\u2289':'nsupe','\u2241':'nsim','\u2244':'nsime','\u2AFD\u20E5':'nparsl','\u2202\u0338':'npart','\u2A14':'npolint','\u2933\u0338':'nrarrc','\u219B':'nrarr','\u21CF':'nrArr','\u219D\u0338':'nrarrw','\uD835\uDCA9':'Nscr','\uD835\uDCC3':'nscr','\u2284':'nsub','\u2AC5\u0338':'nsubE','\u2285':'nsup','\u2AC6\u0338':'nsupE','\xD1':'Ntilde','\xF1':'ntilde','\u039D':'Nu','\u03BD':'nu','#':'num','\u2116':'numero','\u2007':'numsp','\u224D\u20D2':'nvap','\u22AC':'nvdash','\u22AD':'nvDash','\u22AE':'nVdash','\u22AF':'nVDash','\u2265\u20D2':'nvge','>\u20D2':'nvgt','\u2904':'nvHarr','\u29DE':'nvinfin','\u2902':'nvlArr','\u2264\u20D2':'nvle','<\u20D2':'nvlt','\u22B4\u20D2':'nvltrie','\u2903':'nvrArr','\u22B5\u20D2':'nvrtrie','\u223C\u20D2':'nvsim','\u2923':'nwarhk','\u2196':'nwarr','\u21D6':'nwArr','\u2927':'nwnear','\xD3':'Oacute','\xF3':'oacute','\xD4':'Ocirc','\xF4':'ocirc','\u041E':'Ocy','\u043E':'ocy','\u0150':'Odblac','\u0151':'odblac','\u2A38':'odiv','\u29BC':'odsold','\u0152':'OElig','\u0153':'oelig','\u29BF':'ofcir','\uD835\uDD12':'Ofr','\uD835\uDD2C':'ofr','\u02DB':'ogon','\xD2':'Ograve','\xF2':'ograve','\u29C1':'ogt','\u29B5':'ohbar','\u03A9':'ohm','\u29BE':'olcir','\u29BB':'olcross','\u203E':'oline','\u29C0':'olt','\u014C':'Omacr','\u014D':'omacr','\u03C9':'omega','\u039F':'Omicron','\u03BF':'omicron','\u29B6':'omid','\uD835\uDD46':'Oopf','\uD835\uDD60':'oopf','\u29B7':'opar','\u29B9':'operp','\u2A54':'Or','\u2228':'or','\u2A5D':'ord','\u2134':'oscr','\xAA':'ordf','\xBA':'ordm','\u22B6':'origof','\u2A56':'oror','\u2A57':'orslope','\u2A5B':'orv','\uD835\uDCAA':'Oscr','\xD8':'Oslash','\xF8':'oslash','\u2298':'osol','\xD5':'Otilde','\xF5':'otilde','\u2A36':'otimesas','\u2A37':'Otimes','\xD6':'Ouml','\xF6':'ouml','\u233D':'ovbar','\u23DE':'OverBrace','\u23B4':'tbrk','\u23DC':'OverParenthesis','\xB6':'para','\u2AF3':'parsim','\u2AFD':'parsl','\u2202':'part','\u041F':'Pcy','\u043F':'pcy','%':'percnt','.':'period','\u2030':'permil','\u2031':'pertenk','\uD835\uDD13':'Pfr','\uD835\uDD2D':'pfr','\u03A6':'Phi','\u03C6':'phi','\u03D5':'phiv','\u260E':'phone','\u03A0':'Pi','\u03C0':'pi','\u03D6':'piv','\u210E':'planckh','\u2A23':'plusacir','\u2A22':'pluscir','+':'plus','\u2A25':'plusdu','\u2A72':'pluse','\xB1':'pm','\u2A26':'plussim','\u2A27':'plustwo','\u2A15':'pointint','\uD835\uDD61':'popf','\u2119':'Popf','\xA3':'pound','\u2AB7':'prap','\u2ABB':'Pr','\u227A':'pr','\u227C':'prcue','\u2AAF':'pre','\u227E':'prsim','\u2AB9':'prnap','\u2AB5':'prnE','\u22E8':'prnsim','\u2AB3':'prE','\u2032':'prime','\u2033':'Prime','\u220F':'prod','\u232E':'profalar','\u2312':'profline','\u2313':'profsurf','\u221D':'prop','\u22B0':'prurel','\uD835\uDCAB':'Pscr','\uD835\uDCC5':'pscr','\u03A8':'Psi','\u03C8':'psi','\u2008':'puncsp','\uD835\uDD14':'Qfr','\uD835\uDD2E':'qfr','\uD835\uDD62':'qopf','\u211A':'Qopf','\u2057':'qprime','\uD835\uDCAC':'Qscr','\uD835\uDCC6':'qscr','\u2A16':'quatint','?':'quest','"':'quot','\u21DB':'rAarr','\u223D\u0331':'race','\u0154':'Racute','\u0155':'racute','\u221A':'Sqrt','\u29B3':'raemptyv','\u27E9':'rang','\u27EB':'Rang','\u2992':'rangd','\u29A5':'range','\xBB':'raquo','\u2975':'rarrap','\u21E5':'rarrb','\u2920':'rarrbfs','\u2933':'rarrc','\u2192':'rarr','\u21A0':'Rarr','\u291E':'rarrfs','\u2945':'rarrpl','\u2974':'rarrsim','\u2916':'Rarrtl','\u21A3':'rarrtl','\u219D':'rarrw','\u291A':'ratail','\u291C':'rAtail','\u2236':'ratio','\u2773':'rbbrk','}':'rcub',']':'rsqb','\u298C':'rbrke','\u298E':'rbrksld','\u2990':'rbrkslu','\u0158':'Rcaron','\u0159':'rcaron','\u0156':'Rcedil','\u0157':'rcedil','\u2309':'rceil','\u0420':'Rcy','\u0440':'rcy','\u2937':'rdca','\u2969':'rdldhar','\u21B3':'rdsh','\u211C':'Re','\u211B':'Rscr','\u211D':'Ropf','\u25AD':'rect','\u297D':'rfisht','\u230B':'rfloor','\uD835\uDD2F':'rfr','\u2964':'rHar','\u21C0':'rharu','\u296C':'rharul','\u03A1':'Rho','\u03C1':'rho','\u03F1':'rhov','\u21C4':'rlarr','\u27E7':'robrk','\u295D':'RightDownTeeVector','\u2955':'RightDownVectorBar','\u21C9':'rrarr','\u22A2':'vdash','\u295B':'RightTeeVector','\u22CC':'rthree','\u29D0':'RightTriangleBar','\u22B3':'vrtri','\u22B5':'rtrie','\u294F':'RightUpDownVector','\u295C':'RightUpTeeVector','\u2954':'RightUpVectorBar','\u21BE':'uharr','\u2953':'RightVectorBar','\u02DA':'ring','\u200F':'rlm','\u23B1':'rmoust','\u2AEE':'rnmid','\u27ED':'roang','\u21FE':'roarr','\u2986':'ropar','\uD835\uDD63':'ropf','\u2A2E':'roplus','\u2A35':'rotimes','\u2970':'RoundImplies',')':'rpar','\u2994':'rpargt','\u2A12':'rppolint','\u203A':'rsaquo','\uD835\uDCC7':'rscr','\u21B1':'rsh','\u22CA':'rtimes','\u25B9':'rtri','\u29CE':'rtriltri','\u29F4':'RuleDelayed','\u2968':'ruluhar','\u211E':'rx','\u015A':'Sacute','\u015B':'sacute','\u2AB8':'scap','\u0160':'Scaron','\u0161':'scaron','\u2ABC':'Sc','\u227B':'sc','\u227D':'sccue','\u2AB0':'sce','\u2AB4':'scE','\u015E':'Scedil','\u015F':'scedil','\u015C':'Scirc','\u015D':'scirc','\u2ABA':'scnap','\u2AB6':'scnE','\u22E9':'scnsim','\u2A13':'scpolint','\u227F':'scsim','\u0421':'Scy','\u0441':'scy','\u22C5':'sdot','\u2A66':'sdote','\u21D8':'seArr','\xA7':'sect',';':'semi','\u2929':'tosa','\u2736':'sext','\uD835\uDD16':'Sfr','\uD835\uDD30':'sfr','\u266F':'sharp','\u0429':'SHCHcy','\u0449':'shchcy','\u0428':'SHcy','\u0448':'shcy','\u2191':'uarr','\xAD':'shy','\u03A3':'Sigma','\u03C3':'sigma','\u03C2':'sigmaf','\u223C':'sim','\u2A6A':'simdot','\u2243':'sime','\u2A9E':'simg','\u2AA0':'simgE','\u2A9D':'siml','\u2A9F':'simlE','\u2246':'simne','\u2A24':'simplus','\u2972':'simrarr','\u2A33':'smashp','\u29E4':'smeparsl','\u2323':'smile','\u2AAA':'smt','\u2AAC':'smte','\u2AAC\uFE00':'smtes','\u042C':'SOFTcy','\u044C':'softcy','\u233F':'solbar','\u29C4':'solb','/':'sol','\uD835\uDD4A':'Sopf','\uD835\uDD64':'sopf','\u2660':'spades','\u2293':'sqcap','\u2293\uFE00':'sqcaps','\u2294':'sqcup','\u2294\uFE00':'sqcups','\u228F':'sqsub','\u2291':'sqsube','\u2290':'sqsup','\u2292':'sqsupe','\u25A1':'squ','\uD835\uDCAE':'Sscr','\uD835\uDCC8':'sscr','\u22C6':'Star','\u2606':'star','\u2282':'sub','\u22D0':'Sub','\u2ABD':'subdot','\u2AC5':'subE','\u2286':'sube','\u2AC3':'subedot','\u2AC1':'submult','\u2ACB':'subnE','\u228A':'subne','\u2ABF':'subplus','\u2979':'subrarr','\u2AC7':'subsim','\u2AD5':'subsub','\u2AD3':'subsup','\u2211':'sum','\u266A':'sung','\xB9':'sup1','\xB2':'sup2','\xB3':'sup3','\u2283':'sup','\u22D1':'Sup','\u2ABE':'supdot','\u2AD8':'supdsub','\u2AC6':'supE','\u2287':'supe','\u2AC4':'supedot','\u27C9':'suphsol','\u2AD7':'suphsub','\u297B':'suplarr','\u2AC2':'supmult','\u2ACC':'supnE','\u228B':'supne','\u2AC0':'supplus','\u2AC8':'supsim','\u2AD4':'supsub','\u2AD6':'supsup','\u21D9':'swArr','\u292A':'swnwar','\xDF':'szlig','\t':'Tab','\u2316':'target','\u03A4':'Tau','\u03C4':'tau','\u0164':'Tcaron','\u0165':'tcaron','\u0162':'Tcedil','\u0163':'tcedil','\u0422':'Tcy','\u0442':'tcy','\u20DB':'tdot','\u2315':'telrec','\uD835\uDD17':'Tfr','\uD835\uDD31':'tfr','\u2234':'there4','\u0398':'Theta','\u03B8':'theta','\u03D1':'thetav','\u205F\u200A':'ThickSpace','\u2009':'thinsp','\xDE':'THORN','\xFE':'thorn','\u2A31':'timesbar','\xD7':'times','\u2A30':'timesd','\u2336':'topbot','\u2AF1':'topcir','\uD835\uDD4B':'Topf','\uD835\uDD65':'topf','\u2ADA':'topfork','\u2034':'tprime','\u2122':'trade','\u25B5':'utri','\u225C':'trie','\u25EC':'tridot','\u2A3A':'triminus','\u2A39':'triplus','\u29CD':'trisb','\u2A3B':'tritime','\u23E2':'trpezium','\uD835\uDCAF':'Tscr','\uD835\uDCC9':'tscr','\u0426':'TScy','\u0446':'tscy','\u040B':'TSHcy','\u045B':'tshcy','\u0166':'Tstrok','\u0167':'tstrok','\xDA':'Uacute','\xFA':'uacute','\u219F':'Uarr','\u2949':'Uarrocir','\u040E':'Ubrcy','\u045E':'ubrcy','\u016C':'Ubreve','\u016D':'ubreve','\xDB':'Ucirc','\xFB':'ucirc','\u0423':'Ucy','\u0443':'ucy','\u21C5':'udarr','\u0170':'Udblac','\u0171':'udblac','\u296E':'udhar','\u297E':'ufisht','\uD835\uDD18':'Ufr','\uD835\uDD32':'ufr','\xD9':'Ugrave','\xF9':'ugrave','\u2963':'uHar','\u2580':'uhblk','\u231C':'ulcorn','\u230F':'ulcrop','\u25F8':'ultri','\u016A':'Umacr','\u016B':'umacr','\u23DF':'UnderBrace','\u23DD':'UnderParenthesis','\u228E':'uplus','\u0172':'Uogon','\u0173':'uogon','\uD835\uDD4C':'Uopf','\uD835\uDD66':'uopf','\u2912':'UpArrowBar','\u2195':'varr','\u03C5':'upsi','\u03D2':'Upsi','\u03A5':'Upsilon','\u21C8':'uuarr','\u231D':'urcorn','\u230E':'urcrop','\u016E':'Uring','\u016F':'uring','\u25F9':'urtri','\uD835\uDCB0':'Uscr','\uD835\uDCCA':'uscr','\u22F0':'utdot','\u0168':'Utilde','\u0169':'utilde','\xDC':'Uuml','\xFC':'uuml','\u29A7':'uwangle','\u299C':'vangrt','\u228A\uFE00':'vsubne','\u2ACB\uFE00':'vsubnE','\u228B\uFE00':'vsupne','\u2ACC\uFE00':'vsupnE','\u2AE8':'vBar','\u2AEB':'Vbar','\u2AE9':'vBarv','\u0412':'Vcy','\u0432':'vcy','\u22A9':'Vdash','\u22AB':'VDash','\u2AE6':'Vdashl','\u22BB':'veebar','\u225A':'veeeq','\u22EE':'vellip','|':'vert','\u2016':'Vert','\u2758':'VerticalSeparator','\u2240':'wr','\uD835\uDD19':'Vfr','\uD835\uDD33':'vfr','\uD835\uDD4D':'Vopf','\uD835\uDD67':'vopf','\uD835\uDCB1':'Vscr','\uD835\uDCCB':'vscr','\u22AA':'Vvdash','\u299A':'vzigzag','\u0174':'Wcirc','\u0175':'wcirc','\u2A5F':'wedbar','\u2259':'wedgeq','\u2118':'wp','\uD835\uDD1A':'Wfr','\uD835\uDD34':'wfr','\uD835\uDD4E':'Wopf','\uD835\uDD68':'wopf','\uD835\uDCB2':'Wscr','\uD835\uDCCC':'wscr','\uD835\uDD1B':'Xfr','\uD835\uDD35':'xfr','\u039E':'Xi','\u03BE':'xi','\u22FB':'xnis','\uD835\uDD4F':'Xopf','\uD835\uDD69':'xopf','\uD835\uDCB3':'Xscr','\uD835\uDCCD':'xscr','\xDD':'Yacute','\xFD':'yacute','\u042F':'YAcy','\u044F':'yacy','\u0176':'Ycirc','\u0177':'ycirc','\u042B':'Ycy','\u044B':'ycy','\xA5':'yen','\uD835\uDD1C':'Yfr','\uD835\uDD36':'yfr','\u0407':'YIcy','\u0457':'yicy','\uD835\uDD50':'Yopf','\uD835\uDD6A':'yopf','\uD835\uDCB4':'Yscr','\uD835\uDCCE':'yscr','\u042E':'YUcy','\u044E':'yucy','\xFF':'yuml','\u0178':'Yuml','\u0179':'Zacute','\u017A':'zacute','\u017D':'Zcaron','\u017E':'zcaron','\u0417':'Zcy','\u0437':'zcy','\u017B':'Zdot','\u017C':'zdot','\u2128':'Zfr','\u0396':'Zeta','\u03B6':'zeta','\uD835\uDD37':'zfr','\u0416':'ZHcy','\u0436':'zhcy','\u21DD':'zigrarr','\uD835\uDD6B':'zopf','\uD835\uDCB5':'Zscr','\uD835\uDCCF':'zscr','\u200D':'zwj','\u200C':'zwnj'}; + + var regexEscape = /["&'<>`]/g; + var escapeMap = { + '"': '"', + '&': '&', + '\'': ''', + '<': '<', + // See https://mathiasbynens.be/notes/ambiguous-ampersands: in HTML, the + // following is not strictly necessary unless it’s part of a tag or an + // unquoted attribute value. We’re only escaping it to support those + // situations, and for XML support. + '>': '>', + // In Internet Explorer ≤ 8, the backtick character can be used + // to break out of (un)quoted attribute values or HTML comments. + // See http://html5sec.org/#102, http://html5sec.org/#108, and + // http://html5sec.org/#133. + '`': '`' + }; + + var regexInvalidEntity = /&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/; + var regexInvalidRawCodePoint = /[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + var regexDecode = /&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|iacute|Uacute|plusmn|otilde|Otilde|Agrave|agrave|yacute|Yacute|oslash|Oslash|Atilde|atilde|brvbar|Ccedil|ccedil|ograve|curren|divide|Eacute|eacute|Ograve|oacute|Egrave|egrave|ugrave|frac12|frac14|frac34|Ugrave|Oacute|Iacute|ntilde|Ntilde|uacute|middot|Igrave|igrave|iquest|aacute|laquo|THORN|micro|iexcl|icirc|Icirc|Acirc|ucirc|ecirc|Ocirc|ocirc|Ecirc|Ucirc|aring|Aring|aelig|AElig|acute|pound|raquo|acirc|times|thorn|szlig|cedil|COPY|Auml|ordf|ordm|uuml|macr|Uuml|auml|Ouml|ouml|para|nbsp|Euml|quot|QUOT|euml|yuml|cent|sect|copy|sup1|sup2|sup3|Iuml|iuml|shy|eth|reg|not|yen|amp|AMP|REG|uml|ETH|deg|gt|GT|LT|lt)([=a-zA-Z0-9])?/g; + var decodeMap = {'Aacute':'\xC1','aacute':'\xE1','Abreve':'\u0102','abreve':'\u0103','ac':'\u223E','acd':'\u223F','acE':'\u223E\u0333','Acirc':'\xC2','acirc':'\xE2','acute':'\xB4','Acy':'\u0410','acy':'\u0430','AElig':'\xC6','aelig':'\xE6','af':'\u2061','Afr':'\uD835\uDD04','afr':'\uD835\uDD1E','Agrave':'\xC0','agrave':'\xE0','alefsym':'\u2135','aleph':'\u2135','Alpha':'\u0391','alpha':'\u03B1','Amacr':'\u0100','amacr':'\u0101','amalg':'\u2A3F','amp':'&','AMP':'&','andand':'\u2A55','And':'\u2A53','and':'\u2227','andd':'\u2A5C','andslope':'\u2A58','andv':'\u2A5A','ang':'\u2220','ange':'\u29A4','angle':'\u2220','angmsdaa':'\u29A8','angmsdab':'\u29A9','angmsdac':'\u29AA','angmsdad':'\u29AB','angmsdae':'\u29AC','angmsdaf':'\u29AD','angmsdag':'\u29AE','angmsdah':'\u29AF','angmsd':'\u2221','angrt':'\u221F','angrtvb':'\u22BE','angrtvbd':'\u299D','angsph':'\u2222','angst':'\xC5','angzarr':'\u237C','Aogon':'\u0104','aogon':'\u0105','Aopf':'\uD835\uDD38','aopf':'\uD835\uDD52','apacir':'\u2A6F','ap':'\u2248','apE':'\u2A70','ape':'\u224A','apid':'\u224B','apos':'\'','ApplyFunction':'\u2061','approx':'\u2248','approxeq':'\u224A','Aring':'\xC5','aring':'\xE5','Ascr':'\uD835\uDC9C','ascr':'\uD835\uDCB6','Assign':'\u2254','ast':'*','asymp':'\u2248','asympeq':'\u224D','Atilde':'\xC3','atilde':'\xE3','Auml':'\xC4','auml':'\xE4','awconint':'\u2233','awint':'\u2A11','backcong':'\u224C','backepsilon':'\u03F6','backprime':'\u2035','backsim':'\u223D','backsimeq':'\u22CD','Backslash':'\u2216','Barv':'\u2AE7','barvee':'\u22BD','barwed':'\u2305','Barwed':'\u2306','barwedge':'\u2305','bbrk':'\u23B5','bbrktbrk':'\u23B6','bcong':'\u224C','Bcy':'\u0411','bcy':'\u0431','bdquo':'\u201E','becaus':'\u2235','because':'\u2235','Because':'\u2235','bemptyv':'\u29B0','bepsi':'\u03F6','bernou':'\u212C','Bernoullis':'\u212C','Beta':'\u0392','beta':'\u03B2','beth':'\u2136','between':'\u226C','Bfr':'\uD835\uDD05','bfr':'\uD835\uDD1F','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':'\u2AED','bnot':'\u2310','Bopf':'\uD835\uDD39','bopf':'\uD835\uDD53','bot':'\u22A5','bottom':'\u22A5','bowtie':'\u22C8','boxbox':'\u29C9','boxdl':'\u2510','boxdL':'\u2555','boxDl':'\u2556','boxDL':'\u2557','boxdr':'\u250C','boxdR':'\u2552','boxDr':'\u2553','boxDR':'\u2554','boxh':'\u2500','boxH':'\u2550','boxhd':'\u252C','boxHd':'\u2564','boxhD':'\u2565','boxHD':'\u2566','boxhu':'\u2534','boxHu':'\u2567','boxhU':'\u2568','boxHU':'\u2569','boxminus':'\u229F','boxplus':'\u229E','boxtimes':'\u22A0','boxul':'\u2518','boxuL':'\u255B','boxUl':'\u255C','boxUL':'\u255D','boxur':'\u2514','boxuR':'\u2558','boxUr':'\u2559','boxUR':'\u255A','boxv':'\u2502','boxV':'\u2551','boxvh':'\u253C','boxvH':'\u256A','boxVh':'\u256B','boxVH':'\u256C','boxvl':'\u2524','boxvL':'\u2561','boxVl':'\u2562','boxVL':'\u2563','boxvr':'\u251C','boxvR':'\u255E','boxVr':'\u255F','boxVR':'\u2560','bprime':'\u2035','breve':'\u02D8','Breve':'\u02D8','brvbar':'\xA6','bscr':'\uD835\uDCB7','Bscr':'\u212C','bsemi':'\u204F','bsim':'\u223D','bsime':'\u22CD','bsolb':'\u29C5','bsol':'\\','bsolhsub':'\u27C8','bull':'\u2022','bullet':'\u2022','bump':'\u224E','bumpE':'\u2AAE','bumpe':'\u224F','Bumpeq':'\u224E','bumpeq':'\u224F','Cacute':'\u0106','cacute':'\u0107','capand':'\u2A44','capbrcup':'\u2A49','capcap':'\u2A4B','cap':'\u2229','Cap':'\u22D2','capcup':'\u2A47','capdot':'\u2A40','CapitalDifferentialD':'\u2145','caps':'\u2229\uFE00','caret':'\u2041','caron':'\u02C7','Cayleys':'\u212D','ccaps':'\u2A4D','Ccaron':'\u010C','ccaron':'\u010D','Ccedil':'\xC7','ccedil':'\xE7','Ccirc':'\u0108','ccirc':'\u0109','Cconint':'\u2230','ccups':'\u2A4C','ccupssm':'\u2A50','Cdot':'\u010A','cdot':'\u010B','cedil':'\xB8','Cedilla':'\xB8','cemptyv':'\u29B2','cent':'\xA2','centerdot':'\xB7','CenterDot':'\xB7','cfr':'\uD835\uDD20','Cfr':'\u212D','CHcy':'\u0427','chcy':'\u0447','check':'\u2713','checkmark':'\u2713','Chi':'\u03A7','chi':'\u03C7','circ':'\u02C6','circeq':'\u2257','circlearrowleft':'\u21BA','circlearrowright':'\u21BB','circledast':'\u229B','circledcirc':'\u229A','circleddash':'\u229D','CircleDot':'\u2299','circledR':'\xAE','circledS':'\u24C8','CircleMinus':'\u2296','CirclePlus':'\u2295','CircleTimes':'\u2297','cir':'\u25CB','cirE':'\u29C3','cire':'\u2257','cirfnint':'\u2A10','cirmid':'\u2AEF','cirscir':'\u29C2','ClockwiseContourIntegral':'\u2232','CloseCurlyDoubleQuote':'\u201D','CloseCurlyQuote':'\u2019','clubs':'\u2663','clubsuit':'\u2663','colon':':','Colon':'\u2237','Colone':'\u2A74','colone':'\u2254','coloneq':'\u2254','comma':',','commat':'@','comp':'\u2201','compfn':'\u2218','complement':'\u2201','complexes':'\u2102','cong':'\u2245','congdot':'\u2A6D','Congruent':'\u2261','conint':'\u222E','Conint':'\u222F','ContourIntegral':'\u222E','copf':'\uD835\uDD54','Copf':'\u2102','coprod':'\u2210','Coproduct':'\u2210','copy':'\xA9','COPY':'\xA9','copysr':'\u2117','CounterClockwiseContourIntegral':'\u2233','crarr':'\u21B5','cross':'\u2717','Cross':'\u2A2F','Cscr':'\uD835\uDC9E','cscr':'\uD835\uDCB8','csub':'\u2ACF','csube':'\u2AD1','csup':'\u2AD0','csupe':'\u2AD2','ctdot':'\u22EF','cudarrl':'\u2938','cudarrr':'\u2935','cuepr':'\u22DE','cuesc':'\u22DF','cularr':'\u21B6','cularrp':'\u293D','cupbrcap':'\u2A48','cupcap':'\u2A46','CupCap':'\u224D','cup':'\u222A','Cup':'\u22D3','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','dagger':'\u2020','Dagger':'\u2021','daleth':'\u2138','darr':'\u2193','Darr':'\u21A1','dArr':'\u21D3','dash':'\u2010','Dashv':'\u2AE4','dashv':'\u22A3','dbkarow':'\u290F','dblac':'\u02DD','Dcaron':'\u010E','dcaron':'\u010F','Dcy':'\u0414','dcy':'\u0434','ddagger':'\u2021','ddarr':'\u21CA','DD':'\u2145','dd':'\u2146','DDotrahd':'\u2911','ddotseq':'\u2A77','deg':'\xB0','Del':'\u2207','Delta':'\u0394','delta':'\u03B4','demptyv':'\u29B1','dfisht':'\u297F','Dfr':'\uD835\uDD07','dfr':'\uD835\uDD21','dHar':'\u2965','dharl':'\u21C3','dharr':'\u21C2','DiacriticalAcute':'\xB4','DiacriticalDot':'\u02D9','DiacriticalDoubleAcute':'\u02DD','DiacriticalGrave':'`','DiacriticalTilde':'\u02DC','diam':'\u22C4','diamond':'\u22C4','Diamond':'\u22C4','diamondsuit':'\u2666','diams':'\u2666','die':'\xA8','DifferentialD':'\u2146','digamma':'\u03DD','disin':'\u22F2','div':'\xF7','divide':'\xF7','divideontimes':'\u22C7','divonx':'\u22C7','DJcy':'\u0402','djcy':'\u0452','dlcorn':'\u231E','dlcrop':'\u230D','dollar':'$','Dopf':'\uD835\uDD3B','dopf':'\uD835\uDD55','Dot':'\xA8','dot':'\u02D9','DotDot':'\u20DC','doteq':'\u2250','doteqdot':'\u2251','DotEqual':'\u2250','dotminus':'\u2238','dotplus':'\u2214','dotsquare':'\u22A1','doublebarwedge':'\u2306','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','DownArrowBar':'\u2913','downarrow':'\u2193','DownArrow':'\u2193','Downarrow':'\u21D3','DownArrowUpArrow':'\u21F5','DownBreve':'\u0311','downdownarrows':'\u21CA','downharpoonleft':'\u21C3','downharpoonright':'\u21C2','DownLeftRightVector':'\u2950','DownLeftTeeVector':'\u295E','DownLeftVectorBar':'\u2956','DownLeftVector':'\u21BD','DownRightTeeVector':'\u295F','DownRightVectorBar':'\u2957','DownRightVector':'\u21C1','DownTeeArrow':'\u21A7','DownTee':'\u22A4','drbkarow':'\u2910','drcorn':'\u231F','drcrop':'\u230C','Dscr':'\uD835\uDC9F','dscr':'\uD835\uDCB9','DScy':'\u0405','dscy':'\u0455','dsol':'\u29F6','Dstrok':'\u0110','dstrok':'\u0111','dtdot':'\u22F1','dtri':'\u25BF','dtrif':'\u25BE','duarr':'\u21F5','duhar':'\u296F','dwangle':'\u29A6','DZcy':'\u040F','dzcy':'\u045F','dzigrarr':'\u27FF','Eacute':'\xC9','eacute':'\xE9','easter':'\u2A6E','Ecaron':'\u011A','ecaron':'\u011B','Ecirc':'\xCA','ecirc':'\xEA','ecir':'\u2256','ecolon':'\u2255','Ecy':'\u042D','ecy':'\u044D','eDDot':'\u2A77','Edot':'\u0116','edot':'\u0117','eDot':'\u2251','ee':'\u2147','efDot':'\u2252','Efr':'\uD835\uDD08','efr':'\uD835\uDD22','eg':'\u2A9A','Egrave':'\xC8','egrave':'\xE8','egs':'\u2A96','egsdot':'\u2A98','el':'\u2A99','Element':'\u2208','elinters':'\u23E7','ell':'\u2113','els':'\u2A95','elsdot':'\u2A97','Emacr':'\u0112','emacr':'\u0113','empty':'\u2205','emptyset':'\u2205','EmptySmallSquare':'\u25FB','emptyv':'\u2205','EmptyVerySmallSquare':'\u25AB','emsp13':'\u2004','emsp14':'\u2005','emsp':'\u2003','ENG':'\u014A','eng':'\u014B','ensp':'\u2002','Eogon':'\u0118','eogon':'\u0119','Eopf':'\uD835\uDD3C','eopf':'\uD835\uDD56','epar':'\u22D5','eparsl':'\u29E3','eplus':'\u2A71','epsi':'\u03B5','Epsilon':'\u0395','epsilon':'\u03B5','epsiv':'\u03F5','eqcirc':'\u2256','eqcolon':'\u2255','eqsim':'\u2242','eqslantgtr':'\u2A96','eqslantless':'\u2A95','Equal':'\u2A75','equals':'=','EqualTilde':'\u2242','equest':'\u225F','Equilibrium':'\u21CC','equiv':'\u2261','equivDD':'\u2A78','eqvparsl':'\u29E5','erarr':'\u2971','erDot':'\u2253','escr':'\u212F','Escr':'\u2130','esdot':'\u2250','Esim':'\u2A73','esim':'\u2242','Eta':'\u0397','eta':'\u03B7','ETH':'\xD0','eth':'\xF0','Euml':'\xCB','euml':'\xEB','euro':'\u20AC','excl':'!','exist':'\u2203','Exists':'\u2203','expectation':'\u2130','exponentiale':'\u2147','ExponentialE':'\u2147','fallingdotseq':'\u2252','Fcy':'\u0424','fcy':'\u0444','female':'\u2640','ffilig':'\uFB03','fflig':'\uFB00','ffllig':'\uFB04','Ffr':'\uD835\uDD09','ffr':'\uD835\uDD23','filig':'\uFB01','FilledSmallSquare':'\u25FC','FilledVerySmallSquare':'\u25AA','fjlig':'fj','flat':'\u266D','fllig':'\uFB02','fltns':'\u25B1','fnof':'\u0192','Fopf':'\uD835\uDD3D','fopf':'\uD835\uDD57','forall':'\u2200','ForAll':'\u2200','fork':'\u22D4','forkv':'\u2AD9','Fouriertrf':'\u2131','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':'\uD835\uDCBB','Fscr':'\u2131','gacute':'\u01F5','Gamma':'\u0393','gamma':'\u03B3','Gammad':'\u03DC','gammad':'\u03DD','gap':'\u2A86','Gbreve':'\u011E','gbreve':'\u011F','Gcedil':'\u0122','Gcirc':'\u011C','gcirc':'\u011D','Gcy':'\u0413','gcy':'\u0433','Gdot':'\u0120','gdot':'\u0121','ge':'\u2265','gE':'\u2267','gEl':'\u2A8C','gel':'\u22DB','geq':'\u2265','geqq':'\u2267','geqslant':'\u2A7E','gescc':'\u2AA9','ges':'\u2A7E','gesdot':'\u2A80','gesdoto':'\u2A82','gesdotol':'\u2A84','gesl':'\u22DB\uFE00','gesles':'\u2A94','Gfr':'\uD835\uDD0A','gfr':'\uD835\uDD24','gg':'\u226B','Gg':'\u22D9','ggg':'\u22D9','gimel':'\u2137','GJcy':'\u0403','gjcy':'\u0453','gla':'\u2AA5','gl':'\u2277','glE':'\u2A92','glj':'\u2AA4','gnap':'\u2A8A','gnapprox':'\u2A8A','gne':'\u2A88','gnE':'\u2269','gneq':'\u2A88','gneqq':'\u2269','gnsim':'\u22E7','Gopf':'\uD835\uDD3E','gopf':'\uD835\uDD58','grave':'`','GreaterEqual':'\u2265','GreaterEqualLess':'\u22DB','GreaterFullEqual':'\u2267','GreaterGreater':'\u2AA2','GreaterLess':'\u2277','GreaterSlantEqual':'\u2A7E','GreaterTilde':'\u2273','Gscr':'\uD835\uDCA2','gscr':'\u210A','gsim':'\u2273','gsime':'\u2A8E','gsiml':'\u2A90','gtcc':'\u2AA7','gtcir':'\u2A7A','gt':'>','GT':'>','Gt':'\u226B','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','Hacek':'\u02C7','hairsp':'\u200A','half':'\xBD','hamilt':'\u210B','HARDcy':'\u042A','hardcy':'\u044A','harrcir':'\u2948','harr':'\u2194','hArr':'\u21D4','harrw':'\u21AD','Hat':'^','hbar':'\u210F','Hcirc':'\u0124','hcirc':'\u0125','hearts':'\u2665','heartsuit':'\u2665','hellip':'\u2026','hercon':'\u22B9','hfr':'\uD835\uDD25','Hfr':'\u210C','HilbertSpace':'\u210B','hksearow':'\u2925','hkswarow':'\u2926','hoarr':'\u21FF','homtht':'\u223B','hookleftarrow':'\u21A9','hookrightarrow':'\u21AA','hopf':'\uD835\uDD59','Hopf':'\u210D','horbar':'\u2015','HorizontalLine':'\u2500','hscr':'\uD835\uDCBD','Hscr':'\u210B','hslash':'\u210F','Hstrok':'\u0126','hstrok':'\u0127','HumpDownHump':'\u224E','HumpEqual':'\u224F','hybull':'\u2043','hyphen':'\u2010','Iacute':'\xCD','iacute':'\xED','ic':'\u2063','Icirc':'\xCE','icirc':'\xEE','Icy':'\u0418','icy':'\u0438','Idot':'\u0130','IEcy':'\u0415','iecy':'\u0435','iexcl':'\xA1','iff':'\u21D4','ifr':'\uD835\uDD26','Ifr':'\u2111','Igrave':'\xCC','igrave':'\xEC','ii':'\u2148','iiiint':'\u2A0C','iiint':'\u222D','iinfin':'\u29DC','iiota':'\u2129','IJlig':'\u0132','ijlig':'\u0133','Imacr':'\u012A','imacr':'\u012B','image':'\u2111','ImaginaryI':'\u2148','imagline':'\u2110','imagpart':'\u2111','imath':'\u0131','Im':'\u2111','imof':'\u22B7','imped':'\u01B5','Implies':'\u21D2','incare':'\u2105','in':'\u2208','infin':'\u221E','infintie':'\u29DD','inodot':'\u0131','intcal':'\u22BA','int':'\u222B','Int':'\u222C','integers':'\u2124','Integral':'\u222B','intercal':'\u22BA','Intersection':'\u22C2','intlarhk':'\u2A17','intprod':'\u2A3C','InvisibleComma':'\u2063','InvisibleTimes':'\u2062','IOcy':'\u0401','iocy':'\u0451','Iogon':'\u012E','iogon':'\u012F','Iopf':'\uD835\uDD40','iopf':'\uD835\uDD5A','Iota':'\u0399','iota':'\u03B9','iprod':'\u2A3C','iquest':'\xBF','iscr':'\uD835\uDCBE','Iscr':'\u2110','isin':'\u2208','isindot':'\u22F5','isinE':'\u22F9','isins':'\u22F4','isinsv':'\u22F3','isinv':'\u2208','it':'\u2062','Itilde':'\u0128','itilde':'\u0129','Iukcy':'\u0406','iukcy':'\u0456','Iuml':'\xCF','iuml':'\xEF','Jcirc':'\u0134','jcirc':'\u0135','Jcy':'\u0419','jcy':'\u0439','Jfr':'\uD835\uDD0D','jfr':'\uD835\uDD27','jmath':'\u0237','Jopf':'\uD835\uDD41','jopf':'\uD835\uDD5B','Jscr':'\uD835\uDCA5','jscr':'\uD835\uDCBF','Jsercy':'\u0408','jsercy':'\u0458','Jukcy':'\u0404','jukcy':'\u0454','Kappa':'\u039A','kappa':'\u03BA','kappav':'\u03F0','Kcedil':'\u0136','kcedil':'\u0137','Kcy':'\u041A','kcy':'\u043A','Kfr':'\uD835\uDD0E','kfr':'\uD835\uDD28','kgreen':'\u0138','KHcy':'\u0425','khcy':'\u0445','KJcy':'\u040C','kjcy':'\u045C','Kopf':'\uD835\uDD42','kopf':'\uD835\uDD5C','Kscr':'\uD835\uDCA6','kscr':'\uD835\uDCC0','lAarr':'\u21DA','Lacute':'\u0139','lacute':'\u013A','laemptyv':'\u29B4','lagran':'\u2112','Lambda':'\u039B','lambda':'\u03BB','lang':'\u27E8','Lang':'\u27EA','langd':'\u2991','langle':'\u27E8','lap':'\u2A85','Laplacetrf':'\u2112','laquo':'\xAB','larrb':'\u21E4','larrbfs':'\u291F','larr':'\u2190','Larr':'\u219E','lArr':'\u21D0','larrfs':'\u291D','larrhk':'\u21A9','larrlp':'\u21AB','larrpl':'\u2939','larrsim':'\u2973','larrtl':'\u21A2','latail':'\u2919','lAtail':'\u291B','lat':'\u2AAB','late':'\u2AAD','lates':'\u2AAD\uFE00','lbarr':'\u290C','lBarr':'\u290E','lbbrk':'\u2772','lbrace':'{','lbrack':'[','lbrke':'\u298B','lbrksld':'\u298F','lbrkslu':'\u298D','Lcaron':'\u013D','lcaron':'\u013E','Lcedil':'\u013B','lcedil':'\u013C','lceil':'\u2308','lcub':'{','Lcy':'\u041B','lcy':'\u043B','ldca':'\u2936','ldquo':'\u201C','ldquor':'\u201E','ldrdhar':'\u2967','ldrushar':'\u294B','ldsh':'\u21B2','le':'\u2264','lE':'\u2266','LeftAngleBracket':'\u27E8','LeftArrowBar':'\u21E4','leftarrow':'\u2190','LeftArrow':'\u2190','Leftarrow':'\u21D0','LeftArrowRightArrow':'\u21C6','leftarrowtail':'\u21A2','LeftCeiling':'\u2308','LeftDoubleBracket':'\u27E6','LeftDownTeeVector':'\u2961','LeftDownVectorBar':'\u2959','LeftDownVector':'\u21C3','LeftFloor':'\u230A','leftharpoondown':'\u21BD','leftharpoonup':'\u21BC','leftleftarrows':'\u21C7','leftrightarrow':'\u2194','LeftRightArrow':'\u2194','Leftrightarrow':'\u21D4','leftrightarrows':'\u21C6','leftrightharpoons':'\u21CB','leftrightsquigarrow':'\u21AD','LeftRightVector':'\u294E','LeftTeeArrow':'\u21A4','LeftTee':'\u22A3','LeftTeeVector':'\u295A','leftthreetimes':'\u22CB','LeftTriangleBar':'\u29CF','LeftTriangle':'\u22B2','LeftTriangleEqual':'\u22B4','LeftUpDownVector':'\u2951','LeftUpTeeVector':'\u2960','LeftUpVectorBar':'\u2958','LeftUpVector':'\u21BF','LeftVectorBar':'\u2952','LeftVector':'\u21BC','lEg':'\u2A8B','leg':'\u22DA','leq':'\u2264','leqq':'\u2266','leqslant':'\u2A7D','lescc':'\u2AA8','les':'\u2A7D','lesdot':'\u2A7F','lesdoto':'\u2A81','lesdotor':'\u2A83','lesg':'\u22DA\uFE00','lesges':'\u2A93','lessapprox':'\u2A85','lessdot':'\u22D6','lesseqgtr':'\u22DA','lesseqqgtr':'\u2A8B','LessEqualGreater':'\u22DA','LessFullEqual':'\u2266','LessGreater':'\u2276','lessgtr':'\u2276','LessLess':'\u2AA1','lesssim':'\u2272','LessSlantEqual':'\u2A7D','LessTilde':'\u2272','lfisht':'\u297C','lfloor':'\u230A','Lfr':'\uD835\uDD0F','lfr':'\uD835\uDD29','lg':'\u2276','lgE':'\u2A91','lHar':'\u2962','lhard':'\u21BD','lharu':'\u21BC','lharul':'\u296A','lhblk':'\u2584','LJcy':'\u0409','ljcy':'\u0459','llarr':'\u21C7','ll':'\u226A','Ll':'\u22D8','llcorner':'\u231E','Lleftarrow':'\u21DA','llhard':'\u296B','lltri':'\u25FA','Lmidot':'\u013F','lmidot':'\u0140','lmoustache':'\u23B0','lmoust':'\u23B0','lnap':'\u2A89','lnapprox':'\u2A89','lne':'\u2A87','lnE':'\u2268','lneq':'\u2A87','lneqq':'\u2268','lnsim':'\u22E6','loang':'\u27EC','loarr':'\u21FD','lobrk':'\u27E6','longleftarrow':'\u27F5','LongLeftArrow':'\u27F5','Longleftarrow':'\u27F8','longleftrightarrow':'\u27F7','LongLeftRightArrow':'\u27F7','Longleftrightarrow':'\u27FA','longmapsto':'\u27FC','longrightarrow':'\u27F6','LongRightArrow':'\u27F6','Longrightarrow':'\u27F9','looparrowleft':'\u21AB','looparrowright':'\u21AC','lopar':'\u2985','Lopf':'\uD835\uDD43','lopf':'\uD835\uDD5D','loplus':'\u2A2D','lotimes':'\u2A34','lowast':'\u2217','lowbar':'_','LowerLeftArrow':'\u2199','LowerRightArrow':'\u2198','loz':'\u25CA','lozenge':'\u25CA','lozf':'\u29EB','lpar':'(','lparlt':'\u2993','lrarr':'\u21C6','lrcorner':'\u231F','lrhar':'\u21CB','lrhard':'\u296D','lrm':'\u200E','lrtri':'\u22BF','lsaquo':'\u2039','lscr':'\uD835\uDCC1','Lscr':'\u2112','lsh':'\u21B0','Lsh':'\u21B0','lsim':'\u2272','lsime':'\u2A8D','lsimg':'\u2A8F','lsqb':'[','lsquo':'\u2018','lsquor':'\u201A','Lstrok':'\u0141','lstrok':'\u0142','ltcc':'\u2AA6','ltcir':'\u2A79','lt':'<','LT':'<','Lt':'\u226A','ltdot':'\u22D6','lthree':'\u22CB','ltimes':'\u22C9','ltlarr':'\u2976','ltquest':'\u2A7B','ltri':'\u25C3','ltrie':'\u22B4','ltrif':'\u25C2','ltrPar':'\u2996','lurdshar':'\u294A','luruhar':'\u2966','lvertneqq':'\u2268\uFE00','lvnE':'\u2268\uFE00','macr':'\xAF','male':'\u2642','malt':'\u2720','maltese':'\u2720','Map':'\u2905','map':'\u21A6','mapsto':'\u21A6','mapstodown':'\u21A7','mapstoleft':'\u21A4','mapstoup':'\u21A5','marker':'\u25AE','mcomma':'\u2A29','Mcy':'\u041C','mcy':'\u043C','mdash':'\u2014','mDDot':'\u223A','measuredangle':'\u2221','MediumSpace':'\u205F','Mellintrf':'\u2133','Mfr':'\uD835\uDD10','mfr':'\uD835\uDD2A','mho':'\u2127','micro':'\xB5','midast':'*','midcir':'\u2AF0','mid':'\u2223','middot':'\xB7','minusb':'\u229F','minus':'\u2212','minusd':'\u2238','minusdu':'\u2A2A','MinusPlus':'\u2213','mlcp':'\u2ADB','mldr':'\u2026','mnplus':'\u2213','models':'\u22A7','Mopf':'\uD835\uDD44','mopf':'\uD835\uDD5E','mp':'\u2213','mscr':'\uD835\uDCC2','Mscr':'\u2133','mstpos':'\u223E','Mu':'\u039C','mu':'\u03BC','multimap':'\u22B8','mumap':'\u22B8','nabla':'\u2207','Nacute':'\u0143','nacute':'\u0144','nang':'\u2220\u20D2','nap':'\u2249','napE':'\u2A70\u0338','napid':'\u224B\u0338','napos':'\u0149','napprox':'\u2249','natural':'\u266E','naturals':'\u2115','natur':'\u266E','nbsp':'\xA0','nbump':'\u224E\u0338','nbumpe':'\u224F\u0338','ncap':'\u2A43','Ncaron':'\u0147','ncaron':'\u0148','Ncedil':'\u0145','ncedil':'\u0146','ncong':'\u2247','ncongdot':'\u2A6D\u0338','ncup':'\u2A42','Ncy':'\u041D','ncy':'\u043D','ndash':'\u2013','nearhk':'\u2924','nearr':'\u2197','neArr':'\u21D7','nearrow':'\u2197','ne':'\u2260','nedot':'\u2250\u0338','NegativeMediumSpace':'\u200B','NegativeThickSpace':'\u200B','NegativeThinSpace':'\u200B','NegativeVeryThinSpace':'\u200B','nequiv':'\u2262','nesear':'\u2928','nesim':'\u2242\u0338','NestedGreaterGreater':'\u226B','NestedLessLess':'\u226A','NewLine':'\n','nexist':'\u2204','nexists':'\u2204','Nfr':'\uD835\uDD11','nfr':'\uD835\uDD2B','ngE':'\u2267\u0338','nge':'\u2271','ngeq':'\u2271','ngeqq':'\u2267\u0338','ngeqslant':'\u2A7E\u0338','nges':'\u2A7E\u0338','nGg':'\u22D9\u0338','ngsim':'\u2275','nGt':'\u226B\u20D2','ngt':'\u226F','ngtr':'\u226F','nGtv':'\u226B\u0338','nharr':'\u21AE','nhArr':'\u21CE','nhpar':'\u2AF2','ni':'\u220B','nis':'\u22FC','nisd':'\u22FA','niv':'\u220B','NJcy':'\u040A','njcy':'\u045A','nlarr':'\u219A','nlArr':'\u21CD','nldr':'\u2025','nlE':'\u2266\u0338','nle':'\u2270','nleftarrow':'\u219A','nLeftarrow':'\u21CD','nleftrightarrow':'\u21AE','nLeftrightarrow':'\u21CE','nleq':'\u2270','nleqq':'\u2266\u0338','nleqslant':'\u2A7D\u0338','nles':'\u2A7D\u0338','nless':'\u226E','nLl':'\u22D8\u0338','nlsim':'\u2274','nLt':'\u226A\u20D2','nlt':'\u226E','nltri':'\u22EA','nltrie':'\u22EC','nLtv':'\u226A\u0338','nmid':'\u2224','NoBreak':'\u2060','NonBreakingSpace':'\xA0','nopf':'\uD835\uDD5F','Nopf':'\u2115','Not':'\u2AEC','not':'\xAC','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','notin':'\u2209','notindot':'\u22F5\u0338','notinE':'\u22F9\u0338','notinva':'\u2209','notinvb':'\u22F7','notinvc':'\u22F6','NotLeftTriangleBar':'\u29CF\u0338','NotLeftTriangle':'\u22EA','NotLeftTriangleEqual':'\u22EC','NotLess':'\u226E','NotLessEqual':'\u2270','NotLessGreater':'\u2278','NotLessLess':'\u226A\u0338','NotLessSlantEqual':'\u2A7D\u0338','NotLessTilde':'\u2274','NotNestedGreaterGreater':'\u2AA2\u0338','NotNestedLessLess':'\u2AA1\u0338','notni':'\u220C','notniva':'\u220C','notnivb':'\u22FE','notnivc':'\u22FD','NotPrecedes':'\u2280','NotPrecedesEqual':'\u2AAF\u0338','NotPrecedesSlantEqual':'\u22E0','NotReverseElement':'\u220C','NotRightTriangleBar':'\u29D0\u0338','NotRightTriangle':'\u22EB','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','nparallel':'\u2226','npar':'\u2226','nparsl':'\u2AFD\u20E5','npart':'\u2202\u0338','npolint':'\u2A14','npr':'\u2280','nprcue':'\u22E0','nprec':'\u2280','npreceq':'\u2AAF\u0338','npre':'\u2AAF\u0338','nrarrc':'\u2933\u0338','nrarr':'\u219B','nrArr':'\u21CF','nrarrw':'\u219D\u0338','nrightarrow':'\u219B','nRightarrow':'\u21CF','nrtri':'\u22EB','nrtrie':'\u22ED','nsc':'\u2281','nsccue':'\u22E1','nsce':'\u2AB0\u0338','Nscr':'\uD835\uDCA9','nscr':'\uD835\uDCC3','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':'\xD1','ntilde':'\xF1','ntlg':'\u2278','ntriangleleft':'\u22EA','ntrianglelefteq':'\u22EC','ntriangleright':'\u22EB','ntrianglerighteq':'\u22ED','Nu':'\u039D','nu':'\u03BD','num':'#','numero':'\u2116','numsp':'\u2007','nvap':'\u224D\u20D2','nvdash':'\u22AC','nvDash':'\u22AD','nVdash':'\u22AE','nVDash':'\u22AF','nvge':'\u2265\u20D2','nvgt':'>\u20D2','nvHarr':'\u2904','nvinfin':'\u29DE','nvlArr':'\u2902','nvle':'\u2264\u20D2','nvlt':'<\u20D2','nvltrie':'\u22B4\u20D2','nvrArr':'\u2903','nvrtrie':'\u22B5\u20D2','nvsim':'\u223C\u20D2','nwarhk':'\u2923','nwarr':'\u2196','nwArr':'\u21D6','nwarrow':'\u2196','nwnear':'\u2927','Oacute':'\xD3','oacute':'\xF3','oast':'\u229B','Ocirc':'\xD4','ocirc':'\xF4','ocir':'\u229A','Ocy':'\u041E','ocy':'\u043E','odash':'\u229D','Odblac':'\u0150','odblac':'\u0151','odiv':'\u2A38','odot':'\u2299','odsold':'\u29BC','OElig':'\u0152','oelig':'\u0153','ofcir':'\u29BF','Ofr':'\uD835\uDD12','ofr':'\uD835\uDD2C','ogon':'\u02DB','Ograve':'\xD2','ograve':'\xF2','ogt':'\u29C1','ohbar':'\u29B5','ohm':'\u03A9','oint':'\u222E','olarr':'\u21BA','olcir':'\u29BE','olcross':'\u29BB','oline':'\u203E','olt':'\u29C0','Omacr':'\u014C','omacr':'\u014D','Omega':'\u03A9','omega':'\u03C9','Omicron':'\u039F','omicron':'\u03BF','omid':'\u29B6','ominus':'\u2296','Oopf':'\uD835\uDD46','oopf':'\uD835\uDD60','opar':'\u29B7','OpenCurlyDoubleQuote':'\u201C','OpenCurlyQuote':'\u2018','operp':'\u29B9','oplus':'\u2295','orarr':'\u21BB','Or':'\u2A54','or':'\u2228','ord':'\u2A5D','order':'\u2134','orderof':'\u2134','ordf':'\xAA','ordm':'\xBA','origof':'\u22B6','oror':'\u2A56','orslope':'\u2A57','orv':'\u2A5B','oS':'\u24C8','Oscr':'\uD835\uDCAA','oscr':'\u2134','Oslash':'\xD8','oslash':'\xF8','osol':'\u2298','Otilde':'\xD5','otilde':'\xF5','otimesas':'\u2A36','Otimes':'\u2A37','otimes':'\u2297','Ouml':'\xD6','ouml':'\xF6','ovbar':'\u233D','OverBar':'\u203E','OverBrace':'\u23DE','OverBracket':'\u23B4','OverParenthesis':'\u23DC','para':'\xB6','parallel':'\u2225','par':'\u2225','parsim':'\u2AF3','parsl':'\u2AFD','part':'\u2202','PartialD':'\u2202','Pcy':'\u041F','pcy':'\u043F','percnt':'%','period':'.','permil':'\u2030','perp':'\u22A5','pertenk':'\u2031','Pfr':'\uD835\uDD13','pfr':'\uD835\uDD2D','Phi':'\u03A6','phi':'\u03C6','phiv':'\u03D5','phmmat':'\u2133','phone':'\u260E','Pi':'\u03A0','pi':'\u03C0','pitchfork':'\u22D4','piv':'\u03D6','planck':'\u210F','planckh':'\u210E','plankv':'\u210F','plusacir':'\u2A23','plusb':'\u229E','pluscir':'\u2A22','plus':'+','plusdo':'\u2214','plusdu':'\u2A25','pluse':'\u2A72','PlusMinus':'\xB1','plusmn':'\xB1','plussim':'\u2A26','plustwo':'\u2A27','pm':'\xB1','Poincareplane':'\u210C','pointint':'\u2A15','popf':'\uD835\uDD61','Popf':'\u2119','pound':'\xA3','prap':'\u2AB7','Pr':'\u2ABB','pr':'\u227A','prcue':'\u227C','precapprox':'\u2AB7','prec':'\u227A','preccurlyeq':'\u227C','Precedes':'\u227A','PrecedesEqual':'\u2AAF','PrecedesSlantEqual':'\u227C','PrecedesTilde':'\u227E','preceq':'\u2AAF','precnapprox':'\u2AB9','precneqq':'\u2AB5','precnsim':'\u22E8','pre':'\u2AAF','prE':'\u2AB3','precsim':'\u227E','prime':'\u2032','Prime':'\u2033','primes':'\u2119','prnap':'\u2AB9','prnE':'\u2AB5','prnsim':'\u22E8','prod':'\u220F','Product':'\u220F','profalar':'\u232E','profline':'\u2312','profsurf':'\u2313','prop':'\u221D','Proportional':'\u221D','Proportion':'\u2237','propto':'\u221D','prsim':'\u227E','prurel':'\u22B0','Pscr':'\uD835\uDCAB','pscr':'\uD835\uDCC5','Psi':'\u03A8','psi':'\u03C8','puncsp':'\u2008','Qfr':'\uD835\uDD14','qfr':'\uD835\uDD2E','qint':'\u2A0C','qopf':'\uD835\uDD62','Qopf':'\u211A','qprime':'\u2057','Qscr':'\uD835\uDCAC','qscr':'\uD835\uDCC6','quaternions':'\u210D','quatint':'\u2A16','quest':'?','questeq':'\u225F','quot':'"','QUOT':'"','rAarr':'\u21DB','race':'\u223D\u0331','Racute':'\u0154','racute':'\u0155','radic':'\u221A','raemptyv':'\u29B3','rang':'\u27E9','Rang':'\u27EB','rangd':'\u2992','range':'\u29A5','rangle':'\u27E9','raquo':'\xBB','rarrap':'\u2975','rarrb':'\u21E5','rarrbfs':'\u2920','rarrc':'\u2933','rarr':'\u2192','Rarr':'\u21A0','rArr':'\u21D2','rarrfs':'\u291E','rarrhk':'\u21AA','rarrlp':'\u21AC','rarrpl':'\u2945','rarrsim':'\u2974','Rarrtl':'\u2916','rarrtl':'\u21A3','rarrw':'\u219D','ratail':'\u291A','rAtail':'\u291C','ratio':'\u2236','rationals':'\u211A','rbarr':'\u290D','rBarr':'\u290F','RBarr':'\u2910','rbbrk':'\u2773','rbrace':'}','rbrack':']','rbrke':'\u298C','rbrksld':'\u298E','rbrkslu':'\u2990','Rcaron':'\u0158','rcaron':'\u0159','Rcedil':'\u0156','rcedil':'\u0157','rceil':'\u2309','rcub':'}','Rcy':'\u0420','rcy':'\u0440','rdca':'\u2937','rdldhar':'\u2969','rdquo':'\u201D','rdquor':'\u201D','rdsh':'\u21B3','real':'\u211C','realine':'\u211B','realpart':'\u211C','reals':'\u211D','Re':'\u211C','rect':'\u25AD','reg':'\xAE','REG':'\xAE','ReverseElement':'\u220B','ReverseEquilibrium':'\u21CB','ReverseUpEquilibrium':'\u296F','rfisht':'\u297D','rfloor':'\u230B','rfr':'\uD835\uDD2F','Rfr':'\u211C','rHar':'\u2964','rhard':'\u21C1','rharu':'\u21C0','rharul':'\u296C','Rho':'\u03A1','rho':'\u03C1','rhov':'\u03F1','RightAngleBracket':'\u27E9','RightArrowBar':'\u21E5','rightarrow':'\u2192','RightArrow':'\u2192','Rightarrow':'\u21D2','RightArrowLeftArrow':'\u21C4','rightarrowtail':'\u21A3','RightCeiling':'\u2309','RightDoubleBracket':'\u27E7','RightDownTeeVector':'\u295D','RightDownVectorBar':'\u2955','RightDownVector':'\u21C2','RightFloor':'\u230B','rightharpoondown':'\u21C1','rightharpoonup':'\u21C0','rightleftarrows':'\u21C4','rightleftharpoons':'\u21CC','rightrightarrows':'\u21C9','rightsquigarrow':'\u219D','RightTeeArrow':'\u21A6','RightTee':'\u22A2','RightTeeVector':'\u295B','rightthreetimes':'\u22CC','RightTriangleBar':'\u29D0','RightTriangle':'\u22B3','RightTriangleEqual':'\u22B5','RightUpDownVector':'\u294F','RightUpTeeVector':'\u295C','RightUpVectorBar':'\u2954','RightUpVector':'\u21BE','RightVectorBar':'\u2953','RightVector':'\u21C0','ring':'\u02DA','risingdotseq':'\u2253','rlarr':'\u21C4','rlhar':'\u21CC','rlm':'\u200F','rmoustache':'\u23B1','rmoust':'\u23B1','rnmid':'\u2AEE','roang':'\u27ED','roarr':'\u21FE','robrk':'\u27E7','ropar':'\u2986','ropf':'\uD835\uDD63','Ropf':'\u211D','roplus':'\u2A2E','rotimes':'\u2A35','RoundImplies':'\u2970','rpar':')','rpargt':'\u2994','rppolint':'\u2A12','rrarr':'\u21C9','Rrightarrow':'\u21DB','rsaquo':'\u203A','rscr':'\uD835\uDCC7','Rscr':'\u211B','rsh':'\u21B1','Rsh':'\u21B1','rsqb':']','rsquo':'\u2019','rsquor':'\u2019','rthree':'\u22CC','rtimes':'\u22CA','rtri':'\u25B9','rtrie':'\u22B5','rtrif':'\u25B8','rtriltri':'\u29CE','RuleDelayed':'\u29F4','ruluhar':'\u2968','rx':'\u211E','Sacute':'\u015A','sacute':'\u015B','sbquo':'\u201A','scap':'\u2AB8','Scaron':'\u0160','scaron':'\u0161','Sc':'\u2ABC','sc':'\u227B','sccue':'\u227D','sce':'\u2AB0','scE':'\u2AB4','Scedil':'\u015E','scedil':'\u015F','Scirc':'\u015C','scirc':'\u015D','scnap':'\u2ABA','scnE':'\u2AB6','scnsim':'\u22E9','scpolint':'\u2A13','scsim':'\u227F','Scy':'\u0421','scy':'\u0441','sdotb':'\u22A1','sdot':'\u22C5','sdote':'\u2A66','searhk':'\u2925','searr':'\u2198','seArr':'\u21D8','searrow':'\u2198','sect':'\xA7','semi':';','seswar':'\u2929','setminus':'\u2216','setmn':'\u2216','sext':'\u2736','Sfr':'\uD835\uDD16','sfr':'\uD835\uDD30','sfrown':'\u2322','sharp':'\u266F','SHCHcy':'\u0429','shchcy':'\u0449','SHcy':'\u0428','shcy':'\u0448','ShortDownArrow':'\u2193','ShortLeftArrow':'\u2190','shortmid':'\u2223','shortparallel':'\u2225','ShortRightArrow':'\u2192','ShortUpArrow':'\u2191','shy':'\xAD','Sigma':'\u03A3','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','SmallCircle':'\u2218','smallsetminus':'\u2216','smashp':'\u2A33','smeparsl':'\u29E4','smid':'\u2223','smile':'\u2323','smt':'\u2AAA','smte':'\u2AAC','smtes':'\u2AAC\uFE00','SOFTcy':'\u042C','softcy':'\u044C','solbar':'\u233F','solb':'\u29C4','sol':'/','Sopf':'\uD835\uDD4A','sopf':'\uD835\uDD64','spades':'\u2660','spadesuit':'\u2660','spar':'\u2225','sqcap':'\u2293','sqcaps':'\u2293\uFE00','sqcup':'\u2294','sqcups':'\u2294\uFE00','Sqrt':'\u221A','sqsub':'\u228F','sqsube':'\u2291','sqsubset':'\u228F','sqsubseteq':'\u2291','sqsup':'\u2290','sqsupe':'\u2292','sqsupset':'\u2290','sqsupseteq':'\u2292','square':'\u25A1','Square':'\u25A1','SquareIntersection':'\u2293','SquareSubset':'\u228F','SquareSubsetEqual':'\u2291','SquareSuperset':'\u2290','SquareSupersetEqual':'\u2292','SquareUnion':'\u2294','squarf':'\u25AA','squ':'\u25A1','squf':'\u25AA','srarr':'\u2192','Sscr':'\uD835\uDCAE','sscr':'\uD835\uDCC8','ssetmn':'\u2216','ssmile':'\u2323','sstarf':'\u22C6','Star':'\u22C6','star':'\u2606','starf':'\u2605','straightepsilon':'\u03F5','straightphi':'\u03D5','strns':'\xAF','sub':'\u2282','Sub':'\u22D0','subdot':'\u2ABD','subE':'\u2AC5','sube':'\u2286','subedot':'\u2AC3','submult':'\u2AC1','subnE':'\u2ACB','subne':'\u228A','subplus':'\u2ABF','subrarr':'\u2979','subset':'\u2282','Subset':'\u22D0','subseteq':'\u2286','subseteqq':'\u2AC5','SubsetEqual':'\u2286','subsetneq':'\u228A','subsetneqq':'\u2ACB','subsim':'\u2AC7','subsub':'\u2AD5','subsup':'\u2AD3','succapprox':'\u2AB8','succ':'\u227B','succcurlyeq':'\u227D','Succeeds':'\u227B','SucceedsEqual':'\u2AB0','SucceedsSlantEqual':'\u227D','SucceedsTilde':'\u227F','succeq':'\u2AB0','succnapprox':'\u2ABA','succneqq':'\u2AB6','succnsim':'\u22E9','succsim':'\u227F','SuchThat':'\u220B','sum':'\u2211','Sum':'\u2211','sung':'\u266A','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','sup':'\u2283','Sup':'\u22D1','supdot':'\u2ABE','supdsub':'\u2AD8','supE':'\u2AC6','supe':'\u2287','supedot':'\u2AC4','Superset':'\u2283','SupersetEqual':'\u2287','suphsol':'\u27C9','suphsub':'\u2AD7','suplarr':'\u297B','supmult':'\u2AC2','supnE':'\u2ACC','supne':'\u228B','supplus':'\u2AC0','supset':'\u2283','Supset':'\u22D1','supseteq':'\u2287','supseteqq':'\u2AC6','supsetneq':'\u228B','supsetneqq':'\u2ACC','supsim':'\u2AC8','supsub':'\u2AD4','supsup':'\u2AD6','swarhk':'\u2926','swarr':'\u2199','swArr':'\u21D9','swarrow':'\u2199','swnwar':'\u292A','szlig':'\xDF','Tab':'\t','target':'\u2316','Tau':'\u03A4','tau':'\u03C4','tbrk':'\u23B4','Tcaron':'\u0164','tcaron':'\u0165','Tcedil':'\u0162','tcedil':'\u0163','Tcy':'\u0422','tcy':'\u0442','tdot':'\u20DB','telrec':'\u2315','Tfr':'\uD835\uDD17','tfr':'\uD835\uDD31','there4':'\u2234','therefore':'\u2234','Therefore':'\u2234','Theta':'\u0398','theta':'\u03B8','thetasym':'\u03D1','thetav':'\u03D1','thickapprox':'\u2248','thicksim':'\u223C','ThickSpace':'\u205F\u200A','ThinSpace':'\u2009','thinsp':'\u2009','thkap':'\u2248','thksim':'\u223C','THORN':'\xDE','thorn':'\xFE','tilde':'\u02DC','Tilde':'\u223C','TildeEqual':'\u2243','TildeFullEqual':'\u2245','TildeTilde':'\u2248','timesbar':'\u2A31','timesb':'\u22A0','times':'\xD7','timesd':'\u2A30','tint':'\u222D','toea':'\u2928','topbot':'\u2336','topcir':'\u2AF1','top':'\u22A4','Topf':'\uD835\uDD4B','topf':'\uD835\uDD65','topfork':'\u2ADA','tosa':'\u2929','tprime':'\u2034','trade':'\u2122','TRADE':'\u2122','triangle':'\u25B5','triangledown':'\u25BF','triangleleft':'\u25C3','trianglelefteq':'\u22B4','triangleq':'\u225C','triangleright':'\u25B9','trianglerighteq':'\u22B5','tridot':'\u25EC','trie':'\u225C','triminus':'\u2A3A','TripleDot':'\u20DB','triplus':'\u2A39','trisb':'\u29CD','tritime':'\u2A3B','trpezium':'\u23E2','Tscr':'\uD835\uDCAF','tscr':'\uD835\uDCC9','TScy':'\u0426','tscy':'\u0446','TSHcy':'\u040B','tshcy':'\u045B','Tstrok':'\u0166','tstrok':'\u0167','twixt':'\u226C','twoheadleftarrow':'\u219E','twoheadrightarrow':'\u21A0','Uacute':'\xDA','uacute':'\xFA','uarr':'\u2191','Uarr':'\u219F','uArr':'\u21D1','Uarrocir':'\u2949','Ubrcy':'\u040E','ubrcy':'\u045E','Ubreve':'\u016C','ubreve':'\u016D','Ucirc':'\xDB','ucirc':'\xFB','Ucy':'\u0423','ucy':'\u0443','udarr':'\u21C5','Udblac':'\u0170','udblac':'\u0171','udhar':'\u296E','ufisht':'\u297E','Ufr':'\uD835\uDD18','ufr':'\uD835\uDD32','Ugrave':'\xD9','ugrave':'\xF9','uHar':'\u2963','uharl':'\u21BF','uharr':'\u21BE','uhblk':'\u2580','ulcorn':'\u231C','ulcorner':'\u231C','ulcrop':'\u230F','ultri':'\u25F8','Umacr':'\u016A','umacr':'\u016B','uml':'\xA8','UnderBar':'_','UnderBrace':'\u23DF','UnderBracket':'\u23B5','UnderParenthesis':'\u23DD','Union':'\u22C3','UnionPlus':'\u228E','Uogon':'\u0172','uogon':'\u0173','Uopf':'\uD835\uDD4C','uopf':'\uD835\uDD66','UpArrowBar':'\u2912','uparrow':'\u2191','UpArrow':'\u2191','Uparrow':'\u21D1','UpArrowDownArrow':'\u21C5','updownarrow':'\u2195','UpDownArrow':'\u2195','Updownarrow':'\u21D5','UpEquilibrium':'\u296E','upharpoonleft':'\u21BF','upharpoonright':'\u21BE','uplus':'\u228E','UpperLeftArrow':'\u2196','UpperRightArrow':'\u2197','upsi':'\u03C5','Upsi':'\u03D2','upsih':'\u03D2','Upsilon':'\u03A5','upsilon':'\u03C5','UpTeeArrow':'\u21A5','UpTee':'\u22A5','upuparrows':'\u21C8','urcorn':'\u231D','urcorner':'\u231D','urcrop':'\u230E','Uring':'\u016E','uring':'\u016F','urtri':'\u25F9','Uscr':'\uD835\uDCB0','uscr':'\uD835\uDCCA','utdot':'\u22F0','Utilde':'\u0168','utilde':'\u0169','utri':'\u25B5','utrif':'\u25B4','uuarr':'\u21C8','Uuml':'\xDC','uuml':'\xFC','uwangle':'\u29A7','vangrt':'\u299C','varepsilon':'\u03F5','varkappa':'\u03F0','varnothing':'\u2205','varphi':'\u03D5','varpi':'\u03D6','varpropto':'\u221D','varr':'\u2195','vArr':'\u21D5','varrho':'\u03F1','varsigma':'\u03C2','varsubsetneq':'\u228A\uFE00','varsubsetneqq':'\u2ACB\uFE00','varsupsetneq':'\u228B\uFE00','varsupsetneqq':'\u2ACC\uFE00','vartheta':'\u03D1','vartriangleleft':'\u22B2','vartriangleright':'\u22B3','vBar':'\u2AE8','Vbar':'\u2AEB','vBarv':'\u2AE9','Vcy':'\u0412','vcy':'\u0432','vdash':'\u22A2','vDash':'\u22A8','Vdash':'\u22A9','VDash':'\u22AB','Vdashl':'\u2AE6','veebar':'\u22BB','vee':'\u2228','Vee':'\u22C1','veeeq':'\u225A','vellip':'\u22EE','verbar':'|','Verbar':'\u2016','vert':'|','Vert':'\u2016','VerticalBar':'\u2223','VerticalLine':'|','VerticalSeparator':'\u2758','VerticalTilde':'\u2240','VeryThinSpace':'\u200A','Vfr':'\uD835\uDD19','vfr':'\uD835\uDD33','vltri':'\u22B2','vnsub':'\u2282\u20D2','vnsup':'\u2283\u20D2','Vopf':'\uD835\uDD4D','vopf':'\uD835\uDD67','vprop':'\u221D','vrtri':'\u22B3','Vscr':'\uD835\uDCB1','vscr':'\uD835\uDCCB','vsubnE':'\u2ACB\uFE00','vsubne':'\u228A\uFE00','vsupnE':'\u2ACC\uFE00','vsupne':'\u228B\uFE00','Vvdash':'\u22AA','vzigzag':'\u299A','Wcirc':'\u0174','wcirc':'\u0175','wedbar':'\u2A5F','wedge':'\u2227','Wedge':'\u22C0','wedgeq':'\u2259','weierp':'\u2118','Wfr':'\uD835\uDD1A','wfr':'\uD835\uDD34','Wopf':'\uD835\uDD4E','wopf':'\uD835\uDD68','wp':'\u2118','wr':'\u2240','wreath':'\u2240','Wscr':'\uD835\uDCB2','wscr':'\uD835\uDCCC','xcap':'\u22C2','xcirc':'\u25EF','xcup':'\u22C3','xdtri':'\u25BD','Xfr':'\uD835\uDD1B','xfr':'\uD835\uDD35','xharr':'\u27F7','xhArr':'\u27FA','Xi':'\u039E','xi':'\u03BE','xlarr':'\u27F5','xlArr':'\u27F8','xmap':'\u27FC','xnis':'\u22FB','xodot':'\u2A00','Xopf':'\uD835\uDD4F','xopf':'\uD835\uDD69','xoplus':'\u2A01','xotime':'\u2A02','xrarr':'\u27F6','xrArr':'\u27F9','Xscr':'\uD835\uDCB3','xscr':'\uD835\uDCCD','xsqcup':'\u2A06','xuplus':'\u2A04','xutri':'\u25B3','xvee':'\u22C1','xwedge':'\u22C0','Yacute':'\xDD','yacute':'\xFD','YAcy':'\u042F','yacy':'\u044F','Ycirc':'\u0176','ycirc':'\u0177','Ycy':'\u042B','ycy':'\u044B','yen':'\xA5','Yfr':'\uD835\uDD1C','yfr':'\uD835\uDD36','YIcy':'\u0407','yicy':'\u0457','Yopf':'\uD835\uDD50','yopf':'\uD835\uDD6A','Yscr':'\uD835\uDCB4','yscr':'\uD835\uDCCE','YUcy':'\u042E','yucy':'\u044E','yuml':'\xFF','Yuml':'\u0178','Zacute':'\u0179','zacute':'\u017A','Zcaron':'\u017D','zcaron':'\u017E','Zcy':'\u0417','zcy':'\u0437','Zdot':'\u017B','zdot':'\u017C','zeetrf':'\u2128','ZeroWidthSpace':'\u200B','Zeta':'\u0396','zeta':'\u03B6','zfr':'\uD835\uDD37','Zfr':'\u2128','ZHcy':'\u0416','zhcy':'\u0436','zigrarr':'\u21DD','zopf':'\uD835\uDD6B','Zopf':'\u2124','Zscr':'\uD835\uDCB5','zscr':'\uD835\uDCCF','zwj':'\u200D','zwnj':'\u200C'}; + var decodeMapLegacy = {'Aacute':'\xC1','aacute':'\xE1','Acirc':'\xC2','acirc':'\xE2','acute':'\xB4','AElig':'\xC6','aelig':'\xE6','Agrave':'\xC0','agrave':'\xE0','amp':'&','AMP':'&','Aring':'\xC5','aring':'\xE5','Atilde':'\xC3','atilde':'\xE3','Auml':'\xC4','auml':'\xE4','brvbar':'\xA6','Ccedil':'\xC7','ccedil':'\xE7','cedil':'\xB8','cent':'\xA2','copy':'\xA9','COPY':'\xA9','curren':'\xA4','deg':'\xB0','divide':'\xF7','Eacute':'\xC9','eacute':'\xE9','Ecirc':'\xCA','ecirc':'\xEA','Egrave':'\xC8','egrave':'\xE8','ETH':'\xD0','eth':'\xF0','Euml':'\xCB','euml':'\xEB','frac12':'\xBD','frac14':'\xBC','frac34':'\xBE','gt':'>','GT':'>','Iacute':'\xCD','iacute':'\xED','Icirc':'\xCE','icirc':'\xEE','iexcl':'\xA1','Igrave':'\xCC','igrave':'\xEC','iquest':'\xBF','Iuml':'\xCF','iuml':'\xEF','laquo':'\xAB','lt':'<','LT':'<','macr':'\xAF','micro':'\xB5','middot':'\xB7','nbsp':'\xA0','not':'\xAC','Ntilde':'\xD1','ntilde':'\xF1','Oacute':'\xD3','oacute':'\xF3','Ocirc':'\xD4','ocirc':'\xF4','Ograve':'\xD2','ograve':'\xF2','ordf':'\xAA','ordm':'\xBA','Oslash':'\xD8','oslash':'\xF8','Otilde':'\xD5','otilde':'\xF5','Ouml':'\xD6','ouml':'\xF6','para':'\xB6','plusmn':'\xB1','pound':'\xA3','quot':'"','QUOT':'"','raquo':'\xBB','reg':'\xAE','REG':'\xAE','sect':'\xA7','shy':'\xAD','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','szlig':'\xDF','THORN':'\xDE','thorn':'\xFE','times':'\xD7','Uacute':'\xDA','uacute':'\xFA','Ucirc':'\xDB','ucirc':'\xFB','Ugrave':'\xD9','ugrave':'\xF9','uml':'\xA8','Uuml':'\xDC','uuml':'\xFC','Yacute':'\xDD','yacute':'\xFD','yen':'\xA5','yuml':'\xFF'}; + var decodeMapNumeric = {'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'}; + var invalidReferenceCodePoints = [1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65000,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]; + + /*--------------------------------------------------------------------------*/ + + var stringFromCharCode = String.fromCharCode; + + var object = {}; + var hasOwnProperty = object.hasOwnProperty; + var has = function(object, propertyName) { + return hasOwnProperty.call(object, propertyName); + }; + + var contains = function(array, value) { + var index = -1; + var length = array.length; + while (++index < length) { + if (array[index] == value) { + return true; + } + } + return false; + }; + + var merge = function(options, defaults) { + if (!options) { + return defaults; + } + var result = {}; + var key; + for (key in defaults) { + // A `hasOwnProperty` check is not needed here, since only recognized + // option names are used anyway. Any others are ignored. + result[key] = has(options, key) ? options[key] : defaults[key]; + } + return result; + }; + + // Modified version of `ucs2encode`; see http://mths.be/punycode. + var codePointToSymbol = function(codePoint, strict) { + var output = ''; + if ((codePoint >= 0xD800 && codePoint <= 0xDFFF) || codePoint > 0x10FFFF) { + // See issue #4: + // “Otherwise, if the number is in the range 0xD800 to 0xDFFF or is + // greater than 0x10FFFF, then this is a parse error. Return a U+FFFD + // REPLACEMENT CHARACTER.” + if (strict) { + parseError('character reference outside the permissible Unicode range'); + } + return '\uFFFD'; + } + if (has(decodeMapNumeric, codePoint)) { + if (strict) { + parseError('disallowed character reference'); + } + return decodeMapNumeric[codePoint]; + } + if (strict && contains(invalidReferenceCodePoints, codePoint)) { + parseError('disallowed character reference'); + } + if (codePoint > 0xFFFF) { + codePoint -= 0x10000; + output += stringFromCharCode(codePoint >>> 10 & 0x3FF | 0xD800); + codePoint = 0xDC00 | codePoint & 0x3FF; + } + output += stringFromCharCode(codePoint); + return output; + }; + + var hexEscape = function(symbol) { + return '&#x' + symbol.charCodeAt(0).toString(16).toUpperCase() + ';'; + }; + + var parseError = function(message) { + throw Error('Parse error: ' + message); + }; + + /*--------------------------------------------------------------------------*/ + + var encode = function(string, options) { + options = merge(options, encode.options); + var strict = options.strict; + if (strict && regexInvalidRawCodePoint.test(string)) { + parseError('forbidden code point'); + } + var encodeEverything = options.encodeEverything; + var useNamedReferences = options.useNamedReferences; + var allowUnsafeSymbols = options.allowUnsafeSymbols; + if (encodeEverything) { + // Encode ASCII symbols. + string = string.replace(regexAsciiWhitelist, function(symbol) { + // Use named references if requested & possible. + if (useNamedReferences && has(encodeMap, symbol)) { + return '&' + encodeMap[symbol] + ';'; + } + return hexEscape(symbol); + }); + // Shorten a few escapes that represent two symbols, of which at least one + // is within the ASCII range. + if (useNamedReferences) { + string = string + .replace(/>\u20D2/g, '>⃒') + .replace(/<\u20D2/g, '<⃒') + .replace(/fj/g, 'fj'); + } + // Encode non-ASCII symbols. + if (useNamedReferences) { + // Encode non-ASCII symbols that can be replaced with a named reference. + string = string.replace(regexEncodeNonAscii, function(string) { + // Note: there is no need to check `has(encodeMap, string)` here. + return '&' + encodeMap[string] + ';'; + }); + } + // Note: any remaining non-ASCII symbols are handled outside of the `if`. + } else if (useNamedReferences) { + // Apply named character references. + // Encode `<>"'&` using named character references. + if (!allowUnsafeSymbols) { + string = string.replace(regexEscape, function(string) { + return '&' + encodeMap[string] + ';'; // no need to check `has()` here + }); + } + // Shorten escapes that represent two symbols, of which at least one is + // `<>"'&`. + string = string + .replace(/>\u20D2/g, '>⃒') + .replace(/<\u20D2/g, '<⃒'); + // Encode non-ASCII symbols that can be replaced with a named reference. + string = string.replace(regexEncodeNonAscii, function(string) { + // Note: there is no need to check `has(encodeMap, string)` here. + return '&' + encodeMap[string] + ';'; + }); + } else if (!allowUnsafeSymbols) { + // Encode `<>"'&` using hexadecimal escapes, now that they’re not handled + // using named character references. + string = string.replace(regexEscape, hexEscape); + } + return string + // Encode astral symbols. + .replace(regexAstralSymbols, function($0) { + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + var high = $0.charCodeAt(0); + var low = $0.charCodeAt(1); + var codePoint = (high - 0xD800) * 0x400 + low - 0xDC00 + 0x10000; + return '&#x' + codePoint.toString(16).toUpperCase() + ';'; + }) + // Encode any remaining BMP symbols that are not printable ASCII symbols + // using a hexadecimal escape. + .replace(regexBmpWhitelist, hexEscape); + }; + // Expose default options (so they can be overridden globally). + encode.options = { + 'allowUnsafeSymbols': false, + 'encodeEverything': false, + 'strict': false, + 'useNamedReferences': false + }; + + var decode = function(html, options) { + options = merge(options, decode.options); + var strict = options.strict; + if (strict && regexInvalidEntity.test(html)) { + parseError('malformed character reference'); + } + return html.replace(regexDecode, function($0, $1, $2, $3, $4, $5, $6, $7) { + var codePoint; + var semicolon; + var hexDigits; + var reference; + var next; + if ($1) { + // Decode decimal escapes, e.g. `𝌆`. + codePoint = $1; + semicolon = $2; + if (strict && !semicolon) { + parseError('character reference was not terminated by a semicolon'); + } + return codePointToSymbol(codePoint, strict); + } + if ($3) { + // Decode hexadecimal escapes, e.g. `𝌆`. + hexDigits = $3; + semicolon = $4; + if (strict && !semicolon) { + parseError('character reference was not terminated by a semicolon'); + } + codePoint = parseInt(hexDigits, 16); + return codePointToSymbol(codePoint, strict); + } + if ($5) { + // Decode named character references with trailing `;`, e.g. `©`. + reference = $5; + if (has(decodeMap, reference)) { + return decodeMap[reference]; + } else { + // Ambiguous ampersand; see http://mths.be/notes/ambiguous-ampersands. + if (strict) { + parseError( + 'named character reference was not terminated by a semicolon' + ); + } + return $0; + } + } + // If we’re still here, it’s a legacy reference for sure. No need for an + // extra `if` check. + // Decode named character references without trailing `;`, e.g. `&` + // This is only a parse error if it gets converted to `&`, or if it is + // followed by `=` in an attribute context. + reference = $6; + next = $7; + if (next && options.isAttributeValue) { + if (strict && next == '=') { + parseError('`&` did not start a character reference'); + } + return $0; + } else { + if (strict) { + parseError( + 'named character reference was not terminated by a semicolon' + ); + } + // Note: there is no need to check `has(decodeMapLegacy, reference)`. + return decodeMapLegacy[reference] + (next || ''); + } + }); + }; + // Expose default options (so they can be overridden globally). + decode.options = { + 'isAttributeValue': false, + 'strict': false + }; + + var escape = function(string) { + return string.replace(regexEscape, function($0) { + // Note: there is no need to check `has(escapeMap, $0)` here. + return escapeMap[$0]; + }); + }; + + /*--------------------------------------------------------------------------*/ + + var he = { + 'version': '0.5.0', + 'encode': encode, + 'decode': decode, + 'escape': escape, + 'unescape': decode + }; + + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + typeof define == 'function' && + typeof define.amd == 'object' && + define.amd + ) { + define(function() { + return he; + }); + } else if (freeExports && !freeExports.nodeType) { + if (freeModule) { // in Node.js or RingoJS v0.8.0+ + freeModule.exports = he; + } else { // in Narwhal or RingoJS v0.7.0- + for (var key in he) { + has(he, key) && (freeExports[key] = he[key]); + } + } + } else { // in Rhino or a web browser + root.he = he; + } + +}(this)); + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],16:[function(require,module,exports){ +'use strict'; + +/** + * Get the count of the longest repeating streak of + * `character` in `value`. + * + * @example + * longestStreak('` foo `` bar `', '`') // 2 + * + * @param {string} value - Content, coerced to string. + * @param {string} character - Single character to look + * for. + * @return {number} - Number of characters at the place + * where `character` occurs in its longest streak in + * `value`. + * @throws {Error} - when `character` is not a single + * character. + */ +function longestStreak(value, character) { + var count = 0; + var maximum = 0; + var index = -1; + var length; + + value = String(value); + length = value.length; + + if (typeof character !== 'string' || character.length !== 1) { + throw new Error('Expected character'); + } + + while (++index < length) { + if (value.charAt(index) === character) { + count++; + + if (count > maximum) { + maximum = count; + } + } else { + count = 0; + } + } + + return maximum; +} + +/* + * Expose. + */ + +module.exports = longestStreak; + +},{}],17:[function(require,module,exports){ +'use strict'; + +/* + * Useful expressions. + */ + +var EXPRESSION_DOT = /\./; +var EXPRESSION_LAST_DOT = /\.[^.]*$/; + +/* + * Allowed alignment values. + */ + +var LEFT = 'l'; +var RIGHT = 'r'; +var CENTER = 'c'; +var DOT = '.'; +var NULL = ''; + +var ALLIGNMENT = [LEFT, RIGHT, CENTER, DOT, NULL]; + +/* + * Characters. + */ + +var COLON = ':'; +var DASH = '-'; +var PIPE = '|'; +var SPACE = ' '; +var NEW_LINE = '\n'; + +/** + * Get the length of `value`. + * + * @param {string} value + * @return {number} + */ +function lengthNoop(value) { + return String(value).length; +} + +/** + * Get a string consisting of `length` `character`s. + * + * @param {number} length + * @param {string} [character=' '] + * @return {string} + */ +function pad(length, character) { + return Array(length + 1).join(character || SPACE); +} + +/** + * Get the position of the last dot in `value`. + * + * @param {string} value + * @return {number} + */ +function dotindex(value) { + var match = EXPRESSION_LAST_DOT.exec(value); + + return match ? match.index + 1 : value.length; +} + +/** + * Create a table from a matrix of strings. + * + * @param {Array.>} table + * @param {Object?} options + * @param {boolean?} [options.rule=true] + * @param {string?} [options.delimiter=" | "] + * @param {string?} [options.start="| "] + * @param {string?} [options.end=" |"] + * @param {Array.?} options.align + * @param {function(string)?} options.stringLength + * @return {string} Pretty table + */ +function markdownTable(table, options) { + var settings = options || {}; + var delimiter = settings.delimiter; + var start = settings.start; + var end = settings.end; + var alignment = settings.align; + var calculateStringLength = settings.stringLength || lengthNoop; + var cellCount = 0; + var rowIndex = -1; + var rowLength = table.length; + var sizes = []; + var align; + var rule; + var rows; + var row; + var cells; + var index; + var position; + var size; + var value; + var spacing; + var before; + var after; + + alignment = alignment ? alignment.concat() : []; + + if (delimiter === null || delimiter === undefined) { + delimiter = SPACE + PIPE + SPACE; + } + + if (start === null || start === undefined) { + start = PIPE + SPACE; + } + + if (end === null || end === undefined) { + end = SPACE + PIPE; + } + + while (++rowIndex < rowLength) { + row = table[rowIndex]; + + index = -1; + + if (row.length > cellCount) { + cellCount = row.length; + } + + while (++index < cellCount) { + position = row[index] ? dotindex(row[index]) : null; + + if (!sizes[index]) { + sizes[index] = 3; + } + + if (position > sizes[index]) { + sizes[index] = position; + } + } + } + + if (typeof alignment === 'string') { + alignment = pad(cellCount, alignment).split(''); + } + + /* + * Make sure only valid alignments are used. + */ + + index = -1; + + while (++index < cellCount) { + align = alignment[index]; + + if (typeof align === 'string') { + align = align.charAt(0).toLowerCase(); + } + + if (ALLIGNMENT.indexOf(align) === -1) { + align = NULL; + } + + alignment[index] = align; + } + + rowIndex = -1; + rows = []; + + while (++rowIndex < rowLength) { + row = table[rowIndex]; + + index = -1; + cells = []; + + while (++index < cellCount) { + value = row[index]; + + if (value === null || value === undefined) { + value = ''; + } else { + value = String(value); + } + + if (alignment[index] !== DOT) { + cells[index] = value; + } else { + position = dotindex(value); + + size = sizes[index] + + (EXPRESSION_DOT.test(value) ? 0 : 1) - + (calculateStringLength(value) - position); + + cells[index] = value + pad(size - 1); + } + } + + rows[rowIndex] = cells; + } + + sizes = []; + rowIndex = -1; + + while (++rowIndex < rowLength) { + cells = rows[rowIndex]; + + index = -1; + + while (++index < cellCount) { + value = cells[index]; + + if (!sizes[index]) { + sizes[index] = 3; + } + + size = calculateStringLength(value); + + if (size > sizes[index]) { + sizes[index] = size; + } + } + } + + rowIndex = -1; + + while (++rowIndex < rowLength) { + cells = rows[rowIndex]; + + index = -1; + + while (++index < cellCount) { + value = cells[index]; + + position = sizes[index] - (calculateStringLength(value) || 0); + spacing = pad(position); + + if (alignment[index] === RIGHT || alignment[index] === DOT) { + value = spacing + value; + } else if (alignment[index] !== CENTER) { + value = value + spacing; + } else { + position = position / 2; + + if (position % 1 === 0) { + before = position; + after = position; + } else { + before = position + 0.5; + after = position - 0.5; + } + + value = pad(before) + value + pad(after); + } + + cells[index] = value; + } + + rows[rowIndex] = cells.join(delimiter); + } + + if (settings.rule !== false) { + index = -1; + rule = []; + + while (++index < cellCount) { + align = alignment[index]; + + /* + * When `align` is left, don't add colons. + */ + + value = align === RIGHT || align === NULL ? DASH : COLON; + value += pad(sizes[index] - 2, DASH); + value += align !== LEFT && align !== NULL ? COLON : DASH; + + rule[index] = value; + } + + rows.splice(1, 0, rule.join(delimiter)); + } + + return start + rows.join(end + NEW_LINE + start) + end; +} + +/* + * Expose `markdownTable`. + */ + +module.exports = markdownTable; + +},{}],18:[function(require,module,exports){ +/*! + * repeat-string + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +/** + * Expose `repeat` + */ + +module.exports = repeat; + +/** + * Repeat the given `string` the specified `number` + * of times. + * + * **Example:** + * + * ```js + * var repeat = require('repeat-string'); + * repeat('A', 5); + * //=> AAAAA + * ``` + * + * @param {String} `string` The string to repeat + * @param {Number} `number` The number of times to repeat the string + * @return {String} Repeated string + * @api public + */ + +function repeat(str, num) { + if (typeof str !== 'string') { + throw new TypeError('repeat-string expects a string.'); + } + + if (num === 1) return str; + if (num === 2) return str + str; + + var max = str.length * num; + if (cache !== str || typeof cache === 'undefined') { + cache = str; + res = ''; + } + + while (max > res.length && num > 0) { + if (num & 1) { + res += str; + } + + num >>= 1; + if (!num) break; + str += str; + } + + return res.substr(0, max); +} + +/** + * Results cache + */ + +var res = ''; +var cache; + +},{}],19:[function(require,module,exports){ +'use strict'; + +/* + * Constants. + */ + +var LINE = '\n'; + +/** + * Remove final newline characters from `value`. + * + * @example + * trimTrailingLines('foo\nbar'); // 'foo\nbar' + * trimTrailingLines('foo\nbar\n'); // 'foo\nbar' + * trimTrailingLines('foo\nbar\n\n'); // 'foo\nbar' + * + * @param {string} value - Value with trailing newlines, + * coerced to string. + * @return {string} - Value without trailing newlines. + */ +function trimTrailingLines(value) { + var index; + + value = String(value); + index = value.length; + + while (value.charAt(--index) === LINE) { /* empty */ } + + return value.slice(0, index + 1); +} + +/* + * Expose. + */ + +module.exports = trimTrailingLines; + +},{}],20:[function(require,module,exports){ + +exports = module.exports = trim; + +function trim(str){ + return str.replace(/^\s*|\s*$/g, ''); +} + +exports.left = function(str){ + return str.replace(/^\s*/, ''); +}; + +exports.right = function(str){ + return str.replace(/\s*$/, ''); +}; + +},{}],21:[function(require,module,exports){ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module unified + * @fileoverview Parse / Transform / Compile / Repeat. + */ + +'use strict'; + +/* + * Dependencies. + */ + +var bail = require('bail'); +var ware = require('ware'); +var AttachWare = require('attach-ware')(ware); +var VFile = require('vfile'); +var unherit = require('unherit'); + +/* + * Processing pipeline. + */ + +var pipeline = ware() + .use(function (ctx) { + ctx.tree = ctx.context.parse(ctx.file, ctx.settings); + }) + .use(function (ctx, next) { + ctx.context.run(ctx.tree, ctx.file, next); + }) + .use(function (ctx) { + ctx.result = ctx.context.stringify(ctx.tree, ctx.file, ctx.settings); + }); + +/** + * Construct a new Processor class based on the + * given options. + * + * @param {Object} options - Configuration. + * @param {string} options.name - Private storage. + * @param {string} options.type - Type of syntax tree. + * @param {Function} options.Parser - Class to turn a + * virtual file into a syntax tree. + * @param {Function} options.Compiler - Class to turn a + * syntax tree into a string. + * @return {Processor} - A new constructor. + */ +function unified(options) { + var name = options.name; + var type = options.type; + var Parser = options.Parser; + var Compiler = options.Compiler; + + /** + * Construct a Processor instance. + * + * @constructor + * @class {Processor} + */ + function Processor(processor) { + var self = this; + + if (!(self instanceof Processor)) { + return new Processor(processor); + } + + self.ware = new AttachWare(processor && processor.ware); + self.ware.context = self; + + self.Parser = unherit(Parser); + self.Compiler = unherit(Compiler); + } + + /** + * Either return `context` if its an instance + * of `Processor` or construct a new `Processor` + * instance. + * + * @private + * @param {Processor?} [context] - Context object. + * @return {Processor} - Either `context` or a new + * Processor instance. + */ + function instance(context) { + return context instanceof Processor ? context : new Processor(); + } + + /** + * Attach a plugin. + * + * @this {Processor?} - Either a Processor instance or + * the Processor constructor. + * @return {Processor} + */ + function use() { + var self = instance(this); + + self.ware.use.apply(self.ware, arguments); + + return self; + } + + /** + * Transform. + * + * @this {Processor?} - Either a Processor instance or + * the Processor constructor. + * @param {Node} [node] - Syntax tree. + * @param {VFile?} [file] - Virtual file. + * @param {Function?} [done] - Callback. + * @return {Node} - `node`. + */ + function run(node, file, done) { + var self = this; + var space; + + if (typeof file === 'function') { + done = file; + file = null; + } + + if (!file && node && !node.type) { + file = node; + node = null; + } + + file = new VFile(file); + space = file.namespace(name); + + if (!node) { + node = space[type] || node; + } else if (!space[type]) { + space[type] = node; + } + + if (!node) { + throw new Error('Expected node, got ' + node); + } + + done = typeof done === 'function' ? done : bail; + + /* + * Only run when this is an instance of Processor, + * and when there are transformers. + */ + + if (self.ware && self.ware.fns) { + self.ware.run(node, file, done); + } else { + done(null, node, file); + } + + return node; + } + + /** + * Parse a file. + * + * Patches the parsed node onto the `name` + * namespace on the `type` property. + * + * @this {Processor?} - Either a Processor instance or + * the Processor constructor. + * @param {string|VFile} value - Input to parse. + * @param {Object?} [settings] - Configuration. + * @return {Node} - `node`. + */ + function parse(value, settings) { + var file = new VFile(value); + var CustomParser = (this && this.Parser) || Parser; + var node = new CustomParser(file, settings).parse(); + + file.namespace(name)[type] = node; + + return node; + } + + /** + * Compile a file. + * + * Used the parsed node at the `name` + * namespace at `type` when no node was given. + * + * @this {Processor?} - Either a Processor instance or + * the Processor constructor. + * @param {Object} [node] - Syntax tree. + * @param {VFile} [file] - File with syntax tree. + * @param {Object?} [settings] - Configuration. + * @return {string} - Compiled `file`. + */ + function stringify(node, file, settings) { + var CustomCompiler = (this && this.Compiler) || Compiler; + var space; + + if (settings === null || settings === undefined) { + settings = file; + file = null; + } + + if (!file && node && !node.type) { + file = node; + node = null; + } + + file = new VFile(file); + space = file.namespace(name); + + if (!node) { + node = space[type] || node; + } else if (!space[type]) { + space[type] = node; + } + + if (!node) { + throw new Error('Expected node, got ' + node); + } + + return new CustomCompiler(file, settings).compile(); + } + + /** + * Parse / Transform / Compile. + * + * @this {Processor?} - Either a Processor instance or + * the Processor constructor. + * @param {string|VFile} value - Input to process. + * @param {Object?} [settings] - Configuration. + * @param {Function?} [done] - Callback. + * @return {string?} - Parsed document, when + * transformation was async. + */ + function process(value, settings, done) { + var self = instance(this); + var file = new VFile(value); + var result = null; + + if (typeof settings === 'function') { + done = settings; + settings = null; + } + + pipeline.run({ + 'context': self, + 'file': file, + 'settings': settings || {} + }, function (err, res) { + result = res && res.result; + + if (done) { + done(err, file, result); + } else if (err) { + bail(err); + } + }); + + return result; + } + + /* + * Methods / functions. + */ + + var proto = Processor.prototype; + + Processor.use = proto.use = use; + Processor.parse = proto.parse = parse; + Processor.run = proto.run = run; + Processor.stringify = proto.stringify = stringify; + Processor.process = proto.process = process; + + return Processor; +} + +/* + * Expose. + */ + +module.exports = unified; + +},{"attach-ware":22,"bail":2,"unherit":23,"vfile":66,"ware":26}],22:[function(require,module,exports){ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module attach-ware + * @fileoverview Middleware with configuration. + * @example + * var ware = require('attach-ware')(require('ware')); + * + * var middleware = ware() + * .use(function (context, options) { + * if (!options.condition) return; + * + * return function (req, res, next) { + * res.x = 'hello'; + * next(); + * }; + * }, { + * 'condition': true + * }) + * .use(function (context, options) { + * if (!options.condition) return; + * + * return function (req, res, next) { + * res.y = 'world'; + * next(); + * }; + * }, { + * 'condition': false + * }); + * + * middleware.run({}, {}, function (err, req, res) { + * res.x; // "hello" + * res.y; // undefined + * }); + */ + +'use strict'; + +var slice = [].slice; +var unherit = require('unherit'); + +/** + * Clone `Ware` without affecting the super-class and + * turn it into configurable middleware. + * + * @param {Function} Ware - Ware-like constructor. + * @return {Function} AttachWare - Configurable middleware. + */ +function patch(Ware) { + /* + * Methods. + */ + + var useFn = Ware.prototype.use; + + /** + * @constructor + * @class {AttachWare} + */ + var AttachWare = unherit(Ware); + + AttachWare.prototype.foo = true; + + /** + * Attach configurable middleware. + * + * @memberof {AttachWare} + * @this {AttachWare} + * @param {Function} attach + * @return {AttachWare} - `this`. + */ + function use(attach) { + var self = this; + var params = slice.call(arguments, 1); + var index; + var length; + var fn; + + /* + * Accept other `AttachWare`. + */ + + if (attach instanceof AttachWare) { + if (attach.attachers) { + return self.use(attach.attachers); + } + + return self; + } + + /* + * Accept normal ware. + */ + + if (attach instanceof Ware) { + self.fns = self.fns.concat(attach.fns); + return self; + } + + /* + * Multiple attachers. + */ + + if ('length' in attach && typeof attach !== 'function') { + index = -1; + length = attach.length; + + while (++index < length) { + self.use.apply(self, [attach[index]].concat(params)); + } + + return self; + } + + /* + * Single attacher. + */ + + fn = attach.apply(null, [self.context || self].concat(params)); + + /* + * Store the attacher to not break `new Ware(otherWare)` + * functionality. + */ + + if (!self.attachers) { + self.attachers = []; + } + + self.attachers.push(attach); + + /* + * Pass `fn` to the original `Ware#use()`. + */ + + if (fn) { + useFn.call(self, fn); + } + + return self; + } + + AttachWare.prototype.use = use; + + return function (fn) { + return new AttachWare(fn); + }; +} + +module.exports = patch; + +},{"unherit":23}],23:[function(require,module,exports){ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module unherit + * @fileoverview Create a custom constructor which can be modified + * without affecting the original class. + * @example + * var EventEmitter = require('events').EventEmitter; + * var Emitter = unherit(EventEmitter); + * // Create a private class which acts just like + * // `EventEmitter`. + * + * Emitter.prototype.defaultMaxListeners = 0; + * // Now, all instances of `Emitter` have no maximum + * // listeners, without affecting other `EventEmitter`s. + */ + +'use strict'; + +/* + * Dependencies. + */ + +var clone = require('clone'); +var inherits = require('inherits'); + +/** + * Create a custom constructor which can be modified + * without affecting the original class. + * + * @param {Function} Super - Super-class. + * @return {Function} - Constructor acting like `Super`, + * which can be modified without affecting the original + * class. + */ +function unherit(Super) { + var base = clone(Super.prototype); + var result; + var key; + + /** + * Constructor accepting a single argument, + * which itself is an `arguments` object. + */ + function From(parameters) { + return Super.apply(this, parameters); + } + + /** + * Constructor accepting variadic arguments. + */ + function Of() { + if (!(this instanceof Of)) { + return new From(arguments); + } + + return Super.apply(this, arguments); + } + + inherits(Of, Super); + inherits(From, Of); + + /* + * Both do duplicate work. However, cloning the + * prototype ensures clonable things are cloned + * and thus used. The `inherits` call ensures + * `instanceof` still thinks an instance subclasses + * `Super`. + */ + + result = Of.prototype; + + for (key in base) { + result[key] = base[key]; + } + + return Of; +} + +/* + * Expose. + */ + +module.exports = unherit; + +},{"clone":24,"inherits":25}],24:[function(require,module,exports){ +(function (Buffer){ +var clone = (function() { +'use strict'; + +/** + * Clones (copies) an Object using deep copying. + * + * This function supports circular references by default, but if you are certain + * there are no circular references in your object, you can save some CPU time + * by calling clone(obj, false). + * + * Caution: if `circular` is false and `parent` contains circular references, + * your program may enter an infinite loop and crash. + * + * @param `parent` - the object to be cloned + * @param `circular` - set to true if the object to be cloned may contain + * circular references. (optional - true by default) + * @param `depth` - set to a number if the object is only to be cloned to + * a particular depth. (optional - defaults to Infinity) + * @param `prototype` - sets the prototype to be used when cloning an object. + * (optional - defaults to parent prototype). +*/ +function clone(parent, circular, depth, prototype) { + var filter; + if (typeof circular === 'object') { + depth = circular.depth; + prototype = circular.prototype; + filter = circular.filter; + circular = circular.circular + } + // maintain two arrays for circular references, where corresponding parents + // and children have the same index + var allParents = []; + var allChildren = []; + + var useBuffer = typeof Buffer != 'undefined'; + + if (typeof circular == 'undefined') + circular = true; + + if (typeof depth == 'undefined') + depth = Infinity; + + // recurse this function so we don't reset allParents and allChildren + function _clone(parent, depth) { + // cloning null always returns null + if (parent === null) + return null; + + if (depth == 0) + return parent; + + var child; + var proto; + if (typeof parent != 'object') { + return parent; + } + + if (clone.__isArray(parent)) { + child = []; + } else if (clone.__isRegExp(parent)) { + child = new RegExp(parent.source, __getRegExpFlags(parent)); + if (parent.lastIndex) child.lastIndex = parent.lastIndex; + } else if (clone.__isDate(parent)) { + child = new Date(parent.getTime()); + } else if (useBuffer && Buffer.isBuffer(parent)) { + child = new Buffer(parent.length); + parent.copy(child); + return child; + } else { + if (typeof prototype == 'undefined') { + proto = Object.getPrototypeOf(parent); + child = Object.create(proto); + } + else { + child = Object.create(prototype); + proto = prototype; + } + } + + if (circular) { + var index = allParents.indexOf(parent); + + if (index != -1) { + return allChildren[index]; + } + allParents.push(parent); + allChildren.push(child); + } + + for (var i in parent) { + var attrs; + if (proto) { + attrs = Object.getOwnPropertyDescriptor(proto, i); + } + + if (attrs && attrs.set == null) { + continue; + } + child[i] = _clone(parent[i], depth - 1); + } + + return child; + } + + return _clone(parent, depth); +} + +/** + * Simple flat clone using prototype, accepts only objects, usefull for property + * override on FLAT configuration object (no nested props). + * + * USE WITH CAUTION! This may not behave as you wish if you do not know how this + * works. + */ +clone.clonePrototype = function clonePrototype(parent) { + if (parent === null) + return null; + + var c = function () {}; + c.prototype = parent; + return new c(); +}; + +// private utility functions + +function __objToStr(o) { + return Object.prototype.toString.call(o); +}; +clone.__objToStr = __objToStr; + +function __isDate(o) { + return typeof o === 'object' && __objToStr(o) === '[object Date]'; +}; +clone.__isDate = __isDate; + +function __isArray(o) { + return typeof o === 'object' && __objToStr(o) === '[object Array]'; +}; +clone.__isArray = __isArray; + +function __isRegExp(o) { + return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; +}; +clone.__isRegExp = __isRegExp; + +function __getRegExpFlags(re) { + var flags = ''; + if (re.global) flags += 'g'; + if (re.ignoreCase) flags += 'i'; + if (re.multiline) flags += 'm'; + return flags; +}; +clone.__getRegExpFlags = __getRegExpFlags; + +return clone; +})(); + +if (typeof module === 'object' && module.exports) { + module.exports = clone; +} + +}).call(this,require("buffer").Buffer) +},{"buffer":undefined}],25:[function(require,module,exports){ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} + +},{}],26:[function(require,module,exports){ +/** + * Module Dependencies + */ + +var slice = [].slice; +var wrap = require('wrap-fn'); + +/** + * Expose `Ware`. + */ + +module.exports = Ware; + +/** + * Throw an error. + * + * @param {Error} error + */ + +function fail (err) { + throw err; +} + +/** + * Initialize a new `Ware` manager, with optional `fns`. + * + * @param {Function or Array or Ware} fn (optional) + */ + +function Ware (fn) { + if (!(this instanceof Ware)) return new Ware(fn); + this.fns = []; + if (fn) this.use(fn); +} + +/** + * Use a middleware `fn`. + * + * @param {Function or Array or Ware} fn + * @return {Ware} + */ + +Ware.prototype.use = function (fn) { + if (fn instanceof Ware) { + return this.use(fn.fns); + } + + if (fn instanceof Array) { + for (var i = 0, f; f = fn[i++];) this.use(f); + return this; + } + + this.fns.push(fn); + return this; +}; + +/** + * Run through the middleware with the given `args` and optional `callback`. + * + * @param {Mixed} args... + * @param {Function} callback (optional) + * @return {Ware} + */ + +Ware.prototype.run = function () { + var fns = this.fns; + var ctx = this; + var i = 0; + var last = arguments[arguments.length - 1]; + var done = 'function' == typeof last && last; + var args = done + ? slice.call(arguments, 0, arguments.length - 1) + : slice.call(arguments); + + // next step + function next (err) { + if (err) return (done || fail)(err); + var fn = fns[i++]; + var arr = slice.call(args); + + if (!fn) { + return done && done.apply(null, [null].concat(args)); + } + + wrap(fn, next).apply(ctx, arr); + } + + next(); + + return this; +}; + +},{"wrap-fn":27}],27:[function(require,module,exports){ +/** + * Module Dependencies + */ + +var noop = function(){}; +var co = require('co'); + +/** + * Export `wrap-fn` + */ + +module.exports = wrap; + +/** + * Wrap a function to support + * sync, async, and gen functions. + * + * @param {Function} fn + * @param {Function} done + * @return {Function} + * @api public + */ + +function wrap(fn, done) { + done = once(done || noop); + + return function() { + // prevents arguments leakage + // see https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments + var i = arguments.length; + var args = new Array(i); + while (i--) args[i] = arguments[i]; + + var ctx = this; + + // done + if (!fn) { + return done.apply(ctx, [null].concat(args)); + } + + // async + if (fn.length > args.length) { + // NOTE: this only handles uncaught synchronous errors + try { + return fn.apply(ctx, args.concat(done)); + } catch (e) { + return done(e); + } + } + + // generator + if (generator(fn)) { + return co(fn).apply(ctx, args.concat(done)); + } + + // sync + return sync(fn, done).apply(ctx, args); + } +} + +/** + * Wrap a synchronous function execution. + * + * @param {Function} fn + * @param {Function} done + * @return {Function} + * @api private + */ + +function sync(fn, done) { + return function () { + var ret; + + try { + ret = fn.apply(this, arguments); + } catch (err) { + return done(err); + } + + if (promise(ret)) { + ret.then(function (value) { done(null, value); }, done); + } else { + ret instanceof Error ? done(ret) : done(null, ret); + } + } +} + +/** + * Is `value` a generator? + * + * @param {Mixed} value + * @return {Boolean} + * @api private + */ + +function generator(value) { + return value + && value.constructor + && 'GeneratorFunction' == value.constructor.name; +} + + +/** + * Is `value` a promise? + * + * @param {Mixed} value + * @return {Boolean} + * @api private + */ + +function promise(value) { + return value && 'function' == typeof value.then; +} + +/** + * Once + */ + +function once(fn) { + return function() { + var ret = fn.apply(this, arguments); + fn = noop; + return ret; + }; +} + +},{"co":28}],28:[function(require,module,exports){ + +/** + * slice() reference. + */ + +var slice = Array.prototype.slice; + +/** + * Expose `co`. + */ + +module.exports = co; + +/** + * Wrap the given generator `fn` and + * return a thunk. + * + * @param {Function} fn + * @return {Function} + * @api public + */ + +function co(fn) { + var isGenFun = isGeneratorFunction(fn); + + return function (done) { + var ctx = this; + + // in toThunk() below we invoke co() + // with a generator, so optimize for + // this case + var gen = fn; + + // we only need to parse the arguments + // if gen is a generator function. + if (isGenFun) { + var args = slice.call(arguments), len = args.length; + var hasCallback = len && 'function' == typeof args[len - 1]; + done = hasCallback ? args.pop() : error; + gen = fn.apply(this, args); + } else { + done = done || error; + } + + next(); + + // #92 + // wrap the callback in a setImmediate + // so that any of its errors aren't caught by `co` + function exit(err, res) { + setImmediate(function(){ + done.call(ctx, err, res); + }); + } + + function next(err, res) { + var ret; + + // multiple args + if (arguments.length > 2) res = slice.call(arguments, 1); + + // error + if (err) { + try { + ret = gen.throw(err); + } catch (e) { + return exit(e); + } + } + + // ok + if (!err) { + try { + ret = gen.next(res); + } catch (e) { + return exit(e); + } + } + + // done + if (ret.done) return exit(null, ret.value); + + // normalize + ret.value = toThunk(ret.value, ctx); + + // run + if ('function' == typeof ret.value) { + var called = false; + try { + ret.value.call(ctx, function(){ + if (called) return; + called = true; + next.apply(ctx, arguments); + }); + } catch (e) { + setImmediate(function(){ + if (called) return; + called = true; + next(e); + }); + } + return; + } + + // invalid + next(new TypeError('You may only yield a function, promise, generator, array, or object, ' + + 'but the following was passed: "' + String(ret.value) + '"')); + } + } +} + +/** + * Convert `obj` into a normalized thunk. + * + * @param {Mixed} obj + * @param {Mixed} ctx + * @return {Function} + * @api private + */ + +function toThunk(obj, ctx) { + + if (isGeneratorFunction(obj)) { + return co(obj.call(ctx)); + } + + if (isGenerator(obj)) { + return co(obj); + } + + if (isPromise(obj)) { + return promiseToThunk(obj); + } + + if ('function' == typeof obj) { + return obj; + } + + if (isObject(obj) || Array.isArray(obj)) { + return objectToThunk.call(ctx, obj); + } + + return obj; +} + +/** + * Convert an object of yieldables to a thunk. + * + * @param {Object} obj + * @return {Function} + * @api private + */ + +function objectToThunk(obj){ + var ctx = this; + var isArray = Array.isArray(obj); + + return function(done){ + var keys = Object.keys(obj); + var pending = keys.length; + var results = isArray + ? new Array(pending) // predefine the array length + : new obj.constructor(); + var finished; + + if (!pending) { + setImmediate(function(){ + done(null, results) + }); + return; + } + + // prepopulate object keys to preserve key ordering + if (!isArray) { + for (var i = 0; i < pending; i++) { + results[keys[i]] = undefined; + } + } + + for (var i = 0; i < keys.length; i++) { + run(obj[keys[i]], keys[i]); + } + + function run(fn, key) { + if (finished) return; + try { + fn = toThunk(fn, ctx); + + if ('function' != typeof fn) { + results[key] = fn; + return --pending || done(null, results); + } + + fn.call(ctx, function(err, res){ + if (finished) return; + + if (err) { + finished = true; + return done(err); + } + + results[key] = res; + --pending || done(null, results); + }); + } catch (err) { + finished = true; + done(err); + } + } + } +} + +/** + * Convert `promise` to a thunk. + * + * @param {Object} promise + * @return {Function} + * @api private + */ + +function promiseToThunk(promise) { + return function(fn){ + promise.then(function(res) { + fn(null, res); + }, fn); + } +} + +/** + * Check if `obj` is a promise. + * + * @param {Object} obj + * @return {Boolean} + * @api private + */ + +function isPromise(obj) { + return obj && 'function' == typeof obj.then; +} + +/** + * Check if `obj` is a generator. + * + * @param {Mixed} obj + * @return {Boolean} + * @api private + */ + +function isGenerator(obj) { + return obj && 'function' == typeof obj.next && 'function' == typeof obj.throw; +} + +/** + * Check if `obj` is a generator function. + * + * @param {Mixed} obj + * @return {Boolean} + * @api private + */ + +function isGeneratorFunction(obj) { + return obj && obj.constructor && 'GeneratorFunction' == obj.constructor.name; +} + +/** + * Check for plain object. + * + * @param {Mixed} val + * @return {Boolean} + * @api private + */ + +function isObject(val) { + return val && Object == val.constructor; +} + +/** + * Throw `err` in a new stack. + * + * This is used when co() is invoked + * without supplying a callback, which + * should only be for demonstrational + * purposes. + * + * @param {Error} err + * @api private + */ + +function error(err) { + if (!err) return; + setImmediate(function(){ + throw err; + }); +} + +},{}],29:[function(require,module,exports){ +'use strict'; + +/** + * Stringify an NLCST node. + * + * @param {NLCSTNode} nlcst + * @return {string} + */ +function nlcstToString(nlcst) { + var values, + length, + children; + + if (typeof nlcst.value === 'string') { + return nlcst.value; + } + + children = nlcst.children; + length = children.length; + + /** + * Shortcut: This is pretty common, and a small performance win. + */ + + if (length === 1 && 'value' in children[0]) { + return children[0].value; + } + + values = []; + + while (length--) { + values[length] = nlcstToString(children[length]); + } + + return values.join(''); +} + +/* + * Expose `nlcstToString`. + */ + +module.exports = nlcstToString; + +},{}],30:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var Parser, + nlcstToString; + +Parser = require('parse-latin'); +nlcstToString = require('nlcst-to-string'); + +/* + * Constants. + */ + +var EXPRESSION_ABBREVIATION_ENGLISH_PREFIX, + EXPRESSION_ABBREVIATION_ENGLISH_PREFIX_SENSITIVE, + EXPRESSION_ELISION_ENGLISH_AFFIX, + EXPRESSION_ELISION_ENGLISH_PREFIX, + EXPRESSION_APOSTROPHE; + +/* + * Match a blacklisted (case-insensitive) abbreviation + * which when followed by a full-stop does not depict + * a sentence terminal marker. + */ + +EXPRESSION_ABBREVIATION_ENGLISH_PREFIX = new RegExp( + '^(' + + /* + * Business Abbreviations: + * + * Incorporation, Limited company. + */ + + 'inc|ltd|' + + + /* + * English unit abbreviations: + * - Note that *Metric abbreviations* do not use + * full stops. + * - Note that some common plurals are included, + * although units should not be pluralised. + * + * barrel, cubic, dozen, fluid (ounce), foot, gallon, grain, gross, + * inch, karat / knot, pound, mile, ounce, pint, quart, square, + * tablespoon, teaspoon, yard. + */ + + 'bbls?|cu|doz|fl|ft|gal|gr|gro|in|kt|lbs?|mi|oz|pt|qt|sq|tbsp|' + + 'tsp|yds?|' + + + /* + * Abbreviations of time references: + * + * seconds, minutes, hours, Monday, Tuesday, *, Wednesday, + * Thursday, *, Friday, Saturday, Sunday, January, Februari, March, + * April, June, July, August, September, *, October, November, + * December. + */ + + 'sec|min|hr|mon|tue|tues|wed|thu|thurs|fri|sat|sun|jan|feb|mar|' + + 'apr|jun|jul|aug|sep|sept|oct|nov|dec' + + ')$' + /* + * NOTE! There's no `i` flag here because the value to + * test against should be all lowercase! + */ +); + +/* + * Match a blacklisted (case-sensitive) abbreviation + * which when followed by a full-stop does not depict + * a sentence terminal marker. + */ + +EXPRESSION_ABBREVIATION_ENGLISH_PREFIX_SENSITIVE = new RegExp( + '^(' + + /* + * Social: + * + * Mister, Mistress, Mistress, woman, Mademoiselle, Madame, Monsieur, + * Misters, Mesdames, Junior, Senior, *. + */ + + 'Mr|Mrs|Miss|Ms|Mss|Mses|Mlle|Mme|M|Messrs|Mmes|Jr|Sr|Snr|' + + + /* + * Rank and academic: + * + * Doctor, Magister, Attorney, Profesor, Honourable, Reverend, + * Father, Monsignor, Sister, Brother, Saint, President, + * Superintendent, Representative, Senator. + */ + + 'Dr|Mgr|Atty|Prof|Hon|Rev|Fr|Msgr|Sr|Br|St|Pres|Supt|Rep|Sen|' + + + /* + * Rank and military: + * + * Governor, Ambassador, Treasurer, Secretary, Admiral, Brigadier, + * General, Commander, Colonel, Captain, Lieutenant, Major, + * Sergeant, Petty Officer, Warrant Officer, Purple Heart. + */ + + 'Gov|Amb|Treas|Sec|Amd|Brig|Gen|Cdr|Col|Capt|Lt|Maj|Sgt|Po|Wo|Ph|' + + + /* + * Common geographical abbreviations: + * + * Avenue, Boulevard, Mountain, Road, Building, National, *, Route, *, + * County, Park, Square, Drive, Port or Point, Street or State, Fort, + * Peninsula, Territory, Highway, Freeway, Parkway. + */ + + 'Ave|Blvd|Mt|Rd|Bldgs?|Nat|Natl|Rt|Rte|Co|Pk|Sq|Dr|Pt|St|' + + 'Ft|Pen|Terr|Hwy|Fwy|Pkwy|' + + + /* + * American state abbreviations: + * + * Alabama, Arizona, Arkansas, California, *, Colorado, *, + * Connecticut, Delaware, Florida, Georgia,Idaho, *, Illinois, + * Indiana, Iowa, Kansas, *, Kentucky, *, Louisiana, Maine, Maryland, + * Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana, + * Nebraska, *, Nevada, Mexico, Dakota, Oklahoma, *, Oregon, + * Pennsylvania, *, *, Tennessee, Texas, Utah, Vermont, Virginia, + * Washington, Wisconsin, *, Wyoming. + */ + + 'Ala|Ariz|Ark|Cal|Calif|Col|Colo|Conn|Del|Fla|Ga|Ida|Id|Ill|Ind|' + + 'Ia|Kan|Kans|Ken|Ky|La|Me|Md|Mass|Mich|Minn|Miss|Mo|Mont|Neb|' + + 'Nebr|Nev|Mex|Dak|Okla|Ok|Ore|Penna|Penn|Pa|Tenn|Tex|Ut|Vt|Va|' + + 'Wash|Wis|Wisc|Wyo|' + + + /* + * Canadian province abbreviations: + * + * Alberta, Manitoba, Ontario, Quebec, *, Saskatchewan, + * Yukon Territory. + */ + + 'Alta|Man|Ont|Qu\u00E9|Que|Sask|Yuk|' + + + /* + * English county abbreviations: + * + * Bedfordshire, Berkshire, Buckinghamshire, Cambridgeshire, + * Cheshire, Cornwall, Cumberland, Derbyshire, *, Devon, Dorset, + * Durham, Gloucestershire, Hampshire, Herefordshire, *, + * Hertfordshire, Huntingdonshire, Lancashire, Leicestershire, + * Lincolnshire, Middlesex, *, *, Norfolk, Northamptonshire, + * Northumberland, *, Nottinghamshire, Oxfordshire, Rutland, + * Shropshire, Somerset, Staffordshire, *, Suffolk, Surrey, + * Sussex, *, Warwickshire, *, *, Westmorland, Wiltshire, + * Worcestershire, Yorkshire. + */ + + 'Beds|Berks|Bucks|Cambs|Ches|Corn|Cumb|Derbys|Derbs|Dev|Dor|Dur|' + + 'Glos|Hants|Here|Heref|Herts|Hunts|Lancs|Leics|Lincs|Mx|Middx|Mddx|' + + 'Norf|Northants|Northumb|Northd|Notts|Oxon|Rut|Shrops|Salop|Som|' + + 'Staffs|Staf|Suff|Sy|Sx|Ssx|Warks|War|Warw|Westm|Wilts|Worcs|Yorks' + + ')$' +); + +/* + * Match a blacklisted word which when followed by + * an apostrophe depicts elision. + */ + +EXPRESSION_ELISION_ENGLISH_PREFIX = new RegExp( + '^(' + + /* + * Includes: + * + * - o' > of; + * - ol' > old. + */ + + 'o|ol' + + ')$' +); + +/* + * Match a blacklisted word which when preceded by + * an apostrophe depicts elision. + */ + +EXPRESSION_ELISION_ENGLISH_AFFIX = new RegExp( + '^(' + + /* + * Includes: + * + * - 'im > him; + * - 'er > her; + * - 'em > them. + * - 'cause > because. + */ + + 'im|er|em|cause|' + + + /* + * Includes: + * + * - 'twas > it was; + * - 'tis > it is; + * - 'twere > it were. + */ + + 'twas|tis|twere|' + + + /* + * Matches groups of year, optionally followed + * by an `s`. + */ + + '\\d\\ds?' + + ')$' +); + +/* + * Match one apostrophe. + */ + +EXPRESSION_APOSTROPHE = /^['\u2019]$/; + +/** + * Merge a sentence into its next sentence, + * when the sentence ends with a certain word. + * + * @param {NLCSTNode} child + * @param {number} index + * @param {NLCSTParagraphNode} parent + * @return {number?} + */ +function mergeEnglishPrefixExceptions(child, index, parent) { + var children, + node, + prev, + next, + prevValue; + + children = child.children; + + if ( + children && + children.length && + index !== parent.children.length - 1 + ) { + prev = children[children.length - 2]; + node = children[children.length - 1]; + + if ( + node && + prev && + prev.type === 'WordNode' && + nlcstToString(node) === '.' + ) { + prevValue = nlcstToString(prev); + + if ( + EXPRESSION_ABBREVIATION_ENGLISH_PREFIX_SENSITIVE.test( + prevValue + ) || + EXPRESSION_ABBREVIATION_ENGLISH_PREFIX.test( + prevValue.toLowerCase() + ) + ) { + next = parent.children[index + 1]; + + child.children = children.concat(next.children); + + /* + * Update position. + */ + + if (child.position && next.position) { + child.position.end = next.position.end; + } + + parent.children.splice(index + 1, 1); + + return index - 1; + } + } + } +} + +/** + * Merge an apostrophe depicting elision into + * its surrounding word. + * + * @param {NLCSTNode} child + * @param {number} index + * @param {NLCSTSentenceNode} parent + */ +function mergeEnglishElisionExceptions(child, index, parent) { + var siblings, + length, + node, + other, + value; + + if ( + child.type !== 'PunctuationNode' && + child.type !== 'SymbolNode' + ) { + return; + } + + siblings = parent.children; + + length = siblings.length; + + value = nlcstToString(child); + + /* + * Match abbreviation of `with`, `w/` + */ + + if (value === '/') { + node = siblings[index - 1]; + + if (node && nlcstToString(node).toLowerCase() === 'w') { + /* + * Remove the slash from parent. + */ + + siblings.splice(index, 1); + + /* + * Append the slash into the children of the + * previous node. + */ + + node.children.push(child); + + /* + * Update position. + */ + + if (node.position && child.position) { + node.position.end = child.position.end; + } + } + } else if (EXPRESSION_APOSTROPHE.test(value)) { + /* + * If two preceding (the first white space and the + * second a word), and one following (white space) + * nodes exist... + */ + + node = siblings[index - 1]; + + if ( + index > 2 && + index < length - 1 && + node.type === 'WordNode' && + siblings[index - 2].type === 'WhiteSpaceNode' && + siblings[index + 1].type === 'WhiteSpaceNode' && + EXPRESSION_ELISION_ENGLISH_PREFIX.test( + nlcstToString(node).toLowerCase() + ) + ) { + /* + * Remove the apostrophe from parent. + */ + + siblings.splice(index, 1); + + /* + * Append the apostrophe into the children of + * node. + */ + + node.children.push(child); + + /* + * Update position. + */ + + if (node.position && child.position) { + node.position.end = child.position.end; + } + + return; + } + + /* + * If a following word exists, and the preceding node + * is not a word... + */ + + if ( + index !== length - 1 && + siblings[index + 1].type === 'WordNode' && + ( + index === 0 || + siblings[index - 1].type !== 'WordNode' + ) + ) { + node = siblings[index + 1]; + value = nlcstToString(node).toLowerCase(); + + if (EXPRESSION_ELISION_ENGLISH_AFFIX.test(value)) { + /* + * Remove the apostrophe from parent. + */ + + siblings.splice(index, 1); + + /* + * Prepend the apostrophe into the children of + * node. + */ + + node.children = [child].concat(node.children); + + /* + * Update position. + */ + + if (node.position && child.position) { + node.position.start = child.position.start; + } + + /* + * If both preceded and followed by an apostrophe, + * and the word is `n`... + */ + } else if ( + value === 'n' && + index < length - 2 && + EXPRESSION_APOSTROPHE.test( + nlcstToString(siblings[index + 2]) + ) + ) { + other = siblings[index + 2]; + + /* + * Remove the apostrophe from parent. + */ + + siblings.splice(index, 1); + siblings.splice(index + 1, 1); + + /* + * Prepend the preceding apostrophe and append + * the into the following apostrophe into + * the children of node. + */ + + node.children = [child].concat(node.children, other); + + /* + * Update position. + */ + + if (node.position) { + /* istanbul ignore else */ + if (child.position) { + node.position.start = child.position.start; + } + + /* istanbul ignore else */ + if (other.position) { + node.position.end = other.position.end; + } + } + } + } + } +} + +/** + * Transform English natural language into an NLCST-tree. + * + * @constructor {ParseEnglish} + */ +function ParseEnglish() { + /* + * TODO: This should later be removed (when this change bubbles + * through to dependants) + */ + + if (!(this instanceof ParseEnglish)) { + return new ParseEnglish(); + } + + Parser.apply(this, arguments); +} + +/* + * Inherit from `ParseLatin`. + */ + +var parserPrototype; + +/** + * Constructor to create a `ParseEnglish` prototype. + */ +function ParserPrototype () {} + +ParserPrototype.prototype = Parser.prototype; + +parserPrototype = new ParserPrototype(); + +ParseEnglish.prototype = parserPrototype; + +/* + * Add modifiers to `parser`. + */ + +parserPrototype.tokenizeSentencePlugins = + [Parser.plugin(mergeEnglishElisionExceptions)].concat( + parserPrototype.tokenizeSentencePlugins + ); + +parserPrototype.tokenizeParagraphPlugins = + [Parser.modifier(mergeEnglishPrefixExceptions)].concat( + parserPrototype.tokenizeParagraphPlugins + ); + +/* + * Expose `ParseEnglish`. + */ + +module.exports = ParseEnglish; + +/* + * Expose `ParseLatin.modifier` on `ParseEnglish`. + */ + +ParseEnglish.modifier = Parser.modifier; + +/* + * Expose `ParseLatin.plugin` on `ParseEnglish`. + */ + +ParseEnglish.plugin = Parser.plugin; + +},{"nlcst-to-string":29,"parse-latin":31}],31:[function(require,module,exports){ +'use strict'; + +module.exports = require('./lib/parse-latin'); + +},{"./lib/parse-latin":34}],32:[function(require,module,exports){ +module.exports = { + 'affixSymbol': /^([\)\]\}\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63]|["'\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21]|[!\.\?\u2026\u203D])\1*$/, + 'newLine': /^(\r?\n|\r)+$/, + 'newLineMulti': /^(\r?\n|\r){2,}$/, + 'terminalMarker': /^((?:[!\.\?\u2026\u203D])+)$/, + 'wordSymbolInner': /^((?:[&'\-\.:=\?@\xAD\xB7\u2010\u2011\u2019\u2027])|(?:[\/_])+)$/, + 'punctuation': /^(?:[!"'-\),-\/:;\?\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u201F\u2022-\u2027\u2032-\u203A\u203C-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B])+$/, + 'numerical': /^(?:[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF]|\uD83C[\uDD00-\uDD0C])+$/, + 'lowerInitial': /^(?:[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]|\uD801[\uDC28-\uDC4F]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB])/, + 'token': /(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09F4-\u09F9\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71-\u0B77\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BF2\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7E\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D75\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u17F0-\u17F9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABE\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u3192-\u3195\u31A0-\u31BA\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA830-\uA835\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0-\uDEFB\uDF00-\uDF23\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F-\uDE47\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE6\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD804[\uDC00-\uDC46\uDC52-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF3B]|\uD806[\uDCA0-\uDCF2\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44\uDF60-\uDF71]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF])+|(?:[\t-\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000])+|(?:[\uD800-\uDFFF])+|([\s\S])\1*/g, + 'word': /^(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09F4-\u09F9\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71-\u0B77\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BF2\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7E\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D75\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u17F0-\u17F9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABE\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u3192-\u3195\u31A0-\u31BA\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA830-\uA835\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0-\uDEFB\uDF00-\uDF23\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F-\uDE47\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE6\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD804[\uDC00-\uDC46\uDC52-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF3B]|\uD806[\uDCA0-\uDCF2\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44\uDF60-\uDF71]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF])+$/, + 'whiteSpace': /^(?:[\t-\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000])+$/ +}; + +},{}],33:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var iterate; + +iterate = require('array-iterate'); + +/** + * Pass the context as the third argument to `callback`. + * + * @param {function(Object, number, Object): number|undefined} callback + * @return {function(Object, number)} + */ +function wrapperFactory(callback) { + return function (value, index) { + return callback(value, index, this); + }; +} + +/** + * Turns `callback` into a ``iterator'' accepting a parent. + * + * see ``array-iterate'' for more info. + * + * @param {function(Object, number, Object): number|undefined} callback + * @return {function(NLCSTParent)} + */ +function iteratorFactory(callback) { + return function (parent) { + return iterate(parent.children, callback, parent); + }; +} + +/** + * Turns `callback` into a ``iterator'' accepting a parent. + * + * see ``array-iterate'' for more info. + * + * @param {function(Object, number, Object): number|undefined} callback + * @return {function(Object)} + */ +function modifierFactory(callback) { + return iteratorFactory(wrapperFactory(callback)); +} + +/* + * Expose `modifierFactory`. + */ + +module.exports = modifierFactory; + +},{"array-iterate":54}],34:[function(require,module,exports){ +/*! + * parse-latin + * + * Licensed under MIT. + * Copyright (c) 2014 Titus Wormer + */ + +'use strict'; + +/* + * Dependencies. + */ + +var createParser, + expressions, + pluginFactory, + modifierFactory; + +createParser = require('./parser'); +expressions = require('./expressions'); +pluginFactory = require('./plugin'); +modifierFactory = require('./modifier'); + +/* + * == CLASSIFY =============================================================== + */ + +/* + * Constants. + */ + +var EXPRESSION_TOKEN, + EXPRESSION_WORD, + EXPRESSION_PUNCTUATION, + EXPRESSION_WHITE_SPACE; + +/* + * Match all tokens: + * - One or more number, alphabetic, or + * combining characters; + * - One or more white space characters; + * - One or more astral plane characters; + * - One or more of the same character; + */ + +EXPRESSION_TOKEN = expressions.token; + +/* + * Match a word. + */ + +EXPRESSION_WORD = expressions.word; + +/* + * Match a string containing ONLY punctuation. + */ + +EXPRESSION_PUNCTUATION = expressions.punctuation; + +/* + * Match a string containing ONLY white space. + */ + +EXPRESSION_WHITE_SPACE = expressions.whiteSpace; + +/** + * Classify a token. + * + * @param {string?} value + * @return {string} - value's type. + */ +function classify(value) { + if (EXPRESSION_WHITE_SPACE.test(value)) { + return 'WhiteSpace'; + } + + if (EXPRESSION_WORD.test(value)) { + return 'Word'; + } + + if (EXPRESSION_PUNCTUATION.test(value)) { + return 'Punctuation'; + } + + return 'Symbol'; +} + +/** + * Transform a `value` into a list of `NLCSTNode`s. + * + * @param {ParseLatin} parser + * @param {string?} value + * @return {Array.} + */ +function tokenize(parser, value) { + var tokens, + offset, + line, + column, + match; + + if (value === null || value === undefined) { + value = ''; + } else if (value instanceof String) { + value = value.toString(); + } + + if (typeof value !== 'string') { + /** + * Return the given nodes if this is either an + * empty array, or an array with a node as a first + * child. + */ + + if ('length' in value && (!value[0] || value[0].type)) { + return value; + } + + throw new Error( + 'Illegal invocation: \'' + value + '\'' + + ' is not a valid argument for \'ParseLatin\'' + ); + } + + tokens = []; + + if (!value) { + return tokens; + } + + offset = 0; + line = 1; + column = 1; + + /** + * Get the current position. + * + * @example + * position = now(); // {line: 1, column: 1} + * + * @return {Object} + */ + function now() { + return { + 'line': line, + 'column': column, + 'offset': offset + }; + } + + /** + * Store position information for a node. + * + * @example + * start = now(); + * updatePosition('foo'); + * location = new Position(start); + * // {start: {line: 1, column: 1}, end: {line: 1, column: 3}} + * + * @param {Object} start + */ + function Position(start) { + this.start = start; + this.end = now(); + } + + /** + * Mark position and patch `node.position`. + * + * @example + * var update = position(); + * updatePosition('foo'); + * update({}); + * // { + * // position: { + * // start: {line: 1, column: 1} + * // end: {line: 1, column: 3} + * // } + * // } + * + * @returns {function(Node): Node} + */ + function position() { + var before = now(); + + /** + * Add the position to a node. + * + * @example + * update({type: 'text', value: 'foo'}); + * + * @param {Node} node - Node to attach position + * on. + * @return {Node} - `node`. + */ + function patch(node) { + node.position = new Position(before); + + return node; + } + + return patch; + } + + /** + * Update line and column based on `value`. + * + * @example + * update('foo'); + * + * @param {string} subvalue + */ + function update(subvalue) { + var subvalueLength = subvalue.length, + character = -1, + lastIndex = -1; + + offset += subvalueLength; + + while (++character < subvalueLength) { + if (subvalue.charAt(character) === '\n') { + lastIndex = character; + line++; + } + } + + if (lastIndex === -1) { + column = column + subvalueLength; + } else { + column = subvalueLength - lastIndex; + } + } + + /** + * Add mechanism. + * + * @param {NLCSTNode} node - Node to add. + * @param {NLCSTParentNode?} [parent] - Optional parent + * node to insert into. + * @return {NLCSTNode} - `node`. + */ + function add(node, parent) { + if (parent) { + parent.children.push(node); + } else { + tokens.push(node); + } + + return node; + } + + /** + * Remove `subvalue` from `value`. + * Expects `subvalue` to be at the start from + * `value`, and applies no validation. + * + * @example + * eat('foo')({type: 'TextNode', value: 'foo'}); + * + * @param {string} subvalue - Removed from `value`, + * and passed to `update`. + * @return {Function} - Wrapper around `add`, which + * also adds `position` to node. + */ + function eat(subvalue) { + var pos = position(); + + /** + * Add the given arguments, add `position` to + * the returned node, and return the node. + * + * @return {Node} + */ + function apply() { + return pos(add.apply(null, arguments)); + } + + value = value.substring(subvalue.length); + + update(subvalue); + + return apply; + } + + /** + * Remove `subvalue` from `value`. Does not patch + * positional information. + * + * @param {string} subvalue - Value to eat. + * @return {Function} + */ + function noPositionEat(subvalue) { + /** + * Add the given arguments and return the node. + * + * @return {Node} + */ + function apply() { + return add.apply(null, arguments); + } + + value = value.substring(subvalue.length); + + return apply; + } + + /* + * Eat mechanism to use. + */ + + var eater = parser.position ? eat : noPositionEat; + + /** + * Continue matching. + */ + function next() { + EXPRESSION_TOKEN.lastIndex = 0; + + match = EXPRESSION_TOKEN.exec(value); + } + + next(); + + while (match) { + parser['tokenize' + classify(match[0])](match[0], eater); + + next(); + } + + return tokens; +} + +/** + * Add mechanism used when text-tokenisers are called + * directly outside of the `tokenize` function. + * + * @param {NLCSTNode} node - Node to add. + * @param {NLCSTParentNode?} [parent] - Optional parent + * node to insert into. + * @return {NLCSTNode} - `node`. + */ +function noopAdd(node, parent) { + if (parent) { + parent.children.push(node); + } + + return node; +} + +/** + * Eat and add mechanism without adding positional + * information, used when text-tokenisers are called + * directly outside of the `tokenize` function. + * + * @return {Function} + */ +function noopEat() { + return noopAdd; +} + +/* + * == PARSE LATIN ============================================================ + */ + +/** + * Transform Latin-script natural language into + * an NLCST-tree. + * + * @constructor {ParseLatin} + */ +function ParseLatin(options) { + /* + * TODO: This should later be removed (when this + * change bubbles through to dependants). + */ + + if (!(this instanceof ParseLatin)) { + return new ParseLatin(options); + } + + this.position = Boolean(options && options.position); +} + +/* + * Quick access to the prototype. + */ + +var parseLatinPrototype; + +parseLatinPrototype = ParseLatin.prototype; + +/* + * == TOKENIZE =============================================================== + */ + +/** + * Transform a `value` into a list of `NLCSTNode`s. + * + * @see tokenize + */ +parseLatinPrototype.tokenize = function (value) { + return tokenize(this, value); +}; + +/* + * == TEXT NODES ============================================================= + */ + +/** + * Factory to create a `Text`. + * + * @param {string?} type + * @return {function(value): NLCSTText} + */ +function createTextFactory(type) { + type += 'Node'; + + /** + * Construct a `Text` from a bound `type` + * + * @param {value} value - Value of the node. + * @param {Function?} [eat] - Optional eat mechanism + * to use. + * @param {NLCSTParentNode?} [parent] - Optional + * parent to insert into. + * @return {NLCSTText} + */ + return function (value, eat, parent) { + if (value === null || value === undefined) { + value = ''; + } + + return (eat || noopEat)(value)({ + 'type': type, + 'value': String(value) + }, parent); + }; +} + +/** + * Create a `SymbolNode` with the given `value`. + * + * @param {string?} value + * @return {NLCSTSymbolNode} + */ +parseLatinPrototype.tokenizeSymbol = createTextFactory('Symbol'); + +/** + * Create a `WhiteSpaceNode` with the given `value`. + * + * @param {string?} value + * @return {NLCSTWhiteSpaceNode} + */ +parseLatinPrototype.tokenizeWhiteSpace = createTextFactory('WhiteSpace'); + +/** + * Create a `PunctuationNode` with the given `value`. + * + * @param {string?} value + * @return {NLCSTPunctuationNode} + */ +parseLatinPrototype.tokenizePunctuation = createTextFactory('Punctuation'); + +/** + * Create a `SourceNode` with the given `value`. + * + * @param {string?} value + * @return {NLCSTSourceNode} + */ +parseLatinPrototype.tokenizeSource = createTextFactory('Source'); + +/** + * Create a `TextNode` with the given `value`. + * + * @param {string?} value + * @return {NLCSTTextNode} + */ +parseLatinPrototype.tokenizeText = createTextFactory('Text'); + +/* + * == PARENT NODES =========================================================== + * + * All these nodes are `pluggable`: they come with a + * `use` method which accepts a plugin + * (`function(NLCSTNode)`). Every time one of these + * methods are called, the plugin is invoked with the + * node, allowing for easy modification. + * + * In fact, the internal transformation from `tokenize` + * (a list of words, white space, punctuation, and + * symbols) to `tokenizeRoot` (an NLCST tree), is also + * implemented through this mechanism. + */ + +/** + * Run transform plug-ins for `key` on `nodes`. + * + * @param {string} key + * @param {Array.} nodes + * @return {Array.} - `nodes`. + */ +function run(key, nodes) { + var wareKey, + plugins, + index; + + wareKey = key + 'Plugins'; + + plugins = this[wareKey]; + + if (plugins) { + index = -1; + + while (plugins[++index]) { + plugins[index](nodes); + } + } + + return nodes; +} + +/* + * Expose `run`. + */ + +parseLatinPrototype.run = run; + +/** + * @param {Function} Constructor + * @param {string} key + * @param {function(*): undefined} callback + */ +function pluggable(Constructor, key, callback) { + /** + * Set a pluggable version of `callback` + * on `Constructor`. + */ + Constructor.prototype[key] = function () { + return this.run(key, callback.apply(this, arguments)); + }; +} + +/** + * Factory to inject `plugins`. Takes `callback` for + * the actual inserting. + * + * @param {function(Object, string, Array.)} callback + * @return {function(string, Array.)} + */ +function useFactory(callback) { + /* + * Validate if `plugins` can be inserted. Invokes + * the bound `callback` to do the actual inserting. + * + * @param {string} key - Method to inject on + * @param {Array.|Function} plugins - One + * or more plugins. + */ + + return function (key, plugins) { + var self, + wareKey; + + self = this; + + /* + * Throw if the method is not pluggable. + */ + + if (!(key in self)) { + throw new Error( + 'Illegal Invocation: Unsupported `key` for ' + + '`use(key, plugins)`. Make sure `key` is a ' + + 'supported function' + ); + } + + /* + * Fail silently when no plugins are given. + */ + + if (!plugins) { + return; + } + + wareKey = key + 'Plugins'; + + /* + * Make sure `plugins` is a list. + */ + + if (typeof plugins === 'function') { + plugins = [plugins]; + } else { + plugins = plugins.concat(); + } + + /* + * Make sure `wareKey` exists. + */ + + if (!self[wareKey]) { + self[wareKey] = []; + } + + /* + * Invoke callback with the ware key and plugins. + */ + + callback(self, wareKey, plugins); + }; +} + +/* + * Inject `plugins` to modifiy the result of the method + * at `key` on the operated on context. + * + * @param {string} key + * @param {Function|Array.} plugins + * @this {ParseLatin|Object} + */ + +parseLatinPrototype.use = useFactory(function (context, key, plugins) { + context[key] = context[key].concat(plugins); +}); + +/* + * Inject `plugins` to modifiy the result of the method + * at `key` on the operated on context, before any other. + * + * @param {string} key + * @param {Function|Array.} plugins + * @this {ParseLatin|Object} + */ + +parseLatinPrototype.useFirst = useFactory(function (context, key, plugins) { + context[key] = plugins.concat(context[key]); +}); + +/** + * Create a `WordNode` with its children set to a single + * `TextNode`, its value set to the given `value`. + * + * @see pluggable + * + * @param {string?} value + * @return {NLCSTWordNode} + */ +pluggable(ParseLatin, 'tokenizeWord', function (value, eat) { + var add, + parent; + + add = (eat || noopEat)(''); + parent = { + 'type': 'WordNode', + 'children': [] + }; + + this.tokenizeText(value, eat, parent); + + return add(parent); +}); + +/** + * Create a `SentenceNode` with its children set to + * `Node`s, their values set to the tokenized given + * `value`. + * + * Unless plugins add new nodes, the sentence is + * populated by `WordNode`s, `SymbolNode`s, + * `PunctuationNode`s, and `WhiteSpaceNode`s. + * + * @see pluggable + * + * @param {string?} value + * @return {NLCSTSentenceNode} + */ +pluggable(ParseLatin, 'tokenizeSentence', createParser({ + 'type': 'SentenceNode', + 'tokenizer': 'tokenize' +})); + +/** + * Create a `ParagraphNode` with its children set to + * `Node`s, their values set to the tokenized given + * `value`. + * + * Unless plugins add new nodes, the paragraph is + * populated by `SentenceNode`s and `WhiteSpaceNode`s. + * + * @see pluggable + * + * @param {string?} value + * @return {NLCSTParagraphNode} + */ +pluggable(ParseLatin, 'tokenizeParagraph', createParser({ + 'type': 'ParagraphNode', + 'delimiter': expressions.terminalMarker, + 'delimiterType': 'PunctuationNode', + 'tokenizer': 'tokenizeSentence' +})); + +/** + * Create a `RootNode` with its children set to `Node`s, + * their values set to the tokenized given `value`. + * + * Unless plugins add new nodes, the root is populated by + * `ParagraphNode`s and `WhiteSpaceNode`s. + * + * @see pluggable + * + * @param {string?} value + * @return {NLCSTRootNode} + */ +pluggable(ParseLatin, 'tokenizeRoot', createParser({ + 'type': 'RootNode', + 'delimiter': expressions.newLine, + 'delimiterType': 'WhiteSpaceNode', + 'tokenizer': 'tokenizeParagraph' +})); + +/** + * Easy access to the document parser. + * + * @see ParseLatin#tokenizeRoot + */ +parseLatinPrototype.parse = function (value) { + return this.tokenizeRoot(value); +}; + +/* + * == PLUGINS ================================================================ + */ + +parseLatinPrototype.use('tokenizeSentence', [ + require('./plugin/merge-initial-word-symbol'), + require('./plugin/merge-final-word-symbol'), + require('./plugin/merge-inner-word-symbol'), + require('./plugin/merge-initialisms'), + require('./plugin/merge-words'), + require('./plugin/patch-position') +]); + +parseLatinPrototype.use('tokenizeParagraph', [ + require('./plugin/merge-non-word-sentences'), + require('./plugin/merge-affix-symbol'), + require('./plugin/merge-initial-lower-case-letter-sentences'), + require('./plugin/merge-prefix-exceptions'), + require('./plugin/merge-affix-exceptions'), + require('./plugin/merge-remaining-full-stops'), + require('./plugin/make-initial-white-space-siblings'), + require('./plugin/make-final-white-space-siblings'), + require('./plugin/break-implicit-sentences'), + require('./plugin/remove-empty-nodes'), + require('./plugin/patch-position') +]); + +parseLatinPrototype.use('tokenizeRoot', [ + require('./plugin/make-initial-white-space-siblings'), + require('./plugin/make-final-white-space-siblings'), + require('./plugin/remove-empty-nodes'), + require('./plugin/patch-position') +]); + +/* + * == EXPORT ================================================================= + */ + +/* + * Expose `ParseLatin`. + */ + +module.exports = ParseLatin; + +/* + * Expose `pluginFactory` on `ParseLatin` as `plugin`. + */ + +ParseLatin.plugin = pluginFactory; + +/* + * Expose `modifierFactory` on `ParseLatin` as `modifier`. + */ + +ParseLatin.modifier = modifierFactory; + +},{"./expressions":32,"./modifier":33,"./parser":35,"./plugin":36,"./plugin/break-implicit-sentences":37,"./plugin/make-final-white-space-siblings":38,"./plugin/make-initial-white-space-siblings":39,"./plugin/merge-affix-exceptions":40,"./plugin/merge-affix-symbol":41,"./plugin/merge-final-word-symbol":42,"./plugin/merge-initial-lower-case-letter-sentences":43,"./plugin/merge-initial-word-symbol":44,"./plugin/merge-initialisms":45,"./plugin/merge-inner-word-symbol":46,"./plugin/merge-non-word-sentences":47,"./plugin/merge-prefix-exceptions":48,"./plugin/merge-remaining-full-stops":49,"./plugin/merge-words":50,"./plugin/patch-position":51,"./plugin/remove-empty-nodes":52}],35:[function(require,module,exports){ +'use strict'; + +var tokenizer; + +tokenizer = require('./tokenizer'); + +/** + * Construct a parser based on `options`. + * + * @param {Object} options + * @return {function(string): NLCSTNode} + */ +function parserFactory(options) { + var type, + delimiter, + tokenizerProperty; + + type = options.type; + tokenizerProperty = options.tokenizer; + delimiter = options.delimiter; + + if (delimiter) { + delimiter = tokenizer(options.delimiterType, options.delimiter); + } + + return function (value) { + var children; + + children = this[tokenizerProperty](value); + + return { + 'type': type, + 'children': delimiter ? delimiter(children) : children + }; + }; +} + +module.exports = parserFactory; + +},{"./tokenizer":53}],36:[function(require,module,exports){ +'use strict'; + +/** + * Turns `callback` into a ``plugin'' accepting a parent. + * + * @param {function(Object, number, Object)} callback + * @return {function(NLCSTParent)} + */ +function pluginFactory(callback) { + return function (parent) { + var index, + children; + + index = -1; + children = parent.children; + + while (children[++index]) { + callback(children[index], index, parent); + } + }; +} + +/* + * Expose `pluginFactory`. + */ + +module.exports = pluginFactory; + +},{}],37:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var nlcstToString, + modifier, + expressions; + +nlcstToString = require('nlcst-to-string'); +modifier = require('../modifier'); +expressions = require('../expressions'); + +/* + * Constants. + * + * - Two or more new line characters. + */ + +var EXPRESSION_MULTI_NEW_LINE; + +EXPRESSION_MULTI_NEW_LINE = expressions.newLineMulti; + +/** + * Break a sentence if a white space with more + * than one new-line is found. + * + * @param {NLCSTNode} child + * @param {number} index + * @param {NLCSTParagraphNode} parent + * @return {undefined} + */ +function breakImplicitSentences(child, index, parent) { + var children, + position, + length, + tail, + head, + end, + insertion, + node; + + if (child.type !== 'SentenceNode') { + return; + } + + children = child.children; + + length = children.length; + + position = -1; + + while (++position < length) { + node = children[position]; + + if ( + node.type !== 'WhiteSpaceNode' || + !EXPRESSION_MULTI_NEW_LINE.test(nlcstToString(node)) + ) { + continue; + } + + child.children = children.slice(0, position); + + insertion = { + 'type': 'SentenceNode', + 'children': children.slice(position + 1) + }; + + tail = children[position - 1]; + head = children[position + 1]; + + parent.children.splice(index + 1, 0, node, insertion); + + if (child.position && tail.position && head.position) { + end = child.position.end; + + child.position.end = tail.position.end; + + insertion.position = { + 'start': head.position.start, + 'end': end + }; + } + + return index + 1; + } +} + +/* + * Expose `breakImplicitSentences` as a plugin. + */ + +module.exports = modifier(breakImplicitSentences); + +},{"../expressions":32,"../modifier":33,"nlcst-to-string":29}],38:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var modifier; + +modifier = require('../modifier'); + +/** + * Move white space ending a paragraph up, so they are + * the siblings of paragraphs. + * + * @param {NLCSTNode} child + * @param {number} index + * @param {NLCSTParent} parent + * @return {undefined|number} + */ +function makeFinalWhiteSpaceSiblings(child, index, parent) { + var children, + prev; + + children = child.children; + + if ( + children && + children.length !== 0 && + children[children.length - 1].type === 'WhiteSpaceNode' + ) { + parent.children.splice(index + 1, 0, child.children.pop()); + prev = children[children.length - 1]; + + if (prev && prev.position && child.position) { + child.position.end = prev.position.end; + } + + /* + * Next, iterate over the current node again. + */ + + return index; + } +} + +/* + * Expose `makeFinalWhiteSpaceSiblings` as a modifier. + */ + +module.exports = modifier(makeFinalWhiteSpaceSiblings); + +},{"../modifier":33}],39:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var plugin; + +plugin = require('../plugin'); + +/** + * Move white space starting a sentence up, so they are + * the siblings of sentences. + * + * @param {NLCSTNode} child + * @param {number} index + * @param {NLCSTParent} parent + */ +function makeInitialWhiteSpaceSiblings(child, index, parent) { + var children, + next; + + children = child.children; + + if ( + children && + children.length !== 0 && + children[0].type === 'WhiteSpaceNode' + ) { + parent.children.splice(index, 0, children.shift()); + next = children[0]; + + if (next && next.position && child.position) { + child.position.start = next.position.start; + } + } +} + +/* + * Expose `makeInitialWhiteSpaceSiblings` as a plugin. + */ + +module.exports = plugin(makeInitialWhiteSpaceSiblings); + +},{"../plugin":36}],40:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var nlcstToString, + modifier; + +nlcstToString = require('nlcst-to-string'); +modifier = require('../modifier'); + +/** + * Merge a sentence into its previous sentence, when + * the sentence starts with a comma. + * + * @param {NLCSTNode} child + * @param {number} index + * @param {NLCSTParagraphNode} parent + * @return {undefined|number} + */ +function mergeAffixExceptions(child, index, parent) { + var children, + node, + position, + previousChild, + value; + + children = child.children; + + if (!children || !children.length || index === 0) { + return; + } + + position = -1; + + while (children[++position]) { + node = children[position]; + + if (node.type === 'WordNode') { + return; + } + + if ( + node.type === 'SymbolNode' || + node.type === 'PunctuationNode' + ) { + value = nlcstToString(node); + + if (value !== ',' && value !== ';') { + return; + } + + previousChild = parent.children[index - 1]; + + previousChild.children = previousChild.children.concat(children); + + /* + * Update position. + */ + + if (previousChild.position && child.position) { + previousChild.position.end = child.position.end; + } + + parent.children.splice(index, 1); + + /* + * Next, iterate over the node *now* at the current + * position. + */ + + return index; + } + } +} + +/* + * Expose `mergeAffixExceptions` as a modifier. + */ + +module.exports = modifier(mergeAffixExceptions); + +},{"../modifier":33,"nlcst-to-string":29}],41:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var nlcstToString, + modifier, + expressions; + +nlcstToString = require('nlcst-to-string'); +modifier = require('../modifier'); +expressions = require('../expressions'); + +/* + * Constants. + * + * - Closing or final punctuation, or terminal markers + * that should still be included in the previous + * sentence, even though they follow the sentence's + * terminal marker. + */ + +var EXPRESSION_AFFIX_SYMBOL; + +EXPRESSION_AFFIX_SYMBOL = expressions.affixSymbol; + +/** + * Move certain punctuation following a terminal + * marker (thus in the next sentence) to the + * previous sentence. + * + * @param {NLCSTNode} child + * @param {number} index + * @param {NLCSTParagraphNode} parent + * @return {undefined|number} + */ +function mergeAffixSymbol(child, index, parent) { + var children, + prev, + first, + second; + + children = child.children; + + if ( + children && + children.length && + index !== 0 + ) { + first = children[0]; + second = children[1]; + prev = parent.children[index - 1]; + + if ( + ( + first.type === 'SymbolNode' || + first.type === 'PunctuationNode' + ) && + EXPRESSION_AFFIX_SYMBOL.test(nlcstToString(first)) + ) { + prev.children.push(children.shift()); + + /* + * Update position. + */ + + if (first.position && prev.position) { + prev.position.end = first.position.end; + } + + if (second && second.position && child.position) { + child.position.start = second.position.start; + } + + /* + * Next, iterate over the previous node again. + */ + + return index - 1; + } + } +} + +/* + * Expose `mergeAffixSymbol` as a modifier. + */ + +module.exports = modifier(mergeAffixSymbol); + +},{"../expressions":32,"../modifier":33,"nlcst-to-string":29}],42:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var nlcstToString, + modifier; + +nlcstToString = require('nlcst-to-string'); +modifier = require('../modifier'); + +/** + * Merge certain punctuation marks into their + * preceding words. + * + * @param {NLCSTNode} child + * @param {number} index + * @param {NLCSTSentenceNode} parent + * @return {undefined|number} + */ +function mergeFinalWordSymbol(child, index, parent) { + var children, + prev, + next; + + if ( + index !== 0 && + ( + child.type === 'SymbolNode' || + child.type === 'PunctuationNode' + ) && + nlcstToString(child) === '-' + ) { + children = parent.children; + + prev = children[index - 1]; + next = children[index + 1]; + + if ( + ( + !next || + next.type !== 'WordNode' + ) && + ( + prev && + prev.type === 'WordNode' + ) + ) { + /* + * Remove `child` from parent. + */ + + children.splice(index, 1); + + /* + * Add the punctuation mark at the end of the + * previous node. + */ + + prev.children.push(child); + + /* + * Update position. + */ + + if (prev.position && child.position) { + prev.position.end = child.position.end; + } + + /* + * Next, iterate over the node *now* at the + * current position (which was the next node). + */ + + return index; + } + } +} + +/* + * Expose `mergeFinalWordSymbol` as a modifier. + */ + +module.exports = modifier(mergeFinalWordSymbol); + +},{"../modifier":33,"nlcst-to-string":29}],43:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var nlcstToString, + modifier, + expressions; + +nlcstToString = require('nlcst-to-string'); +modifier = require('../modifier'); +expressions = require('../expressions'); + +/* + * Constants. + * + * - Initial lowercase letter. + */ + +var EXPRESSION_LOWER_INITIAL; + +EXPRESSION_LOWER_INITIAL = expressions.lowerInitial; + +/** + * Merge a sentence into its previous sentence, when + * the sentence starts with a lower case letter. + * + * @param {NLCSTNode} child + * @param {number} index + * @param {NLCSTParagraphNode} parent + * @return {undefined|number} + */ +function mergeInitialLowerCaseLetterSentences(child, index, parent) { + var siblings, + children, + position, + node, + prev; + + children = child.children; + + if ( + children && + children.length && + index !== 0 + ) { + position = -1; + + while (children[++position]) { + node = children[position]; + + if (node.type === 'WordNode') { + if (!EXPRESSION_LOWER_INITIAL.test(nlcstToString(node))) { + return; + } + + siblings = parent.children; + + prev = siblings[index - 1]; + + prev.children = prev.children.concat(children); + + siblings.splice(index, 1); + + /* + * Update position. + */ + + if (prev.position && child.position) { + prev.position.end = child.position.end; + } + + /* + * Next, iterate over the node *now* at + * the current position. + */ + + return index; + } + + if ( + node.type === 'SymbolNode' || + node.type === 'PunctuationNode' + ) { + return; + } + } + } +} + +/* + * Expose `mergeInitialLowerCaseLetterSentences` as a modifier. + */ + +module.exports = modifier(mergeInitialLowerCaseLetterSentences); + +},{"../expressions":32,"../modifier":33,"nlcst-to-string":29}],44:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var nlcstToString, + modifier; + +nlcstToString = require('nlcst-to-string'); +modifier = require('../modifier'); + +/** + * Merge certain punctuation marks into their + * following words. + * + * @param {NLCSTNode} child + * @param {number} index + * @param {NLCSTSentenceNode} parent + * @return {undefined|number} + */ +function mergeInitialWordSymbol(child, index, parent) { + var children, + next; + + if ( + ( + child.type !== 'SymbolNode' && + child.type !== 'PunctuationNode' + ) || + nlcstToString(child) !== '&' + ) { + return; + } + + children = parent.children; + + next = children[index + 1]; + + /* + * If either a previous word, or no following word, + * exists, exit early. + */ + + if ( + ( + index !== 0 && + children[index - 1].type === 'WordNode' + ) || + !( + next && + next.type === 'WordNode' + ) + ) { + return; + } + + /* + * Remove `child` from parent. + */ + + children.splice(index, 1); + + /* + * Add the punctuation mark at the start of the + * next node. + */ + + next.children.unshift(child); + + /* + * Update position. + */ + + if (next.position && child.position) { + next.position.start = child.position.start; + } + + /* + * Next, iterate over the node at the previous + * position, as it's now adjacent to a following + * word. + */ + + return index - 1; +} + +/* + * Expose `mergeInitialWordSymbol` as a modifier. + */ + +module.exports = modifier(mergeInitialWordSymbol); + +},{"../modifier":33,"nlcst-to-string":29}],45:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var nlcstToString, + modifier, + expressions; + +nlcstToString = require('nlcst-to-string'); +modifier = require('../modifier'); +expressions = require('../expressions'); + +/* + * Constants. + * + * - Numbers. + */ + +var EXPRESSION_NUMERICAL; + +EXPRESSION_NUMERICAL = expressions.numerical; + +/** + * Merge initialisms. + * + * @param {NLCSTNode} child + * @param {number} index + * @param {NLCSTSentenceNode} parent + * @return {undefined|number} + */ +function mergeInitialisms(child, index, parent) { + var siblings, + prev, + children, + length, + position, + otherChild, + isAllDigits, + value; + + if ( + index !== 0 && + nlcstToString(child) === '.' + ) { + siblings = parent.children; + + prev = siblings[index - 1]; + children = prev.children; + + length = children && children.length; + + if ( + prev.type === 'WordNode' && + length !== 1 && + length % 2 !== 0 + ) { + position = length; + + isAllDigits = true; + + while (children[--position]) { + otherChild = children[position]; + + value = nlcstToString(otherChild); + + if (position % 2 === 0) { + /* + * Initialisms consist of one + * character values. + */ + + if (value.length > 1) { + return; + } + + if (!EXPRESSION_NUMERICAL.test(value)) { + isAllDigits = false; + } + } else if (value !== '.') { + if (position < length - 2) { + break; + } else { + return; + } + } + } + + if (!isAllDigits) { + /* + * Remove `child` from parent. + */ + + siblings.splice(index, 1); + + /* + * Add child to the previous children. + */ + + children.push(child); + + /* + * Update position. + */ + + if (prev.position && child.position) { + prev.position.end = child.position.end; + } + + /* + * Next, iterate over the node *now* at the current + * position. + */ + + return index; + } + } + } +} + +/* + * Expose `mergeInitialisms` as a modifier. + */ + +module.exports = modifier(mergeInitialisms); + +},{"../expressions":32,"../modifier":33,"nlcst-to-string":29}],46:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var nlcstToString, + modifier, + expressions; + +nlcstToString = require('nlcst-to-string'); +modifier = require('../modifier'); +expressions = require('../expressions'); + +/* + * Constants. + * + * - Symbols part of surrounding words. + */ + +var EXPRESSION_INNER_WORD_SYMBOL; + +EXPRESSION_INNER_WORD_SYMBOL = expressions.wordSymbolInner; + +/** + * Merge two words surrounding certain punctuation marks. + * + * @param {NLCSTNode} child + * @param {number} index + * @param {NLCSTSentenceNode} parent + * @return {undefined|number} + */ +function mergeInnerWordSymbol(child, index, parent) { + var siblings, + sibling, + prev, + last, + position, + tokens, + queue; + + if ( + index !== 0 && + ( + child.type === 'SymbolNode' || + child.type === 'PunctuationNode' + ) + ) { + siblings = parent.children; + + prev = siblings[index - 1]; + + if (prev && prev.type === 'WordNode') { + position = index - 1; + + tokens = []; + queue = []; + + /* + * - If a token which is neither word nor + * inner word symbol is found, the loop + * is broken. + * - If an inner word symbol is found, + * it's queued. + * - If a word is found, it's queued (and + * the queue stored and emptied). + */ + + while (siblings[++position]) { + sibling = siblings[position]; + + if (sibling.type === 'WordNode') { + tokens = tokens.concat(queue, sibling.children); + + queue = []; + } else if ( + ( + sibling.type === 'SymbolNode' || + sibling.type === 'PunctuationNode' + ) && + EXPRESSION_INNER_WORD_SYMBOL.test(nlcstToString(sibling)) + ) { + queue.push(sibling); + } else { + break; + } + } + + if (tokens.length) { + /* + * If there is a queue, remove its length + * from `position`. + */ + + if (queue.length) { + position -= queue.length; + } + + /* + * Remove every (one or more) inner-word punctuation + * marks and children of words. + */ + + siblings.splice(index, position - index); + + /* + * Add all found tokens to `prev`s children. + */ + + prev.children = prev.children.concat(tokens); + + last = tokens[tokens.length - 1]; + + /* + * Update position. + */ + + if (prev.position && last.position) { + prev.position.end = last.position.end; + } + + /* + * Next, iterate over the node *now* at the current + * position. + */ + + return index; + } + } + } +} + +/* + * Expose `mergeInnerWordSymbol` as a modifier. + */ + +module.exports = modifier(mergeInnerWordSymbol); + +},{"../expressions":32,"../modifier":33,"nlcst-to-string":29}],47:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var modifier; + +modifier = require('../modifier'); + +/** + * Merge a sentence into the following sentence, when + * the sentence does not contain word tokens. + * + * @param {NLCSTNode} child + * @param {number} index + * @param {NLCSTParagraphNode} parent + * @return {undefined|number} + */ +function mergeNonWordSentences(child, index, parent) { + var children, + position, + prev, + next; + + children = child.children; + position = -1; + + while (children[++position]) { + if (children[position].type === 'WordNode') { + return; + } + } + + prev = parent.children[index - 1]; + + if (prev) { + prev.children = prev.children.concat(children); + + /* + * Remove the child. + */ + + parent.children.splice(index, 1); + + /* + * Patch position. + */ + + if (prev.position && child.position) { + prev.position.end = child.position.end; + } + + /* + * Next, iterate over the node *now* at + * the current position (which was the + * next node). + */ + + return index; + } + + next = parent.children[index + 1]; + + if (next) { + next.children = children.concat(next.children); + + /* + * Patch position. + */ + + if (next.position && child.position) { + next.position.start = child.position.start; + } + + /* + * Remove the child. + */ + + parent.children.splice(index, 1); + } +} + +/* + * Expose `mergeNonWordSentences` as a modifier. + */ + +module.exports = modifier(mergeNonWordSentences); + +},{"../modifier":33}],48:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var nlcstToString, + modifier; + +nlcstToString = require('nlcst-to-string'); +modifier = require('../modifier'); + +/* + * Constants. + * + * - Blacklist of full stop characters that should not + * be treated as terminal sentence markers: A + * case-insensitive abbreviation. + */ + +var EXPRESSION_ABBREVIATION_PREFIX; + +EXPRESSION_ABBREVIATION_PREFIX = new RegExp( + '^(' + + '[0-9]+|' + + '[a-z]|' + + + /* + * Common Latin Abbreviations: + * Based on: http://en.wikipedia.org/wiki/List_of_Latin_abbreviations + * Where only the abbreviations written without joining full stops, + * but with a final full stop, were extracted. + * + * circa, capitulus, confer, compare, centum weight, eadem, (et) alii, + * et cetera, floruit, foliis, ibidem, idem, nemine && contradicente, + * opere && citato, (per) cent, (per) procurationem, (pro) tempore, + * sic erat scriptum, (et) sequentia, statim, videlicet. + */ + + 'al|ca|cap|cca|cent|cf|cit|con|cp|cwt|ead|etc|ff|' + + 'fl|ibid|id|nem|op|pro|seq|sic|stat|tem|viz' + + ')$' +); + +/** + * Merge a sentence into its next sentence, when the + * sentence ends with a certain word. + * + * @param {NLCSTNode} child + * @param {number} index + * @param {NLCSTParagraphNode} parent + * @return {undefined|number} + */ +function mergePrefixExceptions(child, index, parent) { + var children, + node, + next; + + children = child.children; + + if ( + children && + children.length && + index !== parent.children.length - 1 + ) { + node = children[children.length - 1]; + + if ( + node && + nlcstToString(node) === '.' + ) { + node = children[children.length - 2]; + + if ( + node && + node.type === 'WordNode' && + EXPRESSION_ABBREVIATION_PREFIX.test( + nlcstToString(node).toLowerCase() + ) + ) { + next = parent.children[index + 1]; + + child.children = children.concat(next.children); + + parent.children.splice(index + 1, 1); + + /* + * Update position. + */ + + if (next.position && child.position) { + child.position.end = next.position.end; + } + + /* + * Next, iterate over the current node again. + */ + + return index - 1; + } + } + } +} + +/* + * Expose `mergePrefixExceptions` as a modifier. + */ + +module.exports = modifier(mergePrefixExceptions); + +},{"../modifier":33,"nlcst-to-string":29}],49:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var nlcstToString, + plugin, + expressions; + +nlcstToString = require('nlcst-to-string'); +plugin = require('../plugin'); +expressions = require('../expressions'); + +/* + * Constants. + * + * - Blacklist of full stop characters that should not + * be treated as terminal sentence markers: A + * case-insensitive abbreviation. + */ + +var EXPRESSION_TERMINAL_MARKER; + +EXPRESSION_TERMINAL_MARKER = expressions.terminalMarker; + +/** + * Merge non-terminal-marker full stops into + * the previous word (if available), or the next + * word (if available). + * + * @param {NLCSTNode} child + */ +function mergeRemainingFullStops(child) { + var children, + position, + grandchild, + prev, + next, + nextNext, + hasFoundDelimiter; + + children = child.children; + position = children.length; + + hasFoundDelimiter = false; + + while (children[--position]) { + grandchild = children[position]; + + if ( + grandchild.type !== 'SymbolNode' && + grandchild.type !== 'PunctuationNode' + ) { + /* + * This is a sentence without terminal marker, + * so we 'fool' the code to make it think we + * have found one. + */ + + if (grandchild.type === 'WordNode') { + hasFoundDelimiter = true; + } + + continue; + } + + /* + * Exit when this token is not a terminal marker. + */ + + if (!EXPRESSION_TERMINAL_MARKER.test(nlcstToString(grandchild))) { + continue; + } + + /* + * Ignore the first terminal marker found + * (starting at the end), as it should not + * be merged. + */ + + if (!hasFoundDelimiter) { + hasFoundDelimiter = true; + + continue; + } + + /* + * Only merge a single full stop. + */ + + if (nlcstToString(grandchild) !== '.') { + continue; + } + + prev = children[position - 1]; + next = children[position + 1]; + + if (prev && prev.type === 'WordNode') { + nextNext = children[position + 2]; + + /* + * Continue when the full stop is followed by + * a space and another full stop, such as: + * `{.} .` + */ + + if ( + next && + nextNext && + next.type === 'WhiteSpaceNode' && + nlcstToString(nextNext) === '.' + ) { + continue; + } + + /* + * Remove `child` from parent. + */ + + children.splice(position, 1); + + /* + * Add the punctuation mark at the end of the + * previous node. + */ + + prev.children.push(grandchild); + + /* + * Update position. + */ + + if (grandchild.position && prev.position) { + prev.position.end = grandchild.position.end; + } + + position--; + } else if (next && next.type === 'WordNode') { + /* + * Remove `child` from parent. + */ + + children.splice(position, 1); + + /* + * Add the punctuation mark at the start of + * the next node. + */ + + next.children.unshift(grandchild); + + if (grandchild.position && next.position) { + next.position.start = grandchild.position.start; + } + } + } +} + +/* + * Expose `mergeRemainingFullStops` as a plugin. + */ + +module.exports = plugin(mergeRemainingFullStops); + +},{"../expressions":32,"../plugin":36,"nlcst-to-string":29}],50:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var modifier = require('../modifier'); + +/** + * Merge multiple words. This merges the children of + * adjacent words, something which should not occur + * naturally by parse-latin, but might happen when + * custom tokens were passed in. + * + * @param {NLCSTNode} child + * @param {number} index + * @param {NLCSTSentenceNode} parent + * @return {undefined|number} + */ +function mergeFinalWordSymbol(child, index, parent) { + var siblings = parent.children, + next; + + if (child.type === 'WordNode') { + next = siblings[index + 1]; + + if (next && next.type === 'WordNode') { + /* + * Remove `next` from parent. + */ + + siblings.splice(index + 1, 1); + + /* + * Add the punctuation mark at the end of the + * previous node. + */ + + child.children = child.children.concat(next.children); + + /* + * Update position. + */ + + if (next.position && child.position) { + child.position.end = next.position.end; + } + + /* + * Next, re-iterate the current node. + */ + + return index; + } + } +} + +/* + * Expose `mergeFinalWordSymbol` as a modifier. + */ + +module.exports = modifier(mergeFinalWordSymbol); + +},{"../modifier":33}],51:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var plugin = require('../plugin'); + +/** + * Add a `position` object when it does not yet exist + * on `node`. + * + * @param {NLCSTNode} node - Node to patch. + */ +function patch(node) { + if (!node.position) { + node.position = {}; + } +} + +/** + * Patch the position on a parent node based on its first + * and last child. + * + * @param {NLCSTNode} child + */ +function patchPosition(child, index, node) { + var siblings = node.children; + + if (!child.position) { + return; + } + + if ( + index === 0 && + (!node.position || /* istanbul ignore next */ !node.position.start) + ) { + patch(node); + node.position.start = child.position.start; + } + + if ( + index === siblings.length - 1 && + (!node.position || !node.position.end) + ) { + patch(node); + node.position.end = child.position.end; + } +} + +/* + * Expose `patchPosition` as a plugin. + */ + +module.exports = plugin(patchPosition); + +},{"../plugin":36}],52:[function(require,module,exports){ +'use strict'; + +/* + * Dependencies. + */ + +var modifier; + +modifier = require('../modifier'); + +/** + * Remove empty children. + * + * @param {NLCSTNode} child + * @param {number} index + * @param {NLCSTParagraphNode} parent + * @return {undefined|number} + */ +function removeEmptyNodes(child, index, parent) { + if ('children' in child && !child.children.length) { + parent.children.splice(index, 1); + + /* + * Next, iterate over the node *now* at + * the current position (which was the + * next node). + */ + + return index; + } +} + +/* + * Expose `removeEmptyNodes` as a modifier. + */ + +module.exports = modifier(removeEmptyNodes); + +},{"../modifier":33}],53:[function(require,module,exports){ +'use strict'; + +var nlcstToString; + +nlcstToString = require('nlcst-to-string'); + +/** + * Factory to create a tokenizer based on a given + * `expression`. + * + * @param {string} childType + * @param {RegExp} expression + * @return {function(NLCSTParent): Array.} + */ +function tokenizerFactory(childType, expression) { + /** + * A function which splits + * + * @param {NLCSTParent} node + * @return {Array.} + */ + return function (node) { + var children, + tokens, + type, + length, + index, + lastIndex, + start, + parent, + first, + last; + + children = []; + + tokens = node.children; + type = node.type; + + length = tokens.length; + + index = -1; + + lastIndex = length - 1; + + start = 0; + + while (++index < length) { + if ( + index === lastIndex || + ( + tokens[index].type === childType && + expression.test(nlcstToString(tokens[index])) + ) + ) { + first = tokens[start]; + last = tokens[index]; + + parent = { + 'type': type, + 'children': tokens.slice(start, index + 1) + }; + + if (first.position && last.position) { + parent.position = { + 'start': first.position.start, + 'end': last.position.end + }; + } + + children.push(parent); + + start = index + 1; + } + } + + return children; + }; +} + +module.exports = tokenizerFactory; + +},{"nlcst-to-string":29}],54:[function(require,module,exports){ +'use strict'; + +/** + * Cache `hasOwnProperty`. + */ + +var has; + +has = Object.prototype.hasOwnProperty; + +/** + * `Array#forEach()` with the possibility to change + * the next position. + * + * @param {{length: number}} values + * @param {function(*, number, {length: number}): number|undefined} callback + * @param {*} context + */ + +function iterate(values, callback, context) { + var index, + result; + + if (!values) { + throw new Error( + 'TypeError: Iterate requires that |this| ' + + 'not be ' + values + ); + } + + if (!has.call(values, 'length')) { + throw new Error( + 'TypeError: Iterate requires that |this| ' + + 'has a `length`' + ); + } + + if (typeof callback !== 'function') { + throw new Error( + 'TypeError: callback must be a function' + ); + } + + index = -1; + + /** + * The length might change, so we do not cache it. + */ + + while (++index < values.length) { + /** + * Skip missing values. + */ + + if (!(index in values)) { + continue; + } + + result = callback.call(context, values[index], index, values); + + /** + * If `callback` returns a `number`, move `index` over to + * `number`. + */ + + if (typeof result === 'number') { + /** + * Make sure that negative numbers do not + * break the loop. + */ + + if (result < 0) { + index = 0; + } + + index = result - 1; + } + } +} + +/** + * Expose `iterate`. + */ + +module.exports = iterate; + +},{}],55:[function(require,module,exports){ +/** + * @author Titus Wormer + * @copyright 2014-2015 Titus Wormer. + * @license MIT + * @module retext + * @fileoverview Extensible system for analysing and manipulating + * natural language. + */ + +'use strict'; + +/* + * Dependencies. + */ + +var unified = require('unified'); +var Parser = require('./lib/parse.js'); +var Compiler = require('./lib/compile.js'); + +/* + * Exports. + */ + +module.exports = unified({ + 'name': 'retext', + 'type': 'cst', + 'Parser': Parser, + 'Compiler': Compiler +}); + +},{"./lib/compile.js":56,"./lib/parse.js":57,"unified":58}],56:[function(require,module,exports){ +/** + * @author Titus Wormer + * @copyright 2014-2015 Titus Wormer. All rights reserved. + * @license MIT + * @module retext:compile + * @fileoverview Compile nlcst to string. + */ + +'use strict'; + +/* + * Dependencies. + */ + +var toString = require('nlcst-to-string'); + +/** + * Construct a new compiler. + * + * @example + * var file = new VFile('Hello World.'); + * + * file.namespace('retext').cst = { + * 'type': 'SentenceNode', + * 'children': [ + * { + * 'type': 'WordNode', + * 'children': [{ + * 'type': 'TextNode', + * 'value': 'Hello' + * }] + * }, + * { + * 'type': 'WhiteSpaceNode', + * 'value': ' ' + * }, + * { + * 'type': 'WordNode', + * 'children': [{ + * 'type': 'TextNode', + * 'value': 'World' + * }] + * }, + * { + * 'type': 'PunctuationNode', + * 'value': '.' + * } + * ] + * }; + * + * var compiler = new Compiler(file); + * + * @constructor + * @class {Compiler} + * @param {File} file - Virtual file. + */ +function Compiler(file) { + this.file = file; +} + +/** + * Stringify the bound file. + * + * @example + * var file = new VFile('Hello'); + * + * file.namespace('retext').cst = { + * type: 'WordNode', + * children: [{ + * type: 'TextNode', + * value: 'Hello' + * }] + * }); + * + * new Compiler(file).compile(); + * // 'Foo' + * + * @this {Compiler} + * @return {string} - Document. + */ +function compile() { + return toString(this.file.namespace('retext').cst); +} + +/* + * Expose `compile`. + */ + +Compiler.prototype.compile = compile; + +/* + * Expose. + */ + +module.exports = Compiler; + +},{"nlcst-to-string":29}],57:[function(require,module,exports){ +/** + * @author Titus Wormer + * @copyright 2014-2015 Titus Wormer. All rights reserved. + * @license MIT + * @module retext:parse + * @fileoverview Parse a virtual file to nlcst. + */ + +'use strict'; + +/* + * Dependencies. + */ + +var Latin = require('parse-latin'); + +/** + * Construct a new parser. + * + * @example + * var file = new VFile('Hello World.'); + * var parser = new Parser(file); + * + * @constructor + * @class {Parser} + * @param {File} file - Virtual file. + */ +function Parser(file) { + this.file = file; +} + +/** + * Stringify the bound file. + * + * @example + * var file = new VFile('Hello world'); + * + * new Parser(file).parse(); + * // ... + * // { + * // 'type': 'SentenceNode', + * // 'children': [ + * // { + * // 'type': 'WordNode', + * // 'children': [{ + * // 'type': 'TextNode', + * // 'value': 'Hello' + * // }] + * // }, + * // { + * // 'type': 'WhiteSpaceNode', + * // 'value': ' ' + * // }, + * // { + * // 'type': 'WordNode', + * // 'children': [{ + * // 'type': 'TextNode', + * // 'value': 'World' + * // }] + * // }, + * // { + * // 'type': 'PunctuationNode', + * // 'value': '.' + * // } + * // ] + * // } + * // ... + * + * @this {Parser} + * @return {Node} - NLCST node. + */ +function parse() { + return new Latin({ + 'position': true + }).parse(this.file.toString()); +} + +/* + * Expose `parse`. + */ + +Parser.prototype.parse = parse; + +/* + * Expose. + */ + +module.exports = Parser; + +},{"parse-latin":31}],58:[function(require,module,exports){ +arguments[4][21][0].apply(exports,arguments) +},{"attach-ware":59,"bail":2,"dup":21,"unherit":60,"vfile":66,"ware":63}],59:[function(require,module,exports){ +arguments[4][22][0].apply(exports,arguments) +},{"dup":22,"unherit":60}],60:[function(require,module,exports){ +arguments[4][23][0].apply(exports,arguments) +},{"clone":61,"dup":23,"inherits":62}],61:[function(require,module,exports){ +arguments[4][24][0].apply(exports,arguments) +},{"buffer":undefined,"dup":24}],62:[function(require,module,exports){ +arguments[4][25][0].apply(exports,arguments) +},{"dup":25}],63:[function(require,module,exports){ +arguments[4][26][0].apply(exports,arguments) +},{"dup":26,"wrap-fn":64}],64:[function(require,module,exports){ +arguments[4][27][0].apply(exports,arguments) +},{"co":65,"dup":27}],65:[function(require,module,exports){ +arguments[4][28][0].apply(exports,arguments) +},{"dup":28}],66:[function(require,module,exports){ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module vfile + * @fileoverview Virtual file format to attach additional + * information related to processed input. Similar to + * `wearefractal/vinyl`. Additionally, `VFile` can be + * passed directly to ESLint formatters to visualise + * warnings and errors relating to a file. + * @example + * var VFile = require('vfile'); + * + * var file = new VFile({ + * 'directory': '~', + * 'filename': 'example', + * 'extension': 'txt', + * 'contents': 'Foo *bar* baz' + * }); + * + * file.toString(); // 'Foo *bar* baz' + * file.filePath(); // '~/example.txt' + * + * file.move({'extension': 'md'}); + * file.filePath(); // '~/example.md' + * + * file.warn('Something went wrong', {'line': 2, 'column': 3}); + * // { [~/example.md:2:3: Something went wrong] + * // name: '~/example.md:2:3', + * // file: '~/example.md', + * // reason: 'Something went wrong', + * // line: 2, + * // column: 3, + * // fatal: false } + */ + +'use strict'; + +var SEPARATOR = '/'; + +try { + SEPARATOR = require('pa' + 'th').sep; +} catch (e) { /* empty */ } + +/** + * File-related message with location information. + * + * @typedef {Error} VFileMessage + * @property {string} name - (Starting) location of the + * message, preceded by its file-path when available, + * and joined by `:`. Used internally by the native + * `Error#toString()`. + * @property {string} file - File-path. + * @property {string} reason - Reason for message. + * @property {number?} line - Line of message, when + * available. + * @property {number?} column - Column of message, when + * available. + * @property {string?} stack - Stack of message, when + * available. + * @property {boolean?} fatal - Whether the associated file + * is still processable. + */ + +/** + * Stringify a position. + * + * @example + * stringify({'line': 1, 'column': 3}) // '1:3' + * stringify({'line': 1}) // '1:1' + * stringify({'column': 3}) // '1:3' + * stringify() // '1:1' + * + * @private + * @param {Object?} [position] - Single position, like + * those available at `node.position.start`. + * @return {string} + */ +function stringify(position) { + if (!position) { + position = {}; + } + + return (position.line || 1) + ':' + (position.column || 1); +} + +/** + * ESLint's formatter API expects `filePath` to be a + * string. This hack supports invocation as well as + * implicit coercion. + * + * @example + * var file = new VFile({ + * 'filename': 'example', + * 'extension': 'txt' + * }); + * + * filePath = filePathFactory(file); + * + * String(filePath); // 'example.txt' + * filePath(); // 'example.txt' + * + * @private + * @param {VFile} file + * @return {Function} + */ +function filePathFactory(file) { + /** + * Get the filename, with extension and directory, if applicable. + * + * @example + * var file = new VFile({ + * 'directory': '~', + * 'filename': 'example', + * 'extension': 'txt' + * }); + * + * String(file.filePath); // ~/example.txt + * file.filePath() // ~/example.txt + * + * @memberof {VFile} + * @property {Function} toString - Itself. ESLint's + * formatter API expects `filePath` to be `string`. + * This hack supports invocation as well as implicit + * coercion. + * @return {string} - If the `vFile` has a `filename`, + * it will be prefixed with the directory (slashed), + * if applicable, and suffixed with the (dotted) + * extension (if applicable). Otherwise, an empty + * string is returned. + */ + function filePath() { + var directory = file.directory; + var separator; + + if (file.filename || file.extension) { + separator = directory.charAt(directory.length - 1); + + if (separator === '/' || separator === '\\') { + directory = directory.slice(0, -1); + } + + if (directory === '.') { + directory = ''; + } + + return (directory ? directory + SEPARATOR : '') + + file.filename + + (file.extension ? '.' + file.extension : ''); + } + + return ''; + } + + filePath.toString = filePath; + + return filePath; +} + +/** + * Construct a new file. + * + * @example + * var file = new VFile({ + * 'directory': '~', + * 'filename': 'example', + * 'extension': 'txt', + * 'contents': 'Foo *bar* baz' + * }); + * + * file === VFile(file) // true + * file === new VFile(file) // true + * VFile('foo') instanceof VFile // true + * + * @constructor + * @class {VFile} + * @param {Object|VFile|string} [options] - either an + * options object, or the value of `contents` (both + * optional). When a `file` is passed in, it's + * immediately returned. + * @property {string} [contents=''] - Content of file. + * @property {string} [directory=''] - Path to parent + * directory. + * @property {string} [filename=''] - Filename. + * A file-path can still be generated when no filename + * exists. + * @property {string} [extension=''] - Extension. + * A file-path can still be generated when no extension + * exists. + * @property {boolean?} quiet - Whether an error created by + * `VFile#fail()` is returned (when truthy) or thrown + * (when falsey). Ensure all `messages` associated with + * a file are handled properly when setting this to + * `true`. + * @property {Array.} messages - List of associated + * messages. + */ +function VFile(options) { + var self = this; + + /* + * No `new` operator. + */ + + if (!(self instanceof VFile)) { + return new VFile(options); + } + + /* + * Given file. + */ + + if ( + options && + typeof options.message === 'function' && + typeof options.hasFailed === 'function' + ) { + return options; + } + + if (!options) { + options = {}; + } else if (typeof options === 'string') { + options = { + 'contents': options + }; + } + + self.contents = options.contents || ''; + self.filename = options.filename || ''; + self.directory = options.directory || ''; + self.extension = options.extension || ''; + + self.messages = []; + + /* + * Make sure eslint’s formatters stringify `filePath` + * properly. + */ + + self.filePath = filePathFactory(self); +} + +/** + * Get the value of the file. + * + * @example + * var vFile = new VFile('Foo'); + * String(vFile); // 'Foo' + * + * @this {VFile} + * @memberof {VFile} + * @return {string} - value at the `contents` property + * in context. + */ +function toString() { + return this.contents; +} + +/** + * Move a file by passing a new directory, filename, + * and extension. When these are not given, the default + * values are kept. + * + * @example + * var file = new VFile({ + * 'directory': '~', + * 'filename': 'example', + * 'extension': 'txt', + * 'contents': 'Foo *bar* baz' + * }); + * + * file.move({'directory': '/var/www'}); + * file.filePath(); // '/var/www/example.txt' + * + * file.move({'extension': 'md'}); + * file.filePath(); // '/var/www/example.md' + * + * @this {VFile} + * @memberof {VFile} + * @param {Object?} [options] + * @return {VFile} - Context object. + */ +function move(options) { + var self = this; + + if (!options) { + options = {}; + } + + self.directory = options.directory || self.directory || ''; + self.filename = options.filename || self.filename || ''; + self.extension = options.extension || self.extension || ''; + + return self; +} + +/** + * Create a message with `reason` at `position`. + * When an error is passed in as `reason`, copies the + * stack. This does not add a message to `messages`. + * + * @example + * var file = new VFile(); + * + * file.message('Something went wrong'); + * // { [1:1: Something went wrong] + * // name: '1:1', + * // file: '', + * // reason: 'Something went wrong', + * // line: null, + * // column: null } + * + * @this {VFile} + * @memberof {VFile} + * @param {string|Error} reason - Reason for message. + * @param {Node|Location|Position} [position] - Location + * of message in file. + * @return {VFileMessage} - File-related message with + * location information. + */ +function message(reason, position) { + var filePath = this.filePath(); + var location; + var err; + + /* + * Node / location / position. + */ + + if (position && position.position) { + position = position.position; + } + + if (position && position.start) { + location = stringify(position.start) + '-' + stringify(position.end); + position = position.start; + } else { + location = stringify(position); + } + + err = new Error(reason.message || reason); + + err.name = (filePath ? filePath + ':' : '') + location; + err.file = filePath; + err.reason = reason.message || reason; + err.line = position ? position.line : null; + err.column = position ? position.column : null; + + if (reason.stack) { + err.stack = reason.stack; + } + + return err; +} + +/** + * Warn. Creates a non-fatal message (see `VFile#message()`), + * and adds it to the file's `messages` list. + * + * @example + * var file = new VFile(); + * + * file.warn('Something went wrong'); + * // { [1:1: Something went wrong] + * // name: '1:1', + * // file: '', + * // reason: 'Something went wrong', + * // line: null, + * // column: null, + * // fatal: false } + * + * @see VFile#message + * @this {VFile} + * @memberof {VFile} + */ +function warn() { + var err = this.message.apply(this, arguments); + + err.fatal = false; + + this.messages.push(err); + + return err; +} + +/** + * Fail. Creates a fatal message (see `VFile#message()`), + * sets `fatal: true`, adds it to the file's + * `messages` list. + * + * If `quiet` is not `true`, throws the error. + * + * @example + * var file = new VFile(); + * + * file.fail('Something went wrong'); + * // 1:1: Something went wrong + * // at VFile.exception (vfile/index.js:296:11) + * // at VFile.fail (vfile/index.js:360:20) + * // at repl:1:6 + * + * file.quiet = true; + * file.fail('Something went wrong'); + * // { [1:1: Something went wrong] + * // name: '1:1', + * // file: '', + * // reason: 'Something went wrong', + * // line: null, + * // column: null, + * // fatal: true } + * + * @this {VFile} + * @memberof {VFile} + * @throws {VFileMessage} - When not `quiet: true`. + * @param {string|Error} reason - Reason for failure. + * @param {Node|Location|Position} [position] - Place + * of failure in file. + * @return {VFileMessage} - Unless thrown, of course. + */ +function fail(reason, position) { + var err = this.message(reason, position); + + err.fatal = true; + + this.messages.push(err); + + if (!this.quiet) { + throw err; + } + + return err; +} + +/** + * Check if a fatal message occurred making the file no + * longer processable. + * + * @example + * var file = new VFile(); + * file.quiet = true; + * + * file.hasFailed(); // false + * + * file.fail('Something went wrong'); + * file.hasFailed(); // true + * + * @this {VFile} + * @memberof {VFile} + * @return {boolean} - `true` if at least one of file's + * `messages` has a `fatal` property set to `true` + */ +function hasFailed() { + var messages = this.messages; + var index = -1; + var length = messages.length; + + while (++index < length) { + if (messages[index].fatal) { + return true; + } + } + + return false; +} + +/** + * Access private information relating to a file. + * + * @example + * var file = new VFile('Foo'); + * + * file.namespace('foo').bar = 'baz'; + * + * console.log(file.namespace('foo').bar) // 'baz'; + * + * @this {VFile} + * @memberof {VFile} + * @param {string} key - Namespace key. + * @return {Object} - Private space. + */ +function namespace(key) { + var self = this; + var space = self.data; + + if (!space) { + space = self.data = {}; + } + + if (!space[key]) { + space[key] = {}; + } + + return space[key]; +} + +/* + * Methods. + */ + +var vFilePrototype = VFile.prototype; + +vFilePrototype.move = move; +vFilePrototype.toString = toString; +vFilePrototype.message = message; +vFilePrototype.warn = warn; +vFilePrototype.fail = fail; +vFilePrototype.hasFailed = hasFailed; +vFilePrototype.namespace = namespace; + +/* + * Expose. + */ + +module.exports = VFile; + +},{}],67:[function(require,module,exports){ +'use strict'; + +module.exports = require('./lib/equality.js'); + +},{"./lib/equality.js":68}],68:[function(require,module,exports){ +/** + * @author Titus Wormer + * @copyright 2014-2015 Titus Wormer + * @license MIT + * @module retext:equality + * @fileoverview Warn about possible insensitive, inconsiderate language + * with Retext. + */ + +'use strict'; + +/* + * Dependencies. + */ + +var visit = require('unist-util-visit'); +var nlcstToString = require('nlcst-to-string'); +var patterns = require('./patterns.json'); + +/** + * Get a string value from a node. + * + * @param {NLCSTNode} node - NLCST node. + * @return {string} + */ +function toString(node) { + return nlcstToString(node).replace(/['’-]/g, ''); +} + +/** + * foo + */ +function matches(search, parent, position) { + var siblings = parent.children; + var node = siblings[position]; + var index = -1; + var length; + var queue = [node]; + + search = search.split(' '); + length = search.length; + + while (++index < length) { + /* + * Check if this node matches. + */ + + if (!node || search[index] !== toString(node).toLowerCase()) { + return null; + } + + /* + * Exit if this is the last node. + */ + + if (index === length - 1) { + break; + } + + /* + * Find the next word. + */ + + while (++position < siblings.length) { + node = siblings[position]; + queue.push(node); + + if (node.type === 'PunctuationNode') { + return null; + } + + if (node.type === 'WordNode') { + break; + } + } + } + + return queue; +} + +/** + * Check `expression` in `parent` at `position`. + * + * @param {Array} expression - List of words, or a list of + * lists. + * @param {NLCSTNode} parent - Parent node. + * @param {number} position - Position in `parent` to + * check. + * @return {Object?} - Result. + */ +function find(expression, parent, position) { + var index = -1; + var length = expression.length; + var result + + while (++index < length) { + result = matches(expression[index], parent, position); + + if (result) { + return result; + } + } + + return null; +} + +/** + * Check `expression` in `parent` at `position`. + * + * @param {Object} expression - Violation expression. + * @param {NLCSTNode} parent - Parent node. + * @param {number} position - Position in `parent` to + * check. + * @return {Object?} - Result. + */ +function check(expression, parent, position) { + var types = ['female', 'male', 'inconsiderate']; + var length = types.length; + var index = -1; + var result; + var type; + var count; + var kind; + var match; + + while (++index < length) { + type = types[index]; + kind = expression[type]; + + if (!kind) { + continue; + } + + count = -1; + + while (kind[++count]) { + match = kind[count]; + + if (typeof match === 'string') { + match = [match]; + } + + result = find(match, parent, position); + + if (result) { + return { + 'queue': result, + 'type': type, + 'canonical': match[0] + }; + } + } + } + + return null; +} + +/** + * Create a human readable warning message for `violation` + * and suggest `suggestion`. + * + * @example + * message('one', 'two'); + * // '`one` may be insensitive, use `two` instead' + * + * message(['one', 'two'], 'three'); + * // '`one/two` may be insensitive, use `three` instead' + * + * @param {*} violation - One violation, a list of + * violations. + * @param {*} suggestion - One or more suggestions + * @return {string} - Human readable warning. + */ +function message(violation, suggestion) { + return quote(violation) + + ' may be insensitive, use ' + + quote(suggestion) + + ' instead'; +} + +/** + * Quote text meant as literal. + * + * @example + * quote('one'); + * // '`one`' + * + * @example + * quote(['one', 'two']); + * // '`one`, `two`' + */ +function quote(value) { + return '`' + (value.join ? value.join('`, `') : value) + '`'; +} + +/** + * Stringify one or more of violations, where a violation + * can be nested, or double nested. + * + * @example + * stringifyViolation('one'); + * // 'one' + * + * @example + * stringifyViolation(['one', 'two']); + * // 'one/two' + * + * @example + * stringifyViolation([['one', 'two'], ['three', four]]); + * // 'one/three' + * + * @param {*} violation - One or more violations. + */ +function stringifyViolation(violation) { + var values; + var value; + var index; + var length; + + if (!violation.join) { + return violation; + } + + values = []; + index = -1; + length = violation.length; + + while (++index < length) { + value = violation[index]; + values.push(value.join ? value[0] : value); + } + + return values.join('/'); +} + +/** + * Check whether the first character of a given value is + * upper-case. Supports a string, or a list of strings. + * Defers to the standard library for what defines + * a “upper case” letter. + * + * @example + * isCapitalized('one'); // false + * isCapitalized('One'); // true + * + * @example + * isCapitalized(['one', 'Two']); // false + * isCapitalized(['One', 'two']); // true + * + * @param {string|Array.} value - One, or a list + * of strings. + * @return {boolean} - Whether the first character is + * upper-case. + */ +function isCapitalized(value) { + var character = (value.charAt ? value : value[0]).charAt(0); + + return character.toUpperCase() === character; +} + +/** + * Capitalize one value, or a list of values. + * + * @example + * capitalize('one'); // 'One' + * + * @example + * capitalize(['one', 'two']); // ['One', 'Two'] + * + * @param {string|Array.} value - One value, or a + * list of values. + * @return {string|Array.} - One or more + * capitalized values. + */ +function capitalize(value) { + var result = []; + var wasString = typeof value === 'string'; + var index = -1; + var length; + + if (wasString) { + value = [value]; + } + + length = value.length; + + while (++index < length) { + result[index] = value[index].charAt(0).toUpperCase() + + value[index].slice(1); + } + + return wasString ? result[0] : result; +} + +/** + * Warn on `file` about `violation` (at `node`) with + * `suggestion`s. + * + * @param {File} file - Virtual file. + * @param {string|Array.} violation - One or more + * violations. + * @param {string|Array.} suggestion - One or more + * suggestions. + * @param {NLCSTNode} node - Node which violates. + * @return {Error} - Virtual file message. + */ +function warn(file, violation, suggestion, node) { + var err; + var index; + var length; + + violation = stringifyViolation(violation); + + if (isCapitalized(violation)) { + suggestion = capitalize(suggestion); + } + + if (/[A-Z]/.test(violation.charAt(0))) { + if (!suggestion.join) { + suggestion = [suggestion]; + } else { + suggestion = suggestion.concat(); + } + + index = -1; + length = suggestion.length; + + while (++index < length) { + suggestion[index] = suggestion[index].charAt(0).toUpperCase() + + suggestion[index].slice(1); + } + } + + err = file.message(message(violation, suggestion) , node); + err.violation = violation.toLowerCase(); + err.fatal = false; + + return err; +} + +/** + * Test `epxression` on the node at `position` in + * `parent`. + * + * @param {File} file - Virtual file. + * @param {Object} expression - An expression mapping + * offenses to fixes. + * @param {number} position - Index in `parent` + * @param {Node} parent - Parent node. + */ +function test(file, expression, position, parent) { + var result = check(expression, parent, position); + var suggestions = expression.neutral || expression.considerate; + var contents; + var queue; + + if (!result) { + return null; + } + + queue = result.queue; + + contents = nlcstToString({ + 'children': queue + }); + + return { + 'end': position + queue.length - 1, + 'type': result.type, + 'canonical': result.canonical, + 'id': expression.id, + 'err': warn(file, contents, suggestions, queue[0]) + }; +} + +/** + * Factory to warn on the given `node` based on `file`. + * + * @param {File} file - Virtual file. + * @return {Function} - Paragraph visitor. + */ +function factory(file) { + /** + * Search `node` for violations. + * + * @param {NLCSTParagraphNode} node - Paragraph. + */ + return function (node) { + var dictionary = {}; + + visit(node, 'SentenceNode', function (node) { + var children = node.children; + var length = children.length; + var count = patterns.length; + var position = -1; + var index; + var result; + var child; + var prev; + var pattern; + var id; + var dict; + + while (++position < length) { + result = null; + child = children[position]; + + if ( + child.type === 'WhiteSpaceNode' || + /^(and|or|\/)$/.test(toString(child)) + ) { + continue; + } + + if (child.type !== 'WordNode') { + prev = null; + continue; + } + + index = -1; + + while (++index < count) { + pattern = patterns[index]; + result = test(file, pattern, position, node); + + if (result) { + id = result.id; + position = result.end; + + if (pattern.type === 'or') { + if ( + prev && + prev.id === id && + prev.type !== result.type + ) { + file.messages = file.messages.slice(0, -1); + result = null; + } else { + file.messages.push(result.err); + } + } else { + dict = dictionary[id]; + + if (!dict) { + dict = dictionary[id] = { + 'phrases': {}, + 'count': 0, + 'first': child + }; + } + + if (!dict.phrases[result.canonical]) { + dict.phrases[result.canonical] = true; + dict.count++; + + if (dict.count === pattern.inconsiderate.length) { + file.messages.push(warn(file, pattern.inconsiderate, pattern.considerate.join('/'), dict.first)); + } + } + } + + prev = result; + + break; + } + } + + if (!result) { + prev = null; + } + } + }); + }; +} + +/** + * Transformer. + * + * @param {NLCSTNode} cst - Syntax tree. + */ +function transformer(cst, file) { + visit(cst, 'ParagraphNode', factory(file)); +} + +/** + * Attacher. + * + * @return {Function} - `transformer`. + */ +function attacher() { + return transformer; +} + +/* + * Expose. + */ + +module.exports = attacher; + +},{"./patterns.json":69,"nlcst-to-string":70,"unist-util-visit":71}],69:[function(require,module,exports){ +module.exports=[ + { + "neutral": [ + "their" + ], + "female": [ + "her" + ], + "male": [ + "him" + ], + "type": "or", + "id": 0 + }, + { + "neutral": [ + "theirs" + ], + "female": [ + "hers" + ], + "male": [ + "his" + ], + "type": "or", + "id": 1 + }, + { + "neutral": [ + "they", + "it" + ], + "female": [ + "she" + ], + "male": [ + "he" + ], + "type": "or", + "id": 2 + }, + { + "neutral": [ + "themselves", + "theirself", + "self" + ], + "female": [ + "herself" + ], + "male": [ + "himself" + ], + "type": "or", + "id": 3 + }, + { + "neutral": [ + "kid", + "child" + ], + "female": [ + "girl" + ], + "male": [ + "boy" + ], + "type": "or", + "id": 4 + }, + { + "neutral": [ + "people", + "persons", + "folks" + ], + "female": [ + "women", + "girls", + "gals", + "ladies" + ], + "male": [ + "men", + "guys", + "dudes", + "gents", + "gentlemen", + "mankind" + ], + "type": "or", + "id": 5 + }, + { + "neutral": [ + "person", + "friend", + "pal", + "folk", + "individual" + ], + "female": [ + "woman", + "gal", + "lady", + "babe", + "bimbo", + "chick" + ], + "male": [ + "man", + "guy", + "lad", + "fellow", + "dude", + "bro", + "gentleman" + ], + "type": "or", + "id": 6 + }, + { + "neutral": [ + "courteous", + "cultured" + ], + "female": [ + "ladylike" + ], + "type": "or", + "id": 7 + }, + { + "neutral": [ + "resolutely", + "bravely" + ], + "male": [ + "like a man" + ], + "type": "or", + "id": 8 + }, + { + "neutral": [ + "birth name" + ], + "female": [ + "maiden name" + ], + "type": "or", + "id": 9 + }, + { + "neutral": [ + "first voyage" + ], + "female": [ + "maiden voyage" + ], + "type": "or", + "id": 10 + }, + { + "neutral": [ + "strong enough" + ], + "male": [ + "man enough" + ], + "type": "or", + "id": 11 + }, + { + "neutral": [ + "upstaging", + "competitiveness" + ], + "male": [ + "oneupmanship" + ], + "type": "or", + "id": 12 + }, + { + "neutral": [ + "ms." + ], + "female": [ + "miss.", + "mrs." + ], + "type": "or", + "id": 13 + }, + { + "neutral": [ + "manufactured", + "artificial", + "synthetic", + "machine-made" + ], + "male": [ + "manmade" + ], + "type": "or", + "id": 14 + }, + { + "neutral": [ + "dynamo" + ], + "male": [ + "man of action" + ], + "type": "or", + "id": 15 + }, + { + "neutral": [ + "scholar", + "writer", + "literary figure" + ], + "male": [ + "man of letters" + ], + "type": "or", + "id": 16 + }, + { + "neutral": [ + "sophisticate" + ], + "male": [ + "man of the world" + ], + "type": "or", + "id": 17 + }, + { + "neutral": [ + "staff hours", + "hours of work" + ], + "male": [ + "manhour, man hour" + ], + "type": "or", + "id": 18 + }, + { + "neutral": [ + "native land" + ], + "female": [ + "motherland" + ], + "male": [ + "fatherland" + ], + "type": "or", + "id": 19 + }, + { + "neutral": [ + "native tongue", + "native language" + ], + "female": [ + "mother tongue" + ], + "male": [ + "father tongue" + ], + "type": "or", + "id": 20 + }, + { + "neutral": [ + "camaraderie" + ], + "male": [ + "fellowship" + ], + "type": "or", + "id": 21 + }, + { + "neutral": [ + "first-year student", + "fresher" + ], + "male": [ + "freshman", + "freshwoman" + ], + "type": "or", + "id": 22 + }, + { + "neutral": [ + "first-year students", + "freshers" + ], + "female": [ + "freshwomen" + ], + "male": [ + "freshmen" + ], + "type": "or", + "id": 23 + }, + { + "neutral": [ + "garbage collector", + "waste collector", + "trash collector" + ], + "female": [ + "garbagewoman" + ], + "male": [ + "garbageman" + ], + "type": "or", + "id": 24 + }, + { + "neutral": [ + "garbage collectors", + "waste collectors", + "trash collectors" + ], + "female": [ + "garbagewomen" + ], + "male": [ + "garbagemen" + ], + "type": "or", + "id": 25 + }, + { + "neutral": [ + "chair", + "chairperson", + "coordinator" + ], + "female": [ + "chairwoman" + ], + "male": [ + "chairman" + ], + "type": "or", + "id": 26 + }, + { + "neutral": [ + "committee member" + ], + "female": [ + "committee woman" + ], + "male": [ + "committee man" + ], + "type": "or", + "id": 27 + }, + { + "neutral": [ + "cowhand" + ], + "female": [ + "cowgirl" + ], + "male": [ + "cowboy" + ], + "type": "or", + "id": 28 + }, + { + "neutral": [ + "cowhands" + ], + "female": [ + "cowgirls" + ], + "male": [ + "cowboys" + ], + "type": "or", + "id": 29 + }, + { + "neutral": [ + "cattle rancher" + ], + "female": [ + "cattlewoman" + ], + "male": [ + "cattleman" + ], + "type": "or", + "id": 30 + }, + { + "neutral": [ + "cattle ranchers" + ], + "female": [ + "cattlewomen" + ], + "male": [ + "cattlemen" + ], + "type": "or", + "id": 31 + }, + { + "neutral": [ + "chairs", + "chairpersons", + "coordinators" + ], + "female": [ + "chairwomen" + ], + "male": [ + "chairmen" + ], + "type": "or", + "id": 32 + }, + { + "neutral": [ + "mail carrier", + "letter carrier", + "postal worker" + ], + "female": [ + "postwoman", + "mailwoman" + ], + "male": [ + "postman", + "mailman" + ], + "type": "or", + "id": 33 + }, + { + "neutral": [ + "mail carriers", + "letter carriers", + "postal workers" + ], + "female": [ + "postwomen", + "mailwomen" + ], + "male": [ + "postmen", + "mailmen" + ], + "type": "or", + "id": 34 + }, + { + "neutral": [ + "officer", + "police officer" + ], + "female": [ + "policewoman" + ], + "male": [ + "policeman" + ], + "type": "or", + "id": 35 + }, + { + "neutral": [ + "officers", + "police officers" + ], + "female": [ + "policewomen" + ], + "male": [ + "policemen" + ], + "type": "or", + "id": 36 + }, + { + "neutral": [ + "flight attendant" + ], + "female": [ + "stewardess" + ], + "male": [ + "steward" + ], + "type": "or", + "id": 37 + }, + { + "neutral": [ + "flight attendants" + ], + "female": [ + "stewardesses" + ], + "male": [ + "stewards" + ], + "type": "or", + "id": 38 + }, + { + "neutral": [ + "member of congress", + "congress person", + "legislator", + "representative" + ], + "female": [ + "congresswoman" + ], + "male": [ + "congressman" + ], + "type": "or", + "id": 39 + }, + { + "neutral": [ + "member of congresss", + "congress persons", + "legislators", + "representatives" + ], + "female": [ + "congresswomen" + ], + "male": [ + "congressmen" + ], + "type": "or", + "id": 40 + }, + { + "neutral": [ + "fire fighter" + ], + "female": [ + "firewoman" + ], + "male": [ + "fireman" + ], + "type": "or", + "id": 41 + }, + { + "neutral": [ + "fire fighters" + ], + "female": [ + "firewomen" + ], + "male": [ + "firemen" + ], + "type": "or", + "id": 42 + }, + { + "neutral": [ + "fisher", + "crew member" + ], + "female": [ + "fisherwoman" + ], + "male": [ + "fisherman" + ], + "type": "or", + "id": 43 + }, + { + "neutral": [ + "fishers" + ], + "female": [ + "fisherwomen" + ], + "male": [ + "fishermen" + ], + "type": "or", + "id": 44 + }, + { + "neutral": [ + "kinship", + "community" + ], + "female": [ + "sisterhood" + ], + "male": [ + "brotherhood" + ], + "type": "or", + "id": 45 + }, + { + "neutral": [ + "common person", + "average person" + ], + "female": [ + "common girl" + ], + "male": [ + "common man" + ], + "type": "or", + "id": 46 + }, + { + "neutral": [ + "business executive", + "entrepreneur", + "business person", + "professional" + ], + "female": [ + "businesswoman", + "salarywoman" + ], + "male": [ + "businessman", + "salaryman" + ], + "type": "or", + "id": 47 + }, + { + "neutral": [ + "business executives", + "entrepreneurs" + ], + "female": [ + "businesswomen", + "salarywomen", + "career girl", + "career woman" + ], + "male": [ + "businessmen", + "salarymen" + ], + "type": "or", + "id": 48 + }, + { + "neutral": [ + "cleaner" + ], + "female": [ + "cleaning lady", + "cleaning girl", + "cleaning woman", + "janitress" + ], + "male": [ + "cleaning man", + "cleaning boy", + "janitor" + ], + "type": "or", + "id": 49 + }, + { + "neutral": [ + "cleaners" + ], + "female": [ + "cleaning ladies", + "cleaning girls", + "janitresses" + ], + "male": [ + "cleaning men", + "janitors" + ], + "type": "or", + "id": 50 + }, + { + "neutral": [ + "courier", + "messenger" + ], + "female": [ + "delivery girl" + ], + "male": [ + "delivery boy" + ], + "type": "or", + "id": 51 + }, + { + "neutral": [ + "supervisor", + "shift boss" + ], + "female": [ + "forewoman" + ], + "male": [ + "foreman" + ], + "type": "or", + "id": 52 + }, + { + "neutral": [ + "lead", + "front", + "figurehead" + ], + "female": [ + "frontwoman, front woman" + ], + "male": [ + "frontman, front man" + ], + "type": "or", + "id": 53 + }, + { + "neutral": [ + "figureheads" + ], + "female": [ + "front women, frontwomen" + ], + "male": [ + "front men, frontmen" + ], + "type": "or", + "id": 54 + }, + { + "neutral": [ + "supervisors", + "shift bosses" + ], + "female": [ + "forewomen" + ], + "male": [ + "foremen" + ], + "type": "or", + "id": 55 + }, + { + "neutral": [ + "insurance agent" + ], + "female": [ + "insurance woman" + ], + "male": [ + "insurance man" + ], + "type": "or", + "id": 56 + }, + { + "neutral": [ + "insurance agents" + ], + "female": [ + "insurance women" + ], + "male": [ + "insurance men" + ], + "type": "or", + "id": 57 + }, + { + "neutral": [ + "proprietor", + "building manager" + ], + "female": [ + "landlady" + ], + "male": [ + "landlord" + ], + "type": "or", + "id": 58 + }, + { + "neutral": [ + "proprietors", + "building managers" + ], + "female": [ + "landladies" + ], + "male": [ + "landlords" + ], + "type": "or", + "id": 59 + }, + { + "neutral": [ + "graduate" + ], + "female": [ + "alumna" + ], + "male": [ + "alumnus" + ], + "type": "or", + "id": 60 + }, + { + "neutral": [ + "graduates" + ], + "female": [ + "alumnae" + ], + "male": [ + "alumni" + ], + "type": "or", + "id": 61 + }, + { + "neutral": [ + "anchor", + "journalist" + ], + "female": [ + "newswoman", + "newspaperwoman", + "anchorwoman" + ], + "male": [ + "newsman", + "newspaperman", + "anchorman" + ], + "type": "or", + "id": 62 + }, + { + "neutral": [ + "anchors", + "journalists" + ], + "female": [ + "newswomen", + "newspaperwomen", + "anchorwomen" + ], + "male": [ + "newsmen", + "newspapermen", + "anchormen" + ], + "type": "or", + "id": 63 + }, + { + "neutral": [ + "repairer", + "technician" + ], + "female": [ + "repairwoman" + ], + "male": [ + "repairman" + ], + "type": "or", + "id": 64 + }, + { + "neutral": [ + "technicians" + ], + "female": [ + "repairwomen" + ], + "male": [ + "repairmen" + ], + "type": "or", + "id": 65 + }, + { + "neutral": [ + "salesperson", + "sales clerk", + "sales rep", + "sales agent", + "seller" + ], + "female": [ + "saleswoman", + "sales woman", + "saleslady" + ], + "male": [ + "salesman", + "sales man" + ], + "type": "or", + "id": 66 + }, + { + "neutral": [ + "sales clerks", + "sales reps", + "sales agents", + "sellers" + ], + "female": [ + "saleswomen", + "sales women", + "salesladies" + ], + "male": [ + "salesmen", + "sales men" + ], + "type": "or", + "id": 67 + }, + { + "neutral": [ + "soldier", + "service representative" + ], + "female": [ + "servicewoman" + ], + "male": [ + "serviceman" + ], + "type": "or", + "id": 68 + }, + { + "neutral": [ + "soldiers", + "service representatives" + ], + "female": [ + "servicewomen" + ], + "male": [ + "servicemen" + ], + "type": "or", + "id": 69 + }, + { + "neutral": [ + "server" + ], + "female": [ + "waitress" + ], + "male": [ + "waiter" + ], + "type": "or", + "id": 70 + }, + { + "neutral": [ + "servers" + ], + "female": [ + "waitresses" + ], + "male": [ + "waiters" + ], + "type": "or", + "id": 71 + }, + { + "neutral": [ + "worker", + "wage earner", + "taxpayer" + ], + "female": [ + "workwoman", + "working woman" + ], + "male": [ + "workman", + "working man" + ], + "type": "or", + "id": 72 + }, + { + "neutral": [ + "quality construction", + "expertise" + ], + "male": [ + "workmanship" + ], + "type": "or", + "id": 73 + }, + { + "neutral": [ + "workers" + ], + "female": [ + "workwomen" + ], + "male": [ + "workmen" + ], + "type": "or", + "id": 74 + }, + { + "neutral": [ + "performer", + "star", + "artist" + ], + "female": [ + "actress" + ], + "male": [ + "actor" + ], + "type": "or", + "id": 75 + }, + { + "neutral": [ + "performers", + "stars", + "artists" + ], + "female": [ + "actresses" + ], + "male": [ + "actors" + ], + "type": "or", + "id": 76 + }, + { + "neutral": [ + "pilot", + "aviator", + "airstaff" + ], + "female": [ + "aircrewwoman", + "aircrew woman" + ], + "male": [ + "aircrewman", + "airman" + ], + "type": "or", + "id": 77 + }, + { + "neutral": [ + "pilots", + "aviators", + "airstaff" + ], + "female": [ + "aircrewwomen", + "aircrew women" + ], + "male": [ + "aircrewmen", + "airmen" + ], + "type": "or", + "id": 78 + }, + { + "neutral": [ + "cabinet member" + ], + "female": [ + "alderwoman" + ], + "male": [ + "alderman" + ], + "type": "or", + "id": 79 + }, + { + "neutral": [ + "cabinet", + "cabinet members" + ], + "female": [ + "alderwomen" + ], + "male": [ + "aldermen" + ], + "type": "or", + "id": 80 + }, + { + "neutral": [ + "assembly person", + "assembly worker" + ], + "female": [ + "assemblywoman" + ], + "male": [ + "assemblyman" + ], + "type": "or", + "id": 81 + }, + { + "neutral": [ + "relative" + ], + "female": [ + "kinswoman", + "aunt" + ], + "male": [ + "kinsman", + "uncle" + ], + "type": "or", + "id": 82 + }, + { + "neutral": [ + "relatives" + ], + "female": [ + "kinswomen", + "aunts" + ], + "male": [ + "kinsmen", + "uncles" + ], + "type": "or", + "id": 83 + }, + { + "neutral": [ + "klansperson" + ], + "female": [ + "klanswoman" + ], + "male": [ + "klansman" + ], + "type": "or", + "id": 84 + }, + { + "neutral": [ + "clansperson", + "clan member" + ], + "female": [ + "clanswoman" + ], + "male": [ + "clansman" + ], + "type": "or", + "id": 85 + }, + { + "neutral": [ + "klan", + "klanspersons" + ], + "female": [ + "klanswomen" + ], + "male": [ + "klansmen" + ], + "type": "or", + "id": 86 + }, + { + "neutral": [ + "boogey" + ], + "female": [ + "boogeywoman" + ], + "male": [ + "boogeyman" + ], + "type": "or", + "id": 87 + }, + { + "neutral": [ + "boogie" + ], + "female": [ + "boogiewoman" + ], + "male": [ + "boogieman" + ], + "type": "or", + "id": 88 + }, + { + "neutral": [ + "bogey" + ], + "female": [ + "bogeywoman" + ], + "male": [ + "bogeyman" + ], + "type": "or", + "id": 89 + }, + { + "neutral": [ + "bogie" + ], + "female": [ + "bogiewoman" + ], + "male": [ + "bogieman" + ], + "type": "or", + "id": 90 + }, + { + "neutral": [ + "boogies" + ], + "female": [ + "boogiewomen" + ], + "male": [ + "boogiemen" + ], + "type": "or", + "id": 91 + }, + { + "neutral": [ + "bogies" + ], + "female": [ + "bogiewomen" + ], + "male": [ + "bogiemen" + ], + "type": "or", + "id": 92 + }, + { + "neutral": [ + "bonder" + ], + "female": [ + "bondswoman" + ], + "male": [ + "bondsman" + ], + "type": "or", + "id": 93 + }, + { + "neutral": [ + "bonders" + ], + "female": [ + "bondswomen" + ], + "male": [ + "bondsmen" + ], + "type": "or", + "id": 94 + }, + { + "neutral": [ + "homemaker" + ], + "female": [ + "housewife" + ], + "type": "or", + "id": 95 + }, + { + "neutral": [ + "partner", + "significant other", + "spouse" + ], + "female": [ + "wife" + ], + "male": [ + "husband" + ], + "type": "or", + "id": 96 + }, + { + "neutral": [ + "partners", + "significant others", + "spouses" + ], + "female": [ + "wives" + ], + "male": [ + "husbands" + ], + "type": "or", + "id": 97 + }, + { + "neutral": [ + "partner", + "friend", + "significant other" + ], + "female": [ + "girlfriend" + ], + "male": [ + "boyfriend" + ], + "type": "or", + "id": 98 + }, + { + "neutral": [ + "partners", + "friends", + "significant others" + ], + "female": [ + "girlfriends" + ], + "male": [ + "boyfriends" + ], + "type": "or", + "id": 99 + }, + { + "neutral": [ + "childhood" + ], + "female": [ + "girlhood" + ], + "male": [ + "boyhood" + ], + "type": "or", + "id": 100 + }, + { + "neutral": [ + "childish" + ], + "female": [ + "girly", + "girlish" + ], + "male": [ + "boyish" + ], + "type": "or", + "id": 101 + }, + { + "neutral": [ + "traveler" + ], + "female": [ + "journeywoman" + ], + "male": [ + "journeyman" + ], + "type": "or", + "id": 102 + }, + { + "neutral": [ + "travelers" + ], + "female": [ + "journeywomen" + ], + "male": [ + "journeymen" + ], + "type": "or", + "id": 103 + }, + { + "neutral": [ + "godparent", + "elder", + "patron" + ], + "female": [ + "godmother", + "patroness" + ], + "male": [ + "godfather" + ], + "type": "or", + "id": 104 + }, + { + "neutral": [ + "grandchild" + ], + "female": [ + "granddaughter" + ], + "male": [ + "grandson" + ], + "type": "or", + "id": 105 + }, + { + "neutral": [ + "grandchildred" + ], + "female": [ + "granddaughters" + ], + "male": [ + "grandsons" + ], + "type": "or", + "id": 106 + }, + { + "neutral": [ + "ancestor" + ], + "female": [ + "foremother" + ], + "male": [ + "forefather" + ], + "type": "or", + "id": 107 + }, + { + "neutral": [ + "ancestors" + ], + "female": [ + "foremothers" + ], + "male": [ + "forefathers" + ], + "type": "or", + "id": 108 + }, + { + "neutral": [ + "grandparent", + "ancestor" + ], + "female": [ + "granny", + "grandma", + "grandmother" + ], + "male": [ + "grandpappy", + "granddaddy", + "gramps", + "grandpa", + "grandfather" + ], + "type": "or", + "id": 109 + }, + { + "neutral": [ + "grandparents", + "ancestors" + ], + "female": [ + "grandmothers" + ], + "male": [ + "grandfathers" + ], + "type": "or", + "id": 110 + }, + { + "neutral": [ + "spouse" + ], + "female": [ + "bride" + ], + "male": [ + "groom" + ], + "type": "or", + "id": 111 + }, + { + "neutral": [ + "sibling" + ], + "female": [ + "sister" + ], + "male": [ + "brother" + ], + "type": "or", + "id": 112 + }, + { + "neutral": [ + "siblings" + ], + "female": [ + "sisters" + ], + "male": [ + "brothers" + ], + "type": "or", + "id": 113 + }, + { + "neutral": [ + "camera operator", + "camera person" + ], + "female": [ + "camerawoman" + ], + "male": [ + "cameraman" + ], + "type": "or", + "id": 114 + }, + { + "neutral": [ + "camera operators" + ], + "female": [ + "camerawomen" + ], + "male": [ + "cameramen" + ], + "type": "or", + "id": 115 + }, + { + "neutral": [ + "troglodyte", + "hominidae" + ], + "female": [ + "cavewoman" + ], + "male": [ + "caveman" + ], + "type": "or", + "id": 116 + }, + { + "neutral": [ + "troglodytae", + "troglodyti", + "troglodytes", + "hominids" + ], + "female": [ + "cavewomen" + ], + "male": [ + "cavemen" + ], + "type": "or", + "id": 117 + }, + { + "neutral": [ + "clergyperson", + "clergy", + "cleric" + ], + "female": [ + "clergywomen" + ], + "male": [ + "clergyman" + ], + "type": "or", + "id": 118 + }, + { + "neutral": [ + "clergies", + "clerics" + ], + "female": [ + "clergywomen" + ], + "male": [ + "clergymen" + ], + "type": "or", + "id": 119 + }, + { + "neutral": [ + "council member" + ], + "female": [ + "councilwoman" + ], + "male": [ + "councilman" + ], + "type": "or", + "id": 120 + }, + { + "neutral": [ + "council members" + ], + "female": [ + "councilwomen" + ], + "male": [ + "councilmen" + ], + "type": "or", + "id": 121 + }, + { + "neutral": [ + "country person" + ], + "female": [ + "countrywoman" + ], + "male": [ + "countryman" + ], + "type": "or", + "id": 122 + }, + { + "neutral": [ + "country folk" + ], + "female": [ + "countrywomen" + ], + "male": [ + "countrymen" + ], + "type": "or", + "id": 123 + }, + { + "neutral": [ + "artisan", + "craftsperson", + "skilled worker" + ], + "female": [ + "handywoman", + "craftswoman" + ], + "male": [ + "handyman", + "craftsman" + ], + "type": "or", + "id": 124 + }, + { + "neutral": [ + "presenter" + ], + "female": [ + "hostess" + ], + "male": [ + "host" + ], + "type": "or", + "id": 125 + }, + { + "neutral": [ + "presenters" + ], + "female": [ + "hostesses" + ], + "male": [ + "hosts" + ], + "type": "or", + "id": 126 + }, + { + "neutral": [ + "artisans", + "craftspersons", + "skilled workers" + ], + "female": [ + "handywomen", + "craftswomen" + ], + "male": [ + "handymen", + "craftsmen" + ], + "type": "or", + "id": 127 + }, + { + "neutral": [ + "guillotine" + ], + "female": [ + "hangwoman" + ], + "male": [ + "hangman" + ], + "type": "or", + "id": 128 + }, + { + "neutral": [ + "guillotines" + ], + "female": [ + "hangwomen" + ], + "male": [ + "hangmen" + ], + "type": "or", + "id": 129 + }, + { + "neutral": [ + "sidekick" + ], + "female": [ + "henchwoman" + ], + "male": [ + "henchman" + ], + "type": "or", + "id": 130 + }, + { + "neutral": [ + "sidekicks" + ], + "female": [ + "henchwomen" + ], + "male": [ + "henchmen" + ], + "type": "or", + "id": 131 + }, + { + "neutral": [ + "role-model" + ], + "female": [ + "heroine" + ], + "male": [ + "hero" + ], + "type": "or", + "id": 132 + }, + { + "neutral": [ + "role-models" + ], + "female": [ + "heroines" + ], + "male": [ + "heroes" + ], + "type": "or", + "id": 133 + }, + { + "neutral": [ + "parental", + "warm", + "intimate" + ], + "female": [ + "maternal" + ], + "male": [ + "paternal", + "fraternal" + ], + "type": "or", + "id": 134 + }, + { + "neutral": [ + "parental" + ], + "female": [ + "maternity" + ], + "male": [ + "paternity" + ], + "type": "or", + "id": 135 + }, + { + "neutral": [ + "parents" + ], + "female": [ + "mamas", + "mothers", + "moms", + "mums", + "mommas", + "mommies" + ], + "male": [ + "papas", + "fathers", + "dads", + "daddies" + ], + "type": "or", + "id": 136 + }, + { + "neutral": [ + "parent" + ], + "female": [ + "mama", + "mother", + "mom", + "mum", + "momma", + "mommy" + ], + "male": [ + "papa", + "father", + "dad", + "pop", + "daddy" + ], + "type": "or", + "id": 137 + }, + { + "neutral": [ + "loving", + "warm", + "nurturing" + ], + "female": [ + "motherly" + ], + "type": "or", + "id": 138 + }, + { + "neutral": [ + "child" + ], + "female": [ + "daughter" + ], + "male": [ + "son" + ], + "type": "or", + "id": 139 + }, + { + "neutral": [ + "children" + ], + "female": [ + "daughters" + ], + "male": [ + "sons" + ], + "type": "or", + "id": 140 + }, + { + "neutral": [ + "convierge" + ], + "female": [ + "doorwoman" + ], + "male": [ + "doorman" + ], + "type": "or", + "id": 141 + }, + { + "neutral": [ + "convierges" + ], + "female": [ + "doorwomen" + ], + "male": [ + "doormen" + ], + "type": "or", + "id": 142 + }, + { + "neutral": [ + "humanly", + "mature" + ], + "female": [ + "feminin" + ], + "male": [ + "dudely", + "manly" + ], + "type": "or", + "id": 143 + }, + { + "neutral": [ + "human resources" + ], + "male": [ + "manpower" + ], + "type": "or", + "id": 144 + }, + { + "neutral": [ + "human" + ], + "female": [ + "female" + ], + "male": [ + "male" + ], + "type": "or", + "id": 145 + }, + { + "neutral": [ + "humans" + ], + "female": [ + "females" + ], + "male": [ + "males" + ], + "type": "or", + "id": 146 + }, + { + "neutral": [ + "ruler" + ], + "female": [ + "empress", + "queen" + ], + "male": [ + "emperor", + "king" + ], + "type": "or", + "id": 147 + }, + { + "neutral": [ + "rulers" + ], + "female": [ + "empresses", + "queens" + ], + "male": [ + "emperors", + "kings" + ], + "type": "or", + "id": 148 + }, + { + "neutral": [ + "jumbo", + "gigantic" + ], + "female": [ + "queen-size" + ], + "male": [ + "king-size" + ], + "type": "or", + "id": 149 + }, + { + "neutral": [ + "power behind the throne" + ], + "female": [ + "queenmaker" + ], + "male": [ + "kingmaker" + ], + "type": "or", + "id": 150 + }, + { + "neutral": [ + "civilian" + ], + "female": [ + "laywoman" + ], + "male": [ + "layman" + ], + "type": "or", + "id": 151 + }, + { + "neutral": [ + "civilians" + ], + "female": [ + "laywomen" + ], + "male": [ + "laymen" + ], + "type": "or", + "id": 152 + }, + { + "neutral": [ + "emcee", + "moderator", + "convenor" + ], + "male": [ + "master of ceremonies" + ], + "type": "or", + "id": 153 + }, + { + "neutral": [ + "skilled", + "authoritative", + "commanding" + ], + "male": [ + "masterful" + ], + "type": "or", + "id": 154 + }, + { + "neutral": [ + "genius", + "creator", + "instigator", + "oversee", + "launch", + "originate" + ], + "male": [ + "mastermind" + ], + "type": "or", + "id": 155 + }, + { + "neutral": [ + "work of genius", + "chef d’oeuvre" + ], + "male": [ + "masterpiece" + ], + "type": "or", + "id": 156 + }, + { + "neutral": [ + "vision", + "comprehensive plan" + ], + "male": [ + "masterplan" + ], + "type": "or", + "id": 157 + }, + { + "neutral": [ + "trump card", + "stroke of genius" + ], + "male": [ + "masterstroke" + ], + "type": "or", + "id": 158 + }, + { + "neutral": [ + "official", + "owner", + "expert", + "superior", + "chief", + "ruler" + ], + "female": [ + "dame" + ], + "male": [ + "lord" + ], + "type": "or", + "id": 159 + }, + { + "neutral": [ + "officials", + "masters", + "chiefs", + "rulers" + ], + "female": [ + "dames" + ], + "male": [ + "lords" + ], + "type": "or", + "id": 160 + }, + { + "neutral": [ + "sociopath" + ], + "male": [ + "madman", + "mad man" + ], + "type": "or", + "id": 161 + }, + { + "neutral": [ + "sociopaths" + ], + "male": [ + "madmen", + "mad men" + ], + "type": "or", + "id": 162 + }, + { + "neutral": [ + "humankind" + ], + "male": [ + "mankind" + ], + "type": "or", + "id": 163 + }, + { + "neutral": [ + "adulthood", + "personhood" + ], + "female": [ + "girlhood" + ], + "male": [ + "masculinity", + "manhood" + ], + "type": "or", + "id": 164 + }, + { + "neutral": [ + "humanity" + ], + "female": [ + "femininity" + ], + "male": [ + "manliness" + ], + "type": "or", + "id": 165 + }, + { + "neutral": [ + "shooter" + ], + "female": [ + "markswoman" + ], + "male": [ + "marksman" + ], + "type": "or", + "id": 166 + }, + { + "neutral": [ + "shooters" + ], + "female": [ + "markswomen" + ], + "male": [ + "marksmen" + ], + "type": "or", + "id": 167 + }, + { + "neutral": [ + "intermediary", + "go-between" + ], + "female": [ + "middlewoman" + ], + "male": [ + "middleman" + ], + "type": "or", + "id": 168 + }, + { + "neutral": [ + "intermediaries", + "go-betweens" + ], + "female": [ + "middlewomen" + ], + "male": [ + "middlemen" + ], + "type": "or", + "id": 169 + }, + { + "neutral": [ + "milk person" + ], + "female": [ + "milkwomen" + ], + "male": [ + "milkman" + ], + "type": "or", + "id": 170 + }, + { + "neutral": [ + "milk people" + ], + "female": [ + "milkwomen" + ], + "male": [ + "milkmen" + ], + "type": "or", + "id": 171 + }, + { + "neutral": [ + "nibling", + "sibling’s child" + ], + "female": [ + "niece" + ], + "male": [ + "nephew" + ], + "type": "or", + "id": 172 + }, + { + "neutral": [ + "niblings", + "sibling’s children" + ], + "female": [ + "nieces" + ], + "male": [ + "nephews" + ], + "type": "or", + "id": 173 + }, + { + "neutral": [ + "noble" + ], + "female": [ + "noblewoman" + ], + "male": [ + "nobleman" + ], + "type": "or", + "id": 174 + }, + { + "neutral": [ + "nobles" + ], + "female": [ + "noblewomen" + ], + "male": [ + "noblemen" + ], + "type": "or", + "id": 175 + }, + { + "neutral": [ + "notary", + "consumer advocate", + "trouble shooter" + ], + "female": [ + "ombudswoman" + ], + "male": [ + "ombudsman" + ], + "type": "or", + "id": 176 + }, + { + "neutral": [ + "notaries" + ], + "female": [ + "ombudswomen" + ], + "male": [ + "ombudsmen" + ], + "type": "or", + "id": 177 + }, + { + "neutral": [ + "heir" + ], + "female": [ + "princess" + ], + "male": [ + "prince" + ], + "type": "or", + "id": 178 + }, + { + "neutral": [ + "heirs" + ], + "female": [ + "princesses" + ], + "male": [ + "princes" + ], + "type": "or", + "id": 179 + }, + { + "neutral": [ + "fairy" + ], + "female": [ + "sandwoman" + ], + "male": [ + "sandman" + ], + "type": "or", + "id": 180 + }, + { + "neutral": [ + "fairies" + ], + "female": [ + "sandwomen" + ], + "male": [ + "sandmen" + ], + "type": "or", + "id": 181 + }, + { + "neutral": [ + "promoter" + ], + "female": [ + "showwoman" + ], + "male": [ + "showman" + ], + "type": "or", + "id": 182 + }, + { + "neutral": [ + "promoters" + ], + "female": [ + "showwomen", + "show women" + ], + "male": [ + "showmen" + ], + "type": "or", + "id": 183 + }, + { + "neutral": [ + "astronaut" + ], + "female": [ + "spacewoman" + ], + "male": [ + "spaceman" + ], + "type": "or", + "id": 184 + }, + { + "neutral": [ + "astronauts" + ], + "female": [ + "spacewomen" + ], + "male": [ + "spacemen" + ], + "type": "or", + "id": 185 + }, + { + "neutral": [ + "speaker", + "spokes person", + "representative" + ], + "female": [ + "spokeswoman" + ], + "male": [ + "spokesman" + ], + "type": "or", + "id": 186 + }, + { + "neutral": [ + "speakers" + ], + "female": [ + "spokeswomen" + ], + "male": [ + "spokesmen" + ], + "type": "or", + "id": 187 + }, + { + "neutral": [ + "athlete", + "sports person" + ], + "female": [ + "sportswoman" + ], + "male": [ + "sportsman" + ], + "type": "or", + "id": 188 + }, + { + "neutral": [ + "athletes", + "sports persons" + ], + "female": [ + "sportswomen" + ], + "male": [ + "sportsmen" + ], + "type": "or", + "id": 189 + }, + { + "neutral": [ + "senator" + ], + "female": [ + "stateswoman" + ], + "male": [ + "statesman" + ], + "type": "or", + "id": 190 + }, + { + "neutral": [ + "step-sibling" + ], + "female": [ + "stepsister" + ], + "male": [ + "stepbrother" + ], + "type": "or", + "id": 191 + }, + { + "neutral": [ + "step-siblings" + ], + "female": [ + "stepsisters" + ], + "male": [ + "stepbrothers" + ], + "type": "or", + "id": 192 + }, + { + "neutral": [ + "step-parent" + ], + "female": [ + "stepmom", + "stepmother" + ], + "male": [ + "stepdad", + "stepfather" + ], + "type": "or", + "id": 193 + }, + { + "neutral": [ + "step-parents" + ], + "female": [ + "stepmothers" + ], + "male": [ + "stepfathers" + ], + "type": "or", + "id": 194 + }, + { + "neutral": [ + "titan" + ], + "female": [ + "superwoman" + ], + "male": [ + "superman" + ], + "type": "or", + "id": 195 + }, + { + "neutral": [ + "titans" + ], + "female": [ + "superwomen" + ], + "male": [ + "supermen" + ], + "type": "or", + "id": 196 + }, + { + "neutral": [ + "inhumane" + ], + "female": [ + "unwomanly", + "unwomenly" + ], + "male": [ + "unmanly", + "unmenly" + ], + "type": "or", + "id": 197 + }, + { + "neutral": [ + "watcher" + ], + "female": [ + "watchwoman" + ], + "male": [ + "watchman" + ], + "type": "or", + "id": 198 + }, + { + "neutral": [ + "watchers" + ], + "female": [ + "watchwomen" + ], + "male": [ + "watchmen" + ], + "type": "or", + "id": 199 + }, + { + "neutral": [ + "weather forecaster", + "meteorologist" + ], + "female": [ + "weatherwoman" + ], + "male": [ + "weatherman" + ], + "type": "or", + "id": 200 + }, + { + "neutral": [ + "weather forecasters", + "meteorologists" + ], + "female": [ + "weatherwomen" + ], + "male": [ + "weathermen" + ], + "type": "or", + "id": 201 + }, + { + "neutral": [ + "bereaved" + ], + "female": [ + "widow", + "widows" + ], + "male": [ + "widower", + "widowers" + ], + "type": "or", + "id": 202 + }, + { + "neutral": [ + "french" + ], + "male": [ + "frenchmen" + ], + "type": "or", + "id": 203 + }, + { + "considerate": [ + "person with learning disabilities" + ], + "inconsiderate": [ + "learning disabled" + ], + "type": "or", + "id": 204 + }, + { + "considerate": [ + "person with disabilities" + ], + "inconsiderate": [ + "disabled" + ], + "type": "or", + "id": 205 + }, + { + "considerate": [ + "person with mental illness" + ], + "inconsiderate": [ + "mentally ill" + ], + "type": "or", + "id": 206 + }, + { + "considerate": [ + "person with physical handicaps" + ], + "inconsiderate": [ + "handicapped" + ], + "type": "or", + "id": 207 + }, + { + "considerate": [ + "person with schizophrenia" + ], + "inconsiderate": [ + "schizophrenic" + ], + "type": "or", + "id": 208 + }, + { + "considerate": [ + "person with an amputation" + ], + "inconsiderate": [ + "amputee" + ], + "type": "or", + "id": 209 + }, + { + "considerate": [ + "person with a limp" + ], + "inconsiderate": [ + "cripple" + ], + "type": "or", + "id": 210 + }, + { + "considerate": [ + "person with Down’s Syndrome" + ], + "inconsiderate": [ + "mongoloid" + ], + "type": "or", + "id": 211 + }, + { + "considerate": [ + "person with symptoms of mental illness" + ], + "inconsiderate": [ + "crazy" + ], + "type": "or", + "id": 212 + }, + { + "considerate": [ + "individual who has had a stroke" + ], + "inconsiderate": [ + "stroke victim" + ], + "type": "or", + "id": 213 + }, + { + "considerate": [ + "person who has multiple sclerosis" + ], + "inconsiderate": [ + "suffering from multiple sclerosis" + ], + "type": "or", + "id": 214 + }, + { + "considerate": [ + "with family support needs" + ], + "inconsiderate": [ + "family burden" + ], + "type": "or", + "id": 215 + }, + { + "considerate": [ + "primary", + "replica" + ], + "inconsiderate": [ + [ + "master", + "masters" + ], + [ + "slave", + "slaves" + ] + ], + "type": "and", + "id": 216 + } +] + +},{}],70:[function(require,module,exports){ +arguments[4][29][0].apply(exports,arguments) +},{"dup":29}],71:[function(require,module,exports){ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer. All rights reserved. + * @module unist:util:visit + * @fileoverview Utility to recursively walk over unist nodes. + */ + +'use strict'; + +/** + * Walk forwards. + * + * @param {Array.<*>} values - Things to iterate over, + * forwards. + * @param {function(*, number): boolean} callback - Function + * to invoke. + * @return {boolean} - False if iteration stopped. + */ +function forwards(values, callback) { + var index = -1; + var length = values.length; + + while (++index < length) { + if (callback(values[index], index) === false) { + return false; + } + } + + return true; +} + +/** + * Walk backwards. + * + * @param {Array.<*>} values - Things to iterate over, + * backwards. + * @param {function(*, number): boolean} callback - Function + * to invoke. + * @return {boolean} - False if iteration stopped. + */ +function backwards(values, callback) { + var index = values.length; + var length = -1; + + while (--index > length) { + if (callback(values[index], index) === false) { + return false; + } + } + + return true; +} + +/** + * Visit. + * + * @param {Node} tree - Root node + * @param {string} [type] - Node type. + * @param {function(node): boolean?} callback - Invoked + * with each found node. Can return `false` to stop. + * @param {boolean} [reverse] - By default, `visit` will + * walk forwards, when `reverse` is `true`, `visit` + * walks backwards. + */ +function visit(tree, type, callback, reverse) { + var iterate; + var one; + var all; + + if (typeof type === 'function') { + reverse = callback; + callback = type; + type = null; + } + + iterate = reverse ? backwards : forwards; + + /** + * Visit `children` in `parent`. + */ + all = function (children, parent) { + return iterate(children, function (child, index) { + return child && one(child, index, parent); + }); + }; + + /** + * Visit a single node. + */ + one = function (node, index, parent) { + var result; + + index = index || (parent ? 0 : null); + + if (!type || node.type === type) { + result = callback(node, index, parent || null); + } + + if (node.children && result !== false) { + return all(node.children, node); + } + + return result; + }; + + one(tree); +} + +/* + * Expose. + */ + +module.exports = visit; + +},{}]},{},[1])(1) +}); \ No newline at end of file diff --git a/alex.min.js b/alex.min.js new file mode 100644 index 0000000..363806b --- /dev/null +++ b/alex.min.js @@ -0,0 +1 @@ +!function(b,a){typeof exports==='object'&&typeof module!=='undefined'?module.exports=b():typeof define==='function'&&define.amd?define([],b):(typeof window!=='undefined'?a=window:typeof global!=='undefined'?a=global:typeof self!=='undefined'?a=self:a=this,a.alex=b())}(function(){var a;return function a(b,c,e){function f(d,k){if(!c[d]){if(!b[d]){var i=typeof require=='function'&&require;if(!k&&i)return i(d,!0);if(g)return g(d,!0);var j=new Error("Cannot find module '"+d+"'");throw j.code='MODULE_NOT_FOUND',j}var h=c[d]={exports:{}};b[d][0].call(h.exports,function(c){var a=b[d][1][c];return f(a?a:c)},h,h.exports,a,b,c,e)}return c[d].exports}var g=typeof require=='function'&&require;for(var d=0;dc)return{line:b+1,column:c-(a[b-1]||0)+1};return{}}return b}function h(i,c){var e=String(c).split('\n'),h;if(!c||typeof c.contents!=='string')throw new Error('Missing `file` for mdast-range');e=d(e),h=f(e),c.offsetToPosition=g(e),c.positionToOffset=h,b(i,function(c){var b=c.position;b&&b.start&&a(b.start,h),b&&b.end&&a(b.end,h)})}function i(){return h}var b=e('mdast-util-visit');c.exports=i},{'mdast-util-visit':5}],5:[function(e,a,f){'use strict';function b(b,d){var a=-1,c=b.length;while(++ac)if(d(b[a],a)===!1)return!1;return!0}function d(i,a,d,f){var g,e,h;typeof a==='function'&&(f=d,d=a,a=null),g=f?c:b,h=function(a,b){return g(a,function(a,c){return a&&e(a,c,b)})},e=function(b,c,f){var e;return c=c||(f?0:null),(!a||b.type===a)&&(e=d(b,c,f||null)),b.children&&e!==!1?h(b.children,b):e},e(i)}a.exports=d},{}],6:[function(a,e,f){'use strict';var b=a('unified'),c=a('./lib/parse.js'),d=a('./lib/stringify.js');e.exports=b({name:'mdast',type:'ast',Parser:c,Compiler:d})},{'./lib/parse.js':9,'./lib/stringify.js':10,unified:21}],7:[function(b,a,c){'use strict';a.exports={parse:{position:!0,gfm:!0,yaml:!0,commonmark:!1,footnotes:!1,pedantic:!1,breaks:!1},stringify:{entities:'false',setext:!1,closeAtx:!1,looseTable:!1,spacedTable:!0,incrementListMarker:!0,fences:!1,fence:'`',bullet:'-',listItemIndent:'tab',rule:'*',ruleSpaces:!0,ruleRepetition:3,strong:'*',emphasis:'_'}}},{}],8:[function(b,a,c){a.exports={rules:{newline:/^\n([ \t]*\n)*/,code:/^((?: {4}|\t)[^\n]*\n?([ \t]*\n)*)+/,horizontalRule:/^[ \t]*([-*_])( *\1){2,} *(?=\n|$)/,heading:/^([ \t]*)(#{1,6})(?:([ \t]+)([^\n]+?))??(?:[ \t]+#+)?[ \t]*(?=\n|$)/,lineHeading:/^(\ {0,3})([^\n]+?)[ \t]*\n\ {0,3}(=|-){1,}[ \t]*(?=\n|$)/,definition:/^[ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$)/,bullet:/(?:[*+-]|\d+\.)/,indent:/^([ \t]*)((?:[*+-]|\d+\.))( {1,4}(?! )| |\t)/,item:/([ \t]*)((?:[*+-]|\d+\.))( {1,4}(?! )| |\t)[^\n]*(?:\n(?!\1(?:[*+-]|\d+\.)[ \t])[^\n]*)*/gm,list:/^([ \t]*)((?:[*+-]|\d+\.))[ \t][\s\S]+?(?:(?=\n+\1?(?:[-*_][ \t]*){3,}(?:\n|$))|(?=\n+[ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$))|\n{2,}(?![ \t])(?!\1(?:[*+-]|\d+\.)[ \t])|$)/,blockquote:/^(?=[ \t]*>)(?:(?:(?:[ \t]*>[^\n]*\n)*(?:[ \t]*>[^\n]+(?=\n|$))|(?![ \t]*>)(?![ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$))[^\n]+)(?:\n|$))*(?:[ \t]*>[ \t]*(?:\n[ \t]*>[ \t]*)*)?/,html:/^(?:[ \t]*(?:(?:(?:<(?:article|header|aside|hgroup|blockquote|hr|iframe|body|li|map|button|object|canvas|ol|caption|output|col|p|colgroup|pre|dd|progress|div|section|dl|table|td|dt|tbody|embed|textarea|fieldset|tfoot|figcaption|th|figure|thead|footer|tr|form|ul|h1|h2|h3|h4|h5|h6|video|script|style)(?:(?:\s+)(?:[a-zA-Z_:][a-zA-Z0-9_.:-]*)(?:(?:\s+)?=(?:\s+)?(?:[^"'=<>`]+|'[^']*'|"[^"]*"))?)*(?:\s+)?\/?>?)|(?:<\/(?:article|header|aside|hgroup|blockquote|hr|iframe|body|li|map|button|object|canvas|ol|caption|output|col|p|colgroup|pre|dd|progress|div|section|dl|table|td|dt|tbody|embed|textarea|fieldset|tfoot|figcaption|th|figure|thead|footer|tr|form|ul|h1|h2|h3|h4|h5|h6|video|script|style)(?:\s+)?>))||(?:<\?(?:[^\?]|\?(?!>))+\?>)|(?:)|(?:))[\s\S]*?[ \t]*?(?:\n{2,}|\s*$))/i,paragraph:/^(?:(?:[^\n]+\n?(?![ \t]*([-*_])( *\1){2,} *(?=\n|$)|([ \t]*)(#{1,6})(?:([ \t]+)([^\n]+?))??(?:[ \t]+#+)?[ \t]*(?=\n|$)|(\ {0,3})([^\n]+?)[ \t]*\n\ {0,3}(=|-){1,}[ \t]*(?=\n|$)|[ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$)|(?=[ \t]*>)(?:(?:(?:[ \t]*>[^\n]*\n)*(?:[ \t]*>[^\n]+(?=\n|$))|(?![ \t]*>)(?![ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$))[^\n]+)(?:\n|$))*(?:[ \t]*>[ \t]*(?:\n[ \t]*>[ \t]*)*)?|<(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\b)(?!mailto:)\w+(?!:\/|[^\w\s@]*@)\b))+)/,escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autoLink:/^<([^ >]+(@|:\/)[^ >]+)>/,tag:/^(?:(?:<(?:[a-zA-Z][a-zA-Z0-9]*)(?:(?:\s+)(?:[a-zA-Z_:][a-zA-Z0-9_.:-]*)(?:(?:\s+)?=(?:\s+)?(?:[^"'=<>`]+|'[^']*'|"[^"]*"))?)*(?:\s+)?\/?>)|(?:<\/(?:[a-zA-Z][a-zA-Z0-9]*)(?:\s+)?>)||(?:<\?(?:[^\?]|\?(?!>))+\?>)|(?:)|(?:))/,strong:/^(_)_((?:\\[\s\S]|[^\\])+?)__(?!_)|^(\*)\*((?:\\[\s\S]|[^\\])+?)\*\*(?!\*)/,emphasis:/^\b(_)((?:__|\\[\s\S]|[^\\])+?)_\b|^(\*)((?:\*\*|\\[\s\S]|[^\\])+?)\*(?!\*)/,inlineCode:/^(`+)((?!`)[\s\S]*?(?:`\s+|[^`]))?(\1)(?!`)/,'break':/^ {2,}\n(?!\s*$)/,inlineText:/^[\s\S]+?(?=[\\)(?:\s+['"]([\s\S]*?)['"])?\s*\)/,shortcutReference:/^(!?\[)((?:\\[\s\S]|[^\[\]])+?)\]/,reference:/^(!?\[)((?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*)\]\s*\[((?:\\[\s\S]|[^\[\]])*)\]/},gfm:{fences:/^( *)(([`~])\3{2,})[ \t]*([^\n`~]+)?[ \t]*(?:\n([\s\S]*?))??(?:\n\ {0,3}\2\3*[ \t]*(?=\n|$)|$)/,paragraph:/^(?:(?:[^\n]+\n?(?![ \t]*([-*_])( *\1){2,} *(?=\n|$)|( *)(([`~])\5{2,})[ \t]*([^\n`~]+)?[ \t]*(?:\n([\s\S]*?))??(?:\n\ {0,3}\4\5*[ \t]*(?=\n|$)|$)|([ \t]*)((?:[*+-]|\d+\.))[ \t][\s\S]+?(?:(?=\n+\8?(?:[-*_][ \t]*){3,}(?:\n|$))|(?=\n+[ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$))|\n{2,}(?![ \t])(?!\8(?:[*+-]|\d+\.)[ \t])|$)|([ \t]*)(#{1,6})(?:([ \t]+)([^\n]+?))??(?:[ \t]+#+)?[ \t]*(?=\n|$)|(\ {0,3})([^\n]+?)[ \t]*\n\ {0,3}(=|-){1,}[ \t]*(?=\n|$)|[ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$)|(?=[ \t]*>)(?:(?:(?:[ \t]*>[^\n]*\n)*(?:[ \t]*>[^\n]+(?=\n|$))|(?![ \t]*>)(?![ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$))[^\n]+)(?:\n|$))*(?:[ \t]*>[ \t]*(?:\n[ \t]*>[ \t]*)*)?|<(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\b)(?!mailto:)\w+(?!:\/|[^\w\s@]*@)\b))+)/,table:/^( *\|(.+))\n( *\|( *[-:]+[-| :]*)\n)((?: *\|.*(?:\n|$))*)/,looseTable:/^( *(\S.*\|.*))\n( *([-:]+ *\|[-| :]*)\n)((?:.*\|.*(?:\n|$))*)/,escape:/^\\([\\`*{}\[\]()#+\-.!_>~|])/,url:/^https?:\/\/[^\s<]+[^<.,:;"')\]\s]/,deletion:/^~~(?=\S)([\s\S]*?\S)~~/,inlineText:/^[\s\S]+?(?=[\\\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$))|\n{2,}(?![ \t])(?!\1(?:[*+-]|\d+[\.\)])[ \t])|$)/,item:/([ \t]*)((?:[*+-]|\d+[\.\)]))( {1,4}(?! )| |\t)[^\n]*(?:\n(?!\1(?:[*+-]|\d+[\.\)])[ \t])[^\n]*)*/gm,bullet:/(?:[*+-]|\d+[\.\)])/,indent:/^([ \t]*)((?:[*+-]|\d+[\.\)]))( {1,4}(?! )| |\t)/,html:/^(?:[ \t]*(?:(?:(?:<(?:article|header|aside|hgroup|blockquote|hr|iframe|body|li|map|button|object|canvas|ol|caption|output|col|p|colgroup|pre|dd|progress|div|section|dl|table|td|dt|tbody|embed|textarea|fieldset|tfoot|figcaption|th|figure|thead|footer|tr|form|ul|h1|h2|h3|h4|h5|h6|video|script|style)(?:(?:\s+)(?:[a-zA-Z_:][a-zA-Z0-9_.:-]*)(?:(?:\s+)?=(?:\s+)?(?:[^"'=<>`]+|'[^']*'|"[^"]*"))?)*(?:\s+)?\/?>?)|(?:<\/(?:article|header|aside|hgroup|blockquote|hr|iframe|body|li|map|button|object|canvas|ol|caption|output|col|p|colgroup|pre|dd|progress|div|section|dl|table|td|dt|tbody|embed|textarea|fieldset|tfoot|figcaption|th|figure|thead|footer|tr|form|ul|h1|h2|h3|h4|h5|h6|video|script|style)(?:\s+)?>))|(?:)|(?:<\?(?:[^\?]|\?(?!>))+\?>)|(?:)|(?:))[\s\S]*?[ \t]*?(?:\n{2,}|\s*$))/i,tag:/^(?:(?:<(?:[a-zA-Z][a-zA-Z0-9]*)(?:(?:\s+)(?:[a-zA-Z_:][a-zA-Z0-9_.:-]*)(?:(?:\s+)?=(?:\s+)?(?:[^"'=<>`]+|'[^']*'|"[^"]*"))?)*(?:\s+)?\/?>)|(?:<\/(?:[a-zA-Z][a-zA-Z0-9]*)(?:\s+)?>)|(?:)|(?:<\?(?:[^\?]|\?(?!>))+\?>)|(?:)|(?:))/,link:/^(!?\[)((?:(?:\[(?:\[(?:\\[\s\S]|[^\[\]])*?\]|\\[\s\S]|[^\[\]])*?\])|\\[\s\S]|[^\[\]])*?)\]\(\s*(?:(?!<)((?:\((?:\\[\s\S]|[^\(\)\s])*?\)|\\[\s\S]|[^\(\)\s])*?)|<([^\n]*?)>)(?:\s+(?:\'((?:\\[\s\S]|[^\'])*?)\'|"((?:\\[\s\S]|[^"])*?)"|\(((?:\\[\s\S]|[^\)])*?)\)))?\s*\)/,reference:/^(!?\[)((?:(?:\[(?:\[(?:\\[\s\S]|[^\[\]])*?\]|\\[\s\S]|[^\[\]])*?\])|\\[\s\S]|[^\[\]])*?)\]\s*\[((?:\\[\s\S]|[^\[\]])*)\]/,paragraph:/^(?:(?:[^\n]+\n?(?!\ {0,3}([-*_])( *\1){2,} *(?=\n|$)|(\ {0,3})(#{1,6})(?:([ \t]+)([^\n]+?))??(?:[ \t]+#+)?\ {0,3}(?=\n|$)|(?=\ {0,3}>)(?:(?:(?:\ {0,3}>[^\n]*\n)*(?:\ {0,3}>[^\n]+(?=\n|$))|(?!\ {0,3}>)(?!\ {0,3}\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?\ {0,3}(?=\n|$))[^\n]+)(?:\n|$))*(?:\ {0,3}>\ {0,3}(?:\n\ {0,3}>\ {0,3})*)?|<(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\b)(?!mailto:)\w+(?!:\/|[^\w\s@]*@)\b))+)/,blockquote:/^(?=[ \t]*>)(?:(?:(?:[ \t]*>[^\n]*\n)*(?:[ \t]*>[^\n]+(?=\n|$))|(?![ \t]*>)(?![ \t]*([-*_])( *\1){2,} *(?=\n|$)|([ \t]*)((?:[*+-]|\d+\.))[ \t][\s\S]+?(?:(?=\n+\3?(?:[-*_][ \t]*){3,}(?:\n|$))|(?=\n+[ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$))|\n{2,}(?![ \t])(?!\3(?:[*+-]|\d+\.)[ \t])|$)|( *)(([`~])\10{2,})[ \t]*([^\n`~]+)?[ \t]*(?:\n([\s\S]*?))??(?:\n\ {0,3}\9\10*[ \t]*(?=\n|$)|$)|((?: {4}|\t)[^\n]*\n?([ \t]*\n)*)+|[ \t]*\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?[ \t]*(?=\n|$))[^\n]+)(?:\n|$))*(?:[ \t]*>[ \t]*(?:\n[ \t]*>[ \t]*)*)?/,escape:/^\\(\n|[\\`*{}\[\]()#+\-.!_>"$%&',\/:;<=?@^~|])/},commonmarkGFM:{paragraph:/^(?:(?:[^\n]+\n?(?!\ {0,3}([-*_])( *\1){2,} *(?=\n|$)|( *)(([`~])\5{2,})\ {0,3}([^\n`~]+)?\ {0,3}(?:\n([\s\S]*?))??(?:\n\ {0,3}\4\5*\ {0,3}(?=\n|$)|$)|(\ {0,3})((?:[*+-]|\d+\.))[ \t][\s\S]+?(?:(?=\n+\8?(?:[-*_]\ {0,3}){3,}(?:\n|$))|(?=\n+\ {0,3}\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?\ {0,3}(?=\n|$))|\n{2,}(?![ \t])(?!\8(?:[*+-]|\d+\.)[ \t])|$)|(\ {0,3})(#{1,6})(?:([ \t]+)([^\n]+?))??(?:[ \t]+#+)?\ {0,3}(?=\n|$)|(?=\ {0,3}>)(?:(?:(?:\ {0,3}>[^\n]*\n)*(?:\ {0,3}>[^\n]+(?=\n|$))|(?!\ {0,3}>)(?!\ {0,3}\[((?:[^\\](?:\\|\\(?:\\{2})+)\]|[^\]])+)\]:[ \t\n]*(<[^>\[\]]+>|[^\s\[\]]+)(?:[ \t\n]+['"(]((?:[^\n]|\n(?!\n))*?)['")])?\ {0,3}(?=\n|$))[^\n]+)(?:\n|$))*(?:\ {0,3}>\ {0,3}(?:\n\ {0,3}>\ {0,3})*)?|<(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\b)(?!mailto:)\w+(?!:\/|[^\w\s@]*@)\b))+)/},breaks:{'break':/^ *\n(?!\s*$)/,inlineText:/^[\s\S]+?(?=[\\1&&(a=Math.floor(a/b)*b),e[a]=c,d=f.charAt(++c);return{indent:a,stops:e}}function B(m,o){var a=m.split(b),d=a.length+1,g=Infinity,k=[],h,i,j,l;a.unshift(n(e,o)+ah);while(d--){if(i=p(a[d]),k[d]=i.stops,f(a[d]).length===0)continue;if(!i.indent){g=Infinity;break}i.indent>0&&i.indent1&&(this.currentBullet=null,this.previousBullet=null),b(a)}function b0(b,a){return a=d(a),b(a)(this.renderCodeBlock(B(a,v),null,b))}function a$(e,a,b,g,h,f,c){return a=d(a),b&&(c=B(b4(c,b.length),b.length)),e(a)(this.renderCodeBlock(c,f,e))}function a_(b,d,e,c,f,g){var a=b.now();return a.column+=(e+c+(f||'')).length,b(d)(this.renderHeading(g,c.length,a))}function aZ(b,c,d,e,f){var a=b.now();return a.column+=d.length,b(c)(this.renderHeading(e,f===ag?1:2,a))}function aY(a,b){return a(b)(this.renderVoid(as))}function aX(c,g){var b=c.now(),e=this.indent(b.line),a=d(g),f=c(a);return a=a.replace(a4,function(a){return e(a.length),''}),f(this.renderBlockquote(a,b))}function aW(o,y,z,x){var f=this,j=x,t=d(y),a=t.match(f.rules.item),h=a.length,c=0,q=!1,r,l,g,u,v,m,i,w,k,s;if(!f.options.pedantic)while(++c1,start:a,loose:null,children:c}}function aw(a,e){function f(a){return d(a.length),c}var b=this,d=b.indent(e.line);return a=a.replace(a2,f),d=b.indent(e.line),a.replace(a0,f)}function aP(d,m){var k=this,g=k.indent(m.line),h,f,j,c,a,l,i;d=d.replace(a3,function(g,b,a,c,d){return h=b+a+c,f=d,Number(a)<10&&h.length%2===1&&(a=e+a),i=b+n(e,a.length)+c,i+f}),j=d.split(b),c=B(d,p(i).indent).split(b),c[0]=f,g(h.length),a=0,l=j.length;while(++a[ \t]?/gm,a3=/^([ \t]*)([*+-]|\d+[.)])( {1,4}(?! )| |\t)([^\n]*)/,a2=/^([ \t]*)([*+-]|\d+[.)])([ \t]+)/,a0=/^( {1,4}|\t)?/gm,$=/^( {4}|\t)?/gm,W=/^/i,ai=/\n\n(?!\s*$)/,ac=/^\[([\ \t]|x|X)\][\ \t]/,l={};l[e]=e.length,l[A]=v;var j={};j.text=function(a,b){return a.value+=b.value,a},j.blockquote=function(a,b){return this.options.commonmark?b:(a.children=a.children.concat(b.children),a)},j.list=function(a,b){return!this.currentBullet||this.currentBullet!==this.previousBullet||this.currentBullet.length!==1?b:(a.children=a.children.concat(b.children),a)},z.onlyAtTop=!0,z.notInBlockquote=!0,af.onlyAtStart=!0,s.onlyAtTop=!0,s.notInBlockquote=!0,x.onlyAtTop=!0;var q={};q[!0]=aw,q[!1]=aP,R.notInLink=!0,S.notInLink=!0,a.prototype.setOptions=function(a){var b=this,d=b.expressions,e=b.rules,f=b.options,c;a===null||a===undefined?a={}:typeof a==='object'?a=i({},a):ap(a,'options'),b.options=a;for(c in y)ab.boolean(a,c,f[c]),a[c]&&i(e,d[c]);return a.gfm&&a.breaks&&i(e,d.breaksGFM),a.gfm&&a.commonmark&&i(e,d.commonmarkGFM),a.commonmark&&(b.enterBlockquote=b2()),b},a.prototype.options=y,a.prototype.expressions=a7,a.prototype.indent=function(c){function d(c){b.offset[a]=(b.offset[a]||0)+c,a++}var b=this,a=c;return d},a.prototype.parse=function(){var a=this,c=aa(String(a.file)),b;return a.offset={},b=a.renderBlock(ar,c),a.options.position&&(b.position={start:{line:1,column:1}},b.position.end=a.eof||b.position.start),b},a.prototype.enterLink=r('inLink',!1),a.prototype.exitTop=r('atTop',!0),a.prototype.exitStart=r('atStart',!0),a.prototype.enterBlockquote=r('inBlockquote',!1),a.prototype.renderRaw=aI,a.prototype.renderVoid=aK,a.prototype.renderParent=aJ,a.prototype.renderInline=aF,a.prototype.renderBlock=aE,a.prototype.renderLink=aH,a.prototype.renderCodeBlock=aS,a.prototype.renderBlockquote=aL,a.prototype.renderList=aR,a.prototype.renderListItem=aO,a.prototype.renderFootnoteDefinition=aN,a.prototype.renderHeading=aM,a.prototype.renderFootnote=aG,a.prototype.blockTokenizers={yamlFrontMatter:af,newline:b1,code:b0,fences:a$,heading:a_,lineHeading:aZ,horizontalRule:aY,blockquote:aX,list:aW,html:aV,definition:z,footnoteDefinition:s,looseTable:x,table:x,paragraph:aU},a.prototype.blockMethods=['yamlFrontMatter','newline','code','fences','blockquote','heading','horizontalRule','list','lineHeading','html','definition','footnoteDefinition','looseTable','table','paragraph','blockText'],a.prototype.tokenizeBlock=t(aq),a.prototype.inlineTokenizers={escape:aD,autoLink:R,url:S,tag:aC,link:aB,reference:V,shortcutReference:V,strong:aA,emphasis:az,deletion:ay,inlineCode:aQ,'break':ax,inlineText:aT},a.prototype.inlineMethods=['escape','autoLink','url','tag','link','reference','shortcutReference','strong','emphasis','deletion','inlineCode','break','inlineText'],a.prototype.tokenizeInline=t(D),a.prototype.tokenizeFactory=t,b6.exports=a},{'./defaults.js':7,'./expressions.js':8,'./utilities.js':11,'extend.js':14,he:15,'repeat-string':18,trim:20,'trim-trailing-lines':19}],10:[function(h,ac,ad){'use strict';function ab(a){return a}function aa(a,d){function e(a,e){try{return X[c](a,b)}catch(a){d.fail(a,e.position)}}var b={},c;return a==='false'?ab:(a==='true'&&(b.useNamedReferences=!0),c=a==='escape'?'escape':'encode',e)}function x(a,b){return b||!a.length||R.test(a)||D(a,y)!==D(a,z)?Y+a+P:a}function K(b){var a=T;return b.indexOf(a)!==-1&&(a=U),a+b+a}function H(a,f){var c,e;a=a.split(d),c=a.length,e=g(b,f*l);while(c--)a[c].length!==0&&(a[c]=e+a[c]);return a.join(d)}function $(b,c){var a=this;a.file=b,a.options=Q({},a.options),a.setOptions(c)}function a2(d){var a=c,b=d.referenceType;return b==='full'&&(a=d.identifier),b!=='shortcut'&&(a=f+a+e),a}var X=h('he'),Z=h('markdown-table'),g=h('repeat-string'),Q=h('extend.js'),D=h('ccount'),J=h('longest-streak'),C=h('./utilities.js'),F=h('./defaults.js').stringify,L=C.raise,a0=C.validate,l=4,a4=3,a6=3,a7=3,a8='mailto:',R=/\s/,V=/([`~])\1{2}/,W=/^[a-z][a-z+.-]+:\/?/i,P='>',Y='<',u='*',t='^',E=':',p='-',a1='.',c='',a3='=',O='!',a5='#',d='\n',y='(',z=')',n='|',S='+',T='"',U="'",b=' ',f='[',e=']',j='`',A='~',G='_',k=d+d,I=k+d,B=A+A,m={};m[!0]=!0,m[!1]=!0,m.numbers=!0,m.escape=!0;var o={};o[u]=!0,o[p]=!0,o[S]=!0;var r={};r[u]=!0,r[p]=!0,r[G]=!0;var q={};q[G]=!0,q[u]=!0;var w={};w[j]=!0,w[A]=!0;var v={};v[!0]='visitOrderedItems',v[!1]='visitUnorderedItems';var s={},a9='tab',M='1',N='mixed';s[M]=!0,s[a9]=!0,s[N]=!0;var i={};i.null=c,i[void 0]=c,i[!0]=f+'x'+e+b,i[!1]=f+b+e+b;var a=$.prototype;a.options=F;var _={entities:m,bullet:o,rule:r,listItemIndent:s,emphasis:q,strong:q,fence:w};a.setOptions=function(a){var b=this,e=b.options,d,c;a===null||a===undefined?a={}:typeof a==='object'?a=Q({},a):L(a,'options');for(c in F)a0[typeof e[c]](a,c,e[c],_[c]);return d=a.ruleRepetition,d&&d\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,h={Á:'Aacute',á:'aacute',Ă:'Abreve',ă:'abreve','∾':'ac','∿':'acd','∾̳':'acE',Â:'Acirc',â:'acirc','´':'acute',А:'Acy',а:'acy',Æ:'AElig',æ:'aelig','⁡':'af','𝔄':'Afr','𝔞':'afr',À:'Agrave',à:'agrave',ℵ:'aleph',Α:'Alpha',α:'alpha',Ā:'Amacr',ā:'amacr','⨿':'amalg','&':'amp','⩕':'andand','⩓':'And','∧':'and','⩜':'andd','⩘':'andslope','⩚':'andv','∠':'ang','⦤':'ange','⦨':'angmsdaa','⦩':'angmsdab','⦪':'angmsdac','⦫':'angmsdad','⦬':'angmsdae','⦭':'angmsdaf','⦮':'angmsdag','⦯':'angmsdah','∡':'angmsd','∟':'angrt','⊾':'angrtvb','⦝':'angrtvbd','∢':'angsph',Å:'angst','⍼':'angzarr',Ą:'Aogon',ą:'aogon','𝔸':'Aopf','𝕒':'aopf','⩯':'apacir','≈':'ap','⩰':'apE','≊':'ape','≋':'apid',"'":'apos',å:'aring','𝒜':'Ascr','𝒶':'ascr','≔':'colone','*':'ast','≍':'CupCap',Ã:'Atilde',ã:'atilde',Ä:'Auml',ä:'auml','∳':'awconint','⨑':'awint','≌':'bcong','϶':'bepsi','‵':'bprime','∽':'bsim','⋍':'bsime','∖':'setmn','⫧':'Barv','⊽':'barvee','⌅':'barwed','⌆':'Barwed','⎵':'bbrk','⎶':'bbrktbrk',Б:'Bcy',б:'bcy','„':'bdquo','∵':'becaus','⦰':'bemptyv',ℬ:'Bscr',Β:'Beta',β:'beta',ℶ:'beth','≬':'twixt','𝔅':'Bfr','𝔟':'bfr','⋂':'xcap','◯':'xcirc','⋃':'xcup','⨀':'xodot','⨁':'xoplus','⨂':'xotime','⨆':'xsqcup','★':'starf','▽':'xdtri','△':'xutri','⨄':'xuplus','⋁':'Vee','⋀':'Wedge','⤍':'rbarr','⧫':'lozf','▪':'squf','▴':'utrif','▾':'dtrif','◂':'ltrif','▸':'rtrif','␣':'blank','▒':'blk12','░':'blk14','▓':'blk34','█':'block','=⃥':'bne','≡⃥':'bnequiv','⫭':'bNot','⌐':'bnot','𝔹':'Bopf','𝕓':'bopf','⊥':'bot','⋈':'bowtie','⧉':'boxbox','┐':'boxdl','╕':'boxdL','╖':'boxDl','╗':'boxDL','┌':'boxdr','╒':'boxdR','╓':'boxDr','╔':'boxDR','─':'boxh','═':'boxH','┬':'boxhd','╤':'boxHd','╥':'boxhD','╦':'boxHD','┴':'boxhu','╧':'boxHu','╨':'boxhU','╩':'boxHU','⊟':'minusb','⊞':'plusb','⊠':'timesb','┘':'boxul','╛':'boxuL','╜':'boxUl','╝':'boxUL','└':'boxur','╘':'boxuR','╙':'boxUr','╚':'boxUR','│':'boxv','║':'boxV','┼':'boxvh','╪':'boxvH','╫':'boxVh','╬':'boxVH','┤':'boxvl','╡':'boxvL','╢':'boxVl','╣':'boxVL','├':'boxvr','╞':'boxvR','╟':'boxVr','╠':'boxVR','˘':'breve','¦':'brvbar','𝒷':'bscr','⁏':'bsemi','⧅':'bsolb','\\':'bsol','⟈':'bsolhsub','•':'bull','≎':'bump','⪮':'bumpE','≏':'bumpe',Ć:'Cacute',ć:'cacute','⩄':'capand','⩉':'capbrcup','⩋':'capcap','∩':'cap','⋒':'Cap','⩇':'capcup','⩀':'capdot',ⅅ:'DD','∩︀':'caps','⁁':'caret',ˇ:'caron',ℭ:'Cfr','⩍':'ccaps',Č:'Ccaron',č:'ccaron',Ç:'Ccedil',ç:'ccedil',Ĉ:'Ccirc',ĉ:'ccirc','∰':'Cconint','⩌':'ccups','⩐':'ccupssm',Ċ:'Cdot',ċ:'cdot','¸':'cedil','⦲':'cemptyv','¢':'cent','·':'middot','𝔠':'cfr',Ч:'CHcy',ч:'chcy','✓':'check',Χ:'Chi',χ:'chi',ˆ:'circ','≗':'cire','↺':'olarr','↻':'orarr','⊛':'oast','⊚':'ocir','⊝':'odash','⊙':'odot','®':'reg','Ⓢ':'oS','⊖':'ominus','⊕':'oplus','⊗':'otimes','○':'cir','⧃':'cirE','⨐':'cirfnint','⫯':'cirmid','⧂':'cirscir','∲':'cwconint','”':'rdquo','’':'rsquo','♣':'clubs',':':'colon','∷':'Colon','⩴':'Colone',',':'comma','@':'commat','∁':'comp','∘':'compfn',ℂ:'Copf','≅':'cong','⩭':'congdot','≡':'equiv','∮':'oint','∯':'Conint','𝕔':'copf','∐':'coprod','©':'copy','℗':'copysr','↵':'crarr','✗':'cross','⨯':'Cross','𝒞':'Cscr','𝒸':'cscr','⫏':'csub','⫑':'csube','⫐':'csup','⫒':'csupe','⋯':'ctdot','⤸':'cudarrl','⤵':'cudarrr','⋞':'cuepr','⋟':'cuesc','↶':'cularr','⤽':'cularrp','⩈':'cupbrcap','⩆':'cupcap','∪':'cup','⋓':'Cup','⩊':'cupcup','⊍':'cupdot','⩅':'cupor','∪︀':'cups','↷':'curarr','⤼':'curarrm','⋎':'cuvee','⋏':'cuwed','¤':'curren','∱':'cwint','⌭':'cylcty','†':'dagger','‡':'Dagger',ℸ:'daleth','↓':'darr','↡':'Darr','⇓':'dArr','‐':'dash','⫤':'Dashv','⊣':'dashv','⤏':'rBarr','˝':'dblac',Ď:'Dcaron',ď:'dcaron',Д:'Dcy',д:'dcy','⇊':'ddarr',ⅆ:'dd','⤑':'DDotrahd','⩷':'eDDot','°':'deg','∇':'Del',Δ:'Delta',δ:'delta','⦱':'demptyv','⥿':'dfisht','𝔇':'Dfr','𝔡':'dfr','⥥':'dHar','⇃':'dharl','⇂':'dharr','˙':'dot','`':'grave','˜':'tilde','⋄':'diam','♦':'diams','¨':'die',ϝ:'gammad','⋲':'disin','÷':'div','⋇':'divonx',Ђ:'DJcy',ђ:'djcy','⌞':'dlcorn','⌍':'dlcrop',$:'dollar','𝔻':'Dopf','𝕕':'dopf','⃜':'DotDot','≐':'doteq','≑':'eDot','∸':'minusd','∔':'plusdo','⊡':'sdotb','⇐':'lArr','⇔':'iff','⟸':'xlArr','⟺':'xhArr','⟹':'xrArr','⇒':'rArr','⊨':'vDash','⇑':'uArr','⇕':'vArr','∥':'par','⤓':'DownArrowBar','⇵':'duarr','̑':'DownBreve','⥐':'DownLeftRightVector','⥞':'DownLeftTeeVector','⥖':'DownLeftVectorBar','↽':'lhard','⥟':'DownRightTeeVector','⥗':'DownRightVectorBar','⇁':'rhard','↧':'mapstodown','⊤':'top','⤐':'RBarr','⌟':'drcorn','⌌':'drcrop','𝒟':'Dscr','𝒹':'dscr',Ѕ:'DScy',ѕ:'dscy','⧶':'dsol',Đ:'Dstrok',đ:'dstrok','⋱':'dtdot','▿':'dtri','⥯':'duhar','⦦':'dwangle',Џ:'DZcy',џ:'dzcy','⟿':'dzigrarr',É:'Eacute',é:'eacute','⩮':'easter',Ě:'Ecaron',ě:'ecaron',Ê:'Ecirc',ê:'ecirc','≖':'ecir','≕':'ecolon',Э:'Ecy',э:'ecy',Ė:'Edot',ė:'edot',ⅇ:'ee','≒':'efDot','𝔈':'Efr','𝔢':'efr','⪚':'eg',È:'Egrave',è:'egrave','⪖':'egs','⪘':'egsdot','⪙':'el','∈':'in','⏧':'elinters',ℓ:'ell','⪕':'els','⪗':'elsdot',Ē:'Emacr',ē:'emacr','∅':'empty','◻':'EmptySmallSquare','▫':'EmptyVerySmallSquare',' ':'emsp13',' ':'emsp14',' ':'emsp',Ŋ:'ENG',ŋ:'eng',' ':'ensp',Ę:'Eogon',ę:'eogon','𝔼':'Eopf','𝕖':'eopf','⋕':'epar','⧣':'eparsl','⩱':'eplus',ε:'epsi',Ε:'Epsilon',ϵ:'epsiv','≂':'esim','⩵':'Equal','=':'equals','≟':'equest','⇌':'rlhar','⩸':'equivDD','⧥':'eqvparsl','⥱':'erarr','≓':'erDot',ℯ:'escr',ℰ:'Escr','⩳':'Esim',Η:'Eta',η:'eta',Ð:'ETH',ð:'eth',Ë:'Euml',ë:'euml','€':'euro','!':'excl','∃':'exist',Ф:'Fcy',ф:'fcy','♀':'female',ffi:'ffilig',ff:'fflig',ffl:'ffllig','𝔉':'Ffr','𝔣':'ffr',fi:'filig','◼':'FilledSmallSquare',fj:'fjlig','♭':'flat',fl:'fllig','▱':'fltns',ƒ:'fnof','𝔽':'Fopf','𝕗':'fopf','∀':'forall','⋔':'fork','⫙':'forkv',ℱ:'Fscr','⨍':'fpartint','½':'half','⅓':'frac13','¼':'frac14','⅕':'frac15','⅙':'frac16','⅛':'frac18','⅔':'frac23','⅖':'frac25','¾':'frac34','⅗':'frac35','⅜':'frac38','⅘':'frac45','⅚':'frac56','⅝':'frac58','⅞':'frac78','⁄':'frasl','⌢':'frown','𝒻':'fscr',ǵ:'gacute',Γ:'Gamma',γ:'gamma',Ϝ:'Gammad','⪆':'gap',Ğ:'Gbreve',ğ:'gbreve',Ģ:'Gcedil',Ĝ:'Gcirc',ĝ:'gcirc',Г:'Gcy',г:'gcy',Ġ:'Gdot',ġ:'gdot','≥':'ge','≧':'gE','⪌':'gEl','⋛':'gel','⩾':'ges','⪩':'gescc','⪀':'gesdot','⪂':'gesdoto','⪄':'gesdotol','⋛︀':'gesl','⪔':'gesles','𝔊':'Gfr','𝔤':'gfr','≫':'gg','⋙':'Gg',ℷ:'gimel',Ѓ:'GJcy',ѓ:'gjcy','⪥':'gla','≷':'gl','⪒':'glE','⪤':'glj','⪊':'gnap','⪈':'gne','≩':'gnE','⋧':'gnsim','𝔾':'Gopf','𝕘':'gopf','⪢':'GreaterGreater','≳':'gsim','𝒢':'Gscr',ℊ:'gscr','⪎':'gsime','⪐':'gsiml','⪧':'gtcc','⩺':'gtcir','>':'gt','⋗':'gtdot','⦕':'gtlPar','⩼':'gtquest','⥸':'gtrarr','≩︀':'gvnE',' ':'hairsp',ℋ:'Hscr',Ъ:'HARDcy',ъ:'hardcy','⥈':'harrcir','↔':'harr','↭':'harrw','^':'Hat',ℏ:'hbar',Ĥ:'Hcirc',ĥ:'hcirc','♥':'hearts','…':'mldr','⊹':'hercon','𝔥':'hfr',ℌ:'Hfr','⤥':'searhk','⤦':'swarhk','⇿':'hoarr','∻':'homtht','↩':'larrhk','↪':'rarrhk','𝕙':'hopf',ℍ:'Hopf','―':'horbar','𝒽':'hscr',Ħ:'Hstrok',ħ:'hstrok','⁃':'hybull',Í:'Iacute',í:'iacute','⁣':'ic',Î:'Icirc',î:'icirc',И:'Icy',и:'icy',İ:'Idot',Е:'IEcy',е:'iecy','¡':'iexcl','𝔦':'ifr',ℑ:'Im',Ì:'Igrave',ì:'igrave',ⅈ:'ii','⨌':'qint','∭':'tint','⧜':'iinfin','℩':'iiota',IJ:'IJlig',ij:'ijlig',Ī:'Imacr',ī:'imacr',ℐ:'Iscr',ı:'imath','⊷':'imof',Ƶ:'imped','℅':'incare','∞':'infin','⧝':'infintie','⊺':'intcal','∫':'int','∬':'Int',ℤ:'Zopf','⨗':'intlarhk','⨼':'iprod','⁢':'it',Ё:'IOcy',ё:'iocy',Į:'Iogon',į:'iogon','𝕀':'Iopf','𝕚':'iopf',Ι:'Iota',ι:'iota','¿':'iquest','𝒾':'iscr','⋵':'isindot','⋹':'isinE','⋴':'isins','⋳':'isinsv',Ĩ:'Itilde',ĩ:'itilde',І:'Iukcy',і:'iukcy',Ï:'Iuml',ï:'iuml',Ĵ:'Jcirc',ĵ:'jcirc',Й:'Jcy',й:'jcy','𝔍':'Jfr','𝔧':'jfr',ȷ:'jmath','𝕁':'Jopf','𝕛':'jopf','𝒥':'Jscr','𝒿':'jscr',Ј:'Jsercy',ј:'jsercy',Є:'Jukcy',є:'jukcy',Κ:'Kappa',κ:'kappa',ϰ:'kappav',Ķ:'Kcedil',ķ:'kcedil',К:'Kcy',к:'kcy','𝔎':'Kfr','𝔨':'kfr',ĸ:'kgreen',Х:'KHcy',х:'khcy',Ќ:'KJcy',ќ:'kjcy','𝕂':'Kopf','𝕜':'kopf','𝒦':'Kscr','𝓀':'kscr','⇚':'lAarr',Ĺ:'Lacute',ĺ:'lacute','⦴':'laemptyv',ℒ:'Lscr',Λ:'Lambda',λ:'lambda','⟨':'lang','⟪':'Lang','⦑':'langd','⪅':'lap','«':'laquo','⇤':'larrb','⤟':'larrbfs','←':'larr','↞':'Larr','⤝':'larrfs','↫':'larrlp','⤹':'larrpl','⥳':'larrsim','↢':'larrtl','⤙':'latail','⤛':'lAtail','⪫':'lat','⪭':'late','⪭︀':'lates','⤌':'lbarr','⤎':'lBarr','❲':'lbbrk','{':'lcub','[':'lsqb','⦋':'lbrke','⦏':'lbrksld','⦍':'lbrkslu',Ľ:'Lcaron',ľ:'lcaron',Ļ:'Lcedil',ļ:'lcedil','⌈':'lceil',Л:'Lcy',л:'lcy','⤶':'ldca','“':'ldquo','⥧':'ldrdhar','⥋':'ldrushar','↲':'ldsh','≤':'le','≦':'lE','⇆':'lrarr','⟦':'lobrk','⥡':'LeftDownTeeVector','⥙':'LeftDownVectorBar','⌊':'lfloor','↼':'lharu','⇇':'llarr','⇋':'lrhar','⥎':'LeftRightVector','↤':'mapstoleft','⥚':'LeftTeeVector','⋋':'lthree','⧏':'LeftTriangleBar','⊲':'vltri','⊴':'ltrie','⥑':'LeftUpDownVector','⥠':'LeftUpTeeVector','⥘':'LeftUpVectorBar','↿':'uharl','⥒':'LeftVectorBar','⪋':'lEg','⋚':'leg','⩽':'les','⪨':'lescc','⩿':'lesdot','⪁':'lesdoto','⪃':'lesdotor','⋚︀':'lesg','⪓':'lesges','⋖':'ltdot','≶':'lg','⪡':'LessLess','≲':'lsim','⥼':'lfisht','𝔏':'Lfr','𝔩':'lfr','⪑':'lgE','⥢':'lHar','⥪':'lharul','▄':'lhblk',Љ:'LJcy',љ:'ljcy','≪':'ll','⋘':'Ll','⥫':'llhard','◺':'lltri',Ŀ:'Lmidot',ŀ:'lmidot','⎰':'lmoust','⪉':'lnap','⪇':'lne','≨':'lnE','⋦':'lnsim','⟬':'loang','⇽':'loarr','⟵':'xlarr','⟷':'xharr','⟼':'xmap','⟶':'xrarr','↬':'rarrlp','⦅':'lopar','𝕃':'Lopf','𝕝':'lopf','⨭':'loplus','⨴':'lotimes','∗':'lowast',_:'lowbar','↙':'swarr','↘':'searr','◊':'loz','(':'lpar','⦓':'lparlt','⥭':'lrhard','‎':'lrm','⊿':'lrtri','‹':'lsaquo','𝓁':'lscr','↰':'lsh','⪍':'lsime','⪏':'lsimg','‘':'lsquo','‚':'sbquo',Ł:'Lstrok',ł:'lstrok','⪦':'ltcc','⩹':'ltcir','<':'lt','⋉':'ltimes','⥶':'ltlarr','⩻':'ltquest','◃':'ltri','⦖':'ltrPar','⥊':'lurdshar','⥦':'luruhar','≨︀':'lvnE','¯':'macr','♂':'male','✠':'malt','⤅':'Map','↦':'map','↥':'mapstoup','▮':'marker','⨩':'mcomma',М:'Mcy',м:'mcy','—':'mdash','∺':'mDDot',' ':'MediumSpace',ℳ:'Mscr','𝔐':'Mfr','𝔪':'mfr','℧':'mho',µ:'micro','⫰':'midcir','∣':'mid','−':'minus','⨪':'minusdu','∓':'mp','⫛':'mlcp','⊧':'models','𝕄':'Mopf','𝕞':'mopf','𝓂':'mscr',Μ:'Mu',μ:'mu','⊸':'mumap',Ń:'Nacute',ń:'nacute','∠⃒':'nang','≉':'nap','⩰̸':'napE','≋̸':'napid',ʼn:'napos','♮':'natur',ℕ:'Nopf',' ':'nbsp','≎̸':'nbump','≏̸':'nbumpe','⩃':'ncap',Ň:'Ncaron',ň:'ncaron',Ņ:'Ncedil',ņ:'ncedil','≇':'ncong','⩭̸':'ncongdot','⩂':'ncup',Н:'Ncy',н:'ncy','–':'ndash','⤤':'nearhk','↗':'nearr','⇗':'neArr','≠':'ne','≐̸':'nedot','​':'ZeroWidthSpace','≢':'nequiv','⤨':'toea','≂̸':'nesim','\n':'NewLine','∄':'nexist','𝔑':'Nfr','𝔫':'nfr','≧̸':'ngE','≱':'nge','⩾̸':'nges','⋙̸':'nGg','≵':'ngsim','≫⃒':'nGt','≯':'ngt','≫̸':'nGtv','↮':'nharr','⇎':'nhArr','⫲':'nhpar','∋':'ni','⋼':'nis','⋺':'nisd',Њ:'NJcy',њ:'njcy','↚':'nlarr','⇍':'nlArr','‥':'nldr','≦̸':'nlE','≰':'nle','⩽̸':'nles','≮':'nlt','⋘̸':'nLl','≴':'nlsim','≪⃒':'nLt','⋪':'nltri','⋬':'nltrie','≪̸':'nLtv','∤':'nmid','⁠':'NoBreak','𝕟':'nopf','⫬':'Not','¬':'not','≭':'NotCupCap','∦':'npar','∉':'notin','≹':'ntgl','⋵̸':'notindot','⋹̸':'notinE','⋷':'notinvb','⋶':'notinvc','⧏̸':'NotLeftTriangleBar','≸':'ntlg','⪢̸':'NotNestedGreaterGreater','⪡̸':'NotNestedLessLess','∌':'notni','⋾':'notnivb','⋽':'notnivc','⊀':'npr','⪯̸':'npre','⋠':'nprcue','⧐̸':'NotRightTriangleBar','⋫':'nrtri','⋭':'nrtrie','⊏̸':'NotSquareSubset','⋢':'nsqsube','⊐̸':'NotSquareSuperset','⋣':'nsqsupe','⊂⃒':'vnsub','⊈':'nsube','⊁':'nsc','⪰̸':'nsce','⋡':'nsccue','≿̸':'NotSucceedsTilde','⊃⃒':'vnsup','⊉':'nsupe','≁':'nsim','≄':'nsime','⫽⃥':'nparsl','∂̸':'npart','⨔':'npolint','⤳̸':'nrarrc','↛':'nrarr','⇏':'nrArr','↝̸':'nrarrw','𝒩':'Nscr','𝓃':'nscr','⊄':'nsub','⫅̸':'nsubE','⊅':'nsup','⫆̸':'nsupE',Ñ:'Ntilde',ñ:'ntilde',Ν:'Nu',ν:'nu','#':'num','№':'numero',' ':'numsp','≍⃒':'nvap','⊬':'nvdash','⊭':'nvDash','⊮':'nVdash','⊯':'nVDash','≥⃒':'nvge','>⃒':'nvgt','⤄':'nvHarr','⧞':'nvinfin','⤂':'nvlArr','≤⃒':'nvle','<⃒':'nvlt','⊴⃒':'nvltrie','⤃':'nvrArr','⊵⃒':'nvrtrie','∼⃒':'nvsim','⤣':'nwarhk','↖':'nwarr','⇖':'nwArr','⤧':'nwnear',Ó:'Oacute',ó:'oacute',Ô:'Ocirc',ô:'ocirc',О:'Ocy',о:'ocy',Ő:'Odblac',ő:'odblac','⨸':'odiv','⦼':'odsold',Œ:'OElig',œ:'oelig','⦿':'ofcir','𝔒':'Ofr','𝔬':'ofr','˛':'ogon',Ò:'Ograve',ò:'ograve','⧁':'ogt','⦵':'ohbar',Ω:'ohm','⦾':'olcir','⦻':'olcross','‾':'oline','⧀':'olt',Ō:'Omacr',ō:'omacr',ω:'omega',Ο:'Omicron',ο:'omicron','⦶':'omid','𝕆':'Oopf','𝕠':'oopf','⦷':'opar','⦹':'operp','⩔':'Or','∨':'or','⩝':'ord',ℴ:'oscr',ª:'ordf',º:'ordm','⊶':'origof','⩖':'oror','⩗':'orslope','⩛':'orv','𝒪':'Oscr',Ø:'Oslash',ø:'oslash','⊘':'osol',Õ:'Otilde',õ:'otilde','⨶':'otimesas','⨷':'Otimes',Ö:'Ouml',ö:'ouml','⌽':'ovbar','⏞':'OverBrace','⎴':'tbrk','⏜':'OverParenthesis','¶':'para','⫳':'parsim','⫽':'parsl','∂':'part',П:'Pcy',п:'pcy','%':'percnt','.':'period','‰':'permil','‱':'pertenk','𝔓':'Pfr','𝔭':'pfr',Φ:'Phi',φ:'phi',ϕ:'phiv','☎':'phone',Π:'Pi',π:'pi',ϖ:'piv',ℎ:'planckh','⨣':'plusacir','⨢':'pluscir','+':'plus','⨥':'plusdu','⩲':'pluse','±':'pm','⨦':'plussim','⨧':'plustwo','⨕':'pointint','𝕡':'popf',ℙ:'Popf','£':'pound','⪷':'prap','⪻':'Pr','≺':'pr','≼':'prcue','⪯':'pre','≾':'prsim','⪹':'prnap','⪵':'prnE','⋨':'prnsim','⪳':'prE','′':'prime','″':'Prime','∏':'prod','⌮':'profalar','⌒':'profline','⌓':'profsurf','∝':'prop','⊰':'prurel','𝒫':'Pscr','𝓅':'pscr',Ψ:'Psi',ψ:'psi',' ':'puncsp','𝔔':'Qfr','𝔮':'qfr','𝕢':'qopf',ℚ:'Qopf','⁗':'qprime','𝒬':'Qscr','𝓆':'qscr','⨖':'quatint','?':'quest','"':'quot','⇛':'rAarr','∽̱':'race',Ŕ:'Racute',ŕ:'racute','√':'Sqrt','⦳':'raemptyv','⟩':'rang','⟫':'Rang','⦒':'rangd','⦥':'range','»':'raquo','⥵':'rarrap','⇥':'rarrb','⤠':'rarrbfs','⤳':'rarrc','→':'rarr','↠':'Rarr','⤞':'rarrfs','⥅':'rarrpl','⥴':'rarrsim','⤖':'Rarrtl','↣':'rarrtl','↝':'rarrw','⤚':'ratail','⤜':'rAtail','∶':'ratio','❳':'rbbrk','}':'rcub',']':'rsqb','⦌':'rbrke','⦎':'rbrksld','⦐':'rbrkslu',Ř:'Rcaron',ř:'rcaron',Ŗ:'Rcedil',ŗ:'rcedil','⌉':'rceil',Р:'Rcy',р:'rcy','⤷':'rdca','⥩':'rdldhar','↳':'rdsh',ℜ:'Re',ℛ:'Rscr',ℝ:'Ropf','▭':'rect','⥽':'rfisht','⌋':'rfloor','𝔯':'rfr','⥤':'rHar','⇀':'rharu','⥬':'rharul',Ρ:'Rho',ρ:'rho',ϱ:'rhov','⇄':'rlarr','⟧':'robrk','⥝':'RightDownTeeVector','⥕':'RightDownVectorBar','⇉':'rrarr','⊢':'vdash','⥛':'RightTeeVector','⋌':'rthree','⧐':'RightTriangleBar','⊳':'vrtri','⊵':'rtrie','⥏':'RightUpDownVector','⥜':'RightUpTeeVector','⥔':'RightUpVectorBar','↾':'uharr','⥓':'RightVectorBar','˚':'ring','‏':'rlm','⎱':'rmoust','⫮':'rnmid','⟭':'roang','⇾':'roarr','⦆':'ropar','𝕣':'ropf','⨮':'roplus','⨵':'rotimes','⥰':'RoundImplies',')':'rpar','⦔':'rpargt','⨒':'rppolint','›':'rsaquo','𝓇':'rscr','↱':'rsh','⋊':'rtimes','▹':'rtri','⧎':'rtriltri','⧴':'RuleDelayed','⥨':'ruluhar','℞':'rx',Ś:'Sacute',ś:'sacute','⪸':'scap',Š:'Scaron',š:'scaron','⪼':'Sc','≻':'sc','≽':'sccue','⪰':'sce','⪴':'scE',Ş:'Scedil',ş:'scedil',Ŝ:'Scirc',ŝ:'scirc','⪺':'scnap','⪶':'scnE','⋩':'scnsim','⨓':'scpolint','≿':'scsim',С:'Scy',с:'scy','⋅':'sdot','⩦':'sdote','⇘':'seArr','§':'sect',';':'semi','⤩':'tosa','✶':'sext','𝔖':'Sfr','𝔰':'sfr','♯':'sharp',Щ:'SHCHcy',щ:'shchcy',Ш:'SHcy',ш:'shcy','↑':'uarr','­':'shy',Σ:'Sigma',σ:'sigma',ς:'sigmaf','∼':'sim','⩪':'simdot','≃':'sime','⪞':'simg','⪠':'simgE','⪝':'siml','⪟':'simlE','≆':'simne','⨤':'simplus','⥲':'simrarr','⨳':'smashp','⧤':'smeparsl','⌣':'smile','⪪':'smt','⪬':'smte','⪬︀':'smtes',Ь:'SOFTcy',ь:'softcy','⌿':'solbar','⧄':'solb','/':'sol','𝕊':'Sopf','𝕤':'sopf','♠':'spades','⊓':'sqcap','⊓︀':'sqcaps','⊔':'sqcup','⊔︀':'sqcups','⊏':'sqsub','⊑':'sqsube','⊐':'sqsup','⊒':'sqsupe','□':'squ','𝒮':'Sscr','𝓈':'sscr','⋆':'Star','☆':'star','⊂':'sub','⋐':'Sub','⪽':'subdot','⫅':'subE','⊆':'sube','⫃':'subedot','⫁':'submult','⫋':'subnE','⊊':'subne','⪿':'subplus','⥹':'subrarr','⫇':'subsim','⫕':'subsub','⫓':'subsup','∑':'sum','♪':'sung','¹':'sup1','²':'sup2','³':'sup3','⊃':'sup','⋑':'Sup','⪾':'supdot','⫘':'supdsub','⫆':'supE','⊇':'supe','⫄':'supedot','⟉':'suphsol','⫗':'suphsub','⥻':'suplarr','⫂':'supmult','⫌':'supnE','⊋':'supne','⫀':'supplus','⫈':'supsim','⫔':'supsub','⫖':'supsup','⇙':'swArr','⤪':'swnwar',ß:'szlig',' ':'Tab','⌖':'target',Τ:'Tau',τ:'tau',Ť:'Tcaron',ť:'tcaron',Ţ:'Tcedil',ţ:'tcedil',Т:'Tcy',т:'tcy','⃛':'tdot','⌕':'telrec','𝔗':'Tfr','𝔱':'tfr','∴':'there4',Θ:'Theta',θ:'theta',ϑ:'thetav','  ':'ThickSpace',' ':'thinsp',Þ:'THORN',þ:'thorn','⨱':'timesbar','×':'times','⨰':'timesd','⌶':'topbot','⫱':'topcir','𝕋':'Topf','𝕥':'topf','⫚':'topfork','‴':'tprime','™':'trade','▵':'utri','≜':'trie','◬':'tridot','⨺':'triminus','⨹':'triplus','⧍':'trisb','⨻':'tritime','⏢':'trpezium','𝒯':'Tscr','𝓉':'tscr',Ц:'TScy',ц:'tscy',Ћ:'TSHcy',ћ:'tshcy',Ŧ:'Tstrok',ŧ:'tstrok',Ú:'Uacute',ú:'uacute','↟':'Uarr','⥉':'Uarrocir',Ў:'Ubrcy',ў:'ubrcy',Ŭ:'Ubreve',ŭ:'ubreve',Û:'Ucirc',û:'ucirc',У:'Ucy',у:'ucy','⇅':'udarr',Ű:'Udblac',ű:'udblac','⥮':'udhar','⥾':'ufisht','𝔘':'Ufr','𝔲':'ufr',Ù:'Ugrave',ù:'ugrave','⥣':'uHar','▀':'uhblk','⌜':'ulcorn','⌏':'ulcrop','◸':'ultri',Ū:'Umacr',ū:'umacr','⏟':'UnderBrace','⏝':'UnderParenthesis','⊎':'uplus',Ų:'Uogon',ų:'uogon','𝕌':'Uopf','𝕦':'uopf','⤒':'UpArrowBar','↕':'varr',υ:'upsi',ϒ:'Upsi',Υ:'Upsilon','⇈':'uuarr','⌝':'urcorn','⌎':'urcrop',Ů:'Uring',ů:'uring','◹':'urtri','𝒰':'Uscr','𝓊':'uscr','⋰':'utdot',Ũ:'Utilde',ũ:'utilde',Ü:'Uuml',ü:'uuml','⦧':'uwangle','⦜':'vangrt','⊊︀':'vsubne','⫋︀':'vsubnE','⊋︀':'vsupne','⫌︀':'vsupnE','⫨':'vBar','⫫':'Vbar','⫩':'vBarv',В:'Vcy',в:'vcy','⊩':'Vdash','⊫':'VDash','⫦':'Vdashl','⊻':'veebar','≚':'veeeq','⋮':'vellip','|':'vert','‖':'Vert','❘':'VerticalSeparator','≀':'wr','𝔙':'Vfr','𝔳':'vfr','𝕍':'Vopf','𝕧':'vopf','𝒱':'Vscr','𝓋':'vscr','⊪':'Vvdash','⦚':'vzigzag',Ŵ:'Wcirc',ŵ:'wcirc','⩟':'wedbar','≙':'wedgeq','℘':'wp','𝔚':'Wfr','𝔴':'wfr','𝕎':'Wopf','𝕨':'wopf','𝒲':'Wscr','𝓌':'wscr','𝔛':'Xfr','𝔵':'xfr',Ξ:'Xi',ξ:'xi','⋻':'xnis','𝕏':'Xopf','𝕩':'xopf','𝒳':'Xscr','𝓍':'xscr',Ý:'Yacute',ý:'yacute',Я:'YAcy',я:'yacy',Ŷ:'Ycirc',ŷ:'ycirc',Ы:'Ycy',ы:'ycy','¥':'yen','𝔜':'Yfr','𝔶':'yfr',Ї:'YIcy',ї:'yicy','𝕐':'Yopf','𝕪':'yopf','𝒴':'Yscr','𝓎':'yscr',Ю:'YUcy',ю:'yucy',ÿ:'yuml',Ÿ:'Yuml',Ź:'Zacute',ź:'zacute',Ž:'Zcaron',ž:'zcaron',З:'Zcy',з:'zcy',Ż:'Zdot',ż:'zdot',ℨ:'Zfr',Ζ:'Zeta',ζ:'zeta','𝔷':'zfr',Ж:'ZHcy',ж:'zhcy','⇝':'zigrarr','𝕫':'zopf','𝒵':'Zscr','𝓏':'zscr','‍':'zwj','‌':'zwnj'},o=/["&'<>`]/g,C={'"':'"','&':'&',"'":''','<':'<','>':'>','`':'`'},D=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,E=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,F=/&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+);|&(Aacute|iacute|Uacute|plusmn|otilde|Otilde|Agrave|agrave|yacute|Yacute|oslash|Oslash|Atilde|atilde|brvbar|Ccedil|ccedil|ograve|curren|divide|Eacute|eacute|Ograve|oacute|Egrave|egrave|ugrave|frac12|frac14|frac34|Ugrave|Oacute|Iacute|ntilde|Ntilde|uacute|middot|Igrave|igrave|iquest|aacute|laquo|THORN|micro|iexcl|icirc|Icirc|Acirc|ucirc|ecirc|Ocirc|ocirc|Ecirc|Ucirc|aring|Aring|aelig|AElig|acute|pound|raquo|acirc|times|thorn|szlig|cedil|COPY|Auml|ordf|ordm|uuml|macr|Uuml|auml|Ouml|ouml|para|nbsp|Euml|quot|QUOT|euml|yuml|cent|sect|copy|sup1|sup2|sup3|Iuml|iuml|shy|eth|reg|not|yen|amp|AMP|REG|uml|ETH|deg|gt|GT|LT|lt)([=a-zA-Z0-9])?/g,s={Aacute:'Á',aacute:'á',Abreve:'Ă',abreve:'ă',ac:'∾',acd:'∿',acE:'∾̳',Acirc:'Â',acirc:'â',acute:'´',Acy:'А',acy:'а',AElig:'Æ',aelig:'æ',af:'⁡',Afr:'𝔄',afr:'𝔞',Agrave:'À',agrave:'à',alefsym:'ℵ',aleph:'ℵ',Alpha:'Α',alpha:'α',Amacr:'Ā',amacr:'ā',amalg:'⨿',amp:'&',AMP:'&',andand:'⩕',And:'⩓',and:'∧',andd:'⩜',andslope:'⩘',andv:'⩚',ang:'∠',ange:'⦤',angle:'∠',angmsdaa:'⦨',angmsdab:'⦩',angmsdac:'⦪',angmsdad:'⦫',angmsdae:'⦬',angmsdaf:'⦭',angmsdag:'⦮',angmsdah:'⦯',angmsd:'∡',angrt:'∟',angrtvb:'⊾',angrtvbd:'⦝',angsph:'∢',angst:'Å',angzarr:'⍼',Aogon:'Ą',aogon:'ą',Aopf:'𝔸',aopf:'𝕒',apacir:'⩯',ap:'≈',apE:'⩰',ape:'≊',apid:'≋',apos:"'",ApplyFunction:'⁡',approx:'≈',approxeq:'≊',Aring:'Å',aring:'å',Ascr:'𝒜',ascr:'𝒶',Assign:'≔',ast:'*',asymp:'≈',asympeq:'≍',Atilde:'Ã',atilde:'ã',Auml:'Ä',auml:'ä',awconint:'∳',awint:'⨑',backcong:'≌',backepsilon:'϶',backprime:'‵',backsim:'∽',backsimeq:'⋍',Backslash:'∖',Barv:'⫧',barvee:'⊽',barwed:'⌅',Barwed:'⌆',barwedge:'⌅',bbrk:'⎵',bbrktbrk:'⎶',bcong:'≌',Bcy:'Б',bcy:'б',bdquo:'„',becaus:'∵',because:'∵',Because:'∵',bemptyv:'⦰',bepsi:'϶',bernou:'ℬ',Bernoullis:'ℬ',Beta:'Β',beta:'β',beth:'ℶ',between:'≬',Bfr:'𝔅',bfr:'𝔟',bigcap:'⋂',bigcirc:'◯',bigcup:'⋃',bigodot:'⨀',bigoplus:'⨁',bigotimes:'⨂',bigsqcup:'⨆',bigstar:'★',bigtriangledown:'▽',bigtriangleup:'△',biguplus:'⨄',bigvee:'⋁',bigwedge:'⋀',bkarow:'⤍',blacklozenge:'⧫',blacksquare:'▪',blacktriangle:'▴',blacktriangledown:'▾',blacktriangleleft:'◂',blacktriangleright:'▸',blank:'␣',blk12:'▒',blk14:'░',blk34:'▓',block:'█',bne:'=⃥',bnequiv:'≡⃥',bNot:'⫭',bnot:'⌐',Bopf:'𝔹',bopf:'𝕓',bot:'⊥',bottom:'⊥',bowtie:'⋈',boxbox:'⧉',boxdl:'┐',boxdL:'╕',boxDl:'╖',boxDL:'╗',boxdr:'┌',boxdR:'╒',boxDr:'╓',boxDR:'╔',boxh:'─',boxH:'═',boxhd:'┬',boxHd:'╤',boxhD:'╥',boxHD:'╦',boxhu:'┴',boxHu:'╧',boxhU:'╨',boxHU:'╩',boxminus:'⊟',boxplus:'⊞',boxtimes:'⊠',boxul:'┘',boxuL:'╛',boxUl:'╜',boxUL:'╝',boxur:'└',boxuR:'╘',boxUr:'╙',boxUR:'╚',boxv:'│',boxV:'║',boxvh:'┼',boxvH:'╪',boxVh:'╫',boxVH:'╬',boxvl:'┤',boxvL:'╡',boxVl:'╢',boxVL:'╣',boxvr:'├',boxvR:'╞',boxVr:'╟',boxVR:'╠',bprime:'‵',breve:'˘',Breve:'˘',brvbar:'¦',bscr:'𝒷',Bscr:'ℬ',bsemi:'⁏',bsim:'∽',bsime:'⋍',bsolb:'⧅',bsol:'\\',bsolhsub:'⟈',bull:'•',bullet:'•',bump:'≎',bumpE:'⪮',bumpe:'≏',Bumpeq:'≎',bumpeq:'≏',Cacute:'Ć',cacute:'ć',capand:'⩄',capbrcup:'⩉',capcap:'⩋',cap:'∩',Cap:'⋒',capcup:'⩇',capdot:'⩀',CapitalDifferentialD:'ⅅ',caps:'∩︀',caret:'⁁',caron:'ˇ',Cayleys:'ℭ',ccaps:'⩍',Ccaron:'Č',ccaron:'č',Ccedil:'Ç',ccedil:'ç',Ccirc:'Ĉ',ccirc:'ĉ',Cconint:'∰',ccups:'⩌',ccupssm:'⩐',Cdot:'Ċ',cdot:'ċ',cedil:'¸',Cedilla:'¸',cemptyv:'⦲',cent:'¢',centerdot:'·',CenterDot:'·',cfr:'𝔠',Cfr:'ℭ',CHcy:'Ч',chcy:'ч',check:'✓',checkmark:'✓',Chi:'Χ',chi:'χ',circ:'ˆ',circeq:'≗',circlearrowleft:'↺',circlearrowright:'↻',circledast:'⊛',circledcirc:'⊚',circleddash:'⊝',CircleDot:'⊙',circledR:'®',circledS:'Ⓢ',CircleMinus:'⊖',CirclePlus:'⊕',CircleTimes:'⊗',cir:'○',cirE:'⧃',cire:'≗',cirfnint:'⨐',cirmid:'⫯',cirscir:'⧂',ClockwiseContourIntegral:'∲',CloseCurlyDoubleQuote:'”',CloseCurlyQuote:'’',clubs:'♣',clubsuit:'♣',colon:':',Colon:'∷',Colone:'⩴',colone:'≔',coloneq:'≔',comma:',',commat:'@',comp:'∁',compfn:'∘',complement:'∁',complexes:'ℂ',cong:'≅',congdot:'⩭',Congruent:'≡',conint:'∮',Conint:'∯',ContourIntegral:'∮',copf:'𝕔',Copf:'ℂ',coprod:'∐',Coproduct:'∐',copy:'©',COPY:'©',copysr:'℗',CounterClockwiseContourIntegral:'∳',crarr:'↵',cross:'✗',Cross:'⨯',Cscr:'𝒞',cscr:'𝒸',csub:'⫏',csube:'⫑',csup:'⫐',csupe:'⫒',ctdot:'⋯',cudarrl:'⤸',cudarrr:'⤵',cuepr:'⋞',cuesc:'⋟',cularr:'↶',cularrp:'⤽',cupbrcap:'⩈',cupcap:'⩆',CupCap:'≍',cup:'∪',Cup:'⋓',cupcup:'⩊',cupdot:'⊍',cupor:'⩅',cups:'∪︀',curarr:'↷',curarrm:'⤼',curlyeqprec:'⋞',curlyeqsucc:'⋟',curlyvee:'⋎',curlywedge:'⋏',curren:'¤',curvearrowleft:'↶',curvearrowright:'↷',cuvee:'⋎',cuwed:'⋏',cwconint:'∲',cwint:'∱',cylcty:'⌭',dagger:'†',Dagger:'‡',daleth:'ℸ',darr:'↓',Darr:'↡',dArr:'⇓',dash:'‐',Dashv:'⫤',dashv:'⊣',dbkarow:'⤏',dblac:'˝',Dcaron:'Ď',dcaron:'ď',Dcy:'Д',dcy:'д',ddagger:'‡',ddarr:'⇊',DD:'ⅅ',dd:'ⅆ',DDotrahd:'⤑',ddotseq:'⩷',deg:'°',Del:'∇',Delta:'Δ',delta:'δ',demptyv:'⦱',dfisht:'⥿',Dfr:'𝔇',dfr:'𝔡',dHar:'⥥',dharl:'⇃',dharr:'⇂',DiacriticalAcute:'´',DiacriticalDot:'˙',DiacriticalDoubleAcute:'˝',DiacriticalGrave:'`',DiacriticalTilde:'˜',diam:'⋄',diamond:'⋄',Diamond:'⋄',diamondsuit:'♦',diams:'♦',die:'¨',DifferentialD:'ⅆ',digamma:'ϝ',disin:'⋲',div:'÷',divide:'÷',divideontimes:'⋇',divonx:'⋇',DJcy:'Ђ',djcy:'ђ',dlcorn:'⌞',dlcrop:'⌍',dollar:'$',Dopf:'𝔻',dopf:'𝕕',Dot:'¨',dot:'˙',DotDot:'⃜',doteq:'≐',doteqdot:'≑',DotEqual:'≐',dotminus:'∸',dotplus:'∔',dotsquare:'⊡',doublebarwedge:'⌆',DoubleContourIntegral:'∯',DoubleDot:'¨',DoubleDownArrow:'⇓',DoubleLeftArrow:'⇐',DoubleLeftRightArrow:'⇔',DoubleLeftTee:'⫤',DoubleLongLeftArrow:'⟸',DoubleLongLeftRightArrow:'⟺',DoubleLongRightArrow:'⟹',DoubleRightArrow:'⇒',DoubleRightTee:'⊨',DoubleUpArrow:'⇑',DoubleUpDownArrow:'⇕',DoubleVerticalBar:'∥',DownArrowBar:'⤓',downarrow:'↓',DownArrow:'↓',Downarrow:'⇓',DownArrowUpArrow:'⇵',DownBreve:'̑',downdownarrows:'⇊',downharpoonleft:'⇃',downharpoonright:'⇂',DownLeftRightVector:'⥐',DownLeftTeeVector:'⥞',DownLeftVectorBar:'⥖',DownLeftVector:'↽',DownRightTeeVector:'⥟',DownRightVectorBar:'⥗',DownRightVector:'⇁',DownTeeArrow:'↧',DownTee:'⊤',drbkarow:'⤐',drcorn:'⌟',drcrop:'⌌',Dscr:'𝒟',dscr:'𝒹',DScy:'Ѕ',dscy:'ѕ',dsol:'⧶',Dstrok:'Đ',dstrok:'đ',dtdot:'⋱',dtri:'▿',dtrif:'▾',duarr:'⇵',duhar:'⥯',dwangle:'⦦',DZcy:'Џ',dzcy:'џ',dzigrarr:'⟿',Eacute:'É',eacute:'é',easter:'⩮',Ecaron:'Ě',ecaron:'ě',Ecirc:'Ê',ecirc:'ê',ecir:'≖',ecolon:'≕',Ecy:'Э',ecy:'э',eDDot:'⩷',Edot:'Ė',edot:'ė',eDot:'≑',ee:'ⅇ',efDot:'≒',Efr:'𝔈',efr:'𝔢',eg:'⪚',Egrave:'È',egrave:'è',egs:'⪖',egsdot:'⪘',el:'⪙',Element:'∈',elinters:'⏧',ell:'ℓ',els:'⪕',elsdot:'⪗',Emacr:'Ē',emacr:'ē',empty:'∅',emptyset:'∅',EmptySmallSquare:'◻',emptyv:'∅',EmptyVerySmallSquare:'▫',emsp13:' ',emsp14:' ',emsp:' ',ENG:'Ŋ',eng:'ŋ',ensp:' ',Eogon:'Ę',eogon:'ę',Eopf:'𝔼',eopf:'𝕖',epar:'⋕',eparsl:'⧣',eplus:'⩱',epsi:'ε',Epsilon:'Ε',epsilon:'ε',epsiv:'ϵ',eqcirc:'≖',eqcolon:'≕',eqsim:'≂',eqslantgtr:'⪖',eqslantless:'⪕',Equal:'⩵',equals:'=',EqualTilde:'≂',equest:'≟',Equilibrium:'⇌',equiv:'≡',equivDD:'⩸',eqvparsl:'⧥',erarr:'⥱',erDot:'≓',escr:'ℯ',Escr:'ℰ',esdot:'≐',Esim:'⩳',esim:'≂',Eta:'Η',eta:'η',ETH:'Ð',eth:'ð',Euml:'Ë',euml:'ë',euro:'€',excl:'!',exist:'∃',Exists:'∃',expectation:'ℰ',exponentiale:'ⅇ',ExponentialE:'ⅇ',fallingdotseq:'≒',Fcy:'Ф',fcy:'ф',female:'♀',ffilig:'ffi',fflig:'ff',ffllig:'ffl',Ffr:'𝔉',ffr:'𝔣',filig:'fi',FilledSmallSquare:'◼',FilledVerySmallSquare:'▪',fjlig:'fj',flat:'♭',fllig:'fl',fltns:'▱',fnof:'ƒ',Fopf:'𝔽',fopf:'𝕗',forall:'∀',ForAll:'∀',fork:'⋔',forkv:'⫙',Fouriertrf:'ℱ',fpartint:'⨍',frac12:'½',frac13:'⅓',frac14:'¼',frac15:'⅕',frac16:'⅙',frac18:'⅛',frac23:'⅔',frac25:'⅖',frac34:'¾',frac35:'⅗',frac38:'⅜',frac45:'⅘',frac56:'⅚',frac58:'⅝',frac78:'⅞',frasl:'⁄',frown:'⌢',fscr:'𝒻',Fscr:'ℱ',gacute:'ǵ',Gamma:'Γ',gamma:'γ',Gammad:'Ϝ',gammad:'ϝ',gap:'⪆',Gbreve:'Ğ',gbreve:'ğ',Gcedil:'Ģ',Gcirc:'Ĝ',gcirc:'ĝ',Gcy:'Г',gcy:'г',Gdot:'Ġ',gdot:'ġ',ge:'≥',gE:'≧',gEl:'⪌',gel:'⋛',geq:'≥',geqq:'≧',geqslant:'⩾',gescc:'⪩',ges:'⩾',gesdot:'⪀',gesdoto:'⪂',gesdotol:'⪄',gesl:'⋛︀',gesles:'⪔',Gfr:'𝔊',gfr:'𝔤',gg:'≫',Gg:'⋙',ggg:'⋙',gimel:'ℷ',GJcy:'Ѓ',gjcy:'ѓ',gla:'⪥',gl:'≷',glE:'⪒',glj:'⪤',gnap:'⪊',gnapprox:'⪊',gne:'⪈',gnE:'≩',gneq:'⪈',gneqq:'≩',gnsim:'⋧',Gopf:'𝔾',gopf:'𝕘',grave:'`',GreaterEqual:'≥',GreaterEqualLess:'⋛',GreaterFullEqual:'≧',GreaterGreater:'⪢',GreaterLess:'≷',GreaterSlantEqual:'⩾',GreaterTilde:'≳',Gscr:'𝒢',gscr:'ℊ',gsim:'≳',gsime:'⪎',gsiml:'⪐',gtcc:'⪧',gtcir:'⩺',gt:'>',GT:'>',Gt:'≫',gtdot:'⋗',gtlPar:'⦕',gtquest:'⩼',gtrapprox:'⪆',gtrarr:'⥸',gtrdot:'⋗',gtreqless:'⋛',gtreqqless:'⪌',gtrless:'≷',gtrsim:'≳',gvertneqq:'≩︀',gvnE:'≩︀',Hacek:'ˇ',hairsp:' ',half:'½',hamilt:'ℋ',HARDcy:'Ъ',hardcy:'ъ',harrcir:'⥈',harr:'↔',hArr:'⇔',harrw:'↭',Hat:'^',hbar:'ℏ',Hcirc:'Ĥ',hcirc:'ĥ',hearts:'♥',heartsuit:'♥',hellip:'…',hercon:'⊹',hfr:'𝔥',Hfr:'ℌ',HilbertSpace:'ℋ',hksearow:'⤥',hkswarow:'⤦',hoarr:'⇿',homtht:'∻',hookleftarrow:'↩',hookrightarrow:'↪',hopf:'𝕙',Hopf:'ℍ',horbar:'―',HorizontalLine:'─',hscr:'𝒽',Hscr:'ℋ',hslash:'ℏ',Hstrok:'Ħ',hstrok:'ħ',HumpDownHump:'≎',HumpEqual:'≏',hybull:'⁃',hyphen:'‐',Iacute:'Í',iacute:'í',ic:'⁣',Icirc:'Î',icirc:'î',Icy:'И',icy:'и',Idot:'İ',IEcy:'Е',iecy:'е',iexcl:'¡',iff:'⇔',ifr:'𝔦',Ifr:'ℑ',Igrave:'Ì',igrave:'ì',ii:'ⅈ',iiiint:'⨌',iiint:'∭',iinfin:'⧜',iiota:'℩',IJlig:'IJ',ijlig:'ij',Imacr:'Ī',imacr:'ī',image:'ℑ',ImaginaryI:'ⅈ',imagline:'ℐ',imagpart:'ℑ',imath:'ı',Im:'ℑ',imof:'⊷',imped:'Ƶ',Implies:'⇒',incare:'℅','in':'∈',infin:'∞',infintie:'⧝',inodot:'ı',intcal:'⊺',int:'∫',Int:'∬',integers:'ℤ',Integral:'∫',intercal:'⊺',Intersection:'⋂',intlarhk:'⨗',intprod:'⨼',InvisibleComma:'⁣',InvisibleTimes:'⁢',IOcy:'Ё',iocy:'ё',Iogon:'Į',iogon:'į',Iopf:'𝕀',iopf:'𝕚',Iota:'Ι',iota:'ι',iprod:'⨼',iquest:'¿',iscr:'𝒾',Iscr:'ℐ',isin:'∈',isindot:'⋵',isinE:'⋹',isins:'⋴',isinsv:'⋳',isinv:'∈',it:'⁢',Itilde:'Ĩ',itilde:'ĩ',Iukcy:'І',iukcy:'і',Iuml:'Ï',iuml:'ï',Jcirc:'Ĵ',jcirc:'ĵ',Jcy:'Й',jcy:'й',Jfr:'𝔍',jfr:'𝔧',jmath:'ȷ',Jopf:'𝕁',jopf:'𝕛',Jscr:'𝒥',jscr:'𝒿',Jsercy:'Ј',jsercy:'ј',Jukcy:'Є',jukcy:'є',Kappa:'Κ',kappa:'κ',kappav:'ϰ',Kcedil:'Ķ',kcedil:'ķ',Kcy:'К',kcy:'к',Kfr:'𝔎',kfr:'𝔨',kgreen:'ĸ',KHcy:'Х',khcy:'х',KJcy:'Ќ',kjcy:'ќ',Kopf:'𝕂',kopf:'𝕜',Kscr:'𝒦',kscr:'𝓀',lAarr:'⇚',Lacute:'Ĺ',lacute:'ĺ',laemptyv:'⦴',lagran:'ℒ',Lambda:'Λ',lambda:'λ',lang:'⟨',Lang:'⟪',langd:'⦑',langle:'⟨',lap:'⪅',Laplacetrf:'ℒ',laquo:'«',larrb:'⇤',larrbfs:'⤟',larr:'←',Larr:'↞',lArr:'⇐',larrfs:'⤝',larrhk:'↩',larrlp:'↫',larrpl:'⤹',larrsim:'⥳',larrtl:'↢',latail:'⤙',lAtail:'⤛',lat:'⪫',late:'⪭',lates:'⪭︀',lbarr:'⤌',lBarr:'⤎',lbbrk:'❲',lbrace:'{',lbrack:'[',lbrke:'⦋',lbrksld:'⦏',lbrkslu:'⦍',Lcaron:'Ľ',lcaron:'ľ',Lcedil:'Ļ',lcedil:'ļ',lceil:'⌈',lcub:'{',Lcy:'Л',lcy:'л',ldca:'⤶',ldquo:'“',ldquor:'„',ldrdhar:'⥧',ldrushar:'⥋',ldsh:'↲',le:'≤',lE:'≦',LeftAngleBracket:'⟨',LeftArrowBar:'⇤',leftarrow:'←',LeftArrow:'←',Leftarrow:'⇐',LeftArrowRightArrow:'⇆',leftarrowtail:'↢',LeftCeiling:'⌈',LeftDoubleBracket:'⟦',LeftDownTeeVector:'⥡',LeftDownVectorBar:'⥙',LeftDownVector:'⇃',LeftFloor:'⌊',leftharpoondown:'↽',leftharpoonup:'↼',leftleftarrows:'⇇',leftrightarrow:'↔',LeftRightArrow:'↔',Leftrightarrow:'⇔',leftrightarrows:'⇆',leftrightharpoons:'⇋',leftrightsquigarrow:'↭',LeftRightVector:'⥎',LeftTeeArrow:'↤',LeftTee:'⊣',LeftTeeVector:'⥚',leftthreetimes:'⋋',LeftTriangleBar:'⧏',LeftTriangle:'⊲',LeftTriangleEqual:'⊴',LeftUpDownVector:'⥑',LeftUpTeeVector:'⥠',LeftUpVectorBar:'⥘',LeftUpVector:'↿',LeftVectorBar:'⥒',LeftVector:'↼',lEg:'⪋',leg:'⋚',leq:'≤',leqq:'≦',leqslant:'⩽',lescc:'⪨',les:'⩽',lesdot:'⩿',lesdoto:'⪁',lesdotor:'⪃',lesg:'⋚︀',lesges:'⪓',lessapprox:'⪅',lessdot:'⋖',lesseqgtr:'⋚',lesseqqgtr:'⪋',LessEqualGreater:'⋚',LessFullEqual:'≦',LessGreater:'≶',lessgtr:'≶',LessLess:'⪡',lesssim:'≲',LessSlantEqual:'⩽',LessTilde:'≲',lfisht:'⥼',lfloor:'⌊',Lfr:'𝔏',lfr:'𝔩',lg:'≶',lgE:'⪑',lHar:'⥢',lhard:'↽',lharu:'↼',lharul:'⥪',lhblk:'▄',LJcy:'Љ',ljcy:'љ',llarr:'⇇',ll:'≪',Ll:'⋘',llcorner:'⌞',Lleftarrow:'⇚',llhard:'⥫',lltri:'◺',Lmidot:'Ŀ',lmidot:'ŀ',lmoustache:'⎰',lmoust:'⎰',lnap:'⪉',lnapprox:'⪉',lne:'⪇',lnE:'≨',lneq:'⪇',lneqq:'≨',lnsim:'⋦',loang:'⟬',loarr:'⇽',lobrk:'⟦',longleftarrow:'⟵',LongLeftArrow:'⟵',Longleftarrow:'⟸',longleftrightarrow:'⟷',LongLeftRightArrow:'⟷',Longleftrightarrow:'⟺',longmapsto:'⟼',longrightarrow:'⟶',LongRightArrow:'⟶',Longrightarrow:'⟹',looparrowleft:'↫',looparrowright:'↬',lopar:'⦅',Lopf:'𝕃',lopf:'𝕝',loplus:'⨭',lotimes:'⨴',lowast:'∗',lowbar:'_',LowerLeftArrow:'↙',LowerRightArrow:'↘',loz:'◊',lozenge:'◊',lozf:'⧫',lpar:'(',lparlt:'⦓',lrarr:'⇆',lrcorner:'⌟',lrhar:'⇋',lrhard:'⥭',lrm:'‎',lrtri:'⊿',lsaquo:'‹',lscr:'𝓁',Lscr:'ℒ',lsh:'↰',Lsh:'↰',lsim:'≲',lsime:'⪍',lsimg:'⪏',lsqb:'[',lsquo:'‘',lsquor:'‚',Lstrok:'Ł',lstrok:'ł',ltcc:'⪦',ltcir:'⩹',lt:'<',LT:'<',Lt:'≪',ltdot:'⋖',lthree:'⋋',ltimes:'⋉',ltlarr:'⥶',ltquest:'⩻',ltri:'◃',ltrie:'⊴',ltrif:'◂',ltrPar:'⦖',lurdshar:'⥊',luruhar:'⥦',lvertneqq:'≨︀',lvnE:'≨︀',macr:'¯',male:'♂',malt:'✠',maltese:'✠',Map:'⤅',map:'↦',mapsto:'↦',mapstodown:'↧',mapstoleft:'↤',mapstoup:'↥',marker:'▮',mcomma:'⨩',Mcy:'М',mcy:'м',mdash:'—',mDDot:'∺',measuredangle:'∡',MediumSpace:' ',Mellintrf:'ℳ',Mfr:'𝔐',mfr:'𝔪',mho:'℧',micro:'µ',midast:'*',midcir:'⫰',mid:'∣',middot:'·',minusb:'⊟',minus:'−',minusd:'∸',minusdu:'⨪',MinusPlus:'∓',mlcp:'⫛',mldr:'…',mnplus:'∓',models:'⊧',Mopf:'𝕄',mopf:'𝕞',mp:'∓',mscr:'𝓂',Mscr:'ℳ',mstpos:'∾',Mu:'Μ',mu:'μ',multimap:'⊸',mumap:'⊸',nabla:'∇',Nacute:'Ń',nacute:'ń',nang:'∠⃒',nap:'≉',napE:'⩰̸',napid:'≋̸',napos:'ʼn',napprox:'≉',natural:'♮',naturals:'ℕ',natur:'♮',nbsp:' ',nbump:'≎̸',nbumpe:'≏̸',ncap:'⩃',Ncaron:'Ň',ncaron:'ň',Ncedil:'Ņ',ncedil:'ņ',ncong:'≇',ncongdot:'⩭̸',ncup:'⩂',Ncy:'Н',ncy:'н',ndash:'–',nearhk:'⤤',nearr:'↗',neArr:'⇗',nearrow:'↗',ne:'≠',nedot:'≐̸',NegativeMediumSpace:'​',NegativeThickSpace:'​',NegativeThinSpace:'​',NegativeVeryThinSpace:'​',nequiv:'≢',nesear:'⤨',nesim:'≂̸',NestedGreaterGreater:'≫',NestedLessLess:'≪',NewLine:'\n',nexist:'∄',nexists:'∄',Nfr:'𝔑',nfr:'𝔫',ngE:'≧̸',nge:'≱',ngeq:'≱',ngeqq:'≧̸',ngeqslant:'⩾̸',nges:'⩾̸',nGg:'⋙̸',ngsim:'≵',nGt:'≫⃒',ngt:'≯',ngtr:'≯',nGtv:'≫̸',nharr:'↮',nhArr:'⇎',nhpar:'⫲',ni:'∋',nis:'⋼',nisd:'⋺',niv:'∋',NJcy:'Њ',njcy:'њ',nlarr:'↚',nlArr:'⇍',nldr:'‥',nlE:'≦̸',nle:'≰',nleftarrow:'↚',nLeftarrow:'⇍',nleftrightarrow:'↮',nLeftrightarrow:'⇎',nleq:'≰',nleqq:'≦̸',nleqslant:'⩽̸',nles:'⩽̸',nless:'≮',nLl:'⋘̸',nlsim:'≴',nLt:'≪⃒',nlt:'≮',nltri:'⋪',nltrie:'⋬',nLtv:'≪̸',nmid:'∤',NoBreak:'⁠',NonBreakingSpace:' ',nopf:'𝕟',Nopf:'ℕ',Not:'⫬',not:'¬',NotCongruent:'≢',NotCupCap:'≭',NotDoubleVerticalBar:'∦',NotElement:'∉',NotEqual:'≠',NotEqualTilde:'≂̸',NotExists:'∄',NotGreater:'≯',NotGreaterEqual:'≱',NotGreaterFullEqual:'≧̸',NotGreaterGreater:'≫̸',NotGreaterLess:'≹',NotGreaterSlantEqual:'⩾̸',NotGreaterTilde:'≵',NotHumpDownHump:'≎̸',NotHumpEqual:'≏̸',notin:'∉',notindot:'⋵̸',notinE:'⋹̸',notinva:'∉',notinvb:'⋷',notinvc:'⋶',NotLeftTriangleBar:'⧏̸',NotLeftTriangle:'⋪',NotLeftTriangleEqual:'⋬',NotLess:'≮',NotLessEqual:'≰',NotLessGreater:'≸',NotLessLess:'≪̸',NotLessSlantEqual:'⩽̸',NotLessTilde:'≴',NotNestedGreaterGreater:'⪢̸',NotNestedLessLess:'⪡̸',notni:'∌',notniva:'∌',notnivb:'⋾',notnivc:'⋽',NotPrecedes:'⊀',NotPrecedesEqual:'⪯̸',NotPrecedesSlantEqual:'⋠',NotReverseElement:'∌',NotRightTriangleBar:'⧐̸',NotRightTriangle:'⋫',NotRightTriangleEqual:'⋭',NotSquareSubset:'⊏̸',NotSquareSubsetEqual:'⋢',NotSquareSuperset:'⊐̸',NotSquareSupersetEqual:'⋣',NotSubset:'⊂⃒',NotSubsetEqual:'⊈',NotSucceeds:'⊁',NotSucceedsEqual:'⪰̸',NotSucceedsSlantEqual:'⋡',NotSucceedsTilde:'≿̸',NotSuperset:'⊃⃒',NotSupersetEqual:'⊉',NotTilde:'≁',NotTildeEqual:'≄',NotTildeFullEqual:'≇',NotTildeTilde:'≉',NotVerticalBar:'∤',nparallel:'∦',npar:'∦',nparsl:'⫽⃥',npart:'∂̸',npolint:'⨔',npr:'⊀',nprcue:'⋠',nprec:'⊀',npreceq:'⪯̸',npre:'⪯̸',nrarrc:'⤳̸',nrarr:'↛',nrArr:'⇏',nrarrw:'↝̸',nrightarrow:'↛',nRightarrow:'⇏',nrtri:'⋫',nrtrie:'⋭',nsc:'⊁',nsccue:'⋡',nsce:'⪰̸',Nscr:'𝒩',nscr:'𝓃',nshortmid:'∤',nshortparallel:'∦',nsim:'≁',nsime:'≄',nsimeq:'≄',nsmid:'∤',nspar:'∦',nsqsube:'⋢',nsqsupe:'⋣',nsub:'⊄',nsubE:'⫅̸',nsube:'⊈',nsubset:'⊂⃒',nsubseteq:'⊈',nsubseteqq:'⫅̸',nsucc:'⊁',nsucceq:'⪰̸',nsup:'⊅',nsupE:'⫆̸',nsupe:'⊉',nsupset:'⊃⃒',nsupseteq:'⊉',nsupseteqq:'⫆̸',ntgl:'≹',Ntilde:'Ñ',ntilde:'ñ',ntlg:'≸',ntriangleleft:'⋪',ntrianglelefteq:'⋬',ntriangleright:'⋫',ntrianglerighteq:'⋭',Nu:'Ν',nu:'ν',num:'#',numero:'№',numsp:' ',nvap:'≍⃒',nvdash:'⊬',nvDash:'⊭',nVdash:'⊮',nVDash:'⊯',nvge:'≥⃒',nvgt:'>⃒',nvHarr:'⤄',nvinfin:'⧞',nvlArr:'⤂',nvle:'≤⃒',nvlt:'<⃒',nvltrie:'⊴⃒',nvrArr:'⤃',nvrtrie:'⊵⃒',nvsim:'∼⃒',nwarhk:'⤣',nwarr:'↖',nwArr:'⇖',nwarrow:'↖',nwnear:'⤧',Oacute:'Ó',oacute:'ó',oast:'⊛',Ocirc:'Ô',ocirc:'ô',ocir:'⊚',Ocy:'О',ocy:'о',odash:'⊝',Odblac:'Ő',odblac:'ő',odiv:'⨸',odot:'⊙',odsold:'⦼',OElig:'Œ',oelig:'œ',ofcir:'⦿',Ofr:'𝔒',ofr:'𝔬',ogon:'˛',Ograve:'Ò',ograve:'ò',ogt:'⧁',ohbar:'⦵',ohm:'Ω',oint:'∮',olarr:'↺',olcir:'⦾',olcross:'⦻',oline:'‾',olt:'⧀',Omacr:'Ō',omacr:'ō',Omega:'Ω',omega:'ω',Omicron:'Ο',omicron:'ο',omid:'⦶',ominus:'⊖',Oopf:'𝕆',oopf:'𝕠',opar:'⦷',OpenCurlyDoubleQuote:'“',OpenCurlyQuote:'‘',operp:'⦹',oplus:'⊕',orarr:'↻',Or:'⩔',or:'∨',ord:'⩝',order:'ℴ',orderof:'ℴ',ordf:'ª',ordm:'º',origof:'⊶',oror:'⩖',orslope:'⩗',orv:'⩛',oS:'Ⓢ',Oscr:'𝒪',oscr:'ℴ',Oslash:'Ø',oslash:'ø',osol:'⊘',Otilde:'Õ',otilde:'õ',otimesas:'⨶',Otimes:'⨷',otimes:'⊗',Ouml:'Ö',ouml:'ö',ovbar:'⌽',OverBar:'‾',OverBrace:'⏞',OverBracket:'⎴',OverParenthesis:'⏜',para:'¶',parallel:'∥',par:'∥',parsim:'⫳',parsl:'⫽',part:'∂',PartialD:'∂',Pcy:'П',pcy:'п',percnt:'%',period:'.',permil:'‰',perp:'⊥',pertenk:'‱',Pfr:'𝔓',pfr:'𝔭',Phi:'Φ',phi:'φ',phiv:'ϕ',phmmat:'ℳ',phone:'☎',Pi:'Π',pi:'π',pitchfork:'⋔',piv:'ϖ',planck:'ℏ',planckh:'ℎ',plankv:'ℏ',plusacir:'⨣',plusb:'⊞',pluscir:'⨢',plus:'+',plusdo:'∔',plusdu:'⨥',pluse:'⩲',PlusMinus:'±',plusmn:'±',plussim:'⨦',plustwo:'⨧',pm:'±',Poincareplane:'ℌ',pointint:'⨕',popf:'𝕡',Popf:'ℙ',pound:'£',prap:'⪷',Pr:'⪻',pr:'≺',prcue:'≼',precapprox:'⪷',prec:'≺',preccurlyeq:'≼',Precedes:'≺',PrecedesEqual:'⪯',PrecedesSlantEqual:'≼',PrecedesTilde:'≾',preceq:'⪯',precnapprox:'⪹',precneqq:'⪵',precnsim:'⋨',pre:'⪯',prE:'⪳',precsim:'≾',prime:'′',Prime:'″',primes:'ℙ',prnap:'⪹',prnE:'⪵',prnsim:'⋨',prod:'∏',Product:'∏',profalar:'⌮',profline:'⌒',profsurf:'⌓',prop:'∝',Proportional:'∝',Proportion:'∷',propto:'∝',prsim:'≾',prurel:'⊰',Pscr:'𝒫',pscr:'𝓅',Psi:'Ψ',psi:'ψ',puncsp:' ',Qfr:'𝔔',qfr:'𝔮',qint:'⨌',qopf:'𝕢',Qopf:'ℚ',qprime:'⁗',Qscr:'𝒬',qscr:'𝓆',quaternions:'ℍ',quatint:'⨖',quest:'?',questeq:'≟',quot:'"',QUOT:'"',rAarr:'⇛',race:'∽̱',Racute:'Ŕ',racute:'ŕ',radic:'√',raemptyv:'⦳',rang:'⟩',Rang:'⟫',rangd:'⦒',range:'⦥',rangle:'⟩',raquo:'»',rarrap:'⥵',rarrb:'⇥',rarrbfs:'⤠',rarrc:'⤳',rarr:'→',Rarr:'↠',rArr:'⇒',rarrfs:'⤞',rarrhk:'↪',rarrlp:'↬',rarrpl:'⥅',rarrsim:'⥴',Rarrtl:'⤖',rarrtl:'↣',rarrw:'↝',ratail:'⤚',rAtail:'⤜',ratio:'∶',rationals:'ℚ',rbarr:'⤍',rBarr:'⤏',RBarr:'⤐',rbbrk:'❳',rbrace:'}',rbrack:']',rbrke:'⦌',rbrksld:'⦎',rbrkslu:'⦐',Rcaron:'Ř',rcaron:'ř',Rcedil:'Ŗ',rcedil:'ŗ',rceil:'⌉',rcub:'}',Rcy:'Р',rcy:'р',rdca:'⤷',rdldhar:'⥩',rdquo:'”',rdquor:'”',rdsh:'↳',real:'ℜ',realine:'ℛ',realpart:'ℜ',reals:'ℝ',Re:'ℜ',rect:'▭',reg:'®',REG:'®',ReverseElement:'∋',ReverseEquilibrium:'⇋',ReverseUpEquilibrium:'⥯',rfisht:'⥽',rfloor:'⌋',rfr:'𝔯',Rfr:'ℜ',rHar:'⥤',rhard:'⇁',rharu:'⇀',rharul:'⥬',Rho:'Ρ',rho:'ρ',rhov:'ϱ',RightAngleBracket:'⟩',RightArrowBar:'⇥',rightarrow:'→',RightArrow:'→',Rightarrow:'⇒',RightArrowLeftArrow:'⇄',rightarrowtail:'↣',RightCeiling:'⌉',RightDoubleBracket:'⟧',RightDownTeeVector:'⥝',RightDownVectorBar:'⥕',RightDownVector:'⇂',RightFloor:'⌋',rightharpoondown:'⇁',rightharpoonup:'⇀',rightleftarrows:'⇄',rightleftharpoons:'⇌',rightrightarrows:'⇉',rightsquigarrow:'↝',RightTeeArrow:'↦',RightTee:'⊢',RightTeeVector:'⥛',rightthreetimes:'⋌',RightTriangleBar:'⧐',RightTriangle:'⊳',RightTriangleEqual:'⊵',RightUpDownVector:'⥏',RightUpTeeVector:'⥜',RightUpVectorBar:'⥔',RightUpVector:'↾',RightVectorBar:'⥓',RightVector:'⇀',ring:'˚',risingdotseq:'≓',rlarr:'⇄',rlhar:'⇌',rlm:'‏',rmoustache:'⎱',rmoust:'⎱',rnmid:'⫮',roang:'⟭',roarr:'⇾',robrk:'⟧',ropar:'⦆',ropf:'𝕣',Ropf:'ℝ',roplus:'⨮',rotimes:'⨵',RoundImplies:'⥰',rpar:')',rpargt:'⦔',rppolint:'⨒',rrarr:'⇉',Rrightarrow:'⇛',rsaquo:'›',rscr:'𝓇',Rscr:'ℛ',rsh:'↱',Rsh:'↱',rsqb:']',rsquo:'’',rsquor:'’',rthree:'⋌',rtimes:'⋊',rtri:'▹',rtrie:'⊵',rtrif:'▸',rtriltri:'⧎',RuleDelayed:'⧴',ruluhar:'⥨',rx:'℞',Sacute:'Ś',sacute:'ś',sbquo:'‚',scap:'⪸',Scaron:'Š',scaron:'š',Sc:'⪼',sc:'≻',sccue:'≽',sce:'⪰',scE:'⪴',Scedil:'Ş',scedil:'ş',Scirc:'Ŝ',scirc:'ŝ',scnap:'⪺',scnE:'⪶',scnsim:'⋩',scpolint:'⨓',scsim:'≿',Scy:'С',scy:'с',sdotb:'⊡',sdot:'⋅',sdote:'⩦',searhk:'⤥',searr:'↘',seArr:'⇘',searrow:'↘',sect:'§',semi:';',seswar:'⤩',setminus:'∖',setmn:'∖',sext:'✶',Sfr:'𝔖',sfr:'𝔰',sfrown:'⌢',sharp:'♯',SHCHcy:'Щ',shchcy:'щ',SHcy:'Ш',shcy:'ш',ShortDownArrow:'↓',ShortLeftArrow:'←',shortmid:'∣',shortparallel:'∥',ShortRightArrow:'→',ShortUpArrow:'↑',shy:'­',Sigma:'Σ',sigma:'σ',sigmaf:'ς',sigmav:'ς',sim:'∼',simdot:'⩪',sime:'≃',simeq:'≃',simg:'⪞',simgE:'⪠',siml:'⪝',simlE:'⪟',simne:'≆',simplus:'⨤',simrarr:'⥲',slarr:'←',SmallCircle:'∘',smallsetminus:'∖',smashp:'⨳',smeparsl:'⧤',smid:'∣',smile:'⌣',smt:'⪪',smte:'⪬',smtes:'⪬︀',SOFTcy:'Ь',softcy:'ь',solbar:'⌿',solb:'⧄',sol:'/',Sopf:'𝕊',sopf:'𝕤',spades:'♠',spadesuit:'♠',spar:'∥',sqcap:'⊓',sqcaps:'⊓︀',sqcup:'⊔',sqcups:'⊔︀',Sqrt:'√',sqsub:'⊏',sqsube:'⊑',sqsubset:'⊏',sqsubseteq:'⊑',sqsup:'⊐',sqsupe:'⊒',sqsupset:'⊐',sqsupseteq:'⊒',square:'□',Square:'□',SquareIntersection:'⊓',SquareSubset:'⊏',SquareSubsetEqual:'⊑',SquareSuperset:'⊐',SquareSupersetEqual:'⊒',SquareUnion:'⊔',squarf:'▪',squ:'□',squf:'▪',srarr:'→',Sscr:'𝒮',sscr:'𝓈',ssetmn:'∖',ssmile:'⌣',sstarf:'⋆',Star:'⋆',star:'☆',starf:'★',straightepsilon:'ϵ',straightphi:'ϕ',strns:'¯',sub:'⊂',Sub:'⋐',subdot:'⪽',subE:'⫅',sube:'⊆',subedot:'⫃',submult:'⫁',subnE:'⫋',subne:'⊊',subplus:'⪿',subrarr:'⥹',subset:'⊂',Subset:'⋐',subseteq:'⊆',subseteqq:'⫅',SubsetEqual:'⊆',subsetneq:'⊊',subsetneqq:'⫋',subsim:'⫇',subsub:'⫕',subsup:'⫓',succapprox:'⪸',succ:'≻',succcurlyeq:'≽',Succeeds:'≻',SucceedsEqual:'⪰',SucceedsSlantEqual:'≽',SucceedsTilde:'≿',succeq:'⪰',succnapprox:'⪺',succneqq:'⪶',succnsim:'⋩',succsim:'≿',SuchThat:'∋',sum:'∑',Sum:'∑',sung:'♪',sup1:'¹',sup2:'²',sup3:'³',sup:'⊃',Sup:'⋑',supdot:'⪾',supdsub:'⫘',supE:'⫆',supe:'⊇',supedot:'⫄',Superset:'⊃',SupersetEqual:'⊇',suphsol:'⟉',suphsub:'⫗',suplarr:'⥻',supmult:'⫂',supnE:'⫌',supne:'⊋',supplus:'⫀',supset:'⊃',Supset:'⋑',supseteq:'⊇',supseteqq:'⫆',supsetneq:'⊋',supsetneqq:'⫌',supsim:'⫈',supsub:'⫔',supsup:'⫖',swarhk:'⤦',swarr:'↙',swArr:'⇙',swarrow:'↙',swnwar:'⤪',szlig:'ß',Tab:' ',target:'⌖',Tau:'Τ',tau:'τ',tbrk:'⎴',Tcaron:'Ť',tcaron:'ť',Tcedil:'Ţ',tcedil:'ţ',Tcy:'Т',tcy:'т',tdot:'⃛',telrec:'⌕',Tfr:'𝔗',tfr:'𝔱',there4:'∴',therefore:'∴',Therefore:'∴',Theta:'Θ',theta:'θ',thetasym:'ϑ',thetav:'ϑ',thickapprox:'≈',thicksim:'∼',ThickSpace:'  ',ThinSpace:' ',thinsp:' ',thkap:'≈',thksim:'∼',THORN:'Þ',thorn:'þ',tilde:'˜',Tilde:'∼',TildeEqual:'≃',TildeFullEqual:'≅',TildeTilde:'≈',timesbar:'⨱',timesb:'⊠',times:'×',timesd:'⨰',tint:'∭',toea:'⤨',topbot:'⌶',topcir:'⫱',top:'⊤',Topf:'𝕋',topf:'𝕥',topfork:'⫚',tosa:'⤩',tprime:'‴',trade:'™',TRADE:'™',triangle:'▵',triangledown:'▿',triangleleft:'◃',trianglelefteq:'⊴',triangleq:'≜',triangleright:'▹',trianglerighteq:'⊵',tridot:'◬',trie:'≜',triminus:'⨺',TripleDot:'⃛',triplus:'⨹',trisb:'⧍',tritime:'⨻',trpezium:'⏢',Tscr:'𝒯',tscr:'𝓉',TScy:'Ц',tscy:'ц',TSHcy:'Ћ',tshcy:'ћ',Tstrok:'Ŧ',tstrok:'ŧ',twixt:'≬',twoheadleftarrow:'↞',twoheadrightarrow:'↠',Uacute:'Ú',uacute:'ú',uarr:'↑',Uarr:'↟',uArr:'⇑',Uarrocir:'⥉',Ubrcy:'Ў',ubrcy:'ў',Ubreve:'Ŭ',ubreve:'ŭ',Ucirc:'Û',ucirc:'û',Ucy:'У',ucy:'у',udarr:'⇅',Udblac:'Ű',udblac:'ű',udhar:'⥮',ufisht:'⥾',Ufr:'𝔘',ufr:'𝔲',Ugrave:'Ù',ugrave:'ù',uHar:'⥣',uharl:'↿',uharr:'↾',uhblk:'▀',ulcorn:'⌜',ulcorner:'⌜',ulcrop:'⌏',ultri:'◸',Umacr:'Ū',umacr:'ū',uml:'¨',UnderBar:'_',UnderBrace:'⏟',UnderBracket:'⎵',UnderParenthesis:'⏝',Union:'⋃',UnionPlus:'⊎',Uogon:'Ų',uogon:'ų',Uopf:'𝕌',uopf:'𝕦',UpArrowBar:'⤒',uparrow:'↑',UpArrow:'↑',Uparrow:'⇑',UpArrowDownArrow:'⇅',updownarrow:'↕',UpDownArrow:'↕',Updownarrow:'⇕',UpEquilibrium:'⥮',upharpoonleft:'↿',upharpoonright:'↾',uplus:'⊎',UpperLeftArrow:'↖',UpperRightArrow:'↗',upsi:'υ',Upsi:'ϒ',upsih:'ϒ',Upsilon:'Υ',upsilon:'υ',UpTeeArrow:'↥',UpTee:'⊥',upuparrows:'⇈',urcorn:'⌝',urcorner:'⌝',urcrop:'⌎',Uring:'Ů',uring:'ů',urtri:'◹',Uscr:'𝒰',uscr:'𝓊',utdot:'⋰',Utilde:'Ũ',utilde:'ũ',utri:'▵',utrif:'▴',uuarr:'⇈',Uuml:'Ü',uuml:'ü',uwangle:'⦧',vangrt:'⦜',varepsilon:'ϵ',varkappa:'ϰ',varnothing:'∅',varphi:'ϕ',varpi:'ϖ',varpropto:'∝',varr:'↕',vArr:'⇕',varrho:'ϱ',varsigma:'ς',varsubsetneq:'⊊︀',varsubsetneqq:'⫋︀',varsupsetneq:'⊋︀',varsupsetneqq:'⫌︀',vartheta:'ϑ',vartriangleleft:'⊲',vartriangleright:'⊳',vBar:'⫨',Vbar:'⫫',vBarv:'⫩',Vcy:'В',vcy:'в',vdash:'⊢',vDash:'⊨',Vdash:'⊩',VDash:'⊫',Vdashl:'⫦',veebar:'⊻',vee:'∨',Vee:'⋁',veeeq:'≚',vellip:'⋮',verbar:'|',Verbar:'‖',vert:'|',Vert:'‖',VerticalBar:'∣',VerticalLine:'|',VerticalSeparator:'❘',VerticalTilde:'≀',VeryThinSpace:' ',Vfr:'𝔙',vfr:'𝔳',vltri:'⊲',vnsub:'⊂⃒',vnsup:'⊃⃒',Vopf:'𝕍',vopf:'𝕧',vprop:'∝',vrtri:'⊳',Vscr:'𝒱',vscr:'𝓋',vsubnE:'⫋︀',vsubne:'⊊︀',vsupnE:'⫌︀',vsupne:'⊋︀',Vvdash:'⊪',vzigzag:'⦚',Wcirc:'Ŵ',wcirc:'ŵ',wedbar:'⩟',wedge:'∧',Wedge:'⋀',wedgeq:'≙',weierp:'℘',Wfr:'𝔚',wfr:'𝔴',Wopf:'𝕎',wopf:'𝕨',wp:'℘',wr:'≀',wreath:'≀',Wscr:'𝒲',wscr:'𝓌',xcap:'⋂',xcirc:'◯',xcup:'⋃',xdtri:'▽',Xfr:'𝔛',xfr:'𝔵',xharr:'⟷',xhArr:'⟺',Xi:'Ξ',xi:'ξ',xlarr:'⟵',xlArr:'⟸',xmap:'⟼',xnis:'⋻',xodot:'⨀',Xopf:'𝕏',xopf:'𝕩',xoplus:'⨁',xotime:'⨂',xrarr:'⟶',xrArr:'⟹',Xscr:'𝒳',xscr:'𝓍',xsqcup:'⨆',xuplus:'⨄',xutri:'△',xvee:'⋁',xwedge:'⋀',Yacute:'Ý',yacute:'ý',YAcy:'Я',yacy:'я',Ycirc:'Ŷ',ycirc:'ŷ',Ycy:'Ы',ycy:'ы',yen:'¥',Yfr:'𝔜',yfr:'𝔶',YIcy:'Ї',yicy:'ї',Yopf:'𝕐',yopf:'𝕪',Yscr:'𝒴',yscr:'𝓎',YUcy:'Ю',yucy:'ю',yuml:'ÿ',Yuml:'Ÿ',Zacute:'Ź',zacute:'ź',Zcaron:'Ž',zcaron:'ž',Zcy:'З',zcy:'з',Zdot:'Ż',zdot:'ż',zeetrf:'ℨ',ZeroWidthSpace:'​',Zeta:'Ζ',zeta:'ζ',zfr:'𝔷',Zfr:'ℨ',ZHcy:'Ж',zhcy:'ж',zigrarr:'⇝',zopf:'𝕫',Zopf:'ℤ',Zscr:'𝒵',zscr:'𝓏',zwj:'‍',zwnj:'‌'},J={Aacute:'Á',aacute:'á',Acirc:'Â',acirc:'â',acute:'´',AElig:'Æ',aelig:'æ',Agrave:'À',agrave:'à',amp:'&',AMP:'&',Aring:'Å',aring:'å',Atilde:'Ã',atilde:'ã',Auml:'Ä',auml:'ä',brvbar:'¦',Ccedil:'Ç',ccedil:'ç',cedil:'¸',cent:'¢',copy:'©',COPY:'©',curren:'¤',deg:'°',divide:'÷',Eacute:'É',eacute:'é',Ecirc:'Ê',ecirc:'ê',Egrave:'È',egrave:'è',ETH:'Ð',eth:'ð',Euml:'Ë',euml:'ë',frac12:'½',frac14:'¼',frac34:'¾',gt:'>',GT:'>',Iacute:'Í',iacute:'í',Icirc:'Î',icirc:'î',iexcl:'¡',Igrave:'Ì',igrave:'ì',iquest:'¿',Iuml:'Ï',iuml:'ï',laquo:'«',lt:'<',LT:'<',macr:'¯',micro:'µ',middot:'·',nbsp:' ',not:'¬',Ntilde:'Ñ',ntilde:'ñ',Oacute:'Ó',oacute:'ó',Ocirc:'Ô',ocirc:'ô',Ograve:'Ò',ograve:'ò',ordf:'ª',ordm:'º',Oslash:'Ø',oslash:'ø',Otilde:'Õ',otilde:'õ',Ouml:'Ö',ouml:'ö',para:'¶',plusmn:'±',pound:'£',quot:'"',QUOT:'"',raquo:'»',reg:'®',REG:'®',sect:'§',shy:'­',sup1:'¹',sup2:'²',sup3:'³',szlig:'ß',THORN:'Þ',thorn:'þ',times:'×',Uacute:'Ú',uacute:'ú',Ucirc:'Û',ucirc:'û',Ugrave:'Ù',ugrave:'ù',uml:'¨',Uuml:'Ü',uuml:'ü',Yacute:'Ý',yacute:'ý',yen:'¥',yuml:'ÿ'},r={0:'�',128:'€',130:'‚',131:'ƒ',132:'„',133:'…',134:'†',135:'‡',136:'ˆ',137:'‰',138:'Š',139:'‹',140:'Œ',142:'Ž',145:'‘',146:'’',147:'“',148:'”',149:'•',150:'–',151:'—',152:'˜',153:'™',154:'š',155:'›',156:'œ',158:'ž',159:'Ÿ'},w=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],v=String.fromCharCode,y={},z=y.hasOwnProperty,i=function(a,b){return z.call(a,b)},B=function(b,d){var a=-1,c=b.length;while(++a=55296&&a<=57343||a>1114111?(c&&e('character reference outside the permissible Unicode range'),'�'):i(r,a)?(c&&e('disallowed character reference'),r[a]):(c&&B(w,a)&&e('disallowed character reference'),a>65535&&(a-=65536,b+=v(a>>>10&1023|55296),a=56320|a&1023),b+=v(a),b)},m=function(a){return'&#x'+a.charCodeAt(0).toString(16).toUpperCase()+';'},e=function(a){throw Error('Parse error: '+a)},l=function(a,b){b=p(b,l.options);var f=b.strict;f&&E.test(a)&&e('forbidden code point');var g=b.encodeEverything,c=b.useNamedReferences,d=b.allowUnsafeSymbols;return g?(a=a.replace(A,function(a){return c&&i(h,a)?'&'+h[a]+';':m(a)}),c&&(a=a.replace(/>\u20D2/g,'>⃒').replace(/<\u20D2/g,'<⃒').replace(/fj/g,'fj')),c&&(a=a.replace(t,function(a){return'&'+h[a]+';'}))):c?(d||(a=a.replace(o,function(a){return'&'+h[a]+';'})),a=a.replace(/>\u20D2/g,'>⃒').replace(/<\u20D2/g,'<⃒'),a=a.replace(t,function(a){return'&'+h[a]+';'})):d||(a=a.replace(o,m)),a.replace(x,function(a){var b=a.charCodeAt(0),c=a.charCodeAt(1),d=(b-55296)*1024+c-56320+65536;return'&#x'+d.toString(16).toUpperCase()+';'}).replace(G,m)},l.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1},j=function(c,b){b=p(b,j.options);var a=b.strict;return a&&D.test(c)&&e('malformed character reference'),c.replace(F,function(l,h,o,j,n,k,p,r){var f,g,m,c,d;return h?(f=h,g=o,a&&!g&&e('character reference was not terminated by a semicolon'),q(f,a)):j?(m=j,g=n,a&&!g&&e('character reference was not terminated by a semicolon'),f=parseInt(m,16),q(f,a)):k?(c=k,i(s,c)?s[c]:(a&&e('named character reference was not terminated by a semicolon'),l)):(c=p,d=r,d&&b.isAttributeValue?(a&&d=='='&&e('`&` did not start a character reference'),l):(a&&e('named character reference was not terminated by a semicolon'),J[c]+(d||'')))})},j.options={isAttributeValue:!1,strict:!1},I=function(a){return a.replace(o,function(a){return C[a]})},f={version:'0.5.0',encode:l,decode:j,escape:I,unescape:j},typeof a=='function'&&typeof a.amd=='object'&&a.amd)a(function(){return f});else if(k&&!k.nodeType)if(u)u.exports=f;else for(n in f)i(f,n)&&(k[n]=f[n]);else H.he=f}(this)}.call(this,typeof global!=='undefined'?global:typeof self!=='undefined'?self:typeof window!=='undefined'?window:{}))},{}],16:[function(c,a,d){'use strict';function b(b,d){var a=0,c=0,e=-1,f;if(b=String(b),f=b.length,typeof d!=='string'||d.length!==1)throw new Error('Expected character');while(++ec&&(c=a)):a=0;return c}a.exports=b},{}],17:[function(s,r,t){'use strict';function q(a){return String(a).length}function b(b,c){return Array(b+1).join(c||a)}function l(b){var a=o.exec(b);return a?a.index+1:b.length}function p(J,M){var z=M||{},D=z.delimiter,C=z.start,B=z.end,s=z.align,G=z.stringLength||q,w=0,r=-1,E=J.length,u=[],v,H,A,y,x,o,t,F,p,L,K,I;s=s?s.concat():[],(D===null||D===undefined)&&(D=a+d+a),(C===null||C===undefined)&&(C=d+a),(B===null||B===undefined)&&(B=a+d);while(++rw&&(w=y.length);while(++ou[o]&&(u[o]=t)}typeof s==='string'&&(s=b(w,s).split('')),o=-1;while(++ou[o]&&(u[o]=F)}r=-1;while(++ra.length&&d>0){if(d&1&&(a+=c),d>>=1,!d)break;c+=c}return a.substr(0,e)}c.exports=d;var a='',b},{}],19:[function(d,b,e){'use strict';function c(b){var c;b=String(b),c=b.length;while(b.charAt(--c)===a);return b.slice(0,c+1)}var a='\n';b.exports=c},{}],20:[function(d,b,a){function c(a){return a.replace(/^\s*|\s*$/g,'')}a=b.exports=c,a.left=function(a){return a.replace(/^\s*/,'')},a.right=function(a){return a.replace(/\s*$/,'')}},{}],21:[function(b,i,j){'use strict';function h(i){function b(c){var a=this;if(!(a instanceof b))return new b(c);a.ware=new g(c&&c.ware),a.ware.context=a,a.Parser=d(k),a.Compiler=d(l)}function m(a){return a instanceof b?a:new b}function o(){var a=m(this);return a.ware.use.apply(a.ware,arguments),a}function p(b,d,f){var g=this,h;if(typeof d==='function'&&(f=d,d=null),!d&&b&&!b.type&&(d=b,b=null),d=new a(d),h=d.namespace(j),b?h[e]||(h[e]=b):b=h[e]||b,!b)throw new Error('Expected node, got '+b);return f=typeof f==='function'?f:c,g.ware&&g.ware.fns?g.ware.run(b,d,f):f(null,b,d),b}function q(f,g){var b=new a(f),d=this&&this.Parser||k,c=new d(b,g).parse();return b.namespace(j)[e]=c,c}function r(b,c,d){var g=this&&this.Compiler||l,f;if((d===null||d===undefined)&&(d=c,c=null),!c&&b&&!b.type&&(c=b,b=null),c=new a(c),f=c.namespace(j),b?f[e]||(f[e]=b):b=f[e]||b,!b)throw new Error('Expected node, got '+b);return new g(c,d).compile()}function n(i,b,e){var h=m(this),g=new a(i),d=null;return typeof b==='function'&&(e=b,b=null),f.run({context:h,file:g,settings:b||{}},function(a,b){d=b&&b.result,e?e(a,g,d):a&&c(a)}),d}var j=i.name,e=i.type,k=i.Parser,l=i.Compiler,h=b.prototype;return b.use=h.use=o,b.parse=h.parse=q,b.run=h.run=p,b.stringify=h.stringify=r,b.process=h.process=n,b}var c=b('bail'),e=b('ware'),g=b('attach-ware')(e),a=b('vfile'),d=b('unherit'),f=e().use(function(a){a.tree=a.context.parse(a.file,a.settings)}).use(function(a,b){a.context.run(a.tree,a.file,b)}).use(function(a){a.result=a.context.stringify(a.tree,a.file,a.settings)});i.exports=h},{'attach-ware':22,bail:2,unherit:23,vfile:66,ware:26}],22:[function(c,d,f){'use strict';function e(d){function f(f){var b=this,g=a.call(arguments,1),h,j,i;if(f instanceof c)return f.attachers?b.use(f.attachers):b;if(f instanceof d)return b.fns=b.fns.concat(f.fns),b;if('length'in f&&typeof f!=='function'){h=-1,j=f.length;while(++ha.length)try{return e.apply(h,a.concat(c))}catch(a){return c(a)}return g(e)?b(e).apply(h,a.concat(c)):d(e,c).apply(h,a)}}function d(b,a){return function(){var c;try{c=b.apply(this,arguments)}catch(b){return a(b)}h(c)?c.then(function(b){a(null,b)},a):c instanceof Error?a(c):a(null,c)}}function g(a){return a&&a.constructor&&'GeneratorFunction'==a.constructor.name}function h(a){return a&&'function'==typeof a.then}function i(b){return function(){var c=b.apply(this,arguments);return b=a,c}}var a=function(){},b=f('co');c.exports=e},{co:28}],28:[function(l,k,m){function b(b){var f=e(b);return function(h){function k(a,b){setImmediate(function(){h.call(e,a,b)})}function i(f,g){var b;if(arguments.length>2&&(g=a.call(arguments,1)),f)try{b=j.throw(f)}catch(a){return k(a)}if(!f)try{b=j.next(g)}catch(a){return k(a)}if(b.done)return k(null,b.value);if(b.value=d(b.value,e),'function'==typeof b.value){var c=!1;try{b.value.call(e,function(){if(c)return;c=!0,i.apply(e,arguments)})}catch(a){setImmediate(function(){if(c)return;c=!0,i(a)})}return}i(new TypeError('You may only yield a function, promise, generator, array, or object, but the following was passed: "'+String(b.value)+'"'))}var e=this,j=b;if(f){var g=a.call(arguments),l=g.length,m=l&&'function'==typeof g[l-1];h=m?g.pop():c,j=b.apply(this,g)}else h=h||c;i()}}function d(a,c){return e(a)?b(a.call(c)):j(a)?b(a):i(a)?f(a):'function'==typeof a?a:h(a)||Array.isArray(a)?g.call(c,a):a}function g(a){var b=this,c=Array.isArray(a);return function(i){function k(a,c){if(j)return;try{if(a=d(a,b),'function'!=typeof a)return f[c]=a,--h||i(null,f);a.call(b,function(a,b){if(j)return;if(a)return j=!0,i(a);f[c]=b,--h||i(null,f)})}catch(a){j=!0,i(a)}}var g=Object.keys(a),h=g.length,f=c?new Array(h):new a.constructor,j;if(!h){setImmediate(function(){i(null,f)});return}if(!c)for(var e=0;e2&&c1)return;e.test(h)||(k=!1)}else if(h!=='.')if(cc)if(d(b[a],a)===!1)return!1;return!0}function d(i,a,d,f){var g,e,h;typeof a==='function'&&(f=d,d=a,a=null),g=f?c:b,h=function(a,b){return g(a,function(a,c){return a&&e(a,c,b)})},e=function(b,c,f){var e;return c=c||(f?0:null),(!a||b.type===a)&&(e=d(b,c,f||null)),b.children&&e!==!1?h(b.children,b):e},e(i)}a.exports=d},{}]},{},[1])(1)}) diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..6945c70 --- /dev/null +++ b/bower.json @@ -0,0 +1,48 @@ +{ + "name": "alex", + "main": "alex.js", + "description": "Catch insensitive, inconsiderate writing", + "license": "MIT", + "keywords": [ + "alex", + "equal", + "race", + "religion", + "sex", + "orientation", + "identity", + "gender", + "sensitive", + "insensitive", + "neutral", + "writing", + "language", + "english" + ], + "repository": { + "type": "git", + "url": "https://github.com/wooorm/alex.git" + }, + "authors": [ + "Titus Wormer " + ], + "ignore": [ + ".*", + "*.log", + "*.md", + "*.sh", + "*.svg", + "build/", + "components/", + "coverage/", + "node_modules/", + "script/", + "build.js", + "cli.js", + "component.json", + "example.js", + "index.js", + "package.json", + "test.js" + ] +} diff --git a/cli.js b/cli.js new file mode 100755 index 0000000..a0f2c08 --- /dev/null +++ b/cli.js @@ -0,0 +1,76 @@ +#!/usr/bin/env node +'use strict'; + +/* eslint-disable no-console */ + +var meow = require('meow'); +var getStdin = require('get-stdin'); +var styl = require(require('eslint-stylish')); +var toFile = require('to-vfile'); +var alex = require('./'); + +var expextPipeIn = !process.stdin.isTTY; + +var cli = meow({ + 'help': [ + 'Usage: alex [ ...]', + '', + 'Examples', + ' $ echo "His network looks good" | alex', + ' $ alex example.txt', + ' $ alex readme.md' + ] +}); + +var input = cli.input; +var exit = 0; + +/** + * Log a virtual file processed by alex. + * + * @param {VFile} file - Virtual file. + */ +function log(file) { + console.log(styl([file], /* work around stylish */ { + 'rules': { + 'undefined': [1] + } + })); + + if (!exit && file.hasFailed()) { + exit = 1; + } +} + +if (expextPipeIn) { + getStdin(function (value) { + var file = toFile(''); + file.contents = value; + log(alex(file)); + }); +} else if (!input.length) { + cli.showHelp(); + return; +} + +input.forEach(function (filePath) { + toFile.read(filePath, function (err, file) { + if (err) { + throw err; + } + + alex(file); + + log(file); + }); +}); + +/* + * Exit. + */ + +process.on('exit', function () { + /* eslint-disable no-process-exit */ + process.exit(exit); + /* eslint-enable no-process-exit */ +}); diff --git a/component.json b/component.json new file mode 100644 index 0000000..673e287 --- /dev/null +++ b/component.json @@ -0,0 +1,33 @@ +{ + "name": "alex", + "version": "0.0.0", + "description": "Catch insensitive, inconsiderate writing", + "license": "MIT", + "repository": "wooorm/alex", + "keywords": [ + "alex", + "equal", + "race", + "religion", + "sex", + "orientation", + "identity", + "gender", + "sensitive", + "insensitive", + "neutral", + "writing", + "language", + "english" + ], + "dependencies": { + "wooorm/bail": "^1.0.0", + "wooorm/mdast": "^1.0.0", + "wooorm/mdast-util-to-nlcst": "~0.2.1", + "wooorm/parse-english": "~0.5.0", + "wooorm/retext": "~1.0.0-rc.3" + }, + "scripts": [ + "index.js" + ] +} diff --git a/example.md b/example.md new file mode 100644 index 0000000..e2586fa --- /dev/null +++ b/example.md @@ -0,0 +1,3 @@ +All changes are written to the **master server**. The slaves are read-only +copies of master. When an _incoming message_ is given to the master, he +propagates through to the slaves. diff --git a/history.md b/history.md new file mode 100644 index 0000000..5d03263 --- /dev/null +++ b/history.md @@ -0,0 +1,8 @@ + + + + + + +0.0.0 / 2015-08-15 +================== diff --git a/index.js b/index.js new file mode 100644 index 0000000..e081cc4 --- /dev/null +++ b/index.js @@ -0,0 +1,75 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module alex + * @fileoverview + * Alex checks your (or someone else’s) writing for possible + * inconsiderate wording. + */ + +'use strict'; + +/* + * Dependencies. + */ + +var bail = require('bail'); +var mdast = require('mdast'); +var bridge = require('mdast-util-to-nlcst'); +var sort = require('mdast-message-sort'); +var retext = require('retext'); +var parser = require('parse-english'); +var equality = require('retext-equality'); + +/* + * Processor. + */ + +var markdown = mdast(); +var english = retext(parser).use(equality).use(sort); + +/** + * Alex. + * + * Read markdown as input, converts to natural language, + * then detect violations. + * + * @example + * alex('We’ve confirmed his identity.').messages; + * // [ { [1:17-1:20: `his` may be insensitive, use `their`, `theirs` instead] + * // name: '1:17-1:20', + * // file: '', + * // reason: '`his` may be insensitive, use `their`, `theirs` instead', + * // line: 1, + * // column: 17, + * // fatal: false } ] + * + * @param {string|VFile} value - Content + * @return {VFile} - Result. + */ +function alex(value) { + var result; + + /* + * All callbacks are in fact completely sync. + */ + + markdown.process(value, function (err, file) { + bail(err); + + bridge(file); + + english.run(file); + + result = file; + }); + + return result; +} + +/* + * Expose. + */ + +module.exports = alex; diff --git a/logo.svg b/logo.svg new file mode 100644 index 0000000..ff968fb --- /dev/null +++ b/logo.svg @@ -0,0 +1,7 @@ + + + + + alex + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..246f399 --- /dev/null +++ b/package.json @@ -0,0 +1,80 @@ +{ + "name": "alex", + "version": "0.0.0", + "description": "Catch insensitive, inconsiderate writing", + "license": "MIT", + "repository": "wooorm/alex", + "keywords": [ + "cli-app", + "cli", + "bin", + "alex", + "equal", + "race", + "religion", + "sex", + "orientation", + "identity", + "gender", + "sensitive", + "insensitive", + "neutral", + "writing", + "language", + "english" + ], + "author": { + "name": "Titus Wormer", + "email": "tituswormer@gmail.com", + "url": "wooorm.com" + }, + "bin": "cli.js", + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "cli.js" + ], + "dependencies": { + "bail": "^1.0.0", + "eslint-stylish": "^0.2.0", + "get-stdin": "^4.0.1", + "mdast": "^1.0.0", + "mdast-util-to-nlcst": "^0.2.0", + "meow": "^3.3.0", + "parse-english": "^0.5.0", + "retext": "^1.0.0-rc.3", + "retext-equality": "^1.0.0", + "to-vfile": "^1.0.0", + "vfile": "^1.0.0" + }, + "devDependencies": { + "browserify": "^11.0.1", + "eslint": "^1.0.0", + "esmangle": "^1.0.1", + "istanbul": "^0.3.0", + "jscs": "^2.0.0", + "jscs-jsdoc": "^1.0.0", + "mdast-comment-config": "^0.1.2", + "mdast-github": "^0.3.2", + "mdast-lint": "^0.4.2", + "mdast-slug": "^0.1.1", + "mdast-validate-links": "^0.3.1", + "mocha": "^2.0.0" + }, + "scripts": { + "test-api": "mocha --check-leaks test.js", + "test-coverage": "istanbul cover _mocha -- test.js", + "test-travis": "npm run test-coverage", + "test": "npm run test-api", + "lint-api": "eslint .", + "lint-style": "jscs --reporter inline .", + "lint": "npm run lint-api && npm run lint-style", + "make": "npm run lint && npm run test-coverage", + "bundle": "browserify index.js --no-builtins -s alex > alex.js", + "postbundle": "esmangle alex.js > alex.min.js", + "build-md": "mdast . --quiet", + "build": "npm run bundle && npm run build-md" + } +} diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..648e329 --- /dev/null +++ b/readme.md @@ -0,0 +1,88 @@ +# ![alex](https://cdn.rawgit.com/wooorm/alex/master/logo.svg) + +> 📝 **alex** — Catch insensitive, inconsiderate writing. + +[![Build Status](https://img.shields.io/travis/wooorm/alex.svg)](https://travis-ci.org/wooorm/alex) [![Coverage Status](https://img.shields.io/codecov/c/github/wooorm/alex.svg)](https://codecov.io/github/wooorm/alex) [![Code Climate](http://img.shields.io/codeclimate/github/wooorm/alex.svg)](https://codeclimate.com/github/wooorm/alex) + +Whether your own or someone else’s writing, **alex** helps you find gender +favouring, polarising, binary thinking, identity insensitive, race related, +religion inconsiderate, or other **unequal** phrasing. + +## Why + +* [x] Catches numerous different possible offenses; +* [x] Suggests helpful alternatives; +* [x] Reads plain-text and markdown as input; +* [x] Stylish; +* [x] Actively maintained; +* [x] Feature requests and issues are more than welcome! + +## Installation + +[npm](https://docs.npmjs.com/cli/install): + +```bash +npm install alex --global +``` + +## Command Line + +![Example of how alex looks on screen](https://cdn.rawgit.com/wooorm/alex/master/screen-shot.png) + +Let’s say `example.md` looks as follows: + +```markdown +All changes are written to the **master server**. The slaves are read-only +copies of master. When an _incoming message_ is given to the master, he +propagates through to the slaves. +``` + +Then, run **alex** on `example.md`: + +```sh +alex example.md +``` + +Yields: + +```text +example.md + 1:34 warning `master` / `slaves` may be insensitive, use `primary` / `replica` instead + 2:70 warning `he` may be insensitive, use `they`, `it` instead +``` + +See `mdast --help` for more information. + +## Programmatic + +### alex(value) + +**Example** + +```js +alex('We’ve confirmed his identity.').messages; +/* + * [ { [1:17-1:20: `his` may be insensitive, use `their`, `theirs` instead] + * name: '1:17-1:20', + * file: '', + * reason: '`his` may be insensitive, use `their`, `theirs` instead', + * line: 1, + * column: 17, + * fatal: false } ] + */ +``` + +**Parameters** + +* `value` ([`VFile`](https://github.com/wooorm/vfile) or `string`) — + Markdown or plain-text. + +**Returns** + +[`VFile`](https://github.com/wooorm/vfile). You’ll probably be interested +in its [`messages`](https://github.com/wooorm/vfile#vfilemessages) property, as +demonstrated in the example above, as it holds the possible violations. + +## License + +[MIT](LICENSE) © [Titus Wormer](http://wooorm.com) diff --git a/screen-shot.png b/screen-shot.png new file mode 100644 index 0000000..0940832 Binary files /dev/null and b/screen-shot.png differ diff --git a/test.js b/test.js new file mode 100644 index 0000000..c5f8113 --- /dev/null +++ b/test.js @@ -0,0 +1,11 @@ +/** + * @author Titus Wormer + * @copyright 2015 Titus Wormer + * @license MIT + * @module alex:test + * @fileoverview Test Alex’s features. + */ + +'use strict'; + +// TODO: more.