TimeTrex/interface/html5/dist/vendors-node_modules_linkifyjs_string_js.bundle.js

1 line
148 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["vendors-node_modules_linkifyjs_string_js"],{541:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval("var __webpack_unused_export__;\n\n\n__webpack_unused_export__ = true;\n\nvar _linkify = __webpack_require__(8425);\n\nvar linkify = _interopRequireWildcard(_linkify);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nvar tokenize = linkify.tokenize,\n options = linkify.options; /**\n \tConvert strings of text into linkable HTML text\n */\n\nvar Options = options.Options;\n\n\nfunction escapeText(text) {\n\treturn text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}\n\nfunction escapeAttr(href) {\n\treturn href.replace(/\"/g, '&quot;');\n}\n\nfunction attributesToString(attributes) {\n\tif (!attributes) {\n\t\treturn '';\n\t}\n\tvar result = [];\n\n\tfor (var attr in attributes) {\n\t\tvar val = attributes[attr] + '';\n\t\tresult.push(attr + '=\"' + escapeAttr(val) + '\"');\n\t}\n\treturn result.join(' ');\n}\n\nfunction linkifyStr(str) {\n\tvar opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\topts = new Options(opts);\n\n\tvar tokens = tokenize(str);\n\tvar result = [];\n\n\tfor (var i = 0; i < tokens.length; i++) {\n\t\tvar token = tokens[i];\n\n\t\tif (token.type === 'nl' && opts.nl2br) {\n\t\t\tresult.push('<br>\\n');\n\t\t\tcontinue;\n\t\t} else if (!token.isLink || !opts.check(token)) {\n\t\t\tresult.push(escapeText(token.toString()));\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar _opts$resolve = opts.resolve(token),\n\t\t formatted = _opts$resolve.formatted,\n\t\t formattedHref = _opts$resolve.formattedHref,\n\t\t tagName = _opts$resolve.tagName,\n\t\t className = _opts$resolve.className,\n\t\t target = _opts$resolve.target,\n\t\t attributes = _opts$resolve.attributes;\n\n\t\tvar link = '<' + tagName + ' href=\"' + escapeAttr(formattedHref) + '\"';\n\n\t\tif (className) {\n\t\t\tlink += ' class=\"' + escapeAttr(className) + '\"';\n\t\t}\n\n\t\tif (target) {\n\t\t\tlink += ' target=\"' + escapeAttr(target) + '\"';\n\t\t}\n\n\t\tif (attributes) {\n\t\t\tlink += ' ' + attributesToString(attributes);\n\t\t}\n\n\t\tlink += '>' + escapeText(formatted) + '</' + tagName + '>';\n\t\tresult.push(link);\n\t}\n\n\treturn result.join('');\n}\n\nif (!String.prototype.linkify) {\n\ttry {\n\t\tObject.defineProperty(String.prototype, 'linkify', {\n\t\t\tset: function set() {},\n\t\t\tget: function get() {\n\t\t\t\treturn function linkify(opts) {\n\t\t\t\t\treturn linkifyStr(this, opts);\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t} catch (e) {\n\t\t// IE 8 doesn't like Object.defineProperty on non-DOM objects\n\t\tif (!String.prototype.linkify) {\n\t\t\tString.prototype.linkify = function (opts) {\n\t\t\t\treturn linkifyStr(this, opts);\n\t\t\t};\n\t\t}\n\t}\n}\n\n__webpack_unused_export__ = linkifyStr;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQxLmpzIiwibWFwcGluZ3MiOiI7QUFBYTs7QUFFYix5QkFBa0I7O0FBRWxCLGVBQWUsbUJBQU8sQ0FBQyxJQUFXOztBQUVsQzs7QUFFQSx3Q0FBd0MsNkJBQTZCLGNBQWMsT0FBTyxpQkFBaUIsbUJBQW1CLHVCQUF1QixnRkFBZ0Ysc0JBQXNCOztBQUUzUDtBQUNBLCtCQUErQjtBQUMvQjtBQUNBOztBQUVBOzs7QUFHQTtBQUNBLGlDQUFpQyxzQkFBc0Isc0JBQXNCO0FBQzdFOztBQUVBO0FBQ0Esa0NBQWtDO0FBQ2xDOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTs7QUFFQSxpQkFBaUIsbUJBQW1CO0FBQ3BDOztBQUVBO0FBQ0E7QUFDQTtBQUNBLElBQUk7QUFDSjtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EseUJBQXlCO0FBQ3pCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxHQUFHO0FBQ0gsR0FBRztBQUNIO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7