{"version":3,"sources":["es2015/utils.js","es2015/html-tag.js","es2015/anchor-tag-builder.js","es2015/htmlParser/comment-node.js","es2015/htmlParser/element-node.js","es2015/htmlParser/entity-node.js","es2015/htmlParser/text-node.js","es2015/htmlParser/html-parser.js","es2015/match/email-match.js","es2015/match/hashtag-match.js","es2015/match/mention-match.js","es2015/match/phone-match.js","es2015/match/url-match.js","es2015/matcher/email-matcher.js","es2015/matcher/url-matcher.js","es2015/matcher/hashtag-matcher.js","es2015/matcher/phone-matcher.js","es2015/matcher/mention-matcher.js","es2015/truncate/truncate-end.js","es2015/truncate/truncate-smart.js","es2015/truncate/truncate-middle.js","es2015/htmlParser/html-node.js","es2015/match/match.js","es2015/matcher/matcher.js","es2015/regex-lib.js","es2015/matcher/tld-regex.js","es2015/matcher/url-match-validator.js","es2015/autolinker.js"],"names":["indexOf","arr","element","Array","prototype","i","len","length","remove","fn","splice","HtmlTag","cfg","this","tagName","attrs","innerHTML","whitespaceRegex","innerHtml","setTagName","getTagName","setAttr","attrName","attrValue","getAttrs","getAttr","setAttrs","Object","assign","setClass","cssClass","addClass","newClass","classAttr","getClass","classes","split","newClasses","shift","push","join","removeClass","removeClasses","idx","hasClass","setInnerHTML","html","setInnerHtml","getInnerHTML","getInnerHtml","toAnchorString","attrsStr","buildAttrsStr","attrsArr","prop","hasOwnProperty","extendStatics","tagNameRegex","attrNameRegex","attrValueRegex","optionalAttrValueRegex","getNameEqualsValueRegex","AnchorTagBuilder","newWindow","truncate","className","build","match","createAttrs","processAnchorText","getAnchorText","href","getAnchorHref","createCssClass","returnClasses","cssClassSuffixes","getCssClassSuffixes","anchorText","doTruncate","ellipsisChars","str","truncateLen","ellipsisLength","truncateLength","truncateLocation","location","url","ellipsisLengthBeforeParsing","buildUrl","urlObj","scheme","host","path","query","fragment","buildSegment","segment","remainingAvailableLength","remainingAvailableLengthHalf","startOffset","Math","ceil","endOffset","floor","end","substr","urlSub","availableLength","matchQuery","replace","pathAndQuery","truncateSmart","truncateMiddle","substring","HtmlNode","offset","text","getOffset","getText","__extends","d","b","setPrototypeOf","__proto__","p","__","constructor","create","CommentNode","_super","_this","call","comment","getType","getComment","ElementNode","closing","isClosing","EntityNode","apply","arguments","TextNode","htmlRegex","source","group","RegExp","htmlCharacterEntitiesRegex","HtmlParser","parse","currentResult","textAndEntityNodes","lastIndex","nodes","exec","tagText","commentText","isClosingTag","index","inBetweenTagsText","parseTextAndEntityNodes","createCommentNode","createElementNode","forEach","node","textAndEntityTokens","splitRegex","global","Error","result","lastIdx","splitAndCapture","textToken","entityToken","createTextNode","createEntityNode","trim","toLowerCase","Match","__jsduckDummyDocProp","matchedText","tagBuilder","getMatchedText","setOffset","buildTag","EmailMatch","email","getEmail","HashtagMatch","serviceName","hashtag","getServiceName","getHashtag","MentionMatch","mention","getMention","PhoneMatch","number","plusSign","getNumber","UrlMatch","urlMatchType","protocolUrlMatch","protocolRelativeMatch","stripPrefix","www","stripTrailingSlash","decodePercentEncoding","schemePrefixRegex","wwwPrefixRegex","protocolRelativeRegex","protocolPrepended","getUrlMatchType","getUrl","stripProtocolRelativePrefix","stripSchemePrefix","stripWwwPrefix","removeTrailingSlash","removePercentEncoding","charAt","slice","preProcessedEntityAnchorText","decodeURIComponent","e","Matcher","alphaCharsStr","decimalNumbersStr","alphaNumericCharsStr","ipStr","domainLabelStr","getDomainLabelStr","getDomainNameStr","tldRegex","EmailMatcher","validCharacters","emailRegex","matcherRegex","parseMatches","matches","UrlMatchValidator","isValid","urlMatch","isValidUriScheme","urlMatchDoesNotHaveProtocolOrDot","urlMatchDoesNotHaveAtLeastOneWordChar","isValidIpAddress","containsMultipleDots","uriSchemeMatch","newRegex","hasFullProtocolRegex","ipRegex","stringBeforeSlash","test","uriSchemeMatchArr","uriSchemeRegex","uriScheme","hasWordCharAfterProtocolRegex","UrlMatcher","urlSuffixRegex","wordCharRegExp","openParensRe","closeParensRe","matchStr","schemeUrlMatch","wwwUrlMatch","wwwProtocolRelativeMatch","tldProtocolRelativeMatch","prevChar","matchHasUnbalancedClosingParen","pos","matchHasInvalidCharAfterTld","openParensMatch","closeParensMatch","res","HashtagMatcher","nonWordCharRegex","PhoneMatcher","cleanNumber","before","after","contextClear","testMatch","MentionMatcher","matcherRegexes","twitter","instagram","soundcloud","Autolinker","version","urls","phone","replaceFn","context","undefined","htmlParser","matchers","normalizeUrlsCfg","normalizeStripPrefixCfg","normalizeTruncateCfg","link","textOrHtml","options","schemeMatches","wwwMatches","tldMatches","dest","src","defaults","Number","POSITIVE_INFINITY","htmlNodes","skipTagNames","skipTagsStackCount","nodeType","max","textNodeMatches","parseText","compactMatches","removeUnwantedMatches","sort","a","matchedTextLength","endIdx","removeIdx","m","getMatchers","numMatchers","textMatches","j","numTextMatches","newHtml","createMatchReturnVal","replaceFnResult","getTagBuilder","matcher","Email","Hashtag","Mention","Phone","Url"],"mappings":";;;;;;;;;gMA+CO,SAASA,EAAQC,EAAKC,GACzB,GAAIC,MAAMC,UAAUJ,QAChB,OAAOC,EAAID,QAAQE,GAGnB,IAAK,IAAIG,EAAI,EAAGC,EAAML,EAAIM,OAAQF,EAAIC,EAAKD,IACvC,GAAIJ,EAAII,KAAOH,EACX,OAAOG,EAEf,OAAQ,EAiBT,SAASG,EAAOP,EAAKQ,GACxB,IAAK,IAAIJ,EAAIJ,EAAIM,OAAS,EAAQ,GAALF,EAAQA,KACd,IAAfI,EAAGR,EAAII,KACPJ,EAAIS,OAAOL,EAAG,GCD1B,IAAIM,EAAyB,WAKzB,SAASA,EAAQC,QACD,IAARA,IAAkBA,EAAM,IAS5BC,KAAKC,QAAU,GAOfD,KAAKE,MAAQ,GAMbF,KAAKG,UAAY,GAOjBH,KAAKI,gBAAkB,MACvBJ,KAAKC,QAAUF,EAAIE,SAAW,GAC9BD,KAAKE,MAAQH,EAAIG,OAAS,GAC1BF,KAAKG,UAAYJ,EAAIM,WAAaN,EAAII,WAAa,GAsLvD,OA9KAL,EAAQP,UAAUe,WAAa,SAAUL,GAErC,OADAD,KAAKC,Q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KoD,aAGjBmH,GAUX0G,EAAWC,QAAU,QAKrBD,EAAWhO,iBAAmBA,EAK9BgO,EAAWnR,QAAUA,EAKrBmR,EAAW+C,QAAU,CACjBC,MAAOtG,GACPuG,QAAS9D,GACTlD,QAASA,EACTiH,QAASvD,GACTwD,MAAO9D,GACP+D,IAAKlF,IAMT8B,EAAW3N,MAAQ,CACf2Q,MAAOtJ,EACPuJ,QAASpJ,EACTV,MAAOA,EACP+J,QAAShJ,EACTiJ,MAAO9I,EACP+I,IAAK3I,GAEFuF,EAtuBG","file":"Autolinker.min.js","sourcesContent":["/**\n * Assigns (shallow copies) the properties of `src` onto `dest`, if the\n * corresponding property on `dest` === `undefined`.\n *\n * @param {Object} dest The destination object.\n * @param {Object} src The source object.\n * @return {Object} The destination object (`dest`)\n */\nexport function defaults(dest, src) {\n for (var prop in src) {\n if (src.hasOwnProperty(prop) && dest[prop] === undefined) {\n dest[prop] = src[prop];\n }\n }\n return dest;\n}\n/**\n * Truncates the `str` at `len - ellipsisChars.length`, and adds the `ellipsisChars` to the\n * end of the string (by default, two periods: '..'). If the `str` length does not exceed\n * `len`, the string will be returned unchanged.\n *\n * @param {String} str The string to truncate and add an ellipsis to.\n * @param {Number} truncateLen The length to truncate the string at.\n * @param {String} [ellipsisChars=...] The ellipsis character(s) to add to the end of `str`\n * when truncated. Defaults to '...'\n */\nexport function ellipsis(str, truncateLen, ellipsisChars) {\n var ellipsisLength;\n if (str.length > truncateLen) {\n if (ellipsisChars == null) {\n ellipsisChars = '…';\n ellipsisLength = 3;\n }\n else {\n ellipsisLength = ellipsisChars.length;\n }\n str = str.substring(0, truncateLen - ellipsisLength) + ellipsisChars;\n }\n return str;\n}\n/**\n * Supports `Array.prototype.indexOf()` functionality for old IE (IE8 and below).\n *\n * @param {Array} arr The array to find an element of.\n * @param {*} element The element to find in the array, and return the index of.\n * @return {Number} The index of the `element`, or -1 if it was not found.\n */\nexport function indexOf(arr, element) {\n if (Array.prototype.indexOf) {\n return arr.indexOf(element);\n }\n else {\n for (var i = 0, len = arr.length; i < len; i++) {\n if (arr[i] === element)\n return i;\n }\n return -1;\n }\n}\n/**\n * Removes array elements based on a filtering function. Mutates the input\n * array.\n *\n * Using this instead of the ES5 Array.prototype.filter() function, to allow\n * Autolinker compatibility with IE8, and also to prevent creating many new\n * arrays in memory for filtering.\n *\n * @param {Array} arr The array to remove elements from. This array is\n * mutated.\n * @param {Function} fn A function which should return `true` to\n * remove an element.\n * @return {Array} The mutated input `arr`.\n */\nexport function remove(arr, fn) {\n for (var i = arr.length - 1; i >= 0; i--) {\n if (fn(arr[i]) === true) {\n arr.splice(i, 1);\n }\n }\n}\n/**\n * Performs the functionality of what modern browsers do when `String.prototype.split()` is called\n * with a regular expression that contains capturing parenthesis.\n *\n * For example:\n *\n * // Modern browsers:\n * \"a,b,c\".split( /(,)/ ); // --> [ 'a', ',', 'b', ',', 'c' ]\n *\n * // Old IE (including IE8):\n * \"a,b,c\".split( /(,)/ ); // --> [ 'a', 'b', 'c' ]\n *\n * This method emulates the functionality of modern browsers for the old IE case.\n *\n * @param {String} str The string to split.\n * @param {RegExp} splitRegex The regular expression to split the input `str` on. The splitting\n * character(s) will be spliced into the array, as in the \"modern browsers\" example in the\n * description of this method.\n * Note #1: the supplied regular expression **must** have the 'g' flag specified.\n * Note #2: for simplicity's sake, the regular expression does not need\n * to contain capturing parenthesis - it will be assumed that any match has them.\n * @return {String[]} The split array of strings, with the splitting character(s) included.\n */\nexport function splitAndCapture(str, splitRegex) {\n if (!splitRegex.global)\n throw new Error(\"`splitRegex` must have the 'g' flag set\");\n var result = [], lastIdx = 0, match;\n while (match = splitRegex.exec(str)) {\n result.push(str.substring(lastIdx, match.index));\n result.push(match[0]); // push the splitting char(s)\n lastIdx = match.index + match[0].length;\n }\n result.push(str.substring(lastIdx));\n return result;\n}\n\n//# sourceMappingURL=utils.js.map\n","import { indexOf } from \"./utils\";\n/**\n * @class Autolinker.HtmlTag\n * @extends Object\n *\n * Represents an HTML tag, which can be used to easily build/modify HTML tags programmatically.\n *\n * Autolinker uses this abstraction to create HTML tags, and then write them out as strings. You may also use\n * this class in your code, especially within a {@link Autolinker#replaceFn replaceFn}.\n *\n * ## Examples\n *\n * Example instantiation:\n *\n * var tag = new Autolinker.HtmlTag( {\n * tagName : 'a',\n * attrs : { 'href': 'http://google.com', 'class': 'external-link' },\n * innerHtml : 'Google'\n * } );\n *\n * tag.toAnchorString(); // Google\n *\n * // Individual accessor methods\n * tag.getTagName(); // 'a'\n * tag.getAttr( 'href' ); // 'http://google.com'\n * tag.hasClass( 'external-link' ); // true\n *\n *\n * Using mutator methods (which may be used in combination with instantiation config properties):\n *\n * var tag = new Autolinker.HtmlTag();\n * tag.setTagName( 'a' );\n * tag.setAttr( 'href', 'http://google.com' );\n * tag.addClass( 'external-link' );\n * tag.setInnerHtml( 'Google' );\n *\n * tag.getTagName(); // 'a'\n * tag.getAttr( 'href' ); // 'http://google.com'\n * tag.hasClass( 'external-link' ); // true\n *\n * tag.toAnchorString(); // Google\n *\n *\n * ## Example use within a {@link Autolinker#replaceFn replaceFn}\n *\n * var html = Autolinker.link( \"Test google.com\", {\n * replaceFn : function( match ) {\n * var tag = match.buildTag(); // returns an {@link Autolinker.HtmlTag} instance, configured with the Match's href and anchor text\n * tag.setAttr( 'rel', 'nofollow' );\n *\n * return tag;\n * }\n * } );\n *\n * // generated html:\n * // Test google.com\n *\n *\n * ## Example use with a new tag for the replacement\n *\n * var html = Autolinker.link( \"Test google.com\", {\n * replaceFn : function( match ) {\n * var tag = new Autolinker.HtmlTag( {\n * tagName : 'button',\n * attrs : { 'title': 'Load URL: ' + match.getAnchorHref() },\n * innerHtml : 'Load URL: ' + match.getAnchorText()\n * } );\n *\n * return tag;\n * }\n * } );\n *\n * // generated html:\n * // Test \n */\nvar HtmlTag = /** @class */ (function () {\n /**\n * @method constructor\n * @param {Object} [cfg] The configuration properties for this class, in an Object (map)\n */\n function HtmlTag(cfg) {\n if (cfg === void 0) { cfg = {}; }\n /**\n * @cfg {String} tagName\n *\n * The tag name. Ex: 'a', 'button', etc.\n *\n * Not required at instantiation time, but should be set using {@link #setTagName} before {@link #toAnchorString}\n * is executed.\n */\n this.tagName = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Object.} attrs\n *\n * An key/value Object (map) of attributes to create the tag with. The keys are the attribute names, and the\n * values are the attribute values.\n */\n this.attrs = {}; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {String} innerHTML\n *\n * The inner HTML for the tag.\n */\n this.innerHTML = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @protected\n * @property {RegExp} whitespaceRegex\n *\n * Regular expression used to match whitespace in a string of CSS classes.\n */\n this.whitespaceRegex = /\\s+/; // default value just to get the above doc comment in the ES5 output and documentation generator\n this.tagName = cfg.tagName || '';\n this.attrs = cfg.attrs || {};\n this.innerHTML = cfg.innerHtml || cfg.innerHTML || ''; // accept either the camelCased form or the fully capitalized acronym as in the DOM\n }\n /**\n * Sets the tag name that will be used to generate the tag with.\n *\n * @param {String} tagName\n * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained.\n */\n HtmlTag.prototype.setTagName = function (tagName) {\n this.tagName = tagName;\n return this;\n };\n /**\n * Retrieves the tag name.\n *\n * @return {String}\n */\n HtmlTag.prototype.getTagName = function () {\n return this.tagName || '';\n };\n /**\n * Sets an attribute on the HtmlTag.\n *\n * @param {String} attrName The attribute name to set.\n * @param {String} attrValue The attribute value to set.\n * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained.\n */\n HtmlTag.prototype.setAttr = function (attrName, attrValue) {\n var tagAttrs = this.getAttrs();\n tagAttrs[attrName] = attrValue;\n return this;\n };\n /**\n * Retrieves an attribute from the HtmlTag. If the attribute does not exist, returns `undefined`.\n *\n * @param {String} attrName The attribute name to retrieve.\n * @return {String} The attribute's value, or `undefined` if it does not exist on the HtmlTag.\n */\n HtmlTag.prototype.getAttr = function (attrName) {\n return this.getAttrs()[attrName];\n };\n /**\n * Sets one or more attributes on the HtmlTag.\n *\n * @param {Object.} attrs A key/value Object (map) of the attributes to set.\n * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained.\n */\n HtmlTag.prototype.setAttrs = function (attrs) {\n Object.assign(this.getAttrs(), attrs);\n return this;\n };\n /**\n * Retrieves the attributes Object (map) for the HtmlTag.\n *\n * @return {Object.} A key/value object of the attributes for the HtmlTag.\n */\n HtmlTag.prototype.getAttrs = function () {\n return this.attrs || (this.attrs = {});\n };\n /**\n * Sets the provided `cssClass`, overwriting any current CSS classes on the HtmlTag.\n *\n * @param {String} cssClass One or more space-separated CSS classes to set (overwrite).\n * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained.\n */\n HtmlTag.prototype.setClass = function (cssClass) {\n return this.setAttr('class', cssClass);\n };\n /**\n * Convenience method to add one or more CSS classes to the HtmlTag. Will not add duplicate CSS classes.\n *\n * @param {String} cssClass One or more space-separated CSS classes to add.\n * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained.\n */\n HtmlTag.prototype.addClass = function (cssClass) {\n var classAttr = this.getClass(), whitespaceRegex = this.whitespaceRegex, classes = (!classAttr) ? [] : classAttr.split(whitespaceRegex), newClasses = cssClass.split(whitespaceRegex), newClass;\n while (newClass = newClasses.shift()) {\n if (indexOf(classes, newClass) === -1) {\n classes.push(newClass);\n }\n }\n this.getAttrs()['class'] = classes.join(\" \");\n return this;\n };\n /**\n * Convenience method to remove one or more CSS classes from the HtmlTag.\n *\n * @param {String} cssClass One or more space-separated CSS classes to remove.\n * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained.\n */\n HtmlTag.prototype.removeClass = function (cssClass) {\n var classAttr = this.getClass(), whitespaceRegex = this.whitespaceRegex, classes = (!classAttr) ? [] : classAttr.split(whitespaceRegex), removeClasses = cssClass.split(whitespaceRegex), removeClass;\n while (classes.length && (removeClass = removeClasses.shift())) {\n var idx = indexOf(classes, removeClass);\n if (idx !== -1) {\n classes.splice(idx, 1);\n }\n }\n this.getAttrs()['class'] = classes.join(\" \");\n return this;\n };\n /**\n * Convenience method to retrieve the CSS class(es) for the HtmlTag, which will each be separated by spaces when\n * there are multiple.\n *\n * @return {String}\n */\n HtmlTag.prototype.getClass = function () {\n return this.getAttrs()['class'] || \"\";\n };\n /**\n * Convenience method to check if the tag has a CSS class or not.\n *\n * @param {String} cssClass The CSS class to check for.\n * @return {Boolean} `true` if the HtmlTag has the CSS class, `false` otherwise.\n */\n HtmlTag.prototype.hasClass = function (cssClass) {\n return (' ' + this.getClass() + ' ').indexOf(' ' + cssClass + ' ') !== -1;\n };\n /**\n * Sets the inner HTML for the tag.\n *\n * @param {String} html The inner HTML to set.\n * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained.\n */\n HtmlTag.prototype.setInnerHTML = function (html) {\n this.innerHTML = html;\n return this;\n };\n /**\n * Backwards compatibility method name.\n *\n * @param {String} html The inner HTML to set.\n * @return {Autolinker.HtmlTag} This HtmlTag instance, so that method calls may be chained.\n */\n HtmlTag.prototype.setInnerHtml = function (html) {\n return this.setInnerHTML(html);\n };\n /**\n * Retrieves the inner HTML for the tag.\n *\n * @return {String}\n */\n HtmlTag.prototype.getInnerHTML = function () {\n return this.innerHTML || \"\";\n };\n /**\n * Backward compatibility method name.\n *\n * @return {String}\n */\n HtmlTag.prototype.getInnerHtml = function () {\n return this.getInnerHTML();\n };\n /**\n * Override of superclass method used to generate the HTML string for the tag.\n *\n * @return {String}\n */\n HtmlTag.prototype.toAnchorString = function () {\n var tagName = this.getTagName(), attrsStr = this.buildAttrsStr();\n attrsStr = (attrsStr) ? ' ' + attrsStr : ''; // prepend a space if there are actually attributes\n return ['<', tagName, attrsStr, '>', this.getInnerHtml(), ''].join(\"\");\n };\n /**\n * Support method for {@link #toAnchorString}, returns the string space-separated key=\"value\" pairs, used to populate\n * the stringified HtmlTag.\n *\n * @protected\n * @return {String} Example return: `attr1=\"value1\" attr2=\"value2\"`\n */\n HtmlTag.prototype.buildAttrsStr = function () {\n if (!this.attrs)\n return \"\"; // no `attrs` Object (map) has been set, return empty string\n var attrs = this.getAttrs(), attrsArr = [];\n for (var prop in attrs) {\n if (attrs.hasOwnProperty(prop)) {\n attrsArr.push(prop + '=\"' + attrs[prop] + '\"');\n }\n }\n return attrsArr.join(\" \");\n };\n return HtmlTag;\n}());\nexport { HtmlTag };\n\n//# sourceMappingURL=html-tag.js.map\n","import { HtmlTag } from \"./html-tag\";\nimport { truncateSmart } from \"./truncate/truncate-smart\";\nimport { truncateMiddle } from \"./truncate/truncate-middle\";\nimport { truncateEnd } from \"./truncate/truncate-end\";\n/**\n * @protected\n * @class Autolinker.AnchorTagBuilder\n * @extends Object\n *\n * Builds anchor (<a>) tags for the Autolinker utility when a match is\n * found.\n *\n * Normally this class is instantiated, configured, and used internally by an\n * {@link Autolinker} instance, but may actually be used indirectly in a\n * {@link Autolinker#replaceFn replaceFn} to create {@link Autolinker.HtmlTag HtmlTag}\n * instances which may be modified before returning from the\n * {@link Autolinker#replaceFn replaceFn}. For example:\n *\n * var html = Autolinker.link( \"Test google.com\", {\n * replaceFn : function( match ) {\n * var tag = match.buildTag(); // returns an {@link Autolinker.HtmlTag} instance\n * tag.setAttr( 'rel', 'nofollow' );\n *\n * return tag;\n * }\n * } );\n *\n * // generated html:\n * // Test google.com\n */\nvar AnchorTagBuilder = /** @class */ (function () {\n /**\n * @method constructor\n * @param {Object} [cfg] The configuration options for the AnchorTagBuilder instance, specified in an Object (map).\n */\n function AnchorTagBuilder(cfg) {\n if (cfg === void 0) { cfg = {}; }\n /**\n * @cfg {Boolean} newWindow\n * @inheritdoc Autolinker#newWindow\n */\n this.newWindow = false; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Object} truncate\n * @inheritdoc Autolinker#truncate\n */\n this.truncate = {}; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {String} className\n * @inheritdoc Autolinker#className\n */\n this.className = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n this.newWindow = cfg.newWindow || false;\n this.truncate = cfg.truncate || {};\n this.className = cfg.className || '';\n }\n /**\n * Generates the actual anchor (<a>) tag to use in place of the\n * matched text, via its `match` object.\n *\n * @param {Autolinker.match.Match} match The Match instance to generate an\n * anchor tag from.\n * @return {Autolinker.HtmlTag} The HtmlTag instance for the anchor tag.\n */\n AnchorTagBuilder.prototype.build = function (match) {\n return new HtmlTag({\n tagName: 'a',\n attrs: this.createAttrs(match),\n innerHtml: this.processAnchorText(match.getAnchorText())\n });\n };\n /**\n * Creates the Object (map) of the HTML attributes for the anchor (<a>)\n * tag being generated.\n *\n * @protected\n * @param {Autolinker.match.Match} match The Match instance to generate an\n * anchor tag from.\n * @return {Object} A key/value Object (map) of the anchor tag's attributes.\n */\n AnchorTagBuilder.prototype.createAttrs = function (match) {\n var attrs = {\n 'href': match.getAnchorHref() // we'll always have the `href` attribute\n };\n var cssClass = this.createCssClass(match);\n if (cssClass) {\n attrs['class'] = cssClass;\n }\n if (this.newWindow) {\n attrs['target'] = \"_blank\";\n attrs['rel'] = \"noopener noreferrer\";\n }\n if (this.truncate) {\n if (this.truncate.length && this.truncate.length < match.getAnchorText().length) {\n attrs['title'] = match.getAnchorHref();\n }\n }\n return attrs;\n };\n /**\n * Creates the CSS class that will be used for a given anchor tag, based on\n * the `matchType` and the {@link #className} config.\n *\n * Example returns:\n *\n * - \"\" // no {@link #className}\n * - \"myLink myLink-url\" // url match\n * - \"myLink myLink-email\" // email match\n * - \"myLink myLink-phone\" // phone match\n * - \"myLink myLink-hashtag\" // hashtag match\n * - \"myLink myLink-mention myLink-twitter\" // mention match with Twitter service\n *\n * @protected\n * @param {Autolinker.match.Match} match The Match instance to generate an\n * anchor tag from.\n * @return {String} The CSS class string for the link. Example return:\n * \"myLink myLink-url\". If no {@link #className} was configured, returns\n * an empty string.\n */\n AnchorTagBuilder.prototype.createCssClass = function (match) {\n var className = this.className;\n if (!className) {\n return \"\";\n }\n else {\n var returnClasses = [className], cssClassSuffixes = match.getCssClassSuffixes();\n for (var i = 0, len = cssClassSuffixes.length; i < len; i++) {\n returnClasses.push(className + '-' + cssClassSuffixes[i]);\n }\n return returnClasses.join(' ');\n }\n };\n /**\n * Processes the `anchorText` by truncating the text according to the\n * {@link #truncate} config.\n *\n * @private\n * @param {String} anchorText The anchor tag's text (i.e. what will be\n * displayed).\n * @return {String} The processed `anchorText`.\n */\n AnchorTagBuilder.prototype.processAnchorText = function (anchorText) {\n anchorText = this.doTruncate(anchorText);\n return anchorText;\n };\n /**\n * Performs the truncation of the `anchorText` based on the {@link #truncate}\n * option. If the `anchorText` is longer than the length specified by the\n * {@link #truncate} option, the truncation is performed based on the\n * `location` property. See {@link #truncate} for details.\n *\n * @private\n * @param {String} anchorText The anchor tag's text (i.e. what will be\n * displayed).\n * @return {String} The truncated anchor text.\n */\n AnchorTagBuilder.prototype.doTruncate = function (anchorText) {\n var truncate = this.truncate;\n if (!truncate || !truncate.length)\n return anchorText;\n var truncateLength = truncate.length, truncateLocation = truncate.location;\n if (truncateLocation === 'smart') {\n return truncateSmart(anchorText, truncateLength);\n }\n else if (truncateLocation === 'middle') {\n return truncateMiddle(anchorText, truncateLength);\n }\n else {\n return truncateEnd(anchorText, truncateLength);\n }\n };\n return AnchorTagBuilder;\n}());\nexport { AnchorTagBuilder };\n\n//# sourceMappingURL=anchor-tag-builder.js.map\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { HtmlNode } from \"./html-node\";\n/**\n * @class Autolinker.htmlParser.CommentNode\n * @extends Autolinker.htmlParser.HtmlNode\n *\n * Represents an HTML comment node that has been parsed by the\n * {@link Autolinker.htmlParser.HtmlParser}.\n *\n * See this class's superclass ({@link Autolinker.htmlParser.HtmlNode}) for more\n * details.\n */\nvar CommentNode = /** @class */ (function (_super) {\n __extends(CommentNode, _super);\n /**\n * @method constructor\n * @param {Object} cfg The configuration options for this class, specified\n * in an Object.\n */\n function CommentNode(cfg) {\n var _this = _super.call(this, cfg) || this;\n /**\n * @cfg {String} comment (required)\n *\n * The text inside the comment tag. This text is stripped of any leading or\n * trailing whitespace.\n */\n _this.comment = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n _this.comment = cfg.comment;\n return _this;\n }\n /**\n * Returns a string name for the type of node that this class represents.\n *\n * @return {String}\n */\n CommentNode.prototype.getType = function () {\n return 'comment';\n };\n /**\n * Returns the comment inside the comment tag.\n *\n * @return {String}\n */\n CommentNode.prototype.getComment = function () {\n return this.comment;\n };\n return CommentNode;\n}(HtmlNode));\nexport { CommentNode };\n\n//# sourceMappingURL=comment-node.js.map\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { HtmlNode } from \"./html-node\";\n/**\n * @class Autolinker.htmlParser.ElementNode\n * @extends Autolinker.htmlParser.HtmlNode\n *\n * Represents an HTML element node that has been parsed by the {@link Autolinker.htmlParser.HtmlParser}.\n *\n * See this class's superclass ({@link Autolinker.htmlParser.HtmlNode}) for more\n * details.\n */\nvar ElementNode = /** @class */ (function (_super) {\n __extends(ElementNode, _super);\n /**\n * @method constructor\n * @param {Object} cfg The configuration options for this class, specified\n * in an Object.\n */\n function ElementNode(cfg) {\n var _this = _super.call(this, cfg) || this;\n /**\n * @cfg {String} tagName (required)\n *\n * The name of the tag that was matched.\n */\n _this.tagName = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Boolean} closing (required)\n *\n * `true` if the element (tag) is a closing tag, `false` if its an opening\n * tag.\n */\n _this.closing = false; // default value just to get the above doc comment in the ES5 output and documentation generator\n _this.tagName = cfg.tagName;\n _this.closing = cfg.closing;\n return _this;\n }\n /**\n * Returns a string name for the type of node that this class represents.\n *\n * @return {String}\n */\n ElementNode.prototype.getType = function () {\n return 'element';\n };\n /**\n * Returns the HTML element's (tag's) name. Ex: for an <img> tag,\n * returns \"img\".\n *\n * @return {String}\n */\n ElementNode.prototype.getTagName = function () {\n return this.tagName;\n };\n /**\n * Determines if the HTML element (tag) is a closing tag. Ex: <div>\n * returns `false`, while </div> returns `true`.\n *\n * @return {Boolean}\n */\n ElementNode.prototype.isClosing = function () {\n return this.closing;\n };\n return ElementNode;\n}(HtmlNode));\nexport { ElementNode };\n\n//# sourceMappingURL=element-node.js.map\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { HtmlNode } from \"./html-node\";\n/**\n * @class Autolinker.htmlParser.EntityNode\n * @extends Autolinker.htmlParser.HtmlNode\n *\n * Represents a known HTML entity node that has been parsed by the {@link Autolinker.htmlParser.HtmlParser}.\n * Ex: '&nbsp;', or '&#160;' (which will be retrievable from the {@link #getText}\n * method.\n *\n * Note that this class will only be returned from the HtmlParser for the set of\n * checked HTML entity nodes defined by the {@link Autolinker.htmlParser.HtmlParser#htmlCharacterEntitiesRegex}.\n *\n * See this class's superclass ({@link Autolinker.htmlParser.HtmlNode}) for more\n * details.\n */\nvar EntityNode = /** @class */ (function (_super) {\n __extends(EntityNode, _super);\n function EntityNode() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Returns a string name for the type of node that this class represents.\n *\n * @return {String}\n */\n EntityNode.prototype.getType = function () {\n return 'entity';\n };\n return EntityNode;\n}(HtmlNode));\nexport { EntityNode };\n\n//# sourceMappingURL=entity-node.js.map\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { HtmlNode } from \"./html-node\";\n/**\n * @class Autolinker.htmlParser.TextNode\n * @extends Autolinker.htmlParser.HtmlNode\n *\n * Represents a text node that has been parsed by the {@link Autolinker.htmlParser.HtmlParser}.\n *\n * See this class's superclass ({@link Autolinker.htmlParser.HtmlNode}) for more\n * details.\n */\nvar TextNode = /** @class */ (function (_super) {\n __extends(TextNode, _super);\n function TextNode() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Returns a string name for the type of node that this class represents.\n *\n * @return {String}\n */\n TextNode.prototype.getType = function () {\n return 'text';\n };\n return TextNode;\n}(HtmlNode));\nexport { TextNode };\n\n//# sourceMappingURL=text-node.js.map\n","import { splitAndCapture } from \"../utils\";\nimport { CommentNode } from \"./comment-node\";\nimport { ElementNode } from \"./element-node\";\nimport { EntityNode } from \"./entity-node\";\nimport { TextNode } from \"./text-node\";\n/**\n * @private\n * @property {RegExp} htmlRegex\n *\n * The regular expression used to pull out HTML tags from a string. Handles namespaced HTML tags and\n * attribute names, as specified by http://www.w3.org/TR/html-markup/syntax.html.\n *\n * Capturing groups:\n *\n * 1. The \"!DOCTYPE\" tag name, if a tag is a <!DOCTYPE> tag.\n * 2. If it is an end tag, this group will have the '/'.\n * 3. If it is a comment tag, this group will hold the comment text (i.e.\n * the text inside the `<!--` and `-->`.\n * 4. The tag name for a tag without attributes (other than the <!DOCTYPE> tag)\n * 5. The tag name for a tag with attributes (other than the <!DOCTYPE> tag)\n */\nvar htmlRegex = (function () {\n var commentTagRegex = /!--([\\s\\S]+?)--/, tagNameRegex = /[0-9a-zA-Z][0-9a-zA-Z:]*/, attrNameRegex = /[^\\s\"'>\\/=\\x00-\\x1F\\x7F]+/, // the unicode range accounts for excluding control chars, and the delete char\n attrValueRegex = /(?:\"[^\"]*?\"|'[^']*?'|[^'\"=<>`\\s]+)/, // double quoted, single quoted, or unquoted attribute values\n optionalAttrValueRegex = '(?:\\\\s*?=\\\\s*?' + attrValueRegex.source + ')?'; // optional '=[value]'\n var getNameEqualsValueRegex = function (group) {\n return '(?=(' + attrNameRegex.source + '))\\\\' + group + optionalAttrValueRegex;\n };\n return new RegExp([\n // for tag. Ex: )\n '(?:',\n '<(!DOCTYPE)',\n // Zero or more attributes following the tag name\n '(?:',\n '\\\\s+',\n // Either:\n // A. attr=\"value\", or\n // B. \"value\" alone (To cover example doctype tag: )\n // *** Capturing Group 2 - Pseudo-atomic group for attrNameRegex\n '(?:', getNameEqualsValueRegex(2), '|', attrValueRegex.source + ')',\n ')*',\n '>',\n ')',\n '|',\n // All other HTML tags (i.e. tags that are not )\n '(?:',\n '<(/)?',\n // *** Capturing Group 3: The slash or an empty string. Slash ('/') for end tag, empty string for start or self-closing tag.\n '(?:',\n commentTagRegex.source,\n '|',\n // Handle tag without attributes.\n // Doing this separately from a tag that has attributes\n // to fix a regex time complexity issue seen with the\n // example in https://github.com/gregjacobs/Autolinker.js/issues/172\n '(?:',\n // *** Capturing Group 5 - The tag name for a tag without attributes\n '(' + tagNameRegex.source + ')',\n '\\\\s*/?',\n ')',\n '|',\n // Handle tag with attributes\n // Doing this separately from a tag with no attributes\n // to fix a regex time complexity issue seen with the\n // example in https://github.com/gregjacobs/Autolinker.js/issues/172\n '(?:',\n // *** Capturing Group 6 - The tag name for a tag with attributes\n '(' + tagNameRegex.source + ')',\n '\\\\s+',\n // Zero or more attributes following the tag name\n '(?:',\n '(?:\\\\s+|\\\\b)',\n // *** Capturing Group 7 - Pseudo-atomic group for attrNameRegex\n getNameEqualsValueRegex(7),\n ')*',\n '\\\\s*/?',\n ')',\n ')',\n '>',\n ')'\n ].join(\"\"), 'gi');\n})();\n/**\n * @private\n * @property {RegExp} htmlCharacterEntitiesRegex\n *\n * The regular expression that matches common HTML character entities.\n *\n * Ignoring & as it could be part of a query string -- handling it separately.\n */\nvar htmlCharacterEntitiesRegex = /( | |<|<|>|>|"|"|')/gi;\n/**\n * @class Autolinker.htmlParser.HtmlParser\n * @extends Object\n *\n * An HTML parser implementation which simply walks an HTML string and returns an array of\n * {@link Autolinker.htmlParser.HtmlNode HtmlNodes} that represent the basic HTML structure of the input string.\n *\n * Autolinker uses this to only link URLs/emails/mentions within text nodes, effectively ignoring / \"walking\n * around\" HTML tags.\n */\nvar HtmlParser = /** @class */ (function () {\n function HtmlParser() {\n }\n /**\n * Parses an HTML string and returns a simple array of {@link Autolinker.htmlParser.HtmlNode HtmlNodes}\n * to represent the HTML structure of the input string.\n *\n * @param {String} html The HTML to parse.\n * @return {Autolinker.htmlParser.HtmlNode[]}\n */\n HtmlParser.prototype.parse = function (html) {\n var currentResult, lastIndex = 0, textAndEntityNodes, nodes = []; // will be the result of the method\n while ((currentResult = htmlRegex.exec(html)) !== null) {\n var tagText = currentResult[0], commentText = currentResult[4], // if we've matched a comment\n tagName = currentResult[1] || currentResult[5] || currentResult[6], // The tag (ex: \"!DOCTYPE\"), or another tag (ex: \"a\" or \"img\")\n isClosingTag = !!currentResult[3], offset = currentResult.index, inBetweenTagsText = html.substring(lastIndex, offset);\n // Push TextNodes and EntityNodes for any text found between tags\n if (inBetweenTagsText) {\n textAndEntityNodes = this.parseTextAndEntityNodes(lastIndex, inBetweenTagsText);\n nodes.push.apply(nodes, textAndEntityNodes);\n }\n // Push the CommentNode or ElementNode\n if (commentText) {\n nodes.push(this.createCommentNode(offset, tagText, commentText));\n }\n else {\n nodes.push(this.createElementNode(offset, tagText, tagName, isClosingTag));\n }\n lastIndex = offset + tagText.length;\n }\n // Process any remaining text after the last HTML element. Will process all of the text if there were no HTML elements.\n if (lastIndex < html.length) {\n var text = html.substring(lastIndex);\n // Push TextNodes and EntityNodes for any text found between tags\n if (text) {\n textAndEntityNodes = this.parseTextAndEntityNodes(lastIndex, text);\n // Note: the following 3 lines were previously:\n // nodes.push.apply( nodes, textAndEntityNodes );\n // but this was causing a \"Maximum Call Stack Size Exceeded\"\n // error on inputs with a large number of html entities.\n textAndEntityNodes.forEach(function (node) { return nodes.push(node); });\n }\n }\n return nodes;\n };\n /**\n * Parses text and HTML entity nodes from a given string. The input string\n * should not have any HTML tags (elements) within it.\n *\n * @private\n * @param {Number} offset The offset of the text node match within the\n * original HTML string.\n * @param {String} text The string of text to parse. This is from an HTML\n * text node.\n * @return {Autolinker.htmlParser.HtmlNode[]} An array of HtmlNodes to\n * represent the {@link Autolinker.htmlParser.TextNode TextNodes} and\n * {@link Autolinker.htmlParser.EntityNode EntityNodes} found.\n */\n HtmlParser.prototype.parseTextAndEntityNodes = function (offset, text) {\n var nodes = [], textAndEntityTokens = splitAndCapture(text, htmlCharacterEntitiesRegex); // split at HTML entities, but include the HTML entities in the results array\n // Every even numbered token is a TextNode, and every odd numbered token is an EntityNode\n // For example: an input `text` of \"Test "this" today\" would turn into the\n // `textAndEntityTokens`: [ 'Test ', '"', 'this', '"', ' today' ]\n for (var i = 0, len = textAndEntityTokens.length; i < len; i += 2) {\n var textToken = textAndEntityTokens[i], entityToken = textAndEntityTokens[i + 1];\n if (textToken) {\n nodes.push(this.createTextNode(offset, textToken));\n offset += textToken.length;\n }\n if (entityToken) {\n nodes.push(this.createEntityNode(offset, entityToken));\n offset += entityToken.length;\n }\n }\n return nodes;\n };\n /**\n * Factory method to create an {@link Autolinker.htmlParser.CommentNode CommentNode}.\n *\n * @private\n * @param {Number} offset The offset of the match within the original HTML\n * string.\n * @param {String} tagText The full text of the tag (comment) that was\n * matched, including its <!-- and -->.\n * @param {String} commentText The full text of the comment that was matched.\n */\n HtmlParser.prototype.createCommentNode = function (offset, tagText, commentText) {\n return new CommentNode({\n offset: offset,\n text: tagText,\n comment: commentText.trim()\n });\n };\n /**\n * Factory method to create an {@link Autolinker.htmlParser.ElementNode ElementNode}.\n *\n * @private\n * @param {Number} offset The offset of the match within the original HTML\n * string.\n * @param {String} tagText The full text of the tag (element) that was\n * matched, including its attributes.\n * @param {String} tagName The name of the tag. Ex: An <img> tag would\n * be passed to this method as \"img\".\n * @param {Boolean} isClosingTag `true` if it's a closing tag, false\n * otherwise.\n * @return {Autolinker.htmlParser.ElementNode}\n */\n HtmlParser.prototype.createElementNode = function (offset, tagText, tagName, isClosingTag) {\n return new ElementNode({\n offset: offset,\n text: tagText,\n tagName: tagName.toLowerCase(),\n closing: isClosingTag\n });\n };\n /**\n * Factory method to create a {@link Autolinker.htmlParser.EntityNode EntityNode}.\n *\n * @private\n * @param {Number} offset The offset of the match within the original HTML\n * string.\n * @param {String} text The text that was matched for the HTML entity (such\n * as '&nbsp;').\n * @return {Autolinker.htmlParser.EntityNode}\n */\n HtmlParser.prototype.createEntityNode = function (offset, text) {\n return new EntityNode({ offset: offset, text: text });\n };\n /**\n * Factory method to create a {@link Autolinker.htmlParser.TextNode TextNode}.\n *\n * @private\n * @param {Number} offset The offset of the match within the original HTML\n * string.\n * @param {String} text The text that was matched.\n * @return {Autolinker.htmlParser.TextNode}\n */\n HtmlParser.prototype.createTextNode = function (offset, text) {\n return new TextNode({ offset: offset, text: text });\n };\n return HtmlParser;\n}());\nexport { HtmlParser };\n\n//# sourceMappingURL=html-parser.js.map\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Match } from \"./match\";\n/**\n * @class Autolinker.match.Email\n * @extends Autolinker.match.Match\n *\n * Represents a Email match found in an input string which should be Autolinked.\n *\n * See this class's superclass ({@link Autolinker.match.Match}) for more details.\n */\nvar EmailMatch = /** @class */ (function (_super) {\n __extends(EmailMatch, _super);\n /**\n * @method constructor\n * @param {Object} cfg The configuration properties for the Match\n * instance, specified in an Object (map).\n */\n function EmailMatch(cfg) {\n var _this = _super.call(this, cfg) || this;\n /**\n * @cfg {String} email (required)\n *\n * The email address that was matched.\n */\n _this.email = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n _this.email = cfg.email;\n return _this;\n }\n /**\n * Returns a string name for the type of match that this class represents.\n *\n * @return {String}\n */\n EmailMatch.prototype.getType = function () {\n return 'email';\n };\n /**\n * Returns the email address that was matched.\n *\n * @return {String}\n */\n EmailMatch.prototype.getEmail = function () {\n return this.email;\n };\n /**\n * Returns the anchor href that should be generated for the match.\n *\n * @return {String}\n */\n EmailMatch.prototype.getAnchorHref = function () {\n return 'mailto:' + this.email;\n };\n /**\n * Returns the anchor text that should be generated for the match.\n *\n * @return {String}\n */\n EmailMatch.prototype.getAnchorText = function () {\n return this.email;\n };\n return EmailMatch;\n}(Match));\nexport { EmailMatch };\n\n//# sourceMappingURL=email-match.js.map\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Match } from \"./match\";\n/**\n * @class Autolinker.match.Hashtag\n * @extends Autolinker.match.Match\n *\n * Represents a Hashtag match found in an input string which should be\n * Autolinked.\n *\n * See this class's superclass ({@link Autolinker.match.Match}) for more\n * details.\n */\nvar HashtagMatch = /** @class */ (function (_super) {\n __extends(HashtagMatch, _super);\n /**\n * @method constructor\n * @param {Object} cfg The configuration properties for the Match\n * instance, specified in an Object (map).\n */\n function HashtagMatch(cfg) {\n var _this = _super.call(this, cfg) || this;\n /**\n * @cfg {String} serviceName\n *\n * The service to point hashtag matches to. See {@link Autolinker#hashtag}\n * for available values.\n */\n _this.serviceName = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {String} hashtag (required)\n *\n * The HashtagMatch that was matched, without the '#'.\n */\n _this.hashtag = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n _this.serviceName = cfg.serviceName;\n _this.hashtag = cfg.hashtag;\n return _this;\n }\n /**\n * Returns the type of match that this class represents.\n *\n * @return {String}\n */\n HashtagMatch.prototype.getType = function () {\n return 'hashtag';\n };\n /**\n * Returns the configured {@link #serviceName} to point the HashtagMatch to.\n * Ex: 'facebook', 'twitter'.\n *\n * @return {String}\n */\n HashtagMatch.prototype.getServiceName = function () {\n return this.serviceName;\n };\n /**\n * Returns the matched hashtag, without the '#' character.\n *\n * @return {String}\n */\n HashtagMatch.prototype.getHashtag = function () {\n return this.hashtag;\n };\n /**\n * Returns the anchor href that should be generated for the match.\n *\n * @return {String}\n */\n HashtagMatch.prototype.getAnchorHref = function () {\n var serviceName = this.serviceName, hashtag = this.hashtag;\n switch (serviceName) {\n case 'twitter':\n return 'https://twitter.com/hashtag/' + hashtag;\n case 'facebook':\n return 'https://www.facebook.com/hashtag/' + hashtag;\n case 'instagram':\n return 'https://instagram.com/explore/tags/' + hashtag;\n default: // Shouldn't happen because Autolinker's constructor should block any invalid values, but just in case.\n throw new Error('Unknown service name to point hashtag to: ' + serviceName);\n }\n };\n /**\n * Returns the anchor text that should be generated for the match.\n *\n * @return {String}\n */\n HashtagMatch.prototype.getAnchorText = function () {\n return '#' + this.hashtag;\n };\n return HashtagMatch;\n}(Match));\nexport { HashtagMatch };\n\n//# sourceMappingURL=hashtag-match.js.map\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Match } from \"./match\";\n/**\n * @class Autolinker.match.Mention\n * @extends Autolinker.match.Match\n *\n * Represents a Mention match found in an input string which should be Autolinked.\n *\n * See this class's superclass ({@link Autolinker.match.Match}) for more details.\n */\nvar MentionMatch = /** @class */ (function (_super) {\n __extends(MentionMatch, _super);\n /**\n * @method constructor\n * @param {Object} cfg The configuration properties for the Match\n * instance, specified in an Object (map).\n */\n function MentionMatch(cfg) {\n var _this = _super.call(this, cfg) || this;\n /**\n * @cfg {String} serviceName\n *\n * The service to point mention matches to. See {@link Autolinker#mention}\n * for available values.\n */\n _this.serviceName = 'twitter'; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {String} mention (required)\n *\n * The Mention that was matched, without the '@' character.\n */\n _this.mention = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n _this.mention = cfg.mention;\n _this.serviceName = cfg.serviceName;\n return _this;\n }\n /**\n * Returns the type of match that this class represents.\n *\n * @return {String}\n */\n MentionMatch.prototype.getType = function () {\n return 'mention';\n };\n /**\n * Returns the mention, without the '@' character.\n *\n * @return {String}\n */\n MentionMatch.prototype.getMention = function () {\n return this.mention;\n };\n /**\n * Returns the configured {@link #serviceName} to point the mention to.\n * Ex: 'instagram', 'twitter', 'soundcloud'.\n *\n * @return {String}\n */\n MentionMatch.prototype.getServiceName = function () {\n return this.serviceName;\n };\n /**\n * Returns the anchor href that should be generated for the match.\n *\n * @return {String}\n */\n MentionMatch.prototype.getAnchorHref = function () {\n switch (this.serviceName) {\n case 'twitter':\n return 'https://twitter.com/' + this.mention;\n case 'instagram':\n return 'https://instagram.com/' + this.mention;\n case 'soundcloud':\n return 'https://soundcloud.com/' + this.mention;\n default: // Shouldn't happen because Autolinker's constructor should block any invalid values, but just in case.\n throw new Error('Unknown service name to point mention to: ' + this.serviceName);\n }\n };\n /**\n * Returns the anchor text that should be generated for the match.\n *\n * @return {String}\n */\n MentionMatch.prototype.getAnchorText = function () {\n return '@' + this.mention;\n };\n /**\n * Returns the CSS class suffixes that should be used on a tag built with\n * the match. See {@link Autolinker.match.Match#getCssClassSuffixes} for\n * details.\n *\n * @return {String[]}\n */\n MentionMatch.prototype.getCssClassSuffixes = function () {\n var cssClassSuffixes = _super.prototype.getCssClassSuffixes.call(this), serviceName = this.getServiceName();\n if (serviceName) {\n cssClassSuffixes.push(serviceName);\n }\n return cssClassSuffixes;\n };\n return MentionMatch;\n}(Match));\nexport { MentionMatch };\n\n//# sourceMappingURL=mention-match.js.map\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Match } from \"./match\";\n/**\n * @class Autolinker.match.Phone\n * @extends Autolinker.match.Match\n *\n * Represents a Phone number match found in an input string which should be\n * Autolinked.\n *\n * See this class's superclass ({@link Autolinker.match.Match}) for more\n * details.\n */\nvar PhoneMatch = /** @class */ (function (_super) {\n __extends(PhoneMatch, _super);\n /**\n * @method constructor\n * @param {Object} cfg The configuration properties for the Match\n * instance, specified in an Object (map).\n */\n function PhoneMatch(cfg) {\n var _this = _super.call(this, cfg) || this;\n /**\n * @protected\n * @property {String} number (required)\n *\n * The phone number that was matched, without any delimiter characters.\n *\n * Note: This is a string to allow for prefixed 0's.\n */\n _this.number = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @protected\n * @property {Boolean} plusSign (required)\n *\n * `true` if the matched phone number started with a '+' sign. We'll include\n * it in the `tel:` URL if so, as this is needed for international numbers.\n *\n * Ex: '+1 (123) 456 7879'\n */\n _this.plusSign = false; // default value just to get the above doc comment in the ES5 output and documentation generator\n _this.number = cfg.number;\n _this.plusSign = cfg.plusSign;\n return _this;\n }\n /**\n * Returns a string name for the type of match that this class represents.\n *\n * @return {String}\n */\n PhoneMatch.prototype.getType = function () {\n return 'phone';\n };\n /**\n * Returns the phone number that was matched as a string, without any\n * delimiter characters.\n *\n * Note: This is a string to allow for prefixed 0's.\n *\n * @return {String}\n */\n PhoneMatch.prototype.getNumber = function () {\n return this.number;\n };\n /**\n * Returns the anchor href that should be generated for the match.\n *\n * @return {String}\n */\n PhoneMatch.prototype.getAnchorHref = function () {\n return 'tel:' + (this.plusSign ? '+' : '') + this.number;\n };\n /**\n * Returns the anchor text that should be generated for the match.\n *\n * @return {String}\n */\n PhoneMatch.prototype.getAnchorText = function () {\n return this.matchedText;\n };\n return PhoneMatch;\n}(Match));\nexport { PhoneMatch };\n\n//# sourceMappingURL=phone-match.js.map\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Match } from \"./match\";\n/**\n * @class Autolinker.match.Url\n * @extends Autolinker.match.Match\n *\n * Represents a Url match found in an input string which should be Autolinked.\n *\n * See this class's superclass ({@link Autolinker.match.Match}) for more details.\n */\nvar UrlMatch = /** @class */ (function (_super) {\n __extends(UrlMatch, _super);\n /**\n * @method constructor\n * @param {Object} cfg The configuration properties for the Match\n * instance, specified in an Object (map).\n */\n function UrlMatch(cfg) {\n var _this = _super.call(this, cfg) || this;\n /**\n * @cfg {String} url (required)\n *\n * The url that was matched.\n */\n _this.url = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {\"scheme\"/\"www\"/\"tld\"} urlMatchType (required)\n *\n * The type of URL match that this class represents. This helps to determine\n * if the match was made in the original text with a prefixed scheme (ex:\n * 'http://www.google.com'), a prefixed 'www' (ex: 'www.google.com'), or\n * was matched by a known top-level domain (ex: 'google.com').\n */\n _this.urlMatchType = 'scheme'; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Boolean} protocolUrlMatch (required)\n *\n * `true` if the URL is a match which already has a protocol (i.e.\n * 'http://'), `false` if the match was from a 'www' or known TLD match.\n */\n _this.protocolUrlMatch = false; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Boolean} protocolRelativeMatch (required)\n *\n * `true` if the URL is a protocol-relative match. A protocol-relative match\n * is a URL that starts with '//', and will be either http:// or https://\n * based on the protocol that the site is loaded under.\n */\n _this.protocolRelativeMatch = false; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Object} stripPrefix (required)\n *\n * The Object form of {@link Autolinker#cfg-stripPrefix}.\n */\n _this.stripPrefix = { scheme: true, www: true }; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Boolean} stripTrailingSlash (required)\n * @inheritdoc Autolinker#cfg-stripTrailingSlash\n */\n _this.stripTrailingSlash = true; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Boolean} decodePercentEncoding (required)\n * @inheritdoc Autolinker#cfg-decodePercentEncoding\n */\n _this.decodePercentEncoding = true; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @private\n * @property {RegExp} schemePrefixRegex\n *\n * A regular expression used to remove the 'http://' or 'https://' from\n * URLs.\n */\n _this.schemePrefixRegex = /^(https?:\\/\\/)?/i;\n /**\n * @private\n * @property {RegExp} wwwPrefixRegex\n *\n * A regular expression used to remove the 'www.' from URLs.\n */\n _this.wwwPrefixRegex = /^(https?:\\/\\/)?(www\\.)?/i;\n /**\n * @private\n * @property {RegExp} protocolRelativeRegex\n *\n * The regular expression used to remove the protocol-relative '//' from the {@link #url} string, for purposes\n * of {@link #getAnchorText}. A protocol-relative URL is, for example, \"//yahoo.com\"\n */\n _this.protocolRelativeRegex = /^\\/\\//;\n /**\n * @private\n * @property {Boolean} protocolPrepended\n *\n * Will be set to `true` if the 'http://' protocol has been prepended to the {@link #url} (because the\n * {@link #url} did not have a protocol)\n */\n _this.protocolPrepended = false;\n _this.urlMatchType = cfg.urlMatchType;\n _this.url = cfg.url;\n _this.protocolUrlMatch = cfg.protocolUrlMatch;\n _this.protocolRelativeMatch = cfg.protocolRelativeMatch;\n _this.stripPrefix = cfg.stripPrefix;\n _this.stripTrailingSlash = cfg.stripTrailingSlash;\n _this.decodePercentEncoding = cfg.decodePercentEncoding;\n return _this;\n }\n /**\n * Returns a string name for the type of match that this class represents.\n *\n * @return {String}\n */\n UrlMatch.prototype.getType = function () {\n return 'url';\n };\n /**\n * Returns a string name for the type of URL match that this class\n * represents.\n *\n * This helps to determine if the match was made in the original text with a\n * prefixed scheme (ex: 'http://www.google.com'), a prefixed 'www' (ex:\n * 'www.google.com'), or was matched by a known top-level domain (ex:\n * 'google.com').\n *\n * @return {\"scheme\"/\"www\"/\"tld\"}\n */\n UrlMatch.prototype.getUrlMatchType = function () {\n return this.urlMatchType;\n };\n /**\n * Returns the url that was matched, assuming the protocol to be 'http://' if the original\n * match was missing a protocol.\n *\n * @return {String}\n */\n UrlMatch.prototype.getUrl = function () {\n var url = this.url;\n // if the url string doesn't begin with a protocol, assume 'http://'\n if (!this.protocolRelativeMatch && !this.protocolUrlMatch && !this.protocolPrepended) {\n url = this.url = 'http://' + url;\n this.protocolPrepended = true;\n }\n return url;\n };\n /**\n * Returns the anchor href that should be generated for the match.\n *\n * @return {String}\n */\n UrlMatch.prototype.getAnchorHref = function () {\n var url = this.getUrl();\n return url.replace(/&/g, '&'); // any &'s in the URL should be converted back to '&' if they were displayed as & in the source html\n };\n /**\n * Returns the anchor text that should be generated for the match.\n *\n * @return {String}\n */\n UrlMatch.prototype.getAnchorText = function () {\n var anchorText = this.getMatchedText();\n if (this.protocolRelativeMatch) {\n // Strip off any protocol-relative '//' from the anchor text\n anchorText = this.stripProtocolRelativePrefix(anchorText);\n }\n if (this.stripPrefix.scheme) {\n anchorText = this.stripSchemePrefix(anchorText);\n }\n if (this.stripPrefix.www) {\n anchorText = this.stripWwwPrefix(anchorText);\n }\n if (this.stripTrailingSlash) {\n anchorText = this.removeTrailingSlash(anchorText); // remove trailing slash, if there is one\n }\n if (this.decodePercentEncoding) {\n anchorText = this.removePercentEncoding(anchorText);\n }\n return anchorText;\n };\n // ---------------------------------------\n // Utility Functionality\n /**\n * Strips the scheme prefix (such as \"http://\" or \"https://\") from the given\n * `url`.\n *\n * @private\n * @param {String} url The text of the anchor that is being generated, for\n * which to strip off the url scheme.\n * @return {String} The `url`, with the scheme stripped.\n */\n UrlMatch.prototype.stripSchemePrefix = function (url) {\n return url.replace(this.schemePrefixRegex, '');\n };\n /**\n * Strips the 'www' prefix from the given `url`.\n *\n * @private\n * @param {String} url The text of the anchor that is being generated, for\n * which to strip off the 'www' if it exists.\n * @return {String} The `url`, with the 'www' stripped.\n */\n UrlMatch.prototype.stripWwwPrefix = function (url) {\n return url.replace(this.wwwPrefixRegex, '$1'); // leave any scheme ($1), it one exists\n };\n /**\n * Strips any protocol-relative '//' from the anchor text.\n *\n * @private\n * @param {String} text The text of the anchor that is being generated, for which to strip off the\n * protocol-relative prefix (such as stripping off \"//\")\n * @return {String} The `anchorText`, with the protocol-relative prefix stripped.\n */\n UrlMatch.prototype.stripProtocolRelativePrefix = function (text) {\n return text.replace(this.protocolRelativeRegex, '');\n };\n /**\n * Removes any trailing slash from the given `anchorText`, in preparation for the text to be displayed.\n *\n * @private\n * @param {String} anchorText The text of the anchor that is being generated, for which to remove any trailing\n * slash ('/') that may exist.\n * @return {String} The `anchorText`, with the trailing slash removed.\n */\n UrlMatch.prototype.removeTrailingSlash = function (anchorText) {\n if (anchorText.charAt(anchorText.length - 1) === '/') {\n anchorText = anchorText.slice(0, -1);\n }\n return anchorText;\n };\n /**\n * Decodes percent-encoded characters from the given `anchorText`, in\n * preparation for the text to be displayed.\n *\n * @private\n * @param {String} anchorText The text of the anchor that is being\n * generated, for which to decode any percent-encoded characters.\n * @return {String} The `anchorText`, with the percent-encoded characters\n * decoded.\n */\n UrlMatch.prototype.removePercentEncoding = function (anchorText) {\n // First, convert a few of the known % encodings to the corresponding\n // HTML entities that could accidentally be interpretted as special\n // HTML characters\n var preProcessedEntityAnchorText = anchorText\n .replace(/%22/gi, '"') // \" char\n .replace(/%26/gi, '&') // & char\n .replace(/%27/gi, ''') // ' char\n .replace(/%3C/gi, '<') // < char\n .replace(/%3E/gi, '>'); // > char\n try {\n // Now attempt to decode the rest of the anchor text\n return decodeURIComponent(preProcessedEntityAnchorText);\n }\n catch (e) { // Invalid % escape sequence in the anchor text\n return preProcessedEntityAnchorText;\n }\n };\n return UrlMatch;\n}(Match));\nexport { UrlMatch };\n\n//# sourceMappingURL=url-match.js.map\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Matcher } from \"./matcher\";\nimport { alphaNumericCharsStr, getDomainNameStr } from \"../regex-lib\";\nimport { tldRegex } from \"./tld-regex\";\nimport { EmailMatch } from \"../match/email-match\";\n/**\n * @class Autolinker.matcher.Email\n * @extends Autolinker.matcher.Matcher\n *\n * Matcher to find email matches in an input string.\n *\n * See this class's superclass ({@link Autolinker.matcher.Matcher}) for more details.\n */\nvar EmailMatcher = /** @class */ (function (_super) {\n __extends(EmailMatcher, _super);\n function EmailMatcher() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /**\n * The regular expression to match email addresses. Example match:\n *\n * person@place.com\n *\n * @protected\n * @property {RegExp} matcherRegex\n */\n _this.matcherRegex = (function () {\n var alphaNumericChars = alphaNumericCharsStr, specialCharacters = '!#$%&\\'*+\\\\-\\\\/=?^_`{|}~', restrictedSpecialCharacters = '\\\\s\"(),:;<>@\\\\[\\\\]', validCharacters = alphaNumericChars + specialCharacters, validRestrictedCharacters = validCharacters + restrictedSpecialCharacters, emailRegex = new RegExp('(?:[' + validCharacters + '](?:[' + validCharacters + ']|\\\\.(?!\\\\.|@))*|\\\\\"[' + validRestrictedCharacters + '.]+\\\\\")@');\n return new RegExp([\n emailRegex.source,\n getDomainNameStr(1),\n '\\\\.', tldRegex.source // '.com', '.net', etc\n ].join(\"\"), 'gi');\n })();\n return _this;\n }\n /**\n * @inheritdoc\n */\n EmailMatcher.prototype.parseMatches = function (text) {\n var matcherRegex = this.matcherRegex, tagBuilder = this.tagBuilder, matches = [], match;\n while ((match = matcherRegex.exec(text)) !== null) {\n var matchedText = match[0];\n matches.push(new EmailMatch({\n tagBuilder: tagBuilder,\n matchedText: matchedText,\n offset: match.index,\n email: matchedText\n }));\n }\n return matches;\n };\n return EmailMatcher;\n}(Matcher));\nexport { EmailMatcher };\n\n//# sourceMappingURL=email-matcher.js.map\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Matcher } from \"./matcher\";\nimport { alphaNumericCharsStr, getDomainNameStr } from \"../regex-lib\";\nimport { tldRegex } from \"./tld-regex\";\nimport { UrlMatch } from \"../match/url-match\";\nimport { UrlMatchValidator } from \"./url-match-validator\";\n/**\n * @class Autolinker.matcher.Url\n * @extends Autolinker.matcher.Matcher\n *\n * Matcher to find URL matches in an input string.\n *\n * See this class's superclass ({@link Autolinker.matcher.Matcher}) for more details.\n */\nvar UrlMatcher = /** @class */ (function (_super) {\n __extends(UrlMatcher, _super);\n /**\n * @method constructor\n * @param {Object} cfg The configuration properties for the Match instance,\n * specified in an Object (map).\n */\n function UrlMatcher(cfg) {\n var _this = _super.call(this, cfg) || this;\n /**\n * @cfg {Object} stripPrefix (required)\n *\n * The Object form of {@link Autolinker#cfg-stripPrefix}.\n */\n _this.stripPrefix = { scheme: true, www: true }; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Boolean} stripTrailingSlash (required)\n * @inheritdoc Autolinker#stripTrailingSlash\n */\n _this.stripTrailingSlash = true; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Boolean} decodePercentEncoding (required)\n * @inheritdoc Autolinker#decodePercentEncoding\n */\n _this.decodePercentEncoding = true; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @protected\n * @property {RegExp} matcherRegex\n *\n * The regular expression to match URLs with an optional scheme, port\n * number, path, query string, and hash anchor.\n *\n * Example matches:\n *\n * http://google.com\n * www.google.com\n * google.com/path/to/file?q1=1&q2=2#myAnchor\n *\n *\n * This regular expression will have the following capturing groups:\n *\n * 1. Group that matches a scheme-prefixed URL (i.e. 'http://google.com').\n * This is used to match scheme URLs with just a single word, such as\n * 'http://localhost', where we won't double check that the domain name\n * has at least one dot ('.') in it.\n * 2. Group that matches a 'www.' prefixed URL. This is only matched if the\n * 'www.' text was not prefixed by a scheme (i.e.: not prefixed by\n * 'http://', 'ftp:', etc.)\n * 3. A protocol-relative ('//') match for the case of a 'www.' prefixed\n * URL. Will be an empty string if it is not a protocol-relative match.\n * We need to know the character before the '//' in order to determine\n * if it is a valid match or the // was in a string we don't want to\n * auto-link.\n * 4. Group that matches a known TLD (top level domain), when a scheme\n * or 'www.'-prefixed domain is not matched.\n * 5. A protocol-relative ('//') match for the case of a known TLD prefixed\n * URL. Will be an empty string if it is not a protocol-relative match.\n * See #3 for more info.\n */\n _this.matcherRegex = (function () {\n var schemeRegex = /(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\\/\\/)(?!\\d+\\/?)(?:\\/\\/)?)/, // match protocol, allow in format \"http://\" or \"mailto:\". However, do not match the first part of something like 'link:http://www.google.com' (i.e. don't match \"link:\"). Also, make sure we don't interpret 'google.com:8000' as if 'google.com' was a protocol here (i.e. ignore a trailing port number in this regex)\n wwwRegex = /(?:www\\.)/, // starting with 'www.'\n // Allow optional path, query string, and hash anchor, not ending in the following characters: \"?!:,.;\"\n // http://blog.codinghorror.com/the-problem-with-urls/\n urlSuffixRegex = new RegExp('[/?#](?:[' + alphaNumericCharsStr + '\\\\-+&@#/%=~_()|\\'$*\\\\[\\\\]?!:,.;\\u2713]*[' + alphaNumericCharsStr + '\\\\-+&@#/%=~_()|\\'$*\\\\[\\\\]\\u2713])?');\n return new RegExp([\n '(?:',\n '(',\n schemeRegex.source,\n getDomainNameStr(2),\n ')',\n '|',\n '(',\n '(//)?',\n wwwRegex.source,\n getDomainNameStr(6),\n ')',\n '|',\n '(',\n '(//)?',\n getDomainNameStr(10) + '\\\\.',\n tldRegex.source,\n '(?![-' + alphaNumericCharsStr + '])',\n ')',\n ')',\n '(?::[0-9]+)?',\n '(?:' + urlSuffixRegex.source + ')?' // match for path, query string, and/or hash anchor - optional\n ].join(\"\"), 'gi');\n })();\n /**\n * A regular expression to use to check the character before a protocol-relative\n * URL match. We don't want to match a protocol-relative URL if it is part\n * of another word.\n *\n * For example, we want to match something like \"Go to: //google.com\",\n * but we don't want to match something like \"abc//google.com\"\n *\n * This regular expression is used to test the character before the '//'.\n *\n * @protected\n * @type {RegExp} wordCharRegExp\n */\n _this.wordCharRegExp = new RegExp('[' + alphaNumericCharsStr + ']');\n /**\n * The regular expression to match opening parenthesis in a URL match.\n *\n * This is to determine if we have unbalanced parenthesis in the URL, and to\n * drop the final parenthesis that was matched if so.\n *\n * Ex: The text \"(check out: wikipedia.com/something_(disambiguation))\"\n * should only autolink the inner \"wikipedia.com/something_(disambiguation)\"\n * part, so if we find that we have unbalanced parenthesis, we will drop the\n * last one for the match.\n *\n * @protected\n * @property {RegExp}\n */\n _this.openParensRe = /\\(/g;\n /**\n * The regular expression to match closing parenthesis in a URL match. See\n * {@link #openParensRe} for more information.\n *\n * @protected\n * @property {RegExp}\n */\n _this.closeParensRe = /\\)/g;\n _this.stripPrefix = cfg.stripPrefix;\n _this.stripTrailingSlash = cfg.stripTrailingSlash;\n _this.decodePercentEncoding = cfg.decodePercentEncoding;\n return _this;\n }\n /**\n * @inheritdoc\n */\n UrlMatcher.prototype.parseMatches = function (text) {\n var matcherRegex = this.matcherRegex, stripPrefix = this.stripPrefix, stripTrailingSlash = this.stripTrailingSlash, decodePercentEncoding = this.decodePercentEncoding, tagBuilder = this.tagBuilder, matches = [], match;\n while ((match = matcherRegex.exec(text)) !== null) {\n var matchStr = match[0], schemeUrlMatch = match[1], wwwUrlMatch = match[4], wwwProtocolRelativeMatch = match[5], \n //tldUrlMatch = match[ 8 ], -- not needed at the moment\n tldProtocolRelativeMatch = match[9], offset = match.index, protocolRelativeMatch = wwwProtocolRelativeMatch || tldProtocolRelativeMatch, prevChar = text.charAt(offset - 1);\n if (!UrlMatchValidator.isValid(matchStr, schemeUrlMatch)) {\n continue;\n }\n // If the match is preceded by an '@' character, then it is either\n // an email address or a username. Skip these types of matches.\n if (offset > 0 && prevChar === '@') {\n continue;\n }\n // If it's a protocol-relative '//' match, but the character before the '//'\n // was a word character (i.e. a letter/number), then we found the '//' in the\n // middle of another word (such as \"asdf//asdf.com\"). In this case, skip the\n // match.\n if (offset > 0 && protocolRelativeMatch && this.wordCharRegExp.test(prevChar)) {\n continue;\n }\n if (/\\?$/.test(matchStr)) {\n matchStr = matchStr.substr(0, matchStr.length - 1);\n }\n // Handle a closing parenthesis at the end of the match, and exclude\n // it if there is not a matching open parenthesis in the match\n // itself.\n if (this.matchHasUnbalancedClosingParen(matchStr)) {\n matchStr = matchStr.substr(0, matchStr.length - 1); // remove the trailing \")\"\n }\n else {\n // Handle an invalid character after the TLD\n var pos = this.matchHasInvalidCharAfterTld(matchStr, schemeUrlMatch);\n if (pos > -1) {\n matchStr = matchStr.substr(0, pos); // remove the trailing invalid chars\n }\n }\n var urlMatchType = schemeUrlMatch ? 'scheme' : (wwwUrlMatch ? 'www' : 'tld'), protocolUrlMatch = !!schemeUrlMatch;\n matches.push(new UrlMatch({\n tagBuilder: tagBuilder,\n matchedText: matchStr,\n offset: offset,\n urlMatchType: urlMatchType,\n url: matchStr,\n protocolUrlMatch: protocolUrlMatch,\n protocolRelativeMatch: !!protocolRelativeMatch,\n stripPrefix: stripPrefix,\n stripTrailingSlash: stripTrailingSlash,\n decodePercentEncoding: decodePercentEncoding,\n }));\n }\n return matches;\n };\n /**\n * Determines if a match found has an unmatched closing parenthesis. If so,\n * this parenthesis will be removed from the match itself, and appended\n * after the generated anchor tag.\n *\n * A match may have an extra closing parenthesis at the end of the match\n * because the regular expression must include parenthesis for URLs such as\n * \"wikipedia.com/something_(disambiguation)\", which should be auto-linked.\n *\n * However, an extra parenthesis *will* be included when the URL itself is\n * wrapped in parenthesis, such as in the case of \"(wikipedia.com/something_(disambiguation))\".\n * In this case, the last closing parenthesis should *not* be part of the\n * URL itself, and this method will return `true`.\n *\n * @protected\n * @param {String} matchStr The full match string from the {@link #matcherRegex}.\n * @return {Boolean} `true` if there is an unbalanced closing parenthesis at\n * the end of the `matchStr`, `false` otherwise.\n */\n UrlMatcher.prototype.matchHasUnbalancedClosingParen = function (matchStr) {\n var lastChar = matchStr.charAt(matchStr.length - 1);\n if (lastChar === ')') {\n var openParensMatch = matchStr.match(this.openParensRe), closeParensMatch = matchStr.match(this.closeParensRe), numOpenParens = (openParensMatch && openParensMatch.length) || 0, numCloseParens = (closeParensMatch && closeParensMatch.length) || 0;\n if (numOpenParens < numCloseParens) {\n return true;\n }\n }\n return false;\n };\n /**\n * Determine if there's an invalid character after the TLD in a URL. Valid\n * characters after TLD are ':/?#'. Exclude scheme matched URLs from this\n * check.\n *\n * @protected\n * @param {String} urlMatch The matched URL, if there was one. Will be an\n * empty string if the match is not a URL match.\n * @param {String} schemeUrlMatch The match URL string for a scheme\n * match. Ex: 'http://yahoo.com'. This is used to match something like\n * 'http://localhost', where we won't double check that the domain name\n * has at least one '.' in it.\n * @return {Number} the position where the invalid character was found. If\n * no such character was found, returns -1\n */\n UrlMatcher.prototype.matchHasInvalidCharAfterTld = function (urlMatch, schemeUrlMatch) {\n if (!urlMatch) {\n return -1;\n }\n var offset = 0;\n if (schemeUrlMatch) {\n offset = urlMatch.indexOf(':');\n urlMatch = urlMatch.slice(offset);\n }\n var re = new RegExp(\"^((.?\\/\\/)?[-.\" + alphaNumericCharsStr + \"]*[-\" + alphaNumericCharsStr + \"]\\\\.[-\" + alphaNumericCharsStr + \"]+)\");\n var res = re.exec(urlMatch);\n if (res === null) {\n return -1;\n }\n offset += res[1].length;\n urlMatch = urlMatch.slice(res[1].length);\n if (/^[^-.A-Za-z0-9:\\/?#]/.test(urlMatch)) {\n return offset;\n }\n return -1;\n };\n return UrlMatcher;\n}(Matcher));\nexport { UrlMatcher };\n\n//# sourceMappingURL=url-matcher.js.map\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Matcher } from \"./matcher\";\nimport { alphaNumericCharsStr } from \"../regex-lib\";\nimport { HashtagMatch } from \"../match/hashtag-match\";\n/**\n * @class Autolinker.matcher.Hashtag\n * @extends Autolinker.matcher.Matcher\n *\n * Matcher to find HashtagMatch matches in an input string.\n */\nvar HashtagMatcher = /** @class */ (function (_super) {\n __extends(HashtagMatcher, _super);\n /**\n * @method constructor\n * @param {Object} cfg The configuration properties for the Match instance,\n * specified in an Object (map).\n */\n function HashtagMatcher(cfg) {\n var _this = _super.call(this, cfg) || this;\n /**\n * @cfg {String} serviceName\n *\n * The service to point hashtag matches to. See {@link Autolinker#hashtag}\n * for available values.\n */\n _this.serviceName = 'twitter'; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * The regular expression to match Hashtags. Example match:\n *\n * #asdf\n *\n * @protected\n * @property {RegExp} matcherRegex\n */\n _this.matcherRegex = new RegExp('#[_' + alphaNumericCharsStr + ']{1,139}', 'g');\n /**\n * The regular expression to use to check the character before a username match to\n * make sure we didn't accidentally match an email address.\n *\n * For example, the string \"asdf@asdf.com\" should not match \"@asdf\" as a username.\n *\n * @protected\n * @property {RegExp} nonWordCharRegex\n */\n _this.nonWordCharRegex = new RegExp('[^' + alphaNumericCharsStr + ']');\n _this.serviceName = cfg.serviceName;\n return _this;\n }\n /**\n * @inheritdoc\n */\n HashtagMatcher.prototype.parseMatches = function (text) {\n var matcherRegex = this.matcherRegex, nonWordCharRegex = this.nonWordCharRegex, serviceName = this.serviceName, tagBuilder = this.tagBuilder, matches = [], match;\n while ((match = matcherRegex.exec(text)) !== null) {\n var offset = match.index, prevChar = text.charAt(offset - 1);\n // If we found the match at the beginning of the string, or we found the match\n // and there is a whitespace char in front of it (meaning it is not a '#' char\n // in the middle of a word), then it is a hashtag match.\n if (offset === 0 || nonWordCharRegex.test(prevChar)) {\n var matchedText = match[0], hashtag = match[0].slice(1); // strip off the '#' character at the beginning\n matches.push(new HashtagMatch({\n tagBuilder: tagBuilder,\n matchedText: matchedText,\n offset: offset,\n serviceName: serviceName,\n hashtag: hashtag\n }));\n }\n }\n return matches;\n };\n return HashtagMatcher;\n}(Matcher));\nexport { HashtagMatcher };\n\n//# sourceMappingURL=hashtag-matcher.js.map\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Matcher } from \"./matcher\";\nimport { PhoneMatch } from \"../match/phone-match\";\n/**\n * @class Autolinker.matcher.Phone\n * @extends Autolinker.matcher.Matcher\n *\n * Matcher to find Phone number matches in an input string.\n *\n * See this class's superclass ({@link Autolinker.matcher.Matcher}) for more\n * details.\n */\nvar PhoneMatcher = /** @class */ (function (_super) {\n __extends(PhoneMatcher, _super);\n function PhoneMatcher() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /**\n * The regular expression to match Phone numbers. Example match:\n *\n * (123) 456-7890\n *\n * This regular expression has the following capturing groups:\n *\n * 1 or 2. The prefixed '+' sign, if there is one.\n *\n * @protected\n * @property {RegExp} matcherRegex\n */\n _this.matcherRegex = /(?:(?:(?:(\\+)?\\d{1,3}[-\\040.]?)?\\(?\\d{3}\\)?[-\\040.]?\\d{3}[-\\040.]?\\d{4})|(?:(\\+)(?:9[976]\\d|8[987530]\\d|6[987]\\d|5[90]\\d|42\\d|3[875]\\d|2[98654321]\\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\\040.]?(?:\\d[-\\040.]?){6,12}\\d+))([,;]+[0-9]+#?)*/g;\n return _this;\n }\n // ex: (123) 456-7890, 123 456 7890, 123-456-7890, +18004441234,,;,10226420346#,\n // +1 (800) 444 1234, 10226420346#, 1-800-444-1234,1022,64,20346#\n /**\n * @inheritdoc\n */\n PhoneMatcher.prototype.parseMatches = function (text) {\n var matcherRegex = this.matcherRegex, tagBuilder = this.tagBuilder, matches = [], match;\n while ((match = matcherRegex.exec(text)) !== null) {\n // Remove non-numeric values from phone number string\n var matchedText = match[0], cleanNumber = matchedText.replace(/[^0-9,;#]/g, ''), // strip out non-digit characters exclude comma semicolon and #\n plusSign = !!(match[1] || match[2]), // match[ 1 ] or match[ 2 ] is the prefixed plus sign, if there is one\n before = match.index == 0 ? '' : text.substr(match.index - 1, 1), after = text.substr(match.index + matchedText.length, 1), contextClear = !before.match(/\\d/) && !after.match(/\\d/);\n if (this.testMatch(match[3]) && this.testMatch(matchedText) && contextClear) {\n matches.push(new PhoneMatch({\n tagBuilder: tagBuilder,\n matchedText: matchedText,\n offset: match.index,\n number: cleanNumber,\n plusSign: plusSign\n }));\n }\n }\n return matches;\n };\n PhoneMatcher.prototype.testMatch = function (text) {\n return /\\D/.test(text);\n };\n return PhoneMatcher;\n}(Matcher));\nexport { PhoneMatcher };\n\n//# sourceMappingURL=phone-matcher.js.map\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Matcher } from \"./matcher\";\nimport { alphaNumericCharsStr } from \"../regex-lib\";\nimport { MentionMatch } from \"../match/mention-match\";\n/**\n * @class Autolinker.matcher.Mention\n * @extends Autolinker.matcher.Matcher\n *\n * Matcher to find/replace username matches in an input string.\n */\nvar MentionMatcher = /** @class */ (function (_super) {\n __extends(MentionMatcher, _super);\n /**\n * @method constructor\n * @param {Object} cfg The configuration properties for the Match instance,\n * specified in an Object (map).\n */\n function MentionMatcher(cfg) {\n var _this = _super.call(this, cfg) || this;\n /**\n * @cfg {'twitter'/'instagram'/'soundcloud'} protected\n *\n * The name of service to link @mentions to.\n *\n * Valid values are: 'twitter', 'instagram', or 'soundcloud'\n */\n _this.serviceName = 'twitter'; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * Hash of regular expression to match username handles. Example match:\n *\n * @asdf\n *\n * @private\n * @property {Object} matcherRegexes\n */\n _this.matcherRegexes = {\n 'twitter': new RegExp('@[_' + alphaNumericCharsStr + ']{1,20}', 'g'),\n 'instagram': new RegExp('@[_.' + alphaNumericCharsStr + ']{1,50}', 'g'),\n 'soundcloud': new RegExp('@[_.' + alphaNumericCharsStr + \"\\-\" + ']{1,50}', 'g')\n };\n /**\n * The regular expression to use to check the character before a username match to\n * make sure we didn't accidentally match an email address.\n *\n * For example, the string \"asdf@asdf.com\" should not match \"@asdf\" as a username.\n *\n * @private\n * @property {RegExp} nonWordCharRegex\n */\n _this.nonWordCharRegex = new RegExp('[^' + alphaNumericCharsStr + ']');\n _this.serviceName = cfg.serviceName;\n return _this;\n }\n /**\n * @inheritdoc\n */\n MentionMatcher.prototype.parseMatches = function (text) {\n var serviceName = this.serviceName, matcherRegex = this.matcherRegexes[this.serviceName], nonWordCharRegex = this.nonWordCharRegex, tagBuilder = this.tagBuilder, matches = [], match;\n if (!matcherRegex) {\n return matches;\n }\n while ((match = matcherRegex.exec(text)) !== null) {\n var offset = match.index, prevChar = text.charAt(offset - 1);\n // If we found the match at the beginning of the string, or we found the match\n // and there is a whitespace char in front of it (meaning it is not an email\n // address), then it is a username match.\n if (offset === 0 || nonWordCharRegex.test(prevChar)) {\n var matchedText = match[0].replace(/\\.+$/g, ''), // strip off trailing .\n mention = matchedText.slice(1); // strip off the '@' character at the beginning\n matches.push(new MentionMatch({\n tagBuilder: tagBuilder,\n matchedText: matchedText,\n offset: offset,\n serviceName: serviceName,\n mention: mention\n }));\n }\n }\n return matches;\n };\n return MentionMatcher;\n}(Matcher));\nexport { MentionMatcher };\n\n//# sourceMappingURL=mention-matcher.js.map\n","import { ellipsis } from \"../utils\";\n/**\n * A truncation feature where the ellipsis will be placed at the end of the URL.\n *\n * @param {String} anchorText\n * @param {Number} truncateLen The maximum length of the truncated output URL string.\n * @param {String} ellipsisChars The characters to place within the url, e.g. \"..\".\n * @return {String} The truncated URL.\n */\nexport function truncateEnd(anchorText, truncateLen, ellipsisChars) {\n return ellipsis(anchorText, truncateLen, ellipsisChars);\n}\n\n//# sourceMappingURL=truncate-end.js.map\n","/**\n * Date: 2015-10-05\n * Author: Kasper Søfren (https://github.com/kafoso)\n *\n * A truncation feature, where the ellipsis will be placed at a section within\n * the URL making it still somewhat human readable.\n *\n * @param {String} url\t\t\t\t\t\t A URL.\n * @param {Number} truncateLen\t\t The maximum length of the truncated output URL string.\n * @param {String} ellipsisChars\t The characters to place within the url, e.g. \"...\".\n * @return {String} The truncated URL.\n */\nexport function truncateSmart(url, truncateLen, ellipsisChars) {\n var ellipsisLengthBeforeParsing;\n var ellipsisLength;\n if (ellipsisChars == null) {\n ellipsisChars = '…';\n ellipsisLength = 3;\n ellipsisLengthBeforeParsing = 8;\n }\n else {\n ellipsisLength = ellipsisChars.length;\n ellipsisLengthBeforeParsing = ellipsisChars.length;\n }\n var parse_url = function (url) {\n var urlObj = {};\n var urlSub = url;\n var match = urlSub.match(/^([a-z]+):\\/\\//i);\n if (match) {\n urlObj.scheme = match[1];\n urlSub = urlSub.substr(match[0].length);\n }\n match = urlSub.match(/^(.*?)(?=(\\?|#|\\/|$))/i);\n if (match) {\n urlObj.host = match[1];\n urlSub = urlSub.substr(match[0].length);\n }\n match = urlSub.match(/^\\/(.*?)(?=(\\?|#|$))/i);\n if (match) {\n urlObj.path = match[1];\n urlSub = urlSub.substr(match[0].length);\n }\n match = urlSub.match(/^\\?(.*?)(?=(#|$))/i);\n if (match) {\n urlObj.query = match[1];\n urlSub = urlSub.substr(match[0].length);\n }\n match = urlSub.match(/^#(.*?)$/i);\n if (match) {\n urlObj.fragment = match[1];\n //urlSub = urlSub.substr(match[0].length); -- not used. Uncomment if adding another block.\n }\n return urlObj;\n };\n var buildUrl = function (urlObj) {\n var url = \"\";\n if (urlObj.scheme && urlObj.host) {\n url += urlObj.scheme + \"://\";\n }\n if (urlObj.host) {\n url += urlObj.host;\n }\n if (urlObj.path) {\n url += \"/\" + urlObj.path;\n }\n if (urlObj.query) {\n url += \"?\" + urlObj.query;\n }\n if (urlObj.fragment) {\n url += \"#\" + urlObj.fragment;\n }\n return url;\n };\n var buildSegment = function (segment, remainingAvailableLength) {\n var remainingAvailableLengthHalf = remainingAvailableLength / 2, startOffset = Math.ceil(remainingAvailableLengthHalf), endOffset = (-1) * Math.floor(remainingAvailableLengthHalf), end = \"\";\n if (endOffset < 0) {\n end = segment.substr(endOffset);\n }\n return segment.substr(0, startOffset) + ellipsisChars + end;\n };\n if (url.length <= truncateLen) {\n return url;\n }\n var availableLength = truncateLen - ellipsisLength;\n var urlObj = parse_url(url);\n // Clean up the URL\n if (urlObj.query) {\n var matchQuery = urlObj.query.match(/^(.*?)(?=(\\?|\\#))(.*?)$/i);\n if (matchQuery) {\n // Malformed URL; two or more \"?\". Removed any content behind the 2nd.\n urlObj.query = urlObj.query.substr(0, matchQuery[1].length);\n url = buildUrl(urlObj);\n }\n }\n if (url.length <= truncateLen) {\n return url;\n }\n if (urlObj.host) {\n urlObj.host = urlObj.host.replace(/^www\\./, \"\");\n url = buildUrl(urlObj);\n }\n if (url.length <= truncateLen) {\n return url;\n }\n // Process and build the URL\n var str = \"\";\n if (urlObj.host) {\n str += urlObj.host;\n }\n if (str.length >= availableLength) {\n if (urlObj.host.length == truncateLen) {\n return (urlObj.host.substr(0, (truncateLen - ellipsisLength)) + ellipsisChars).substr(0, availableLength + ellipsisLengthBeforeParsing);\n }\n return buildSegment(str, availableLength).substr(0, availableLength + ellipsisLengthBeforeParsing);\n }\n var pathAndQuery = \"\";\n if (urlObj.path) {\n pathAndQuery += \"/\" + urlObj.path;\n }\n if (urlObj.query) {\n pathAndQuery += \"?\" + urlObj.query;\n }\n if (pathAndQuery) {\n if ((str + pathAndQuery).length >= availableLength) {\n if ((str + pathAndQuery).length == truncateLen) {\n return (str + pathAndQuery).substr(0, truncateLen);\n }\n var remainingAvailableLength = availableLength - str.length;\n return (str + buildSegment(pathAndQuery, remainingAvailableLength)).substr(0, availableLength + ellipsisLengthBeforeParsing);\n }\n else {\n str += pathAndQuery;\n }\n }\n if (urlObj.fragment) {\n var fragment = \"#\" + urlObj.fragment;\n if ((str + fragment).length >= availableLength) {\n if ((str + fragment).length == truncateLen) {\n return (str + fragment).substr(0, truncateLen);\n }\n var remainingAvailableLength2 = availableLength - str.length;\n return (str + buildSegment(fragment, remainingAvailableLength2)).substr(0, availableLength + ellipsisLengthBeforeParsing);\n }\n else {\n str += fragment;\n }\n }\n if (urlObj.scheme && urlObj.host) {\n var scheme = urlObj.scheme + \"://\";\n if ((str + scheme).length < availableLength) {\n return (scheme + str).substr(0, truncateLen);\n }\n }\n if (str.length <= truncateLen) {\n return str;\n }\n var end = \"\";\n if (availableLength > 0) {\n end = str.substr((-1) * Math.floor(availableLength / 2));\n }\n return (str.substr(0, Math.ceil(availableLength / 2)) + ellipsisChars + end).substr(0, availableLength + ellipsisLengthBeforeParsing);\n}\n\n//# sourceMappingURL=truncate-smart.js.map\n","/**\n * Date: 2015-10-05\n * Author: Kasper Søfren (https://github.com/kafoso)\n *\n * A truncation feature, where the ellipsis will be placed in the dead-center of the URL.\n *\n * @param {String} url A URL.\n * @param {Number} truncateLen The maximum length of the truncated output URL string.\n * @param {String} ellipsisChars The characters to place within the url, e.g. \"..\".\n * @return {String} The truncated URL.\n */\nexport function truncateMiddle(url, truncateLen, ellipsisChars) {\n if (url.length <= truncateLen) {\n return url;\n }\n var ellipsisLengthBeforeParsing;\n var ellipsisLength;\n if (ellipsisChars == null) {\n ellipsisChars = '…';\n ellipsisLengthBeforeParsing = 8;\n ellipsisLength = 3;\n }\n else {\n ellipsisLengthBeforeParsing = ellipsisChars.length;\n ellipsisLength = ellipsisChars.length;\n }\n var availableLength = truncateLen - ellipsisLength;\n var end = \"\";\n if (availableLength > 0) {\n end = url.substr((-1) * Math.floor(availableLength / 2));\n }\n return (url.substr(0, Math.ceil(availableLength / 2)) + ellipsisChars + end).substr(0, availableLength + ellipsisLengthBeforeParsing);\n}\n\n//# sourceMappingURL=truncate-middle.js.map\n","/**\n * @abstract\n * @class Autolinker.htmlParser.HtmlNode\n *\n * Represents an HTML node found in an input string. An HTML node is one of the\n * following:\n *\n * 1. An {@link Autolinker.htmlParser.ElementNode ElementNode}, which represents\n * HTML tags.\n * 2. A {@link Autolinker.htmlParser.CommentNode CommentNode}, which represents\n * HTML comments.\n * 3. A {@link Autolinker.htmlParser.TextNode TextNode}, which represents text\n * outside or within HTML tags.\n * 4. A {@link Autolinker.htmlParser.EntityNode EntityNode}, which represents\n * one of the known HTML entities that Autolinker looks for. This includes\n * common ones such as &quot; and &nbsp;\n */\nvar HtmlNode = /** @class */ (function () {\n /**\n * @method constructor\n * @param {Object} cfg The configuration properties for the Match instance,\n * specified in an Object (map).\n */\n function HtmlNode(cfg) {\n /**\n * @cfg {Number} offset (required)\n *\n * The offset of the HTML node in the original text that was parsed.\n */\n this.offset = 0; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {String} text (required)\n *\n * The text that was matched for the HtmlNode.\n *\n * - In the case of an {@link Autolinker.htmlParser.ElementNode ElementNode},\n * this will be the tag's text.\n * - In the case of an {@link Autolinker.htmlParser.CommentNode CommentNode},\n * this will be the comment's text.\n * - In the case of a {@link Autolinker.htmlParser.TextNode TextNode}, this\n * will be the text itself.\n * - In the case of a {@link Autolinker.htmlParser.EntityNode EntityNode},\n * this will be the text of the HTML entity.\n */\n this.text = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n this.offset = cfg.offset;\n this.text = cfg.text;\n }\n /**\n * Retrieves the {@link #offset} of the HtmlNode. This is the offset of the\n * HTML node in the original string that was parsed.\n *\n * @return {Number}\n */\n HtmlNode.prototype.getOffset = function () {\n return this.offset;\n };\n /**\n * Retrieves the {@link #text} for the HtmlNode.\n *\n * @return {String}\n */\n HtmlNode.prototype.getText = function () {\n return this.text;\n };\n return HtmlNode;\n}());\nexport { HtmlNode };\n\n//# sourceMappingURL=html-node.js.map\n","/**\n * @abstract\n * @class Autolinker.match.Match\n *\n * Represents a match found in an input string which should be Autolinked. A Match object is what is provided in a\n * {@link Autolinker#replaceFn replaceFn}, and may be used to query for details about the match.\n *\n * For example:\n *\n * var input = \"...\"; // string with URLs, Email Addresses, and Mentions (Twitter, Instagram, Soundcloud)\n *\n * var linkedText = Autolinker.link( input, {\n * replaceFn : function( match ) {\n * console.log( \"href = \", match.getAnchorHref() );\n * console.log( \"text = \", match.getAnchorText() );\n *\n * switch( match.getType() ) {\n * case 'url' :\n * console.log( \"url: \", match.getUrl() );\n *\n * case 'email' :\n * console.log( \"email: \", match.getEmail() );\n *\n * case 'mention' :\n * console.log( \"mention: \", match.getMention() );\n * }\n * }\n * } );\n *\n * See the {@link Autolinker} class for more details on using the {@link Autolinker#replaceFn replaceFn}.\n */\nvar Match = /** @class */ (function () {\n /**\n * @member Autolinker.match.Match\n * @method constructor\n * @param {Object} cfg The configuration properties for the Match\n * instance, specified in an Object (map).\n */\n function Match(cfg) {\n /**\n * @cfg {Autolinker.AnchorTagBuilder} tagBuilder (required)\n *\n * Reference to the AnchorTagBuilder instance to use to generate an anchor\n * tag for the Match.\n */\n this.__jsduckDummyDocProp = null; // property used just to get the above doc comment into the ES5 output and documentation generator\n /**\n * @cfg {String} matchedText (required)\n *\n * The original text that was matched by the {@link Autolinker.matcher.Matcher}.\n */\n this.matchedText = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Number} offset (required)\n *\n * The offset of where the match was made in the input string.\n */\n this.offset = 0; // default value just to get the above doc comment in the ES5 output and documentation generator\n this.tagBuilder = cfg.tagBuilder;\n this.matchedText = cfg.matchedText;\n this.offset = cfg.offset;\n }\n /**\n * Returns the original text that was matched.\n *\n * @return {String}\n */\n Match.prototype.getMatchedText = function () {\n return this.matchedText;\n };\n /**\n * Sets the {@link #offset} of where the match was made in the input string.\n *\n * A {@link Autolinker.matcher.Matcher} will be fed only HTML text nodes,\n * and will therefore set an original offset that is relative to the HTML\n * text node itself. However, we want this offset to be relative to the full\n * HTML input string, and thus if using {@link Autolinker#parse} (rather\n * than calling a {@link Autolinker.matcher.Matcher} directly), then this\n * offset is corrected after the Matcher itself has done its job.\n *\n * @param {Number} offset\n */\n Match.prototype.setOffset = function (offset) {\n this.offset = offset;\n };\n /**\n * Returns the offset of where the match was made in the input string. This\n * is the 0-based index of the match.\n *\n * @return {Number}\n */\n Match.prototype.getOffset = function () {\n return this.offset;\n };\n /**\n * Returns the CSS class suffix(es) for this match.\n *\n * A CSS class suffix is appended to the {@link Autolinker#className} in\n * the {@link Autolinker.AnchorTagBuilder} when a match is translated into\n * an anchor tag.\n *\n * For example, if {@link Autolinker#className} was configured as 'myLink',\n * and this method returns `[ 'url' ]`, the final class name of the element\n * will become: 'myLink myLink-url'.\n *\n * The match may provide multiple CSS class suffixes to be appended to the\n * {@link Autolinker#className} in order to facilitate better styling\n * options for different match criteria. See {@link Autolinker.match.Mention}\n * for an example.\n *\n * By default, this method returns a single array with the match's\n * {@link #getType type} name, but may be overridden by subclasses.\n *\n * @return {String[]}\n */\n Match.prototype.getCssClassSuffixes = function () {\n return [this.getType()];\n };\n /**\n * Builds and returns an {@link Autolinker.HtmlTag} instance based on the\n * Match.\n *\n * This can be used to easily generate anchor tags from matches, and either\n * return their HTML string, or modify them before doing so.\n *\n * Example Usage:\n *\n * var tag = match.buildTag();\n * tag.addClass( 'cordova-link' );\n * tag.setAttr( 'target', '_system' );\n *\n * tag.toAnchorString(); // Google\n *\n * Example Usage in {@link Autolinker#replaceFn}:\n *\n * var html = Autolinker.link( \"Test google.com\", {\n * replaceFn : function( match ) {\n * var tag = match.buildTag(); // returns an {@link Autolinker.HtmlTag} instance\n * tag.setAttr( 'rel', 'nofollow' );\n *\n * return tag;\n * }\n * } );\n *\n * // generated html:\n * // Test google.com\n */\n Match.prototype.buildTag = function () {\n return this.tagBuilder.build(this);\n };\n return Match;\n}());\nexport { Match };\n\n//# sourceMappingURL=match.js.map\n","/**\n * @abstract\n * @class Autolinker.matcher.Matcher\n *\n * An abstract class and interface for individual matchers to find matches in\n * an input string with linkified versions of them.\n *\n * Note that Matchers do not take HTML into account - they must be fed the text\n * nodes of any HTML string, which is handled by {@link Autolinker#parse}.\n */\nvar Matcher = /** @class */ (function () {\n /**\n * @method constructor\n * @param {Object} cfg The configuration properties for the Matcher\n * instance, specified in an Object (map).\n */\n function Matcher(cfg) {\n /**\n * @cfg {Autolinker.AnchorTagBuilder} tagBuilder (required)\n *\n * Reference to the AnchorTagBuilder instance to use to generate HTML tags\n * for {@link Autolinker.match.Match Matches}.\n */\n this.__jsduckDummyDocProp = null; // property used just to get the above doc comment into the ES5 output and documentation generator\n this.tagBuilder = cfg.tagBuilder;\n }\n return Matcher;\n}());\nexport { Matcher };\n\n//# sourceMappingURL=matcher.js.map\n","/*\n * This file builds and stores a library of the common regular expressions used\n * by the Autolinker utility.\n *\n * Other regular expressions may exist ad-hoc, but these are generally the\n * regular expressions that are shared between source files.\n */\n/**\n * The string form of a regular expression that would match all of the\n * alphabetic (\"letter\") chars in the unicode character set when placed in a\n * RegExp character class (`[]`). This includes all international alphabetic\n * characters.\n *\n * These would be the characters matched by unicode regex engines `\\p{L}`\n * escape (\"all letters\").\n *\n * Taken from the XRegExp library: http://xregexp.com/\n * Specifically: http://xregexp.com/v/3.2.0/xregexp-all.js, the 'Letter'\n * regex's bmp\n *\n * VERY IMPORTANT: This set of characters is defined inside of a Regular\n * Expression literal rather than a string literal to prevent UglifyJS from\n * compressing the unicode escape sequences into their actual unicode\n * characters. If Uglify compresses these into the unicode characters\n * themselves, this results in the error \"Range out of order in character\n * class\" when these characters are used inside of a Regular Expression\n * character class (`[]`). See usages of this const. Alternatively, we can set\n * the UglifyJS option `ascii_only` to true for the build, but that doesn't\n * help others who are pulling in Autolinker into their own build and running\n * UglifyJS themselves.\n */\nexport var alphaCharsStr = /A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0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\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\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\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\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\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FD5\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC/\n .source; // see note in above variable description\n/**\n * The string form of a regular expression that would match all of the\n * decimal number chars in the unicode character set when placed in a RegExp\n * character class (`[]`).\n *\n * These would be the characters matched by unicode regex engines `\\p{Nd}`\n * escape (\"all decimal numbers\")\n *\n * Taken from the XRegExp library: http://xregexp.com/\n * Specifically: http://xregexp.com/v/3.2.0/xregexp-all.js, the 'Decimal_Number'\n * regex's bmp\n *\n * VERY IMPORTANT: This set of characters is defined inside of a Regular\n * Expression literal rather than a string literal to prevent UglifyJS from\n * compressing the unicode escape sequences into their actual unicode\n * characters. If Uglify compresses these into the unicode characters\n * themselves, this results in the error \"Range out of order in character\n * class\" when these characters are used inside of a Regular Expression\n * character class (`[]`). See usages of this const. Alternatively, we can set\n * the UglifyJS option `ascii_only` to true for the build, but that doesn't\n * help others who are pulling in Autolinker into their own build and running\n * UglifyJS themselves.\n */\nexport var decimalNumbersStr = /0-9\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE6-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0DE6-\\u0DEF\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29\\u1040-\\u1049\\u1090-\\u1099\\u17E0-\\u17E9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19D9\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\uA620-\\uA629\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uA9F0-\\uA9F9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19/\n .source; // see note in above variable description\n/**\n * The string form of a regular expression that would match all of the\n * letters and decimal number chars in the unicode character set when placed\n * in a RegExp character class (`[]`).\n *\n * These would be the characters matched by unicode regex engines `[\\p{L}\\p{Nd}]`\n * escape (\"all letters and decimal numbers\")\n */\nexport var alphaNumericCharsStr = alphaCharsStr + decimalNumbersStr;\n// Simplified IP regular expression\nvar ipStr = '(?:[' + decimalNumbersStr + ']{1,3}\\\\.){3}[' + decimalNumbersStr + ']{1,3}';\n// Protected domain label which do not allow \"-\" character on the beginning and the end of a single label\nvar domainLabelStr = '[' + alphaNumericCharsStr + '](?:[' + alphaNumericCharsStr + '\\\\-]{0,61}[' + alphaNumericCharsStr + '])?';\nvar getDomainLabelStr = function (group) {\n return '(?=(' + domainLabelStr + '))\\\\' + group;\n};\n/**\n * A function to match domain names of a URL or email address.\n * Ex: 'google', 'yahoo', 'some-other-company', etc.\n */\nexport var getDomainNameStr = function (group) {\n return '(?:' + getDomainLabelStr(group) + '(?:\\\\.' + getDomainLabelStr(group + 1) + '){0,126}|' + ipStr + ')';\n};\n/**\n * A regular expression to match domain names of a URL or email address.\n * Ex: 'google', 'yahoo', 'some-other-company', etc.\n */\nexport var domainNameRegex = new RegExp('[' + alphaNumericCharsStr + '.\\\\-]*[' + alphaNumericCharsStr + '\\\\-]');\n\n//# sourceMappingURL=regex-lib.js.map\n","// NOTE: THIS IS A GENERATED FILE\n// To update with the latest TLD list, run `npm run update-tld-regex` or `yarn update-tld-regex` (depending on which you have installed)\nexport var tldRegex = /(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/;\n\n//# sourceMappingURL=tld-regex.js.map\n","import { alphaCharsStr } from \"../regex-lib\";\n/**\n * @private\n * @class Autolinker.matcher.UrlMatchValidator\n * @singleton\n *\n * Used by Autolinker to filter out false URL positives from the\n * {@link Autolinker.matcher.Url UrlMatcher}.\n *\n * Due to the limitations of regular expressions (including the missing feature\n * of look-behinds in JS regular expressions), we cannot always determine the\n * validity of a given match. This class applies a bit of additional logic to\n * filter out any false positives that have been matched by the\n * {@link Autolinker.matcher.Url UrlMatcher}.\n */\nvar UrlMatchValidator = /** @class */ (function () {\n function UrlMatchValidator() {\n }\n /**\n * Determines if a given URL match found by the {@link Autolinker.matcher.Url UrlMatcher}\n * is valid. Will return `false` for:\n *\n * 1) URL matches which do not have at least have one period ('.') in the\n * domain name (effectively skipping over matches like \"abc:def\").\n * However, URL matches with a protocol will be allowed (ex: 'http://localhost')\n * 2) URL matches which do not have at least one word character in the\n * domain name (effectively skipping over matches like \"git:1.0\").\n * 3) A protocol-relative url match (a URL beginning with '//') whose\n * previous character is a word character (effectively skipping over\n * strings like \"abc//google.com\")\n *\n * Otherwise, returns `true`.\n *\n * @param {String} urlMatch The matched URL, if there was one. Will be an\n * empty string if the match is not a URL match.\n * @param {String} protocolUrlMatch The match URL string for a protocol\n * match. Ex: 'http://yahoo.com'. This is used to match something like\n * 'http://localhost', where we won't double check that the domain name\n * has at least one '.' in it.\n * @return {Boolean} `true` if the match given is valid and should be\n * processed, or `false` if the match is invalid and/or should just not be\n * processed.\n */\n UrlMatchValidator.isValid = function (urlMatch, protocolUrlMatch) {\n if ((protocolUrlMatch && !this.isValidUriScheme(protocolUrlMatch)) ||\n this.urlMatchDoesNotHaveProtocolOrDot(urlMatch, protocolUrlMatch) || // At least one period ('.') must exist in the URL match for us to consider it an actual URL, *unless* it was a full protocol match (like 'http://localhost')\n (this.urlMatchDoesNotHaveAtLeastOneWordChar(urlMatch, protocolUrlMatch) && // At least one letter character must exist in the domain name after a protocol match. Ex: skip over something like \"git:1.0\"\n !this.isValidIpAddress(urlMatch)) || // Except if it's an IP address\n this.containsMultipleDots(urlMatch)) {\n return false;\n }\n return true;\n };\n UrlMatchValidator.isValidIpAddress = function (uriSchemeMatch) {\n var newRegex = new RegExp(this.hasFullProtocolRegex.source + this.ipRegex.source);\n var uriScheme = uriSchemeMatch.match(newRegex);\n return uriScheme !== null;\n };\n UrlMatchValidator.containsMultipleDots = function (urlMatch) {\n var stringBeforeSlash = urlMatch;\n if (this.hasFullProtocolRegex.test(urlMatch)) {\n stringBeforeSlash = urlMatch.split('://')[1];\n }\n return stringBeforeSlash.split('/')[0].indexOf(\"..\") > -1;\n };\n /**\n * Determines if the URI scheme is a valid scheme to be autolinked. Returns\n * `false` if the scheme is 'javascript:' or 'vbscript:'\n *\n * @private\n * @param {String} uriSchemeMatch The match URL string for a full URI scheme\n * match. Ex: 'http://yahoo.com' or 'mailto:a@a.com'.\n * @return {Boolean} `true` if the scheme is a valid one, `false` otherwise.\n */\n UrlMatchValidator.isValidUriScheme = function (uriSchemeMatch) {\n var uriSchemeMatchArr = uriSchemeMatch.match(this.uriSchemeRegex), uriScheme = uriSchemeMatchArr && uriSchemeMatchArr[0].toLowerCase();\n return (uriScheme !== 'javascript:' && uriScheme !== 'vbscript:');\n };\n /**\n * Determines if a URL match does not have either:\n *\n * a) a full protocol (i.e. 'http://'), or\n * b) at least one dot ('.') in the domain name (for a non-full-protocol\n * match).\n *\n * Either situation is considered an invalid URL (ex: 'git:d' does not have\n * either the '://' part, or at least one dot in the domain name. If the\n * match was 'git:abc.com', we would consider this valid.)\n *\n * @private\n * @param {String} urlMatch The matched URL, if there was one. Will be an\n * empty string if the match is not a URL match.\n * @param {String} protocolUrlMatch The match URL string for a protocol\n * match. Ex: 'http://yahoo.com'. This is used to match something like\n * 'http://localhost', where we won't double check that the domain name\n * has at least one '.' in it.\n * @return {Boolean} `true` if the URL match does not have a full protocol,\n * or at least one dot ('.') in a non-full-protocol match.\n */\n UrlMatchValidator.urlMatchDoesNotHaveProtocolOrDot = function (urlMatch, protocolUrlMatch) {\n return (!!urlMatch && (!protocolUrlMatch || !this.hasFullProtocolRegex.test(protocolUrlMatch)) && urlMatch.indexOf('.') === -1);\n };\n /**\n * Determines if a URL match does not have at least one word character after\n * the protocol (i.e. in the domain name).\n *\n * At least one letter character must exist in the domain name after a\n * protocol match. Ex: skip over something like \"git:1.0\"\n *\n * @private\n * @param {String} urlMatch The matched URL, if there was one. Will be an\n * empty string if the match is not a URL match.\n * @param {String} protocolUrlMatch The match URL string for a protocol\n * match. Ex: 'http://yahoo.com'. This is used to know whether or not we\n * have a protocol in the URL string, in order to check for a word\n * character after the protocol separator (':').\n * @return {Boolean} `true` if the URL match does not have at least one word\n * character in it after the protocol, `false` otherwise.\n */\n UrlMatchValidator.urlMatchDoesNotHaveAtLeastOneWordChar = function (urlMatch, protocolUrlMatch) {\n if (urlMatch && protocolUrlMatch) {\n return !this.hasWordCharAfterProtocolRegex.test(urlMatch);\n }\n else {\n return false;\n }\n };\n /**\n * Regex to test for a full protocol, with the two trailing slashes. Ex: 'http://'\n *\n * @private\n * @property {RegExp} hasFullProtocolRegex\n */\n UrlMatchValidator.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\\/\\//;\n /**\n * Regex to find the URI scheme, such as 'mailto:'.\n *\n * This is used to filter out 'javascript:' and 'vbscript:' schemes.\n *\n * @private\n * @property {RegExp} uriSchemeRegex\n */\n UrlMatchValidator.uriSchemeRegex = /^[A-Za-z][-.+A-Za-z0-9]*:/;\n /**\n * Regex to determine if at least one word char exists after the protocol (i.e. after the ':')\n *\n * @private\n * @property {RegExp} hasWordCharAfterProtocolRegex\n */\n UrlMatchValidator.hasWordCharAfterProtocolRegex = new RegExp(\":[^\\\\s]*?[\" + alphaCharsStr + \"]\");\n /**\n * Regex to determine if the string is a valid IP address\n *\n * @private\n * @property {RegExp} ipRegex\n */\n UrlMatchValidator.ipRegex = /[0-9][0-9]?[0-9]?\\.[0-9][0-9]?[0-9]?\\.[0-9][0-9]?[0-9]?\\.[0-9][0-9]?[0-9]?(:[0-9]*)?\\/?$/;\n return UrlMatchValidator;\n}());\nexport { UrlMatchValidator };\n\n//# sourceMappingURL=url-match-validator.js.map\n","import { defaults, remove } from \"./utils\";\nimport { AnchorTagBuilder } from \"./anchor-tag-builder\";\nimport { HtmlParser } from \"./htmlParser/html-parser\";\nimport { Match } from \"./match/match\";\nimport { EmailMatch } from \"./match/email-match\";\nimport { HashtagMatch } from \"./match/hashtag-match\";\nimport { MentionMatch } from \"./match/mention-match\";\nimport { PhoneMatch } from \"./match/phone-match\";\nimport { UrlMatch } from \"./match/url-match\";\nimport { Matcher } from \"./matcher/matcher\";\nimport { HtmlTag } from \"./html-tag\";\nimport { EmailMatcher } from \"./matcher/email-matcher\";\nimport { UrlMatcher } from \"./matcher/url-matcher\";\nimport { HashtagMatcher } from \"./matcher/hashtag-matcher\";\nimport { PhoneMatcher } from \"./matcher/phone-matcher\";\nimport { MentionMatcher } from \"./matcher/mention-matcher\";\n/**\n * @class Autolinker\n * @extends Object\n *\n * Utility class used to process a given string of text, and wrap the matches in\n * the appropriate anchor (<a>) tags to turn them into links.\n *\n * Any of the configuration options may be provided in an Object provided\n * to the Autolinker constructor, which will configure how the {@link #link link()}\n * method will process the links.\n *\n * For example:\n *\n * var autolinker = new Autolinker( {\n * newWindow : false,\n * truncate : 30\n * } );\n *\n * var html = autolinker.link( \"Joe went to www.yahoo.com\" );\n * // produces: 'Joe went to yahoo.com'\n *\n *\n * The {@link #static-link static link()} method may also be used to inline\n * options into a single call, which may be more convenient for one-off uses.\n * For example:\n *\n * var html = Autolinker.link( \"Joe went to www.yahoo.com\", {\n * newWindow : false,\n * truncate : 30\n * } );\n * // produces: 'Joe went to yahoo.com'\n *\n *\n * ## Custom Replacements of Links\n *\n * If the configuration options do not provide enough flexibility, a {@link #replaceFn}\n * may be provided to fully customize the output of Autolinker. This function is\n * called once for each URL/Email/Phone#/Hashtag/Mention (Twitter, Instagram, Soundcloud)\n * match that is encountered.\n *\n * For example:\n *\n * var input = \"...\"; // string with URLs, Email Addresses, Phone #s, Hashtags, and Mentions (Twitter, Instagram, Soundcloud)\n *\n * var linkedText = Autolinker.link( input, {\n * replaceFn : function( match ) {\n * console.log( \"href = \", match.getAnchorHref() );\n * console.log( \"text = \", match.getAnchorText() );\n *\n * switch( match.getType() ) {\n * case 'url' :\n * console.log( \"url: \", match.getUrl() );\n *\n * if( match.getUrl().indexOf( 'mysite.com' ) === -1 ) {\n * var tag = match.buildTag(); // returns an `Autolinker.HtmlTag` instance, which provides mutator methods for easy changes\n * tag.setAttr( 'rel', 'nofollow' );\n * tag.addClass( 'external-link' );\n *\n * return tag;\n *\n * } else {\n * return true; // let Autolinker perform its normal anchor tag replacement\n * }\n *\n * case 'email' :\n * var email = match.getEmail();\n * console.log( \"email: \", email );\n *\n * if( email === \"my@own.address\" ) {\n * return false; // don't auto-link this particular email address; leave as-is\n * } else {\n * return; // no return value will have Autolinker perform its normal anchor tag replacement (same as returning `true`)\n * }\n *\n * case 'phone' :\n * var phoneNumber = match.getPhoneNumber();\n * console.log( phoneNumber );\n *\n * return '' + phoneNumber + '';\n *\n * case 'hashtag' :\n * var hashtag = match.getHashtag();\n * console.log( hashtag );\n *\n * return '' + hashtag + '';\n *\n * case 'mention' :\n * var mention = match.getMention();\n * console.log( mention );\n *\n * return '' + mention + '';\n * }\n * }\n * } );\n *\n *\n * The function may return the following values:\n *\n * - `true` (Boolean): Allow Autolinker to replace the match as it normally\n * would.\n * - `false` (Boolean): Do not replace the current match at all - leave as-is.\n * - Any String: If a string is returned from the function, the string will be\n * used directly as the replacement HTML for the match.\n * - An {@link Autolinker.HtmlTag} instance, which can be used to build/modify\n * an HTML tag before writing out its HTML text.\n */\nvar Autolinker = /** @class */ (function () {\n /**\n * @method constructor\n * @param {Object} [cfg] The configuration options for the Autolinker instance,\n * specified in an Object (map).\n */\n function Autolinker(cfg) {\n if (cfg === void 0) { cfg = {}; }\n /**\n * The Autolinker version number exposed on the instance itself.\n *\n * Ex: 0.25.1\n */\n this.version = Autolinker.version;\n /**\n * @cfg {Boolean/Object} [urls]\n *\n * `true` if URLs should be automatically linked, `false` if they should not\n * be. Defaults to `true`.\n *\n * Examples:\n *\n * urls: true\n *\n * // or\n *\n * urls: {\n * schemeMatches : true,\n * wwwMatches : true,\n * tldMatches : true\n * }\n *\n * As shown above, this option also accepts an Object form with 3 properties\n * to allow for more customization of what exactly gets linked. All default\n * to `true`:\n *\n * @cfg {Boolean} [urls.schemeMatches] `true` to match URLs found prefixed\n * with a scheme, i.e. `http://google.com`, or `other+scheme://google.com`,\n * `false` to prevent these types of matches.\n * @cfg {Boolean} [urls.wwwMatches] `true` to match urls found prefixed with\n * `'www.'`, i.e. `www.google.com`. `false` to prevent these types of\n * matches. Note that if the URL had a prefixed scheme, and\n * `schemeMatches` is true, it will still be linked.\n * @cfg {Boolean} [urls.tldMatches] `true` to match URLs with known top\n * level domains (.com, .net, etc.) that are not prefixed with a scheme or\n * `'www.'`. This option attempts to match anything that looks like a URL\n * in the given text. Ex: `google.com`, `asdf.org/?page=1`, etc. `false`\n * to prevent these types of matches.\n */\n this.urls = {}; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Boolean} [email=true]\n *\n * `true` if email addresses should be automatically linked, `false` if they\n * should not be.\n */\n this.email = true; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Boolean} [phone=true]\n *\n * `true` if Phone numbers (\"(555)555-5555\") should be automatically linked,\n * `false` if they should not be.\n */\n this.phone = true; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Boolean/String} [hashtag=false]\n *\n * A string for the service name to have hashtags (ex: \"#myHashtag\")\n * auto-linked to. The currently-supported values are:\n *\n * - 'twitter'\n * - 'facebook'\n * - 'instagram'\n *\n * Pass `false` to skip auto-linking of hashtags.\n */\n this.hashtag = false; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {String/Boolean} [mention=false]\n *\n * A string for the service name to have mentions (ex: \"@myuser\")\n * auto-linked to. The currently supported values are:\n *\n * - 'twitter'\n * - 'instagram'\n * - 'soundcloud'\n *\n * Defaults to `false` to skip auto-linking of mentions.\n */\n this.mention = false; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Boolean} [newWindow=true]\n *\n * `true` if the links should open in a new window, `false` otherwise.\n */\n this.newWindow = true; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Boolean/Object} [stripPrefix=true]\n *\n * `true` if 'http://' (or 'https://') and/or the 'www.' should be stripped\n * from the beginning of URL links' text, `false` otherwise. Defaults to\n * `true`.\n *\n * Examples:\n *\n * stripPrefix: true\n *\n * // or\n *\n * stripPrefix: {\n * scheme : true,\n * www : true\n * }\n *\n * As shown above, this option also accepts an Object form with 2 properties\n * to allow for more customization of what exactly is prevented from being\n * displayed. Both default to `true`:\n *\n * @cfg {Boolean} [stripPrefix.scheme] `true` to prevent the scheme part of\n * a URL match from being displayed to the user. Example:\n * `'http://google.com'` will be displayed as `'google.com'`. `false` to\n * not strip the scheme. NOTE: Only an `'http://'` or `'https://'` scheme\n * will be removed, so as not to remove a potentially dangerous scheme\n * (such as `'file://'` or `'javascript:'`)\n * @cfg {Boolean} [stripPrefix.www] www (Boolean): `true` to prevent the\n * `'www.'` part of a URL match from being displayed to the user. Ex:\n * `'www.google.com'` will be displayed as `'google.com'`. `false` to not\n * strip the `'www'`.\n */\n this.stripPrefix = { scheme: true, www: true }; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Boolean} [stripTrailingSlash=true]\n *\n * `true` to remove the trailing slash from URL matches, `false` to keep\n * the trailing slash.\n *\n * Example when `true`: `http://google.com/` will be displayed as\n * `http://google.com`.\n */\n this.stripTrailingSlash = true; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Boolean} [decodePercentEncoding=true]\n *\n * `true` to decode percent-encoded characters in URL matches, `false` to keep\n * the percent-encoded characters.\n *\n * Example when `true`: `https://en.wikipedia.org/wiki/San_Jos%C3%A9` will\n * be displayed as `https://en.wikipedia.org/wiki/San_José`.\n */\n this.decodePercentEncoding = true; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Number/Object} [truncate=0]\n *\n * ## Number Form\n *\n * A number for how many characters matched text should be truncated to\n * inside the text of a link. If the matched text is over this number of\n * characters, it will be truncated to this length by adding a two period\n * ellipsis ('..') to the end of the string.\n *\n * For example: A url like 'http://www.yahoo.com/some/long/path/to/a/file'\n * truncated to 25 characters might look something like this:\n * 'yahoo.com/some/long/pat..'\n *\n * Example Usage:\n *\n * truncate: 25\n *\n *\n * Defaults to `0` for \"no truncation.\"\n *\n *\n * ## Object Form\n *\n * An Object may also be provided with two properties: `length` (Number) and\n * `location` (String). `location` may be one of the following: 'end'\n * (default), 'middle', or 'smart'.\n *\n * Example Usage:\n *\n * truncate: { length: 25, location: 'middle' }\n *\n * @cfg {Number} [truncate.length=0] How many characters to allow before\n * truncation will occur. Defaults to `0` for \"no truncation.\"\n * @cfg {\"end\"/\"middle\"/\"smart\"} [truncate.location=\"end\"]\n *\n * - 'end' (default): will truncate up to the number of characters, and then\n * add an ellipsis at the end. Ex: 'yahoo.com/some/long/pat..'\n * - 'middle': will truncate and add the ellipsis in the middle. Ex:\n * 'yahoo.com/s..th/to/a/file'\n * - 'smart': for URLs where the algorithm attempts to strip out unnecessary\n * parts first (such as the 'www.', then URL scheme, hash, etc.),\n * attempting to make the URL human-readable before looking for a good\n * point to insert the ellipsis if it is still too long. Ex:\n * 'yahoo.com/some..to/a/file'. For more details, see\n * {@link Autolinker.truncate.TruncateSmart}.\n */\n this.truncate = { length: 0, location: 'end' }; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {String} className\n *\n * A CSS class name to add to the generated links. This class will be added\n * to all links, as well as this class plus match suffixes for styling\n * url/email/phone/hashtag/mention links differently.\n *\n * For example, if this config is provided as \"myLink\", then:\n *\n * - URL links will have the CSS classes: \"myLink myLink-url\"\n * - Email links will have the CSS classes: \"myLink myLink-email\", and\n * - Phone links will have the CSS classes: \"myLink myLink-phone\"\n * - Hashtag links will have the CSS classes: \"myLink myLink-hashtag\"\n * - Mention links will have the CSS classes: \"myLink myLink-mention myLink-[type]\"\n * where [type] is either \"instagram\", \"twitter\" or \"soundcloud\"\n */\n this.className = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Function} replaceFn\n *\n * A function to individually process each match found in the input string.\n *\n * See the class's description for usage.\n *\n * The `replaceFn` can be called with a different context object (`this`\n * reference) using the {@link #context} cfg.\n *\n * This function is called with the following parameter:\n *\n * @cfg {Autolinker.match.Match} replaceFn.match The Match instance which\n * can be used to retrieve information about the match that the `replaceFn`\n * is currently processing. See {@link Autolinker.match.Match} subclasses\n * for details.\n */\n this.replaceFn = null; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @cfg {Object} context\n *\n * The context object (`this` reference) to call the `replaceFn` with.\n *\n * Defaults to this Autolinker instance.\n */\n this.context = undefined; // default value just to get the above doc comment in the ES5 output and documentation generator\n /**\n * @private\n * @property {Autolinker.htmlParser.HtmlParser} htmlParser\n *\n * The HtmlParser instance used to skip over HTML tags, while finding text\n * nodes to process.\n */\n this.htmlParser = new HtmlParser();\n /**\n * @private\n * @property {Autolinker.matcher.Matcher[]} matchers\n *\n * The {@link Autolinker.matcher.Matcher} instances for this Autolinker\n * instance.\n *\n * This is lazily created in {@link #getMatchers}.\n */\n this.matchers = null;\n /**\n * @private\n * @property {Autolinker.AnchorTagBuilder} tagBuilder\n *\n * The AnchorTagBuilder instance used to build match replacement anchor tags.\n * Note: this is lazily instantiated in the {@link #getTagBuilder} method.\n */\n this.tagBuilder = null;\n // Note: when `this.something` is used in the rhs of these assignments,\n // it refers to the default values set above the constructor\n this.urls = this.normalizeUrlsCfg(cfg.urls);\n this.email = typeof cfg.email === 'boolean' ? cfg.email : this.email;\n this.phone = typeof cfg.phone === 'boolean' ? cfg.phone : this.phone;\n this.hashtag = cfg.hashtag || this.hashtag;\n this.mention = cfg.mention || this.mention;\n this.newWindow = typeof cfg.newWindow === 'boolean' ? cfg.newWindow : this.newWindow;\n this.stripPrefix = this.normalizeStripPrefixCfg(cfg.stripPrefix);\n this.stripTrailingSlash = typeof cfg.stripTrailingSlash === 'boolean' ? cfg.stripTrailingSlash : this.stripTrailingSlash;\n this.decodePercentEncoding = typeof cfg.decodePercentEncoding === 'boolean' ? cfg.decodePercentEncoding : this.decodePercentEncoding;\n // Validate the value of the `mention` cfg\n var mention = this.mention;\n if (mention !== false && mention !== 'twitter' && mention !== 'instagram' && mention !== 'soundcloud') {\n throw new Error(\"invalid `mention` cfg - see docs\");\n }\n // Validate the value of the `hashtag` cfg\n var hashtag = this.hashtag;\n if (hashtag !== false && hashtag !== 'twitter' && hashtag !== 'facebook' && hashtag !== 'instagram') {\n throw new Error(\"invalid `hashtag` cfg - see docs\");\n }\n this.truncate = this.normalizeTruncateCfg(cfg.truncate);\n this.className = cfg.className || this.className;\n this.replaceFn = cfg.replaceFn || this.replaceFn;\n this.context = cfg.context || this;\n }\n /**\n * Automatically links URLs, Email addresses, Phone Numbers, Twitter handles,\n * Hashtags, and Mentions found in the given chunk of HTML. Does not link URLs\n * found within HTML tags.\n *\n * For instance, if given the text: `You should go to http://www.yahoo.com`,\n * then the result will be `You should go to <a href=\"http://www.yahoo.com\">http://www.yahoo.com</a>`\n *\n * Example:\n *\n * var linkedText = Autolinker.link( \"Go to google.com\", { newWindow: false } );\n * // Produces: \"Go to google.com\"\n *\n * @static\n * @param {String} textOrHtml The HTML or text to find matches within (depending\n * on if the {@link #urls}, {@link #email}, {@link #phone}, {@link #mention},\n * {@link #hashtag}, and {@link #mention} options are enabled).\n * @param {Object} [options] Any of the configuration options for the Autolinker\n * class, specified in an Object (map). See the class description for an\n * example call.\n * @return {String} The HTML text, with matches automatically linked.\n */\n Autolinker.link = function (textOrHtml, options) {\n var autolinker = new Autolinker(options);\n return autolinker.link(textOrHtml);\n };\n /**\n * Parses the input `textOrHtml` looking for URLs, email addresses, phone\n * numbers, username handles, and hashtags (depending on the configuration\n * of the Autolinker instance), and returns an array of {@link Autolinker.match.Match}\n * objects describing those matches (without making any replacements).\n *\n * Note that if parsing multiple pieces of text, it is slightly more efficient\n * to create an Autolinker instance, and use the instance-level {@link #parse}\n * method.\n *\n * Example:\n *\n * var matches = Autolinker.parse( \"Hello google.com, I am asdf@asdf.com\", {\n * urls: true,\n * email: true\n * } );\n *\n * console.log( matches.length ); // 2\n * console.log( matches[ 0 ].getType() ); // 'url'\n * console.log( matches[ 0 ].getUrl() ); // 'google.com'\n * console.log( matches[ 1 ].getType() ); // 'email'\n * console.log( matches[ 1 ].getEmail() ); // 'asdf@asdf.com'\n *\n * @static\n * @param {String} textOrHtml The HTML or text to find matches within\n * (depending on if the {@link #urls}, {@link #email}, {@link #phone},\n * {@link #hashtag}, and {@link #mention} options are enabled).\n * @param {Object} [options] Any of the configuration options for the Autolinker\n * class, specified in an Object (map). See the class description for an\n * example call.\n * @return {Autolinker.match.Match[]} The array of Matches found in the\n * given input `textOrHtml`.\n */\n Autolinker.parse = function (textOrHtml, options) {\n var autolinker = new Autolinker(options);\n return autolinker.parse(textOrHtml);\n };\n /**\n * Normalizes the {@link #urls} config into an Object with 3 properties:\n * `schemeMatches`, `wwwMatches`, and `tldMatches`, all Booleans.\n *\n * See {@link #urls} config for details.\n *\n * @private\n * @param {Boolean/Object} urls\n * @return {Object}\n */\n Autolinker.prototype.normalizeUrlsCfg = function (urls) {\n if (urls == null)\n urls = true; // default to `true`\n if (typeof urls === 'boolean') {\n return { schemeMatches: urls, wwwMatches: urls, tldMatches: urls };\n }\n else { // object form\n return {\n schemeMatches: typeof urls.schemeMatches === 'boolean' ? urls.schemeMatches : true,\n wwwMatches: typeof urls.wwwMatches === 'boolean' ? urls.wwwMatches : true,\n tldMatches: typeof urls.tldMatches === 'boolean' ? urls.tldMatches : true\n };\n }\n };\n /**\n * Normalizes the {@link #stripPrefix} config into an Object with 2\n * properties: `scheme`, and `www` - both Booleans.\n *\n * See {@link #stripPrefix} config for details.\n *\n * @private\n * @param {Boolean/Object} stripPrefix\n * @return {Object}\n */\n Autolinker.prototype.normalizeStripPrefixCfg = function (stripPrefix) {\n if (stripPrefix == null)\n stripPrefix = true; // default to `true`\n if (typeof stripPrefix === 'boolean') {\n return { scheme: stripPrefix, www: stripPrefix };\n }\n else { // object form\n return {\n scheme: typeof stripPrefix.scheme === 'boolean' ? stripPrefix.scheme : true,\n www: typeof stripPrefix.www === 'boolean' ? stripPrefix.www : true\n };\n }\n };\n /**\n * Normalizes the {@link #truncate} config into an Object with 2 properties:\n * `length` (Number), and `location` (String).\n *\n * See {@link #truncate} config for details.\n *\n * @private\n * @param {Number/Object} truncate\n * @return {Object}\n */\n Autolinker.prototype.normalizeTruncateCfg = function (truncate) {\n if (typeof truncate === 'number') {\n return { length: truncate, location: 'end' };\n }\n else { // object, or undefined/null\n return defaults(truncate || {}, {\n length: Number.POSITIVE_INFINITY,\n location: 'end'\n });\n }\n };\n /**\n * Parses the input `textOrHtml` looking for URLs, email addresses, phone\n * numbers, username handles, and hashtags (depending on the configuration\n * of the Autolinker instance), and returns an array of {@link Autolinker.match.Match}\n * objects describing those matches (without making any replacements).\n *\n * This method is used by the {@link #link} method, but can also be used to\n * simply do parsing of the input in order to discover what kinds of links\n * there are and how many.\n *\n * Example usage:\n *\n * var autolinker = new Autolinker( {\n * urls: true,\n * email: true\n * } );\n *\n * var matches = autolinker.parse( \"Hello google.com, I am asdf@asdf.com\" );\n *\n * console.log( matches.length ); // 2\n * console.log( matches[ 0 ].getType() ); // 'url'\n * console.log( matches[ 0 ].getUrl() ); // 'google.com'\n * console.log( matches[ 1 ].getType() ); // 'email'\n * console.log( matches[ 1 ].getEmail() ); // 'asdf@asdf.com'\n *\n * @param {String} textOrHtml The HTML or text to find matches within\n * (depending on if the {@link #urls}, {@link #email}, {@link #phone},\n * {@link #hashtag}, and {@link #mention} options are enabled).\n * @return {Autolinker.match.Match[]} The array of Matches found in the\n * given input `textOrHtml`.\n */\n Autolinker.prototype.parse = function (textOrHtml) {\n var htmlNodes = this.htmlParser.parse(textOrHtml), skipTagNames = ['a', 'style', 'script'], skipTagsStackCount = 0, // used to only Autolink text outside of anchor/script/style tags. We don't want to autolink something that is already linked inside of an tag, for instance\n matches = [];\n // Find all matches within the `textOrHtml` (but not matches that are\n // already nested within , or tag\n skipTagsStackCount = Math.max(skipTagsStackCount - 1, 0); // attempt to handle extraneous tags by making sure the stack count never goes below 0\n }\n }\n else if (nodeType === 'text' && skipTagsStackCount === 0) { // Process text nodes that are not within an ,