/*! markdown-render (as markdownRender; ==UserScript==) 0.0.231 https://github.com/rivy/js-user.markdown-render#readme @license MIT */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["markdownRender"] = factory(); else root["markdownRender"] = factory(); })(window, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 106); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); var __assign = this && this.__assign || Object.assign || function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; var __values = this && this.__values || function (o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; }; var __read = this && this.__read || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; Object.defineProperty(exports, "__esModule", { value: true }); var Attributes_js_1 = __webpack_require__(26); var Node_js_1 = __webpack_require__(233); exports.TEXCLASS = { ORD: 0, OP: 1, BIN: 2, REL: 3, OPEN: 4, CLOSE: 5, PUNCT: 6, INNER: 7, VCENTER: 8, NONE: -1 }; exports.TEXCLASSNAMES = ['ORD', 'OP', 'BIN', 'REL', 'OPEN', 'CLOSE', 'PUNCT', 'INNER', 'VCENTER']; var TEXSPACELENGTH = ['', 'thinmathspace', 'mediummathspace', 'thickmathspace']; var TEXSPACE = [[0, -1, 2, 3, 0, 0, 0, 1], [-1, -1, 0, 3, 0, 0, 0, 1], [2, 2, 0, 0, 2, 0, 0, 2], [3, 3, 0, 0, 3, 0, 0, 3], [0, 0, 0, 0, 0, 0, 0, 0], [0, -1, 2, 3, 0, 0, 0, 1], [1, 1, 0, 1, 1, 1, 1, 1], [1, -1, 2, 3, 1, 0, 1, 1]]; exports.indentAttributes = ['indentalign', 'indentalignfirst', 'indentshift', 'indentshiftfirst']; var AbstractMmlNode = function (_super) { __extends(AbstractMmlNode, _super); function AbstractMmlNode(factory, attributes, children) { if (attributes === void 0) { attributes = {}; } if (children === void 0) { children = []; } var _this = _super.call(this, factory) || this; _this.texClass = null; _this.prevClass = null; _this.prevLevel = null; if (_this.arity < 0) { _this.childNodes = [factory.create('inferredMrow')]; _this.childNodes[0].parent = _this; } _this.setChildren(children); _this.attributes = new Attributes_js_1.Attributes(factory.getNodeClass(_this.kind).defaults, factory.getNodeClass('math').defaults); _this.attributes.setList(attributes); return _this; } Object.defineProperty(AbstractMmlNode.prototype, "isToken", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlNode.prototype, "isEmbellished", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlNode.prototype, "isSpacelike", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlNode.prototype, "linebreakContainer", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlNode.prototype, "hasNewLine", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlNode.prototype, "arity", { get: function () { return Infinity; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlNode.prototype, "isInferred", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlNode.prototype, "Parent", { get: function () { var parent = this.parent; while (parent && parent.notParent) { parent = parent.Parent; } return parent; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlNode.prototype, "notParent", { get: function () { return false; }, enumerable: true, configurable: true }); AbstractMmlNode.prototype.setChildren = function (children) { if (this.arity < 0) { return this.childNodes[0].setChildren(children); } return _super.prototype.setChildren.call(this, children); }; AbstractMmlNode.prototype.appendChild = function (child) { if (this.arity < 0) { this.childNodes[0].appendChild(child); return child; } return _super.prototype.appendChild.call(this, child); }; AbstractMmlNode.prototype.replaceChild = function (newChild, oldChild) { if (this.arity < 0) { this.childNodes[0].replaceChild(newChild, oldChild); return newChild; } return _super.prototype.replaceChild.call(this, newChild, oldChild); }; AbstractMmlNode.prototype.core = function () { return this; }; AbstractMmlNode.prototype.coreMO = function () { return this; }; AbstractMmlNode.prototype.coreIndex = function () { return 0; }; AbstractMmlNode.prototype.childPosition = function () { var child = this; var parent = child.parent; while (parent && parent.notParent) { child = parent; parent = parent.parent; } if (parent) { var i = 0; try { for (var _a = __values(parent.childNodes), _b = _a.next(); !_b.done; _b = _a.next()) { var node = _b.value; if (node === child) { return i; } i++; } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_1) throw e_1.error; } } } return null; var e_1, _c; }; AbstractMmlNode.prototype.setTeXclass = function (prev) { this.getPrevClass(prev); return this.texClass != null ? this : prev; }; AbstractMmlNode.prototype.updateTeXclass = function (core) { if (core) { this.prevClass = core.prevClass; this.prevLevel = core.prevLevel; core.prevClass = core.prevLevel = null; this.texClass = core.texClass; } }; AbstractMmlNode.prototype.getPrevClass = function (prev) { if (prev) { this.prevClass = prev.texClass; this.prevLevel = prev.attributes.get('scriptlevel'); } }; AbstractMmlNode.prototype.texSpacing = function () { var prevClass = this.prevClass != null ? this.prevClass : exports.TEXCLASS.NONE; var texClass = this.texClass || exports.TEXCLASS.ORD; if (prevClass === exports.TEXCLASS.NONE || texClass === exports.TEXCLASS.NONE) { return ''; } if (prevClass === exports.TEXCLASS.VCENTER) { prevClass = exports.TEXCLASS.ORD; } if (texClass === exports.TEXCLASS.VCENTER) { texClass = exports.TEXCLASS.ORD; } var space = TEXSPACE[prevClass][texClass]; if (this.prevLevel > 0 && this.attributes.get('scriptlevel') > 0 && space >= 0) { return ''; } return TEXSPACELENGTH[Math.abs(space)]; }; AbstractMmlNode.prototype.hasSpacingAttributes = function () { return this.isEmbellished && this.coreMO().hasSpacingAttributes(); }; AbstractMmlNode.prototype.setInheritedAttributes = function (attributes, display, level, prime) { if (attributes === void 0) { attributes = {}; } if (display === void 0) { display = false; } if (level === void 0) { level = 0; } if (prime === void 0) { prime = false; } var defaults = this.attributes.getAllDefaults(); try { for (var _a = __values(Object.keys(attributes)), _b = _a.next(); !_b.done; _b = _a.next()) { var key = _b.value; if (defaults.hasOwnProperty(key)) { var _c = __read(attributes[key], 2), node = _c[0], value = _c[1]; var noinherit = (AbstractMmlNode.noInherit[node] || {})[this.kind] || {}; if (!noinherit[key]) { this.attributes.setInherited(key, value); } } } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_b && !_b.done && (_d = _a.return)) _d.call(_a); } finally { if (e_2) throw e_2.error; } } var displaystyle = this.attributes.getExplicit('displaystyle'); if (displaystyle === undefined) { this.attributes.setInherited('displaystyle', display); } var scriptlevel = this.attributes.getExplicit('scriptlevel'); if (scriptlevel === undefined) { this.attributes.setInherited('scriptlevel', level); } if (prime) { this.setProperty('texprimestyle', prime); } var arity = this.arity; if (arity >= 0 && arity !== Infinity && (arity === 1 && this.childNodes.length === 0 || arity !== 1 && this.childNodes.length !== arity)) { if (arity < this.childNodes.length) { this.childNodes = this.childNodes.slice(0, arity); } else { while (this.childNodes.length < arity) { this.appendChild(this.factory.create('mrow')); } } } this.setChildInheritedAttributes(attributes, display, level, prime); var e_2, _d; }; AbstractMmlNode.prototype.setChildInheritedAttributes = function (attributes, display, level, prime) { try { for (var _a = __values(this.childNodes), _b = _a.next(); !_b.done; _b = _a.next()) { var child = _b.value; child.setInheritedAttributes(attributes, display, level, prime); } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_3) throw e_3.error; } } var e_3, _c; }; AbstractMmlNode.prototype.addInheritedAttributes = function (current, attributes) { var updated = __assign({}, current); try { for (var _a = __values(Object.keys(attributes)), _b = _a.next(); !_b.done; _b = _a.next()) { var name_1 = _b.value; if (name_1 !== 'displaystyle' && name_1 !== 'scriptlevel' && name_1 !== 'style') { updated[name_1] = [this.kind, attributes[name_1]]; } } } catch (e_4_1) { e_4 = { error: e_4_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_4) throw e_4.error; } } return updated; var e_4, _c; }; AbstractMmlNode.prototype.inheritAttributesFrom = function (node) { var attributes = node.attributes; var display = attributes.get('displaystyle'); var scriptlevel = attributes.get('scriptlevel'); var defaults = !attributes.isSet('mathsize') ? {} : { mathsize: ['math', attributes.get('mathsize')] }; var prime = node.getProperty('texprimestyle') || false; this.setInheritedAttributes(defaults, display, scriptlevel, prime); }; AbstractMmlNode.prototype.verifyTree = function (options) { if (options === void 0) { options = null; } if (options === null) { return; } this.verifyAttributes(options); var arity = this.arity; if (options['checkArity']) { if (arity >= 0 && arity !== Infinity && (arity === 1 && this.childNodes.length === 0 || arity !== 1 && this.childNodes.length !== arity)) { this.mError('Wrong number of children for "' + this.kind + '" node', options, true); } } this.verifyChildren(options); }; AbstractMmlNode.prototype.verifyAttributes = function (options) { if (options['checkAttributes']) { var attributes = this.attributes; var bad = []; try { for (var _a = __values(attributes.getExplicitNames()), _b = _a.next(); !_b.done; _b = _a.next()) { var name_2 = _b.value; if (name_2.substr(0, 5) !== 'data-' && attributes.getDefault(name_2) === undefined && !name_2.match(/^(?:class|style|id|(?:xlink:)?href)$/)) { bad.push(name_2); } } } catch (e_5_1) { e_5 = { error: e_5_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_5) throw e_5.error; } } if (bad.length) { this.mError('Unknown attributes for ' + this.kind + ' node: ' + bad.join(', '), options); } } var e_5, _c; }; AbstractMmlNode.prototype.verifyChildren = function (options) { try { for (var _a = __values(this.childNodes), _b = _a.next(); !_b.done; _b = _a.next()) { var child = _b.value; child.verifyTree(options); } } catch (e_6_1) { e_6 = { error: e_6_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_6) throw e_6.error; } } var e_6, _c; }; AbstractMmlNode.prototype.mError = function (message, options, short) { if (short === void 0) { short = false; } if (this.parent && this.parent.isKind('merror')) { return; } var merror = this.factory.create('merror'); if (options['fullErrors'] || short) { var mtext = this.factory.create('mtext'); var text = this.factory.create('text'); text.setText(options['fullErrors'] ? message : this.kind); mtext.appendChild(text); merror.appendChild(mtext); this.parent.replaceChild(merror, this); } else { this.parent.replaceChild(merror, this); merror.appendChild(this); } return merror; }; return AbstractMmlNode; }(Node_js_1.AbstractNode); AbstractMmlNode.defaults = { mathbackground: Attributes_js_1.INHERIT, mathcolor: Attributes_js_1.INHERIT, mathsize: Attributes_js_1.INHERIT, dir: Attributes_js_1.INHERIT }; AbstractMmlNode.noInherit = { mstyle: { mpadded: { width: true, height: true, depth: true, lspace: true, voffset: true }, mtable: { width: true, height: true, depth: true, align: true } }, maligngroup: { mrow: { groupalign: true }, mtable: { groupalign: true } } }; AbstractMmlNode.verifyDefaults = { checkArity: true, checkAttributes: false, fullErrors: false, fixMmultiscripts: true, fixMtables: true }; exports.AbstractMmlNode = AbstractMmlNode; var AbstractMmlTokenNode = function (_super) { __extends(AbstractMmlTokenNode, _super); function AbstractMmlTokenNode() { return _super !== null && _super.apply(this, arguments) || this; } Object.defineProperty(AbstractMmlTokenNode.prototype, "isToken", { get: function () { return true; }, enumerable: true, configurable: true }); AbstractMmlTokenNode.prototype.getText = function () { var text = ''; try { for (var _a = __values(this.childNodes), _b = _a.next(); !_b.done; _b = _a.next()) { var child = _b.value; if (child instanceof TextNode) { text += child.getText(); } } } catch (e_7_1) { e_7 = { error: e_7_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_7) throw e_7.error; } } return text; var e_7, _c; }; AbstractMmlTokenNode.prototype.setChildInheritedAttributes = function (attributes, display, level, prime) { try { for (var _a = __values(this.childNodes), _b = _a.next(); !_b.done; _b = _a.next()) { var child = _b.value; if (child instanceof AbstractMmlNode) { child.setInheritedAttributes(attributes, display, level, prime); } } } catch (e_8_1) { e_8 = { error: e_8_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_8) throw e_8.error; } } var e_8, _c; }; AbstractMmlTokenNode.prototype.walkTree = function (func, data) { func(this, data); try { for (var _a = __values(this.childNodes), _b = _a.next(); !_b.done; _b = _a.next()) { var child = _b.value; if (child instanceof AbstractMmlNode) { child.walkTree(func, data); } } } catch (e_9_1) { e_9 = { error: e_9_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_9) throw e_9.error; } } return data; var e_9, _c; }; return AbstractMmlTokenNode; }(AbstractMmlNode); AbstractMmlTokenNode.defaults = __assign({}, AbstractMmlNode.defaults, { mathvariant: 'normal', mathsize: Attributes_js_1.INHERIT }); exports.AbstractMmlTokenNode = AbstractMmlTokenNode; var AbstractMmlLayoutNode = function (_super) { __extends(AbstractMmlLayoutNode, _super); function AbstractMmlLayoutNode() { return _super !== null && _super.apply(this, arguments) || this; } Object.defineProperty(AbstractMmlLayoutNode.prototype, "isSpacelike", { get: function () { return this.childNodes[0].isSpacelike; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlLayoutNode.prototype, "isEmbellished", { get: function () { return this.childNodes[0].isEmbellished; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlLayoutNode.prototype, "arity", { get: function () { return -1; }, enumerable: true, configurable: true }); AbstractMmlLayoutNode.prototype.core = function () { return this.childNodes[0]; }; AbstractMmlLayoutNode.prototype.coreMO = function () { return this.childNodes[0].coreMO(); }; AbstractMmlLayoutNode.prototype.setTeXclass = function (prev) { prev = this.childNodes[0].setTeXclass(prev); this.updateTeXclass(this.childNodes[0]); return prev; }; return AbstractMmlLayoutNode; }(AbstractMmlNode); AbstractMmlLayoutNode.defaults = AbstractMmlNode.defaults; exports.AbstractMmlLayoutNode = AbstractMmlLayoutNode; var AbstractMmlBaseNode = function (_super) { __extends(AbstractMmlBaseNode, _super); function AbstractMmlBaseNode() { return _super !== null && _super.apply(this, arguments) || this; } Object.defineProperty(AbstractMmlBaseNode.prototype, "isEmbellished", { get: function () { return this.childNodes[0].isEmbellished; }, enumerable: true, configurable: true }); AbstractMmlBaseNode.prototype.core = function () { return this.childNodes[0]; }; AbstractMmlBaseNode.prototype.coreMO = function () { return this.childNodes[0].coreMO(); }; AbstractMmlBaseNode.prototype.setTeXclass = function (prev) { this.getPrevClass(prev); this.texClass = exports.TEXCLASS.NONE; var base = this.childNodes[0]; if (base) { if (this.isEmbellished || base.isKind('mi')) { prev = base.setTeXclass(prev); this.updateTeXclass(this.core()); } else { base.setTeXclass(null); prev = this; } } else { prev = this; } try { for (var _a = __values(this.childNodes.slice(1)), _b = _a.next(); !_b.done; _b = _a.next()) { var child = _b.value; if (child) { child.setTeXclass(null); } } } catch (e_10_1) { e_10 = { error: e_10_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_10) throw e_10.error; } } return prev; var e_10, _c; }; return AbstractMmlBaseNode; }(AbstractMmlNode); AbstractMmlBaseNode.defaults = AbstractMmlNode.defaults; exports.AbstractMmlBaseNode = AbstractMmlBaseNode; var AbstractMmlEmptyNode = function (_super) { __extends(AbstractMmlEmptyNode, _super); function AbstractMmlEmptyNode() { return _super !== null && _super.apply(this, arguments) || this; } Object.defineProperty(AbstractMmlEmptyNode.prototype, "isToken", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlEmptyNode.prototype, "isEmbellished", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlEmptyNode.prototype, "isSpacelike", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlEmptyNode.prototype, "linebreakContainer", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlEmptyNode.prototype, "hasNewLine", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlEmptyNode.prototype, "arity", { get: function () { return 0; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlEmptyNode.prototype, "isInferred", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlEmptyNode.prototype, "notParent", { get: function () { return false; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlEmptyNode.prototype, "Parent", { get: function () { return this.parent; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlEmptyNode.prototype, "texClass", { get: function () { return exports.TEXCLASS.NONE; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlEmptyNode.prototype, "prevClass", { get: function () { return exports.TEXCLASS.NONE; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractMmlEmptyNode.prototype, "prevLevel", { get: function () { return 0; }, enumerable: true, configurable: true }); AbstractMmlEmptyNode.prototype.hasSpacingAttributes = function () { return false; }; Object.defineProperty(AbstractMmlEmptyNode.prototype, "attributes", { get: function () { return null; }, enumerable: true, configurable: true }); AbstractMmlEmptyNode.prototype.core = function () { return this; }; AbstractMmlEmptyNode.prototype.coreMO = function () { return this; }; AbstractMmlEmptyNode.prototype.coreIndex = function () { return 0; }; AbstractMmlEmptyNode.prototype.childPosition = function () { return 0; }; AbstractMmlEmptyNode.prototype.setTeXclass = function (prev) { return prev; }; AbstractMmlEmptyNode.prototype.texSpacing = function () { return ''; }; AbstractMmlEmptyNode.prototype.setInheritedAttributes = function (attributes, display, level, prime) {}; AbstractMmlEmptyNode.prototype.inheritAttributesFrom = function (node) {}; AbstractMmlEmptyNode.prototype.verifyTree = function (options) {}; AbstractMmlEmptyNode.prototype.mError = function (message, options, short) { if (short === void 0) { short = false; } }; return AbstractMmlEmptyNode; }(Node_js_1.AbstractEmptyNode); exports.AbstractMmlEmptyNode = AbstractMmlEmptyNode; var TextNode = function (_super) { __extends(TextNode, _super); function TextNode() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.text = ''; return _this; } Object.defineProperty(TextNode.prototype, "kind", { get: function () { return 'text'; }, enumerable: true, configurable: true }); TextNode.prototype.getText = function () { return this.text; }; TextNode.prototype.setText = function (text) { this.text = text; return this; }; TextNode.prototype.toString = function () { return this.text; }; return TextNode; }(AbstractMmlEmptyNode); exports.TextNode = TextNode; var XMLNode = function (_super) { __extends(XMLNode, _super); function XMLNode() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.xml = null; return _this; } Object.defineProperty(XMLNode.prototype, "kind", { get: function () { return 'XML'; }, enumerable: true, configurable: true }); XMLNode.prototype.getXML = function () { return this.xml; }; XMLNode.prototype.setXML = function (xml) { this.xml = xml; return this; }; XMLNode.prototype.toString = function () { return 'XML data'; }; return XMLNode; }(AbstractMmlEmptyNode); exports.XMLNode = XMLNode; /***/ }), /* 1 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Utilities // function _class(obj) { return Object.prototype.toString.call(obj); } function isString(obj) { return _class(obj) === '[object String]'; } var _hasOwnProperty = Object.prototype.hasOwnProperty; function has(object, key) { return _hasOwnProperty.call(object, key); } // Merge objects // function assign(obj /*from1, from2, from3, ...*/ ) { var sources = Array.prototype.slice.call(arguments, 1); sources.forEach(function (source) { if (!source) { return; } if (typeof source !== 'object') { throw new TypeError(source + 'must be object'); } Object.keys(source).forEach(function (key) { obj[key] = source[key]; }); }); return obj; } // Remove element from array and put another array at those position. // Useful for some operations with tokens function arrayReplaceAt(src, pos, newElements) { return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1)); } //////////////////////////////////////////////////////////////////////////////// function isValidEntityCode(c) { /*eslint no-bitwise:0*/ // broken sequence if (c >= 0xD800 && c <= 0xDFFF) { return false; } // never used if (c >= 0xFDD0 && c <= 0xFDEF) { return false; } if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { return false; } // control codes if (c >= 0x00 && c <= 0x08) { return false; } if (c === 0x0B) { return false; } if (c >= 0x0E && c <= 0x1F) { return false; } if (c >= 0x7F && c <= 0x9F) { return false; } // out of range if (c > 0x10FFFF) { return false; } return true; } function fromCodePoint(c) { /*eslint no-bitwise:0*/ if (c > 0xffff) { c -= 0x10000; var surrogate1 = 0xd800 + (c >> 10), surrogate2 = 0xdc00 + (c & 0x3ff); return String.fromCharCode(surrogate1, surrogate2); } return String.fromCharCode(c); } var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g; var ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi; var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi'); var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i; var entities = __webpack_require__(62); function replaceEntityPattern(match, name) { var code = 0; if (has(entities, name)) { return entities[name]; } if (name.charCodeAt(0) === 0x23 /* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) { code = name[1].toLowerCase() === 'x' ? parseInt(name.slice(2), 16) : parseInt(name.slice(1), 10); if (isValidEntityCode(code)) { return fromCodePoint(code); } } return match; } /*function replaceEntities(str) { if (str.indexOf('&') < 0) { return str; } return str.replace(ENTITY_RE, replaceEntityPattern); }*/ function unescapeMd(str) { if (str.indexOf('\\') < 0) { return str; } return str.replace(UNESCAPE_MD_RE, '$1'); } function unescapeAll(str) { if (str.indexOf('\\') < 0 && str.indexOf('&') < 0) { return str; } return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) { if (escaped) { return escaped; } return replaceEntityPattern(match, entity); }); } //////////////////////////////////////////////////////////////////////////////// var HTML_ESCAPE_TEST_RE = /[&<>"]/; var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g; var HTML_REPLACEMENTS = { '&': '&', '<': '<', '>': '>', '"': '"' }; function replaceUnsafeChar(ch) { return HTML_REPLACEMENTS[ch]; } function escapeHtml(str) { if (HTML_ESCAPE_TEST_RE.test(str)) { return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar); } return str; } //////////////////////////////////////////////////////////////////////////////// var REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g; function escapeRE(str) { return str.replace(REGEXP_ESCAPE_RE, '\\$&'); } //////////////////////////////////////////////////////////////////////////////// function isSpace(code) { switch (code) { case 0x09: case 0x20: return true; } return false; } // Zs (unicode class) || [\t\f\v\r\n] function isWhiteSpace(code) { if (code >= 0x2000 && code <= 0x200A) { return true; } switch (code) { case 0x09: // \t case 0x0A: // \n case 0x0B: // \v case 0x0C: // \f case 0x0D: // \r case 0x20: case 0xA0: case 0x1680: case 0x202F: case 0x205F: case 0x3000: return true; } return false; } //////////////////////////////////////////////////////////////////////////////// /*eslint-disable max-len*/ var UNICODE_PUNCT_RE = __webpack_require__(39); // Currently without astral characters support. function isPunctChar(ch) { return UNICODE_PUNCT_RE.test(ch); } // Markdown ASCII punctuation characters. // // !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~ // http://spec.commonmark.org/0.15/#ascii-punctuation-character // // Don't confuse with unicode punctuation !!! It lacks some chars in ascii range. // function isMdAsciiPunct(ch) { switch (ch) { case 0x21 /* ! */ : case 0x22 /* " */ : case 0x23 /* # */ : case 0x24 /* $ */ : case 0x25 /* % */ : case 0x26 /* & */ : case 0x27 /* ' */ : case 0x28 /* ( */ : case 0x29 /* ) */ : case 0x2A /* * */ : case 0x2B /* + */ : case 0x2C /* , */ : case 0x2D /* - */ : case 0x2E /* . */ : case 0x2F /* / */ : case 0x3A /* : */ : case 0x3B /* ; */ : case 0x3C /* < */ : case 0x3D /* = */ : case 0x3E /* > */ : case 0x3F /* ? */ : case 0x40 /* @ */ : case 0x5B /* [ */ : case 0x5C /* \ */ : case 0x5D /* ] */ : case 0x5E /* ^ */ : case 0x5F /* _ */ : case 0x60 /* ` */ : case 0x7B /* { */ : case 0x7C /* | */ : case 0x7D /* } */ : case 0x7E /* ~ */ : return true; default: return false; } } // Hepler to unify [reference labels]. // function normalizeReference(str) { // Trim and collapse whitespace // str = str.trim().replace(/\s+/g, ' '); // In node v10 'ẞ'.toLowerCase() === 'Ṿ', which is presumed to be a bug // fixed in v12 (couldn't find any details). // // So treat this one as a special case // (remove this when node v10 is no longer supported). // if ('ẞ'.toLowerCase() === 'Ṿ') { str = str.replace(/ẞ/g, 'ß'); } // .toLowerCase().toUpperCase() should get rid of all differences // between letter variants. // // Simple .toLowerCase() doesn't normalize 125 code points correctly, // and .toUpperCase doesn't normalize 6 of them (list of exceptions: // İ, ϴ, ẞ, Ω, K, Å - those are already uppercased, but have differently // uppercased versions). // // Here's an example showing how it happens. Lets take greek letter omega: // uppercase U+0398 (Θ), U+03f4 (ϴ) and lowercase U+03b8 (θ), U+03d1 (ϑ) // // Unicode entries: // 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8; // 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398 // 03D1;GREEK THETA SYMBOL;Ll;0;L; 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398 // 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L; 0398;;;;N;;;;03B8; // // Case-insensitive comparison should treat all of them as equivalent. // // But .toLowerCase() doesn't change ϑ (it's already lowercase), // and .toUpperCase() doesn't change ϴ (already uppercase). // // Applying first lower then upper case normalizes any character: // '\u0398\u03f4\u03b8\u03d1'.toLowerCase().toUpperCase() === '\u0398\u0398\u0398\u0398' // // Note: this is equivalent to unicode case folding; unicode normalization // is a different step that is not required here. // // Final result should be uppercased, because it's later stored in an object // (this avoid a conflict with Object.prototype members, // most notably, `__proto__`) // return str.toLowerCase().toUpperCase(); } //////////////////////////////////////////////////////////////////////////////// // Re-export libraries commonly used in both markdown-it and its plugins, // so plugins won't have to depend on them explicitly, which reduces their // bundled size (e.g. a browser build). // exports.lib = {}; exports.lib.mdurl = __webpack_require__(63); exports.lib.ucmicro = __webpack_require__(148); exports.assign = assign; exports.isString = isString; exports.has = has; exports.unescapeMd = unescapeMd; exports.unescapeAll = unescapeAll; exports.isValidEntityCode = isValidEntityCode; exports.fromCodePoint = fromCodePoint; // exports.replaceEntities = replaceEntities; exports.escapeHtml = escapeHtml; exports.arrayReplaceAt = arrayReplaceAt; exports.isSpace = isSpace; exports.isWhiteSpace = isWhiteSpace; exports.isMdAsciiPunct = isMdAsciiPunct; exports.isPunctChar = isPunctChar; exports.escapeRE = escapeRE; exports.normalizeReference = normalizeReference; /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); var __assign = this && this.__assign || Object.assign || function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; var __values = this && this.__values || function (o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; }; var __read = this && this.__read || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; function __export(m) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } Object.defineProperty(exports, "__esModule", { value: true }); var FontData_js_1 = __webpack_require__(29); var lengths_js_1 = __webpack_require__(22); var Options_js_1 = __webpack_require__(10); __export(__webpack_require__(29)); ; ; var CHTMLFontData = function (_super) { __extends(CHTMLFontData, _super); function CHTMLFontData(options) { if (options === void 0) { options = null; } var _this = _super.call(this) || this; _this.cssRoot = ''; var CLASS = _this.constructor; _this.options = Options_js_1.userOptions(Options_js_1.defaultOptions({}, CLASS.OPTIONS), options); try { for (var _a = __values(Object.keys(CLASS.defaultVariantClasses)), _b = _a.next(); !_b.done; _b = _a.next()) { var name_1 = _b.value; _this.variant[name_1].classes = CLASS.defaultVariantClasses[name_1]; } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_1) throw e_1.error; } } return _this; var e_1, _c; } CHTMLFontData.prototype.adaptiveCSS = function (adapt) { this.options.adaptiveCSS = adapt; }; CHTMLFontData.prototype.clearCache = function () { if (!this.options.adaptiveCSS) return; try { for (var _a = __values(Object.keys(this.delimiters)), _b = _a.next(); !_b.done; _b = _a.next()) { var n = _b.value; this.delimiters[parseInt(n)].used = false; } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_2) throw e_2.error; } } try { for (var _d = __values(Object.keys(this.variant)), _e = _d.next(); !_e.done; _e = _d.next()) { var name_2 = _e.value; var chars = this.variant[name_2].chars; try { for (var _f = __values(Object.keys(chars)), _g = _f.next(); !_g.done; _g = _f.next()) { var n = _g.value; var options = chars[parseInt(n)][3]; if (options) { options.used = false; } } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (_g && !_g.done && (_h = _f.return)) _h.call(_f); } finally { if (e_3) throw e_3.error; } } } } catch (e_4_1) { e_4 = { error: e_4_1 }; } finally { try { if (_e && !_e.done && (_j = _d.return)) _j.call(_d); } finally { if (e_4) throw e_4.error; } } var e_2, _c, e_4, _j, e_3, _h; }; Object.defineProperty(CHTMLFontData.prototype, "styles", { get: function () { var CLASS = this.constructor; var styles = __assign({}, CLASS.defaultStyles); this.addFontURLs(styles, CLASS.defaultFonts, this.options.fontURL); try { for (var _a = __values(Object.keys(this.delimiters)), _b = _a.next(); !_b.done; _b = _a.next()) { var n = _b.value; var N = parseInt(n); this.addDelimiterStyles(styles, N, this.delimiters[N]); } } catch (e_5_1) { e_5 = { error: e_5_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_5) throw e_5.error; } } this.addVariantChars(styles); return styles; var e_5, _c; }, enumerable: true, configurable: true }); CHTMLFontData.prototype.addVariantChars = function (styles) { var charUsed = new Map(); try { for (var _a = __values(Object.keys(this.variant)), _b = _a.next(); !_b.done; _b = _a.next()) { var name_3 = _b.value; var variant = this.variant[name_3]; var vclass = name_3 === 'normal' ? '' : '.' + variant.classes.replace(/ /g, '.'); try { for (var _c = __values(Object.keys(variant.chars)), _d = _c.next(); !_d.done; _d = _c.next()) { var n = _d.value; var N = parseInt(n); if (variant.chars[N].length === 4) { this.addCharStyles(styles, vclass, N, variant.chars[N], charUsed); } } } catch (e_6_1) { e_6 = { error: e_6_1 }; } finally { try { if (_d && !_d.done && (_e = _c.return)) _e.call(_c); } finally { if (e_6) throw e_6.error; } } } } catch (e_7_1) { e_7 = { error: e_7_1 }; } finally { try { if (_b && !_b.done && (_f = _a.return)) _f.call(_a); } finally { if (e_7) throw e_7.error; } } var e_7, _f, e_6, _e; }; CHTMLFontData.prototype.addFontURLs = function (styles, fonts, url) { try { for (var _a = __values(Object.keys(fonts)), _b = _a.next(); !_b.done; _b = _a.next()) { var name_4 = _b.value; var font = __assign({}, fonts[name_4]); font.src = font.src.replace(/%%URL%%/, url); styles[name_4] = font; } } catch (e_8_1) { e_8 = { error: e_8_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_8) throw e_8.error; } } var e_8, _c; }; CHTMLFontData.prototype.addDelimiterStyles = function (styles, n, data) { if (this.options.adaptiveCSS && !data.used) return; var c = this.charSelector(n); if (data.c && data.c !== n) { styles[this.cssRoot + '.mjx-stretched mjx-c' + c + '::before'] = { content: this.charContent(data.c) }; } if (!data.stretch) return; if (data.dir === 1) { this.addDelimiterVStyles(styles, c, data); } else { this.addDelimiterHStyles(styles, c, data); } }; CHTMLFontData.prototype.addDelimiterVStyles = function (styles, c, data) { var W = data.HDW[2]; var _a = __read(data.stretch, 4), beg = _a[0], ext = _a[1], end = _a[2], mid = _a[3]; var Hb = this.addDelimiterVPart(styles, c, W, 'beg', beg); this.addDelimiterVPart(styles, c, W, 'ext', ext); var He = this.addDelimiterVPart(styles, c, W, 'end', end); var css = {}; var root = this.cssRoot; if (mid) { var Hm = this.addDelimiterVPart(styles, c, W, 'mid', mid); css.height = '50%'; styles[root + 'mjx-stretchy-v' + c + ' > mjx-mid'] = { 'margin-top': this.em(-Hm / 2), 'margin-bottom': this.em(-Hm / 2) }; } if (Hb) { css['border-top-width'] = this.em0(Hb - .03); } if (He) { css['border-bottom-width'] = this.em0(He - .03); styles[root + 'mjx-stretchy-v' + c + ' > mjx-end'] = { 'margin-top': this.em(-He) }; } if (Object.keys(css).length) { styles[root + 'mjx-stretchy-v' + c + ' > mjx-ext'] = css; } }; CHTMLFontData.prototype.addDelimiterVPart = function (styles, c, W, part, n) { if (!n) return 0; var data = this.getDelimiterData(n); var dw = (W - data[2]) / 2; var css = { content: this.charContent(n) }; if (part !== 'ext') { css.padding = this.padding(data, dw); } else if (dw) { css['padding-left'] = this.em0(dw); } styles[this.cssRoot + 'mjx-stretchy-v' + c + ' mjx-' + part + ' mjx-c::before'] = css; return data[0] + data[1]; }; CHTMLFontData.prototype.addDelimiterHStyles = function (styles, c, data) { var _a = __read(data.stretch, 4), beg = _a[0], ext = _a[1], end = _a[2], mid = _a[3]; this.addDelimiterHPart(styles, c, 'beg', beg); this.addDelimiterHPart(styles, c, 'ext', ext, !(beg || end)); this.addDelimiterHPart(styles, c, 'end', end); if (mid) { this.addDelimiterHPart(styles, c, 'mid', mid); styles[this.cssRoot + 'mjx-stretchy-h' + c + ' > mjx-ext'] = { width: '50%' }; } }; CHTMLFontData.prototype.addDelimiterHPart = function (styles, c, part, n, force) { if (force === void 0) { force = false; } if (!n) { return 0; } var data = this.getDelimiterData(n); var options = data[3]; var css = { content: options && options.c ? '"' + options.c + '"' : this.charContent(n) }; if (part !== 'ext' || force) { css.padding = this.padding(data, 0, -data[2]); } styles[this.cssRoot + 'mjx-stretchy-h' + c + ' mjx-' + part + ' mjx-c::before'] = css; }; CHTMLFontData.prototype.addCharStyles = function (styles, vclass, n, data, charUsed) { var _a = __read(data, 4), h = _a[0], d = _a[1], w = _a[2], options = _a[3]; if (this.options.adaptiveCSS && !options.used) return; var css = {}; var selector = 'mjx-c' + this.charSelector(n); var root = this.cssRoot; css.padding = this.padding(data, 0, options.ic || 0); var content = options.c ? '"' + options.c + '"' : this.charContent(n); if (charUsed.get(n) !== content) { if (!charUsed.has(n) && !options.c) { styles[root + selector + '::before'] = { content: content }; charUsed.set(n, content); } else { styles[root + vclass + ' ' + selector + '::before'] = { content: content }; } } if (options.f !== undefined) { css['font-family'] = 'MJXZERO, MJXTEX' + (options.f ? '-' + options.f : ''); } var char = (vclass ? vclass + ' ' : '') + selector; styles[root + char] = css; if (options.ic) { var _b = __read([root + 'mjx-', '[noIC]' + char + ':last-child'], 2), MJX = _b[0], noIC = _b[1]; styles[MJX + 'mi' + noIC] = styles[MJX + 'mo' + noIC] = { 'padding-right': this.em(w) }; } }; CHTMLFontData.prototype.getDelimiterData = function (n) { return this.getChar('-smallop', n); }; CHTMLFontData.charOptions = function (font, n) { return _super.charOptions.call(this, font, n); }; CHTMLFontData.prototype.em = function (n) { return lengths_js_1.em(n); }; CHTMLFontData.prototype.em0 = function (n) { return lengths_js_1.em(Math.max(0, n)); }; CHTMLFontData.prototype.padding = function (_a, dw, ic) { var _b = __read(_a, 3), h = _b[0], d = _b[1], w = _b[2]; if (dw === void 0) { dw = 0; } if (ic === void 0) { ic = 0; } return [h, w + ic, d, dw].map(this.em0).join(' '); }; CHTMLFontData.prototype.charContent = function (n) { return '"' + (n >= 0x20 && n <= 0x7E && n !== 0x22 && n !== 0x27 && n !== 0x5C ? String.fromCharCode(n) : '\\' + n.toString(16).toUpperCase()) + '"'; }; CHTMLFontData.prototype.charSelector = function (n) { return '.mjx-c' + n.toString(16).toUpperCase(); }; return CHTMLFontData; }(FontData_js_1.FontData); CHTMLFontData.OPTIONS = { fontURL: 'mathjax3-ts/output/chtml/fonts/tex-woff-v2' }; CHTMLFontData.defaultVariantClasses = {}; CHTMLFontData.defaultStyles = { 'mjx-c::before': { display: 'inline-block', width: 0 } }; CHTMLFontData.defaultFonts = { '@font-face /* 0 */': { 'font-family': 'MJXZERO', src: 'url("%%URL%%/MathJax_Zero.woff") format("woff")' } }; exports.CHTMLFontData = CHTMLFontData; function AddCSS(font, options) { try { for (var _a = __values(Object.keys(options)), _b = _a.next(); !_b.done; _b = _a.next()) { var c = _b.value; var n = parseInt(c); Object.assign(FontData_js_1.FontData.charOptions(font, n), options[n]); } } catch (e_9_1) { e_9 = { error: e_9_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_9) throw e_9.error; } } return font; var e_9, _c; } exports.AddCSS = AddCSS; /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); var __values = this && this.__values || function (o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; }; var __read = this && this.__read || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; Object.defineProperty(exports, "__esModule", { value: true }); var LENGTHS = __webpack_require__(22); var Wrapper_js_1 = __webpack_require__(249); var BBox_js_1 = __webpack_require__(75); exports.FONTSIZE = { '70.7%': 's', '70%': 's', '50%': 'ss', '60%': 'Tn', '85%': 'sm', '120%': 'lg', '144%': 'Lg', '173%': 'LG', '207%': 'hg', '249%': 'HG' }; exports.SPACE = (_a = {}, _a[LENGTHS.em(2 / 18)] = '1', _a[LENGTHS.em(3 / 18)] = '2', _a[LENGTHS.em(4 / 18)] = '3', _a[LENGTHS.em(5 / 18)] = '4', _a[LENGTHS.em(6 / 18)] = '5', _a); var CHTMLWrapper = function (_super) { __extends(CHTMLWrapper, _super); function CHTMLWrapper() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.chtml = null; return _this; } CHTMLWrapper.prototype.toCHTML = function (parent) { var chtml = this.standardCHTMLnode(parent); try { for (var _a = __values(this.childNodes), _b = _a.next(); !_b.done; _b = _a.next()) { var child = _b.value; child.toCHTML(chtml); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_1) throw e_1.error; } } var e_1, _c; }; CHTMLWrapper.prototype.standardCHTMLnode = function (parent) { this.markUsed(); var chtml = this.createCHTMLnode(parent); this.handleStyles(); this.handleVariant(); this.handleScale(); this.handleColor(); this.handleSpace(); this.handleAttributes(); this.handlePWidth(); return chtml; }; CHTMLWrapper.prototype.markUsed = function () { this.constructor.used = true; }; CHTMLWrapper.prototype.createCHTMLnode = function (parent) { var href = this.node.attributes.get('href'); if (href) { parent = this.adaptor.append(parent, this.html('a', { href: href })); } this.chtml = this.adaptor.append(parent, this.html('mjx-' + this.node.kind)); return this.chtml; }; CHTMLWrapper.prototype.handleStyles = function () { if (!this.styles) return; var styles = this.styles.cssText; if (styles) { this.adaptor.setAttribute(this.chtml, 'style', styles); var family = this.styles.get('font-family'); if (family) { this.adaptor.setStyle(this.chtml, 'font-family', 'MJXZERO, ' + family); } } }; CHTMLWrapper.prototype.handleVariant = function () { if (this.node.isToken && this.variant !== '-explicitFont') { this.adaptor.setAttribute(this.chtml, 'class', (this.font.getVariant(this.variant) || this.font.getVariant('normal')).classes); } }; CHTMLWrapper.prototype.handleScale = function () { this.setScale(this.chtml, this.bbox.rscale); }; CHTMLWrapper.prototype.setScale = function (chtml, rscale) { var scale = Math.abs(rscale - 1) < .001 ? 1 : rscale; if (chtml && scale !== 1) { var size = this.percent(scale); if (exports.FONTSIZE[size]) { this.adaptor.setAttribute(chtml, 'size', exports.FONTSIZE[size]); } else { this.adaptor.setStyle(chtml, 'fontSize', size); } } return chtml; }; CHTMLWrapper.prototype.handleSpace = function () { try { for (var _a = __values([[this.bbox.L, 'space', 'marginLeft'], [this.bbox.R, 'rspace', 'marginRight']]), _b = _a.next(); !_b.done; _b = _a.next()) { var data = _b.value; var _c = __read(data, 3), dimen = _c[0], name_1 = _c[1], margin = _c[2]; if (dimen) { var space = this.em(dimen); if (exports.SPACE[space]) { this.adaptor.setAttribute(this.chtml, name_1, exports.SPACE[space]); } else { this.adaptor.setStyle(this.chtml, margin, space); } } } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_b && !_b.done && (_d = _a.return)) _d.call(_a); } finally { if (e_2) throw e_2.error; } } var e_2, _d; }; CHTMLWrapper.prototype.handleColor = function () { var attributes = this.node.attributes; var mathcolor = attributes.getExplicit('mathcolor'); var color = attributes.getExplicit('color'); var mathbackground = attributes.getExplicit('mathbackground'); var background = attributes.getExplicit('background'); if (mathcolor || color) { this.adaptor.setStyle(this.chtml, 'color', mathcolor || color); } if (mathbackground || background) { this.adaptor.setStyle(this.chtml, 'backgroundColor', mathbackground || background); } }; CHTMLWrapper.prototype.handleAttributes = function () { var attributes = this.node.attributes; var defaults = attributes.getAllDefaults(); var skip = CHTMLWrapper.skipAttributes; try { for (var _a = __values(attributes.getExplicitNames()), _b = _a.next(); !_b.done; _b = _a.next()) { var name_2 = _b.value; if (skip[name_2] === false || !(name_2 in defaults) && !skip[name_2] && !this.adaptor.hasAttribute(this.chtml, name_2)) { this.adaptor.setAttribute(this.chtml, name_2, attributes.getExplicit(name_2)); } } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_3) throw e_3.error; } } if (attributes.get('class')) { this.adaptor.addClass(this.chtml, attributes.get('class')); } var e_3, _c; }; CHTMLWrapper.prototype.handlePWidth = function () { if (this.bbox.pwidth) { if (this.bbox.pwidth === BBox_js_1.BBox.fullWidth) { this.adaptor.setAttribute(this.chtml, 'width', 'full'); } else { this.adaptor.setStyle(this.chtml, 'width', this.bbox.pwidth); } } }; CHTMLWrapper.prototype.setIndent = function (chtml, align, shift) { var adaptor = this.adaptor; if (align === 'center' || align === 'left') { var L = this.getBBox().L; adaptor.setStyle(chtml, 'margin-left', this.em(shift + L)); } if (align === 'center' || align === 'right') { var R = this.getBBox().R; adaptor.setStyle(chtml, 'margin-right', this.em(-shift + R)); } }; CHTMLWrapper.prototype.drawBBox = function () { var _a = this.getBBox(), w = _a.w, h = _a.h, d = _a.d, R = _a.R; var box = this.html('mjx-box', { style: { opacity: .25, 'margin-left': this.em(-w - R) } }, [this.html('mjx-box', { style: { height: this.em(h), width: this.em(w), 'background-color': 'red' } }), this.html('mjx-box', { style: { height: this.em(d), width: this.em(w), 'margin-left': this.em(-w), 'vertical-align': this.em(-d), 'background-color': 'green' } })]); var node = this.chtml || this.parent.chtml; var size = this.adaptor.getAttribute(node, 'size'); if (size) { this.adaptor.setAttribute(box, 'size', size); } var fontsize = this.adaptor.getStyle(node, 'fontSize'); if (fontsize) { this.adaptor.setStyle(box, 'fontSize', fontsize); } this.adaptor.append(this.adaptor.parent(node), box); this.adaptor.setStyle(node, 'backgroundColor', '#FFEE00'); }; CHTMLWrapper.prototype.html = function (type, def, content) { if (def === void 0) { def = {}; } if (content === void 0) { content = []; } return this.jax.html(type, def, content); }; CHTMLWrapper.prototype.text = function (text) { return this.jax.text(text); }; CHTMLWrapper.prototype.createMo = function (text) { return _super.prototype.createMo.call(this, text); }; CHTMLWrapper.prototype.coreMO = function () { return _super.prototype.coreMO.call(this); }; CHTMLWrapper.prototype.char = function (n) { return this.font.charSelector(n).substr(1); }; return CHTMLWrapper; }(Wrapper_js_1.CommonWrapper); CHTMLWrapper.kind = 'unknown'; CHTMLWrapper.autoStyle = true; CHTMLWrapper.used = false; exports.CHTMLWrapper = CHTMLWrapper; var _a; /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __read = this && this.__read || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __values = this && this.__values || function (o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; }; Object.defineProperty(exports, "__esModule", { value: true }); var ParseMethods_js_1 = __webpack_require__(28); var MapHandler_js_1 = __webpack_require__(17); var Options_js_1 = __webpack_require__(10); var sm = __webpack_require__(5); var MapHandler_js_2 = __webpack_require__(17); var FunctionList_js_1 = __webpack_require__(44); var Configuration = function () { function Configuration(name, handler, fallback, items, tags, options, nodes, preprocessors, postprocessors, _a, _b) { if (handler === void 0) { handler = {}; } if (fallback === void 0) { fallback = {}; } if (items === void 0) { items = {}; } if (tags === void 0) { tags = {}; } if (options === void 0) { options = {}; } if (nodes === void 0) { nodes = {}; } if (preprocessors === void 0) { preprocessors = []; } if (postprocessors === void 0) { postprocessors = []; } var _c = __read(_a, 2), init = _c[0], priority = _c[1]; var _d = __read(_b, 2), config = _d[0], configPriority = _d[1]; this.name = name; this.handler = handler; this.fallback = fallback; this.items = items; this.tags = tags; this.options = options; this.nodes = nodes; this.preprocessors = preprocessors; this.postprocessors = postprocessors; this.initMethod = new FunctionList_js_1.FunctionList(); this.configMethod = new FunctionList_js_1.FunctionList(); if (init) { this.initMethod.add(init, priority || 0); } if (config) { this.configMethod.add(config, configPriority || priority || 0); } this.handler = Object.assign({ character: [], delimiter: [], macro: [], environment: [] }, handler); ConfigurationHandler.set(name, this); } Configuration.create = function (name, config) { if (config === void 0) { config = {}; } return new Configuration(name, config.handler || {}, config.fallback || {}, config.items || {}, config.tags || {}, config.options || {}, config.nodes || {}, config.preprocessors || [], config.postprocessors || [], [config.init, config.priority], [config.config, config.configPriority]); }; Configuration.empty = function () { return Configuration.create('empty'); }; ; Configuration.extension = function () { new sm.MacroMap(MapHandler_js_1.ExtensionMaps.NEW_MACRO, {}, {}); new sm.DelimiterMap(MapHandler_js_1.ExtensionMaps.NEW_DELIMITER, ParseMethods_js_1.default.delimiter, {}); new sm.CommandMap(MapHandler_js_1.ExtensionMaps.NEW_COMMAND, {}, {}); new sm.EnvironmentMap(MapHandler_js_1.ExtensionMaps.NEW_ENVIRONMENT, ParseMethods_js_1.default.environment, {}, {}); return Configuration.create('extension', { handler: { character: [], delimiter: [MapHandler_js_1.ExtensionMaps.NEW_DELIMITER], macro: [MapHandler_js_1.ExtensionMaps.NEW_DELIMITER, MapHandler_js_1.ExtensionMaps.NEW_COMMAND, MapHandler_js_1.ExtensionMaps.NEW_MACRO], environment: [MapHandler_js_1.ExtensionMaps.NEW_ENVIRONMENT] } }); }; ; Configuration.prototype.init = function (configuration) { this.initMethod.execute(configuration); }; Configuration.prototype.config = function (configuration, jax) { this.configMethod.execute(configuration, jax); try { for (var _a = __values(this.preprocessors), _b = _a.next(); !_b.done; _b = _a.next()) { var pre = _b.value; typeof pre === 'function' ? jax.preFilters.add(pre) : jax.preFilters.add(pre[0], pre[1]); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_1) throw e_1.error; } } try { for (var _d = __values(this.postprocessors), _e = _d.next(); !_e.done; _e = _d.next()) { var post = _e.value; typeof post === 'function' ? jax.postFilters.add(post) : jax.postFilters.add(post[0], post[1]); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_e && !_e.done && (_f = _d.return)) _f.call(_d); } finally { if (e_2) throw e_2.error; } } var e_1, _c, e_2, _f; }; Configuration.prototype.append = function (config) { var handlers = Object.keys(config.handler); try { for (var handlers_1 = __values(handlers), handlers_1_1 = handlers_1.next(); !handlers_1_1.done; handlers_1_1 = handlers_1.next()) { var key = handlers_1_1.value; try { for (var _a = __values(config.handler[key]), _b = _a.next(); !_b.done; _b = _a.next()) { var map = _b.value; this.handler[key].unshift(map); } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_3) throw e_3.error; } } } } catch (e_4_1) { e_4 = { error: e_4_1 }; } finally { try { if (handlers_1_1 && !handlers_1_1.done && (_d = handlers_1.return)) _d.call(handlers_1); } finally { if (e_4) throw e_4.error; } } Object.assign(this.fallback, config.fallback); Object.assign(this.items, config.items); Object.assign(this.tags, config.tags); Options_js_1.defaultOptions(this.options, config.options); Object.assign(this.nodes, config.nodes); try { for (var _e = __values(config.preprocessors), _f = _e.next(); !_f.done; _f = _e.next()) { var pre = _f.value; this.preprocessors.push(pre); } } catch (e_5_1) { e_5 = { error: e_5_1 }; } finally { try { if (_f && !_f.done && (_g = _e.return)) _g.call(_e); } finally { if (e_5) throw e_5.error; } } ; try { for (var _h = __values(config.postprocessors), _j = _h.next(); !_j.done; _j = _h.next()) { var post = _j.value; this.postprocessors.push(post); } } catch (e_6_1) { e_6 = { error: e_6_1 }; } finally { try { if (_j && !_j.done && (_k = _h.return)) _k.call(_h); } finally { if (e_6) throw e_6.error; } } ; try { for (var _l = __values(config.initMethod), _m = _l.next(); !_m.done; _m = _l.next()) { var init = _m.value; this.initMethod.add(init.item, init.priority); } } catch (e_7_1) { e_7 = { error: e_7_1 }; } finally { try { if (_m && !_m.done && (_o = _l.return)) _o.call(_l); } finally { if (e_7) throw e_7.error; } } ; try { for (var _p = __values(config.configMethod), _q = _p.next(); !_q.done; _q = _p.next()) { var init = _q.value; this.configMethod.add(init.item, init.priority); } } catch (e_8_1) { e_8 = { error: e_8_1 }; } finally { try { if (_q && !_q.done && (_r = _p.return)) _r.call(_p); } finally { if (e_8) throw e_8.error; } } ; var e_4, _d, e_3, _c, e_5, _g, e_6, _k, e_7, _o, e_8, _r; }; Configuration.prototype.register = function (config, jax, options) { if (options === void 0) { options = {}; } this.append(config); config.init(this); var parser = jax.parseOptions; parser.handlers = new MapHandler_js_2.SubHandlers(this); parser.nodeFactory.setCreators(config.nodes); try { for (var _a = __values(Object.keys(config.items)), _b = _a.next(); !_b.done; _b = _a.next()) { var kind = _b.value; parser.itemFactory.setNodeClass(kind, config.items[kind]); } } catch (e_9_1) { e_9 = { error: e_9_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_9) throw e_9.error; } } Options_js_1.defaultOptions(parser.options, config.options); Options_js_1.userOptions(parser.options, options); config.config(this, jax); try { for (var _d = __values(config.preprocessors), _e = _d.next(); !_e.done; _e = _d.next()) { var pre = _e.value; Array.isArray(pre) ? jax.preFilters.add(pre[0], pre[1]) : jax.preFilters.add(pre); } } catch (e_10_1) { e_10 = { error: e_10_1 }; } finally { try { if (_e && !_e.done && (_f = _d.return)) _f.call(_d); } finally { if (e_10) throw e_10.error; } } try { for (var _g = __values(config.postprocessors), _h = _g.next(); !_h.done; _h = _g.next()) { var post = _h.value; Array.isArray(post) ? jax.postFilters.add(post[0], post[1]) : jax.postFilters.add(post); } } catch (e_11_1) { e_11 = { error: e_11_1 }; } finally { try { if (_h && !_h.done && (_j = _g.return)) _j.call(_g); } finally { if (e_11) throw e_11.error; } } var e_9, _c, e_10, _f, e_11, _j; }; return Configuration; }(); exports.Configuration = Configuration; ; var ConfigurationHandler; (function (ConfigurationHandler) { var maps = new Map(); ConfigurationHandler.set = function (name, map) { maps.set(name, map); }; ConfigurationHandler.get = function (name) { return maps.get(name); }; ConfigurationHandler.keys = function () { return maps.keys(); }; })(ConfigurationHandler = exports.ConfigurationHandler || (exports.ConfigurationHandler = {})); /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); var __read = this && this.__read || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __values = this && this.__values || function (o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; }; var __spread = this && this.__spread || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; }; Object.defineProperty(exports, "__esModule", { value: true }); var Symbol_js_1 = __webpack_require__(36); var MapHandler_js_1 = __webpack_require__(17); var AbstractSymbolMap = function () { function AbstractSymbolMap(_name, _parser) { this._name = _name; this._parser = _parser; MapHandler_js_1.MapHandler.register(this); } ; Object.defineProperty(AbstractSymbolMap.prototype, "name", { get: function () { return this._name; }, enumerable: true, configurable: true }); AbstractSymbolMap.prototype.parserFor = function (symbol) { return this.contains(symbol) ? this.parser : null; }; AbstractSymbolMap.prototype.parse = function (_a) { var _b = __read(_a, 2), env = _b[0], symbol = _b[1]; var parser = this.parserFor(symbol); var mapped = this.lookup(symbol); return parser && mapped ? parser(env, mapped) || true : null; }; Object.defineProperty(AbstractSymbolMap.prototype, "parser", { get: function () { return this._parser; }, set: function (parser) { this._parser = parser; }, enumerable: true, configurable: true }); return AbstractSymbolMap; }(); exports.AbstractSymbolMap = AbstractSymbolMap; var RegExpMap = function (_super) { __extends(RegExpMap, _super); function RegExpMap(name, parser, _regExp) { var _this = _super.call(this, name, parser) || this; _this._regExp = _regExp; return _this; } ; RegExpMap.prototype.contains = function (symbol) { return this._regExp.test(symbol); }; RegExpMap.prototype.lookup = function (symbol) { return this.contains(symbol) ? symbol : null; }; return RegExpMap; }(AbstractSymbolMap); exports.RegExpMap = RegExpMap; var AbstractParseMap = function (_super) { __extends(AbstractParseMap, _super); function AbstractParseMap() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.map = new Map(); return _this; } AbstractParseMap.prototype.lookup = function (symbol) { return this.map.get(symbol); }; AbstractParseMap.prototype.contains = function (symbol) { return this.map.has(symbol); }; AbstractParseMap.prototype.add = function (symbol, object) { this.map.set(symbol, object); }; return AbstractParseMap; }(AbstractSymbolMap); exports.AbstractParseMap = AbstractParseMap; var CharacterMap = function (_super) { __extends(CharacterMap, _super); function CharacterMap(name, parser, json) { var _this = _super.call(this, name, parser) || this; try { for (var _a = __values(Object.keys(json)), _b = _a.next(); !_b.done; _b = _a.next()) { var key = _b.value; var value = json[key]; var _c = __read(typeof value === 'string' ? [value, null] : value, 2), char = _c[0], attrs = _c[1]; var character = new Symbol_js_1.Symbol(key, char, attrs); _this.add(key, character); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_b && !_b.done && (_d = _a.return)) _d.call(_a); } finally { if (e_1) throw e_1.error; } } return _this; var e_1, _d; } ; return CharacterMap; }(AbstractParseMap); exports.CharacterMap = CharacterMap; var DelimiterMap = function (_super) { __extends(DelimiterMap, _super); function DelimiterMap() { return _super !== null && _super.apply(this, arguments) || this; } DelimiterMap.prototype.parse = function (_a) { var _b = __read(_a, 2), env = _b[0], symbol = _b[1]; return _super.prototype.parse.call(this, [env, '\\' + symbol]); }; return DelimiterMap; }(CharacterMap); exports.DelimiterMap = DelimiterMap; var MacroMap = function (_super) { __extends(MacroMap, _super); function MacroMap(name, json, functionMap) { var _this = _super.call(this, name, null) || this; try { for (var _a = __values(Object.keys(json)), _b = _a.next(); !_b.done; _b = _a.next()) { var key = _b.value; var value = json[key]; var _c = __read(typeof value === 'string' ? [value] : value), func = _c[0], attrs = _c.slice(1); var character = new Symbol_js_1.Macro(key, functionMap[func], attrs); _this.add(key, character); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_b && !_b.done && (_d = _a.return)) _d.call(_a); } finally { if (e_2) throw e_2.error; } } return _this; var e_2, _d; } ; MacroMap.prototype.parserFor = function (symbol) { var macro = this.lookup(symbol); return macro ? macro.func : null; }; MacroMap.prototype.parse = function (_a) { var _b = __read(_a, 2), env = _b[0], symbol = _b[1]; var macro = this.lookup(symbol); var parser = this.parserFor(symbol); if (!macro || !parser) { return null; } return parser.apply(void 0, __spread([env, macro.symbol], macro.args)) || true; }; return MacroMap; }(AbstractParseMap); exports.MacroMap = MacroMap; var CommandMap = function (_super) { __extends(CommandMap, _super); function CommandMap() { return _super !== null && _super.apply(this, arguments) || this; } CommandMap.prototype.parse = function (_a) { var _b = __read(_a, 2), env = _b[0], symbol = _b[1]; var macro = this.lookup(symbol); var parser = this.parserFor(symbol); if (!macro || !parser) { return null; } var args = ['\\' + macro.symbol].concat(macro.args); if (!parser) { return null; } var saveCommand = env.currentCS; env.currentCS = '\\' + symbol; var result = parser.apply(void 0, __spread([env, '\\' + macro.symbol], macro.args)); env.currentCS = saveCommand; return result || true; }; return CommandMap; }(MacroMap); exports.CommandMap = CommandMap; var EnvironmentMap = function (_super) { __extends(EnvironmentMap, _super); function EnvironmentMap(name, parser, json, functionMap) { var _this = _super.call(this, name, json, functionMap) || this; _this.parser = parser; return _this; } ; EnvironmentMap.prototype.parse = function (_a) { var _b = __read(_a, 2), env = _b[0], symbol = _b[1]; var macro = this.lookup(symbol); var envParser = this.parserFor(symbol); if (!macro || !envParser) { return null; } this.parser(env, macro.symbol, envParser, macro.args); return true; }; return EnvironmentMap; }(MacroMap); exports.EnvironmentMap = EnvironmentMap; /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var TexError = function () { function TexError(id, message) { var rest = []; for (var _i = 2; _i < arguments.length; _i++) { rest[_i - 2] = arguments[_i]; } this.id = id; this.message = TexError.processString(message, rest); } TexError.processString = function (str, args) { var parts = str.split(TexError.pattern); for (var i = 1, m = parts.length; i < m; i += 2) { var c = parts[i].charAt(0); if (c >= '0' && c <= '9') { parts[i] = args[parseInt(parts[i], 10) - 1]; if (typeof parts[i] === 'number') { parts[i] = parts[i].toString(); } } else if (c === '{') { c = parts[i].substr(1); if (c >= '0' && c <= '9') { parts[i] = args[parseInt(parts[i].substr(1, parts[i].length - 2), 10) - 1]; if (typeof parts[i] === 'number') { parts[i] = parts[i].toString(); } } else { var match = parts[i].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/); if (match) { parts[i] = '%' + parts[i]; } } } if (parts[i] == null) { parts[i] = '???'; } } return parts.join(''); }; return TexError; }(); TexError.pattern = /%(\d+|\{\d+\}|\{[a-z]+:\%\d+(?:\|(?:%\{\d+\}|%.|[^\}])*)+\}|.)/g; exports.default = TexError; /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var YAMLException = __webpack_require__(24); var TYPE_CONSTRUCTOR_OPTIONS = ['kind', 'resolve', 'construct', 'instanceOf', 'predicate', 'represent', 'defaultStyle', 'styleAliases']; var YAML_NODE_KINDS = ['scalar', 'sequence', 'mapping']; function compileStyleAliases(map) { var result = {}; if (map !== null) { Object.keys(map).forEach(function (style) { map[style].forEach(function (alias) { result[String(alias)] = style; }); }); } return result; } function Type(tag, options) { options = options || {}; Object.keys(options).forEach(function (name) { if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); } }); // TODO: Add tag format check. this.tag = tag; this.kind = options['kind'] || null; this.resolve = options['resolve'] || function () { return true; }; this.construct = options['construct'] || function (data) { return data; }; this.instanceOf = options['instanceOf'] || null; this.predicate = options['predicate'] || null; this.represent = options['represent'] || null; this.defaultStyle = options['defaultStyle'] || null; this.styleAliases = compileStyleAliases(options['styleAliases'] || null); if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); } } module.exports = Type; /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __values = this && this.__values || function (o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; }; var __read = this && this.__read || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread = this && this.__spread || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; }; Object.defineProperty(exports, "__esModule", { value: true }); var MmlNode_js_1 = __webpack_require__(0); var mo_js_1 = __webpack_require__(34); var NodeUtil; (function (NodeUtil) { var attrs = new Map([['autoOP', true], ['fnOP', true], ['movesupsub', true], ['subsupOK', true], ['texprimestyle', true], ['useHeight', true], ['variantForm', true], ['withDelims', true], ['open', true], ['close', true]]); var methodOut = false; function createEntity(code) { return String.fromCharCode(parseInt(code, 16)); } NodeUtil.createEntity = createEntity; ; function getChildren(node) { return node.childNodes; } NodeUtil.getChildren = getChildren; ; function getText(node) { return node.getText(); } NodeUtil.getText = getText; ; function appendChildren(node, children) { try { for (var children_1 = __values(children), children_1_1 = children_1.next(); !children_1_1.done; children_1_1 = children_1.next()) { var child = children_1_1.value; node.appendChild(child); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (children_1_1 && !children_1_1.done && (_a = children_1.return)) _a.call(children_1); } finally { if (e_1) throw e_1.error; } } var e_1, _a; } NodeUtil.appendChildren = appendChildren; ; function setAttribute(node, attribute, value) { node.attributes.set(attribute, value); } NodeUtil.setAttribute = setAttribute; ; function setProperty(node, property, value) { node.setProperty(property, value); } NodeUtil.setProperty = setProperty; ; function setProperties(node, properties) { try { for (var _a = __values(Object.keys(properties)), _b = _a.next(); !_b.done; _b = _a.next()) { var name_1 = _b.value; var value = properties[name_1]; if (name_1 === 'texClass') { node.texClass = value; } else if (name_1 === 'movablelimits') { node.setProperty('movablelimits', value); if (node.isKind('mo') || node.isKind('mstyle')) { node.attributes.set('movablelimits', value); } } else if (name_1 === 'inferred') {} else if (attrs.has(name_1)) { node.setProperty(name_1, value); } else { node.attributes.set(name_1, value); } } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_2) throw e_2.error; } } var e_2, _c; } NodeUtil.setProperties = setProperties; ; function getProperty(node, property) { return node.getProperty(property); } NodeUtil.getProperty = getProperty; ; function getAttribute(node, attr) { return node.attributes.get(attr); } NodeUtil.getAttribute = getAttribute; function removeProperties(node) { var properties = []; for (var _i = 1; _i < arguments.length; _i++) { properties[_i - 1] = arguments[_i]; } node.removeProperty.apply(node, __spread(properties)); } NodeUtil.removeProperties = removeProperties; function getChildAt(node, position) { return node.childNodes[position]; } NodeUtil.getChildAt = getChildAt; ; function setChild(node, position, child) { var children = node.childNodes; children[position] = child; if (child) { child.parent = node; } } NodeUtil.setChild = setChild; ; function copyChildren(oldNode, newNode) { var children = oldNode.childNodes; for (var i = 0; i < children.length; i++) { setChild(newNode, i, children[i]); } } NodeUtil.copyChildren = copyChildren; ; function copyAttributes(oldNode, newNode) { newNode.attributes = oldNode.attributes; setProperties(newNode, oldNode.getAllProperties()); } NodeUtil.copyAttributes = copyAttributes; ; function isType(node, kind) { return node.isKind(kind); } NodeUtil.isType = isType; ; function isEmbellished(node) { return node.isEmbellished; } NodeUtil.isEmbellished = isEmbellished; ; function getTexClass(node) { return node.texClass; } NodeUtil.getTexClass = getTexClass; ; function getCoreMO(node) { return node.coreMO(); } NodeUtil.getCoreMO = getCoreMO; ; function isNode(item) { return item instanceof MmlNode_js_1.AbstractMmlNode || item instanceof MmlNode_js_1.AbstractMmlEmptyNode; } NodeUtil.isNode = isNode; ; function isInferred(node) { return node.isInferred; } NodeUtil.isInferred = isInferred; ; function getForm(node) { if (!isType(node, 'mo')) { return null; } var mo = node; var forms = mo.getForms(); try { for (var forms_1 = __values(forms), forms_1_1 = forms_1.next(); !forms_1_1.done; forms_1_1 = forms_1.next()) { var form = forms_1_1.value; var symbol = mo_js_1.MmlMo.OPTABLE[form][mo.getText()]; if (symbol) { return symbol; } } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (forms_1_1 && !forms_1_1.done && (_a = forms_1.return)) _a.call(forms_1); } finally { if (e_3) throw e_3.error; } } return null; var e_3, _a; } NodeUtil.getForm = getForm; ; })(NodeUtil || (NodeUtil = {})); exports.default = NodeUtil; /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __read = this && this.__read || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; Object.defineProperty(exports, "__esModule", { value: true }); var MmlNode_js_1 = __webpack_require__(0); var NodeUtil_js_1 = __webpack_require__(8); var TexParser_js_1 = __webpack_require__(15); var TexError_js_1 = __webpack_require__(6); var Entities_js_1 = __webpack_require__(18); __webpack_require__(72); var ParseUtil; (function (ParseUtil) { var emPerInch = 7.2; var pxPerInch = 72; var UNIT_CASES = { 'em': function (m) { return m; }, 'ex': function (m) { return m * .43; }, 'pt': function (m) { return m / 10; }, 'pc': function (m) { return m * 1.2; }, 'px': function (m) { return m * emPerInch / pxPerInch; }, 'in': function (m) { return m * emPerInch; }, 'cm': function (m) { return m * emPerInch / 2.54; }, 'mm': function (m) { return m * emPerInch / 25.4; }, 'mu': function (m) { return m / 18; } }; var num = '([-+]?([.,]\\d+|\\d+([.,]\\d*)?))'; var unit = '(pt|em|ex|mu|px|mm|cm|in|pc)'; var dimenEnd = RegExp('^\\s*' + num + '\\s*' + unit + '\\s*$'); var dimenRest = RegExp('^\\s*' + num + '\\s*' + unit + ' ?'); function matchDimen(dim, rest) { if (rest === void 0) { rest = false; } var match = dim.match(rest ? dimenRest : dimenEnd); return match ? [match[1].replace(/,/, '.'), match[4], match[0].length] : [null, null, 0]; } ParseUtil.matchDimen = matchDimen; function dimen2em(dim) { var _a = __read(matchDimen(dim), 3), value = _a[0], unit = _a[1], _ = _a[2]; var m = parseFloat(value || '1'); var func = UNIT_CASES[unit]; return func ? func(m) : 0; } ParseUtil.dimen2em = dimen2em; function Em(m) { if (Math.abs(m) < .0006) { return '0em'; } return m.toFixed(3).replace(/\.?0+$/, '') + 'em'; } ParseUtil.Em = Em; function fenced(configuration, open, mml, close, big) { if (big === void 0) { big = ''; } var nf = configuration.nodeFactory; var mrow = nf.create('node', 'mrow', [], { open: open, close: close, texClass: MmlNode_js_1.TEXCLASS.INNER }); var mo; if (big) { mo = new TexParser_js_1.default('\\' + big + 'l' + open, configuration.parser.stack.env, configuration).mml(); } else { var openNode = nf.create('text', open); mo = nf.create('node', 'mo', [], { fence: true, stretchy: true, symmetric: true, texClass: MmlNode_js_1.TEXCLASS.OPEN }, openNode); } NodeUtil_js_1.default.appendChildren(mrow, [mo]); if (NodeUtil_js_1.default.isType(mml, 'mrow') && NodeUtil_js_1.default.isInferred(mml)) { NodeUtil_js_1.default.appendChildren(mrow, NodeUtil_js_1.default.getChildren(mml)); } else { NodeUtil_js_1.default.appendChildren(mrow, [mml]); } if (big) { mo = new TexParser_js_1.default('\\' + big + 'r' + close, configuration.parser.stack.env, configuration).mml(); } else { var closeNode = nf.create('text', close); mo = nf.create('node', 'mo', [], { fence: true, stretchy: true, symmetric: true, texClass: MmlNode_js_1.TEXCLASS.CLOSE }, closeNode); } NodeUtil_js_1.default.appendChildren(mrow, [mo]); return mrow; } ParseUtil.fenced = fenced; function fixedFence(configuration, open, mml, close) { var mrow = configuration.nodeFactory.create('node', 'mrow', [], { open: open, close: close, texClass: MmlNode_js_1.TEXCLASS.ORD }); if (open) { NodeUtil_js_1.default.appendChildren(mrow, [mathPalette(configuration, open, 'l')]); } if (NodeUtil_js_1.default.isType(mml, 'mrow')) { NodeUtil_js_1.default.appendChildren(mrow, NodeUtil_js_1.default.getChildren(mml)); } else { NodeUtil_js_1.default.appendChildren(mrow, [mml]); } if (close) { NodeUtil_js_1.default.appendChildren(mrow, [mathPalette(configuration, close, 'r')]); } return mrow; } ParseUtil.fixedFence = fixedFence; function mathPalette(configuration, fence, side) { if (fence === '{' || fence === '}') { fence = '\\' + fence; } var D = '{\\bigg' + side + ' ' + fence + '}'; var T = '{\\big' + side + ' ' + fence + '}'; return new TexParser_js_1.default('\\mathchoice' + D + T + T + T, {}, configuration).mml(); } ParseUtil.mathPalette = mathPalette; function fixInitialMO(configuration, nodes) { for (var i = 0, m = nodes.length; i < m; i++) { var child = nodes[i]; if (child && !NodeUtil_js_1.default.isType(child, 'mspace') && (!NodeUtil_js_1.default.isType(child, 'TeXAtom') || NodeUtil_js_1.default.getChildren(child)[0] && NodeUtil_js_1.default.getChildren(NodeUtil_js_1.default.getChildren(child)[0]).length)) { if (NodeUtil_js_1.default.isEmbellished(child)) { var mi = configuration.nodeFactory.create('node', 'mi'); nodes.unshift(mi); } break; } } } ParseUtil.fixInitialMO = fixInitialMO; function mi2mo(parser, mi) { var mo = parser.create('node', 'mo'); NodeUtil_js_1.default.copyChildren(mi, mo); NodeUtil_js_1.default.copyAttributes(mi, mo); NodeUtil_js_1.default.setProperties(mo, { lspace: '0', rspace: '0' }); NodeUtil_js_1.default.removeProperties(mo, 'movesupsub'); return mo; } ParseUtil.mi2mo = mi2mo; function internalMath(parser, text, level) { var def = parser.stack.env['font'] ? { mathvariant: parser.stack.env['font'] } : {}; var mml = [], i = 0, k = 0, c, node, match = '', braces = 0; if (text.match(/\\?[${}\\]|\\\(|\\(eq)?ref\s*\{/)) { while (i < text.length) { c = text.charAt(i++); if (c === '$') { if (match === '$' && braces === 0) { node = parser.create('node', 'TeXAtom', [new TexParser_js_1.default(text.slice(k, i - 1), {}, parser.configuration).mml()]); mml.push(node); match = ''; k = i; } else if (match === '') { if (k < i - 1) { mml.push(internalText(parser, text.slice(k, i - 1), def)); } match = '$'; k = i; } } else if (c === '{' && match !== '') { braces++; } else if (c === '}') { if (match === '}' && braces === 0) { var atom = new TexParser_js_1.default(text.slice(k, i), {}, parser.configuration).mml(); node = parser.create('node', 'TeXAtom', [atom], def); mml.push(node); match = ''; k = i; } else if (match !== '') { if (braces) { braces--; } } } else if (c === '\\') { if (match === '' && text.substr(i).match(/^(eq)?ref\s*\{/)) { var len = RegExp['$&'].length; if (k < i - 1) { mml.push(internalText(parser, text.slice(k, i - 1), def)); } match = '}'; k = i - 1; i += len; } else { c = text.charAt(i++); if (c === '(' && match === '') { if (k < i - 2) { mml.push(internalText(parser, text.slice(k, i - 2), def)); } match = ')'; k = i; } else if (c === ')' && match === ')' && braces === 0) { node = parser.create('node', 'TeXAtom', [new TexParser_js_1.default(text.slice(k, i - 2), {}, parser.configuration).mml()]); mml.push(node); match = ''; k = i; } else if (c.match(/[${}\\]/) && match === '') { i--; text = text.substr(0, i - 1) + text.substr(i); } } } } if (match !== '') { throw new TexError_js_1.default('MathNotTerminated', 'Math not terminated in text box'); } } if (k < text.length) { mml.push(internalText(parser, text.slice(k), def)); } if (level != null) { mml = [parser.create('node', 'mstyle', mml, { displaystyle: false, scriptlevel: level })]; } else if (mml.length > 1) { mml = [parser.create('node', 'mrow', mml)]; } return mml; } ParseUtil.internalMath = internalMath; function internalText(parser, text, def) { text = text.replace(/^\s+/, Entities_js_1.entities.nbsp).replace(/\s+$/, Entities_js_1.entities.nbsp); var textNode = parser.create('text', text); return parser.create('node', 'mtext', [], def, textNode); } function trimSpaces(text) { if (typeof text !== 'string') { return text; } var TEXT = text.trim(); if (TEXT.match(/\\$/) && text.match(/ $/)) { TEXT += ' '; } return TEXT; } ParseUtil.trimSpaces = trimSpaces; function setArrayAlign(array, align) { align = ParseUtil.trimSpaces(align || ''); if (align === 't') { array.arraydef.align = 'baseline 1'; } else if (align === 'b') { array.arraydef.align = 'baseline -1'; } else if (align === 'c') { array.arraydef.align = 'center'; } else if (align) { array.arraydef.align = align; } return array; } ParseUtil.setArrayAlign = setArrayAlign; function substituteArgs(parser, args, str) { var text = ''; var newstring = ''; var i = 0; while (i < str.length) { var c = str.charAt(i++); if (c === '\\') { text += c + str.charAt(i++); } else if (c === '#') { c = str.charAt(i++); if (c === '#') { text += c; } else { if (!c.match(/[1-9]/) || parseInt(c, 10) > args.length) { throw new TexError_js_1.default('IllegalMacroParam', 'Illegal macro parameter reference'); } newstring = addArgs(parser, addArgs(parser, newstring, text), args[parseInt(c, 10) - 1]); text = ''; } } else { text += c; } } return addArgs(parser, newstring, text); } ParseUtil.substituteArgs = substituteArgs; function addArgs(parser, s1, s2) { if (s2.match(/^[a-z]/i) && s1.match(/(^|[^\\])(\\\\)*\\[a-z]+$/i)) { s1 += ' '; } if (s1.length + s2.length > parser.configuration.options['maxBuffer']) { throw new TexError_js_1.default('MaxBufferSize', 'MathJax internal buffer size exceeded; is there a' + ' recursive macro call?'); } return s1 + s2; } ParseUtil.addArgs = addArgs; function checkEqnEnv(parser) { if (parser.stack.global.eqnenv) { throw new TexError_js_1.default('ErroneousNestingEq', 'Erroneous nesting of equation structures'); } parser.stack.global.eqnenv = true; } ParseUtil.checkEqnEnv = checkEqnEnv; ; function MmlFilterAttribute(parser, name, value) { return value; } ParseUtil.MmlFilterAttribute = MmlFilterAttribute; ; function getFontDef(parser) { var font = parser.stack.env['font']; return font ? { mathvariant: font } : {}; } ParseUtil.getFontDef = getFontDef; ; function splitPackageOptions(attrib, allowed) { if (allowed === void 0) { allowed = {}; } var def = {}; if (attrib !== '') { var attr = attrib.replace(/ /g, '').split(/,/); for (var i = 0, m = attr.length; i < m; i++) { var keyvalue = attr[i].split(/[:=]/); if (allowed[keyvalue[0]]) { var value = keyvalue[1]; def[keyvalue[0]] = value === 'true' ? true : value === 'false' ? false : value; } } } return def; } ParseUtil.splitPackageOptions = splitPackageOptions; })(ParseUtil || (ParseUtil = {})); exports.default = ParseUtil; /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __values = this && this.__values || function (o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; }; var __read = this && this.__read || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread = this && this.__spread || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; }; Object.defineProperty(exports, "__esModule", { value: true }); var OBJECT = {}.constructor; function isObject(obj) { return typeof obj === 'object' && obj !== null && obj.constructor === OBJECT; } exports.APPEND = '[+]'; exports.REMOVE = '[-]'; var Expandable = function () { function Expandable() {} return Expandable; }(); exports.Expandable = Expandable; ; function expandable(def) { return Object.assign(Object.create(Expandable.prototype), def); } exports.expandable = expandable; function makeArray(x) { return Array.isArray(x) ? x : [x]; } exports.makeArray = makeArray; function keys(def) { if (!def) { return []; } return Object.keys(def).concat(Object.getOwnPropertySymbols(def)); } exports.keys = keys; function copy(def) { var props = {}; try { for (var _a = __values(keys(def)), _b = _a.next(); !_b.done; _b = _a.next()) { var key = _b.value; var prop = Object.getOwnPropertyDescriptor(def, key); var value = prop.value; if (Array.isArray(value)) { prop.value = insert([], value, false); } else if (isObject(value)) { prop.value = copy(value); } if (prop.enumerable) { props[key] = prop; } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_1) throw e_1.error; } } return Object.defineProperties({}, props); var e_1, _c; } exports.copy = copy; function insert(dst, src, warn) { if (warn === void 0) { warn = true; } var _loop_1 = function (key) { if (warn && dst[key] === undefined && !(dst instanceof Expandable)) { if (typeof key === 'symbol') { key = key.toString(); } throw new Error('Invalid option "' + key + '" (no default value).'); } var sval = src[key], dval = dst[key]; if (isObject(sval) && dval !== null && (typeof dval === 'object' || typeof dval === 'function')) { var ids = keys(sval); if (Array.isArray(dval) && (ids.length === 1 && (ids[0] === exports.APPEND || ids[0] === exports.REMOVE) && Array.isArray(sval[ids[0]]) || ids.length === 2 && ids.sort().join(',') === exports.APPEND + ',' + exports.REMOVE && Array.isArray(sval[exports.APPEND]) && Array.isArray(sval[exports.REMOVE]))) { if (sval[exports.REMOVE]) { dval = dst[key] = dval.filter(function (x) { return sval[exports.REMOVE].indexOf(x) < 0; }); } if (sval[exports.APPEND]) { dst[key] = __spread(dval, sval[exports.APPEND]); } } else { insert(dval, sval, warn); } } else if (Array.isArray(sval)) { dst[key] = []; insert(dst[key], sval, false); } else if (isObject(sval)) { dst[key] = copy(sval); } else { dst[key] = sval; } }; try { for (var _a = __values(keys(src)), _b = _a.next(); !_b.done; _b = _a.next()) { var key = _b.value; _loop_1(key); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_2) throw e_2.error; } } return dst; var e_2, _c; } exports.insert = insert; function defaultOptions(options) { var defs = []; for (var _i = 1; _i < arguments.length; _i++) { defs[_i - 1] = arguments[_i]; } defs.forEach(function (def) { return insert(options, def, false); }); return options; } exports.defaultOptions = defaultOptions; function userOptions(options) { var defs = []; for (var _i = 1; _i < arguments.length; _i++) { defs[_i - 1] = arguments[_i]; } defs.forEach(function (def) { return insert(options, def, true); }); return options; } exports.userOptions = userOptions; function selectOptions(options) { var keys = []; for (var _i = 1; _i < arguments.length; _i++) { keys[_i - 1] = arguments[_i]; } var subset = {}; try { for (var keys_1 = __values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) { var key = keys_1_1.value; if (options.hasOwnProperty(key)) { subset[key] = options[key]; } } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1); } finally { if (e_3) throw e_3.error; } } return subset; var e_3, _a; } exports.selectOptions = selectOptions; function selectOptionsFromKeys(options, object) { return selectOptions.apply(void 0, __spread([options], Object.keys(object))); } exports.selectOptionsFromKeys = selectOptionsFromKeys; function separateOptions(options) { var objects = []; for (var _i = 1; _i < arguments.length; _i++) { objects[_i - 1] = arguments[_i]; } var results = []; try { for (var objects_1 = __values(objects), objects_1_1 = objects_1.next(); !objects_1_1.done; objects_1_1 = objects_1.next()) { var object = objects_1_1.value; var exists = {}, missing = {}; try { for (var _a = __values(Object.keys(options || {})), _b = _a.next(); !_b.done; _b = _a.next()) { var key = _b.value; (object[key] === undefined ? missing : exists)[key] = options[key]; } } catch (e_4_1) { e_4 = { error: e_4_1 }; } finally { try { if (_b && !_b.done && (_c = _a.return)) _c.call(_a); } finally { if (e_4) throw e_4.error; } } results.push(exists); options = missing; } } catch (e_5_1) { e_5 = { error: e_5_1 }; } finally { try { if (objects_1_1 && !objects_1_1.done && (_d = objects_1.return)) _d.call(objects_1); } finally { if (e_5) throw e_5.error; } } results.unshift(options); return results; var e_5, _d, e_4, _c; } exports.separateOptions = separateOptions; /***/ }), /* 11 */ /***/ (function(module, exports) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ module.exports = function(src) { function log(error) { (typeof console !== "undefined") && (console.error || console.log)("[Script Loader]", error); } // Check for IE =< 8 function isIE() { return typeof attachEvent !== "undefined" && typeof addEventListener === "undefined"; } try { if (typeof execScript !== "undefined" && isIE()) { execScript(src); } else if (typeof eval !== "undefined") { eval.call(null, src); } else { log("EvalError: No eval function available"); } } catch (error) { log(error); } } /***/ }), /* 12 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // css base code, injected by the css-loader module.exports = function (useSourceMap) { var list = []; // return the list of modules as css string list.toString = function toString() { return this.map(function (item) { var content = cssWithMappingToString(item, useSourceMap); if (item[2]) { return '@media ' + item[2] + '{' + content + '}'; } else { return content; } }).join(''); }; // import a list of modules into the list list.i = function (modules, mediaQuery) { if (typeof modules === 'string') { modules = [[null, modules, '']]; } var alreadyImportedModules = {}; for (var i = 0; i < this.length; i++) { var id = this[i][0]; if (id != null) { alreadyImportedModules[id] = true; } } for (i = 0; i < modules.length; i++) { var item = modules[i]; // skip already imported module // this implementation is not 100% perfect for weird media query combinations // when a module is imported multiple times with different media queries. // I hope this will never occur (Hey this way we have smaller bundles) if (item[0] == null || !alreadyImportedModules[item[0]]) { if (mediaQuery && !item[2]) { item[2] = mediaQuery; } else if (mediaQuery) { item[2] = '(' + item[2] + ') and (' + mediaQuery + ')'; } list.push(item); } } }; return list; }; function cssWithMappingToString(item, useSourceMap) { var content = item[1] || ''; var cssMapping = item[3]; if (!cssMapping) { return content; } if (useSourceMap && typeof btoa === 'function') { var sourceMapping = toComment(cssMapping); var sourceURLs = cssMapping.sources.map(function (source) { return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'; }); return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); } return [content].join('\n'); } // Adapted from convert-source-map (MIT) function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; } /***/ }), /* 13 */ /***/ (function(module, exports, __webpack_require__) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ var stylesInDom = {}; var memoize = function (fn) { var memo; return function () { if (typeof memo === "undefined") memo = fn.apply(this, arguments); return memo; }; }; var isOldIE = memoize(function () { // Test for IE <= 9 as proposed by Browserhacks // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 // Tests for existence of standard globals is to allow style-loader // to operate correctly into non-standard environments // @see https://github.com/webpack-contrib/style-loader/issues/177 return window && document && document.all && !window.atob; }); var getTarget = function (target, parent) { if (parent){ return parent.querySelector(target); } return document.querySelector(target); }; var getElement = (function (fn) { var memo = {}; return function(target, parent) { // If passing function in options, then use it for resolve "head" element. // Useful for Shadow Root style i.e // { // insertInto: function () { return document.querySelector("#foo").shadowRoot } // } if (typeof target === 'function') { return target(); } if (typeof memo[target] === "undefined") { var styleTarget = getTarget.call(this, target, parent); // Special case to return head of iframe instead of iframe itself if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { try { // This will throw an exception if access to iframe is blocked // due to cross-origin restrictions styleTarget = styleTarget.contentDocument.head; } catch(e) { styleTarget = null; } } memo[target] = styleTarget; } return memo[target] }; })(); var singleton = null; var singletonCounter = 0; var stylesInsertedAtTop = []; var fixUrls = __webpack_require__(407); module.exports = function(list, options) { if (typeof DEBUG !== "undefined" && DEBUG) { if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); } options = options || {}; options.attrs = typeof options.attrs === "object" ? options.attrs : {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of '); $('head').append(''); //$('head').append(''); transform_codeblocks_to_CodeMirror(); // NOTE: all within CODEBLOCKS have, at this point, been removed by conversion to CodeMirror components; only inline-type elements remain add_codeblock_snippet_support(); highlight_code(); // highlight elements, as needed (only those tagged with a language) }); } var css_class_button = 'button'; var css_class_codeblock = 'codeblock'; var css_class_tooltip = 'tooltipped'; var css_class_tooltip__below = 'tooltipped--s'; // tooltipped--s == position tooltip below function add_codeblock_snippet_support() { var _ME = 'add_codeblock_snippet_support()'; var css_class_snip_button = "".concat(css_class_button, "--snip"); // unique / identifying class name var css_class_snip_button$ = "".concat(css_class_snip_button, " ").concat(css_class_button); // unique / ID class must be leftmost in the string var css_class_snip_button_tooltip$ = "".concat(css_class_tooltip, " ").concat(css_class_tooltip__below); var clipboard_src = 'https:' + script_repo_CDN_base_url + 'master/assets/clippy.svg'; var clipboard_alt = 'Copy to clipboard'; var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; /* expected CSS */ $('head').append(''); var $codeblocks = $(".".concat(css_class_codeblock)); $codeblocks.each(function (index) { ///console.log( _ME + ': index = ' + index ); //let content = $('', { height:'100%', src: clipboard_src, alt: clipboard_alt} ); var content = 'Copy'; var $button = $('