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QAAQ,UAAW,MACnB,QAAQ,UAAW,MACnB,QAAQ,UAAW,MAE/B,CAsEW,CAAgB,GAzKL,SAAU,EAAM,GAEpC,IAAI,EACA,EACA,EACA,EAQJ,QAZkB,IAAd,IAAmB,EAAO,KAYjB,OALX,EADkB,iBAAT,EACF,EAAK,WAGL,EAAK,QAAQ,MAAO,KAI3B,OAAO,EAEJ,GAAa,MAAT,EAEP,EAAY,EACZ,EAAe,EACf,EAAY,EACZ,EAAc,OAEX,GAAa,MAAT,EAEP,EAAY,EACZ,EAAe,EACf,EAAY,EACZ,EAAc,OAEX,GAAa,MAAT,EAEP,EAAY,EACZ,EAAe,EACf,EAAY,EACZ,EAAc,OAMd,IAAK,IAAI,EAAI,EAAG,EAAI,EAAK,OAAQ,IAAK,CACpC,IAAI,EAAI,EAAK,GACH,MAAN,IACF,EAAY,GAEJ,MAAN,IACF,EAAe,GAEP,MAAN,IACF,EAAe,GAEP,MAAN,IACF,EAAY,GAEJ,MAAN,IACF,EAAY,GAEJ,MAAN,IACF,EAAY,GAEJ,MAAN,IACF,EAAc,EAElB,CAeF,OAbI,IAEF,GADA,EAAO,EAAK,QAAQ,WAAY,MACpB,QAAQ,WAAY,OAE9B,GAAa,KAIf,GADA,GADA,GADA,EAAO,EAAK,QAAQ,WAAY,MACpB,QAAQ,WAAY,MACpB,QAAQ,WAAY,MACpB,QAAQ,WAAY,MAE9B,IACF,EAAO,EAAK,QAAQ,WAAY,MAE3B,CACT,CA2FW,CAAgB,EAAK,EAEhC,EAEA,EAAiB,QAAI,CAGvB","file":"/npm/smartypants@0.1.4/smartypants.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.48.0.\n * Original file: /npm/smartypants@0.1.4/smartypants.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/* eslint-env browser, amd, node */\n\n/**\n *\n * @file Translates plain ASCII punctuation characters into \"smart\" typographic punctuation\n * @desc See the readme for details, installation instructions, and * license information.\n * @version 0.0.4\n * @author othree\n *\n * Copyright (c) 2003-2004 John Gruber\n * Copyright (c) 2016      Kao, Wei-Ko(othree)\n *\n * @see {@link https://www.npmjs.com/package/smartypants|smartypants.js}\n */\n\n/*! smartypants.js 0.0.6 | (c) Kao, Wei-Ko(othree) | github.com/othree/smartypants.js/blob/master/LICENSE */\n\n(function (root, factory) {\n  if (typeof define === 'function' && define.amd) {\n    // AMD\n    define('SmartyPants', ['exports'], function (exports) {\n      factory((root.SmartyPants = exports));\n    });\n  } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {\n    // CommonJS\n    factory(exports);\n  } else {\n    // Browser globals\n    factory((root.SmartyPants = {}));\n  }\n}(this, function (exports) {\n\n  \"use strict\";\n  exports.__esModule = true;\n  exports.smartypantsu = exports.smartellipses = exports.smartdashes = exports.smartquotes = exports.smartypants = void 0;\n  var tags_to_skip = /<(\\/?)(?:pre|code|kbd|script|math)[^>]*>/i;\n  /**\n   * @param text text to be parsed\n   * @param attr value of the smart_quotes=\"\" attribute\n   */\n  var SmartyPants = function (text, attr) {\n    if (text === void 0) { text = ''; }\n    if (attr === void 0) { attr = '1'; }\n    var do_quotes;\n    var do_backticks;\n    var do_dashes;\n    var do_ellipses;\n    var do_stupefy;\n    var convert_quot = 0;\n    if (typeof attr === 'number') {\n      attr = attr.toString();\n    }\n    else {\n      attr = attr.replace(/\\s/g, '');\n    }\n    /**\n     * Parse attributes:\n     * 0 : do nothing\n     * 1 : set all\n     * 2 : set all, using old school en- and em- dash shortcuts\n     * 3 : set all, using inverted old school en and em- dash shortcuts\n     *\n     * q : quotes\n     * b : backtick quotes (``double'' only)\n     * B : backtick quotes (``double'' and `single')\n     * d : dashes\n     * D : old school dashes\n     * i : inverted old school dashes\n     * e : ellipses\n     * w : convert &quot; entities to \" for Dreamweaver users\n     */\n    if (attr === '0') {\n      // Do nothing\n      return text;\n    }\n    else if (attr === '1') {\n      // Do everything, turn all options on.\n      do_quotes = 1;\n      do_backticks = 1;\n      do_dashes = 1;\n      do_ellipses = 1;\n    }\n    else if (attr === '2') {\n      // Do everything, turn all options on, use old school dash shorthand.\n      do_quotes = 1;\n      do_backticks = 1;\n      do_dashes = 2;\n      do_ellipses = 1;\n    }\n    else if (attr === '3') {\n      // Do everything, turn all options on, use inverted old school dash shorthand.\n      do_quotes = 1;\n      do_backticks = 1;\n      do_dashes = 3;\n      do_ellipses = 1;\n    }\n    else if (attr === '-1') {\n      // Special \"stupefy\" mode.\n      do_stupefy = 1;\n    }\n    else {\n      for (var i = 0; i < attr.length; i++) {\n        var c = attr[i];\n        if (c === 'q') {\n          do_quotes = 1;\n        }\n        if (c === 'b') {\n          do_backticks = 1;\n        }\n        if (c === 'B') {\n          do_backticks = 2;\n        }\n        if (c === 'd') {\n          do_dashes = 1;\n        }\n        if (c === 'D') {\n          do_dashes = 2;\n        }\n        if (c === 'i') {\n          do_dashes = 3;\n        }\n        if (c === 'e') {\n          do_ellipses = 1;\n        }\n        if (c === 'w') {\n          convert_quot = 1;\n        }\n      }\n    }\n    var tokens = _tokenize(text);\n    var result = '';\n    /**\n     * Keep track of when we're inside <pre> or <code> tags.\n     */\n    var in_pre = 0;\n    /**\n     * This is a cheat, used to get some context\n     * for one-character tokens that consist of\n     * just a quote char. What we do is remember\n     * the last character of the previous text\n     * token, to use as context to curl single-\n     * character quote tokens correctly.\n     */\n    var prev_token_last_char = '';\n    for (var i = 0; i < tokens.length; i++) {\n      var cur_token = tokens[i];\n      if (cur_token[0] === 'tag') {\n        result = result + cur_token[1];\n        var matched = tags_to_skip.exec(cur_token[1]);\n        if (matched) {\n          if (matched[1] === '/') {\n            in_pre = 0;\n          }\n          else {\n            in_pre = 1;\n          }\n        }\n      }\n      else {\n        var t = cur_token[1];\n        var last_char = t.substring(t.length - 1, t.length); // Remember last char of this token before processing.\n        if (!in_pre) {\n          t = ProcessEscapes(t);\n          if (convert_quot) {\n            t = t.replace(/$quot;/g, '\"');\n          }\n          if (do_dashes) {\n            if (do_dashes === 1) {\n              t = EducateDashes(t);\n            }\n            if (do_dashes === 2) {\n              t = EducateDashesOldSchool(t);\n            }\n            if (do_dashes === 3) {\n              t = EducateDashesOldSchoolInverted(t);\n            }\n          }\n          if (do_ellipses) {\n            t = EducateEllipses(t);\n          }\n          // Note: backticks need to be processed before quotes.\n          if (do_backticks) {\n            t = EducateBackticks(t);\n            if (do_backticks === 2) {\n              t = EducateSingleBackticks(t);\n            }\n          }\n          if (do_quotes) {\n            if (t === '\\'') {\n              // Special case: single-character ' token\n              if (/\\S/.test(prev_token_last_char)) {\n                t = '&#8217;';\n              }\n              else {\n                t = '&#8216;';\n              }\n            }\n            else if (t === '\"') {\n              // Special case: single-character \" token\n              if (/\\S/.test(prev_token_last_char)) {\n                t = '&#8221;';\n              }\n              else {\n                t = '&#8220;';\n              }\n            }\n            else {\n              // Normal case:\n              t = EducateQuotes(t);\n            }\n          }\n          if (do_stupefy) {\n            t = StupefyEntities(t);\n          }\n        }\n        prev_token_last_char = last_char;\n        result = result + t;\n      }\n    }\n    return result;\n  };\n  exports.smartypants = SmartyPants;\n  var SmartQuotes = function (text, attr) {\n    /**\n     * should we educate ``backticks'' -style quotes?\n     */\n    // var do_backticks:number;\n    if (text === void 0) { text = ''; }\n    if (attr === void 0) { attr = '1'; }\n    if (typeof attr === 'number') {\n      attr = attr.toString();\n    }\n    else {\n      attr = attr.replace(/\\s/g, '');\n    }\n    if (attr === '0') {\n      // Do nothing\n      return text;\n      // } else if (attr === '2') {\n      //   // smarten ``backticks'' -style quotes\n      //   do_backticks = 1;\n      // } else {\n      //   do_backticks = 0;\n    }\n    /**\n     * Special case to handle quotes at the very end of $text when preceded by\n     * an HTML tag. Add a space to give the quote education algorithm a bit of\n     * context, so that it can guess correctly that it's a closing quote:\n     */\n    var add_extra_space = 0;\n    if (/>['\"]$/.test(text)) {\n      add_extra_space = 1; // Remember, so we can trim the extra space later.\n      text = text + ' ';\n    }\n    var tokens = _tokenize(text);\n    var result = '';\n    /**\n     * Keep track of when we're inside <pre> or <code> tags.\n     */\n    var in_pre = 0;\n    /**\n     * This is a cheat, used to get some context\n     * for one-character tokens that consist of\n     * just a quote char. What we do is remember\n     * the last character of the previous text\n     * token, to use as context to curl single-\n     * character quote tokens correctly.\n     */\n    var prev_token_last_char = '';\n    for (var i = 0; i < tokens.length; i++) {\n      var cur_token = tokens[i];\n      if (cur_token[0] === 'tag') {\n        result = result + cur_token[1];\n        var matched = tags_to_skip.exec(cur_token[1]);\n        if (matched) {\n          if (matched[1] === '/') {\n            in_pre = 0;\n          }\n          else {\n            in_pre = 1;\n          }\n        }\n      }\n      else {\n        var t = cur_token[1];\n        var last_char = t.substring(t.length - 1, t.length); // Remember last char of this token before processing.\n        if (!in_pre) {\n          t = ProcessEscapes(t);\n          if (t === '\\'') {\n            // Special case: single-character ' token\n            if (/\\S/.test(prev_token_last_char)) {\n              t = '&#8217;';\n            }\n            else {\n              t = '&#8216;';\n            }\n          }\n          else if (t === '\"') {\n            // Special case: single-character \" token\n            if (/\\S/.test(prev_token_last_char)) {\n              t = '&#8221;';\n            }\n            else {\n              t = '&#8220;';\n            }\n          }\n          else {\n            // Normal case:\n            t = EducateQuotes(t);\n          }\n        }\n        prev_token_last_char = last_char;\n        result = result + t;\n      }\n    }\n    if (add_extra_space) {\n      result = result.replace(/ $/, '');\n    }\n    return result;\n  };\n  exports.smartquotes = SmartQuotes;\n  var SmartDashes = function (text, attr) {\n    if (text === void 0) { text = ''; }\n    if (attr === void 0) { attr = '1'; }\n    // reference to the subroutine to use for dash education, default to EducateDashes:\n    var dash_sub_ref = EducateDashes;\n    if (typeof attr === 'number') {\n      attr = attr.toString();\n    }\n    else {\n      attr = attr.replace(/\\s/g, '');\n    }\n    if (attr === '0') {\n      // Do nothing\n      return text;\n    }\n    else if (attr === '2') {\n      // use old smart dash shortcuts, \"--\" for en, \"---\" for em\n      dash_sub_ref = EducateDashesOldSchool;\n    }\n    else if (attr === '3') {\n      // inverse of 2, \"--\" for em, \"---\" for en\n      dash_sub_ref = EducateDashesOldSchoolInverted;\n    }\n    var tokens = _tokenize(text);\n    var result = '';\n    /**\n     * Keep track of when we're inside <pre> or <code> tags.\n     */\n    var in_pre = 0;\n    for (var i = 0; i < tokens.length; i++) {\n      var cur_token = tokens[i];\n      if (cur_token[0] === 'tag') {\n        result = result + cur_token[1];\n        var matched = tags_to_skip.exec(cur_token[1]);\n        if (matched) {\n          if (matched[1] === '/') {\n            in_pre = 0;\n          }\n          else {\n            in_pre = 1;\n          }\n        }\n      }\n      else {\n        var t = cur_token[1];\n        if (!in_pre) {\n          t = ProcessEscapes(t);\n          t = dash_sub_ref(t);\n        }\n        result = result + t;\n      }\n    }\n    return result;\n  };\n  exports.smartdashes = SmartDashes;\n  var SmartEllipses = function (text, attr) {\n    if (text === void 0) { text = ''; }\n    if (attr === void 0) { attr = '1'; }\n    if (typeof attr === 'number') {\n      attr = attr.toString();\n    }\n    else {\n      attr = attr.replace(/\\s/g, '');\n    }\n    if (attr === '0') {\n      // Do nothing\n      return text;\n    }\n    var tokens = _tokenize(text);\n    var result = '';\n    /**\n     * Keep track of when we're inside <pre> or <code> tags.\n     */\n    var in_pre = 0;\n    for (var i = 0; i < tokens.length; i++) {\n      var cur_token = tokens[i];\n      if (cur_token[0] === 'tag') {\n        result = result + cur_token[1];\n        var matched = tags_to_skip.exec(cur_token[1]);\n        if (matched) {\n          if (matched[1] === '/') {\n            in_pre = 0;\n          }\n          else {\n            in_pre = 1;\n          }\n        }\n      }\n      else {\n        var t = cur_token[1];\n        if (!in_pre) {\n          t = ProcessEscapes(t);\n          t = EducateEllipses(t);\n        }\n        result = result + t;\n      }\n    }\n    return result;\n  };\n  exports.smartellipses = SmartEllipses;\n  /**\n   * @param {string} str String\n   * @return {string} The string, with \"educated\" curly quote HTML entities.\n   *\n   * Example input:  \"Isn't this fun?\"\n   * Example output: &#8220;Isn&#8217;t this fun?&#8221;\n   */\n  var EducateQuotes = function (str) {\n    /**\n     * Make our own \"punctuation\" character class, because the POSIX-style\n     * [:PUNCT:] is only available in Perl 5.6 or later:\n     *\n     * JavaScript don't have punctuation class neither.\n     */\n    var punct_class = '[!\"#\\$\\%\\'()*+,-./:;<=>?\\@\\[\\\\\\]\\^_`{|}~]'; // eslint-disable-line no-useless-escape\n    /**\n     * Special case if the very first character is a quote\n     * followed by punctuation at a non-word-break. Close the quotes by brute force:\n     */\n    str = str.replace(new RegExp(\"^'(?=\" + punct_class + \"B)\"), '&#8217;'); // eslint-disable-line no-useless-escape\n    str = str.replace(new RegExp(\"^\\\"(?=\" + punct_class + \"B)\"), '&#8221;'); // eslint-disable-line no-useless-escape\n    /**\n     * Special case for double sets of quotes, e.g.:\n     *   <p>He said, \"'Quoted' words in a larger quote.\"</p>\n     */\n    str = str.replace(/\"'(?=\\w)/, '&#8220;&#8216;');\n    str = str.replace(/'\"(?=\\w)/, '&#8216;&#8220;');\n    /**\n     * Special case for decade abbreviations (the '80s):\n     */\n    str = str.replace(/'(?=\\d\\d)/, '&#8217;');\n    var close_class = '[^\\ \\t\\r\\n\\[\\{\\(\\-]'; // eslint-disable-line no-useless-escape\n    var dec_dashes = '&#8211;|&#8212;';\n    /**\n     * Get most opening single quotes:\n     * s {\n     *     (\n     *         \\s          |   # a whitespace char, or\n     *         &nbsp;      |   # a non-breaking space entity, or\n     *         --          |   # dashes, or\n     *         &[mn]dash;  |   # named dash entities\n     *         $dec_dashes |   # or decimal entities\n     *         &\\#x201[34];    # or hex\n     *     )\n     *     '                   # the quote\n     *     (?=\\w)              # followed by a word character\n     * } {$1&#8216;}xg;\n     */\n    str = str.replace(new RegExp(\"(s|&nbsp;|--|&[mn]dash;|\" + dec_dashes + \"|&#x201[34])'(?=w)\", 'g'), '\\$1&#8216;'); // eslint-disable-line no-useless-escape\n    /**\n     * Single closing quotes:\n     * s {\n     *     ($close_class)?\n     *     '\n     *     (?(1)|          # If $1 captured, then do nothing;\n     *       (?=\\s | s\\b)  # otherwise, positive lookahead for a whitespace\n     *     )               # char or an 's' at a word ending position. This\n     *                     # is a special case to handle something like:\n     *                     # \"<i>Custer</i>'s Last Stand.\"\n     * } {$1&#8217;}xgi;\n     */\n    str = str.replace(new RegExp(\"(\" + close_class + \")'\", 'g'), '\\$1&#8217;'); // eslint-disable-line no-useless-escape\n    str = str.replace(new RegExp(\"(?<!\" + close_class + \")'(?=s|s\\b)\", 'g'), '&#8217;'); // eslint-disable-line no-useless-escape\n    /**\n     * Any remaining single quotes should be opening ones:\n     */\n    str = str.replace(/'/g, '&#8216;');\n    /**\n     * Get most opening double quotes:\n     * s {\n     *     (\n     *         \\s          |   # a whitespace char, or\n     *         &nbsp;      |   # a non-breaking space entity, or\n     *         --          |   # dashes, or\n     *         &[mn]dash;  |   # named dash entities\n     *         $dec_dashes |   # or decimal entities\n     *         &\\#x201[34];    # or hex\n     *     )\n     *     \"                   # the quote\n     *     (?=\\w)              # followed by a word character\n     * } {$1&#8220;}xg;\n     */\n    str = str.replace(new RegExp(\"(s|&nbsp;|--|&[mn]dash;|\" + dec_dashes + \"|&#x201[34])\\\"(?=w)\", 'g'), '\\$1&#8220;'); // eslint-disable-line no-useless-escape\n    /**\n     * Double closing quotes:\n     * s {\n     *     ($close_class)?\n     *     \"\n     *     (?(1)|(?=\\s))   # If $1 captured, then do nothing;\n     *                        # if not, then make sure the next char is whitespace.\n     * } {$1&#8221;}xg;\n     */\n    str = str.replace(new RegExp(\"(\" + close_class + \")\\\"\", 'g'), '\\$1&#8221;'); // eslint-disable-line no-useless-escape\n    str = str.replace(new RegExp(\"(?<!\" + close_class + \")\\\"(?=s)\", 'g'), '&#8221;'); // eslint-disable-line no-useless-escape\n    /**\n     * Any remaining quotes should be opening ones.\n     */\n    str = str.replace(/\"/g, '&#8220;');\n    return str;\n  };\n  /**\n   * @param {string} str String\n   * @return {string} The string, with ``backticks'' -style double quotes\n   *                  translated into HTML curly quote entities.\n   *\n   * Example input:  ``Isn't this fun?''\n   * Example output: &#8220;Isn't this fun?&#8221;\n   */\n  var EducateBackticks = function (str) {\n    str = str.replace(/``/g, '&#8220;');\n    str = str.replace(/''/g, '&#8221;');\n    return str;\n  };\n  /**\n   * @param {string} str String\n   * @return {string} The string, with `backticks' -style single quotes\n   *                  translated into HTML curly quote entities.\n   *\n   * Example input:  `Isn't this fun?'\n   * Example output: &#8216;Isn&#8217;t this fun?&#8217;\n   */\n  var EducateSingleBackticks = function (str) {\n    str = str.replace(/`/g, '&#8216;');\n    str = str.replace(/'/g, '&#8217;');\n    return str;\n  };\n  /**\n   * @param {string} str String\n   * @return {string} The string, with each instance of \"--\" translated to\n   *                  an em-dash HTML entity.\n   */\n  var EducateDashes = function (str) {\n    str = str.replace(/--/g, '&#8212;');\n    return str;\n  };\n  /**\n   * @param {string} str String\n   * @return {string} The string, with each instance of \"--\" translated to\n   *                  an en-dash HTML entity, and each \"---\" translated to\n   *                  an em-dash HTML entity.\n   */\n  var EducateDashesOldSchool = function (str) {\n    str = str.replace(/---/g, '&#8212;');\n    str = str.replace(/--/g, '&#8211;');\n    return str;\n  };\n  /**\n   * @param {string} str String\n   * @return {string} The string, with each instance of \"--\" translated to\n   *                  an em-dash HTML entity, and each \"---\" translated to\n   *                  an en-dash HTML entity. Two reasons why: First, unlike the\n   *                  en- and em-dash syntax supported by\n   *                  EducateDashesOldSchool(), it's compatible with existing\n   *                  entries written before SmartyPants 1.1, back when \"--\" was\n   *                  only used for em-dashes.  Second, em-dashes are more\n   *                  common than en-dashes, and so it sort of makes sense that\n   *                  the shortcut should be shorter to type. (Thanks to Aaron\n   *                  Swartz for the idea.)\n   */\n  var EducateDashesOldSchoolInverted = function (str) {\n    str = str.replace(/---/g, '&#8211;');\n    str = str.replace(/--/g, '&#8212;');\n    return str;\n  };\n  /**\n   * @param {string} str String\n   * @return {string} The string, with each instance of \"...\" translated to\n   *                  an ellipsis HTML entity. Also converts the case where\n   *                  there are spaces between the dots.\n   *\n   * Example input:  Huh...?\n   * Example output: Huh&#8230;?\n   */\n  var EducateEllipses = function (str) {\n    str = str.replace(/\\.\\.\\./g, '&#8230;');\n    str = str.replace(/\\. \\. \\./g, '&#8230;');\n    return str;\n  };\n  /**\n   * @param {string} str String\n   * @return {string} The string, with each SmartyPants HTML entity translated to\n   *                  its ASCII counterpart.\n   *\n   * Example input:  &#8220;Hello &#8212; world.&#8221;\n   * Example output: \"Hello -- world.\"\n   */\n  var StupefyEntities = function (str) {\n    str = str.replace(/&#8211;/g, '-'); // en-dash\n    str = str.replace(/&#8212;/g, '--'); // em-dash\n    str = str.replace(/&#8216;/g, '\\''); // open single quote\n    str = str.replace(/&#8217;/g, '\\''); // close single quote\n    str = str.replace(/&#8220;/g, '\"'); // open double quote\n    str = str.replace(/&#8221;/g, '\"'); // close double quote\n    str = str.replace(/&#8230;/g, '...'); // ellipsis\n    return str;\n  };\n  /**\n   * @param {string} str String\n   * @return {string} The string, with each SmartyPants HTML entity translated to\n   *                  UTF-8 characters.\n   *\n   * Example input:  “Hello &#8217; world.”\n   * Example output: \"Hello — world.\"\n   */\n  var EducateEntities = function (text, attr) {\n    if (attr === void 0) { attr = '1'; }\n    var do_quotes;\n    var do_backticks;\n    var do_dashes;\n    var do_ellipses;\n    // var do_stupefy:number;\n    if (typeof attr === 'number') {\n      attr = attr.toString();\n    }\n    else {\n      attr = attr.replace(/\\s/g, '');\n    }\n    if (attr === '0') {\n      // Do nothing\n      return text;\n    }\n    else if (attr === '1') {\n      // Do everything, turn all options on.\n      do_quotes = 1;\n      do_backticks = 1;\n      do_dashes = 1;\n      do_ellipses = 1;\n    }\n    else if (attr === '2') {\n      // Do everything, turn all options on, use old school dash shorthand.\n      do_quotes = 1;\n      do_backticks = 1;\n      do_dashes = 3;\n      do_ellipses = 1;\n    }\n    else if (attr === '3') {\n      // Do everything, turn all options on, use inverted old school dash shorthand.\n      do_quotes = 1;\n      do_backticks = 1;\n      do_dashes = 3;\n      do_ellipses = 1;\n      // } else if (attr === '-1') {\n      //   // Special \"stupefy\" mode.\n      //   do_stupefy = 1;\n    }\n    else {\n      for (var i = 0; i < attr.length; i++) {\n        var c = attr[i];\n        if (c === 'q') {\n          do_quotes = 1;\n        }\n        if (c === 'b') {\n          do_backticks = 1;\n        }\n        if (c === 'B') {\n          do_backticks = 2;\n        }\n        if (c === 'd') {\n          do_dashes = 1;\n        }\n        if (c === 'D') {\n          do_dashes = 2;\n        }\n        if (c === 'i') {\n          do_dashes = 3;\n        }\n        if (c === 'e') {\n          do_ellipses = 1;\n        }\n      }\n    }\n    if (do_dashes) {\n      text = text.replace(/&#8211;/g, '\\u2013'); // en-dash\n      text = text.replace(/&#8212;/g, '\\u2014'); // em-dash\n    }\n    if (do_quotes || do_backticks) {\n      text = text.replace(/&#8216;/g, '\\u2018'); // open single quote\n      text = text.replace(/&#8217;/g, '\\u2019'); // close single quote\n      text = text.replace(/&#8220;/g, '\\u201c'); // open double quote\n      text = text.replace(/&#8221;/g, '\\u201d'); // close double quote\n    }\n    if (do_ellipses) {\n      text = text.replace(/&#8230;/g, '\\u2026'); // ellipsis\n    }\n    return text;\n  };\n  /**\n   * @param {string} str String\n   * @return {string} The string, with each SmartyPants UTF-8 chars translated to\n   *                  its ASCII counterpart.\n   *\n   * Example input:  &#8220;Hello &#8212; world.&#8221;\n   * Example output: \"Hello -- world.\"\n   */\n  var StupifyUTF8Char = function (str) {\n    str = str.replace(/\\u2013/g, '-'); // en-dash\n    str = str.replace(/\\u2014/g, '--'); // em-dash\n    str = str.replace(/\\u2018/g, '\\''); // open single quote\n    str = str.replace(/\\u2019/g, '\\''); // close single quote\n    str = str.replace(/\\u201c/g, '\"'); // open double quote\n    str = str.replace(/\\u201d/g, '\"'); // close double quote\n    str = str.replace(/\\u2026/g, '...'); // ellipsis\n    return str;\n  };\n  /**\n   * @param {string} str String\n   * @return {string} string, with after processing the following backslash\n   *                  escape sequences. This is useful if you want to force a \"dumb\"\n   *                  quote or other character to appear.\n   *\n   *                  Escape  Value\n   *                  ------  -----\n   *                  \\\\      &#92;\n   *                  \\\"      &#34;\n   *                  \\'      &#39;\n   *                  \\.      &#46;\n   *                  \\-      &#45;\n   *                  \\`      &#96;\n   *\n   */\n  var ProcessEscapes = function (str) {\n    str = str.replace(/\\\\\\\\/g, '&#92;');\n    str = str.replace(/\\\\\"/g, '&#34;');\n    str = str.replace(/\\\\'/g, '&#39;');\n    str = str.replace(/\\\\\\./g, '&#46;');\n    str = str.replace(/\\\\-/g, '&#45;');\n    str = str.replace(/\\\\`/g, '&#96;');\n    return str;\n  };\n  /**\n   * @param {string} str String containing HTML markup.\n   * @return {Array<token>} Reference to an array of the tokens comprising the input\n   *                        string. Each token is either a tag (possibly with nested,\n   *                        tags contained therein, such as <a href=\"<MTFoo>\">, or a\n   *                        run of text between tags. Each element of the array is a\n   *                        two-element array; the first is either 'tag' or 'text';\n   *                        the second is the actual value.\n   *\n   * Based on the _tokenize() subroutine from Brad Choate's MTRegex plugin.\n   *     <http://www.bradchoate.com/past/mtregex.php>\n   */\n  var _tokenize = function (str) {\n    var pos = 0;\n    var len = str.length;\n    var tokens = [];\n    var match = /<!--[\\s\\S]*?-->|<\\?.*?\\?>|<[^>]*>/g;\n    var matched = null;\n    while (matched = match.exec(str)) { // eslint-disable-line no-cond-assign\n      if (pos < matched.index) {\n        var t_1 = ['text', str.substring(pos, matched.index)];\n        tokens.push(t_1);\n      }\n      var t = ['tag', matched.toString()];\n      tokens.push(t);\n      pos = match.lastIndex;\n    }\n    if (pos < len) {\n      var t = ['text', str.substring(pos, len)];\n      tokens.push(t);\n    }\n    return tokens;\n  };\n  var smartypantsu = function (text, attr) {\n    if (text === void 0) { text = ''; }\n    if (attr === void 0) { attr = '1'; }\n    var str = SmartyPants(text, attr);\n    if (typeof attr === 'number') {\n      attr = attr.toString();\n    }\n    else {\n      attr = attr.replace(/\\s/g, '');\n    }\n    if (attr === '-1') {\n      return StupifyUTF8Char(str);\n    }\n    else {\n      return EducateEntities(str, attr);\n    }\n  };\n  exports.smartypantsu = smartypantsu;\n  exports[\"default\"] = SmartyPants;\n\n\n}));\n"]}