@readme/markdown
Version:
ReadMe's React-based Markdown parser
1,342 lines (1,229 loc) • 1.56 MB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("@readme/variable"), require("@tippyjs/react"), require("react"));
else if(typeof define === 'function' && define.amd)
define(["@readme/variable", "@tippyjs/react", "react"], factory);
else {
var a = typeof exports === 'object' ? factory(require("@readme/variable"), require("@tippyjs/react"), require("react")) : factory(root["@readme/variable"], root["@tippyjs/react"], root["React"]);
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
}
})(self, (__WEBPACK_EXTERNAL_MODULE__3689__, __WEBPACK_EXTERNAL_MODULE__578__, __WEBPACK_EXTERNAL_MODULE__4466__) => {
return /******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 478:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var visit = __webpack_require__(791);
var hasOwnProperty = Object.prototype.hasOwnProperty;
var hastCssPropertyMap = {
align: 'text-align',
valign: 'vertical-align',
height: 'height',
width: 'width',
};
module.exports = function tableCellStyle(node) {
visit(node, 'element', visitor);
return node;
};
function visitor(node) {
if (node.tagName !== 'tr' && node.tagName !== 'td' && node.tagName !== 'th') {
return;
}
var hastName;
var cssName;
for (hastName in hastCssPropertyMap) {
if (
!hasOwnProperty.call(hastCssPropertyMap, hastName) ||
node.properties[hastName] === undefined
) {
continue;
}
cssName = hastCssPropertyMap[hastName];
appendStyle(node, cssName, node.properties[hastName]);
delete node.properties[hastName];
}
}
function appendStyle(node, property, value) {
var prevStyle = (node.properties.style || '').trim();
if (prevStyle && !/;\s*/.test(prevStyle)) {
prevStyle += ';';
}
if (prevStyle) {
prevStyle += ' ';
}
var nextStyle = prevStyle + property + ': ' + value + ';';
node.properties.style = nextStyle;
}
/***/ }),
/***/ 791:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
module.exports = visit
var visitParents = __webpack_require__(9294)
var CONTINUE = visitParents.CONTINUE
var SKIP = visitParents.SKIP
var EXIT = visitParents.EXIT
visit.CONTINUE = CONTINUE
visit.SKIP = SKIP
visit.EXIT = EXIT
function visit(tree, test, visitor, reverse) {
if (typeof test === 'function' && typeof visitor !== 'function') {
reverse = visitor
visitor = test
test = null
}
visitParents(tree, test, overload, reverse)
function overload(node, parents) {
var parent = parents[parents.length - 1]
var index = parent ? parent.children.indexOf(node) : null
return visitor(node, index, parent)
}
}
/***/ }),
/***/ 7721:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var s = __webpack_require__(9505);
var h = __webpack_require__(1742);
var find = __webpack_require__(9560);
var html = __webpack_require__(7247);
var svg = __webpack_require__(1218);
var vfileLocation = __webpack_require__(4787);
var ns = __webpack_require__(6);
module.exports = wrapper;
var own = {}.hasOwnProperty;
// Handlers.
var map = {
'#document': root,
'#document-fragment': root,
'#text': text,
'#comment': comment,
'#documentType': doctype
};
// Wrapper to normalise options.
function wrapper(ast, options) {
var settings = options || {};
var file;
if (settings.messages) {
file = settings;
settings = {};
} else {
file = settings.file;
}
return transform(ast, {
schema: settings.space === 'svg' ? svg : html,
file: file,
verbose: settings.verbose
});
}
// Transform a node.
function transform(ast, config) {
var schema = config.schema;
var fn = own.call(map, ast.nodeName) ? map[ast.nodeName] : element;
var children;
var result;
var position;
if (fn === element) {
config.schema = ast.namespaceURI === ns.svg ? svg : html;
}
if (ast.childNodes) {
children = nodes(ast.childNodes, config);
}
result = fn(ast, children, config);
if (ast.sourceCodeLocation && config.file) {
position = location(result, ast.sourceCodeLocation, config);
if (position) {
config.location = true;
result.position = position;
}
}
config.schema = schema;
return result;
}
// Transform children.
function nodes(children, config) {
var index = -1;
var result = [];
while (++index < children.length) {
result[index] = transform(children[index], config);
}
return result;
}
// Transform a document.
// Stores `ast.quirksMode` in `node.data.quirksMode`.
function root(ast, children, config) {
var result = {
type: 'root',
children: children,
data: {
quirksMode: ast.mode === 'quirks' || ast.mode === 'limited-quirks'
}
};
var doc;
var location;
if (config.file && config.location) {
doc = String(config.file);
location = vfileLocation(doc);
result.position = {
start: location.toPoint(0),
end: location.toPoint(doc.length)
};
}
return result;
}
// Transform a doctype.
function doctype(ast) {
return {
type: 'doctype',
name: ast.name || '',
public: ast.publicId || null,
system: ast.systemId || null
};
}
// Transform a text.
function text(ast) {
return {
type: 'text',
value: ast.value
};
}
// Transform a comment.
function comment(ast) {
return {
type: 'comment',
value: ast.data
};
}
// Transform an element.
function element(ast, children, config) {
var fn = config.schema.space === 'svg' ? s : h;
var props = {};
var index = -1;
var result;
var attribute;
var pos;
var start;
var end;
while (++index < ast.attrs.length) {
attribute = ast.attrs[index];
props[(attribute.prefix ? attribute.prefix + ':' : '') + attribute.name] = attribute.value;
}
result = fn(ast.tagName, props, children);
if (result.tagName === 'template' && 'content' in ast) {
pos = ast.sourceCodeLocation;
start = pos && pos.startTag && position(pos.startTag).end;
end = pos && pos.endTag && position(pos.endTag).start;
result.content = transform(ast.content, config);
if ((start || end) && config.file) {
result.content.position = {
start: start,
end: end
};
}
}
return result;
}
// Create clean positional information.
function location(node, location, config) {
var result = position(location);
var tail;
var key;
var props;
if (node.type === 'element') {
tail = node.children[node.children.length - 1];
// Bug for unclosed with children.
// See: <https://github.com/inikulin/parse5/issues/109>.
if (!location.endTag && tail && tail.position && tail.position.end) {
result.end = Object.assign({}, tail.position.end);
}
if (config.verbose) {
props = {};
for (key in location.attrs) {
props[find(config.schema, key).property] = position(location.attrs[key]);
}
node.data = {
position: {
opening: position(location.startTag),
closing: location.endTag ? position(location.endTag) : null,
properties: props
}
};
}
}
return result;
}
function position(loc) {
var start = point({
line: loc.startLine,
column: loc.startCol,
offset: loc.startOffset
});
var end = point({
line: loc.endLine,
column: loc.endCol,
offset: loc.endOffset
});
return start || end ? {
start: start,
end: end
} : null;
}
function point(point) {
return point.line && point.column ? point : null;
}
/***/ }),
/***/ 8335:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var xtend = __webpack_require__(7529);
var html = __webpack_require__(7247);
var svg = __webpack_require__(1218);
var find = __webpack_require__(9560);
var toH = __webpack_require__(6331);
var ns = __webpack_require__(6);
var zwitch = __webpack_require__(8019);
module.exports = transform;
var ignoredSpaces = ['svg', 'html'];
var one = zwitch('type');
one.handlers.root = root;
one.handlers.element = element;
one.handlers.text = text;
one.handlers.comment = comment;
one.handlers.doctype = doctype;
// Transform a tree from hast to Parse5’s AST.
function transform(tree, space) {
return one(tree, space === 'svg' ? svg : html);
}
function root(node, schema) {
var data = node.data || {};
var mode = data.quirksMode ? 'quirks' : 'no-quirks';
return patch(node, {
nodeName: '#document',
mode: mode
}, schema);
}
function fragment(node, schema) {
return patch(node, {
nodeName: '#document-fragment'
}, schema);
}
function doctype(node, schema) {
return patch(node, {
nodeName: '#documentType',
name: node.name,
publicId: node.public || '',
systemId: node.system || ''
}, schema);
}
function text(node, schema) {
return patch(node, {
nodeName: '#text',
value: node.value
}, schema);
}
function comment(node, schema) {
return patch(node, {
nodeName: '#comment',
data: node.value
}, schema);
}
function element(node, schema) {
var space = schema.space;
var shallow = xtend(node, {
children: []
});
return toH(h, shallow, {
space: space
});
function h(name, attrs) {
var values = [];
var p5;
var attr;
var value;
var key;
var info;
var pos;
for (key in attrs) {
info = find(schema, key);
attr = attrs[key];
if (attr === false || info.boolean && !attr) {
continue;
}
value = {
name: key,
value: attr === true ? '' : String(attr)
};
if (info.space && ignoredSpaces.indexOf(info.space) === -1) {
pos = key.indexOf(':');
if (pos === -1) {
value.prefix = '';
} else {
value.name = key.slice(pos + 1);
value.prefix = key.slice(0, pos);
}
value.namespace = ns[info.space];
}
values.push(value);
}
p5 = patch(node, {
nodeName: name,
tagName: name,
attrs: values
}, schema);
if (name === 'template') {
p5.content = fragment(shallow.content, schema);
}
return p5;
}
}
// Patch specific properties.
function patch(node, p5, parentSchema) {
var schema = parentSchema;
var position = node.position;
var children = node.children;
var childNodes = [];
var length = children ? children.length : 0;
var index = -1;
var child;
if (node.type === 'element') {
if (schema.space === 'html' && node.tagName === 'svg') {
schema = svg;
}
p5.namespaceURI = ns[schema.space];
}
while (++index < length) {
child = one(children[index], schema);
child.parentNode = p5;
childNodes[index] = child;
}
if (node.type === 'element' || node.type === 'root') {
p5.childNodes = childNodes;
}
if (position && position.start && position.end) {
p5.sourceCodeLocation = {
startLine: position.start.line,
startCol: position.start.column,
startOffset: position.start.offset,
endLine: position.end.line,
endCol: position.end.column,
endOffset: position.end.offset
};
}
return p5;
}
/***/ }),
/***/ 8980:
/***/ ((module) => {
"use strict";
module.exports = function (value) {
if (Object.prototype.toString.call(value) !== '[object Object]') {
return false;
}
var prototype = Object.getPrototypeOf(value);
return prototype === null || prototype === Object.prototype;
};
/***/ }),
/***/ 1794:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
var _require = __webpack_require__(8869),
DOCUMENT_MODE = _require.DOCUMENT_MODE;
//Const
var VALID_DOCTYPE_NAME = 'html';
var VALID_SYSTEM_ID = 'about:legacy-compat';
var QUIRKS_MODE_SYSTEM_ID = 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd';
var QUIRKS_MODE_PUBLIC_ID_PREFIXES = ['+//silmaril//dtd html pro v0r11 19970101//', '-//as//dtd html 3.0 aswedit + extensions//', '-//advasoft ltd//dtd html 3.0 aswedit + extensions//', '-//ietf//dtd html 2.0 level 1//', '-//ietf//dtd html 2.0 level 2//', '-//ietf//dtd html 2.0 strict level 1//', '-//ietf//dtd html 2.0 strict level 2//', '-//ietf//dtd html 2.0 strict//', '-//ietf//dtd html 2.0//', '-//ietf//dtd html 2.1e//', '-//ietf//dtd html 3.0//', '-//ietf//dtd html 3.2 final//', '-//ietf//dtd html 3.2//', '-//ietf//dtd html 3//', '-//ietf//dtd html level 0//', '-//ietf//dtd html level 1//', '-//ietf//dtd html level 2//', '-//ietf//dtd html level 3//', '-//ietf//dtd html strict level 0//', '-//ietf//dtd html strict level 1//', '-//ietf//dtd html strict level 2//', '-//ietf//dtd html strict level 3//', '-//ietf//dtd html strict//', '-//ietf//dtd html//', '-//metrius//dtd metrius presentational//', '-//microsoft//dtd internet explorer 2.0 html strict//', '-//microsoft//dtd internet explorer 2.0 html//', '-//microsoft//dtd internet explorer 2.0 tables//', '-//microsoft//dtd internet explorer 3.0 html strict//', '-//microsoft//dtd internet explorer 3.0 html//', '-//microsoft//dtd internet explorer 3.0 tables//', '-//netscape comm. corp.//dtd html//', '-//netscape comm. corp.//dtd strict html//', "-//o'reilly and associates//dtd html 2.0//", "-//o'reilly and associates//dtd html extended 1.0//", "-//o'reilly and associates//dtd html extended relaxed 1.0//", '-//sq//dtd html 2.0 hotmetal + extensions//', '-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//', '-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//', '-//spyglass//dtd html 2.0 extended//', '-//sun microsystems corp.//dtd hotjava html//', '-//sun microsystems corp.//dtd hotjava strict html//', '-//w3c//dtd html 3 1995-03-24//', '-//w3c//dtd html 3.2 draft//', '-//w3c//dtd html 3.2 final//', '-//w3c//dtd html 3.2//', '-//w3c//dtd html 3.2s draft//', '-//w3c//dtd html 4.0 frameset//', '-//w3c//dtd html 4.0 transitional//', '-//w3c//dtd html experimental 19960712//', '-//w3c//dtd html experimental 970421//', '-//w3c//dtd w3 html//', '-//w3o//dtd w3 html 3.0//', '-//webtechs//dtd mozilla html 2.0//', '-//webtechs//dtd mozilla html//'];
var QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = QUIRKS_MODE_PUBLIC_ID_PREFIXES.concat(['-//w3c//dtd html 4.01 frameset//', '-//w3c//dtd html 4.01 transitional//']);
var QUIRKS_MODE_PUBLIC_IDS = ['-//w3o//dtd w3 html strict 3.0//en//', '-/w3c/dtd html 4.0 transitional/en', 'html'];
var LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = ['-//w3c//dtd xhtml 1.0 frameset//', '-//w3c//dtd xhtml 1.0 transitional//'];
var LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES = LIMITED_QUIRKS_PUBLIC_ID_PREFIXES.concat(['-//w3c//dtd html 4.01 frameset//', '-//w3c//dtd html 4.01 transitional//']);
//Utils
function enquoteDoctypeId(id) {
var quote = id.indexOf('"') !== -1 ? "'" : '"';
return quote + id + quote;
}
function hasPrefix(publicId, prefixes) {
for (var i = 0; i < prefixes.length; i++) {
if (publicId.indexOf(prefixes[i]) === 0) {
return true;
}
}
return false;
}
//API
exports.isConforming = function (token) {
return token.name === VALID_DOCTYPE_NAME && token.publicId === null && (token.systemId === null || token.systemId === VALID_SYSTEM_ID);
};
exports.getDocumentMode = function (token) {
if (token.name !== VALID_DOCTYPE_NAME) {
return DOCUMENT_MODE.QUIRKS;
}
var systemId = token.systemId;
if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID) {
return DOCUMENT_MODE.QUIRKS;
}
var publicId = token.publicId;
if (publicId !== null) {
publicId = publicId.toLowerCase();
if (QUIRKS_MODE_PUBLIC_IDS.indexOf(publicId) > -1) {
return DOCUMENT_MODE.QUIRKS;
}
var prefixes = systemId === null ? QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES : QUIRKS_MODE_PUBLIC_ID_PREFIXES;
if (hasPrefix(publicId, prefixes)) {
return DOCUMENT_MODE.QUIRKS;
}
prefixes = systemId === null ? LIMITED_QUIRKS_PUBLIC_ID_PREFIXES : LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES;
if (hasPrefix(publicId, prefixes)) {
return DOCUMENT_MODE.LIMITED_QUIRKS;
}
}
return DOCUMENT_MODE.NO_QUIRKS;
};
exports.serializeContent = function (name, publicId, systemId) {
var str = '!DOCTYPE ';
if (name) {
str += name;
}
if (publicId) {
str += ' PUBLIC ' + enquoteDoctypeId(publicId);
} else if (systemId) {
str += ' SYSTEM';
}
if (systemId !== null) {
str += ' ' + enquoteDoctypeId(systemId);
}
return str;
};
/***/ }),
/***/ 4688:
/***/ ((module) => {
"use strict";
module.exports = {
controlCharacterInInputStream: 'control-character-in-input-stream',
noncharacterInInputStream: 'noncharacter-in-input-stream',
surrogateInInputStream: 'surrogate-in-input-stream',
nonVoidHtmlElementStartTagWithTrailingSolidus: 'non-void-html-element-start-tag-with-trailing-solidus',
endTagWithAttributes: 'end-tag-with-attributes',
endTagWithTrailingSolidus: 'end-tag-with-trailing-solidus',
unexpectedSolidusInTag: 'unexpected-solidus-in-tag',
unexpectedNullCharacter: 'unexpected-null-character',
unexpectedQuestionMarkInsteadOfTagName: 'unexpected-question-mark-instead-of-tag-name',
invalidFirstCharacterOfTagName: 'invalid-first-character-of-tag-name',
unexpectedEqualsSignBeforeAttributeName: 'unexpected-equals-sign-before-attribute-name',
missingEndTagName: 'missing-end-tag-name',
unexpectedCharacterInAttributeName: 'unexpected-character-in-attribute-name',
unknownNamedCharacterReference: 'unknown-named-character-reference',
missingSemicolonAfterCharacterReference: 'missing-semicolon-after-character-reference',
unexpectedCharacterAfterDoctypeSystemIdentifier: 'unexpected-character-after-doctype-system-identifier',
unexpectedCharacterInUnquotedAttributeValue: 'unexpected-character-in-unquoted-attribute-value',
eofBeforeTagName: 'eof-before-tag-name',
eofInTag: 'eof-in-tag',
missingAttributeValue: 'missing-attribute-value',
missingWhitespaceBetweenAttributes: 'missing-whitespace-between-attributes',
missingWhitespaceAfterDoctypePublicKeyword: 'missing-whitespace-after-doctype-public-keyword',
missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers: 'missing-whitespace-between-doctype-public-and-system-identifiers',
missingWhitespaceAfterDoctypeSystemKeyword: 'missing-whitespace-after-doctype-system-keyword',
missingQuoteBeforeDoctypePublicIdentifier: 'missing-quote-before-doctype-public-identifier',
missingQuoteBeforeDoctypeSystemIdentifier: 'missing-quote-before-doctype-system-identifier',
missingDoctypePublicIdentifier: 'missing-doctype-public-identifier',
missingDoctypeSystemIdentifier: 'missing-doctype-system-identifier',
abruptDoctypePublicIdentifier: 'abrupt-doctype-public-identifier',
abruptDoctypeSystemIdentifier: 'abrupt-doctype-system-identifier',
cdataInHtmlContent: 'cdata-in-html-content',
incorrectlyOpenedComment: 'incorrectly-opened-comment',
eofInScriptHtmlCommentLikeText: 'eof-in-script-html-comment-like-text',
eofInDoctype: 'eof-in-doctype',
nestedComment: 'nested-comment',
abruptClosingOfEmptyComment: 'abrupt-closing-of-empty-comment',
eofInComment: 'eof-in-comment',
incorrectlyClosedComment: 'incorrectly-closed-comment',
eofInCdata: 'eof-in-cdata',
absenceOfDigitsInNumericCharacterReference: 'absence-of-digits-in-numeric-character-reference',
nullCharacterReference: 'null-character-reference',
surrogateCharacterReference: 'surrogate-character-reference',
characterReferenceOutsideUnicodeRange: 'character-reference-outside-unicode-range',
controlCharacterReference: 'control-character-reference',
noncharacterCharacterReference: 'noncharacter-character-reference',
missingWhitespaceBeforeDoctypeName: 'missing-whitespace-before-doctype-name',
missingDoctypeName: 'missing-doctype-name',
invalidCharacterSequenceAfterDoctypeName: 'invalid-character-sequence-after-doctype-name',
duplicateAttribute: 'duplicate-attribute',
nonConformingDoctype: 'non-conforming-doctype',
missingDoctype: 'missing-doctype',
misplacedDoctype: 'misplaced-doctype',
endTagWithoutMatchingOpenElement: 'end-tag-without-matching-open-element',
closingOfElementWithOpenChildElements: 'closing-of-element-with-open-child-elements',
disallowedContentInNoscriptInHead: 'disallowed-content-in-noscript-in-head',
openElementsLeftAfterEof: 'open-elements-left-after-eof',
abandonedHeadElementChild: 'abandoned-head-element-child',
misplacedStartTagForHeadElement: 'misplaced-start-tag-for-head-element',
nestedNoscriptInHead: 'nested-noscript-in-head',
eofInElementThatCanContainOnlyText: 'eof-in-element-that-can-contain-only-text'
};
/***/ }),
/***/ 533:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
var _defineProperty = __webpack_require__(8416);
var _EXITS_FOREIGN_CONTEN;
var Tokenizer = __webpack_require__(301);
var HTML = __webpack_require__(8869);
//Aliases
var $ = HTML.TAG_NAMES;
var NS = HTML.NAMESPACES;
var ATTRS = HTML.ATTRS;
//MIME types
var MIME_TYPES = {
TEXT_HTML: 'text/html',
APPLICATION_XML: 'application/xhtml+xml'
};
//Attributes
var DEFINITION_URL_ATTR = 'definitionurl';
var ADJUSTED_DEFINITION_URL_ATTR = 'definitionURL';
var SVG_ATTRS_ADJUSTMENT_MAP = {
attributename: 'attributeName',
attributetype: 'attributeType',
basefrequency: 'baseFrequency',
baseprofile: 'baseProfile',
calcmode: 'calcMode',
clippathunits: 'clipPathUnits',
diffuseconstant: 'diffuseConstant',
edgemode: 'edgeMode',
filterunits: 'filterUnits',
glyphref: 'glyphRef',
gradienttransform: 'gradientTransform',
gradientunits: 'gradientUnits',
kernelmatrix: 'kernelMatrix',
kernelunitlength: 'kernelUnitLength',
keypoints: 'keyPoints',
keysplines: 'keySplines',
keytimes: 'keyTimes',
lengthadjust: 'lengthAdjust',
limitingconeangle: 'limitingConeAngle',
markerheight: 'markerHeight',
markerunits: 'markerUnits',
markerwidth: 'markerWidth',
maskcontentunits: 'maskContentUnits',
maskunits: 'maskUnits',
numoctaves: 'numOctaves',
pathlength: 'pathLength',
patterncontentunits: 'patternContentUnits',
patterntransform: 'patternTransform',
patternunits: 'patternUnits',
pointsatx: 'pointsAtX',
pointsaty: 'pointsAtY',
pointsatz: 'pointsAtZ',
preservealpha: 'preserveAlpha',
preserveaspectratio: 'preserveAspectRatio',
primitiveunits: 'primitiveUnits',
refx: 'refX',
refy: 'refY',
repeatcount: 'repeatCount',
repeatdur: 'repeatDur',
requiredextensions: 'requiredExtensions',
requiredfeatures: 'requiredFeatures',
specularconstant: 'specularConstant',
specularexponent: 'specularExponent',
spreadmethod: 'spreadMethod',
startoffset: 'startOffset',
stddeviation: 'stdDeviation',
stitchtiles: 'stitchTiles',
surfacescale: 'surfaceScale',
systemlanguage: 'systemLanguage',
tablevalues: 'tableValues',
targetx: 'targetX',
targety: 'targetY',
textlength: 'textLength',
viewbox: 'viewBox',
viewtarget: 'viewTarget',
xchannelselector: 'xChannelSelector',
ychannelselector: 'yChannelSelector',
zoomandpan: 'zoomAndPan'
};
var XML_ATTRS_ADJUSTMENT_MAP = {
'xlink:actuate': {
prefix: 'xlink',
name: 'actuate',
namespace: NS.XLINK
},
'xlink:arcrole': {
prefix: 'xlink',
name: 'arcrole',
namespace: NS.XLINK
},
'xlink:href': {
prefix: 'xlink',
name: 'href',
namespace: NS.XLINK
},
'xlink:role': {
prefix: 'xlink',
name: 'role',
namespace: NS.XLINK
},
'xlink:show': {
prefix: 'xlink',
name: 'show',
namespace: NS.XLINK
},
'xlink:title': {
prefix: 'xlink',
name: 'title',
namespace: NS.XLINK
},
'xlink:type': {
prefix: 'xlink',
name: 'type',
namespace: NS.XLINK
},
'xml:base': {
prefix: 'xml',
name: 'base',
namespace: NS.XML
},
'xml:lang': {
prefix: 'xml',
name: 'lang',
namespace: NS.XML
},
'xml:space': {
prefix: 'xml',
name: 'space',
namespace: NS.XML
},
xmlns: {
prefix: '',
name: 'xmlns',
namespace: NS.XMLNS
},
'xmlns:xlink': {
prefix: 'xmlns',
name: 'xlink',
namespace: NS.XMLNS
}
};
//SVG tag names adjustment map
var SVG_TAG_NAMES_ADJUSTMENT_MAP = exports.SVG_TAG_NAMES_ADJUSTMENT_MAP = {
altglyph: 'altGlyph',
altglyphdef: 'altGlyphDef',
altglyphitem: 'altGlyphItem',
animatecolor: 'animateColor',
animatemotion: 'animateMotion',
animatetransform: 'animateTransform',
clippath: 'clipPath',
feblend: 'feBlend',
fecolormatrix: 'feColorMatrix',
fecomponenttransfer: 'feComponentTransfer',
fecomposite: 'feComposite',
feconvolvematrix: 'feConvolveMatrix',
fediffuselighting: 'feDiffuseLighting',
fedisplacementmap: 'feDisplacementMap',
fedistantlight: 'feDistantLight',
feflood: 'feFlood',
fefunca: 'feFuncA',
fefuncb: 'feFuncB',
fefuncg: 'feFuncG',
fefuncr: 'feFuncR',
fegaussianblur: 'feGaussianBlur',
feimage: 'feImage',
femerge: 'feMerge',
femergenode: 'feMergeNode',
femorphology: 'feMorphology',
feoffset: 'feOffset',
fepointlight: 'fePointLight',
fespecularlighting: 'feSpecularLighting',
fespotlight: 'feSpotLight',
fetile: 'feTile',
feturbulence: 'feTurbulence',
foreignobject: 'foreignObject',
glyphref: 'glyphRef',
lineargradient: 'linearGradient',
radialgradient: 'radialGradient',
textpath: 'textPath'
};
//Tags that causes exit from foreign content
var EXITS_FOREIGN_CONTENT = (_EXITS_FOREIGN_CONTEN = {}, _defineProperty(_EXITS_FOREIGN_CONTEN, $.B, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.BIG, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.BLOCKQUOTE, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.BODY, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.BR, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.CENTER, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.CODE, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.DD, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.DIV, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.DL, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.DT, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.EM, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.EMBED, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.H1, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.H2, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.H3, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.H4, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.H5, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.H6, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.HEAD, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.HR, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.I, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.IMG, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.LI, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.LISTING, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.MENU, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.META, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.NOBR, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.OL, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.P, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.PRE, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.RUBY, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.S, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.SMALL, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.SPAN, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.STRONG, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.STRIKE, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.SUB, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.SUP, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.TABLE, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.TT, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.U, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.UL, true), _defineProperty(_EXITS_FOREIGN_CONTEN, $.VAR, true), _EXITS_FOREIGN_CONTEN);
//Check exit from foreign content
exports.causesExit = function (startTagToken) {
var tn = startTagToken.tagName;
var isFontWithAttrs = tn === $.FONT && (Tokenizer.getTokenAttr(startTagToken, ATTRS.COLOR) !== null || Tokenizer.getTokenAttr(startTagToken, ATTRS.SIZE) !== null || Tokenizer.getTokenAttr(startTagToken, ATTRS.FACE) !== null);
return isFontWithAttrs ? true : EXITS_FOREIGN_CONTENT[tn];
};
//Token adjustments
exports.adjustTokenMathMLAttrs = function (token) {
for (var i = 0; i < token.attrs.length; i++) {
if (token.attrs[i].name === DEFINITION_URL_ATTR) {
token.attrs[i].name = ADJUSTED_DEFINITION_URL_ATTR;
break;
}
}
};
exports.adjustTokenSVGAttrs = function (token) {
for (var i = 0; i < token.attrs.length; i++) {
var adjustedAttrName = SVG_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name];
if (adjustedAttrName) {
token.attrs[i].name = adjustedAttrName;
}
}
};
exports.adjustTokenXMLAttrs = function (token) {
for (var i = 0; i < token.attrs.length; i++) {
var adjustedAttrEntry = XML_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name];
if (adjustedAttrEntry) {
token.attrs[i].prefix = adjustedAttrEntry.prefix;
token.attrs[i].name = adjustedAttrEntry.name;
token.attrs[i].namespace = adjustedAttrEntry.namespace;
}
}
};
exports.adjustTokenSVGTagName = function (token) {
var adjustedTagName = SVG_TAG_NAMES_ADJUSTMENT_MAP[token.tagName];
if (adjustedTagName) {
token.tagName = adjustedTagName;
}
};
//Integration points
function isMathMLTextIntegrationPoint(tn, ns) {
return ns === NS.MATHML && (tn === $.MI || tn === $.MO || tn === $.MN || tn === $.MS || tn === $.MTEXT);
}
function isHtmlIntegrationPoint(tn, ns, attrs) {
if (ns === NS.MATHML && tn === $.ANNOTATION_XML) {
for (var i = 0; i < attrs.length; i++) {
if (attrs[i].name === ATTRS.ENCODING) {
var value = attrs[i].value.toLowerCase();
return value === MIME_TYPES.TEXT_HTML || value === MIME_TYPES.APPLICATION_XML;
}
}
}
return ns === NS.SVG && (tn === $.FOREIGN_OBJECT || tn === $.DESC || tn === $.TITLE);
}
exports.isIntegrationPoint = function (tn, ns, attrs, foreignNS) {
if ((!foreignNS || foreignNS === NS.HTML) && isHtmlIntegrationPoint(tn, ns, attrs)) {
return true;
}
if ((!foreignNS || foreignNS === NS.MATHML) && isMathMLTextIntegrationPoint(tn, ns)) {
return true;
}
return false;
};
/***/ }),
/***/ 8869:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
var _defineProperty = __webpack_require__(8416);
var _NS$HTML, _NS$MATHML, _NS$SVG, _exports$SPECIAL_ELEM;
var NS = exports.NAMESPACES = {
HTML: 'http://www.w3.org/1999/xhtml',
MATHML: 'http://www.w3.org/1998/Math/MathML',
SVG: 'http://www.w3.org/2000/svg',
XLINK: 'http://www.w3.org/1999/xlink',
XML: 'http://www.w3.org/XML/1998/namespace',
XMLNS: 'http://www.w3.org/2000/xmlns/'
};
exports.ATTRS = {
TYPE: 'type',
ACTION: 'action',
ENCODING: 'encoding',
PROMPT: 'prompt',
NAME: 'name',
COLOR: 'color',
FACE: 'face',
SIZE: 'size'
};
exports.DOCUMENT_MODE = {
NO_QUIRKS: 'no-quirks',
QUIRKS: 'quirks',
LIMITED_QUIRKS: 'limited-quirks'
};
var $ = exports.TAG_NAMES = {
A: 'a',
ADDRESS: 'address',
ANNOTATION_XML: 'annotation-xml',
APPLET: 'applet',
AREA: 'area',
ARTICLE: 'article',
ASIDE: 'aside',
B: 'b',
BASE: 'base',
BASEFONT: 'basefont',
BGSOUND: 'bgsound',
BIG: 'big',
BLOCKQUOTE: 'blockquote',
BODY: 'body',
BR: 'br',
BUTTON: 'button',
CAPTION: 'caption',
CENTER: 'center',
CODE: 'code',
COL: 'col',
COLGROUP: 'colgroup',
DD: 'dd',
DESC: 'desc',
DETAILS: 'details',
DIALOG: 'dialog',
DIR: 'dir',
DIV: 'div',
DL: 'dl',
DT: 'dt',
EM: 'em',
EMBED: 'embed',
FIELDSET: 'fieldset',
FIGCAPTION: 'figcaption',
FIGURE: 'figure',
FONT: 'font',
FOOTER: 'footer',
FOREIGN_OBJECT: 'foreignObject',
FORM: 'form',
FRAME: 'frame',
FRAMESET: 'frameset',
H1: 'h1',
H2: 'h2',
H3: 'h3',
H4: 'h4',
H5: 'h5',
H6: 'h6',
HEAD: 'head',
HEADER: 'header',
HGROUP: 'hgroup',
HR: 'hr',
HTML: 'html',
I: 'i',
IMG: 'img',
IMAGE: 'image',
INPUT: 'input',
IFRAME: 'iframe',
KEYGEN: 'keygen',
LABEL: 'label',
LI: 'li',
LINK: 'link',
LISTING: 'listing',
MAIN: 'main',
MALIGNMARK: 'malignmark',
MARQUEE: 'marquee',
MATH: 'math',
MENU: 'menu',
META: 'meta',
MGLYPH: 'mglyph',
MI: 'mi',
MO: 'mo',
MN: 'mn',
MS: 'ms',
MTEXT: 'mtext',
NAV: 'nav',
NOBR: 'nobr',
NOFRAMES: 'noframes',
NOEMBED: 'noembed',
NOSCRIPT: 'noscript',
OBJECT: 'object',
OL: 'ol',
OPTGROUP: 'optgroup',
OPTION: 'option',
P: 'p',
PARAM: 'param',
PLAINTEXT: 'plaintext',
PRE: 'pre',
RB: 'rb',
RP: 'rp',
RT: 'rt',
RTC: 'rtc',
RUBY: 'ruby',
S: 's',
SCRIPT: 'script',
SECTION: 'section',
SELECT: 'select',
SOURCE: 'source',
SMALL: 'small',
SPAN: 'span',
STRIKE: 'strike',
STRONG: 'strong',
STYLE: 'style',
SUB: 'sub',
SUMMARY: 'summary',
SUP: 'sup',
TABLE: 'table',
TBODY: 'tbody',
TEMPLATE: 'template',
TEXTAREA: 'textarea',
TFOOT: 'tfoot',
TD: 'td',
TH: 'th',
THEAD: 'thead',
TITLE: 'title',
TR: 'tr',
TRACK: 'track',
TT: 'tt',
U: 'u',
UL: 'ul',
SVG: 'svg',
VAR: 'var',
WBR: 'wbr',
XMP: 'xmp'
};
exports.SPECIAL_ELEMENTS = (_exports$SPECIAL_ELEM = {}, _defineProperty(_exports$SPECIAL_ELEM, NS.HTML, (_NS$HTML = {}, _defineProperty(_NS$HTML, $.ADDRESS, true), _defineProperty(_NS$HTML, $.APPLET, true), _defineProperty(_NS$HTML, $.AREA, true), _defineProperty(_NS$HTML, $.ARTICLE, true), _defineProperty(_NS$HTML, $.ASIDE, true), _defineProperty(_NS$HTML, $.BASE, true), _defineProperty(_NS$HTML, $.BASEFONT, true), _defineProperty(_NS$HTML, $.BGSOUND, true), _defineProperty(_NS$HTML, $.BLOCKQUOTE, true), _defineProperty(_NS$HTML, $.BODY, true), _defineProperty(_NS$HTML, $.BR, true), _defineProperty(_NS$HTML, $.BUTTON, true), _defineProperty(_NS$HTML, $.CAPTION, true), _defineProperty(_NS$HTML, $.CENTER, true), _defineProperty(_NS$HTML, $.COL, true), _defineProperty(_NS$HTML, $.COLGROUP, true), _defineProperty(_NS$HTML, $.DD, true), _defineProperty(_NS$HTML, $.DETAILS, true), _defineProperty(_NS$HTML, $.DIR, true), _defineProperty(_NS$HTML, $.DIV, true), _defineProperty(_NS$HTML, $.DL, true), _defineProperty(_NS$HTML, $.DT, true), _defineProperty(_NS$HTML, $.EMBED, true), _defineProperty(_NS$HTML, $.FIELDSET, true), _defineProperty(_NS$HTML, $.FIGCAPTION, true), _defineProperty(_NS$HTML, $.FIGURE, true), _defineProperty(_NS$HTML, $.FOOTER, true), _defineProperty(_NS$HTML, $.FORM, true), _defineProperty(_NS$HTML, $.FRAME, true), _defineProperty(_NS$HTML, $.FRAMESET, true), _defineProperty(_NS$HTML, $.H1, true), _defineProperty(_NS$HTML, $.H2, true), _defineProperty(_NS$HTML, $.H3, true), _defineProperty(_NS$HTML, $.H4, true), _defineProperty(_NS$HTML, $.H5, true), _defineProperty(_NS$HTML, $.H6, true), _defineProperty(_NS$HTML, $.HEAD, true), _defineProperty(_NS$HTML, $.HEADER, true), _defineProperty(_NS$HTML, $.HGROUP, true), _defineProperty(_NS$HTML, $.HR, true), _defineProperty(_NS$HTML, $.HTML, true), _defineProperty(_NS$HTML, $.IFRAME, true), _defineProperty(_NS$HTML, $.IMG, true), _defineProperty(_NS$HTML, $.INPUT, true), _defineProperty(_NS$HTML, $.LI, true), _defineProperty(_NS$HTML, $.LINK, true), _defineProperty(_NS$HTML, $.LISTING, true), _defineProperty(_NS$HTML, $.MAIN, true), _defineProperty(_NS$HTML, $.MARQUEE, true), _defineProperty(_NS$HTML, $.MENU, true), _defineProperty(_NS$HTML, $.META, true), _defineProperty(_NS$HTML, $.NAV, true), _defineProperty(_NS$HTML, $.NOEMBED, true), _defineProperty(_NS$HTML, $.NOFRAMES, true), _defineProperty(_NS$HTML, $.NOSCRIPT, true), _defineProperty(_NS$HTML, $.OBJECT, true), _defineProperty(_NS$HTML, $.OL, true), _defineProperty(_NS$HTML, $.P, true), _defineProperty(_NS$HTML, $.PARAM, true), _defineProperty(_NS$HTML, $.PLAINTEXT, true), _defineProperty(_NS$HTML, $.PRE, true), _defineProperty(_NS$HTML, $.SCRIPT, true), _defineProperty(_NS$HTML, $.SECTION, true), _defineProperty(_NS$HTML, $.SELECT, true), _defineProperty(_NS$HTML, $.SOURCE, true), _defineProperty(_NS$HTML, $.STYLE, true), _defineProperty(_NS$HTML, $.SUMMARY, true), _defineProperty(_NS$HTML, $.TABLE, true), _defineProperty(_NS$HTML, $.TBODY, true), _defineProperty(_NS$HTML, $.TD, true), _defineProperty(_NS$HTML, $.TEMPLATE, true), _defineProperty(_NS$HTML, $.TEXTAREA, true), _defineProperty(_NS$HTML, $.TFOOT, true), _defineProperty(_NS$HTML, $.TH, true), _defineProperty(_NS$HTML, $.THEAD, true), _defineProperty(_NS$HTML, $.TITLE, true), _defineProperty(_NS$HTML, $.TR, true), _defineProperty(_NS$HTML, $.TRACK, true), _defineProperty(_NS$HTML, $.UL, true), _defineProperty(_NS$HTML, $.WBR, true), _defineProperty(_NS$HTML, $.XMP, true), _NS$HTML)), _defineProperty(_exports$SPECIAL_ELEM, NS.MATHML, (_NS$MATHML = {}, _defineProperty(_NS$MATHML, $.MI, true), _defineProperty(_NS$MATHML, $.MO, true), _defineProperty(_NS$MATHML, $.MN, true), _defineProperty(_NS$MATHML, $.MS, true), _defineProperty(_NS$MATHML, $.MTEXT, true), _defineProperty(_NS$MATHML, $.ANNOTATION_XML, true), _NS$MATHML)), _defineProperty(_exports$SPECIAL_ELEM, NS.SVG, (_NS$SVG = {}, _defineProperty(_NS$SVG, $.TITLE, true), _defineProperty(_NS$SVG, $.FOREIGN_OBJECT, true), _defineProperty(_NS$SVG, $.DESC, true), _NS$SVG)), _exports$SPECIAL_ELEM);
/***/ }),
/***/ 9879:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
var UNDEFINED_CODE_POINTS = [0xfffe, 0xffff, 0x1fffe, 0x1ffff, 0x2fffe, 0x2ffff, 0x3fffe, 0x3ffff, 0x4fffe, 0x4ffff, 0x5fffe, 0x5ffff, 0x6fffe, 0x6ffff, 0x7fffe, 0x7ffff, 0x8fffe, 0x8ffff, 0x9fffe, 0x9ffff, 0xafffe, 0xaffff, 0xbfffe, 0xbffff, 0xcfffe, 0xcffff, 0xdfffe, 0xdffff, 0xefffe, 0xeffff, 0xffffe, 0xfffff, 0x10fffe, 0x10ffff];
exports.REPLACEMENT_CHARACTER = "\uFFFD";
exports.CODE_POINTS = {
EOF: -1,
NULL: 0x00,
TABULATION: 0x09,
CARRIAGE_RETURN: 0x0d,
LINE_FEED: 0x0a,
FORM_FEED: 0x0c,
SPACE: 0x20,
EXCLAMATION_MARK: 0x21,
QUOTATION_MARK: 0x22,
NUMBER_SIGN: 0x23,
AMPERSAND: 0x26,
APOSTROPHE: 0x27,
HYPHEN_MINUS: 0x2d,
SOLIDUS: 0x2f,
DIGIT_0: 0x30,
DIGIT_9: 0x39,
SEMICOLON: 0x3b,
LESS_THAN_SIGN: 0x3c,
EQUALS_SIGN: 0x3d,
GREATER_THAN_SIGN: 0x3e,
QUESTION_MARK: 0x3f,
LATIN_CAPITAL_A: 0x41,
LATIN_CAPITAL_F: 0x46,
LATIN_CAPITAL_X: 0x58,
LATIN_CAPITAL_Z: 0x5a,
RIGHT_SQUARE_BRACKET: 0x5d,
GRAVE_ACCENT: 0x60,
LATIN_SMALL_A: 0x61,
LATIN_SMALL_F: 0x66,
LATIN_SMALL_X: 0x78,
LATIN_SMALL_Z: 0x7a,
REPLACEMENT_CHARACTER: 0xfffd
};
exports.CODE_POINT_SEQUENCES = {
DASH_DASH_STRING: [0x2d, 0x2d],
//--
DOCTYPE_STRING: [0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45],
//DOCTYPE
CDATA_START_STRING: [0x5b, 0x43, 0x44, 0x41, 0x54, 0x41, 0x5b],
//[CDATA[
SCRIPT_STRING: [0x73, 0x63, 0x72, 0x69, 0x70, 0x74],
//script
PUBLIC_STRING: [0x50, 0x55, 0x42, 0x4c, 0x49, 0x43],
//PUBLIC
SYSTEM_STRING: [0x53, 0x59, 0x53, 0x54, 0x45, 0x4d] //SYSTEM
};
//Surrogates
exports.isSurrogate = function (cp) {
return cp >= 0xd800 && cp <= 0xdfff;
};
exports.isSurrogatePair = function (cp) {
return cp >= 0xdc00 && cp <= 0xdfff;
};
exports.getSurrogatePairCodePoint = function (cp1, cp2) {
return (cp1 - 0xd800) * 0x400 + 0x2400 + cp2;
};
//NOTE: excluding NULL and ASCII whitespace
exports.isControlCodePoint = function (cp) {
return cp !== 0x20 && cp !== 0x0a && cp !== 0x0d && cp !== 0x09 && cp !== 0x0c && cp >= 0x01 && cp <= 0x1f || cp >= 0x7f && cp <= 0x9f;
};
exports.isUndefinedCodePoint = function (cp) {
return cp >= 0xfdd0 && cp <= 0xfdef || UNDEFINED_CODE_POINTS.indexOf(cp) > -1;
};
/***/ }),
/***/ 9488:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var _classCallCheck = __webpack_require__(6690);
var _createClass = __webpack_require__(9728);
var _inherits = __webpack_require__(1655);
var _possibleConstructorReturn = __webpack_require__(4993);
var _getPrototypeOf = __webpack_require__(3808);
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
var Mixin = __webpack_require__(4086);
var ErrorReportingMixinBase = /*#__PURE__*/function (_Mixin) {
_inherits(ErrorReportingMixinBase, _Mixin);
var _super = _createSuper(ErrorReportingMixinBase);
function ErrorReportingMixinBase(host, opts) {
var _this;
_classCallCheck(this, ErrorReportingMixinBase);
_this = _super.call(this, host);
_this.posTracker = null;
_this.onParseError = opts.onParseError;
return _this;
}
_createClass(ErrorReportingMixinBase, [{
key: "_setErrorLocation",
value: function _setErrorLocation(err) {
err.startLine = err.endLine = this.posTracker.line;
err.startCol = err.endCol = this.posTracker.col;
err.startOffset = err.endOffset = this.posTracker.offset;
}
}, {
key: "_reportError",
value: function _reportError(code) {
var err = {
code: code,
startLine: -1,
startCol: -1,
startOffset: -1,
endLine: -1,
endCol: -1,
endOffset: -1
};
this._setErrorLocation(err);
this.onParseError(err);
}
}, {
key: "_getOverriddenMethods",
value: function _getOverriddenMethods(mxn) {
return {
_err: function _err(code) {
mxn._reportError(code);
}
};
}
}]);
return ErrorReportingMixinBase;
}(Mixin);
module.exports = ErrorReportingMixinBase;
/***/ }),
/***/ 2250:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var _classCallCheck = __webpack_require__(6690);
var _createClass = __webpack_require__(9728);
var _inherits = __webpack_require__(1655);
var _possibleConstructorReturn = __webpack_require__(4993);
var _getPrototypeOf = __webpack_require__(3808);
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
var ErrorReportingMixinBase = __webpack_require__(9488);
var ErrorReportingTokenizerMixin = __webpack_require__(7341);
var LocationInfoTokenizerMixin = __webpack_require__(5348);
var Mixin = __webpack_require__(4086);
var ErrorReportingParserMixin = /*#__PURE__*/function (_ErrorReportingMixinB) {
_inherits(ErrorReportingParserMixin, _ErrorReportingMixinB);
var _super = _createSuper(ErrorReportingParserMixin);
function ErrorReportingParserMixin(parser, opts) {
var _this;
_classCallCheck(this, ErrorReportingParserMixin);
_this = _super.call(this, parser, opts);
_this.opts = opts;
_this.ctLoc = null;
_this.locBeforeToken = false;
return _this;
}
_createClass(ErrorReportingParserMixin, [{
key: "_setErrorLocation",
value: function _setErrorLocation(err) {
if (this.ctLoc) {
err.startLine = this.ctLoc.startLine;
err.startCol = this.ctLoc.startCol;
err.startOffset = this.ctLoc.startOffset;
err.endLine = this.locBeforeToken ? this.ctLoc.startLine : this.ctLoc.endLine;
err.endCol = this.locBeforeToken ? this.ctLoc.startCol : this.ctLoc.endCol;
err.endOffset = this.locBeforeToken ? this.ctLoc.startOffset : this.ctLoc.endOffset;
}
}
}, {
key: "_getOverriddenMethods",
value: function _getOverriddenMethods(mxn, orig) {
return {
_bootstrap: function _bootstrap(document, fragmentContext) {
orig._bootstrap.call(this, document, fragmentContext);
Mixin.install(this.tokenizer, ErrorReportingTokenizerMixin, mxn.opts);
Mixin.install(this.tokenizer, LocationInfoTokenizerMixin);
},
_processInputToken: function _processInputToken(token) {
mxn.ctLoc = token.location;
orig._processInputToken.call(this, token);
},
_err: function _err(code, options) {
mxn.locBeforeToken = options && options.beforeToken;
mxn._reportError(code);
}
};
}
}]);
return ErrorReportingParserMixin;
}(ErrorReportingMixinBase);
module.exports = ErrorReportingParserMixin;
/***/ }),
/***/ 3130:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var _classCallCheck = __webpack_require__(6690);
var _createClass = __webpack_require__(9728);
var _get = __webpack_require__(1588);
var _inherits = __webpack_require__(1655);
var _possibleConstructorReturn = __webpack_require__(4993);
var _getPrototypeOf = __webpack_require__(3808);
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
var ErrorReportingMixinBase = __webpack_require__(9488);
var PositionTrackingPreprocessorMixin = __webpack_require__(2619);
var Mixin = __webpack_require__(4086);
var ErrorReportingPreprocessorMixin = /*#__PURE__*/function (_ErrorReportingMixinB) {
_inherits(ErrorReportingPreprocessorMixin, _ErrorReportingMixinB);
var _super = _createSuper(ErrorReportingPreprocessorMixin);
function ErrorReportingPreprocessorMixin(preprocessor, opts) {
var _this;
_classCallCheck(this, ErrorReportingPreprocessorMixin);
_this = _super.call(this, preprocessor, opts);
_this.posTracker = Mixin.install(preprocessor, PositionTrackingPreprocessorMixin);
_this.lastErrOffset = -1;
return _this;
}
_createClass(ErrorReportingPreprocessorMixin, [{
key: "_reportError",
value: function _reportError(code) {
//NOTE: avoid reporting error twice on advance/retreat
if (this.lastErrOffset !== this.posTracker.offset) {
this.lastErrOffset = this.posTracker.offset;
_get(_getPrototypeOf(ErrorReportingPreprocessorMixin.prototype), "_reportError", this).call(this, code);
}
}
}]);
return ErrorReportingPreprocessorMixin;
}(ErrorReportingMixinBase);
module.exports = ErrorReportingPreprocessorMixin;
/***/ }),
/***/ 7341:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var _createClass = __webpack_require__(9728);
var _classCallCheck = __webpack_require__(6690);
var _inherits = __webpack_require__(1655);
var _possibleConstructorReturn = __webpack_require__(4993);
var _getPrototypeOf = __webpack_require__(3808);
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
var ErrorReportingMixinBase = __webpack_require__(9488);
var ErrorReportingPreprocessorMixin = __webpack_require__(3130);
var Mixin = __webpack_require__(4086);
var ErrorReportingTokenizerMixin = /*#__PURE__*/function (_ErrorReportingMixinB) {
_inherits(ErrorReportingTokenizerMixin, _ErrorReportingMixinB);
var _super = _createSuper(ErrorReportingTokenizerMixin);
function ErrorReportingTokenizerMixin(tokenizer, opts) {
var _this;
_classCallCheck(this, ErrorReportingTokenizerMixin);
_this = _super.call(this, tokenizer, opts);
var preprocessorMixin = Mixin.install(tokenizer.preprocessor, ErrorReportingPreprocessorMixin, opts);
_this.posTracker = preprocessorMixin.posTracker;
return _this;
}
return _createClass(ErrorReportingTokenizerMixin);
}(ErrorReportingMixinBase);
module.exports = ErrorReportingTokenizerMixin;
/***/ }),
/***/ 494:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
var _classCallCheck = __webpack_require__(6690);
var _createClass = __webpack_require__(9728);
var _inherits = __webpack_require__(1655);
var _possibleConstructorReturn = __webpack_require__(4993);
var _getPrototypeOf = __webpack_require__(3808);
function _createSuper(Derived) { var hasNativeReflectC